fourth-spark 0.10.4 → 0.10.5

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.
@@ -0,0 +1,517 @@
1
+ var bv=Object.defineProperty;var xv=(e,t,a)=>t in e?bv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var un=(e,t,a)=>xv(e,typeof t!="symbol"?t+"":t,a);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function a(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(o){if(o.ep)return;o.ep=!0;const u=a(o);fetch(o.href,u)}})();function Fc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mm={exports:{}},Xl={};/**
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 ax;function Ev(){if(ax)return Xl;ax=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(s,o,u){var d=null;if(u!==void 0&&(d=""+u),o.key!==void 0&&(d=""+o.key),"key"in o){u={};for(var f in o)f!=="key"&&(u[f]=o[f])}else u=o;return o=u.ref,{$$typeof:e,type:s,key:d,ref:o!==void 0?o:null,props:u}}return Xl.Fragment=t,Xl.jsx=a,Xl.jsxs=a,Xl}var rx;function yv(){return rx||(rx=1,mm.exports=Ev()),mm.exports}var l=yv(),hm={exports:{}},Qe={};/**
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 sx;function Nv(){if(sx)return Qe;sx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function N(U){return U===null||typeof U!="object"?null:(U=y&&U[y]||U["@@iterator"],typeof U=="function"?U:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,w={};function A(U,ie,M){this.props=U,this.context=ie,this.refs=w,this.updater=M||v}A.prototype.isReactComponent={},A.prototype.setState=function(U,ie){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,ie,"setState")},A.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function R(){}R.prototype=A.prototype;function I(U,ie,M){this.props=U,this.context=ie,this.refs=w,this.updater=M||v}var Y=I.prototype=new R;Y.constructor=I,S(Y,A.prototype),Y.isPureReactComponent=!0;var B=Array.isArray;function C(){}var z={H:null,A:null,T:null,S:null},W=Object.prototype.hasOwnProperty;function Q(U,ie,M){var ye=M.ref;return{$$typeof:e,type:U,key:ie,ref:ye!==void 0?ye:null,props:M}}function j(U,ie){return Q(U.type,ie,U.props)}function ee(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function ue(U){var ie={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(M){return ie[M]})}var Z=/\/+/g;function q(U,ie){return typeof U=="object"&&U!==null&&U.key!=null?ue(""+U.key):ie.toString(36)}function F(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(C,C):(U.status="pending",U.then(function(ie){U.status==="pending"&&(U.status="fulfilled",U.value=ie)},function(ie){U.status==="pending"&&(U.status="rejected",U.reason=ie)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function D(U,ie,M,ye,re){var Ne=typeof U;(Ne==="undefined"||Ne==="boolean")&&(U=null);var Pe=!1;if(U===null)Pe=!0;else switch(Ne){case"bigint":case"string":case"number":Pe=!0;break;case"object":switch(U.$$typeof){case e:case t:Pe=!0;break;case b:return Pe=U._init,D(Pe(U._payload),ie,M,ye,re)}}if(Pe)return re=re(U),Pe=ye===""?"."+q(U,0):ye,B(re)?(M="",Pe!=null&&(M=Pe.replace(Z,"$&/")+"/"),D(re,ie,M,"",function(vt){return vt})):re!=null&&(ee(re)&&(re=j(re,M+(re.key==null||U&&U.key===re.key?"":(""+re.key).replace(Z,"$&/")+"/")+Pe)),ie.push(re)),1;Pe=0;var tt=ye===""?".":ye+":";if(B(U))for(var et=0;et<U.length;et++)ye=U[et],Ne=tt+q(ye,et),Pe+=D(ye,ie,M,Ne,re);else if(et=N(U),typeof et=="function")for(U=et.call(U),et=0;!(ye=U.next()).done;)ye=ye.value,Ne=tt+q(ye,et++),Pe+=D(ye,ie,M,Ne,re);else if(Ne==="object"){if(typeof U.then=="function")return D(F(U),ie,M,ye,re);throw ie=String(U),Error("Objects are not valid as a React child (found: "+(ie==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":ie)+"). If you meant to render a collection of children, use an array instead.")}return Pe}function P(U,ie,M){if(U==null)return U;var ye=[],re=0;return D(U,ye,"","",function(Ne){return ie.call(M,Ne,re++)}),ye}function ae(U){if(U._status===-1){var ie=U._result;ie=ie(),ie.then(function(M){(U._status===0||U._status===-1)&&(U._status=1,U._result=M)},function(M){(U._status===0||U._status===-1)&&(U._status=2,U._result=M)}),U._status===-1&&(U._status=0,U._result=ie)}if(U._status===1)return U._result.default;throw U._result}var K=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ie=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(ie))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},k={map:P,forEach:function(U,ie,M){P(U,function(){ie.apply(this,arguments)},M)},count:function(U){var ie=0;return P(U,function(){ie++}),ie},toArray:function(U){return P(U,function(ie){return ie})||[]},only:function(U){if(!ee(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return Qe.Activity=g,Qe.Children=k,Qe.Component=A,Qe.Fragment=a,Qe.Profiler=o,Qe.PureComponent=I,Qe.StrictMode=s,Qe.Suspense=m,Qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,Qe.__COMPILER_RUNTIME={__proto__:null,c:function(U){return z.H.useMemoCache(U)}},Qe.cache=function(U){return function(){return U.apply(null,arguments)}},Qe.cacheSignal=function(){return null},Qe.cloneElement=function(U,ie,M){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var ye=S({},U.props),re=U.key;if(ie!=null)for(Ne in ie.key!==void 0&&(re=""+ie.key),ie)!W.call(ie,Ne)||Ne==="key"||Ne==="__self"||Ne==="__source"||Ne==="ref"&&ie.ref===void 0||(ye[Ne]=ie[Ne]);var Ne=arguments.length-2;if(Ne===1)ye.children=M;else if(1<Ne){for(var Pe=Array(Ne),tt=0;tt<Ne;tt++)Pe[tt]=arguments[tt+2];ye.children=Pe}return Q(U.type,re,ye)},Qe.createContext=function(U){return U={$$typeof:d,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:u,_context:U},U},Qe.createElement=function(U,ie,M){var ye,re={},Ne=null;if(ie!=null)for(ye in ie.key!==void 0&&(Ne=""+ie.key),ie)W.call(ie,ye)&&ye!=="key"&&ye!=="__self"&&ye!=="__source"&&(re[ye]=ie[ye]);var Pe=arguments.length-2;if(Pe===1)re.children=M;else if(1<Pe){for(var tt=Array(Pe),et=0;et<Pe;et++)tt[et]=arguments[et+2];re.children=tt}if(U&&U.defaultProps)for(ye in Pe=U.defaultProps,Pe)re[ye]===void 0&&(re[ye]=Pe[ye]);return Q(U,Ne,re)},Qe.createRef=function(){return{current:null}},Qe.forwardRef=function(U){return{$$typeof:f,render:U}},Qe.isValidElement=ee,Qe.lazy=function(U){return{$$typeof:b,_payload:{_status:-1,_result:U},_init:ae}},Qe.memo=function(U,ie){return{$$typeof:h,type:U,compare:ie===void 0?null:ie}},Qe.startTransition=function(U){var ie=z.T,M={};z.T=M;try{var ye=U(),re=z.S;re!==null&&re(M,ye),typeof ye=="object"&&ye!==null&&typeof ye.then=="function"&&ye.then(C,K)}catch(Ne){K(Ne)}finally{ie!==null&&M.types!==null&&(ie.types=M.types),z.T=ie}},Qe.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},Qe.use=function(U){return z.H.use(U)},Qe.useActionState=function(U,ie,M){return z.H.useActionState(U,ie,M)},Qe.useCallback=function(U,ie){return z.H.useCallback(U,ie)},Qe.useContext=function(U){return z.H.useContext(U)},Qe.useDebugValue=function(){},Qe.useDeferredValue=function(U,ie){return z.H.useDeferredValue(U,ie)},Qe.useEffect=function(U,ie){return z.H.useEffect(U,ie)},Qe.useEffectEvent=function(U){return z.H.useEffectEvent(U)},Qe.useId=function(){return z.H.useId()},Qe.useImperativeHandle=function(U,ie,M){return z.H.useImperativeHandle(U,ie,M)},Qe.useInsertionEffect=function(U,ie){return z.H.useInsertionEffect(U,ie)},Qe.useLayoutEffect=function(U,ie){return z.H.useLayoutEffect(U,ie)},Qe.useMemo=function(U,ie){return z.H.useMemo(U,ie)},Qe.useOptimistic=function(U,ie){return z.H.useOptimistic(U,ie)},Qe.useReducer=function(U,ie,M){return z.H.useReducer(U,ie,M)},Qe.useRef=function(U){return z.H.useRef(U)},Qe.useState=function(U){return z.H.useState(U)},Qe.useSyncExternalStore=function(U,ie,M){return z.H.useSyncExternalStore(U,ie,M)},Qe.useTransition=function(){return z.H.useTransition()},Qe.version="19.2.8",Qe}var ix;function Bh(){return ix||(ix=1,hm.exports=Nv()),hm.exports}var _=Bh();const tc=Fc(_);var pm={exports:{}},Ql={},gm={exports:{}},bm={};/**
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 lx;function Tv(){return lx||(lx=1,(function(e){function t(D,P){var ae=D.length;D.push(P);e:for(;0<ae;){var K=ae-1>>>1,k=D[K];if(0<o(k,P))D[K]=P,D[ae]=k,ae=K;else break e}}function a(D){return D.length===0?null:D[0]}function s(D){if(D.length===0)return null;var P=D[0],ae=D.pop();if(ae!==P){D[0]=ae;e:for(var K=0,k=D.length,U=k>>>1;K<U;){var ie=2*(K+1)-1,M=D[ie],ye=ie+1,re=D[ye];if(0>o(M,ae))ye<k&&0>o(re,M)?(D[K]=re,D[ye]=ae,K=ye):(D[K]=M,D[ie]=ae,K=ie);else if(ye<k&&0>o(re,ae))D[K]=re,D[ye]=ae,K=ye;else break e}}return P}function o(D,P){var ae=D.sortIndex-P.sortIndex;return ae!==0?ae:D.id-P.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var m=[],h=[],b=1,g=null,y=3,N=!1,v=!1,S=!1,w=!1,A=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function Y(D){for(var P=a(h);P!==null;){if(P.callback===null)s(h);else if(P.startTime<=D)s(h),P.sortIndex=P.expirationTime,t(m,P);else break;P=a(h)}}function B(D){if(S=!1,Y(D),!v)if(a(m)!==null)v=!0,C||(C=!0,ue());else{var P=a(h);P!==null&&F(B,P.startTime-D)}}var C=!1,z=-1,W=5,Q=-1;function j(){return w?!0:!(e.unstable_now()-Q<W)}function ee(){if(w=!1,C){var D=e.unstable_now();Q=D;var P=!0;try{e:{v=!1,S&&(S=!1,R(z),z=-1),N=!0;var ae=y;try{t:{for(Y(D),g=a(m);g!==null&&!(g.expirationTime>D&&j());){var K=g.callback;if(typeof K=="function"){g.callback=null,y=g.priorityLevel;var k=K(g.expirationTime<=D);if(D=e.unstable_now(),typeof k=="function"){g.callback=k,Y(D),P=!0;break t}g===a(m)&&s(m),Y(D)}else s(m);g=a(m)}if(g!==null)P=!0;else{var U=a(h);U!==null&&F(B,U.startTime-D),P=!1}}break e}finally{g=null,y=ae,N=!1}P=void 0}}finally{P?ue():C=!1}}}var ue;if(typeof I=="function")ue=function(){I(ee)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,q=Z.port2;Z.port1.onmessage=ee,ue=function(){q.postMessage(null)}}else ue=function(){A(ee,0)};function F(D,P){z=A(function(){D(e.unstable_now())},P)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(D){switch(y){case 1:case 2:case 3:var P=3;break;default:P=y}var ae=y;y=P;try{return D()}finally{y=ae}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(D,P){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var ae=y;y=D;try{return P()}finally{y=ae}},e.unstable_scheduleCallback=function(D,P,ae){var K=e.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?K+ae:K):ae=K,D){case 1:var k=-1;break;case 2:k=250;break;case 5:k=1073741823;break;case 4:k=1e4;break;default:k=5e3}return k=ae+k,D={id:b++,callback:P,priorityLevel:D,startTime:ae,expirationTime:k,sortIndex:-1},ae>K?(D.sortIndex=ae,t(h,D),a(m)===null&&D===a(h)&&(S?(R(z),z=-1):S=!0,F(B,ae-K))):(D.sortIndex=k,t(m,D),v||N||(v=!0,C||(C=!0,ue()))),D},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(D){var P=y;return function(){var ae=y;y=P;try{return D.apply(this,arguments)}finally{y=ae}}}})(bm)),bm}var ox;function _v(){return ox||(ox=1,gm.exports=Tv()),gm.exports}var xm={exports:{}},Sn={};/**
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 ux;function vv(){if(ux)return Sn;ux=1;var e=Bh();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)h+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var s={d:{f:a,r:function(){throw Error(t(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(m,h,b){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:m,containerInfo:h,implementation:b}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Sn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Sn.createPortal=function(m,h){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return u(m,h,null,b)},Sn.flushSync=function(m){var h=d.T,b=s.p;try{if(d.T=null,s.p=2,m)return m()}finally{d.T=h,s.p=b,s.d.f()}},Sn.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,s.d.C(m,h))},Sn.prefetchDNS=function(m){typeof m=="string"&&s.d.D(m)},Sn.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var b=h.as,g=f(b,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,N=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;b==="style"?s.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:N}):b==="script"&&s.d.X(m,{crossOrigin:g,integrity:y,fetchPriority:N,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Sn.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var b=f(h.as,h.crossOrigin);s.d.M(m,{crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&s.d.M(m)},Sn.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var b=h.as,g=f(b,h.crossOrigin);s.d.L(m,b,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Sn.preloadModule=function(m,h){if(typeof m=="string")if(h){var b=f(h.as,h.crossOrigin);s.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else s.d.m(m)},Sn.requestFormReset=function(m){s.d.r(m)},Sn.unstable_batchedUpdates=function(m,h){return m(h)},Sn.useFormState=function(m,h,b){return d.H.useFormState(m,h,b)},Sn.useFormStatus=function(){return d.H.useHostTransitionStatus()},Sn.version="19.2.8",Sn}var cx;function Sv(){if(cx)return xm.exports;cx=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),xm.exports=vv(),xm.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 dx;function Av(){if(dx)return Ql;dx=1;var e=_v(),t=Bh(),a=Sv();function s(n){var r="https://react.dev/errors/"+n;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)r+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+n+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function u(n){var r=n,i=n;if(n.alternate)for(;r.return;)r=r.return;else{n=r;do r=n,(r.flags&4098)!==0&&(i=r.return),n=r.return;while(n)}return r.tag===3?i:null}function d(n){if(n.tag===13){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function f(n){if(n.tag===31){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function m(n){if(u(n)!==n)throw Error(s(188))}function h(n){var r=n.alternate;if(!r){if(r=u(n),r===null)throw Error(s(188));return r!==n?null:n}for(var i=n,c=r;;){var p=i.return;if(p===null)break;var x=p.alternate;if(x===null){if(c=p.return,c!==null){i=c;continue}break}if(p.child===x.child){for(x=p.child;x;){if(x===i)return m(p),n;if(x===c)return m(p),r;x=x.sibling}throw Error(s(188))}if(i.return!==c.return)i=p,c=x;else{for(var T=!1,O=p.child;O;){if(O===i){T=!0,i=p,c=x;break}if(O===c){T=!0,c=p,i=x;break}O=O.sibling}if(!T){for(O=x.child;O;){if(O===i){T=!0,i=x,c=p;break}if(O===c){T=!0,c=x,i=p;break}O=O.sibling}if(!T)throw Error(s(189))}}if(i.alternate!==c)throw Error(s(190))}if(i.tag!==3)throw Error(s(188));return i.stateNode.current===i?n:r}function b(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n;for(n=n.child;n!==null;){if(r=b(n),r!==null)return r;n=n.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),N=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),I=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),Q=Symbol.for("react.activity"),j=Symbol.for("react.memo_cache_sentinel"),ee=Symbol.iterator;function ue(n){return n===null||typeof n!="object"?null:(n=ee&&n[ee]||n["@@iterator"],typeof n=="function"?n:null)}var Z=Symbol.for("react.client.reference");function q(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===Z?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case S:return"Fragment";case A:return"Profiler";case w:return"StrictMode";case B:return"Suspense";case C:return"SuspenseList";case Q:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case v:return"Portal";case I:return n.displayName||"Context";case R:return(n._context.displayName||"Context")+".Consumer";case Y:var r=n.render;return n=n.displayName,n||(n=r.displayName||r.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case z:return r=n.displayName||null,r!==null?r:q(n.type)||"Memo";case W:r=n._payload,n=n._init;try{return q(n(r))}catch{}}return null}var F=Array.isArray,D=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},K=[],k=-1;function U(n){return{current:n}}function ie(n){0>k||(n.current=K[k],K[k]=null,k--)}function M(n,r){k++,K[k]=n.current,n.current=r}var ye=U(null),re=U(null),Ne=U(null),Pe=U(null);function tt(n,r){switch(M(Ne,r),M(re,n),M(ye,null),r.nodeType){case 9:case 11:n=(n=r.documentElement)&&(n=n.namespaceURI)?Ab(n):0;break;default:if(n=r.tagName,r=r.namespaceURI)r=Ab(r),n=wb(r,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}ie(ye),M(ye,n)}function et(){ie(ye),ie(re),ie(Ne)}function vt(n){n.memoizedState!==null&&M(Pe,n);var r=ye.current,i=wb(r,n.type);r!==i&&(M(re,n),M(ye,i))}function en(n){re.current===n&&(ie(ye),ie(re)),Pe.current===n&&(ie(Pe),Yl._currentValue=ae)}var Hn,aa;function xe(n){if(Hn===void 0)try{throw Error()}catch(i){var r=i.stack.trim().match(/\n( *(at )?)/);Hn=r&&r[1]||"",aa=-1<i.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Hn+n+aa}var xt=!1;function nt(n,r){if(!n||xt)return"";xt=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(r){var be=function(){throw Error()};if(Object.defineProperty(be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(be,[])}catch(de){var ce=de}Reflect.construct(n,[],be)}else{try{be.call()}catch(de){ce=de}n.call(be.prototype)}}else{try{throw Error()}catch(de){ce=de}(be=n())&&typeof be.catch=="function"&&be.catch(function(){})}}catch(de){if(de&&ce&&typeof de.stack=="string")return[de.stack,ce.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=c.DetermineComponentFrameRoot(),T=x[0],O=x[1];if(T&&O){var V=T.split(`
44
+ `),oe=O.split(`
45
+ `);for(p=c=0;c<V.length&&!V[c].includes("DetermineComponentFrameRoot");)c++;for(;p<oe.length&&!oe[p].includes("DetermineComponentFrameRoot");)p++;if(c===V.length||p===oe.length)for(c=V.length-1,p=oe.length-1;1<=c&&0<=p&&V[c]!==oe[p];)p--;for(;1<=c&&0<=p;c--,p--)if(V[c]!==oe[p]){if(c!==1||p!==1)do if(c--,p--,0>p||V[c]!==oe[p]){var he=`
46
+ `+V[c].replace(" at new "," at ");return n.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",n.displayName)),he}while(1<=c&&0<=p);break}}}finally{xt=!1,Error.prepareStackTrace=i}return(i=n?n.displayName||n.name:"")?xe(i):""}function Fn(n,r){switch(n.tag){case 26:case 27:case 5:return xe(n.type);case 16:return xe("Lazy");case 13:return n.child!==r&&r!==null?xe("Suspense Fallback"):xe("Suspense");case 19:return xe("SuspenseList");case 0:case 15:return nt(n.type,!1);case 11:return nt(n.type.render,!1);case 1:return nt(n.type,!0);case 31:return xe("Activity");default:return""}}function In(n){try{var r="",i=null;do r+=Fn(n,i),i=n,n=n.return;while(n);return r}catch(c){return`
47
+ Error generating stack: `+c.message+`
48
+ `+c.stack}}var ba=Object.prototype.hasOwnProperty,Ia=e.unstable_scheduleCallback,nr=e.unstable_cancelCallback,Ha=e.unstable_shouldYield,kr=e.unstable_requestPaint,St=e.unstable_now,ar=e.unstable_getCurrentPriorityLevel,me=e.unstable_ImmediatePriority,Se=e.unstable_UserBlockingPriority,Fe=e.unstable_NormalPriority,$=e.unstable_LowPriority,Re=e.unstable_IdlePriority,mt=e.log,dn=e.unstable_setDisableYieldValue,tn=null,Dt=null;function mn(n){if(typeof mt=="function"&&dn(n),Dt&&typeof Dt.setStrictMode=="function")try{Dt.setStrictMode(tn,n)}catch{}}var Et=Math.clz32?Math.clz32:Uo,Fa=Math.log,Mn=Math.LN2;function Uo(n){return n>>>=0,n===0?32:31-(Fa(n)/Mn|0)|0}var ps=256,Ws=262144,gs=4194304;function zn(n){var r=n&42;if(r!==0)return r;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function X(n,r,i){var c=n.pendingLanes;if(c===0)return 0;var p=0,x=n.suspendedLanes,T=n.pingedLanes;n=n.warmLanes;var O=c&134217727;return O!==0?(c=O&~x,c!==0?p=zn(c):(T&=O,T!==0?p=zn(T):i||(i=O&~n,i!==0&&(p=zn(i))))):(O=c&~x,O!==0?p=zn(O):T!==0?p=zn(T):i||(i=c&~n,i!==0&&(p=zn(i)))),p===0?0:r!==0&&r!==p&&(r&x)===0&&(x=p&-p,i=r&-r,x>=i||x===32&&(i&4194048)!==0)?r:p}function pe(n,r){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&r)===0}function Ce(n,r){switch(n){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ke(){var n=gs;return gs<<=1,(gs&62914560)===0&&(gs=4194304),n}function jt(n){for(var r=[],i=0;31>i;i++)r.push(n);return r}function Rt(n,r){n.pendingLanes|=r,r!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function De(n,r,i,c,p,x){var T=n.pendingLanes;n.pendingLanes=i,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=i,n.entangledLanes&=i,n.errorRecoveryDisabledLanes&=i,n.shellSuspendCounter=0;var O=n.entanglements,V=n.expirationTimes,oe=n.hiddenUpdates;for(i=T&~i;0<i;){var he=31-Et(i),be=1<<he;O[he]=0,V[he]=-1;var ce=oe[he];if(ce!==null)for(oe[he]=null,he=0;he<ce.length;he++){var de=ce[he];de!==null&&(de.lane&=-536870913)}i&=~be}c!==0&&Oe(n,c,0),x!==0&&p===0&&n.tag!==0&&(n.suspendedLanes|=x&~(T&~r))}function Oe(n,r,i){n.pendingLanes|=r,n.suspendedLanes&=~r;var c=31-Et(r);n.entangledLanes|=r,n.entanglements[c]=n.entanglements[c]|1073741824|i&261930}function Ye(n,r){var i=n.entangledLanes|=r;for(n=n.entanglements;i;){var c=31-Et(i),p=1<<c;p&r|n[c]&r&&(n[c]|=r),i&=~p}}function Vt(n,r){var i=r&-r;return i=(i&42)!==0?1:Ht(i),(i&(n.suspendedLanes|r))!==0?0:i}function Ht(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function rr(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Zs(){var n=P.p;return n!==0?n:(n=window.event,n===void 0?32:Qb(n.type))}function Js(n,r){var i=P.p;try{return P.p=n,r()}finally{P.p=i}}var za=Math.random().toString(36).slice(2),Xt="__reactFiber$"+za,_n="__reactProps$"+za,Rr="__reactContainer$"+za,nl="__reactEvents$"+za,Ho="__reactListeners$"+za,ei="__reactHandles$"+za,Fo="__reactResources$"+za,bs="__reactMarker$"+za;function al(n){delete n[Xt],delete n[_n],delete n[nl],delete n[Ho],delete n[ei]}function Dn(n){var r=n[Xt];if(r)return r;for(var i=n.parentNode;i;){if(r=i[Rr]||i[Xt]){if(i=r.alternate,r.child!==null||i!==null&&i.child!==null)for(n=Db(n);n!==null;){if(i=n[Xt])return i;n=Db(n)}return r}n=i,i=n.parentNode}return null}function sr(n){if(n=n[Xt]||n[Rr]){var r=n.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return n}return null}function Or(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n.stateNode;throw Error(s(33))}function Ir(n){var r=n[Fo];return r||(r=n[Fo]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function nn(n){n[bs]=!0}var zo=new Set,xs={};function ir(n,r){_e(n,r),_e(n+"Capture",r)}function _e(n,r){for(xs[n]=r,n=0;n<r.length;n++)zo.add(r[n])}var Ue=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]*$"),at={},yt={};function Qt(n){return ba.call(yt,n)?!0:ba.call(at,n)?!1:Ue.test(n)?yt[n]=!0:(at[n]=!0,!1)}function vn(n,r,i){if(Qt(r))if(i===null)n.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":n.removeAttribute(r);return;case"boolean":var c=r.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){n.removeAttribute(r);return}}n.setAttribute(r,""+i)}}function ra(n,r,i){if(i===null)n.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(r);return}n.setAttribute(r,""+i)}}function $n(n,r,i,c){if(c===null)n.removeAttribute(i);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttributeNS(r,i,""+c)}}function Lt(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function sa(n){var r=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function $o(n,r,i){var c=Object.getOwnPropertyDescriptor(n.constructor.prototype,r);if(!n.hasOwnProperty(r)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,x=c.set;return Object.defineProperty(n,r,{configurable:!0,get:function(){return p.call(this)},set:function(T){i=""+T,x.call(this,T)}}),Object.defineProperty(n,r,{enumerable:c.enumerable}),{getValue:function(){return i},setValue:function(T){i=""+T},stopTracking:function(){n._valueTracker=null,delete n[r]}}}}function ti(n){if(!n._valueTracker){var r=sa(n)?"checked":"value";n._valueTracker=$o(n,r,""+n[r])}}function rl(n){if(!n)return!1;var r=n._valueTracker;if(!r)return!0;var i=r.getValue(),c="";return n&&(c=sa(n)?n.checked?"true":"false":n.value),n=c,n!==i?(r.setValue(n),!0):!1}function ni(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var dd=/[\n"\\]/g;function qn(n){return n.replace(dd,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function sl(n,r,i,c,p,x,T,O){n.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?n.type=T:n.removeAttribute("type"),r!=null?T==="number"?(r===0&&n.value===""||n.value!=r)&&(n.value=""+Lt(r)):n.value!==""+Lt(r)&&(n.value=""+Lt(r)):T!=="submit"&&T!=="reset"||n.removeAttribute("value"),r!=null?ai(n,T,Lt(r)):i!=null?ai(n,T,Lt(i)):c!=null&&n.removeAttribute("value"),p==null&&x!=null&&(n.defaultChecked=!!x),p!=null&&(n.checked=p&&typeof p!="function"&&typeof p!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?n.name=""+Lt(O):n.removeAttribute("name")}function Es(n,r,i,c,p,x,T,O){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(n.type=x),r!=null||i!=null){if(!(x!=="submit"&&x!=="reset"||r!=null)){ti(n);return}i=i!=null?""+Lt(i):"",r=r!=null?""+Lt(r):i,O||r===n.value||(n.value=r),n.defaultValue=r}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,n.checked=O?n.checked:!!c,n.defaultChecked=!!c,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(n.name=T),ti(n)}function ai(n,r,i){r==="number"&&ni(n.ownerDocument)===n||n.defaultValue===""+i||(n.defaultValue=""+i)}function xn(n,r,i,c){if(n=n.options,r){r={};for(var p=0;p<i.length;p++)r["$"+i[p]]=!0;for(i=0;i<n.length;i++)p=r.hasOwnProperty("$"+n[i].value),n[i].selected!==p&&(n[i].selected=p),p&&c&&(n[i].defaultSelected=!0)}else{for(i=""+Lt(i),r=null,p=0;p<n.length;p++){if(n[p].value===i){n[p].selected=!0,c&&(n[p].defaultSelected=!0);return}r!==null||n[p].disabled||(r=n[p])}r!==null&&(r.selected=!0)}}function qo(n,r,i){if(r!=null&&(r=""+Lt(r),r!==n.value&&(n.value=r),i==null)){n.defaultValue!==r&&(n.defaultValue=r);return}n.defaultValue=i!=null?""+Lt(i):""}function ri(n,r,i,c){if(r==null){if(c!=null){if(i!=null)throw Error(s(92));if(F(c)){if(1<c.length)throw Error(s(93));c=c[0]}i=c}i==null&&(i=""),r=i}i=Lt(r),n.defaultValue=i,c=n.textContent,c===i&&c!==""&&c!==null&&(n.value=c),ti(n)}function qe(n,r){if(r){var i=n.firstChild;if(i&&i===n.lastChild&&i.nodeType===3){i.nodeValue=r;return}}n.textContent=r}var Yo=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 an(n,r,i){var c=r.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?c?n.setProperty(r,""):r==="float"?n.cssFloat="":n[r]="":c?n.setProperty(r,i):typeof i!="number"||i===0||Yo.has(r)?r==="float"?n.cssFloat=i:n[r]=(""+i).trim():n[r]=i+"px"}function Nt(n,r,i){if(r!=null&&typeof r!="object")throw Error(s(62));if(n=n.style,i!=null){for(var c in i)!i.hasOwnProperty(c)||r!=null&&r.hasOwnProperty(c)||(c.indexOf("--")===0?n.setProperty(c,""):c==="float"?n.cssFloat="":n[c]="");for(var p in r)c=r[p],r.hasOwnProperty(p)&&i[p]!==c&&an(n,p,c)}else for(var x in r)r.hasOwnProperty(x)&&an(n,x,r[x])}function Mr(n){if(n.indexOf("-")===-1)return!1;switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var lr=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"]]),il=/^[\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 Dr(n){return il.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function we(){}var Le=null;function We(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var ot=null,qt=null;function xa(n){var r=sr(n);if(r&&(n=r.stateNode)){var i=n[_n]||null;e:switch(n=r.stateNode,r.type){case"input":if(sl(n,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),r=i.name,i.type==="radio"&&r!=null){for(i=n;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+qn(""+r)+'"][type="radio"]'),r=0;r<i.length;r++){var c=i[r];if(c!==n&&c.form===n.form){var p=c[_n]||null;if(!p)throw Error(s(90));sl(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(r=0;r<i.length;r++)c=i[r],c.form===n.form&&rl(c)}break e;case"textarea":qo(n,i.value,i.defaultValue);break e;case"select":r=i.value,r!=null&&xn(n,!!i.multiple,r,!1)}}}var ll=!1;function Go(n,r,i){if(ll)return n(r,i);ll=!0;try{var c=n(r);return c}finally{if(ll=!1,(ot!==null||qt!==null)&&(Mu(),ot&&(r=ot,n=qt,qt=ot=null,xa(r),n)))for(r=0;r<n.length;r++)xa(n[r])}}function ol(n,r){var i=n.stateNode;if(i===null)return null;var c=i[_n]||null;if(c===null)return null;i=c[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(n=n.type,c=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!c;break e;default:n=!1}if(n)return null;if(i&&typeof i!="function")throw Error(s(231,r,typeof i));return i}var or=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fd=!1;if(or)try{var ul={};Object.defineProperty(ul,"passive",{get:function(){fd=!0}}),window.addEventListener("test",ul,ul),window.removeEventListener("test",ul,ul)}catch{fd=!1}var Lr=null,md=null,Ko=null;function wp(){if(Ko)return Ko;var n,r=md,i=r.length,c,p="value"in Lr?Lr.value:Lr.textContent,x=p.length;for(n=0;n<i&&r[n]===p[n];n++);var T=i-n;for(c=1;c<=T&&r[i-c]===p[x-c];c++);return Ko=p.slice(n,1<c?1-c:void 0)}function Vo(n){var r=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&r===13&&(n=13)):n=r,n===10&&(n=13),32<=n||n===13?n:0}function Xo(){return!0}function Cp(){return!1}function Yn(n){function r(i,c,p,x,T){this._reactName=i,this._targetInst=p,this.type=c,this.nativeEvent=x,this.target=T,this.currentTarget=null;for(var O in n)n.hasOwnProperty(O)&&(i=n[O],this[O]=i?i(x):x[O]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Xo:Cp,this.isPropagationStopped=Cp,this}return g(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Xo)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Xo)},persist:function(){},isPersistent:Xo}),r}var ys={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qo=Yn(ys),cl=g({},ys,{view:0,detail:0}),p_=Yn(cl),hd,pd,dl,Wo=g({},cl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bd,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==dl&&(dl&&n.type==="mousemove"?(hd=n.screenX-dl.screenX,pd=n.screenY-dl.screenY):pd=hd=0,dl=n),hd)},movementY:function(n){return"movementY"in n?n.movementY:pd}}),kp=Yn(Wo),g_=g({},Wo,{dataTransfer:0}),b_=Yn(g_),x_=g({},cl,{relatedTarget:0}),gd=Yn(x_),E_=g({},ys,{animationName:0,elapsedTime:0,pseudoElement:0}),y_=Yn(E_),N_=g({},ys,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),T_=Yn(N_),__=g({},ys,{data:0}),Rp=Yn(__),v_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},S_={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"},A_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function w_(n){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(n):(n=A_[n])?!!r[n]:!1}function bd(){return w_}var C_=g({},cl,{key:function(n){if(n.key){var r=v_[n.key]||n.key;if(r!=="Unidentified")return r}return n.type==="keypress"?(n=Vo(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?S_[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bd,charCode:function(n){return n.type==="keypress"?Vo(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Vo(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),k_=Yn(C_),R_=g({},Wo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Op=Yn(R_),O_=g({},cl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bd}),I_=Yn(O_),M_=g({},ys,{propertyName:0,elapsedTime:0,pseudoElement:0}),D_=Yn(M_),L_=g({},Wo,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),j_=Yn(L_),B_=g({},ys,{newState:0,oldState:0}),P_=Yn(B_),U_=[9,13,27,32],xd=or&&"CompositionEvent"in window,fl=null;or&&"documentMode"in document&&(fl=document.documentMode);var H_=or&&"TextEvent"in window&&!fl,Ip=or&&(!xd||fl&&8<fl&&11>=fl),Mp=" ",Dp=!1;function Lp(n,r){switch(n){case"keyup":return U_.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jp(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var si=!1;function F_(n,r){switch(n){case"compositionend":return jp(r);case"keypress":return r.which!==32?null:(Dp=!0,Mp);case"textInput":return n=r.data,n===Mp&&Dp?null:n;default:return null}}function z_(n,r){if(si)return n==="compositionend"||!xd&&Lp(n,r)?(n=wp(),Ko=md=Lr=null,si=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Ip&&r.locale!=="ko"?null:r.data;default:return null}}var $_={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 Bp(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r==="input"?!!$_[n.type]:r==="textarea"}function Pp(n,r,i,c){ot?qt?qt.push(c):qt=[c]:ot=c,r=Hu(r,"onChange"),0<r.length&&(i=new Qo("onChange","change",null,i,c),n.push({event:i,listeners:r}))}var ml=null,hl=null;function q_(n){yb(n,0)}function Zo(n){var r=Or(n);if(rl(r))return n}function Up(n,r){if(n==="change")return r}var Hp=!1;if(or){var Ed;if(or){var yd="oninput"in document;if(!yd){var Fp=document.createElement("div");Fp.setAttribute("oninput","return;"),yd=typeof Fp.oninput=="function"}Ed=yd}else Ed=!1;Hp=Ed&&(!document.documentMode||9<document.documentMode)}function zp(){ml&&(ml.detachEvent("onpropertychange",$p),hl=ml=null)}function $p(n){if(n.propertyName==="value"&&Zo(hl)){var r=[];Pp(r,hl,n,We(n)),Go(q_,r)}}function Y_(n,r,i){n==="focusin"?(zp(),ml=r,hl=i,ml.attachEvent("onpropertychange",$p)):n==="focusout"&&zp()}function G_(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Zo(hl)}function K_(n,r){if(n==="click")return Zo(r)}function V_(n,r){if(n==="input"||n==="change")return Zo(r)}function X_(n,r){return n===r&&(n!==0||1/n===1/r)||n!==n&&r!==r}var ia=typeof Object.is=="function"?Object.is:X_;function pl(n,r){if(ia(n,r))return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;var i=Object.keys(n),c=Object.keys(r);if(i.length!==c.length)return!1;for(c=0;c<i.length;c++){var p=i[c];if(!ba.call(r,p)||!ia(n[p],r[p]))return!1}return!0}function qp(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Yp(n,r){var i=qp(n);n=0;for(var c;i;){if(i.nodeType===3){if(c=n+i.textContent.length,n<=r&&c>=r)return{node:i,offset:r-n};n=c}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=qp(i)}}function Gp(n,r){return n&&r?n===r?!0:n&&n.nodeType===3?!1:r&&r.nodeType===3?Gp(n,r.parentNode):"contains"in n?n.contains(r):n.compareDocumentPosition?!!(n.compareDocumentPosition(r)&16):!1:!1}function Kp(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var r=ni(n.document);r instanceof n.HTMLIFrameElement;){try{var i=typeof r.contentWindow.location.href=="string"}catch{i=!1}if(i)n=r.contentWindow;else break;r=ni(n.document)}return r}function Nd(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r&&(r==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||r==="textarea"||n.contentEditable==="true")}var Q_=or&&"documentMode"in document&&11>=document.documentMode,ii=null,Td=null,gl=null,_d=!1;function Vp(n,r,i){var c=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;_d||ii==null||ii!==ni(c)||(c=ii,"selectionStart"in c&&Nd(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),gl&&pl(gl,c)||(gl=c,c=Hu(Td,"onSelect"),0<c.length&&(r=new Qo("onSelect","select",null,r,i),n.push({event:r,listeners:c}),r.target=ii)))}function Ns(n,r){var i={};return i[n.toLowerCase()]=r.toLowerCase(),i["Webkit"+n]="webkit"+r,i["Moz"+n]="moz"+r,i}var li={animationend:Ns("Animation","AnimationEnd"),animationiteration:Ns("Animation","AnimationIteration"),animationstart:Ns("Animation","AnimationStart"),transitionrun:Ns("Transition","TransitionRun"),transitionstart:Ns("Transition","TransitionStart"),transitioncancel:Ns("Transition","TransitionCancel"),transitionend:Ns("Transition","TransitionEnd")},vd={},Xp={};or&&(Xp=document.createElement("div").style,"AnimationEvent"in window||(delete li.animationend.animation,delete li.animationiteration.animation,delete li.animationstart.animation),"TransitionEvent"in window||delete li.transitionend.transition);function Ts(n){if(vd[n])return vd[n];if(!li[n])return n;var r=li[n],i;for(i in r)if(r.hasOwnProperty(i)&&i in Xp)return vd[n]=r[i];return n}var Qp=Ts("animationend"),Wp=Ts("animationiteration"),Zp=Ts("animationstart"),W_=Ts("transitionrun"),Z_=Ts("transitionstart"),J_=Ts("transitioncancel"),Jp=Ts("transitionend"),e0=new Map,Sd="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(" ");Sd.push("scrollEnd");function Ma(n,r){e0.set(n,r),ir(r,[n])}var Jo=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Ea=[],oi=0,Ad=0;function eu(){for(var n=oi,r=Ad=oi=0;r<n;){var i=Ea[r];Ea[r++]=null;var c=Ea[r];Ea[r++]=null;var p=Ea[r];Ea[r++]=null;var x=Ea[r];if(Ea[r++]=null,c!==null&&p!==null){var T=c.pending;T===null?p.next=p:(p.next=T.next,T.next=p),c.pending=p}x!==0&&t0(i,p,x)}}function tu(n,r,i,c){Ea[oi++]=n,Ea[oi++]=r,Ea[oi++]=i,Ea[oi++]=c,Ad|=c,n.lanes|=c,n=n.alternate,n!==null&&(n.lanes|=c)}function wd(n,r,i,c){return tu(n,r,i,c),nu(n)}function _s(n,r){return tu(n,null,null,r),nu(n)}function t0(n,r,i){n.lanes|=i;var c=n.alternate;c!==null&&(c.lanes|=i);for(var p=!1,x=n.return;x!==null;)x.childLanes|=i,c=x.alternate,c!==null&&(c.childLanes|=i),x.tag===22&&(n=x.stateNode,n===null||n._visibility&1||(p=!0)),n=x,x=x.return;return n.tag===3?(x=n.stateNode,p&&r!==null&&(p=31-Et(i),n=x.hiddenUpdates,c=n[p],c===null?n[p]=[r]:c.push(r),r.lane=i|536870912),x):null}function nu(n){if(50<Pl)throw Pl=0,Bf=null,Error(s(185));for(var r=n.return;r!==null;)n=r,r=n.return;return n.tag===3?n.stateNode:null}var ui={};function e2(n,r,i,c){this.tag=n,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function la(n,r,i,c){return new e2(n,r,i,c)}function Cd(n){return n=n.prototype,!(!n||!n.isReactComponent)}function ur(n,r){var i=n.alternate;return i===null?(i=la(n.tag,r,n.key,n.mode),i.elementType=n.elementType,i.type=n.type,i.stateNode=n.stateNode,i.alternate=n,n.alternate=i):(i.pendingProps=r,i.type=n.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=n.flags&65011712,i.childLanes=n.childLanes,i.lanes=n.lanes,i.child=n.child,i.memoizedProps=n.memoizedProps,i.memoizedState=n.memoizedState,i.updateQueue=n.updateQueue,r=n.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},i.sibling=n.sibling,i.index=n.index,i.ref=n.ref,i.refCleanup=n.refCleanup,i}function n0(n,r){n.flags&=65011714;var i=n.alternate;return i===null?(n.childLanes=0,n.lanes=r,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=i.childLanes,n.lanes=i.lanes,n.child=i.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=i.memoizedProps,n.memoizedState=i.memoizedState,n.updateQueue=i.updateQueue,n.type=i.type,r=i.dependencies,n.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),n}function au(n,r,i,c,p,x){var T=0;if(c=n,typeof n=="function")Cd(n)&&(T=1);else if(typeof n=="string")T=sv(n,i,ye.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case Q:return n=la(31,i,r,p),n.elementType=Q,n.lanes=x,n;case S:return vs(i.children,p,x,r);case w:T=8,p|=24;break;case A:return n=la(12,i,r,p|2),n.elementType=A,n.lanes=x,n;case B:return n=la(13,i,r,p),n.elementType=B,n.lanes=x,n;case C:return n=la(19,i,r,p),n.elementType=C,n.lanes=x,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case I:T=10;break e;case R:T=9;break e;case Y:T=11;break e;case z:T=14;break e;case W:T=16,c=null;break e}T=29,i=Error(s(130,n===null?"null":typeof n,"")),c=null}return r=la(T,i,r,p),r.elementType=n,r.type=c,r.lanes=x,r}function vs(n,r,i,c){return n=la(7,n,c,r),n.lanes=i,n}function kd(n,r,i){return n=la(6,n,null,r),n.lanes=i,n}function a0(n){var r=la(18,null,null,0);return r.stateNode=n,r}function Rd(n,r,i){return r=la(4,n.children!==null?n.children:[],n.key,r),r.lanes=i,r.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},r}var r0=new WeakMap;function ya(n,r){if(typeof n=="object"&&n!==null){var i=r0.get(n);return i!==void 0?i:(r={value:n,source:r,stack:In(r)},r0.set(n,r),r)}return{value:n,source:r,stack:In(r)}}var ci=[],di=0,ru=null,bl=0,Na=[],Ta=0,jr=null,$a=1,qa="";function cr(n,r){ci[di++]=bl,ci[di++]=ru,ru=n,bl=r}function s0(n,r,i){Na[Ta++]=$a,Na[Ta++]=qa,Na[Ta++]=jr,jr=n;var c=$a;n=qa;var p=32-Et(c)-1;c&=~(1<<p),i+=1;var x=32-Et(r)+p;if(30<x){var T=p-p%5;x=(c&(1<<T)-1).toString(32),c>>=T,p-=T,$a=1<<32-Et(r)+p|i<<p|c,qa=x+n}else $a=1<<x|i<<p|c,qa=n}function Od(n){n.return!==null&&(cr(n,1),s0(n,1,0))}function Id(n){for(;n===ru;)ru=ci[--di],ci[di]=null,bl=ci[--di],ci[di]=null;for(;n===jr;)jr=Na[--Ta],Na[Ta]=null,qa=Na[--Ta],Na[Ta]=null,$a=Na[--Ta],Na[Ta]=null}function i0(n,r){Na[Ta++]=$a,Na[Ta++]=qa,Na[Ta++]=jr,$a=r.id,qa=r.overflow,jr=n}var En=null,Bt=null,dt=!1,Br=null,_a=!1,Md=Error(s(519));function Pr(n){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw xl(ya(r,n)),Md}function l0(n){var r=n.stateNode,i=n.type,c=n.memoizedProps;switch(r[Xt]=n,r[_n]=c,i){case"dialog":it("cancel",r),it("close",r);break;case"iframe":case"object":case"embed":it("load",r);break;case"video":case"audio":for(i=0;i<Hl.length;i++)it(Hl[i],r);break;case"source":it("error",r);break;case"img":case"image":case"link":it("error",r),it("load",r);break;case"details":it("toggle",r);break;case"input":it("invalid",r),Es(r,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":it("invalid",r);break;case"textarea":it("invalid",r),ri(r,c.value,c.defaultValue,c.children)}i=c.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||r.textContent===""+i||c.suppressHydrationWarning===!0||vb(r.textContent,i)?(c.popover!=null&&(it("beforetoggle",r),it("toggle",r)),c.onScroll!=null&&it("scroll",r),c.onScrollEnd!=null&&it("scrollend",r),c.onClick!=null&&(r.onclick=we),r=!0):r=!1,r||Pr(n,!0)}function o0(n){for(En=n.return;En;)switch(En.tag){case 5:case 31:case 13:_a=!1;return;case 27:case 3:_a=!0;return;default:En=En.return}}function fi(n){if(n!==En)return!1;if(!dt)return o0(n),dt=!0,!1;var r=n.tag,i;if((i=r!==3&&r!==27)&&((i=r===5)&&(i=n.type,i=!(i!=="form"&&i!=="button")||Zf(n.type,n.memoizedProps)),i=!i),i&&Bt&&Pr(n),o0(n),r===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));Bt=Mb(n)}else if(r===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));Bt=Mb(n)}else r===27?(r=Bt,Zr(n.type)?(n=am,am=null,Bt=n):Bt=r):Bt=En?Sa(n.stateNode.nextSibling):null;return!0}function Ss(){Bt=En=null,dt=!1}function Dd(){var n=Br;return n!==null&&(Xn===null?Xn=n:Xn.push.apply(Xn,n),Br=null),n}function xl(n){Br===null?Br=[n]:Br.push(n)}var Ld=U(null),As=null,dr=null;function Ur(n,r,i){M(Ld,r._currentValue),r._currentValue=i}function fr(n){n._currentValue=Ld.current,ie(Ld)}function jd(n,r,i){for(;n!==null;){var c=n.alternate;if((n.childLanes&r)!==r?(n.childLanes|=r,c!==null&&(c.childLanes|=r)):c!==null&&(c.childLanes&r)!==r&&(c.childLanes|=r),n===i)break;n=n.return}}function Bd(n,r,i,c){var p=n.child;for(p!==null&&(p.return=n);p!==null;){var x=p.dependencies;if(x!==null){var T=p.child;x=x.firstContext;e:for(;x!==null;){var O=x;x=p;for(var V=0;V<r.length;V++)if(O.context===r[V]){x.lanes|=i,O=x.alternate,O!==null&&(O.lanes|=i),jd(x.return,i,n),c||(T=null);break e}x=O.next}}else if(p.tag===18){if(T=p.return,T===null)throw Error(s(341));T.lanes|=i,x=T.alternate,x!==null&&(x.lanes|=i),jd(T,i,n),T=null}else T=p.child;if(T!==null)T.return=p;else for(T=p;T!==null;){if(T===n){T=null;break}if(p=T.sibling,p!==null){p.return=T.return,T=p;break}T=T.return}p=T}}function mi(n,r,i,c){n=null;for(var p=r,x=!1;p!==null;){if(!x){if((p.flags&524288)!==0)x=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var T=p.alternate;if(T===null)throw Error(s(387));if(T=T.memoizedProps,T!==null){var O=p.type;ia(p.pendingProps.value,T.value)||(n!==null?n.push(O):n=[O])}}else if(p===Pe.current){if(T=p.alternate,T===null)throw Error(s(387));T.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(n!==null?n.push(Yl):n=[Yl])}p=p.return}n!==null&&Bd(r,n,i,c),r.flags|=262144}function su(n){for(n=n.firstContext;n!==null;){if(!ia(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function ws(n){As=n,dr=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function yn(n){return u0(As,n)}function iu(n,r){return As===null&&ws(n),u0(n,r)}function u0(n,r){var i=r._currentValue;if(r={context:r,memoizedValue:i,next:null},dr===null){if(n===null)throw Error(s(308));dr=r,n.dependencies={lanes:0,firstContext:r},n.flags|=524288}else dr=dr.next=r;return i}var t2=typeof AbortController<"u"?AbortController:function(){var n=[],r=this.signal={aborted:!1,addEventListener:function(i,c){n.push(c)}};this.abort=function(){r.aborted=!0,n.forEach(function(i){return i()})}},n2=e.unstable_scheduleCallback,a2=e.unstable_NormalPriority,rn={$$typeof:I,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pd(){return{controller:new t2,data:new Map,refCount:0}}function El(n){n.refCount--,n.refCount===0&&n2(a2,function(){n.controller.abort()})}var yl=null,Ud=0,hi=0,pi=null;function r2(n,r){if(yl===null){var i=yl=[];Ud=0,hi=$f(),pi={status:"pending",value:void 0,then:function(c){i.push(c)}}}return Ud++,r.then(c0,c0),r}function c0(){if(--Ud===0&&yl!==null){pi!==null&&(pi.status="fulfilled");var n=yl;yl=null,hi=0,pi=null;for(var r=0;r<n.length;r++)(0,n[r])()}}function s2(n,r){var i=[],c={status:"pending",value:null,reason:null,then:function(p){i.push(p)}};return n.then(function(){c.status="fulfilled",c.value=r;for(var p=0;p<i.length;p++)(0,i[p])(r)},function(p){for(c.status="rejected",c.reason=p,p=0;p<i.length;p++)(0,i[p])(void 0)}),c}var d0=D.S;D.S=function(n,r){Vg=St(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r2(n,r),d0!==null&&d0(n,r)};var Cs=U(null);function Hd(){var n=Cs.current;return n!==null?n:Ot.pooledCache}function lu(n,r){r===null?M(Cs,Cs.current):M(Cs,r.pool)}function f0(){var n=Hd();return n===null?null:{parent:rn._currentValue,pool:n}}var gi=Error(s(460)),Fd=Error(s(474)),ou=Error(s(542)),uu={then:function(){}};function m0(n){return n=n.status,n==="fulfilled"||n==="rejected"}function h0(n,r,i){switch(i=n[i],i===void 0?n.push(r):i!==r&&(r.then(we,we),r=i),r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,g0(n),n;default:if(typeof r.status=="string")r.then(we,we);else{if(n=Ot,n!==null&&100<n.shellSuspendCounter)throw Error(s(482));n=r,n.status="pending",n.then(function(c){if(r.status==="pending"){var p=r;p.status="fulfilled",p.value=c}},function(c){if(r.status==="pending"){var p=r;p.status="rejected",p.reason=c}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,g0(n),n}throw Rs=r,gi}}function ks(n){try{var r=n._init;return r(n._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Rs=i,gi):i}}var Rs=null;function p0(){if(Rs===null)throw Error(s(459));var n=Rs;return Rs=null,n}function g0(n){if(n===gi||n===ou)throw Error(s(483))}var bi=null,Nl=0;function cu(n){var r=Nl;return Nl+=1,bi===null&&(bi=[]),h0(bi,n,r)}function Tl(n,r){r=r.props.ref,n.ref=r!==void 0?r:null}function du(n,r){throw r.$$typeof===y?Error(s(525)):(n=Object.prototype.toString.call(r),Error(s(31,n==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":n)))}function b0(n){function r(te,J){if(n){var le=te.deletions;le===null?(te.deletions=[J],te.flags|=16):le.push(J)}}function i(te,J){if(!n)return null;for(;J!==null;)r(te,J),J=J.sibling;return null}function c(te){for(var J=new Map;te!==null;)te.key!==null?J.set(te.key,te):J.set(te.index,te),te=te.sibling;return J}function p(te,J){return te=ur(te,J),te.index=0,te.sibling=null,te}function x(te,J,le){return te.index=le,n?(le=te.alternate,le!==null?(le=le.index,le<J?(te.flags|=67108866,J):le):(te.flags|=67108866,J)):(te.flags|=1048576,J)}function T(te){return n&&te.alternate===null&&(te.flags|=67108866),te}function O(te,J,le,ge){return J===null||J.tag!==6?(J=kd(le,te.mode,ge),J.return=te,J):(J=p(J,le),J.return=te,J)}function V(te,J,le,ge){var He=le.type;return He===S?he(te,J,le.props.children,ge,le.key):J!==null&&(J.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===W&&ks(He)===J.type)?(J=p(J,le.props),Tl(J,le),J.return=te,J):(J=au(le.type,le.key,le.props,null,te.mode,ge),Tl(J,le),J.return=te,J)}function oe(te,J,le,ge){return J===null||J.tag!==4||J.stateNode.containerInfo!==le.containerInfo||J.stateNode.implementation!==le.implementation?(J=Rd(le,te.mode,ge),J.return=te,J):(J=p(J,le.children||[]),J.return=te,J)}function he(te,J,le,ge,He){return J===null||J.tag!==7?(J=vs(le,te.mode,ge,He),J.return=te,J):(J=p(J,le),J.return=te,J)}function be(te,J,le){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=kd(""+J,te.mode,le),J.return=te,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case N:return le=au(J.type,J.key,J.props,null,te.mode,le),Tl(le,J),le.return=te,le;case v:return J=Rd(J,te.mode,le),J.return=te,J;case W:return J=ks(J),be(te,J,le)}if(F(J)||ue(J))return J=vs(J,te.mode,le,null),J.return=te,J;if(typeof J.then=="function")return be(te,cu(J),le);if(J.$$typeof===I)return be(te,iu(te,J),le);du(te,J)}return null}function ce(te,J,le,ge){var He=J!==null?J.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return He!==null?null:O(te,J,""+le,ge);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case N:return le.key===He?V(te,J,le,ge):null;case v:return le.key===He?oe(te,J,le,ge):null;case W:return le=ks(le),ce(te,J,le,ge)}if(F(le)||ue(le))return He!==null?null:he(te,J,le,ge,null);if(typeof le.then=="function")return ce(te,J,cu(le),ge);if(le.$$typeof===I)return ce(te,J,iu(te,le),ge);du(te,le)}return null}function de(te,J,le,ge,He){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return te=te.get(le)||null,O(J,te,""+ge,He);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case N:return te=te.get(ge.key===null?le:ge.key)||null,V(J,te,ge,He);case v:return te=te.get(ge.key===null?le:ge.key)||null,oe(J,te,ge,He);case W:return ge=ks(ge),de(te,J,le,ge,He)}if(F(ge)||ue(ge))return te=te.get(le)||null,he(J,te,ge,He,null);if(typeof ge.then=="function")return de(te,J,le,cu(ge),He);if(ge.$$typeof===I)return de(te,J,le,iu(J,ge),He);du(J,ge)}return null}function Me(te,J,le,ge){for(var He=null,ht=null,je=J,Je=J=0,ct=null;je!==null&&Je<le.length;Je++){je.index>Je?(ct=je,je=null):ct=je.sibling;var pt=ce(te,je,le[Je],ge);if(pt===null){je===null&&(je=ct);break}n&&je&&pt.alternate===null&&r(te,je),J=x(pt,J,Je),ht===null?He=pt:ht.sibling=pt,ht=pt,je=ct}if(Je===le.length)return i(te,je),dt&&cr(te,Je),He;if(je===null){for(;Je<le.length;Je++)je=be(te,le[Je],ge),je!==null&&(J=x(je,J,Je),ht===null?He=je:ht.sibling=je,ht=je);return dt&&cr(te,Je),He}for(je=c(je);Je<le.length;Je++)ct=de(je,te,Je,le[Je],ge),ct!==null&&(n&&ct.alternate!==null&&je.delete(ct.key===null?Je:ct.key),J=x(ct,J,Je),ht===null?He=ct:ht.sibling=ct,ht=ct);return n&&je.forEach(function(as){return r(te,as)}),dt&&cr(te,Je),He}function $e(te,J,le,ge){if(le==null)throw Error(s(151));for(var He=null,ht=null,je=J,Je=J=0,ct=null,pt=le.next();je!==null&&!pt.done;Je++,pt=le.next()){je.index>Je?(ct=je,je=null):ct=je.sibling;var as=ce(te,je,pt.value,ge);if(as===null){je===null&&(je=ct);break}n&&je&&as.alternate===null&&r(te,je),J=x(as,J,Je),ht===null?He=as:ht.sibling=as,ht=as,je=ct}if(pt.done)return i(te,je),dt&&cr(te,Je),He;if(je===null){for(;!pt.done;Je++,pt=le.next())pt=be(te,pt.value,ge),pt!==null&&(J=x(pt,J,Je),ht===null?He=pt:ht.sibling=pt,ht=pt);return dt&&cr(te,Je),He}for(je=c(je);!pt.done;Je++,pt=le.next())pt=de(je,te,Je,pt.value,ge),pt!==null&&(n&&pt.alternate!==null&&je.delete(pt.key===null?Je:pt.key),J=x(pt,J,Je),ht===null?He=pt:ht.sibling=pt,ht=pt);return n&&je.forEach(function(gv){return r(te,gv)}),dt&&cr(te,Je),He}function Ct(te,J,le,ge){if(typeof le=="object"&&le!==null&&le.type===S&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case N:e:{for(var He=le.key;J!==null;){if(J.key===He){if(He=le.type,He===S){if(J.tag===7){i(te,J.sibling),ge=p(J,le.props.children),ge.return=te,te=ge;break e}}else if(J.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===W&&ks(He)===J.type){i(te,J.sibling),ge=p(J,le.props),Tl(ge,le),ge.return=te,te=ge;break e}i(te,J);break}else r(te,J);J=J.sibling}le.type===S?(ge=vs(le.props.children,te.mode,ge,le.key),ge.return=te,te=ge):(ge=au(le.type,le.key,le.props,null,te.mode,ge),Tl(ge,le),ge.return=te,te=ge)}return T(te);case v:e:{for(He=le.key;J!==null;){if(J.key===He)if(J.tag===4&&J.stateNode.containerInfo===le.containerInfo&&J.stateNode.implementation===le.implementation){i(te,J.sibling),ge=p(J,le.children||[]),ge.return=te,te=ge;break e}else{i(te,J);break}else r(te,J);J=J.sibling}ge=Rd(le,te.mode,ge),ge.return=te,te=ge}return T(te);case W:return le=ks(le),Ct(te,J,le,ge)}if(F(le))return Me(te,J,le,ge);if(ue(le)){if(He=ue(le),typeof He!="function")throw Error(s(150));return le=He.call(le),$e(te,J,le,ge)}if(typeof le.then=="function")return Ct(te,J,cu(le),ge);if(le.$$typeof===I)return Ct(te,J,iu(te,le),ge);du(te,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,J!==null&&J.tag===6?(i(te,J.sibling),ge=p(J,le),ge.return=te,te=ge):(i(te,J),ge=kd(le,te.mode,ge),ge.return=te,te=ge),T(te)):i(te,J)}return function(te,J,le,ge){try{Nl=0;var He=Ct(te,J,le,ge);return bi=null,He}catch(je){if(je===gi||je===ou)throw je;var ht=la(29,je,null,te.mode);return ht.lanes=ge,ht.return=te,ht}finally{}}}var Os=b0(!0),x0=b0(!1),Hr=!1;function zd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $d(n,r){n=n.updateQueue,r.updateQueue===n&&(r.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Fr(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function zr(n,r,i){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,(bt&2)!==0){var p=c.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),c.pending=r,r=nu(n),t0(n,null,i),r}return tu(n,c,r,i),nu(n)}function _l(n,r,i){if(r=r.updateQueue,r!==null&&(r=r.shared,(i&4194048)!==0)){var c=r.lanes;c&=n.pendingLanes,i|=c,r.lanes=i,Ye(n,i)}}function qd(n,r){var i=n.updateQueue,c=n.alternate;if(c!==null&&(c=c.updateQueue,i===c)){var p=null,x=null;if(i=i.firstBaseUpdate,i!==null){do{var T={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};x===null?p=x=T:x=x.next=T,i=i.next}while(i!==null);x===null?p=x=r:x=x.next=r}else p=x=r;i={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:x,shared:c.shared,callbacks:c.callbacks},n.updateQueue=i;return}n=i.lastBaseUpdate,n===null?i.firstBaseUpdate=r:n.next=r,i.lastBaseUpdate=r}var Yd=!1;function vl(){if(Yd){var n=pi;if(n!==null)throw n}}function Sl(n,r,i,c){Yd=!1;var p=n.updateQueue;Hr=!1;var x=p.firstBaseUpdate,T=p.lastBaseUpdate,O=p.shared.pending;if(O!==null){p.shared.pending=null;var V=O,oe=V.next;V.next=null,T===null?x=oe:T.next=oe,T=V;var he=n.alternate;he!==null&&(he=he.updateQueue,O=he.lastBaseUpdate,O!==T&&(O===null?he.firstBaseUpdate=oe:O.next=oe,he.lastBaseUpdate=V))}if(x!==null){var be=p.baseState;T=0,he=oe=V=null,O=x;do{var ce=O.lane&-536870913,de=ce!==O.lane;if(de?(ut&ce)===ce:(c&ce)===ce){ce!==0&&ce===hi&&(Yd=!0),he!==null&&(he=he.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var Me=n,$e=O;ce=r;var Ct=i;switch($e.tag){case 1:if(Me=$e.payload,typeof Me=="function"){be=Me.call(Ct,be,ce);break e}be=Me;break e;case 3:Me.flags=Me.flags&-65537|128;case 0:if(Me=$e.payload,ce=typeof Me=="function"?Me.call(Ct,be,ce):Me,ce==null)break e;be=g({},be,ce);break e;case 2:Hr=!0}}ce=O.callback,ce!==null&&(n.flags|=64,de&&(n.flags|=8192),de=p.callbacks,de===null?p.callbacks=[ce]:de.push(ce))}else de={lane:ce,tag:O.tag,payload:O.payload,callback:O.callback,next:null},he===null?(oe=he=de,V=be):he=he.next=de,T|=ce;if(O=O.next,O===null){if(O=p.shared.pending,O===null)break;de=O,O=de.next,de.next=null,p.lastBaseUpdate=de,p.shared.pending=null}}while(!0);he===null&&(V=be),p.baseState=V,p.firstBaseUpdate=oe,p.lastBaseUpdate=he,x===null&&(p.shared.lanes=0),Kr|=T,n.lanes=T,n.memoizedState=be}}function E0(n,r){if(typeof n!="function")throw Error(s(191,n));n.call(r)}function y0(n,r){var i=n.callbacks;if(i!==null)for(n.callbacks=null,n=0;n<i.length;n++)E0(i[n],r)}var xi=U(null),fu=U(0);function N0(n,r){n=Nr,M(fu,n),M(xi,r),Nr=n|r.baseLanes}function Gd(){M(fu,Nr),M(xi,xi.current)}function Kd(){Nr=fu.current,ie(xi),ie(fu)}var oa=U(null),va=null;function $r(n){var r=n.alternate;M(Wt,Wt.current&1),M(oa,n),va===null&&(r===null||xi.current!==null||r.memoizedState!==null)&&(va=n)}function Vd(n){M(Wt,Wt.current),M(oa,n),va===null&&(va=n)}function T0(n){n.tag===22?(M(Wt,Wt.current),M(oa,n),va===null&&(va=n)):qr()}function qr(){M(Wt,Wt.current),M(oa,oa.current)}function ua(n){ie(oa),va===n&&(va=null),ie(Wt)}var Wt=U(0);function mu(n){for(var r=n;r!==null;){if(r.tag===13){var i=r.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||tm(i)||nm(i)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var mr=0,Ze=null,At=null,sn=null,hu=!1,Ei=!1,Is=!1,pu=0,Al=0,yi=null,i2=0;function Yt(){throw Error(s(321))}function Xd(n,r){if(r===null)return!1;for(var i=0;i<r.length&&i<n.length;i++)if(!ia(n[i],r[i]))return!1;return!0}function Qd(n,r,i,c,p,x){return mr=x,Ze=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,D.H=n===null||n.memoizedState===null?sg:ff,Is=!1,x=i(c,p),Is=!1,Ei&&(x=v0(r,i,c,p)),_0(n),x}function _0(n){D.H=kl;var r=At!==null&&At.next!==null;if(mr=0,sn=At=Ze=null,hu=!1,Al=0,yi=null,r)throw Error(s(300));n===null||ln||(n=n.dependencies,n!==null&&su(n)&&(ln=!0))}function v0(n,r,i,c){Ze=n;var p=0;do{if(Ei&&(yi=null),Al=0,Ei=!1,25<=p)throw Error(s(301));if(p+=1,sn=At=null,n.updateQueue!=null){var x=n.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}D.H=ig,x=r(i,c)}while(Ei);return x}function l2(){var n=D.H,r=n.useState()[0];return r=typeof r.then=="function"?wl(r):r,n=n.useState()[0],(At!==null?At.memoizedState:null)!==n&&(Ze.flags|=1024),r}function Wd(){var n=pu!==0;return pu=0,n}function Zd(n,r,i){r.updateQueue=n.updateQueue,r.flags&=-2053,n.lanes&=~i}function Jd(n){if(hu){for(n=n.memoizedState;n!==null;){var r=n.queue;r!==null&&(r.pending=null),n=n.next}hu=!1}mr=0,sn=At=Ze=null,Ei=!1,Al=pu=0,yi=null}function Ln(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return sn===null?Ze.memoizedState=sn=n:sn=sn.next=n,sn}function Zt(){if(At===null){var n=Ze.alternate;n=n!==null?n.memoizedState:null}else n=At.next;var r=sn===null?Ze.memoizedState:sn.next;if(r!==null)sn=r,At=n;else{if(n===null)throw Ze.alternate===null?Error(s(467)):Error(s(310));At=n,n={memoizedState:At.memoizedState,baseState:At.baseState,baseQueue:At.baseQueue,queue:At.queue,next:null},sn===null?Ze.memoizedState=sn=n:sn=sn.next=n}return sn}function gu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wl(n){var r=Al;return Al+=1,yi===null&&(yi=[]),n=h0(yi,n,r),r=Ze,(sn===null?r.memoizedState:sn.next)===null&&(r=r.alternate,D.H=r===null||r.memoizedState===null?sg:ff),n}function bu(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return wl(n);if(n.$$typeof===I)return yn(n)}throw Error(s(438,String(n)))}function ef(n){var r=null,i=Ze.updateQueue;if(i!==null&&(r=i.memoCache),r==null){var c=Ze.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(r={data:c.data.map(function(p){return p.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),i===null&&(i=gu(),Ze.updateQueue=i),i.memoCache=r,i=r.data[r.index],i===void 0)for(i=r.data[r.index]=Array(n),c=0;c<n;c++)i[c]=j;return r.index++,i}function hr(n,r){return typeof r=="function"?r(n):r}function xu(n){var r=Zt();return tf(r,At,n)}function tf(n,r,i){var c=n.queue;if(c===null)throw Error(s(311));c.lastRenderedReducer=i;var p=n.baseQueue,x=c.pending;if(x!==null){if(p!==null){var T=p.next;p.next=x.next,x.next=T}r.baseQueue=p=x,c.pending=null}if(x=n.baseState,p===null)n.memoizedState=x;else{r=p.next;var O=T=null,V=null,oe=r,he=!1;do{var be=oe.lane&-536870913;if(be!==oe.lane?(ut&be)===be:(mr&be)===be){var ce=oe.revertLane;if(ce===0)V!==null&&(V=V.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),be===hi&&(he=!0);else if((mr&ce)===ce){oe=oe.next,ce===hi&&(he=!0);continue}else be={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},V===null?(O=V=be,T=x):V=V.next=be,Ze.lanes|=ce,Kr|=ce;be=oe.action,Is&&i(x,be),x=oe.hasEagerState?oe.eagerState:i(x,be)}else ce={lane:be,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},V===null?(O=V=ce,T=x):V=V.next=ce,Ze.lanes|=be,Kr|=be;oe=oe.next}while(oe!==null&&oe!==r);if(V===null?T=x:V.next=O,!ia(x,n.memoizedState)&&(ln=!0,he&&(i=pi,i!==null)))throw i;n.memoizedState=x,n.baseState=T,n.baseQueue=V,c.lastRenderedState=x}return p===null&&(c.lanes=0),[n.memoizedState,c.dispatch]}function nf(n){var r=Zt(),i=r.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=n;var c=i.dispatch,p=i.pending,x=r.memoizedState;if(p!==null){i.pending=null;var T=p=p.next;do x=n(x,T.action),T=T.next;while(T!==p);ia(x,r.memoizedState)||(ln=!0),r.memoizedState=x,r.baseQueue===null&&(r.baseState=x),i.lastRenderedState=x}return[x,c]}function S0(n,r,i){var c=Ze,p=Zt(),x=dt;if(x){if(i===void 0)throw Error(s(407));i=i()}else i=r();var T=!ia((At||p).memoizedState,i);if(T&&(p.memoizedState=i,ln=!0),p=p.queue,sf(C0.bind(null,c,p,n),[n]),p.getSnapshot!==r||T||sn!==null&&sn.memoizedState.tag&1){if(c.flags|=2048,Ni(9,{destroy:void 0},w0.bind(null,c,p,i,r),null),Ot===null)throw Error(s(349));x||(mr&127)!==0||A0(c,r,i)}return i}function A0(n,r,i){n.flags|=16384,n={getSnapshot:r,value:i},r=Ze.updateQueue,r===null?(r=gu(),Ze.updateQueue=r,r.stores=[n]):(i=r.stores,i===null?r.stores=[n]:i.push(n))}function w0(n,r,i,c){r.value=i,r.getSnapshot=c,k0(r)&&R0(n)}function C0(n,r,i){return i(function(){k0(r)&&R0(n)})}function k0(n){var r=n.getSnapshot;n=n.value;try{var i=r();return!ia(n,i)}catch{return!0}}function R0(n){var r=_s(n,2);r!==null&&Qn(r,n,2)}function af(n){var r=Ln();if(typeof n=="function"){var i=n;if(n=i(),Is){mn(!0);try{i()}finally{mn(!1)}}}return r.memoizedState=r.baseState=n,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hr,lastRenderedState:n},r}function O0(n,r,i,c){return n.baseState=i,tf(n,At,typeof c=="function"?c:hr)}function o2(n,r,i,c,p){if(Nu(n))throw Error(s(485));if(n=r.action,n!==null){var x={payload:p,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){x.listeners.push(T)}};D.T!==null?i(!0):x.isTransition=!1,c(x),i=r.pending,i===null?(x.next=r.pending=x,I0(r,x)):(x.next=i.next,r.pending=i.next=x)}}function I0(n,r){var i=r.action,c=r.payload,p=n.state;if(r.isTransition){var x=D.T,T={};D.T=T;try{var O=i(p,c),V=D.S;V!==null&&V(T,O),M0(n,r,O)}catch(oe){rf(n,r,oe)}finally{x!==null&&T.types!==null&&(x.types=T.types),D.T=x}}else try{x=i(p,c),M0(n,r,x)}catch(oe){rf(n,r,oe)}}function M0(n,r,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(c){D0(n,r,c)},function(c){return rf(n,r,c)}):D0(n,r,i)}function D0(n,r,i){r.status="fulfilled",r.value=i,L0(r),n.state=i,r=n.pending,r!==null&&(i=r.next,i===r?n.pending=null:(i=i.next,r.next=i,I0(n,i)))}function rf(n,r,i){var c=n.pending;if(n.pending=null,c!==null){c=c.next;do r.status="rejected",r.reason=i,L0(r),r=r.next;while(r!==c)}n.action=null}function L0(n){n=n.listeners;for(var r=0;r<n.length;r++)(0,n[r])()}function j0(n,r){return r}function B0(n,r){if(dt){var i=Ot.formState;if(i!==null){e:{var c=Ze;if(dt){if(Bt){t:{for(var p=Bt,x=_a;p.nodeType!==8;){if(!x){p=null;break t}if(p=Sa(p.nextSibling),p===null){p=null;break t}}x=p.data,p=x==="F!"||x==="F"?p:null}if(p){Bt=Sa(p.nextSibling),c=p.data==="F!";break e}}Pr(c)}c=!1}c&&(r=i[0])}}return i=Ln(),i.memoizedState=i.baseState=r,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:j0,lastRenderedState:r},i.queue=c,i=ng.bind(null,Ze,c),c.dispatch=i,c=af(!1),x=df.bind(null,Ze,!1,c.queue),c=Ln(),p={state:r,dispatch:null,action:n,pending:null},c.queue=p,i=o2.bind(null,Ze,p,x,i),p.dispatch=i,c.memoizedState=n,[r,i,!1]}function P0(n){var r=Zt();return U0(r,At,n)}function U0(n,r,i){if(r=tf(n,r,j0)[0],n=xu(hr)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var c=wl(r)}catch(T){throw T===gi?ou:T}else c=r;r=Zt();var p=r.queue,x=p.dispatch;return i!==r.memoizedState&&(Ze.flags|=2048,Ni(9,{destroy:void 0},u2.bind(null,p,i),null)),[c,x,n]}function u2(n,r){n.action=r}function H0(n){var r=Zt(),i=At;if(i!==null)return U0(r,i,n);Zt(),r=r.memoizedState,i=Zt();var c=i.queue.dispatch;return i.memoizedState=n,[r,c,!1]}function Ni(n,r,i,c){return n={tag:n,create:i,deps:c,inst:r,next:null},r=Ze.updateQueue,r===null&&(r=gu(),Ze.updateQueue=r),i=r.lastEffect,i===null?r.lastEffect=n.next=n:(c=i.next,i.next=n,n.next=c,r.lastEffect=n),n}function F0(){return Zt().memoizedState}function Eu(n,r,i,c){var p=Ln();Ze.flags|=n,p.memoizedState=Ni(1|r,{destroy:void 0},i,c===void 0?null:c)}function yu(n,r,i,c){var p=Zt();c=c===void 0?null:c;var x=p.memoizedState.inst;At!==null&&c!==null&&Xd(c,At.memoizedState.deps)?p.memoizedState=Ni(r,x,i,c):(Ze.flags|=n,p.memoizedState=Ni(1|r,x,i,c))}function z0(n,r){Eu(8390656,8,n,r)}function sf(n,r){yu(2048,8,n,r)}function c2(n){Ze.flags|=4;var r=Ze.updateQueue;if(r===null)r=gu(),Ze.updateQueue=r,r.events=[n];else{var i=r.events;i===null?r.events=[n]:i.push(n)}}function $0(n){var r=Zt().memoizedState;return c2({ref:r,nextImpl:n}),function(){if((bt&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function q0(n,r){return yu(4,2,n,r)}function Y0(n,r){return yu(4,4,n,r)}function G0(n,r){if(typeof r=="function"){n=n();var i=r(n);return function(){typeof i=="function"?i():r(null)}}if(r!=null)return n=n(),r.current=n,function(){r.current=null}}function K0(n,r,i){i=i!=null?i.concat([n]):null,yu(4,4,G0.bind(null,r,n),i)}function lf(){}function V0(n,r){var i=Zt();r=r===void 0?null:r;var c=i.memoizedState;return r!==null&&Xd(r,c[1])?c[0]:(i.memoizedState=[n,r],n)}function X0(n,r){var i=Zt();r=r===void 0?null:r;var c=i.memoizedState;if(r!==null&&Xd(r,c[1]))return c[0];if(c=n(),Is){mn(!0);try{n()}finally{mn(!1)}}return i.memoizedState=[c,r],c}function of(n,r,i){return i===void 0||(mr&1073741824)!==0&&(ut&261930)===0?n.memoizedState=r:(n.memoizedState=i,n=Qg(),Ze.lanes|=n,Kr|=n,i)}function Q0(n,r,i,c){return ia(i,r)?i:xi.current!==null?(n=of(n,i,c),ia(n,r)||(ln=!0),n):(mr&42)===0||(mr&1073741824)!==0&&(ut&261930)===0?(ln=!0,n.memoizedState=i):(n=Qg(),Ze.lanes|=n,Kr|=n,r)}function W0(n,r,i,c,p){var x=P.p;P.p=x!==0&&8>x?x:8;var T=D.T,O={};D.T=O,df(n,!1,r,i);try{var V=p(),oe=D.S;if(oe!==null&&oe(O,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var he=s2(V,c);Cl(n,r,he,fa(n))}else Cl(n,r,c,fa(n))}catch(be){Cl(n,r,{then:function(){},status:"rejected",reason:be},fa())}finally{P.p=x,T!==null&&O.types!==null&&(T.types=O.types),D.T=T}}function d2(){}function uf(n,r,i,c){if(n.tag!==5)throw Error(s(476));var p=Z0(n).queue;W0(n,p,r,ae,i===null?d2:function(){return J0(n),i(c)})}function Z0(n){var r=n.memoizedState;if(r!==null)return r;r={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hr,lastRenderedState:ae},next:null};var i={};return r.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hr,lastRenderedState:i},next:null},n.memoizedState=r,n=n.alternate,n!==null&&(n.memoizedState=r),r}function J0(n){var r=Z0(n);r.next===null&&(r=n.alternate.memoizedState),Cl(n,r.next.queue,{},fa())}function cf(){return yn(Yl)}function eg(){return Zt().memoizedState}function tg(){return Zt().memoizedState}function f2(n){for(var r=n.return;r!==null;){switch(r.tag){case 24:case 3:var i=fa();n=Fr(i);var c=zr(r,n,i);c!==null&&(Qn(c,r,i),_l(c,r,i)),r={cache:Pd()},n.payload=r;return}r=r.return}}function m2(n,r,i){var c=fa();i={lane:c,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Nu(n)?ag(r,i):(i=wd(n,r,i,c),i!==null&&(Qn(i,n,c),rg(i,r,c)))}function ng(n,r,i){var c=fa();Cl(n,r,i,c)}function Cl(n,r,i,c){var p={lane:c,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Nu(n))ag(r,p);else{var x=n.alternate;if(n.lanes===0&&(x===null||x.lanes===0)&&(x=r.lastRenderedReducer,x!==null))try{var T=r.lastRenderedState,O=x(T,i);if(p.hasEagerState=!0,p.eagerState=O,ia(O,T))return tu(n,r,p,0),Ot===null&&eu(),!1}catch{}finally{}if(i=wd(n,r,p,c),i!==null)return Qn(i,n,c),rg(i,r,c),!0}return!1}function df(n,r,i,c){if(c={lane:2,revertLane:$f(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Nu(n)){if(r)throw Error(s(479))}else r=wd(n,i,c,2),r!==null&&Qn(r,n,2)}function Nu(n){var r=n.alternate;return n===Ze||r!==null&&r===Ze}function ag(n,r){Ei=hu=!0;var i=n.pending;i===null?r.next=r:(r.next=i.next,i.next=r),n.pending=r}function rg(n,r,i){if((i&4194048)!==0){var c=r.lanes;c&=n.pendingLanes,i|=c,r.lanes=i,Ye(n,i)}}var kl={readContext:yn,use:bu,useCallback:Yt,useContext:Yt,useEffect:Yt,useImperativeHandle:Yt,useLayoutEffect:Yt,useInsertionEffect:Yt,useMemo:Yt,useReducer:Yt,useRef:Yt,useState:Yt,useDebugValue:Yt,useDeferredValue:Yt,useTransition:Yt,useSyncExternalStore:Yt,useId:Yt,useHostTransitionStatus:Yt,useFormState:Yt,useActionState:Yt,useOptimistic:Yt,useMemoCache:Yt,useCacheRefresh:Yt};kl.useEffectEvent=Yt;var sg={readContext:yn,use:bu,useCallback:function(n,r){return Ln().memoizedState=[n,r===void 0?null:r],n},useContext:yn,useEffect:z0,useImperativeHandle:function(n,r,i){i=i!=null?i.concat([n]):null,Eu(4194308,4,G0.bind(null,r,n),i)},useLayoutEffect:function(n,r){return Eu(4194308,4,n,r)},useInsertionEffect:function(n,r){Eu(4,2,n,r)},useMemo:function(n,r){var i=Ln();r=r===void 0?null:r;var c=n();if(Is){mn(!0);try{n()}finally{mn(!1)}}return i.memoizedState=[c,r],c},useReducer:function(n,r,i){var c=Ln();if(i!==void 0){var p=i(r);if(Is){mn(!0);try{i(r)}finally{mn(!1)}}}else p=r;return c.memoizedState=c.baseState=p,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:p},c.queue=n,n=n.dispatch=m2.bind(null,Ze,n),[c.memoizedState,n]},useRef:function(n){var r=Ln();return n={current:n},r.memoizedState=n},useState:function(n){n=af(n);var r=n.queue,i=ng.bind(null,Ze,r);return r.dispatch=i,[n.memoizedState,i]},useDebugValue:lf,useDeferredValue:function(n,r){var i=Ln();return of(i,n,r)},useTransition:function(){var n=af(!1);return n=W0.bind(null,Ze,n.queue,!0,!1),Ln().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,r,i){var c=Ze,p=Ln();if(dt){if(i===void 0)throw Error(s(407));i=i()}else{if(i=r(),Ot===null)throw Error(s(349));(ut&127)!==0||A0(c,r,i)}p.memoizedState=i;var x={value:i,getSnapshot:r};return p.queue=x,z0(C0.bind(null,c,x,n),[n]),c.flags|=2048,Ni(9,{destroy:void 0},w0.bind(null,c,x,i,r),null),i},useId:function(){var n=Ln(),r=Ot.identifierPrefix;if(dt){var i=qa,c=$a;i=(c&~(1<<32-Et(c)-1)).toString(32)+i,r="_"+r+"R_"+i,i=pu++,0<i&&(r+="H"+i.toString(32)),r+="_"}else i=i2++,r="_"+r+"r_"+i.toString(32)+"_";return n.memoizedState=r},useHostTransitionStatus:cf,useFormState:B0,useActionState:B0,useOptimistic:function(n){var r=Ln();r.memoizedState=r.baseState=n;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=i,r=df.bind(null,Ze,!0,i),i.dispatch=r,[n,r]},useMemoCache:ef,useCacheRefresh:function(){return Ln().memoizedState=f2.bind(null,Ze)},useEffectEvent:function(n){var r=Ln(),i={impl:n};return r.memoizedState=i,function(){if((bt&2)!==0)throw Error(s(440));return i.impl.apply(void 0,arguments)}}},ff={readContext:yn,use:bu,useCallback:V0,useContext:yn,useEffect:sf,useImperativeHandle:K0,useInsertionEffect:q0,useLayoutEffect:Y0,useMemo:X0,useReducer:xu,useRef:F0,useState:function(){return xu(hr)},useDebugValue:lf,useDeferredValue:function(n,r){var i=Zt();return Q0(i,At.memoizedState,n,r)},useTransition:function(){var n=xu(hr)[0],r=Zt().memoizedState;return[typeof n=="boolean"?n:wl(n),r]},useSyncExternalStore:S0,useId:eg,useHostTransitionStatus:cf,useFormState:P0,useActionState:P0,useOptimistic:function(n,r){var i=Zt();return O0(i,At,n,r)},useMemoCache:ef,useCacheRefresh:tg};ff.useEffectEvent=$0;var ig={readContext:yn,use:bu,useCallback:V0,useContext:yn,useEffect:sf,useImperativeHandle:K0,useInsertionEffect:q0,useLayoutEffect:Y0,useMemo:X0,useReducer:nf,useRef:F0,useState:function(){return nf(hr)},useDebugValue:lf,useDeferredValue:function(n,r){var i=Zt();return At===null?of(i,n,r):Q0(i,At.memoizedState,n,r)},useTransition:function(){var n=nf(hr)[0],r=Zt().memoizedState;return[typeof n=="boolean"?n:wl(n),r]},useSyncExternalStore:S0,useId:eg,useHostTransitionStatus:cf,useFormState:H0,useActionState:H0,useOptimistic:function(n,r){var i=Zt();return At!==null?O0(i,At,n,r):(i.baseState=n,[n,i.queue.dispatch])},useMemoCache:ef,useCacheRefresh:tg};ig.useEffectEvent=$0;function mf(n,r,i,c){r=n.memoizedState,i=i(c,r),i=i==null?r:g({},r,i),n.memoizedState=i,n.lanes===0&&(n.updateQueue.baseState=i)}var hf={enqueueSetState:function(n,r,i){n=n._reactInternals;var c=fa(),p=Fr(c);p.payload=r,i!=null&&(p.callback=i),r=zr(n,p,c),r!==null&&(Qn(r,n,c),_l(r,n,c))},enqueueReplaceState:function(n,r,i){n=n._reactInternals;var c=fa(),p=Fr(c);p.tag=1,p.payload=r,i!=null&&(p.callback=i),r=zr(n,p,c),r!==null&&(Qn(r,n,c),_l(r,n,c))},enqueueForceUpdate:function(n,r){n=n._reactInternals;var i=fa(),c=Fr(i);c.tag=2,r!=null&&(c.callback=r),r=zr(n,c,i),r!==null&&(Qn(r,n,i),_l(r,n,i))}};function lg(n,r,i,c,p,x,T){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(c,x,T):r.prototype&&r.prototype.isPureReactComponent?!pl(i,c)||!pl(p,x):!0}function og(n,r,i,c){n=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(i,c),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(i,c),r.state!==n&&hf.enqueueReplaceState(r,r.state,null)}function Ms(n,r){var i=r;if("ref"in r){i={};for(var c in r)c!=="ref"&&(i[c]=r[c])}if(n=n.defaultProps){i===r&&(i=g({},i));for(var p in n)i[p]===void 0&&(i[p]=n[p])}return i}function ug(n){Jo(n)}function cg(n){console.error(n)}function dg(n){Jo(n)}function Tu(n,r){try{var i=n.onUncaughtError;i(r.value,{componentStack:r.stack})}catch(c){setTimeout(function(){throw c})}}function fg(n,r,i){try{var c=n.onCaughtError;c(i.value,{componentStack:i.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function pf(n,r,i){return i=Fr(i),i.tag=3,i.payload={element:null},i.callback=function(){Tu(n,r)},i}function mg(n){return n=Fr(n),n.tag=3,n}function hg(n,r,i,c){var p=i.type.getDerivedStateFromError;if(typeof p=="function"){var x=c.value;n.payload=function(){return p(x)},n.callback=function(){fg(r,i,c)}}var T=i.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(n.callback=function(){fg(r,i,c),typeof p!="function"&&(Vr===null?Vr=new Set([this]):Vr.add(this));var O=c.stack;this.componentDidCatch(c.value,{componentStack:O!==null?O:""})})}function h2(n,r,i,c,p){if(i.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(r=i.alternate,r!==null&&mi(r,i,p,!0),i=oa.current,i!==null){switch(i.tag){case 31:case 13:return va===null?Du():i.alternate===null&&Gt===0&&(Gt=3),i.flags&=-257,i.flags|=65536,i.lanes=p,c===uu?i.flags|=16384:(r=i.updateQueue,r===null?i.updateQueue=new Set([c]):r.add(c),Hf(n,c,p)),!1;case 22:return i.flags|=65536,c===uu?i.flags|=16384:(r=i.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([c])},i.updateQueue=r):(i=r.retryQueue,i===null?r.retryQueue=new Set([c]):i.add(c)),Hf(n,c,p)),!1}throw Error(s(435,i.tag))}return Hf(n,c,p),Du(),!1}if(dt)return r=oa.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=p,c!==Md&&(n=Error(s(422),{cause:c}),xl(ya(n,i)))):(c!==Md&&(r=Error(s(423),{cause:c}),xl(ya(r,i))),n=n.current.alternate,n.flags|=65536,p&=-p,n.lanes|=p,c=ya(c,i),p=pf(n.stateNode,c,p),qd(n,p),Gt!==4&&(Gt=2)),!1;var x=Error(s(520),{cause:c});if(x=ya(x,i),Bl===null?Bl=[x]:Bl.push(x),Gt!==4&&(Gt=2),r===null)return!0;c=ya(c,i),i=r;do{switch(i.tag){case 3:return i.flags|=65536,n=p&-p,i.lanes|=n,n=pf(i.stateNode,c,n),qd(i,n),!1;case 1:if(r=i.type,x=i.stateNode,(i.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Vr===null||!Vr.has(x))))return i.flags|=65536,p&=-p,i.lanes|=p,p=mg(p),hg(p,n,i,c),qd(i,p),!1}i=i.return}while(i!==null);return!1}var gf=Error(s(461)),ln=!1;function Nn(n,r,i,c){r.child=n===null?x0(r,null,i,c):Os(r,n.child,i,c)}function pg(n,r,i,c,p){i=i.render;var x=r.ref;if("ref"in c){var T={};for(var O in c)O!=="ref"&&(T[O]=c[O])}else T=c;return ws(r),c=Qd(n,r,i,T,x,p),O=Wd(),n!==null&&!ln?(Zd(n,r,p),pr(n,r,p)):(dt&&O&&Od(r),r.flags|=1,Nn(n,r,c,p),r.child)}function gg(n,r,i,c,p){if(n===null){var x=i.type;return typeof x=="function"&&!Cd(x)&&x.defaultProps===void 0&&i.compare===null?(r.tag=15,r.type=x,bg(n,r,x,c,p)):(n=au(i.type,null,c,r,r.mode,p),n.ref=r.ref,n.return=r,r.child=n)}if(x=n.child,!vf(n,p)){var T=x.memoizedProps;if(i=i.compare,i=i!==null?i:pl,i(T,c)&&n.ref===r.ref)return pr(n,r,p)}return r.flags|=1,n=ur(x,c),n.ref=r.ref,n.return=r,r.child=n}function bg(n,r,i,c,p){if(n!==null){var x=n.memoizedProps;if(pl(x,c)&&n.ref===r.ref)if(ln=!1,r.pendingProps=c=x,vf(n,p))(n.flags&131072)!==0&&(ln=!0);else return r.lanes=n.lanes,pr(n,r,p)}return bf(n,r,i,c,p)}function xg(n,r,i,c){var p=c.children,x=n!==null?n.memoizedState:null;if(n===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((r.flags&128)!==0){if(x=x!==null?x.baseLanes|i:i,n!==null){for(c=r.child=n.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~x}else c=0,r.child=null;return Eg(n,r,x,i,c)}if((i&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},n!==null&&lu(r,x!==null?x.cachePool:null),x!==null?N0(r,x):Gd(),T0(r);else return c=r.lanes=536870912,Eg(n,r,x!==null?x.baseLanes|i:i,i,c)}else x!==null?(lu(r,x.cachePool),N0(r,x),qr(),r.memoizedState=null):(n!==null&&lu(r,null),Gd(),qr());return Nn(n,r,p,i),r.child}function Rl(n,r){return n!==null&&n.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Eg(n,r,i,c,p){var x=Hd();return x=x===null?null:{parent:rn._currentValue,pool:x},r.memoizedState={baseLanes:i,cachePool:x},n!==null&&lu(r,null),Gd(),T0(r),n!==null&&mi(n,r,c,!0),r.childLanes=p,null}function _u(n,r){return r=Su({mode:r.mode,children:r.children},n.mode),r.ref=n.ref,n.child=r,r.return=n,r}function yg(n,r,i){return Os(r,n.child,null,i),n=_u(r,r.pendingProps),n.flags|=2,ua(r),r.memoizedState=null,n}function p2(n,r,i){var c=r.pendingProps,p=(r.flags&128)!==0;if(r.flags&=-129,n===null){if(dt){if(c.mode==="hidden")return n=_u(r,c),r.lanes=536870912,Rl(null,n);if(Vd(r),(n=Bt)?(n=Ib(n,_a),n=n!==null&&n.data==="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:jr!==null?{id:$a,overflow:qa}:null,retryLane:536870912,hydrationErrors:null},i=a0(n),i.return=r,r.child=i,En=r,Bt=null)):n=null,n===null)throw Pr(r);return r.lanes=536870912,null}return _u(r,c)}var x=n.memoizedState;if(x!==null){var T=x.dehydrated;if(Vd(r),p)if(r.flags&256)r.flags&=-257,r=yg(n,r,i);else if(r.memoizedState!==null)r.child=n.child,r.flags|=128,r=null;else throw Error(s(558));else if(ln||mi(n,r,i,!1),p=(i&n.childLanes)!==0,ln||p){if(c=Ot,c!==null&&(T=Vt(c,i),T!==0&&T!==x.retryLane))throw x.retryLane=T,_s(n,T),Qn(c,n,T),gf;Du(),r=yg(n,r,i)}else n=x.treeContext,Bt=Sa(T.nextSibling),En=r,dt=!0,Br=null,_a=!1,n!==null&&i0(r,n),r=_u(r,c),r.flags|=4096;return r}return n=ur(n.child,{mode:c.mode,children:c.children}),n.ref=r.ref,r.child=n,n.return=r,n}function vu(n,r){var i=r.ref;if(i===null)n!==null&&n.ref!==null&&(r.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(s(284));(n===null||n.ref!==i)&&(r.flags|=4194816)}}function bf(n,r,i,c,p){return ws(r),i=Qd(n,r,i,c,void 0,p),c=Wd(),n!==null&&!ln?(Zd(n,r,p),pr(n,r,p)):(dt&&c&&Od(r),r.flags|=1,Nn(n,r,i,p),r.child)}function Ng(n,r,i,c,p,x){return ws(r),r.updateQueue=null,i=v0(r,c,i,p),_0(n),c=Wd(),n!==null&&!ln?(Zd(n,r,x),pr(n,r,x)):(dt&&c&&Od(r),r.flags|=1,Nn(n,r,i,x),r.child)}function Tg(n,r,i,c,p){if(ws(r),r.stateNode===null){var x=ui,T=i.contextType;typeof T=="object"&&T!==null&&(x=yn(T)),x=new i(c,x),r.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=hf,r.stateNode=x,x._reactInternals=r,x=r.stateNode,x.props=c,x.state=r.memoizedState,x.refs={},zd(r),T=i.contextType,x.context=typeof T=="object"&&T!==null?yn(T):ui,x.state=r.memoizedState,T=i.getDerivedStateFromProps,typeof T=="function"&&(mf(r,i,T,c),x.state=r.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(T=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),T!==x.state&&hf.enqueueReplaceState(x,x.state,null),Sl(r,c,x,p),vl(),x.state=r.memoizedState),typeof x.componentDidMount=="function"&&(r.flags|=4194308),c=!0}else if(n===null){x=r.stateNode;var O=r.memoizedProps,V=Ms(i,O);x.props=V;var oe=x.context,he=i.contextType;T=ui,typeof he=="object"&&he!==null&&(T=yn(he));var be=i.getDerivedStateFromProps;he=typeof be=="function"||typeof x.getSnapshotBeforeUpdate=="function",O=r.pendingProps!==O,he||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(O||oe!==T)&&og(r,x,c,T),Hr=!1;var ce=r.memoizedState;x.state=ce,Sl(r,c,x,p),vl(),oe=r.memoizedState,O||ce!==oe||Hr?(typeof be=="function"&&(mf(r,i,be,c),oe=r.memoizedState),(V=Hr||lg(r,i,V,c,ce,oe,T))?(he||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(r.flags|=4194308)):(typeof x.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=c,r.memoizedState=oe),x.props=c,x.state=oe,x.context=T,c=V):(typeof x.componentDidMount=="function"&&(r.flags|=4194308),c=!1)}else{x=r.stateNode,$d(n,r),T=r.memoizedProps,he=Ms(i,T),x.props=he,be=r.pendingProps,ce=x.context,oe=i.contextType,V=ui,typeof oe=="object"&&oe!==null&&(V=yn(oe)),O=i.getDerivedStateFromProps,(oe=typeof O=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(T!==be||ce!==V)&&og(r,x,c,V),Hr=!1,ce=r.memoizedState,x.state=ce,Sl(r,c,x,p),vl();var de=r.memoizedState;T!==be||ce!==de||Hr||n!==null&&n.dependencies!==null&&su(n.dependencies)?(typeof O=="function"&&(mf(r,i,O,c),de=r.memoizedState),(he=Hr||lg(r,i,he,c,ce,de,V)||n!==null&&n.dependencies!==null&&su(n.dependencies))?(oe||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(c,de,V),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(c,de,V)),typeof x.componentDidUpdate=="function"&&(r.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof x.componentDidUpdate!="function"||T===n.memoizedProps&&ce===n.memoizedState||(r.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||T===n.memoizedProps&&ce===n.memoizedState||(r.flags|=1024),r.memoizedProps=c,r.memoizedState=de),x.props=c,x.state=de,x.context=V,c=he):(typeof x.componentDidUpdate!="function"||T===n.memoizedProps&&ce===n.memoizedState||(r.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||T===n.memoizedProps&&ce===n.memoizedState||(r.flags|=1024),c=!1)}return x=c,vu(n,r),c=(r.flags&128)!==0,x||c?(x=r.stateNode,i=c&&typeof i.getDerivedStateFromError!="function"?null:x.render(),r.flags|=1,n!==null&&c?(r.child=Os(r,n.child,null,p),r.child=Os(r,null,i,p)):Nn(n,r,i,p),r.memoizedState=x.state,n=r.child):n=pr(n,r,p),n}function _g(n,r,i,c){return Ss(),r.flags|=256,Nn(n,r,i,c),r.child}var xf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ef(n){return{baseLanes:n,cachePool:f0()}}function yf(n,r,i){return n=n!==null?n.childLanes&~i:0,r&&(n|=da),n}function vg(n,r,i){var c=r.pendingProps,p=!1,x=(r.flags&128)!==0,T;if((T=x)||(T=n!==null&&n.memoizedState===null?!1:(Wt.current&2)!==0),T&&(p=!0,r.flags&=-129),T=(r.flags&32)!==0,r.flags&=-33,n===null){if(dt){if(p?$r(r):qr(),(n=Bt)?(n=Ib(n,_a),n=n!==null&&n.data!=="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:jr!==null?{id:$a,overflow:qa}:null,retryLane:536870912,hydrationErrors:null},i=a0(n),i.return=r,r.child=i,En=r,Bt=null)):n=null,n===null)throw Pr(r);return nm(n)?r.lanes=32:r.lanes=536870912,null}var O=c.children;return c=c.fallback,p?(qr(),p=r.mode,O=Su({mode:"hidden",children:O},p),c=vs(c,p,i,null),O.return=r,c.return=r,O.sibling=c,r.child=O,c=r.child,c.memoizedState=Ef(i),c.childLanes=yf(n,T,i),r.memoizedState=xf,Rl(null,c)):($r(r),Nf(r,O))}var V=n.memoizedState;if(V!==null&&(O=V.dehydrated,O!==null)){if(x)r.flags&256?($r(r),r.flags&=-257,r=Tf(n,r,i)):r.memoizedState!==null?(qr(),r.child=n.child,r.flags|=128,r=null):(qr(),O=c.fallback,p=r.mode,c=Su({mode:"visible",children:c.children},p),O=vs(O,p,i,null),O.flags|=2,c.return=r,O.return=r,c.sibling=O,r.child=c,Os(r,n.child,null,i),c=r.child,c.memoizedState=Ef(i),c.childLanes=yf(n,T,i),r.memoizedState=xf,r=Rl(null,c));else if($r(r),nm(O)){if(T=O.nextSibling&&O.nextSibling.dataset,T)var oe=T.dgst;T=oe,c=Error(s(419)),c.stack="",c.digest=T,xl({value:c,source:null,stack:null}),r=Tf(n,r,i)}else if(ln||mi(n,r,i,!1),T=(i&n.childLanes)!==0,ln||T){if(T=Ot,T!==null&&(c=Vt(T,i),c!==0&&c!==V.retryLane))throw V.retryLane=c,_s(n,c),Qn(T,n,c),gf;tm(O)||Du(),r=Tf(n,r,i)}else tm(O)?(r.flags|=192,r.child=n.child,r=null):(n=V.treeContext,Bt=Sa(O.nextSibling),En=r,dt=!0,Br=null,_a=!1,n!==null&&i0(r,n),r=Nf(r,c.children),r.flags|=4096);return r}return p?(qr(),O=c.fallback,p=r.mode,V=n.child,oe=V.sibling,c=ur(V,{mode:"hidden",children:c.children}),c.subtreeFlags=V.subtreeFlags&65011712,oe!==null?O=ur(oe,O):(O=vs(O,p,i,null),O.flags|=2),O.return=r,c.return=r,c.sibling=O,r.child=c,Rl(null,c),c=r.child,O=n.child.memoizedState,O===null?O=Ef(i):(p=O.cachePool,p!==null?(V=rn._currentValue,p=p.parent!==V?{parent:V,pool:V}:p):p=f0(),O={baseLanes:O.baseLanes|i,cachePool:p}),c.memoizedState=O,c.childLanes=yf(n,T,i),r.memoizedState=xf,Rl(n.child,c)):($r(r),i=n.child,n=i.sibling,i=ur(i,{mode:"visible",children:c.children}),i.return=r,i.sibling=null,n!==null&&(T=r.deletions,T===null?(r.deletions=[n],r.flags|=16):T.push(n)),r.child=i,r.memoizedState=null,i)}function Nf(n,r){return r=Su({mode:"visible",children:r},n.mode),r.return=n,n.child=r}function Su(n,r){return n=la(22,n,null,r),n.lanes=0,n}function Tf(n,r,i){return Os(r,n.child,null,i),n=Nf(r,r.pendingProps.children),n.flags|=2,r.memoizedState=null,n}function Sg(n,r,i){n.lanes|=r;var c=n.alternate;c!==null&&(c.lanes|=r),jd(n.return,r,i)}function _f(n,r,i,c,p,x){var T=n.memoizedState;T===null?n.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:c,tail:i,tailMode:p,treeForkCount:x}:(T.isBackwards=r,T.rendering=null,T.renderingStartTime=0,T.last=c,T.tail=i,T.tailMode=p,T.treeForkCount=x)}function Ag(n,r,i){var c=r.pendingProps,p=c.revealOrder,x=c.tail;c=c.children;var T=Wt.current,O=(T&2)!==0;if(O?(T=T&1|2,r.flags|=128):T&=1,M(Wt,T),Nn(n,r,c,i),c=dt?bl:0,!O&&n!==null&&(n.flags&128)!==0)e:for(n=r.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Sg(n,i,r);else if(n.tag===19)Sg(n,i,r);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===r)break e;for(;n.sibling===null;){if(n.return===null||n.return===r)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(p){case"forwards":for(i=r.child,p=null;i!==null;)n=i.alternate,n!==null&&mu(n)===null&&(p=i),i=i.sibling;i=p,i===null?(p=r.child,r.child=null):(p=i.sibling,i.sibling=null),_f(r,!1,p,i,x,c);break;case"backwards":case"unstable_legacy-backwards":for(i=null,p=r.child,r.child=null;p!==null;){if(n=p.alternate,n!==null&&mu(n)===null){r.child=p;break}n=p.sibling,p.sibling=i,i=p,p=n}_f(r,!0,i,null,x,c);break;case"together":_f(r,!1,null,null,void 0,c);break;default:r.memoizedState=null}return r.child}function pr(n,r,i){if(n!==null&&(r.dependencies=n.dependencies),Kr|=r.lanes,(i&r.childLanes)===0)if(n!==null){if(mi(n,r,i,!1),(i&r.childLanes)===0)return null}else return null;if(n!==null&&r.child!==n.child)throw Error(s(153));if(r.child!==null){for(n=r.child,i=ur(n,n.pendingProps),r.child=i,i.return=r;n.sibling!==null;)n=n.sibling,i=i.sibling=ur(n,n.pendingProps),i.return=r;i.sibling=null}return r.child}function vf(n,r){return(n.lanes&r)!==0?!0:(n=n.dependencies,!!(n!==null&&su(n)))}function g2(n,r,i){switch(r.tag){case 3:tt(r,r.stateNode.containerInfo),Ur(r,rn,n.memoizedState.cache),Ss();break;case 27:case 5:vt(r);break;case 4:tt(r,r.stateNode.containerInfo);break;case 10:Ur(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Vd(r),null;break;case 13:var c=r.memoizedState;if(c!==null)return c.dehydrated!==null?($r(r),r.flags|=128,null):(i&r.child.childLanes)!==0?vg(n,r,i):($r(r),n=pr(n,r,i),n!==null?n.sibling:null);$r(r);break;case 19:var p=(n.flags&128)!==0;if(c=(i&r.childLanes)!==0,c||(mi(n,r,i,!1),c=(i&r.childLanes)!==0),p){if(c)return Ag(n,r,i);r.flags|=128}if(p=r.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),M(Wt,Wt.current),c)break;return null;case 22:return r.lanes=0,xg(n,r,i,r.pendingProps);case 24:Ur(r,rn,n.memoizedState.cache)}return pr(n,r,i)}function wg(n,r,i){if(n!==null)if(n.memoizedProps!==r.pendingProps)ln=!0;else{if(!vf(n,i)&&(r.flags&128)===0)return ln=!1,g2(n,r,i);ln=(n.flags&131072)!==0}else ln=!1,dt&&(r.flags&1048576)!==0&&s0(r,bl,r.index);switch(r.lanes=0,r.tag){case 16:e:{var c=r.pendingProps;if(n=ks(r.elementType),r.type=n,typeof n=="function")Cd(n)?(c=Ms(n,c),r.tag=1,r=Tg(null,r,n,c,i)):(r.tag=0,r=bf(null,r,n,c,i));else{if(n!=null){var p=n.$$typeof;if(p===Y){r.tag=11,r=pg(null,r,n,c,i);break e}else if(p===z){r.tag=14,r=gg(null,r,n,c,i);break e}}throw r=q(n)||n,Error(s(306,r,""))}}return r;case 0:return bf(n,r,r.type,r.pendingProps,i);case 1:return c=r.type,p=Ms(c,r.pendingProps),Tg(n,r,c,p,i);case 3:e:{if(tt(r,r.stateNode.containerInfo),n===null)throw Error(s(387));c=r.pendingProps;var x=r.memoizedState;p=x.element,$d(n,r),Sl(r,c,null,i);var T=r.memoizedState;if(c=T.cache,Ur(r,rn,c),c!==x.cache&&Bd(r,[rn],i,!0),vl(),c=T.element,x.isDehydrated)if(x={element:c,isDehydrated:!1,cache:T.cache},r.updateQueue.baseState=x,r.memoizedState=x,r.flags&256){r=_g(n,r,c,i);break e}else if(c!==p){p=ya(Error(s(424)),r),xl(p),r=_g(n,r,c,i);break e}else{switch(n=r.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(Bt=Sa(n.firstChild),En=r,dt=!0,Br=null,_a=!0,i=x0(r,null,c,i),r.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(Ss(),c===p){r=pr(n,r,i);break e}Nn(n,r,c,i)}r=r.child}return r;case 26:return vu(n,r),n===null?(i=Pb(r.type,null,r.pendingProps,null))?r.memoizedState=i:dt||(i=r.type,n=r.pendingProps,c=Fu(Ne.current).createElement(i),c[Xt]=r,c[_n]=n,Tn(c,i,n),nn(c),r.stateNode=c):r.memoizedState=Pb(r.type,n.memoizedProps,r.pendingProps,n.memoizedState),null;case 27:return vt(r),n===null&&dt&&(c=r.stateNode=Lb(r.type,r.pendingProps,Ne.current),En=r,_a=!0,p=Bt,Zr(r.type)?(am=p,Bt=Sa(c.firstChild)):Bt=p),Nn(n,r,r.pendingProps.children,i),vu(n,r),n===null&&(r.flags|=4194304),r.child;case 5:return n===null&&dt&&((p=c=Bt)&&(c=G2(c,r.type,r.pendingProps,_a),c!==null?(r.stateNode=c,En=r,Bt=Sa(c.firstChild),_a=!1,p=!0):p=!1),p||Pr(r)),vt(r),p=r.type,x=r.pendingProps,T=n!==null?n.memoizedProps:null,c=x.children,Zf(p,x)?c=null:T!==null&&Zf(p,T)&&(r.flags|=32),r.memoizedState!==null&&(p=Qd(n,r,l2,null,null,i),Yl._currentValue=p),vu(n,r),Nn(n,r,c,i),r.child;case 6:return n===null&&dt&&((n=i=Bt)&&(i=K2(i,r.pendingProps,_a),i!==null?(r.stateNode=i,En=r,Bt=null,n=!0):n=!1),n||Pr(r)),null;case 13:return vg(n,r,i);case 4:return tt(r,r.stateNode.containerInfo),c=r.pendingProps,n===null?r.child=Os(r,null,c,i):Nn(n,r,c,i),r.child;case 11:return pg(n,r,r.type,r.pendingProps,i);case 7:return Nn(n,r,r.pendingProps,i),r.child;case 8:return Nn(n,r,r.pendingProps.children,i),r.child;case 12:return Nn(n,r,r.pendingProps.children,i),r.child;case 10:return c=r.pendingProps,Ur(r,r.type,c.value),Nn(n,r,c.children,i),r.child;case 9:return p=r.type._context,c=r.pendingProps.children,ws(r),p=yn(p),c=c(p),r.flags|=1,Nn(n,r,c,i),r.child;case 14:return gg(n,r,r.type,r.pendingProps,i);case 15:return bg(n,r,r.type,r.pendingProps,i);case 19:return Ag(n,r,i);case 31:return p2(n,r,i);case 22:return xg(n,r,i,r.pendingProps);case 24:return ws(r),c=yn(rn),n===null?(p=Hd(),p===null&&(p=Ot,x=Pd(),p.pooledCache=x,x.refCount++,x!==null&&(p.pooledCacheLanes|=i),p=x),r.memoizedState={parent:c,cache:p},zd(r),Ur(r,rn,p)):((n.lanes&i)!==0&&($d(n,r),Sl(r,null,null,i),vl()),p=n.memoizedState,x=r.memoizedState,p.parent!==c?(p={parent:c,cache:c},r.memoizedState=p,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=p),Ur(r,rn,c)):(c=x.cache,Ur(r,rn,c),c!==p.cache&&Bd(r,[rn],i,!0))),Nn(n,r,r.pendingProps.children,i),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function gr(n){n.flags|=4}function Sf(n,r,i,c,p){if((r=(n.mode&32)!==0)&&(r=!1),r){if(n.flags|=16777216,(p&335544128)===p)if(n.stateNode.complete)n.flags|=8192;else if(eb())n.flags|=8192;else throw Rs=uu,Fd}else n.flags&=-16777217}function Cg(n,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!$b(r))if(eb())n.flags|=8192;else throw Rs=uu,Fd}function Au(n,r){r!==null&&(n.flags|=4),n.flags&16384&&(r=n.tag!==22?Ke():536870912,n.lanes|=r,Si|=r)}function Ol(n,r){if(!dt)switch(n.tailMode){case"hidden":r=n.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?n.tail=null:i.sibling=null;break;case"collapsed":i=n.tail;for(var c=null;i!==null;)i.alternate!==null&&(c=i),i=i.sibling;c===null?r||n.tail===null?n.tail=null:n.tail.sibling=null:c.sibling=null}}function Pt(n){var r=n.alternate!==null&&n.alternate.child===n.child,i=0,c=0;if(r)for(var p=n.child;p!==null;)i|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=n,p=p.sibling;else for(p=n.child;p!==null;)i|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=n,p=p.sibling;return n.subtreeFlags|=c,n.childLanes=i,r}function b2(n,r,i){var c=r.pendingProps;switch(Id(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pt(r),null;case 1:return Pt(r),null;case 3:return i=r.stateNode,c=null,n!==null&&(c=n.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),fr(rn),et(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(n===null||n.child===null)&&(fi(r)?gr(r):n===null||n.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Dd())),Pt(r),null;case 26:var p=r.type,x=r.memoizedState;return n===null?(gr(r),x!==null?(Pt(r),Cg(r,x)):(Pt(r),Sf(r,p,null,c,i))):x?x!==n.memoizedState?(gr(r),Pt(r),Cg(r,x)):(Pt(r),r.flags&=-16777217):(n=n.memoizedProps,n!==c&&gr(r),Pt(r),Sf(r,p,n,c,i)),null;case 27:if(en(r),i=Ne.current,p=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==c&&gr(r);else{if(!c){if(r.stateNode===null)throw Error(s(166));return Pt(r),null}n=ye.current,fi(r)?l0(r):(n=Lb(p,c,i),r.stateNode=n,gr(r))}return Pt(r),null;case 5:if(en(r),p=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==c&&gr(r);else{if(!c){if(r.stateNode===null)throw Error(s(166));return Pt(r),null}if(x=ye.current,fi(r))l0(r);else{var T=Fu(Ne.current);switch(x){case 1:x=T.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:x=T.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":x=T.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":x=T.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":x=T.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof c.is=="string"?T.createElement("select",{is:c.is}):T.createElement("select"),c.multiple?x.multiple=!0:c.size&&(x.size=c.size);break;default:x=typeof c.is=="string"?T.createElement(p,{is:c.is}):T.createElement(p)}}x[Xt]=r,x[_n]=c;e:for(T=r.child;T!==null;){if(T.tag===5||T.tag===6)x.appendChild(T.stateNode);else if(T.tag!==4&&T.tag!==27&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===r)break e;for(;T.sibling===null;){if(T.return===null||T.return===r)break e;T=T.return}T.sibling.return=T.return,T=T.sibling}r.stateNode=x;e:switch(Tn(x,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&gr(r)}}return Pt(r),Sf(r,r.type,n===null?null:n.memoizedProps,r.pendingProps,i),null;case 6:if(n&&r.stateNode!=null)n.memoizedProps!==c&&gr(r);else{if(typeof c!="string"&&r.stateNode===null)throw Error(s(166));if(n=Ne.current,fi(r)){if(n=r.stateNode,i=r.memoizedProps,c=null,p=En,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}n[Xt]=r,n=!!(n.nodeValue===i||c!==null&&c.suppressHydrationWarning===!0||vb(n.nodeValue,i)),n||Pr(r,!0)}else n=Fu(n).createTextNode(c),n[Xt]=r,r.stateNode=n}return Pt(r),null;case 31:if(i=r.memoizedState,n===null||n.memoizedState!==null){if(c=fi(r),i!==null){if(n===null){if(!c)throw Error(s(318));if(n=r.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(557));n[Xt]=r}else Ss(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Pt(r),n=!1}else i=Dd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=i),n=!0;if(!n)return r.flags&256?(ua(r),r):(ua(r),null);if((r.flags&128)!==0)throw Error(s(558))}return Pt(r),null;case 13:if(c=r.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(p=fi(r),c!==null&&c.dehydrated!==null){if(n===null){if(!p)throw Error(s(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(s(317));p[Xt]=r}else Ss(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Pt(r),p=!1}else p=Dd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=p),p=!0;if(!p)return r.flags&256?(ua(r),r):(ua(r),null)}return ua(r),(r.flags&128)!==0?(r.lanes=i,r):(i=c!==null,n=n!==null&&n.memoizedState!==null,i&&(c=r.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),x=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(x=c.memoizedState.cachePool.pool),x!==p&&(c.flags|=2048)),i!==n&&i&&(r.child.flags|=8192),Au(r,r.updateQueue),Pt(r),null);case 4:return et(),n===null&&Kf(r.stateNode.containerInfo),Pt(r),null;case 10:return fr(r.type),Pt(r),null;case 19:if(ie(Wt),c=r.memoizedState,c===null)return Pt(r),null;if(p=(r.flags&128)!==0,x=c.rendering,x===null)if(p)Ol(c,!1);else{if(Gt!==0||n!==null&&(n.flags&128)!==0)for(n=r.child;n!==null;){if(x=mu(n),x!==null){for(r.flags|=128,Ol(c,!1),n=x.updateQueue,r.updateQueue=n,Au(r,n),r.subtreeFlags=0,n=i,i=r.child;i!==null;)n0(i,n),i=i.sibling;return M(Wt,Wt.current&1|2),dt&&cr(r,c.treeForkCount),r.child}n=n.sibling}c.tail!==null&&St()>Ou&&(r.flags|=128,p=!0,Ol(c,!1),r.lanes=4194304)}else{if(!p)if(n=mu(x),n!==null){if(r.flags|=128,p=!0,n=n.updateQueue,r.updateQueue=n,Au(r,n),Ol(c,!0),c.tail===null&&c.tailMode==="hidden"&&!x.alternate&&!dt)return Pt(r),null}else 2*St()-c.renderingStartTime>Ou&&i!==536870912&&(r.flags|=128,p=!0,Ol(c,!1),r.lanes=4194304);c.isBackwards?(x.sibling=r.child,r.child=x):(n=c.last,n!==null?n.sibling=x:r.child=x,c.last=x)}return c.tail!==null?(n=c.tail,c.rendering=n,c.tail=n.sibling,c.renderingStartTime=St(),n.sibling=null,i=Wt.current,M(Wt,p?i&1|2:i&1),dt&&cr(r,c.treeForkCount),n):(Pt(r),null);case 22:case 23:return ua(r),Kd(),c=r.memoizedState!==null,n!==null?n.memoizedState!==null!==c&&(r.flags|=8192):c&&(r.flags|=8192),c?(i&536870912)!==0&&(r.flags&128)===0&&(Pt(r),r.subtreeFlags&6&&(r.flags|=8192)):Pt(r),i=r.updateQueue,i!==null&&Au(r,i.retryQueue),i=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),c=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),c!==i&&(r.flags|=2048),n!==null&&ie(Cs),null;case 24:return i=null,n!==null&&(i=n.memoizedState.cache),r.memoizedState.cache!==i&&(r.flags|=2048),fr(rn),Pt(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function x2(n,r){switch(Id(r),r.tag){case 1:return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 3:return fr(rn),et(),n=r.flags,(n&65536)!==0&&(n&128)===0?(r.flags=n&-65537|128,r):null;case 26:case 27:case 5:return en(r),null;case 31:if(r.memoizedState!==null){if(ua(r),r.alternate===null)throw Error(s(340));Ss()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 13:if(ua(r),n=r.memoizedState,n!==null&&n.dehydrated!==null){if(r.alternate===null)throw Error(s(340));Ss()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 19:return ie(Wt),null;case 4:return et(),null;case 10:return fr(r.type),null;case 22:case 23:return ua(r),Kd(),n!==null&&ie(Cs),n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 24:return fr(rn),null;case 25:return null;default:return null}}function kg(n,r){switch(Id(r),r.tag){case 3:fr(rn),et();break;case 26:case 27:case 5:en(r);break;case 4:et();break;case 31:r.memoizedState!==null&&ua(r);break;case 13:ua(r);break;case 19:ie(Wt);break;case 10:fr(r.type);break;case 22:case 23:ua(r),Kd(),n!==null&&ie(Cs);break;case 24:fr(rn)}}function Il(n,r){try{var i=r.updateQueue,c=i!==null?i.lastEffect:null;if(c!==null){var p=c.next;i=p;do{if((i.tag&n)===n){c=void 0;var x=i.create,T=i.inst;c=x(),T.destroy=c}i=i.next}while(i!==p)}}catch(O){_t(r,r.return,O)}}function Yr(n,r,i){try{var c=r.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var x=p.next;c=x;do{if((c.tag&n)===n){var T=c.inst,O=T.destroy;if(O!==void 0){T.destroy=void 0,p=r;var V=i,oe=O;try{oe()}catch(he){_t(p,V,he)}}}c=c.next}while(c!==x)}}catch(he){_t(r,r.return,he)}}function Rg(n){var r=n.updateQueue;if(r!==null){var i=n.stateNode;try{y0(r,i)}catch(c){_t(n,n.return,c)}}}function Og(n,r,i){i.props=Ms(n.type,n.memoizedProps),i.state=n.memoizedState;try{i.componentWillUnmount()}catch(c){_t(n,r,c)}}function Ml(n,r){try{var i=n.ref;if(i!==null){switch(n.tag){case 26:case 27:case 5:var c=n.stateNode;break;case 30:c=n.stateNode;break;default:c=n.stateNode}typeof i=="function"?n.refCleanup=i(c):i.current=c}}catch(p){_t(n,r,p)}}function Ya(n,r){var i=n.ref,c=n.refCleanup;if(i!==null)if(typeof c=="function")try{c()}catch(p){_t(n,r,p)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(p){_t(n,r,p)}else i.current=null}function Ig(n){var r=n.type,i=n.memoizedProps,c=n.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":i.autoFocus&&c.focus();break e;case"img":i.src?c.src=i.src:i.srcSet&&(c.srcset=i.srcSet)}}catch(p){_t(n,n.return,p)}}function Af(n,r,i){try{var c=n.stateNode;H2(c,n.type,i,r),c[_n]=r}catch(p){_t(n,n.return,p)}}function Mg(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Zr(n.type)||n.tag===4}function wf(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Mg(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Zr(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Cf(n,r,i){var c=n.tag;if(c===5||c===6)n=n.stateNode,r?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(n,r):(r=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,r.appendChild(n),i=i._reactRootContainer,i!=null||r.onclick!==null||(r.onclick=we));else if(c!==4&&(c===27&&Zr(n.type)&&(i=n.stateNode,r=null),n=n.child,n!==null))for(Cf(n,r,i),n=n.sibling;n!==null;)Cf(n,r,i),n=n.sibling}function wu(n,r,i){var c=n.tag;if(c===5||c===6)n=n.stateNode,r?i.insertBefore(n,r):i.appendChild(n);else if(c!==4&&(c===27&&Zr(n.type)&&(i=n.stateNode),n=n.child,n!==null))for(wu(n,r,i),n=n.sibling;n!==null;)wu(n,r,i),n=n.sibling}function Dg(n){var r=n.stateNode,i=n.memoizedProps;try{for(var c=n.type,p=r.attributes;p.length;)r.removeAttributeNode(p[0]);Tn(r,c,i),r[Xt]=n,r[_n]=i}catch(x){_t(n,n.return,x)}}var br=!1,on=!1,kf=!1,Lg=typeof WeakSet=="function"?WeakSet:Set,hn=null;function E2(n,r){if(n=n.containerInfo,Qf=Vu,n=Kp(n),Nd(n)){if("selectionStart"in n)var i={start:n.selectionStart,end:n.selectionEnd};else e:{i=(i=n.ownerDocument)&&i.defaultView||window;var c=i.getSelection&&i.getSelection();if(c&&c.rangeCount!==0){i=c.anchorNode;var p=c.anchorOffset,x=c.focusNode;c=c.focusOffset;try{i.nodeType,x.nodeType}catch{i=null;break e}var T=0,O=-1,V=-1,oe=0,he=0,be=n,ce=null;t:for(;;){for(var de;be!==i||p!==0&&be.nodeType!==3||(O=T+p),be!==x||c!==0&&be.nodeType!==3||(V=T+c),be.nodeType===3&&(T+=be.nodeValue.length),(de=be.firstChild)!==null;)ce=be,be=de;for(;;){if(be===n)break t;if(ce===i&&++oe===p&&(O=T),ce===x&&++he===c&&(V=T),(de=be.nextSibling)!==null)break;be=ce,ce=be.parentNode}be=de}i=O===-1||V===-1?null:{start:O,end:V}}else i=null}i=i||{start:0,end:0}}else i=null;for(Wf={focusedElem:n,selectionRange:i},Vu=!1,hn=r;hn!==null;)if(r=hn,n=r.child,(r.subtreeFlags&1028)!==0&&n!==null)n.return=r,hn=n;else for(;hn!==null;){switch(r=hn,x=r.alternate,n=r.flags,r.tag){case 0:if((n&4)!==0&&(n=r.updateQueue,n=n!==null?n.events:null,n!==null))for(i=0;i<n.length;i++)p=n[i],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&x!==null){n=void 0,i=r,p=x.memoizedProps,x=x.memoizedState,c=i.stateNode;try{var Me=Ms(i.type,p);n=c.getSnapshotBeforeUpdate(Me,x),c.__reactInternalSnapshotBeforeUpdate=n}catch($e){_t(i,i.return,$e)}}break;case 3:if((n&1024)!==0){if(n=r.stateNode.containerInfo,i=n.nodeType,i===9)em(n);else if(i===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":em(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(s(163))}if(n=r.sibling,n!==null){n.return=r.return,hn=n;break}hn=r.return}}function jg(n,r,i){var c=i.flags;switch(i.tag){case 0:case 11:case 15:Er(n,i),c&4&&Il(5,i);break;case 1:if(Er(n,i),c&4)if(n=i.stateNode,r===null)try{n.componentDidMount()}catch(T){_t(i,i.return,T)}else{var p=Ms(i.type,r.memoizedProps);r=r.memoizedState;try{n.componentDidUpdate(p,r,n.__reactInternalSnapshotBeforeUpdate)}catch(T){_t(i,i.return,T)}}c&64&&Rg(i),c&512&&Ml(i,i.return);break;case 3:if(Er(n,i),c&64&&(n=i.updateQueue,n!==null)){if(r=null,i.child!==null)switch(i.child.tag){case 27:case 5:r=i.child.stateNode;break;case 1:r=i.child.stateNode}try{y0(n,r)}catch(T){_t(i,i.return,T)}}break;case 27:r===null&&c&4&&Dg(i);case 26:case 5:Er(n,i),r===null&&c&4&&Ig(i),c&512&&Ml(i,i.return);break;case 12:Er(n,i);break;case 31:Er(n,i),c&4&&Ug(n,i);break;case 13:Er(n,i),c&4&&Hg(n,i),c&64&&(n=i.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(i=C2.bind(null,i),V2(n,i))));break;case 22:if(c=i.memoizedState!==null||br,!c){r=r!==null&&r.memoizedState!==null||on,p=br;var x=on;br=c,(on=r)&&!x?yr(n,i,(i.subtreeFlags&8772)!==0):Er(n,i),br=p,on=x}break;case 30:break;default:Er(n,i)}}function Bg(n){var r=n.alternate;r!==null&&(n.alternate=null,Bg(r)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(r=n.stateNode,r!==null&&al(r)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var Ft=null,Gn=!1;function xr(n,r,i){for(i=i.child;i!==null;)Pg(n,r,i),i=i.sibling}function Pg(n,r,i){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(tn,i)}catch{}switch(i.tag){case 26:on||Ya(i,r),xr(n,r,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:on||Ya(i,r);var c=Ft,p=Gn;Zr(i.type)&&(Ft=i.stateNode,Gn=!1),xr(n,r,i),zl(i.stateNode),Ft=c,Gn=p;break;case 5:on||Ya(i,r);case 6:if(c=Ft,p=Gn,Ft=null,xr(n,r,i),Ft=c,Gn=p,Ft!==null)if(Gn)try{(Ft.nodeType===9?Ft.body:Ft.nodeName==="HTML"?Ft.ownerDocument.body:Ft).removeChild(i.stateNode)}catch(x){_t(i,r,x)}else try{Ft.removeChild(i.stateNode)}catch(x){_t(i,r,x)}break;case 18:Ft!==null&&(Gn?(n=Ft,Rb(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,i.stateNode),Mi(n)):Rb(Ft,i.stateNode));break;case 4:c=Ft,p=Gn,Ft=i.stateNode.containerInfo,Gn=!0,xr(n,r,i),Ft=c,Gn=p;break;case 0:case 11:case 14:case 15:Yr(2,i,r),on||Yr(4,i,r),xr(n,r,i);break;case 1:on||(Ya(i,r),c=i.stateNode,typeof c.componentWillUnmount=="function"&&Og(i,r,c)),xr(n,r,i);break;case 21:xr(n,r,i);break;case 22:on=(c=on)||i.memoizedState!==null,xr(n,r,i),on=c;break;default:xr(n,r,i)}}function Ug(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{Mi(n)}catch(i){_t(r,r.return,i)}}}function Hg(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Mi(n)}catch(i){_t(r,r.return,i)}}function y2(n){switch(n.tag){case 31:case 13:case 19:var r=n.stateNode;return r===null&&(r=n.stateNode=new Lg),r;case 22:return n=n.stateNode,r=n._retryCache,r===null&&(r=n._retryCache=new Lg),r;default:throw Error(s(435,n.tag))}}function Cu(n,r){var i=y2(n);r.forEach(function(c){if(!i.has(c)){i.add(c);var p=k2.bind(null,n,c);c.then(p,p)}})}function Kn(n,r){var i=r.deletions;if(i!==null)for(var c=0;c<i.length;c++){var p=i[c],x=n,T=r,O=T;e:for(;O!==null;){switch(O.tag){case 27:if(Zr(O.type)){Ft=O.stateNode,Gn=!1;break e}break;case 5:Ft=O.stateNode,Gn=!1;break e;case 3:case 4:Ft=O.stateNode.containerInfo,Gn=!0;break e}O=O.return}if(Ft===null)throw Error(s(160));Pg(x,T,p),Ft=null,Gn=!1,x=p.alternate,x!==null&&(x.return=null),p.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Fg(r,n),r=r.sibling}var Da=null;function Fg(n,r){var i=n.alternate,c=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:Kn(r,n),Vn(n),c&4&&(Yr(3,n,n.return),Il(3,n),Yr(5,n,n.return));break;case 1:Kn(r,n),Vn(n),c&512&&(on||i===null||Ya(i,i.return)),c&64&&br&&(n=n.updateQueue,n!==null&&(c=n.callbacks,c!==null&&(i=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=i===null?c:i.concat(c))));break;case 26:var p=Da;if(Kn(r,n),Vn(n),c&512&&(on||i===null||Ya(i,i.return)),c&4){var x=i!==null?i.memoizedState:null;if(c=n.memoizedState,i===null)if(c===null)if(n.stateNode===null){e:{c=n.type,i=n.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":x=p.getElementsByTagName("title")[0],(!x||x[bs]||x[Xt]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=p.createElement(c),p.head.insertBefore(x,p.querySelector("head > title"))),Tn(x,c,i),x[Xt]=n,nn(x),c=x;break e;case"link":var T=Fb("link","href",p).get(c+(i.href||""));if(T){for(var O=0;O<T.length;O++)if(x=T[O],x.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&x.getAttribute("rel")===(i.rel==null?null:i.rel)&&x.getAttribute("title")===(i.title==null?null:i.title)&&x.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){T.splice(O,1);break t}}x=p.createElement(c),Tn(x,c,i),p.head.appendChild(x);break;case"meta":if(T=Fb("meta","content",p).get(c+(i.content||""))){for(O=0;O<T.length;O++)if(x=T[O],x.getAttribute("content")===(i.content==null?null:""+i.content)&&x.getAttribute("name")===(i.name==null?null:i.name)&&x.getAttribute("property")===(i.property==null?null:i.property)&&x.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&x.getAttribute("charset")===(i.charSet==null?null:i.charSet)){T.splice(O,1);break t}}x=p.createElement(c),Tn(x,c,i),p.head.appendChild(x);break;default:throw Error(s(468,c))}x[Xt]=n,nn(x),c=x}n.stateNode=c}else zb(p,n.type,n.stateNode);else n.stateNode=Hb(p,c,n.memoizedProps);else x!==c?(x===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):x.count--,c===null?zb(p,n.type,n.stateNode):Hb(p,c,n.memoizedProps)):c===null&&n.stateNode!==null&&Af(n,n.memoizedProps,i.memoizedProps)}break;case 27:Kn(r,n),Vn(n),c&512&&(on||i===null||Ya(i,i.return)),i!==null&&c&4&&Af(n,n.memoizedProps,i.memoizedProps);break;case 5:if(Kn(r,n),Vn(n),c&512&&(on||i===null||Ya(i,i.return)),n.flags&32){p=n.stateNode;try{qe(p,"")}catch(Me){_t(n,n.return,Me)}}c&4&&n.stateNode!=null&&(p=n.memoizedProps,Af(n,p,i!==null?i.memoizedProps:p)),c&1024&&(kf=!0);break;case 6:if(Kn(r,n),Vn(n),c&4){if(n.stateNode===null)throw Error(s(162));c=n.memoizedProps,i=n.stateNode;try{i.nodeValue=c}catch(Me){_t(n,n.return,Me)}}break;case 3:if(qu=null,p=Da,Da=zu(r.containerInfo),Kn(r,n),Da=p,Vn(n),c&4&&i!==null&&i.memoizedState.isDehydrated)try{Mi(r.containerInfo)}catch(Me){_t(n,n.return,Me)}kf&&(kf=!1,zg(n));break;case 4:c=Da,Da=zu(n.stateNode.containerInfo),Kn(r,n),Vn(n),Da=c;break;case 12:Kn(r,n),Vn(n);break;case 31:Kn(r,n),Vn(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,Cu(n,c)));break;case 13:Kn(r,n),Vn(n),n.child.flags&8192&&n.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Ru=St()),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,Cu(n,c)));break;case 22:p=n.memoizedState!==null;var V=i!==null&&i.memoizedState!==null,oe=br,he=on;if(br=oe||p,on=he||V,Kn(r,n),on=he,br=oe,Vn(n),c&8192)e:for(r=n.stateNode,r._visibility=p?r._visibility&-2:r._visibility|1,p&&(i===null||V||br||on||Ds(n)),i=null,r=n;;){if(r.tag===5||r.tag===26){if(i===null){V=i=r;try{if(x=V.stateNode,p)T=x.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{O=V.stateNode;var be=V.memoizedProps.style,ce=be!=null&&be.hasOwnProperty("display")?be.display:null;O.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(Me){_t(V,V.return,Me)}}}else if(r.tag===6){if(i===null){V=r;try{V.stateNode.nodeValue=p?"":V.memoizedProps}catch(Me){_t(V,V.return,Me)}}}else if(r.tag===18){if(i===null){V=r;try{var de=V.stateNode;p?Ob(de,!0):Ob(V.stateNode,!1)}catch(Me){_t(V,V.return,Me)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===n)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break e;for(;r.sibling===null;){if(r.return===null||r.return===n)break e;i===r&&(i=null),r=r.return}i===r&&(i=null),r.sibling.return=r.return,r=r.sibling}c&4&&(c=n.updateQueue,c!==null&&(i=c.retryQueue,i!==null&&(c.retryQueue=null,Cu(n,i))));break;case 19:Kn(r,n),Vn(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,Cu(n,c)));break;case 30:break;case 21:break;default:Kn(r,n),Vn(n)}}function Vn(n){var r=n.flags;if(r&2){try{for(var i,c=n.return;c!==null;){if(Mg(c)){i=c;break}c=c.return}if(i==null)throw Error(s(160));switch(i.tag){case 27:var p=i.stateNode,x=wf(n);wu(n,x,p);break;case 5:var T=i.stateNode;i.flags&32&&(qe(T,""),i.flags&=-33);var O=wf(n);wu(n,O,T);break;case 3:case 4:var V=i.stateNode.containerInfo,oe=wf(n);Cf(n,oe,V);break;default:throw Error(s(161))}}catch(he){_t(n,n.return,he)}n.flags&=-3}r&4096&&(n.flags&=-4097)}function zg(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var r=n;zg(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),n=n.sibling}}function Er(n,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)jg(n,r.alternate,r),r=r.sibling}function Ds(n){for(n=n.child;n!==null;){var r=n;switch(r.tag){case 0:case 11:case 14:case 15:Yr(4,r,r.return),Ds(r);break;case 1:Ya(r,r.return);var i=r.stateNode;typeof i.componentWillUnmount=="function"&&Og(r,r.return,i),Ds(r);break;case 27:zl(r.stateNode);case 26:case 5:Ya(r,r.return),Ds(r);break;case 22:r.memoizedState===null&&Ds(r);break;case 30:Ds(r);break;default:Ds(r)}n=n.sibling}}function yr(n,r,i){for(i=i&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var c=r.alternate,p=n,x=r,T=x.flags;switch(x.tag){case 0:case 11:case 15:yr(p,x,i),Il(4,x);break;case 1:if(yr(p,x,i),c=x,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(oe){_t(c,c.return,oe)}if(c=x,p=c.updateQueue,p!==null){var O=c.stateNode;try{var V=p.shared.hiddenCallbacks;if(V!==null)for(p.shared.hiddenCallbacks=null,p=0;p<V.length;p++)E0(V[p],O)}catch(oe){_t(c,c.return,oe)}}i&&T&64&&Rg(x),Ml(x,x.return);break;case 27:Dg(x);case 26:case 5:yr(p,x,i),i&&c===null&&T&4&&Ig(x),Ml(x,x.return);break;case 12:yr(p,x,i);break;case 31:yr(p,x,i),i&&T&4&&Ug(p,x);break;case 13:yr(p,x,i),i&&T&4&&Hg(p,x);break;case 22:x.memoizedState===null&&yr(p,x,i),Ml(x,x.return);break;case 30:break;default:yr(p,x,i)}r=r.sibling}}function Rf(n,r){var i=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),n=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(n=r.memoizedState.cachePool.pool),n!==i&&(n!=null&&n.refCount++,i!=null&&El(i))}function Of(n,r){n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&El(n))}function La(n,r,i,c){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)$g(n,r,i,c),r=r.sibling}function $g(n,r,i,c){var p=r.flags;switch(r.tag){case 0:case 11:case 15:La(n,r,i,c),p&2048&&Il(9,r);break;case 1:La(n,r,i,c);break;case 3:La(n,r,i,c),p&2048&&(n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&El(n)));break;case 12:if(p&2048){La(n,r,i,c),n=r.stateNode;try{var x=r.memoizedProps,T=x.id,O=x.onPostCommit;typeof O=="function"&&O(T,r.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(V){_t(r,r.return,V)}}else La(n,r,i,c);break;case 31:La(n,r,i,c);break;case 13:La(n,r,i,c);break;case 23:break;case 22:x=r.stateNode,T=r.alternate,r.memoizedState!==null?x._visibility&2?La(n,r,i,c):Dl(n,r):x._visibility&2?La(n,r,i,c):(x._visibility|=2,Ti(n,r,i,c,(r.subtreeFlags&10256)!==0||!1)),p&2048&&Rf(T,r);break;case 24:La(n,r,i,c),p&2048&&Of(r.alternate,r);break;default:La(n,r,i,c)}}function Ti(n,r,i,c,p){for(p=p&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var x=n,T=r,O=i,V=c,oe=T.flags;switch(T.tag){case 0:case 11:case 15:Ti(x,T,O,V,p),Il(8,T);break;case 23:break;case 22:var he=T.stateNode;T.memoizedState!==null?he._visibility&2?Ti(x,T,O,V,p):Dl(x,T):(he._visibility|=2,Ti(x,T,O,V,p)),p&&oe&2048&&Rf(T.alternate,T);break;case 24:Ti(x,T,O,V,p),p&&oe&2048&&Of(T.alternate,T);break;default:Ti(x,T,O,V,p)}r=r.sibling}}function Dl(n,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var i=n,c=r,p=c.flags;switch(c.tag){case 22:Dl(i,c),p&2048&&Rf(c.alternate,c);break;case 24:Dl(i,c),p&2048&&Of(c.alternate,c);break;default:Dl(i,c)}r=r.sibling}}var Ll=8192;function _i(n,r,i){if(n.subtreeFlags&Ll)for(n=n.child;n!==null;)qg(n,r,i),n=n.sibling}function qg(n,r,i){switch(n.tag){case 26:_i(n,r,i),n.flags&Ll&&n.memoizedState!==null&&iv(i,Da,n.memoizedState,n.memoizedProps);break;case 5:_i(n,r,i);break;case 3:case 4:var c=Da;Da=zu(n.stateNode.containerInfo),_i(n,r,i),Da=c;break;case 22:n.memoizedState===null&&(c=n.alternate,c!==null&&c.memoizedState!==null?(c=Ll,Ll=16777216,_i(n,r,i),Ll=c):_i(n,r,i));break;default:_i(n,r,i)}}function Yg(n){var r=n.alternate;if(r!==null&&(n=r.child,n!==null)){r.child=null;do r=n.sibling,n.sibling=null,n=r;while(n!==null)}}function jl(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var i=0;i<r.length;i++){var c=r[i];hn=c,Kg(c,n)}Yg(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Gg(n),n=n.sibling}function Gg(n){switch(n.tag){case 0:case 11:case 15:jl(n),n.flags&2048&&Yr(9,n,n.return);break;case 3:jl(n);break;case 12:jl(n);break;case 22:var r=n.stateNode;n.memoizedState!==null&&r._visibility&2&&(n.return===null||n.return.tag!==13)?(r._visibility&=-3,ku(n)):jl(n);break;default:jl(n)}}function ku(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var i=0;i<r.length;i++){var c=r[i];hn=c,Kg(c,n)}Yg(n)}for(n=n.child;n!==null;){switch(r=n,r.tag){case 0:case 11:case 15:Yr(8,r,r.return),ku(r);break;case 22:i=r.stateNode,i._visibility&2&&(i._visibility&=-3,ku(r));break;default:ku(r)}n=n.sibling}}function Kg(n,r){for(;hn!==null;){var i=hn;switch(i.tag){case 0:case 11:case 15:Yr(8,i,r);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var c=i.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:El(i.memoizedState.cache)}if(c=i.child,c!==null)c.return=i,hn=c;else e:for(i=n;hn!==null;){c=hn;var p=c.sibling,x=c.return;if(Bg(c),c===i){hn=null;break e}if(p!==null){p.return=x,hn=p;break e}hn=x}}}var N2={getCacheForType:function(n){var r=yn(rn),i=r.data.get(n);return i===void 0&&(i=n(),r.data.set(n,i)),i},cacheSignal:function(){return yn(rn).controller.signal}},T2=typeof WeakMap=="function"?WeakMap:Map,bt=0,Ot=null,st=null,ut=0,Tt=0,ca=null,Gr=!1,vi=!1,If=!1,Nr=0,Gt=0,Kr=0,Ls=0,Mf=0,da=0,Si=0,Bl=null,Xn=null,Df=!1,Ru=0,Vg=0,Ou=1/0,Iu=null,Vr=null,fn=0,Xr=null,Ai=null,Tr=0,Lf=0,jf=null,Xg=null,Pl=0,Bf=null;function fa(){return(bt&2)!==0&&ut!==0?ut&-ut:D.T!==null?$f():Zs()}function Qg(){if(da===0)if((ut&536870912)===0||dt){var n=Ws;Ws<<=1,(Ws&3932160)===0&&(Ws=262144),da=n}else da=536870912;return n=oa.current,n!==null&&(n.flags|=32),da}function Qn(n,r,i){(n===Ot&&(Tt===2||Tt===9)||n.cancelPendingCommit!==null)&&(wi(n,0),Qr(n,ut,da,!1)),Rt(n,i),((bt&2)===0||n!==Ot)&&(n===Ot&&((bt&2)===0&&(Ls|=i),Gt===4&&Qr(n,ut,da,!1)),Ga(n))}function Wg(n,r,i){if((bt&6)!==0)throw Error(s(327));var c=!i&&(r&127)===0&&(r&n.expiredLanes)===0||pe(n,r),p=c?S2(n,r):Uf(n,r,!0),x=c;do{if(p===0){vi&&!c&&Qr(n,r,0,!1);break}else{if(i=n.current.alternate,x&&!_2(i)){p=Uf(n,r,!1),x=!1;continue}if(p===2){if(x=r,n.errorRecoveryDisabledLanes&x)var T=0;else T=n.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){r=T;e:{var O=n;p=Bl;var V=O.current.memoizedState.isDehydrated;if(V&&(wi(O,T).flags|=256),T=Uf(O,T,!1),T!==2){if(If&&!V){O.errorRecoveryDisabledLanes|=x,Ls|=x,p=4;break e}x=Xn,Xn=p,x!==null&&(Xn===null?Xn=x:Xn.push.apply(Xn,x))}p=T}if(x=!1,p!==2)continue}}if(p===1){wi(n,0),Qr(n,r,0,!0);break}e:{switch(c=n,x=p,x){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:Qr(c,r,da,!Gr);break e;case 2:Xn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(p=Ru+300-St(),10<p)){if(Qr(c,r,da,!Gr),X(c,0,!0)!==0)break e;Tr=r,c.timeoutHandle=Cb(Zg.bind(null,c,i,Xn,Iu,Df,r,da,Ls,Si,Gr,x,"Throttled",-0,0),p);break e}Zg(c,i,Xn,Iu,Df,r,da,Ls,Si,Gr,x,null,-0,0)}}break}while(!0);Ga(n)}function Zg(n,r,i,c,p,x,T,O,V,oe,he,be,ce,de){if(n.timeoutHandle=-1,be=r.subtreeFlags,be&8192||(be&16785408)===16785408){be={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:we},qg(r,x,be);var Me=(x&62914560)===x?Ru-St():(x&4194048)===x?Vg-St():0;if(Me=lv(be,Me),Me!==null){Tr=x,n.cancelPendingCommit=Me(ib.bind(null,n,r,x,i,c,p,T,O,V,he,be,null,ce,de)),Qr(n,x,T,!oe);return}}ib(n,r,x,i,c,p,T,O,V)}function _2(n){for(var r=n;;){var i=r.tag;if((i===0||i===11||i===15)&&r.flags&16384&&(i=r.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var c=0;c<i.length;c++){var p=i[c],x=p.getSnapshot;p=p.value;try{if(!ia(x(),p))return!1}catch{return!1}}if(i=r.child,r.subtreeFlags&16384&&i!==null)i.return=r,r=i;else{if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Qr(n,r,i,c){r&=~Mf,r&=~Ls,n.suspendedLanes|=r,n.pingedLanes&=~r,c&&(n.warmLanes|=r),c=n.expirationTimes;for(var p=r;0<p;){var x=31-Et(p),T=1<<x;c[x]=-1,p&=~T}i!==0&&Oe(n,i,r)}function Mu(){return(bt&6)===0?(Ul(0),!1):!0}function Pf(){if(st!==null){if(Tt===0)var n=st.return;else n=st,dr=As=null,Jd(n),bi=null,Nl=0,n=st;for(;n!==null;)kg(n.alternate,n),n=n.return;st=null}}function wi(n,r){var i=n.timeoutHandle;i!==-1&&(n.timeoutHandle=-1,$2(i)),i=n.cancelPendingCommit,i!==null&&(n.cancelPendingCommit=null,i()),Tr=0,Pf(),Ot=n,st=i=ur(n.current,null),ut=r,Tt=0,ca=null,Gr=!1,vi=pe(n,r),If=!1,Si=da=Mf=Ls=Kr=Gt=0,Xn=Bl=null,Df=!1,(r&8)!==0&&(r|=r&32);var c=n.entangledLanes;if(c!==0)for(n=n.entanglements,c&=r;0<c;){var p=31-Et(c),x=1<<p;r|=n[p],c&=~x}return Nr=r,eu(),i}function Jg(n,r){Ze=null,D.H=kl,r===gi||r===ou?(r=p0(),Tt=3):r===Fd?(r=p0(),Tt=4):Tt=r===gf?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,ca=r,st===null&&(Gt=1,Tu(n,ya(r,n.current)))}function eb(){var n=oa.current;return n===null?!0:(ut&4194048)===ut?va===null:(ut&62914560)===ut||(ut&536870912)!==0?n===va:!1}function tb(){var n=D.H;return D.H=kl,n===null?kl:n}function nb(){var n=D.A;return D.A=N2,n}function Du(){Gt=4,Gr||(ut&4194048)!==ut&&oa.current!==null||(vi=!0),(Kr&134217727)===0&&(Ls&134217727)===0||Ot===null||Qr(Ot,ut,da,!1)}function Uf(n,r,i){var c=bt;bt|=2;var p=tb(),x=nb();(Ot!==n||ut!==r)&&(Iu=null,wi(n,r)),r=!1;var T=Gt;e:do try{if(Tt!==0&&st!==null){var O=st,V=ca;switch(Tt){case 8:Pf(),T=6;break e;case 3:case 2:case 9:case 6:oa.current===null&&(r=!0);var oe=Tt;if(Tt=0,ca=null,Ci(n,O,V,oe),i&&vi){T=0;break e}break;default:oe=Tt,Tt=0,ca=null,Ci(n,O,V,oe)}}v2(),T=Gt;break}catch(he){Jg(n,he)}while(!0);return r&&n.shellSuspendCounter++,dr=As=null,bt=c,D.H=p,D.A=x,st===null&&(Ot=null,ut=0,eu()),T}function v2(){for(;st!==null;)ab(st)}function S2(n,r){var i=bt;bt|=2;var c=tb(),p=nb();Ot!==n||ut!==r?(Iu=null,Ou=St()+500,wi(n,r)):vi=pe(n,r);e:do try{if(Tt!==0&&st!==null){r=st;var x=ca;t:switch(Tt){case 1:Tt=0,ca=null,Ci(n,r,x,1);break;case 2:case 9:if(m0(x)){Tt=0,ca=null,rb(r);break}r=function(){Tt!==2&&Tt!==9||Ot!==n||(Tt=7),Ga(n)},x.then(r,r);break e;case 3:Tt=7;break e;case 4:Tt=5;break e;case 7:m0(x)?(Tt=0,ca=null,rb(r)):(Tt=0,ca=null,Ci(n,r,x,7));break;case 5:var T=null;switch(st.tag){case 26:T=st.memoizedState;case 5:case 27:var O=st;if(T?$b(T):O.stateNode.complete){Tt=0,ca=null;var V=O.sibling;if(V!==null)st=V;else{var oe=O.return;oe!==null?(st=oe,Lu(oe)):st=null}break t}}Tt=0,ca=null,Ci(n,r,x,5);break;case 6:Tt=0,ca=null,Ci(n,r,x,6);break;case 8:Pf(),Gt=6;break e;default:throw Error(s(462))}}A2();break}catch(he){Jg(n,he)}while(!0);return dr=As=null,D.H=c,D.A=p,bt=i,st!==null?0:(Ot=null,ut=0,eu(),Gt)}function A2(){for(;st!==null&&!Ha();)ab(st)}function ab(n){var r=wg(n.alternate,n,Nr);n.memoizedProps=n.pendingProps,r===null?Lu(n):st=r}function rb(n){var r=n,i=r.alternate;switch(r.tag){case 15:case 0:r=Ng(i,r,r.pendingProps,r.type,void 0,ut);break;case 11:r=Ng(i,r,r.pendingProps,r.type.render,r.ref,ut);break;case 5:Jd(r);default:kg(i,r),r=st=n0(r,Nr),r=wg(i,r,Nr)}n.memoizedProps=n.pendingProps,r===null?Lu(n):st=r}function Ci(n,r,i,c){dr=As=null,Jd(r),bi=null,Nl=0;var p=r.return;try{if(h2(n,p,r,i,ut)){Gt=1,Tu(n,ya(i,n.current)),st=null;return}}catch(x){if(p!==null)throw st=p,x;Gt=1,Tu(n,ya(i,n.current)),st=null;return}r.flags&32768?(dt||c===1?n=!0:vi||(ut&536870912)!==0?n=!1:(Gr=n=!0,(c===2||c===9||c===3||c===6)&&(c=oa.current,c!==null&&c.tag===13&&(c.flags|=16384))),sb(r,n)):Lu(r)}function Lu(n){var r=n;do{if((r.flags&32768)!==0){sb(r,Gr);return}n=r.return;var i=b2(r.alternate,r,Nr);if(i!==null){st=i;return}if(r=r.sibling,r!==null){st=r;return}st=r=n}while(r!==null);Gt===0&&(Gt=5)}function sb(n,r){do{var i=x2(n.alternate,n);if(i!==null){i.flags&=32767,st=i;return}if(i=n.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!r&&(n=n.sibling,n!==null)){st=n;return}st=n=i}while(n!==null);Gt=6,st=null}function ib(n,r,i,c,p,x,T,O,V){n.cancelPendingCommit=null;do ju();while(fn!==0);if((bt&6)!==0)throw Error(s(327));if(r!==null){if(r===n.current)throw Error(s(177));if(x=r.lanes|r.childLanes,x|=Ad,De(n,i,x,T,O,V),n===Ot&&(st=Ot=null,ut=0),Ai=r,Xr=n,Tr=i,Lf=x,jf=p,Xg=c,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,R2(Fe,function(){return db(),null})):(n.callbackNode=null,n.callbackPriority=0),c=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||c){c=D.T,D.T=null,p=P.p,P.p=2,T=bt,bt|=4;try{E2(n,r,i)}finally{bt=T,P.p=p,D.T=c}}fn=1,lb(),ob(),ub()}}function lb(){if(fn===1){fn=0;var n=Xr,r=Ai,i=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||i){i=D.T,D.T=null;var c=P.p;P.p=2;var p=bt;bt|=4;try{Fg(r,n);var x=Wf,T=Kp(n.containerInfo),O=x.focusedElem,V=x.selectionRange;if(T!==O&&O&&O.ownerDocument&&Gp(O.ownerDocument.documentElement,O)){if(V!==null&&Nd(O)){var oe=V.start,he=V.end;if(he===void 0&&(he=oe),"selectionStart"in O)O.selectionStart=oe,O.selectionEnd=Math.min(he,O.value.length);else{var be=O.ownerDocument||document,ce=be&&be.defaultView||window;if(ce.getSelection){var de=ce.getSelection(),Me=O.textContent.length,$e=Math.min(V.start,Me),Ct=V.end===void 0?$e:Math.min(V.end,Me);!de.extend&&$e>Ct&&(T=Ct,Ct=$e,$e=T);var te=Yp(O,$e),J=Yp(O,Ct);if(te&&J&&(de.rangeCount!==1||de.anchorNode!==te.node||de.anchorOffset!==te.offset||de.focusNode!==J.node||de.focusOffset!==J.offset)){var le=be.createRange();le.setStart(te.node,te.offset),de.removeAllRanges(),$e>Ct?(de.addRange(le),de.extend(J.node,J.offset)):(le.setEnd(J.node,J.offset),de.addRange(le))}}}}for(be=[],de=O;de=de.parentNode;)de.nodeType===1&&be.push({element:de,left:de.scrollLeft,top:de.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<be.length;O++){var ge=be[O];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}Vu=!!Qf,Wf=Qf=null}finally{bt=p,P.p=c,D.T=i}}n.current=r,fn=2}}function ob(){if(fn===2){fn=0;var n=Xr,r=Ai,i=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||i){i=D.T,D.T=null;var c=P.p;P.p=2;var p=bt;bt|=4;try{jg(n,r.alternate,r)}finally{bt=p,P.p=c,D.T=i}}fn=3}}function ub(){if(fn===4||fn===3){fn=0,kr();var n=Xr,r=Ai,i=Tr,c=Xg;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?fn=5:(fn=0,Ai=Xr=null,cb(n,n.pendingLanes));var p=n.pendingLanes;if(p===0&&(Vr=null),rr(i),r=r.stateNode,Dt&&typeof Dt.onCommitFiberRoot=="function")try{Dt.onCommitFiberRoot(tn,r,void 0,(r.current.flags&128)===128)}catch{}if(c!==null){r=D.T,p=P.p,P.p=2,D.T=null;try{for(var x=n.onRecoverableError,T=0;T<c.length;T++){var O=c[T];x(O.value,{componentStack:O.stack})}}finally{D.T=r,P.p=p}}(Tr&3)!==0&&ju(),Ga(n),p=n.pendingLanes,(i&261930)!==0&&(p&42)!==0?n===Bf?Pl++:(Pl=0,Bf=n):Pl=0,Ul(0)}}function cb(n,r){(n.pooledCacheLanes&=r)===0&&(r=n.pooledCache,r!=null&&(n.pooledCache=null,El(r)))}function ju(){return lb(),ob(),ub(),db()}function db(){if(fn!==5)return!1;var n=Xr,r=Lf;Lf=0;var i=rr(Tr),c=D.T,p=P.p;try{P.p=32>i?32:i,D.T=null,i=jf,jf=null;var x=Xr,T=Tr;if(fn=0,Ai=Xr=null,Tr=0,(bt&6)!==0)throw Error(s(331));var O=bt;if(bt|=4,Gg(x.current),$g(x,x.current,T,i),bt=O,Ul(0,!1),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(tn,x)}catch{}return!0}finally{P.p=p,D.T=c,cb(n,r)}}function fb(n,r,i){r=ya(i,r),r=pf(n.stateNode,r,2),n=zr(n,r,2),n!==null&&(Rt(n,2),Ga(n))}function _t(n,r,i){if(n.tag===3)fb(n,n,i);else for(;r!==null;){if(r.tag===3){fb(r,n,i);break}else if(r.tag===1){var c=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Vr===null||!Vr.has(c))){n=ya(i,n),i=mg(2),c=zr(r,i,2),c!==null&&(hg(i,c,r,n),Rt(c,2),Ga(c));break}}r=r.return}}function Hf(n,r,i){var c=n.pingCache;if(c===null){c=n.pingCache=new T2;var p=new Set;c.set(r,p)}else p=c.get(r),p===void 0&&(p=new Set,c.set(r,p));p.has(i)||(If=!0,p.add(i),n=w2.bind(null,n,r,i),r.then(n,n))}function w2(n,r,i){var c=n.pingCache;c!==null&&c.delete(r),n.pingedLanes|=n.suspendedLanes&i,n.warmLanes&=~i,Ot===n&&(ut&i)===i&&(Gt===4||Gt===3&&(ut&62914560)===ut&&300>St()-Ru?(bt&2)===0&&wi(n,0):Mf|=i,Si===ut&&(Si=0)),Ga(n)}function mb(n,r){r===0&&(r=Ke()),n=_s(n,r),n!==null&&(Rt(n,r),Ga(n))}function C2(n){var r=n.memoizedState,i=0;r!==null&&(i=r.retryLane),mb(n,i)}function k2(n,r){var i=0;switch(n.tag){case 31:case 13:var c=n.stateNode,p=n.memoizedState;p!==null&&(i=p.retryLane);break;case 19:c=n.stateNode;break;case 22:c=n.stateNode._retryCache;break;default:throw Error(s(314))}c!==null&&c.delete(r),mb(n,i)}function R2(n,r){return Ia(n,r)}var Bu=null,ki=null,Ff=!1,Pu=!1,zf=!1,Wr=0;function Ga(n){n!==ki&&n.next===null&&(ki===null?Bu=ki=n:ki=ki.next=n),Pu=!0,Ff||(Ff=!0,I2())}function Ul(n,r){if(!zf&&Pu){zf=!0;do for(var i=!1,c=Bu;c!==null;){if(n!==0){var p=c.pendingLanes;if(p===0)var x=0;else{var T=c.suspendedLanes,O=c.pingedLanes;x=(1<<31-Et(42|n)+1)-1,x&=p&~(T&~O),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(i=!0,bb(c,x))}else x=ut,x=X(c,c===Ot?x:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(x&3)===0||pe(c,x)||(i=!0,bb(c,x));c=c.next}while(i);zf=!1}}function O2(){hb()}function hb(){Pu=Ff=!1;var n=0;Wr!==0&&z2()&&(n=Wr);for(var r=St(),i=null,c=Bu;c!==null;){var p=c.next,x=pb(c,r);x===0?(c.next=null,i===null?Bu=p:i.next=p,p===null&&(ki=i)):(i=c,(n!==0||(x&3)!==0)&&(Pu=!0)),c=p}fn!==0&&fn!==5||Ul(n),Wr!==0&&(Wr=0)}function pb(n,r){for(var i=n.suspendedLanes,c=n.pingedLanes,p=n.expirationTimes,x=n.pendingLanes&-62914561;0<x;){var T=31-Et(x),O=1<<T,V=p[T];V===-1?((O&i)===0||(O&c)!==0)&&(p[T]=Ce(O,r)):V<=r&&(n.expiredLanes|=O),x&=~O}if(r=Ot,i=ut,i=X(n,n===r?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c=n.callbackNode,i===0||n===r&&(Tt===2||Tt===9)||n.cancelPendingCommit!==null)return c!==null&&c!==null&&nr(c),n.callbackNode=null,n.callbackPriority=0;if((i&3)===0||pe(n,i)){if(r=i&-i,r===n.callbackPriority)return r;switch(c!==null&&nr(c),rr(i)){case 2:case 8:i=Se;break;case 32:i=Fe;break;case 268435456:i=Re;break;default:i=Fe}return c=gb.bind(null,n),i=Ia(i,c),n.callbackPriority=r,n.callbackNode=i,r}return c!==null&&c!==null&&nr(c),n.callbackPriority=2,n.callbackNode=null,2}function gb(n,r){if(fn!==0&&fn!==5)return n.callbackNode=null,n.callbackPriority=0,null;var i=n.callbackNode;if(ju()&&n.callbackNode!==i)return null;var c=ut;return c=X(n,n===Ot?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c===0?null:(Wg(n,c,r),pb(n,St()),n.callbackNode!=null&&n.callbackNode===i?gb.bind(null,n):null)}function bb(n,r){if(ju())return null;Wg(n,r,!0)}function I2(){q2(function(){(bt&6)!==0?Ia(me,O2):hb()})}function $f(){if(Wr===0){var n=hi;n===0&&(n=ps,ps<<=1,(ps&261888)===0&&(ps=256)),Wr=n}return Wr}function xb(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Dr(""+n)}function Eb(n,r){var i=r.ownerDocument.createElement("input");return i.name=r.name,i.value=r.value,n.id&&i.setAttribute("form",n.id),r.parentNode.insertBefore(i,r),n=new FormData(n),i.parentNode.removeChild(i),n}function M2(n,r,i,c,p){if(r==="submit"&&i&&i.stateNode===p){var x=xb((p[_n]||null).action),T=c.submitter;T&&(r=(r=T[_n]||null)?xb(r.formAction):T.getAttribute("formAction"),r!==null&&(x=r,T=null));var O=new Qo("action","action",null,c,p);n.push({event:O,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Wr!==0){var V=T?Eb(p,T):new FormData(p);uf(i,{pending:!0,data:V,method:p.method,action:x},null,V)}}else typeof x=="function"&&(O.preventDefault(),V=T?Eb(p,T):new FormData(p),uf(i,{pending:!0,data:V,method:p.method,action:x},x,V))},currentTarget:p}]})}}for(var qf=0;qf<Sd.length;qf++){var Yf=Sd[qf],D2=Yf.toLowerCase(),L2=Yf[0].toUpperCase()+Yf.slice(1);Ma(D2,"on"+L2)}Ma(Qp,"onAnimationEnd"),Ma(Wp,"onAnimationIteration"),Ma(Zp,"onAnimationStart"),Ma("dblclick","onDoubleClick"),Ma("focusin","onFocus"),Ma("focusout","onBlur"),Ma(W_,"onTransitionRun"),Ma(Z_,"onTransitionStart"),Ma(J_,"onTransitionCancel"),Ma(Jp,"onTransitionEnd"),_e("onMouseEnter",["mouseout","mouseover"]),_e("onMouseLeave",["mouseout","mouseover"]),_e("onPointerEnter",["pointerout","pointerover"]),_e("onPointerLeave",["pointerout","pointerover"]),ir("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ir("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ir("onBeforeInput",["compositionend","keypress","textInput","paste"]),ir("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ir("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ir("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hl="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(" "),j2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Hl));function yb(n,r){r=(r&4)!==0;for(var i=0;i<n.length;i++){var c=n[i],p=c.event;c=c.listeners;e:{var x=void 0;if(r)for(var T=c.length-1;0<=T;T--){var O=c[T],V=O.instance,oe=O.currentTarget;if(O=O.listener,V!==x&&p.isPropagationStopped())break e;x=O,p.currentTarget=oe;try{x(p)}catch(he){Jo(he)}p.currentTarget=null,x=V}else for(T=0;T<c.length;T++){if(O=c[T],V=O.instance,oe=O.currentTarget,O=O.listener,V!==x&&p.isPropagationStopped())break e;x=O,p.currentTarget=oe;try{x(p)}catch(he){Jo(he)}p.currentTarget=null,x=V}}}}function it(n,r){var i=r[nl];i===void 0&&(i=r[nl]=new Set);var c=n+"__bubble";i.has(c)||(Nb(r,n,2,!1),i.add(c))}function Gf(n,r,i){var c=0;r&&(c|=4),Nb(i,n,c,r)}var Uu="_reactListening"+Math.random().toString(36).slice(2);function Kf(n){if(!n[Uu]){n[Uu]=!0,zo.forEach(function(i){i!=="selectionchange"&&(j2.has(i)||Gf(i,!1,n),Gf(i,!0,n))});var r=n.nodeType===9?n:n.ownerDocument;r===null||r[Uu]||(r[Uu]=!0,Gf("selectionchange",!1,r))}}function Nb(n,r,i,c){switch(Qb(r)){case 2:var p=cv;break;case 8:p=dv;break;default:p=om}i=p.bind(null,r,i,n),p=void 0,!fd||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(p=!0),c?p!==void 0?n.addEventListener(r,i,{capture:!0,passive:p}):n.addEventListener(r,i,!0):p!==void 0?n.addEventListener(r,i,{passive:p}):n.addEventListener(r,i,!1)}function Vf(n,r,i,c,p){var x=c;if((r&1)===0&&(r&2)===0&&c!==null)e:for(;;){if(c===null)return;var T=c.tag;if(T===3||T===4){var O=c.stateNode.containerInfo;if(O===p)break;if(T===4)for(T=c.return;T!==null;){var V=T.tag;if((V===3||V===4)&&T.stateNode.containerInfo===p)return;T=T.return}for(;O!==null;){if(T=Dn(O),T===null)return;if(V=T.tag,V===5||V===6||V===26||V===27){c=x=T;continue e}O=O.parentNode}}c=c.return}Go(function(){var oe=x,he=We(i),be=[];e:{var ce=e0.get(n);if(ce!==void 0){var de=Qo,Me=n;switch(n){case"keypress":if(Vo(i)===0)break e;case"keydown":case"keyup":de=k_;break;case"focusin":Me="focus",de=gd;break;case"focusout":Me="blur",de=gd;break;case"beforeblur":case"afterblur":de=gd;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":de=kp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=b_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=I_;break;case Qp:case Wp:case Zp:de=y_;break;case Jp:de=D_;break;case"scroll":case"scrollend":de=p_;break;case"wheel":de=j_;break;case"copy":case"cut":case"paste":de=T_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=Op;break;case"toggle":case"beforetoggle":de=P_}var $e=(r&4)!==0,Ct=!$e&&(n==="scroll"||n==="scrollend"),te=$e?ce!==null?ce+"Capture":null:ce;$e=[];for(var J=oe,le;J!==null;){var ge=J;if(le=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||le===null||te===null||(ge=ol(J,te),ge!=null&&$e.push(Fl(J,ge,le))),Ct)break;J=J.return}0<$e.length&&(ce=new de(ce,Me,null,i,he),be.push({event:ce,listeners:$e}))}}if((r&7)===0){e:{if(ce=n==="mouseover"||n==="pointerover",de=n==="mouseout"||n==="pointerout",ce&&i!==Le&&(Me=i.relatedTarget||i.fromElement)&&(Dn(Me)||Me[Rr]))break e;if((de||ce)&&(ce=he.window===he?he:(ce=he.ownerDocument)?ce.defaultView||ce.parentWindow:window,de?(Me=i.relatedTarget||i.toElement,de=oe,Me=Me?Dn(Me):null,Me!==null&&(Ct=u(Me),$e=Me.tag,Me!==Ct||$e!==5&&$e!==27&&$e!==6)&&(Me=null)):(de=null,Me=oe),de!==Me)){if($e=kp,ge="onMouseLeave",te="onMouseEnter",J="mouse",(n==="pointerout"||n==="pointerover")&&($e=Op,ge="onPointerLeave",te="onPointerEnter",J="pointer"),Ct=de==null?ce:Or(de),le=Me==null?ce:Or(Me),ce=new $e(ge,J+"leave",de,i,he),ce.target=Ct,ce.relatedTarget=le,ge=null,Dn(he)===oe&&($e=new $e(te,J+"enter",Me,i,he),$e.target=le,$e.relatedTarget=Ct,ge=$e),Ct=ge,de&&Me)t:{for($e=B2,te=de,J=Me,le=0,ge=te;ge;ge=$e(ge))le++;ge=0;for(var He=J;He;He=$e(He))ge++;for(;0<le-ge;)te=$e(te),le--;for(;0<ge-le;)J=$e(J),ge--;for(;le--;){if(te===J||J!==null&&te===J.alternate){$e=te;break t}te=$e(te),J=$e(J)}$e=null}else $e=null;de!==null&&Tb(be,ce,de,$e,!1),Me!==null&&Ct!==null&&Tb(be,Ct,Me,$e,!0)}}e:{if(ce=oe?Or(oe):window,de=ce.nodeName&&ce.nodeName.toLowerCase(),de==="select"||de==="input"&&ce.type==="file")var ht=Up;else if(Bp(ce))if(Hp)ht=V_;else{ht=G_;var je=Y_}else de=ce.nodeName,!de||de.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?oe&&Mr(oe.elementType)&&(ht=Up):ht=K_;if(ht&&(ht=ht(n,oe))){Pp(be,ht,i,he);break e}je&&je(n,ce,oe),n==="focusout"&&oe&&ce.type==="number"&&oe.memoizedProps.value!=null&&ai(ce,"number",ce.value)}switch(je=oe?Or(oe):window,n){case"focusin":(Bp(je)||je.contentEditable==="true")&&(ii=je,Td=oe,gl=null);break;case"focusout":gl=Td=ii=null;break;case"mousedown":_d=!0;break;case"contextmenu":case"mouseup":case"dragend":_d=!1,Vp(be,i,he);break;case"selectionchange":if(Q_)break;case"keydown":case"keyup":Vp(be,i,he)}var Je;if(xd)e:{switch(n){case"compositionstart":var ct="onCompositionStart";break e;case"compositionend":ct="onCompositionEnd";break e;case"compositionupdate":ct="onCompositionUpdate";break e}ct=void 0}else si?Lp(n,i)&&(ct="onCompositionEnd"):n==="keydown"&&i.keyCode===229&&(ct="onCompositionStart");ct&&(Ip&&i.locale!=="ko"&&(si||ct!=="onCompositionStart"?ct==="onCompositionEnd"&&si&&(Je=wp()):(Lr=he,md="value"in Lr?Lr.value:Lr.textContent,si=!0)),je=Hu(oe,ct),0<je.length&&(ct=new Rp(ct,n,null,i,he),be.push({event:ct,listeners:je}),Je?ct.data=Je:(Je=jp(i),Je!==null&&(ct.data=Je)))),(Je=H_?F_(n,i):z_(n,i))&&(ct=Hu(oe,"onBeforeInput"),0<ct.length&&(je=new Rp("onBeforeInput","beforeinput",null,i,he),be.push({event:je,listeners:ct}),je.data=Je)),M2(be,n,oe,i,he)}yb(be,r)})}function Fl(n,r,i){return{instance:n,listener:r,currentTarget:i}}function Hu(n,r){for(var i=r+"Capture",c=[];n!==null;){var p=n,x=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||x===null||(p=ol(n,i),p!=null&&c.unshift(Fl(n,p,x)),p=ol(n,r),p!=null&&c.push(Fl(n,p,x))),n.tag===3)return c;n=n.return}return[]}function B2(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function Tb(n,r,i,c,p){for(var x=r._reactName,T=[];i!==null&&i!==c;){var O=i,V=O.alternate,oe=O.stateNode;if(O=O.tag,V!==null&&V===c)break;O!==5&&O!==26&&O!==27||oe===null||(V=oe,p?(oe=ol(i,x),oe!=null&&T.unshift(Fl(i,oe,V))):p||(oe=ol(i,x),oe!=null&&T.push(Fl(i,oe,V)))),i=i.return}T.length!==0&&n.push({event:r,listeners:T})}var P2=/\r\n?/g,U2=/\u0000|\uFFFD/g;function _b(n){return(typeof n=="string"?n:""+n).replace(P2,`
49
+ `).replace(U2,"")}function vb(n,r){return r=_b(r),_b(n)===r}function wt(n,r,i,c,p,x){switch(i){case"children":typeof c=="string"?r==="body"||r==="textarea"&&c===""||qe(n,c):(typeof c=="number"||typeof c=="bigint")&&r!=="body"&&qe(n,""+c);break;case"className":ra(n,"class",c);break;case"tabIndex":ra(n,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":ra(n,i,c);break;case"style":Nt(n,c,x);break;case"data":if(r!=="object"){ra(n,"data",c);break}case"src":case"href":if(c===""&&(r!=="a"||i!=="href")){n.removeAttribute(i);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(i);break}c=Dr(""+c),n.setAttribute(i,c);break;case"action":case"formAction":if(typeof c=="function"){n.setAttribute(i,"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 x=="function"&&(i==="formAction"?(r!=="input"&&wt(n,r,"name",p.name,p,null),wt(n,r,"formEncType",p.formEncType,p,null),wt(n,r,"formMethod",p.formMethod,p,null),wt(n,r,"formTarget",p.formTarget,p,null)):(wt(n,r,"encType",p.encType,p,null),wt(n,r,"method",p.method,p,null),wt(n,r,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(i);break}c=Dr(""+c),n.setAttribute(i,c);break;case"onClick":c!=null&&(n.onclick=we);break;case"onScroll":c!=null&&it("scroll",n);break;case"onScrollEnd":c!=null&&it("scrollend",n);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(s(61));if(i=c.__html,i!=null){if(p.children!=null)throw Error(s(60));n.innerHTML=i}}break;case"multiple":n.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":n.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){n.removeAttribute("xlink:href");break}i=Dr(""+c),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(i,""+c):n.removeAttribute(i);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":c&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(i,""):n.removeAttribute(i);break;case"capture":case"download":c===!0?n.setAttribute(i,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(i,c):n.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?n.setAttribute(i,c):n.removeAttribute(i);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?n.removeAttribute(i):n.setAttribute(i,c);break;case"popover":it("beforetoggle",n),it("toggle",n),vn(n,"popover",c);break;case"xlinkActuate":$n(n,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":$n(n,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":$n(n,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":$n(n,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":$n(n,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":$n(n,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":$n(n,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":$n(n,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":$n(n,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":vn(n,"is",c);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=lr.get(i)||i,vn(n,i,c))}}function Xf(n,r,i,c,p,x){switch(i){case"style":Nt(n,c,x);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(s(61));if(i=c.__html,i!=null){if(p.children!=null)throw Error(s(60));n.innerHTML=i}}break;case"children":typeof c=="string"?qe(n,c):(typeof c=="number"||typeof c=="bigint")&&qe(n,""+c);break;case"onScroll":c!=null&&it("scroll",n);break;case"onScrollEnd":c!=null&&it("scrollend",n);break;case"onClick":c!=null&&(n.onclick=we);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!xs.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(p=i.endsWith("Capture"),r=i.slice(2,p?i.length-7:void 0),x=n[_n]||null,x=x!=null?x[i]:null,typeof x=="function"&&n.removeEventListener(r,x,p),typeof c=="function")){typeof x!="function"&&x!==null&&(i in n?n[i]=null:n.hasAttribute(i)&&n.removeAttribute(i)),n.addEventListener(r,c,p);break e}i in n?n[i]=c:c===!0?n.setAttribute(i,""):vn(n,i,c)}}}function Tn(n,r,i){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":it("error",n),it("load",n);var c=!1,p=!1,x;for(x in i)if(i.hasOwnProperty(x)){var T=i[x];if(T!=null)switch(x){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:wt(n,r,x,T,i,null)}}p&&wt(n,r,"srcSet",i.srcSet,i,null),c&&wt(n,r,"src",i.src,i,null);return;case"input":it("invalid",n);var O=x=T=p=null,V=null,oe=null;for(c in i)if(i.hasOwnProperty(c)){var he=i[c];if(he!=null)switch(c){case"name":p=he;break;case"type":T=he;break;case"checked":V=he;break;case"defaultChecked":oe=he;break;case"value":x=he;break;case"defaultValue":O=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(s(137,r));break;default:wt(n,r,c,he,i,null)}}Es(n,x,O,V,oe,T,p,!1);return;case"select":it("invalid",n),c=T=x=null;for(p in i)if(i.hasOwnProperty(p)&&(O=i[p],O!=null))switch(p){case"value":x=O;break;case"defaultValue":T=O;break;case"multiple":c=O;default:wt(n,r,p,O,i,null)}r=x,i=T,n.multiple=!!c,r!=null?xn(n,!!c,r,!1):i!=null&&xn(n,!!c,i,!0);return;case"textarea":it("invalid",n),x=p=c=null;for(T in i)if(i.hasOwnProperty(T)&&(O=i[T],O!=null))switch(T){case"value":c=O;break;case"defaultValue":p=O;break;case"children":x=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(s(91));break;default:wt(n,r,T,O,i,null)}ri(n,c,p,x);return;case"option":for(V in i)if(i.hasOwnProperty(V)&&(c=i[V],c!=null))switch(V){case"selected":n.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:wt(n,r,V,c,i,null)}return;case"dialog":it("beforetoggle",n),it("toggle",n),it("cancel",n),it("close",n);break;case"iframe":case"object":it("load",n);break;case"video":case"audio":for(c=0;c<Hl.length;c++)it(Hl[c],n);break;case"image":it("error",n),it("load",n);break;case"details":it("toggle",n);break;case"embed":case"source":case"link":it("error",n),it("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(oe in i)if(i.hasOwnProperty(oe)&&(c=i[oe],c!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:wt(n,r,oe,c,i,null)}return;default:if(Mr(r)){for(he in i)i.hasOwnProperty(he)&&(c=i[he],c!==void 0&&Xf(n,r,he,c,i,void 0));return}}for(O in i)i.hasOwnProperty(O)&&(c=i[O],c!=null&&wt(n,r,O,c,i,null))}function H2(n,r,i,c){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,x=null,T=null,O=null,V=null,oe=null,he=null;for(de in i){var be=i[de];if(i.hasOwnProperty(de)&&be!=null)switch(de){case"checked":break;case"value":break;case"defaultValue":V=be;default:c.hasOwnProperty(de)||wt(n,r,de,null,c,be)}}for(var ce in c){var de=c[ce];if(be=i[ce],c.hasOwnProperty(ce)&&(de!=null||be!=null))switch(ce){case"type":x=de;break;case"name":p=de;break;case"checked":oe=de;break;case"defaultChecked":he=de;break;case"value":T=de;break;case"defaultValue":O=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(s(137,r));break;default:de!==be&&wt(n,r,ce,de,c,be)}}sl(n,T,O,V,oe,he,x,p);return;case"select":de=T=O=ce=null;for(x in i)if(V=i[x],i.hasOwnProperty(x)&&V!=null)switch(x){case"value":break;case"multiple":de=V;default:c.hasOwnProperty(x)||wt(n,r,x,null,c,V)}for(p in c)if(x=c[p],V=i[p],c.hasOwnProperty(p)&&(x!=null||V!=null))switch(p){case"value":ce=x;break;case"defaultValue":O=x;break;case"multiple":T=x;default:x!==V&&wt(n,r,p,x,c,V)}r=O,i=T,c=de,ce!=null?xn(n,!!i,ce,!1):!!c!=!!i&&(r!=null?xn(n,!!i,r,!0):xn(n,!!i,i?[]:"",!1));return;case"textarea":de=ce=null;for(O in i)if(p=i[O],i.hasOwnProperty(O)&&p!=null&&!c.hasOwnProperty(O))switch(O){case"value":break;case"children":break;default:wt(n,r,O,null,c,p)}for(T in c)if(p=c[T],x=i[T],c.hasOwnProperty(T)&&(p!=null||x!=null))switch(T){case"value":ce=p;break;case"defaultValue":de=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(s(91));break;default:p!==x&&wt(n,r,T,p,c,x)}qo(n,ce,de);return;case"option":for(var Me in i)if(ce=i[Me],i.hasOwnProperty(Me)&&ce!=null&&!c.hasOwnProperty(Me))switch(Me){case"selected":n.selected=!1;break;default:wt(n,r,Me,null,c,ce)}for(V in c)if(ce=c[V],de=i[V],c.hasOwnProperty(V)&&ce!==de&&(ce!=null||de!=null))switch(V){case"selected":n.selected=ce&&typeof ce!="function"&&typeof ce!="symbol";break;default:wt(n,r,V,ce,c,de)}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 $e in i)ce=i[$e],i.hasOwnProperty($e)&&ce!=null&&!c.hasOwnProperty($e)&&wt(n,r,$e,null,c,ce);for(oe in c)if(ce=c[oe],de=i[oe],c.hasOwnProperty(oe)&&ce!==de&&(ce!=null||de!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(s(137,r));break;default:wt(n,r,oe,ce,c,de)}return;default:if(Mr(r)){for(var Ct in i)ce=i[Ct],i.hasOwnProperty(Ct)&&ce!==void 0&&!c.hasOwnProperty(Ct)&&Xf(n,r,Ct,void 0,c,ce);for(he in c)ce=c[he],de=i[he],!c.hasOwnProperty(he)||ce===de||ce===void 0&&de===void 0||Xf(n,r,he,ce,c,de);return}}for(var te in i)ce=i[te],i.hasOwnProperty(te)&&ce!=null&&!c.hasOwnProperty(te)&&wt(n,r,te,null,c,ce);for(be in c)ce=c[be],de=i[be],!c.hasOwnProperty(be)||ce===de||ce==null&&de==null||wt(n,r,be,ce,c,de)}function Sb(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function F2(){if(typeof performance.getEntriesByType=="function"){for(var n=0,r=0,i=performance.getEntriesByType("resource"),c=0;c<i.length;c++){var p=i[c],x=p.transferSize,T=p.initiatorType,O=p.duration;if(x&&O&&Sb(T)){for(T=0,O=p.responseEnd,c+=1;c<i.length;c++){var V=i[c],oe=V.startTime;if(oe>O)break;var he=V.transferSize,be=V.initiatorType;he&&Sb(be)&&(V=V.responseEnd,T+=he*(V<O?1:(O-oe)/(V-oe)))}if(--c,r+=8*(x+T)/(p.duration/1e3),n++,10<n)break}}if(0<n)return r/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var Qf=null,Wf=null;function Fu(n){return n.nodeType===9?n:n.ownerDocument}function Ab(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function wb(n,r){if(n===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&r==="foreignObject"?0:n}function Zf(n,r){return n==="textarea"||n==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Jf=null;function z2(){var n=window.event;return n&&n.type==="popstate"?n===Jf?!1:(Jf=n,!0):(Jf=null,!1)}var Cb=typeof setTimeout=="function"?setTimeout:void 0,$2=typeof clearTimeout=="function"?clearTimeout:void 0,kb=typeof Promise=="function"?Promise:void 0,q2=typeof queueMicrotask=="function"?queueMicrotask:typeof kb<"u"?function(n){return kb.resolve(null).then(n).catch(Y2)}:Cb;function Y2(n){setTimeout(function(){throw n})}function Zr(n){return n==="head"}function Rb(n,r){var i=r,c=0;do{var p=i.nextSibling;if(n.removeChild(i),p&&p.nodeType===8)if(i=p.data,i==="/$"||i==="/&"){if(c===0){n.removeChild(p),Mi(r);return}c--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")c++;else if(i==="html")zl(n.ownerDocument.documentElement);else if(i==="head"){i=n.ownerDocument.head,zl(i);for(var x=i.firstChild;x;){var T=x.nextSibling,O=x.nodeName;x[bs]||O==="SCRIPT"||O==="STYLE"||O==="LINK"&&x.rel.toLowerCase()==="stylesheet"||i.removeChild(x),x=T}}else i==="body"&&zl(n.ownerDocument.body);i=p}while(i);Mi(r)}function Ob(n,r){var i=n;n=0;do{var c=i.nextSibling;if(i.nodeType===1?r?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(r?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),c&&c.nodeType===8)if(i=c.data,i==="/$"){if(n===0)break;n--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||n++;i=c}while(i)}function em(n){var r=n.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var i=r;switch(r=r.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":em(i),al(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}n.removeChild(i)}}function G2(n,r,i,c){for(;n.nodeType===1;){var p=i;if(n.nodeName.toLowerCase()!==r.toLowerCase()){if(!c&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(c){if(!n[bs])switch(r){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(x=n.getAttribute("rel"),x==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(x!==p.rel||n.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||n.getAttribute("title")!==(p.title==null?null:p.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(x=n.getAttribute("src"),(x!==(p.src==null?null:p.src)||n.getAttribute("type")!==(p.type==null?null:p.type)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&x&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(r==="input"&&n.type==="hidden"){var x=p.name==null?null:""+p.name;if(p.type==="hidden"&&n.getAttribute("name")===x)return n}else return n;if(n=Sa(n.nextSibling),n===null)break}return null}function K2(n,r,i){if(r==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=Sa(n.nextSibling),n===null))return null;return n}function Ib(n,r){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!r||(n=Sa(n.nextSibling),n===null))return null;return n}function tm(n){return n.data==="$?"||n.data==="$~"}function nm(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function V2(n,r){var i=n.ownerDocument;if(n.data==="$~")n._reactRetry=r;else if(n.data!=="$?"||i.readyState!=="loading")r();else{var c=function(){r(),i.removeEventListener("DOMContentLoaded",c)};i.addEventListener("DOMContentLoaded",c),n._reactRetry=c}}function Sa(n){for(;n!=null;n=n.nextSibling){var r=n.nodeType;if(r===1||r===3)break;if(r===8){if(r=n.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return n}var am=null;function Mb(n){n=n.nextSibling;for(var r=0;n;){if(n.nodeType===8){var i=n.data;if(i==="/$"||i==="/&"){if(r===0)return Sa(n.nextSibling);r--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||r++}n=n.nextSibling}return null}function Db(n){n=n.previousSibling;for(var r=0;n;){if(n.nodeType===8){var i=n.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(r===0)return n;r--}else i!=="/$"&&i!=="/&"||r++}n=n.previousSibling}return null}function Lb(n,r,i){switch(r=Fu(i),n){case"html":if(n=r.documentElement,!n)throw Error(s(452));return n;case"head":if(n=r.head,!n)throw Error(s(453));return n;case"body":if(n=r.body,!n)throw Error(s(454));return n;default:throw Error(s(451))}}function zl(n){for(var r=n.attributes;r.length;)n.removeAttributeNode(r[0]);al(n)}var Aa=new Map,jb=new Set;function zu(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var _r=P.d;P.d={f:X2,r:Q2,D:W2,C:Z2,L:J2,m:ev,X:nv,S:tv,M:av};function X2(){var n=_r.f(),r=Mu();return n||r}function Q2(n){var r=sr(n);r!==null&&r.tag===5&&r.type==="form"?J0(r):_r.r(n)}var Ri=typeof document>"u"?null:document;function Bb(n,r,i){var c=Ri;if(c&&typeof r=="string"&&r){var p=qn(r);p='link[rel="'+n+'"][href="'+p+'"]',typeof i=="string"&&(p+='[crossorigin="'+i+'"]'),jb.has(p)||(jb.add(p),n={rel:n,crossOrigin:i,href:r},c.querySelector(p)===null&&(r=c.createElement("link"),Tn(r,"link",n),nn(r),c.head.appendChild(r)))}}function W2(n){_r.D(n),Bb("dns-prefetch",n,null)}function Z2(n,r){_r.C(n,r),Bb("preconnect",n,r)}function J2(n,r,i){_r.L(n,r,i);var c=Ri;if(c&&n&&r){var p='link[rel="preload"][as="'+qn(r)+'"]';r==="image"&&i&&i.imageSrcSet?(p+='[imagesrcset="'+qn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(p+='[imagesizes="'+qn(i.imageSizes)+'"]')):p+='[href="'+qn(n)+'"]';var x=p;switch(r){case"style":x=Oi(n);break;case"script":x=Ii(n)}Aa.has(x)||(n=g({rel:"preload",href:r==="image"&&i&&i.imageSrcSet?void 0:n,as:r},i),Aa.set(x,n),c.querySelector(p)!==null||r==="style"&&c.querySelector($l(x))||r==="script"&&c.querySelector(ql(x))||(r=c.createElement("link"),Tn(r,"link",n),nn(r),c.head.appendChild(r)))}}function ev(n,r){_r.m(n,r);var i=Ri;if(i&&n){var c=r&&typeof r.as=="string"?r.as:"script",p='link[rel="modulepreload"][as="'+qn(c)+'"][href="'+qn(n)+'"]',x=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Ii(n)}if(!Aa.has(x)&&(n=g({rel:"modulepreload",href:n},r),Aa.set(x,n),i.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(ql(x)))return}c=i.createElement("link"),Tn(c,"link",n),nn(c),i.head.appendChild(c)}}}function tv(n,r,i){_r.S(n,r,i);var c=Ri;if(c&&n){var p=Ir(c).hoistableStyles,x=Oi(n);r=r||"default";var T=p.get(x);if(!T){var O={loading:0,preload:null};if(T=c.querySelector($l(x)))O.loading=5;else{n=g({rel:"stylesheet",href:n,"data-precedence":r},i),(i=Aa.get(x))&&rm(n,i);var V=T=c.createElement("link");nn(V),Tn(V,"link",n),V._p=new Promise(function(oe,he){V.onload=oe,V.onerror=he}),V.addEventListener("load",function(){O.loading|=1}),V.addEventListener("error",function(){O.loading|=2}),O.loading|=4,$u(T,r,c)}T={type:"stylesheet",instance:T,count:1,state:O},p.set(x,T)}}}function nv(n,r){_r.X(n,r);var i=Ri;if(i&&n){var c=Ir(i).hoistableScripts,p=Ii(n),x=c.get(p);x||(x=i.querySelector(ql(p)),x||(n=g({src:n,async:!0},r),(r=Aa.get(p))&&sm(n,r),x=i.createElement("script"),nn(x),Tn(x,"link",n),i.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(p,x))}}function av(n,r){_r.M(n,r);var i=Ri;if(i&&n){var c=Ir(i).hoistableScripts,p=Ii(n),x=c.get(p);x||(x=i.querySelector(ql(p)),x||(n=g({src:n,async:!0,type:"module"},r),(r=Aa.get(p))&&sm(n,r),x=i.createElement("script"),nn(x),Tn(x,"link",n),i.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(p,x))}}function Pb(n,r,i,c){var p=(p=Ne.current)?zu(p):null;if(!p)throw Error(s(446));switch(n){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(r=Oi(i.href),i=Ir(p).hoistableStyles,c=i.get(r),c||(c={type:"style",instance:null,count:0,state:null},i.set(r,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){n=Oi(i.href);var x=Ir(p).hoistableStyles,T=x.get(n);if(T||(p=p.ownerDocument||p,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(n,T),(x=p.querySelector($l(n)))&&!x._p&&(T.instance=x,T.state.loading=5),Aa.has(n)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Aa.set(n,i),x||rv(p,n,i,T.state))),r&&c===null)throw Error(s(528,""));return T}if(r&&c!==null)throw Error(s(529,""));return null;case"script":return r=i.async,i=i.src,typeof i=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Ii(i),i=Ir(p).hoistableScripts,c=i.get(r),c||(c={type:"script",instance:null,count:0,state:null},i.set(r,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,n))}}function Oi(n){return'href="'+qn(n)+'"'}function $l(n){return'link[rel="stylesheet"]['+n+"]"}function Ub(n){return g({},n,{"data-precedence":n.precedence,precedence:null})}function rv(n,r,i,c){n.querySelector('link[rel="preload"][as="style"]['+r+"]")?c.loading=1:(r=n.createElement("link"),c.preload=r,r.addEventListener("load",function(){return c.loading|=1}),r.addEventListener("error",function(){return c.loading|=2}),Tn(r,"link",i),nn(r),n.head.appendChild(r))}function Ii(n){return'[src="'+qn(n)+'"]'}function ql(n){return"script[async]"+n}function Hb(n,r,i){if(r.count++,r.instance===null)switch(r.type){case"style":var c=n.querySelector('style[data-href~="'+qn(i.href)+'"]');if(c)return r.instance=c,nn(c),c;var p=g({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return c=(n.ownerDocument||n).createElement("style"),nn(c),Tn(c,"style",p),$u(c,i.precedence,n),r.instance=c;case"stylesheet":p=Oi(i.href);var x=n.querySelector($l(p));if(x)return r.state.loading|=4,r.instance=x,nn(x),x;c=Ub(i),(p=Aa.get(p))&&rm(c,p),x=(n.ownerDocument||n).createElement("link"),nn(x);var T=x;return T._p=new Promise(function(O,V){T.onload=O,T.onerror=V}),Tn(x,"link",c),r.state.loading|=4,$u(x,i.precedence,n),r.instance=x;case"script":return x=Ii(i.src),(p=n.querySelector(ql(x)))?(r.instance=p,nn(p),p):(c=i,(p=Aa.get(x))&&(c=g({},i),sm(c,p)),n=n.ownerDocument||n,p=n.createElement("script"),nn(p),Tn(p,"link",c),n.head.appendChild(p),r.instance=p);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(c=r.instance,r.state.loading|=4,$u(c,i.precedence,n));return r.instance}function $u(n,r,i){for(var c=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,x=p,T=0;T<c.length;T++){var O=c[T];if(O.dataset.precedence===r)x=O;else if(x!==p)break}x?x.parentNode.insertBefore(n,x.nextSibling):(r=i.nodeType===9?i.head:i,r.insertBefore(n,r.firstChild))}function rm(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.title==null&&(n.title=r.title)}function sm(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.integrity==null&&(n.integrity=r.integrity)}var qu=null;function Fb(n,r,i){if(qu===null){var c=new Map,p=qu=new Map;p.set(i,c)}else p=qu,c=p.get(i),c||(c=new Map,p.set(i,c));if(c.has(n))return c;for(c.set(n,null),i=i.getElementsByTagName(n),p=0;p<i.length;p++){var x=i[p];if(!(x[bs]||x[Xt]||n==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var T=x.getAttribute(r)||"";T=n+T;var O=c.get(T);O?O.push(x):c.set(T,[x])}}return c}function zb(n,r,i){n=n.ownerDocument||n,n.head.insertBefore(i,r==="title"?n.querySelector("head > title"):null)}function sv(n,r,i){if(i===1||r.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return n=r.disabled,typeof r.precedence=="string"&&n==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function $b(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function iv(n,r,i,c){if(i.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var p=Oi(c.href),x=r.querySelector($l(p));if(x){r=x._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(n.count++,n=Yu.bind(n),r.then(n,n)),i.state.loading|=4,i.instance=x,nn(x);return}x=r.ownerDocument||r,c=Ub(c),(p=Aa.get(p))&&rm(c,p),x=x.createElement("link"),nn(x);var T=x;T._p=new Promise(function(O,V){T.onload=O,T.onerror=V}),Tn(x,"link",c),i.instance=x}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(i,r),(r=i.state.preload)&&(i.state.loading&3)===0&&(n.count++,i=Yu.bind(n),r.addEventListener("load",i),r.addEventListener("error",i))}}var im=0;function lv(n,r){return n.stylesheets&&n.count===0&&Ku(n,n.stylesheets),0<n.count||0<n.imgCount?function(i){var c=setTimeout(function(){if(n.stylesheets&&Ku(n,n.stylesheets),n.unsuspend){var x=n.unsuspend;n.unsuspend=null,x()}},6e4+r);0<n.imgBytes&&im===0&&(im=62500*F2());var p=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Ku(n,n.stylesheets),n.unsuspend)){var x=n.unsuspend;n.unsuspend=null,x()}},(n.imgBytes>im?50:800)+r);return n.unsuspend=i,function(){n.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function Yu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ku(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Gu=null;function Ku(n,r){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Gu=new Map,r.forEach(ov,n),Gu=null,Yu.call(n))}function ov(n,r){if(!(r.state.loading&4)){var i=Gu.get(n);if(i)var c=i.get(null);else{i=new Map,Gu.set(n,i);for(var p=n.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<p.length;x++){var T=p[x];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(i.set(T.dataset.precedence,T),c=T)}c&&i.set(null,c)}p=r.instance,T=p.getAttribute("data-precedence"),x=i.get(T)||c,x===c&&i.set(null,p),i.set(T,p),this.count++,c=Yu.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),x?x.parentNode.insertBefore(p,x.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(p,n.firstChild)),r.state.loading|=4}}var Yl={$$typeof:I,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function uv(n,r,i,c,p,x,T,O,V){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=jt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jt(0),this.hiddenUpdates=jt(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=x,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=V,this.incompleteTransitions=new Map}function qb(n,r,i,c,p,x,T,O,V,oe,he,be){return n=new uv(n,r,i,T,V,oe,he,be,O),r=1,x===!0&&(r|=24),x=la(3,null,null,r),n.current=x,x.stateNode=n,r=Pd(),r.refCount++,n.pooledCache=r,r.refCount++,x.memoizedState={element:c,isDehydrated:i,cache:r},zd(x),n}function Yb(n){return n?(n=ui,n):ui}function Gb(n,r,i,c,p,x){p=Yb(p),c.context===null?c.context=p:c.pendingContext=p,c=Fr(r),c.payload={element:i},x=x===void 0?null:x,x!==null&&(c.callback=x),i=zr(n,c,r),i!==null&&(Qn(i,n,r),_l(i,n,r))}function Kb(n,r){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var i=n.retryLane;n.retryLane=i!==0&&i<r?i:r}}function lm(n,r){Kb(n,r),(n=n.alternate)&&Kb(n,r)}function Vb(n){if(n.tag===13||n.tag===31){var r=_s(n,67108864);r!==null&&Qn(r,n,67108864),lm(n,67108864)}}function Xb(n){if(n.tag===13||n.tag===31){var r=fa();r=Ht(r);var i=_s(n,r);i!==null&&Qn(i,n,r),lm(n,r)}}var Vu=!0;function cv(n,r,i,c){var p=D.T;D.T=null;var x=P.p;try{P.p=2,om(n,r,i,c)}finally{P.p=x,D.T=p}}function dv(n,r,i,c){var p=D.T;D.T=null;var x=P.p;try{P.p=8,om(n,r,i,c)}finally{P.p=x,D.T=p}}function om(n,r,i,c){if(Vu){var p=um(c);if(p===null)Vf(n,r,c,Xu,i),Wb(n,c);else if(mv(p,n,r,i,c))c.stopPropagation();else if(Wb(n,c),r&4&&-1<fv.indexOf(n)){for(;p!==null;){var x=sr(p);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var T=zn(x.pendingLanes);if(T!==0){var O=x;for(O.pendingLanes|=2,O.entangledLanes|=2;T;){var V=1<<31-Et(T);O.entanglements[1]|=V,T&=~V}Ga(x),(bt&6)===0&&(Ou=St()+500,Ul(0))}}break;case 31:case 13:O=_s(x,2),O!==null&&Qn(O,x,2),Mu(),lm(x,2)}if(x=um(c),x===null&&Vf(n,r,c,Xu,i),x===p)break;p=x}p!==null&&c.stopPropagation()}else Vf(n,r,c,null,i)}}function um(n){return n=We(n),cm(n)}var Xu=null;function cm(n){if(Xu=null,n=Dn(n),n!==null){var r=u(n);if(r===null)n=null;else{var i=r.tag;if(i===13){if(n=d(r),n!==null)return n;n=null}else if(i===31){if(n=f(r),n!==null)return n;n=null}else if(i===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;n=null}else r!==n&&(n=null)}}return Xu=n,null}function Qb(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ar()){case me:return 2;case Se:return 8;case Fe:case $:return 32;case Re:return 268435456;default:return 32}default:return 32}}var dm=!1,Jr=null,es=null,ts=null,Gl=new Map,Kl=new Map,ns=[],fv="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 Wb(n,r){switch(n){case"focusin":case"focusout":Jr=null;break;case"dragenter":case"dragleave":es=null;break;case"mouseover":case"mouseout":ts=null;break;case"pointerover":case"pointerout":Gl.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Kl.delete(r.pointerId)}}function Vl(n,r,i,c,p,x){return n===null||n.nativeEvent!==x?(n={blockedOn:r,domEventName:i,eventSystemFlags:c,nativeEvent:x,targetContainers:[p]},r!==null&&(r=sr(r),r!==null&&Vb(r)),n):(n.eventSystemFlags|=c,r=n.targetContainers,p!==null&&r.indexOf(p)===-1&&r.push(p),n)}function mv(n,r,i,c,p){switch(r){case"focusin":return Jr=Vl(Jr,n,r,i,c,p),!0;case"dragenter":return es=Vl(es,n,r,i,c,p),!0;case"mouseover":return ts=Vl(ts,n,r,i,c,p),!0;case"pointerover":var x=p.pointerId;return Gl.set(x,Vl(Gl.get(x)||null,n,r,i,c,p)),!0;case"gotpointercapture":return x=p.pointerId,Kl.set(x,Vl(Kl.get(x)||null,n,r,i,c,p)),!0}return!1}function Zb(n){var r=Dn(n.target);if(r!==null){var i=u(r);if(i!==null){if(r=i.tag,r===13){if(r=d(i),r!==null){n.blockedOn=r,Js(n.priority,function(){Xb(i)});return}}else if(r===31){if(r=f(i),r!==null){n.blockedOn=r,Js(n.priority,function(){Xb(i)});return}}else if(r===3&&i.stateNode.current.memoizedState.isDehydrated){n.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Qu(n){if(n.blockedOn!==null)return!1;for(var r=n.targetContainers;0<r.length;){var i=um(n.nativeEvent);if(i===null){i=n.nativeEvent;var c=new i.constructor(i.type,i);Le=c,i.target.dispatchEvent(c),Le=null}else return r=sr(i),r!==null&&Vb(r),n.blockedOn=i,!1;r.shift()}return!0}function Jb(n,r,i){Qu(n)&&i.delete(r)}function hv(){dm=!1,Jr!==null&&Qu(Jr)&&(Jr=null),es!==null&&Qu(es)&&(es=null),ts!==null&&Qu(ts)&&(ts=null),Gl.forEach(Jb),Kl.forEach(Jb)}function Wu(n,r){n.blockedOn===r&&(n.blockedOn=null,dm||(dm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,hv)))}var Zu=null;function ex(n){Zu!==n&&(Zu=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Zu===n&&(Zu=null);for(var r=0;r<n.length;r+=3){var i=n[r],c=n[r+1],p=n[r+2];if(typeof c!="function"){if(cm(c||i)===null)continue;break}var x=sr(i);x!==null&&(n.splice(r,3),r-=3,uf(x,{pending:!0,data:p,method:i.method,action:c},c,p))}}))}function Mi(n){function r(V){return Wu(V,n)}Jr!==null&&Wu(Jr,n),es!==null&&Wu(es,n),ts!==null&&Wu(ts,n),Gl.forEach(r),Kl.forEach(r);for(var i=0;i<ns.length;i++){var c=ns[i];c.blockedOn===n&&(c.blockedOn=null)}for(;0<ns.length&&(i=ns[0],i.blockedOn===null);)Zb(i),i.blockedOn===null&&ns.shift();if(i=(n.ownerDocument||n).$$reactFormReplay,i!=null)for(c=0;c<i.length;c+=3){var p=i[c],x=i[c+1],T=p[_n]||null;if(typeof x=="function")T||ex(i);else if(T){var O=null;if(x&&x.hasAttribute("formAction")){if(p=x,T=x[_n]||null)O=T.formAction;else if(cm(p)!==null)continue}else O=T.action;typeof O=="function"?i[c+1]=O:(i.splice(c,3),c-=3),ex(i)}}}function tx(){function n(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(T){return p=T})},focusReset:"manual",scroll:"manual"})}function r(){p!==null&&(p(),p=null),c||setTimeout(i,20)}function i(){if(!c&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(i,100),function(){c=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),p!==null&&(p(),p=null)}}}function fm(n){this._internalRoot=n}Ju.prototype.render=fm.prototype.render=function(n){var r=this._internalRoot;if(r===null)throw Error(s(409));var i=r.current,c=fa();Gb(i,c,n,r,null,null)},Ju.prototype.unmount=fm.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var r=n.containerInfo;Gb(n.current,2,null,n,null,null),Mu(),r[Rr]=null}};function Ju(n){this._internalRoot=n}Ju.prototype.unstable_scheduleHydration=function(n){if(n){var r=Zs();n={blockedOn:null,target:n,priority:r};for(var i=0;i<ns.length&&r!==0&&r<ns[i].priority;i++);ns.splice(i,0,n),i===0&&Zb(n)}};var nx=t.version;if(nx!=="19.2.8")throw Error(s(527,nx,"19.2.8"));P.findDOMNode=function(n){var r=n._reactInternals;if(r===void 0)throw typeof n.render=="function"?Error(s(188)):(n=Object.keys(n).join(","),Error(s(268,n)));return n=h(r),n=n!==null?b(n):null,n=n===null?null:n.stateNode,n};var pv={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ec=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ec.isDisabled&&ec.supportsFiber)try{tn=ec.inject(pv),Dt=ec}catch{}}return Ql.createRoot=function(n,r){if(!o(n))throw Error(s(299));var i=!1,c="",p=ug,x=cg,T=dg;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(x=r.onCaughtError),r.onRecoverableError!==void 0&&(T=r.onRecoverableError)),r=qb(n,1,!1,null,null,i,c,null,p,x,T,tx),n[Rr]=r.current,Kf(n),new fm(r)},Ql.hydrateRoot=function(n,r,i){if(!o(n))throw Error(s(299));var c=!1,p="",x=ug,T=cg,O=dg,V=null;return i!=null&&(i.unstable_strictMode===!0&&(c=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onUncaughtError!==void 0&&(x=i.onUncaughtError),i.onCaughtError!==void 0&&(T=i.onCaughtError),i.onRecoverableError!==void 0&&(O=i.onRecoverableError),i.formState!==void 0&&(V=i.formState)),r=qb(n,1,!0,r,i??null,c,p,V,x,T,O,tx),r.context=Yb(null),i=r.current,c=fa(),c=Ht(c),p=Fr(c),p.callback=null,zr(i,p,c),i=c,r.current.lanes=i,Rt(r,i),Ga(r),n[Rr]=r.current,Kf(n),new Ju(r)},Ql.version="19.2.8",Ql}var fx;function wv(){if(fx)return pm.exports;fx=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),pm.exports=Av(),pm.exports}var Cv=wv();/**
50
+ * react-router v7.18.1
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var Ph=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,KE=/^[\\/]{2}/;function kv(e,t){return t+e.replace(/\\/g,"/")}var mx="popstate";function hx(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Rv(e={}){function t(s,o){var h;let u=(h=o.state)==null?void 0:h.masked,{pathname:d,search:f,hash:m}=u||s.location;return rh("",{pathname:d,search:f,hash:m},o.state&&o.state.usr||null,o.state&&o.state.key||"default",u?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function a(s,o){return typeof o=="string"?o:bo(o)}return Iv(t,a,null,e)}function $t(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ka(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ov(){return Math.random().toString(36).substring(2,10)}function px(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function rh(e,t,a=null,s,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Vi(t):t,state:a,key:t&&t.key||s||Ov(),mask:o}}function bo({pathname:e="/",search:t="",hash:a=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function Vi(e){let t={};if(e){let a=e.indexOf("#");a>=0&&(t.hash=e.substring(a),e=e.substring(0,a));let s=e.indexOf("?");s>=0&&(t.search=e.substring(s),e=e.substring(0,s)),e&&(t.pathname=e)}return t}function Iv(e,t,a,s={}){let{window:o=document.defaultView,v5Compat:u=!1}=s,d=o.history,f="POP",m=null,h=b();h==null&&(h=0,d.replaceState({...d.state,idx:h},""));function b(){return(d.state||{idx:null}).idx}function g(){f="POP";let w=b(),A=w==null?null:w-h;h=w,m&&m({action:f,location:S.location,delta:A})}function y(w,A){f="PUSH";let R=hx(w)?w:rh(S.location,w,A);h=b()+1;let I=px(R,h),Y=S.createHref(R.mask||R);try{d.pushState(I,"",Y)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;o.location.assign(Y)}u&&m&&m({action:f,location:S.location,delta:1})}function N(w,A){f="REPLACE";let R=hx(w)?w:rh(S.location,w,A);h=b();let I=px(R,h),Y=S.createHref(R.mask||R);d.replaceState(I,"",Y),u&&m&&m({action:f,location:S.location,delta:0})}function v(w){return Mv(o,w)}let S={get action(){return f},get location(){return e(o,d)},listen(w){if(m)throw new Error("A history only accepts one active listener");return o.addEventListener(mx,g),m=w,()=>{o.removeEventListener(mx,g),m=null}},createHref(w){return t(o,w)},createURL:v,encodeLocation(w){let A=v(w);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:y,replace:N,go(w){return d.go(w)}};return S}function Mv(e,t,a=!1){let s="http://localhost";e&&(s=e.location.origin!=="null"?e.location.origin:e.location.href),$t(s,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:bo(t);return o=o.replace(/ $/,"%20"),!a&&KE.test(o)&&(o=s+o),new URL(o,s)}function VE(e,t,a="/"){return Dv(e,t,a,!1)}function Dv(e,t,a,s,o){let u=typeof t=="string"?Vi(t):t,d=Ar(u.pathname||"/",a);if(d==null)return null;let f=Lv(e),m=null,h=Gv(d);for(let b=0;m==null&&b<f.length;++b)m=Yv(f[b],h,s);return m}function Lv(e){let t=XE(e);return jv(t),t}function XE(e,t=[],a=[],s="",o=!1){let u=(d,f,m=o,h)=>{let b={relativePath:h===void 0?d.path||"":h,caseSensitive:d.caseSensitive===!0,childrenIndex:f,route:d};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(s)&&m)return;$t(b.relativePath.startsWith(s),`Absolute route path "${b.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(s.length)}let g=Ba([s,b.relativePath]),y=a.concat(b);d.children&&d.children.length>0&&($t(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),XE(d.children,t,y,g,m)),!(d.path==null&&!d.index)&&t.push({path:g,score:$v(g,d.index),routesMeta:y.map((N,v)=>{let[S,w]=ZE(N.relativePath,N.caseSensitive,v===y.length-1);return{...N,matcher:S,compiledParams:w}})})};return e.forEach((d,f)=>{var m;if(d.path===""||!((m=d.path)!=null&&m.includes("?")))u(d,f);else for(let h of QE(d.path))u(d,f,!0,h)}),t}function QE(e){let t=e.split("/");if(t.length===0)return[];let[a,...s]=t,o=a.endsWith("?"),u=a.replace(/\?$/,"");if(s.length===0)return o?[u,""]:[u];let d=QE(s.join("/")),f=[];return f.push(...d.map(m=>m===""?u:[u,m].join("/"))),o&&f.push(...d),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function jv(e){e.sort((t,a)=>t.score!==a.score?a.score-t.score:qv(t.routesMeta.map(s=>s.childrenIndex),a.routesMeta.map(s=>s.childrenIndex)))}var Bv=/^:[\w-]+$/,Pv=3,Uv=2,Hv=1,Fv=10,zv=-2,gx=e=>e==="*";function $v(e,t){let a=e.split("/"),s=a.length;return a.some(gx)&&(s+=zv),t&&(s+=Uv),a.filter(o=>!gx(o)).reduce((o,u)=>o+(Bv.test(u)?Pv:u===""?Hv:Fv),s)}function qv(e,t){return e.length===t.length&&e.slice(0,-1).every((s,o)=>s===t[o])?e[e.length-1]-t[t.length-1]:0}function Yv(e,t,a=!1){let{routesMeta:s}=e,o={},u="/",d=[];for(let f=0;f<s.length;++f){let m=s[f],h=f===s.length-1,b=u==="/"?t:t.slice(u.length)||"/",g={path:m.relativePath,caseSensitive:m.caseSensitive,end:h},y=m.matcher&&m.compiledParams?WE(g,b,m.matcher,m.compiledParams):yc(g,b),N=m.route;if(!y&&h&&a&&!s[s.length-1].route.index&&(y=yc({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},b)),!y)return null;Object.assign(o,y.params),d.push({params:o,pathname:Ba([u,y.pathname]),pathnameBase:Xv(Ba([u,y.pathnameBase])),route:N}),y.pathnameBase!=="/"&&(u=Ba([u,y.pathnameBase]))}return d}function yc(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[a,s]=ZE(e.path,e.caseSensitive,e.end);return WE(e,t,a,s)}function WE(e,t,a,s){let o=t.match(a);if(!o)return null;let u=o[0],d=u.replace(/(.)\/+$/,"$1"),f=o.slice(1);return{params:s.reduce((h,{paramName:b,isOptional:g},y)=>{if(b==="*"){let v=f[y]||"";d=u.slice(0,u.length-v.length).replace(/(.)\/+$/,"$1")}const N=f[y];return g&&!N?h[b]=void 0:h[b]=(N||"").replace(/%2F/g,"/"),h},{}),pathname:u,pathnameBase:d,pattern:e}}function ZE(e,t=!1,a=!0){ka(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let s=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,f,m,h,b)=>{if(s.push({paramName:f,isOptional:m!=null}),m){let g=b.charAt(h+d.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),s]}function Gv(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ka(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ar(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,s=e.charAt(a);return s&&s!=="/"?null:e.slice(a)||"/"}function Kv(e,t="/"){let{pathname:a,search:s="",hash:o=""}=typeof e=="string"?Vi(e):e,u;return a?(a=JE(a),a.startsWith("/")?u=bx(a.substring(1),"/"):u=bx(a,t)):u=t,{pathname:u,search:Qv(s),hash:Wv(o)}}function bx(e,t){let a=Nc(t).split("/");return e.split("/").forEach(o=>{o===".."?a.length>1&&a.pop():o!=="."&&a.push(o)}),a.length>1?a.join("/"):"/"}function Em(e,t,a,s){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Vv(e){return e.filter((t,a)=>a===0||t.route.path&&t.route.path.length>0)}function Uh(e){let t=Vv(e);return t.map((a,s)=>s===t.length-1?a.pathname:a.pathnameBase)}function zc(e,t,a,s=!1){let o;typeof e=="string"?o=Vi(e):(o={...e},$t(!o.pathname||!o.pathname.includes("?"),Em("?","pathname","search",o)),$t(!o.pathname||!o.pathname.includes("#"),Em("#","pathname","hash",o)),$t(!o.search||!o.search.includes("#"),Em("#","search","hash",o)));let u=e===""||o.pathname==="",d=u?"/":o.pathname,f;if(d==null)f=a;else{let g=t.length-1;if(!s&&d.startsWith("..")){let y=d.split("/");for(;y[0]==="..";)y.shift(),g-=1;o.pathname=y.join("/")}f=g>=0?t[g]:"/"}let m=Kv(o,f),h=d&&d!=="/"&&d.endsWith("/"),b=(u||d===".")&&a.endsWith("/");return!m.pathname.endsWith("/")&&(h||b)&&(m.pathname+="/"),m}var JE=e=>e.replace(/[\\/]{2,}/g,"/"),Ba=e=>JE(e.join("/")),Nc=e=>e.replace(/\/+$/,""),Xv=e=>Nc(e).replace(/^\/*/,"/"),Qv=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Wv=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Zv=class{constructor(e,t,a,s=!1){this.status=e,this.statusText=t||"",this.internal=s,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function Jv(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function eS(e){let t=e.map(a=>a.route.path).filter(Boolean);return Ba(t)||"/"}var ey=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ty(e,t){let a=e;if(typeof a!="string"||!Ph.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let s=a,o=!1;if(ey)try{let u=new URL(window.location.href),d=KE.test(a)?new URL(kv(a,u.protocol)):new URL(a),f=Ar(d.pathname,t);d.origin===u.origin&&f!=null?a=f+d.search+d.hash:o=!0}catch{ka(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:o,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ny=["POST","PUT","PATCH","DELETE"];new Set(ny);var tS=["GET",...ny];new Set(tS);var nS=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function aS(e){try{return nS.includes(new URL(e).protocol)}catch{return!1}}var Xi=_.createContext(null);Xi.displayName="DataRouter";var $c=_.createContext(null);$c.displayName="DataRouterState";var ay=_.createContext(!1);function rS(){return _.useContext(ay)}var ry=_.createContext({isTransitioning:!1});ry.displayName="ViewTransition";var sS=_.createContext(new Map);sS.displayName="Fetchers";var iS=_.createContext(null);iS.displayName="Await";var pa=_.createContext(null);pa.displayName="Navigation";var Ao=_.createContext(null);Ao.displayName="Location";var Oa=_.createContext({outlet:null,matches:[],isDataRoute:!1});Oa.displayName="Route";var Hh=_.createContext(null);Hh.displayName="RouteError";var sy="REACT_ROUTER_ERROR",lS="REDIRECT",oS="ROUTE_ERROR_RESPONSE";function uS(e){if(e.startsWith(`${sy}:${lS}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function cS(e){if(e.startsWith(`${sy}:${oS}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Zv(t.status,t.statusText,t.data)}catch{}}function dS(e,{relative:t}={}){$t(Qi(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:s}=_.useContext(pa),{hash:o,pathname:u,search:d}=wo(e,{relative:t}),f=u;return a!=="/"&&(f=u==="/"?a:Ba([a,u])),s.createHref({pathname:f,search:d,hash:o})}function Qi(){return _.useContext(Ao)!=null}function ga(){return $t(Qi(),"useLocation() may be used only in the context of a <Router> component."),_.useContext(Ao).location}var iy="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ly(e){_.useContext(pa).static||_.useLayoutEffect(e)}function Pn(){let{isDataRoute:e}=_.useContext(Oa);return e?wS():fS()}function fS(){$t(Qi(),"useNavigate() may be used only in the context of a <Router> component.");let e=_.useContext(Xi),{basename:t,navigator:a}=_.useContext(pa),{matches:s}=_.useContext(Oa),{pathname:o}=ga(),u=JSON.stringify(Uh(s)),d=_.useRef(!1);return ly(()=>{d.current=!0}),_.useCallback((m,h={})=>{if(ka(d.current,iy),!d.current)return;if(typeof m=="number"){a.go(m);return}let b=zc(m,JSON.parse(u),o,h.relative==="path");e==null&&t!=="/"&&(b.pathname=b.pathname==="/"?t:Ba([t,b.pathname])),(h.replace?a.replace:a.push)(b,h.state,h)},[t,a,u,o,e])}var mS=_.createContext(null);function hS(e){let t=_.useContext(Oa).outlet;return _.useMemo(()=>t&&_.createElement(mS.Provider,{value:e},t),[t,e])}function pS(){let{matches:e}=_.useContext(Oa),t=e[e.length-1];return(t==null?void 0:t.params)??{}}function wo(e,{relative:t}={}){let{matches:a}=_.useContext(Oa),{pathname:s}=ga(),o=JSON.stringify(Uh(a));return _.useMemo(()=>zc(e,JSON.parse(o),s,t==="path"),[e,o,s,t])}function gS(e,t){return oy(e,t)}function oy(e,t,a){var w;$t(Qi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=_.useContext(pa),{matches:o}=_.useContext(Oa),u=o[o.length-1],d=u?u.params:{},f=u?u.pathname:"/",m=u?u.pathnameBase:"/",h=u&&u.route;{let A=h&&h.path||"";cy(f,!h||A.endsWith("*")||A.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${A}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
+
60
+ Please change the parent <Route path="${A}"> to <Route path="${A==="/"?"*":`${A}/*`}">.`)}let b=ga(),g;if(t){let A=typeof t=="string"?Vi(t):t;$t(m==="/"||((w=A.pathname)==null?void 0:w.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${A.pathname}" was given in the \`location\` prop.`),g=A}else g=b;let y=g.pathname||"/",N=y;if(m!=="/"){let A=m.replace(/^\//,"").split("/");N="/"+y.replace(/^\//,"").split("/").slice(A.length).join("/")}let v=a&&a.state.matches.length?a.state.matches.map(A=>Object.assign(A,{route:a.manifest[A.route.id]||A.route})):VE(e,{pathname:N});ka(h||v!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),ka(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let S=NS(v&&v.map(A=>Object.assign({},A,{params:Object.assign({},d,A.params),pathname:Ba([m,s.encodeLocation?s.encodeLocation(A.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:A.pathname]),pathnameBase:A.pathnameBase==="/"?m:Ba([m,s.encodeLocation?s.encodeLocation(A.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:A.pathnameBase])})),o,a);return t&&S?_.createElement(Ao.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...g},navigationType:"POP"}},S):S}function bS(){let e=AS(),t=Jv(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:s},u={padding:"2px 4px",backgroundColor:s},d=null;return console.error("Error handled by React Router default ErrorBoundary:",e),d=_.createElement(_.Fragment,null,_.createElement("p",null,"💿 Hey developer 👋"),_.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",_.createElement("code",{style:u},"ErrorBoundary")," or"," ",_.createElement("code",{style:u},"errorElement")," prop on your route.")),_.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},t),a?_.createElement("pre",{style:o},a):null,d)}var xS=_.createElement(bS,null),uy=class extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const a=cS(e.digest);a&&(e=a)}let t=e!==void 0?_.createElement(Oa.Provider,{value:this.props.routeContext},_.createElement(Hh.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?_.createElement(ES,{error:e},t):t}};uy.contextType=ay;var ym=new WeakMap;function ES({children:e,error:t}){let{basename:a}=_.useContext(pa);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let s=uS(t.digest);if(s){let o=ym.get(t);if(o)throw o;let u=ty(s.location,a),d=u.absoluteURL||u.to;if(aS(d))throw new Error("Invalid redirect location");if(ey&&!ym.get(t))if(u.isExternal||s.reloadDocument)window.location.href=d;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:s.replace}));throw ym.set(t,f),f}return _.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d}`})}}return e}function yS({routeContext:e,match:t,children:a}){let s=_.useContext(Xi);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),_.createElement(Oa.Provider,{value:e},a)}function NS(e,t=[],a){let s=a==null?void 0:a.state;if(e==null){if(!s)return null;if(s.errors)e=s.matches;else if(t.length===0&&!s.initialized&&s.matches.length>0)e=s.matches;else return null}let o=e,u=s==null?void 0:s.errors;if(u!=null){let b=o.findIndex(g=>g.route.id&&(u==null?void 0:u[g.route.id])!==void 0);$t(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),o=o.slice(0,Math.min(o.length,b+1))}let d=!1,f=-1;if(a&&s){d=s.renderFallback;for(let b=0;b<o.length;b++){let g=o[b];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=b),g.route.id){let{loaderData:y,errors:N}=s,v=g.route.loader&&!y.hasOwnProperty(g.route.id)&&(!N||N[g.route.id]===void 0);if(g.route.lazy||v){a.isStatic&&(d=!0),f>=0?o=o.slice(0,f+1):o=[o[0]];break}}}}let m=a==null?void 0:a.onError,h=s&&m?(b,g)=>{var y,N;m(b,{location:s.location,params:((N=(y=s.matches)==null?void 0:y[0])==null?void 0:N.params)??{},pattern:eS(s.matches),errorInfo:g})}:void 0;return o.reduceRight((b,g,y)=>{let N,v=!1,S=null,w=null;s&&(N=u&&g.route.id?u[g.route.id]:void 0,S=g.route.errorElement||xS,d&&(f<0&&y===0?(cy("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,w=null):f===y&&(v=!0,w=g.route.hydrateFallbackElement||null)));let A=t.concat(o.slice(0,y+1)),R=()=>{let I;return N?I=S:v?I=w:g.route.Component?I=_.createElement(g.route.Component,null):g.route.element?I=g.route.element:I=b,_.createElement(yS,{match:g,routeContext:{outlet:b,matches:A,isDataRoute:s!=null},children:I})};return s&&(g.route.ErrorBoundary||g.route.errorElement||y===0)?_.createElement(uy,{location:s.location,revalidation:s.revalidation,component:S,error:N,children:R(),routeContext:{outlet:null,matches:A,isDataRoute:!0},onError:h}):R()},null)}function Fh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function TS(e){let t=_.useContext(Xi);return $t(t,Fh(e)),t}function _S(e){let t=_.useContext($c);return $t(t,Fh(e)),t}function vS(e){let t=_.useContext(Oa);return $t(t,Fh(e)),t}function zh(e){let t=vS(e),a=t.matches[t.matches.length-1];return $t(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function SS(){return zh("useRouteId")}function AS(){var s;let e=_.useContext(Hh),t=_S("useRouteError"),a=zh("useRouteError");return e!==void 0?e:(s=t.errors)==null?void 0:s[a]}function wS(){let{router:e}=TS("useNavigate"),t=zh("useNavigate"),a=_.useRef(!1);return ly(()=>{a.current=!0}),_.useCallback(async(o,u={})=>{ka(a.current,iy),a.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...u}))},[e,t])}var xx={};function cy(e,t,a){!t&&!xx[e]&&(xx[e]=!0,ka(!1,a))}_.memo(CS);function CS({routes:e,manifest:t,future:a,state:s,isStatic:o,onError:u}){return oy(e,void 0,{manifest:t,state:s,isStatic:o,onError:u})}function sh({to:e,replace:t,state:a,relative:s}){$t(Qi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=_.useContext(pa);ka(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=_.useContext(Oa),{pathname:d}=ga(),f=Pn(),m=zc(e,Uh(u),d,s==="path"),h=JSON.stringify(m);return _.useEffect(()=>{f(JSON.parse(h),{replace:t,state:a,relative:s})},[f,h,s,t,a]),null}function kS(e){return hS(e.context)}function ja(e){$t(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function RS({basename:e="/",children:t=null,location:a,navigationType:s="POP",navigator:o,static:u=!1,useTransitions:d}){$t(!Qi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),m=_.useMemo(()=>({basename:f,navigator:o,static:u,useTransitions:d,future:{}}),[f,o,u,d]);typeof a=="string"&&(a=Vi(a));let{pathname:h="/",search:b="",hash:g="",state:y=null,key:N="default",mask:v}=a,S=_.useMemo(()=>{let w=Ar(h,f);return w==null?null:{location:{pathname:w,search:b,hash:g,state:y,key:N,mask:v},navigationType:s}},[f,h,b,g,y,N,s,v]);return ka(S!=null,`<Router basename="${f}"> is not able to match the URL "${h}${b}${g}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:_.createElement(pa.Provider,{value:m},_.createElement(Ao.Provider,{children:t,value:S}))}function OS({children:e,location:t}){return gS(ih(e),t)}function ih(e,t=[]){let a=[];return _.Children.forEach(e,(s,o)=>{if(!_.isValidElement(s))return;let u=[...t,o];if(s.type===_.Fragment){a.push.apply(a,ih(s.props.children,u));return}$t(s.type===ja,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),$t(!s.props.index||!s.props.children,"An index route cannot have child routes.");let d={id:s.props.id||u.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(d.children=ih(s.props.children,u)),a.push(d)}),a}var mc="get",hc="application/x-www-form-urlencoded";function qc(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function IS(e){return qc(e)&&e.tagName.toLowerCase()==="button"}function MS(e){return qc(e)&&e.tagName.toLowerCase()==="form"}function DS(e){return qc(e)&&e.tagName.toLowerCase()==="input"}function LS(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function jS(e,t){return e.button===0&&(!t||t==="_self")&&!LS(e)}function lh(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,a)=>{let s=e[a];return t.concat(Array.isArray(s)?s.map(o=>[a,o]):[[a,s]])},[]))}function BS(e,t){let a=lh(e);return t&&t.forEach((s,o)=>{a.has(o)||t.getAll(o).forEach(u=>{a.append(o,u)})}),a}var nc=null;function PS(){if(nc===null)try{new FormData(document.createElement("form"),0),nc=!1}catch{nc=!0}return nc}var US=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Nm(e){return e!=null&&!US.has(e)?(ka(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${hc}"`),null):e}function HS(e,t){let a,s,o,u,d;if(MS(e)){let f=e.getAttribute("action");s=f?Ar(f,t):null,a=e.getAttribute("method")||mc,o=Nm(e.getAttribute("enctype"))||hc,u=new FormData(e)}else if(IS(e)||DS(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=e.getAttribute("formaction")||f.getAttribute("action");if(s=m?Ar(m,t):null,a=e.getAttribute("formmethod")||f.getAttribute("method")||mc,o=Nm(e.getAttribute("formenctype"))||Nm(f.getAttribute("enctype"))||hc,u=new FormData(f,e),!PS()){let{name:h,type:b,value:g}=e;if(b==="image"){let y=h?`${h}.`:"";u.append(`${y}x`,"0"),u.append(`${y}y`,"0")}else h&&u.append(h,g)}}else{if(qc(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=mc,s=null,o=hc,d=e}return u&&o==="text/plain"&&(d=u,u=void 0),{action:s,method:a.toLowerCase(),encType:o,formData:u,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function $h(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function dy(e,t,a,s){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return a?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${s}`:o.pathname=`${o.pathname}.${s}`:o.pathname==="/"?o.pathname=`_root.${s}`:t&&Ar(o.pathname,t)==="/"?o.pathname=`${Nc(t)}/_root.${s}`:o.pathname=`${Nc(o.pathname)}.${s}`,o}async function FS(e,t){if(e.id in t)return t[e.id];try{let a=await import(e.module);return t[e.id]=a,a}catch(a){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function zS(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function $S(e,t,a){let s=await Promise.all(e.map(async o=>{let u=t.routes[o.route.id];if(u){let d=await FS(u,a);return d.links?d.links():[]}return[]}));return KS(s.flat(1).filter(zS).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Ex(e,t,a,s,o,u){let d=(m,h)=>a[h]?m.route.id!==a[h].route.id:!0,f=(m,h)=>{var b;return a[h].pathname!==m.pathname||((b=a[h].route.path)==null?void 0:b.endsWith("*"))&&a[h].params["*"]!==m.params["*"]};return u==="assets"?t.filter((m,h)=>d(m,h)||f(m,h)):u==="data"?t.filter((m,h)=>{var g;let b=s.routes[m.route.id];if(!b||!b.hasLoader)return!1;if(d(m,h)||f(m,h))return!0;if(m.route.shouldRevalidate){let y=m.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((g=a[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function qS(e,t,{includeHydrateFallback:a}={}){return YS(e.map(s=>{let o=t.routes[s.route.id];if(!o)return[];let u=[o.module];return o.clientActionModule&&(u=u.concat(o.clientActionModule)),o.clientLoaderModule&&(u=u.concat(o.clientLoaderModule)),a&&o.hydrateFallbackModule&&(u=u.concat(o.hydrateFallbackModule)),o.imports&&(u=u.concat(o.imports)),u}).flat(1))}function YS(e){return[...new Set(e)]}function GS(e){let t={},a=Object.keys(e).sort();for(let s of a)t[s]=e[s];return t}function KS(e,t){let a=new Set;return new Set(t),e.reduce((s,o)=>{let u=JSON.stringify(GS(o));return a.has(u)||(a.add(u),s.push({key:u,link:o})),s},[])}function qh(){let e=_.useContext(Xi);return $h(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function VS(){let e=_.useContext($c);return $h(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Yh=_.createContext(void 0);Yh.displayName="FrameworkContext";function Yc(){let e=_.useContext(Yh);return $h(e,"You must render this element inside a <HydratedRouter> element"),e}function XS(e,t){let a=_.useContext(Yh),[s,o]=_.useState(!1),[u,d]=_.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:b,onTouchStart:g}=t,y=_.useRef(null);_.useEffect(()=>{if(e==="render"&&d(!0),e==="viewport"){let S=A=>{A.forEach(R=>{d(R.isIntersecting)})},w=new IntersectionObserver(S,{threshold:.5});return y.current&&w.observe(y.current),()=>{w.disconnect()}}},[e]),_.useEffect(()=>{if(s){let S=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(S)}}},[s]);let N=()=>{o(!0)},v=()=>{o(!1),d(!1)};return a?e!=="intent"?[u,y,{}]:[u,y,{onFocus:Wl(f,N),onBlur:Wl(m,v),onMouseEnter:Wl(h,N),onMouseLeave:Wl(b,v),onTouchStart:Wl(g,N)}]:[!1,y,{}]}function Wl(e,t){return a=>{e&&e(a),a.defaultPrevented||t(a)}}function QS({page:e,...t}){let a=rS(),{nonce:s}=Yc(),{router:o}=qh(),u=_.useMemo(()=>VE(o.routes,e,o.basename),[o.routes,e,o.basename]);return u?(t.nonce==null&&s&&(t={...t,nonce:s}),a?_.createElement(ZS,{page:e,matches:u,...t}):_.createElement(JS,{page:e,matches:u,...t})):null}function WS(e){let{manifest:t,routeModules:a}=Yc(),[s,o]=_.useState([]);return _.useEffect(()=>{let u=!1;return $S(e,t,a).then(d=>{u||o(d)}),()=>{u=!0}},[e,t,a]),s}function ZS({page:e,matches:t,...a}){let s=ga(),{future:o}=Yc(),{basename:u}=qh(),d=_.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let f=dy(e,u,o.v8_trailingSlashAwareDataRequests,"rsc"),m=!1,h=[];for(let b of t)typeof b.route.shouldRevalidate=="function"?m=!0:h.push(b.route.id);return m&&h.length>0&&f.searchParams.set("_routes",h.join(",")),[f.pathname+f.search]},[u,o.v8_trailingSlashAwareDataRequests,e,s,t]);return _.createElement(_.Fragment,null,d.map(f=>_.createElement("link",{key:f,rel:"prefetch",as:"fetch",href:f,...a})))}function JS({page:e,matches:t,...a}){let s=ga(),{future:o,manifest:u,routeModules:d}=Yc(),{basename:f}=qh(),{loaderData:m,matches:h}=VS(),b=_.useMemo(()=>Ex(e,t,h,u,s,"data"),[e,t,h,u,s]),g=_.useMemo(()=>Ex(e,t,h,u,s,"assets"),[e,t,h,u,s]),y=_.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let S=new Set,w=!1;if(t.forEach(R=>{var Y;let I=u.routes[R.route.id];!I||!I.hasLoader||(!b.some(B=>B.route.id===R.route.id)&&R.route.id in m&&((Y=d[R.route.id])!=null&&Y.shouldRevalidate)||I.hasClientLoader?w=!0:S.add(R.route.id))}),S.size===0)return[];let A=dy(e,f,o.v8_trailingSlashAwareDataRequests,"data");return w&&S.size>0&&A.searchParams.set("_routes",t.filter(R=>S.has(R.route.id)).map(R=>R.route.id).join(",")),[A.pathname+A.search]},[f,o.v8_trailingSlashAwareDataRequests,m,s,u,b,t,e,d]),N=_.useMemo(()=>qS(g,u),[g,u]),v=WS(g);return _.createElement(_.Fragment,null,y.map(S=>_.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...a})),N.map(S=>_.createElement("link",{key:S,rel:"modulepreload",href:S,...a})),v.map(({key:S,link:w})=>_.createElement("link",{key:S,nonce:a.nonce,...w,crossOrigin:w.crossOrigin??a.crossOrigin})))}function eA(...e){return t=>{e.forEach(a=>{typeof a=="function"?a(t):a!=null&&(a.current=t)})}}var tA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{tA&&(window.__reactRouterVersion="7.18.1")}catch{}function nA({basename:e,children:t,useTransitions:a,window:s}){let o=_.useRef();o.current==null&&(o.current=Rv({window:s,v5Compat:!0}));let u=o.current,[d,f]=_.useState({action:u.action,location:u.location}),m=_.useCallback(h=>{a===!1?f(h):_.startTransition(()=>f(h))},[a]);return _.useLayoutEffect(()=>u.listen(m),[u,m]),_.createElement(RS,{basename:e,children:t,location:d.location,navigationType:d.action,navigator:u,useTransitions:a})}var fy=_.forwardRef(function({onClick:t,discover:a="render",prefetch:s="none",relative:o,reloadDocument:u,replace:d,mask:f,state:m,target:h,to:b,preventScrollReset:g,viewTransition:y,defaultShouldRevalidate:N,...v},S){let{basename:w,navigator:A,useTransitions:R}=_.useContext(pa),I=typeof b=="string"&&Ph.test(b),Y=ty(b,w);b=Y.to;let B=dS(b,{relative:o}),C=ga(),z=null;if(f){let F=zc(f,[],C.mask?C.mask.pathname:"/",!0);w!=="/"&&(F.pathname=F.pathname==="/"?w:Ba([w,F.pathname])),z=A.createHref(F)}let[W,Q,j]=XS(s,v),ee=sA(b,{replace:d,mask:f,state:m,target:h,preventScrollReset:g,relative:o,viewTransition:y,defaultShouldRevalidate:N,useTransitions:R});function ue(F){t&&t(F),F.defaultPrevented||ee(F)}let Z=!(Y.isExternal||u),q=_.createElement("a",{...v,...j,href:(Z?z:void 0)||Y.absoluteURL||B,onClick:Z?ue:t,ref:eA(S,Q),target:h,"data-discover":!I&&a==="render"?"true":void 0});return W&&!I?_.createElement(_.Fragment,null,q,_.createElement(QS,{page:B})):q});fy.displayName="Link";var Gh=_.forwardRef(function({"aria-current":t="page",caseSensitive:a=!1,className:s="",end:o=!1,style:u,to:d,viewTransition:f,children:m,...h},b){let g=wo(d,{relative:h.relative}),y=ga(),N=_.useContext($c),{navigator:v,basename:S}=_.useContext(pa),w=N!=null&&cA(g)&&f===!0,A=v.encodeLocation?v.encodeLocation(g).pathname:g.pathname,R=y.pathname,I=N&&N.navigation&&N.navigation.location?N.navigation.location.pathname:null;a||(R=R.toLowerCase(),I=I?I.toLowerCase():null,A=A.toLowerCase()),I&&S&&(I=Ar(I,S)||I);const Y=A!=="/"&&A.endsWith("/")?A.length-1:A.length;let B=R===A||!o&&R.startsWith(A)&&R.charAt(Y)==="/",C=I!=null&&(I===A||!o&&I.startsWith(A)&&I.charAt(A.length)==="/"),z={isActive:B,isPending:C,isTransitioning:w},W=B?t:void 0,Q;typeof s=="function"?Q=s(z):Q=[s,B?"active":null,C?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let j=typeof u=="function"?u(z):u;return _.createElement(fy,{...h,"aria-current":W,className:Q,ref:b,style:j,to:d,viewTransition:f},typeof m=="function"?m(z):m)});Gh.displayName="NavLink";var aA=_.forwardRef(({discover:e="render",fetcherKey:t,navigate:a,reloadDocument:s,replace:o,state:u,method:d=mc,action:f,onSubmit:m,relative:h,preventScrollReset:b,viewTransition:g,defaultShouldRevalidate:y,...N},v)=>{let{useTransitions:S}=_.useContext(pa),w=oA(),A=uA(f,{relative:h}),R=d.toLowerCase()==="get"?"get":"post",I=typeof f=="string"&&Ph.test(f),Y=B=>{if(m&&m(B),B.defaultPrevented)return;B.preventDefault();let C=B.nativeEvent.submitter,z=(C==null?void 0:C.getAttribute("formmethod"))||d,W=()=>w(C||B.currentTarget,{fetcherKey:t,method:z,navigate:a,replace:o,state:u,relative:h,preventScrollReset:b,viewTransition:g,defaultShouldRevalidate:y});S&&a!==!1?_.startTransition(()=>W()):W()};return _.createElement("form",{ref:v,method:R,action:A,onSubmit:s?m:Y,...N,"data-discover":!I&&e==="render"?"true":void 0})});aA.displayName="Form";function rA(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function my(e){let t=_.useContext(Xi);return $t(t,rA(e)),t}function sA(e,{target:t,replace:a,mask:s,state:o,preventScrollReset:u,relative:d,viewTransition:f,defaultShouldRevalidate:m,useTransitions:h}={}){let b=Pn(),g=ga(),y=wo(e,{relative:d});return _.useCallback(N=>{if(jS(N,t)){N.preventDefault();let v=a!==void 0?a:bo(g)===bo(y),S=()=>b(e,{replace:v,mask:s,state:o,preventScrollReset:u,relative:d,viewTransition:f,defaultShouldRevalidate:m});h?_.startTransition(()=>S()):S()}},[g,b,y,a,s,o,t,e,u,d,f,m,h])}function hy(e){ka(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=_.useRef(lh(e)),a=_.useRef(!1),s=ga(),o=_.useMemo(()=>BS(s.search,a.current?null:t.current),[s.search]),u=Pn(),d=_.useCallback((f,m)=>{const h=lh(typeof f=="function"?f(new URLSearchParams(o)):f);a.current=!0,u("?"+h,m)},[u,o]);return[o,d]}var iA=0,lA=()=>`__${String(++iA)}__`;function oA(){let{router:e}=my("useSubmit"),{basename:t}=_.useContext(pa),a=SS(),s=e.fetch,o=e.navigate;return _.useCallback(async(u,d={})=>{let{action:f,method:m,encType:h,formData:b,body:g}=HS(u,t);if(d.navigate===!1){let y=d.fetcherKey||lA();await s(y,a,d.action||f,{defaultShouldRevalidate:d.defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:b,body:g,formMethod:d.method||m,formEncType:d.encType||h,flushSync:d.flushSync})}else await o(d.action||f,{defaultShouldRevalidate:d.defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:b,body:g,formMethod:d.method||m,formEncType:d.encType||h,replace:d.replace,state:d.state,fromRouteId:a,flushSync:d.flushSync,viewTransition:d.viewTransition})},[s,o,t,a])}function uA(e,{relative:t}={}){let{basename:a}=_.useContext(pa),s=_.useContext(Oa);$t(s,"useFormAction must be used inside a RouteContext");let[o]=s.matches.slice(-1),u={...wo(e||".",{relative:t})},d=ga();if(e==null){u.search=d.search;let f=new URLSearchParams(u.search),m=f.getAll("index");if(m.some(b=>b==="")){f.delete("index"),m.filter(g=>g).forEach(g=>f.append("index",g));let b=f.toString();u.search=b?`?${b}`:""}}return(!e||e===".")&&o.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(u.pathname=u.pathname==="/"?a:Ba([a,u.pathname])),bo(u)}function cA(e,{relative:t}={}){let a=_.useContext(ry);$t(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=my("useViewTransitionState"),o=wo(e,{relative:t});if(!a.isTransitioning)return!1;let u=Ar(a.currentLocation.pathname,s)||a.currentLocation.pathname,d=Ar(a.nextLocation.pathname,s)||a.nextLocation.pathname;return yc(o.pathname,d)!=null||yc(o.pathname,u)!=null}/**
61
+ * @license lucide-react v0.513.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const dA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),fA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,s)=>s?s.toUpperCase():a.toLowerCase()),yx=e=>{const t=fA(e);return t.charAt(0).toUpperCase()+t.slice(1)},py=(...e)=>e.filter((t,a,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===a).join(" ").trim(),mA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
66
+ * @license lucide-react v0.513.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */var hA={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"};/**
71
+ * @license lucide-react v0.513.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const pA=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:s,className:o="",children:u,iconNode:d,...f},m)=>_.createElement("svg",{ref:m,...hA,width:t,height:t,stroke:e,strokeWidth:s?Number(a)*24/Number(t):a,className:py("lucide",o),...!u&&!mA(f)&&{"aria-hidden":"true"},...f},[...d.map(([h,b])=>_.createElement(h,b)),...Array.isArray(u)?u:[u]]));/**
76
+ * @license lucide-react v0.513.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const ke=(e,t)=>{const a=_.forwardRef(({className:s,...o},u)=>_.createElement(pA,{ref:u,iconNode:t,className:py(`lucide-${dA(yx(e))}`,`lucide-${e}`,s),...o}));return a.displayName=yx(e),a};/**
81
+ * @license lucide-react v0.513.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */const gA=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],bA=ke("activity",gA);/**
86
+ * @license lucide-react v0.513.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const xA=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],EA=ke("arrow-down-to-line",xA);/**
91
+ * @license lucide-react v0.513.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const yA=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],oh=ke("arrow-left",yA);/**
96
+ * @license lucide-react v0.513.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const NA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],TA=ke("arrow-right",NA);/**
101
+ * @license lucide-react v0.513.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const _A=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],gy=ke("arrow-up",_A);/**
106
+ * @license lucide-react v0.513.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const vA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],SA=ke("ban",vA);/**
111
+ * @license lucide-react v0.513.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const AA=[["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"}]],wA=ke("bot",AA);/**
116
+ * @license lucide-react v0.513.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const CA=[["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"}]],by=ke("box",CA);/**
121
+ * @license lucide-react v0.513.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const kA=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]],Fi=ke("brain",kA);/**
126
+ * @license lucide-react v0.513.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const RA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Cn=ke("check",RA);/**
131
+ * @license lucide-react v0.513.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const OA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ea=ke("chevron-down",OA);/**
136
+ * @license lucide-react v0.513.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const IA=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Kh=ke("chevron-left",IA);/**
141
+ * @license lucide-react v0.513.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const MA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Gc=ke("chevron-right",MA);/**
146
+ * @license lucide-react v0.513.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const DA=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],LA=ke("chevron-up",DA);/**
151
+ * @license lucide-react v0.513.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const jA=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],BA=ke("chevrons-left",jA);/**
156
+ * @license lucide-react v0.513.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const PA=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],UA=ke("chevrons-right",PA);/**
161
+ * @license lucide-react v0.513.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const HA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Tm=ke("circle-check",HA);/**
166
+ * @license lucide-react v0.513.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const FA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],xo=ke("circle-dot",FA);/**
171
+ * @license lucide-react v0.513.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const zA=[["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"}]],xy=ke("circle-x",zA);/**
176
+ * @license lucide-react v0.513.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const $A=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],qA=ke("circle",$A);/**
181
+ * @license lucide-react v0.513.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const YA=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],GA=ke("clipboard",YA);/**
186
+ * @license lucide-react v0.513.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const KA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],Kc=ke("clock",KA);/**
191
+ * @license lucide-react v0.513.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const VA=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],Ey=ke("cloud",VA);/**
196
+ * @license lucide-react v0.513.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const XA=[["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"}]],Tc=ke("copy",XA);/**
201
+ * @license lucide-react v0.513.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const QA=[["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"}]],pc=ke("cpu",QA);/**
206
+ * @license lucide-react v0.513.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const WA=[["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"}]],ZA=ke("download",WA);/**
211
+ * @license lucide-react v0.513.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const JA=[["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"}]],e3=ke("ellipsis",JA);/**
216
+ * @license lucide-react v0.513.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const t3=[["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"}]],_c=ke("external-link",t3);/**
221
+ * @license lucide-react v0.513.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const n3=[["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"}]],a3=ke("eye-off",n3);/**
226
+ * @license lucide-react v0.513.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const r3=[["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"}]],s3=ke("eye",r3);/**
231
+ * @license lucide-react v0.513.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const i3=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Vh=ke("file-text",i3);/**
236
+ * @license lucide-react v0.513.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const l3=[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]],Xh=ke("flag",l3);/**
241
+ * @license lucide-react v0.513.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const o3=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],u3=ke("gauge",o3);/**
246
+ * @license lucide-react v0.513.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const c3=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],Gs=ke("git-branch",c3);/**
251
+ * @license lucide-react v0.513.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const d3=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],f3=ke("git-commit-horizontal",d3);/**
256
+ * @license lucide-react v0.513.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const m3=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],vc=ke("git-merge",m3);/**
261
+ * @license lucide-react v0.513.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */const h3=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]],Eo=ke("git-pull-request",h3);/**
266
+ * @license lucide-react v0.513.0 - ISC
267
+ *
268
+ * This source code is licensed under the ISC license.
269
+ * See the LICENSE file in the root directory of this source tree.
270
+ */const p3=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],g3=ke("hard-drive",p3);/**
271
+ * @license lucide-react v0.513.0 - ISC
272
+ *
273
+ * This source code is licensed under the ISC license.
274
+ * See the LICENSE file in the root directory of this source tree.
275
+ */const b3=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],x3=ke("image-plus",b3);/**
276
+ * @license lucide-react v0.513.0 - ISC
277
+ *
278
+ * This source code is licensed under the ISC license.
279
+ * See the LICENSE file in the root directory of this source tree.
280
+ */const E3=[["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"}]],Vc=ke("link-2",E3);/**
281
+ * @license lucide-react v0.513.0 - ISC
282
+ *
283
+ * This source code is licensed under the ISC license.
284
+ * See the LICENSE file in the root directory of this source tree.
285
+ */const y3=[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],N3=ke("list-todo",y3);/**
286
+ * @license lucide-react v0.513.0 - ISC
287
+ *
288
+ * This source code is licensed under the ISC license.
289
+ * See the LICENSE file in the root directory of this source tree.
290
+ */const T3=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Kt=ke("loader-circle",T3);/**
291
+ * @license lucide-react v0.513.0 - ISC
292
+ *
293
+ * This source code is licensed under the ISC license.
294
+ * See the LICENSE file in the root directory of this source tree.
295
+ */const _3=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],v3=ke("maximize-2",_3);/**
296
+ * @license lucide-react v0.513.0 - ISC
297
+ *
298
+ * This source code is licensed under the ISC license.
299
+ * See the LICENSE file in the root directory of this source tree.
300
+ */const S3=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],Xc=ke("menu",S3);/**
301
+ * @license lucide-react v0.513.0 - ISC
302
+ *
303
+ * This source code is licensed under the ISC license.
304
+ * See the LICENSE file in the root directory of this source tree.
305
+ */const A3=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],w3=ke("message-circle-question",A3);/**
306
+ * @license lucide-react v0.513.0 - ISC
307
+ *
308
+ * This source code is licensed under the ISC license.
309
+ * See the LICENSE file in the root directory of this source tree.
310
+ */const C3=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],k3=ke("message-circle",C3);/**
311
+ * @license lucide-react v0.513.0 - ISC
312
+ *
313
+ * This source code is licensed under the ISC license.
314
+ * See the LICENSE file in the root directory of this source tree.
315
+ */const R3=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],O3=ke("message-square",R3);/**
316
+ * @license lucide-react v0.513.0 - ISC
317
+ *
318
+ * This source code is licensed under the ISC license.
319
+ * See the LICENSE file in the root directory of this source tree.
320
+ */const I3=[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]],M3=ke("mic",I3);/**
321
+ * @license lucide-react v0.513.0 - ISC
322
+ *
323
+ * This source code is licensed under the ISC license.
324
+ * See the LICENSE file in the root directory of this source tree.
325
+ */const D3=[["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"}]],L3=ke("minimize-2",D3);/**
326
+ * @license lucide-react v0.513.0 - ISC
327
+ *
328
+ * This source code is licensed under the ISC license.
329
+ * See the LICENSE file in the root directory of this source tree.
330
+ */const j3=[["path",{d:"M5 12h14",key:"1ays0h"}]],B3=ke("minus",j3);/**
331
+ * @license lucide-react v0.513.0 - ISC
332
+ *
333
+ * This source code is licensed under the ISC license.
334
+ * See the LICENSE file in the root directory of this source tree.
335
+ */const P3=[["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"}]],U3=ke("monitor",P3);/**
336
+ * @license lucide-react v0.513.0 - ISC
337
+ *
338
+ * This source code is licensed under the ISC license.
339
+ * See the LICENSE file in the root directory of this source tree.
340
+ */const H3=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],F3=ke("moon",H3);/**
341
+ * @license lucide-react v0.513.0 - ISC
342
+ *
343
+ * This source code is licensed under the ISC license.
344
+ * See the LICENSE file in the root directory of this source tree.
345
+ */const z3=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],$3=ke("network",z3);/**
346
+ * @license lucide-react v0.513.0 - ISC
347
+ *
348
+ * This source code is licensed under the ISC license.
349
+ * See the LICENSE file in the root directory of this source tree.
350
+ */const q3=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],yy=ke("panel-right",q3);/**
351
+ * @license lucide-react v0.513.0 - ISC
352
+ *
353
+ * This source code is licensed under the ISC license.
354
+ * See the LICENSE file in the root directory of this source tree.
355
+ */const Y3=[["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"}]],G3=ke("paperclip",Y3);/**
356
+ * @license lucide-react v0.513.0 - ISC
357
+ *
358
+ * This source code is licensed under the ISC license.
359
+ * See the LICENSE file in the root directory of this source tree.
360
+ */const K3=[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]],Qh=ke("pen-line",K3);/**
361
+ * @license lucide-react v0.513.0 - ISC
362
+ *
363
+ * This source code is licensed under the ISC license.
364
+ * See the LICENSE file in the root directory of this source tree.
365
+ */const V3=[["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"}]],Nx=ke("pencil",V3);/**
366
+ * @license lucide-react v0.513.0 - ISC
367
+ *
368
+ * This source code is licensed under the ISC license.
369
+ * See the LICENSE file in the root directory of this source tree.
370
+ */const X3=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Qc=ke("play",X3);/**
371
+ * @license lucide-react v0.513.0 - ISC
372
+ *
373
+ * This source code is licensed under the ISC license.
374
+ * See the LICENSE file in the root directory of this source tree.
375
+ */const Q3=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ra=ke("plus",Q3);/**
376
+ * @license lucide-react v0.513.0 - ISC
377
+ *
378
+ * This source code is licensed under the ISC license.
379
+ * See the LICENSE file in the root directory of this source tree.
380
+ */const W3=[["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"}]],qs=ke("refresh-cw",W3);/**
381
+ * @license lucide-react v0.513.0 - ISC
382
+ *
383
+ * This source code is licensed under the ISC license.
384
+ * See the LICENSE file in the root directory of this source tree.
385
+ */const Z3=[["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"}]],J3=ke("rotate-ccw",Z3);/**
386
+ * @license lucide-react v0.513.0 - ISC
387
+ *
388
+ * This source code is licensed under the ISC license.
389
+ * See the LICENSE file in the root directory of this source tree.
390
+ */const e5=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Wc=ke("save",e5);/**
391
+ * @license lucide-react v0.513.0 - ISC
392
+ *
393
+ * This source code is licensed under the ISC license.
394
+ * See the LICENSE file in the root directory of this source tree.
395
+ */const t5=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],us=ke("search",t5);/**
396
+ * @license lucide-react v0.513.0 - ISC
397
+ *
398
+ * This source code is licensed under the ISC license.
399
+ * See the LICENSE file in the root directory of this source tree.
400
+ */const n5=[["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"}]],zi=ke("send",n5);/**
401
+ * @license lucide-react v0.513.0 - ISC
402
+ *
403
+ * This source code is licensed under the ISC license.
404
+ * See the LICENSE file in the root directory of this source tree.
405
+ */const a5=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],r5=ke("settings",a5);/**
406
+ * @license lucide-react v0.513.0 - ISC
407
+ *
408
+ * This source code is licensed under the ISC license.
409
+ * See the LICENSE file in the root directory of this source tree.
410
+ */const s5=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],Hi=ke("sparkles",s5);/**
411
+ * @license lucide-react v0.513.0 - ISC
412
+ *
413
+ * This source code is licensed under the ISC license.
414
+ * See the LICENSE file in the root directory of this source tree.
415
+ */const i5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],uh=ke("square",i5);/**
416
+ * @license lucide-react v0.513.0 - ISC
417
+ *
418
+ * This source code is licensed under the ISC license.
419
+ * See the LICENSE file in the root directory of this source tree.
420
+ */const l5=[["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"}]],o5=ke("sun",l5);/**
421
+ * @license lucide-react v0.513.0 - ISC
422
+ *
423
+ * This source code is licensed under the ISC license.
424
+ * See the LICENSE file in the root directory of this source tree.
425
+ */const u5=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],wr=ke("trash-2",u5);/**
426
+ * @license lucide-react v0.513.0 - ISC
427
+ *
428
+ * This source code is licensed under the ISC license.
429
+ * See the LICENSE file in the root directory of this source tree.
430
+ */const c5=[["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"}]],kn=ke("triangle-alert",c5);/**
431
+ * @license lucide-react v0.513.0 - ISC
432
+ *
433
+ * This source code is licensed under the ISC license.
434
+ * See the LICENSE file in the root directory of this source tree.
435
+ */const d5=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Ny=ke("upload",d5);/**
436
+ * @license lucide-react v0.513.0 - ISC
437
+ *
438
+ * This source code is licensed under the ISC license.
439
+ * See the LICENSE file in the root directory of this source tree.
440
+ */const f5=[["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"}]],Ty=ke("user",f5);/**
441
+ * @license lucide-react v0.513.0 - ISC
442
+ *
443
+ * This source code is licensed under the ISC license.
444
+ * See the LICENSE file in the root directory of this source tree.
445
+ */const m5=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],_y=ke("users",m5);/**
446
+ * @license lucide-react v0.513.0 - ISC
447
+ *
448
+ * This source code is licensed under the ISC license.
449
+ * See the LICENSE file in the root directory of this source tree.
450
+ */const h5=[["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"}]],vy=ke("wifi",h5);/**
451
+ * @license lucide-react v0.513.0 - ISC
452
+ *
453
+ * This source code is licensed under the ISC license.
454
+ * See the LICENSE file in the root directory of this source tree.
455
+ */const p5=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]],g5=ke("wrench",p5);/**
456
+ * @license lucide-react v0.513.0 - ISC
457
+ *
458
+ * This source code is licensed under the ISC license.
459
+ * See the LICENSE file in the root directory of this source tree.
460
+ */const b5=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],gt=ke("x",b5);/**
461
+ * @license lucide-react v0.513.0 - ISC
462
+ *
463
+ * This source code is licensed under the ISC license.
464
+ * See the LICENSE file in the root directory of this source tree.
465
+ */const x5=[["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"}]],Zc=ke("zap",x5);function Sy(e){var t,a,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(a=Sy(e[t]))&&(s&&(s+=" "),s+=a)}else for(a in e)e[a]&&(s&&(s+=" "),s+=a);return s}function se(){for(var e,t,a=0,s="",o=arguments.length;a<o;a++)(e=arguments[a])&&(t=Sy(e))&&(s&&(s+=" "),s+=t);return s}const Tx=e=>{let t;const a=new Set,s=(h,b)=>{const g=typeof h=="function"?h(t):h;if(!Object.is(g,t)){const y=t;t=b??(typeof g!="object"||g===null)?g:Object.assign({},t,g),a.forEach(N=>N(t,y))}},o=()=>t,f={setState:s,getState:o,getInitialState:()=>m,subscribe:h=>(a.add(h),()=>a.delete(h))},m=t=e(s,o,f);return f},E5=(e=>e?Tx(e):Tx),y5=e=>e;function N5(e,t=y5){const a=tc.useSyncExternalStore(e.subscribe,tc.useCallback(()=>t(e.getState()),[e,t]),tc.useCallback(()=>t(e.getInitialState()),[e,t]));return tc.useDebugValue(a),a}const _x=e=>{const t=E5(e),a=s=>N5(t,s);return Object.assign(a,t),a},Ja=(e=>e?_x(e):_x),_m="fs-theme";function Ay(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function vx(e){return e==="system"?Ay():e}function Sx(e){e==="system"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}const ch=Ja((e,t)=>({preference:localStorage.getItem(_m)??"system",resolved:vx(localStorage.getItem(_m)??"system"),setPreference(a){const s=vx(a);localStorage.setItem(_m,a),Sx(a),e({preference:a,resolved:s})},cycle(){const a=["system","light","dark"],s=a[(a.indexOf(t().preference)+1)%a.length];t().setPreference(s)},init(){Sx(t().preference);const a=window.matchMedia("(prefers-color-scheme: dark)"),s=()=>{const{preference:o}=t();if(o==="system"){const u=Ay();e({resolved:u})}};return a.addEventListener("change",s),()=>a.removeEventListener("change",s)}})),Sc="fourth-spark-server-url";function wy(){if(typeof window>"u")return!1;const t=window.Capacitor;return typeof(t==null?void 0:t.isNativePlatform)=="function"&&t.isNativePlatform()}function Cy(){return localStorage.getItem(Sc)??""}function T5(e){const t=e.replace(/\/+$/,"");t?localStorage.setItem(Sc,t):localStorage.removeItem(Sc)}function dh(){return localStorage.getItem(Sc)??""}class Za extends Error{constructor(a,s){super(a);un(this,"status");this.name="ApiError",this.status=s}}async function Ae(e,t){let a;try{a=await fetch(Cy()+e,{...t,headers:{Accept:"application/json",...t!=null&&t.body?{"Content-Type":"application/json"}:{},...t==null?void 0:t.headers}})}catch(o){throw new Za(o instanceof Error?o.message:"Network request failed",0)}if(!a.ok){const o=await a.text().catch(()=>"");throw new Za(o.trim()||`${a.status} ${a.statusText}`,a.status)}if(a.status===204)return;const s=await a.text();if(s)return JSON.parse(s)}function Un(e,...t){if(Array.isArray(e))return e;if(e&&typeof e=="object"){const a=e;for(const s of[...t,"data","items"])if(Array.isArray(a[s]))return a[s]}return[]}async function _5(){return Un(await Ae("/api/repos"),"repos")}async function v5(e,t,a,s){return Ae("/api/repos",{method:"POST",body:JSON.stringify({name:e,gitUrl:t,localPath:a,runtimeType:s})})}async function S5(e){return Ae("/api/repos/resolve",{method:"POST",body:JSON.stringify({localPath:e})})}async function A5(e){await Ae(`/api/repos/${encodeURIComponent(e)}`,{method:"DELETE"})}async function w5(e){await Ae(`/api/repos/${encodeURIComponent(e)}/start`,{method:"POST"})}async function C5(e){await Ae(`/api/repos/${encodeURIComponent(e)}/stop`,{method:"POST"})}async function k5(e){return Ae(`/api/repos/${encodeURIComponent(e)}/branches`)}async function R5(e,t){return Ae(`/api/repos/${encodeURIComponent(e)}/checkout`,{method:"POST",body:JSON.stringify({branch:t})})}async function O5(e){return Ae(`/api/repos/${encodeURIComponent(e)}/pull`,{method:"POST"})}function Ge(e){return`/api/repos/${encodeURIComponent(e)}`}async function I5(e){return Un(await Ae(`${Ge(e)}/workspaces`),"workspaces")}async function M5(e,t){await Ae(`${Ge(e)}/workspaces/${encodeURIComponent(t)}`,{method:"DELETE"})}async function D5(e){return Ae(`${Ge(e)}/workspaces/cleanup`,{method:"POST"})}async function L5(e,t){await Ae(`/api/repos/${e}/worktree`,{method:"PATCH",body:JSON.stringify({enabled:t})})}async function j5(e,t){await Ae(`/api/repos/${e}/runtime`,{method:"PATCH",body:JSON.stringify({runtimeType:t})})}async function B5(e){return Un(await Ae(`${Ge(e)}/sessions`),"sessions")}async function P5(e,t,a,s,o,u,d,f){return Ae(`${Ge(e)}/sessions`,{method:"POST",body:JSON.stringify({message:t,agent:a,model:s,variant:o,issueId:u,customAgentId:d,files:f})})}async function U5(e,t){await Ae(`${Ge(e)}/sessions/${encodeURIComponent(t)}`,{method:"DELETE"})}async function H5(e,t,a,s,o,u){await Ae(`${Ge(e)}/sessions/${encodeURIComponent(t)}/prompt`,{method:"POST",body:JSON.stringify({content:a,agent:s,model:o,files:u})})}async function F5(e,t){await Ae(`${Ge(e)}/sessions/${encodeURIComponent(t)}/abort`,{method:"POST"})}async function z5(e,t,a){await Ae(`${Ge(e)}/sessions/${encodeURIComponent(t)}/questions/reply`,{method:"POST",body:JSON.stringify({answers:a})})}async function $5(e,t){await Ae(`${Ge(e)}/sessions/${encodeURIComponent(t)}/questions/reject`,{method:"POST"})}async function q5(e,t,a){return Ae(`${Ge(e)}/sessions/${encodeURIComponent(t)}/revert`,{method:"POST",body:JSON.stringify({messageID:a})})}function Ax(e){const t=e,a=t.info;if(a&&typeof a.id=="string"){const s=Array.isArray(t.parts)?t.parts:void 0;return{...a,...s?{parts:s}:{}}}return t}async function wx(e,t,a){const s=new URLSearchParams;a!=null&&a.limit&&s.set("limit",String(a.limit)),a!=null&&a.before&&s.set("before",a.before);const o=s.toString(),u=`${Ge(e)}/sessions/${encodeURIComponent(t)}/messages${o?`?${o}`:""}`,d=await Ae(u);if(Array.isArray(d)){const h=d.map(Ax);return{messages:h,total:h.length,hasMore:!1}}const f=d,m=Array.isArray(f.messages)?f.messages:[];return{messages:m.map(Ax),total:f.total??m.length,hasMore:f.hasMore??!1}}async function ky(e,t){return Ae(`${Ge(e)}/sessions/${encodeURIComponent(t)}/status`)}async function Y5(e,t){return Ae(`${Ge(e)}/sessions/${encodeURIComponent(t)}/links`)}async function G5(e,t){return Ae(`${Ge(e)}/sessions/snapshot/${encodeURIComponent(t)}`)}async function Cx(e){return Ae(`${Ge(e)}/sessions/all-links`)}async function K5(e,t,a,s){await Ae(`${Ge(e)}/sessions/${encodeURIComponent(t)}/links`,{method:"POST",body:JSON.stringify({type:a,targetId:s})})}async function V5(e,t,a,s){await Ae(`${Ge(e)}/sessions/${encodeURIComponent(t)}/links`,{method:"DELETE",body:JSON.stringify({type:a,targetId:s})})}async function X5(e){return Un(await Ae(`${Ge(e)}/agents`),"agents")}async function Ry(){return Un(await Ae("/api/custom-agents"))}async function Oy(e){return Ae("/api/custom-agents",{method:"POST",body:JSON.stringify(e)})}async function Iy(e,t){return Ae(`/api/custom-agents/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}async function Wh(e){await Ae(`/api/custom-agents/${encodeURIComponent(e)}`,{method:"DELETE"})}async function kx(e){return Ae(`/api/custom-agents/${encodeURIComponent(e)}/export`)}async function Q5(e){return Ae("/api/custom-agents/import",{method:"POST",body:JSON.stringify(e)})}async function My(e,t){const a=new URLSearchParams;t!=null&&t.category&&a.set("category",t.category),t!=null&&t.includeSuperseded&&a.set("includeSuperseded","true");const s=a.toString();return Ae(`/api/custom-agents/${encodeURIComponent(e)}/memories${s?`?${s}`:""}`)}async function W5(e,t,a){return Ae(`/api/custom-agents/${encodeURIComponent(e)}/memories/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(a)})}async function Z5(e,t){await Ae(`/api/custom-agents/${encodeURIComponent(e)}/memories/${encodeURIComponent(t)}`,{method:"DELETE"})}async function J5(e,t){return Ae(`/api/custom-agents/${encodeURIComponent(e)}/memories/extract`,{method:"POST",body:JSON.stringify({sessionIds:t})})}async function Zh(e){return Ae(`/api/custom-agents/${encodeURIComponent(e)}/sessions`)}async function Dy(e){return Un(await Ae(`${Ge(e)}/custom-agents`))}async function Ly(e,t){return Ae(`${Ge(e)}/custom-agents`,{method:"POST",body:JSON.stringify(t)})}async function Co(e){return Un(await Ae(`${Ge(e)}/models`))}async function jy(){return Un(await Ae("/api/prompt-fragments"))}async function ew(e){return Ae("/api/prompt-fragments",{method:"POST",body:JSON.stringify(e)})}async function tw(e,t){return Ae(`/api/prompt-fragments/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}async function nw(e){await Ae(`/api/prompt-fragments/${encodeURIComponent(e)}`,{method:"DELETE"})}async function Rx(e){return Un(await Ae(`${Ge(e)}/tags`))}async function Ox(e,t){return Un(await Ae(`${Ge(e)}/milestones`))}async function Ix(e,t="open"){return Un(await Ae(`${Ge(e)}/issues?state=${encodeURIComponent(t)}`),"issues")}async function aw(e,t="all"){return Ae(`${Ge(e)}/issues/sync`,{method:"POST",body:JSON.stringify({state:t})})}async function rw(e,t,a){return Ae(`${Ge(e)}/issues`,{method:"POST",body:JSON.stringify({title:t,body:a})})}async function sw(e,t,a){await Ae(`${Ge(e)}/issues/${t}/children`,{method:"POST",body:JSON.stringify({childNumber:a})})}async function By(e,t,a){return Ae(`${Ge(e)}/issues/${t}`,{method:"PATCH",body:JSON.stringify(a)})}async function Mx(e,t){return Un(await Ae(`${Ge(e)}/issues/${t}/pulls`))}async function iw(e,t,a,s=!1){await Ae(`${Ge(e)}/issues/${t}/pulls/${a}/merge`,{method:"POST",body:JSON.stringify({closeIssue:s})})}async function Dx(e,t="open"){return Un(await Ae(`${Ge(e)}/pulls?state=${encodeURIComponent(t)}`))}async function lw(e,t="all"){return Ae(`${Ge(e)}/pulls/sync`,{method:"POST",body:JSON.stringify({state:t})})}async function ow(e,t){await Ae(`${Ge(e)}/pulls/${t}/merge`,{method:"POST"})}async function Py(e,t){return Un(await Ae(`${Ge(e)}/pulls/${t}/issues`))}async function uw(e,t,a){await Ae(`${Ge(e)}/pulls/${t}/issues`,{method:"POST",body:JSON.stringify({issueNumber:a})})}async function cw(e,t,a){await Ae(`${Ge(e)}/pulls/${t}/issues/${a}`,{method:"DELETE"})}async function dw(e,t){return Ae(`${Ge(e)}/pulls/${t}/comments`)}async function fw(e,t){return Ae(`${Ge(e)}/issues/${t}/comments`)}async function Lx(e,t,a){return Ae(`${Ge(e)}/issues/${t}/comments`,{method:"POST",body:JSON.stringify({body:a})})}async function mw(e,t,a){return Ae(`${Ge(e)}/issues/${t}/polish`,{method:"POST",body:JSON.stringify({draft:a})})}async function jx(e,t){return Ae(`${Ge(e)}/issues/${t}/draft`)}async function hw(e,t,a){return Ae(`${Ge(e)}/issues/polish-create`,{method:"POST",body:JSON.stringify({title:t,body:a})})}async function Bx(e){return Ae(`${Ge(e)}/issues/draft-create`)}async function Px(e){await Ae(`${Ge(e)}/issues/draft-create`,{method:"DELETE"})}async function pw(e,t,a){await Ae(`${Ge(e)}/sessions/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({title:a})})}async function gw(e,t,a){await Ae(`${Ge(e)}/sessions/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({completedAt:a})})}async function bw(){return Ae("/api/agents-md")}async function xw(e){await Ae("/api/agents-md",{method:"PUT",body:JSON.stringify({content:e})})}async function Ew(e){return Ae(`/api/repos/${encodeURIComponent(e)}/agents-md`)}async function yw(e,t){await Ae(`/api/repos/${encodeURIComponent(e)}/agents-md`,{method:"PUT",body:JSON.stringify({content:t})})}function Nw(e){return`${Cy()}${Ge(e)}/events`}async function Tw(e){return Ae(`${Ge(e)}/sessions/status`)}async function ko(){return Ae("/api/settings")}async function fh(e,t){await Ae(`/api/settings/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({value:t})})}async function mh(){return Ae("/api/cloud/status")}async function _w(){return Ae("/api/cloud/reload",{method:"POST"})}async function vw(e){try{return(await Ae("/api/cloud/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})})).connected}catch{return!1}}async function Sw(){return Un(await Ae("/api/git-hosts"),"gitHosts")}async function Aw(e,t,a,s="gitea"){return Ae("/api/git-hosts",{method:"POST",body:JSON.stringify({host:e,name:t,token:a,platform:s})})}async function ww(e){await Ae(`/api/git-hosts/${encodeURIComponent(e)}`,{method:"DELETE"})}async function Uy(){return Ae("/api/usage")}async function Hy(e){return Ae("/api/usage/switch",{method:"POST",body:JSON.stringify({accountId:e})})}async function Cw(e,t="ios"){await Ae("/api/push/register",{method:"POST",body:JSON.stringify({token:e,platform:t})})}const rs="fs-active-repo",Be=Ja((e,t)=>({repos:[],activeRepoId:localStorage.getItem(rs),loading:!1,loadError:null,loadRepos:async()=>{e({loading:!0,loadError:null});try{const a=await _5(),s=t().activeRepoId,o=s&&a.some(d=>d.id===s);e({repos:a,loading:!1,activeRepoId:o?s:a.length>0?a[0].id:null});const u=t().activeRepoId;u?localStorage.setItem(rs,u):localStorage.removeItem(rs)}catch(a){e({loading:!1,loadError:a instanceof Error?a.message:"Failed to load repos"})}},setActiveRepo:a=>{e({activeRepoId:a}),a?localStorage.setItem(rs,a):localStorage.removeItem(rs)},addRepo:async(a,s,o,u)=>{try{const d=await v5(a,s,o,u);return e(f=>({repos:[...f.repos,d],activeRepoId:d.id})),localStorage.setItem(rs,d.id),d}catch(d){return e({loadError:d instanceof Error?d.message:"Failed to add repo"}),null}},removeRepo:async a=>{try{await A5(a)}catch{}e(s=>{const o=s.repos.filter(d=>d.id!==a),u=s.activeRepoId===a?o.length>0?o[0].id:null:s.activeRepoId;return u?localStorage.setItem(rs,u):localStorage.removeItem(rs),{repos:o,activeRepoId:u}})},updateRepoBranch:(a,s)=>{e(o=>({repos:o.repos.map(u=>u.id===a?{...u,branch:s}:u)}))}})),ta=e=>{var t;return((t=e.repos.find(a=>a.id===e.activeRepoId))==null?void 0:t.name)??null},vm="fs-nav-collapsed",Sm="fs-session-panel-collapsed",Ac=Ja(e=>({navCollapsed:localStorage.getItem(vm)==="true",sessionPanelCollapsed:localStorage.getItem(Sm)==="true",toggleNav(){e(t=>{const a=!t.navCollapsed;return localStorage.setItem(vm,String(a)),{navCollapsed:a}})},toggleSessionPanel(){e(t=>{const a=!t.sessionPanelCollapsed;return localStorage.setItem(Sm,String(a)),{sessionPanelCollapsed:a}})},setNavCollapsed(t){localStorage.setItem(vm,String(t)),e({navCollapsed:t})},setSessionPanelCollapsed(t){localStorage.setItem(Sm,String(t)),e({sessionPanelCollapsed:t})}})),Fy=[{segment:"repos",icon:by,label:"仓库管理",global:!0},{segment:"run",icon:Qc,label:"运行面板",global:!1},{segment:"agents",icon:wA,label:"Agents",global:!1},{segment:"issues",icon:xo,label:"Issues",global:!1},{segment:"pulls",icon:Eo,label:"PRs",global:!1},{segment:"settings",icon:r5,label:"设置",global:!0}];function zy(e,t,a){return t?`/${e}`:a?`/${encodeURIComponent(a)}/${e}`:`/${e}`}function kw(e){const t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}function Rw({repos:e,activeRepoId:t,onRepoChange:a}){const[s,o]=_.useState(!1),u=_.useRef(null),d=e.find(m=>m.id===t),f=_.useCallback(()=>o(!1),[]);return _.useEffect(()=>{if(!s)return;const m=h=>{u.current&&!u.current.contains(h.target)&&f()};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[s,f]),l.jsxs("div",{ref:u,className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>o(m=>!m),className:"flex max-w-[140px] items-center gap-1 rounded-md border border-line bg-base px-2 py-1 text-xs text-fg-2 transition-colors hover:border-blue-500 sm:max-w-[200px]",children:[l.jsx(by,{className:"h-3 w-3 shrink-0 text-fg-4"}),l.jsxs("span",{className:"truncate",children:[l.jsx("span",{className:"sm:hidden",children:d?kw(d.name):""}),l.jsx("span",{className:"hidden sm:inline",children:(d==null?void 0:d.name)??""})]}),l.jsx(ea,{className:se("h-3 w-3 shrink-0 text-fg-4 transition-transform",s&&"rotate-180")})]}),s&&l.jsx("div",{className:"absolute left-0 top-full z-50 mt-1 w-64 overflow-hidden rounded-lg border border-line bg-surface shadow-lg",children:l.jsx("div",{className:"max-h-64 overflow-y-auto py-1",children:e.map(m=>l.jsxs("button",{type:"button",onClick:()=>{a(m.id),f()},className:se("flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors",m.id===t?"font-medium text-blue-600":"text-fg-2 hover:bg-elevated"),children:[m.id===t?l.jsx(Cn,{className:"h-3 w-3 shrink-0"}):l.jsx("span",{className:"h-3 w-3 shrink-0"}),l.jsx("span",{className:"truncate",children:m.name})]},m.id))})})]})}function Ow({repoId:e,currentBranch:t}){const a=Be(A=>A.updateRepoBranch),[s,o]=_.useState(!1),[u,d]=_.useState(null),[f,m]=_.useState(!1),[h,b]=_.useState(null),[g,y]=_.useState(null),N=_.useRef(null),v=_.useCallback(()=>{o(!1),y(null)},[]);_.useEffect(()=>{if(!s)return;const A=R=>{N.current&&!N.current.contains(R.target)&&v()};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[s,v]);const S=async()=>{if(s){v();return}o(!0),m(!0),y(null);try{d(await k5(e))}catch{y("加载分支失败")}finally{m(!1)}},w=async A=>{if(!(A===t||h)){b(A),y(null);try{const R=await R5(e,A);a(e,R.branch),v()}catch(R){y(R instanceof Error?R.message:"切换失败")}finally{b(null)}}};return t?l.jsxs("div",{ref:N,className:"relative",children:[l.jsxs("button",{type:"button",onClick:S,className:"flex items-center gap-1 rounded-md bg-elevated px-2 py-1 text-xs text-fg-3 transition-colors hover:bg-blue-500/10 hover:text-blue-600",children:[l.jsx(Gs,{className:"h-3 w-3"}),t,l.jsx(ea,{className:se("h-3 w-3 transition-transform",s&&"rotate-180")})]}),s&&l.jsxs("div",{className:"absolute right-0 top-full z-50 mt-1 w-56 overflow-hidden rounded-lg border border-line bg-surface shadow-lg",children:[f?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx(Kt,{className:"h-4 w-4 animate-spin text-fg-4"})}):u?l.jsxs("div",{className:"max-h-64 overflow-y-auto py-1",children:[u.local.map(A=>l.jsxs("button",{type:"button",disabled:h!==null,onClick:()=>w(A),className:se("flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors",A===t?"font-medium text-blue-600":"text-fg-2 hover:bg-elevated"),children:[A===t?l.jsx(Cn,{className:"h-3 w-3 shrink-0"}):h===A?l.jsx(Kt,{className:"h-3 w-3 shrink-0 animate-spin"}):l.jsx("span",{className:"h-3 w-3 shrink-0"}),l.jsx("span",{className:"truncate",children:A})]},A)),u.remote.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mx-3 my-1 border-t border-line"}),l.jsx("div",{className:"px-3 py-1 text-[10px] font-medium uppercase tracking-wider text-fg-4",children:"Remote"}),u.remote.map(A=>l.jsxs("button",{type:"button",disabled:h!==null,onClick:()=>w(A),className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs text-fg-2 transition-colors hover:bg-elevated",children:[h===A?l.jsx(Kt,{className:"h-3 w-3 shrink-0 animate-spin"}):l.jsx("span",{className:"h-3 w-3 shrink-0"}),l.jsx("span",{className:"truncate",children:A})]},`remote-${A}`))]})]}):null,g&&l.jsx("div",{className:"border-t border-line px-3 py-2 text-xs text-red-500",children:g})]})]}):null}function Iw(){const[e,t]=_.useState(null);return _.useEffect(()=>{const a=()=>fetch("/api/health").then(u=>u.json()).then(u=>{u.latestVersion&&u.latestVersion!=="0.10.5"&&t(u.latestVersion)}).catch(()=>{});a();const s=setInterval(a,30*6e4),o=()=>a();return window.addEventListener("focus",o),()=>{clearInterval(s),window.removeEventListener("focus",o)}},[]),e}function Mw(){const e=Pn(),t=ga(),a=Be(g=>g.repos),s=Be(g=>g.activeRepoId),o=Be(g=>g.setActiveRepo),u=ch(g=>g.preference),d=ch(g=>g.cycle),f=u==="light"?o5:u==="dark"?F3:U3,m=a.find(g=>g.id===s),h=Iw(),b=g=>{var v;if(!g)return;o(g);const y=a.find(S=>S.id===g);if(!y)return;const N=((v=t.pathname.match(/\/(run|issues|pulls)/))==null?void 0:v[1])??"run";e(`/${encodeURIComponent(y.name)}/${N}`)};return l.jsxs("header",{className:"shrink-0 border-b border-line bg-surface pt-[var(--safe-top)]",children:[l.jsxs("div",{className:"flex h-12 items-center justify-between px-4",children:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx(Zc,{className:"h-5 w-5 text-blue-500"}),l.jsx("span",{className:"hidden text-sm font-bold tracking-tight text-fg sm:inline",children:"Fourth Spark"}),l.jsxs("span",{className:"hidden rounded bg-elevated px-1.5 py-0.5 text-[10px] font-medium tabular-nums text-fg-4 sm:inline",children:["v","0.10.5"]}),h&&l.jsxs("span",{className:"hidden text-[10px] text-amber-500 sm:inline",children:["→ v",h," 可用,运行 ",l.jsx("code",{className:"rounded bg-amber-500/10 px-1 font-mono",children:"fourth-spark upgrade"})," 更新"]})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[a.length>0&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Rw,{repos:a,activeRepoId:s,onRepoChange:b}),m&&s&&l.jsx(Ow,{repoId:s,currentBranch:m.branch})]}),l.jsx("a",{href:"https://github.com/kinminghao/fourth-spark",target:"_blank",rel:"noopener noreferrer","aria-label":"GitHub",className:"flex h-8 w-8 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:l.jsx("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:l.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})})}),l.jsx("button",{type:"button",onClick:d,"aria-label":`主题: ${u}`,className:"flex h-8 w-8 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:l.jsx(f,{className:"h-4 w-4"})})]})]}),h&&l.jsx("div",{className:"border-t border-line px-4 py-1.5 sm:hidden",children:l.jsxs("span",{className:"text-[10px] text-amber-500",children:["→ v",h," 可用,运行 ",l.jsx("code",{className:"rounded bg-amber-500/10 px-1 font-mono",children:"fourth-spark upgrade"})," 更新"]})})]})}function Dw(){const e=Be(ta),t=Ac(s=>s.navCollapsed),a=Ac(s=>s.toggleNav);return l.jsxs("nav",{className:se("hidden shrink-0 flex-col border-r border-line bg-surface py-2 transition-[width] duration-200 ease-in-out md:flex",t?"w-14":"w-48"),children:[l.jsx("div",{className:"flex flex-1 flex-col",children:Fy.map(s=>l.jsxs(Gh,{to:zy(s.segment,s.global,e),title:t?s.label:void 0,className:({isActive:o})=>se("mx-2 flex items-center rounded-md py-2 text-sm transition-colors",t?"justify-center px-2":"gap-2.5 px-3",o?"bg-blue-500/10 font-medium text-blue-600":"text-fg-3 hover:bg-elevated hover:text-fg"),children:[l.jsx(s.icon,{className:"h-4 w-4 shrink-0"}),l.jsx("span",{className:se("truncate transition-[opacity,max-width] duration-200 ease-in-out",t?"max-w-0 opacity-0":"max-w-[8rem] opacity-100"),children:s.label})]},s.segment))}),l.jsx("button",{type:"button",onClick:a,title:t?"展开导航":"收起导航",className:"mx-2 flex items-center justify-center rounded-md py-2 text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:t?l.jsx(UA,{className:"h-4 w-4"}):l.jsx(BA,{className:"h-4 w-4"})})]})}function Lw(){const e=Be(ta);return l.jsx("nav",{className:"fixed bottom-0 left-0 right-0 z-30 border-t border-line bg-surface pb-[var(--safe-bottom)] md:hidden",children:l.jsx("div",{className:"flex h-14 items-center justify-around",children:Fy.map(t=>l.jsx(Gh,{to:zy(t.segment,t.global,e),"aria-label":t.label,className:({isActive:a})=>se("flex h-10 w-10 items-center justify-center rounded-md transition-colors",a?"bg-blue-500/10 text-blue-600":"text-fg-3 hover:bg-elevated hover:text-fg"),children:l.jsx(t.icon,{className:"h-5 w-5 shrink-0"})},t.segment))})})}function jw(){return l.jsxs("div",{className:"flex h-full flex-col overflow-hidden bg-base text-fg",children:[l.jsx(Mw,{}),l.jsxs("div",{className:"flex min-h-0 flex-1",children:[l.jsx(Dw,{}),l.jsx("main",{className:"flex min-w-0 flex-1 flex-col overflow-hidden pb-[calc(3.5rem_+_var(--safe-bottom))] md:pb-0",children:l.jsx(kS,{})})]}),l.jsx(Lw,{})]})}let Bw=0;const Ut=Ja(e=>({toasts:[],addToast:(t,a="info",s,o)=>{const u=(o==null?void 0:o.id)??`toast-${++Bw}-${Date.now()}`;e(d=>d.toasts.some(f=>f.id===u)?d:{toasts:[...d.toasts,{id:u,message:t,variant:a,sessionId:s,persistent:o==null?void 0:o.persistent}]}),o!=null&&o.persistent||setTimeout(()=>{e(d=>({toasts:d.toasts.filter(f=>f.id!==u)}))},4e3)},removeToast:t=>{e(a=>({toasts:a.toasts.filter(s=>s.id!==t)}))}}));function Pw({onClose:e}){const[t,a]=_.useState(""),[s,o]=_.useState(""),[u,d]=_.useState(""),[f,m]=_.useState("opencode"),[h,b]=_.useState(!1),[g,y]=_.useState(""),N=Be(R=>R.addRepo),v=s.trim()!==""&&u.trim()!==""&&t.trim()!==""&&!h,S=async R=>{const I=R.trim();if(I){b(!0),y("");try{const Y=await S5(I);Y.name&&!s.trim()&&o(Y.name),Y.gitUrl&&!u.trim()&&d(Y.gitUrl)}catch(Y){const B=Y instanceof Error?Y.message:"无法解析路径";try{const C=JSON.parse(B);y(C.error??B)}catch{y(B)}}b(!1)}},w=_.useRef(S);w.current=S,_.useEffect(()=>{const R=t.trim();if(!R)return;const I=setTimeout(()=>{w.current(R)},500);return()=>clearTimeout(I)},[t]);const A=async()=>{if(!v)return;y(""),await N(s.trim(),u.trim(),t.trim(),f)&&e()};return l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:e,children:l.jsxs("div",{className:"w-full max-w-md rounded-xl border border-line bg-surface p-6 shadow-2xl",onClick:R=>R.stopPropagation(),children:[l.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[l.jsx("h2",{className:"text-base font-semibold text-fg",children:"添加仓库"}),l.jsx("button",{type:"button",onClick:e,className:"rounded-md p-1 text-fg-4 hover:bg-elevated hover:text-fg-2",children:l.jsx(gt,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsxs("div",{className:"flex flex-col gap-1.5",children:[l.jsx("label",{htmlFor:"m-path",className:"text-xs font-medium text-fg-3",children:"本地路径"}),l.jsx("input",{id:"m-path",value:t,onChange:R=>a(R.target.value),onBlur:R=>void S(R.target.value),placeholder:"/Users/you/code/repo",autoFocus:!0,className:"w-full rounded-lg border border-line bg-base px-3 py-2 font-mono text-sm text-fg placeholder:text-fg-5 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"}),l.jsx("span",{className:"text-[11px] text-fg-5",children:h?"正在读取 Git 信息…":"输入路径后自动读取仓库信息"})]}),l.jsxs("div",{className:"flex flex-col gap-1.5",children:[l.jsx("label",{htmlFor:"m-name",className:"text-xs font-medium text-fg-3",children:"名称"}),l.jsx("input",{id:"m-name",value:s,onChange:R=>o(R.target.value),placeholder:"my-project",className:"w-full rounded-lg border border-line bg-base px-3 py-2 text-sm text-fg placeholder:text-fg-5 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"})]}),l.jsxs("div",{className:"flex flex-col gap-1.5",children:[l.jsx("label",{htmlFor:"m-git",className:"text-xs font-medium text-fg-3",children:"Git 远程地址"}),l.jsx("input",{id:"m-git",value:u,onChange:R=>d(R.target.value),placeholder:"https://github.com/org/repo.git",className:"w-full rounded-lg border border-line bg-base px-3 py-2 font-mono text-xs text-fg placeholder:text-fg-5 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"})]}),l.jsxs("div",{className:"flex flex-col gap-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-fg-3",children:"运行时"}),l.jsx("div",{className:"flex gap-2",children:[{value:"opencode",label:"OpenCode"},{value:"claude-code",label:"Claude Code"}].map(R=>l.jsx("button",{type:"button",onClick:()=>m(R.value),className:`flex-1 rounded-lg border px-3 py-2 text-sm font-medium transition-colors ${f===R.value?"border-blue-500 bg-blue-500/10 text-blue-600":"border-line bg-base text-fg-4 hover:bg-elevated hover:text-fg-2"}`,children:R.label},R.value))}),l.jsx("span",{className:"text-[11px] text-fg-5",children:f==="claude-code"?"需要本地安装 Claude Code CLI":"需要本地安装 OpenCode CLI"})]}),g&&l.jsx("p",{className:"rounded-md bg-red-500/10 px-3 py-2 text-xs text-red-500",children:g}),l.jsxs("div",{className:"mt-1 flex items-center justify-end gap-2",children:[l.jsx("button",{type:"button",onClick:e,className:"rounded-lg border border-line px-4 py-2 text-sm text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:"取消"}),l.jsx("button",{type:"button",onClick:A,disabled:!v,className:"rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-500 disabled:cursor-not-allowed disabled:bg-fg-6 disabled:text-fg-4",children:"添加仓库"})]})]})]})})}function Uw({repoId:e,repoName:t,onClose:a}){const[s,o]=_.useState(""),[u,d]=_.useState(""),[f,m]=_.useState(!0),[h,b]=_.useState(!1),[g,y]=_.useState(null);_.useEffect(()=>{Ew(e).then(S=>{o(S.content),d(S.content),m(!1)}).catch(S=>{y(S instanceof Error?S.message:String(S)),m(!1)})},[e]);const N=async()=>{b(!0),y(null);try{await yw(e,s),d(s)}catch(S){y(S instanceof Error?S.message:String(S))}b(!1)},v=s!==u;return l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:a,children:l.jsxs("div",{className:"flex w-full max-w-2xl flex-col rounded-xl border border-line bg-surface p-6 shadow-2xl",onClick:S=>S.stopPropagation(),children:[l.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("h2",{className:"text-base font-semibold text-fg",children:[t," — AGENTS.md"]}),l.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"仅对此仓库生效,修改后 opencode 热加载即时生效。"})]}),l.jsx("button",{type:"button",onClick:a,className:"shrink-0 rounded-md p-1 text-fg-4 hover:bg-elevated hover:text-fg-2",children:l.jsx(gt,{className:"h-4 w-4"})})]}),g&&l.jsxs("div",{className:"mb-3 flex items-start gap-2 rounded-lg bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[l.jsx(kn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),l.jsx("span",{className:"min-w-0 break-words",children:g})]}),f?l.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-16 text-fg-5",children:[l.jsx(Kt,{className:"h-5 w-5 fs-spin"}),l.jsx("p",{className:"text-xs",children:"加载中…"})]}):l.jsx("textarea",{value:s,onChange:S=>o(S.target.value),spellCheck:!1,className:"h-96 w-full resize-y rounded-lg border border-line bg-base px-4 py-3 font-mono text-sm leading-relaxed text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20",placeholder:`# AGENTS.md
466
+
467
+ 在此编写该仓库的 Agent 指令…`}),l.jsxs("div",{className:"mt-4 flex items-center justify-end gap-2",children:[l.jsx("button",{type:"button",onClick:a,className:"rounded-lg border border-line px-4 py-2 text-sm text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:"关闭"}),l.jsxs("button",{type:"button",onClick:()=>void N(),disabled:h||!v,className:"flex items-center gap-1.5 rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[l.jsx(Wc,{className:"h-3.5 w-3.5"}),h?"保存中…":"保存"]})]})]})})}const hh=1024,ph=hh*1024,Ux=ph*1024;function Hx(e){return!e||e<=0?"0 B":e<hh?`${e} B`:e<ph?`${(e/hh).toFixed(1)} KB`:e<Ux?`${(e/ph).toFixed(1)} MB`:`${(e/Ux).toFixed(2)} GB`}const Am="ws/";function Hw({repoId:e}){const[t,a]=_.useState(!1),[s,o]=_.useState(null),[u,d]=_.useState(!1),[f,m]=_.useState(null),[h,b]=_.useState(null),[g,y]=_.useState(!1),N=async()=>{d(!0),m(null);try{const R=await I5(e);o(R)}catch(R){m(R instanceof Za?R.message:"加载失败")}d(!1)};_.useEffect(()=>{t&&s===null&&N()},[t]);const v=async R=>{b(R);try{await M5(e,R),await N()}catch(I){m(I instanceof Za?I.message:"删除失败")}b(null)},S=async()=>{y(!0);try{await D5(e),await N()}catch(R){m(R instanceof Za?R.message:"清理失败")}y(!1)},w=(s==null?void 0:s.length)??0,A=(s==null?void 0:s.reduce((R,I)=>R+(I.diskUsage||0),0))??0;return l.jsxs("div",{className:"mt-3 border-t border-line pt-3",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("button",{type:"button",onClick:()=>a(R=>!R),className:"flex min-w-0 flex-1 items-center gap-1.5 text-left text-xs font-medium text-fg-3 transition-colors hover:text-fg-2",children:[t?l.jsx(LA,{className:"h-3 w-3 shrink-0"}):l.jsx(ea,{className:"h-3 w-3 shrink-0"}),l.jsx(Gs,{className:"h-3 w-3 shrink-0 text-fg-5"}),l.jsx("span",{children:"工作空间"}),s!==null&&l.jsxs("span",{className:"text-fg-5",children:["(",w,") · ",Hx(A)]})]}),t&&w>0&&l.jsxs("button",{type:"button",onClick:()=>void S(),disabled:g,className:"flex h-6 shrink-0 items-center gap-1 rounded border border-line px-2 text-xs text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2 disabled:opacity-50",children:[g?l.jsx("span",{className:"inline-block h-2.5 w-2.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):null,"清理已合并"]})]}),t&&l.jsxs("div",{className:"mt-2",children:[f&&l.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2 rounded border border-red-500/30 bg-red-500/5 px-2 py-1 text-xs text-red-600",children:[l.jsx("span",{className:"truncate",children:f}),l.jsx("button",{type:"button",onClick:()=>m(null),className:"shrink-0 rounded p-0.5 transition-colors hover:bg-red-500/10",children:l.jsx(gt,{className:"h-3 w-3"})})]}),u&&s===null?l.jsx("div",{className:"flex justify-center py-3",children:l.jsx("span",{className:"inline-block h-3.5 w-3.5 animate-spin rounded-full border-2 border-fg-5 border-t-transparent"})}):w===0?l.jsx("p",{className:"py-2 text-center text-xs text-fg-5",children:"暂无工作空间"}):l.jsx("ul",{className:"space-y-1",children:s==null?void 0:s.map(R=>{const I=R.branch.startsWith(Am),Y=I?R.branch.slice(Am.length):R.branch,B=R.status==="active"?"bg-emerald-500/10 text-emerald-600":R.status==="idle"?"bg-amber-500/10 text-amber-600":"bg-fg-6/30 text-fg-4",C=R.status==="active"?"活跃":R.status==="idle"?"空闲":R.status==="merged"?"已合并":R.status==="stale"?"陈旧":R.status,z=R.status!=="active";return l.jsxs("li",{className:"flex items-center gap-2 rounded-md border border-line bg-elevated/40 px-2 py-1.5 text-xs",children:[l.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[R.running&&R.port&&l.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-emerald-500",title:`运行中 :${R.port}`}),l.jsxs("span",{className:"min-w-0 truncate font-mono",children:[I&&l.jsx("span",{className:"text-fg-5",children:Am}),l.jsx("span",{className:"text-fg-2",children:Y})]})]}),l.jsx("span",{className:se("shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium",B),children:C}),l.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 text-fg-5",children:[l.jsx(g3,{className:"h-2.5 w-2.5"}),Hx(R.diskUsage)]}),l.jsx("button",{type:"button",onClick:()=>void v(R.id),disabled:!z||h===R.id,title:z?"删除工作空间":"活跃工作空间无法删除",className:"flex h-5 w-5 shrink-0 items-center justify-center rounded text-fg-5 transition-colors hover:bg-red-500/10 hover:text-red-500 disabled:cursor-not-allowed disabled:opacity-30 disabled:hover:bg-transparent disabled:hover:text-fg-5",children:h===R.id?l.jsx("span",{className:"inline-block h-2.5 w-2.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):l.jsx(wr,{className:"h-3 w-3"})})]},R.id)})})]})]})}function Fw(){const e=Be(B=>B.repos),t=Be(B=>B.activeRepoId),a=Be(B=>B.setActiveRepo),s=Be(B=>B.removeRepo),o=Be(B=>B.loadRepos),[u,d]=_.useState(!1),[f,m]=_.useState(null),[h,b]=_.useState(null),[g,y]=_.useState(null),N=Ut(B=>B.addToast),[v,S]=_.useState(null),[w,A]=_.useState(null),R=_.useRef(null);_.useEffect(()=>{if(!w)return;const B=C=>{R.current&&!R.current.contains(C.target)&&A(null)};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[w]);const I=async(B,C)=>{b(B);try{C?await C5(B):await w5(B),await o()}catch{}b(null)},Y=async B=>{y(B);try{const C=await O5(B);await o();const z=C.alreadyUpToDate?"info":"success";N(C.summary,z,void 0,{persistent:!0})}catch(C){let z="拉取失败";if(C instanceof Za)try{z=JSON.parse(C.message).error??C.message}catch{z=C.message}N(z,"error",void 0,{persistent:!0})}y(null)};return l.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[l.jsxs("div",{className:"mx-auto max-w-4xl",children:[l.jsxs("div",{className:"mb-6 flex items-center justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("h1",{className:"text-lg font-semibold text-fg",children:"仓库管理"}),l.jsx("p",{className:"mt-0.5 text-sm text-fg-4",children:"管理代码仓库,每个仓库对应一个独立的 Agent 运行环境"})]}),l.jsxs("button",{type:"button",onClick:()=>d(!0),className:"flex shrink-0 items-center gap-1.5 rounded-lg bg-blue-600 px-3 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-500 md:px-4",children:[l.jsx(Ra,{className:"h-4 w-4"}),l.jsx("span",{className:"hidden md:inline",children:"添加仓库"})]})]}),e.length===0?l.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-dashed border-line-hard py-16 text-center",children:[l.jsx("div",{className:"rounded-full bg-elevated p-3",children:l.jsx(Ra,{className:"h-6 w-6 text-fg-4"})}),l.jsx("p",{className:"text-sm font-medium text-fg-3",children:"暂无代码仓库"}),l.jsx("p",{className:"text-xs text-fg-5",children:"添加一个本地仓库开始使用"}),l.jsx("button",{type:"button",onClick:()=>d(!0),className:"mt-2 rounded-lg border border-line px-4 py-2 text-sm text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:"添加仓库"})]}):l.jsx(l.Fragment,{children:l.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:e.map(B=>{const C=B.id===t;return l.jsxs("div",{className:se("rounded-xl border p-4 transition-colors",C?"border-blue-500/40 bg-blue-500/5":"border-line"),children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("button",{type:"button",onClick:()=>a(B.id),className:"flex min-w-0 items-center gap-2 text-left",children:[C?l.jsx(xo,{className:"h-4 w-4 shrink-0 text-blue-500"}):l.jsx(qA,{className:"h-4 w-4 shrink-0 text-fg-5"}),l.jsx("span",{className:se("truncate font-medium",C?"text-fg":"text-fg-2"),children:B.name})]}),l.jsxs("span",{className:se("inline-flex shrink-0 items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium",B.running?"bg-emerald-500/10 text-emerald-600":"bg-fg-6/30 text-fg-4"),children:[l.jsx("span",{className:se("h-1.5 w-1.5 rounded-full",B.running?"bg-emerald-500":"bg-fg-5")}),B.running?"运行中":"已停止"]})]}),l.jsxs("dl",{className:"mt-3 space-y-1 font-mono text-xs text-fg-4",children:[l.jsxs("div",{className:"flex gap-2",children:[l.jsx("dt",{className:"shrink-0 text-fg-5",children:"Git"}),l.jsx("dd",{className:"min-w-0 truncate",children:B.gitUrl})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("dt",{className:"shrink-0 text-fg-5",children:"路径"}),l.jsxs("dd",{className:"flex min-w-0 items-center gap-1.5",children:[l.jsx("span",{className:"truncate",children:B.localPath}),l.jsx("button",{type:"button",onClick:()=>void navigator.clipboard.writeText(B.localPath),title:"复制路径",className:"shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:text-fg-3",children:l.jsx(Tc,{className:"h-3 w-3"})})]})]}),B.running&&B.port&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("dt",{className:"shrink-0 text-fg-5",children:"直连"}),l.jsxs("dd",{className:"flex min-w-0 items-center gap-1.5",children:[l.jsxs("a",{href:`http://127.0.0.1:${B.port}`,target:"_blank",rel:"noopener noreferrer",className:"truncate text-blue-500 hover:underline",children:["127.0.0.1:",B.port]}),l.jsx("button",{type:"button",onClick:()=>void navigator.clipboard.writeText(`http://127.0.0.1:${B.port}`),title:"复制链接",className:"shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:text-fg-3",children:l.jsx(Tc,{className:"h-3 w-3"})})]})]})]}),l.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[l.jsx("button",{type:"button",onClick:()=>void Y(B.id),disabled:g===B.id,className:"flex h-8 shrink-0 items-center justify-center gap-1.5 rounded-md border border-blue-500/30 px-2.5 text-xs font-medium text-blue-600 transition-colors hover:bg-blue-500/10 disabled:opacity-50",children:g===B.id?l.jsx("span",{className:"inline-block h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):l.jsxs(l.Fragment,{children:[l.jsx(EA,{className:"h-3 w-3"}),"拉取"]})}),l.jsx("button",{type:"button",onClick:()=>void I(B.id,B.running),disabled:h===B.id,className:se("flex h-8 flex-1 items-center justify-center gap-1.5 rounded-md border text-xs font-medium transition-colors disabled:opacity-50",B.running?"border-amber-500/30 text-amber-600 hover:bg-amber-500/10":"border-emerald-500/30 text-emerald-600 hover:bg-emerald-500/10"),children:h===B.id?l.jsx("span",{className:"inline-block h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):B.running?l.jsxs(l.Fragment,{children:[l.jsx(uh,{className:"h-3 w-3 fill-current"}),"停止"]}):l.jsxs(l.Fragment,{children:[l.jsx(Qc,{className:"h-3 w-3 fill-current"}),"启动"]})}),l.jsxs("div",{className:"relative",ref:w===B.id?R:void 0,children:[l.jsx("button",{type:"button",onClick:()=>A(w===B.id?null:B.id),className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:l.jsx(e3,{className:"h-4 w-4"})}),w===B.id&&l.jsxs("div",{className:"absolute right-0 top-full z-20 mt-1 min-w-[160px] overflow-hidden rounded-lg border border-line bg-elevated shadow-lg",children:[l.jsx("button",{type:"button",className:se("flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-colors hover:bg-base/60",B.runtimeType==="claude-code"?"text-orange-500":"text-sky-500"),onClick:async()=>{A(null);const z=B.runtimeType==="claude-code"?"opencode":"claude-code";await j5(B.id,z),o()},children:B.runtimeType==="claude-code"?"Claude → OpenCode":"OpenCode → Claude"}),l.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-fg-3 transition-colors hover:bg-base/60",onClick:async()=>{A(null),await L5(B.id,!B.worktreeEnabled),o()},children:[l.jsx(Gs,{className:"h-3 w-3"}),l.jsx("span",{children:"Worktree"}),l.jsx("span",{className:se("ml-auto text-[10px]",B.worktreeEnabled?"text-violet-500":"text-fg-5"),children:B.worktreeEnabled?"已开启":"已关闭"})]}),l.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-fg-3 transition-colors hover:bg-base/60",onClick:()=>{A(null),S({id:B.id,name:B.name})},children:[l.jsx(Vh,{className:"h-3 w-3"}),"配置"]}),l.jsx("div",{className:"my-0.5 border-t border-line"}),l.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-red-500 transition-colors hover:bg-red-500/10",onClick:()=>{A(null),m(B.id)},children:[l.jsx(wr,{className:"h-3 w-3"}),"删除仓库"]})]})]})]}),f===B.id&&l.jsxs("div",{className:"mt-2 flex items-center justify-between rounded-md border border-red-500/20 bg-red-500/5 px-3 py-2",children:[l.jsx("span",{className:"text-xs text-red-500",children:"确认删除此仓库?"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{type:"button",onClick:()=>{s(B.id),m(null)},className:"flex h-6 items-center gap-1 rounded border border-red-500/30 px-2 text-xs text-red-500 transition-colors hover:bg-red-500/10",children:[l.jsx(Cn,{className:"h-3 w-3"}),"确认"]}),l.jsx("button",{type:"button",onClick:()=>m(null),className:"flex h-6 items-center gap-1 rounded border border-line px-2 text-xs text-fg-4 transition-colors hover:bg-elevated",children:"取消"})]})]}),B.worktreeEnabled&&l.jsx(Hw,{repoId:B.id})]},B.id)})})}),l.jsxs("p",{className:"mt-3 text-xs text-fg-5",children:[e.length," 个仓库"]})]}),u&&l.jsx(Pw,{onClose:()=>d(!1)}),v&&l.jsx(Uw,{repoId:v.id,repoName:v.name,onClose:()=>S(null)})]})}const zw=new Set(["tool","tool-use","tool_use","tool-call","tool_call","tool-result","tool_result"]),$w=new Set(["thinking","reasoning","reason"]),qw=new Set(["text","output_text","message"]),Yw=new Set(["file","image"]);function wc(e){var a;const t=((a=e.type)==null?void 0:a.toLowerCase())??"";return zw.has(t)||e.toolName!=null||e.tool!=null?"tool":Yw.has(t)?"file":$w.has(t)?"thinking":qw.has(t)||e.content!=null||e.text!=null?"text":"other"}function Cc(e){return e.content??e.text??""}function $y(e){return e.toolName??e.tool??"tool"}function Jc(e){var t;return e.input??((t=e.state)==null?void 0:t.input)}function Jh(e){var t;return e.output??((t=e.state)==null?void 0:t.output)}function ep(e){var a,s,o;const t=(s=(a=e.state)==null?void 0:a.status)==null?void 0:s.toLowerCase();return t==="completed"||t==="done"||t==="success"?"completed":t==="error"||t==="failed"||((o=e.state)==null?void 0:o.error)!=null?"error":t==="pending"||t==="queued"?"pending":t==="running"||t==="in_progress"?"running":Jh(e)!=null?"completed":"running"}function Fx(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function $i(e){const t=e==null?void 0:e.toLowerCase();return t==="in_progress"||t==="in-progress"||t==="active"?"in_progress":t==="completed"||t==="done"||t==="complete"?"completed":t==="cancelled"||t==="canceled"?"cancelled":"pending"}function Gw(e){return e.filter(t=>$i(t.status)==="completed").length}function yo(e){const t=$y(e).toLowerCase();return t==="question"||t==="mcp_question"}function Kw(e){const t=Jc(e);if(!t||typeof t!="object")return null;const a=t;return Array.isArray(a.questions)?a.questions:null}function kc(e){if(!yo(e))return!1;const t=ep(e);return t==="pending"||t==="running"}const Vw=/\bses_[a-zA-Z0-9]+/;function Xw(e){var o;const t=Jc(e);if(t&&typeof t=="object"){const u=t;if(typeof u.task_id=="string"&&u.task_id.startsWith("ses_"))return u.task_id}const a=(o=e.state)==null?void 0:o.metadata;if(a){const u=a.session_id??a.sessionId;if(typeof u=="string"&&u.startsWith("ses_"))return u}const s=Jh(e);if(typeof s=="string"){const u=Vw.exec(s);if(u)return u[0]}if(s&&typeof s=="object"){const u=s,d=u.session_id??u.sessionId??u.task_id;if(typeof d=="string"&&d.startsWith("ses_"))return d}return null}const Qw=["Sisyphus","Prometheus","Atlas"];function Ww(e){const t=(e.name||e.id||"").toLowerCase();return Qw.some(a=>t.startsWith(a.toLowerCase()))}const Zw=Ja(e=>({agents:[],loaded:!1,loadAgents:async()=>{const t=Be.getState().activeRepoId;if(!t){e({agents:[],loaded:!0});return}try{const a=await X5(t);e({agents:a.filter(Ww),loaded:!0})}catch{e({loaded:!0})}}}));function qy(e){return`question-${e}`}function wm(e,t){const a=t.find(o=>o.id===e),s=(a==null?void 0:a.title)||e.slice(-8);Ut.getState().addToast(`${s} — 等待回复`,"warning",e,{id:qy(e),persistent:!0})}function Jw(e){var t;for(const a of e)if((t=a.parts)!=null&&t.some(s=>yo(s)&&kc(s)))return!0;return!1}const No=[],Rc=[],zx=[],js={};function $x(e){return e.id??e.callID}function An(){return Be.getState().activeRepoId}const qx=20,Ie=Ja((e,t)=>({sessions:[],activeSessionId:null,messages:{},messagesMeta:{},todos:{},sessionStatuses:{},errorReasons:{},queuedMessageIds:{},sessionLinks:{},allSessionLinks:{},sessionFilter:"active",loadingSessions:!1,loadError:null,sendError:null,setSessionFilter:a=>e({sessionFilter:a}),toggleSessionComplete:async a=>{const s=An();if(!s)return;const o=t().sessions.find(d=>d.id===a);if(!o)return;const u=o.completedAt?null:Date.now();e(d=>({sessions:d.sessions.map(f=>f.id===a?{...f,completedAt:u??void 0}:f)}));try{await gw(s,a,u)}catch{await t().loadSessions()}},loadSessions:async()=>{const a=An();if(!a){e({sessions:[],loadingSessions:!1});return}e({loadingSessions:!0,loadError:null});try{const[s,o]=await Promise.all([B5(a),Cx(a).catch(()=>null)]),u={sessions:s,loadingSessions:!1};o&&(u.allSessionLinks=o),e(u)}catch(s){e({loadingSessions:!1,loadError:s instanceof Error?s.message:"Failed to load sessions"})}},createSession:async(a,s,o,u,d,f,m)=>{const h=An();if(!h)return null;e({sendError:null});try{const b=await P5(h,a,s,o,u,d,f,m);return e(g=>({sessions:[b,...g.sessions.filter(y=>y.id!==b.id)],activeSessionId:b.id,messages:{...g.messages,[b.id]:[]}})),t().setSessionStatus(b.id,"busy"),b}catch(b){return e({sendError:b instanceof Error?b.message:"Failed to create session"}),null}},setActiveSession:async a=>{An()&&(e({activeSessionId:a,sendError:null}),await t().refreshSessionData(a))},refreshSessionData:async a=>{var b,g;const s=An();if(!s)return;const u=!t().messages[a]||t().messages[a].length===0?{limit:qx}:void 0,[d,f]=await Promise.allSettled([G5(s,a),wx(s,a,u)]),m=d.status==="fulfilled"?d.value:null,h=(g=(b=m==null?void 0:m.session)==null?void 0:b.revert)==null?void 0:g.messageID;e(y=>{const N={};if(m&&(m.status&&(N.sessionStatuses={...y.sessionStatuses,[a]:m.status.type}),m.todos&&(N.todos={...y.todos,[a]:m.todos}),m.links&&(N.sessionLinks={...y.sessionLinks,[a]:m.links}),m.session&&(N.sessions=y.sessions.map(v=>v.id===a?{...v,...m.session}:v))),f.status==="fulfilled"){let v=f.value.messages;if(h){const w=v.findIndex(A=>A.id===h);w>=0&&(v=v.slice(0,w+1))}const S=y.messages[a]??[];v.length>=S.length&&(N.messages={...y.messages,[a]:v}),N.messagesMeta={...y.messagesMeta,[a]:{total:Math.max(f.value.total,S.length),hasMore:f.value.hasMore,loading:!1}}}return N}),f.status==="fulfilled"&&Jw(f.value.messages)&&wm(a,t().sessions)},loadMoreMessages:async a=>{var f;const s=An();if(!s)return;const o=t().messagesMeta[a];if(!(o!=null&&o.hasMore)||o.loading)return;const d=(f=(t().messages[a]??[])[0])==null?void 0:f.id;e(m=>({messagesMeta:{...m.messagesMeta,[a]:{...o,loading:!0}}}));try{const m=await wx(s,a,{limit:qx,before:d});e(h=>{const b=h.messages[a]??[];return{messages:{...h.messages,[a]:[...m.messages,...b]},messagesMeta:{...h.messagesMeta,[a]:{total:m.total,hasMore:m.hasMore,loading:!1}}}})}catch{e(m=>({messagesMeta:{...m.messagesMeta,[a]:{...o,loading:!1}}}))}},refreshSessionLinks:async a=>{const s=An();if(s)try{const[o,u]=await Promise.all([Y5(s,a),Cx(s).catch(()=>null)]);e(d=>{const f={sessionLinks:{...d.sessionLinks,[a]:o}};return u&&(f.allSessionLinks=u),f})}catch{}},addLink:async(a,s,o)=>{const u=An();if(!u)return!1;try{return await K5(u,a,s,o),await t().refreshSessionLinks(a),!0}catch{return!1}},removeLink:async(a,s,o)=>{const u=An();if(!u)return!1;try{return await V5(u,a,s,o),await t().refreshSessionLinks(a),!0}catch{return!1}},deleteSession:async a=>{const s=An();if(s)try{await U5(s,a)}catch{}delete js[a],e(o=>{const{[a]:u,...d}=o.messages,{[a]:f,...m}=o.messagesMeta,{[a]:h,...b}=o.todos,{[a]:g,...y}=o.sessionStatuses,{[a]:N,...v}=o.errorReasons,{[a]:S,...w}=o.queuedMessageIds,{[a]:A,...R}=o.sessionLinks,{[a]:I,...Y}=o.allSessionLinks;return{sessions:o.sessions.filter(B=>B.id!==a),messages:d,messagesMeta:m,todos:b,sessionStatuses:y,errorReasons:v,queuedMessageIds:w,sessionLinks:R,allSessionLinks:Y,activeSessionId:o.activeSessionId===a?null:o.activeSessionId}})},sendMessage:async(a,s,o)=>{const u=An(),d=t().activeSessionId;if(!u||!d)return!1;const f=t().sessions.find(h=>h.id===d),m=t().sessionStatuses[d]==="busy";e({sendError:null}),m||t().setSessionStatus(d,"busy");try{const h=Zw.getState(),b=f!=null&&f.agent&&h.loaded&&h.agents.some(g=>g.name===f.agent||g.id===f.agent)?f.agent:void 0;return await H5(u,d,a,b,s,o),m&&(js[d]=(js[d]||0)+1),!0}catch(h){return e({sendError:h instanceof Error?h.message:"Failed to send message"}),m||t().setSessionStatus(d,"idle"),!1}},replyQuestion:async a=>{const s=An(),o=t().activeSessionId;if(!(!s||!o))try{await z5(s,o,a)}catch(u){e({sendError:u instanceof Error?u.message:"Failed to reply to question"})}},rejectQuestion:async()=>{const a=An(),s=t().activeSessionId;if(!(!a||!s))try{await $5(a,s)}catch{}},abortSession:async()=>{const a=An(),s=t().activeSessionId;if(!(!a||!s)){try{await F5(a,s)}catch{}t().setSessionStatus(s,"idle")}},clearSessions:()=>{for(const a of Object.keys(js))delete js[a];e({sessions:[],activeSessionId:null,messages:{},messagesMeta:{},todos:{},sessionStatuses:{},errorReasons:{},queuedMessageIds:{},sessionLinks:{},allSessionLinks:{},loadError:null,sendError:null})},updateMessage:(a,s)=>{var o;e(u=>{const d=u.messages[a]??[],f=d.findIndex(g=>g.id===s.id);let m,h=u.queuedMessageIds,b=u.messagesMeta;if(f>=0){const g={...d[f],...s};(!s.parts||s.parts.length===0)&&d[f].parts&&(g.parts=d[f].parts),m=[...d],m[f]=g}else{m=[...d,s];const g=b[a];g&&(b={...b,[a]:{...g,total:g.total+1}});const y=js[a]||0;if(s.role==="user"&&y>0){const N=[...h[a]??[]];N.push(s.id),h={...h,[a]:N},js[a]=y-1}else if(s.role==="assistant"){const N=h[a];N&&N.length>0&&(h={...h,[a]:N.slice(1)})}}return{messages:{...u.messages,[a]:m},messagesMeta:b,queuedMessageIds:h}}),(o=s.parts)!=null&&o.some(u=>yo(u)&&kc(u))&&wm(a,t().sessions)},updateMessagePart:(a,s,o)=>{e(u=>{const d=u.messages[a]??[],f=d.findIndex(v=>v.id===s),m=f>=0?d[f]:{id:s,role:"assistant"},h=m.parts?[...m.parts]:[],b=$x(o),g=b!=null?h.findIndex(v=>$x(v)===b):-1;g>=0?h[g]={...h[g],...o}:h.push(o);const y={...m,parts:h},N=f>=0?[...d]:[...d,y];return f>=0&&(N[f]=y),{messages:{...u.messages,[a]:N}}}),yo(o)&&kc(o)&&wm(a,t().sessions)},appendMessagePartDelta:(a,s,o,u)=>{e(d=>{const f=d.messages[a]??[],m=f.findIndex(v=>v.id===s),h=m>=0?f[m]:{id:s,role:"assistant"},b=h.parts?[...h.parts]:[],g=b.findIndex(v=>v.id===o);if(g>=0){const v=b[g],S=Cc(v)+u;b[g]=v.content!=null?{...v,content:S}:{...v,text:S}}else b.push({id:o,type:"text",text:u});const y={...h,parts:b},N=m>=0?[...f]:[...f,y];return m>=0&&(N[m]=y),{messages:{...d.messages,[a]:N}}})},updateTodos:(a,s)=>{e(o=>({todos:{...o.todos,[a]:s}}))},updateSessionInfo:a=>{e(s=>s.sessions.some(u=>u.id===a.id)?{sessions:s.sessions.map(u=>u.id===a.id?{...u,...a}:u)}:{sessions:[a,...s.sessions]})},setSessionStatus:(a,s,o)=>{const u=t().sessionStatuses[a];if(u!==s){const d=t().sessions.find(m=>m.id===a),f=(d==null?void 0:d.title)||a.slice(-8);if(s==="idle"&&u!==void 0&&u!=="idle")Ut.getState().removeToast(qy(a)),Ut.getState().addToast(`${f} — 完成`,"success",a);else if(s==="busy"&&(u===void 0||u==="idle"))Ut.getState().addToast(`${f} — 开始运行`,"info",a);else if(s==="retry")Ut.getState().addToast(`${f} — 进入重试`,"warning",a);else if(s==="error"){const m=o?`${f} — 错误: ${o}`:`${f} — 发生错误`;Ut.getState().addToast(m,"error",a)}}e(d=>{const f=o?{...d.errorReasons,[a]:o}:s!=="error"?(()=>{const{[a]:m,...h}=d.errorReasons;return h})():d.errorReasons;return{sessionStatuses:{...d.sessionStatuses,[a]:s},errorReasons:f}})},bulkSetStatuses:a=>{e({sessionStatuses:{...t().sessionStatuses,...a}})},renameSession:async(a,s)=>{const o=An();if(o){e(u=>({sessions:u.sessions.map(d=>d.id===a?{...d,title:s}:d)}));try{await pw(o,a,s)}catch{await t().loadSessions()}}},revertToMessage:async(a,s)=>{const o=An();if(!o)return!1;try{return await q5(o,a,s),await t().refreshSessionData(a),!0}catch{return!1}}})),Ve=Ja((e,t)=>({issues:[],tags:[],tagFilterMode:new Map,milestones:[],selectedMilestoneId:null,loaded:!1,syncing:!1,selectedIssueId:null,previewIssueId:null,matchingParentId:null,matchingCandidateId:null,pendingDraft:null,clearIssues:()=>e({issues:[],tags:[],tagFilterMode:new Map,milestones:[],selectedMilestoneId:null,loaded:!1,selectedIssueId:null,previewIssueId:null,matchingParentId:null,matchingCandidateId:null,pendingDraft:null}),setSelectedIssue:a=>e({selectedIssueId:a}),setPreviewIssue:a=>e({previewIssueId:a}),setPendingDraft:a=>e({pendingDraft:a}),enterMatchMode:a=>e({matchingParentId:a,matchingCandidateId:null,previewIssueId:null}),exitMatchMode:()=>{const a=t().matchingParentId;e({matchingParentId:null,matchingCandidateId:null,previewIssueId:a})},setMatchCandidate:a=>e({matchingCandidateId:a}),linkChild:async(a,s)=>{var u;const o=Be.getState().activeRepoId;if(!o)return!1;try{await sw(o,a,s);const d=(u=t().issues.find(f=>f.number===a))==null?void 0:u.id;return d&&e(f=>({issues:f.issues.map(m=>m.number===s?{...m,parentId:d}:m),matchingCandidateId:null})),!0}catch{return!1}},updateIssueState:async(a,s)=>{const o=Be.getState().activeRepoId;if(!o)return!1;try{const u=await By(o,a,{state:s});return e(d=>({issues:d.issues.map(f=>f.number===a?{...f,state:u.state}:f)})),!0}catch{return!1}},loadIssues:async()=>{const a=Be.getState().activeRepoId;if(!a){e({issues:[],loaded:!0});return}try{const s=await Ix(a,"all");e({issues:s,loaded:!0})}catch{e({loaded:!0})}},syncIssues:async()=>{const a=Be.getState().activeRepoId;if(a){e({syncing:!0});try{await aw(a,"open");const[s,o,u]=await Promise.all([Ix(a,"all"),Rx(a),Ox(a)]);e({issues:s,tags:o,milestones:u,syncing:!1})}catch(s){e({syncing:!1});let o="同步 Issue 失败";if(s instanceof Za)try{const u=JSON.parse(s.message);u.error&&(o=u.error)}catch{s.message&&(o=s.message)}Ut.getState().addToast(o,"error")}}},createIssue:async(a,s)=>{const o=Be.getState().activeRepoId;if(!o)return null;try{const u=await rw(o,a,s);return e(d=>({issues:[u,...d.issues]})),u}catch{return null}},loadTags:async()=>{const a=Be.getState().activeRepoId;if(!a){e({tags:[]});return}try{const s=await Rx(a);e({tags:s})}catch{}},cycleTagFilter:a=>{e(s=>{const o=new Map(s.tagFilterMode),u=o.get(a);return u?u==="include"?o.set(a,"exclude"):o.delete(a):o.set(a,"include"),{tagFilterMode:o}})},clearTagFilter:()=>e({tagFilterMode:new Map}),loadMilestones:async()=>{const a=Be.getState().activeRepoId;if(!a){e({milestones:[]});return}try{const s=await Ox(a);e({milestones:s})}catch{}},setMilestoneFilter:a=>e({selectedMilestoneId:a})})),gc=Ja(e=>({drafts:{},setDraft:(t,a)=>e(s=>{if(!a.trim()){const{[t]:o,...u}=s.drafts;return{drafts:u}}return{drafts:{...s.drafts,[t]:a}}}),clearDraft:t=>e(a=>{const{[t]:s,...o}=a.drafts;return{drafts:o}})}));function Yx(e){const t=[],a=String(e||"");let s=a.indexOf(","),o=0,u=!1;for(;!u;){s===-1&&(s=a.length,u=!0);const d=a.slice(o,s).trim();(d||!u)&&t.push(d),o=s+1,s=a.indexOf(",",o)}return t}function Yy(e,t){const a={};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const eC=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tC=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nC={};function Gx(e,t){return(nC.jsx?tC:eC).test(e)}const aC=/[ \t\n\f\r]/g;function rC(e){return typeof e=="object"?e.type==="text"?Kx(e.value):!1:Kx(e)}function Kx(e){return e.replace(aC,"")===""}class Ro{constructor(t,a,s){this.normal=a,this.property=t,s&&(this.space=s)}}Ro.prototype.normal={};Ro.prototype.property={};Ro.prototype.space=void 0;function Gy(e,t){const a={},s={};for(const o of e)Object.assign(a,o.property),Object.assign(s,o.normal);return new Ro(a,s,t)}function To(e){return e.toLowerCase()}class na{constructor(t,a){this.attribute=a,this.property=t}}na.prototype.attribute="";na.prototype.booleanish=!1;na.prototype.boolean=!1;na.prototype.commaOrSpaceSeparated=!1;na.prototype.commaSeparated=!1;na.prototype.defined=!1;na.prototype.mustUseProperty=!1;na.prototype.number=!1;na.prototype.overloadedBoolean=!1;na.prototype.property="";na.prototype.spaceSeparated=!1;na.prototype.space=void 0;let sC=0;const Xe=Ks(),cn=Ks(),gh=Ks(),ve=Ks(),It=Ks(),zs=Ks(),ma=Ks();function Ks(){return 2**++sC}const bh=Object.freeze(Object.defineProperty({__proto__:null,boolean:Xe,booleanish:cn,commaOrSpaceSeparated:ma,commaSeparated:zs,number:ve,overloadedBoolean:gh,spaceSeparated:It},Symbol.toStringTag,{value:"Module"})),Cm=Object.keys(bh);class tp extends na{constructor(t,a,s,o){let u=-1;if(super(t,a),Vx(this,"space",o),typeof s=="number")for(;++u<Cm.length;){const d=Cm[u];Vx(this,Cm[u],(s&bh[d])===bh[d])}}}tp.prototype.defined=!0;function Vx(e,t,a){a&&(e[t]=a)}function Wi(e){const t={},a={};for(const[s,o]of Object.entries(e.properties)){const u=new tp(s,e.transform(e.attributes||{},s),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(u.mustUseProperty=!0),t[s]=u,a[To(s)]=s,a[To(u.attribute)]=s}return new Ro(t,a,e.space)}const Ky=Wi({properties:{ariaActiveDescendant:null,ariaAtomic:cn,ariaAutoComplete:null,ariaBusy:cn,ariaChecked:cn,ariaColCount:ve,ariaColIndex:ve,ariaColSpan:ve,ariaControls:It,ariaCurrent:null,ariaDescribedBy:It,ariaDetails:null,ariaDisabled:cn,ariaDropEffect:It,ariaErrorMessage:null,ariaExpanded:cn,ariaFlowTo:It,ariaGrabbed:cn,ariaHasPopup:null,ariaHidden:cn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:It,ariaLevel:ve,ariaLive:null,ariaModal:cn,ariaMultiLine:cn,ariaMultiSelectable:cn,ariaOrientation:null,ariaOwns:It,ariaPlaceholder:null,ariaPosInSet:ve,ariaPressed:cn,ariaReadOnly:cn,ariaRelevant:null,ariaRequired:cn,ariaRoleDescription:It,ariaRowCount:ve,ariaRowIndex:ve,ariaRowSpan:ve,ariaSelected:cn,ariaSetSize:ve,ariaSort:null,ariaValueMax:ve,ariaValueMin:ve,ariaValueNow:ve,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Vy(e,t){return t in e?e[t]:t}function Xy(e,t){return Vy(e,t.toLowerCase())}const iC=Wi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:zs,acceptCharset:It,accessKey:It,action:null,allow:null,allowFullScreen:Xe,allowPaymentRequest:Xe,allowUserMedia:Xe,alpha:Xe,alt:null,as:null,async:Xe,autoCapitalize:null,autoComplete:It,autoFocus:Xe,autoPlay:Xe,blocking:It,capture:null,charSet:null,checked:Xe,cite:null,className:It,closedBy:null,colorSpace:null,cols:ve,colSpan:ve,command:null,commandFor:null,content:null,contentEditable:cn,controls:Xe,controlsList:It,coords:ve|zs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Xe,defer:Xe,dir:null,dirName:null,disabled:Xe,download:gh,draggable:cn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Xe,formTarget:null,headers:It,height:ve,hidden:gh,high:ve,href:null,hrefLang:null,htmlFor:It,httpEquiv:It,id:null,imageSizes:null,imageSrcSet:null,inert:Xe,inputMode:null,integrity:null,is:null,isMap:Xe,itemId:null,itemProp:It,itemRef:It,itemScope:Xe,itemType:It,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Xe,low:ve,manifest:null,max:null,maxLength:ve,media:null,method:null,min:null,minLength:ve,multiple:Xe,muted:Xe,name:null,nonce:null,noModule:Xe,noValidate:Xe,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:Xe,optimum:ve,pattern:null,ping:It,placeholder:null,playsInline:Xe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Xe,referrerPolicy:null,rel:It,required:Xe,reversed:Xe,rows:ve,rowSpan:ve,sandbox:It,scope:null,scoped:Xe,seamless:Xe,selected:Xe,shadowRootClonable:Xe,shadowRootCustomElementRegistry:Xe,shadowRootDelegatesFocus:Xe,shadowRootMode:null,shadowRootSerializable:Xe,shape:null,size:ve,sizes:null,slot:null,span:ve,spellCheck:cn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ve,step:null,style:null,tabIndex:ve,target:null,title:null,translate:null,type:null,typeMustMatch:Xe,useMap:null,value:cn,width:ve,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:It,axis:null,background:null,bgColor:null,border:ve,borderColor:null,bottomMargin:ve,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Xe,declare:Xe,event:null,face:null,frame:null,frameBorder:null,hSpace:ve,leftMargin:ve,link:null,longDesc:null,lowSrc:null,marginHeight:ve,marginWidth:ve,noResize:Xe,noHref:Xe,noShade:Xe,noWrap:Xe,object:null,profile:null,prompt:null,rev:null,rightMargin:ve,rules:null,scheme:null,scrolling:cn,standby:null,summary:null,text:null,topMargin:ve,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ve,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Xe,disablePictureInPicture:Xe,disableRemotePlayback:Xe,exportParts:zs,part:It,prefix:null,property:null,results:ve,security:null,unselectable:null},space:"html",transform:Xy}),lC=Wi({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",maskType:"mask-type",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:ma,accentHeight:ve,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ve,amplitude:ve,arabicForm:null,ascent:ve,attributeName:null,attributeType:null,azimuth:ve,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ve,by:null,calcMode:null,capHeight:ve,className:It,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:ve,diffuseConstant:ve,direction:null,display:null,dur:null,divisor:ve,dominantBaseline:null,download:Xe,dx:null,dy:null,edgeMode:null,editable:null,elevation:ve,enableBackground:null,end:null,event:null,exponent:ve,externalResourcesRequired:null,fill:null,fillOpacity:ve,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:zs,g2:zs,glyphName:zs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ve,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ve,horizOriginX:ve,horizOriginY:ve,id:null,ideographic:ve,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ve,k:ve,k1:ve,k2:ve,k3:ve,k4:ve,kernelMatrix:ma,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ve,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ve,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:ve,overlineThickness:ve,paintOrder:null,panose1:null,path:null,pathLength:ve,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:It,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ve,pointsAtY:ve,pointsAtZ:ve,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ma,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ma,rev:ma,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ma,requiredFeatures:ma,requiredFonts:ma,requiredFormats:ma,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:ve,specularExponent:ve,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ve,strikethroughThickness:ve,string:null,stroke:null,strokeDashArray:ma,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ve,strokeOpacity:ve,strokeWidth:null,style:null,surfaceScale:ve,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ma,tabIndex:ve,tableValues:null,target:null,targetX:ve,targetY:ve,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ma,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ve,underlineThickness:ve,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ve,values:null,vAlphabetic:ve,vMathematical:ve,vectorEffect:null,vHanging:ve,vIdeographic:ve,version:null,vertAdvY:ve,vertOriginX:ve,vertOriginY:ve,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ve,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Vy}),Qy=Wi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Wy=Wi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Xy}),Zy=Wi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),oC={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"},uC=/[A-Z]/g,Xx=/-[a-z]/g,cC=/^data[-\w.:]+$/i;function ed(e,t){const a=To(t);let s=t,o=na;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&cC.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(Xx,fC);s="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!Xx.test(u)){let d=u.replace(uC,dC);d.charAt(0)!=="-"&&(d="-"+d),t="data"+d}}o=tp}return new o(s,t)}function dC(e){return"-"+e.toLowerCase()}function fC(e){return e.charAt(1).toUpperCase()}const Oo=Gy([Ky,iC,Qy,Wy,Zy],"html"),ms=Gy([Ky,lC,Qy,Wy,Zy],"svg");function Qx(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Jy(e){return e.join(" ").trim()}var Di={},km,Wx;function mC(){if(Wx)return km;Wx=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,a=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
468
+ `,h="/",b="*",g="",y="comment",N="declaration";function v(w,A){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];A=A||{};var R=1,I=1;function Y(q){var F=q.match(t);F&&(R+=F.length);var D=q.lastIndexOf(m);I=~D?q.length-D:I+q.length}function B(){var q={line:R,column:I};return function(F){return F.position=new C(q),Q(),F}}function C(q){this.start=q,this.end={line:R,column:I},this.source=A.source}C.prototype.content=w;function z(q){var F=new Error(A.source+":"+R+":"+I+": "+q);if(F.reason=q,F.filename=A.source,F.line=R,F.column=I,F.source=w,!A.silent)throw F}function W(q){var F=q.exec(w);if(F){var D=F[0];return Y(D),w=w.slice(D.length),F}}function Q(){W(a)}function j(q){var F;for(q=q||[];F=ee();)F!==!1&&q.push(F);return q}function ee(){var q=B();if(!(h!=w.charAt(0)||b!=w.charAt(1))){for(var F=2;g!=w.charAt(F)&&(b!=w.charAt(F)||h!=w.charAt(F+1));)++F;if(F+=2,g===w.charAt(F-1))return z("End of comment missing");var D=w.slice(2,F-2);return I+=2,Y(D),w=w.slice(F),I+=2,q({type:y,comment:D})}}function ue(){var q=B(),F=W(s);if(F){if(ee(),!W(o))return z("property missing ':'");var D=W(u),P=q({type:N,property:S(F[0].replace(e,g)),value:D?S(D[0].replace(e,g)):g});return W(d),P}}function Z(){var q=[];j(q);for(var F;F=ue();)F!==!1&&(q.push(F),j(q));return q}return Q(),Z()}function S(w){return w?w.replace(f,g):g}return km=v,km}var Zx;function hC(){if(Zx)return Di;Zx=1;var e=Di&&Di.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Di,"__esModule",{value:!0}),Di.default=a;const t=e(mC());function a(s,o){let u=null;if(!s||typeof s!="string")return u;const d=(0,t.default)(s),f=typeof o=="function";return d.forEach(m=>{if(m.type!=="declaration")return;const{property:h,value:b}=m;f?o(h,b,m):b&&(u=u||{},u[h]=b)}),u}return Di}var Zl={},Jx;function pC(){if(Jx)return Zl;Jx=1,Object.defineProperty(Zl,"__esModule",{value:!0}),Zl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,a=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,u=function(h){return!h||a.test(h)||e.test(h)},d=function(h,b){return b.toUpperCase()},f=function(h,b){return"".concat(b,"-")},m=function(h,b){return b===void 0&&(b={}),u(h)?h:(h=h.toLowerCase(),b.reactCompat?h=h.replace(o,f):h=h.replace(s,f),h.replace(t,d))};return Zl.camelCase=m,Zl}var Jl,e1;function gC(){if(e1)return Jl;e1=1;var e=Jl&&Jl.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(hC()),a=pC();function s(o,u){var d={};return!o||typeof o!="string"||(0,t.default)(o,function(f,m){f&&m&&(d[(0,a.camelCase)(f,u)]=m)}),d}return s.default=s,Jl=s,Jl}var bC=gC();const xC=Fc(bC),td=eN("end"),er=eN("start");function eN(e){return t;function t(a){const s=a&&a.position&&a.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function EC(e){const t=er(e),a=td(e);if(t&&a)return{start:t,end:a}}function lo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?t1(e.position):"start"in e||"end"in e?t1(e):"line"in e||"column"in e?xh(e):""}function xh(e){return n1(e&&e.line)+":"+n1(e&&e.column)}function t1(e){return xh(e&&e.start)+"-"+xh(e&&e.end)}function n1(e){return e&&typeof e=="number"?e:1}class Rn extends Error{constructor(t,a,s){super(),typeof a=="string"&&(s=a,a=void 0);let o="",u={},d=!1;if(a&&("line"in a&&"column"in a?u={place:a}:"start"in a&&"end"in a?u={place:a}:"type"in a?u={ancestors:[a],place:a.position}:u={...a}),typeof t=="string"?o=t:!u.cause&&t&&(d=!0,o=t.message,u.cause=t),!u.ruleId&&!u.source&&typeof s=="string"){const m=s.indexOf(":");m===-1?u.ruleId=s:(u.source=s.slice(0,m),u.ruleId=s.slice(m+1))}if(!u.place&&u.ancestors&&u.ancestors){const m=u.ancestors[u.ancestors.length-1];m&&(u.place=m.position)}const f=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=f?f.line:void 0,this.name=lo(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=d&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Rn.prototype.file="";Rn.prototype.name="";Rn.prototype.reason="";Rn.prototype.message="";Rn.prototype.stack="";Rn.prototype.column=void 0;Rn.prototype.line=void 0;Rn.prototype.ancestors=void 0;Rn.prototype.cause=void 0;Rn.prototype.fatal=void 0;Rn.prototype.place=void 0;Rn.prototype.ruleId=void 0;Rn.prototype.source=void 0;const np={}.hasOwnProperty,yC=new Map,NC=/[A-Z]/g,TC=new Set(["table","tbody","thead","tfoot","tr"]),_C=new Set(["td","th"]),tN="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function vC(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=t.filePath||void 0;let s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=IC(a,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=OC(a,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ms:Oo,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},u=nN(o,e,void 0);return u&&typeof u!="string"?u:o.create(e,o.Fragment,{children:u||void 0},void 0)}function nN(e,t,a){if(t.type==="element")return SC(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return AC(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return CC(e,t,a);if(t.type==="mdxjsEsm")return wC(e,t);if(t.type==="root")return kC(e,t,a);if(t.type==="text")return RC(e,t)}function SC(e,t,a){const s=e.schema;let o=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(o=ms,e.schema=o),e.ancestors.push(t);const u=rN(e,t.tagName,!1),d=MC(e,t);let f=rp(e,t);return TC.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!rC(m):!0})),aN(e,d,u,t),ap(d,f),e.ancestors.pop(),e.schema=s,e.create(t,u,d,a)}function AC(e,t){if(t.data&&t.data.estree&&e.evaluater){const s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}_o(e,t.position)}function wC(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);_o(e,t.position)}function CC(e,t,a){const s=e.schema;let o=s;t.name==="svg"&&s.space==="html"&&(o=ms,e.schema=o),e.ancestors.push(t);const u=t.name===null?e.Fragment:rN(e,t.name,!0),d=DC(e,t),f=rp(e,t);return aN(e,d,u,t),ap(d,f),e.ancestors.pop(),e.schema=s,e.create(t,u,d,a)}function kC(e,t,a){const s={};return ap(s,rp(e,t)),e.create(t,e.Fragment,s,a)}function RC(e,t){return t.value}function aN(e,t,a,s){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(t.node=s)}function ap(e,t){if(t.length>0){const a=t.length>1?t:t[0];a&&(e.children=a)}}function OC(e,t,a){return s;function s(o,u,d,f){const h=Array.isArray(d.children)?a:t;return f?h(u,d,f):h(u,d)}}function IC(e,t){return a;function a(s,o,u,d){const f=Array.isArray(u.children),m=er(s);return t(o,u,d,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function MC(e,t){const a={};let s,o;for(o in t.properties)if(o!=="children"&&np.call(t.properties,o)){const u=LC(e,o,t.properties[o]);if(u){const[d,f]=u;e.tableCellAlignToStyle&&d==="align"&&typeof f=="string"&&_C.has(t.tagName)?s=f:a[d]=f}}if(s){const u=a.style||(a.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return a}function DC(e,t){const a={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const u=s.data.estree.body[0];u.type;const d=u.expression;d.type;const f=d.properties[0];f.type,Object.assign(a,e.evaluater.evaluateExpression(f.argument))}else _o(e,t.position);else{const o=s.name;let u;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const f=s.value.data.estree.body[0];f.type,u=e.evaluater.evaluateExpression(f.expression)}else _o(e,t.position);else u=s.value===null?!0:s.value;a[o]=u}return a}function rp(e,t){const a=[];let s=-1;const o=e.passKeys?new Map:yC;for(;++s<t.children.length;){const u=t.children[s];let d;if(e.passKeys){const m=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(m){const h=o.get(m)||0;d=m+"-"+h,o.set(m,h+1)}}const f=nN(e,u,d);f!==void 0&&a.push(f)}return a}function LC(e,t,a){const s=ed(e.schema,t);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=s.commaSeparated?Yy(a):Jy(a)),s.property==="style"){let o=typeof a=="object"?a:jC(e,String(a));return e.stylePropertyNameCase==="css"&&(o=BC(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&s.space?oC[s.property]||s.property:s.attribute,a]}}function jC(e,t){try{return xC(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const s=a,o=new Rn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=tN+"#cannot-parse-style-attribute",o}}function rN(e,t,a){let s;if(!a)s={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let u=-1,d;for(;++u<o.length;){const f=Gx(o[u])?{type:"Identifier",name:o[u]}:{type:"Literal",value:o[u]};d=d?{type:"MemberExpression",object:d,property:f,computed:!!(u&&f.type==="Literal"),optional:!1}:f}s=d}else s=Gx(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const o=s.value;return np.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(s);_o(e)}function _o(e,t){const a=new Rn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=tN+"#cannot-handle-mdx-estrees-without-createevaluater",a}function BC(e){const t={};let a;for(a in e)np.call(e,a)&&(t[PC(a)]=e[a]);return t}function PC(e){let t=e.replace(NC,UC);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function UC(e){return"-"+e.toLowerCase()}const Rm={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"]},HC={};function sp(e,t){const a=HC,s=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,o=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return sN(e,s,o)}function sN(e,t,a){if(FC(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return a1(e.children,t,a)}return Array.isArray(e)?a1(e,t,a):""}function a1(e,t,a){const s=[];let o=-1;for(;++o<e.length;)s[o]=sN(e[o],t,a);return s.join("")}function FC(e){return!!(e&&typeof e=="object")}const r1=document.createElement("i");function ip(e){const t="&"+e+";";r1.innerHTML=t;const a=r1.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===t?!1:a}function ha(e,t,a,s){const o=e.length;let u=0,d;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,a=a>0?a:0,s.length<1e4)d=Array.from(s),d.unshift(t,a),e.splice(...d);else for(a&&e.splice(t,a);u<s.length;)d=s.slice(u,u+1e4),d.unshift(t,0),e.splice(...d),u+=1e4,t+=1e4}function wa(e,t){return e.length>0?(ha(e,e.length,0,t),e):t}const s1={}.hasOwnProperty;function iN(e){const t={};let a=-1;for(;++a<e.length;)zC(t,e[a]);return t}function zC(e,t){let a;for(a in t){const o=(s1.call(e,a)?e[a]:void 0)||(e[a]={}),u=t[a];let d;if(u)for(d in u){s1.call(o,d)||(o[d]=[]);const f=u[d];$C(o[d],Array.isArray(f)?f:f?[f]:[])}}}function $C(e,t){let a=-1;const s=[];for(;++a<t.length;)(t[a].add==="after"?e:s).push(t[a]);ha(e,0,0,s)}function lN(e,t){const a=Number.parseInt(e,t);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function Pa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Bn=hs(/[A-Za-z]/),wn=hs(/[\dA-Za-z]/),qC=hs(/[#-'*+\--9=?A-Z^-~]/);function Oc(e){return e!==null&&(e<32||e===127)}const Eh=hs(/\d/),YC=hs(/[\dA-Fa-f]/),GC=hs(/[!-/:-@[-`{-~]/);function ze(e){return e!==null&&e<-2}function Mt(e){return e!==null&&(e<0||e===32)}function lt(e){return e===-2||e===-1||e===32}const nd=hs(new RegExp("\\p{P}|\\p{S}","u")),Ys=hs(/\s/);function hs(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function Zi(e){const t=[];let a=-1,s=0,o=0;for(;++a<e.length;){const u=e.charCodeAt(a);let d="";if(u===37&&wn(e.charCodeAt(a+1))&&wn(e.charCodeAt(a+2)))o=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(d=String.fromCharCode(u));else if(u>55295&&u<57344){const f=e.charCodeAt(a+1);u<56320&&f>56319&&f<57344?(d=String.fromCharCode(u,f),o=1):d="�"}else d=String.fromCharCode(u);d&&(t.push(e.slice(s,a),encodeURIComponent(d)),s=a+o+1,d=""),o&&(a+=o,o=0)}return t.join("")+e.slice(s)}function ft(e,t,a,s){const o=s?s-1:Number.POSITIVE_INFINITY;let u=0;return d;function d(m){return lt(m)?(e.enter(a),f(m)):t(m)}function f(m){return lt(m)&&u++<o?(e.consume(m),f):(e.exit(a),t(m))}}const KC={tokenize:VC};function VC(e){const t=e.attempt(this.parser.constructs.contentInitial,s,o);let a;return t;function s(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),ft(e,t,"linePrefix")}function o(f){return e.enter("paragraph"),u(f)}function u(f){const m=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=m),a=m,d(f)}function d(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return ze(f)?(e.consume(f),e.exit("chunkText"),u):(e.consume(f),d)}}const XC={tokenize:QC},i1={tokenize:WC};function QC(e){const t=this,a=[];let s=0,o,u,d;return f;function f(I){if(s<a.length){const Y=a[s];return t.containerState=Y[1],e.attempt(Y[0].continuation,m,h)(I)}return h(I)}function m(I){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&R();const Y=t.events.length;let B=Y,C;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){C=t.events[B][1].end;break}A(s);let z=Y;for(;z<t.events.length;)t.events[z][1].end={...C},z++;return ha(t.events,B+1,0,t.events.slice(Y)),t.events.length=z,h(I)}return f(I)}function h(I){if(s===a.length){if(!o)return y(I);if(o.currentConstruct&&o.currentConstruct.concrete)return v(I);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(i1,b,g)(I)}function b(I){return o&&R(),A(s),y(I)}function g(I){return t.parser.lazy[t.now().line]=s!==a.length,d=t.now().offset,v(I)}function y(I){return t.containerState={},e.attempt(i1,N,v)(I)}function N(I){return s++,a.push([t.currentConstruct,t.containerState]),y(I)}function v(I){if(I===null){o&&R(),A(0),e.consume(I);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:u}),S(I)}function S(I){if(I===null){w(e.exit("chunkFlow"),!0),A(0),e.consume(I);return}return ze(I)?(e.consume(I),w(e.exit("chunkFlow")),s=0,t.interrupt=void 0,f):(e.consume(I),S)}function w(I,Y){const B=t.sliceStream(I);if(Y&&B.push(null),I.previous=u,u&&(u.next=I),u=I,o.defineSkip(I.start),o.write(B),t.parser.lazy[I.start.line]){let C=o.events.length;for(;C--;)if(o.events[C][1].start.offset<d&&(!o.events[C][1].end||o.events[C][1].end.offset>d))return;const z=t.events.length;let W=z,Q,j;for(;W--;)if(t.events[W][0]==="exit"&&t.events[W][1].type==="chunkFlow"){if(Q){j=t.events[W][1].end;break}Q=!0}for(A(s),C=z;C<t.events.length;)t.events[C][1].end={...j},C++;ha(t.events,W+1,0,t.events.slice(z)),t.events.length=C}}function A(I){let Y=a.length;for(;Y-- >I;){const B=a[Y];t.containerState=B[1],B[0].exit.call(t,e)}a.length=I}function R(){o.write([null]),u=void 0,o=void 0,t.containerState._closeFlow=void 0}}function WC(e,t,a){return ft(e,e.attempt(this.parser.constructs.document,t,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function qi(e){if(e===null||Mt(e)||Ys(e))return 1;if(nd(e))return 2}function ad(e,t,a){const s=[];let o=-1;for(;++o<e.length;){const u=e[o].resolveAll;u&&!s.includes(u)&&(t=u(t,a),s.push(u))}return t}const yh={name:"attention",resolveAll:ZC,tokenize:JC};function ZC(e,t){let a=-1,s,o,u,d,f,m,h,b;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(s=a;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&t.sliceSerialize(e[s][1]).charCodeAt(0)===t.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[s][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;m=e[s][1].end.offset-e[s][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;const g={...e[s][1].end},y={...e[a][1].start};l1(g,-m),l1(y,m),d={type:m>1?"strongSequence":"emphasisSequence",start:g,end:{...e[s][1].end}},f={type:m>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:y},u={type:m>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[a][1].start}},o={type:m>1?"strong":"emphasis",start:{...d.start},end:{...f.end}},e[s][1].end={...d.start},e[a][1].start={...f.end},h=[],e[s][1].end.offset-e[s][1].start.offset&&(h=wa(h,[["enter",e[s][1],t],["exit",e[s][1],t]])),h=wa(h,[["enter",o,t],["enter",d,t],["exit",d,t],["enter",u,t]]),h=wa(h,ad(t.parser.constructs.insideSpan.null,e.slice(s+1,a),t)),h=wa(h,[["exit",u,t],["enter",f,t],["exit",f,t],["exit",o,t]]),e[a][1].end.offset-e[a][1].start.offset?(b=2,h=wa(h,[["enter",e[a][1],t],["exit",e[a][1],t]])):b=0,ha(e,s-1,a-s+3,h),a=s+h.length-b-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function JC(e,t){const a=this.parser.constructs.attentionMarkers.null,s=this.previous,o=qi(s);let u;return d;function d(m){return u=m,e.enter("attentionSequence"),f(m)}function f(m){if(m===u)return e.consume(m),f;const h=e.exit("attentionSequence"),b=qi(m),g=!b||b===2&&o||a.includes(m),y=!o||o===2&&b||a.includes(s);return h._open=!!(u===42?g:g&&(o||!y)),h._close=!!(u===42?y:y&&(b||!g)),t(m)}}function l1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const ek={name:"autolink",tokenize:tk};function tk(e,t,a){let s=0;return o;function o(N){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(N),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(N){return Bn(N)?(e.consume(N),d):N===64?a(N):h(N)}function d(N){return N===43||N===45||N===46||wn(N)?(s=1,f(N)):h(N)}function f(N){return N===58?(e.consume(N),s=0,m):(N===43||N===45||N===46||wn(N))&&s++<32?(e.consume(N),f):(s=0,h(N))}function m(N){return N===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(N),e.exit("autolinkMarker"),e.exit("autolink"),t):N===null||N===32||N===60||Oc(N)?a(N):(e.consume(N),m)}function h(N){return N===64?(e.consume(N),b):qC(N)?(e.consume(N),h):a(N)}function b(N){return wn(N)?g(N):a(N)}function g(N){return N===46?(e.consume(N),s=0,b):N===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(N),e.exit("autolinkMarker"),e.exit("autolink"),t):y(N)}function y(N){if((N===45||wn(N))&&s++<63){const v=N===45?y:g;return e.consume(N),v}return a(N)}}const Io={partial:!0,tokenize:nk};function nk(e,t,a){return s;function s(u){return lt(u)?ft(e,o,"linePrefix")(u):o(u)}function o(u){return u===null||ze(u)?t(u):a(u)}}const oN={continuation:{tokenize:rk},exit:sk,name:"blockQuote",tokenize:ak};function ak(e,t,a){const s=this;return o;function o(d){if(d===62){const f=s.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),u}return a(d)}function u(d){return lt(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(d))}}function rk(e,t,a){const s=this;return o;function o(d){return lt(d)?ft(e,u,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):u(d)}function u(d){return e.attempt(oN,t,a)(d)}}function sk(e){e.exit("blockQuote")}const uN={name:"characterEscape",tokenize:ik};function ik(e,t,a){return s;function s(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),o}function o(u){return GC(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):a(u)}}const cN={name:"characterReference",tokenize:lk};function lk(e,t,a){const s=this;let o=0,u,d;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),m}function m(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),u=31,d=wn,b(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,d=YC,b):(e.enter("characterReferenceValue"),u=7,d=Eh,b(g))}function b(g){if(g===59&&o){const y=e.exit("characterReferenceValue");return d===wn&&!ip(s.sliceSerialize(y))?a(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return d(g)&&o++<u?(e.consume(g),b):a(g)}}const o1={partial:!0,tokenize:uk},u1={concrete:!0,name:"codeFenced",tokenize:ok};function ok(e,t,a){const s=this,o={partial:!0,tokenize:B};let u=0,d=0,f;return m;function m(C){return h(C)}function h(C){const z=s.events[s.events.length-1];return u=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,f=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),b(C)}function b(C){return C===f?(d++,e.consume(C),b):d<3?a(C):(e.exit("codeFencedFenceSequence"),lt(C)?ft(e,g,"whitespace")(C):g(C))}function g(C){return C===null||ze(C)?(e.exit("codeFencedFence"),s.interrupt?t(C):e.check(o1,S,Y)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(C))}function y(C){return C===null||ze(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(C)):lt(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ft(e,N,"whitespace")(C)):C===96&&C===f?a(C):(e.consume(C),y)}function N(C){return C===null||ze(C)?g(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(C))}function v(C){return C===null||ze(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(C)):C===96&&C===f?a(C):(e.consume(C),v)}function S(C){return e.attempt(o,Y,w)(C)}function w(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),A}function A(C){return u>0&&lt(C)?ft(e,R,"linePrefix",u+1)(C):R(C)}function R(C){return C===null||ze(C)?e.check(o1,S,Y)(C):(e.enter("codeFlowValue"),I(C))}function I(C){return C===null||ze(C)?(e.exit("codeFlowValue"),R(C)):(e.consume(C),I)}function Y(C){return e.exit("codeFenced"),t(C)}function B(C,z,W){let Q=0;return j;function j(F){return C.enter("lineEnding"),C.consume(F),C.exit("lineEnding"),ee}function ee(F){return C.enter("codeFencedFence"),lt(F)?ft(C,ue,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):ue(F)}function ue(F){return F===f?(C.enter("codeFencedFenceSequence"),Z(F)):W(F)}function Z(F){return F===f?(Q++,C.consume(F),Z):Q>=d?(C.exit("codeFencedFenceSequence"),lt(F)?ft(C,q,"whitespace")(F):q(F)):W(F)}function q(F){return F===null||ze(F)?(C.exit("codeFencedFence"),z(F)):W(F)}}}function uk(e,t,a){const s=this;return o;function o(d){return d===null?a(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u)}function u(d){return s.parser.lazy[s.now().line]?a(d):t(d)}}const Om={name:"codeIndented",tokenize:dk},ck={partial:!0,tokenize:fk};function dk(e,t,a){const s=this;return o;function o(h){return e.enter("codeIndented"),ft(e,u,"linePrefix",5)(h)}function u(h){const b=s.events[s.events.length-1];return b&&b[1].type==="linePrefix"&&b[2].sliceSerialize(b[1],!0).length>=4?d(h):a(h)}function d(h){return h===null?m(h):ze(h)?e.attempt(ck,d,m)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||ze(h)?(e.exit("codeFlowValue"),d(h)):(e.consume(h),f)}function m(h){return e.exit("codeIndented"),t(h)}}function fk(e,t,a){const s=this;return o;function o(d){return s.parser.lazy[s.now().line]?a(d):ze(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),o):ft(e,u,"linePrefix",5)(d)}function u(d){const f=s.events[s.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(d):ze(d)?o(d):a(d)}}const mk={name:"codeText",previous:pk,resolve:hk,tokenize:gk};function hk(e){let t=e.length-4,a=3,s,o;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=a;++s<t;)if(e[s][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[t][1].type="codeTextPadding",a+=2,t-=2;break}}for(s=a-1,t++;++s<=t;)o===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(o=s):(s===t||e[s][1].type==="lineEnding")&&(e[o][1].type="codeTextData",s!==o+2&&(e[o][1].end=e[s-1][1].end,e.splice(o+2,s-o-2),t-=s-o-2,s=o+2),o=void 0);return e}function pk(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function gk(e,t,a){let s=0,o,u;return d;function d(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),s++,f):(e.exit("codeTextSequence"),m(g))}function m(g){return g===null?a(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),m):g===96?(u=e.enter("codeTextSequence"),o=0,b(g)):ze(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),m):(e.enter("codeTextData"),h(g))}function h(g){return g===null||g===32||g===96||ze(g)?(e.exit("codeTextData"),m(g)):(e.consume(g),h)}function b(g){return g===96?(e.consume(g),o++,b):o===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(u.type="codeTextData",h(g))}}class bk{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,a){const s=a??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(t,s):t>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,a,s){const o=a||0;this.setCursor(Math.trunc(t));const u=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return s&&eo(this.left,s),u.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),eo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),eo(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const a=this.left.splice(t,Number.POSITIVE_INFINITY);eo(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);eo(this.left,a.reverse())}}}function eo(e,t){let a=0;if(t.length<1e4)e.push(...t);else for(;a<t.length;)e.push(...t.slice(a,a+1e4)),a+=1e4}function dN(e){const t={};let a=-1,s,o,u,d,f,m,h;const b=new bk(e);for(;++a<b.length;){for(;a in t;)a=t[a];if(s=b.get(a),a&&s[1].type==="chunkFlow"&&b.get(a-1)[1].type==="listItemPrefix"&&(m=s[1]._tokenizer.events,u=0,u<m.length&&m[u][1].type==="lineEndingBlank"&&(u+=2),u<m.length&&m[u][1].type==="content"))for(;++u<m.length&&m[u][1].type!=="content";)m[u][1].type==="chunkText"&&(m[u][1]._isInFirstContentOfListItem=!0,u++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,xk(b,a)),a=t[a],h=!0);else if(s[1]._container){for(u=a,o=void 0;u--;)if(d=b.get(u),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(o&&(b.get(o)[1].type="lineEndingBlank"),d[1].type="lineEnding",o=u);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;o&&(s[1].end={...b.get(o)[1].start},f=b.slice(o,a),f.unshift(s),b.splice(o,a-o+1,f))}}return ha(e,0,Number.POSITIVE_INFINITY,b.slice(0)),!h}function xk(e,t){const a=e.get(t)[1],s=e.get(t)[2];let o=t-1;const u=[];let d=a._tokenizer;d||(d=s.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const f=d.events,m=[],h={};let b,g,y=-1,N=a,v=0,S=0;const w=[S];for(;N;){for(;e.get(++o)[1]!==N;);u.push(o),N._tokenizer||(b=s.sliceStream(N),N.next||b.push(null),g&&d.defineSkip(N.start),N._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(b),N._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),g=N,N=N.next}for(N=a;++y<f.length;)f[y][0]==="exit"&&f[y-1][0]==="enter"&&f[y][1].type===f[y-1][1].type&&f[y][1].start.line!==f[y][1].end.line&&(S=y+1,w.push(S),N._tokenizer=void 0,N.previous=void 0,N=N.next);for(d.events=[],N?(N._tokenizer=void 0,N.previous=void 0):w.pop(),y=w.length;y--;){const A=f.slice(w[y],w[y+1]),R=u.pop();m.push([R,R+A.length-1]),e.splice(R,2,A)}for(m.reverse(),y=-1;++y<m.length;)h[v+m[y][0]]=v+m[y][1],v+=m[y][1]-m[y][0]-1;return h}const Ek={resolve:Nk,tokenize:Tk},yk={partial:!0,tokenize:_k};function Nk(e){return dN(e),e}function Tk(e,t){let a;return s;function s(f){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),o(f)}function o(f){return f===null?u(f):ze(f)?e.check(yk,d,u)(f):(e.consume(f),o)}function u(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function d(f){return e.consume(f),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,o}}function _k(e,t,a){const s=this;return o;function o(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),ft(e,u,"linePrefix")}function u(d){if(d===null||ze(d))return a(d);const f=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(d):e.interrupt(s.parser.constructs.flow,a,t)(d)}}function fN(e,t,a,s,o,u,d,f,m){const h=m||Number.POSITIVE_INFINITY;let b=0;return g;function g(A){return A===60?(e.enter(s),e.enter(o),e.enter(u),e.consume(A),e.exit(u),y):A===null||A===32||A===41||Oc(A)?a(A):(e.enter(s),e.enter(d),e.enter(f),e.enter("chunkString",{contentType:"string"}),S(A))}function y(A){return A===62?(e.enter(u),e.consume(A),e.exit(u),e.exit(o),e.exit(s),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),N(A))}function N(A){return A===62?(e.exit("chunkString"),e.exit(f),y(A)):A===null||A===60||ze(A)?a(A):(e.consume(A),A===92?v:N)}function v(A){return A===60||A===62||A===92?(e.consume(A),N):N(A)}function S(A){return!b&&(A===null||A===41||Mt(A))?(e.exit("chunkString"),e.exit(f),e.exit(d),e.exit(s),t(A)):b<h&&A===40?(e.consume(A),b++,S):A===41?(e.consume(A),b--,S):A===null||A===32||A===40||Oc(A)?a(A):(e.consume(A),A===92?w:S)}function w(A){return A===40||A===41||A===92?(e.consume(A),S):S(A)}}function mN(e,t,a,s,o,u){const d=this;let f=0,m;return h;function h(N){return e.enter(s),e.enter(o),e.consume(N),e.exit(o),e.enter(u),b}function b(N){return f>999||N===null||N===91||N===93&&!m||N===94&&!f&&"_hiddenFootnoteSupport"in d.parser.constructs?a(N):N===93?(e.exit(u),e.enter(o),e.consume(N),e.exit(o),e.exit(s),t):ze(N)?(e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),b):(e.enter("chunkString",{contentType:"string"}),g(N))}function g(N){return N===null||N===91||N===93||ze(N)||f++>999?(e.exit("chunkString"),b(N)):(e.consume(N),m||(m=!lt(N)),N===92?y:g)}function y(N){return N===91||N===92||N===93?(e.consume(N),f++,g):g(N)}}function hN(e,t,a,s,o,u){let d;return f;function f(y){return y===34||y===39||y===40?(e.enter(s),e.enter(o),e.consume(y),e.exit(o),d=y===40?41:y,m):a(y)}function m(y){return y===d?(e.enter(o),e.consume(y),e.exit(o),e.exit(s),t):(e.enter(u),h(y))}function h(y){return y===d?(e.exit(u),m(d)):y===null?a(y):ze(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),ft(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),b(y))}function b(y){return y===d||y===null||ze(y)?(e.exit("chunkString"),h(y)):(e.consume(y),y===92?g:b)}function g(y){return y===d||y===92?(e.consume(y),b):b(y)}}function oo(e,t){let a;return s;function s(o){return ze(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a=!0,s):lt(o)?ft(e,s,a?"linePrefix":"lineSuffix")(o):t(o)}}const vk={name:"definition",tokenize:Ak},Sk={partial:!0,tokenize:wk};function Ak(e,t,a){const s=this;let o;return u;function u(N){return e.enter("definition"),d(N)}function d(N){return mN.call(s,e,f,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(N)}function f(N){return o=Pa(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),N===58?(e.enter("definitionMarker"),e.consume(N),e.exit("definitionMarker"),m):a(N)}function m(N){return Mt(N)?oo(e,h)(N):h(N)}function h(N){return fN(e,b,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(N)}function b(N){return e.attempt(Sk,g,g)(N)}function g(N){return lt(N)?ft(e,y,"whitespace")(N):y(N)}function y(N){return N===null||ze(N)?(e.exit("definition"),s.parser.defined.push(o),t(N)):a(N)}}function wk(e,t,a){return s;function s(f){return Mt(f)?oo(e,o)(f):a(f)}function o(f){return hN(e,u,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function u(f){return lt(f)?ft(e,d,"whitespace")(f):d(f)}function d(f){return f===null||ze(f)?t(f):a(f)}}const Ck={name:"hardBreakEscape",tokenize:kk};function kk(e,t,a){return s;function s(u){return e.enter("hardBreakEscape"),e.consume(u),o}function o(u){return ze(u)?(e.exit("hardBreakEscape"),t(u)):a(u)}}const Rk={name:"headingAtx",resolve:Ok,tokenize:Ik};function Ok(e,t){let a=e.length-2,s=3,o,u;return e[s][1].type==="whitespace"&&(s+=2),a-2>s&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(s===a-1||a-4>s&&e[a-2][1].type==="whitespace")&&(a-=s+1===a?2:4),a>s&&(o={type:"atxHeadingText",start:e[s][1].start,end:e[a][1].end},u={type:"chunkText",start:e[s][1].start,end:e[a][1].end,contentType:"text"},ha(e,s,a-s+1,[["enter",o,t],["enter",u,t],["exit",u,t],["exit",o,t]])),e}function Ik(e,t,a){let s=0;return o;function o(b){return e.enter("atxHeading"),u(b)}function u(b){return e.enter("atxHeadingSequence"),d(b)}function d(b){return b===35&&s++<6?(e.consume(b),d):b===null||Mt(b)?(e.exit("atxHeadingSequence"),f(b)):a(b)}function f(b){return b===35?(e.enter("atxHeadingSequence"),m(b)):b===null||ze(b)?(e.exit("atxHeading"),t(b)):lt(b)?ft(e,f,"whitespace")(b):(e.enter("atxHeadingText"),h(b))}function m(b){return b===35?(e.consume(b),m):(e.exit("atxHeadingSequence"),f(b))}function h(b){return b===null||b===35||Mt(b)?(e.exit("atxHeadingText"),f(b)):(e.consume(b),h)}}const Mk=["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"],c1=["pre","script","style","textarea"],Dk={concrete:!0,name:"htmlFlow",resolveTo:Bk,tokenize:Pk},Lk={partial:!0,tokenize:Hk},jk={partial:!0,tokenize:Uk};function Bk(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Pk(e,t,a){const s=this;let o,u,d,f,m;return h;function h(M){return b(M)}function b(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),g}function g(M){return M===33?(e.consume(M),y):M===47?(e.consume(M),u=!0,S):M===63?(e.consume(M),o=3,s.interrupt?t:k):Bn(M)?(e.consume(M),d=String.fromCharCode(M),w):a(M)}function y(M){return M===45?(e.consume(M),o=2,N):M===91?(e.consume(M),o=5,f=0,v):Bn(M)?(e.consume(M),o=4,s.interrupt?t:k):a(M)}function N(M){return M===45?(e.consume(M),s.interrupt?t:k):a(M)}function v(M){const ye="CDATA[";return M===ye.charCodeAt(f++)?(e.consume(M),f===ye.length?s.interrupt?t:ue:v):a(M)}function S(M){return Bn(M)?(e.consume(M),d=String.fromCharCode(M),w):a(M)}function w(M){if(M===null||M===47||M===62||Mt(M)){const ye=M===47,re=d.toLowerCase();return!ye&&!u&&c1.includes(re)?(o=1,s.interrupt?t(M):ue(M)):Mk.includes(d.toLowerCase())?(o=6,ye?(e.consume(M),A):s.interrupt?t(M):ue(M)):(o=7,s.interrupt&&!s.parser.lazy[s.now().line]?a(M):u?R(M):I(M))}return M===45||wn(M)?(e.consume(M),d+=String.fromCharCode(M),w):a(M)}function A(M){return M===62?(e.consume(M),s.interrupt?t:ue):a(M)}function R(M){return lt(M)?(e.consume(M),R):j(M)}function I(M){return M===47?(e.consume(M),j):M===58||M===95||Bn(M)?(e.consume(M),Y):lt(M)?(e.consume(M),I):j(M)}function Y(M){return M===45||M===46||M===58||M===95||wn(M)?(e.consume(M),Y):B(M)}function B(M){return M===61?(e.consume(M),C):lt(M)?(e.consume(M),B):I(M)}function C(M){return M===null||M===60||M===61||M===62||M===96?a(M):M===34||M===39?(e.consume(M),m=M,z):lt(M)?(e.consume(M),C):W(M)}function z(M){return M===m?(e.consume(M),m=null,Q):M===null||ze(M)?a(M):(e.consume(M),z)}function W(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||Mt(M)?B(M):(e.consume(M),W)}function Q(M){return M===47||M===62||lt(M)?I(M):a(M)}function j(M){return M===62?(e.consume(M),ee):a(M)}function ee(M){return M===null||ze(M)?ue(M):lt(M)?(e.consume(M),ee):a(M)}function ue(M){return M===45&&o===2?(e.consume(M),D):M===60&&o===1?(e.consume(M),P):M===62&&o===4?(e.consume(M),U):M===63&&o===3?(e.consume(M),k):M===93&&o===5?(e.consume(M),K):ze(M)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(Lk,ie,Z)(M)):M===null||ze(M)?(e.exit("htmlFlowData"),Z(M)):(e.consume(M),ue)}function Z(M){return e.check(jk,q,ie)(M)}function q(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),F}function F(M){return M===null||ze(M)?Z(M):(e.enter("htmlFlowData"),ue(M))}function D(M){return M===45?(e.consume(M),k):ue(M)}function P(M){return M===47?(e.consume(M),d="",ae):ue(M)}function ae(M){if(M===62){const ye=d.toLowerCase();return c1.includes(ye)?(e.consume(M),U):ue(M)}return Bn(M)&&d.length<8?(e.consume(M),d+=String.fromCharCode(M),ae):ue(M)}function K(M){return M===93?(e.consume(M),k):ue(M)}function k(M){return M===62?(e.consume(M),U):M===45&&o===2?(e.consume(M),k):ue(M)}function U(M){return M===null||ze(M)?(e.exit("htmlFlowData"),ie(M)):(e.consume(M),U)}function ie(M){return e.exit("htmlFlow"),t(M)}}function Uk(e,t,a){const s=this;return o;function o(d){return ze(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):a(d)}function u(d){return s.parser.lazy[s.now().line]?a(d):t(d)}}function Hk(e,t,a){return s;function s(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Io,t,a)}}const Fk={name:"htmlText",tokenize:zk};function zk(e,t,a){const s=this;let o,u,d;return f;function f(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),m}function m(k){return k===33?(e.consume(k),h):k===47?(e.consume(k),B):k===63?(e.consume(k),I):Bn(k)?(e.consume(k),W):a(k)}function h(k){return k===45?(e.consume(k),b):k===91?(e.consume(k),u=0,v):Bn(k)?(e.consume(k),R):a(k)}function b(k){return k===45?(e.consume(k),N):a(k)}function g(k){return k===null?a(k):k===45?(e.consume(k),y):ze(k)?(d=g,P(k)):(e.consume(k),g)}function y(k){return k===45?(e.consume(k),N):g(k)}function N(k){return k===62?D(k):k===45?y(k):g(k)}function v(k){const U="CDATA[";return k===U.charCodeAt(u++)?(e.consume(k),u===U.length?S:v):a(k)}function S(k){return k===null?a(k):k===93?(e.consume(k),w):ze(k)?(d=S,P(k)):(e.consume(k),S)}function w(k){return k===93?(e.consume(k),A):S(k)}function A(k){return k===62?D(k):k===93?(e.consume(k),A):S(k)}function R(k){return k===null||k===62?D(k):ze(k)?(d=R,P(k)):(e.consume(k),R)}function I(k){return k===null?a(k):k===63?(e.consume(k),Y):ze(k)?(d=I,P(k)):(e.consume(k),I)}function Y(k){return k===62?D(k):I(k)}function B(k){return Bn(k)?(e.consume(k),C):a(k)}function C(k){return k===45||wn(k)?(e.consume(k),C):z(k)}function z(k){return ze(k)?(d=z,P(k)):lt(k)?(e.consume(k),z):D(k)}function W(k){return k===45||wn(k)?(e.consume(k),W):k===47||k===62||Mt(k)?Q(k):a(k)}function Q(k){return k===47?(e.consume(k),D):k===58||k===95||Bn(k)?(e.consume(k),j):ze(k)?(d=Q,P(k)):lt(k)?(e.consume(k),Q):D(k)}function j(k){return k===45||k===46||k===58||k===95||wn(k)?(e.consume(k),j):ee(k)}function ee(k){return k===61?(e.consume(k),ue):ze(k)?(d=ee,P(k)):lt(k)?(e.consume(k),ee):Q(k)}function ue(k){return k===null||k===60||k===61||k===62||k===96?a(k):k===34||k===39?(e.consume(k),o=k,Z):ze(k)?(d=ue,P(k)):lt(k)?(e.consume(k),ue):(e.consume(k),q)}function Z(k){return k===o?(e.consume(k),o=void 0,F):k===null?a(k):ze(k)?(d=Z,P(k)):(e.consume(k),Z)}function q(k){return k===null||k===34||k===39||k===60||k===61||k===96?a(k):k===47||k===62||Mt(k)?Q(k):(e.consume(k),q)}function F(k){return k===47||k===62||Mt(k)?Q(k):a(k)}function D(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):a(k)}function P(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),ae}function ae(k){return lt(k)?ft(e,K,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):K(k)}function K(k){return e.enter("htmlTextData"),d(k)}}const lp={name:"labelEnd",resolveAll:Gk,resolveTo:Kk,tokenize:Vk},$k={tokenize:Xk},qk={tokenize:Qk},Yk={tokenize:Wk};function Gk(e){let t=-1;const a=[];for(;++t<e.length;){const s=e[t][1];if(a.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const o=s.type==="labelImage"?4:2;s.type="data",t+=o}}return e.length!==a.length&&ha(e,0,e.length,a),e}function Kk(e,t){let a=e.length,s=0,o,u,d,f;for(;a--;)if(o=e[a][1],u){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[a][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(d){if(e[a][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(u=a,o.type!=="labelLink")){s=2;break}}else o.type==="labelEnd"&&(d=a);const m={type:e[u][1].type==="labelLink"?"link":"image",start:{...e[u][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[u][1].start},end:{...e[d][1].end}},b={type:"labelText",start:{...e[u+s+2][1].end},end:{...e[d-2][1].start}};return f=[["enter",m,t],["enter",h,t]],f=wa(f,e.slice(u+1,u+s+3)),f=wa(f,[["enter",b,t]]),f=wa(f,ad(t.parser.constructs.insideSpan.null,e.slice(u+s+4,d-3),t)),f=wa(f,[["exit",b,t],e[d-2],e[d-1],["exit",h,t]]),f=wa(f,e.slice(d+1)),f=wa(f,[["exit",m,t]]),ha(e,u,e.length,f),e}function Vk(e,t,a){const s=this;let o=s.events.length,u,d;for(;o--;)if((s.events[o][1].type==="labelImage"||s.events[o][1].type==="labelLink")&&!s.events[o][1]._balanced){u=s.events[o][1];break}return f;function f(y){return u?u._inactive?g(y):(d=s.parser.defined.includes(Pa(s.sliceSerialize({start:u.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),m):a(y)}function m(y){return y===40?e.attempt($k,b,d?b:g)(y):y===91?e.attempt(qk,b,d?h:g)(y):d?b(y):g(y)}function h(y){return e.attempt(Yk,b,g)(y)}function b(y){return t(y)}function g(y){return u._balanced=!0,a(y)}}function Xk(e,t,a){return s;function s(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),o}function o(g){return Mt(g)?oo(e,u)(g):u(g)}function u(g){return g===41?b(g):fN(e,d,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function d(g){return Mt(g)?oo(e,m)(g):b(g)}function f(g){return a(g)}function m(g){return g===34||g===39||g===40?hN(e,h,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):b(g)}function h(g){return Mt(g)?oo(e,b)(g):b(g)}function b(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):a(g)}}function Qk(e,t,a){const s=this;return o;function o(f){return mN.call(s,e,u,d,"reference","referenceMarker","referenceString")(f)}function u(f){return s.parser.defined.includes(Pa(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(f):a(f)}function d(f){return a(f)}}function Wk(e,t,a){return s;function s(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),o}function o(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),t):a(u)}}const Zk={name:"labelStartImage",resolveAll:lp.resolveAll,tokenize:Jk};function Jk(e,t,a){const s=this;return o;function o(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),u}function u(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),d):a(f)}function d(f){return f===94&&"_hiddenFootnoteSupport"in s.parser.constructs?a(f):t(f)}}const eR={name:"labelStartLink",resolveAll:lp.resolveAll,tokenize:tR};function tR(e,t,a){const s=this;return o;function o(d){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelLink"),u}function u(d){return d===94&&"_hiddenFootnoteSupport"in s.parser.constructs?a(d):t(d)}}const Im={name:"lineEnding",tokenize:nR};function nR(e,t){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ft(e,t,"linePrefix")}}const bc={name:"thematicBreak",tokenize:aR};function aR(e,t,a){let s=0,o;return u;function u(h){return e.enter("thematicBreak"),d(h)}function d(h){return o=h,f(h)}function f(h){return h===o?(e.enter("thematicBreakSequence"),m(h)):s>=3&&(h===null||ze(h))?(e.exit("thematicBreak"),t(h)):a(h)}function m(h){return h===o?(e.consume(h),s++,m):(e.exit("thematicBreakSequence"),lt(h)?ft(e,f,"whitespace")(h):f(h))}}const Zn={continuation:{tokenize:lR},exit:uR,name:"list",tokenize:iR},rR={partial:!0,tokenize:cR},sR={partial:!0,tokenize:oR};function iR(e,t,a){const s=this,o=s.events[s.events.length-1];let u=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,d=0;return f;function f(N){const v=s.containerState.type||(N===42||N===43||N===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!s.containerState.marker||N===s.containerState.marker:Eh(N)){if(s.containerState.type||(s.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),N===42||N===45?e.check(bc,a,h)(N):h(N);if(!s.interrupt||N===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(N)}return a(N)}function m(N){return Eh(N)&&++d<10?(e.consume(N),m):(!s.interrupt||d<2)&&(s.containerState.marker?N===s.containerState.marker:N===41||N===46)?(e.exit("listItemValue"),h(N)):a(N)}function h(N){return e.enter("listItemMarker"),e.consume(N),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||N,e.check(Io,s.interrupt?a:b,e.attempt(rR,y,g))}function b(N){return s.containerState.initialBlankLine=!0,u++,y(N)}function g(N){return lt(N)?(e.enter("listItemPrefixWhitespace"),e.consume(N),e.exit("listItemPrefixWhitespace"),y):a(N)}function y(N){return s.containerState.size=u+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(N)}}function lR(e,t,a){const s=this;return s.containerState._closeFlow=void 0,e.check(Io,o,u);function o(f){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,ft(e,t,"listItemIndent",s.containerState.size+1)(f)}function u(f){return s.containerState.furtherBlankLines||!lt(f)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,d(f)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(sR,t,d)(f))}function d(f){return s.containerState._closeFlow=!0,s.interrupt=void 0,ft(e,e.attempt(Zn,t,a),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function oR(e,t,a){const s=this;return ft(e,o,"listItemIndent",s.containerState.size+1);function o(u){const d=s.events[s.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===s.containerState.size?t(u):a(u)}}function uR(e){e.exit(this.containerState.type)}function cR(e,t,a){const s=this;return ft(e,o,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(u){const d=s.events[s.events.length-1];return!lt(u)&&d&&d[1].type==="listItemPrefixWhitespace"?t(u):a(u)}}const d1={name:"setextUnderline",resolveTo:dR,tokenize:fR};function dR(e,t){let a=e.length,s,o,u;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){s=a;break}e[a][1].type==="paragraph"&&(o=a)}else e[a][1].type==="content"&&e.splice(a,1),!u&&e[a][1].type==="definition"&&(u=a);const d={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",u?(e.splice(o,0,["enter",d,t]),e.splice(u+1,0,["exit",e[s][1],t]),e[s][1].end={...e[u][1].end}):e[s][1]=d,e.push(["exit",d,t]),e}function fR(e,t,a){const s=this;let o;return u;function u(h){let b=s.events.length,g;for(;b--;)if(s.events[b][1].type!=="lineEnding"&&s.events[b][1].type!=="linePrefix"&&s.events[b][1].type!=="content"){g=s.events[b][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||g)?(e.enter("setextHeadingLine"),o=h,d(h)):a(h)}function d(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===o?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),lt(h)?ft(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||ze(h)?(e.exit("setextHeadingLine"),t(h)):a(h)}}const mR={tokenize:hR};function hR(e){const t=this,a=e.attempt(Io,s,e.attempt(this.parser.constructs.flowInitial,o,ft(e,e.attempt(this.parser.constructs.flow,o,e.attempt(Ek,o)),"linePrefix")));return a;function s(u){if(u===null){e.consume(u);return}return e.enter("lineEndingBlank"),e.consume(u),e.exit("lineEndingBlank"),t.currentConstruct=void 0,a}function o(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),t.currentConstruct=void 0,a}}const pR={resolveAll:gN()},gR=pN("string"),bR=pN("text");function pN(e){return{resolveAll:gN(e==="text"?xR:void 0),tokenize:t};function t(a){const s=this,o=this.parser.constructs[e],u=a.attempt(o,d,f);return d;function d(b){return h(b)?u(b):f(b)}function f(b){if(b===null){a.consume(b);return}return a.enter("data"),a.consume(b),m}function m(b){return h(b)?(a.exit("data"),u(b)):(a.consume(b),m)}function h(b){if(b===null)return!0;const g=o[b];let y=-1;if(g)for(;++y<g.length;){const N=g[y];if(!N.previous||N.previous.call(s,s.previous))return!0}return!1}}}function gN(e){return t;function t(a,s){let o=-1,u;for(;++o<=a.length;)u===void 0?a[o]&&a[o][1].type==="data"&&(u=o,o++):(!a[o]||a[o][1].type!=="data")&&(o!==u+2&&(a[u][1].end=a[o-1][1].end,a.splice(u+2,o-u-2),o=u+2),u=void 0);return e?e(a,s):a}}function xR(e,t){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){const s=e[a-1][1],o=t.sliceStream(s);let u=o.length,d=-1,f=0,m;for(;u--;){const h=o[u];if(typeof h=="string"){for(d=h.length;h.charCodeAt(d-1)===32;)f++,d--;if(d)break;d=-1}else if(h===-2)m=!0,f++;else if(h!==-1){u++;break}}if(t._contentTypeTextTrailing&&a===e.length&&(f=0),f){const h={type:a===e.length||m||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?d:s.start._bufferIndex+d,_index:s.start._index+u,line:s.end.line,column:s.end.column-f,offset:s.end.offset-f},end:{...s.end}};s.end={...h.start},s.start.offset===s.end.offset?Object.assign(s,h):(e.splice(a,0,["enter",h,t],["exit",h,t]),a+=2)}a++}return e}const ER={42:Zn,43:Zn,45:Zn,48:Zn,49:Zn,50:Zn,51:Zn,52:Zn,53:Zn,54:Zn,55:Zn,56:Zn,57:Zn,62:oN},yR={91:vk},NR={[-2]:Om,[-1]:Om,32:Om},TR={35:Rk,42:bc,45:[d1,bc],60:Dk,61:d1,95:bc,96:u1,126:u1},_R={38:cN,92:uN},vR={[-5]:Im,[-4]:Im,[-3]:Im,33:Zk,38:cN,42:yh,60:[ek,Fk],91:eR,92:[Ck,uN],93:lp,95:yh,96:mk},SR={null:[yh,pR]},AR={null:[42,95]},wR={null:[]},CR=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:AR,contentInitial:yR,disable:wR,document:ER,flow:TR,flowInitial:NR,insideSpan:SR,string:_R,text:vR},Symbol.toStringTag,{value:"Module"}));function kR(e,t,a){let s={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const o={},u=[];let d=[],f=[];const m={attempt:z(B),check:z(C),consume:R,enter:I,exit:Y,interrupt:z(C,{interrupt:!0})},h={code:null,containerState:{},defineSkip:S,events:[],now:v,parser:e,previous:null,sliceSerialize:y,sliceStream:N,write:g};let b=t.tokenize.call(h,m);return t.resolveAll&&u.push(t),h;function g(ee){return d=wa(d,ee),w(),d[d.length-1]!==null?[]:(W(t,0),h.events=ad(u,h.events,h),h.events)}function y(ee,ue){return OR(N(ee),ue)}function N(ee){return RR(d,ee)}function v(){const{_bufferIndex:ee,_index:ue,line:Z,column:q,offset:F}=s;return{_bufferIndex:ee,_index:ue,line:Z,column:q,offset:F}}function S(ee){o[ee.line]=ee.column,j()}function w(){let ee;for(;s._index<d.length;){const ue=d[s._index];if(typeof ue=="string")for(ee=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===ee&&s._bufferIndex<ue.length;)A(ue.charCodeAt(s._bufferIndex));else A(ue)}}function A(ee){b=b(ee)}function R(ee){ze(ee)?(s.line++,s.column=1,s.offset+=ee===-3?2:1,j()):ee!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===d[s._index].length&&(s._bufferIndex=-1,s._index++)),h.previous=ee}function I(ee,ue){const Z=ue||{};return Z.type=ee,Z.start=v(),h.events.push(["enter",Z,h]),f.push(Z),Z}function Y(ee){const ue=f.pop();return ue.end=v(),h.events.push(["exit",ue,h]),ue}function B(ee,ue){W(ee,ue.from)}function C(ee,ue){ue.restore()}function z(ee,ue){return Z;function Z(q,F,D){let P,ae,K,k;return Array.isArray(q)?ie(q):"tokenize"in q?ie([q]):U(q);function U(Ne){return Pe;function Pe(tt){const et=tt!==null&&Ne[tt],vt=tt!==null&&Ne.null,en=[...Array.isArray(et)?et:et?[et]:[],...Array.isArray(vt)?vt:vt?[vt]:[]];return ie(en)(tt)}}function ie(Ne){return P=Ne,ae=0,Ne.length===0?D:M(Ne[ae])}function M(Ne){return Pe;function Pe(tt){return k=Q(),K=Ne,Ne.partial||(h.currentConstruct=Ne),Ne.name&&h.parser.constructs.disable.null.includes(Ne.name)?re():Ne.tokenize.call(ue?Object.assign(Object.create(h),ue):h,m,ye,re)(tt)}}function ye(Ne){return ee(K,k),F}function re(Ne){return k.restore(),++ae<P.length?M(P[ae]):D}}}function W(ee,ue){ee.resolveAll&&!u.includes(ee)&&u.push(ee),ee.resolve&&ha(h.events,ue,h.events.length-ue,ee.resolve(h.events.slice(ue),h)),ee.resolveTo&&(h.events=ee.resolveTo(h.events,h))}function Q(){const ee=v(),ue=h.previous,Z=h.currentConstruct,q=h.events.length,F=Array.from(f);return{from:q,restore:D};function D(){s=ee,h.previous=ue,h.currentConstruct=Z,h.events.length=q,f=F,j()}}function j(){s.line in o&&s.column<2&&(s.column=o[s.line],s.offset+=o[s.line]-1)}}function RR(e,t){const a=t.start._index,s=t.start._bufferIndex,o=t.end._index,u=t.end._bufferIndex;let d;if(a===o)d=[e[a].slice(s,u)];else{if(d=e.slice(a,o),s>-1){const f=d[0];typeof f=="string"?d[0]=f.slice(s):d.shift()}u>0&&d.push(e[o].slice(0,u))}return d}function OR(e,t){let a=-1;const s=[];let o;for(;++a<e.length;){const u=e[a];let d;if(typeof u=="string")d=u;else switch(u){case-5:{d="\r";break}case-4:{d=`
469
+ `;break}case-3:{d=`\r
470
+ `;break}case-2:{d=t?" ":" ";break}case-1:{if(!t&&o)continue;d=" ";break}default:d=String.fromCharCode(u)}o=u===-2,s.push(d)}return s.join("")}function IR(e){const s={constructs:iN([CR,...(e||{}).extensions||[]]),content:o(KC),defined:[],document:o(XC),flow:o(mR),lazy:{},string:o(gR),text:o(bR)};return s;function o(u){return d;function d(f){return kR(s,u,f)}}}function MR(e){for(;!dN(e););return e}const f1=/[\0\t\n\r]/g;function DR(){let e=1,t="",a=!0,s;return o;function o(u,d,f){const m=[];let h,b,g,y,N;for(u=t+(typeof u=="string"?u.toString():new TextDecoder(d||void 0).decode(u)),g=0,t="",a&&(u.charCodeAt(0)===65279&&g++,a=void 0);g<u.length;){if(f1.lastIndex=g,h=f1.exec(u),y=h&&h.index!==void 0?h.index:u.length,N=u.charCodeAt(y),!h){t=u.slice(g);break}if(N===10&&g===y&&s)m.push(-3),s=void 0;else switch(s&&(m.push(-5),s=void 0),g<y&&(m.push(u.slice(g,y)),e+=y-g),N){case 0:{m.push(65533),e++;break}case 9:{for(b=Math.ceil(e/4)*4,m.push(-2);e++<b;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:s=!0,e=1}g=y+1}return f&&(s&&m.push(-5),t&&m.push(t),m.push(null)),m}}const LR=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function jR(e){return e.replace(LR,BR)}function BR(e,t,a){if(t)return t;if(a.charCodeAt(0)===35){const o=a.charCodeAt(1),u=o===120||o===88;return lN(a.slice(u?2:1),u?16:10)}return ip(a)||e}const bN={}.hasOwnProperty;function PR(e,t,a){return t&&typeof t=="object"&&(a=t,t=void 0),UR(a)(MR(IR(a).document().write(DR()(e,t,!0))))}function UR(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(ba),autolinkProtocol:Q,autolinkEmail:Q,atxHeading:u(xt),blockQuote:u(vt),characterEscape:Q,characterReference:Q,codeFenced:u(en),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:u(en,d),codeText:u(Hn,d),codeTextData:Q,data:Q,codeFlowValue:Q,definition:u(aa),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:u(xe),hardBreakEscape:u(nt),hardBreakTrailing:u(nt),htmlFlow:u(Fn,d),htmlFlowData:Q,htmlText:u(Fn,d),htmlTextData:Q,image:u(In),label:d,link:u(ba),listItem:u(nr),listItemValue:y,listOrdered:u(Ia,g),listUnordered:u(Ia),paragraph:u(Ha),reference:M,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:u(xt),strong:u(kr),thematicBreak:u(ar)},exit:{atxHeading:m(),atxHeadingSequence:B,autolink:m(),autolinkEmail:et,autolinkProtocol:tt,blockQuote:m(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:Ne,characterReference:Pe,codeFenced:m(w),codeFencedFence:S,codeFencedFenceInfo:N,codeFencedFenceMeta:v,codeFlowValue:j,codeIndented:m(A),codeText:m(F),codeTextData:j,data:j,definition:m(),definitionDestinationString:Y,definitionLabelString:R,definitionTitleString:I,emphasis:m(),hardBreakEscape:m(ue),hardBreakTrailing:m(ue),htmlFlow:m(Z),htmlFlowData:j,htmlText:m(q),htmlTextData:j,image:m(P),label:K,labelText:ae,lineEnding:ee,link:m(D),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:ye,resourceDestinationString:k,resourceTitleString:U,resource:ie,setextHeading:m(W),setextHeadingLineSequence:z,setextHeadingText:C,strong:m(),thematicBreak:m()}};xN(t,(e||{}).mdastExtensions||[]);const a={};return s;function s(me){let Se={type:"root",children:[]};const Fe={stack:[Se],tokenStack:[],config:t,enter:f,exit:h,buffer:d,resume:b,data:a},$=[];let Re=-1;for(;++Re<me.length;)if(me[Re][1].type==="listOrdered"||me[Re][1].type==="listUnordered")if(me[Re][0]==="enter")$.push(Re);else{const mt=$.pop();Re=o(me,mt,Re)}for(Re=-1;++Re<me.length;){const mt=t[me[Re][0]];bN.call(mt,me[Re][1].type)&&mt[me[Re][1].type].call(Object.assign({sliceSerialize:me[Re][2].sliceSerialize},Fe),me[Re][1])}if(Fe.tokenStack.length>0){const mt=Fe.tokenStack[Fe.tokenStack.length-1];(mt[1]||m1).call(Fe,void 0,mt[0])}for(Se.position={start:ss(me.length>0?me[0][1].start:{line:1,column:1,offset:0}),end:ss(me.length>0?me[me.length-2][1].end:{line:1,column:1,offset:0})},Re=-1;++Re<t.transforms.length;)Se=t.transforms[Re](Se)||Se;return Se}function o(me,Se,Fe){let $=Se-1,Re=-1,mt=!1,dn,tn,Dt,mn;for(;++$<=Fe;){const Et=me[$];switch(Et[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Et[0]==="enter"?Re++:Re--,mn=void 0;break}case"lineEndingBlank":{Et[0]==="enter"&&(dn&&!mn&&!Re&&!Dt&&(Dt=$),mn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:mn=void 0}if(!Re&&Et[0]==="enter"&&Et[1].type==="listItemPrefix"||Re===-1&&Et[0]==="exit"&&(Et[1].type==="listUnordered"||Et[1].type==="listOrdered")){if(dn){let Fa=$;for(tn=void 0;Fa--;){const Mn=me[Fa];if(Mn[1].type==="lineEnding"||Mn[1].type==="lineEndingBlank"){if(Mn[0]==="exit")continue;tn&&(me[tn][1].type="lineEndingBlank",mt=!0),Mn[1].type="lineEnding",tn=Fa}else if(!(Mn[1].type==="linePrefix"||Mn[1].type==="blockQuotePrefix"||Mn[1].type==="blockQuotePrefixWhitespace"||Mn[1].type==="blockQuoteMarker"||Mn[1].type==="listItemIndent"))break}Dt&&(!tn||Dt<tn)&&(dn._spread=!0),dn.end=Object.assign({},tn?me[tn][1].start:Et[1].end),me.splice(tn||$,0,["exit",dn,Et[2]]),$++,Fe++}if(Et[1].type==="listItemPrefix"){const Fa={type:"listItem",_spread:!1,start:Object.assign({},Et[1].start),end:void 0};dn=Fa,me.splice($,0,["enter",Fa,Et[2]]),$++,Fe++,Dt=void 0,mn=!0}}}return me[Se][1]._spread=mt,Fe}function u(me,Se){return Fe;function Fe($){f.call(this,me($),$),Se&&Se.call(this,$)}}function d(){this.stack.push({type:"fragment",children:[]})}function f(me,Se,Fe){this.stack[this.stack.length-1].children.push(me),this.stack.push(me),this.tokenStack.push([Se,Fe||void 0]),me.position={start:ss(Se.start),end:void 0}}function m(me){return Se;function Se(Fe){me&&me.call(this,Fe),h.call(this,Fe)}}function h(me,Se){const Fe=this.stack.pop(),$=this.tokenStack.pop();if($)$[0].type!==me.type&&(Se?Se.call(this,me,$[0]):($[1]||m1).call(this,me,$[0]));else throw new Error("Cannot close `"+me.type+"` ("+lo({start:me.start,end:me.end})+"): it’s not open");Fe.position.end=ss(me.end)}function b(){return sp(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function y(me){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(me),10),this.data.expectingFirstListItemValue=void 0}}function N(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=me}function v(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=me}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.value=me.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function A(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.value=me.replace(/(\r?\n|\r)$/g,"")}function R(me){const Se=this.resume(),Fe=this.stack[this.stack.length-1];Fe.label=Se,Fe.identifier=Pa(this.sliceSerialize(me)).toLowerCase()}function I(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.title=me}function Y(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.url=me}function B(me){const Se=this.stack[this.stack.length-1];if(!Se.depth){const Fe=this.sliceSerialize(me).length;Se.depth=Fe}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function z(me){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(me).codePointAt(0)===61?1:2}function W(){this.data.setextHeadingSlurpLineEnding=void 0}function Q(me){const Fe=this.stack[this.stack.length-1].children;let $=Fe[Fe.length-1];(!$||$.type!=="text")&&($=St(),$.position={start:ss(me.start),end:void 0},Fe.push($)),this.stack.push($)}function j(me){const Se=this.stack.pop();Se.value+=this.sliceSerialize(me),Se.position.end=ss(me.end)}function ee(me){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Fe=Se.children[Se.children.length-1];Fe.position.end=ss(me.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Se.type)&&(Q.call(this,me),j.call(this,me))}function ue(){this.data.atHardBreak=!0}function Z(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.value=me}function q(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.value=me}function F(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.value=me}function D(){const me=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";me.type+="Reference",me.referenceType=Se,delete me.url,delete me.title}else delete me.identifier,delete me.label;this.data.referenceType=void 0}function P(){const me=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";me.type+="Reference",me.referenceType=Se,delete me.url,delete me.title}else delete me.identifier,delete me.label;this.data.referenceType=void 0}function ae(me){const Se=this.sliceSerialize(me),Fe=this.stack[this.stack.length-2];Fe.label=jR(Se),Fe.identifier=Pa(Se).toLowerCase()}function K(){const me=this.stack[this.stack.length-1],Se=this.resume(),Fe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Fe.type==="link"){const $=me.children;Fe.children=$}else Fe.alt=Se}function k(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.url=me}function U(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.title=me}function ie(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function ye(me){const Se=this.resume(),Fe=this.stack[this.stack.length-1];Fe.label=Se,Fe.identifier=Pa(this.sliceSerialize(me)).toLowerCase(),this.data.referenceType="full"}function re(me){this.data.characterReferenceType=me.type}function Ne(me){const Se=this.sliceSerialize(me),Fe=this.data.characterReferenceType;let $;Fe?($=lN(Se,Fe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):$=ip(Se);const Re=this.stack[this.stack.length-1];Re.value+=$}function Pe(me){const Se=this.stack.pop();Se.position.end=ss(me.end)}function tt(me){j.call(this,me);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(me)}function et(me){j.call(this,me);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(me)}function vt(){return{type:"blockquote",children:[]}}function en(){return{type:"code",lang:null,meta:null,value:""}}function Hn(){return{type:"inlineCode",value:""}}function aa(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function xe(){return{type:"emphasis",children:[]}}function xt(){return{type:"heading",depth:0,children:[]}}function nt(){return{type:"break"}}function Fn(){return{type:"html",value:""}}function In(){return{type:"image",title:null,url:"",alt:null}}function ba(){return{type:"link",title:null,url:"",children:[]}}function Ia(me){return{type:"list",ordered:me.type==="listOrdered",start:null,spread:me._spread,children:[]}}function nr(me){return{type:"listItem",spread:me._spread,checked:null,children:[]}}function Ha(){return{type:"paragraph",children:[]}}function kr(){return{type:"strong",children:[]}}function St(){return{type:"text",value:""}}function ar(){return{type:"thematicBreak"}}}function ss(e){return{line:e.line,column:e.column,offset:e.offset}}function xN(e,t){let a=-1;for(;++a<t.length;){const s=t[a];Array.isArray(s)?xN(e,s):HR(e,s)}}function HR(e,t){let a;for(a in t)if(bN.call(t,a))switch(a){case"canContainEols":{const s=t[a];s&&e[a].push(...s);break}case"transforms":{const s=t[a];s&&e[a].push(...s);break}case"enter":case"exit":{const s=t[a];s&&Object.assign(e[a],s);break}}}function m1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+lo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+lo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+lo({start:t.start,end:t.end})+") is still open")}function FR(e){const t=this;t.parser=a;function a(s){return PR(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function zR(e,t){const a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,a),e.applyData(t,a)}function $R(e,t){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,a),[e.applyData(t,a),{type:"text",value:`
471
+ `}]}function qR(e,t){const a=t.value?t.value+`
472
+ `:"",s={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(s.className=["language-"+o[0]]);let u={type:"element",tagName:"code",properties:s,children:[{type:"text",value:a}]};return t.meta&&(u.data={meta:t.meta}),e.patch(t,u),u=e.applyData(t,u),u={type:"element",tagName:"pre",properties:{},children:[u]},e.patch(t,u),u}function YR(e,t){const a={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function GR(e,t){const a={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function KR(e,t){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),o=Zi(s.toLowerCase()),u=e.footnoteOrder.indexOf(s);let d,f=e.footnoteCounts.get(s);f===void 0?(f=0,e.footnoteOrder.push(s),d=e.footnoteOrder.length):d=u+1,f+=1,e.footnoteCounts.set(s,f);const m={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+o,id:a+"fnref-"+o+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(t,m);const h={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,h),e.applyData(t,h)}function VR(e,t){const a={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function XR(e,t){if(e.options.allowDangerousHtml){const a={type:"raw",value:t.value};return e.patch(t,a),e.applyData(t,a)}}function EN(e,t){const a=t.referenceType;let s="]";if(a==="collapsed"?s+="[]":a==="full"&&(s+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+s}];const o=e.all(t),u=o[0];u&&u.type==="text"?u.value="["+u.value:o.unshift({type:"text",value:"["});const d=o[o.length-1];return d&&d.type==="text"?d.value+=s:o.push({type:"text",value:s}),o}function QR(e,t){const a=String(t.identifier).toUpperCase(),s=e.definitionById.get(a);if(!s)return EN(e,t);const o={src:Zi(s.url||""),alt:t.alt};s.title!==null&&s.title!==void 0&&(o.title=s.title);const u={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,u),e.applyData(t,u)}function WR(e,t){const a={src:Zi(t.url)};t.alt!==null&&t.alt!==void 0&&(a.alt=t.alt),t.title!==null&&t.title!==void 0&&(a.title=t.title);const s={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,s),e.applyData(t,s)}function ZR(e,t){const a={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,a);const s={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(t,s),e.applyData(t,s)}function JR(e,t){const a=String(t.identifier).toUpperCase(),s=e.definitionById.get(a);if(!s)return EN(e,t);const o={href:Zi(s.url||"")};s.title!==null&&s.title!==void 0&&(o.title=s.title);const u={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,u),e.applyData(t,u)}function e4(e,t){const a={href:Zi(t.url)};t.title!==null&&t.title!==void 0&&(a.title=t.title);const s={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function t4(e,t,a){const s=e.all(t),o=a?n4(a):yN(t),u={},d=[];if(typeof t.checked=="boolean"){const b=s[0];let g;b&&b.type==="element"&&b.tagName==="p"?g=b:(g={type:"element",tagName:"p",properties:{},children:[]},s.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let f=-1;for(;++f<s.length;){const b=s[f];(o||f!==0||b.type!=="element"||b.tagName!=="p")&&d.push({type:"text",value:`
473
+ `}),b.type==="element"&&b.tagName==="p"&&!o?d.push(...b.children):d.push(b)}const m=s[s.length-1];m&&(o||m.type!=="element"||m.tagName!=="p")&&d.push({type:"text",value:`
474
+ `});const h={type:"element",tagName:"li",properties:u,children:d};return e.patch(t,h),e.applyData(t,h)}function n4(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const a=e.children;let s=-1;for(;!t&&++s<a.length;)t=yN(a[s])}return t}function yN(e){const t=e.spread;return t??e.children.length>1}function a4(e,t){const a={},s=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(a.start=t.start);++o<s.length;){const d=s[o];if(d.type==="element"&&d.tagName==="li"&&d.properties&&Array.isArray(d.properties.className)&&d.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const u={type:"element",tagName:t.ordered?"ol":"ul",properties:a,children:e.wrap(s,!0)};return e.patch(t,u),e.applyData(t,u)}function r4(e,t){const a={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function s4(e,t){const a={type:"root",children:e.wrap(e.all(t))};return e.patch(t,a),e.applyData(t,a)}function i4(e,t){const a={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function l4(e,t){const a=e.all(t),s=a.shift(),o=[];if(s){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(t.children[0],d),o.push(d)}if(a.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},f=er(t.children[1]),m=td(t.children[t.children.length-1]);f&&m&&(d.position={start:f,end:m}),o.push(d)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,u),e.applyData(t,u)}function o4(e,t,a){const s=a?a.children:void 0,u=(s?s.indexOf(t):1)===0?"th":"td",d=a&&a.type==="table"?a.align:void 0,f=d?d.length:t.children.length;let m=-1;const h=[];for(;++m<f;){const g=t.children[m],y={},N=d?d[m]:void 0;N&&(y.align=N);let v={type:"element",tagName:u,properties:y,children:[]};g&&(v.children=e.all(g),e.patch(g,v),v=e.applyData(g,v)),h.push(v)}const b={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,b),e.applyData(t,b)}function u4(e,t){const a={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}const h1=9,p1=32;function c4(e){const t=String(e),a=/\r?\n|\r/g;let s=a.exec(t),o=0;const u=[];for(;s;)u.push(g1(t.slice(o,s.index),o>0,!0),s[0]),o=s.index+s[0].length,s=a.exec(t);return u.push(g1(t.slice(o),o>0,!1)),u.join("")}function g1(e,t,a){let s=0,o=e.length;if(t){let u=e.codePointAt(s);for(;u===h1||u===p1;)s++,u=e.codePointAt(s)}if(a){let u=e.codePointAt(o-1);for(;u===h1||u===p1;)o--,u=e.codePointAt(o-1)}return o>s?e.slice(s,o):""}function d4(e,t){const a={type:"text",value:c4(String(t.value))};return e.patch(t,a),e.applyData(t,a)}function f4(e,t){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,a),e.applyData(t,a)}const m4={blockquote:zR,break:$R,code:qR,delete:YR,emphasis:GR,footnoteReference:KR,heading:VR,html:XR,imageReference:QR,image:WR,inlineCode:ZR,linkReference:JR,link:e4,listItem:t4,list:a4,paragraph:r4,root:s4,strong:i4,table:l4,tableCell:u4,tableRow:o4,text:d4,thematicBreak:f4,toml:ac,yaml:ac,definition:ac,footnoteDefinition:ac};function ac(){}const NN=-1,rd=0,uo=1,Ic=2,op=3,up=4,cp=5,dp=6,TN=7,_N=8,vN=typeof self=="object"?self:globalThis,b1=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new vN[e](t)},h4=(e,t)=>{const a=(o,u)=>(e.set(u,o),o),s=o=>{if(e.has(o))return e.get(o);const[u,d]=t[o];switch(u){case rd:case NN:return a(d,o);case uo:{const f=a([],o);for(const m of d)f.push(s(m));return f}case Ic:{const f=a({},o);for(const[m,h]of d)f[s(m)]=s(h);return f}case op:return a(new Date(d),o);case up:{const{source:f,flags:m}=d;return a(new RegExp(f,m),o)}case cp:{const f=a(new Map,o);for(const[m,h]of d)f.set(s(m),s(h));return f}case dp:{const f=a(new Set,o);for(const m of d)f.add(s(m));return f}case TN:{const{name:f,message:m}=d;return a(typeof vN[f]=="function"?b1(f,m):new Error(m),o)}case _N:return a(BigInt(d),o);case"BigInt":return a(Object(BigInt(d)),o);case"ArrayBuffer":return a(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:f}=new Uint8Array(d);return a(new DataView(f),d)}}return a(b1(u,d),o)};return s},x1=e=>h4(new Map,e)(0),Hs="",{toString:p4}={},{keys:g4}=Object,to=e=>{const t=typeof e;if(t!=="object"||!e)return[rd,t];const a=p4.call(e).slice(8,-1);switch(a){case"Array":return[uo,Hs];case"Object":return[Ic,Hs];case"Date":return[op,Hs];case"RegExp":return[up,Hs];case"Map":return[cp,Hs];case"Set":return[dp,Hs];case"DataView":return[uo,a]}return a.includes("Array")?[uo,a]:e instanceof Error?[TN,e.name||"Error"]:[Ic,a]},rc=([e,t])=>e===rd&&(t==="function"||t==="symbol"),b4=(e,t,a,s)=>{const o=(d,f)=>{const m=s.push(d)-1;return a.set(f,m),m},u=d=>{if(a.has(d))return a.get(d);let[f,m]=to(d);switch(f){case rd:{let b=d;switch(m){case"bigint":f=_N,b=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);b=null;break;case"undefined":return o([NN],d)}return o([f,b],d)}case uo:{if(m){let y=d;return m==="DataView"?y=new Uint8Array(d.buffer):m==="ArrayBuffer"&&(y=new Uint8Array(d)),o([m,[...y]],d)}const b=[],g=o([f,b],d);for(const y of d)b.push(u(y));return g}case Ic:{if(m)switch(m){case"BigInt":return o([m,d.toString()],d);case"Boolean":case"Number":case"String":return o([m,d.valueOf()],d)}if(t&&"toJSON"in d)return u(d.toJSON());const b=[],g=o([f,b],d);for(const y of g4(d))(e||!rc(to(d[y])))&&b.push([u(y),u(d[y])]);return g}case op:return o([f,isNaN(d.getTime())?Hs:d.toISOString()],d);case up:{const{source:b,flags:g}=d;return o([f,{source:b,flags:g}],d)}case cp:{const b=[],g=o([f,b],d);for(const[y,N]of d)(e||!(rc(to(y))||rc(to(N))))&&b.push([u(y),u(N)]);return g}case dp:{const b=[],g=o([f,b],d);for(const y of d)(e||!rc(to(y)))&&b.push(u(y));return g}}const{message:h}=d;return o([f,{name:m,message:h}],d)};return u},E1=(e,{json:t,lossy:a}={})=>{const s=[];return b4(!(t||a),!!t,new Map,s)(e),s},Yi=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?x1(E1(e,t)):structuredClone(e):(e,t)=>x1(E1(e,t));function x4(e,t){const a=[{type:"text",value:"↩"}];return t>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),a}function E4(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function y4(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||x4,s=e.options.footnoteBackLabel||E4,o=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let m=-1;for(;++m<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[m]);if(!h)continue;const b=e.all(h),g=String(h.identifier).toUpperCase(),y=Zi(g.toLowerCase());let N=0;const v=[],S=e.footnoteCounts.get(g);for(;S!==void 0&&++N<=S;){v.length>0&&v.push({type:"text",value:" "});let R=typeof a=="string"?a:a(m,N);typeof R=="string"&&(R={type:"text",value:R}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(N>1?"-"+N:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(m,N),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const w=b[b.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const R=w.children[w.children.length-1];R&&R.type==="text"?R.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...v)}else b.push(...v);const A={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(b,!0)};e.patch(h,A),f.push(A)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...Yi(d),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
475
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
476
+ `}]}}const Mo=(function(e){if(e==null)return v4;if(typeof e=="function")return sd(e);if(typeof e=="object")return Array.isArray(e)?N4(e):T4(e);if(typeof e=="string")return _4(e);throw new Error("Expected function, string, or object as test")});function N4(e){const t=[];let a=-1;for(;++a<e.length;)t[a]=Mo(e[a]);return sd(s);function s(...o){let u=-1;for(;++u<t.length;)if(t[u].apply(this,o))return!0;return!1}}function T4(e){const t=e;return sd(a);function a(s){const o=s;let u;for(u in e)if(o[u]!==t[u])return!1;return!0}}function _4(e){return sd(t);function t(a){return a&&a.type===e}}function sd(e){return t;function t(a,s,o){return!!(S4(a)&&e.call(this,a,typeof s=="number"?s:void 0,o||void 0))}}function v4(){return!0}function S4(e){return e!==null&&typeof e=="object"&&"type"in e}const SN=[],A4=!0,Nh=!1,w4="skip";function AN(e,t,a,s){let o;typeof t=="function"&&typeof a!="function"?(s=a,a=t):o=t;const u=Mo(o),d=s?-1:1;f(e,void 0,[])();function f(m,h,b){const g=m&&typeof m=="object"?m:{};if(typeof g.type=="string"){const N=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(m.type+(N?"<"+N+">":""))+")"})}return y;function y(){let N=SN,v,S,w;if((!t||u(m,h,b[b.length-1]||void 0))&&(N=C4(a(m,b)),N[0]===Nh))return N;if("children"in m&&m.children){const A=m;if(A.children&&N[0]!==w4)for(S=(s?A.children.length:-1)+d,w=b.concat(A);S>-1&&S<A.children.length;){const R=A.children[S];if(v=f(R,S,w)(),v[0]===Nh)return v;S=typeof v[1]=="number"?v[1]:S+d}}return N}}}function C4(e){return Array.isArray(e)?e:typeof e=="number"?[A4,e]:e==null?SN:[e]}function Do(e,t,a,s){let o,u,d;typeof t=="function"&&typeof a!="function"?(u=void 0,d=t,o=a):(u=t,d=a,o=s),AN(e,u,f,o);function f(m,h){const b=h[h.length-1],g=b?b.children.indexOf(m):void 0;return d(m,g,b)}}const Th={}.hasOwnProperty,k4={};function R4(e,t){const a=t||k4,s=new Map,o=new Map,u=new Map,d={...m4,...a.handlers},f={all:h,applyData:I4,definitionById:s,footnoteById:o,footnoteCounts:u,footnoteOrder:[],handlers:d,one:m,options:a,patch:O4,wrap:D4};return Do(e,function(b){if(b.type==="definition"||b.type==="footnoteDefinition"){const g=b.type==="definition"?s:o,y=String(b.identifier).toUpperCase();g.has(y)||g.set(y,b)}}),f;function m(b,g){const y=b.type,N=f.handlers[y];if(Th.call(f.handlers,y)&&N)return N(f,b,g);if(f.options.passThrough&&f.options.passThrough.includes(y)){if("children"in b){const{children:S,...w}=b,A=Yi(w);return A.children=f.all(b),A}return Yi(b)}return(f.options.unknownHandler||M4)(f,b,g)}function h(b){const g=[];if("children"in b){const y=b.children;let N=-1;for(;++N<y.length;){const v=f.one(y[N],b);if(v){if(N&&y[N-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=y1(v.value)),!Array.isArray(v)&&v.type==="element")){const S=v.children[0];S&&S.type==="text"&&(S.value=y1(S.value))}Array.isArray(v)?g.push(...v):g.push(v)}}}return g}}function O4(e,t){e.position&&(t.position=EC(e))}function I4(e,t){let a=t;if(e&&e.data){const s=e.data.hName,o=e.data.hChildren,u=e.data.hProperties;if(typeof s=="string")if(a.type==="element")a.tagName=s;else{const d="children"in a?a.children:[a];a={type:"element",tagName:s,properties:{},children:d}}a.type==="element"&&u&&Object.assign(a.properties,Yi(u)),"children"in a&&a.children&&o!==null&&o!==void 0&&(a.children=o)}return a}function M4(e,t){const a=t.data||{},s="value"in t&&!(Th.call(a,"hProperties")||Th.call(a,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function D4(e,t){const a=[];let s=-1;for(t&&a.push({type:"text",value:`
477
+ `});++s<e.length;)s&&a.push({type:"text",value:`
478
+ `}),a.push(e[s]);return t&&e.length>0&&a.push({type:"text",value:`
479
+ `}),a}function y1(e){let t=0,a=e.charCodeAt(t);for(;a===9||a===32;)t++,a=e.charCodeAt(t);return e.slice(t)}function N1(e,t){const a=R4(e,t),s=a.one(e,void 0),o=y4(a),u=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return o&&u.children.push({type:"text",value:`
480
+ `},o),u}function L4(e,t){return e&&"run"in e?async function(a,s){const o=N1(a,{file:s,...t});await e.run(o,s)}:function(a,s){return N1(a,{file:s,...e||t})}}function T1(e){if(e)throw e}var Mm,_1;function j4(){if(_1)return Mm;_1=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,a=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},u=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var b=e.call(h,"constructor"),g=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!b&&!g)return!1;var y;for(y in h);return typeof y>"u"||e.call(h,y)},d=function(h,b){a&&b.name==="__proto__"?a(h,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):h[b.name]=b.newValue},f=function(h,b){if(b==="__proto__")if(e.call(h,b)){if(s)return s(h,b).value}else return;return h[b]};return Mm=function m(){var h,b,g,y,N,v,S=arguments[0],w=1,A=arguments.length,R=!1;for(typeof S=="boolean"&&(R=S,S=arguments[1]||{},w=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});w<A;++w)if(h=arguments[w],h!=null)for(b in h)g=f(S,b),y=f(h,b),S!==y&&(R&&y&&(u(y)||(N=o(y)))?(N?(N=!1,v=g&&o(g)?g:[]):v=g&&u(g)?g:{},d(S,{name:b,newValue:m(R,v,y)})):typeof y<"u"&&d(S,{name:b,newValue:y}));return S},Mm}var B4=j4();const Dm=Fc(B4);function _h(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function P4(){const e=[],t={run:a,use:s};return t;function a(...o){let u=-1;const d=o.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);f(null,...o);function f(m,...h){const b=e[++u];let g=-1;if(m){d(m);return}for(;++g<o.length;)(h[g]===null||h[g]===void 0)&&(h[g]=o[g]);o=h,b?U4(b,f)(...h):d(null,...h)}}function s(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function U4(e,t){let a;return s;function s(...d){const f=e.length>d.length;let m;f&&d.push(o);try{m=e.apply(this,d)}catch(h){const b=h;if(f&&a)throw b;return o(b)}f||(m&&m.then&&typeof m.then=="function"?m.then(u,o):m instanceof Error?o(m):u(m))}function o(d,...f){a||(a=!0,t(d,...f))}function u(d){o(null,d)}}const Xa={basename:H4,dirname:F4,extname:z4,join:$4,sep:"/"};function H4(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Lo(e);let a=0,s=-1,o=e.length,u;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(u){a=o+1;break}}else s<0&&(u=!0,s=o+1);return s<0?"":e.slice(a,s)}if(t===e)return"";let d=-1,f=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(u){a=o+1;break}}else d<0&&(u=!0,d=o+1),f>-1&&(e.codePointAt(o)===t.codePointAt(f--)?f<0&&(s=o):(f=-1,s=d));return a===s?s=d:s<0&&(s=e.length),e.slice(a,s)}function F4(e){if(Lo(e),e.length===0)return".";let t=-1,a=e.length,s;for(;--a;)if(e.codePointAt(a)===47){if(s){t=a;break}}else s||(s=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function z4(e){Lo(e);let t=e.length,a=-1,s=0,o=-1,u=0,d;for(;t--;){const f=e.codePointAt(t);if(f===47){if(d){s=t+1;break}continue}a<0&&(d=!0,a=t+1),f===46?o<0?o=t:u!==1&&(u=1):o>-1&&(u=-1)}return o<0||a<0||u===0||u===1&&o===a-1&&o===s+1?"":e.slice(o,a)}function $4(...e){let t=-1,a;for(;++t<e.length;)Lo(e[t]),e[t]&&(a=a===void 0?e[t]:a+"/"+e[t]);return a===void 0?".":q4(a)}function q4(e){Lo(e);const t=e.codePointAt(0)===47;let a=Y4(e,!t);return a.length===0&&!t&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),t?"/"+a:a}function Y4(e,t){let a="",s=0,o=-1,u=0,d=-1,f,m;for(;++d<=e.length;){if(d<e.length)f=e.codePointAt(d);else{if(f===47)break;f=47}if(f===47){if(!(o===d-1||u===1))if(o!==d-1&&u===2){if(a.length<2||s!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(m=a.lastIndexOf("/"),m!==a.length-1){m<0?(a="",s=0):(a=a.slice(0,m),s=a.length-1-a.lastIndexOf("/")),o=d,u=0;continue}}else if(a.length>0){a="",s=0,o=d,u=0;continue}}t&&(a=a.length>0?a+"/..":"..",s=2)}else a.length>0?a+="/"+e.slice(o+1,d):a=e.slice(o+1,d),s=d-o-1;o=d,u=0}else f===46&&u>-1?u++:u=-1}return a}function Lo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const G4={cwd:K4};function K4(){return"/"}function vh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function V4(e){if(typeof e=="string")e=new URL(e);else if(!vh(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return X4(e)}function X4(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const t=e.pathname;let a=-1;for(;++a<t.length;)if(t.codePointAt(a)===37&&t.codePointAt(a+1)===50){const s=t.codePointAt(a+2);if(s===70||s===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const Lm=["history","path","basename","stem","extname","dirname"];class wN{constructor(t){let a;t?vh(t)?a={path:t}:typeof t=="string"||Q4(t)?a={value:t}:a=t:a={},this.cwd="cwd"in a?"":G4.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<Lm.length;){const u=Lm[s];u in a&&a[u]!==void 0&&a[u]!==null&&(this[u]=u==="history"?[...a[u]]:a[u])}let o;for(o in a)Lm.includes(o)||(this[o]=a[o])}get basename(){return typeof this.path=="string"?Xa.basename(this.path):void 0}set basename(t){Bm(t,"basename"),jm(t,"basename"),this.path=Xa.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Xa.dirname(this.path):void 0}set dirname(t){v1(this.basename,"dirname"),this.path=Xa.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Xa.extname(this.path):void 0}set extname(t){if(jm(t,"extname"),v1(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Xa.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){vh(t)&&(t=V4(t)),Bm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Xa.basename(this.path,this.extname):void 0}set stem(t){Bm(t,"stem"),jm(t,"stem"),this.path=Xa.join(this.dirname||"",t+(this.extname||""))}fail(t,a,s){const o=this.message(t,a,s);throw o.fatal=!0,o}info(t,a,s){const o=this.message(t,a,s);return o.fatal=void 0,o}message(t,a,s){const o=new Rn(t,a,s);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function jm(e,t){if(e&&e.includes(Xa.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Xa.sep+"`")}function Bm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function v1(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Q4(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const W4=(function(e){const s=this.constructor.prototype,o=s[e],u=function(){return o.apply(u,arguments)};return Object.setPrototypeOf(u,s),u}),Z4={}.hasOwnProperty;class fp extends W4{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=P4()}copy(){const t=new fp;let a=-1;for(;++a<this.attachers.length;){const s=this.attachers[a];t.use(...s)}return t.data(Dm(!0,{},this.namespace)),t}data(t,a){return typeof t=="string"?arguments.length===2?(Hm("data",this.frozen),this.namespace[t]=a,this):Z4.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Hm("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[a,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const o=a.call(t,...s);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const a=sc(t),s=this.parser||this.Parser;return Pm("parse",s),s(String(a),a)}process(t,a){const s=this;return this.freeze(),Pm("process",this.parser||this.Parser),Um("process",this.compiler||this.Compiler),a?o(void 0,a):new Promise(o);function o(u,d){const f=sc(t),m=s.parse(f);s.run(m,f,function(b,g,y){if(b||!g||!y)return h(b);const N=g,v=s.stringify(N,y);tO(v)?y.value=v:y.result=v,h(b,y)});function h(b,g){b||!g?d(b):u?u(g):a(void 0,g)}}}processSync(t){let a=!1,s;return this.freeze(),Pm("processSync",this.parser||this.Parser),Um("processSync",this.compiler||this.Compiler),this.process(t,o),A1("processSync","process",a),s;function o(u,d){a=!0,T1(u),s=d}}run(t,a,s){S1(t),this.freeze();const o=this.transformers;return!s&&typeof a=="function"&&(s=a,a=void 0),s?u(void 0,s):new Promise(u);function u(d,f){const m=sc(a);o.run(t,m,h);function h(b,g,y){const N=g||t;b?f(b):d?d(N):s(void 0,N,y)}}}runSync(t,a){let s=!1,o;return this.run(t,a,u),A1("runSync","run",s),o;function u(d,f){T1(d),o=f,s=!0}}stringify(t,a){this.freeze();const s=sc(a),o=this.compiler||this.Compiler;return Um("stringify",o),S1(t),o(t,s)}use(t,...a){const s=this.attachers,o=this.namespace;if(Hm("use",this.frozen),t!=null)if(typeof t=="function")m(t,a);else if(typeof t=="object")Array.isArray(t)?f(t):d(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function u(h){if(typeof h=="function")m(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[b,...g]=h;m(b,g)}else d(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function d(h){if(!("plugins"in h)&&!("settings"in h))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");f(h.plugins),h.settings&&(o.settings=Dm(!0,o.settings,h.settings))}function f(h){let b=-1;if(h!=null)if(Array.isArray(h))for(;++b<h.length;){const g=h[b];u(g)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function m(h,b){let g=-1,y=-1;for(;++g<s.length;)if(s[g][0]===h){y=g;break}if(y===-1)s.push([h,...b]);else if(b.length>0){let[N,...v]=b;const S=s[y][1];_h(S)&&_h(N)&&(N=Dm(!0,S,N)),s[y]=[h,N,...v]}}}}const J4=new fp().freeze();function Pm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Um(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Hm(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function S1(e){if(!_h(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function A1(e,t,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function sc(e){return eO(e)?e:new wN(e)}function eO(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function tO(e){return typeof e=="string"||nO(e)}function nO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const aO="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",w1=[],C1={allowDangerousHtml:!0},rO=/^(https?|ircs?|mailto|xmpp)$/i,sO=[{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 cs(e){const t=iO(e),a=lO(e);return oO(t.runSync(t.parse(a),a),e)}function iO(e){const t=e.rehypePlugins||w1,a=e.remarkPlugins||w1,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...C1}:C1;return J4().use(FR).use(a).use(L4,s).use(t)}function lO(e){const t=e.children||"",a=new wN;return typeof t=="string"&&(a.value=t),a}function oO(e,t){const a=t.allowedElements,s=t.allowElement,o=t.components,u=t.disallowedElements,d=t.skipHtml,f=t.unwrapDisallowed,m=t.urlTransform||uO;for(const b of sO)Object.hasOwn(t,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+aO+b.id,void 0);return Do(e,h),vC(e,{Fragment:l.Fragment,components:o,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function h(b,g,y){if(b.type==="raw"&&y&&typeof g=="number")return d?y.children.splice(g,1):y.children[g]={type:"text",value:b.value},g;if(b.type==="element"){let N;for(N in Rm)if(Object.hasOwn(Rm,N)&&Object.hasOwn(b.properties,N)){const v=b.properties[N],S=Rm[N];(S===null||S.includes(b.tagName))&&(b.properties[N]=m(String(v||""),N,b))}}if(b.type==="element"){let N=a?!a.includes(b.tagName):u?u.includes(b.tagName):!1;if(!N&&s&&typeof g=="number"&&(N=!s(b,g,y)),N&&y&&typeof g=="number")return f&&b.children?y.children.splice(g,1,...b.children):y.children.splice(g,1),g}}}function uO(e){const t=e.indexOf(":"),a=e.indexOf("?"),s=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||a!==-1&&t>a||s!==-1&&t>s||rO.test(e.slice(0,t))?e:""}function k1(e,t){const a=String(e);if(typeof t!="string")throw new TypeError("Expected character");let s=0,o=a.indexOf(t);for(;o!==-1;)s++,o=a.indexOf(t,o+t.length);return s}function cO(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function dO(e,t,a){const o=Mo((a||{}).ignore||[]),u=fO(t);let d=-1;for(;++d<u.length;)AN(e,"text",f);function f(h,b){let g=-1,y;for(;++g<b.length;){const N=b[g],v=y?y.children:void 0;if(o(N,v?v.indexOf(N):void 0,y))return;y=N}if(y)return m(h,b)}function m(h,b){const g=b[b.length-1],y=u[d][0],N=u[d][1];let v=0;const w=g.children.indexOf(h);let A=!1,R=[];y.lastIndex=0;let I=y.exec(h.value);for(;I;){const Y=I.index,B={index:I.index,input:I.input,stack:[...b,h]};let C=N(...I,B);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?y.lastIndex=Y+1:(v!==Y&&R.push({type:"text",value:h.value.slice(v,Y)}),Array.isArray(C)?R.push(...C):C&&R.push(C),v=Y+I[0].length,A=!0),!y.global)break;I=y.exec(h.value)}return A?(v<h.value.length&&R.push({type:"text",value:h.value.slice(v)}),g.children.splice(w,1,...R)):R=[h],w+R.length}}function fO(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let s=-1;for(;++s<a.length;){const o=a[s];t.push([mO(o[0]),hO(o[1])])}return t}function mO(e){return typeof e=="string"?new RegExp(cO(e),"g"):e}function hO(e){return typeof e=="function"?e:function(){return e}}const Fm="phrasing",zm=["autolink","link","image","label"];function pO(){return{transforms:[TO],enter:{literalAutolink:bO,literalAutolinkEmail:$m,literalAutolinkHttp:$m,literalAutolinkWww:$m},exit:{literalAutolink:NO,literalAutolinkEmail:yO,literalAutolinkHttp:xO,literalAutolinkWww:EO}}}function gO(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Fm,notInConstruct:zm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Fm,notInConstruct:zm},{character:":",before:"[ps]",after:"\\/",inConstruct:Fm,notInConstruct:zm}]}}function bO(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function $m(e){this.config.enter.autolinkProtocol.call(this,e)}function xO(e){this.config.exit.autolinkProtocol.call(this,e)}function EO(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function yO(e){this.config.exit.autolinkEmail.call(this,e)}function NO(e){this.exit(e)}function TO(e){dO(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,_O],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),vO]],{ignore:["link","linkReference"]})}function _O(e,t,a,s,o){let u="";if(!CN(o)||(/^w/i.test(t)&&(a=t+a,t="",u="http://"),!SO(a)))return!1;const d=AO(a+s);if(!d[0])return!1;const f={type:"link",title:null,url:u+t+d[0],children:[{type:"text",value:t+d[0]}]};return d[1]?[f,{type:"text",value:d[1]}]:f}function vO(e,t,a,s){return!CN(s,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function SO(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function AO(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let a=t[0],s=a.indexOf(")");const o=k1(e,"(");let u=k1(e,")");for(;s!==-1&&o>u;)e+=a.slice(0,s+1),a=a.slice(s+1),s=a.indexOf(")"),u++;return[e,a]}function CN(e,t){const a=e.input.charCodeAt(e.index-1);return(e.index===0||Ys(a)||nd(a))&&(!t||a!==47)}kN.peek=LO;function wO(){this.buffer()}function CO(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function kO(){this.buffer()}function RO(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function OO(e){const t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Pa(this.sliceSerialize(e)).toLowerCase(),a.label=t}function IO(e){this.exit(e)}function MO(e){const t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Pa(this.sliceSerialize(e)).toLowerCase(),a.label=t}function DO(e){this.exit(e)}function LO(){return"["}function kN(e,t,a,s){const o=a.createTracker(s);let u=o.move("[^");const d=a.enter("footnoteReference"),f=a.enter("reference");return u+=o.move(a.safe(a.associationId(e),{after:"]",before:u})),f(),d(),u+=o.move("]"),u}function jO(){return{enter:{gfmFootnoteCallString:wO,gfmFootnoteCall:CO,gfmFootnoteDefinitionLabelString:kO,gfmFootnoteDefinition:RO},exit:{gfmFootnoteCallString:OO,gfmFootnoteCall:IO,gfmFootnoteDefinitionLabelString:MO,gfmFootnoteDefinition:DO}}}function BO(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:a,footnoteReference:kN},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(s,o,u,d){const f=u.createTracker(d);let m=f.move("[^");const h=u.enter("footnoteDefinition"),b=u.enter("label");return m+=f.move(u.safe(u.associationId(s),{before:m,after:"]"})),b(),m+=f.move("]:"),s.children&&s.children.length>0&&(f.shift(4),m+=f.move((t?`
481
+ `:" ")+u.indentLines(u.containerFlow(s,f.current()),t?RN:PO))),h(),m}}function PO(e,t,a){return t===0?e:RN(e,t,a)}function RN(e,t,a){return(a?"":" ")+e}const UO=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ON.peek=qO;function HO(){return{canContainEols:["delete"],enter:{strikethrough:zO},exit:{strikethrough:$O}}}function FO(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:UO}],handlers:{delete:ON}}}function zO(e){this.enter({type:"delete",children:[]},e)}function $O(e){this.exit(e)}function ON(e,t,a,s){const o=a.createTracker(s),u=a.enter("strikethrough");let d=o.move("~~");return d+=a.containerPhrasing(e,{...o.current(),before:d,after:"~"}),d+=o.move("~~"),u(),d}function qO(){return"~"}function YO(e){return e.length}function GO(e,t){const a=t||{},s=(a.align||[]).concat(),o=a.stringLength||YO,u=[],d=[],f=[],m=[];let h=0,b=-1;for(;++b<e.length;){const S=[],w=[];let A=-1;for(e[b].length>h&&(h=e[b].length);++A<e[b].length;){const R=KO(e[b][A]);if(a.alignDelimiters!==!1){const I=o(R);w[A]=I,(m[A]===void 0||I>m[A])&&(m[A]=I)}S.push(R)}d[b]=S,f[b]=w}let g=-1;if(typeof s=="object"&&"length"in s)for(;++g<h;)u[g]=R1(s[g]);else{const S=R1(s);for(;++g<h;)u[g]=S}g=-1;const y=[],N=[];for(;++g<h;){const S=u[g];let w="",A="";S===99?(w=":",A=":"):S===108?w=":":S===114&&(A=":");let R=a.alignDelimiters===!1?1:Math.max(1,m[g]-w.length-A.length);const I=w+"-".repeat(R)+A;a.alignDelimiters!==!1&&(R=w.length+R+A.length,R>m[g]&&(m[g]=R),N[g]=R),y[g]=I}d.splice(1,0,y),f.splice(1,0,N),b=-1;const v=[];for(;++b<d.length;){const S=d[b],w=f[b];g=-1;const A=[];for(;++g<h;){const R=S[g]||"";let I="",Y="";if(a.alignDelimiters!==!1){const B=m[g]-(w[g]||0),C=u[g];C===114?I=" ".repeat(B):C===99?B%2?(I=" ".repeat(B/2+.5),Y=" ".repeat(B/2-.5)):(I=" ".repeat(B/2),Y=I):Y=" ".repeat(B)}a.delimiterStart!==!1&&!g&&A.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&R==="")&&(a.delimiterStart!==!1||g)&&A.push(" "),a.alignDelimiters!==!1&&A.push(I),A.push(R),a.alignDelimiters!==!1&&A.push(Y),a.padding!==!1&&A.push(" "),(a.delimiterEnd!==!1||g!==h-1)&&A.push("|")}v.push(a.delimiterEnd===!1?A.join("").replace(/ +$/,""):A.join(""))}return v.join(`
482
+ `)}function KO(e){return e==null?"":String(e)}function R1(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const O1={}.hasOwnProperty;function IN(e,t){const a=t||{};function s(o,...u){let d=s.invalid;const f=s.handlers;if(o&&O1.call(o,e)){const m=String(o[e]);d=O1.call(f,m)?f[m]:s.unknown}if(d)return d.call(this,o,...u)}return s.handlers=a.handlers||{},s.invalid=a.invalid,s.unknown=a.unknown,s}function VO(e,t,a,s){const o=a.enter("blockquote"),u=a.createTracker(s);u.move("> "),u.shift(2);const d=a.indentLines(a.containerFlow(e,u.current()),XO);return o(),d}function XO(e,t,a){return">"+(a?"":" ")+e}function QO(e,t){return I1(e,t.inConstruct,!0)&&!I1(e,t.notInConstruct,!1)}function I1(e,t,a){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return a;let s=-1;for(;++s<t.length;)if(e.includes(t[s]))return!0;return!1}function M1(e,t,a,s){let o=-1;for(;++o<a.unsafe.length;)if(a.unsafe[o].character===`
483
+ `&&QO(a.stack,a.unsafe[o]))return/[ \t]/.test(s.before)?"":" ";return`\\
484
+ `}function WO(e,t){const a=String(e);let s=a.indexOf(t),o=s,u=0,d=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;s!==-1;)s===o?++u>d&&(d=u):u=1,o=s+t.length,s=a.indexOf(t,o);return d}function ZO(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function JO(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function eI(e,t,a,s){const o=JO(a),u=e.value||"",d=o==="`"?"GraveAccent":"Tilde";if(ZO(e,a)){const g=a.enter("codeIndented"),y=a.indentLines(u,tI);return g(),y}const f=a.createTracker(s),m=o.repeat(Math.max(WO(u,o)+1,3)),h=a.enter("codeFenced");let b=f.move(m);if(e.lang){const g=a.enter(`codeFencedLang${d}`);b+=f.move(a.safe(e.lang,{before:b,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=a.enter(`codeFencedMeta${d}`);b+=f.move(" "),b+=f.move(a.safe(e.meta,{before:b,after:`
485
+ `,encode:["`"],...f.current()})),g()}return b+=f.move(`
486
+ `),u&&(b+=f.move(u+`
487
+ `)),b+=f.move(m),h(),b}function tI(e,t,a){return(a?"":" ")+e}function mp(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function nI(e,t,a,s){const o=mp(a),u=o==='"'?"Quote":"Apostrophe",d=a.enter("definition");let f=a.enter("label");const m=a.createTracker(s);let h=m.move("[");return h+=m.move(a.safe(a.associationId(e),{before:h,after:"]",...m.current()})),h+=m.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=a.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(a.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=a.enter("destinationRaw"),h+=m.move(a.safe(e.url,{before:h,after:e.title?" ":`
488
+ `,...m.current()}))),f(),e.title&&(f=a.enter(`title${u}`),h+=m.move(" "+o),h+=m.move(a.safe(e.title,{before:h,after:o,...m.current()})),h+=m.move(o),f()),d(),h}function aI(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function vo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Mc(e,t,a){const s=qi(e),o=qi(t);return s===void 0?o===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:s===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}MN.peek=rI;function MN(e,t,a,s){const o=aI(a),u=a.enter("emphasis"),d=a.createTracker(s),f=d.move(o);let m=d.move(a.containerPhrasing(e,{after:o,before:f,...d.current()}));const h=m.charCodeAt(0),b=Mc(s.before.charCodeAt(s.before.length-1),h,o);b.inside&&(m=vo(h)+m.slice(1));const g=m.charCodeAt(m.length-1),y=Mc(s.after.charCodeAt(0),g,o);y.inside&&(m=m.slice(0,-1)+vo(g));const N=d.move(o);return u(),a.attentionEncodeSurroundingInfo={after:y.outside,before:b.outside},f+m+N}function rI(e,t,a){return a.options.emphasis||"*"}function sI(e,t){let a=!1;return Do(e,function(s){if("value"in s&&/\r?\n|\r/.test(s.value)||s.type==="break")return a=!0,Nh}),!!((!e.depth||e.depth<3)&&sp(e)&&(t.options.setext||a))}function iI(e,t,a,s){const o=Math.max(Math.min(6,e.depth||1),1),u=a.createTracker(s);if(sI(e,a)){const b=a.enter("headingSetext"),g=a.enter("phrasing"),y=a.containerPhrasing(e,{...u.current(),before:`
489
+ `,after:`
490
+ `});return g(),b(),y+`
491
+ `+(o===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
492
+ `))+1))}const d="#".repeat(o),f=a.enter("headingAtx"),m=a.enter("phrasing");u.move(d+" ");let h=a.containerPhrasing(e,{before:"# ",after:`
493
+ `,...u.current()});return/^[\t ]/.test(h)&&(h=vo(h.charCodeAt(0))+h.slice(1)),h=h?d+" "+h:d,a.options.closeAtx&&(h+=" "+d),m(),f(),h}DN.peek=lI;function DN(e){return e.value||""}function lI(){return"<"}LN.peek=oI;function LN(e,t,a,s){const o=mp(a),u=o==='"'?"Quote":"Apostrophe",d=a.enter("image");let f=a.enter("label");const m=a.createTracker(s);let h=m.move("![");return h+=m.move(a.safe(e.alt,{before:h,after:"]",...m.current()})),h+=m.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=a.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(a.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=a.enter("destinationRaw"),h+=m.move(a.safe(e.url,{before:h,after:e.title?" ":")",...m.current()}))),f(),e.title&&(f=a.enter(`title${u}`),h+=m.move(" "+o),h+=m.move(a.safe(e.title,{before:h,after:o,...m.current()})),h+=m.move(o),f()),h+=m.move(")"),d(),h}function oI(){return"!"}jN.peek=uI;function jN(e,t,a,s){const o=e.referenceType,u=a.enter("imageReference");let d=a.enter("label");const f=a.createTracker(s);let m=f.move("![");const h=a.safe(e.alt,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),d();const b=a.stack;a.stack=[],d=a.enter("reference");const g=a.safe(a.associationId(e),{before:m,after:"]",...f.current()});return d(),a.stack=b,u(),o==="full"||!h||h!==g?m+=f.move(g+"]"):o==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function uI(){return"!"}BN.peek=cI;function BN(e,t,a){let s=e.value||"",o="`",u=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(s);)o+="`";for(/[^ \r\n]/.test(s)&&(/^[ \r\n]/.test(s)&&/[ \r\n]$/.test(s)||/^`|`$/.test(s))&&(s=" "+s+" ");++u<a.unsafe.length;){const d=a.unsafe[u],f=a.compilePattern(d);let m;if(d.atBreak)for(;m=f.exec(s);){let h=m.index;s.charCodeAt(h)===10&&s.charCodeAt(h-1)===13&&h--,s=s.slice(0,h)+" "+s.slice(m.index+1)}}return o+s+o}function cI(){return"`"}function PN(e,t){const a=sp(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}UN.peek=dI;function UN(e,t,a,s){const o=mp(a),u=o==='"'?"Quote":"Apostrophe",d=a.createTracker(s);let f,m;if(PN(e,a)){const b=a.stack;a.stack=[],f=a.enter("autolink");let g=d.move("<");return g+=d.move(a.containerPhrasing(e,{before:g,after:">",...d.current()})),g+=d.move(">"),f(),a.stack=b,g}f=a.enter("link"),m=a.enter("label");let h=d.move("[");return h+=d.move(a.containerPhrasing(e,{before:h,after:"](",...d.current()})),h+=d.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=a.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(a.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(m=a.enter("destinationRaw"),h+=d.move(a.safe(e.url,{before:h,after:e.title?" ":")",...d.current()}))),m(),e.title&&(m=a.enter(`title${u}`),h+=d.move(" "+o),h+=d.move(a.safe(e.title,{before:h,after:o,...d.current()})),h+=d.move(o),m()),h+=d.move(")"),f(),h}function dI(e,t,a){return PN(e,a)?"<":"["}HN.peek=fI;function HN(e,t,a,s){const o=e.referenceType,u=a.enter("linkReference");let d=a.enter("label");const f=a.createTracker(s);let m=f.move("[");const h=a.containerPhrasing(e,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),d();const b=a.stack;a.stack=[],d=a.enter("reference");const g=a.safe(a.associationId(e),{before:m,after:"]",...f.current()});return d(),a.stack=b,u(),o==="full"||!h||h!==g?m+=f.move(g+"]"):o==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function fI(){return"["}function hp(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function mI(e){const t=hp(e),a=e.options.bulletOther;if(!a)return t==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+a+"`) to be different");return a}function hI(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function FN(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function pI(e,t,a,s){const o=a.enter("list"),u=a.bulletCurrent;let d=e.ordered?hI(a):hp(a);const f=e.ordered?d==="."?")":".":mI(a);let m=t&&a.bulletLastUsed?d===a.bulletLastUsed:!1;if(!e.ordered){const b=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&b&&(!b.children||!b.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(m=!0),FN(a)===d&&b){let g=-1;for(;++g<e.children.length;){const y=e.children[g];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(d=f),a.bulletCurrent=d;const h=a.containerFlow(e,s);return a.bulletLastUsed=d,a.bulletCurrent=u,o(),h}function gI(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function bI(e,t,a,s){const o=gI(a);let u=a.bulletCurrent||hp(a);t&&t.type==="list"&&t.ordered&&(u=(typeof t.start=="number"&&t.start>-1?t.start:1)+(a.options.incrementListMarker===!1?0:t.children.indexOf(e))+u);let d=u.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(d=Math.ceil(d/4)*4);const f=a.createTracker(s);f.move(u+" ".repeat(d-u.length)),f.shift(d);const m=a.enter("listItem"),h=a.indentLines(a.containerFlow(e,f.current()),b);return m(),h;function b(g,y,N){return y?(N?"":" ".repeat(d))+g:(N?u:u+" ".repeat(d-u.length))+g}}function xI(e,t,a,s){const o=a.enter("paragraph"),u=a.enter("phrasing"),d=a.containerPhrasing(e,s);return u(),o(),d}const EI=Mo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function yI(e,t,a,s){return(e.children.some(function(d){return EI(d)})?a.containerPhrasing:a.containerFlow).call(a,e,s)}function NI(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}zN.peek=TI;function zN(e,t,a,s){const o=NI(a),u=a.enter("strong"),d=a.createTracker(s),f=d.move(o+o);let m=d.move(a.containerPhrasing(e,{after:o,before:f,...d.current()}));const h=m.charCodeAt(0),b=Mc(s.before.charCodeAt(s.before.length-1),h,o);b.inside&&(m=vo(h)+m.slice(1));const g=m.charCodeAt(m.length-1),y=Mc(s.after.charCodeAt(0),g,o);y.inside&&(m=m.slice(0,-1)+vo(g));const N=d.move(o+o);return u(),a.attentionEncodeSurroundingInfo={after:y.outside,before:b.outside},f+m+N}function TI(e,t,a){return a.options.strong||"*"}function _I(e,t,a,s){return a.safe(e.value,s)}function vI(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function SI(e,t,a){const s=(FN(a)+(a.options.ruleSpaces?" ":"")).repeat(vI(a));return a.options.ruleSpaces?s.slice(0,-1):s}const $N={blockquote:VO,break:M1,code:eI,definition:nI,emphasis:MN,hardBreak:M1,heading:iI,html:DN,image:LN,imageReference:jN,inlineCode:BN,link:UN,linkReference:HN,list:pI,listItem:bI,paragraph:xI,root:yI,strong:zN,text:_I,thematicBreak:SI};function AI(){return{enter:{table:wI,tableData:D1,tableHeader:D1,tableRow:kI},exit:{codeText:RI,table:CI,tableData:qm,tableHeader:qm,tableRow:qm}}}function wI(e){const t=e._align;this.enter({type:"table",align:t.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function CI(e){this.exit(e),this.data.inTable=void 0}function kI(e){this.enter({type:"tableRow",children:[]},e)}function qm(e){this.exit(e)}function D1(e){this.enter({type:"tableCell",children:[]},e)}function RI(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,OI));const a=this.stack[this.stack.length-1];a.type,a.value=t,this.exit(e)}function OI(e,t){return t==="|"?t:e}function II(e){const t=e||{},a=t.tableCellPadding,s=t.tablePipeAlign,o=t.stringLength,u=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
494
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:d,tableCell:m,tableRow:f}};function d(N,v,S,w){return h(b(N,S,w),N.align)}function f(N,v,S,w){const A=g(N,S,w),R=h([A]);return R.slice(0,R.indexOf(`
495
+ `))}function m(N,v,S,w){const A=S.enter("tableCell"),R=S.enter("phrasing"),I=S.containerPhrasing(N,{...w,before:u,after:u});return R(),A(),I}function h(N,v){return GO(N,{align:v,alignDelimiters:s,padding:a,stringLength:o})}function b(N,v,S){const w=N.children;let A=-1;const R=[],I=v.enter("table");for(;++A<w.length;)R[A]=g(w[A],v,S);return I(),R}function g(N,v,S){const w=N.children;let A=-1;const R=[],I=v.enter("tableRow");for(;++A<w.length;)R[A]=m(w[A],N,v,S);return I(),R}function y(N,v,S){let w=$N.inlineCode(N,v,S);return S.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function MI(){return{exit:{taskListCheckValueChecked:L1,taskListCheckValueUnchecked:L1,paragraph:LI}}}function DI(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:jI}}}function L1(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function LI(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const s=a.children[0];if(s&&s.type==="text"){const o=t.children;let u=-1,d;for(;++u<o.length;){const f=o[u];if(f.type==="paragraph"){d=f;break}}d===a&&(s.value=s.value.slice(1),s.value.length===0?a.children.shift():a.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,a.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function jI(e,t,a,s){const o=e.children[0],u=typeof e.checked=="boolean"&&o&&o.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",f=a.createTracker(s);u&&f.move(d);let m=$N.listItem(e,t,a,{...s,...f.current()});return u&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(b){return b+d}}function BI(){return[pO(),jO(),HO(),AI(),MI()]}function PI(e){return{extensions:[gO(),BO(e),FO(),II(e),DI()]}}const UI={tokenize:YI,partial:!0},qN={tokenize:GI,partial:!0},YN={tokenize:KI,partial:!0},GN={tokenize:VI,partial:!0},HI={tokenize:XI,partial:!0},KN={name:"wwwAutolink",tokenize:$I,previous:XN},VN={name:"protocolAutolink",tokenize:qI,previous:QN},Cr={name:"emailAutolink",tokenize:zI,previous:WN},tr={};function FI(){return{text:tr}}let Bs=48;for(;Bs<123;)tr[Bs]=Cr,Bs++,Bs===58?Bs=65:Bs===91&&(Bs=97);tr[43]=Cr;tr[45]=Cr;tr[46]=Cr;tr[95]=Cr;tr[72]=[Cr,VN];tr[104]=[Cr,VN];tr[87]=[Cr,KN];tr[119]=[Cr,KN];function zI(e,t,a){const s=this;let o,u;return d;function d(g){return!Sh(g)||!WN.call(s,s.previous)||pp(s.events)?a(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return Sh(g)?(e.consume(g),f):g===64?(e.consume(g),m):a(g)}function m(g){return g===46?e.check(HI,b,h)(g):g===45||g===95||wn(g)?(u=!0,e.consume(g),m):b(g)}function h(g){return e.consume(g),o=!0,m}function b(g){return u&&o&&Bn(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):a(g)}}function $I(e,t,a){const s=this;return o;function o(d){return d!==87&&d!==119||!XN.call(s,s.previous)||pp(s.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(UI,e.attempt(qN,e.attempt(YN,u),a),a)(d))}function u(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(d)}}function qI(e,t,a){const s=this;let o="",u=!1;return d;function d(g){return(g===72||g===104)&&QN.call(s,s.previous)&&!pp(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(g),e.consume(g),f):a(g)}function f(g){if(Bn(g)&&o.length<5)return o+=String.fromCodePoint(g),e.consume(g),f;if(g===58){const y=o.toLowerCase();if(y==="http"||y==="https")return e.consume(g),m}return a(g)}function m(g){return g===47?(e.consume(g),u?h:(u=!0,m)):a(g)}function h(g){return g===null||Oc(g)||Mt(g)||Ys(g)||nd(g)?a(g):e.attempt(qN,e.attempt(YN,b),a)(g)}function b(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function YI(e,t,a){let s=0;return o;function o(d){return(d===87||d===119)&&s<3?(s++,e.consume(d),o):d===46&&s===3?(e.consume(d),u):a(d)}function u(d){return d===null?a(d):t(d)}}function GI(e,t,a){let s,o,u;return d;function d(h){return h===46||h===95?e.check(GN,m,f)(h):h===null||Mt(h)||Ys(h)||h!==45&&nd(h)?m(h):(u=!0,e.consume(h),d)}function f(h){return h===95?s=!0:(o=s,s=void 0),e.consume(h),d}function m(h){return o||s||!u?a(h):t(h)}}function KI(e,t){let a=0,s=0;return o;function o(d){return d===40?(a++,e.consume(d),o):d===41&&s<a?u(d):d===33||d===34||d===38||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===60||d===63||d===93||d===95||d===126?e.check(GN,t,u)(d):d===null||Mt(d)||Ys(d)?t(d):(e.consume(d),o)}function u(d){return d===41&&s++,e.consume(d),o}}function VI(e,t,a){return s;function s(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),s):f===38?(e.consume(f),u):f===93?(e.consume(f),o):f===60||f===null||Mt(f)||Ys(f)?t(f):a(f)}function o(f){return f===null||f===40||f===91||Mt(f)||Ys(f)?t(f):s(f)}function u(f){return Bn(f)?d(f):a(f)}function d(f){return f===59?(e.consume(f),s):Bn(f)?(e.consume(f),d):a(f)}}function XI(e,t,a){return s;function s(u){return e.consume(u),o}function o(u){return wn(u)?a(u):t(u)}}function XN(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Mt(e)}function QN(e){return!Bn(e)}function WN(e){return!(e===47||Sh(e))}function Sh(e){return e===43||e===45||e===46||e===95||wn(e)}function pp(e){let t=e.length,a=!1;for(;t--;){const s=e[t][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){a=!0;break}if(s._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const QI={tokenize:r6,partial:!0};function WI(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:t6,continuation:{tokenize:n6},exit:a6}},text:{91:{name:"gfmFootnoteCall",tokenize:e6},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ZI,resolveTo:JI}}}}function ZI(e,t,a){const s=this;let o=s.events.length;const u=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let d;for(;o--;){const m=s.events[o][1];if(m.type==="labelImage"){d=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return f;function f(m){if(!d||!d._balanced)return a(m);const h=Pa(s.sliceSerialize({start:d.end,end:s.now()}));return h.codePointAt(0)!==94||!u.includes(h.slice(1))?a(m):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),t(m))}}function JI(e,t){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const s={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const u={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},u.start),end:Object.assign({},u.end)},f=[e[a+1],e[a+2],["enter",s,t],e[a+3],e[a+4],["enter",o,t],["exit",o,t],["enter",u,t],["enter",d,t],["exit",d,t],["exit",u,t],e[e.length-2],e[e.length-1],["exit",s,t]];return e.splice(a,e.length-a+1,...f),e}function e6(e,t,a){const s=this,o=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let u=0,d;return f;function f(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),m}function m(g){return g!==94?a(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(g){if(u>999||g===93&&!d||g===null||g===91||Mt(g))return a(g);if(g===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return o.includes(Pa(s.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):a(g)}return Mt(g)||(d=!0),u++,e.consume(g),g===92?b:h}function b(g){return g===91||g===92||g===93?(e.consume(g),u++,h):h(g)}}function t6(e,t,a){const s=this,o=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let u,d=0,f;return m;function m(v){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(v){return v===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",b):a(v)}function b(v){if(d>999||v===93&&!f||v===null||v===91||Mt(v))return a(v);if(v===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return u=Pa(s.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return Mt(v)||(f=!0),d++,e.consume(v),v===92?g:b}function g(v){return v===91||v===92||v===93?(e.consume(v),d++,b):b(v)}function y(v){return v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),o.includes(u)||o.push(u),ft(e,N,"gfmFootnoteDefinitionWhitespace")):a(v)}function N(v){return t(v)}}function n6(e,t,a){return e.check(Io,t,e.attempt(QI,t,a))}function a6(e){e.exit("gfmFootnoteDefinition")}function r6(e,t,a){const s=this;return ft(e,o,"gfmFootnoteDefinitionIndent",5);function o(u){const d=s.events[s.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?t(u):a(u)}}function s6(e){let a=(e||{}).singleTilde;const s={name:"strikethrough",tokenize:u,resolveAll:o};return a==null&&(a=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function o(d,f){let m=-1;for(;++m<d.length;)if(d[m][0]==="enter"&&d[m][1].type==="strikethroughSequenceTemporary"&&d[m][1]._close){let h=m;for(;h--;)if(d[h][0]==="exit"&&d[h][1].type==="strikethroughSequenceTemporary"&&d[h][1]._open&&d[m][1].end.offset-d[m][1].start.offset===d[h][1].end.offset-d[h][1].start.offset){d[m][1].type="strikethroughSequence",d[h][1].type="strikethroughSequence";const b={type:"strikethrough",start:Object.assign({},d[h][1].start),end:Object.assign({},d[m][1].end)},g={type:"strikethroughText",start:Object.assign({},d[h][1].end),end:Object.assign({},d[m][1].start)},y=[["enter",b,f],["enter",d[h][1],f],["exit",d[h][1],f],["enter",g,f]],N=f.parser.constructs.insideSpan.null;N&&ha(y,y.length,0,ad(N,d.slice(h+1,m),f)),ha(y,y.length,0,[["exit",g,f],["enter",d[m][1],f],["exit",d[m][1],f],["exit",b,f]]),ha(d,h-1,m-h+3,y),m=h+y.length-2;break}}for(m=-1;++m<d.length;)d[m][1].type==="strikethroughSequenceTemporary"&&(d[m][1].type="data");return d}function u(d,f,m){const h=this.previous,b=this.events;let g=0;return y;function y(v){return h===126&&b[b.length-1][1].type!=="characterEscape"?m(v):(d.enter("strikethroughSequenceTemporary"),N(v))}function N(v){const S=qi(h);if(v===126)return g>1?m(v):(d.consume(v),g++,N);if(g<2&&!a)return m(v);const w=d.exit("strikethroughSequenceTemporary"),A=qi(v);return w._open=!A||A===2&&!!S,w._close=!S||S===2&&!!A,f(v)}}}class i6{constructor(){this.map=[]}add(t,a,s){l6(this,t,a,s)}consume(t){if(this.map.sort(function(u,d){return u[0]-d[0]}),this.map.length===0)return;let a=this.map.length;const s=[];for(;a>0;)a-=1,s.push(t.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),t.length=this.map[a][0];s.push(t.slice()),t.length=0;let o=s.pop();for(;o;){for(const u of o)t.push(u);o=s.pop()}this.map.length=0}}function l6(e,t,a,s){let o=0;if(!(a===0&&s.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=a,e.map[o][2].push(...s);return}o+=1}e.map.push([t,a,s])}}function o6(e,t){let a=!1;const s=[];for(;t<e.length;){const o=e[t];if(a){if(o[0]==="enter")o[1].type==="tableContent"&&s.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const u=s.length-1;s[u]=s[u]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(a=!0);t+=1}return s}function u6(){return{flow:{null:{name:"table",tokenize:c6,resolveAll:d6}}}}function c6(e,t,a){const s=this;let o=0,u=0,d;return f;function f(j){let ee=s.events.length-1;for(;ee>-1;){const q=s.events[ee][1].type;if(q==="lineEnding"||q==="linePrefix")ee--;else break}const ue=ee>-1?s.events[ee][1].type:null,Z=ue==="tableHead"||ue==="tableRow"?C:m;return Z===C&&s.parser.lazy[s.now().line]?a(j):Z(j)}function m(j){return e.enter("tableHead"),e.enter("tableRow"),h(j)}function h(j){return j===124||(d=!0,u+=1),b(j)}function b(j){return j===null?a(j):ze(j)?u>1?(u=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),N):a(j):lt(j)?ft(e,b,"whitespace")(j):(u+=1,d&&(d=!1,o+=1),j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),d=!0,b):(e.enter("data"),g(j)))}function g(j){return j===null||j===124||Mt(j)?(e.exit("data"),b(j)):(e.consume(j),j===92?y:g)}function y(j){return j===92||j===124?(e.consume(j),g):g(j)}function N(j){return s.interrupt=!1,s.parser.lazy[s.now().line]?a(j):(e.enter("tableDelimiterRow"),d=!1,lt(j)?ft(e,v,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):v(j))}function v(j){return j===45||j===58?w(j):j===124?(d=!0,e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),S):B(j)}function S(j){return lt(j)?ft(e,w,"whitespace")(j):w(j)}function w(j){return j===58?(u+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),A):j===45?(u+=1,A(j)):j===null||ze(j)?Y(j):B(j)}function A(j){return j===45?(e.enter("tableDelimiterFiller"),R(j)):B(j)}function R(j){return j===45?(e.consume(j),R):j===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),I):(e.exit("tableDelimiterFiller"),I(j))}function I(j){return lt(j)?ft(e,Y,"whitespace")(j):Y(j)}function Y(j){return j===124?v(j):j===null||ze(j)?!d||o!==u?B(j):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(j)):B(j)}function B(j){return a(j)}function C(j){return e.enter("tableRow"),z(j)}function z(j){return j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),z):j===null||ze(j)?(e.exit("tableRow"),t(j)):lt(j)?ft(e,z,"whitespace")(j):(e.enter("data"),W(j))}function W(j){return j===null||j===124||Mt(j)?(e.exit("data"),z(j)):(e.consume(j),j===92?Q:W)}function Q(j){return j===92||j===124?(e.consume(j),W):W(j)}}function d6(e,t){let a=-1,s=!0,o=0,u=[0,0,0,0],d=[0,0,0,0],f=!1,m=0,h,b,g;const y=new i6;for(;++a<e.length;){const N=e[a],v=N[1];N[0]==="enter"?v.type==="tableHead"?(f=!1,m!==0&&(j1(y,t,m,h,b),b=void 0,m=0),h={type:"table",start:Object.assign({},v.start),end:Object.assign({},v.end)},y.add(a,0,[["enter",h,t]])):v.type==="tableRow"||v.type==="tableDelimiterRow"?(s=!0,g=void 0,u=[0,0,0,0],d=[0,a+1,0,0],f&&(f=!1,b={type:"tableBody",start:Object.assign({},v.start),end:Object.assign({},v.end)},y.add(a,0,[["enter",b,t]])),o=v.type==="tableDelimiterRow"?2:b?3:1):o&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")?(s=!1,d[2]===0&&(u[1]!==0&&(d[0]=d[1],g=ic(y,t,u,o,void 0,g),u=[0,0,0,0]),d[2]=a)):v.type==="tableCellDivider"&&(s?s=!1:(u[1]!==0&&(d[0]=d[1],g=ic(y,t,u,o,void 0,g)),u=d,d=[u[1],a,0,0])):v.type==="tableHead"?(f=!0,m=a):v.type==="tableRow"||v.type==="tableDelimiterRow"?(m=a,u[1]!==0?(d[0]=d[1],g=ic(y,t,u,o,a,g)):d[1]!==0&&(g=ic(y,t,d,o,a,g)),o=0):o&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")&&(d[3]=a)}for(m!==0&&j1(y,t,m,h,b),y.consume(t.events),a=-1;++a<t.events.length;){const N=t.events[a];N[0]==="enter"&&N[1].type==="table"&&(N[1]._align=o6(t.events,a))}return e}function ic(e,t,a,s,o,u){const d=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",f="tableContent";a[0]!==0&&(u.end=Object.assign({},ji(t.events,a[0])),e.add(a[0],0,[["exit",u,t]]));const m=ji(t.events,a[1]);if(u={type:d,start:Object.assign({},m),end:Object.assign({},m)},e.add(a[1],0,[["enter",u,t]]),a[2]!==0){const h=ji(t.events,a[2]),b=ji(t.events,a[3]),g={type:f,start:Object.assign({},h),end:Object.assign({},b)};if(e.add(a[2],0,[["enter",g,t]]),s!==2){const y=t.events[a[2]],N=t.events[a[3]];if(y[1].end=Object.assign({},N[1].end),y[1].type="chunkText",y[1].contentType="text",a[3]>a[2]+1){const v=a[2]+1,S=a[3]-a[2]-1;e.add(v,S,[])}}e.add(a[3]+1,0,[["exit",g,t]])}return o!==void 0&&(u.end=Object.assign({},ji(t.events,o)),e.add(o,0,[["exit",u,t]]),u=void 0),u}function j1(e,t,a,s,o){const u=[],d=ji(t.events,a);o&&(o.end=Object.assign({},d),u.push(["exit",o,t])),s.end=Object.assign({},d),u.push(["exit",s,t]),e.add(a+1,0,u)}function ji(e,t){const a=e[t],s=a[0]==="enter"?"start":"end";return a[1][s]}const f6={name:"tasklistCheck",tokenize:h6};function m6(){return{text:{91:f6}}}function h6(e,t,a){const s=this;return o;function o(m){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?a(m):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),u)}function u(m){return Mt(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),d):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),d):a(m)}function d(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):a(m)}function f(m){return ze(m)?t(m):lt(m)?e.check({tokenize:p6},t,a)(m):a(m)}}function p6(e,t,a){return ft(e,s,"whitespace");function s(o){return o===null?a(o):t(o)}}function g6(e){return iN([FI(),WI(),s6(e),u6(),m6()])}const b6={};function ds(e){const t=this,a=e||b6,s=t.data(),o=s.micromarkExtensions||(s.micromarkExtensions=[]),u=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),d=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);o.push(g6(a)),u.push(BI()),d.push(PI(a))}const x6=5*1024*1024,B1=10,ZN=["image/png","image/jpeg","image/gif","image/webp"];let E6=0;function y6(e){return new Promise((t,a)=>{const s=new FileReader;s.onload=()=>t(String(s.result)),s.onerror=()=>a(s.error),s.readAsDataURL(e)})}function N6({url:e,label:t,onClose:a}){return _.useEffect(()=>{const s=o=>{o.key==="Escape"&&(o.preventDefault(),a())};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[a]),l.jsx("div",{role:"dialog","aria-modal":"true","aria-label":t,onClick:a,className:"fixed inset-0 z-50 flex cursor-zoom-out items-center justify-center bg-black/80 p-8 backdrop-blur-sm",children:l.jsx("img",{src:e,alt:t,className:"max-h-full max-w-full object-contain"})})}function JN({url:e,label:t,className:a}){const[s,o]=_.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",onClick:()=>o(!0),"aria-label":`预览 ${t}`,className:"block cursor-zoom-in rounded-md transition-opacity duration-150 hover:opacity-80",children:l.jsx("img",{src:e,alt:t,className:se("rounded-md border border-line",a)})}),s&&l.jsx(N6,{url:e,label:t,onClose:()=>o(!1)})]})}function eT(e=!0){const[t,a]=_.useState([]),[s,o]=_.useState(null);_.useEffect(()=>{o(null),e||a([])},[e]);const u=async b=>{const g=[],y=[],N=t.length;let v=B1-N;for(const S of b){if(v<=0){y.push(`最多 ${B1} 张图片`);break}if(!ZN.includes(S.type)){y.push(`${S.name||"文件"}:格式不支持`);continue}if(S.size>x6){y.push(`${S.name}:超过 5MB`);continue}g.push({_id:`att-${++E6}`,mime:S.type,url:await y6(S),filename:S.name}),v--}g.length>0&&a(S=>[...S,...g]),o(y.length>0?y.join(";"):null)},d=b=>{const g=Array.from(b.clipboardData.files);if(g.length!==0){if(b.preventDefault(),!e){o("当前模型不支持图片");return}u(g)}},f=b=>a(g=>g.filter(y=>y._id!==b)),m=_.useCallback(()=>{a([]),o(null)},[]),h=t.map(({mime:b,url:g,filename:y})=>({mime:b,url:g,filename:y}));return{attachments:t,promptFiles:h,error:s,setError:o,addFiles:u,onPaste:d,remove:f,clear:m}}function tT({onFiles:e,disabled:t,allowed:a}){const s=_.useRef(null);return l.jsxs(l.Fragment,{children:[l.jsx("input",{ref:s,type:"file",accept:ZN.join(","),multiple:!0,hidden:!0,onChange:o=>{e(Array.from(o.target.files??[])),o.target.value=""}}),l.jsx("button",{type:"button",onClick:()=>{var o;return(o=s.current)==null?void 0:o.click()},disabled:t||!a,"aria-label":"Attach image",title:a?"附加图片":"当前模型不支持图片",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-fg-5 transition-colors duration-150 hover:text-fg-3 disabled:cursor-not-allowed disabled:text-fg-6/40",children:l.jsx(x3,{className:"h-4 w-4"})})]})}function nT({attachments:e,error:t,onRemove:a,className:s}){return e.length===0&&!t?null:l.jsxs("div",{className:s,children:[e.length>0&&l.jsx("div",{className:"mb-2 flex flex-wrap gap-2",children:e.map(o=>l.jsxs("div",{className:"group relative",children:[l.jsx(JN,{url:o.url,label:o.filename??"attachment",className:"h-16 w-16 object-cover"}),l.jsx("button",{type:"button",onClick:()=>a(o._id),"aria-label":"Remove attachment",className:"absolute -right-1.5 -top-1.5 flex h-4 w-4 items-center justify-center rounded-full border border-line bg-term text-fg-4 opacity-0 transition-opacity duration-150 hover:text-fg-2 group-hover:opacity-100",children:l.jsx(gt,{className:"h-2.5 w-2.5",strokeWidth:2.5})})]},o._id))}),t&&l.jsx("div",{className:"mb-2 font-mono text-[11px] text-red-400",children:t})]})}function aT({isListening:e,disabled:t,onStart:a,onStop:s}){const o=_.useRef(!1),u=f=>{if(t)return;f.preventDefault(),o.current=!0,a();const m=()=>{document.removeEventListener("touchend",m),document.removeEventListener("touchcancel",m),o.current=!1,s()};document.addEventListener("touchend",m,{once:!0}),document.addEventListener("touchcancel",m,{once:!0})},d=()=>{if(t||o.current)return;a();const f=()=>{document.removeEventListener("mouseup",f),s()};document.addEventListener("mouseup",f,{once:!0})};return l.jsx("button",{type:"button",disabled:t,onTouchStart:u,onMouseDown:d,onContextMenu:f=>f.preventDefault(),"aria-label":"按住说话",title:"按住说话",style:{WebkitTouchCallout:"none"},className:se("flex shrink-0 select-none touch-none items-center justify-center transition-colors duration-150 disabled:cursor-not-allowed disabled:text-fg-6/40","order-first self-stretch w-12 rounded-xl sm:order-none sm:self-auto sm:h-7 sm:w-7 sm:rounded-md",e?"bg-red-500/15 text-red-400 hover:bg-red-500/25":"text-fg-5 hover:text-fg-3"),children:l.jsx(M3,{className:se("h-6 w-6 sm:h-4 sm:w-4",e&&"animate-pulse")})})}/*! Capacitor: https://capacitorjs.com/ - MIT License */var Gi;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(Gi||(Gi={}));class Ym extends Error{constructor(t,a,s){super(t),this.message=t,this.code=a,this.data=s}}const T6=e=>{var t,a;return e!=null&&e.androidBridge?"android":!((a=(t=e==null?void 0:e.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||a===void 0)&&a.bridge?"ios":"web"},_6=e=>{const t=e.CapacitorCustomPlatform||null,a=e.Capacitor||{},s=a.Plugins=a.Plugins||{},o=()=>t!==null?t.name:T6(e),u=()=>o()!=="web",d=g=>{const y=h.get(g);return!!(y!=null&&y.platforms.has(o())||f(g))},f=g=>{var y;return(y=a.PluginHeaders)===null||y===void 0?void 0:y.find(N=>N.name===g)},m=g=>e.console.error(g),h=new Map,b=(g,y={})=>{const N=h.get(g);if(N)return console.warn(`Capacitor plugin "${g}" already registered. Cannot register plugins twice.`),N.proxy;const v=o(),S=f(g);let w;const A=async()=>(!w&&v in y?w=typeof y[v]=="function"?w=await y[v]():w=y[v]:t!==null&&!w&&"web"in y&&(w=typeof y.web=="function"?w=await y.web():w=y.web),w),R=(W,Q)=>{var j,ee;if(S){const ue=S==null?void 0:S.methods.find(Z=>Q===Z.name);if(ue)return ue.rtype==="promise"?Z=>a.nativePromise(g,Q.toString(),Z):(Z,q)=>a.nativeCallback(g,Q.toString(),Z,q);if(W)return(j=W[Q])===null||j===void 0?void 0:j.bind(W)}else{if(W)return(ee=W[Q])===null||ee===void 0?void 0:ee.bind(W);throw new Ym(`"${g}" plugin is not implemented on ${v}`,Gi.Unimplemented)}},I=W=>{let Q;const j=(...ee)=>{const ue=A().then(Z=>{const q=R(Z,W);if(q){const F=q(...ee);return Q=F==null?void 0:F.remove,F}else throw new Ym(`"${g}.${W}()" is not implemented on ${v}`,Gi.Unimplemented)});return W==="addListener"&&(ue.remove=async()=>Q()),ue};return j.toString=()=>`${W.toString()}() { [capacitor code] }`,Object.defineProperty(j,"name",{value:W,writable:!1,configurable:!1}),j},Y=I("addListener"),B=I("removeListener"),C=(W,Q)=>{const j=Y({eventName:W},Q),ee=async()=>{const Z=await j;B({eventName:W,callbackId:Z},Q)},ue=new Promise(Z=>j.then(()=>Z({remove:ee})));return ue.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await ee()},ue},z=new Proxy({},{get(W,Q){switch(Q){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return S?C:Y;case"removeListener":return B;default:return I(Q)}}});return s[g]=z,h.set(g,{name:g,proxy:z,platforms:new Set([...Object.keys(y),...S?[v]:[]])}),z};return a.convertFileSrc||(a.convertFileSrc=g=>g),a.getPlatform=o,a.handleError=m,a.isNativePlatform=u,a.isPluginAvailable=d,a.registerPlugin=b,a.Exception=Ym,a.DEBUG=!!a.DEBUG,a.isLoggingEnabled=!!a.isLoggingEnabled,a},v6=e=>e.Capacitor=_6(e),Dc=v6(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),jo=Dc.registerPlugin;class gp{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(t,a){let s=!1;this.listeners[t]||(this.listeners[t]=[],s=!0),this.listeners[t].push(a);const u=this.windowListeners[t];u&&!u.registered&&this.addWindowListener(u),s&&this.sendRetainedArgumentsForEvent(t);const d=async()=>this.removeListener(t,a);return Promise.resolve({remove:d})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,a,s){const o=this.listeners[t];if(!o){if(s){let u=this.retainedEventArguments[t];u||(u=[]),u.push(a),this.retainedEventArguments[t]=u}return}o.forEach(u=>u(a))}hasListeners(t){var a;return!!(!((a=this.listeners[t])===null||a===void 0)&&a.length)}registerWindowListener(t,a){this.windowListeners[a]={registered:!1,windowEventName:t,pluginEventName:a,handler:s=>{this.notifyListeners(a,s)}}}unimplemented(t="not implemented"){return new Dc.Exception(t,Gi.Unimplemented)}unavailable(t="not available"){return new Dc.Exception(t,Gi.Unavailable)}async removeListener(t,a){const s=this.listeners[t];if(!s)return;const o=s.indexOf(a);this.listeners[t].splice(o,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const a=this.retainedEventArguments[t];a&&(delete this.retainedEventArguments[t],a.forEach(s=>{this.notifyListeners(t,s)}))}}const P1=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),U1=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class S6 extends gp{async getCookies(){const t=document.cookie,a={};return t.split(";").forEach(s=>{if(s.length<=0)return;let[o,u]=s.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");o=U1(o).trim(),u=U1(u).trim(),a[o]=u}),a}async setCookie(t){try{const a=P1(t.key),s=P1(t.value),o=t.expires?`; expires=${t.expires.replace("expires=","")}`:"",u=(t.path||"/").replace("path=",""),d=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${a}=${s||""}${o}; path=${u}; ${d};`}catch(a){return Promise.reject(a)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(a){return Promise.reject(a)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const a of t)document.cookie=a.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}jo("CapacitorCookies",{web:()=>new S6});const A6=async e=>new Promise((t,a)=>{const s=new FileReader;s.onload=()=>{const o=s.result;t(o.indexOf(",")>=0?o.split(",")[1]:o)},s.onerror=o=>a(o),s.readAsDataURL(e)}),w6=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(o=>o.toLocaleLowerCase()).reduce((o,u,d)=>(o[u]=e[t[d]],o),{})},C6=(e,t=!0)=>e?Object.entries(e).reduce((s,o)=>{const[u,d]=o;let f,m;return Array.isArray(d)?(m="",d.forEach(h=>{f=t?encodeURIComponent(h):h,m+=`${u}=${f}&`}),m.slice(0,-1)):(f=t?encodeURIComponent(d):d,m=`${u}=${f}`),`${s}&${m}`},"").substr(1):null,k6=(e,t={})=>{const a=Object.assign({method:e.method||"GET",headers:e.headers},t),o=w6(e.headers)["content-type"]||"";if(typeof e.data=="string")a.body=e.data;else if(o.includes("application/x-www-form-urlencoded")){const u=new URLSearchParams;for(const[d,f]of Object.entries(e.data||{}))u.set(d,f);a.body=u.toString()}else if(o.includes("multipart/form-data")||e.data instanceof FormData){const u=new FormData;if(e.data instanceof FormData)e.data.forEach((f,m)=>{u.append(m,f)});else for(const f of Object.keys(e.data))u.append(f,e.data[f]);a.body=u;const d=new Headers(a.headers);d.delete("content-type"),a.headers=d}else(o.includes("application/json")||typeof e.data=="object")&&(a.body=JSON.stringify(e.data));return a};class R6 extends gp{async request(t){const a=k6(t,t.webFetchExtra),s=C6(t.params,t.shouldEncodeUrlParams),o=s?`${t.url}?${s}`:t.url,u=await fetch(o,a),d=u.headers.get("content-type")||"";let{responseType:f="text"}=u.ok?t:{};d.includes("application/json")&&(f="json");let m,h;switch(f){case"arraybuffer":case"blob":h=await u.blob(),m=await A6(h);break;case"json":m=await u.json();break;case"document":case"text":default:m=await u.text()}const b={};return u.headers.forEach((g,y)=>{b[y]=g}),{data:m,headers:b,status:u.status,url:u.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}jo("CapacitorHttp",{web:()=>new R6});var H1;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(H1||(H1={}));var F1;(function(e){e.StatusBar="StatusBar",e.NavigationBar="NavigationBar"})(F1||(F1={}));class O6 extends gp{async setStyle(){this.unavailable("not available for web")}async setAnimation(){this.unavailable("not available for web")}async show(){this.unavailable("not available for web")}async hide(){this.unavailable("not available for web")}}jo("SystemBars",{web:()=>new O6});const I6="modulepreload",M6=function(e){return"/"+e},z1={},D6=function(t,a,s){let o=Promise.resolve();if(a&&a.length>0){let d=function(h){return Promise.all(h.map(b=>Promise.resolve(b).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),m=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));o=d(a.map(h=>{if(h=M6(h),h in z1)return;z1[h]=!0;const b=h.endsWith(".css"),g=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const y=document.createElement("link");if(y.rel=b?"stylesheet":I6,b||(y.as="script"),y.crossOrigin="",y.href=h,m&&y.setAttribute("nonce",m),document.head.appendChild(y),b)return new Promise((N,v)=>{y.addEventListener("load",N),y.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${h}`)))})}))}function u(d){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=d,window.dispatchEvent(f),!f.defaultPrevented)throw d}return o.then(d=>{for(const f of d||[])f.status==="rejected"&&u(f.reason);return t().catch(u)})},Li=jo("SpeechRecognition",{web:()=>D6(()=>import("./web-BXmpp6Wr.js"),[]).then(e=>new e.SpeechRecognitionWeb)});function L6(e,t){const a=e.length,s=new ArrayBuffer(44+a*2),o=new DataView(s),u=(d,f)=>{for(let m=0;m<f.length;m++)o.setUint8(d+m,f.charCodeAt(m))};u(0,"RIFF"),o.setUint32(4,36+a*2,!0),u(8,"WAVE"),u(12,"fmt "),o.setUint32(16,16,!0),o.setUint16(20,1,!0),o.setUint16(22,1,!0),o.setUint32(24,t,!0),o.setUint32(28,t*2,!0),o.setUint16(32,2,!0),o.setUint16(34,16,!0),u(36,"data"),o.setUint32(40,a*2,!0);for(let d=0;d<a;d++){const f=Math.max(-1,Math.min(1,e[d]));o.setInt16(44+d*2,f<0?f*32768:f*32767,!0)}return new Blob([s],{type:"audio/wav"})}const Ah=Dc.isNativePlatform(),Gm=!Ah&&typeof window<"u"?window.SpeechRecognition??window.webkitSpeechRecognition:void 0,Km=16e3;function rT(e="zh-CN"){const[t,a]=_.useState(!1),[s,o]=_.useState(""),[u,d]=_.useState(""),[f,m]=_.useState(null),[h,b]=_.useState(0),[g,y]=_.useState("idle"),N=_.useRef(null),v=_.useRef(!1),S=_.useRef([]),w=_.useRef(!1),A=_.useRef(null),R=_.useRef(!1),I=_.useRef(null),Y=_.useRef(null),B=_.useRef(null),C=_.useRef([]),z=_.useRef(!1),W=!0,Q=_.useCallback(async()=>{var ie,M,ye;(ie=B.current)==null||ie.disconnect(),(M=Y.current)==null||M.getTracks().forEach(re=>re.stop()),await((ye=I.current)==null?void 0:ye.close().catch(()=>{}));const D=C.current;if(C.current=[],B.current=null,Y.current=null,I.current=null,D.length===0||z.current){a(!1),y("idle");return}d("识别中…"),y("recognizing");const P=D.reduce((re,Ne)=>re+Ne.length,0),ae=new Float32Array(P);let K=0;for(const re of D)ae.set(re,K),K+=re.length;const k=L6(ae,Km),U=new FormData;U.append("audio",k,"recording.wav");try{const re=await fetch("/api/transcribe",{method:"POST",body:U});if(z.current)return;if(re.ok){const{text:Ne}=await re.json();Ne?(o(Ne),y("done")):y("idle")}else{const Ne=await re.json().catch(()=>({error:`HTTP ${re.status}`}));m(Ne.error??`HTTP ${re.status}`),y("idle")}}catch(re){m(`语音识别失败:${re instanceof Error?re.message:String(re)}`),y("idle")}finally{d(""),a(!1)}},[]),j=_.useCallback(async()=>{if(v.current=!0,A.current&&(clearTimeout(A.current),A.current=null),Ah){await Li.stop().catch(()=>{});for(const D of S.current)await D.remove().catch(()=>{});S.current=[],a(!1),d("")}else N.current?N.current.stop():I.current?await Q():(a(!1),y("idle"))},[Q]),ee=_.useCallback(async()=>{var K;z.current=!1,o(""),d(""),m(null),y("idle");const{available:D}=await Li.available();if(!D){m("当前设备不支持语音识别");return}if((await Li.requestPermissions()).speechRecognition!=="granted"){m("请允许语音识别权限");return}const ae=[];ae.push(await Li.addListener("partialResults",k=>{d(k.matches[0]??"")})),ae.push(await Li.addListener("listeningState",k=>{const U=k.status==="started";a(U),U&&y("recording"),U||d("")})),S.current=ae;try{const k=await Li.start({language:e,partialResults:!0,maxResults:1});(K=k.matches)!=null&&K.length&&o(U=>U+k.matches.join(""))}catch(k){m(`语音识别错误:${k instanceof Error?k.message:String(k)}`);for(const U of ae)await U.remove().catch(()=>{});S.current=[]}},[e]),ue=_.useCallback(()=>{if(!Gm)return!1;z.current=!1,o(""),d(""),m(null),y("idle"),v.current=!1;const D=new Gm;D.lang=e,D.continuous=!0,D.interimResults=!0,D.maxAlternatives=1,D.onstart=()=>{a(!0),y("recording"),w.current=!1,A.current=setTimeout(()=>{!w.current&&!v.current&&(R.current=!0,v.current=!0,D.stop(),m("语音识别服务不可用(Chrome/Edge 需连接 Google 服务器),下次将使用服务端识别"))},5e3)},D.onresult=P=>{w.current=!0,A.current&&(clearTimeout(A.current),A.current=null);let ae="",K="";for(let k=P.resultIndex;k<P.results.length;k++){const U=P.results[k][0].transcript;P.results[k].isFinal?ae+=U:K+=U}ae&&o(k=>k+ae),d(K)},D.onerror=P=>{switch(P.error!=="no-speech"&&P.error!=="aborted"&&(v.current=!0),P.error){case"not-allowed":m("请允许麦克风权限");break;case"network":m("网络错误,请检查连接");break;case"no-speech":case"aborted":return;default:m(`语音识别错误:${P.error}`)}},D.onend=()=>{if(d(""),!v.current)try{D.start();return}catch{}a(!1),N.current=null},N.current=D;try{return D.start(),!0}catch{return!1}},[e]),Z=_.useCallback(async()=>{z.current=!1,o(""),d(""),m(null),y("idle");try{const k=await fetch("/api/transcribe/status"),{available:U}=await k.json();if(!U){m("语音识别服务未就绪,请稍后重试");return}}catch{m("无法连接语音识别服务");return}let D;try{D=await navigator.mediaDevices.getUserMedia({audio:{sampleRate:Km,channelCount:1}})}catch{m("请允许麦克风权限");return}const P=new AudioContext({sampleRate:Km}),ae=P.createMediaStreamSource(D),K=P.createScriptProcessor(4096,1,1);C.current=[],K.onaudioprocess=k=>{C.current.push(new Float32Array(k.inputBuffer.getChannelData(0)))},ae.connect(K),K.connect(P.destination),I.current=P,Y.current=D,B.current=K,a(!0),y("recording")},[]),q=_.useCallback(()=>{Ah?ee():Gm&&!R.current&&ue()||Z()},[ee,ue,Z]);_.useEffect(()=>{if(!t){b(0);return}if(N.current)return;let D=!1,P=null,ae=null,K=0;return(async()=>{try{if(P=await navigator.mediaDevices.getUserMedia({audio:!0}),D){P.getTracks().forEach(re=>re.stop());return}ae=new AudioContext;const k=ae.createMediaStreamSource(P),U=ae.createAnalyser();U.fftSize=256,k.connect(U);const ie=new Uint8Array(U.frequencyBinCount);let M=0;const ye=()=>{if(D)return;U.getByteFrequencyData(ie);const re=performance.now();if(re-M>80){let Ne=0;for(let Pe=0;Pe<ie.length;Pe++)Ne+=ie[Pe];b(Ne/(ie.length*255)),M=re}K=requestAnimationFrame(ye)};K=requestAnimationFrame(ye)}catch{}})(),()=>{D=!0,cancelAnimationFrame(K),P==null||P.getTracks().forEach(k=>k.stop()),ae==null||ae.close().catch(()=>{}),b(0)}},[t]),_.useEffect(()=>{!t&&g==="recording"&&y(s?"done":"idle")},[t,g,s]),_.useEffect(()=>()=>{var D,P,ae,K;v.current=!0,(D=N.current)==null||D.stop(),(P=B.current)==null||P.disconnect(),(ae=Y.current)==null||ae.getTracks().forEach(k=>k.stop()),(K=I.current)==null||K.close().catch(()=>{});for(const k of S.current)k.remove().catch(()=>{})},[]);const F=_.useCallback(()=>{z.current=!0,o(""),d(""),y("idle")},[]);return{isSupported:W,isListening:t,phase:g,transcript:s,interimTranscript:u,error:f,volumeLevel:h,start:q,stop:j,resetTranscript:F}}function bp(e){const[t,a]=_.useState("fit"),s=t==="wide";return l.jsxs("div",{className:`md-table-wrap ${s?"md-table-wide":"md-table-fit"}`,children:[l.jsxs("button",{type:"button",className:"md-table-toggle",title:s?"适应屏幕":"超宽展开",onClick:()=>a(s?"fit":"wide"),children:[s?l.jsx(L3,{className:"h-3 w-3"}):l.jsx(v3,{className:"h-3 w-3"}),l.jsx("span",{children:s?"适应屏幕":"超宽展开"})]}),l.jsx("div",{className:"md-table-scroll",children:l.jsx("table",{...e})})]})}const fs=Ja(e=>({agents:[],loaded:!1,loadAgents:async()=>{const t=Be.getState().activeRepoId;try{const a=t?await Dy(t):await Ry();e({agents:a,loaded:!0})}catch{e({loaded:!0})}},createAgent:async(t,a)=>{const s=a?await Ly(a,t):await Oy(t);return e(o=>({agents:[...o.agents,s]})),s},updateAgent:async(t,a)=>{const s=await Iy(t,a);e(o=>({agents:o.agents.map(u=>u.id===t?s:u)}))},deleteAgent:async t=>{await Wh(t),e(a=>({agents:a.agents.filter(s=>s.id!==t)}))}}));function j6(e){if(typeof e!="string")return e;const t=e.trim();if(t)try{return JSON.parse(t)}catch{return t}}function bn(e){return e&&typeof e=="object"?e:null}function Vs(e){const t=bn(e);return t&&"properties"in t?t.properties:e}function B6(e){const t=bn(e);return typeof(t==null?void 0:t.type)=="string"?t.type:void 0}function P6(e){const t=bn(Vs(e));if(!t)return null;const a=bn(t.info);if(a&&typeof a.id=="string"){const o=Array.isArray(t.parts)?t.parts:void 0;return{...a,...o?{parts:o}:{}}}if(typeof t.id=="string"&&typeof t.role=="string")return t;const s=bn(t.message);return s&&typeof s.id=="string"?s:null}function U6(e){const t=bn(Vs(e));if(!t)return{};const a=bn(t.part)??t;return typeof a.type!="string"?{}:{messageId:typeof a.messageID=="string"&&a.messageID||typeof a.messageId=="string"&&a.messageId||typeof t.messageID=="string"&&t.messageID||typeof t.messageId=="string"&&t.messageId||void 0,part:a}}function H6(e){const t=bn(Vs(e));if(!t||t.field!=="text")return null;const a=typeof t.messageID=="string"?t.messageID:null,s=typeof t.partID=="string"?t.partID:null,o=typeof t.delta=="string"?t.delta:null;return!a||!s||o===null?null:{messageId:a,partId:s,delta:o}}function F6(e){const t=Vs(e);if(Array.isArray(t))return t;const a=bn(t);return a&&Array.isArray(a.todos)?a.todos:[]}function Ka(e){return typeof e=="number"?e:0}function z6(e){const t=bn(Vs(e));if(!t||typeof t.id!="string")return null;const a={id:t.id};typeof t.title=="string"&&(a.title=t.title),typeof t.agent=="string"&&(a.agent=t.agent),typeof t.cost=="number"&&(a.cost=t.cost);const s=typeof t.parentID=="string"?t.parentID:typeof t.parent_id=="string"?t.parent_id:void 0;s&&(a.parentID=s);const o=bn(t.tokens),u=typeof t.tokens_input=="number"||typeof t.tokens_output=="number";if(o||u){const f=o?bn(o.cache):null;a.tokens={input:Ka(o==null?void 0:o.input)||Ka(t.tokens_input),output:Ka(o==null?void 0:o.output)||Ka(t.tokens_output),reasoning:Ka(o==null?void 0:o.reasoning)||Ka(t.tokens_reasoning),cache:{read:Ka(f==null?void 0:f.read)||Ka(t.tokens_cache_read),write:Ka(f==null?void 0:f.write)||Ka(t.tokens_cache_write)}}}const d=bn(t.model);return d&&(a.model={providerID:typeof d.providerID=="string"?d.providerID:void 0,modelID:typeof d.modelID=="string"?d.modelID:void 0,variant:typeof d.variant=="string"?d.variant:void 0}),a}function $6(e){const t=bn(Vs(e));if(!t)return null;if(typeof t.message=="string")return t.message;const a=bn(t.error);if(a){const s=bn(a.data);if(typeof(s==null?void 0:s.message)=="string")return`${a.name??"Error"}: ${s.message}`;if(typeof a.message=="string")return`${a.name??"Error"}: ${a.message}`;if(typeof a.name=="string")return String(a.name)}return typeof t.reason=="string"?t.reason:null}function q6(e){const t=Vs(e);if(typeof t=="string")return t;const a=bn(t);if(typeof(a==null?void 0:a.status)=="string")return a.status;const s=bn(a==null?void 0:a.status);return typeof(s==null?void 0:s.type)=="string"?s.type:typeof(a==null?void 0:a.type)=="string"?a.type:null}function Y6(e,t,a,s){switch(e==="message"||e===""?B6(t)??e:e){case"message.updated":{const u=P6(t);u&&s.updateMessage(a,u);break}case"session.updated":{const u=z6(t);u&&s.updateSessionInfo(u);break}case"message.part.updated":{const{messageId:u,part:d}=U6(t);d&&u&&s.updateMessagePart(a,u,d);break}case"message.part.delta":{const u=H6(t);u&&s.appendMessagePartDelta(a,u.messageId,u.partId,u.delta);break}case"todo.updated":{s.updateTodos(a,F6(t));break}case"session.status":{const u=q6(t);u&&s.setSessionStatus(a,u);break}case"session.idle":{s.setSessionStatus(a,"idle");break}case"session.error":{const u=$6(t);s.setSessionStatus(a,"error",u??void 0);break}}}const G6=600*1e3;class K6{constructor(t,a){un(this,"sessionId");un(this,"idleTimer",null);un(this,"active",!1);un(this,"alive",!0);un(this,"callbacks");this.sessionId=t,this.callbacks=a,this.resetIdleTimer()}dispatch(t,a){if(!this.alive)return;this.resetIdleTimer();const s=Ie.getState();Y6(t,a,this.sessionId,s)}activate(){this.active=!0,this.clearIdleTimer()}deactivate(){this.active=!1,this.resetIdleTimer()}refreshOnIdle(){Ie.getState().refreshSessionData(this.sessionId)}stop(){this.alive=!1,this.clearIdleTimer()}resetIdleTimer(){this.clearIdleTimer(),!this.active&&(this.idleTimer=setTimeout(()=>{this.callbacks.onWorkerIdle(this.sessionId)},G6))}clearIdleTimer(){this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null)}}const V6=1e3,X6=3e4;class Q6{constructor(t,a){un(this,"source",null);un(this,"reconnectTimer",null);un(this,"attempts",0);un(this,"disposed",!1);un(this,"repoId");un(this,"onEvent");this.repoId=t,this.onEvent=a}start(){this.connect()}stop(){var t;this.disposed=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(t=this.source)==null||t.close(),this.source=null}connect(){if(this.disposed)return;const t=Nw(this.repoId),a=new EventSource(t);this.source=a,a.onopen=()=>{this.attempts=0},a.onmessage=o=>{this.handleRaw("message",o)};const s=["message.updated","message.part.updated","message.part.delta","message.removed","todo.updated","session.status","session.idle","session.error","session.updated"];for(const o of s)a.addEventListener(o,u=>{this.handleRaw(o,u)});a.onerror=()=>{if(!(this.disposed||!this.source)&&this.source.readyState===EventSource.CLOSED){this.source.close(),this.source=null;const o=Math.min(V6*2**this.attempts,X6);this.attempts++,this.reconnectTimer=setTimeout(()=>this.connect(),o)}}}handleRaw(t,a){if(!(a instanceof MessageEvent))return;const s=j6(a.data);if(s===void 0)return;const o=this.extractSessionId(s);if(!o)return;let u=t;if(t==="message"||t===""){const d=s&&typeof s=="object"?s:null;typeof(d==null?void 0:d.type)=="string"&&(u=d.type)}this.onEvent(o,u,s)}extractSessionId(t){if(!t||typeof t!="object")return null;const a=t;if(a.properties&&typeof a.properties=="object"){const s=a.properties;if(typeof s.sessionID=="string")return s.sessionID;if(typeof s.id=="string")return s.id}return typeof a.sessionID=="string"?a.sessionID:typeof a.sessionId=="string"?a.sessionId:null}}const W6=6e4;class Z6{constructor(t){un(this,"timer",null);un(this,"paused",!1);un(this,"callbacks");this.callbacks=t}start(){this.tick(),this.timer=setInterval(()=>{this.paused||this.tick()},W6)}stop(){this.timer&&(clearInterval(this.timer),this.timer=null)}pause(){this.paused=!0}resume(){this.paused=!1,this.tick()}tick(){const t=Be.getState().activeRepoId;t&&(Ie.getState().loadSessions(),Tw(t).then(a=>{const s={};for(const[o,u]of Object.entries(a))s[o]=u.type??"idle";Ie.getState().bulkSetStatuses(s);for(const[o,u]of Object.entries(s))(u==="busy"||u==="retry")&&this.callbacks.ensureWorker(o)}).catch(()=>{}))}}class J6{constructor(){un(this,"workers",new Map);un(this,"dispatcher",null);un(this,"supervisor",null);un(this,"visibilityHandler",null)}start(t){this.stop();const a={onWorkerIdle:s=>this.removeWorker(s)};this.dispatcher=new Q6(t,(s,o,u)=>{const d=this.ensureWorker(s,a);if(o==="session.idle"||o==="session.status"){const f=Ie.getState().sessionStatuses[s];d.dispatch(o,u);const m=Ie.getState().sessionStatuses[s];f&&f!=="idle"&&m==="idle"&&d.refreshOnIdle()}else d.dispatch(o,u)}),this.dispatcher.start(),this.supervisor=new Z6({ensureWorker:s=>this.ensureWorker(s,a)}),this.supervisor.start(),this.visibilityHandler=()=>{var s,o;document.hidden?(s=this.supervisor)==null||s.pause():(o=this.supervisor)==null||o.resume()},document.addEventListener("visibilitychange",this.visibilityHandler)}stop(){var t,a;(t=this.dispatcher)==null||t.stop(),this.dispatcher=null,(a=this.supervisor)==null||a.stop(),this.supervisor=null;for(const s of this.workers.values())s.stop();this.workers.clear(),this.visibilityHandler&&(document.removeEventListener("visibilitychange",this.visibilityHandler),this.visibilityHandler=null)}activateSession(t){for(const o of this.workers.values())o.sessionId!==t&&o.deactivate();if(!t)return;const a={onWorkerIdle:o=>this.removeWorker(o)};this.ensureWorker(t,a).activate(),Ie.getState().refreshSessionData(t)}deactivateSession(t){var a;(a=this.workers.get(t))==null||a.deactivate()}ensureWorker(t,a){let s=this.workers.get(t);return s||(s=new K6(t,a),this.workers.set(t,s)),s}removeWorker(t){const a=Ie.getState().activeSessionId;if(t===a)return;const s=this.workers.get(t);s&&(s.stop(),this.workers.delete(t))}}const Lc=new J6,$1=(function(e,t,a){const s=Mo(a);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(s(e.children[t],t,e))return e.children[t]}),Xs=(function(e){if(e==null)return nM;if(typeof e=="string")return tM(e);if(typeof e=="object")return eM(e);if(typeof e=="function")return xp(e);throw new Error("Expected function, string, or array as `test`")});function eM(e){const t=[];let a=-1;for(;++a<e.length;)t[a]=Xs(e[a]);return xp(s);function s(...o){let u=-1;for(;++u<t.length;)if(t[u].apply(this,o))return!0;return!1}}function tM(e){return xp(t);function t(a){return a.tagName===e}}function xp(e){return t;function t(a,s,o){return!!(aM(a)&&e.call(this,a,typeof s=="number"?s:void 0,o||void 0))}}function nM(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function aM(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const q1=/\n/g,Y1=/[\t ]+/g,wh=Xs("br"),G1=Xs(dM),rM=Xs("p"),K1=Xs("tr"),sM=Xs(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",cM,fM]),sT=Xs(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function iM(e,t){const a=t||{},s="children"in e?e.children:[],o=sT(e),u=oT(e,{whitespace:a.whitespace||"normal"}),d=[];(e.type==="text"||e.type==="comment")&&d.push(...lT(e,{breakBefore:!0,breakAfter:!0}));let f=-1;for(;++f<s.length;)d.push(...iT(s[f],e,{whitespace:u,breakBefore:f?void 0:o,breakAfter:f<s.length-1?wh(s[f+1]):o}));const m=[];let h;for(f=-1;++f<d.length;){const b=d[f];typeof b=="number"?h!==void 0&&b>h&&(h=b):b&&(h!==void 0&&h>-1&&m.push(`
496
+ `.repeat(h)||" "),h=-1,m.push(b))}return m.join("")}function iT(e,t,a){return e.type==="element"?lM(e,t,a):e.type==="text"?a.whitespace==="normal"?lT(e,a):oM(e):[]}function lM(e,t,a){const s=oT(e,a),o=e.children||[];let u=-1,d=[];if(sM(e))return d;let f,m;for(wh(e)||K1(e)&&$1(t,e,K1)?m=`
497
+ `:rM(e)?(f=2,m=2):sT(e)&&(f=1,m=1);++u<o.length;)d=d.concat(iT(o[u],e,{whitespace:s,breakBefore:u?void 0:f,breakAfter:u<o.length-1?wh(o[u+1]):m}));return G1(e)&&$1(t,e,G1)&&d.push(" "),f&&d.unshift(f),m&&d.push(m),d}function lT(e,t){const a=String(e.value),s=[],o=[];let u=0;for(;u<=a.length;){q1.lastIndex=u;const m=q1.exec(a),h=m&&"index"in m?m.index:a.length;s.push(uM(a.slice(u,h).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),u===0?t.breakBefore:!0,h===a.length?t.breakAfter:!0)),u=h+1}let d=-1,f;for(;++d<s.length;)s[d].charCodeAt(s[d].length-1)===8203||d<s.length-1&&s[d+1].charCodeAt(0)===8203?(o.push(s[d]),f=void 0):s[d]?(typeof f=="number"&&o.push(f),o.push(s[d]),f=0):(d===0||d===s.length-1)&&o.push(0);return o}function oM(e){return[String(e.value)]}function uM(e,t,a){const s=[];let o=0,u;for(;o<e.length;){Y1.lastIndex=o;const d=Y1.exec(e);u=d?d.index:e.length,!o&&!u&&d&&!t&&s.push(""),o!==u&&s.push(e.slice(o,u)),o=d?u+d[0].length:u}return o!==u&&!a&&s.push(""),s.join(" ")}function oT(e,t){if(e.type==="element"){const a=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return a.wrap?"pre-wrap":"pre";case"td":case"th":return a.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function cM(e){return!!(e.properties||{}).hidden}function dM(e){return e.tagName==="td"||e.tagName==="th"}function fM(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function mM(e){const t=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",d="(?!struct)("+s+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",f={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},b={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},a,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},N=t.optional(o)+e.IDENT_RE+"\\s*\\(",v=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],S=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],A=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],Y={type:S,keyword:v,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},B={className:"function.dispatch",relevance:0,keywords:{_hint:A},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},C=[B,g,f,a,e.C_BLOCK_COMMENT_MODE,b,h],z={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:Y,contains:C.concat([{begin:/\(/,end:/\)/,keywords:Y,contains:C.concat(["self"]),relevance:0}]),relevance:0},W={className:"function",begin:"("+d+"[\\*&\\s]+)+"+N,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:Y,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:Y,relevance:0},{begin:N,returnBegin:!0,contains:[y],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,b]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:Y,relevance:0,contains:[a,e.C_BLOCK_COMMENT_MODE,h,b,f,{begin:/\(/,end:/\)/,keywords:Y,relevance:0,contains:["self",a,e.C_BLOCK_COMMENT_MODE,h,b,f]}]},f,a,e.C_BLOCK_COMMENT_MODE,g]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:Y,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(z,W,B,C,[g,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:Y,contains:["self",f]},{begin:e.IDENT_RE+"::",keywords:Y},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function hM(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},a=mM(e),s=a.keywords;return s.type=[...s.type,...t.type],s.literal=[...s.literal,...t.literal],s.built_in=[...s.built_in,...t.built_in],s._hints=t._hints,a.name="Arduino",a.aliases=["ino"],a.supersetOf="cpp",a}function pM(e){const t=e.regex,a={},s={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[a]}]};Object.assign(a,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},s]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},u=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),d={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},f={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,a,o]};o.contains.push(f);const m={match:/\\"/},h={className:"string",begin:/'/,end:/'/},b={match:/\\'/},g={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,a]},y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],N=e.SHEBANG({binary:`(${y.join("|")})`,relevance:10}),v={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},S=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],w=["true","false"],A={match:/(\/[a-z._-]+)+/},R=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],I=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],Y=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],B=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:S,literal:w,built_in:[...R,...I,"set","shopt",...Y,...B]},contains:[N,e.SHEBANG(),v,g,u,d,A,f,m,h,b,a]}}function gM(e){const t=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",d="("+s+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",f={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},b={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},a,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},N=t.optional(o)+e.IDENT_RE+"\\s*\\(",w={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},A=[g,f,a,e.C_BLOCK_COMMENT_MODE,b,h],R={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:A.concat([{begin:/\(/,end:/\)/,keywords:w,contains:A.concat(["self"]),relevance:0}]),relevance:0},I={begin:"("+d+"[\\*&\\s]+)+"+N,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:w,relevance:0},{begin:N,returnBegin:!0,contains:[e.inherit(y,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[a,e.C_BLOCK_COMMENT_MODE,h,b,f,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",a,e.C_BLOCK_COMMENT_MODE,h,b,f]}]},f,a,e.C_BLOCK_COMMENT_MODE,g]};return{name:"C",aliases:["h"],keywords:w,disableAutodetect:!0,illegal:"</",contains:[].concat(R,I,A,[g,{begin:e.IDENT_RE+"::",keywords:w},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:g,strings:h,keywords:w}}}function bM(e){const t=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",d="(?!struct)("+s+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",f={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},b={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},a,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},N=t.optional(o)+e.IDENT_RE+"\\s*\\(",v=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],S=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],A=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],Y={type:S,keyword:v,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},B={className:"function.dispatch",relevance:0,keywords:{_hint:A},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},C=[B,g,f,a,e.C_BLOCK_COMMENT_MODE,b,h],z={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:Y,contains:C.concat([{begin:/\(/,end:/\)/,keywords:Y,contains:C.concat(["self"]),relevance:0}]),relevance:0},W={className:"function",begin:"("+d+"[\\*&\\s]+)+"+N,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:Y,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:Y,relevance:0},{begin:N,returnBegin:!0,contains:[y],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,b]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:Y,relevance:0,contains:[a,e.C_BLOCK_COMMENT_MODE,h,b,f,{begin:/\(/,end:/\)/,keywords:Y,relevance:0,contains:["self",a,e.C_BLOCK_COMMENT_MODE,h,b,f]}]},f,a,e.C_BLOCK_COMMENT_MODE,g]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:Y,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(z,W,B,C,[g,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:Y,contains:["self",f]},{begin:e.IDENT_RE+"::",keywords:Y},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function xM(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],a=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],s=["default","false","null","true"],o=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],u=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],d={keyword:o.concat(u),built_in:t,literal:s},f=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),m={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},b={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},g=e.inherit(b,{illegal:/\n/}),y={className:"subst",begin:/\{/,end:/\}/,keywords:d},N=e.inherit(y,{illegal:/\n/}),v={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,N]},S={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]},w=e.inherit(S,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},N]});y.contains=[S,v,b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,e.C_BLOCK_COMMENT_MODE],N.contains=[w,v,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const A={variants:[h,S,v,b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},R={begin:"<",end:">",contains:[{beginKeywords:"in out"},f]},I=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",Y={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:d,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},A,m,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},f,R,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[f,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[f,R,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+I+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:d,contains:[{beginKeywords:a.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,R],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,relevance:0,contains:[A,m,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Y]}}const EM=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),yM=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],NM=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],TM=[...yM,...NM],_M=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),vM=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),SM=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),AM=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function wM(e){const t=e.regex,a=EM(e),s={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},o="and or not only",u=/@-?\w[\w]*(-\w+)*/,d="[a-zA-Z-][a-zA-Z0-9_-]*",f=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[a.BLOCK_COMMENT,s,a.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+d,relevance:0},a.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+vM.join("|")+")"},{begin:":(:)?("+SM.join("|")+")"}]},a.CSS_VARIABLE,{className:"attribute",begin:"\\b("+AM.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[a.BLOCK_COMMENT,a.HEXCOLOR,a.IMPORTANT,a.CSS_NUMBER_MODE,...f,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...f,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},a.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:u},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:_M.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...f,a.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+TM.join("|")+")\\b"}]}}function CM(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function kM(e){const u={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:u,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:u,illegal:/["']/}]}]}}function RM(e){const t=e.regex,a=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(a,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function OM(e){const t=e.regex,a={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},s=e.COMMENT();s.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const o={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},u={className:"literal",begin:/\bon|off|true|false|yes|no\b/},d={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},f={begin:/\[/,end:/\]/,contains:[s,u,o,d,a,"self"],relevance:0},m=/[A-Za-z0-9_-]+/,h=/"(\\"|[^"])*"/,b=/'[^']*'/,g=t.either(m,h,b),y=t.concat(g,"(\\s*\\.\\s*",g,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[s,{className:"section",begin:/\[+/,end:/\]+/},{begin:y,className:"attr",starts:{end:/$/,contains:[s,f,u,o,d,a]}}]}}var Bi="[0-9](_*[0-9])*",lc=`\\.(${Bi})`,oc="[0-9a-fA-F](_*[0-9a-fA-F])*",V1={className:"number",variants:[{begin:`(\\b(${Bi})((${lc})|\\.)?|(${lc}))[eE][+-]?(${Bi})[fFdD]?\\b`},{begin:`\\b(${Bi})((${lc})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${lc})[fFdD]?\\b`},{begin:`\\b(${Bi})[fFdD]\\b`},{begin:`\\b0[xX]((${oc})\\.?|(${oc})?\\.(${oc}))[pP][+-]?(${Bi})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${oc})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function uT(e,t,a){return a===-1?"":e.replace(t,s=>uT(e,t,a-1))}function IM(e){const t=e.regex,a="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",s=a+uT("(?:<"+a+"~~~(?:\\s*,\\s*"+a+"~~~)*>)?",/~~~/g,2),m={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},h={className:"meta",begin:"@"+a,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},b={className:"params",begin:/\(/,end:/\)/,keywords:m,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:m,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,a],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,a),/\s+/,a,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,a],className:{1:"keyword",3:"title.class"},contains:[b,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+s+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:m,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:m,relevance:0,contains:[h,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,V1,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},V1,h]}}const X1="[A-Za-z$_][0-9A-Za-z$_]*",MM=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],DM=["true","false","null","undefined","NaN","Infinity"],cT=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],dT=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],fT=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],LM=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],jM=[].concat(fT,cT,dT);function BM(e){const t=e.regex,a=(ae,{after:K})=>{const k="</"+ae[0].slice(1);return ae.input.indexOf(k,K)!==-1},s=X1,o={begin:"<>",end:"</>"},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,d={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ae,K)=>{const k=ae[0].length+ae.index,U=ae.input[k];if(U==="<"||U===","){K.ignoreMatch();return}U===">"&&(a(ae,{after:k})||K.ignoreMatch());let ie;const M=ae.input.substring(k);if(ie=M.match(/^\s*=/)){K.ignoreMatch();return}if((ie=M.match(/^\s+extends\s+/))&&ie.index===0){K.ignoreMatch();return}}},f={$pattern:X1,keyword:MM,literal:DM,built_in:jM,"variable.language":LM},m="[0-9](_?[0-9])*",h=`\\.(${m})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${b})((${h})|\\.)?|(${h}))[eE][+-]?(${m})\\b`},{begin:`\\b(${b})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},N={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},v={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"css"}},S={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,y]},R={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},I=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,N,v,S,w,{match:/\$\d+/},g];y.contains=I.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(I)});const Y=[].concat(R,y.contains),B=Y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(Y)}]),C={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:B},z={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,t.concat(s,"(",t.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},W={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...cT,...dT]}},Q={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},j={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[C],illegal:/%/},ee={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ue(ae){return t.concat("(?!",ae.join("|"),")")}const Z={match:t.concat(/\b/,ue([...fT,"super","import"].map(ae=>`${ae}\\s*\\(`)),s,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},q={begin:t.concat(/\./,t.lookahead(t.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},C]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[C]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:W},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),Q,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,N,v,S,w,R,{match:/\$\d+/},g,W,{scope:"attr",match:s+t.lookahead(":"),relevance:0},P,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[R,e.REGEXP_MODE,{className:"function",begin:D,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:B}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:u},{begin:d.begin,"on:begin":d.isTrulyOpeningTag,end:d.end}],subLanguage:"xml",contains:[{begin:d.begin,end:d.end,skip:!0,contains:["self"]}]}]},j,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[C,e.inherit(e.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},q,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[C]},Z,ee,z,F,{match:/\$[(.]/}]}}function PM(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},a={match:/[{}[\],:]/,className:"punctuation",relevance:0},s=["true","false","null"],o={scope:"literal",beginKeywords:s.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:s},contains:[t,a,e.QUOTE_STRING_MODE,o,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Pi="[0-9](_*[0-9])*",uc=`\\.(${Pi})`,cc="[0-9a-fA-F](_*[0-9a-fA-F])*",UM={className:"number",variants:[{begin:`(\\b(${Pi})((${uc})|\\.)?|(${uc}))[eE][+-]?(${Pi})[fFdD]?\\b`},{begin:`\\b(${Pi})((${uc})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${uc})[fFdD]?\\b`},{begin:`\\b(${Pi})[fFdD]\\b`},{begin:`\\b0[xX]((${cc})\\.?|(${cc})?\\.(${cc}))[pP][+-]?(${Pi})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${cc})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function HM(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},a={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},s={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},o={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},u={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},d={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[u,o]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,u,o]}]};o.contains.push(d);const f={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},m={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(d,{className:"string"}),"self"]}]},h=UM,b=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),g={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},y=g;return y.variants[1].contains=[g],g.variants[1].contains=[y],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,b,a,s,f,m,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[g,e.C_LINE_COMMENT_MODE,b],relevance:0},e.C_LINE_COMMENT_MODE,b,f,m,d,e.C_NUMBER_MODE]},b]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},f,m]},d,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
498
+ `},h]}}const FM=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),zM=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],$M=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],qM=[...zM,...$M],YM=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),mT=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),hT=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),GM=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),KM=mT.concat(hT).sort().reverse();function VM(e){const t=FM(e),a=KM,s="and or not only",o="[\\w-]+",u="("+o+"|@\\{"+o+"\\})",d=[],f=[],m=function(I){return{className:"string",begin:"~?"+I+".*?"+I}},h=function(I,Y,B){return{className:I,begin:Y,relevance:B}},b={$pattern:/[a-z-]+/,keyword:s,attribute:YM.join(" ")},g={begin:"\\(",end:"\\)",contains:f,keywords:b,relevance:0};f.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m("'"),m('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,g,h("variable","@@?"+o,10),h("variable","@\\{"+o+"\\}"),h("built_in","~?`[^`]*?`"),{className:"attribute",begin:o+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const y=f.concat({begin:/\{/,end:/\}/,contains:d}),N={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(f)},v={begin:u+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+GM.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:f}}]},S={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:b,returnEnd:!0,contains:f,relevance:0}},w={className:"variable",variants:[{begin:"@"+o+"\\s*:",relevance:15},{begin:"@"+o}],starts:{end:"[;}]",returnEnd:!0,contains:y}},A={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:u,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,N,h("keyword","all\\b"),h("variable","@\\{"+o+"\\}"),{begin:"\\b("+qM.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,h("selector-tag",u,0),h("selector-id","#"+u),h("selector-class","\\."+u,0),h("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+mT.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+hT.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:y},{begin:"!important"},t.FUNCTION_DISPATCH]},R={begin:o+`:(:)?(${a.join("|")})`,returnBegin:!0,contains:[A]};return d.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,S,w,R,v,A,N,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:d}}function XM(e){const t="\\[=*\\[",a="\\]=*\\]",s={begin:t,end:a,contains:["self"]},o=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,a,{contains:[s],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:o.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:o}].concat(o)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:a,contains:[s],relevance:5}])}}function QM(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},a={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},s={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,a]},o={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},u={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},d={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,a,s,o,u,d]}}function WM(e){const t=e.regex,a={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},s={begin:"^[-\\*]{3,}",end:"$"},o={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},u={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},d={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},f=/[A-Za-z][A-Za-z0-9+.-]*/,m={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,f,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},h={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},b={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},g=e.inherit(h,{contains:[]}),y=e.inherit(b,{contains:[]});h.contains.push(y),b.contains.push(g);let N=[a,m];return[h,b,g,y].forEach(A=>{A.contains=A.contains.concat(N)}),N=N.concat(h,b),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:N},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:N}]}]},a,u,h,b,{className:"quote",begin:"^>\\s+",contains:N,end:"$"},o,s,m,d,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function ZM(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},a=/[a-zA-Z@][a-zA-Z0-9_]*/,f={"variable.language":["this","super"],$pattern:a,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},m={$pattern:a,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:f,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+m.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:m,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function JM(e){const t=e.regex,a=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],s=/[dualxmsipngr]{0,12}/,o={$pattern:/[\w.]+/,keyword:a.join(" ")},u={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:o},d={begin:/->\{/,end:/\}/},f={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},m={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[f]},h={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},b=[e.BACKSLASH_ESCAPE,u,m],g=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],y=(S,w,A="\\1")=>{const R=A==="\\1"?A:t.concat(A,w);return t.concat(t.concat("(?:",S,")"),w,/(?:\\.|[^\\\/])*?/,R,/(?:\\.|[^\\\/])*?/,A,s)},N=(S,w,A)=>t.concat(t.concat("(?:",S,")"),w,/(?:\\.|[^\\\/])*?/,A,s),v=[m,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),d,{className:"string",contains:b,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},h,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:y("s|tr|y",t.either(...g,{capture:!0}))},{begin:y("s|tr|y","\\(","\\)")},{begin:y("s|tr|y","\\[","\\]")},{begin:y("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:N("(?:m|qr)?",/\//,/\//)},{begin:N("m|qr",t.either(...g,{capture:!0}),/\1/)},{begin:N("m|qr",/\(/,/\)/)},{begin:N("m|qr",/\[/,/\]/)},{begin:N("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,f]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,f,h]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return u.contains=v,d.contains=v,{name:"Perl",aliases:["pl","pm"],keywords:o,contains:v}}function eD(e){const t=e.regex,a=/(?![A-Za-z0-9])(?![$])/,s=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,a),o=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,a),u=t.concat(/[A-Z]+/,a),d={scope:"variable",match:"\\$+"+s},f={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},m={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},h=e.inherit(e.APOS_STRING_MODE,{illegal:null}),b=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(m)}),g={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(m),"on:begin":(q,F)=>{F.data._beginMatch=q[1]||q[2]},"on:end":(q,F)=>{F.data._beginMatch!==q[1]&&F.ignoreMatch()}},y=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),N=`[
499
+ ]`,v={scope:"string",variants:[b,h,g,y]},S={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},w=["false","null","true"],A=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],R=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],Y={keyword:A,literal:(q=>{const F=[];return q.forEach(D=>{F.push(D),D.toLowerCase()===D?F.push(D.toUpperCase()):F.push(D.toLowerCase())}),F})(w),built_in:R},B=q=>q.map(F=>F.replace(/\|\d+$/,"")),C={variants:[{match:[/new/,t.concat(N,"+"),t.concat("(?!",B(R).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},z=t.concat(s,"\\b(?!\\()"),W={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),z],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,t.concat(/::/,t.lookahead(/(?!class\b)/)),z],scope:{1:"title.class",3:"variable.constant"}},{match:[o,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},Q={scope:"attr",match:t.concat(s,t.lookahead(":"),t.lookahead(/(?!::)/))},j={relevance:0,begin:/\(/,end:/\)/,keywords:Y,contains:[Q,d,W,e.C_BLOCK_COMMENT_MODE,v,S,C]},ee={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",B(A).join("\\b|"),"|",B(R).join("\\b|"),"\\b)"),s,t.concat(N,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[j]};j.contains.push(ee);const ue=[Q,W,e.C_BLOCK_COMMENT_MODE,v,S,C],Z={begin:t.concat(/#\[\s*\\?/,t.either(o,u)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:w,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:w,keyword:["new","array"]},contains:["self",...ue]},...ue,{scope:"meta",variants:[{match:o},{match:u}]}]};return{case_insensitive:!1,keywords:Y,contains:[Z,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},f,{scope:"variable.language",match:/\$this\b/},d,ee,W,{match:[/const/,/\s/,s],scope:{1:"keyword",3:"variable.constant"}},C,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:Y,contains:["self",Z,d,W,e.C_BLOCK_COMMENT_MODE,v,S]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},v,S]}}function tD(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function nD(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function aD(e){const t=e.regex,a=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),s=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],f={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:s,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},m={className:"meta",begin:/^(>>>|\.\.\.) /},h={className:"subst",begin:/\{/,end:/\}/,keywords:f,illegal:/#/},b={begin:/\{\{/,relevance:0},g={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,m],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,m],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,m,b,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,m,b,h]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,b,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,b,h]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},y="[0-9](_?[0-9])*",N=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,v=`\\b|${s.join("|")}`,S={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${N}))[eE][+-]?(${y})[jJ]?(?=${v})`},{begin:`(${N})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${v})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${v})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${v})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${v})`},{begin:`\\b(${y})[jJ](?=${v})`}]},w={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:f,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},A={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:["self",m,S,g,e.HASH_COMMENT_MODE]}]};return h.contains=[g,S,m],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:f,illegal:/(<\/|\?)|=>/,contains:[m,S,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},g,w,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[A]},{variants:[{match:[/\bclass/,/\s+/,a,/\s*/,/\(\s*/,a,/\s*\)/]},{match:[/\bclass/,/\s+/,a]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[S,A,g]}]}}function rD(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function sD(e){const t=e.regex,a=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,s=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),o=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,u=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:a,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:a},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[o,s]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,s]},{scope:{1:"punctuation",2:"number"},match:[u,s]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,s]}]},{scope:{3:"operator"},match:[a,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:o},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:u},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function iD(e){const t=e.regex,a="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",s=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=t.concat(s,/(::\w+)*/),d={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},f={className:"doctag",begin:"@[A-Za-z]+"},m={begin:"#<",end:">"},h=[e.COMMENT("#","$",{contains:[f]}),e.COMMENT("^=begin","^=end",{contains:[f],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],b={className:"subst",begin:/#\{/,end:/\}/,keywords:d},g={className:"string",contains:[e.BACKSLASH_ESCAPE,b],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,b]})]}]},y="[1-9](_?[0-9])*|0",N="[0-9](_?[0-9])*",v={className:"number",relevance:0,variants:[{begin:`\\b(${y})(\\.(${N}))?([eE][+-]?(${N})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},S={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:d}]},C=[g,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:d},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:d},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:s,scope:"title.class"},{match:[/def/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[S]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[g,{begin:a}],relevance:0},v,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:d},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,b],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(m,h),relevance:0}].concat(m,h);b.contains=C,S.contains=C;const j=[{begin:/^\s*=>/,starts:{end:"$",contains:C}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:d,contains:C}}];return h.unshift(m),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:d,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(j).concat(h).concat(C)}}function lD(e){const t=e.regex,a=/(r#)?/,s=t.concat(a,e.UNDERSCORE_IDENT_RE),o=t.concat(a,e.IDENT_RE),u={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,o,t.lookahead(/\s*\(/))},d="([ui](8|16|32|64|128|size)|f(32|64))?",f=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],m=["true","false","Some","None","Ok","Err"],h=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],b=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:b,keyword:f,literal:m,built_in:h},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+d},{begin:"\\b0o([0-7_]+)"+d},{begin:"\\b0x([A-Fa-f0-9_]+)"+d},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+d}],relevance:0},{begin:[/fn/,/\s+/,s],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,s],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,s,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,s],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,s],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:h,type:b}},{className:"punctuation",begin:"->"},u]}}const oD=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),uD=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],cD=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],dD=[...uD,...cD],fD=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),mD=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),hD=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),pD=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function gD(e){const t=oD(e),a=hD,s=mD,o="@[a-z-]+",u="and or not only",f={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+dD.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+s.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+a.join("|")+")"},f,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+pD.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,f,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:o,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:u,attribute:fD.join(" ")},contains:[{begin:o,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},f,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function bD(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function xD(e){const t=e.regex,a=e.COMMENT("--","$"),s={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},o={begin:/"/,end:/"/,contains:[{match:/""/}]},u=["true","false","unknown"],d=["double precision","large object","with timezone","without timezone"],f=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],m=["add","asc","collation","desc","final","first","last","view"],h=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],b=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],g=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],y=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],N=b,v=[...h,...m].filter(B=>!b.includes(B)),S={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},w={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},A={match:t.concat(/\b/,t.either(...N),/\s*\(/),relevance:0,keywords:{built_in:N}};function R(B){return t.concat(/\b/,t.either(...B.map(C=>C.replace(/\s+/,"\\s+"))),/\b/)}const I={scope:"keyword",match:R(y),relevance:0};function Y(B,{exceptions:C,when:z}={}){const W=z;return C=C||[],B.map(Q=>Q.match(/\|\d+$/)||C.includes(Q)?Q:W(Q)?`${Q}|0`:Q)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:Y(v,{when:B=>B.length<3}),literal:u,type:f,built_in:g},contains:[{scope:"type",match:R(d)},I,A,S,s,o,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,a,w]}}function pT(e){return e?typeof e=="string"?e:e.source:null}function no(e){return kt("(?=",e,")")}function kt(...e){return e.map(a=>pT(a)).join("")}function ED(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function jn(...e){return"("+(ED(e).capture?"":"?:")+e.map(s=>pT(s)).join("|")+")"}const Ep=e=>kt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),yD=["Protocol","Type"].map(Ep),Q1=["init","self"].map(Ep),ND=["Any","Self"],Vm=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],W1=["false","nil","true"],TD=["assignment","associativity","higherThan","left","lowerThan","none","right"],_D=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Z1=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],gT=jn(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),bT=jn(gT,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Xm=kt(gT,bT,"*"),xT=jn(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),jc=jn(xT,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Va=kt(xT,jc,"*"),dc=kt(/[A-Z]/,jc,"*"),vD=["attached","autoclosure",kt(/convention\(/,jn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",kt(/objc\(/,Va,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],SD=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function AD(e){const t={match:/\s+/,relevance:0},a=e.COMMENT("/\\*","\\*/",{contains:["self"]}),s=[e.C_LINE_COMMENT_MODE,a],o={match:[/\./,jn(...yD,...Q1)],className:{2:"keyword"}},u={match:kt(/\./,jn(...Vm)),relevance:0},d=Vm.filter(nt=>typeof nt=="string").concat(["_|0"]),f=Vm.filter(nt=>typeof nt!="string").concat(ND).map(Ep),m={variants:[{className:"keyword",match:jn(...f,...Q1)}]},h={$pattern:jn(/\b\w+/,/#\w+/),keyword:d.concat(_D),literal:W1},b=[o,u,m],g={match:kt(/\./,jn(...Z1)),relevance:0},y={className:"built_in",match:kt(/\b/,jn(...Z1),/(?=\()/)},N=[g,y],v={match:/->/,relevance:0},S={className:"operator",relevance:0,variants:[{match:Xm},{match:`\\.(\\.|${bT})+`}]},w=[v,S],A="([0-9]_*)+",R="([0-9a-fA-F]_*)+",I={className:"number",relevance:0,variants:[{match:`\\b(${A})(\\.(${A}))?([eE][+-]?(${A}))?\\b`},{match:`\\b0x(${R})(\\.(${R}))?([pP][+-]?(${A}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},Y=(nt="")=>({className:"subst",variants:[{match:kt(/\\/,nt,/[0\\tnr"']/)},{match:kt(/\\/,nt,/u\{[0-9a-fA-F]{1,8}\}/)}]}),B=(nt="")=>({className:"subst",match:kt(/\\/,nt,/[\t ]*(?:[\r\n]|\r\n)/)}),C=(nt="")=>({className:"subst",label:"interpol",begin:kt(/\\/,nt,/\(/),end:/\)/}),z=(nt="")=>({begin:kt(nt,/"""/),end:kt(/"""/,nt),contains:[Y(nt),B(nt),C(nt)]}),W=(nt="")=>({begin:kt(nt,/"/),end:kt(/"/,nt),contains:[Y(nt),C(nt)]}),Q={className:"string",variants:[z(),z("#"),z("##"),z("###"),W(),W("#"),W("##"),W("###")]},j=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],ee={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:j},ue=nt=>{const Fn=kt(nt,/\//),In=kt(/\//,nt);return{begin:Fn,end:In,contains:[...j,{scope:"comment",begin:`#(?!.*${In})`,end:/$/}]}},Z={scope:"regexp",variants:[ue("###"),ue("##"),ue("#"),ee]},q={match:kt(/`/,Va,/`/)},F={className:"variable",match:/\$\d+/},D={className:"variable",match:`\\$${jc}+`},P=[q,F,D],ae={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:SD,contains:[...w,I,Q]}]}},K={scope:"keyword",match:kt(/@/,jn(...vD),no(jn(/\(/,/\s+/)))},k={scope:"meta",match:kt(/@/,Va)},U=[ae,K,k],ie={match:no(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:kt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,jc,"+")},{className:"type",match:dc,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:kt(/\s+&\s+/,no(dc)),relevance:0}]},M={begin:/</,end:/>/,keywords:h,contains:[...s,...b,...U,v,ie]};ie.contains.push(M);const ye={match:kt(Va,/\s*:/),keywords:"_|0",relevance:0},re={begin:/\(/,end:/\)/,relevance:0,keywords:h,contains:["self",ye,...s,Z,...b,...N,...w,I,Q,...P,...U,ie]},Ne={begin:/</,end:/>/,keywords:"repeat each",contains:[...s,ie]},Pe={begin:jn(no(kt(Va,/\s*:/)),no(kt(Va,/\s+/,Va,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Va}]},tt={begin:/\(/,end:/\)/,keywords:h,contains:[Pe,...s,...b,...w,I,Q,...U,ie,re],endsParent:!0,illegal:/["']/},et={match:[/(func|macro)/,/\s+/,jn(q.match,Va,Xm)],className:{1:"keyword",3:"title.function"},contains:[Ne,tt,t],illegal:[/\[/,/%/]},vt={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Ne,tt,t],illegal:/\[|%/},en={match:[/operator/,/\s+/,Xm],className:{1:"keyword",3:"title"}},Hn={begin:[/precedencegroup/,/\s+/,dc],className:{1:"keyword",3:"title"},contains:[ie],keywords:[...TD,...W1],end:/}/},aa={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},xe={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},xt={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Va,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:h,contains:[Ne,...b,{begin:/:/,end:/\{/,keywords:h,contains:[{scope:"title.class.inherited",match:dc},...b],relevance:0}]};for(const nt of Q.variants){const Fn=nt.contains.find(ba=>ba.label==="interpol");Fn.keywords=h;const In=[...b,...N,...w,I,Q,...P];Fn.contains=[...In,{begin:/\(/,end:/\)/,contains:["self",...In]}]}return{name:"Swift",keywords:h,contains:[...s,et,vt,aa,xe,xt,en,Hn,{beginKeywords:"import",end:/$/,contains:[...s],relevance:0},Z,...b,...N,...w,I,Q,...P,...U,ie,re]}}const Bc="[A-Za-z$_][0-9A-Za-z$_]*",ET=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],yT=["true","false","null","undefined","NaN","Infinity"],NT=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],TT=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],_T=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],vT=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ST=[].concat(_T,NT,TT);function wD(e){const t=e.regex,a=(ae,{after:K})=>{const k="</"+ae[0].slice(1);return ae.input.indexOf(k,K)!==-1},s=Bc,o={begin:"<>",end:"</>"},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,d={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ae,K)=>{const k=ae[0].length+ae.index,U=ae.input[k];if(U==="<"||U===","){K.ignoreMatch();return}U===">"&&(a(ae,{after:k})||K.ignoreMatch());let ie;const M=ae.input.substring(k);if(ie=M.match(/^\s*=/)){K.ignoreMatch();return}if((ie=M.match(/^\s+extends\s+/))&&ie.index===0){K.ignoreMatch();return}}},f={$pattern:Bc,keyword:ET,literal:yT,built_in:ST,"variable.language":vT},m="[0-9](_?[0-9])*",h=`\\.(${m})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${b})((${h})|\\.)?|(${h}))[eE][+-]?(${m})\\b`},{begin:`\\b(${b})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},N={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},v={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"css"}},S={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,y]},R={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},I=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,N,v,S,w,{match:/\$\d+/},g];y.contains=I.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(I)});const Y=[].concat(R,y.contains),B=Y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(Y)}]),C={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:B},z={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,t.concat(s,"(",t.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},W={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...NT,...TT]}},Q={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},j={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[C],illegal:/%/},ee={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ue(ae){return t.concat("(?!",ae.join("|"),")")}const Z={match:t.concat(/\b/,ue([..._T,"super","import"].map(ae=>`${ae}\\s*\\(`)),s,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},q={begin:t.concat(/\./,t.lookahead(t.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},C]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[C]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:W},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),Q,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,N,v,S,w,R,{match:/\$\d+/},g,W,{scope:"attr",match:s+t.lookahead(":"),relevance:0},P,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[R,e.REGEXP_MODE,{className:"function",begin:D,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:B}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:u},{begin:d.begin,"on:begin":d.isTrulyOpeningTag,end:d.end}],subLanguage:"xml",contains:[{begin:d.begin,end:d.end,skip:!0,contains:["self"]}]}]},j,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[C,e.inherit(e.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},q,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[C]},Z,ee,z,F,{match:/\$[(.]/}]}}function CD(e){const t=e.regex,a=wD(e),s=Bc,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],u={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},d={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[a.exports.CLASS_REFERENCE]},f={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},m=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],h={$pattern:Bc,keyword:ET.concat(m),literal:yT,built_in:ST.concat(o),"variable.language":vT},b={className:"meta",begin:"@"+s},g=(S,w,A)=>{const R=S.contains.findIndex(I=>I.label===w);if(R===-1)throw new Error("can not find mode to replace");S.contains.splice(R,1,A)};Object.assign(a.keywords,h),a.exports.PARAMS_CONTAINS.push(b);const y=a.contains.find(S=>S.scope==="attr"),N=Object.assign({},y,{match:t.concat(s,t.lookahead(/\s*\?:/))});a.exports.PARAMS_CONTAINS.push([a.exports.CLASS_REFERENCE,y,N]),a.contains=a.contains.concat([b,u,d,N]),g(a,"shebang",e.SHEBANG()),g(a,"use_strict",f);const v=a.contains.find(S=>S.label==="func.def");return v.relevance=0,Object.assign(a,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),a}function kD(e){const t=e.regex,a={className:"string",begin:/"(""|[^/n])"C\b/},s={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o=/\d{1,2}\/\d{1,2}\/\d{4}/,u=/\d{4}-\d{1,2}-\d{1,2}/,d=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,f=/\d{1,2}(:\d{1,2}){1,2}/,m={className:"literal",variants:[{begin:t.concat(/# */,t.either(u,o),/ *#/)},{begin:t.concat(/# */,f,/ *#/)},{begin:t.concat(/# */,d,/ *#/)},{begin:t.concat(/# */,t.either(u,o),/ +/,t.either(d,f),/ *#/)}]},h={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},b={className:"label",begin:/^\w+:/},g=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),y=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[a,s,m,h,b,g,y,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[y]}]}}function RD(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const a=e.COMMENT(/;;/,/$/),s=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],o={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},u={className:"variable",begin:/\$[\w_]+/},d={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},f={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},m={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},h={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:s},contains:[a,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},u,d,o,e.QUOTE_STRING_MODE,m,h,f]}}function OD(e){const t=e.regex,a=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),s=/[\p{L}0-9._:-]+/u,o={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},u={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},d=e.inherit(u,{begin:/\(/,end:/\)/}),f=e.inherit(e.APOS_STRING_MODE,{className:"string"}),m=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),h={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:s,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[u,m,f,d,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[u,d,m,f]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[m]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[h],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[h],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(a,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:a,relevance:0,starts:h}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(a,/>/))),contains:[{className:"name",begin:a,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function ID(e){const t="true false yes no null",a="[\\w#;/?:@&=+$,.~*'()[\\]]+",s={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},o={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},u={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},d={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,o]},f=e.inherit(d,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),y={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},N={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},v={begin:/\{/,end:/\}/,contains:[N],illegal:"\\n",relevance:0},S={begin:"\\[",end:"\\]",contains:[N],illegal:"\\n",relevance:0},w=[s,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+a},{className:"type",begin:"!<"+a+">"},{className:"type",begin:"!"+a},{className:"type",begin:"!!"+a},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},y,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},v,S,u,d],A=[...w];return A.pop(),A.push(f),N.contains=A,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:w}}const MD={arduino:hM,bash:pM,c:gM,cpp:bM,csharp:xM,css:wM,diff:CM,go:kM,graphql:RM,ini:OM,java:IM,javascript:BM,json:PM,kotlin:HM,less:VM,lua:XM,makefile:QM,markdown:WM,objectivec:ZM,perl:JM,php:eD,"php-template":tD,plaintext:nD,python:aD,"python-repl":rD,r:sD,ruby:iD,rust:lD,scss:gD,shell:bD,sql:xD,swift:AD,typescript:CD,vbnet:kD,wasm:RD,xml:OD,yaml:ID};var Qm,J1;function DD(){if(J1)return Qm;J1=1;function e(X){return X instanceof Map?X.clear=X.delete=X.set=function(){throw new Error("map is read-only")}:X instanceof Set&&(X.add=X.clear=X.delete=function(){throw new Error("set is read-only")}),Object.freeze(X),Object.getOwnPropertyNames(X).forEach(pe=>{const Ce=X[pe],Ke=typeof Ce;(Ke==="object"||Ke==="function")&&!Object.isFrozen(Ce)&&e(Ce)}),X}class t{constructor(pe){pe.data===void 0&&(pe.data={}),this.data=pe.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function a(X){return X.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function s(X,...pe){const Ce=Object.create(null);for(const Ke in X)Ce[Ke]=X[Ke];return pe.forEach(function(Ke){for(const jt in Ke)Ce[jt]=Ke[jt]}),Ce}const o="</span>",u=X=>!!X.scope,d=(X,{prefix:pe})=>{if(X.startsWith("language:"))return X.replace("language:","language-");if(X.includes(".")){const Ce=X.split(".");return[`${pe}${Ce.shift()}`,...Ce.map((Ke,jt)=>`${Ke}${"_".repeat(jt+1)}`)].join(" ")}return`${pe}${X}`};class f{constructor(pe,Ce){this.buffer="",this.classPrefix=Ce.classPrefix,pe.walk(this)}addText(pe){this.buffer+=a(pe)}openNode(pe){if(!u(pe))return;const Ce=d(pe.scope,{prefix:this.classPrefix});this.span(Ce)}closeNode(pe){u(pe)&&(this.buffer+=o)}value(){return this.buffer}span(pe){this.buffer+=`<span class="${pe}">`}}const m=(X={})=>{const pe={children:[]};return Object.assign(pe,X),pe};class h{constructor(){this.rootNode=m(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(pe){this.top.children.push(pe)}openNode(pe){const Ce=m({scope:pe});this.add(Ce),this.stack.push(Ce)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(pe){return this.constructor._walk(pe,this.rootNode)}static _walk(pe,Ce){return typeof Ce=="string"?pe.addText(Ce):Ce.children&&(pe.openNode(Ce),Ce.children.forEach(Ke=>this._walk(pe,Ke)),pe.closeNode(Ce)),pe}static _collapse(pe){typeof pe!="string"&&pe.children&&(pe.children.every(Ce=>typeof Ce=="string")?pe.children=[pe.children.join("")]:pe.children.forEach(Ce=>{h._collapse(Ce)}))}}class b extends h{constructor(pe){super(),this.options=pe}addText(pe){pe!==""&&this.add(pe)}startScope(pe){this.openNode(pe)}endScope(){this.closeNode()}__addSublanguage(pe,Ce){const Ke=pe.root;Ce&&(Ke.scope=`language:${Ce}`),this.add(Ke)}toHTML(){return new f(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function g(X){return X?typeof X=="string"?X:X.source:null}function y(X){return S("(?=",X,")")}function N(X){return S("(?:",X,")*")}function v(X){return S("(?:",X,")?")}function S(...X){return X.map(Ce=>g(Ce)).join("")}function w(X){const pe=X[X.length-1];return typeof pe=="object"&&pe.constructor===Object?(X.splice(X.length-1,1),pe):{}}function A(...X){return"("+(w(X).capture?"":"?:")+X.map(Ke=>g(Ke)).join("|")+")"}function R(X){return new RegExp(X.toString()+"|").exec("").length-1}function I(X,pe){const Ce=X&&X.exec(pe);return Ce&&Ce.index===0}const Y=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function B(X,{joinWith:pe}){let Ce=0;return X.map(Ke=>{Ce+=1;const jt=Ce;let Rt=g(Ke),De="";for(;Rt.length>0;){const Oe=Y.exec(Rt);if(!Oe){De+=Rt;break}De+=Rt.substring(0,Oe.index),Rt=Rt.substring(Oe.index+Oe[0].length),Oe[0][0]==="\\"&&Oe[1]?De+="\\"+String(Number(Oe[1])+jt):(De+=Oe[0],Oe[0]==="("&&Ce++)}return De}).map(Ke=>`(${Ke})`).join(pe)}const C=/\b\B/,z="[a-zA-Z]\\w*",W="[a-zA-Z_]\\w*",Q="\\b\\d+(\\.\\d+)?",j="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",ee="\\b(0b[01]+)",ue="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Z=(X={})=>{const pe=/^#![ ]*\//;return X.binary&&(X.begin=S(pe,/.*\b/,X.binary,/\b.*/)),s({scope:"meta",begin:pe,end:/$/,relevance:0,"on:begin":(Ce,Ke)=>{Ce.index!==0&&Ke.ignoreMatch()}},X)},q={begin:"\\\\[\\s\\S]",relevance:0},F={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[q]},D={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[q]},P={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ae=function(X,pe,Ce={}){const Ke=s({scope:"comment",begin:X,end:pe,contains:[]},Ce);Ke.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const jt=A("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Ke.contains.push({begin:S(/[ ]+/,"(",jt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ke},K=ae("//","$"),k=ae("/\\*","\\*/"),U=ae("#","$"),ie={scope:"number",begin:Q,relevance:0},M={scope:"number",begin:j,relevance:0},ye={scope:"number",begin:ee,relevance:0},re={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[q,{begin:/\[/,end:/\]/,relevance:0,contains:[q]}]},Ne={scope:"title",begin:z,relevance:0},Pe={scope:"title",begin:W,relevance:0},tt={begin:"\\.\\s*"+W,relevance:0};var vt=Object.freeze({__proto__:null,APOS_STRING_MODE:F,BACKSLASH_ESCAPE:q,BINARY_NUMBER_MODE:ye,BINARY_NUMBER_RE:ee,COMMENT:ae,C_BLOCK_COMMENT_MODE:k,C_LINE_COMMENT_MODE:K,C_NUMBER_MODE:M,C_NUMBER_RE:j,END_SAME_AS_BEGIN:function(X){return Object.assign(X,{"on:begin":(pe,Ce)=>{Ce.data._beginMatch=pe[1]},"on:end":(pe,Ce)=>{Ce.data._beginMatch!==pe[1]&&Ce.ignoreMatch()}})},HASH_COMMENT_MODE:U,IDENT_RE:z,MATCH_NOTHING_RE:C,METHOD_GUARD:tt,NUMBER_MODE:ie,NUMBER_RE:Q,PHRASAL_WORDS_MODE:P,QUOTE_STRING_MODE:D,REGEXP_MODE:re,RE_STARTERS_RE:ue,SHEBANG:Z,TITLE_MODE:Ne,UNDERSCORE_IDENT_RE:W,UNDERSCORE_TITLE_MODE:Pe});function en(X,pe){X.input[X.index-1]==="."&&pe.ignoreMatch()}function Hn(X,pe){X.className!==void 0&&(X.scope=X.className,delete X.className)}function aa(X,pe){pe&&X.beginKeywords&&(X.begin="\\b("+X.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",X.__beforeBegin=en,X.keywords=X.keywords||X.beginKeywords,delete X.beginKeywords,X.relevance===void 0&&(X.relevance=0))}function xe(X,pe){Array.isArray(X.illegal)&&(X.illegal=A(...X.illegal))}function xt(X,pe){if(X.match){if(X.begin||X.end)throw new Error("begin & end are not supported with match");X.begin=X.match,delete X.match}}function nt(X,pe){X.relevance===void 0&&(X.relevance=1)}const Fn=(X,pe)=>{if(!X.beforeMatch)return;if(X.starts)throw new Error("beforeMatch cannot be used with starts");const Ce=Object.assign({},X);Object.keys(X).forEach(Ke=>{delete X[Ke]}),X.keywords=Ce.keywords,X.begin=S(Ce.beforeMatch,y(Ce.begin)),X.starts={relevance:0,contains:[Object.assign(Ce,{endsParent:!0})]},X.relevance=0,delete Ce.beforeMatch},In=["of","and","for","in","not","or","if","then","parent","list","value"],ba="keyword";function Ia(X,pe,Ce=ba){const Ke=Object.create(null);return typeof X=="string"?jt(Ce,X.split(" ")):Array.isArray(X)?jt(Ce,X):Object.keys(X).forEach(function(Rt){Object.assign(Ke,Ia(X[Rt],pe,Rt))}),Ke;function jt(Rt,De){pe&&(De=De.map(Oe=>Oe.toLowerCase())),De.forEach(function(Oe){const Ye=Oe.split("|");Ke[Ye[0]]=[Rt,nr(Ye[0],Ye[1])]})}}function nr(X,pe){return pe?Number(pe):Ha(X)?0:1}function Ha(X){return In.includes(X.toLowerCase())}const kr={},St=X=>{console.error(X)},ar=(X,...pe)=>{console.log(`WARN: ${X}`,...pe)},me=(X,pe)=>{kr[`${X}/${pe}`]||(console.log(`Deprecated as of ${X}. ${pe}`),kr[`${X}/${pe}`]=!0)},Se=new Error;function Fe(X,pe,{key:Ce}){let Ke=0;const jt=X[Ce],Rt={},De={};for(let Oe=1;Oe<=pe.length;Oe++)De[Oe+Ke]=jt[Oe],Rt[Oe+Ke]=!0,Ke+=R(pe[Oe-1]);X[Ce]=De,X[Ce]._emit=Rt,X[Ce]._multi=!0}function $(X){if(Array.isArray(X.begin)){if(X.skip||X.excludeBegin||X.returnBegin)throw St("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Se;if(typeof X.beginScope!="object"||X.beginScope===null)throw St("beginScope must be object"),Se;Fe(X,X.begin,{key:"beginScope"}),X.begin=B(X.begin,{joinWith:""})}}function Re(X){if(Array.isArray(X.end)){if(X.skip||X.excludeEnd||X.returnEnd)throw St("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Se;if(typeof X.endScope!="object"||X.endScope===null)throw St("endScope must be object"),Se;Fe(X,X.end,{key:"endScope"}),X.end=B(X.end,{joinWith:""})}}function mt(X){X.scope&&typeof X.scope=="object"&&X.scope!==null&&(X.beginScope=X.scope,delete X.scope)}function dn(X){mt(X),typeof X.beginScope=="string"&&(X.beginScope={_wrap:X.beginScope}),typeof X.endScope=="string"&&(X.endScope={_wrap:X.endScope}),$(X),Re(X)}function tn(X){function pe(De,Oe){return new RegExp(g(De),"m"+(X.case_insensitive?"i":"")+(X.unicodeRegex?"u":"")+(Oe?"g":""))}class Ce{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Oe,Ye){Ye.position=this.position++,this.matchIndexes[this.matchAt]=Ye,this.regexes.push([Ye,Oe]),this.matchAt+=R(Oe)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Oe=this.regexes.map(Ye=>Ye[1]);this.matcherRe=pe(B(Oe,{joinWith:"|"}),!0),this.lastIndex=0}exec(Oe){this.matcherRe.lastIndex=this.lastIndex;const Ye=this.matcherRe.exec(Oe);if(!Ye)return null;const Vt=Ye.findIndex((rr,Zs)=>Zs>0&&rr!==void 0),Ht=this.matchIndexes[Vt];return Ye.splice(0,Vt),Object.assign(Ye,Ht)}}class Ke{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Oe){if(this.multiRegexes[Oe])return this.multiRegexes[Oe];const Ye=new Ce;return this.rules.slice(Oe).forEach(([Vt,Ht])=>Ye.addRule(Vt,Ht)),Ye.compile(),this.multiRegexes[Oe]=Ye,Ye}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Oe,Ye){this.rules.push([Oe,Ye]),Ye.type==="begin"&&this.count++}exec(Oe){const Ye=this.getMatcher(this.regexIndex);Ye.lastIndex=this.lastIndex;let Vt=Ye.exec(Oe);if(this.resumingScanAtSamePosition()&&!(Vt&&Vt.index===this.lastIndex)){const Ht=this.getMatcher(0);Ht.lastIndex=this.lastIndex+1,Vt=Ht.exec(Oe)}return Vt&&(this.regexIndex+=Vt.position+1,this.regexIndex===this.count&&this.considerAll()),Vt}}function jt(De){const Oe=new Ke;return De.contains.forEach(Ye=>Oe.addRule(Ye.begin,{rule:Ye,type:"begin"})),De.terminatorEnd&&Oe.addRule(De.terminatorEnd,{type:"end"}),De.illegal&&Oe.addRule(De.illegal,{type:"illegal"}),Oe}function Rt(De,Oe){const Ye=De;if(De.isCompiled)return Ye;[Hn,xt,dn,Fn].forEach(Ht=>Ht(De,Oe)),X.compilerExtensions.forEach(Ht=>Ht(De,Oe)),De.__beforeBegin=null,[aa,xe,nt].forEach(Ht=>Ht(De,Oe)),De.isCompiled=!0;let Vt=null;return typeof De.keywords=="object"&&De.keywords.$pattern&&(De.keywords=Object.assign({},De.keywords),Vt=De.keywords.$pattern,delete De.keywords.$pattern),Vt=Vt||/\w+/,De.keywords&&(De.keywords=Ia(De.keywords,X.case_insensitive)),Ye.keywordPatternRe=pe(Vt,!0),Oe&&(De.begin||(De.begin=/\B|\b/),Ye.beginRe=pe(Ye.begin),!De.end&&!De.endsWithParent&&(De.end=/\B|\b/),De.end&&(Ye.endRe=pe(Ye.end)),Ye.terminatorEnd=g(Ye.end)||"",De.endsWithParent&&Oe.terminatorEnd&&(Ye.terminatorEnd+=(De.end?"|":"")+Oe.terminatorEnd)),De.illegal&&(Ye.illegalRe=pe(De.illegal)),De.contains||(De.contains=[]),De.contains=[].concat(...De.contains.map(function(Ht){return mn(Ht==="self"?De:Ht)})),De.contains.forEach(function(Ht){Rt(Ht,Ye)}),De.starts&&Rt(De.starts,Oe),Ye.matcher=jt(Ye),Ye}if(X.compilerExtensions||(X.compilerExtensions=[]),X.contains&&X.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return X.classNameAliases=s(X.classNameAliases||{}),Rt(X)}function Dt(X){return X?X.endsWithParent||Dt(X.starts):!1}function mn(X){return X.variants&&!X.cachedVariants&&(X.cachedVariants=X.variants.map(function(pe){return s(X,{variants:null},pe)})),X.cachedVariants?X.cachedVariants:Dt(X)?s(X,{starts:X.starts?s(X.starts):null}):Object.isFrozen(X)?s(X):X}var Et="11.11.1";class Fa extends Error{constructor(pe,Ce){super(pe),this.name="HTMLInjectionError",this.html=Ce}}const Mn=a,Uo=s,ps=Symbol("nomatch"),Ws=7,gs=function(X){const pe=Object.create(null),Ce=Object.create(null),Ke=[];let jt=!0;const Rt="Could not find the language '{}', did you forget to load/include a language module?",De={disableAutodetect:!0,name:"Plain text",contains:[]};let Oe={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:b};function Ye(_e){return Oe.noHighlightRe.test(_e)}function Vt(_e){let Ue=_e.className+" ";Ue+=_e.parentNode?_e.parentNode.className:"";const at=Oe.languageDetectRe.exec(Ue);if(at){const yt=Dn(at[1]);return yt||(ar(Rt.replace("{}",at[1])),ar("Falling back to no-highlight mode for this block.",_e)),yt?at[1]:"no-highlight"}return Ue.split(/\s+/).find(yt=>Ye(yt)||Dn(yt))}function Ht(_e,Ue,at){let yt="",Qt="";typeof Ue=="object"?(yt=_e,at=Ue.ignoreIllegals,Qt=Ue.language):(me("10.7.0","highlight(lang, code, ...args) has been deprecated."),me("10.7.0",`Please use highlight(code, options) instead.
500
+ https://github.com/highlightjs/highlight.js/issues/2277`),Qt=_e,yt=Ue),at===void 0&&(at=!0);const vn={code:yt,language:Qt};xs("before:highlight",vn);const ra=vn.result?vn.result:rr(vn.language,vn.code,at);return ra.code=vn.code,xs("after:highlight",ra),ra}function rr(_e,Ue,at,yt){const Qt=Object.create(null);function vn(we,Le){return we.keywords[Le]}function ra(){if(!qe.keywords){an.addText(Nt);return}let we=0;qe.keywordPatternRe.lastIndex=0;let Le=qe.keywordPatternRe.exec(Nt),We="";for(;Le;){We+=Nt.substring(we,Le.index);const ot=xn.case_insensitive?Le[0].toLowerCase():Le[0],qt=vn(qe,ot);if(qt){const[xa,ll]=qt;if(an.addText(We),We="",Qt[ot]=(Qt[ot]||0)+1,Qt[ot]<=Ws&&(Mr+=ll),xa.startsWith("_"))We+=Le[0];else{const Go=xn.classNameAliases[xa]||xa;sa(Le[0],Go)}}else We+=Le[0];we=qe.keywordPatternRe.lastIndex,Le=qe.keywordPatternRe.exec(Nt)}We+=Nt.substring(we),an.addText(We)}function $n(){if(Nt==="")return;let we=null;if(typeof qe.subLanguage=="string"){if(!pe[qe.subLanguage]){an.addText(Nt);return}we=rr(qe.subLanguage,Nt,!0,Yo[qe.subLanguage]),Yo[qe.subLanguage]=we._top}else we=Js(Nt,qe.subLanguage.length?qe.subLanguage:null);qe.relevance>0&&(Mr+=we.relevance),an.__addSublanguage(we._emitter,we.language)}function Lt(){qe.subLanguage!=null?$n():ra(),Nt=""}function sa(we,Le){we!==""&&(an.startScope(Le),an.addText(we),an.endScope())}function $o(we,Le){let We=1;const ot=Le.length-1;for(;We<=ot;){if(!we._emit[We]){We++;continue}const qt=xn.classNameAliases[we[We]]||we[We],xa=Le[We];qt?sa(xa,qt):(Nt=xa,ra(),Nt=""),We++}}function ti(we,Le){return we.scope&&typeof we.scope=="string"&&an.openNode(xn.classNameAliases[we.scope]||we.scope),we.beginScope&&(we.beginScope._wrap?(sa(Nt,xn.classNameAliases[we.beginScope._wrap]||we.beginScope._wrap),Nt=""):we.beginScope._multi&&($o(we.beginScope,Le),Nt="")),qe=Object.create(we,{parent:{value:qe}}),qe}function rl(we,Le,We){let ot=I(we.endRe,We);if(ot){if(we["on:end"]){const qt=new t(we);we["on:end"](Le,qt),qt.isMatchIgnored&&(ot=!1)}if(ot){for(;we.endsParent&&we.parent;)we=we.parent;return we}}if(we.endsWithParent)return rl(we.parent,Le,We)}function ni(we){return qe.matcher.regexIndex===0?(Nt+=we[0],1):(Dr=!0,0)}function dd(we){const Le=we[0],We=we.rule,ot=new t(We),qt=[We.__beforeBegin,We["on:begin"]];for(const xa of qt)if(xa&&(xa(we,ot),ot.isMatchIgnored))return ni(Le);return We.skip?Nt+=Le:(We.excludeBegin&&(Nt+=Le),Lt(),!We.returnBegin&&!We.excludeBegin&&(Nt=Le)),ti(We,we),We.returnBegin?0:Le.length}function qn(we){const Le=we[0],We=Ue.substring(we.index),ot=rl(qe,we,We);if(!ot)return ps;const qt=qe;qe.endScope&&qe.endScope._wrap?(Lt(),sa(Le,qe.endScope._wrap)):qe.endScope&&qe.endScope._multi?(Lt(),$o(qe.endScope,we)):qt.skip?Nt+=Le:(qt.returnEnd||qt.excludeEnd||(Nt+=Le),Lt(),qt.excludeEnd&&(Nt=Le));do qe.scope&&an.closeNode(),!qe.skip&&!qe.subLanguage&&(Mr+=qe.relevance),qe=qe.parent;while(qe!==ot.parent);return ot.starts&&ti(ot.starts,we),qt.returnEnd?0:Le.length}function sl(){const we=[];for(let Le=qe;Le!==xn;Le=Le.parent)Le.scope&&we.unshift(Le.scope);we.forEach(Le=>an.openNode(Le))}let Es={};function ai(we,Le){const We=Le&&Le[0];if(Nt+=we,We==null)return Lt(),0;if(Es.type==="begin"&&Le.type==="end"&&Es.index===Le.index&&We===""){if(Nt+=Ue.slice(Le.index,Le.index+1),!jt){const ot=new Error(`0 width match regex (${_e})`);throw ot.languageName=_e,ot.badRule=Es.rule,ot}return 1}if(Es=Le,Le.type==="begin")return dd(Le);if(Le.type==="illegal"&&!at){const ot=new Error('Illegal lexeme "'+We+'" for mode "'+(qe.scope||"<unnamed>")+'"');throw ot.mode=qe,ot}else if(Le.type==="end"){const ot=qn(Le);if(ot!==ps)return ot}if(Le.type==="illegal"&&We==="")return Nt+=`
501
+ `,1;if(il>1e5&&il>Le.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Nt+=We,We.length}const xn=Dn(_e);if(!xn)throw St(Rt.replace("{}",_e)),new Error('Unknown language: "'+_e+'"');const qo=tn(xn);let ri="",qe=yt||qo;const Yo={},an=new Oe.__emitter(Oe);sl();let Nt="",Mr=0,lr=0,il=0,Dr=!1;try{if(xn.__emitTokens)xn.__emitTokens(Ue,an);else{for(qe.matcher.considerAll();;){il++,Dr?Dr=!1:qe.matcher.considerAll(),qe.matcher.lastIndex=lr;const we=qe.matcher.exec(Ue);if(!we)break;const Le=Ue.substring(lr,we.index),We=ai(Le,we);lr=we.index+We}ai(Ue.substring(lr))}return an.finalize(),ri=an.toHTML(),{language:_e,value:ri,relevance:Mr,illegal:!1,_emitter:an,_top:qe}}catch(we){if(we.message&&we.message.includes("Illegal"))return{language:_e,value:Mn(Ue),illegal:!0,relevance:0,_illegalBy:{message:we.message,index:lr,context:Ue.slice(lr-100,lr+100),mode:we.mode,resultSoFar:ri},_emitter:an};if(jt)return{language:_e,value:Mn(Ue),illegal:!1,relevance:0,errorRaised:we,_emitter:an,_top:qe};throw we}}function Zs(_e){const Ue={value:Mn(_e),illegal:!1,relevance:0,_top:De,_emitter:new Oe.__emitter(Oe)};return Ue._emitter.addText(_e),Ue}function Js(_e,Ue){Ue=Ue||Oe.languages||Object.keys(pe);const at=Zs(_e),yt=Ue.filter(Dn).filter(Or).map(Lt=>rr(Lt,_e,!1));yt.unshift(at);const Qt=yt.sort((Lt,sa)=>{if(Lt.relevance!==sa.relevance)return sa.relevance-Lt.relevance;if(Lt.language&&sa.language){if(Dn(Lt.language).supersetOf===sa.language)return 1;if(Dn(sa.language).supersetOf===Lt.language)return-1}return 0}),[vn,ra]=Qt,$n=vn;return $n.secondBest=ra,$n}function za(_e,Ue,at){const yt=Ue&&Ce[Ue]||at;_e.classList.add("hljs"),_e.classList.add(`language-${yt}`)}function Xt(_e){let Ue=null;const at=Vt(_e);if(Ye(at))return;if(xs("before:highlightElement",{el:_e,language:at}),_e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",_e);return}if(_e.children.length>0&&(Oe.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(_e)),Oe.throwUnescapedHTML))throw new Fa("One of your code blocks includes unescaped HTML.",_e.innerHTML);Ue=_e;const yt=Ue.textContent,Qt=at?Ht(yt,{language:at,ignoreIllegals:!0}):Js(yt);_e.innerHTML=Qt.value,_e.dataset.highlighted="yes",za(_e,at,Qt.language),_e.result={language:Qt.language,re:Qt.relevance,relevance:Qt.relevance},Qt.secondBest&&(_e.secondBest={language:Qt.secondBest.language,relevance:Qt.secondBest.relevance}),xs("after:highlightElement",{el:_e,result:Qt,text:yt})}function _n(_e){Oe=Uo(Oe,_e)}const Rr=()=>{ei(),me("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function nl(){ei(),me("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Ho=!1;function ei(){function _e(){ei()}if(document.readyState==="loading"){Ho||window.addEventListener("DOMContentLoaded",_e,!1),Ho=!0;return}document.querySelectorAll(Oe.cssSelector).forEach(Xt)}function Fo(_e,Ue){let at=null;try{at=Ue(X)}catch(yt){if(St("Language definition for '{}' could not be registered.".replace("{}",_e)),jt)St(yt);else throw yt;at=De}at.name||(at.name=_e),pe[_e]=at,at.rawDefinition=Ue.bind(null,X),at.aliases&&sr(at.aliases,{languageName:_e})}function bs(_e){delete pe[_e];for(const Ue of Object.keys(Ce))Ce[Ue]===_e&&delete Ce[Ue]}function al(){return Object.keys(pe)}function Dn(_e){return _e=(_e||"").toLowerCase(),pe[_e]||pe[Ce[_e]]}function sr(_e,{languageName:Ue}){typeof _e=="string"&&(_e=[_e]),_e.forEach(at=>{Ce[at.toLowerCase()]=Ue})}function Or(_e){const Ue=Dn(_e);return Ue&&!Ue.disableAutodetect}function Ir(_e){_e["before:highlightBlock"]&&!_e["before:highlightElement"]&&(_e["before:highlightElement"]=Ue=>{_e["before:highlightBlock"](Object.assign({block:Ue.el},Ue))}),_e["after:highlightBlock"]&&!_e["after:highlightElement"]&&(_e["after:highlightElement"]=Ue=>{_e["after:highlightBlock"](Object.assign({block:Ue.el},Ue))})}function nn(_e){Ir(_e),Ke.push(_e)}function zo(_e){const Ue=Ke.indexOf(_e);Ue!==-1&&Ke.splice(Ue,1)}function xs(_e,Ue){const at=_e;Ke.forEach(function(yt){yt[at]&&yt[at](Ue)})}function ir(_e){return me("10.7.0","highlightBlock will be removed entirely in v12.0"),me("10.7.0","Please use highlightElement now."),Xt(_e)}Object.assign(X,{highlight:Ht,highlightAuto:Js,highlightAll:ei,highlightElement:Xt,highlightBlock:ir,configure:_n,initHighlighting:Rr,initHighlightingOnLoad:nl,registerLanguage:Fo,unregisterLanguage:bs,listLanguages:al,getLanguage:Dn,registerAliases:sr,autoDetection:Or,inherit:Uo,addPlugin:nn,removePlugin:zo}),X.debugMode=function(){jt=!1},X.safeMode=function(){jt=!0},X.versionString=Et,X.regex={concat:S,lookahead:y,either:A,optional:v,anyNumberOfTimes:N};for(const _e in vt)typeof vt[_e]=="object"&&e(vt[_e]);return Object.assign(X,vt),X},zn=gs({});return zn.newInstance=()=>gs({}),Qm=zn,zn.HighlightJS=zn,zn.default=zn,Qm}var LD=DD();const jD=Fc(LD),eE={},BD="hljs-";function PD(e){const t=jD.newInstance();return e&&u(e),{highlight:a,highlightAuto:s,listLanguages:o,register:u,registerAlias:d,registered:f};function a(m,h,b){const g=b||eE,y=typeof g.prefix=="string"?g.prefix:BD;if(!t.getLanguage(m))throw new Error("Unknown language: `"+m+"` is not registered");t.configure({__emitter:UD,classPrefix:y});const N=t.highlight(h,{ignoreIllegals:!0,language:m});if(N.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:N.errorRaised});const v=N._emitter.root,S=v.data;return S.language=N.language,S.relevance=N.relevance,v}function s(m,h){const g=(h||eE).subset||o();let y=-1,N=0,v;for(;++y<g.length;){const S=g[y];if(!t.getLanguage(S))continue;const w=a(S,m,h);w.data&&w.data.relevance!==void 0&&w.data.relevance>N&&(N=w.data.relevance,v=w)}return v||{type:"root",children:[],data:{language:void 0,relevance:N}}}function o(){return t.listLanguages()}function u(m,h){if(typeof m=="string")t.registerLanguage(m,h);else{let b;for(b in m)Object.hasOwn(m,b)&&t.registerLanguage(b,m[b])}}function d(m,h){if(typeof m=="string")t.registerAliases(typeof h=="string"?h:[...h],{languageName:m});else{let b;for(b in m)if(Object.hasOwn(m,b)){const g=m[b];t.registerAliases(typeof g=="string"?g:[...g],{languageName:b})}}}function f(m){return!!t.getLanguage(m)}}class UD{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const a=this.stack[this.stack.length-1],s=a.children[a.children.length-1];s&&s.type==="text"?s.value+=t:a.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,a){const s=this.stack[this.stack.length-1],o=t.root.children;a?s.children.push({type:"element",tagName:"span",properties:{className:[a]},children:o}):s.children.push(...o)}openNode(t){const a=this,s=t.split(".").map(function(d,f){return f?d+"_".repeat(f):a.options.classPrefix+d}),o=this.stack[this.stack.length-1],u={type:"element",tagName:"span",properties:{className:s},children:[]};o.children.push(u),this.stack.push(u)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const HD={};function FD(e){const t=e||HD,a=t.aliases,s=t.detect||!1,o=t.languages||MD,u=t.plainText,d=t.prefix,f=t.subset;let m="hljs";const h=PD(o);if(a&&h.registerAlias(a),d){const b=d.indexOf("-");m=b===-1?d:d.slice(0,b)}return function(b,g){Do(b,"element",function(y,N,v){if(y.tagName!=="code"||!v||v.type!=="element"||v.tagName!=="pre")return;const S=zD(y);if(S===!1||!S&&!s||S&&u&&u.includes(S))return;Array.isArray(y.properties.className)||(y.properties.className=[]),y.properties.className.includes(m)||y.properties.className.unshift(m);const w=iM(y,{whitespace:"pre"});let A;try{A=S?h.highlight(S,w,{prefix:d}):h.highlightAuto(w,{prefix:d,subset:f})}catch(R){const I=R;if(S&&/Unknown language/.test(I.message)){g.message("Cannot highlight as `"+S+"`, it’s not registered",{ancestors:[v,y],cause:I,place:y.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw I}!S&&A.data&&A.data.language&&y.properties.className.push("language-"+A.data.language),A.children.length>0&&(y.children=A.children)})}}function zD(e){const t=e.properties.className;let a=-1;if(!Array.isArray(t))return;let s;for(;++a<t.length;){const o=String(t[a]);if(o==="no-highlight"||o==="nohighlight")return!1;!s&&o.slice(0,5)==="lang-"&&(s=o.slice(5)),!s&&o.slice(0,9)==="language-"&&(s=o.slice(9))}return s}function $D({q:e,pending:t,selected:a,customText:s,onSelect:o,onCustomTextChange:u,onClearSelections:d,onSubmitCustom:f,isSingle:m}){const[h,b]=_.useState(!1),g=h||s.length>0;return l.jsxs("div",{className:"space-y-2",children:[e.header&&l.jsx("div",{className:"text-xs font-semibold text-fg-3",children:e.header}),l.jsx("p",{className:"text-sm text-fg-2",children:e.question}),e.options.length>0&&l.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.options.map(y=>{const N=!g&&((a==null?void 0:a.includes(y.label))??!1);return l.jsxs("button",{type:"button",disabled:!t,onClick:()=>{b(!1),u(""),o(y.label)},className:se("rounded-md border px-3 py-1.5 text-left text-xs transition-colors",N?"border-emerald-500/60 bg-emerald-500/20 text-emerald-300 ring-1 ring-emerald-500/30":t?"border-blue-500/40 bg-blue-500/10 text-blue-300 hover:bg-blue-500/20":"border-line bg-surface/50 text-fg-5 cursor-default"),children:[N&&l.jsx(Cn,{className:"mr-1 inline h-3 w-3"}),l.jsx("span",{className:"font-medium",children:y.label}),y.description&&l.jsx("span",{className:"ml-1.5 text-fg-5",children:y.description})]},y.label)}),t&&l.jsxs("button",{type:"button",onClick:()=>{g?(b(!1),u("")):(b(!0),d())},className:se("rounded-md border px-3 py-1.5 text-left text-xs transition-colors",g?"border-emerald-500/60 bg-emerald-500/20 text-emerald-300 ring-1 ring-emerald-500/30":"border-dashed border-blue-500/40 text-blue-300 hover:bg-blue-500/10"),children:[g&&l.jsx(Cn,{className:"mr-1 inline h-3 w-3"}),l.jsx("span",{className:"font-medium",children:"其他…"})]})]}),g&&t&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{type:"text",value:s,onChange:y=>{u(y.target.value),y.target.value&&d()},onKeyDown:y=>{y.key==="Enter"&&s.trim()&&m&&f&&f()},placeholder:"输入自定义回复…",autoFocus:!0,className:"flex-1 rounded-md border border-blue-500/40 bg-blue-500/5 px-3 py-1.5 text-xs text-fg-1 placeholder:text-fg-5 outline-none focus:border-blue-500/60 focus:ring-1 focus:ring-blue-500/30"}),m&&l.jsx("button",{type:"button",disabled:!s.trim(),onClick:f,className:se("flex items-center gap-1 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",s.trim()?"bg-emerald-600 text-white hover:bg-emerald-500":"bg-surface/50 text-fg-5 cursor-not-allowed"),children:l.jsx(zi,{className:"h-3 w-3"})})]})]})}function qD({part:e}){const t=Kw(e),a=ep(e),s=a==="pending"||a==="running",o=Ie(W=>W.activeSessionId),u=Ie(W=>W.replyQuestion),d=Ie(W=>W.rejectQuestion),[f,m]=_.useState(null),[h,b]=_.useState({}),[g,y]=_.useState({});if(!t||t.length===0)return null;const N=t.length===1,v=()=>{o&&Ut.getState().removeToast(`question-${o}`)},S=(W,Q)=>{if(!f){if(y(j=>{const{[W]:ee,...ue}=j;return ue}),N){m("answered"),v(),u([[Q]]);return}b(j=>{const ee=t[W],ue=j[W]??[];if(ee.multiple){const Z=ue.includes(Q);return{...j,[W]:Z?ue.filter(q=>q!==Q):[...ue,Q]}}return{...j,[W]:[Q]}})}},w=(W,Q)=>{y(j=>{if(Q)return{...j,[W]:Q};const{[W]:ee,...ue}=j;return ue})},A=W=>{b(Q=>{const{[W]:j,...ee}=Q;return ee})},R=W=>{var j;const Q=(j=g[W])==null?void 0:j.trim();f||!Q||(m("answered"),v(),u([[Q]]))},I=t.filter((W,Q)=>{var j,ee;return(((j=h[Q])==null?void 0:j.length)??0)>0||(((ee=g[Q])==null?void 0:ee.trim().length)??0)>0}).length,Y=!N&&I===t.length,B=()=>{if(f||!Y)return;m("answered"),v();const W=t.map((Q,j)=>{var ue;const ee=(ue=g[j])==null?void 0:ue.trim();return ee?[ee]:h[j]??[]});u(W)},C=()=>{f||(m("dismissed"),v(),d())},z=s&&!f;return l.jsxs("div",{className:se("my-1 overflow-hidden rounded-md border bg-term/70",z?"border-blue-500/40":"border-line"),children:[l.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 font-mono text-xs",children:[l.jsx(w3,{className:se("h-3.5 w-3.5 shrink-0",z?"text-blue-400":"text-fg-4")}),l.jsx("span",{className:se("font-medium",z?"text-blue-300":"text-fg-3"),children:f==="answered"?"已回复":f==="dismissed"?"已取消":z?"等待回复":"Question"}),!N&&z&&l.jsxs("span",{className:"text-fg-5",children:["(",I,"/",t.length,")"]}),z&&l.jsxs("button",{type:"button",onClick:C,className:"ml-auto flex items-center gap-1 rounded px-1.5 py-0.5 text-fg-5 transition-colors hover:bg-red-500/10 hover:text-red-400",children:[l.jsx(gt,{className:"h-3 w-3"}),l.jsx("span",{children:"取消"})]})]}),l.jsxs("div",{className:"border-t border-line px-4 py-3 space-y-3",children:[t.map((W,Q)=>l.jsx($D,{q:W,pending:z,selected:h[Q],customText:g[Q]??"",onSelect:j=>S(Q,j),onCustomTextChange:j=>w(Q,j),onClearSelections:()=>A(Q),onSubmitCustom:N?()=>R(Q):void 0,isSingle:N},Q)),!N&&z&&l.jsx("div",{className:"flex justify-end pt-1",children:l.jsxs("button",{type:"button",disabled:!Y,onClick:B,className:se("flex items-center gap-1.5 rounded-md px-4 py-1.5 text-xs font-medium transition-colors",Y?"bg-emerald-600 text-white hover:bg-emerald-500":"bg-surface/50 text-fg-5 cursor-not-allowed"),children:[l.jsx(zi,{className:"h-3 w-3"}),l.jsx("span",{children:"提交回答"})]})})]})]})}const Wm=2e3,YD={read:"Read",write:"Write",edit:"Edit",patch:"Patch",grep:"Grep",glob:"Glob",bash:"Bash",shell:"Bash",list:"List",ls:"List",webfetch:"Fetch",fetch:"Fetch",task:"Task",agent:"Task",todowrite:"Todo",write_todos:"Todo",question:"Question",mcp_question:"Question"},GD={running:{glyph:"◌",label:"running",color:"text-amber-400",accent:"border-amber-500/40",spin:!0},completed:{glyph:"✓",label:"done",color:"text-emerald-400",accent:"border-emerald-500/40",spin:!1},error:{glyph:"✗",label:"error",color:"text-red-400",accent:"border-red-500/40",spin:!1},pending:{glyph:"○",label:"queued",color:"text-fg-4",accent:"border-fg-6",spin:!1}};function id(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function Qa(e,t){if(!e)return null;for(const a of t){const s=e[a];if(typeof s=="string"&&s.trim())return s.trim()}return null}function KD(e,t){const a=e.toLowerCase(),s=YD[a]??e.charAt(0).toUpperCase()+e.slice(1),o=id(t);switch(a){case"read":case"write":case"edit":case"patch":return{label:s,arg:Qa(o,["filePath","path","file"])};case"grep":{const u=Qa(o,["pattern","query"]);return{label:s,arg:u?`"${u}"`:null}}case"glob":return{label:s,arg:Qa(o,["pattern","query"])};case"bash":case"shell":{const u=Qa(o,["command","cmd","script"]);return{label:s,arg:u?u.split(`
502
+ `)[0]:null}}case"webfetch":case"fetch":return{label:s,arg:Qa(o,["url"])};case"task":case"agent":return{label:s,arg:Qa(o,["description","prompt","title"])};default:return{label:s,arg:Qa(o,["filePath","path","pattern","query","command","url","description"])}}}function VD({oldStr:e,newStr:t}){const a=e.split(`
503
+ `),s=t.split(`
504
+ `);return l.jsxs("div",{className:"grid grid-cols-1 gap-px overflow-x-auto rounded text-xs md:grid-cols-2",children:[l.jsx("pre",{className:"min-w-0 whitespace-pre-wrap break-words p-1.5 fs-diff-del",children:a.map((o,u)=>l.jsxs("div",{children:[l.jsx("span",{className:"select-none text-red-400/70",children:"− "}),l.jsx("span",{className:"text-red-400",children:o})]},u))}),l.jsx("pre",{className:"min-w-0 whitespace-pre-wrap break-words p-1.5 fs-diff-add",children:s.map((o,u)=>l.jsxs("div",{children:[l.jsx("span",{className:"select-none text-emerald-400/70",children:"+ "}),l.jsx("span",{className:"text-emerald-400",children:o})]},u))})]})}const tE={completed:{glyph:"✓",color:"text-emerald-400"},in_progress:{glyph:"◌",color:"text-amber-400"},cancelled:{glyph:"✗",color:"text-fg-5"},pending:{glyph:"○",color:"text-fg-4"}};function AT({todos:e}){return l.jsx("ul",{className:"space-y-0.5 text-xs",children:e.map((t,a)=>{var f;const s=((f=t.status)==null?void 0:f.toLowerCase())??"pending",o=s==="in-progress"||s==="active"?"in_progress":s==="done"||s==="complete"?"completed":s==="canceled"?"cancelled":s,u=tE[o]??tE.pending,d=o==="completed"||o==="cancelled";return l.jsxs("li",{className:"flex items-start gap-1.5",children:[l.jsx("span",{className:se("shrink-0 leading-5",u.color,o==="in_progress"&&"fs-spin"),children:u.glyph}),l.jsx("span",{className:se("leading-5",d?"text-fg-5 line-through":"text-fg-2"),children:t.content}),t.priority&&l.jsx("span",{className:"ml-auto shrink-0 text-fg-5",children:t.priority})]},a)})})}const XD={"visual-engineering":"bg-purple-500/15 text-purple-400",quick:"bg-emerald-500/15 text-emerald-400",deep:"bg-blue-500/15 text-blue-400",ultrabrain:"bg-amber-500/15 text-amber-400",artistry:"bg-pink-500/15 text-pink-400",writing:"bg-cyan-500/15 text-cyan-400","unspecified-low":"bg-elevated text-fg-4","unspecified-high":"bg-elevated text-fg-3"},QD={explore:"bg-teal-500/15 text-teal-400",librarian:"bg-indigo-500/15 text-indigo-400",oracle:"bg-amber-500/15 text-amber-400",metis:"bg-rose-500/15 text-rose-400",momus:"bg-orange-500/15 text-orange-400"};function WD({record:e}){const[t,a]=_.useState(!1),s=typeof e.category=="string"?e.category:null,o=typeof e.subagent_type=="string"?e.subagent_type:null,u=Qa(e,["description","title"]),d=typeof e.prompt=="string"?e.prompt:null,f=Array.isArray(e.load_skills)?e.load_skills.filter(y=>typeof y=="string"):[],m=typeof e.run_in_background=="boolean"?e.run_in_background:!1,h=typeof e.task_id=="string"?e.task_id:null,b=s??o,g=(s&&XD[s])??(o&&QD[o])??"bg-elevated text-fg-3";return l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[b&&l.jsx("span",{className:se("rounded px-1.5 py-0.5 text-[10px] font-medium",g),children:b}),f.map(y=>l.jsx("span",{className:"rounded bg-elevated px-1.5 py-0.5 text-[10px] text-fg-4",children:y},y)),m&&l.jsx("span",{className:"rounded bg-elevated px-1.5 py-0.5 text-[10px] text-fg-5",children:"bg"}),h&&l.jsxs("span",{className:"rounded bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",title:h,children:["↩ ",h.slice(0,16),"…"]})]}),u&&l.jsx("p",{className:"text-xs text-fg-2",children:u}),d&&l.jsxs("div",{children:[l.jsxs("button",{type:"button",onClick:()=>a(y=>!y),className:"flex items-center gap-1 text-[10px] text-fg-4 transition-colors hover:text-fg-2",children:[l.jsx(Gc,{className:se("h-3 w-3 transition-transform",t&&"rotate-90")}),"Prompt",l.jsxs("span",{className:"text-fg-5",children:["(",d.length," chars)"]})]}),t&&l.jsx("pre",{className:"mt-1 max-h-60 overflow-y-auto whitespace-pre-wrap break-words rounded bg-elevated/50 p-2 text-[11px] leading-relaxed text-fg-3",children:d})]})]})}function ZD(e){const t=Xw(e),a=Ie(m=>m.activeSessionId),s=Ie(m=>m.sessions);if(t)return t;if(!a)return null;const o=Jc(e),u=id(o),d=Qa(u,["description","title"]),f=s.filter(m=>m.parentID===a);if(f.length===0)return null;if(f.length===1)return f[0].id;if(d){const m=f.find(h=>h.title===d);if(m)return m.id}return null}function JD({part:e}){const t=ZD(e),a=Ie(s=>s.setActiveSession);return t?l.jsxs("button",{type:"button",onClick:s=>{s.stopPropagation(),a(t)},className:"mt-2 flex items-center gap-1.5 rounded-md border border-line px-2.5 py-1 font-mono text-xs text-blue-400 transition-colors hover:border-blue-500/50 hover:bg-blue-500/10",children:[l.jsxs("span",{className:"truncate text-fg-5",children:[t.slice(0,20),"…"]}),l.jsx(TA,{className:"h-3 w-3 shrink-0"}),l.jsx("span",{className:"shrink-0",children:"查看子会话"})]}):null}function eL(e,t){const a=id(t);if(!a)return null;const s=e.toLowerCase();if(s==="edit"||s==="patch"){const o=typeof a.oldString=="string"?a.oldString:"",u=typeof a.newString=="string"?a.newString:"";if(o||u)return l.jsx(VD,{oldStr:o,newStr:u})}if(s==="todowrite"||s==="write_todos"){const o=Array.isArray(a.todos)?a.todos:null;if(o&&o.length>0)return l.jsx(AT,{todos:o})}if(s==="bash"||s==="shell"){const o=Qa(a,["command","cmd","script"]);if(o)return l.jsxs("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-fg-2",children:[l.jsx("span",{className:"select-none text-emerald-400/70",children:"❯ "}),o]})}if(s==="task"||s==="agent")return l.jsx(WD,{record:a});if(s==="read")return null;if(s==="write"){const o=typeof a.content=="string"?a.content:null;if(o){const u=o.length>500?`${o.slice(0,500)}…`:o;return l.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-fg-2",children:u})}}return null}function tL(e,t){const a=e.toLowerCase();if(a==="todowrite"||a==="write_todos"){const s=Array.isArray(t)?t:null;if(s&&s.length>0)return l.jsx(AT,{todos:s})}return null}function nL({part:e}){const t=ep(e),a=t==="running"||t==="pending",[s,o]=_.useState(a),[u,d]=_.useState(!1),f=_.useRef(a);_.useEffect(()=>{f.current!==a&&(o(a),f.current=a)},[a]);const m=$y(e),h=m.toLowerCase(),b=h==="task"||h==="agent",g=Jc(e),{label:y,arg:N}=KD(m,g),v=eL(m,g),S=v?null:Fx(g),w=Jh(e),A=tL(m,w),R=A?"":Fx(w),I=GD[t],Y=h==="edit"||h==="patch";let B=0,C=0;if(Y){const Q=id(g);if(Q){const j=typeof Q.oldString=="string"?Q.oldString:"",ee=typeof Q.newString=="string"?Q.newString:"";j&&(C=j.split(`
505
+ `).length),ee&&(B=ee.split(`
506
+ `).length)}}const z=R.length>Wm,W=u||!z?R:`${R.slice(0,Wm)}…`;return l.jsxs("div",{className:"my-1 overflow-hidden rounded-md border border-line bg-term/70",children:[l.jsxs("button",{type:"button",onClick:()=>o(Q=>!Q),className:"flex w-full items-center gap-2 px-3 py-1.5 text-left font-mono text-xs transition-colors duration-150 hover:bg-surface/70",children:[l.jsx("span",{className:se("shrink-0 leading-none",I.color),children:s?"▾":"▸"}),l.jsx("span",{className:"shrink-0 font-medium text-fg",children:y}),N&&l.jsx("span",{className:"truncate text-fg-3",children:N}),Y&&(B>0||C>0)&&l.jsxs("span",{className:"flex shrink-0 items-center gap-1.5 text-[11px] leading-none",children:[B>0&&l.jsxs("span",{className:"text-emerald-400",children:["+",B]}),C>0&&l.jsxs("span",{className:"text-red-400",children:["-",C]})]}),l.jsxs("span",{className:se("ml-auto flex shrink-0 items-center gap-1.5 leading-none",I.color),children:[l.jsx("span",{className:se(I.spin&&"fs-spin"),children:I.glyph}),l.jsx("span",{children:I.label})]})]}),s&&l.jsx("div",{className:"border-t border-line px-3 py-2",children:l.jsxs("div",{className:se("ml-1 border-l-2 pl-3 font-mono text-xs",I.accent),children:[v&&l.jsx("section",{className:"mb-2",children:v}),S&&l.jsxs("section",{className:"mb-2",children:[l.jsx("div",{className:"mb-1 text-[10px] uppercase tracking-wider text-fg-5",children:"input"}),l.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-fg-2",children:S})]}),b&&l.jsx(JD,{part:e}),A&&l.jsx("section",{children:A}),R&&l.jsxs("section",{children:[l.jsx("div",{className:"mb-1 text-[10px] uppercase tracking-wider text-fg-5",children:"output"}),l.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-fg-2",children:W}),z&&l.jsx("button",{type:"button",onClick:()=>d(Q=>!Q),className:"mt-1 text-blue-400 transition-colors hover:text-blue-300",children:u?"show less":`show ${R.length-Wm} more chars`})]}),!v&&!S&&!A&&!R&&l.jsx("div",{className:"text-fg-5",children:"no parameters"})]})})]})}function aL({text:e}){const[t,a]=_.useState(!1);return l.jsxs("div",{className:"my-1",children:[l.jsxs("button",{type:"button",onClick:()=>a(s=>!s),className:"flex items-center gap-1.5 font-mono text-xs text-fg-5 transition-colors hover:text-fg-3",children:[t?l.jsx(ea,{className:"h-3 w-3 shrink-0"}):l.jsx(Gc,{className:"h-3 w-3 shrink-0"}),l.jsx(Fi,{className:"h-3 w-3 shrink-0"}),l.jsx("span",{children:"thinking"})]}),t&&l.jsx("div",{className:"ml-1.5 mt-1 whitespace-pre-wrap border-l border-line pl-3 text-xs italic leading-relaxed text-fg-4",children:e})]})}function rL(){const[e,t]=_.useState(0);return _.useEffect(()=>{const a=Date.now(),s=setInterval(()=>{t(Math.floor((Date.now()-a)/1e3))},1e3);return()=>clearInterval(s)},[]),l.jsxs("div",{className:"my-1 flex items-center gap-1.5 font-mono text-xs text-fg-5",children:[l.jsx(Fi,{className:"h-3 w-3 shrink-0 animate-pulse"}),l.jsx("span",{children:"thinking"}),e>0&&l.jsxs("span",{className:"text-fg-6",children:[e,"s"]})]})}function wT({part:e,className:t}){var a;return e.url?(a=e.mime)!=null&&a.startsWith("image/")?l.jsx(JN,{url:e.url,label:e.filename??"attachment",className:se("object-contain",t??"max-h-80")}):l.jsxs("div",{className:"flex items-center gap-1.5 font-mono text-xs text-fg-5",children:[l.jsx(G3,{className:"h-3 w-3 shrink-0"}),l.jsx("span",{children:e.filename??e.mime??"attachment"})]}):null}function sL({part:e,isStreaming:t}){switch(wc(e)){case"text":{const s=Cc(e);return s.trim()?l.jsx("div",{className:"markdown-body leading-relaxed",children:l.jsx(cs,{remarkPlugins:[ds],rehypePlugins:[FD],components:{table:bp},children:s})}):null}case"thinking":{const s=Cc(e);return s.trim()?l.jsx(aL,{text:s}):t?l.jsx(rL,{}):null}case"tool":return yo(e)?l.jsx(qD,{part:e}):l.jsx(nL,{part:e});case"file":return l.jsx(wT,{part:e});default:return null}}function iL({message:e,isStreaming:t,queued:a}){var b,g,y,N,v,S;const s=e.role==="user",o=e.parts??[],u=o.filter(w=>wc(w)!=="other");if(s){const w=o.map(Cc).join("").trim(),A=o.filter(Y=>wc(Y)==="file"),R=(b=e.time)==null?void 0:b.created,I=R?new Date(R*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):null;return l.jsxs("div",{className:"fs-fade-in rounded-r-md border-l-2 border-emerald-500/40 bg-emerald-500/[0.04] px-3 py-2 font-mono",children:[l.jsxs("div",{className:"mb-1 flex items-center gap-2 text-[11px]",children:[l.jsx("span",{className:"font-medium text-emerald-400",children:"You"}),I&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-fg-6",children:"·"}),l.jsx("span",{className:"text-fg-5",children:I})]}),a&&l.jsxs("span",{className:"inline-flex items-center gap-1 rounded border border-amber-500/30 px-1.5 py-0.5 text-xs text-amber-400",children:[l.jsx("span",{className:"leading-none",children:"○"}),l.jsx("span",{children:"queued"})]})]}),l.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[l.jsx("span",{className:"shrink-0 select-none text-emerald-400",children:"❯"}),l.jsx("span",{className:"min-w-0 flex-1 whitespace-pre-wrap break-words text-fg",children:w||"…"})]}),A.length>0&&l.jsx("div",{className:"mt-2 flex flex-wrap gap-2 pl-5",children:A.map((Y,B)=>l.jsx(wT,{part:Y,className:"max-h-40"},Y.id??B))})]})}const d=((g=e.info)==null?void 0:g.agent)??e.agent,f=((y=e.info)==null?void 0:y.modelID)??e.modelID,m=(N=e.info)==null?void 0:N.error,h=(v=e.info)==null?void 0:v.finish;return l.jsxs("div",{className:"fs-fade-in font-mono",children:[(d||f)&&l.jsxs("div",{className:"mb-1 flex items-center gap-2 text-xs",children:[d&&l.jsx("span",{className:"text-fg-3",children:d}),d&&f&&l.jsx("span",{className:"text-fg-6",children:"·"}),f&&l.jsx("span",{className:"text-fg-5",children:f})]}),m&&l.jsxs("div",{className:"my-1 flex items-start gap-2 rounded-md border border-red-500/20 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[l.jsx(kn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("span",{className:"font-semibold",children:m.name??"Error"}),((S=m.data)==null?void 0:S.message)&&l.jsx("p",{className:"mt-0.5 text-red-400/80",children:m.data.message}),h&&h!=="end"&&l.jsxs("p",{className:"mt-0.5 text-red-400/60",children:["finish: ",h]})]})]}),l.jsx("div",{className:"space-y-2 text-sm text-fg",children:u.length>0?u.map((w,A)=>l.jsx(sL,{part:w,isStreaming:t},w.id??w.callID??A)):!m&&(t?l.jsx("span",{className:"text-fg-5",children:"…"}):l.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-amber-400/80",children:[l.jsx(kn,{className:"h-3 w-3 shrink-0"}),l.jsx("span",{children:"空响应 — Agent 未产出任何内容"})]}))})]})}const lL={completed:{glyph:"■",color:"text-emerald-400"},in_progress:{glyph:"■",color:"text-amber-400"},cancelled:{glyph:"■",color:"text-fg-6"},pending:{glyph:"□",color:"text-fg-5"}};function oL(e){const t=e.find(s=>$i(s.status)==="in_progress");if(t)return t.content;const a=e.find(s=>$i(s.status)==="pending");return a?a.content:"all steps complete"}function uL({todos:e,onClick:t}){if(e.length===0)return null;const a=e.length,s=Gw(e);return l.jsx("div",{className:"rounded-md border border-line bg-term/60 px-3 py-2",children:l.jsxs("button",{type:"button",onClick:t,className:"flex w-full items-center gap-2 text-left font-mono text-xs",children:[l.jsxs("span",{className:"shrink-0 tabular-nums text-fg-4",children:["[",s,"/",a,"]"]}),l.jsx("span",{className:"shrink-0 tracking-tight",children:e.map(o=>{const u=lL[$i(o.status)];return l.jsx("span",{className:u.color,children:u.glyph},o.id)})}),l.jsx("span",{className:"min-w-0 flex-1 truncate text-fg-2",children:oL(e)}),l.jsx("span",{className:"shrink-0 text-[10px] text-fg-5",children:"详情 →"})]})})}const cL=200,dL=240,fL=1e3,mL=[.85,1.25,.65,1.4,.75,1.15,.95],Zm=4,nE=24;function hL(e){const t=Math.floor(e/60).toString().padStart(2,"0"),a=Math.floor(e%60).toString().padStart(2,"0");return`${t}:${a}`}function pL({volumeLevel:e}){const t=Math.min(Math.max(e,0),1);return l.jsx("div",{className:"flex h-6 items-center gap-1","aria-hidden":"true",children:mL.map((a,s)=>{const o=Zm+t*a*(nE-Zm),u=Math.max(Zm,Math.min(nE,o));return l.jsx("span",{className:"w-1 rounded-full bg-red-400 transition-[height] duration-150 ease-out",style:{height:`${u}px`}},s)})})}function gL(){return Ie(e=>{const t=e.activeSessionId;if(!t)return!1;const a=e.messages[t]??No;for(let s=a.length-1;s>=0;s--){const o=a[s].parts;if(o){for(const u of o)if(wc(u)==="tool"&&kc(u))return!0}}return!1})}function bL(){var ye;const[e,t]=_.useState(""),[a,s]=_.useState(""),[o,u]=_.useState([]),[d,f]=_.useState(""),[m,h]=_.useState(0),b=_.useRef(null),g=_.useRef(null),y=_.useRef(null),N=_.useRef(0),v=rT(),S=Ie(re=>re.activeSessionId),w=Be(re=>re.activeRepoId),A=Ie(re=>{const Ne=re.activeSessionId;return Ne?re.sessionStatuses[Ne]:void 0}),R=Ie(re=>re.sendMessage),I=gc(re=>re.setDraft),Y=gc(re=>re.clearDraft),B=gL();_.useEffect(()=>{if(!w){u([]);return}let re=!1;return(async()=>{try{const[Ne,Pe]=await Promise.all([ko(),Co(w)]);if(re)return;const tt=Ne.pinned_models,et=tt?JSON.parse(tt):[];u(et.length>0?Pe.filter(vt=>et.includes(vt.id)):[])}catch{re||u([])}})(),()=>{re=!0}},[w]);const C=A==="busy"&&!B,z=!S;_.useLayoutEffect(()=>{const re=b.current;re&&(re.style.height="auto",re.style.height=`${Math.min(re.scrollHeight,cL)}px`)},[e]);const W=((ye=o.find(re=>re.id===a))==null?void 0:ye.supportsImage)!==!1,{attachments:Q,promptFiles:j,error:ee,addFiles:ue,onPaste:Z,remove:q,clear:F}=eT(W);_.useEffect(()=>{t(S?gc.getState().drafts[S]??"":""),F(),v.stop()},[S,F,v.stop]),_.useEffect(()=>(v.phase==="recording"?(N.current=Date.now(),h(0),y.current=setInterval(()=>{h(Math.floor((Date.now()-N.current)/1e3))},fL)):y.current&&(clearInterval(y.current),y.current=null),()=>{y.current&&(clearInterval(y.current),y.current=null)}),[v.phase]),_.useEffect(()=>{v.phase==="done"&&(f(v.transcript),requestAnimationFrame(()=>{const re=g.current;re&&(re.focus(),re.setSelectionRange(re.value.length,re.value.length))}))},[v.phase,v.transcript]),_.useLayoutEffect(()=>{if(v.phase!=="done")return;const re=g.current;re&&(re.style.height="auto",re.style.height=`${Math.min(re.scrollHeight,dL)}px`)},[v.phase,d]);const D=async()=>{const re=e.trim();if(z||!re&&Q.length===0)return;await R(re,a||void 0,j.length>0?j:void 0)&&(t(""),F(),S&&Y(S))},P=re=>{re.nativeEvent.isComposing||re.keyCode===229||re.key==="Enter"&&!re.shiftKey&&(re.preventDefault(),D())},ae=()=>{v.stop(),v.resetTranscript(),f("")},K=async()=>{const re=d.trim();if(!re){ae();return}await R(re,a||void 0)&&(v.resetTranscript(),f(""))};_.useEffect(()=>{if(v.phase==="idle")return;const re=Ne=>{if(Ne.key==="Escape"&&v.phase!=="recognizing"){Ne.preventDefault(),ae();return}if(v.phase==="done"&&Ne.key==="Enter"&&(Ne.metaKey||Ne.ctrlKey)){if(Ne.isComposing)return;Ne.preventDefault(),K()}};return window.addEventListener("keydown",re),()=>window.removeEventListener("keydown",re)},[v.phase,d]);const k=re=>{re.nativeEvent.isComposing||re.keyCode===229||re.key==="Enter"&&(re.metaKey||re.ctrlKey)&&(re.preventDefault(),K())},U=S?B?"输入回复,或点击上方选项…":C?"输入消息将排队等待处理…":"enter a command…":"select or start a run",ie=S?C?"text-amber-400 fs-blink":B?"text-blue-400":"text-emerald-400":"text-fg-6",M=v.transcript.length>0||v.interimTranscript.length>0;return l.jsxs("div",{className:"relative border-t border-line bg-term px-4 py-4",children:[v.phase!=="idle"&&l.jsx("div",{className:"absolute bottom-full left-0 right-0 z-20 border-t border-line bg-surface/95 backdrop-blur-sm",children:l.jsxs("div",{className:"mx-auto max-h-[40vh] w-full max-w-4xl overflow-y-auto px-4 py-4",children:[v.phase==="recording"&&l.jsx("div",{className:"text-xl leading-relaxed",children:M?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-fg",children:v.transcript}),v.interimTranscript&&l.jsx("span",{className:"text-fg-4",children:v.interimTranscript})]}):l.jsx("span",{className:"italic text-fg-5",children:"正在聆听…"})}),v.phase==="recognizing"&&l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Kt,{className:"h-5 w-5 shrink-0 text-emerald-400 fs-spin"}),l.jsx("span",{className:"font-mono text-sm text-emerald-400",children:"识别中…"}),v.interimTranscript&&l.jsx("span",{className:"truncate text-base text-fg-4",children:v.interimTranscript})]}),v.phase==="done"&&l.jsx("textarea",{ref:g,value:d,onChange:re=>f(re.target.value),onKeyDown:k,rows:2,placeholder:"识别结果(可编辑)",className:"w-full resize-none bg-transparent text-xl leading-relaxed text-fg placeholder:text-fg-5 focus:outline-none"})]})}),l.jsx(nT,{attachments:Q,error:ee,onRemove:q,className:"mx-auto max-w-4xl"}),l.jsxs("div",{className:se("mx-auto flex max-w-4xl items-start gap-2 rounded-lg border px-3 py-2 transition-colors duration-150",z?"border-line":"border-fg-5 focus-within:border-fg-4"),children:[l.jsx("span",{className:se("select-none pt-px font-mono text-sm leading-6",ie),children:"❯"}),l.jsx("textarea",{ref:b,rows:2,value:e,disabled:z,onChange:re=>{const Ne=re.target.value;t(Ne),S&&I(S,Ne)},onKeyDown:P,onPaste:Z,placeholder:U,className:"flex-1 resize-none bg-transparent font-mono text-sm leading-6 text-fg placeholder:text-fg-6 focus:outline-none disabled:cursor-not-allowed"}),l.jsx(tT,{onFiles:re=>void ue(re),disabled:z,allowed:W}),l.jsx(aT,{isListening:v.isListening,disabled:z,onStart:v.start,onStop:()=>void v.stop()}),l.jsx("button",{type:"button",onClick:D,disabled:z||e.trim().length===0&&Q.length===0,"aria-label":"Send message",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-emerald-600 text-white transition-colors duration-150 hover:bg-emerald-500 disabled:cursor-not-allowed disabled:bg-fg-6/30 disabled:text-fg-5",children:l.jsx(gy,{className:"h-4 w-4",strokeWidth:2.5})})]}),v.phase==="idle"?l.jsxs("div",{className:"mx-auto mt-1.5 flex max-w-4xl items-center gap-3 pl-5",children:[v.error&&l.jsx("span",{className:"font-mono text-[10px] text-red-400",children:v.error}),l.jsx("span",{className:"font-mono text-[10px] text-fg-6",children:"⏎ to run · shift+⏎ for newline"}),o.length>0&&l.jsxs("select",{value:a,onChange:re=>s(re.target.value),className:"ml-auto max-w-[200px] truncate rounded border border-line bg-surface px-2 py-0.5 font-mono text-[11px] text-fg-4 focus:border-fg-5 focus:outline-none",children:[l.jsx("option",{value:"",children:"默认模型"}),o.map(re=>l.jsx("option",{value:re.id,children:re.name||re.id},re.id))]})]}):v.phase==="done"?l.jsxs("div",{className:"mx-auto mt-1.5 flex max-w-4xl items-center gap-2 pl-5",children:[l.jsx("span",{className:"hidden font-mono text-[10px] text-fg-6 sm:inline",children:"⌘/Ctrl+⏎ 发送 · Esc 取消"}),l.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[l.jsx("button",{type:"button",onClick:ae,className:"rounded-md border border-line px-3 py-1 text-xs text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:"取消"}),l.jsxs("button",{type:"button",onClick:()=>void K(),disabled:d.trim().length===0,"aria-label":"发送",className:"flex items-center gap-1.5 rounded-md bg-emerald-600 px-3 py-1 text-xs font-medium text-white transition-colors hover:bg-emerald-500 disabled:cursor-not-allowed disabled:bg-fg-6/30 disabled:text-fg-5",children:[l.jsx(zi,{className:"h-3.5 w-3.5",strokeWidth:2.5}),l.jsx("span",{children:"发送"})]})]})]}):l.jsx("div",{className:"mx-auto mt-1.5 flex max-w-4xl items-center gap-3 pl-5",children:v.phase==="recording"?l.jsxs(l.Fragment,{children:[l.jsx(pL,{volumeLevel:v.volumeLevel}),l.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-[11px] font-medium text-red-400",children:[l.jsx("span",{className:"h-1.5 w-1.5 shrink-0 animate-pulse rounded-full bg-red-400"}),"录音中"]}),l.jsx("span",{className:"font-mono text-[11px] tabular-nums text-fg-4",children:hL(m)})]}):l.jsxs(l.Fragment,{children:[l.jsx(Kt,{className:"h-4 w-4 shrink-0 text-emerald-400 fs-spin"}),l.jsx("span",{className:"font-mono text-[11px] text-emerald-400",children:"识别中…"})]})})]})}const aE={idle:{glyph:"●",label:"ready",color:"text-emerald-400",spin:!1},busy:{glyph:"◌",label:"running",color:"text-amber-400",spin:!0},retry:{glyph:"◌",label:"retrying",color:"text-amber-400",spin:!0},error:{glyph:"✗",label:"error",color:"text-red-400",spin:!1}},rE=[{bg:"bg-blue-500/15",text:"text-blue-500"},{bg:"bg-purple-500/15",text:"text-purple-500"},{bg:"bg-emerald-500/15",text:"text-emerald-500"},{bg:"bg-amber-500/15",text:"text-amber-500"},{bg:"bg-rose-500/15",text:"text-rose-500"},{bg:"bg-cyan-500/15",text:"text-cyan-500"},{bg:"bg-indigo-500/15",text:"text-indigo-500"},{bg:"bg-orange-500/15",text:"text-orange-500"}];function xL(e){const t=e.trim(),a=t.charCodeAt(0)||0;return{...rE[a%rE.length],initial:(t.charAt(0)||"?").toUpperCase()}}function sE({status:e,reason:t}){const a=aE[e??"idle"]??aE.idle;return l.jsxs("span",{className:se("flex items-center gap-1.5 rounded border border-line px-2 py-0.5 font-mono text-xs",a.color),title:e==="error"&&t?t:void 0,children:[l.jsx("span",{className:se("leading-none",a.spin&&"fs-spin"),children:a.glyph}),l.jsx("span",{children:a.label})]})}const EL={"claude-opus-4":1e6,"claude-sonnet-4":1e6,"claude-sonnet-5":1e6,"claude-opus-5":1e6,"claude-3-7-sonnet":2e5,"claude-3-5-sonnet":2e5,"claude-3-5-haiku":2e5,"claude-3-opus":2e5,"claude-3-sonnet":2e5,"claude-3-haiku":2e5},iE=1e6;function yL(e){if(!e)return iE;for(const[t,a]of Object.entries(EL))if(e.startsWith(t))return a;return iE}function lE(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function NL(e){return e>=1?`$${e.toFixed(2)}`:e>=.01?`$${e.toFixed(3)}`:e>0?`$${e.toFixed(4)}`:"$0"}function TL(e){for(let t=e.length-1;t>=0;t--){const a=e[t];if(a.role==="assistant"&&a.tokens){const s=a.tokens;if(s.cache&&(s.cache.read>0||s.cache.write>0)||s.input>0||s.output>0)return s}}return null}function oE({session:e,messages:t}){var m,h,b;const a=TL(t),s=(e==null?void 0:e.cost)??0;if(!a&&!s)return null;const o=a?a.input+(((m=a.cache)==null?void 0:m.read)??0)+(((h=a.cache)==null?void 0:h.write)??0):0,u=yL((b=e==null?void 0:e.model)==null?void 0:b.modelID),d=o>0?Math.min(Math.round(o/u*100),999):0,f=d>=80?"text-red-400":d>=50?"text-amber-400":"text-fg-5";return l.jsxs("div",{className:"flex items-center gap-2 font-mono text-[11px] text-fg-5",children:[o>0&&l.jsxs(l.Fragment,{children:[l.jsx("span",{title:"当前上下文 = cache_read + cache_write + input (最近一次请求)",children:lE(o)}),l.jsx("span",{className:"text-fg-6",children:"·"}),l.jsxs("span",{className:f,title:`上下文占比 (${lE(u)} 窗口)`,children:[d,"%"]}),l.jsx("span",{className:"text-fg-6",children:"·"})]}),l.jsx("span",{title:"会话累计费用",children:NL(s)})]})}const _L=144,vL=64,SL=240,AL=1e3,wL=[.85,1.25,.65,1.4,.75,1.15,.95],Jm=4,uE=24;function CL(e){const t=Math.floor(e/60).toString().padStart(2,"0"),a=Math.floor(e%60).toString().padStart(2,"0");return`${t}:${a}`}function kL({volumeLevel:e}){const t=Math.min(Math.max(e,0),1);return l.jsx("div",{className:"flex h-6 items-center gap-1","aria-hidden":"true",children:wL.map((a,s)=>{const o=Jm+t*a*(uE-Jm),u=Math.max(Jm,Math.min(uE,o));return l.jsx("span",{className:"w-1 rounded-full bg-red-400 transition-[height] duration-150 ease-out",style:{height:`${u}px`}},s)})})}function CT({onToggleSidebar:e}){const[t,a]=_.useState(""),[s,o]=_.useState(""),[u,d]=_.useState(""),[f,m]=_.useState(""),[h,b]=_.useState(!1),[g,y]=_.useState(""),[N,v]=_.useState(0),S=_.useRef(null),w=_.useRef(null),A=_.useRef(null),R=_.useRef(null),I=_.useRef(0),[Y,B]=_.useState([]),C=rT(),z=Ie(xe=>xe.createSession),W=Ie(xe=>xe.sendError),Q=Be(xe=>xe.activeRepoId),ee=fs(xe=>xe.agents).filter(xe=>xe.isSystem<2),ue=Ve(xe=>xe.issues),Z=Ve(xe=>xe.selectedIssueId),q=Ve(xe=>xe.pendingDraft);_.useEffect(()=>{ee.length>0&&!s&&o(ee[0].id)},[ee,s]),_.useEffect(()=>{if(!Q){B([]);return}let xe=!1;return Co(Q).then(xt=>{xe||B(xt)}).catch(()=>{xe||B([])}),()=>{xe=!0}},[Q]);const F=Y.length===0||Y.some(xe=>xe.supportsImage!==!1),{attachments:D,promptFiles:P,error:ae,addFiles:K,onPaste:k,remove:U,clear:ie}=eT(F);_.useEffect(()=>{Z&&(d(Z),Ve.getState().setSelectedIssue(null))},[Z]),_.useEffect(()=>{q&&(a(q),Ve.getState().setPendingDraft(null))},[q]),_.useLayoutEffect(()=>{const xe=S.current;xe&&(xe.style.height="auto",xe.style.height=`${Math.min(xe.scrollHeight,_L)}px`)},[t]),_.useEffect(()=>{const xe=xt=>{w.current&&!w.current.contains(xt.target)&&b(!1)};return document.addEventListener("mousedown",xe),()=>document.removeEventListener("mousedown",xe)},[]);const M=ue.filter(xe=>xe.state==="open"),ye=ue.find(xe=>xe.id===u),re=f.trim().toLowerCase(),Ne=re?M.filter(xe=>`#${xe.number} ${xe.title}`.toLowerCase().includes(re)):M,Pe=!!u,tt=()=>{const xe=t.trim();!Q||!xe&&!Pe&&D.length===0||(a(""),ie(),z(xe,void 0,void 0,void 0,u||void 0,s||void 0,P.length>0?P:void 0))},et=xe=>{xe.nativeEvent.isComposing||xe.keyCode===229||xe.key==="Enter"&&!xe.shiftKey&&(xe.preventDefault(),tt())},vt=()=>{C.stop(),C.resetTranscript(),y("")},en=()=>{const xe=g.trim();if(!xe){vt();return}C.resetTranscript(),y(""),z(xe,void 0,void 0,void 0,u||void 0,s||void 0)};_.useEffect(()=>(C.phase==="recording"?(I.current=Date.now(),v(0),R.current=setInterval(()=>{v(Math.floor((Date.now()-I.current)/1e3))},AL)):R.current&&(clearInterval(R.current),R.current=null),()=>{R.current&&(clearInterval(R.current),R.current=null)}),[C.phase]),_.useEffect(()=>{C.phase==="done"&&(y(C.transcript),requestAnimationFrame(()=>{const xe=A.current;xe&&(xe.focus(),xe.setSelectionRange(xe.value.length,xe.value.length))}))},[C.phase,C.transcript]),_.useLayoutEffect(()=>{if(C.phase!=="done")return;const xe=A.current;xe&&(xe.style.height="auto",xe.style.height=`${Math.min(xe.scrollHeight,SL)}px`)},[C.phase,g]),_.useEffect(()=>{if(C.phase==="idle")return;const xe=xt=>{if(xt.key==="Escape"&&C.phase!=="recognizing"){xt.preventDefault(),vt();return}if(C.phase==="done"&&xt.key==="Enter"&&(xt.metaKey||xt.ctrlKey)){if(xt.isComposing)return;xt.preventDefault(),en()}};return window.addEventListener("keydown",xe),()=>window.removeEventListener("keydown",xe)},[C.phase,g]);const Hn=xe=>{xe.nativeEvent.isComposing||xe.keyCode===229||xe.key==="Enter"&&(xe.metaKey||xe.ctrlKey)&&(xe.preventDefault(),en())},aa=C.transcript.length>0||C.interimTranscript.length>0;return l.jsxs("div",{className:"relative flex flex-1 flex-col items-center justify-center bg-term",children:[l.jsx("button",{type:"button",onClick:e,"aria-label":"Open sidebar",className:"absolute left-3 top-3 rounded-lg p-2 text-fg-3 hover:bg-elevated md:hidden",children:l.jsx(Xc,{className:"h-5 w-5"})}),l.jsxs("div",{className:"w-full max-w-2xl px-6",children:[l.jsx("div",{className:"mb-8 text-center",children:l.jsxs("div",{className:"font-mono text-2xl text-fg-6",children:[l.jsx("span",{className:"text-emerald-500/60",children:"❯"}),l.jsx("span",{className:"fs-blink text-fg-4",children:" ▋"})]})}),l.jsx(nT,{attachments:D,error:ae,onRemove:U}),l.jsxs("div",{className:se("relative rounded-xl border bg-base/80 shadow-sm transition-colors","border-line focus-within:border-fg-5"),children:[C.phase!=="idle"&&l.jsx("div",{className:"absolute bottom-full left-0 right-0 z-20 mb-2 overflow-hidden rounded-xl border border-line bg-surface/95 backdrop-blur-sm",children:l.jsxs("div",{className:"max-h-[40vh] overflow-y-auto px-4 py-4",children:[C.phase==="recording"&&l.jsx("div",{className:"text-xl leading-relaxed",children:aa?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-fg",children:C.transcript}),C.interimTranscript&&l.jsx("span",{className:"text-fg-4",children:C.interimTranscript})]}):l.jsx("span",{className:"italic text-fg-5",children:"正在聆听…"})}),C.phase==="recognizing"&&l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Kt,{className:"h-5 w-5 shrink-0 text-emerald-400 fs-spin"}),l.jsx("span",{className:"font-mono text-sm text-emerald-400",children:"识别中…"}),C.interimTranscript&&l.jsx("span",{className:"truncate text-base text-fg-4",children:C.interimTranscript})]}),C.phase==="done"&&l.jsx("textarea",{ref:A,value:g,onChange:xe=>y(xe.target.value),onKeyDown:Hn,rows:2,placeholder:"识别结果(可编辑)",className:"w-full resize-none bg-transparent text-xl leading-relaxed text-fg placeholder:text-fg-5 focus:outline-none"})]})}),ee.length>0&&l.jsx("div",{className:"flex gap-1.5 overflow-x-auto px-4 pt-3 pb-1 scrollbar-none",children:ee.map(xe=>{const xt=xL(xe.name);return l.jsxs("button",{type:"button",onClick:()=>o(xe.id),className:se("flex shrink-0 items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium transition-colors",s===xe.id?"bg-blue-500/15 text-blue-400 ring-1 ring-inset ring-blue-500/30":"text-fg-4 hover:bg-elevated hover:text-fg-3"),children:[l.jsx("span",{className:se("inline-flex h-4 w-4 items-center justify-center rounded-full text-[10px] font-bold",xt.bg,xt.text),children:xt.initial}),xe.name]},xe.id)})}),l.jsxs("div",{className:"flex items-start gap-2 px-4 py-3",children:[l.jsx("span",{className:se("select-none pt-px font-mono text-sm leading-6","text-emerald-400"),children:"❯"}),l.jsx("textarea",{ref:S,rows:1,value:t,autoFocus:!0,disabled:!Q,onChange:xe=>a(xe.target.value),onKeyDown:et,onPaste:k,placeholder:Q?"让 Agent 做什么?":"请先选择一个仓库",className:"flex-1 resize-none bg-transparent font-mono text-sm leading-6 text-fg placeholder:text-fg-6 focus:outline-none disabled:cursor-not-allowed"}),l.jsx(tT,{onFiles:xe=>void K(xe),disabled:!Q,allowed:!0}),l.jsx(aT,{isListening:C.isListening,disabled:!Q,onStart:C.start,onStop:()=>void C.stop()}),l.jsx("button",{type:"button",onClick:tt,disabled:!Q||!t.trim()&&!Pe&&D.length===0,"aria-label":"Start run",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-emerald-600 text-white transition-colors duration-150 hover:bg-emerald-500 disabled:cursor-not-allowed disabled:bg-fg-6/30 disabled:text-fg-5",children:l.jsx(gy,{className:"h-4 w-4",strokeWidth:2.5})})]}),ue.length>0&&l.jsx("div",{className:"flex items-center gap-3 border-t border-line/60 px-4 py-2",children:l.jsxs("div",{ref:w,className:"relative hidden min-w-0 flex-1 items-center gap-1.5 font-mono text-[11px] text-fg-4 sm:flex",children:[l.jsx("span",{className:"shrink-0",children:"Issue"}),l.jsxs("button",{type:"button",onClick:()=>{b(xe=>!xe),m("")},className:"flex min-w-0 flex-1 items-center gap-1 truncate rounded border border-line bg-surface px-2 py-1 font-mono text-xs text-fg transition-colors hover:border-fg-5 focus:border-fg-5 focus:outline-none",children:[l.jsx("span",{className:"min-w-0 flex-1 truncate text-left",children:ye?`#${ye.number} ${ye.title}`:"无"}),l.jsx(ea,{className:"h-3 w-3 shrink-0 text-fg-5"})]}),u&&l.jsx("button",{type:"button",onClick:()=>{d(""),m("")},className:"shrink-0 text-fg-5 hover:text-fg-3",children:l.jsx(gt,{className:"h-3 w-3"})}),h&&l.jsxs("div",{className:"absolute left-0 top-full z-50 mt-1 w-full min-w-[280px] rounded-md border border-line bg-surface shadow-lg",children:[l.jsxs("div",{className:"flex items-center gap-1.5 border-b border-line px-2 py-1.5",children:[l.jsx(us,{className:"h-3 w-3 shrink-0 text-fg-5"}),l.jsx("input",{type:"text",value:f,onChange:xe=>m(xe.target.value),onKeyDown:xe=>{xe.key==="Escape"&&b(!1)},placeholder:"搜索 issue...",autoFocus:!0,className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-fg placeholder:text-fg-6 focus:outline-none"})]}),l.jsxs("ul",{className:"max-h-48 overflow-y-auto py-1",children:[!re&&l.jsx("li",{children:l.jsx("button",{type:"button",onClick:()=>{d(""),b(!1)},className:se("w-full px-2.5 py-1.5 text-left font-mono text-xs transition-colors hover:bg-elevated/60",u?"text-fg-4":"text-blue-400"),children:"无"})}),Ne.map(xe=>l.jsx("li",{children:l.jsxs("button",{type:"button",onClick:()=>{d(xe.id),m(""),b(!1)},className:se("flex w-full items-center gap-1.5 px-2.5 py-1.5 text-left transition-colors hover:bg-elevated/60",xe.id===u?"bg-blue-500/10":""),children:[l.jsxs("span",{className:se("shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-medium",xe.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",xe.number]}),l.jsx("span",{className:"min-w-0 truncate font-mono text-xs text-fg-3",children:xe.title})]})},xe.id)),Ne.length===0&&l.jsx("li",{className:"px-2.5 py-3 text-center font-mono text-[10px] text-fg-5",children:"无匹配结果"})]})]})]})})]}),C.phase==="idle"?l.jsx("div",{className:"mt-2 flex items-center justify-center gap-2 font-mono text-[10px] text-fg-6",children:C.error?l.jsx("span",{className:"text-red-400",children:C.error}):l.jsx("span",{children:"⌘⏎ / ctrl+⏎ 开始运行"})}):C.phase==="done"?l.jsxs("div",{className:"mt-2 flex items-center gap-2 px-1",children:[l.jsx("span",{className:"hidden font-mono text-[10px] text-fg-6 sm:inline",children:"⌘/Ctrl+⏎ 发送 · Esc 取消"}),l.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[l.jsx("button",{type:"button",onClick:vt,className:"rounded-md border border-line px-3 py-1 text-xs text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:"取消"}),l.jsxs("button",{type:"button",onClick:en,disabled:g.trim().length===0,"aria-label":"发送",className:"flex items-center gap-1.5 rounded-md bg-emerald-600 px-3 py-1 text-xs font-medium text-white transition-colors hover:bg-emerald-500 disabled:cursor-not-allowed disabled:bg-fg-6/30 disabled:text-fg-5",children:[l.jsx(zi,{className:"h-3.5 w-3.5",strokeWidth:2.5}),l.jsx("span",{children:"发送"})]})]})]}):l.jsx("div",{className:"mt-2 flex items-center gap-3 px-1",children:C.phase==="recording"?l.jsxs(l.Fragment,{children:[l.jsx(kL,{volumeLevel:C.volumeLevel}),l.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-[11px] font-medium text-red-400",children:[l.jsx("span",{className:"h-1.5 w-1.5 shrink-0 animate-pulse rounded-full bg-red-400"}),"录音中"]}),l.jsx("span",{className:"font-mono text-[11px] tabular-nums text-fg-4",children:CL(N)})]}):l.jsxs(l.Fragment,{children:[l.jsx(Kt,{className:"h-4 w-4 shrink-0 text-emerald-400 fs-spin"}),l.jsx("span",{className:"font-mono text-[11px] text-emerald-400",children:"识别中…"})]})}),W&&l.jsx("div",{className:"mt-3 rounded-lg border border-red-500/20 bg-red-500/10 px-4 py-2 font-mono text-xs text-red-400",children:W})]})]})}function cE({body:e}){return e?l.jsx("div",{className:"markdown-body leading-relaxed",children:l.jsx(cs,{remarkPlugins:[ds],components:{table:bp},children:e})}):l.jsx("p",{className:"py-10 text-center font-mono text-xs text-fg-5",children:"没有描述内容"})}function dE({issue:e}){var t;return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("span",{className:se("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",e.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",e.number," ",e.state]}),(t=e.labels)==null?void 0:t.map(a=>l.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${a.color}20`,color:`#${a.color}`},children:a.name},a.id))]}),l.jsx("h2",{className:"mt-0.5 truncate text-sm font-medium text-fg",children:e.title})]})}function RL({onToggleSidebar:e}){const t=Ve(b=>b.matchingParentId),a=Ve(b=>b.matchingCandidateId),s=Ve(b=>b.issues.find(g=>g.id===t)),o=Ve(b=>b.issues.find(g=>g.id===a)),u=Ve(b=>b.exitMatchMode),d=Ve(b=>b.linkChild),[f,m]=_.useState(!1);if(!s)return null;const h=async()=>{o&&(m(!0),await d(s.number,o.number),m(!1))};return l.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden bg-term",children:[l.jsxs("header",{className:"flex items-center gap-3 border-b border-line bg-base px-4 py-2.5",children:[l.jsx("button",{type:"button",onClick:e,"aria-label":"Open sidebar",className:"-ml-1 rounded-lg p-1.5 text-fg-3 hover:bg-elevated md:hidden",children:l.jsx(Xc,{className:"h-5 w-5"})}),l.jsx("span",{className:"text-xs font-medium text-fg-4",children:"匹配子任务"}),l.jsxs("span",{className:"font-mono text-xs text-fg-3",children:["父: #",s.number]}),l.jsx("div",{className:"flex-1"}),l.jsxs("button",{type:"button",onClick:u,className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 text-xs text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[l.jsx(gt,{className:"h-3.5 w-3.5"}),"退出匹配"]})]}),l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col md:flex-row",children:[l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden border-b border-line md:border-b-0 md:border-r",children:[l.jsx("div",{className:"border-b border-line/60 px-4 py-2.5",children:l.jsx(dE,{issue:s})}),l.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-6",children:l.jsx(cE,{body:s.body})})]}),l.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:o?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border-b border-line/60 px-4 py-2.5",children:l.jsx(dE,{issue:o})}),l.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-6",children:l.jsx(cE,{body:o.body})})]}):l.jsx("div",{className:"flex flex-1 items-center justify-center",children:l.jsx("p",{className:"font-mono text-xs text-fg-5",children:"← 从左侧列表选择候选 Issue"})})})]}),o&&l.jsx("div",{className:"flex items-center justify-center gap-3 border-t border-line bg-base px-4 py-3",children:l.jsxs("button",{type:"button",onClick:()=>void h(),disabled:f,className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-4 py-2 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-50",children:[l.jsx(Cn,{className:"h-3.5 w-3.5"}),f?"关联中…":`确认: 将 #${o.number} 设为 #${s.number} 的子任务`]})})]})}function OL({onToggleSidebar:e}){var o;const t=Ve(u=>u.previewIssueId),a=Ve(u=>u.issues.find(d=>d.id===t));if(!a)return l.jsx(CT,{onToggleSidebar:e});const s=()=>{Ve.getState().setSelectedIssue(a.id),Ve.getState().setPreviewIssue(null)};return l.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden bg-term",children:[l.jsxs("header",{className:"flex items-center gap-3 border-b border-line bg-base px-4 py-2.5",children:[l.jsx("button",{type:"button",onClick:e,"aria-label":"Open sidebar",className:"-ml-1 rounded-lg p-1.5 text-fg-3 hover:bg-elevated md:hidden",children:l.jsx(Xc,{className:"h-5 w-5"})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("span",{className:se("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",a.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",a.number," ",a.state]}),(o=a.labels)==null?void 0:o.map(u=>l.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${u.color}20`,color:`#${u.color}`},children:u.name},u.id))]}),l.jsx("h2",{className:"mt-0.5 truncate text-sm font-medium text-fg",children:a.title})]}),l.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[a.htmlUrl&&l.jsxs("a",{href:a.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 font-mono text-xs text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[l.jsx(_c,{className:"h-3.5 w-3.5"}),"源站"]}),l.jsxs("button",{type:"button",onClick:()=>Ve.getState().enterMatchMode(a.id),className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 text-xs text-fg-3 transition-colors hover:border-blue-500/50 hover:text-blue-400",children:[l.jsx(Gs,{className:"h-3.5 w-3.5"}),"匹配子任务"]}),l.jsxs("button",{type:"button",onClick:s,className:"flex h-8 items-center gap-1.5 rounded-md bg-blue-600 px-3 text-xs font-medium text-white transition-colors hover:bg-blue-500",children:[l.jsx(Qc,{className:"h-3.5 w-3.5 fill-current"}),"开始处理"]})]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto",children:l.jsx("div",{className:"mx-auto max-w-4xl px-6 py-6",children:a.body?l.jsx("div",{className:"markdown-body leading-relaxed",children:l.jsx(cs,{remarkPlugins:[ds],components:{table:bp},children:a.body})}):l.jsx("p",{className:"py-10 text-center font-mono text-xs text-fg-5",children:"该 Issue 没有描述内容"})})})]})}function IL({onToggleSidebar:e,onToggleRightPanel:t,rightPanelOpen:a}){var P,ae;const s=Pn(),o=Be(ta),u=Ie(K=>K.activeSessionId),d=Ve(K=>K.previewIssueId),f=Ie(K=>K.sessions.find(k=>k.id===K.activeSessionId)??null),m=Ie(K=>{const k=K.activeSessionId;return k?K.messages[k]??No:No}),h=Ie(K=>{const k=K.activeSessionId;return k?K.todos[k]??Rc:Rc}),b=Ie(K=>{const k=K.activeSessionId;return k?K.sessionStatuses[k]:void 0}),g=Ie(K=>{const k=K.activeSessionId;return k?K.queuedMessageIds[k]??zx:zx}),y=Ie(K=>{const k=K.activeSessionId;return k?K.errorReasons[k]:void 0}),N=Ie(K=>{const k=K.activeSessionId;return k?K.messagesMeta[k]:void 0}),v=Ie(K=>K.loadMoreMessages),S=Ie(K=>K.sendError),w=Ie(K=>K.abortSession),A=Ie(K=>K.revertToMessage),R=Be(K=>K.repos.find(k=>k.id===K.activeRepoId)),I=(R==null?void 0:R.runtimeType)!=="claude-code",[Y,B]=_.useState(null),[C,z]=_.useState(!1),W=Ve(K=>f!=null&&f.issueId?K.issues.find(k=>k.id===f.issueId):void 0);_.useEffect(()=>{if(u)return Lc.activateSession(u),()=>Lc.deactivateSession(u)},[u]);const Q=_.useRef(null),j=_.useRef(!0),[ee,ue]=_.useState(!1);_.useEffect(()=>{const K=Q.current;K&&j.current&&(K.scrollTop=K.scrollHeight)},[m,h]),_.useEffect(()=>{j.current=!0,ue(!1)},[u]),_.useEffect(()=>{if(b!=="busy"&&b!=="retry")return;const K=k=>{if(k.key!=="Escape"||k.defaultPrevented)return;const U=k.target;U instanceof HTMLInputElement||U instanceof HTMLTextAreaElement||U!=null&&U.isContentEditable||w()};return window.addEventListener("keydown",K),()=>window.removeEventListener("keydown",K)},[b,w]);const Z=Ve(K=>K.matchingParentId);if(!u)return Z?l.jsx(RL,{onToggleSidebar:e}):d?l.jsx(OL,{onToggleSidebar:e}):l.jsx(CT,{onToggleSidebar:e});const q=b==="busy",F=b==="retry",D=q||F;return l.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden bg-term",children:[l.jsxs("header",{className:"border-b border-line bg-base md:hidden",children:[l.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",onClick:()=>z(K=>!K),children:[l.jsxs("div",{className:"flex items-center gap-1",onClick:K=>K.stopPropagation(),children:[l.jsx("button",{type:"button",onClick:e,"aria-label":"Open sidebar",className:"-ml-1 rounded-lg p-1.5 text-fg-3 hover:bg-elevated",children:l.jsx(Xc,{className:"h-5 w-5"})}),l.jsx("button",{type:"button",onClick:()=>Ie.setState({activeSessionId:null}),"aria-label":"新建运行",title:"新建运行",className:"rounded-lg p-1.5 text-fg-3 hover:bg-elevated",children:l.jsx(Ra,{className:"h-5 w-5"})})]}),l.jsxs("div",{className:"min-w-0 flex-1",children:[(f==null?void 0:f.parentID)&&l.jsxs("button",{type:"button",onClick:K=>{K.stopPropagation(),Ie.getState().setActiveSession(f.parentID)},className:"mb-0.5 flex items-center gap-1 text-[11px] text-fg-4 transition-colors hover:text-blue-400",children:[l.jsx(oh,{className:"h-3 w-3"}),"返回父会话"]}),l.jsx("h2",{className:"text-sm font-medium leading-snug text-fg",children:((P=f==null?void 0:f.title)==null?void 0:P.trim())||"untitled run"})]}),D&&l.jsx("span",{className:se("h-2 w-2 shrink-0 rounded-full","bg-amber-400 animate-pulse")}),!D&&b==="error"&&l.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-red-400"}),l.jsx(ea,{className:se("h-4 w-4 shrink-0 text-fg-5 transition-transform duration-200",C&&"rotate-180")})]}),l.jsx("div",{className:se("grid transition-[grid-template-rows] duration-200 ease-in-out",C?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:l.jsx("div",{className:"overflow-hidden",children:l.jsxs("div",{className:"flex flex-col gap-2.5 border-t border-line/60 px-4 py-3",children:[(f==null?void 0:f.agent)&&l.jsxs("div",{className:"flex items-center gap-2 font-mono text-xs text-fg-4",children:[l.jsx("span",{className:"w-14 shrink-0 text-fg-5",children:"Agent"}),l.jsx("span",{className:"truncate",children:f.agent})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"w-14 shrink-0 font-mono text-xs text-fg-5",children:"Status"}),l.jsx(sE,{status:b,reason:y})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"w-14 shrink-0 font-mono text-xs text-fg-5",children:"Context"}),l.jsx(oE,{session:f,messages:m})]}),W&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"w-14 shrink-0 font-mono text-xs text-fg-5",children:"Issue"}),l.jsxs("button",{type:"button",onClick:()=>s(`/${encodeURIComponent(o)}/issues?issueId=${W.id}`),className:"flex items-center gap-1.5 truncate font-mono text-xs text-fg-3 transition-colors hover:text-blue-400",children:[l.jsxs("span",{className:se("shrink-0 rounded px-1 py-0.5 text-[10px] font-semibold",W.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",W.number]}),l.jsx("span",{className:"truncate",children:W.title})]})]}),D&&l.jsxs("button",{type:"button",onClick:()=>void w(),className:"mt-0.5 flex w-full items-center justify-center gap-1.5 rounded-md border border-line px-2.5 py-1.5 font-mono text-xs text-fg-2 transition-colors hover:border-red-500/50 hover:text-red-400",children:[l.jsx(uh,{className:"h-3 w-3 fill-current"}),F?"stop retry":"stop"]})]})})})]}),l.jsxs("header",{className:"hidden items-center gap-3 border-b border-line bg-base px-4 py-2.5 md:flex",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[(f==null?void 0:f.parentID)&&l.jsxs("button",{type:"button",onClick:()=>void Ie.getState().setActiveSession(f.parentID),className:"mb-0.5 flex items-center gap-1 text-[11px] text-fg-4 transition-colors hover:text-blue-400",children:[l.jsx(oh,{className:"h-3 w-3"}),"返回父会话"]}),l.jsx("h2",{className:"truncate text-sm font-medium text-fg",children:((ae=f==null?void 0:f.title)==null?void 0:ae.trim())||"untitled run"}),(f==null?void 0:f.agent)&&l.jsx("p",{className:"truncate font-mono text-xs text-fg-4",children:f.agent}),l.jsx(oE,{session:f,messages:m})]}),W&&l.jsxs("button",{type:"button",onClick:()=>s(`/${encodeURIComponent(o)}/issues?issueId=${W.id}`),className:"flex items-center gap-1 rounded-md border border-line px-2 py-1 font-mono text-xs text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[l.jsxs("span",{className:se("rounded px-1 py-0.5 text-[10px] font-semibold",W.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",W.number]}),l.jsx("span",{className:"hidden max-w-[120px] truncate sm:inline",children:W.title})]}),l.jsx(sE,{status:b,reason:y}),t&&l.jsx("button",{type:"button",onClick:t,"aria-label":a?"关闭侧边栏":"打开侧边栏",className:se("flex items-center justify-center rounded-md border border-line p-1.5 transition-colors",a?"bg-blue-500/10 text-blue-500 hover:bg-blue-500/20":"text-fg-4 hover:bg-elevated hover:text-fg-2"),children:l.jsx(yy,{className:"h-4 w-4"})}),D&&l.jsxs("button",{type:"button",onClick:()=>void w(),className:"flex items-center gap-1.5 rounded-md border border-line px-2.5 py-1 font-mono text-xs text-fg-2 transition-colors hover:border-red-500/50 hover:text-red-400",children:[l.jsx(uh,{className:"h-3 w-3 fill-current"}),F?"stop retry":"stop"]})]}),l.jsxs("div",{className:"relative min-h-0 flex-1",children:[l.jsx("div",{ref:Q,onScroll:()=>{const K=Q.current;if(!K)return;const k=K.scrollHeight-K.clientHeight-K.scrollTop<=vL;if(j.current=k,ue(!k),K.scrollTop<200&&u&&(N!=null&&N.hasMore)&&!N.loading){const U=K.scrollHeight;v(u).then(()=>{requestAnimationFrame(()=>{Q.current&&(Q.current.scrollTop=Q.current.scrollHeight-U)})})}},className:"h-full overflow-y-auto",children:l.jsxs("div",{className:"mx-auto flex max-w-4xl flex-col gap-3 px-4 py-4",children:[(N==null?void 0:N.loading)&&l.jsx("div",{className:"flex justify-center py-2",children:l.jsx("span",{className:"inline-block h-4 w-4 animate-spin rounded-full border-2 border-fg-5 border-t-transparent"})}),N&&!N.loading&&N.hasMore&&l.jsx("button",{type:"button",onClick:()=>u&&v(u),className:"mx-auto rounded-md border border-line px-3 py-1 font-mono text-xs text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-2",children:"加载更早的消息"}),m.length===0?l.jsxs("p",{className:"py-10 text-center font-mono text-xs text-fg-6",children:[l.jsx("span",{className:"text-emerald-500/60",children:"❯"})," waiting for input",l.jsx("span",{className:"fs-blink",children:" ▋"})]}):m.map((K,k)=>l.jsxs(_.Fragment,{children:[k>0&&K.role==="user"&&l.jsx("div",{className:"group/revert relative border-t border-line py-2",children:I&&!D&&l.jsxs("button",{type:"button",disabled:Y!==null,onClick:async()=>{const U=m.length-k;window.confirm(`回退到此处?将移除后续 ${U} 条对话记录(不影响已产生的代码改动)。`)&&(B(K.id),await A(u,K.id),B(null))},className:"absolute left-1/2 top-1/2 z-10 flex -translate-x-1/2 -translate-y-1/2 items-center gap-1 rounded-full border border-line bg-base px-2.5 py-1 font-mono text-[11px] text-fg-4 opacity-60 shadow-sm transition-all duration-150 hover:border-amber-500/50 hover:text-amber-400 md:opacity-30 md:group-hover/revert:opacity-100 disabled:opacity-50",children:[Y===K.id?l.jsx("span",{className:"inline-block h-3 w-3 animate-spin rounded-full border-2 border-current border-t-transparent"}):l.jsx(J3,{className:"h-3 w-3"}),"回退到此处"]})}),l.jsx("div",{"data-message-id":K.id,children:l.jsx(iL,{message:K,isStreaming:q&&k===m.length-1,queued:g.includes(K.id)})})]},K.id)),h.length>0&&l.jsx(uL,{todos:[...h],onClick:t})]})}),l.jsx("button",{type:"button",onClick:()=>{const K=Q.current;K&&(K.scrollTo({top:K.scrollHeight,behavior:"smooth"}),j.current=!0)},"aria-label":"滚动到底部",className:se("absolute bottom-4 right-4 z-10 flex h-9 w-9 items-center justify-center rounded-full border border-line bg-surface/90 text-fg-4 shadow-lg backdrop-blur transition-all duration-200","hover:bg-elevated hover:text-fg-2",ee?"translate-y-0 opacity-100":"pointer-events-none translate-y-2 opacity-0"),children:l.jsx(ea,{className:"h-4 w-4"})})]}),b==="error"&&y&&l.jsxs("div",{className:"flex items-center gap-2 border-t border-red-500/20 bg-red-500/10 px-4 py-2 font-mono text-xs text-red-400",children:[l.jsx(kn,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{className:"truncate",children:y})]}),S&&l.jsxs("div",{className:"flex items-center gap-2 border-t border-red-500/20 bg-red-500/10 px-4 py-2 font-mono text-xs text-red-400",children:[l.jsx(kn,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{className:"truncate",children:S})]}),l.jsx(bL,{})]})}const Jn=Ja((e,t)=>({pulls:[],loaded:!1,syncing:!1,selectedPrId:null,matchingPrId:null,matchingCandidateIssueId:null,clearPulls:()=>e({pulls:[],loaded:!1,selectedPrId:null,matchingPrId:null,matchingCandidateIssueId:null}),setSelectedPr:a=>e({selectedPrId:a}),enterMatchMode:a=>e({matchingPrId:a,matchingCandidateIssueId:null}),exitMatchMode:()=>{const a=t().matchingPrId;e({matchingPrId:null,matchingCandidateIssueId:null,selectedPrId:a})},setMatchCandidate:a=>e({matchingCandidateIssueId:a}),linkIssue:async(a,s)=>{const o=Be.getState().activeRepoId;if(!o)return!1;try{return await uw(o,a,s),!0}catch{return!1}},unlinkIssue:async(a,s)=>{const o=Be.getState().activeRepoId;if(!o)return!1;try{return await cw(o,a,s),!0}catch{return!1}},loadPulls:async()=>{const a=Be.getState().activeRepoId;if(!a){e({pulls:[],loaded:!0});return}try{const s=await Dx(a,"all");e({pulls:s,loaded:!0})}catch{e({loaded:!0})}},syncPulls:async()=>{const a=Be.getState().activeRepoId;if(a){e({syncing:!0});try{await lw(a,"open");const s=await Dx(a,"all");e({pulls:s,syncing:!1})}catch(s){e({syncing:!1});let o="同步 PR 失败";if(s instanceof Za)try{const u=JSON.parse(s.message);u.error&&(o=u.error)}catch{s.message&&(o=s.message)}Ut.getState().addToast(o,"error")}}}})),ML={completed:{glyph:"✓",color:"text-emerald-400",spin:!1},in_progress:{glyph:"◌",color:"text-amber-400",spin:!0},cancelled:{glyph:"✗",color:"text-fg-5",spin:!1},pending:{glyph:"○",color:"text-fg-4",spin:!1}};function DL(e){var o;const t=(o=e.time)==null?void 0:o.created;if(!t)return"";const a=t<1e12?t*1e3:t;return new Date(a).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function LL(e){if(!e.parts)return"";for(const t of e.parts){const a=t.content??t.text;if(a)return a}return""}function jL({todos:e}){if(e.length===0)return l.jsx("div",{className:"flex flex-1 items-center justify-center",children:l.jsx("p",{className:"font-mono text-xs text-fg-5",children:"暂无待办项"})});const t=e.filter(a=>{const s=$i(a.status);return s==="completed"||s==="cancelled"}).length;return l.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3",children:[l.jsxs("div",{className:"mb-2 font-mono text-[10px] tabular-nums text-fg-5",children:["进度 ",t,"/",e.length]}),l.jsx("ul",{className:"space-y-1.5",children:e.map(a=>{const s=$i(a.status),o=ML[s],u=s==="completed"||s==="cancelled";return l.jsxs("li",{className:"flex items-start gap-2 font-mono text-xs",children:[l.jsx("span",{className:se("shrink-0 leading-5",o.color,o.spin&&"fs-spin"),children:o.glyph}),l.jsx("span",{className:se("leading-5",u?"text-fg-5 line-through":"text-fg-2"),children:a.content})]},a.id)})})]})}function BL({messages:e,onScrollToMessage:t}){const a=e.filter(s=>s.role==="user");return a.length===0?l.jsx("div",{className:"flex flex-1 items-center justify-center",children:l.jsx("p",{className:"font-mono text-xs text-fg-5",children:"暂无输入记录"})}):l.jsx("div",{className:"flex-1 overflow-y-auto px-3 py-2",children:l.jsx("ul",{className:"space-y-1",children:a.map((s,o)=>{const u=LL(s),d=DL(s);return l.jsx("li",{children:l.jsxs("button",{type:"button",onClick:()=>t==null?void 0:t(s.id),className:"group w-full rounded-md px-2 py-1.5 text-left transition-colors hover:bg-elevated/60",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"shrink-0 font-mono text-[10px] text-emerald-400/60",children:"❯"}),l.jsxs("span",{className:"shrink-0 font-mono text-[10px] tabular-nums text-fg-5",children:["#",o+1]}),d&&l.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] text-fg-6",children:d})]}),u&&l.jsx("p",{className:"mt-0.5 line-clamp-2 pl-5 text-xs leading-relaxed text-fg-3 group-hover:text-fg-2",children:u})]})},s.id)})})})}function PL({linked:e,number:t,title:a,state:s,mergedAt:o,isPr:u,onToggle:d}){const f=u?s==="open"?"bg-emerald-500/15 text-emerald-400":o?"bg-purple-500/15 text-purple-400":"bg-red-500/15 text-red-400":s==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400";return l.jsx("li",{children:l.jsx("button",{type:"button",onClick:d,className:se("flex w-full items-start gap-2 rounded-md px-2 py-2 text-left transition-colors",e?"border-l-2 border-emerald-500 bg-emerald-500/5":"border-l-2 border-transparent hover:bg-elevated/50"),children:l.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[l.jsxs("span",{className:se("shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-semibold",f),children:["#",t]}),l.jsx("span",{className:"min-w-0 truncate text-xs text-fg-2",children:a}),e&&l.jsx(Vc,{className:"ml-auto h-3 w-3 shrink-0 text-emerald-400"})]})})})}function UL({links:e,sessionId:t}){var C,z,W,Q;const a=Pn(),s=Be(ta),[o,u]=_.useState(null),[d,f]=_.useState(""),m=_.useRef(null),h=Ve(j=>j.issues),b=Jn(j=>j.pulls),g=Ie(j=>j.addLink),y=Ie(j=>j.removeLink),N=new Set(((C=e==null?void 0:e.issues)==null?void 0:C.map(j=>j.id))??[]),v=new Set(((z=e==null?void 0:e.pullRequests)==null?void 0:z.map(j=>j.id))??[]);_.useEffect(()=>{var j;o&&((j=m.current)==null||j.focus())},[o]);const S=()=>{u(null),f("")},w=async(j,ee,ue)=>{t&&(ue?await y(t,j,ee):await g(t,j,ee))},A=d.trim().toLowerCase(),R=A?h.filter(j=>`#${j.number} ${j.title}`.toLowerCase().includes(A)):h,I=A?b.filter(j=>`#${j.number} ${j.title} ${j.headBranch}`.toLowerCase().includes(A)):b,Y=((W=e==null?void 0:e.issues)==null?void 0:W.length)??0,B=((Q=e==null?void 0:e.pullRequests)==null?void 0:Q.length)??0;if(o){const j=o==="issue",ee=j?R:I,ue=j?N:v;return l.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-2",children:[l.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-blue-400",children:j?"关联 Issue":"关联 PR"}),l.jsxs("button",{type:"button",onClick:S,className:"flex h-6 items-center gap-1 rounded-md px-2 text-xs text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:[l.jsx(gt,{className:"h-3.5 w-3.5"}),"完成"]})]}),l.jsx("div",{className:"border-b border-line px-3 py-2",children:l.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2 py-1",children:[l.jsx(us,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),l.jsx("input",{ref:m,type:"text",value:d,onChange:Z=>f(Z.target.value),placeholder:j?"搜索 issue...":"搜索 PR...",className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),d&&l.jsx("button",{type:"button",onClick:()=>f(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:l.jsx(gt,{className:"h-3 w-3"})})]})}),l.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:ee.length===0?l.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:(j?h:b).length===0?j?"暂无 Issue,请先同步":"暂无 PR,请先同步":"无匹配结果"}):l.jsx("ul",{className:"space-y-0.5",children:ee.map(Z=>l.jsx(PL,{linked:ue.has(Z.id),number:Z.number,title:Z.title,state:Z.state,mergedAt:j?void 0:Z.mergedAt,isPr:!j,onToggle:()=>w(o,Z.id,ue.has(Z.id))},Z.id))})})]})}return l.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[l.jsxs("div",{className:"flex items-center gap-1.5 border-b border-line px-3 py-2",children:[l.jsx("span",{className:"flex-1 font-mono text-[10px] text-fg-5",children:Y+B>0?`${Y+B} 项关联`:"暂无关联"}),l.jsxs("button",{type:"button",onClick:()=>u("issue"),className:"flex h-6 items-center gap-1 rounded-md border border-line px-1.5 text-fg-4 transition-colors hover:border-emerald-500/50 hover:text-emerald-400",children:[l.jsx(Ra,{className:"h-3 w-3"}),l.jsx("span",{className:"text-[10px] font-medium",children:"Issue"})]}),l.jsxs("button",{type:"button",onClick:()=>u("pr"),className:"flex h-6 items-center gap-1 rounded-md border border-line px-1.5 text-fg-4 transition-colors hover:border-blue-500/50 hover:text-blue-400",children:[l.jsx(Ra,{className:"h-3 w-3"}),l.jsx("span",{className:"text-[10px] font-medium",children:"PR"})]})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3",children:[Y>0&&l.jsxs("div",{className:"mb-3",children:[l.jsxs("div",{className:"mb-1.5 font-mono text-[10px] font-medium uppercase tracking-wider text-fg-5",children:["Issues (",Y,")"]}),l.jsx("ul",{className:"space-y-1",children:e.issues.map(j=>l.jsxs("li",{className:"group flex items-start gap-1",children:[l.jsxs("button",{type:"button",onClick:()=>a(`/${encodeURIComponent(s)}/issues?issueId=${encodeURIComponent(j.id)}`),className:"flex min-w-0 flex-1 items-start gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-elevated/60",children:[l.jsxs("span",{className:se("mt-0.5 shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-semibold",j.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",j.number]}),l.jsx("span",{className:"line-clamp-2 text-xs leading-5 text-fg-3 group-hover:text-fg-2",children:j.title})]}),l.jsx("button",{type:"button",onClick:()=>void w("issue",j.id,!0),className:"mt-1.5 hidden shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:bg-red-500/15 hover:text-red-400 group-hover:block",children:l.jsx(gt,{className:"h-3 w-3"})})]},j.id))})]}),B>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"mb-1.5 font-mono text-[10px] font-medium uppercase tracking-wider text-fg-5",children:["Pull Requests (",B,")"]}),l.jsx("ul",{className:"space-y-1",children:e.pullRequests.map(j=>l.jsxs("li",{className:"group flex items-start gap-1",children:[l.jsxs("button",{type:"button",onClick:()=>a(`/${encodeURIComponent(s)}/pulls?prId=${encodeURIComponent(j.id)}`),className:"flex min-w-0 flex-1 items-start gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-elevated/60",children:[l.jsxs("span",{className:se("mt-0.5 shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-semibold",j.state==="open"?"bg-emerald-500/15 text-emerald-400":j.mergedAt?"bg-purple-500/15 text-purple-400":"bg-red-500/15 text-red-400"),children:["#",j.number]}),l.jsx("span",{className:"line-clamp-2 text-xs leading-5 text-fg-3 group-hover:text-fg-2",children:j.title})]}),l.jsx("button",{type:"button",onClick:()=>void w("pr",j.id,!0),className:"mt-1.5 hidden shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:bg-red-500/15 hover:text-red-400 group-hover:block",children:l.jsx(gt,{className:"h-3 w-3"})})]},j.id))})]}),Y===0&&B===0&&l.jsx("div",{className:"flex flex-1 items-center justify-center py-10",children:l.jsx("p",{className:"font-mono text-xs text-fg-5",children:"点击上方按钮添加关联"})})]})]})}const HL={"visual-engineering":"bg-purple-500/15 text-purple-400",quick:"bg-emerald-500/15 text-emerald-400",deep:"bg-blue-500/15 text-blue-400",ultrabrain:"bg-amber-500/15 text-amber-400",artistry:"bg-pink-500/15 text-pink-400",writing:"bg-cyan-500/15 text-cyan-400",explore:"bg-teal-500/15 text-teal-400",librarian:"bg-indigo-500/15 text-indigo-400",oracle:"bg-amber-500/15 text-amber-400",metis:"bg-rose-500/15 text-rose-400",momus:"bg-orange-500/15 text-orange-400"};function FL(e){switch(e){case"idle":return"bg-emerald-500";case"busy":case"retry":return"bg-amber-500 animate-pulse";case"error":return"bg-red-500";default:return"bg-fg-5"}}function eh(e){var a;const t=(a=e.time)==null?void 0:a.created;if(t)return t<1e12?t*1e3:t;if(e.createdAt){const s=Date.parse(e.createdAt);if(!Number.isNaN(s))return s}return null}function zL(e){const t=Date.now()-e,a=Math.floor(t/1e3);if(a<60)return"just now";const s=Math.floor(a/60);if(s<60)return`${s}m ago`;const o=Math.floor(s/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function $L(){const e=Ie(m=>m.sessions),t=Ie(m=>m.activeSessionId),a=Ie(m=>m.sessionStatuses),s=Ie(m=>m.setActiveSession),o=e.find(m=>m.id===t),u=(o==null?void 0:o.parentID)??t,d=!!(o!=null&&o.parentID),f=e.filter(m=>m.parentID===u).sort((m,h)=>(eh(h)??0)-(eh(m)??0));return f.length===0?l.jsx("div",{className:"flex flex-1 items-center justify-center",children:l.jsx("p",{className:"font-mono text-xs text-fg-5",children:"暂无子任务"})}):l.jsxs("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:[d&&l.jsxs("div",{className:"mb-1.5 px-2 font-mono text-[10px] text-fg-5",children:["同级子任务 (",f.length,")"]}),l.jsx("ul",{className:"space-y-0.5",children:f.map(m=>{const h=m.id===t,b=a[m.id],g=eh(m),y=(m.agent&&HL[m.agent])??"bg-elevated text-fg-4",N=m.title||`${m.id.slice(0,9)}...`;return l.jsx("li",{children:l.jsxs("button",{type:"button",onClick:()=>{h||s(m.id)},className:se("group flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left transition-colors",h?"border-l-2 border-blue-500 bg-blue-500/5":"border-l-2 border-transparent hover:bg-elevated/60"),children:[l.jsx("span",{className:se("mt-1 h-2 w-2 shrink-0 rounded-full",FL(b))}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[m.agent&&l.jsx("span",{className:se("shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-medium",y),children:m.agent}),g!=null&&l.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] tabular-nums text-fg-6",children:zL(g)})]}),l.jsx("p",{className:se("mt-0.5 line-clamp-2 text-xs leading-5",h?"text-fg-2":"text-fg-3 group-hover:text-fg-2"),children:N})]})]})},m.id)})})]})}function fE({todos:e,messages:t,sessionLinks:a,sessionId:s,onScrollToMessage:o}){var v,S;const[u,d]=_.useState("todo"),f=Ie(w=>w.sessions),m=Ie(w=>w.activeSessionId),h=t.filter(w=>w.role==="user").length,b=(((v=a==null?void 0:a.issues)==null?void 0:v.length)??0)+(((S=a==null?void 0:a.pullRequests)==null?void 0:S.length)??0),g=f.find(w=>w.id===m),y=(g==null?void 0:g.parentID)??m,N=f.filter(w=>w.parentID===y).length;return l.jsxs("div",{className:"flex h-full w-72 shrink-0 flex-col border-l border-line bg-surface",children:[l.jsxs("div",{className:"flex items-center border-b border-line",children:[l.jsxs("button",{type:"button",onClick:()=>d("todo"),className:se("flex flex-1 items-center justify-center gap-1.5 border-b-2 px-3 py-2.5 text-xs font-medium transition-colors",u==="todo"?"border-blue-500 text-blue-500":"border-transparent text-fg-4 hover:text-fg-2"),children:[l.jsx(N3,{className:"h-3.5 w-3.5"}),"待办",e.length>0&&l.jsx("span",{className:"rounded-full bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:e.length})]}),l.jsxs("button",{type:"button",onClick:()=>d("prompts"),className:se("flex flex-1 items-center justify-center gap-1.5 border-b-2 px-3 py-2.5 text-xs font-medium transition-colors",u==="prompts"?"border-blue-500 text-blue-500":"border-transparent text-fg-4 hover:text-fg-2"),children:[l.jsx(O3,{className:"h-3.5 w-3.5"}),"输入",h>0&&l.jsx("span",{className:"rounded-full bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:h})]}),l.jsxs("button",{type:"button",onClick:()=>d("links"),className:se("flex flex-1 items-center justify-center gap-1.5 border-b-2 px-3 py-2.5 text-xs font-medium transition-colors",u==="links"?"border-blue-500 text-blue-500":"border-transparent text-fg-4 hover:text-fg-2"),children:[l.jsx(Vc,{className:"h-3.5 w-3.5"}),"关联",b>0&&l.jsx("span",{className:"rounded-full bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:b})]}),l.jsxs("button",{type:"button",onClick:()=>d("subtasks"),className:se("flex flex-1 items-center justify-center gap-1.5 border-b-2 px-3 py-2.5 text-xs font-medium transition-colors",u==="subtasks"?"border-blue-500 text-blue-500":"border-transparent text-fg-4 hover:text-fg-2"),children:[l.jsx(Gs,{className:"h-3.5 w-3.5"}),"子任务",N>0&&l.jsx("span",{className:"rounded-full bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:N})]})]}),u==="todo"?l.jsx(jL,{todos:e}):u==="prompts"?l.jsx(BL,{messages:t,onScrollToMessage:o}):u==="links"?l.jsx(UL,{links:a,sessionId:s}):l.jsx($L,{})]})}const mE=8;function qL(e,t){let a=e instanceof Element?e:null;for(;a&&a!==t;){if(a.scrollWidth>a.clientWidth){const s=getComputedStyle(a).overflowX;if(s==="auto"||s==="scroll")return!0}a=a.parentElement}return!1}function kT({onSwipeLeft:e,onSwipeRight:t,threshold:a=40,disabled:s=!1}={}){const o=_.useRef({x0:0,y0:0,dir:null,on:!1}),u=_.useRef(0),d=_.useCallback(h=>{if(s||qL(h.target,h.currentTarget))return;const b=h.touches[0];o.current={x0:b.clientX,y0:b.clientY,dir:null,on:!0},u.current=0},[s]),f=_.useCallback(h=>{const b=o.current;if(!b.on)return;const g=h.touches[0].clientX-b.x0,y=h.touches[0].clientY-b.y0;if(!b.dir){(Math.abs(g)>mE||Math.abs(y)>mE)&&(b.dir=Math.abs(g)>Math.abs(y)?"h":"v");return}if(b.dir==="v"){b.on=!1;return}u.current=g},[]),m=_.useCallback(()=>{const h=o.current;if(!h.on||h.dir!=="h"){h.on=!1;return}h.on=!1;const b=u.current;b>a?t==null||t():b<-a&&(e==null||e())},[a,e,t]);return{onTouchStart:d,onTouchMove:f,onTouchEnd:m}}function Ch({side:e,open:t,onClose:a,children:s,width:o="w-80"}){const u=e==="left";return l.jsxs("div",{className:"md:hidden",children:[t&&l.jsx("div",{className:"fixed inset-0 z-40 bg-black/50",onClick:a,"aria-hidden":"true"}),l.jsx("div",{className:se("fixed top-0 bottom-0 z-50 flex flex-col bg-surface pt-[var(--safe-top)] pb-[var(--safe-bottom)] shadow-xl transition-transform duration-200 ease-out",o,u?"left-0 border-r border-line":"right-0 border-l border-line",t?"translate-x-0":u?"-translate-x-full":"translate-x-full"),children:s})]})}function kh(e){var t,a;if(typeof((t=e.time)==null?void 0:t.updated)=="number")return e.time.updated;if(typeof((a=e.time)==null?void 0:a.created)=="number")return e.time.created;if(e.createdAt){const s=Date.parse(e.createdAt);return Number.isNaN(s)?0:s}return 0}function YL(e){const t=kh(e);if(!t)return"";const a=t<1e12?t*1e3:t,s=new Date(a);return s.toDateString()===new Date().toDateString()?s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function hE(e){navigator.clipboard?navigator.clipboard.writeText(e).catch(()=>pE(e)):pE(e)}function pE(e){const t=document.createElement("textarea");t.value=e,t.style.cssText="position:fixed;opacity:0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}function GL(e){switch(e){case"idle":return"bg-emerald-500";case"busy":case"retry":return"bg-amber-500 animate-pulse";case"error":return"bg-red-500";default:return"bg-fg-5"}}function KL({session:e,isActive:t,isConfirming:a,onSelect:s,onDelete:o,onConfirm:u,onCancelConfirm:d,onRename:f,onToggleComplete:m,status:h,issue:b,linkedItems:g}){var P,ae;const y=gc(K=>K.drafts[e.id]),N=!!e.completedAt,v=YL(e),[S,w]=_.useState(!1),[A,R]=_.useState(""),I=_.useRef(null),Y=()=>{var K;R(((K=e.title)==null?void 0:K.trim())||""),w(!0),requestAnimationFrame(()=>{var k;return(k=I.current)==null?void 0:k.focus()})},B=()=>{var k;w(!1);const K=A.trim();K&&K!==(((k=e.title)==null?void 0:k.trim())||"")&&f(K)},C=192,z=_.useRef(null),W=_.useRef(null),Q=_.useRef(0),j=_.useRef({x0:0,y0:0,base:0,dir:null,on:!1}),ee=K=>{Q.current=K;const k=z.current,U=W.current;k&&(k.style.transform=K!==0?`translateX(${K}px)`:"",k.style.pointerEvents=K===-C?"none":""),U&&(U.style.width=`${Math.abs(K)}px`)},ue=K=>{const k=K.touches[0];j.current={x0:k.clientX,y0:k.clientY,base:Q.current,dir:null,on:!0},z.current&&(z.current.style.transition="none"),W.current&&(W.current.style.transition="none")},Z=K=>{const k=j.current;if(!k.on)return;const U=K.touches[0].clientX-k.x0,ie=K.touches[0].clientY-k.y0;if(!k.dir){(Math.abs(U)>5||Math.abs(ie)>5)&&(k.dir=Math.abs(U)>Math.abs(ie)?"h":"v");return}k.dir!=="v"&&ee(Math.max(-C,Math.min(0,k.base+U)))},q=K=>{const k=z.current,U=W.current;k&&(k.style.transition="transform 200ms ease-out"),U&&(U.style.transition="width 200ms ease-out"),ee(K)},F=()=>{j.current.on=!1,q(Q.current<-C/2?-C:0)},D=()=>q(0);return l.jsxs("li",{className:"relative overflow-hidden rounded-md",children:[l.jsx("div",{ref:W,className:"absolute right-0 top-0 bottom-0 z-10 overflow-hidden md:hidden",style:{width:0},children:l.jsx("div",{className:"absolute right-0 top-0 bottom-0 flex",style:{width:C},children:a?l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",onClick:()=>{o(),D()},className:"flex w-12 items-center justify-center bg-red-500 text-white active:bg-red-600",children:l.jsx(Cn,{className:"h-4 w-4"})}),l.jsx("button",{type:"button",onClick:()=>{d(),D()},className:"flex w-12 items-center justify-center bg-neutral-500 text-white active:bg-neutral-600",children:l.jsx(gt,{className:"h-4 w-4"})})]}):l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",onClick:()=>{m(),D()},className:se("flex w-12 items-center justify-center text-white",N?"bg-neutral-500 active:bg-neutral-600":"bg-emerald-500 active:bg-emerald-600"),children:l.jsx(Tm,{className:"h-4 w-4"})}),l.jsx("button",{type:"button",onClick:()=>{Y(),D()},className:"flex w-12 items-center justify-center bg-amber-500 text-white active:bg-amber-600",children:l.jsx(Nx,{className:"h-4 w-4"})}),l.jsx("button",{type:"button",onClick:()=>{var K;hE(JSON.stringify({id:e.id,name:((K=e.title)==null?void 0:K.trim())||""},null,2)),D()},className:"flex w-12 items-center justify-center bg-blue-500 text-white active:bg-blue-600",children:l.jsx(Tc,{className:"h-4 w-4"})}),l.jsx("button",{type:"button",onClick:()=>u(),className:"flex w-12 items-center justify-center bg-red-500 text-white active:bg-red-600",children:l.jsx(wr,{className:"h-4 w-4"})})]})})}),l.jsxs("div",{ref:z,className:se("group relative rounded-md border-l-2 will-change-transform",t?"border-blue-500 bg-elevated":"border-transparent bg-surface hover:bg-elevated/50"),onTouchStart:ue,onTouchMove:Z,onTouchEnd:F,children:[l.jsxs("button",{type:"button",onClick:()=>{S||(s(),D())},className:se("block w-full px-2.5 py-2 text-left",N&&!t&&"opacity-50"),style:{pointerEvents:"auto"},children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:se("h-1.5 w-1.5 shrink-0 rounded-full",GL(h))}),l.jsx("span",{className:"min-w-0 truncate font-mono text-xs text-fg-3",children:((P=e.agent)==null?void 0:P.trim())||"默认"}),N&&l.jsx(Tm,{className:"h-3 w-3 shrink-0 text-emerald-400"}),v&&l.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] tabular-nums text-fg-5",children:v})]}),S?l.jsx("input",{ref:I,type:"text",value:A,onChange:K=>R(K.target.value),onBlur:B,onKeyDown:K=>{K.key==="Enter"&&B(),K.key==="Escape"&&w(!1)},onClick:K=>K.stopPropagation(),className:"mt-0.5 w-full rounded border border-blue-500 bg-base pl-3.5 text-sm text-fg-2 outline-none"}):l.jsxs("div",{className:"mt-0.5 pl-3.5",onDoubleClick:K=>{K.stopPropagation(),Y()},children:[(b||g)&&l.jsxs("div",{className:"mb-0.5 flex flex-wrap gap-1",children:[b&&l.jsxs("span",{className:se("shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-medium leading-none",b.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",b.number]}),g==null?void 0:g.map(K=>l.jsx("span",{className:se("shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-medium leading-none",K.type==="pr"?K.state==="open"?"bg-blue-500/15 text-blue-400":K.mergedAt?"bg-purple-500/15 text-purple-400":"bg-red-500/15 text-red-400":K.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:K.type==="pr"?`PR#${K.number}`:`#${K.number}`},`${K.type}-${K.number}`))]}),l.jsx("span",{className:"block truncate text-sm text-fg-2",children:((ae=e.title)==null?void 0:ae.trim())||"未命名运行"}),y&&l.jsxs("span",{className:"mt-0.5 block truncate text-xs text-amber-400/80",children:["✏️ ",y]})]})]}),a?l.jsxs("span",{className:"absolute right-1.5 top-1.5 hidden items-center gap-1 rounded bg-surface/90 px-0.5 md:flex",children:[l.jsx("button",{type:"button",onClick:o,className:"rounded p-1 text-red-400 hover:bg-red-500/10",children:l.jsx(Cn,{className:"h-3.5 w-3.5"})}),l.jsx("button",{type:"button",onClick:d,className:"rounded p-1 text-fg-3 hover:bg-elevated",children:l.jsx(gt,{className:"h-3.5 w-3.5"})})]}):l.jsxs("span",{className:"absolute right-1.5 top-1.5 hidden items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 md:flex",children:[l.jsx("button",{type:"button",onClick:m,title:N?"取消完成":"标记完成",className:se("rounded p-1",N?"text-emerald-400 hover:text-emerald-300":"text-fg-5 hover:text-emerald-400"),children:l.jsx(Tm,{className:"h-3.5 w-3.5"})}),l.jsx("button",{type:"button",onClick:Y,title:"重命名",className:"rounded p-1 text-fg-5 hover:text-fg-2",children:l.jsx(Nx,{className:"h-3.5 w-3.5"})}),l.jsx("button",{type:"button",onClick:()=>{var K;hE(JSON.stringify({id:e.id,name:((K=e.title)==null?void 0:K.trim())||""},null,2))},title:"复制 Session JSON",className:"rounded p-1 text-fg-5 hover:text-fg-2",children:l.jsx(Tc,{className:"h-3.5 w-3.5"})}),l.jsx("button",{type:"button",onClick:u,className:"rounded p-1 text-fg-5 hover:text-red-400",children:l.jsx(wr,{className:"h-3.5 w-3.5"})})]})]})]})}function gE({onClose:e}){const[t,a]=_.useState(null),s=Ie(R=>R.sessions),o=Ie(R=>R.activeSessionId),u=Ie(R=>R.sessionStatuses),d=Ie(R=>R.sessionFilter),f=Ie(R=>R.setSessionFilter),m=Ie(R=>R.setActiveSession),h=Ie(R=>R.deleteSession),b=Ie(R=>R.renameSession),g=Ie(R=>R.toggleSessionComplete),y=Be(R=>R.activeRepoId),N=Ve(R=>R.issues),v=Ie(R=>R.allSessionLinks),S=[...s].filter(R=>R.parentID?!1:d==="active"?!R.completedAt:!0).sort((R,I)=>kh(I)-kh(R)),w=new Map(N.map(R=>[R.id,R])),A=R=>l.jsx("ul",{className:"space-y-0.5",children:R.map(I=>{const Y=I.issueId?w.get(I.issueId):void 0,B=v[I.id],C=[];if(B){for(const z of B.issues)C.push({number:z.number,state:z.state,type:"issue"});for(const z of B.pullRequests)C.push({number:z.number,state:z.state,type:"pr",mergedAt:z.mergedAt})}return l.jsx(KL,{session:I,isActive:I.id===o,isConfirming:t===I.id,status:u[I.id],issue:Y?{number:Y.number,title:Y.title,state:Y.state}:void 0,linkedItems:C.length>0?C:void 0,onSelect:()=>{m(I.id),e==null||e()},onDelete:()=>{h(I.id),a(null)},onConfirm:()=>a(I.id),onCancelConfirm:()=>a(null),onRename:z=>void b(I.id,z),onToggleComplete:()=>void g(I.id)},I.id)})});return l.jsx("div",{className:"flex h-full w-80 shrink-0 flex-col border-r border-line bg-surface",children:l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-3",children:[l.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-fg-3",children:"运行记录"}),y&&l.jsx("button",{type:"button",onClick:()=>{Ie.setState({activeSessionId:null}),e==null||e()},title:"新建运行",className:"flex h-7 w-7 items-center justify-center rounded-md bg-blue-600 text-white transition-colors hover:bg-blue-500",children:l.jsx(Ra,{className:"h-4 w-4"})})]}),y&&l.jsx("div",{className:"flex gap-1 border-b border-line px-3 py-1.5",children:[["active","进行中"],["all","全部"]].map(([R,I])=>l.jsx("button",{type:"button",onClick:()=>f(R),className:se("rounded-md px-2 py-0.5 font-mono text-[11px] transition-colors",d===R?"bg-elevated text-fg-2":"text-fg-5 hover:text-fg-3"),children:I},R))}),l.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:y?S.length===0?l.jsx("p",{className:"px-2 py-6 text-center font-mono text-xs text-fg-5",children:"暂无运行记录"}):l.jsx("div",{children:A(S)}):l.jsx("p",{className:"px-2 py-6 text-center font-mono text-xs text-fg-5",children:"请先选择一个仓库"})})]})})}function VL(){const[e,t]=_.useState(()=>typeof window<"u"&&window.matchMedia("(min-width: 1280px)").matches);return _.useEffect(()=>{const a=window.matchMedia("(min-width: 1280px)"),s=o=>t(o.matches);return a.addEventListener("change",s),()=>a.removeEventListener("change",s)},[]),e}function bE(e){const t=document.querySelector(`[data-message-id="${e}"]`);t&&(t.scrollIntoView({behavior:"smooth",block:"center"}),t.classList.add("fs-highlight"),setTimeout(()=>t.classList.remove("fs-highlight"),2e3))}function XL(){const[e,t]=_.useState(!1),[a,s]=_.useState(!1),[o,u]=_.useState(!1),d=VL(),f=Ie(w=>w.activeSessionId),m=Ac(w=>w.sessionPanelCollapsed),h=Ac(w=>w.toggleSessionPanel),b=Ie(w=>{const A=w.activeSessionId;return A?w.todos[A]??Rc:Rc}),g=Ie(w=>{const A=w.activeSessionId;return A?w.messages[A]??No:No}),y=Ie(w=>{const A=w.activeSessionId;return A?w.sessionLinks[A]:void 0});_.useEffect(()=>{d&&f?u(!0):d||u(!1)},[d,f]);const N=o&&!!f,v=()=>{window.matchMedia("(max-width: 767px)").matches?s(w=>!w):u(w=>!w)},S=kT({onSwipeRight:()=>t(!0),onSwipeLeft:()=>s(!0),disabled:e||a});return l.jsxs("div",{className:"flex min-h-0 flex-1",...S,children:[l.jsxs("div",{className:"relative hidden shrink-0 md:flex",children:[l.jsx("div",{className:se("overflow-hidden transition-[width] duration-200 ease-in-out",m?"w-0":"w-80"),children:l.jsx("div",{className:"h-full w-80",children:l.jsx(gE,{})})}),l.jsx("button",{type:"button",onClick:h,title:m?"展开运行记录":"收起运行记录",className:se("absolute left-full top-1/2 z-20 flex h-14 w-4 -translate-y-1/2 items-center justify-center rounded-r-md border-y border-r border-line text-fg-5 transition-all duration-200 hover:bg-elevated hover:text-fg-3",m?"bg-surface opacity-80 hover:w-5 hover:opacity-100":"bg-surface/80 opacity-40 hover:opacity-100"),children:m?l.jsx(Gc,{className:"h-3 w-3"}):l.jsx(Kh,{className:"h-3 w-3"})})]}),l.jsx(Ch,{side:"left",open:e,onClose:()=>t(!1),children:l.jsx(gE,{onClose:()=>t(!1)})}),l.jsx(Ch,{side:"right",open:a,onClose:()=>s(!1),children:l.jsx(fE,{todos:b,messages:g,sessionLinks:y,sessionId:f,onScrollToMessage:w=>{s(!1),setTimeout(()=>bE(w),300)}})}),l.jsx("div",{className:"flex min-w-0 flex-1 flex-col",children:l.jsx(IL,{onToggleSidebar:()=>t(w=>!w),onToggleRightPanel:v,rightPanelOpen:N})}),N&&l.jsx("div",{className:"hidden shrink-0 md:flex",children:l.jsx(fE,{todos:b,messages:g,sessionLinks:y,sessionId:f,onScrollToMessage:bE})})]})}const xE=/[#.]/g;function QL(e,t){const a=e||"",s={};let o=0,u,d;for(;o<a.length;){xE.lastIndex=o;const f=xE.exec(a),m=a.slice(o,f?f.index:a.length);m&&(u?u==="#"?s.id=m:Array.isArray(s.className)?s.className.push(m):s.className=[m]:d=m,o+=m.length),f&&(u=f[0],o++)}return{type:"element",tagName:d||t||"div",properties:s,children:[]}}function RT(e,t,a){const s=a?ej(a):void 0;function o(u,d,...f){let m;if(u==null){m={type:"root",children:[]};const h=d;f.unshift(h)}else{m=QL(u,t);const h=m.tagName.toLowerCase(),b=s?s.get(h):void 0;if(m.tagName=b||h,WL(d))f.unshift(d);else for(const[g,y]of Object.entries(d))ZL(e,m.properties,g,y)}for(const h of f)Rh(m.children,h);return m.type==="element"&&m.tagName==="template"&&(m.content={type:"root",children:m.children},m.children=[]),m}return o}function WL(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,a=Object.keys(e);for(const s of a){const o=t[s];if(o&&typeof o=="object"){if(!Array.isArray(o))return!0;const u=o;for(const d of u)if(typeof d!="number"&&typeof d!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function ZL(e,t,a,s){const o=ed(e,a);let u;if(s!=null){if(typeof s=="number"){if(Number.isNaN(s))return;u=s}else typeof s=="boolean"?u=s:typeof s=="string"?o.spaceSeparated?u=Qx(s):o.commaSeparated?u=Yx(s):o.commaOrSpaceSeparated?u=Qx(Yx(s).join(" ")):u=EE(o,o.property,s):Array.isArray(s)?u=[...s]:u=o.property==="style"?JL(s):String(s);if(Array.isArray(u)){const d=[];for(const f of u)d.push(EE(o,o.property,f));u=d}o.property==="className"&&Array.isArray(t.className)&&(u=t.className.concat(u)),t[o.property]=u}}function Rh(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const a of t)Rh(e,a);else if(typeof t=="object"&&"type"in t)t.type==="root"?Rh(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function EE(e,t,a){if(typeof a=="string"){if(e.number&&a&&!Number.isNaN(Number(a)))return Number(a);if((e.boolean||e.overloadedBoolean)&&(a===""||To(a)===To(t)))return!0}return a}function JL(e){const t=[];for(const[a,s]of Object.entries(e))t.push([a,s].join(": "));return t.join("; ")}function ej(e){const t=new Map;for(const a of e)t.set(a.toLowerCase(),a);return t}const tj=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],nj=RT(Oo,"div"),aj=RT(ms,"g",tj);function rj(e){const t=String(e),a=[];return{toOffset:o,toPoint:s};function s(u){if(typeof u=="number"&&u>-1&&u<=t.length){let d=0;for(;;){let f=a[d];if(f===void 0){const m=yE(t,a[d-1]);f=m===-1?t.length+1:m+1,a[d]=f}if(f>u)return{line:d+1,column:u-(d>0?a[d-1]:0)+1,offset:u};d++}}}function o(u){if(u&&typeof u.line=="number"&&typeof u.column=="number"&&!Number.isNaN(u.line)&&!Number.isNaN(u.column)){for(;a.length<u.line;){const f=a[a.length-1],m=yE(t,f),h=m===-1?t.length+1:m+1;if(f===h)break;a.push(h)}const d=(u.line>1?a[u.line-2]:0)+u.column-1;if(d<a[u.line-1])return d}}}function yE(e,t){const a=e.indexOf("\r",t),s=e.indexOf(`
507
+ `,t);return s===-1?a:a===-1||a+1===s?s:a<s?a:s}const Fs={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},OT={}.hasOwnProperty,sj=Object.prototype;function ij(e,t){const a=t||{};return yp({file:a.file||void 0,location:!1,schema:a.space==="svg"?ms:Oo,verbose:a.verbose||!1},e)}function yp(e,t){let a;switch(t.nodeName){case"#comment":{const s=t;return a={type:"comment",value:s.data},xc(e,s,a),a}case"#document":case"#document-fragment":{const s=t,o="mode"in s?s.mode==="quirks"||s.mode==="limited-quirks":!1;if(a={type:"root",children:IT(e,t.childNodes),data:{quirksMode:o}},e.file&&e.location){const u=String(e.file),d=rj(u),f=d.toPoint(0),m=d.toPoint(u.length);a.position={start:f,end:m}}return a}case"#documentType":{const s=t;return a={type:"doctype"},xc(e,s,a),a}case"#text":{const s=t;return a={type:"text",value:s.value},xc(e,s,a),a}default:return a=lj(e,t),a}}function IT(e,t){let a=-1;const s=[];for(;++a<t.length;){const o=yp(e,t[a]);s.push(o)}return s}function lj(e,t){const a=e.schema;e.schema=t.namespaceURI===Fs.svg?ms:Oo;let s=-1;const o={};for(;++s<t.attrs.length;){const f=t.attrs[s],m=(f.prefix?f.prefix+":":"")+f.name;OT.call(sj,m)||(o[m]=f.value)}const d=(e.schema.space==="svg"?aj:nj)(t.tagName,o,IT(e,t.childNodes));if(xc(e,t,d),d.tagName==="template"){const f=t,m=f.sourceCodeLocation,h=m&&m.startTag&&Ui(m.startTag),b=m&&m.endTag&&Ui(m.endTag),g=yp(e,f.content);h&&b&&e.file&&(g.position={start:h.end,end:b.start}),d.content=g}return e.schema=a,d}function xc(e,t,a){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const s=oj(e,a,t.sourceCodeLocation);s&&(e.location=!0,a.position=s)}}function oj(e,t,a){const s=Ui(a);if(t.type==="element"){const o=t.children[t.children.length-1];if(s&&!a.endTag&&o&&o.position&&o.position.end&&(s.end=Object.assign({},o.position.end)),e.verbose){const u={};let d;if(a.attrs)for(d in a.attrs)OT.call(a.attrs,d)&&(u[ed(e.schema,d).property]=Ui(a.attrs[d]));a.startTag;const f=Ui(a.startTag),m=a.endTag?Ui(a.endTag):void 0,h={opening:f};m&&(h.closing=m),h.properties=u,t.data={position:h}}}return s}function Ui(e){const t=NE({line:e.startLine,column:e.startCol,offset:e.startOffset}),a=NE({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||a?{start:t,end:a}:void 0}function NE(e){return e.line&&e.column?e:void 0}const uj={},cj={}.hasOwnProperty,MT=IN("type",{handlers:{root:fj,element:bj,text:pj,comment:gj,doctype:hj}});function dj(e,t){const s=(t||uj).space;return MT(e,s==="svg"?ms:Oo)}function fj(e,t){const a={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return a.childNodes=Np(e.children,a,t),Ji(e,a),a}function mj(e,t){const a={nodeName:"#document-fragment",childNodes:[]};return a.childNodes=Np(e.children,a,t),Ji(e,a),a}function hj(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Ji(e,t),t}function pj(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Ji(e,t),t}function gj(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Ji(e,t),t}function bj(e,t){const a=t;let s=a;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=ms);const o=[];let u;if(e.properties){for(u in e.properties)if(u!=="children"&&cj.call(e.properties,u)){const m=xj(s,u,e.properties[u]);m&&o.push(m)}}const d=s.space,f={nodeName:e.tagName,tagName:e.tagName,attrs:o,namespaceURI:Fs[d],childNodes:[],parentNode:null};return f.childNodes=Np(e.children,f,s),Ji(e,f),e.tagName==="template"&&e.content&&(f.content=mj(e.content,s)),f}function xj(e,t,a){const s=ed(e,t);if(a===!1||a===null||a===void 0||typeof a=="number"&&Number.isNaN(a)||!a&&s.boolean)return;Array.isArray(a)&&(a=s.commaSeparated?Yy(a):Jy(a));const o={name:s.attribute,value:a===!0?"":String(a)};if(s.space&&s.space!=="html"&&s.space!=="svg"){const u=o.name.indexOf(":");u<0?o.prefix="":(o.name=o.name.slice(u+1),o.prefix=s.attribute.slice(0,u)),o.namespace=Fs[s.space]}return o}function Np(e,t,a){let s=-1;const o=[];if(e)for(;++s<e.length;){const u=MT(e[s],a);u.parentNode=t,o.push(u)}return o}function Ji(e,t){const a=e.position;a&&a.start&&a.end&&(a.start.offset,a.end.offset,t.sourceCodeLocation={startLine:a.start.line,startCol:a.start.column,startOffset:a.start.offset,endLine:a.end.line,endCol:a.end.column,endOffset:a.end.offset})}const Ej=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],yj=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),zt="�";var L;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(L||(L={}));const Wn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function DT(e){return e>=55296&&e<=57343}function Nj(e){return e>=56320&&e<=57343}function Tj(e,t){return(e-55296)*1024+9216+t}function LT(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function jT(e){return e>=64976&&e<=65007||yj.has(e)}var fe;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(fe||(fe={}));const _j=65536;class vj{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=_j,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,a){const{line:s,col:o,offset:u}=this,d=o+a,f=u+a;return{code:t,startLine:s,endLine:s,startCol:d,endCol:d,startOffset:f,endOffset:f}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const a=this.html.charCodeAt(this.pos+1);if(Nj(a))return this.pos++,this._addGap(),Tj(t,a)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,L.EOF;return this._err(fe.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,a){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=a}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,a){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(a)return this.html.startsWith(t,this.pos);for(let s=0;s<t.length;s++)if((this.html.charCodeAt(this.pos+s)|32)!==t.charCodeAt(s))return!1;return!0}peek(t){const a=this.pos+t;if(a>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,L.EOF;const s=this.html.charCodeAt(a);return s===L.CARRIAGE_RETURN?L.LINE_FEED:s}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,L.EOF;let t=this.html.charCodeAt(this.pos);return t===L.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,L.LINE_FEED):t===L.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,DT(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===L.LINE_FEED||t===L.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){LT(t)?this._err(fe.controlCharacterInInputStream):jT(t)&&this._err(fe.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var rt;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(rt||(rt={}));function BT(e,t){for(let a=e.attrs.length-1;a>=0;a--)if(e.attrs[a].name===t)return e.attrs[a].value;return null}const Sj=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),Aj=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function wj(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=Aj.get(e))!==null&&t!==void 0?t:e}var gn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(gn||(gn={}));const Cj=32;var os;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(os||(os={}));function Oh(e){return e>=gn.ZERO&&e<=gn.NINE}function kj(e){return e>=gn.UPPER_A&&e<=gn.UPPER_F||e>=gn.LOWER_A&&e<=gn.LOWER_F}function Rj(e){return e>=gn.UPPER_A&&e<=gn.UPPER_Z||e>=gn.LOWER_A&&e<=gn.LOWER_Z||Oh(e)}function Oj(e){return e===gn.EQUALS||Rj(e)}var pn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(pn||(pn={}));var Sr;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Sr||(Sr={}));class Ij{constructor(t,a,s){this.decodeTree=t,this.emitCodePoint=a,this.errors=s,this.state=pn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Sr.Strict}startEntity(t){this.decodeMode=t,this.state=pn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,a){switch(this.state){case pn.EntityStart:return t.charCodeAt(a)===gn.NUM?(this.state=pn.NumericStart,this.consumed+=1,this.stateNumericStart(t,a+1)):(this.state=pn.NamedEntity,this.stateNamedEntity(t,a));case pn.NumericStart:return this.stateNumericStart(t,a);case pn.NumericDecimal:return this.stateNumericDecimal(t,a);case pn.NumericHex:return this.stateNumericHex(t,a);case pn.NamedEntity:return this.stateNamedEntity(t,a)}}stateNumericStart(t,a){return a>=t.length?-1:(t.charCodeAt(a)|Cj)===gn.LOWER_X?(this.state=pn.NumericHex,this.consumed+=1,this.stateNumericHex(t,a+1)):(this.state=pn.NumericDecimal,this.stateNumericDecimal(t,a))}addToNumericResult(t,a,s,o){if(a!==s){const u=s-a;this.result=this.result*Math.pow(o,u)+Number.parseInt(t.substr(a,u),o),this.consumed+=u}}stateNumericHex(t,a){const s=a;for(;a<t.length;){const o=t.charCodeAt(a);if(Oh(o)||kj(o))a+=1;else return this.addToNumericResult(t,s,a,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(t,s,a,16),-1}stateNumericDecimal(t,a){const s=a;for(;a<t.length;){const o=t.charCodeAt(a);if(Oh(o))a+=1;else return this.addToNumericResult(t,s,a,10),this.emitNumericEntity(o,2)}return this.addToNumericResult(t,s,a,10),-1}emitNumericEntity(t,a){var s;if(this.consumed<=a)return(s=this.errors)===null||s===void 0||s.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===gn.SEMI)this.consumed+=1;else if(this.decodeMode===Sr.Strict)return 0;return this.emitCodePoint(wj(this.result),this.consumed),this.errors&&(t!==gn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,a){const{decodeTree:s}=this;let o=s[this.treeIndex],u=(o&os.VALUE_LENGTH)>>14;for(;a<t.length;a++,this.excess++){const d=t.charCodeAt(a);if(this.treeIndex=Mj(s,o,this.treeIndex+Math.max(1,u),d),this.treeIndex<0)return this.result===0||this.decodeMode===Sr.Attribute&&(u===0||Oj(d))?0:this.emitNotTerminatedNamedEntity();if(o=s[this.treeIndex],u=(o&os.VALUE_LENGTH)>>14,u!==0){if(d===gn.SEMI)return this.emitNamedEntityData(this.treeIndex,u,this.consumed+this.excess);this.decodeMode!==Sr.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:a,decodeTree:s}=this,o=(s[a]&os.VALUE_LENGTH)>>14;return this.emitNamedEntityData(a,o,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,a,s){const{decodeTree:o}=this;return this.emitCodePoint(a===1?o[t]&~os.VALUE_LENGTH:o[t+1],s),a===3&&this.emitCodePoint(o[t+2],s),s}end(){var t;switch(this.state){case pn.NamedEntity:return this.result!==0&&(this.decodeMode!==Sr.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case pn.NumericDecimal:return this.emitNumericEntity(0,2);case pn.NumericHex:return this.emitNumericEntity(0,3);case pn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case pn.EntityStart:return 0}}}function Mj(e,t,a,s){const o=(t&os.BRANCH_LENGTH)>>7,u=t&os.JUMP_TABLE;if(o===0)return u!==0&&s===u?a:-1;if(u){const m=s-u;return m<0||m>=o?-1:e[a+m]-1}let d=a,f=d+o-1;for(;d<=f;){const m=d+f>>>1,h=e[m];if(h<s)d=m+1;else if(h>s)f=m-1;else return e[m+o]}return-1}var Ee;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(Ee||(Ee={}));var $s;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})($s||($s={}));var Ca;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Ca||(Ca={}));var ne;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(ne||(ne={}));var E;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(E||(E={}));const Dj=new Map([[ne.A,E.A],[ne.ADDRESS,E.ADDRESS],[ne.ANNOTATION_XML,E.ANNOTATION_XML],[ne.APPLET,E.APPLET],[ne.AREA,E.AREA],[ne.ARTICLE,E.ARTICLE],[ne.ASIDE,E.ASIDE],[ne.B,E.B],[ne.BASE,E.BASE],[ne.BASEFONT,E.BASEFONT],[ne.BGSOUND,E.BGSOUND],[ne.BIG,E.BIG],[ne.BLOCKQUOTE,E.BLOCKQUOTE],[ne.BODY,E.BODY],[ne.BR,E.BR],[ne.BUTTON,E.BUTTON],[ne.CAPTION,E.CAPTION],[ne.CENTER,E.CENTER],[ne.CODE,E.CODE],[ne.COL,E.COL],[ne.COLGROUP,E.COLGROUP],[ne.DD,E.DD],[ne.DESC,E.DESC],[ne.DETAILS,E.DETAILS],[ne.DIALOG,E.DIALOG],[ne.DIR,E.DIR],[ne.DIV,E.DIV],[ne.DL,E.DL],[ne.DT,E.DT],[ne.EM,E.EM],[ne.EMBED,E.EMBED],[ne.FIELDSET,E.FIELDSET],[ne.FIGCAPTION,E.FIGCAPTION],[ne.FIGURE,E.FIGURE],[ne.FONT,E.FONT],[ne.FOOTER,E.FOOTER],[ne.FOREIGN_OBJECT,E.FOREIGN_OBJECT],[ne.FORM,E.FORM],[ne.FRAME,E.FRAME],[ne.FRAMESET,E.FRAMESET],[ne.H1,E.H1],[ne.H2,E.H2],[ne.H3,E.H3],[ne.H4,E.H4],[ne.H5,E.H5],[ne.H6,E.H6],[ne.HEAD,E.HEAD],[ne.HEADER,E.HEADER],[ne.HGROUP,E.HGROUP],[ne.HR,E.HR],[ne.HTML,E.HTML],[ne.I,E.I],[ne.IMG,E.IMG],[ne.IMAGE,E.IMAGE],[ne.INPUT,E.INPUT],[ne.IFRAME,E.IFRAME],[ne.KEYGEN,E.KEYGEN],[ne.LABEL,E.LABEL],[ne.LI,E.LI],[ne.LINK,E.LINK],[ne.LISTING,E.LISTING],[ne.MAIN,E.MAIN],[ne.MALIGNMARK,E.MALIGNMARK],[ne.MARQUEE,E.MARQUEE],[ne.MATH,E.MATH],[ne.MENU,E.MENU],[ne.META,E.META],[ne.MGLYPH,E.MGLYPH],[ne.MI,E.MI],[ne.MO,E.MO],[ne.MN,E.MN],[ne.MS,E.MS],[ne.MTEXT,E.MTEXT],[ne.NAV,E.NAV],[ne.NOBR,E.NOBR],[ne.NOFRAMES,E.NOFRAMES],[ne.NOEMBED,E.NOEMBED],[ne.NOSCRIPT,E.NOSCRIPT],[ne.OBJECT,E.OBJECT],[ne.OL,E.OL],[ne.OPTGROUP,E.OPTGROUP],[ne.OPTION,E.OPTION],[ne.P,E.P],[ne.PARAM,E.PARAM],[ne.PLAINTEXT,E.PLAINTEXT],[ne.PRE,E.PRE],[ne.RB,E.RB],[ne.RP,E.RP],[ne.RT,E.RT],[ne.RTC,E.RTC],[ne.RUBY,E.RUBY],[ne.S,E.S],[ne.SCRIPT,E.SCRIPT],[ne.SEARCH,E.SEARCH],[ne.SECTION,E.SECTION],[ne.SELECT,E.SELECT],[ne.SOURCE,E.SOURCE],[ne.SMALL,E.SMALL],[ne.SPAN,E.SPAN],[ne.STRIKE,E.STRIKE],[ne.STRONG,E.STRONG],[ne.STYLE,E.STYLE],[ne.SUB,E.SUB],[ne.SUMMARY,E.SUMMARY],[ne.SUP,E.SUP],[ne.TABLE,E.TABLE],[ne.TBODY,E.TBODY],[ne.TEMPLATE,E.TEMPLATE],[ne.TEXTAREA,E.TEXTAREA],[ne.TFOOT,E.TFOOT],[ne.TD,E.TD],[ne.TH,E.TH],[ne.THEAD,E.THEAD],[ne.TITLE,E.TITLE],[ne.TR,E.TR],[ne.TRACK,E.TRACK],[ne.TT,E.TT],[ne.U,E.U],[ne.UL,E.UL],[ne.SVG,E.SVG],[ne.VAR,E.VAR],[ne.WBR,E.WBR],[ne.XMP,E.XMP]]);function el(e){var t;return(t=Dj.get(e))!==null&&t!==void 0?t:E.UNKNOWN}const Te=E,Lj={[Ee.HTML]:new Set([Te.ADDRESS,Te.APPLET,Te.AREA,Te.ARTICLE,Te.ASIDE,Te.BASE,Te.BASEFONT,Te.BGSOUND,Te.BLOCKQUOTE,Te.BODY,Te.BR,Te.BUTTON,Te.CAPTION,Te.CENTER,Te.COL,Te.COLGROUP,Te.DD,Te.DETAILS,Te.DIR,Te.DIV,Te.DL,Te.DT,Te.EMBED,Te.FIELDSET,Te.FIGCAPTION,Te.FIGURE,Te.FOOTER,Te.FORM,Te.FRAME,Te.FRAMESET,Te.H1,Te.H2,Te.H3,Te.H4,Te.H5,Te.H6,Te.HEAD,Te.HEADER,Te.HGROUP,Te.HR,Te.HTML,Te.IFRAME,Te.IMG,Te.INPUT,Te.LI,Te.LINK,Te.LISTING,Te.MAIN,Te.MARQUEE,Te.MENU,Te.META,Te.NAV,Te.NOEMBED,Te.NOFRAMES,Te.NOSCRIPT,Te.OBJECT,Te.OL,Te.P,Te.PARAM,Te.PLAINTEXT,Te.PRE,Te.SCRIPT,Te.SECTION,Te.SELECT,Te.SOURCE,Te.STYLE,Te.SUMMARY,Te.TABLE,Te.TBODY,Te.TD,Te.TEMPLATE,Te.TEXTAREA,Te.TFOOT,Te.TH,Te.THEAD,Te.TITLE,Te.TR,Te.TRACK,Te.UL,Te.WBR,Te.XMP]),[Ee.MATHML]:new Set([Te.MI,Te.MO,Te.MN,Te.MS,Te.MTEXT,Te.ANNOTATION_XML]),[Ee.SVG]:new Set([Te.TITLE,Te.FOREIGN_OBJECT,Te.DESC]),[Ee.XLINK]:new Set,[Ee.XML]:new Set,[Ee.XMLNS]:new Set},Ih=new Set([Te.H1,Te.H2,Te.H3,Te.H4,Te.H5,Te.H6]);ne.STYLE,ne.SCRIPT,ne.XMP,ne.IFRAME,ne.NOEMBED,ne.NOFRAMES,ne.PLAINTEXT;var H;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(H||(H={}));const Jt={DATA:H.DATA,RCDATA:H.RCDATA,RAWTEXT:H.RAWTEXT,SCRIPT_DATA:H.SCRIPT_DATA,PLAINTEXT:H.PLAINTEXT,CDATA_SECTION:H.CDATA_SECTION};function jj(e){return e>=L.DIGIT_0&&e<=L.DIGIT_9}function io(e){return e>=L.LATIN_CAPITAL_A&&e<=L.LATIN_CAPITAL_Z}function Bj(e){return e>=L.LATIN_SMALL_A&&e<=L.LATIN_SMALL_Z}function is(e){return Bj(e)||io(e)}function TE(e){return is(e)||jj(e)}function fc(e){return e+32}function PT(e){return e===L.SPACE||e===L.LINE_FEED||e===L.TABULATION||e===L.FORM_FEED}function _E(e){return PT(e)||e===L.SOLIDUS||e===L.GREATER_THAN_SIGN}function Pj(e){return e===L.NULL?fe.nullCharacterReference:e>1114111?fe.characterReferenceOutsideUnicodeRange:DT(e)?fe.surrogateCharacterReference:jT(e)?fe.noncharacterCharacterReference:LT(e)||e===L.CARRIAGE_RETURN?fe.controlCharacterReference:null}class Uj{constructor(t,a){this.options=t,this.handler=a,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=H.DATA,this.returnState=H.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new vj(a),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Ij(Sj,(s,o)=>{this.preprocessor.pos=this.entityStartPos+o-1,this._flushCodePointConsumedAsCharacterReference(s)},a.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(fe.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:s=>{this._err(fe.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+s)},validateNumericCharacterReference:s=>{const o=Pj(s);o&&this._err(o,1)}}:void 0)}_err(t,a=0){var s,o;(o=(s=this.handler).onParseError)===null||o===void 0||o.call(s,this.preprocessor.getError(t,a))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,a,s){this.active=!0,this.preprocessor.write(t,a),this._runParsingLoop(),this.paused||s==null||s()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let a=0;a<t;a++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,a){return this.preprocessor.startsWith(t,a)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:rt.START_TAG,tagName:"",tagID:E.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:rt.END_TAG,tagName:"",tagID:E.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:rt.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:rt.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,a){this.currentCharacterToken={type:t,chars:a,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,a;const s=this.currentToken;if(BT(s,this.currentAttr.name)===null){if(s.attrs.push(this.currentAttr),s.location&&this.currentLocation){const o=(t=(a=s.location).attrs)!==null&&t!==void 0?t:a.attrs=Object.create(null);o[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(fe.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=el(t.tagName),t.type===rt.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(fe.endTagWithAttributes),t.selfClosing&&this._err(fe.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case rt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case rt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case rt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:rt.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,a){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=a;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,a)}_emitCodePoint(t){const a=PT(t)?rt.WHITESPACE_CHARACTER:t===L.NULL?rt.NULL_CHARACTER:rt.CHARACTER;this._appendCharToCurrentCharacterToken(a,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(rt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=H.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Sr.Attribute:Sr.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===H.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===H.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===H.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case H.DATA:{this._stateData(t);break}case H.RCDATA:{this._stateRcdata(t);break}case H.RAWTEXT:{this._stateRawtext(t);break}case H.SCRIPT_DATA:{this._stateScriptData(t);break}case H.PLAINTEXT:{this._statePlaintext(t);break}case H.TAG_OPEN:{this._stateTagOpen(t);break}case H.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case H.TAG_NAME:{this._stateTagName(t);break}case H.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case H.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case H.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case H.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case H.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case H.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case H.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case H.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case H.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case H.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case H.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case H.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case H.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case H.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case H.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case H.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case H.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case H.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case H.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case H.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case H.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case H.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case H.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case H.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case H.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case H.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case H.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case H.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case H.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case H.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case H.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case H.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case H.BOGUS_COMMENT:{this._stateBogusComment(t);break}case H.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case H.COMMENT_START:{this._stateCommentStart(t);break}case H.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case H.COMMENT:{this._stateComment(t);break}case H.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case H.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case H.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case H.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case H.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case H.COMMENT_END:{this._stateCommentEnd(t);break}case H.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case H.DOCTYPE:{this._stateDoctype(t);break}case H.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case H.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case H.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case H.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case H.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case H.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case H.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case H.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case H.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case H.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case H.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case H.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case H.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case H.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case H.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case H.CDATA_SECTION:{this._stateCdataSection(t);break}case H.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case H.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case H.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case H.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case L.LESS_THAN_SIGN:{this.state=H.TAG_OPEN;break}case L.AMPERSAND:{this._startCharacterReference();break}case L.NULL:{this._err(fe.unexpectedNullCharacter),this._emitCodePoint(t);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case L.AMPERSAND:{this._startCharacterReference();break}case L.LESS_THAN_SIGN:{this.state=H.RCDATA_LESS_THAN_SIGN;break}case L.NULL:{this._err(fe.unexpectedNullCharacter),this._emitChars(zt);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case L.LESS_THAN_SIGN:{this.state=H.RAWTEXT_LESS_THAN_SIGN;break}case L.NULL:{this._err(fe.unexpectedNullCharacter),this._emitChars(zt);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case L.LESS_THAN_SIGN:{this.state=H.SCRIPT_DATA_LESS_THAN_SIGN;break}case L.NULL:{this._err(fe.unexpectedNullCharacter),this._emitChars(zt);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case L.NULL:{this._err(fe.unexpectedNullCharacter),this._emitChars(zt);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(is(t))this._createStartTagToken(),this.state=H.TAG_NAME,this._stateTagName(t);else switch(t){case L.EXCLAMATION_MARK:{this.state=H.MARKUP_DECLARATION_OPEN;break}case L.SOLIDUS:{this.state=H.END_TAG_OPEN;break}case L.QUESTION_MARK:{this._err(fe.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=H.BOGUS_COMMENT,this._stateBogusComment(t);break}case L.EOF:{this._err(fe.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(fe.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=H.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(is(t))this._createEndTagToken(),this.state=H.TAG_NAME,this._stateTagName(t);else switch(t){case L.GREATER_THAN_SIGN:{this._err(fe.missingEndTagName),this.state=H.DATA;break}case L.EOF:{this._err(fe.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(fe.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=H.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const a=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=H.BEFORE_ATTRIBUTE_NAME;break}case L.SOLIDUS:{this.state=H.SELF_CLOSING_START_TAG;break}case L.GREATER_THAN_SIGN:{this.state=H.DATA,this.emitCurrentTagToken();break}case L.NULL:{this._err(fe.unexpectedNullCharacter),a.tagName+=zt;break}case L.EOF:{this._err(fe.eofInTag),this._emitEOFToken();break}default:a.tagName+=String.fromCodePoint(io(t)?fc(t):t)}}_stateRcdataLessThanSign(t){t===L.SOLIDUS?this.state=H.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=H.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){is(t)?(this.state=H.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=H.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const a=this.currentToken;switch(a.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=H.BEFORE_ATTRIBUTE_NAME,!1;case L.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=H.SELF_CLOSING_START_TAG,!1;case L.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=H.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=H.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===L.SOLIDUS?this.state=H.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=H.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){is(t)?(this.state=H.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=H.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=H.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case L.SOLIDUS:{this.state=H.SCRIPT_DATA_END_TAG_OPEN;break}case L.EXCLAMATION_MARK:{this.state=H.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=H.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){is(t)?(this.state=H.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=H.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=H.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===L.HYPHEN_MINUS?(this.state=H.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=H.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===L.HYPHEN_MINUS?(this.state=H.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=H.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case L.HYPHEN_MINUS:{this.state=H.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case L.LESS_THAN_SIGN:{this.state=H.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case L.NULL:{this._err(fe.unexpectedNullCharacter),this._emitChars(zt);break}case L.EOF:{this._err(fe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case L.HYPHEN_MINUS:{this.state=H.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case L.LESS_THAN_SIGN:{this.state=H.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case L.NULL:{this._err(fe.unexpectedNullCharacter),this.state=H.SCRIPT_DATA_ESCAPED,this._emitChars(zt);break}case L.EOF:{this._err(fe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=H.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case L.HYPHEN_MINUS:{this._emitChars("-");break}case L.LESS_THAN_SIGN:{this.state=H.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case L.GREATER_THAN_SIGN:{this.state=H.SCRIPT_DATA,this._emitChars(">");break}case L.NULL:{this._err(fe.unexpectedNullCharacter),this.state=H.SCRIPT_DATA_ESCAPED,this._emitChars(zt);break}case L.EOF:{this._err(fe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=H.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===L.SOLIDUS?this.state=H.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:is(t)?(this._emitChars("<"),this.state=H.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=H.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){is(t)?(this.state=H.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=H.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=H.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Wn.SCRIPT,!1)&&_E(this.preprocessor.peek(Wn.SCRIPT.length))){this._emitCodePoint(t);for(let a=0;a<Wn.SCRIPT.length;a++)this._emitCodePoint(this._consume());this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=H.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case L.HYPHEN_MINUS:{this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case L.LESS_THAN_SIGN:{this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case L.NULL:{this._err(fe.unexpectedNullCharacter),this._emitChars(zt);break}case L.EOF:{this._err(fe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case L.HYPHEN_MINUS:{this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case L.LESS_THAN_SIGN:{this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case L.NULL:{this._err(fe.unexpectedNullCharacter),this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(zt);break}case L.EOF:{this._err(fe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case L.HYPHEN_MINUS:{this._emitChars("-");break}case L.LESS_THAN_SIGN:{this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case L.GREATER_THAN_SIGN:{this.state=H.SCRIPT_DATA,this._emitChars(">");break}case L.NULL:{this._err(fe.unexpectedNullCharacter),this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(zt);break}case L.EOF:{this._err(fe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===L.SOLIDUS?(this.state=H.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Wn.SCRIPT,!1)&&_E(this.preprocessor.peek(Wn.SCRIPT.length))){this._emitCodePoint(t);for(let a=0;a<Wn.SCRIPT.length;a++)this._emitCodePoint(this._consume());this.state=H.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.SOLIDUS:case L.GREATER_THAN_SIGN:case L.EOF:{this.state=H.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case L.EQUALS_SIGN:{this._err(fe.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=H.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=H.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:case L.SOLIDUS:case L.GREATER_THAN_SIGN:case L.EOF:{this._leaveAttrName(),this.state=H.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case L.EQUALS_SIGN:{this._leaveAttrName(),this.state=H.BEFORE_ATTRIBUTE_VALUE;break}case L.QUOTATION_MARK:case L.APOSTROPHE:case L.LESS_THAN_SIGN:{this._err(fe.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case L.NULL:{this._err(fe.unexpectedNullCharacter),this.currentAttr.name+=zt;break}default:this.currentAttr.name+=String.fromCodePoint(io(t)?fc(t):t)}}_stateAfterAttributeName(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.SOLIDUS:{this.state=H.SELF_CLOSING_START_TAG;break}case L.EQUALS_SIGN:{this.state=H.BEFORE_ATTRIBUTE_VALUE;break}case L.GREATER_THAN_SIGN:{this.state=H.DATA,this.emitCurrentTagToken();break}case L.EOF:{this._err(fe.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=H.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.QUOTATION_MARK:{this.state=H.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case L.APOSTROPHE:{this.state=H.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(fe.missingAttributeValue),this.state=H.DATA,this.emitCurrentTagToken();break}default:this.state=H.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case L.QUOTATION_MARK:{this.state=H.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case L.AMPERSAND:{this._startCharacterReference();break}case L.NULL:{this._err(fe.unexpectedNullCharacter),this.currentAttr.value+=zt;break}case L.EOF:{this._err(fe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case L.APOSTROPHE:{this.state=H.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case L.AMPERSAND:{this._startCharacterReference();break}case L.NULL:{this._err(fe.unexpectedNullCharacter),this.currentAttr.value+=zt;break}case L.EOF:{this._err(fe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this._leaveAttrValue(),this.state=H.BEFORE_ATTRIBUTE_NAME;break}case L.AMPERSAND:{this._startCharacterReference();break}case L.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=H.DATA,this.emitCurrentTagToken();break}case L.NULL:{this._err(fe.unexpectedNullCharacter),this.currentAttr.value+=zt;break}case L.QUOTATION_MARK:case L.APOSTROPHE:case L.LESS_THAN_SIGN:case L.EQUALS_SIGN:case L.GRAVE_ACCENT:{this._err(fe.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case L.EOF:{this._err(fe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this._leaveAttrValue(),this.state=H.BEFORE_ATTRIBUTE_NAME;break}case L.SOLIDUS:{this._leaveAttrValue(),this.state=H.SELF_CLOSING_START_TAG;break}case L.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=H.DATA,this.emitCurrentTagToken();break}case L.EOF:{this._err(fe.eofInTag),this._emitEOFToken();break}default:this._err(fe.missingWhitespaceBetweenAttributes),this.state=H.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case L.GREATER_THAN_SIGN:{const a=this.currentToken;a.selfClosing=!0,this.state=H.DATA,this.emitCurrentTagToken();break}case L.EOF:{this._err(fe.eofInTag),this._emitEOFToken();break}default:this._err(fe.unexpectedSolidusInTag),this.state=H.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const a=this.currentToken;switch(t){case L.GREATER_THAN_SIGN:{this.state=H.DATA,this.emitCurrentComment(a);break}case L.EOF:{this.emitCurrentComment(a),this._emitEOFToken();break}case L.NULL:{this._err(fe.unexpectedNullCharacter),a.data+=zt;break}default:a.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Wn.DASH_DASH,!0)?(this._createCommentToken(Wn.DASH_DASH.length+1),this.state=H.COMMENT_START):this._consumeSequenceIfMatch(Wn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Wn.DOCTYPE.length+1),this.state=H.DOCTYPE):this._consumeSequenceIfMatch(Wn.CDATA_START,!0)?this.inForeignNode?this.state=H.CDATA_SECTION:(this._err(fe.cdataInHtmlContent),this._createCommentToken(Wn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=H.BOGUS_COMMENT):this._ensureHibernation()||(this._err(fe.incorrectlyOpenedComment),this._createCommentToken(2),this.state=H.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case L.HYPHEN_MINUS:{this.state=H.COMMENT_START_DASH;break}case L.GREATER_THAN_SIGN:{this._err(fe.abruptClosingOfEmptyComment),this.state=H.DATA;const a=this.currentToken;this.emitCurrentComment(a);break}default:this.state=H.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const a=this.currentToken;switch(t){case L.HYPHEN_MINUS:{this.state=H.COMMENT_END;break}case L.GREATER_THAN_SIGN:{this._err(fe.abruptClosingOfEmptyComment),this.state=H.DATA,this.emitCurrentComment(a);break}case L.EOF:{this._err(fe.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+="-",this.state=H.COMMENT,this._stateComment(t)}}_stateComment(t){const a=this.currentToken;switch(t){case L.HYPHEN_MINUS:{this.state=H.COMMENT_END_DASH;break}case L.LESS_THAN_SIGN:{a.data+="<",this.state=H.COMMENT_LESS_THAN_SIGN;break}case L.NULL:{this._err(fe.unexpectedNullCharacter),a.data+=zt;break}case L.EOF:{this._err(fe.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const a=this.currentToken;switch(t){case L.EXCLAMATION_MARK:{a.data+="!",this.state=H.COMMENT_LESS_THAN_SIGN_BANG;break}case L.LESS_THAN_SIGN:{a.data+="<";break}default:this.state=H.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===L.HYPHEN_MINUS?this.state=H.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=H.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===L.HYPHEN_MINUS?this.state=H.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=H.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==L.GREATER_THAN_SIGN&&t!==L.EOF&&this._err(fe.nestedComment),this.state=H.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const a=this.currentToken;switch(t){case L.HYPHEN_MINUS:{this.state=H.COMMENT_END;break}case L.EOF:{this._err(fe.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+="-",this.state=H.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const a=this.currentToken;switch(t){case L.GREATER_THAN_SIGN:{this.state=H.DATA,this.emitCurrentComment(a);break}case L.EXCLAMATION_MARK:{this.state=H.COMMENT_END_BANG;break}case L.HYPHEN_MINUS:{a.data+="-";break}case L.EOF:{this._err(fe.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+="--",this.state=H.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const a=this.currentToken;switch(t){case L.HYPHEN_MINUS:{a.data+="--!",this.state=H.COMMENT_END_DASH;break}case L.GREATER_THAN_SIGN:{this._err(fe.incorrectlyClosedComment),this.state=H.DATA,this.emitCurrentComment(a);break}case L.EOF:{this._err(fe.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+="--!",this.state=H.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=H.BEFORE_DOCTYPE_NAME;break}case L.GREATER_THAN_SIGN:{this.state=H.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case L.EOF:{this._err(fe.eofInDoctype),this._createDoctypeToken(null);const a=this.currentToken;a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(fe.missingWhitespaceBeforeDoctypeName),this.state=H.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(io(t))this._createDoctypeToken(String.fromCharCode(fc(t))),this.state=H.DOCTYPE_NAME;else switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.NULL:{this._err(fe.unexpectedNullCharacter),this._createDoctypeToken(zt),this.state=H.DOCTYPE_NAME;break}case L.GREATER_THAN_SIGN:{this._err(fe.missingDoctypeName),this._createDoctypeToken(null);const a=this.currentToken;a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=H.DATA;break}case L.EOF:{this._err(fe.eofInDoctype),this._createDoctypeToken(null);const a=this.currentToken;a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=H.DOCTYPE_NAME}}_stateDoctypeName(t){const a=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=H.AFTER_DOCTYPE_NAME;break}case L.GREATER_THAN_SIGN:{this.state=H.DATA,this.emitCurrentDoctype(a);break}case L.NULL:{this._err(fe.unexpectedNullCharacter),a.name+=zt;break}case L.EOF:{this._err(fe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:a.name+=String.fromCodePoint(io(t)?fc(t):t)}}_stateAfterDoctypeName(t){const a=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.GREATER_THAN_SIGN:{this.state=H.DATA,this.emitCurrentDoctype(a);break}case L.EOF:{this._err(fe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Wn.PUBLIC,!1)?this.state=H.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Wn.SYSTEM,!1)?this.state=H.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(fe.invalidCharacterSequenceAfterDoctypeName),a.forceQuirks=!0,this.state=H.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const a=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=H.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case L.QUOTATION_MARK:{this._err(fe.missingWhitespaceAfterDoctypePublicKeyword),a.publicId="",this.state=H.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{this._err(fe.missingWhitespaceAfterDoctypePublicKeyword),a.publicId="",this.state=H.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(fe.missingDoctypePublicIdentifier),a.forceQuirks=!0,this.state=H.DATA,this.emitCurrentDoctype(a);break}case L.EOF:{this._err(fe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(fe.missingQuoteBeforeDoctypePublicIdentifier),a.forceQuirks=!0,this.state=H.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const a=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.QUOTATION_MARK:{a.publicId="",this.state=H.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{a.publicId="",this.state=H.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(fe.missingDoctypePublicIdentifier),a.forceQuirks=!0,this.state=H.DATA,this.emitCurrentDoctype(a);break}case L.EOF:{this._err(fe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(fe.missingQuoteBeforeDoctypePublicIdentifier),a.forceQuirks=!0,this.state=H.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const a=this.currentToken;switch(t){case L.QUOTATION_MARK:{this.state=H.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case L.NULL:{this._err(fe.unexpectedNullCharacter),a.publicId+=zt;break}case L.GREATER_THAN_SIGN:{this._err(fe.abruptDoctypePublicIdentifier),a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=H.DATA;break}case L.EOF:{this._err(fe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:a.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const a=this.currentToken;switch(t){case L.APOSTROPHE:{this.state=H.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case L.NULL:{this._err(fe.unexpectedNullCharacter),a.publicId+=zt;break}case L.GREATER_THAN_SIGN:{this._err(fe.abruptDoctypePublicIdentifier),a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=H.DATA;break}case L.EOF:{this._err(fe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:a.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const a=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=H.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case L.GREATER_THAN_SIGN:{this.state=H.DATA,this.emitCurrentDoctype(a);break}case L.QUOTATION_MARK:{this._err(fe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),a.systemId="",this.state=H.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{this._err(fe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),a.systemId="",this.state=H.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case L.EOF:{this._err(fe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(fe.missingQuoteBeforeDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=H.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const a=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.GREATER_THAN_SIGN:{this.emitCurrentDoctype(a),this.state=H.DATA;break}case L.QUOTATION_MARK:{a.systemId="",this.state=H.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{a.systemId="",this.state=H.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case L.EOF:{this._err(fe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(fe.missingQuoteBeforeDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=H.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const a=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=H.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case L.QUOTATION_MARK:{this._err(fe.missingWhitespaceAfterDoctypeSystemKeyword),a.systemId="",this.state=H.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{this._err(fe.missingWhitespaceAfterDoctypeSystemKeyword),a.systemId="",this.state=H.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(fe.missingDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=H.DATA,this.emitCurrentDoctype(a);break}case L.EOF:{this._err(fe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(fe.missingQuoteBeforeDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=H.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const a=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.QUOTATION_MARK:{a.systemId="",this.state=H.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{a.systemId="",this.state=H.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(fe.missingDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=H.DATA,this.emitCurrentDoctype(a);break}case L.EOF:{this._err(fe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(fe.missingQuoteBeforeDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=H.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const a=this.currentToken;switch(t){case L.QUOTATION_MARK:{this.state=H.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case L.NULL:{this._err(fe.unexpectedNullCharacter),a.systemId+=zt;break}case L.GREATER_THAN_SIGN:{this._err(fe.abruptDoctypeSystemIdentifier),a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=H.DATA;break}case L.EOF:{this._err(fe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:a.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const a=this.currentToken;switch(t){case L.APOSTROPHE:{this.state=H.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case L.NULL:{this._err(fe.unexpectedNullCharacter),a.systemId+=zt;break}case L.GREATER_THAN_SIGN:{this._err(fe.abruptDoctypeSystemIdentifier),a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=H.DATA;break}case L.EOF:{this._err(fe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:a.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const a=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.GREATER_THAN_SIGN:{this.emitCurrentDoctype(a),this.state=H.DATA;break}case L.EOF:{this._err(fe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(fe.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=H.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const a=this.currentToken;switch(t){case L.GREATER_THAN_SIGN:{this.emitCurrentDoctype(a),this.state=H.DATA;break}case L.NULL:{this._err(fe.unexpectedNullCharacter);break}case L.EOF:{this.emitCurrentDoctype(a),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case L.RIGHT_SQUARE_BRACKET:{this.state=H.CDATA_SECTION_BRACKET;break}case L.EOF:{this._err(fe.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===L.RIGHT_SQUARE_BRACKET?this.state=H.CDATA_SECTION_END:(this._emitChars("]"),this.state=H.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case L.GREATER_THAN_SIGN:{this.state=H.DATA;break}case L.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=H.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(L.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&TE(this.preprocessor.peek(1))?H.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){TE(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===L.SEMICOLON&&this._err(fe.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const UT=new Set([E.DD,E.DT,E.LI,E.OPTGROUP,E.OPTION,E.P,E.RB,E.RP,E.RT,E.RTC]),vE=new Set([...UT,E.CAPTION,E.COLGROUP,E.TBODY,E.TD,E.TFOOT,E.TH,E.THEAD,E.TR]),Pc=new Set([E.APPLET,E.CAPTION,E.HTML,E.MARQUEE,E.OBJECT,E.TABLE,E.TD,E.TEMPLATE,E.TH]),Hj=new Set([...Pc,E.OL,E.UL]),Fj=new Set([...Pc,E.BUTTON]),SE=new Set([E.ANNOTATION_XML,E.MI,E.MN,E.MO,E.MS,E.MTEXT]),AE=new Set([E.DESC,E.FOREIGN_OBJECT,E.TITLE]),zj=new Set([E.TR,E.TEMPLATE,E.HTML]),$j=new Set([E.TBODY,E.TFOOT,E.THEAD,E.TEMPLATE,E.HTML]),qj=new Set([E.TABLE,E.TEMPLATE,E.HTML]),Yj=new Set([E.TD,E.TH]);class Gj{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,a,s){this.treeAdapter=a,this.handler=s,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=E.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===E.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Ee.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,a){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=a,this.currentTagId=a,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,a,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,a){const s=this._indexOf(t);this.items[s]=a,s===this.stackTop&&(this.current=a)}insertAfter(t,a,s){const o=this._indexOf(t)+1;this.items.splice(o,0,a),this.tagIDs.splice(o,0,s),this.stackTop++,o===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,o===this.stackTop)}popUntilTagNamePopped(t){let a=this.stackTop+1;do a=this.tagIDs.lastIndexOf(t,a-1);while(a>0&&this.treeAdapter.getNamespaceURI(this.items[a])!==Ee.HTML);this.shortenToLength(Math.max(a,0))}shortenToLength(t){for(;this.stackTop>=t;){const a=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(a,this.stackTop<t)}}popUntilElementPopped(t){const a=this._indexOf(t);this.shortenToLength(Math.max(a,0))}popUntilPopped(t,a){const s=this._indexOfTagNames(t,a);this.shortenToLength(Math.max(s,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Ih,Ee.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Yj,Ee.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,a){for(let s=this.stackTop;s>=0;s--)if(t.has(this.tagIDs[s])&&this.treeAdapter.getNamespaceURI(this.items[s])===a)return s;return-1}clearBackTo(t,a){const s=this._indexOfTagNames(t,a);this.shortenToLength(s+1)}clearBackToTableContext(){this.clearBackTo(qj,Ee.HTML)}clearBackToTableBodyContext(){this.clearBackTo($j,Ee.HTML)}clearBackToTableRowContext(){this.clearBackTo(zj,Ee.HTML)}remove(t){const a=this._indexOf(t);a>=0&&(a===this.stackTop?this.pop():(this.items.splice(a,1),this.tagIDs.splice(a,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===E.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const a=this._indexOf(t)-1;return a>=0?this.items[a]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===E.HTML}hasInDynamicScope(t,a){for(let s=this.stackTop;s>=0;s--){const o=this.tagIDs[s];switch(this.treeAdapter.getNamespaceURI(this.items[s])){case Ee.HTML:{if(o===t)return!0;if(a.has(o))return!1;break}case Ee.SVG:{if(AE.has(o))return!1;break}case Ee.MATHML:{if(SE.has(o))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Pc)}hasInListItemScope(t){return this.hasInDynamicScope(t,Hj)}hasInButtonScope(t){return this.hasInDynamicScope(t,Fj)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const a=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Ee.HTML:{if(Ih.has(a))return!0;if(Pc.has(a))return!1;break}case Ee.SVG:{if(AE.has(a))return!1;break}case Ee.MATHML:{if(SE.has(a))return!1;break}}}return!0}hasInTableScope(t){for(let a=this.stackTop;a>=0;a--)if(this.treeAdapter.getNamespaceURI(this.items[a])===Ee.HTML)switch(this.tagIDs[a]){case t:return!0;case E.TABLE:case E.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Ee.HTML)switch(this.tagIDs[t]){case E.TBODY:case E.THEAD:case E.TFOOT:return!0;case E.TABLE:case E.HTML:return!1}return!0}hasInSelectScope(t){for(let a=this.stackTop;a>=0;a--)if(this.treeAdapter.getNamespaceURI(this.items[a])===Ee.HTML)switch(this.tagIDs[a]){case t:return!0;case E.OPTION:case E.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&UT.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&vE.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&vE.has(this.currentTagId);)this.pop()}}const th=3;var Wa;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Wa||(Wa={}));const wE={type:Wa.Marker};class Kj{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,a){const s=[],o=a.length,u=this.treeAdapter.getTagName(t),d=this.treeAdapter.getNamespaceURI(t);for(let f=0;f<this.entries.length;f++){const m=this.entries[f];if(m.type===Wa.Marker)break;const{element:h}=m;if(this.treeAdapter.getTagName(h)===u&&this.treeAdapter.getNamespaceURI(h)===d){const b=this.treeAdapter.getAttrList(h);b.length===o&&s.push({idx:f,attrs:b})}}return s}_ensureNoahArkCondition(t){if(this.entries.length<th)return;const a=this.treeAdapter.getAttrList(t),s=this._getNoahArkConditionCandidates(t,a);if(s.length<th)return;const o=new Map(a.map(d=>[d.name,d.value]));let u=0;for(let d=0;d<s.length;d++){const f=s[d];f.attrs.every(m=>o.get(m.name)===m.value)&&(u+=1,u>=th&&this.entries.splice(f.idx,1))}}insertMarker(){this.entries.unshift(wE)}pushElement(t,a){this._ensureNoahArkCondition(t),this.entries.unshift({type:Wa.Element,element:t,token:a})}insertElementAfterBookmark(t,a){const s=this.entries.indexOf(this.bookmark);this.entries.splice(s,0,{type:Wa.Element,element:t,token:a})}removeEntry(t){const a=this.entries.indexOf(t);a!==-1&&this.entries.splice(a,1)}clearToLastMarker(){const t=this.entries.indexOf(wE);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const a=this.entries.find(s=>s.type===Wa.Marker||this.treeAdapter.getTagName(s.element)===t);return a&&a.type===Wa.Element?a:null}getElementEntry(t){return this.entries.find(a=>a.type===Wa.Element&&a.element===t)}}const ls={createDocument(){return{nodeName:"#document",mode:Ca.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,a){return{nodeName:e,tagName:e,attrs:a,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,a){const s=e.childNodes.indexOf(a);e.childNodes.splice(s,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,a,s){const o=e.childNodes.find(u=>u.nodeName==="#documentType");if(o)o.name=t,o.publicId=a,o.systemId=s;else{const u={nodeName:"#documentType",name:t,publicId:a,systemId:s,parentNode:null};ls.appendChild(e,u)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const a=e.childNodes[e.childNodes.length-1];if(ls.isTextNode(a)){a.value+=t;return}}ls.appendChild(e,ls.createTextNode(t))},insertTextBefore(e,t,a){const s=e.childNodes[e.childNodes.indexOf(a)-1];s&&ls.isTextNode(s)?s.value+=t:ls.insertBefore(e,ls.createTextNode(t),a)},adoptAttributes(e,t){const a=new Set(e.attrs.map(s=>s.name));for(let s=0;s<t.length;s++)a.has(t[s].name)||e.attrs.push(t[s])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},HT="html",Vj="about:legacy-compat",Xj="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",FT=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],Qj=[...FT,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],Wj=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),zT=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],Zj=[...zT,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function CE(e,t){return t.some(a=>e.startsWith(a))}function Jj(e){return e.name===HT&&e.publicId===null&&(e.systemId===null||e.systemId===Vj)}function e8(e){if(e.name!==HT)return Ca.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===Xj)return Ca.QUIRKS;let{publicId:a}=e;if(a!==null){if(a=a.toLowerCase(),Wj.has(a))return Ca.QUIRKS;let s=t===null?Qj:FT;if(CE(a,s))return Ca.QUIRKS;if(s=t===null?zT:Zj,CE(a,s))return Ca.LIMITED_QUIRKS}return Ca.NO_QUIRKS}const kE={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},t8="definitionurl",n8="definitionURL",a8=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),r8=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Ee.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Ee.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Ee.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Ee.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Ee.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Ee.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Ee.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Ee.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Ee.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Ee.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Ee.XMLNS}]]),s8=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),i8=new Set([E.B,E.BIG,E.BLOCKQUOTE,E.BODY,E.BR,E.CENTER,E.CODE,E.DD,E.DIV,E.DL,E.DT,E.EM,E.EMBED,E.H1,E.H2,E.H3,E.H4,E.H5,E.H6,E.HEAD,E.HR,E.I,E.IMG,E.LI,E.LISTING,E.MENU,E.META,E.NOBR,E.OL,E.P,E.PRE,E.RUBY,E.S,E.SMALL,E.SPAN,E.STRONG,E.STRIKE,E.SUB,E.SUP,E.TABLE,E.TT,E.U,E.UL,E.VAR]);function l8(e){const t=e.tagID;return t===E.FONT&&e.attrs.some(({name:s})=>s===$s.COLOR||s===$s.SIZE||s===$s.FACE)||i8.has(t)}function $T(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===t8){e.attrs[t].name=n8;break}}function qT(e){for(let t=0;t<e.attrs.length;t++){const a=a8.get(e.attrs[t].name);a!=null&&(e.attrs[t].name=a)}}function Tp(e){for(let t=0;t<e.attrs.length;t++){const a=r8.get(e.attrs[t].name);a&&(e.attrs[t].prefix=a.prefix,e.attrs[t].name=a.name,e.attrs[t].namespace=a.namespace)}}function o8(e){const t=s8.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=el(e.tagName))}function u8(e,t){return t===Ee.MATHML&&(e===E.MI||e===E.MO||e===E.MN||e===E.MS||e===E.MTEXT)}function c8(e,t,a){if(t===Ee.MATHML&&e===E.ANNOTATION_XML){for(let s=0;s<a.length;s++)if(a[s].name===$s.ENCODING){const o=a[s].value.toLowerCase();return o===kE.TEXT_HTML||o===kE.APPLICATION_XML}}return t===Ee.SVG&&(e===E.FOREIGN_OBJECT||e===E.DESC||e===E.TITLE)}function d8(e,t,a,s){return(!s||s===Ee.HTML)&&c8(e,t,a)||(!s||s===Ee.MATHML)&&u8(e,t)}const f8="hidden",m8=8,h8=3;var G;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(G||(G={}));const p8={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},YT=new Set([E.TABLE,E.TBODY,E.TFOOT,E.THEAD,E.TR]),RE={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:ls,onParseError:null};class OE{constructor(t,a,s=null,o=null){this.fragmentContext=s,this.scriptHandler=o,this.currentToken=null,this.stopped=!1,this.insertionMode=G.INITIAL,this.originalInsertionMode=G.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...RE,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=a??this.treeAdapter.createDocument(),this.tokenizer=new Uj(this.options,this),this.activeFormattingElements=new Kj(this.treeAdapter),this.fragmentContextID=s?el(this.treeAdapter.getTagName(s)):E.UNKNOWN,this._setContextModes(s??this.document,this.fragmentContextID),this.openElements=new Gj(this.document,this.treeAdapter,this)}static parse(t,a){const s=new this(a);return s.tokenizer.write(t,!0),s.document}static getFragmentParser(t,a){const s={...RE,...a};t??(t=s.treeAdapter.createElement(ne.TEMPLATE,Ee.HTML,[]));const o=s.treeAdapter.createElement("documentmock",Ee.HTML,[]),u=new this(s,o,t);return u.fragmentContextID===E.TEMPLATE&&u.tmplInsertionModeStack.unshift(G.IN_TEMPLATE),u._initTokenizerForFragmentParsing(),u._insertFakeRootElement(),u._resetInsertionMode(),u._findFormInFragmentContext(),u}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),a=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,a),a}_err(t,a,s){var o;if(!this.onParseError)return;const u=(o=t.location)!==null&&o!==void 0?o:p8,d={code:a,startLine:u.startLine,startCol:u.startCol,startOffset:u.startOffset,endLine:s?u.startLine:u.endLine,endCol:s?u.startCol:u.endCol,endOffset:s?u.startOffset:u.endOffset};this.onParseError(d)}onItemPush(t,a,s){var o,u;(u=(o=this.treeAdapter).onItemPush)===null||u===void 0||u.call(o,t),s&&this.openElements.stackTop>0&&this._setContextModes(t,a)}onItemPop(t,a){var s,o;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(o=(s=this.treeAdapter).onItemPop)===null||o===void 0||o.call(s,t,this.openElements.current),a){let u,d;this.openElements.stackTop===0&&this.fragmentContext?(u=this.fragmentContext,d=this.fragmentContextID):{current:u,currentTagId:d}=this.openElements,this._setContextModes(u,d)}}_setContextModes(t,a){const s=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===Ee.HTML;this.currentNotInHTML=!s,this.tokenizer.inForeignNode=!s&&t!==void 0&&a!==void 0&&!this._isIntegrationPoint(a,t)}_switchToTextParsing(t,a){this._insertElement(t,Ee.HTML),this.tokenizer.state=a,this.originalInsertionMode=this.insertionMode,this.insertionMode=G.TEXT}switchToPlaintextParsing(){this.insertionMode=G.TEXT,this.originalInsertionMode=G.IN_BODY,this.tokenizer.state=Jt.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===ne.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Ee.HTML))switch(this.fragmentContextID){case E.TITLE:case E.TEXTAREA:{this.tokenizer.state=Jt.RCDATA;break}case E.STYLE:case E.XMP:case E.IFRAME:case E.NOEMBED:case E.NOFRAMES:case E.NOSCRIPT:{this.tokenizer.state=Jt.RAWTEXT;break}case E.SCRIPT:{this.tokenizer.state=Jt.SCRIPT_DATA;break}case E.PLAINTEXT:{this.tokenizer.state=Jt.PLAINTEXT;break}}}_setDocumentType(t){const a=t.name||"",s=t.publicId||"",o=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,a,s,o),t.location){const d=this.treeAdapter.getChildNodes(this.document).find(f=>this.treeAdapter.isDocumentTypeNode(f));d&&this.treeAdapter.setNodeSourceCodeLocation(d,t.location)}}_attachElementToTree(t,a){if(this.options.sourceCodeLocationInfo){const s=a&&{...a,startTag:a};this.treeAdapter.setNodeSourceCodeLocation(t,s)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const s=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(s??this.document,t)}}_appendElement(t,a){const s=this.treeAdapter.createElement(t.tagName,a,t.attrs);this._attachElementToTree(s,t.location)}_insertElement(t,a){const s=this.treeAdapter.createElement(t.tagName,a,t.attrs);this._attachElementToTree(s,t.location),this.openElements.push(s,t.tagID)}_insertFakeElement(t,a){const s=this.treeAdapter.createElement(t,Ee.HTML,[]);this._attachElementToTree(s,null),this.openElements.push(s,a)}_insertTemplate(t){const a=this.treeAdapter.createElement(t.tagName,Ee.HTML,t.attrs),s=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(a,s),this._attachElementToTree(a,t.location),this.openElements.push(a,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(ne.HTML,Ee.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,E.HTML)}_appendCommentNode(t,a){const s=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(a,s),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}_insertCharacters(t){let a,s;if(this._shouldFosterParentOnInsertion()?({parent:a,beforeElement:s}=this._findFosterParentingLocation(),s?this.treeAdapter.insertTextBefore(a,t.chars,s):this.treeAdapter.insertText(a,t.chars)):(a=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(a,t.chars)),!t.location)return;const o=this.treeAdapter.getChildNodes(a),u=s?o.lastIndexOf(s):o.length,d=o[u-1];if(this.treeAdapter.getNodeSourceCodeLocation(d)){const{endLine:m,endCol:h,endOffset:b}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(d,{endLine:m,endCol:h,endOffset:b})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(d,t.location)}_adoptNodes(t,a){for(let s=this.treeAdapter.getFirstChild(t);s;s=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(s),this.treeAdapter.appendChild(a,s)}_setEndLocation(t,a){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&a.location){const s=a.location,o=this.treeAdapter.getTagName(t),u=a.type===rt.END_TAG&&o===a.tagName?{endTag:{...s},endLine:s.endLine,endCol:s.endCol,endOffset:s.endOffset}:{endLine:s.startLine,endCol:s.startCol,endOffset:s.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,u)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let a,s;return this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,s=this.fragmentContextID):{current:a,currentTagId:s}=this.openElements,t.tagID===E.SVG&&this.treeAdapter.getTagName(a)===ne.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(a)===Ee.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===E.MGLYPH||t.tagID===E.MALIGNMARK)&&s!==void 0&&!this._isIntegrationPoint(s,a,Ee.HTML)}_processToken(t){switch(t.type){case rt.CHARACTER:{this.onCharacter(t);break}case rt.NULL_CHARACTER:{this.onNullCharacter(t);break}case rt.COMMENT:{this.onComment(t);break}case rt.DOCTYPE:{this.onDoctype(t);break}case rt.START_TAG:{this._processStartTag(t);break}case rt.END_TAG:{this.onEndTag(t);break}case rt.EOF:{this.onEof(t);break}case rt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,a,s){const o=this.treeAdapter.getNamespaceURI(a),u=this.treeAdapter.getAttrList(a);return d8(t,o,u,s)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const a=this.activeFormattingElements.entries.findIndex(o=>o.type===Wa.Marker||this.openElements.contains(o.element)),s=a===-1?t-1:a-1;for(let o=s;o>=0;o--){const u=this.activeFormattingElements.entries[o];this._insertElement(u.token,this.treeAdapter.getNamespaceURI(u.element)),u.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=G.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(E.P),this.openElements.popUntilTagNamePopped(E.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case E.TR:{this.insertionMode=G.IN_ROW;return}case E.TBODY:case E.THEAD:case E.TFOOT:{this.insertionMode=G.IN_TABLE_BODY;return}case E.CAPTION:{this.insertionMode=G.IN_CAPTION;return}case E.COLGROUP:{this.insertionMode=G.IN_COLUMN_GROUP;return}case E.TABLE:{this.insertionMode=G.IN_TABLE;return}case E.BODY:{this.insertionMode=G.IN_BODY;return}case E.FRAMESET:{this.insertionMode=G.IN_FRAMESET;return}case E.SELECT:{this._resetInsertionModeForSelect(t);return}case E.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case E.HTML:{this.insertionMode=this.headElement?G.AFTER_HEAD:G.BEFORE_HEAD;return}case E.TD:case E.TH:{if(t>0){this.insertionMode=G.IN_CELL;return}break}case E.HEAD:{if(t>0){this.insertionMode=G.IN_HEAD;return}break}}this.insertionMode=G.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let a=t-1;a>0;a--){const s=this.openElements.tagIDs[a];if(s===E.TEMPLATE)break;if(s===E.TABLE){this.insertionMode=G.IN_SELECT_IN_TABLE;return}}this.insertionMode=G.IN_SELECT}_isElementCausesFosterParenting(t){return YT.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const a=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case E.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(a)===Ee.HTML)return{parent:this.treeAdapter.getTemplateContent(a),beforeElement:null};break}case E.TABLE:{const s=this.treeAdapter.getParentNode(a);return s?{parent:s,beforeElement:a}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const a=this._findFosterParentingLocation();a.beforeElement?this.treeAdapter.insertBefore(a.parent,t,a.beforeElement):this.treeAdapter.appendChild(a.parent,t)}_isSpecialElement(t,a){const s=this.treeAdapter.getNamespaceURI(t);return Lj[s].has(a)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Y9(this,t);return}switch(this.insertionMode){case G.INITIAL:{ao(this,t);break}case G.BEFORE_HTML:{co(this,t);break}case G.BEFORE_HEAD:{fo(this,t);break}case G.IN_HEAD:{mo(this,t);break}case G.IN_HEAD_NO_SCRIPT:{ho(this,t);break}case G.AFTER_HEAD:{po(this,t);break}case G.IN_BODY:case G.IN_CAPTION:case G.IN_CELL:case G.IN_TEMPLATE:{KT(this,t);break}case G.TEXT:case G.IN_SELECT:case G.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case G.IN_TABLE:case G.IN_TABLE_BODY:case G.IN_ROW:{nh(this,t);break}case G.IN_TABLE_TEXT:{JT(this,t);break}case G.IN_COLUMN_GROUP:{Uc(this,t);break}case G.AFTER_BODY:{Hc(this,t);break}case G.AFTER_AFTER_BODY:{Ec(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){q9(this,t);return}switch(this.insertionMode){case G.INITIAL:{ao(this,t);break}case G.BEFORE_HTML:{co(this,t);break}case G.BEFORE_HEAD:{fo(this,t);break}case G.IN_HEAD:{mo(this,t);break}case G.IN_HEAD_NO_SCRIPT:{ho(this,t);break}case G.AFTER_HEAD:{po(this,t);break}case G.TEXT:{this._insertCharacters(t);break}case G.IN_TABLE:case G.IN_TABLE_BODY:case G.IN_ROW:{nh(this,t);break}case G.IN_COLUMN_GROUP:{Uc(this,t);break}case G.AFTER_BODY:{Hc(this,t);break}case G.AFTER_AFTER_BODY:{Ec(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){Mh(this,t);return}switch(this.insertionMode){case G.INITIAL:case G.BEFORE_HTML:case G.BEFORE_HEAD:case G.IN_HEAD:case G.IN_HEAD_NO_SCRIPT:case G.AFTER_HEAD:case G.IN_BODY:case G.IN_TABLE:case G.IN_CAPTION:case G.IN_COLUMN_GROUP:case G.IN_TABLE_BODY:case G.IN_ROW:case G.IN_CELL:case G.IN_SELECT:case G.IN_SELECT_IN_TABLE:case G.IN_TEMPLATE:case G.IN_FRAMESET:case G.AFTER_FRAMESET:{Mh(this,t);break}case G.IN_TABLE_TEXT:{ro(this,t);break}case G.AFTER_BODY:{T8(this,t);break}case G.AFTER_AFTER_BODY:case G.AFTER_AFTER_FRAMESET:{_8(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case G.INITIAL:{v8(this,t);break}case G.BEFORE_HEAD:case G.IN_HEAD:case G.IN_HEAD_NO_SCRIPT:case G.AFTER_HEAD:{this._err(t,fe.misplacedDoctype);break}case G.IN_TABLE_TEXT:{ro(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,fe.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?G9(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case G.INITIAL:{ao(this,t);break}case G.BEFORE_HTML:{S8(this,t);break}case G.BEFORE_HEAD:{w8(this,t);break}case G.IN_HEAD:{Ua(this,t);break}case G.IN_HEAD_NO_SCRIPT:{R8(this,t);break}case G.AFTER_HEAD:{I8(this,t);break}case G.IN_BODY:{On(this,t);break}case G.IN_TABLE:{Ki(this,t);break}case G.IN_TABLE_TEXT:{ro(this,t);break}case G.IN_CAPTION:{C9(this,t);break}case G.IN_COLUMN_GROUP:{Sp(this,t);break}case G.IN_TABLE_BODY:{ud(this,t);break}case G.IN_ROW:{cd(this,t);break}case G.IN_CELL:{O9(this,t);break}case G.IN_SELECT:{n_(this,t);break}case G.IN_SELECT_IN_TABLE:{M9(this,t);break}case G.IN_TEMPLATE:{L9(this,t);break}case G.AFTER_BODY:{B9(this,t);break}case G.IN_FRAMESET:{P9(this,t);break}case G.AFTER_FRAMESET:{H9(this,t);break}case G.AFTER_AFTER_BODY:{z9(this,t);break}case G.AFTER_AFTER_FRAMESET:{$9(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?K9(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case G.INITIAL:{ao(this,t);break}case G.BEFORE_HTML:{A8(this,t);break}case G.BEFORE_HEAD:{C8(this,t);break}case G.IN_HEAD:{k8(this,t);break}case G.IN_HEAD_NO_SCRIPT:{O8(this,t);break}case G.AFTER_HEAD:{M8(this,t);break}case G.IN_BODY:{od(this,t);break}case G.TEXT:{x9(this,t);break}case G.IN_TABLE:{So(this,t);break}case G.IN_TABLE_TEXT:{ro(this,t);break}case G.IN_CAPTION:{k9(this,t);break}case G.IN_COLUMN_GROUP:{R9(this,t);break}case G.IN_TABLE_BODY:{Dh(this,t);break}case G.IN_ROW:{t_(this,t);break}case G.IN_CELL:{I9(this,t);break}case G.IN_SELECT:{a_(this,t);break}case G.IN_SELECT_IN_TABLE:{D9(this,t);break}case G.IN_TEMPLATE:{j9(this,t);break}case G.AFTER_BODY:{s_(this,t);break}case G.IN_FRAMESET:{U9(this,t);break}case G.AFTER_FRAMESET:{F9(this,t);break}case G.AFTER_AFTER_BODY:{Ec(this,t);break}}}onEof(t){switch(this.insertionMode){case G.INITIAL:{ao(this,t);break}case G.BEFORE_HTML:{co(this,t);break}case G.BEFORE_HEAD:{fo(this,t);break}case G.IN_HEAD:{mo(this,t);break}case G.IN_HEAD_NO_SCRIPT:{ho(this,t);break}case G.AFTER_HEAD:{po(this,t);break}case G.IN_BODY:case G.IN_TABLE:case G.IN_CAPTION:case G.IN_COLUMN_GROUP:case G.IN_TABLE_BODY:case G.IN_ROW:case G.IN_CELL:case G.IN_SELECT:case G.IN_SELECT_IN_TABLE:{WT(this,t);break}case G.TEXT:{E9(this,t);break}case G.IN_TABLE_TEXT:{ro(this,t);break}case G.IN_TEMPLATE:{r_(this,t);break}case G.AFTER_BODY:case G.IN_FRAMESET:case G.AFTER_FRAMESET:case G.AFTER_AFTER_BODY:case G.AFTER_AFTER_FRAMESET:{vp(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===L.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case G.IN_HEAD:case G.IN_HEAD_NO_SCRIPT:case G.AFTER_HEAD:case G.TEXT:case G.IN_COLUMN_GROUP:case G.IN_SELECT:case G.IN_SELECT_IN_TABLE:case G.IN_FRAMESET:case G.AFTER_FRAMESET:{this._insertCharacters(t);break}case G.IN_BODY:case G.IN_CAPTION:case G.IN_CELL:case G.IN_TEMPLATE:case G.AFTER_BODY:case G.AFTER_AFTER_BODY:case G.AFTER_AFTER_FRAMESET:{GT(this,t);break}case G.IN_TABLE:case G.IN_TABLE_BODY:case G.IN_ROW:{nh(this,t);break}case G.IN_TABLE_TEXT:{ZT(this,t);break}}}}function g8(e,t){let a=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return a?e.openElements.contains(a.element)?e.openElements.hasInScope(t.tagID)||(a=null):(e.activeFormattingElements.removeEntry(a),a=null):QT(e,t),a}function b8(e,t){let a=null,s=e.openElements.stackTop;for(;s>=0;s--){const o=e.openElements.items[s];if(o===t.element)break;e._isSpecialElement(o,e.openElements.tagIDs[s])&&(a=o)}return a||(e.openElements.shortenToLength(Math.max(s,0)),e.activeFormattingElements.removeEntry(t)),a}function x8(e,t,a){let s=t,o=e.openElements.getCommonAncestor(t);for(let u=0,d=o;d!==a;u++,d=o){o=e.openElements.getCommonAncestor(d);const f=e.activeFormattingElements.getElementEntry(d),m=f&&u>=h8;!f||m?(m&&e.activeFormattingElements.removeEntry(f),e.openElements.remove(d)):(d=E8(e,f),s===t&&(e.activeFormattingElements.bookmark=f),e.treeAdapter.detachNode(s),e.treeAdapter.appendChild(d,s),s=d)}return s}function E8(e,t){const a=e.treeAdapter.getNamespaceURI(t.element),s=e.treeAdapter.createElement(t.token.tagName,a,t.token.attrs);return e.openElements.replace(t.element,s),t.element=s,s}function y8(e,t,a){const s=e.treeAdapter.getTagName(t),o=el(s);if(e._isElementCausesFosterParenting(o))e._fosterParentElement(a);else{const u=e.treeAdapter.getNamespaceURI(t);o===E.TEMPLATE&&u===Ee.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,a)}}function N8(e,t,a){const s=e.treeAdapter.getNamespaceURI(a.element),{token:o}=a,u=e.treeAdapter.createElement(o.tagName,s,o.attrs);e._adoptNodes(t,u),e.treeAdapter.appendChild(t,u),e.activeFormattingElements.insertElementAfterBookmark(u,o),e.activeFormattingElements.removeEntry(a),e.openElements.remove(a.element),e.openElements.insertAfter(t,u,o.tagID)}function _p(e,t){for(let a=0;a<m8;a++){const s=g8(e,t);if(!s)break;const o=b8(e,s);if(!o)break;e.activeFormattingElements.bookmark=s;const u=x8(e,o,s.element),d=e.openElements.getCommonAncestor(s.element);e.treeAdapter.detachNode(u),d&&y8(e,d,u),N8(e,o,s)}}function Mh(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function T8(e,t){e._appendCommentNode(t,e.openElements.items[0])}function _8(e,t){e._appendCommentNode(t,e.document)}function vp(e,t){if(e.stopped=!0,t.location){const a=e.fragmentContext?0:2;for(let s=e.openElements.stackTop;s>=a;s--)e._setEndLocation(e.openElements.items[s],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const s=e.openElements.items[0],o=e.treeAdapter.getNodeSourceCodeLocation(s);if(o&&!o.endTag&&(e._setEndLocation(s,t),e.openElements.stackTop>=1)){const u=e.openElements.items[1],d=e.treeAdapter.getNodeSourceCodeLocation(u);d&&!d.endTag&&e._setEndLocation(u,t)}}}}function v8(e,t){e._setDocumentType(t);const a=t.forceQuirks?Ca.QUIRKS:e8(t);Jj(t)||e._err(t,fe.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,a),e.insertionMode=G.BEFORE_HTML}function ao(e,t){e._err(t,fe.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Ca.QUIRKS),e.insertionMode=G.BEFORE_HTML,e._processToken(t)}function S8(e,t){t.tagID===E.HTML?(e._insertElement(t,Ee.HTML),e.insertionMode=G.BEFORE_HEAD):co(e,t)}function A8(e,t){const a=t.tagID;(a===E.HTML||a===E.HEAD||a===E.BODY||a===E.BR)&&co(e,t)}function co(e,t){e._insertFakeRootElement(),e.insertionMode=G.BEFORE_HEAD,e._processToken(t)}function w8(e,t){switch(t.tagID){case E.HTML:{On(e,t);break}case E.HEAD:{e._insertElement(t,Ee.HTML),e.headElement=e.openElements.current,e.insertionMode=G.IN_HEAD;break}default:fo(e,t)}}function C8(e,t){const a=t.tagID;a===E.HEAD||a===E.BODY||a===E.HTML||a===E.BR?fo(e,t):e._err(t,fe.endTagWithoutMatchingOpenElement)}function fo(e,t){e._insertFakeElement(ne.HEAD,E.HEAD),e.headElement=e.openElements.current,e.insertionMode=G.IN_HEAD,e._processToken(t)}function Ua(e,t){switch(t.tagID){case E.HTML:{On(e,t);break}case E.BASE:case E.BASEFONT:case E.BGSOUND:case E.LINK:case E.META:{e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0;break}case E.TITLE:{e._switchToTextParsing(t,Jt.RCDATA);break}case E.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Jt.RAWTEXT):(e._insertElement(t,Ee.HTML),e.insertionMode=G.IN_HEAD_NO_SCRIPT);break}case E.NOFRAMES:case E.STYLE:{e._switchToTextParsing(t,Jt.RAWTEXT);break}case E.SCRIPT:{e._switchToTextParsing(t,Jt.SCRIPT_DATA);break}case E.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=G.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(G.IN_TEMPLATE);break}case E.HEAD:{e._err(t,fe.misplacedStartTagForHeadElement);break}default:mo(e,t)}}function k8(e,t){switch(t.tagID){case E.HEAD:{e.openElements.pop(),e.insertionMode=G.AFTER_HEAD;break}case E.BODY:case E.BR:case E.HTML:{mo(e,t);break}case E.TEMPLATE:{Qs(e,t);break}default:e._err(t,fe.endTagWithoutMatchingOpenElement)}}function Qs(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==E.TEMPLATE&&e._err(t,fe.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(E.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,fe.endTagWithoutMatchingOpenElement)}function mo(e,t){e.openElements.pop(),e.insertionMode=G.AFTER_HEAD,e._processToken(t)}function R8(e,t){switch(t.tagID){case E.HTML:{On(e,t);break}case E.BASEFONT:case E.BGSOUND:case E.HEAD:case E.LINK:case E.META:case E.NOFRAMES:case E.STYLE:{Ua(e,t);break}case E.NOSCRIPT:{e._err(t,fe.nestedNoscriptInHead);break}default:ho(e,t)}}function O8(e,t){switch(t.tagID){case E.NOSCRIPT:{e.openElements.pop(),e.insertionMode=G.IN_HEAD;break}case E.BR:{ho(e,t);break}default:e._err(t,fe.endTagWithoutMatchingOpenElement)}}function ho(e,t){const a=t.type===rt.EOF?fe.openElementsLeftAfterEof:fe.disallowedContentInNoscriptInHead;e._err(t,a),e.openElements.pop(),e.insertionMode=G.IN_HEAD,e._processToken(t)}function I8(e,t){switch(t.tagID){case E.HTML:{On(e,t);break}case E.BODY:{e._insertElement(t,Ee.HTML),e.framesetOk=!1,e.insertionMode=G.IN_BODY;break}case E.FRAMESET:{e._insertElement(t,Ee.HTML),e.insertionMode=G.IN_FRAMESET;break}case E.BASE:case E.BASEFONT:case E.BGSOUND:case E.LINK:case E.META:case E.NOFRAMES:case E.SCRIPT:case E.STYLE:case E.TEMPLATE:case E.TITLE:{e._err(t,fe.abandonedHeadElementChild),e.openElements.push(e.headElement,E.HEAD),Ua(e,t),e.openElements.remove(e.headElement);break}case E.HEAD:{e._err(t,fe.misplacedStartTagForHeadElement);break}default:po(e,t)}}function M8(e,t){switch(t.tagID){case E.BODY:case E.HTML:case E.BR:{po(e,t);break}case E.TEMPLATE:{Qs(e,t);break}default:e._err(t,fe.endTagWithoutMatchingOpenElement)}}function po(e,t){e._insertFakeElement(ne.BODY,E.BODY),e.insertionMode=G.IN_BODY,ld(e,t)}function ld(e,t){switch(t.type){case rt.CHARACTER:{KT(e,t);break}case rt.WHITESPACE_CHARACTER:{GT(e,t);break}case rt.COMMENT:{Mh(e,t);break}case rt.START_TAG:{On(e,t);break}case rt.END_TAG:{od(e,t);break}case rt.EOF:{WT(e,t);break}}}function GT(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function KT(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function D8(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function L8(e,t){const a=e.openElements.tryPeekProperlyNestedBodyElement();a&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(a,t.attrs))}function j8(e,t){const a=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&a&&(e.treeAdapter.detachNode(a),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Ee.HTML),e.insertionMode=G.IN_FRAMESET)}function B8(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,Ee.HTML)}function P8(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Ih.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Ee.HTML)}function U8(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,Ee.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function H8(e,t){const a=e.openElements.tmplCount>0;(!e.formElement||a)&&(e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,Ee.HTML),a||(e.formElement=e.openElements.current))}function F8(e,t){e.framesetOk=!1;const a=t.tagID;for(let s=e.openElements.stackTop;s>=0;s--){const o=e.openElements.tagIDs[s];if(a===E.LI&&o===E.LI||(a===E.DD||a===E.DT)&&(o===E.DD||o===E.DT)){e.openElements.generateImpliedEndTagsWithExclusion(o),e.openElements.popUntilTagNamePopped(o);break}if(o!==E.ADDRESS&&o!==E.DIV&&o!==E.P&&e._isSpecialElement(e.openElements.items[s],o))break}e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,Ee.HTML)}function z8(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,Ee.HTML),e.tokenizer.state=Jt.PLAINTEXT}function $8(e,t){e.openElements.hasInScope(E.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(E.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.framesetOk=!1}function q8(e,t){const a=e.activeFormattingElements.getElementEntryInScopeWithTagName(ne.A);a&&(_p(e,t),e.openElements.remove(a.element),e.activeFormattingElements.removeEntry(a)),e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Y8(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function G8(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(E.NOBR)&&(_p(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Ee.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function K8(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function V8(e,t){e.treeAdapter.getDocumentMode(e.document)!==Ca.QUIRKS&&e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,Ee.HTML),e.framesetOk=!1,e.insertionMode=G.IN_TABLE}function VT(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Ee.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function XT(e){const t=BT(e,$s.TYPE);return t!=null&&t.toLowerCase()===f8}function X8(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Ee.HTML),XT(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Q8(e,t){e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0}function W8(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._appendElement(t,Ee.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Z8(e,t){t.tagName=ne.IMG,t.tagID=E.IMG,VT(e,t)}function J8(e,t){e._insertElement(t,Ee.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Jt.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=G.TEXT}function e9(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Jt.RAWTEXT)}function t9(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Jt.RAWTEXT)}function IE(e,t){e._switchToTextParsing(t,Jt.RAWTEXT)}function n9(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===G.IN_TABLE||e.insertionMode===G.IN_CAPTION||e.insertionMode===G.IN_TABLE_BODY||e.insertionMode===G.IN_ROW||e.insertionMode===G.IN_CELL?G.IN_SELECT_IN_TABLE:G.IN_SELECT}function a9(e,t){e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML)}function r9(e,t){e.openElements.hasInScope(E.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Ee.HTML)}function s9(e,t){e.openElements.hasInScope(E.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(E.RTC),e._insertElement(t,Ee.HTML)}function i9(e,t){e._reconstructActiveFormattingElements(),$T(t),Tp(t),t.selfClosing?e._appendElement(t,Ee.MATHML):e._insertElement(t,Ee.MATHML),t.ackSelfClosing=!0}function l9(e,t){e._reconstructActiveFormattingElements(),qT(t),Tp(t),t.selfClosing?e._appendElement(t,Ee.SVG):e._insertElement(t,Ee.SVG),t.ackSelfClosing=!0}function ME(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML)}function On(e,t){switch(t.tagID){case E.I:case E.S:case E.B:case E.U:case E.EM:case E.TT:case E.BIG:case E.CODE:case E.FONT:case E.SMALL:case E.STRIKE:case E.STRONG:{Y8(e,t);break}case E.A:{q8(e,t);break}case E.H1:case E.H2:case E.H3:case E.H4:case E.H5:case E.H6:{P8(e,t);break}case E.P:case E.DL:case E.OL:case E.UL:case E.DIV:case E.DIR:case E.NAV:case E.MAIN:case E.MENU:case E.ASIDE:case E.CENTER:case E.FIGURE:case E.FOOTER:case E.HEADER:case E.HGROUP:case E.DIALOG:case E.DETAILS:case E.ADDRESS:case E.ARTICLE:case E.SEARCH:case E.SECTION:case E.SUMMARY:case E.FIELDSET:case E.BLOCKQUOTE:case E.FIGCAPTION:{B8(e,t);break}case E.LI:case E.DD:case E.DT:{F8(e,t);break}case E.BR:case E.IMG:case E.WBR:case E.AREA:case E.EMBED:case E.KEYGEN:{VT(e,t);break}case E.HR:{W8(e,t);break}case E.RB:case E.RTC:{r9(e,t);break}case E.RT:case E.RP:{s9(e,t);break}case E.PRE:case E.LISTING:{U8(e,t);break}case E.XMP:{e9(e,t);break}case E.SVG:{l9(e,t);break}case E.HTML:{D8(e,t);break}case E.BASE:case E.LINK:case E.META:case E.STYLE:case E.TITLE:case E.SCRIPT:case E.BGSOUND:case E.BASEFONT:case E.TEMPLATE:{Ua(e,t);break}case E.BODY:{L8(e,t);break}case E.FORM:{H8(e,t);break}case E.NOBR:{G8(e,t);break}case E.MATH:{i9(e,t);break}case E.TABLE:{V8(e,t);break}case E.INPUT:{X8(e,t);break}case E.PARAM:case E.TRACK:case E.SOURCE:{Q8(e,t);break}case E.IMAGE:{Z8(e,t);break}case E.BUTTON:{$8(e,t);break}case E.APPLET:case E.OBJECT:case E.MARQUEE:{K8(e,t);break}case E.IFRAME:{t9(e,t);break}case E.SELECT:{n9(e,t);break}case E.OPTION:case E.OPTGROUP:{a9(e,t);break}case E.NOEMBED:case E.NOFRAMES:{IE(e,t);break}case E.FRAMESET:{j8(e,t);break}case E.TEXTAREA:{J8(e,t);break}case E.NOSCRIPT:{e.options.scriptingEnabled?IE(e,t):ME(e,t);break}case E.PLAINTEXT:{z8(e,t);break}case E.COL:case E.TH:case E.TD:case E.TR:case E.HEAD:case E.FRAME:case E.TBODY:case E.TFOOT:case E.THEAD:case E.CAPTION:case E.COLGROUP:break;default:ME(e,t)}}function o9(e,t){if(e.openElements.hasInScope(E.BODY)&&(e.insertionMode=G.AFTER_BODY,e.options.sourceCodeLocationInfo)){const a=e.openElements.tryPeekProperlyNestedBodyElement();a&&e._setEndLocation(a,t)}}function u9(e,t){e.openElements.hasInScope(E.BODY)&&(e.insertionMode=G.AFTER_BODY,s_(e,t))}function c9(e,t){const a=t.tagID;e.openElements.hasInScope(a)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(a))}function d9(e){const t=e.openElements.tmplCount>0,{formElement:a}=e;t||(e.formElement=null),(a||t)&&e.openElements.hasInScope(E.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(E.FORM):a&&e.openElements.remove(a))}function f9(e){e.openElements.hasInButtonScope(E.P)||e._insertFakeElement(ne.P,E.P),e._closePElement()}function m9(e){e.openElements.hasInListItemScope(E.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(E.LI),e.openElements.popUntilTagNamePopped(E.LI))}function h9(e,t){const a=t.tagID;e.openElements.hasInScope(a)&&(e.openElements.generateImpliedEndTagsWithExclusion(a),e.openElements.popUntilTagNamePopped(a))}function p9(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function g9(e,t){const a=t.tagID;e.openElements.hasInScope(a)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(a),e.activeFormattingElements.clearToLastMarker())}function b9(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(ne.BR,E.BR),e.openElements.pop(),e.framesetOk=!1}function QT(e,t){const a=t.tagName,s=t.tagID;for(let o=e.openElements.stackTop;o>0;o--){const u=e.openElements.items[o],d=e.openElements.tagIDs[o];if(s===d&&(s!==E.UNKNOWN||e.treeAdapter.getTagName(u)===a)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.stackTop>=o&&e.openElements.shortenToLength(o);break}if(e._isSpecialElement(u,d))break}}function od(e,t){switch(t.tagID){case E.A:case E.B:case E.I:case E.S:case E.U:case E.EM:case E.TT:case E.BIG:case E.CODE:case E.FONT:case E.NOBR:case E.SMALL:case E.STRIKE:case E.STRONG:{_p(e,t);break}case E.P:{f9(e);break}case E.DL:case E.UL:case E.OL:case E.DIR:case E.DIV:case E.NAV:case E.PRE:case E.MAIN:case E.MENU:case E.ASIDE:case E.BUTTON:case E.CENTER:case E.FIGURE:case E.FOOTER:case E.HEADER:case E.HGROUP:case E.DIALOG:case E.ADDRESS:case E.ARTICLE:case E.DETAILS:case E.SEARCH:case E.SECTION:case E.SUMMARY:case E.LISTING:case E.FIELDSET:case E.BLOCKQUOTE:case E.FIGCAPTION:{c9(e,t);break}case E.LI:{m9(e);break}case E.DD:case E.DT:{h9(e,t);break}case E.H1:case E.H2:case E.H3:case E.H4:case E.H5:case E.H6:{p9(e);break}case E.BR:{b9(e);break}case E.BODY:{o9(e,t);break}case E.HTML:{u9(e,t);break}case E.FORM:{d9(e);break}case E.APPLET:case E.OBJECT:case E.MARQUEE:{g9(e,t);break}case E.TEMPLATE:{Qs(e,t);break}default:QT(e,t)}}function WT(e,t){e.tmplInsertionModeStack.length>0?r_(e,t):vp(e,t)}function x9(e,t){var a;t.tagID===E.SCRIPT&&((a=e.scriptHandler)===null||a===void 0||a.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function E9(e,t){e._err(t,fe.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function nh(e,t){if(e.openElements.currentTagId!==void 0&&YT.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=G.IN_TABLE_TEXT,t.type){case rt.CHARACTER:{JT(e,t);break}case rt.WHITESPACE_CHARACTER:{ZT(e,t);break}}else Bo(e,t)}function y9(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Ee.HTML),e.insertionMode=G.IN_CAPTION}function N9(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Ee.HTML),e.insertionMode=G.IN_COLUMN_GROUP}function T9(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ne.COLGROUP,E.COLGROUP),e.insertionMode=G.IN_COLUMN_GROUP,Sp(e,t)}function _9(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Ee.HTML),e.insertionMode=G.IN_TABLE_BODY}function v9(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ne.TBODY,E.TBODY),e.insertionMode=G.IN_TABLE_BODY,ud(e,t)}function S9(e,t){e.openElements.hasInTableScope(E.TABLE)&&(e.openElements.popUntilTagNamePopped(E.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function A9(e,t){XT(t)?e._appendElement(t,Ee.HTML):Bo(e,t),t.ackSelfClosing=!0}function w9(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Ee.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Ki(e,t){switch(t.tagID){case E.TD:case E.TH:case E.TR:{v9(e,t);break}case E.STYLE:case E.SCRIPT:case E.TEMPLATE:{Ua(e,t);break}case E.COL:{T9(e,t);break}case E.FORM:{w9(e,t);break}case E.TABLE:{S9(e,t);break}case E.TBODY:case E.TFOOT:case E.THEAD:{_9(e,t);break}case E.INPUT:{A9(e,t);break}case E.CAPTION:{y9(e,t);break}case E.COLGROUP:{N9(e,t);break}default:Bo(e,t)}}function So(e,t){switch(t.tagID){case E.TABLE:{e.openElements.hasInTableScope(E.TABLE)&&(e.openElements.popUntilTagNamePopped(E.TABLE),e._resetInsertionMode());break}case E.TEMPLATE:{Qs(e,t);break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:case E.TBODY:case E.TD:case E.TFOOT:case E.TH:case E.THEAD:case E.TR:break;default:Bo(e,t)}}function Bo(e,t){const a=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,ld(e,t),e.fosterParentingEnabled=a}function ZT(e,t){e.pendingCharacterTokens.push(t)}function JT(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function ro(e,t){let a=0;if(e.hasNonWhitespacePendingCharacterToken)for(;a<e.pendingCharacterTokens.length;a++)Bo(e,e.pendingCharacterTokens[a]);else for(;a<e.pendingCharacterTokens.length;a++)e._insertCharacters(e.pendingCharacterTokens[a]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const e_=new Set([E.CAPTION,E.COL,E.COLGROUP,E.TBODY,E.TD,E.TFOOT,E.TH,E.THEAD,E.TR]);function C9(e,t){const a=t.tagID;e_.has(a)?e.openElements.hasInTableScope(E.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(E.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=G.IN_TABLE,Ki(e,t)):On(e,t)}function k9(e,t){const a=t.tagID;switch(a){case E.CAPTION:case E.TABLE:{e.openElements.hasInTableScope(E.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(E.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=G.IN_TABLE,a===E.TABLE&&So(e,t));break}case E.BODY:case E.COL:case E.COLGROUP:case E.HTML:case E.TBODY:case E.TD:case E.TFOOT:case E.TH:case E.THEAD:case E.TR:break;default:od(e,t)}}function Sp(e,t){switch(t.tagID){case E.HTML:{On(e,t);break}case E.COL:{e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0;break}case E.TEMPLATE:{Ua(e,t);break}default:Uc(e,t)}}function R9(e,t){switch(t.tagID){case E.COLGROUP:{e.openElements.currentTagId===E.COLGROUP&&(e.openElements.pop(),e.insertionMode=G.IN_TABLE);break}case E.TEMPLATE:{Qs(e,t);break}case E.COL:break;default:Uc(e,t)}}function Uc(e,t){e.openElements.currentTagId===E.COLGROUP&&(e.openElements.pop(),e.insertionMode=G.IN_TABLE,e._processToken(t))}function ud(e,t){switch(t.tagID){case E.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Ee.HTML),e.insertionMode=G.IN_ROW;break}case E.TH:case E.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(ne.TR,E.TR),e.insertionMode=G.IN_ROW,cd(e,t);break}case E.CAPTION:case E.COL:case E.COLGROUP:case E.TBODY:case E.TFOOT:case E.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE,Ki(e,t));break}default:Ki(e,t)}}function Dh(e,t){const a=t.tagID;switch(t.tagID){case E.TBODY:case E.TFOOT:case E.THEAD:{e.openElements.hasInTableScope(a)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE);break}case E.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE,So(e,t));break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:case E.TD:case E.TH:case E.TR:break;default:So(e,t)}}function cd(e,t){switch(t.tagID){case E.TH:case E.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,Ee.HTML),e.insertionMode=G.IN_CELL,e.activeFormattingElements.insertMarker();break}case E.CAPTION:case E.COL:case E.COLGROUP:case E.TBODY:case E.TFOOT:case E.THEAD:case E.TR:{e.openElements.hasInTableScope(E.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE_BODY,ud(e,t));break}default:Ki(e,t)}}function t_(e,t){switch(t.tagID){case E.TR:{e.openElements.hasInTableScope(E.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE_BODY);break}case E.TABLE:{e.openElements.hasInTableScope(E.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE_BODY,Dh(e,t));break}case E.TBODY:case E.TFOOT:case E.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(E.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE_BODY,Dh(e,t));break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:case E.TD:case E.TH:break;default:So(e,t)}}function O9(e,t){const a=t.tagID;e_.has(a)?(e.openElements.hasInTableScope(E.TD)||e.openElements.hasInTableScope(E.TH))&&(e._closeTableCell(),cd(e,t)):On(e,t)}function I9(e,t){const a=t.tagID;switch(a){case E.TD:case E.TH:{e.openElements.hasInTableScope(a)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(a),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=G.IN_ROW);break}case E.TABLE:case E.TBODY:case E.TFOOT:case E.THEAD:case E.TR:{e.openElements.hasInTableScope(a)&&(e._closeTableCell(),t_(e,t));break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:break;default:od(e,t)}}function n_(e,t){switch(t.tagID){case E.HTML:{On(e,t);break}case E.OPTION:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e._insertElement(t,Ee.HTML);break}case E.OPTGROUP:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e.openElements.currentTagId===E.OPTGROUP&&e.openElements.pop(),e._insertElement(t,Ee.HTML);break}case E.HR:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e.openElements.currentTagId===E.OPTGROUP&&e.openElements.pop(),e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0;break}case E.INPUT:case E.KEYGEN:case E.TEXTAREA:case E.SELECT:{e.openElements.hasInSelectScope(E.SELECT)&&(e.openElements.popUntilTagNamePopped(E.SELECT),e._resetInsertionMode(),t.tagID!==E.SELECT&&e._processStartTag(t));break}case E.SCRIPT:case E.TEMPLATE:{Ua(e,t);break}}}function a_(e,t){switch(t.tagID){case E.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===E.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===E.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===E.OPTGROUP&&e.openElements.pop();break}case E.OPTION:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop();break}case E.SELECT:{e.openElements.hasInSelectScope(E.SELECT)&&(e.openElements.popUntilTagNamePopped(E.SELECT),e._resetInsertionMode());break}case E.TEMPLATE:{Qs(e,t);break}}}function M9(e,t){const a=t.tagID;a===E.CAPTION||a===E.TABLE||a===E.TBODY||a===E.TFOOT||a===E.THEAD||a===E.TR||a===E.TD||a===E.TH?(e.openElements.popUntilTagNamePopped(E.SELECT),e._resetInsertionMode(),e._processStartTag(t)):n_(e,t)}function D9(e,t){const a=t.tagID;a===E.CAPTION||a===E.TABLE||a===E.TBODY||a===E.TFOOT||a===E.THEAD||a===E.TR||a===E.TD||a===E.TH?e.openElements.hasInTableScope(a)&&(e.openElements.popUntilTagNamePopped(E.SELECT),e._resetInsertionMode(),e.onEndTag(t)):a_(e,t)}function L9(e,t){switch(t.tagID){case E.BASE:case E.BASEFONT:case E.BGSOUND:case E.LINK:case E.META:case E.NOFRAMES:case E.SCRIPT:case E.STYLE:case E.TEMPLATE:case E.TITLE:{Ua(e,t);break}case E.CAPTION:case E.COLGROUP:case E.TBODY:case E.TFOOT:case E.THEAD:{e.tmplInsertionModeStack[0]=G.IN_TABLE,e.insertionMode=G.IN_TABLE,Ki(e,t);break}case E.COL:{e.tmplInsertionModeStack[0]=G.IN_COLUMN_GROUP,e.insertionMode=G.IN_COLUMN_GROUP,Sp(e,t);break}case E.TR:{e.tmplInsertionModeStack[0]=G.IN_TABLE_BODY,e.insertionMode=G.IN_TABLE_BODY,ud(e,t);break}case E.TD:case E.TH:{e.tmplInsertionModeStack[0]=G.IN_ROW,e.insertionMode=G.IN_ROW,cd(e,t);break}default:e.tmplInsertionModeStack[0]=G.IN_BODY,e.insertionMode=G.IN_BODY,On(e,t)}}function j9(e,t){t.tagID===E.TEMPLATE&&Qs(e,t)}function r_(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(E.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):vp(e,t)}function B9(e,t){t.tagID===E.HTML?On(e,t):Hc(e,t)}function s_(e,t){var a;if(t.tagID===E.HTML){if(e.fragmentContext||(e.insertionMode=G.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===E.HTML){e._setEndLocation(e.openElements.items[0],t);const s=e.openElements.items[1];s&&!(!((a=e.treeAdapter.getNodeSourceCodeLocation(s))===null||a===void 0)&&a.endTag)&&e._setEndLocation(s,t)}}else Hc(e,t)}function Hc(e,t){e.insertionMode=G.IN_BODY,ld(e,t)}function P9(e,t){switch(t.tagID){case E.HTML:{On(e,t);break}case E.FRAMESET:{e._insertElement(t,Ee.HTML);break}case E.FRAME:{e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0;break}case E.NOFRAMES:{Ua(e,t);break}}}function U9(e,t){t.tagID===E.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==E.FRAMESET&&(e.insertionMode=G.AFTER_FRAMESET))}function H9(e,t){switch(t.tagID){case E.HTML:{On(e,t);break}case E.NOFRAMES:{Ua(e,t);break}}}function F9(e,t){t.tagID===E.HTML&&(e.insertionMode=G.AFTER_AFTER_FRAMESET)}function z9(e,t){t.tagID===E.HTML?On(e,t):Ec(e,t)}function Ec(e,t){e.insertionMode=G.IN_BODY,ld(e,t)}function $9(e,t){switch(t.tagID){case E.HTML:{On(e,t);break}case E.NOFRAMES:{Ua(e,t);break}}}function q9(e,t){t.chars=zt,e._insertCharacters(t)}function Y9(e,t){e._insertCharacters(t),e.framesetOk=!1}function i_(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Ee.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function G9(e,t){if(l8(t))i_(e),e._startTagOutsideForeignContent(t);else{const a=e._getAdjustedCurrentElement(),s=e.treeAdapter.getNamespaceURI(a);s===Ee.MATHML?$T(t):s===Ee.SVG&&(o8(t),qT(t)),Tp(t),t.selfClosing?e._appendElement(t,s):e._insertElement(t,s),t.ackSelfClosing=!0}}function K9(e,t){if(t.tagID===E.P||t.tagID===E.BR){i_(e),e._endTagOutsideForeignContent(t);return}for(let a=e.openElements.stackTop;a>0;a--){const s=e.openElements.items[a];if(e.treeAdapter.getNamespaceURI(s)===Ee.HTML){e._endTagOutsideForeignContent(t);break}const o=e.treeAdapter.getTagName(s);if(o.toLowerCase()===t.tagName){t.tagName=o,e.openElements.shortenToLength(a);break}}}ne.AREA,ne.BASE,ne.BASEFONT,ne.BGSOUND,ne.BR,ne.COL,ne.EMBED,ne.FRAME,ne.HR,ne.IMG,ne.INPUT,ne.KEYGEN,ne.LINK,ne.META,ne.PARAM,ne.SOURCE,ne.TRACK,ne.WBR;const V9=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,X9=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),DE={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function l_(e,t){const a=sB(e),s=IN("type",{handlers:{root:Q9,element:W9,text:Z9,comment:u_,doctype:J9,raw:tB},unknown:nB}),o={parser:a?new OE(DE):OE.getFragmentParser(void 0,DE),handle(f){s(f,o)},stitches:!1,options:t||{}};s(e,o),tl(o,er());const u=a?o.parser.document:o.parser.getFragment(),d=ij(u,{file:o.options.file});return o.stitches&&Do(d,"comment",function(f,m,h){const b=f;if(b.value.stitch&&h&&m!==void 0){const g=h.children;return g[m]=b.value.stitch,m}}),d.type==="root"&&d.children.length===1&&d.children[0].type===e.type?d.children[0]:d}function o_(e,t){let a=-1;if(e)for(;++a<e.length;)t.handle(e[a])}function Q9(e,t){o_(e.children,t)}function W9(e,t){aB(e,t),o_(e.children,t),rB(e,t)}function Z9(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const a={type:rt.CHARACTER,chars:e.value,location:Po(e)};tl(t,er(e)),t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken)}function J9(e,t){const a={type:rt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Po(e)};tl(t,er(e)),t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken)}function eB(e,t){t.stitches=!0;const a=iB(e);if("children"in e&&"children"in a){const s=l_({type:"root",children:e.children},t.options);a.children=s.children}u_({type:"comment",value:{stitch:a}},t)}function u_(e,t){const a=e.value,s={type:rt.COMMENT,data:a,location:Po(e)};tl(t,er(e)),t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken)}function tB(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,c_(t,er(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(V9,"&lt;$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const a=t.parser.tokenizer._consume();t.parser.tokenizer._callState(a)}}function nB(e,t){const a=e;if(t.options.passThrough&&t.options.passThrough.includes(a.type))eB(a,t);else{let s="";throw X9.has(a.type)&&(s=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+a.type+"` node"+s)}}function tl(e,t){c_(e,t);const a=e.parser.tokenizer.currentCharacterToken;a&&a.location&&(a.location.endLine=e.parser.tokenizer.preprocessor.line,a.location.endCol=e.parser.tokenizer.preprocessor.col+1,a.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=a,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Jt.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function c_(e,t){if(t&&t.offset!==void 0){const a={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=a}}function aB(e,t){const a=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Jt.PLAINTEXT)return;tl(t,er(e));const s=t.parser.openElements.current;let o="namespaceURI"in s?s.namespaceURI:Fs.html;o===Fs.html&&a==="svg"&&(o=Fs.svg);const u=dj({...e,children:[]},{space:o===Fs.svg?"svg":"html"}),d={type:rt.START_TAG,tagName:a,tagID:el(a),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in u?u.attrs:[],location:Po(e)};t.parser.currentToken=d,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=a}function rB(e,t){const a=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Ej.includes(a)||t.parser.tokenizer.state===Jt.PLAINTEXT)return;tl(t,td(e));const s={type:rt.END_TAG,tagName:a,tagID:el(a),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Po(e)};t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken),a===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Jt.RCDATA||t.parser.tokenizer.state===Jt.RAWTEXT||t.parser.tokenizer.state===Jt.SCRIPT_DATA)&&(t.parser.tokenizer.state=Jt.DATA)}function sB(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Po(e){const t=er(e)||{line:void 0,column:void 0,offset:void 0},a=td(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:a.line,endCol:a.column,endOffset:a.offset}}function iB(e){return"children"in e?Yi({...e,children:[]}):Yi(e)}function go(e){return function(t,a){return l_(t,{...e,file:a})}}const LE=[{key:"open",label:"开放"},{key:"closed",label:"已关闭"},{key:"all",label:"全部"}];function lB(e){const t=e<1e12?e*1e3:e,a=Date.now()-t;return a<6e4?"刚刚":a<36e5?`${Math.floor(a/6e4)}分钟前`:a<864e5?`${Math.floor(a/36e5)}小时前`:a<2592e6?`${Math.floor(a/864e5)}天前`:new Date(t).toLocaleDateString("zh-CN",{month:"short",day:"numeric"})}function jE({onDone:e}){const[t,a]=_.useState(""),[s,o]=_.useState(""),[u,d]=_.useState(!1),[f,m]=_.useState("idle"),[h,b]=_.useState(""),[g,y]=_.useState(""),[N,v]=_.useState(null),S=_.useRef(null),w=Ve(ee=>ee.createIssue),A=Be(ee=>ee.activeRepoId),R=Be(ta),I=Pn(),Y=_.useCallback(()=>{S.current&&(clearInterval(S.current),S.current=null)},[]);_.useEffect(()=>()=>Y(),[Y]),_.useEffect(()=>{if(!A)return;let ee=!1;return Bx(A).then(ue=>{!ee&&ue.title&&(b(ue.title),y(ue.body),m("preview"))}).catch(()=>{}),()=>{ee=!0}},[A]);const B=async()=>{!t.trim()||u||(d(!0),await w(t.trim(),s.trim()||void 0),d(!1),e())},C=async()=>{!h.trim()||u||(d(!0),await w(h.trim(),g.trim()||void 0),A&&Px(A).catch(()=>{}),d(!1),m("idle"),b(""),y(""),v(null),e())},z=async()=>{if(!(!t.trim()||!A||f==="polishing")){m("polishing");try{const{sessionId:ee}=await hw(A,t.trim(),s.trim()||void 0);v(ee),S.current=setInterval(async()=>{try{if((await ky(A,ee)).type==="idle"){Y();const Z=await Bx(A);b(Z.title),y(Z.body),m("preview")}}catch{Y(),m("idle"),Ut.getState().addToast("润色状态检查失败","error")}},2e3)}catch(ee){m("idle"),Ut.getState().addToast(ee instanceof Error?ee.message:"润色启动失败","error")}}},W=()=>{Y(),A&&Px(A).catch(()=>{}),b(""),y(""),v(null),m("idle")},Q=()=>{!N||!R||(Ie.setState({activeSessionId:N}),I(`/${encodeURIComponent(R)}/run`))},j=ee=>{(ee.metaKey||ee.ctrlKey)&&ee.key==="Enter"&&(ee.preventDefault(),B())};return f==="preview"?l.jsxs("div",{className:"border-b border-line px-3 py-3",children:[l.jsxs("h4",{className:"mb-2 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-fg-4",children:[l.jsx(Hi,{className:"h-3.5 w-3.5 text-amber-400"}),"AI 润色结果"]}),l.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-3 py-2.5",children:[l.jsx("input",{type:"text",value:h,onChange:ee=>b(ee.target.value),className:"w-full bg-transparent text-xs font-medium text-fg placeholder:text-fg-6 focus:outline-none",placeholder:"润色后标题"}),l.jsx("textarea",{value:g,onChange:ee=>y(ee.target.value),rows:5,className:"mt-2 w-full resize-none bg-transparent text-xs text-fg placeholder:text-fg-6 focus:outline-none",placeholder:"润色后描述"})]}),l.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[l.jsxs("button",{type:"button",disabled:!h.trim()||u,onClick:()=>void C(),className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[l.jsx(Ra,{className:"h-3.5 w-3.5"}),"创建 Issue"]}),l.jsxs("button",{type:"button",onClick:()=>void z(),className:"flex items-center gap-1.5 rounded-md border border-line px-2.5 py-1 text-xs text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[l.jsx(Hi,{className:"h-3.5 w-3.5"}),"重新润色"]}),l.jsx("button",{type:"button",onClick:Q,className:"flex items-center gap-1.5 rounded-md border border-line px-2.5 py-1 text-xs text-fg-3 transition-colors hover:border-blue-500/50 hover:text-blue-400",children:"转入深度对话"}),l.jsx("button",{type:"button",onClick:W,className:"ml-auto rounded-md px-2.5 py-1 text-xs text-fg-5 transition-colors hover:text-fg-3",children:"放弃"})]})]}):l.jsxs("div",{className:"border-b border-line px-3 py-3",children:[l.jsx("input",{type:"text",value:t,onChange:ee=>a(ee.target.value),onKeyDown:j,placeholder:"Issue 标题",autoFocus:!0,disabled:f==="polishing",className:"w-full rounded-md border border-line bg-base px-2.5 py-1.5 text-xs text-fg placeholder:text-fg-6 focus:border-fg-5 focus:outline-none disabled:opacity-50"}),l.jsx("textarea",{value:s,onChange:ee=>o(ee.target.value),onKeyDown:j,placeholder:"描述(可选) ⌘⏎ 创建",rows:3,disabled:f==="polishing",className:"mt-2 w-full resize-none rounded-md border border-line bg-base px-2.5 py-1.5 text-xs text-fg placeholder:text-fg-6 focus:border-fg-5 focus:outline-none disabled:opacity-50"}),l.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2",children:[l.jsx("button",{type:"button",onClick:e,className:"rounded-md px-2.5 py-1 text-xs text-fg-4 transition-colors hover:text-fg-2",children:"取消"}),l.jsxs("button",{type:"button",disabled:!t.trim()||f==="polishing",onClick:()=>void z(),className:"flex items-center gap-1.5 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-1 text-xs font-medium text-amber-400 transition-colors hover:bg-amber-500/20 disabled:opacity-40",children:[l.jsx(Hi,{className:"h-3.5 w-3.5"}),f==="polishing"?"润色中...":"AI 润色"]}),l.jsx("button",{type:"button",onClick:()=>void B(),disabled:!t.trim()||u||f==="polishing",className:"rounded-md bg-blue-600 px-3 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:"直接创建"})]})]})}function oB({repoId:e,issueNumber:t,onPublished:a}){const s=Pn(),o=Be(ta),[u,d]=_.useState(""),[f,m]=_.useState("idle"),[h,b]=_.useState(""),[g,y]=_.useState(null),[N,v]=_.useState(!1),S=_.useRef(null),w=_.useCallback(()=>{S.current&&(clearInterval(S.current),S.current=null)},[]);_.useEffect(()=>()=>w(),[w]),_.useEffect(()=>{let C=!1;return jx(e,t).then(z=>{!C&&z.body&&(b(z.body),m("preview"))}).catch(()=>{}),()=>{C=!0}},[e,t]);const A=async()=>{if(!(!u.trim()||N)){v(!0);try{const C=await Lx(e,t,u.trim());a(C),d(""),Ut.getState().addToast("评论已发布","success")}catch(C){Ut.getState().addToast(C instanceof Error?C.message:"发布失败","error")}finally{v(!1)}}},R=async()=>{if(!(!u.trim()||f==="polishing")){m("polishing");try{const{sessionId:C}=await mw(e,t,u.trim());y(C),S.current=setInterval(async()=>{try{if((await ky(e,C)).type==="idle"){w();const W=await jx(e,t);b(W.body),m("preview")}}catch{w(),m("idle"),Ut.getState().addToast("润色状态检查失败","error")}},2e3)}catch(C){m("idle"),Ut.getState().addToast(C instanceof Error?C.message:"润色启动失败","error")}}},I=async()=>{if(!(!h.trim()||N)){v(!0);try{const C=await Lx(e,t,h.trim());a(C),d(""),b(""),y(null),m("idle"),Ut.getState().addToast("评论已发布","success")}catch(C){Ut.getState().addToast(C instanceof Error?C.message:"发布失败","error")}finally{v(!1)}}},Y=()=>{w(),b(""),y(null),m("idle")},B=()=>{!g||!o||(Ie.setState({activeSessionId:g}),s(`/${encodeURIComponent(o)}/run`))};return f==="preview"?l.jsxs("div",{className:"mt-8 border-t border-line pt-6",children:[l.jsxs("h3",{className:"mb-3 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-fg-4",children:[l.jsx(Hi,{className:"h-3.5 w-3.5 text-amber-400"}),"AI 润色结果"]}),l.jsx("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-4 py-3",children:l.jsx("textarea",{value:h,onChange:C=>b(C.target.value),rows:6,className:"w-full resize-none bg-transparent text-sm text-fg placeholder:text-fg-6 focus:outline-none"})}),l.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[l.jsxs("button",{type:"button",disabled:N,onClick:()=>void I(),className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[l.jsx(zi,{className:"h-3.5 w-3.5"}),"发布评论"]}),l.jsxs("button",{type:"button",onClick:()=>void R(),className:"flex items-center gap-1.5 rounded-md border border-line px-2.5 py-1.5 text-xs text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[l.jsx(Hi,{className:"h-3.5 w-3.5"}),"重新润色"]}),l.jsx("button",{type:"button",onClick:B,className:"flex items-center gap-1.5 rounded-md border border-line px-2.5 py-1.5 text-xs text-fg-3 transition-colors hover:border-blue-500/50 hover:text-blue-400",children:"转入深度对话"}),l.jsx("button",{type:"button",onClick:Y,className:"ml-auto rounded-md px-2.5 py-1.5 text-xs text-fg-5 transition-colors hover:text-fg-3",children:"放弃"})]})]}):l.jsxs("div",{className:"mt-8 border-t border-line pt-6",children:[l.jsx("h3",{className:"mb-3 text-xs font-semibold uppercase tracking-wider text-fg-4",children:"添加评论"}),l.jsx("textarea",{value:u,onChange:C=>d(C.target.value),placeholder:"写下你的评论...",rows:4,disabled:f==="polishing",className:"w-full resize-none rounded-lg border border-line bg-base px-3 py-2.5 text-sm text-fg placeholder:text-fg-6 focus:border-fg-5 focus:outline-none disabled:opacity-50"}),l.jsxs("div",{className:"mt-2.5 flex items-center gap-2",children:[l.jsxs("button",{type:"button",disabled:!u.trim()||N||f==="polishing",onClick:()=>void A(),className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[l.jsx(zi,{className:"h-3.5 w-3.5"}),N?"发送中...":"直接发送"]}),l.jsxs("button",{type:"button",disabled:!u.trim()||f==="polishing",onClick:()=>void R(),className:"flex items-center gap-1.5 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-1.5 text-xs font-medium text-amber-400 transition-colors hover:bg-amber-500/20 disabled:opacity-40",children:[l.jsx(Hi,{className:"h-3.5 w-3.5"}),f==="polishing"?"润色中...":"AI 润色"]})]})]})}function BE({issue:e,sessionCount:t,isActive:a,isEpic:s,milestone:o,onSelect:u}){return l.jsx("li",{children:l.jsxs("button",{type:"button",onClick:u,className:se("group flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-left transition-colors",a?"border-l-2 border-blue-500 bg-elevated/80":"border-l-2 border-transparent hover:bg-elevated/50"),children:[l.jsx("span",{className:se("flex h-10 w-10 shrink-0 items-center justify-center rounded-full font-mono text-sm font-bold",e.state==="open"?"bg-gradient-to-br from-emerald-500/20 to-emerald-500/5 text-emerald-400 ring-1 ring-emerald-500/25":"bg-gradient-to-br from-purple-500/20 to-purple-500/5 text-purple-400 ring-1 ring-purple-500/25"),children:e.number}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[s&&l.jsx("span",{className:"shrink-0 rounded px-1 py-0.5 text-[9px] font-bold tracking-wide bg-amber-400/12 text-amber-400",children:"EPIC"}),l.jsx("span",{className:"min-w-0 text-xs font-medium text-fg-2 group-hover:text-fg",children:e.title})]}),e.labels&&e.labels.length>0&&l.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:e.labels.map(d=>l.jsx("span",{className:"rounded px-1 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${d.color}20`,color:`#${d.color}`},children:d.name},d.id))}),o&&l.jsxs("span",{className:"mt-1 flex items-center gap-1 text-[10px] text-indigo-400/70",children:[l.jsx(Xh,{className:"h-2.5 w-2.5"}),o.title]})]}),t>0&&l.jsx("span",{className:"shrink-0 rounded-full bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:t})]})})}function uB({issue:e,sessionCount:t,isEpic:a,milestone:s,onSelect:o}){return l.jsx("li",{children:l.jsxs("button",{type:"button",onClick:o,className:"group flex w-full items-center gap-3 border-b border-line px-4 py-3 text-left transition-colors hover:bg-elevated/50",children:[l.jsx("span",{className:se("flex h-10 w-10 shrink-0 items-center justify-center rounded-full font-mono text-sm font-bold",e.state==="open"?"bg-gradient-to-br from-emerald-500/20 to-emerald-500/5 text-emerald-400 ring-1 ring-emerald-500/25":"bg-gradient-to-br from-purple-500/20 to-purple-500/5 text-purple-400 ring-1 ring-purple-500/25"),children:e.number}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[a&&l.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[9px] font-bold tracking-wide bg-amber-400/12 text-amber-400",children:"EPIC"}),l.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-fg-2 group-hover:text-fg",children:e.title}),s&&l.jsxs("span",{className:"hidden shrink-0 items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium bg-indigo-500/15 text-indigo-400 sm:flex",children:[l.jsx(Xh,{className:"h-2.5 w-2.5"}),s.title]}),t>0&&l.jsxs("span",{className:"shrink-0 rounded-full bg-elevated px-2 py-0.5 font-mono text-[10px] text-fg-5",children:[t," 次运行"]}),e.assignees&&e.assignees.length>0&&l.jsxs("div",{className:"hidden shrink-0 items-center -space-x-1.5 sm:flex",children:[e.assignees.slice(0,3).map(u=>l.jsx("img",{src:u.avatar_url,alt:u.login,title:u.login,className:"h-5 w-5 rounded-full ring-2 ring-surface"},u.login)),e.assignees.length>3&&l.jsxs("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-elevated text-[9px] font-medium text-fg-4 ring-2 ring-surface",children:["+",e.assignees.length-3]})]})]}),l.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1",children:[e.authorLogin&&l.jsxs("span",{className:"shrink-0 text-[11px] text-fg-5",title:e.authorLogin,children:[e.authorAvatar&&l.jsx("img",{src:e.authorAvatar,alt:"",className:"mr-1 inline-block h-3.5 w-3.5 rounded-full align-text-bottom"}),e.authorLogin]}),e.authorLogin&&l.jsx("span",{className:"text-fg-6",children:"·"}),l.jsx("span",{className:"shrink-0 text-[11px] text-fg-6",children:lB(e.createdAt)}),(e.commentCount??0)>0&&l.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 text-[11px] text-fg-6",children:[l.jsx("span",{className:"text-fg-6",children:"·"}),l.jsx(k3,{className:"h-3 w-3"}),e.commentCount]}),(e.labels&&e.labels.length>0||(e.commentCount??0)>0||e.authorLogin)&&e.labels&&e.labels.length>0&&l.jsx("span",{className:"text-fg-6",children:"·"}),e.labels&&e.labels.length>0?e.labels.map(u=>l.jsx("span",{className:"rounded px-1.5 py-0.5 text-[11px] font-medium",style:{backgroundColor:`#${u.color}20`,color:`#${u.color}`},children:u.name},u.id)):e.authorLogin?null:l.jsx("span",{className:"text-[11px] text-fg-6",children:" "})]})]})]})})}function cB({issue:e,milestone:t,onBack:a,onClose:s,onToggleSidebar:o}){var ue;const u=Pn(),d=Be(Z=>Z.activeRepoId),f=Be(ta),[m,h]=_.useState([]),[b,g]=_.useState(!1),[y,N]=_.useState([]),[v,S]=_.useState(0),[w,A]=_.useState(!1),[R,I]=_.useState(!1),[Y,B]=_.useState("issue"),C=Ve(Z=>Z.updateIssueState);_.useEffect(()=>{d&&(g(!0),fw(d,e.number).then(h).catch(()=>h([])).finally(()=>g(!1)))},[d,e.number]),_.useEffect(()=>{d&&Mx(d,e.number).then(N).catch(()=>N([]))},[d,e.number]),_.useEffect(()=>{B("issue"),S(0)},[e.id]);const z=y[v]??y[0],W=async Z=>{if(!(w||!d||!z)){A(!0);try{await iw(d,e.number,z.number,Z),Z&&await C(e.number,"closed");const q=await Mx(d,e.number);N(q),v>=q.length&&S(Math.max(0,q.length-1)),Ut.getState().addToast(`PR #${z.number} 合入成功`,"success")}catch(q){let F="合入失败";if(q instanceof Za)try{F=JSON.parse(q.message).error??F}catch{F=q.message}Ut.getState().addToast(F,"error")}finally{A(!1)}}},Q=()=>{if(!z)return;const Z=`请解决 PR #${z.number} 的合并冲突: ${z.title}`;Ve.getState().setSelectedIssue(e.id),Ve.getState().setPendingDraft(Z),Ve.getState().setPreviewIssue(null),Ie.setState({activeSessionId:null}),u(`/${encodeURIComponent(f)}/run`)},j=()=>{Ve.getState().setSelectedIssue(e.id),Ve.getState().setPreviewIssue(null),Ie.setState({activeSessionId:null}),u(`/${encodeURIComponent(f)}/run`)},ee=Z=>{const q=new Date(Z);return q.toLocaleDateString("zh-CN",{month:"short",day:"numeric"})+" "+q.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"})};return l.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[l.jsxs("header",{className:"flex flex-col gap-2 border-b border-line px-4 py-3 md:flex-row md:items-center md:gap-3 md:px-6",children:[l.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[l.jsx("button",{type:"button",onClick:a,"aria-label":"返回列表",className:"-ml-1 shrink-0 rounded-md p-1.5 text-fg-3 transition-colors hover:bg-elevated hover:text-fg md:hidden",children:l.jsx(Kh,{className:"h-5 w-5"})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[l.jsxs("span",{className:se("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",e.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",e.number," ",e.state]}),(ue=e.labels)==null?void 0:ue.map(Z=>l.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${Z.color}20`,color:`#${Z.color}`},children:Z.name},Z.id)),t&&l.jsxs("span",{className:"flex shrink-0 items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium bg-indigo-500/15 text-indigo-400",children:[l.jsx(Xh,{className:"h-2.5 w-2.5"}),t.title]})]}),l.jsx("h2",{className:"mt-1 text-base font-semibold text-fg",children:e.title}),(e.authorLogin||e.assignees&&e.assignees.length>0)&&l.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 text-xs text-fg-4",children:[e.authorLogin&&l.jsxs("span",{className:"flex items-center gap-1.5",children:[e.authorAvatar&&l.jsx("img",{src:e.authorAvatar,alt:"",className:"h-4 w-4 rounded-full"}),e.authorLogin]}),e.assignees&&e.assignees.length>0&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"text-fg-5",children:"→"}),l.jsx("span",{className:"flex items-center -space-x-1",children:e.assignees.map(Z=>l.jsx("img",{src:Z.avatar_url,alt:Z.login,title:Z.login,className:"h-4 w-4 rounded-full ring-1 ring-surface"},Z.login))}),l.jsx("span",{className:"text-fg-4",children:e.assignees.map(Z=>Z.login).join(", ")})]})]})]})]}),l.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:[e.htmlUrl&&l.jsxs("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 font-mono text-xs text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[l.jsx(_c,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"hidden sm:inline",children:"源站"})]}),l.jsxs("button",{type:"button",onClick:()=>{Ve.getState().enterMatchMode(e.id),Ie.setState({activeSessionId:null}),u(`/${encodeURIComponent(f)}/run`)},className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 text-xs text-fg-3 transition-colors hover:border-blue-500/50 hover:text-blue-400",children:[l.jsx(Gs,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"hidden sm:inline",children:"匹配子任务"})]}),l.jsx("button",{type:"button",disabled:R,onClick:async()=>{I(!0),await C(e.number,e.state==="open"?"closed":"open"),I(!1)},className:se("flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-xs font-medium transition-colors disabled:opacity-40",e.state==="open"?"border-red-500/30 text-red-400 hover:border-red-500/60 hover:bg-red-500/10":"border-emerald-500/30 text-emerald-400 hover:border-emerald-500/60 hover:bg-emerald-500/10"),children:e.state==="open"?l.jsxs(l.Fragment,{children:[l.jsx(xy,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"hidden sm:inline",children:"关闭"})]}):l.jsxs(l.Fragment,{children:[l.jsx(xo,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"hidden sm:inline",children:"重新打开"})]})}),l.jsxs("button",{type:"button",onClick:j,className:"flex h-8 items-center gap-1.5 rounded-md bg-blue-600 px-3 text-xs font-medium text-white transition-colors hover:bg-blue-500",children:[l.jsx(Qc,{className:"h-3.5 w-3.5 fill-current"}),l.jsx("span",{className:"hidden sm:inline",children:"开始处理"})]}),o&&l.jsx("button",{type:"button",onClick:o,title:"面板",className:"flex h-8 w-8 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-2",children:l.jsx(yy,{className:"h-4 w-4"})}),s&&l.jsx("button",{type:"button",onClick:s,title:"关闭详情",className:"hidden h-8 w-8 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-2 md:flex",children:l.jsx(gt,{className:"h-4 w-4"})})]})]}),y.length>0&&l.jsxs("div",{className:"flex shrink-0 items-center border-b border-line bg-surface",children:[l.jsxs("button",{type:"button",onClick:()=>B("issue"),className:se("flex items-center gap-1.5 border-b-2 px-4 py-2.5 text-xs font-medium transition-colors",Y==="issue"?"border-blue-500 text-fg":"border-transparent text-fg-4 hover:text-fg-2"),children:[l.jsx(xo,{className:"h-3.5 w-3.5"}),"Issue"]}),l.jsxs("button",{type:"button",onClick:()=>B("pr"),className:se("flex items-center gap-1.5 border-b-2 px-4 py-2.5 text-xs font-medium transition-colors",Y==="pr"?"border-blue-500 text-fg":"border-transparent text-fg-4 hover:text-fg-2"),children:[l.jsx(Eo,{className:"h-3.5 w-3.5"}),"PR",l.jsx("span",{className:se("rounded-full px-1.5 py-0.5 font-mono text-[10px]",Y==="pr"?"bg-blue-500/10 text-blue-500":"bg-elevated text-fg-5"),children:y.length}),y.some(Z=>Z.mergeable===!1)&&l.jsxs("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-semibold bg-red-500/15 text-red-400",children:[l.jsx(kn,{className:"inline h-3 w-3 -mt-px"})," Conflict"]})]})]}),Y==="issue"||y.length===0?l.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:l.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-6 md:px-6",children:[e.body?l.jsx("div",{className:"markdown-body leading-relaxed",children:l.jsx(cs,{remarkPlugins:[ds],rehypePlugins:[go],children:e.body})}):l.jsx("p",{className:"py-10 text-center font-mono text-xs text-fg-5",children:"该 Issue 没有描述内容"}),b?l.jsx("p",{className:"mt-8 text-center font-mono text-xs text-fg-6",children:"加载评论…"}):m.length>0&&l.jsxs("div",{className:"mt-8 border-t border-line pt-6",children:[l.jsxs("h3",{className:"mb-4 text-xs font-semibold uppercase tracking-wider text-fg-4",children:["评论 (",m.length,")"]}),l.jsx("div",{className:"space-y-4",children:m.map(Z=>l.jsxs("div",{className:"rounded-lg border border-line bg-elevated/40 px-4 py-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("img",{src:Z.user.avatar_url,alt:Z.user.login,className:"h-5 w-5 rounded-full"}),l.jsx("span",{className:"text-xs font-semibold text-fg-2",children:Z.user.login}),l.jsx("span",{className:"text-[10px] text-fg-6",children:ee(Z.created_at)})]}),l.jsx("div",{className:"markdown-body mt-2 text-sm leading-relaxed text-fg-3",children:l.jsx(cs,{remarkPlugins:[ds],rehypePlugins:[go],children:Z.body})})]},Z.id))})]}),d&&l.jsx(oB,{repoId:d,issueNumber:e.number,onPublished:Z=>h(q=>[...q,Z])},e.id)]})}):l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[l.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2 border-b border-line bg-surface px-4 py-0",children:[y.length>1&&y.map((Z,q)=>l.jsxs("button",{type:"button",onClick:()=>S(q),className:se("flex items-center gap-1.5 border-b-2 px-2.5 py-2.5 text-xs font-medium transition-colors",q===v?"border-blue-500 text-fg":"border-transparent text-fg-4 hover:text-fg-2"),children:[l.jsxs("span",{className:"font-mono text-[10px]",children:["#",Z.number]}),l.jsx("span",{className:"max-w-[140px] truncate",children:Z.title})]},Z.number)),l.jsxs("div",{className:se("flex items-center gap-2",y.length>1&&"ml-auto"),children:[(z==null?void 0:z.html_url)&&l.jsxs("a",{href:z.html_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 rounded-md border border-line px-2 py-1.5 font-mono text-[11px] text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[l.jsx(_c,{className:"h-3 w-3"}),l.jsx("span",{className:"hidden sm:inline",children:"查看"})]}),(z==null?void 0:z.mergeable)===!1&&l.jsxs("button",{type:"button",onClick:Q,className:"flex items-center gap-1.5 rounded-md border border-amber-500/30 px-2.5 py-1.5 text-xs font-medium text-amber-400 transition-colors hover:border-amber-500/60 hover:bg-amber-500/10",children:[l.jsx(g5,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"hidden sm:inline",children:"解冲突"})]}),l.jsxs("button",{type:"button",disabled:w||(z==null?void 0:z.mergeable)===!1,onClick:()=>void W(!1),className:"flex items-center gap-1.5 rounded-md border border-emerald-500/30 px-2.5 py-1.5 text-xs font-medium text-emerald-400 transition-colors hover:border-emerald-500/60 hover:bg-emerald-500/10 disabled:opacity-40",children:[l.jsx(vc,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"hidden sm:inline",children:"合入"})]}),l.jsxs("button",{type:"button",disabled:w||(z==null?void 0:z.mergeable)===!1,onClick:()=>void W(!0),className:"flex items-center gap-1.5 rounded-md border border-blue-500/30 px-2.5 py-1.5 text-xs font-medium text-blue-400 transition-colors hover:border-blue-500/60 hover:bg-blue-500/10 disabled:opacity-40",children:[l.jsx(vc,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"hidden sm:inline",children:"合入并关闭"})]})]})]}),z&&l.jsx("div",{className:"flex-1 overflow-y-auto",children:l.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-6 md:px-6",children:[l.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[l.jsxs("span",{className:se("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",z.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",z.number," ",z.state]}),z.mergeable===!1&&l.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-semibold bg-red-500/15 text-red-400",children:"Conflict"}),l.jsx("span",{className:"text-sm font-semibold text-fg",children:z.title})]}),z.body?l.jsx("div",{className:"markdown-body leading-relaxed",children:l.jsx(cs,{remarkPlugins:[ds],rehypePlugins:[go],children:z.body})}):l.jsx("p",{className:"py-6 text-center font-mono text-xs text-fg-5",children:"该 PR 没有描述内容"})]})})]})]})}function d_({issue:e,childrenMap:t,currentId:a,onSelect:s,depth:o}){const u=t.get(e.id)??[],d=e.id===a;return l.jsxs("div",{children:[l.jsxs("button",{type:"button",onClick:()=>s(e.id),className:se("group flex w-full items-center gap-1.5 rounded-md px-2 py-1.5 text-left text-xs transition-colors",d?"bg-blue-500/10 text-blue-400":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),style:{paddingLeft:`${o*18+8}px`},children:[l.jsx("span",{className:se("h-1.5 w-1.5 shrink-0 rounded-full",e.state==="open"?"bg-emerald-400":"bg-purple-400")}),l.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-fg-6",children:["#",e.number]}),l.jsx("span",{className:"min-w-0 truncate",children:e.title})]}),u.length>0&&l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute top-0 bottom-3 w-px bg-line",style:{left:`${o*18+16}px`}}),u.map(f=>l.jsx(d_,{issue:f,childrenMap:t,currentId:a,onSelect:s,depth:o+1},f.id))]})]})}function dB(e,t){let a=0,s=0;const o=[...t.get(e)??[]];for(let u=0;u<o.length;u++){const d=o[u];a++,d.state==="closed"&&s++;const f=t.get(d.id);f&&o.push(...f)}return{total:a,closed:s}}function fB(e){var u;const t=typeof((u=e.time)==null?void 0:u.created)=="number"?e.time.created:e.createdAt?Date.parse(e.createdAt):0;if(!t||Number.isNaN(t))return"";const a=t<1e12?t*1e3:t,s=new Date(a);return s.toDateString()===new Date().toDateString()?s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function PE({session:e,onSelect:t}){var s,o;const a=fB(e);return l.jsx("li",{children:l.jsxs("button",{type:"button",onClick:t,className:"block w-full rounded-md border-l-2 border-transparent px-2.5 py-2 text-left transition-colors hover:bg-elevated/50",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"min-w-0 truncate font-mono text-xs text-fg-3",children:((s=e.agent)==null?void 0:s.trim())||"默认"}),a&&l.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] tabular-nums text-fg-5",children:a})]}),l.jsx("div",{className:"mt-0.5 truncate text-sm text-fg-2",children:((o=e.title)==null?void 0:o.trim())||"未命名运行"})]})})}function f_({sessions:e,onSelect:t}){const a=Ve(d=>d.issues),s=new Map(a.map(d=>[d.id,d])),o=new Map,u=[];for(const d of e)if(d.issueId&&s.has(d.issueId)){const f=o.get(d.issueId)??[];f.push(d),o.set(d.issueId,f)}else u.push(d);return l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col border-t border-line",children:[l.jsxs("div",{className:"flex items-center gap-1.5 border-b border-line px-3 py-3",children:[l.jsx(bA,{className:"h-3.5 w-3.5 text-fg-5"}),l.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-fg-4",children:"运行记录"}),l.jsx("span",{className:"ml-auto rounded-full bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:e.length})]}),l.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:e.length===0?l.jsx("p",{className:"px-2 py-4 text-center font-mono text-[10px] text-fg-6",children:"暂无运行记录"}):l.jsxs("div",{className:"space-y-3",children:[[...o.entries()].map(([d,f])=>{const m=s.get(d);return l.jsxs("div",{children:[l.jsxs("div",{className:"mb-1 flex items-center gap-1.5 px-1",children:[l.jsxs("span",{className:se("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-medium",m.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",m.number]}),l.jsx("span",{className:"min-w-0 truncate text-xs font-medium text-fg-3",children:m.title})]}),l.jsx("ul",{className:"space-y-0.5",children:f.map(h=>l.jsx(PE,{session:h,onSelect:()=>t(h.id)},h.id))})]},d)}),u.length>0&&l.jsxs("div",{children:[o.size>0&&l.jsx("div",{className:"mb-1 px-1",children:l.jsx("span",{className:"text-xs font-medium text-fg-5",children:"未关联 Issue"})}),l.jsx("ul",{className:"space-y-0.5",children:u.map(d=>l.jsx(PE,{session:d,onSelect:()=>t(d.id)},d.id))})]})]})})]})}function mB({rootIssue:e,childrenMap:t,currentId:a,onSelect:s,sessions:o,onSessionSelect:u}){const{total:d,closed:f}=dB(e.id,t),m=d===0?0:Math.round(f/d*100);return l.jsxs("div",{className:"flex w-full flex-col",children:[l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[l.jsxs("div",{className:"flex items-center gap-1.5 border-b border-line px-3 py-3",children:[l.jsx($3,{className:"h-3.5 w-3.5 text-fg-5"}),l.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-fg-4",children:"子任务树"})]}),d>0&&l.jsxs("div",{className:"border-b border-line px-3 py-2",children:[l.jsx("div",{className:"h-1 overflow-hidden rounded-full bg-elevated",children:l.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-emerald-400 to-blue-500 transition-all",style:{width:`${m}%`}})}),l.jsxs("p",{className:"mt-1 font-mono text-[10px] text-fg-6",children:[f," / ",d," completed"]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:l.jsx(d_,{issue:e,childrenMap:t,currentId:a,onSelect:s,depth:0})})]}),l.jsx(f_,{sessions:o,onSelect:u})]})}function hB({sessions:e,onSessionSelect:t}){return l.jsx("div",{className:"flex w-full flex-col",children:l.jsx(f_,{sessions:e,onSelect:t})})}function pB(){const[e,t]=_.useState("open"),[a,s]=_.useState("stray"),[o,u]=_.useState(!1),[d,f]=_.useState(""),[m,h]=_.useState(null),[b,g]=_.useState(null),[y,N]=_.useState(!1),[v,S]=_.useState(!1),[w,A]=_.useState(null),[R,I]=_.useState(null),[Y,B]=_.useState(null),[C,z]=hy(),W=Ve($=>$.issues),Q=Ve($=>$.syncing),j=Ve($=>$.syncIssues),ee=Ve($=>$.tags),ue=Ve($=>$.tagFilterMode),Z=Ve($=>$.cycleTagFilter),q=Ve($=>$.clearTagFilter),F=Ve($=>$.loadTags),D=Ve($=>$.milestones),P=Ve($=>$.selectedMilestoneId),ae=Ve($=>$.setMilestoneFilter),K=Ve($=>$.loadMilestones),k=Be($=>$.activeRepoId),U=Ie($=>$.sessions);_.useEffect(()=>{const $=C.get("issueId");$&&W.some(Re=>Re.id===$)&&(h($),z({},{replace:!0}))},[C,z,W]),_.useEffect(()=>{k&&(F(),K())},[k,F,K]);const ie=new Map;for(const $ of U)$.issueId&&!$.parentID&&ie.set($.issueId,(ie.get($.issueId)??0)+1);const M=new Set(W.filter($=>$.parentId).map($=>$.parentId)),ye=new Map;for(const $ of W)if($.parentId){const Re=ye.get($.parentId);Re?Re.push($):ye.set($.parentId,[$])}function re($){return $.parentId?"task":M.has($.id)?"epic":"stray"}const Ne=new Map(D.map($=>[$.id,$])),Pe=e==="all"?W:W.filter($=>$.state===e),tt=a==="all"?Pe:Pe.filter($=>re($)===a),et=ue.size===0?tt:tt.filter($=>{var mt;const Re=new Set(($.labels??[]).map(dn=>dn.name));for(const[dn,tn]of ue){const Dt=(mt=ee.find(mn=>mn.id===dn))==null?void 0:mt.name;if(Dt&&(tn==="include"&&!Re.has(Dt)||tn==="exclude"&&Re.has(Dt)))return!1}return!0}),vt=d.trim().toLowerCase(),en=vt?et.filter($=>`#${$.number} ${$.title}`.toLowerCase().includes(vt)):et,Hn=P?en.filter($=>$.milestoneId===P):en,aa=R?Hn.filter($=>$.authorLogin===R):Hn,xe=Y?aa.filter($=>($.assignees??[]).some(Re=>Re.login===Y)):aa,xt=(()=>{const $=new Map;for(const Re of W)Re.authorLogin&&!$.has(Re.authorLogin)&&$.set(Re.authorLogin,{login:Re.authorLogin,avatar:Re.authorAvatar});return[...$.values()]})(),nt=(()=>{const $=new Map;for(const Re of W)for(const mt of Re.assignees??[])$.has(mt.login)||$.set(mt.login,{login:mt.login,avatar:mt.avatar_url});return[...$.values()]})(),Fn=W.filter($=>$.state==="open").length,In=W.filter($=>$.state==="closed").length,ba=Pe.filter($=>re($)==="epic").length,Ia=Pe.filter($=>re($)==="task").length,nr=Pe.filter($=>re($)==="stray").length,Ha=W.find($=>$.id===m)??null,kr=Pn(),St=new Set;if(m&&(St.add(m),b)){St.add(b);const $=[...ye.get(b)??[]];for(let Re=0;Re<$.length;Re++){St.add($[Re].id);const mt=ye.get($[Re].id);mt&&$.push(...mt)}}const ar=U.filter($=>$.issueId&&St.has($.issueId)&&!$.parentID),me=Be(ta),Se=$=>{Ie.setState({activeSessionId:$}),kr(`/${encodeURIComponent(me)}/run`)},Fe=kT({onSwipeRight:()=>S(!0),onSwipeLeft:()=>N(!0),disabled:!m||v||y});return l.jsxs("div",{className:"flex min-h-0 flex-1",...Fe,children:[l.jsxs("div",{className:se("shrink-0 flex-col bg-surface",m?"hidden md:flex md:w-80 border-r border-line":"flex w-full"),children:[m?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-3",children:[l.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-fg-3",children:"Issues"}),k&&l.jsx("div",{className:"flex items-center gap-1",children:l.jsx("button",{type:"button",onClick:()=>void j(),disabled:Q,title:"同步",className:"flex h-7 w-7 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2 disabled:opacity-40",children:l.jsx(qs,{className:se("h-3.5 w-3.5",Q&&"animate-spin")})})})]}),o&&l.jsx(jE,{onDone:()=>u(!1)}),l.jsx("div",{className:"flex border-b border-line",children:LE.map(({key:$,label:Re})=>{const mt=$==="open"?Fn:$==="closed"?In:W.length;return l.jsxs("button",{type:"button",onClick:()=>t($),className:se("flex flex-1 items-center justify-center gap-1.5 py-2 text-xs font-medium transition-colors",e===$?"border-b-2 border-blue-500 text-blue-500":"text-fg-4 hover:text-fg-2"),children:[Re,l.jsx("span",{className:se("rounded-full px-1.5 py-0.5 font-mono text-[10px]",e===$?"bg-blue-500/10 text-blue-500":"bg-elevated text-fg-5"),children:mt})]},$)})}),l.jsx("div",{className:"border-b border-line px-3 py-2",children:l.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2 py-1",children:[l.jsx(us,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),l.jsx("input",{type:"text",value:d,onChange:$=>f($.target.value),placeholder:"搜索 issue...",className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),d&&l.jsx("button",{type:"button",onClick:()=>f(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:l.jsx(gt,{className:"h-3 w-3"})})]})})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-2 border-b border-line px-4 py-2.5",children:[l.jsx("span",{className:"shrink-0 text-sm font-semibold text-fg md:order-1",children:"Issues"}),k&&l.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1 md:order-last md:ml-0",children:[l.jsx("button",{type:"button",onClick:()=>void j(),disabled:Q,title:"同步 Issues",className:"flex h-8 w-8 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2 disabled:opacity-40",children:l.jsx(qs,{className:se("h-3.5 w-3.5",Q&&"animate-spin")})}),l.jsx("button",{type:"button",onClick:()=>u($=>!$),title:"新建 Issue",className:se("flex h-8 w-8 items-center justify-center rounded-md transition-colors",o?"bg-blue-600 text-white":"text-fg-4 hover:bg-elevated hover:text-fg-2"),children:l.jsx(Ra,{className:"h-3.5 w-3.5"})})]}),l.jsx("div",{className:"w-full md:order-2 md:w-auto",children:l.jsx("div",{className:"flex shrink-0 items-center rounded-lg bg-elevated/60 p-0.5",children:LE.map(({key:$,label:Re})=>{const mt=$==="open"?Fn:$==="closed"?In:W.length;return l.jsxs("button",{type:"button",onClick:()=>t($),className:se("flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",e===$?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-2"),children:[Re,l.jsx("span",{className:se("rounded-full px-1.5 py-0.5 font-mono text-[10px]",e===$?"bg-blue-500/10 text-blue-500":"text-fg-5"),children:mt})]},$)})})}),l.jsx("div",{className:"w-full md:order-5 md:w-auto md:min-w-0 md:flex-1 md:px-1",children:l.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2.5 py-1.5",children:[l.jsx(us,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),l.jsx("input",{type:"text",value:d,onChange:$=>f($.target.value),placeholder:"搜索 issue...",className:"min-w-0 flex-1 bg-transparent text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),d&&l.jsx("button",{type:"button",onClick:()=>f(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:l.jsx(gt,{className:"h-3 w-3"})})]})}),l.jsx("div",{className:"hidden md:order-3 md:mx-1 md:block md:h-4 md:w-px md:shrink-0 md:bg-line"}),l.jsxs("div",{className:"flex w-full gap-2 overflow-x-auto scrollbar-none md:order-4 md:w-auto md:overflow-visible",children:[l.jsxs("button",{type:"button",onClick:()=>A(w==="type"?null:"type"),className:se("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",w==="type"?"bg-elevated text-fg":a!=="all"?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["类型",a!=="all"&&l.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:a==="epic"?"Epic":a==="task"?"任务":"游离"}),l.jsx(ea,{className:se("h-3 w-3 transition-transform",w==="type"&&"rotate-180")})]}),l.jsxs("button",{type:"button",onClick:()=>A(w==="tag"?null:"tag"),className:se("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",w==="tag"?"bg-elevated text-fg":ue.size>0?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["标签",ue.size>0&&l.jsx("span",{className:"rounded-full bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:ue.size}),l.jsx(ea,{className:se("h-3 w-3 transition-transform",w==="tag"&&"rotate-180")})]}),l.jsxs("button",{type:"button",onClick:()=>A(w==="milestone"?null:"milestone"),className:se("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",w==="milestone"?"bg-elevated text-fg":P?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["Milestone",P&&(()=>{const $=D.find(Re=>Re.id===P);return $?l.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:$.title}):null})(),l.jsx(ea,{className:se("h-3 w-3 transition-transform",w==="milestone"&&"rotate-180")})]}),l.jsxs("button",{type:"button",onClick:()=>A(w==="author"?null:"author"),className:se("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",w==="author"?"bg-elevated text-fg":R?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["Author",R&&l.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:R}),l.jsx(ea,{className:se("h-3 w-3 transition-transform",w==="author"&&"rotate-180")})]}),l.jsxs("button",{type:"button",onClick:()=>A(w==="assignee"?null:"assignee"),className:se("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",w==="assignee"?"bg-elevated text-fg":Y?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["Assignee",Y&&l.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:Y}),l.jsx(ea,{className:se("h-3 w-3 transition-transform",w==="assignee"&&"rotate-180")})]})]})]}),w==="type"&&l.jsx("div",{className:"flex items-center gap-2 overflow-x-auto border-b border-line px-4 py-2",style:{scrollbarWidth:"none"},children:["epic","stray","task","all"].map($=>{const Re=$==="epic"?"Epic":$==="stray"?"游离":$==="task"?"任务":"全部",mt=$==="epic"?ba:$==="stray"?nr:$==="task"?Ia:Pe.length,dn=a===$;return l.jsxs("button",{type:"button",onClick:()=>s(dn&&$!=="all"?"all":$),className:se("flex shrink-0 items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-semibold transition-colors",dn?$==="epic"?"bg-amber-400/15 text-amber-400":$==="stray"?"bg-sky-400/15 text-sky-400":$==="task"?"bg-violet-400/15 text-violet-400":"bg-fg-6/20 text-fg-3":"bg-elevated/60 text-fg-5 hover:bg-elevated hover:text-fg-3"),children:[Re,l.jsx("span",{className:se("rounded-full px-1.5 py-0.5 font-mono text-[10px] font-medium",dn?"opacity-70":"text-fg-6"),children:mt})]},$)})}),w==="tag"&&l.jsx("div",{className:"flex items-center gap-2 overflow-x-auto border-b border-line px-4 py-2",style:{scrollbarWidth:"none"},children:ee.length===0?l.jsx("span",{className:"text-xs text-fg-5",children:"暂无标签"}):l.jsxs(l.Fragment,{children:[ee.map($=>{const Re=ue.get($.id);return l.jsxs("button",{type:"button",onClick:()=>Z($.id),className:se("shrink-0 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",Re==="include"?"ring-1 ring-current shadow-sm":Re==="exclude"?"opacity-90 line-through decoration-2":"opacity-50 hover:opacity-80"),style:Re==="exclude"?{backgroundColor:`#${$.color}10`,color:`#${$.color}`,boxShadow:`inset 0 0 0 1px color-mix(in srgb, #${$.color} 30%, transparent)`}:{backgroundColor:`#${$.color}18`,color:`#${$.color}`,boxShadow:Re==="include"?`inset 0 0 0 1px color-mix(in srgb, #${$.color} 50%, transparent)`:void 0},children:[Re==="exclude"&&l.jsx("span",{className:"mr-1 text-[10px]",children:"✕"}),$.name]},$.id)}),ue.size>0&&l.jsx("button",{type:"button",onClick:q,className:"shrink-0 rounded-md px-2 py-1 text-[10px] text-fg-5 transition-colors hover:bg-elevated hover:text-fg-3",children:"清除"})]})}),w==="milestone"&&l.jsx("div",{className:"flex items-center gap-2 overflow-x-auto border-b border-line px-4 py-2",style:{scrollbarWidth:"none"},children:D.length===0?l.jsx("span",{className:"text-xs text-fg-5",children:"暂无里程碑"}):l.jsxs(l.Fragment,{children:[D.map($=>{const Re=P===$.id;return l.jsxs("button",{type:"button",onClick:()=>ae(Re?null:$.id),className:se("shrink-0 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",Re?"bg-indigo-500/15 text-indigo-400 ring-1 ring-indigo-400/50 shadow-sm":"bg-elevated/60 text-fg-5 hover:bg-elevated hover:text-fg-3"),children:[$.title,$.state==="closed"&&l.jsx("span",{className:"ml-1 text-[10px] opacity-60",children:"✓"})]},$.id)}),P&&l.jsx("button",{type:"button",onClick:()=>ae(null),className:"shrink-0 rounded-md px-2 py-1 text-[10px] text-fg-5 transition-colors hover:bg-elevated hover:text-fg-3",children:"清除"})]})}),w==="author"&&l.jsx("div",{className:"flex items-center gap-2 overflow-x-auto border-b border-line px-4 py-2",style:{scrollbarWidth:"none"},children:xt.length===0?l.jsx("span",{className:"text-xs text-fg-5",children:"同步后可见作者"}):l.jsxs(l.Fragment,{children:[xt.map($=>l.jsxs("button",{type:"button",onClick:()=>I(R===$.login?null:$.login),className:se("flex shrink-0 items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",R===$.login?"bg-blue-500/15 text-blue-400 ring-1 ring-blue-500/30 shadow-sm":"bg-elevated/60 text-fg-5 hover:bg-elevated hover:text-fg-3"),children:[$.avatar&&l.jsx("img",{src:$.avatar,alt:"",className:"h-4 w-4 rounded-full"}),$.login]},$.login)),R&&l.jsx("button",{type:"button",onClick:()=>I(null),className:"shrink-0 rounded-md px-2 py-1 text-[10px] text-fg-5 transition-colors hover:bg-elevated hover:text-fg-3",children:"清除"})]})}),w==="assignee"&&l.jsx("div",{className:"flex items-center gap-2 overflow-x-auto border-b border-line px-4 py-2",style:{scrollbarWidth:"none"},children:nt.length===0?l.jsx("span",{className:"text-xs text-fg-5",children:"同步后可见指派人"}):l.jsxs(l.Fragment,{children:[nt.map($=>l.jsxs("button",{type:"button",onClick:()=>B(Y===$.login?null:$.login),className:se("flex shrink-0 items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",Y===$.login?"bg-blue-500/15 text-blue-400 ring-1 ring-blue-500/30 shadow-sm":"bg-elevated/60 text-fg-5 hover:bg-elevated hover:text-fg-3"),children:[$.avatar&&l.jsx("img",{src:$.avatar,alt:"",className:"h-4 w-4 rounded-full"}),$.login]},$.login)),Y&&l.jsx("button",{type:"button",onClick:()=>B(null),className:"shrink-0 rounded-md px-2 py-1 text-[10px] text-fg-5 transition-colors hover:bg-elevated hover:text-fg-3",children:"清除"})]})}),o&&l.jsx(jE,{onDone:()=>u(!1)})]}),l.jsx("div",{className:se("flex-1 overflow-y-auto",m?"px-2 py-2":"px-3 py-3"),children:k?xe.length===0?l.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:W.length===0?"点击 ↻ 同步 Issues":"无匹配 Issue"}):l.jsx("ul",{className:se(m?"space-y-0.5":"space-y-1"),children:xe.map($=>m?l.jsx(BE,{issue:$,sessionCount:ie.get($.id)??0,isActive:m===$.id,isEpic:re($)==="epic",milestone:$.milestoneId?Ne.get($.milestoneId):void 0,onSelect:()=>{h($.id),g(re($)==="epic"?$.id:null)}},$.id):l.jsx(uB,{issue:$,sessionCount:ie.get($.id)??0,isEpic:re($)==="epic",milestone:$.milestoneId?Ne.get($.milestoneId):void 0,onSelect:()=>{h($.id),g(re($)==="epic"?$.id:null)}},$.id))}):l.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:"请先选择一个仓库"})})]}),m&&l.jsx(Ch,{side:"left",open:v,onClose:()=>S(!1),children:l.jsxs("div",{className:"flex h-full flex-col",children:[l.jsx("div",{className:"border-b border-line px-3 py-3",children:l.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-fg-3",children:"Issues"})}),l.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:xe.length===0?l.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:"无匹配 Issue"}):l.jsx("ul",{className:"space-y-0.5",children:xe.map($=>l.jsx(BE,{issue:$,sessionCount:ie.get($.id)??0,isActive:m===$.id,isEpic:re($)==="epic",milestone:$.milestoneId?Ne.get($.milestoneId):void 0,onSelect:()=>{h($.id),g(re($)==="epic"?$.id:null),S(!1)}},$.id))})})]})}),m&&l.jsx("div",{className:"relative flex min-w-0 flex-1 flex-col bg-term",children:Ha?l.jsxs(l.Fragment,{children:[l.jsx(cB,{issue:Ha,milestone:Ha.milestoneId?Ne.get(Ha.milestoneId):void 0,onBack:()=>{h(null),g(null),N(!1)},onClose:()=>{h(null),g(null),N(!1)},onToggleSidebar:()=>N($=>!$)}),y&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"absolute inset-0 z-10 bg-black/30",onClick:()=>N(!1)}),l.jsxs("div",{className:"absolute right-0 top-0 bottom-0 z-20 flex w-[280px] flex-col border-l border-line bg-surface shadow-xl",children:[l.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-line px-3 py-2.5",children:[l.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-fg-4",children:b?"子任务树 & 运行记录":"运行记录"}),l.jsx("button",{type:"button",onClick:()=>N(!1),className:"flex h-6 w-6 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:l.jsx(gt,{className:"h-4 w-4"})})]}),l.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:b?(()=>{const $=W.find(Re=>Re.id===b);return $?l.jsx(mB,{rootIssue:$,childrenMap:ye,currentId:m,onSelect:Re=>{h(Re),N(!1)},sessions:ar,onSessionSelect:Se}):null})():l.jsx(hB,{sessions:ar,onSessionSelect:Se})})]})]})]}):l.jsx("div",{className:"flex flex-1 items-center justify-center",children:l.jsx("p",{className:"font-mono text-xs text-fg-5",children:"Issue 未找到"})})})]})}const UE=[{key:"open",label:"开放"},{key:"merged",label:"已合并"},{key:"closed",label:"已关闭"},{key:"all",label:"全部"}];function m_(e){const t=e<1e12?e*1e3:e,a=Date.now()-t;return a<6e4?"刚刚":a<36e5?`${Math.floor(a/6e4)}分钟前`:a<864e5?`${Math.floor(a/36e5)}小时前`:a<2592e6?`${Math.floor(a/864e5)}天前`:new Date(t).toLocaleDateString("zh-CN",{month:"short",day:"numeric"})}function gB(e){return e==="merged"?"bg-purple-500/15 text-purple-400":e==="closed"?"bg-red-500/15 text-red-400":"bg-emerald-500/15 text-emerald-400"}function bB({pr:e,isActive:t,onSelect:a}){return l.jsx("li",{children:l.jsxs("button",{type:"button",onClick:a,className:se("group flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-left transition-colors",t?"border-l-2 border-blue-500 bg-elevated/80":"border-l-2 border-transparent hover:bg-elevated/50"),children:[l.jsx("span",{className:se("flex h-10 w-10 shrink-0 items-center justify-center rounded-full font-mono text-sm font-bold ring-1",e.state==="merged"?"bg-gradient-to-br from-purple-500/20 to-purple-500/5 text-purple-400 ring-purple-500/25":e.state==="closed"?"bg-gradient-to-br from-red-500/20 to-red-500/5 text-red-400 ring-red-500/25":"bg-gradient-to-br from-emerald-500/20 to-emerald-500/5 text-emerald-400 ring-emerald-500/25"),children:e.number}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[e.draft===1&&l.jsx("span",{className:"shrink-0 rounded px-1 py-0.5 text-[9px] font-bold bg-fg-6/15 text-fg-4",children:"DRAFT"}),l.jsx("span",{className:"min-w-0 text-xs font-medium text-fg-2 group-hover:text-fg",children:e.title})]}),l.jsxs("div",{className:"mt-0.5 truncate font-mono text-[10px] text-fg-6",children:[e.headBranch," → ",e.baseBranch]}),e.labels&&e.labels.length>0&&l.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:e.labels.map(s=>l.jsx("span",{className:"rounded px-1 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${s.color}20`,color:`#${s.color}`},children:s.name},s.id))})]})]})})}function xB({pr:e,onSelect:t}){return l.jsx("li",{children:l.jsxs("button",{type:"button",onClick:t,className:"group flex w-full items-center gap-3 border-b border-line px-4 py-3 text-left transition-colors hover:bg-elevated/50",children:[l.jsx("span",{className:se("flex h-10 w-10 shrink-0 items-center justify-center rounded-full font-mono text-sm font-bold ring-1",e.state==="merged"?"bg-gradient-to-br from-purple-500/20 to-purple-500/5 text-purple-400 ring-purple-500/25":e.state==="closed"?"bg-gradient-to-br from-red-500/20 to-red-500/5 text-red-400 ring-red-500/25":"bg-gradient-to-br from-emerald-500/20 to-emerald-500/5 text-emerald-400 ring-emerald-500/25"),children:e.number}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[e.draft===1&&l.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[9px] font-bold tracking-wide bg-fg-6/15 text-fg-4",children:"DRAFT"}),l.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-fg-2 group-hover:text-fg",children:e.title}),e.mergeable==="false"&&e.state==="open"&&l.jsxs("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-semibold bg-red-500/15 text-red-400",children:[l.jsx(kn,{className:"inline h-3 w-3 -mt-px"})," Conflict"]}),e.assignees&&e.assignees.length>0&&l.jsx("div",{className:"hidden shrink-0 items-center -space-x-1.5 sm:flex",children:e.assignees.slice(0,3).map(a=>l.jsx("img",{src:a.avatar_url,alt:a.login,title:a.login,className:"h-5 w-5 rounded-full ring-2 ring-surface"},a.login))})]}),l.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1",children:[l.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-fg-5",children:[e.headBranch," → ",e.baseBranch]}),l.jsx("span",{className:"text-fg-6",children:"·"}),e.authorLogin&&l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"shrink-0 text-[11px] text-fg-5",title:e.authorLogin,children:[e.authorAvatar&&l.jsx("img",{src:e.authorAvatar,alt:"",className:"mr-1 inline-block h-3.5 w-3.5 rounded-full align-text-bottom"}),e.authorLogin]}),l.jsx("span",{className:"text-fg-6",children:"·"})]}),l.jsx("span",{className:"shrink-0 text-[11px] text-fg-6",children:m_(e.createdAt)}),e.labels&&e.labels.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-fg-6",children:"·"}),e.labels.map(a=>l.jsx("span",{className:"rounded px-1.5 py-0.5 text-[11px] font-medium",style:{backgroundColor:`#${a.color}20`,color:`#${a.color}`},children:a.name},a.id))]})]})]})]})})}function EB({issue:e,linked:t,onToggle:a}){return l.jsx("li",{children:l.jsx("button",{type:"button",onClick:a,className:se("group flex w-full items-start gap-2 rounded-md px-3 py-2.5 text-left transition-colors",t?"border-l-2 border-emerald-500 bg-emerald-500/5":"border-l-2 border-transparent hover:bg-elevated/50"),children:l.jsx("div",{className:"min-w-0 flex-1",children:l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsxs("span",{className:se("shrink-0 rounded px-1.5 py-0.5 font-mono text-xs font-medium",e.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",e.number]}),l.jsx("span",{className:"min-w-0 truncate text-sm font-medium text-fg-2",children:e.title}),t&&l.jsx(Vc,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-emerald-400"})]})})})})}function yB({pr:e,onBack:t,onClose:a,onEnterMatch:s}){var B;const o=Be(C=>C.activeRepoId),u=Be(ta),[d,f]=_.useState(!1),[m,h]=_.useState([]),[b,g]=_.useState(!1),[y,N]=_.useState([]),[v,S]=_.useState(!1),w=Pn(),A=Jn(C=>C.unlinkIssue);_.useEffect(()=>{o&&(g(!0),dw(o,e.number).then(h).catch(()=>h([])).finally(()=>g(!1)))},[o,e.number]),_.useEffect(()=>{o&&Py(o,e.number).then(N).catch(()=>N([]))},[o,e.number]);const R=async C=>{if(!(d||!o)){f(!0);try{if(await ow(o,e.number),C&&y.length>0){const z=y.filter(W=>W.state==="open");await Promise.all(z.map(W=>By(o,W.number,{state:"closed"}))),N(W=>W.map(Q=>Q.state==="open"?{...Q,state:"closed"}:Q)),Ve.getState().loadIssues(),Ut.getState().addToast(`PR #${e.number} 合入成功,已关闭 ${z.length} 个 Issue`,"success")}else Ut.getState().addToast(`PR #${e.number} 合入成功`,"success");Jn.getState().loadPulls()}catch(z){let W="合入失败";if(z instanceof Za)try{W=JSON.parse(z.message).error??W}catch{W=z.message}Ut.getState().addToast(W,"error")}finally{f(!1)}}},I=async C=>{await A(e.number,C)&&N(W=>W.filter(Q=>Q.number!==C))},Y=C=>{const z=new Date(C);return z.toLocaleDateString("zh-CN",{month:"short",day:"numeric"})+" "+z.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"})};return l.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[l.jsxs("header",{className:"flex flex-col gap-2 border-b border-line px-4 py-3 md:flex-row md:items-center md:gap-3 md:px-6",children:[l.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[l.jsx("button",{type:"button",onClick:t,"aria-label":"返回列表",className:"-ml-1 shrink-0 rounded-md p-1.5 text-fg-3 transition-colors hover:bg-elevated hover:text-fg md:hidden",children:l.jsx(Kh,{className:"h-5 w-5"})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[l.jsxs("span",{className:se("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",gB(e.state)),children:["#",e.number," ",e.state]}),e.draft===1&&l.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-bold bg-fg-6/15 text-fg-4",children:"DRAFT"}),e.mergeable==="false"&&e.state==="open"&&l.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-semibold bg-red-500/15 text-red-400",children:"Conflict"}),(B=e.labels)==null?void 0:B.map(C=>l.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${C.color}20`,color:`#${C.color}`},children:C.name},C.id))]}),l.jsx("h2",{className:"mt-1 text-base font-semibold text-fg",children:e.title}),l.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 text-xs text-fg-4",children:[l.jsxs("span",{className:"flex min-w-0 items-center gap-1 font-mono text-[11px] text-fg-5",children:[l.jsx(Eo,{className:"h-3.5 w-3.5 shrink-0"}),l.jsxs("span",{className:"truncate",children:[e.headBranch," → ",e.baseBranch]})]}),e.authorLogin&&l.jsxs("span",{className:"flex items-center gap-1.5",children:[e.authorAvatar&&l.jsx("img",{src:e.authorAvatar,alt:"",className:"h-4 w-4 rounded-full"}),e.authorLogin]}),e.mergedAt&&l.jsxs("span",{className:"text-purple-400",children:["合并于 ",m_(e.mergedAt)]})]})]})]}),l.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:[e.htmlUrl&&l.jsxs("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 font-mono text-xs text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[l.jsx(_c,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"hidden sm:inline",children:"源站"})]}),l.jsxs("button",{type:"button",onClick:s,className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 text-xs text-fg-3 transition-colors hover:border-blue-500/50 hover:text-blue-400",children:[l.jsx(Vc,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"hidden sm:inline",children:"关联 Issue"})]}),e.state==="open"&&l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",disabled:d||e.mergeable==="false",onClick:()=>void R(!1),className:"flex h-8 items-center gap-1.5 rounded-md border border-emerald-500/30 px-2.5 text-xs font-medium text-emerald-400 transition-colors hover:border-emerald-500/60 hover:bg-emerald-500/10 disabled:opacity-40",children:[l.jsx(vc,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"hidden sm:inline",children:"合入"})]}),y.some(C=>C.state==="open")&&l.jsxs("button",{type:"button",disabled:d||e.mergeable==="false",onClick:()=>void R(!0),className:"flex h-8 items-center gap-1.5 rounded-md bg-blue-600 px-3 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[l.jsx(vc,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"hidden sm:inline",children:"合入并关闭 Issues"})]})]}),a&&l.jsx("button",{type:"button",onClick:a,title:"关闭详情",className:"hidden h-8 w-8 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-2 md:flex",children:l.jsx(gt,{className:"h-4 w-4"})})]})]}),l.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:l.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-6 md:px-6",children:[y.length>0&&l.jsxs("div",{className:"mb-6 rounded-lg border border-line bg-elevated/30 px-4 py-3",children:[l.jsxs("h3",{className:"mb-2 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-fg-4",children:[l.jsx(xo,{className:"h-3.5 w-3.5"}),"关联 Issues (",y.length,")"]}),l.jsx("div",{className:"space-y-1.5",children:y.map(C=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{type:"button",onClick:()=>w(`/${encodeURIComponent(u)}/issues?issueId=${encodeURIComponent(C.id)}`),className:"flex min-w-0 flex-1 items-center gap-2 rounded-md px-1 py-0.5 transition-colors hover:bg-elevated/60",children:[l.jsxs("span",{className:se("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-medium",C.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",C.number]}),l.jsx("span",{className:"min-w-0 flex-1 truncate text-left text-sm text-fg-2",children:C.title})]}),l.jsx("button",{type:"button",onClick:()=>void I(C.number),title:"取消关联",className:"shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:bg-red-500/10 hover:text-red-400",children:l.jsx(xy,{className:"h-3.5 w-3.5"})})]},C.id))})]}),(e.commitCount!=null||e.additions!=null)&&l.jsxs("div",{className:"mb-6 rounded-lg border border-line bg-elevated/30 px-4 py-3",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-fg-3",children:[e.commitCount!=null&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(f3,{className:"h-3.5 w-3.5 text-fg-5"}),l.jsx("span",{className:"font-medium",children:e.commitCount})," 次提交"]}),e.changedFilesCount!=null&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(Vh,{className:"h-3.5 w-3.5 text-fg-5"}),l.jsx("span",{className:"font-medium",children:e.changedFilesCount})," 个文件"]}),e.additions!=null&&l.jsxs("span",{className:"flex items-center gap-1 text-emerald-400",children:[l.jsx(Ra,{className:"h-3 w-3"}),l.jsx("span",{className:"font-mono font-medium",children:e.additions})]}),e.deletions!=null&&l.jsxs("span",{className:"flex items-center gap-1 text-red-400",children:[l.jsx(B3,{className:"h-3 w-3"}),l.jsx("span",{className:"font-mono font-medium",children:e.deletions})]})]}),e.diffStats&&e.diffStats.length>0&&l.jsxs("div",{className:"mt-3 border-t border-line pt-3",children:[l.jsxs("button",{type:"button",onClick:()=>S(C=>!C),className:"flex w-full items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-fg-4 transition-colors hover:text-fg-2",children:[v?l.jsx(ea,{className:"h-3.5 w-3.5"}):l.jsx(Gc,{className:"h-3.5 w-3.5"}),"变更文件 (",e.diffStats.length,")"]}),v&&l.jsx("div",{className:"mt-2 space-y-0.5",children:e.diffStats.map(C=>l.jsxs("div",{className:"flex items-center gap-2 rounded px-2 py-1 text-xs hover:bg-elevated/50",children:[l.jsx("span",{className:se("w-14 shrink-0 rounded px-1 py-0.5 text-center font-mono text-[10px] font-medium",C.status==="added"?"bg-emerald-500/15 text-emerald-400":C.status==="removed"?"bg-red-500/15 text-red-400":"bg-blue-500/15 text-blue-400"),children:C.status==="added"?"新增":C.status==="removed"?"删除":C.status==="renamed"?"重命名":"修改"}),l.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-fg-3",title:C.filename,children:C.filename}),l.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-emerald-400",children:["+",C.additions]}),l.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-red-400",children:["-",C.deletions]})]},C.filename))})]})]}),e.body?l.jsx("div",{className:"markdown-body leading-relaxed",children:l.jsx(cs,{remarkPlugins:[ds],rehypePlugins:[go],children:e.body})}):l.jsx("p",{className:"py-10 text-center font-mono text-xs text-fg-5",children:"该 PR 没有描述内容"}),b?l.jsx("p",{className:"mt-8 text-center font-mono text-xs text-fg-6",children:"加载评论…"}):m.length>0&&l.jsxs("div",{className:"mt-8 border-t border-line pt-6",children:[l.jsxs("h3",{className:"mb-4 text-xs font-semibold uppercase tracking-wider text-fg-4",children:["评论 (",m.length,")"]}),l.jsx("div",{className:"space-y-4",children:m.map(C=>l.jsxs("div",{className:"rounded-lg border border-line bg-elevated/40 px-4 py-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("img",{src:C.user.avatar_url,alt:C.user.login,className:"h-5 w-5 rounded-full"}),l.jsx("span",{className:"text-xs font-semibold text-fg-2",children:C.user.login}),l.jsx("span",{className:"text-[10px] text-fg-6",children:Y(C.created_at)})]}),l.jsx("div",{className:"markdown-body mt-2 text-sm leading-relaxed text-fg-3",children:l.jsx(cs,{remarkPlugins:[ds],rehypePlugins:[go],children:C.body})})]},C.id))})]})]})})]})}function NB(){const[e,t]=_.useState("open"),[a,s]=_.useState(""),[o,u]=_.useState(null),[d,f]=_.useState(""),[m,h]=hy(),b=Jn(P=>P.pulls),g=Jn(P=>P.syncing),y=Jn(P=>P.syncPulls),N=Jn(P=>P.matchingPrId),v=Jn(P=>P.enterMatchMode),S=Jn(P=>P.exitMatchMode),w=Jn(P=>P.linkIssue),A=Be(P=>P.activeRepoId),R=Ve(P=>P.issues);_.useEffect(()=>{const P=m.get("prId");P&&b.some(ae=>ae.id===P)&&(u(P),h({},{replace:!0}))},[m,h,b]);const I=N?b.find(P=>P.id===N)??null:null,[Y,B]=_.useState(new Set);_.useEffect(()=>{if(!A||!I){B(new Set);return}Py(A,I.number).then(P=>B(new Set(P.map(ae=>ae.id)))).catch(()=>B(new Set))},[A,I]);const C=async P=>{if(!I)return;Y.has(P.id)?await Jn.getState().unlinkIssue(I.number,P.number)&&B(k=>{const U=new Set(k);return U.delete(P.id),U}):await w(I.number,P.number)&&B(k=>new Set(k).add(P.id))},z=b.filter(P=>P.state==="open").length,W=b.filter(P=>P.state==="merged").length,Q=b.filter(P=>P.state==="closed").length,j=e==="all"?b:b.filter(P=>P.state===e),ee=a.trim().toLowerCase(),ue=ee?j.filter(P=>`#${P.number} ${P.title} ${P.headBranch} ${P.baseBranch}`.toLowerCase().includes(ee)):j,Z=d.trim().toLowerCase(),q=Z?R.filter(P=>`#${P.number} ${P.title}`.toLowerCase().includes(Z)):R,F=b.find(P=>P.id===o)??null,D=I??F;return l.jsxs("div",{className:"flex min-h-0 flex-1",children:[l.jsxs("div",{className:se("shrink-0 flex-col bg-surface",D?"hidden md:flex md:w-80 border-r border-line":"flex w-full"),children:[N?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-3",children:[l.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-blue-400",children:"选择 Issue 关联"}),l.jsxs("button",{type:"button",onClick:S,className:"flex h-7 items-center gap-1 rounded-md px-2 text-xs text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:[l.jsx(gt,{className:"h-3.5 w-3.5"}),"完成"]})]}),l.jsx("div",{className:"border-b border-line px-3 py-2",children:l.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2 py-1",children:[l.jsx(us,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),l.jsx("input",{type:"text",value:d,onChange:P=>f(P.target.value),placeholder:"搜索 issue...",className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),d&&l.jsx("button",{type:"button",onClick:()=>f(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:l.jsx(gt,{className:"h-3 w-3"})})]})}),l.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:q.length===0?l.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:R.length===0?"暂无 Issue,请先同步":"无匹配 Issue"}):l.jsx("ul",{className:"space-y-0.5",children:q.map(P=>l.jsx(EB,{issue:P,linked:Y.has(P.id),onToggle:()=>void C(P)},P.id))})})]}):D?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-3",children:[l.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-fg-3",children:"Pull Requests"}),A&&l.jsx("button",{type:"button",onClick:()=>void y(),disabled:g,title:"同步",className:"flex h-7 w-7 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2 disabled:opacity-40",children:l.jsx(qs,{className:se("h-3.5 w-3.5",g&&"animate-spin")})})]}),l.jsx("div",{className:"flex border-b border-line",children:UE.map(({key:P,label:ae})=>{const K=P==="open"?z:P==="merged"?W:P==="closed"?Q:b.length;return l.jsxs("button",{type:"button",onClick:()=>t(P),className:se("flex flex-1 items-center justify-center gap-1.5 py-2 text-xs font-medium transition-colors",e===P?"border-b-2 border-blue-500 text-blue-500":"text-fg-4 hover:text-fg-2"),children:[ae,l.jsx("span",{className:se("rounded-full px-1.5 py-0.5 font-mono text-[10px]",e===P?"bg-blue-500/10 text-blue-500":"bg-elevated text-fg-5"),children:K})]},P)})}),l.jsx("div",{className:"border-b border-line px-3 py-2",children:l.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2 py-1",children:[l.jsx(us,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),l.jsx("input",{type:"text",value:a,onChange:P=>s(P.target.value),placeholder:"搜索 PR...",className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),a&&l.jsx("button",{type:"button",onClick:()=>s(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:l.jsx(gt,{className:"h-3 w-3"})})]})})]}):l.jsx(l.Fragment,{children:l.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-2 border-b border-line px-4 py-2.5",children:[l.jsx("span",{className:"shrink-0 text-sm font-semibold text-fg md:order-1",children:"Pull Requests"}),l.jsx("button",{type:"button",onClick:()=>void y(),disabled:g||!A,title:"同步 PR",className:"ml-auto flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-2 disabled:opacity-40 md:order-last md:ml-0",children:l.jsx(qs,{className:se("h-4 w-4",g&&"animate-spin")})}),l.jsx("div",{className:"w-full md:order-2 md:w-auto",children:l.jsx("div",{className:"flex shrink-0 items-center rounded-lg bg-elevated/60 p-0.5",children:UE.map(({key:P,label:ae})=>{const K=P==="open"?z:P==="merged"?W:P==="closed"?Q:b.length;return l.jsxs("button",{type:"button",onClick:()=>t(P),className:se("flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",e===P?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-2"),children:[ae,l.jsx("span",{className:se("rounded-full px-1.5 py-0.5 font-mono text-[10px]",e===P?"bg-blue-500/10 text-blue-500":"text-fg-5"),children:K})]},P)})})}),l.jsx("div",{className:"w-full md:order-3 md:w-auto md:min-w-0 md:flex-1 md:px-1",children:l.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2.5 py-1.5",children:[l.jsx(us,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),l.jsx("input",{type:"text",value:a,onChange:P=>s(P.target.value),placeholder:"搜索 PR...",className:"min-w-0 flex-1 bg-transparent text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),a&&l.jsx("button",{type:"button",onClick:()=>s(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:l.jsx(gt,{className:"h-3 w-3"})})]})})]})}),!N&&l.jsx("div",{className:se("flex-1 overflow-y-auto",D?"px-2 py-2":"px-3 py-3"),children:A?ue.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-fg-5",children:[l.jsx(Eo,{className:"h-8 w-8"}),l.jsx("p",{className:"font-mono text-xs",children:b.length===0?"点击 ↻ 同步 PR":"没有匹配的 PR"})]}):l.jsx("ul",{className:se(D?"space-y-0.5":"space-y-1"),children:ue.map(P=>D?l.jsx(bB,{pr:P,isActive:P.id===(o??N),onSelect:()=>u(P.id)},P.id):l.jsx(xB,{pr:P,onSelect:()=>u(P.id)},P.id))}):l.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:"请先选择一个仓库"})})]}),D?l.jsx(yB,{pr:D,onBack:()=>{u(null),N&&S()},onClose:()=>{u(null),N&&S()},onEnterMatch:()=>v(D.id)},`${D.id}-${N??"view"}`):l.jsx("div",{className:"hidden flex-1 items-center justify-center md:flex",children:l.jsxs("div",{className:"text-center text-fg-5",children:[l.jsx(Eo,{className:"mx-auto h-12 w-12 opacity-20"}),l.jsx("p",{className:"mt-3 font-mono text-xs",children:"选择一个 PR 查看详情"})]})})]})}const TB=["Sisyphus - ultraworker","Prometheus - Plan Builder","Atlas - Plan Executor"],_B="pinned_models",Ps="__system_prompt__",HE=[{bg:"bg-blue-500/15",text:"text-blue-500"},{bg:"bg-purple-500/15",text:"text-purple-500"},{bg:"bg-emerald-500/15",text:"text-emerald-500"},{bg:"bg-amber-500/15",text:"text-amber-500"},{bg:"bg-rose-500/15",text:"text-rose-500"},{bg:"bg-cyan-500/15",text:"text-cyan-500"},{bg:"bg-indigo-500/15",text:"text-indigo-500"},{bg:"bg-orange-500/15",text:"text-orange-500"}];function vB(e){const t=e.trim(),a=t.charCodeAt(0)||0;return{...HE[a%HE.length],initial:(t.charAt(0)||"?").toUpperCase()}}function SB({agent:e,memoryCount:t,sessionCount:a,onClick:s,onDelete:o}){const[u,d]=_.useState(!1),f=e.isSystem===1,m=vB(e.name);return l.jsxs("div",{className:"flex cursor-pointer flex-col rounded-xl border border-line bg-surface transition-colors hover:border-fg-6/60",onClick:s,children:[l.jsxs("div",{className:"flex items-start gap-3 p-4 pb-3",children:[l.jsx("div",{className:se("flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-sm font-semibold",m.bg,m.text),children:m.initial}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"truncate text-sm font-semibold text-fg",children:e.name}),f&&l.jsx("span",{className:"shrink-0 rounded bg-amber-500/10 px-1.5 py-0.5 text-[10px] font-medium text-amber-400",children:"系统"}),e.repoId&&l.jsx("span",{className:"shrink-0 rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] font-medium text-blue-400",children:"repo"})]}),l.jsxs("p",{className:"mt-0.5 text-[11px] text-fg-4",children:[l.jsx("span",{className:"font-mono",children:e.baseAgent}),e.model&&l.jsxs("span",{className:"ml-1.5 text-fg-5",children:["· ",e.model]})]}),e.description&&l.jsx("p",{className:"mt-1 text-xs text-fg-5 line-clamp-2",children:e.description})]})]}),l.jsxs("div",{className:"flex items-center gap-4 border-t border-line/60 px-4 py-2.5",children:[l.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-fg-5",children:[l.jsx(Fi,{className:"h-3 w-3"}),l.jsxs("span",{children:["记忆 ",t]})]}),l.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-fg-5",children:[l.jsx(Kc,{className:"h-3 w-3"}),l.jsxs("span",{children:["会话 ",a]})]}),l.jsx("div",{className:"flex-1"}),!f&&!u&&l.jsx("button",{type:"button",onClick:h=>{h.stopPropagation(),d(!0)},title:"删除",className:"rounded p-1 text-fg-5 opacity-0 transition-opacity hover:text-red-400 group-hover:opacity-100 [.group:hover_&]:opacity-100",children:l.jsx(wr,{className:"h-3.5 w-3.5"})}),u&&l.jsxs("div",{className:"flex items-center gap-0.5",onClick:h=>h.stopPropagation(),children:[l.jsx("button",{type:"button",onClick:o,className:"rounded p-1 text-red-400 hover:bg-red-500/10",children:l.jsx(Cn,{className:"h-3.5 w-3.5"})}),l.jsx("button",{type:"button",onClick:()=>d(!1),className:"rounded p-1 text-fg-4 hover:bg-elevated",children:l.jsx(gt,{className:"h-3.5 w-3.5"})})]})]})]})}function AB({initial:e,availableFragments:t,onSave:a,onCancel:s}){const o=Be(Z=>Z.activeRepoId),[u,d]=_.useState((e==null?void 0:e.name)??""),[f,m]=_.useState((e==null?void 0:e.description)??""),[h,b]=_.useState((e==null?void 0:e.baseAgent)??"Sisyphus - ultraworker"),[g,y]=_.useState((e==null?void 0:e.model)??""),[N,v]=_.useState((e==null?void 0:e.systemPrompt)??""),[S,w]=_.useState(!1),[A,R]=_.useState(!1),[I,Y]=_.useState([]);_.useEffect(()=>{if(!o){Y([]);return}let Z=!1;return(async()=>{try{const[q,F]=await Promise.all([ko(),Co(o)]);if(Z)return;const D=q[_B],P=D?JSON.parse(D):[];Y(P.length>0?F.filter(ae=>P.includes(ae.id)):[])}catch{Z||Y([])}})(),()=>{Z=!0}},[o]);const[B,C]=_.useState(()=>{const Z=(e==null?void 0:e.fragments.map(P=>P.id))??[],q=(e==null?void 0:e.systemPromptPosition)??-1,F=q>=0&&q<=Z.length?q:Z.length,D=[...Z];return D.splice(F,0,Ps),D}),z=Z=>{C(q=>{if(q.includes(Z))return q.filter(P=>P!==Z);const F=q.indexOf(Ps),D=[...q];return D.splice(F>=0?F:D.length,0,Z),D})},W=(Z,q)=>{const F=Z+q;F<0||F>=B.length||C(D=>{const P=[...D];return[P[Z],P[F]]=[P[F],P[Z]],P})},Q=B.filter(Z=>Z!==Ps),j=(()=>{const Z=B.indexOf(Ps);return Z<0?-1:B.slice(0,Z).filter(q=>q!==Ps).length})(),ee=B.map(Z=>{var q;return Z===Ps?N:(q=t.find(F=>F.id===Z))==null?void 0:q.content}).filter(Boolean).join(`
508
+
509
+ ---
510
+
511
+ `),ue=async()=>{if(!(!u.trim()||!h)){R(!0);try{await a({name:u.trim(),description:f.trim()||void 0,baseAgent:h,model:g.trim()||void 0,systemPrompt:N,systemPromptPosition:j,fragmentIds:Q})}finally{R(!1)}}};return l.jsxs("div",{className:"space-y-3 rounded-xl border border-line bg-surface p-5",children:[l.jsxs("div",{className:"flex gap-3",children:[l.jsxs("label",{className:"flex-1",children:[l.jsx("span",{className:"text-xs font-medium text-fg-3",children:"名称"}),l.jsx("input",{type:"text",value:u,onChange:Z=>d(Z.target.value),placeholder:"代码审查员",className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-1.5 text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),l.jsxs("label",{className:"w-36",children:[l.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Base Agent"}),l.jsx("select",{value:h,onChange:Z=>b(Z.target.value),className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-1.5 text-sm text-fg focus:border-blue-500 focus:outline-none",children:TB.map(Z=>l.jsx("option",{value:Z,children:Z},Z))})]})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-fg-3",children:"描述(可选)"}),l.jsx("input",{type:"text",value:f,onChange:Z=>m(Z.target.value),placeholder:"一句话描述这个 Agent 的用途",className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-1.5 text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-xs font-medium text-fg-3",children:"模型(可选)"}),l.jsxs("select",{value:g,onChange:Z=>y(Z.target.value),className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-1.5 font-mono text-sm text-fg focus:border-blue-500 focus:outline-none",children:[l.jsx("option",{value:"",children:"默认模型"}),I.map(Z=>l.jsx("option",{value:Z.id,children:Z.name||Z.id},Z.id))]}),I.length===0&&l.jsx("p",{className:"mt-1 text-[11px] text-fg-5",children:"在设置的「模型」中勾选常用模型后可选择。"})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-xs font-medium text-fg-3",children:"提示词组合"}),l.jsx("p",{className:"mt-0.5 text-[11px] text-fg-5",children:"排序片段与补充指令的拼接顺序。"}),l.jsxs("div",{className:"mt-1.5 space-y-1",children:[B.map((Z,q)=>{if(Z===Ps)return l.jsxs("div",{className:"flex items-center gap-2 rounded border border-amber-500/30 bg-amber-500/5 px-2 py-1",children:[l.jsxs("div",{className:"flex flex-col",children:[l.jsx("button",{type:"button",onClick:()=>W(q,-1),disabled:q===0,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▲"}),l.jsx("button",{type:"button",onClick:()=>W(q,1),disabled:q===B.length-1,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▼"})]}),l.jsx("span",{className:"flex-1 truncate text-xs font-medium text-amber-400",children:"✎ 补充指令"})]},Z);const F=t.find(D=>D.id===Z);return F?l.jsxs("div",{className:"flex items-center gap-2 rounded border border-blue-500/30 bg-blue-500/5 px-2 py-1",children:[l.jsxs("div",{className:"flex flex-col",children:[l.jsx("button",{type:"button",onClick:()=>W(q,-1),disabled:q===0,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▲"}),l.jsx("button",{type:"button",onClick:()=>W(q,1),disabled:q===B.length-1,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▼"})]}),l.jsx("span",{className:"flex-1 truncate text-xs text-fg",children:F.name}),l.jsx("button",{type:"button",onClick:()=>z(Z),className:"text-fg-5 hover:text-red-400",children:l.jsx(gt,{className:"h-3 w-3"})})]},Z):null}),t.filter(Z=>!Q.includes(Z.id)).length>0&&l.jsxs("select",{value:"",onChange:Z=>{Z.target.value&&z(Z.target.value)},className:"w-full rounded border border-dashed border-line bg-base px-2 py-1 text-xs text-fg-4 focus:border-blue-500 focus:outline-none",children:[l.jsx("option",{value:"",children:"+ 添加片段…"}),t.filter(Z=>!Q.includes(Z.id)).map(Z=>l.jsx("option",{value:Z.id,children:Z.name},Z.id))]})]})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-fg-3",children:"补充指令内容"}),l.jsx("textarea",{value:N,onChange:Z=>v(Z.target.value),rows:3,placeholder:"agent 级别的补充指令…",className:"mt-1 w-full resize-y rounded-md border border-line bg-base px-3 py-2 font-mono text-sm leading-relaxed text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),(Q.length>0||N)&&l.jsxs("div",{children:[l.jsxs("button",{type:"button",onClick:()=>w(!S),className:"flex items-center gap-1 text-xs font-medium text-fg-4 hover:text-fg-3",children:[l.jsx("span",{children:S?"▾":"▸"})," 预览最终提示词"]}),S&&l.jsx("pre",{className:"mt-1 max-h-48 overflow-auto rounded border border-line bg-elevated px-3 py-2 font-mono text-xs leading-relaxed text-fg-4",children:ee||"(空)"})]}),l.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[l.jsx("button",{type:"button",onClick:s,className:"rounded-md px-3 py-1.5 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),l.jsx("button",{type:"button",onClick:()=>void ue(),disabled:A||!u.trim(),className:"rounded-md bg-blue-600 px-4 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:A?"保存中…":e?"更新":"创建"})]})]})}function wB({fragment:e,onEdit:t,onDelete:a}){const[s,o]=_.useState(!1);return l.jsxs("div",{className:"group flex items-center gap-3 rounded-lg border border-line bg-base px-3 py-2",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"text-xs font-medium text-fg",children:e.name}),e.content&&l.jsx("p",{className:"mt-0.5 truncate font-mono text-[11px] text-fg-5",children:e.content})]}),l.jsx("div",{className:"flex items-center gap-1",children:s?l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",onClick:a,className:"rounded p-1 text-red-400 hover:bg-red-500/10",children:l.jsx(Cn,{className:"h-3.5 w-3.5"})}),l.jsx("button",{type:"button",onClick:()=>o(!1),className:"rounded p-1 text-fg-4 hover:bg-elevated",children:l.jsx(gt,{className:"h-3.5 w-3.5"})})]}):l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",onClick:t,className:"rounded p-1 text-fg-5 opacity-0 transition-opacity hover:text-fg-3 group-hover:opacity-100",children:l.jsx(Qh,{className:"h-3.5 w-3.5"})}),l.jsx("button",{type:"button",onClick:()=>o(!0),className:"rounded p-1 text-fg-5 opacity-0 transition-opacity hover:text-red-400 group-hover:opacity-100",children:l.jsx(wr,{className:"h-3.5 w-3.5"})})]})})]})}function FE({initial:e,onSave:t,onCancel:a}){const[s,o]=_.useState((e==null?void 0:e.name)??""),[u,d]=_.useState((e==null?void 0:e.content)??""),[f,m]=_.useState(!1),h=async()=>{if(s.trim()){m(!0);try{await t({name:s.trim(),content:u})}finally{m(!1)}}};return l.jsxs("div",{className:"space-y-2 rounded-lg border border-line bg-base p-3",children:[l.jsx("input",{type:"text",value:s,onChange:b=>o(b.target.value),placeholder:"片段名称",className:"w-full rounded-md border border-line bg-surface px-3 py-1.5 text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"}),l.jsx("textarea",{value:u,onChange:b=>d(b.target.value),rows:3,placeholder:"提示词内容…",className:"w-full resize-y rounded-md border border-line bg-surface px-3 py-2 font-mono text-sm leading-relaxed text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx("button",{type:"button",onClick:a,className:"rounded-md px-3 py-1 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),l.jsx("button",{type:"button",onClick:()=>void h(),disabled:f||!s.trim(),className:"rounded-md bg-blue-600 px-3 py-1 text-xs font-medium text-white hover:bg-blue-500 disabled:opacity-40",children:f?"保存中…":e?"更新":"创建"})]})]})}function CB({onImported:e,onCancel:t}){const[a,s]=_.useState(""),[o,u]=_.useState(!1),[d,f]=_.useState(null),m=_.useRef(null),h=async g=>{f(null);let y;try{y=JSON.parse(g)}catch{f("JSON 格式无效");return}if(y.type!=="fourth-spark-custom-agent"||!y.agent){f("不是有效的 Custom Agent 导出文件");return}u(!0);try{await Q5(y),e()}catch(N){f(N instanceof Error?N.message:String(N))}finally{u(!1)}},b=g=>{var v;const y=(v=g.target.files)==null?void 0:v[0];if(!y)return;const N=new FileReader;N.onload=()=>{const S=N.result;s(S),h(S)},N.readAsText(y)};return l.jsxs("div",{className:"space-y-3 rounded-xl border border-line bg-surface p-5",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-xs font-medium text-fg-3",children:"导入 Custom Agent"}),l.jsx("button",{type:"button",onClick:t,className:"rounded p-1 text-fg-5 hover:text-fg-3",children:l.jsx(gt,{className:"h-3.5 w-3.5"})})]}),l.jsx("input",{ref:m,type:"file",accept:".json",onChange:b,className:"hidden"}),l.jsxs("button",{type:"button",onClick:()=>{var g;return(g=m.current)==null?void 0:g.click()},className:"flex w-full items-center justify-center gap-1.5 rounded-md border border-dashed border-line py-2.5 text-xs text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-3",children:[l.jsx(Ny,{className:"h-3.5 w-3.5"})," 上传 JSON 文件"]}),l.jsx("textarea",{value:a,onChange:g=>s(g.target.value),rows:4,placeholder:"或粘贴 JSON 内容…",className:"w-full resize-y rounded-md border border-line bg-base px-3 py-2 font-mono text-xs leading-relaxed text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"}),d&&l.jsxs("div",{className:"flex items-start gap-2 rounded-lg bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[l.jsx(kn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),l.jsx("span",{children:d})]}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx("button",{type:"button",onClick:t,className:"rounded-md px-3 py-1.5 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),l.jsx("button",{type:"button",onClick:()=>void h(a),disabled:o||!a.trim(),className:"rounded-md bg-blue-600 px-4 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:o?"导入中…":"导入"})]})]})}function kB(){const e=Pn(),t=Be(ta),a=Be(q=>q.activeRepoId),[s,o]=_.useState([]),[u,d]=_.useState([]),[f,m]=_.useState(!0),[h,b]=_.useState(!1),[g,y]=_.useState(!1),[N,v]=_.useState(null),[S,w]=_.useState(!1),[A,R]=_.useState(!1),[I,Y]=_.useState({}),[B,C]=_.useState({}),z=_.useCallback(()=>{const q=a?Dy(a):Ry();Promise.all([q,jy()]).then(([F,D])=>{o(F),d(D),m(!1)}).catch(()=>m(!1))},[a]);_.useEffect(()=>{m(!0),z()},[z]),_.useEffect(()=>{if(s.length===0)return;const q=s.filter(F=>F.isSystem<2);for(const F of q)My(F.id).then(D=>{Y(P=>({...P,[F.id]:D.filter(ae=>!ae.supersededBy).length}))}).catch(()=>{}),Zh(F.id).then(D=>{C(P=>({...P,[F.id]:D.length}))}).catch(()=>{})},[s]);const W=s.filter(q=>q.isSystem<2),Q=async q=>{a?await Ly(a,q):await Oy(q),b(!1),z(),fs.getState().loadAgents()},j=async q=>{await Wh(q),o(F=>F.filter(D=>D.id!==q)),fs.getState().loadAgents()},ee=async q=>{await ew(q),y(!1),z()},ue=async q=>{N&&(await tw(N.id,q),v(null),z())},Z=async q=>{await nw(q),d(F=>F.filter(D=>D.id!==q))};return a?l.jsx("div",{className:"flex-1 overflow-y-auto",children:l.jsxs("div",{className:"mx-auto max-w-4xl space-y-6 p-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-bold text-fg",children:"Agents"}),l.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"组合 base agent + 模型 + 提示词片段,创建 Session 时选择。"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{type:"button",onClick:()=>{w(!0),b(!1)},className:"flex items-center gap-1.5 rounded-md border border-line px-3 py-1.5 text-xs font-medium text-fg-3 transition-colors hover:bg-elevated",children:[l.jsx(Ny,{className:"h-3.5 w-3.5"})," 导入"]}),l.jsxs("button",{type:"button",onClick:()=>{b(!0),w(!1)},className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500",children:[l.jsx(Ra,{className:"h-3.5 w-3.5"})," 创建"]})]})]}),h&&l.jsx(AB,{availableFragments:u,onSave:Q,onCancel:()=>b(!1)}),S&&l.jsx(CB,{onImported:()=>{w(!1),z(),fs.getState().loadAgents()},onCancel:()=>w(!1)}),f?l.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-16 text-fg-5",children:[l.jsx(Kt,{className:"h-5 w-5 fs-spin"}),l.jsx("p",{className:"text-xs",children:"加载中…"})]}):W.length===0&&!h?l.jsxs("div",{className:"flex flex-col items-center gap-3 py-16 text-fg-5",children:[l.jsx(Fi,{className:"h-8 w-8 text-fg-6"}),l.jsx("p",{className:"text-sm",children:"还没有 Agent"}),l.jsx("p",{className:"text-xs text-fg-5",children:"点击上方「创建」开始。"})]}):l.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:W.map(q=>l.jsx("div",{className:"group",children:l.jsx(SB,{agent:q,memoryCount:I[q.id]??0,sessionCount:B[q.id]??0,onClick:()=>e(`/${encodeURIComponent(t??"")}/agents/${q.id}`),onDelete:()=>void j(q.id)})},q.id))}),l.jsxs("section",{className:"rounded-xl border border-line bg-surface",children:[l.jsxs("button",{type:"button",onClick:()=>R(!A),className:"flex w-full items-center justify-between px-5 py-4 text-left",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-sm font-semibold text-fg",children:"提示词片段"}),l.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"可复用的提示词模块,可在多个 Agent 间共享。"})]}),l.jsx(ea,{className:se("h-4 w-4 shrink-0 text-fg-4 transition-transform",A&&"rotate-180")})]}),A&&l.jsx("div",{className:"border-t border-line px-5 pb-5 pt-3",children:l.jsxs("div",{className:"space-y-1.5",children:[u.map(q=>(N==null?void 0:N.id)===q.id?l.jsx(FE,{initial:q,onSave:ue,onCancel:()=>v(null)},q.id):l.jsx(wB,{fragment:q,onEdit:()=>v(q),onDelete:()=>void Z(q.id)},q.id)),g?l.jsx(FE,{onSave:ee,onCancel:()=>y(!1)}):l.jsxs("button",{type:"button",onClick:()=>y(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-line py-2 text-xs text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-3",children:[l.jsx(Ra,{className:"h-3.5 w-3.5"})," 添加片段"]})]})})]})]})}):l.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:l.jsx("p",{className:"text-sm text-fg-4",children:"请先在顶部选择一个仓库。"})})}const RB=["Sisyphus - ultraworker","Prometheus - Plan Builder","Atlas - Plan Executor"],OB="pinned_models",Us="__system_prompt__",zE=[{bg:"bg-blue-500/15",text:"text-blue-500"},{bg:"bg-purple-500/15",text:"text-purple-500"},{bg:"bg-emerald-500/15",text:"text-emerald-500"},{bg:"bg-amber-500/15",text:"text-amber-500"},{bg:"bg-rose-500/15",text:"text-rose-500"},{bg:"bg-cyan-500/15",text:"text-cyan-500"},{bg:"bg-indigo-500/15",text:"text-indigo-500"},{bg:"bg-orange-500/15",text:"text-orange-500"}];function IB(e){const t=e.trim(),a=t.charCodeAt(0)||0;return{...zE[a%zE.length],initial:(t.charAt(0)||"?").toUpperCase()}}const Lh={decision:{bg:"bg-blue-500/10",text:"text-blue-400"},lesson:{bg:"bg-amber-500/10",text:"text-amber-400"},preference:{bg:"bg-green-500/10",text:"text-green-400"},pattern:{bg:"bg-purple-500/10",text:"text-purple-400"},general:{bg:"bg-elevated",text:"text-fg-4"}};function Ap(e){const t=Date.now()-e,a=Math.floor(t/6e4);if(a<1)return"刚刚";if(a<60)return`${a} 分钟前`;const s=Math.floor(a/60);if(s<24)return`${s} 小时前`;const o=Math.floor(s/24);return o<30?`${o} 天前`:`${Math.floor(o/30)} 个月前`}function $E({memory:e,onUpdate:t,onDelete:a}){const[s,o]=_.useState(!1),[u,d]=_.useState(e.content),[f,m]=_.useState(e.category),[h,b]=_.useState(!1),[g,y]=_.useState(!1),N=Lh[e.category]??Lh.general,v=async()=>{b(!0);try{await t(e.id,{content:u,category:f}),o(!1)}finally{b(!1)}},S=async()=>{y(!1),await a(e.id)};return s?l.jsxs("div",{className:"rounded-lg border border-blue-500/30 bg-blue-500/5 p-3 space-y-2",children:[l.jsx("textarea",{value:u,onChange:w=>d(w.target.value),rows:3,className:"w-full resize-y rounded-md border border-line bg-surface px-3 py-2 font-mono text-xs leading-relaxed text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("select",{value:f,onChange:w=>m(w.target.value),className:"rounded-md border border-line bg-surface px-2 py-1 text-xs text-fg focus:border-blue-500 focus:outline-none",children:[l.jsx("option",{value:"decision",children:"decision"}),l.jsx("option",{value:"lesson",children:"lesson"}),l.jsx("option",{value:"preference",children:"preference"}),l.jsx("option",{value:"pattern",children:"pattern"}),l.jsx("option",{value:"general",children:"general"})]}),l.jsx("div",{className:"flex-1"}),l.jsx("button",{type:"button",onClick:()=>{o(!1),d(e.content),m(e.category)},className:"rounded-md px-3 py-1 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),l.jsx("button",{type:"button",onClick:()=>void v(),disabled:h||!u.trim(),className:"rounded-md bg-blue-600 px-3 py-1 text-xs font-medium text-white hover:bg-blue-500 disabled:opacity-40",children:h?"保存中…":"保存"})]})]}):l.jsxs("div",{className:"group/mem rounded-lg border border-line bg-base px-3 py-2.5",children:[l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx("span",{className:se("mt-0.5 shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium",N.bg,N.text),children:e.category}),l.jsx("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-fg",children:e.content})]}),l.jsxs("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-fg-5",children:[l.jsxs("span",{className:"flex items-center gap-0.5",children:[l.jsx(Zc,{className:"h-3 w-3"})," ",e.importance.toFixed(2)]}),l.jsx("span",{children:"·"}),l.jsx("span",{children:Ap(e.updatedAt)}),e.supersededBy&&l.jsxs(l.Fragment,{children:[l.jsx("span",{children:"·"}),l.jsx("span",{className:"text-amber-400",children:e.supersededBy==="user-deleted"?"已删除":"已合并"})]}),l.jsx("div",{className:"flex-1"}),!e.supersededBy&&l.jsx("div",{className:"flex items-center gap-0.5 opacity-0 transition-opacity group-hover/mem:opacity-100",children:g?l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",onClick:()=>void S(),className:"rounded p-1 text-red-400 hover:bg-red-500/10",children:l.jsx(Cn,{className:"h-3.5 w-3.5"})}),l.jsx("button",{type:"button",onClick:()=>y(!1),className:"rounded p-1 text-fg-4 hover:bg-elevated",children:l.jsx(gt,{className:"h-3.5 w-3.5"})})]}):l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",onClick:()=>o(!0),className:"rounded p-1 text-fg-5 hover:text-fg-3",children:l.jsx(Qh,{className:"h-3.5 w-3.5"})}),l.jsx("button",{type:"button",onClick:()=>y(!0),className:"rounded p-1 text-fg-5 hover:text-red-400",children:l.jsx(wr,{className:"h-3.5 w-3.5"})})]})})]})]})}function MB({agentId:e}){const[t,a]=_.useState([]),[s,o]=_.useState(!0),[u,d]=_.useState(null),[f,m]=_.useState(!1),[h,b]=_.useState([]),[g,y]=_.useState(!0),[N,v]=_.useState(!1),[S,w]=_.useState(new Set),[A,R]=_.useState(!1),[I,Y]=_.useState(null),B=_.useCallback(async()=>{o(!0);try{const q=await My(e,{category:u??void 0,includeSuperseded:f});a(q)}catch{a([])}o(!1)},[e,u,f]);_.useEffect(()=>{B()},[B]),_.useEffect(()=>{if(!N)return;let q=!1;return y(!0),Zh(e).then(F=>{q||b(F)}).catch(()=>{q||b([])}).finally(()=>{q||y(!1)}),()=>{q=!0}},[e,N]);const C=t.filter(q=>!q.supersededBy),z=t.filter(q=>q.supersededBy),W=_.useMemo(()=>new Set(t.map(q=>q.sessionId).filter(Boolean)),[t]),Q=async(q,F)=>{await W5(e,q,F),await B()},j=async q=>{await Z5(e,q),await B()},ee=q=>{w(F=>{const D=new Set(F);return D.has(q)?D.delete(q):D.add(q),D})},ue=async()=>{if(S.size!==0){R(!0),Y(null);try{const D=(await J5(e,[...S])).results;if(D){const P=D.filter(K=>K.status==="ok"),ae=D.filter(K=>K.status!=="ok");P.length>0&&Y(`提取成功 ${P.reduce((K,k)=>K+(k.actions??0),0)} 条记忆`),ae.length>0&&Y(K=>(K?K+";":"")+ae.map(k=>k.error??k.status).join(";")),P.length>0&&await B()}w(new Set)}catch(q){Y(`请求失败: ${q instanceof Error?q.message:String(q)}`)}R(!1)}},Z=["decision","lesson","preference","pattern"];return l.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5 space-y-4",children:[l.jsx("div",{className:"flex items-center justify-between",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Fi,{className:"h-4 w-4 text-purple-400"}),l.jsx("h2",{className:"text-sm font-semibold text-fg",children:"记忆"}),!s&&l.jsx("span",{className:"rounded-full bg-elevated px-1.5 py-0.5 text-[10px] tabular-nums text-fg-4",children:C.length})]})}),l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[l.jsx("button",{type:"button",onClick:()=>d(null),className:se("rounded-full px-2.5 py-0.5 text-[11px] font-medium transition-colors",u===null?"bg-fg/10 text-fg":"text-fg-4 hover:text-fg-3"),children:"全部"}),Z.map(q=>{const F=Lh[q];return l.jsx("button",{type:"button",onClick:()=>d(u===q?null:q),className:se("rounded-full px-2.5 py-0.5 text-[11px] font-medium transition-colors",u===q?se(F.bg,F.text):"text-fg-4 hover:text-fg-3"),children:q},q)})]}),s?l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx(Kt,{className:"h-4 w-4 fs-spin text-fg-5"})}):C.length===0&&z.length===0?l.jsx("div",{className:"py-8 text-center text-xs text-fg-5",children:"暂无记忆。使用此 Agent 完成 Session 后将自动提取。"}):l.jsxs("div",{className:"space-y-1.5",children:[C.map(q=>l.jsx($E,{memory:q,onUpdate:Q,onDelete:j},q.id)),z.length>0&&l.jsxs("div",{className:"pt-1",children:[l.jsxs("button",{type:"button",onClick:()=>m(!f),className:"flex items-center gap-1 text-[11px] text-fg-5 hover:text-fg-3",children:[l.jsx("span",{children:f?"▾":"▸"}),"已合并/已删除 (",z.length,")"]}),f&&l.jsx("div",{className:"mt-1.5 space-y-1.5 opacity-60",children:z.map(q=>l.jsx($E,{memory:q,onUpdate:Q,onDelete:j},q.id))})]})]}),l.jsxs("div",{className:"border-t border-line pt-3",children:[l.jsxs("button",{type:"button",onClick:()=>v(!N),className:"flex items-center gap-1.5 text-xs font-medium text-fg-4 hover:text-fg-3",children:[l.jsx(Kc,{className:"h-3.5 w-3.5"}),l.jsxs("span",{children:[N?"▾":"▸"," 从 Session 提取记忆"]})]}),N&&l.jsx("div",{className:"mt-2 space-y-1.5",children:g?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx(Kt,{className:"h-4 w-4 fs-spin text-fg-5"})}):h.length===0?l.jsx("p",{className:"py-4 text-center text-xs text-fg-5",children:"暂无 Session 记录。"}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"max-h-64 space-y-1 overflow-y-auto",children:h.map(q=>{const F=W.has(q.id);return l.jsxs("label",{className:se("flex cursor-pointer items-center gap-2.5 rounded-md border px-3 py-2 transition-colors",S.has(q.id)?"border-purple-500/30 bg-purple-500/5":"border-line bg-base hover:bg-elevated/60"),children:[l.jsx("input",{type:"checkbox",checked:S.has(q.id),onChange:()=>ee(q.id),className:"h-3.5 w-3.5 shrink-0 cursor-pointer rounded border-line accent-purple-500"}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"block truncate text-xs text-fg",children:q.title||q.id.slice(-8)}),l.jsx("span",{className:"text-[11px] text-fg-5",children:Ap(q.timeCreated)})]}),l.jsx("span",{className:se("shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium",F?"bg-green-500/10 text-green-400":"bg-elevated text-fg-5"),children:F?"已提取":"未提取"})]},q.id)})}),S.size>0&&l.jsxs("button",{type:"button",onClick:()=>void ue(),disabled:A,className:"flex w-full items-center justify-center gap-1.5 rounded-lg bg-purple-600 py-2 text-xs font-medium text-white transition-colors hover:bg-purple-500 disabled:opacity-40",children:[A?l.jsx(Kt,{className:"h-3.5 w-3.5 fs-spin"}):l.jsx(Fi,{className:"h-3.5 w-3.5"}),A?"提取中…":`提取选中 Session 的记忆 (${S.size})`]}),I&&l.jsx("p",{className:se("mt-1.5 rounded-md px-3 py-1.5 text-xs",I.includes("成功")?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"),children:I})]})})]})]})}function DB({agentId:e}){const[t,a]=_.useState([]),[s,o]=_.useState(!0);return _.useEffect(()=>{let u=!1;return Zh(e).then(d=>{u||a(d)}).catch(()=>{u||a([])}).finally(()=>{u||o(!1)}),()=>{u=!0}},[e]),l.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Kc,{className:"h-4 w-4 text-fg-4"}),l.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Session 历史"}),!s&&l.jsx("span",{className:"rounded-full bg-elevated px-1.5 py-0.5 text-[10px] tabular-nums text-fg-4",children:t.length})]}),l.jsx("div",{className:"mt-3",children:s?l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx(Kt,{className:"h-4 w-4 fs-spin text-fg-5"})}):t.length===0?l.jsx("p",{className:"py-8 text-center text-xs text-fg-5",children:"暂无 Session 记录。"}):l.jsx("div",{className:"space-y-1",children:t.map(u=>l.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-line bg-base px-4 py-2.5",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"block truncate text-xs font-medium text-fg",children:u.title||u.id.slice(-8)}),l.jsxs("div",{className:"mt-0.5 flex items-center gap-2 text-[11px] text-fg-5",children:[l.jsx("span",{children:Ap(u.timeCreated)}),u.cost>0&&l.jsxs(l.Fragment,{children:[l.jsx("span",{children:"·"}),l.jsxs("span",{children:["$",u.cost.toFixed(4)]})]}),(u.tokensInput>0||u.tokensOutput>0)&&l.jsxs(l.Fragment,{children:[l.jsx("span",{children:"·"}),l.jsxs("span",{children:[Math.round((u.tokensInput+u.tokensOutput)/1e3),"K tokens"]})]})]})]}),u.completedAt?l.jsx("span",{className:"shrink-0 rounded-full bg-green-500/10 px-2 py-0.5 text-[10px] font-medium text-green-400",children:"完成"}):l.jsx("span",{className:"shrink-0 rounded-full bg-elevated px-2 py-0.5 text-[10px] font-medium text-fg-5",children:"进行中"})]},u.id))})})]})}function LB({agent:e,fragments:t,onSave:a}){const s=Be(F=>F.activeRepoId),[o,u]=_.useState(!1),[d,f]=_.useState(e.name),[m,h]=_.useState(e.description??""),[b,g]=_.useState(e.baseAgent),[y,N]=_.useState(e.model??""),[v,S]=_.useState(e.systemPrompt),[w,A]=_.useState(!1),[R,I]=_.useState(!1),[Y,B]=_.useState([]);_.useEffect(()=>{if(!s){B([]);return}let F=!1;return(async()=>{try{const[D,P]=await Promise.all([ko(),Co(s)]);if(F)return;const ae=D[OB],K=ae?JSON.parse(ae):[];B(K.length>0?P.filter(k=>K.includes(k.id)):[])}catch{F||B([])}})(),()=>{F=!0}},[s]);const[C,z]=_.useState(()=>{const F=e.fragments.map(K=>K.id),D=e.systemPromptPosition??-1,P=D>=0&&D<=F.length?D:F.length,ae=[...F];return ae.splice(P,0,Us),ae}),W=F=>{z(D=>{if(D.includes(F))return D.filter(K=>K!==F);const P=D.indexOf(Us),ae=[...D];return ae.splice(P>=0?P:ae.length,0,F),ae})},Q=(F,D)=>{const P=F+D;P<0||P>=C.length||z(ae=>{const K=[...ae];return[K[F],K[P]]=[K[P],K[F]],K})},j=C.filter(F=>F!==Us),ee=(()=>{const F=C.indexOf(Us);return F<0?-1:C.slice(0,F).filter(D=>D!==Us).length})(),ue=C.map(F=>{var D;return F===Us?v:(D=t.find(P=>P.id===F))==null?void 0:D.content}).filter(Boolean).join(`
512
+
513
+ ---
514
+
515
+ `),Z=async()=>{if(!(!d.trim()||!b)){I(!0);try{await a({name:d.trim(),description:m.trim()||void 0,baseAgent:b,model:y.trim()||void 0,systemPrompt:v,systemPromptPosition:ee,fragmentIds:j}),u(!1)}finally{I(!1)}}},q=e.isSystem>=1;return o?l.jsxs("section",{className:"rounded-xl border border-blue-500/30 bg-surface p-5 space-y-3",children:[l.jsx("h2",{className:"text-sm font-semibold text-fg",children:"编辑配置"}),l.jsxs("div",{className:"flex gap-3",children:[l.jsxs("label",{className:"flex-1",children:[l.jsx("span",{className:"text-xs font-medium text-fg-3",children:"名称"}),l.jsx("input",{type:"text",value:d,onChange:F=>f(F.target.value),className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-1.5 text-sm text-fg focus:border-blue-500 focus:outline-none"})]}),l.jsxs("label",{className:"w-36",children:[l.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Base Agent"}),l.jsx("select",{value:b,onChange:F=>g(F.target.value),className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-1.5 text-sm text-fg focus:border-blue-500 focus:outline-none",children:RB.map(F=>l.jsx("option",{value:F,children:F},F))})]})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-fg-3",children:"描述(可选)"}),l.jsx("input",{type:"text",value:m,onChange:F=>h(F.target.value),placeholder:"一句话描述这个 Agent 的用途",className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-1.5 text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-xs font-medium text-fg-3",children:"模型(可选)"}),l.jsxs("select",{value:y,onChange:F=>N(F.target.value),className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-1.5 font-mono text-sm text-fg focus:border-blue-500 focus:outline-none",children:[l.jsx("option",{value:"",children:"默认模型"}),Y.map(F=>l.jsx("option",{value:F.id,children:F.name||F.id},F.id))]})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-xs font-medium text-fg-3",children:"提示词组合"}),l.jsxs("div",{className:"mt-1.5 space-y-1",children:[C.map((F,D)=>{if(F===Us)return l.jsxs("div",{className:"flex items-center gap-2 rounded border border-amber-500/30 bg-amber-500/5 px-2 py-1",children:[l.jsxs("div",{className:"flex flex-col",children:[l.jsx("button",{type:"button",onClick:()=>Q(D,-1),disabled:D===0,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▲"}),l.jsx("button",{type:"button",onClick:()=>Q(D,1),disabled:D===C.length-1,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▼"})]}),l.jsx("span",{className:"flex-1 truncate text-xs font-medium text-amber-400",children:"✎ 补充指令"})]},F);const P=t.find(ae=>ae.id===F);return P?l.jsxs("div",{className:"flex items-center gap-2 rounded border border-blue-500/30 bg-blue-500/5 px-2 py-1",children:[l.jsxs("div",{className:"flex flex-col",children:[l.jsx("button",{type:"button",onClick:()=>Q(D,-1),disabled:D===0,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▲"}),l.jsx("button",{type:"button",onClick:()=>Q(D,1),disabled:D===C.length-1,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▼"})]}),l.jsx("span",{className:"flex-1 truncate text-xs text-fg",children:P.name}),l.jsx("button",{type:"button",onClick:()=>W(F),className:"text-fg-5 hover:text-red-400",children:l.jsx(gt,{className:"h-3 w-3"})})]},F):null}),t.filter(F=>!j.includes(F.id)).length>0&&l.jsxs("select",{value:"",onChange:F=>{F.target.value&&W(F.target.value)},className:"w-full rounded border border-dashed border-line bg-base px-2 py-1 text-xs text-fg-4 focus:border-blue-500 focus:outline-none",children:[l.jsx("option",{value:"",children:"+ 添加片段…"}),t.filter(F=>!j.includes(F.id)).map(F=>l.jsx("option",{value:F.id,children:F.name},F.id))]})]})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-fg-3",children:"补充指令内容"}),l.jsx("textarea",{value:v,onChange:F=>S(F.target.value),rows:4,className:"mt-1 w-full resize-y rounded-md border border-line bg-base px-3 py-2 font-mono text-sm leading-relaxed text-fg focus:border-blue-500 focus:outline-none"})]}),(j.length>0||v)&&l.jsxs("div",{children:[l.jsxs("button",{type:"button",onClick:()=>A(!w),className:"flex items-center gap-1 text-xs font-medium text-fg-4 hover:text-fg-3",children:[l.jsx("span",{children:w?"▾":"▸"})," 预览最终提示词"]}),w&&l.jsx("pre",{className:"mt-1 max-h-48 overflow-auto rounded border border-line bg-elevated px-3 py-2 font-mono text-xs leading-relaxed text-fg-4",children:ue||"(空)"})]}),l.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[l.jsx("button",{type:"button",onClick:()=>u(!1),className:"rounded-md px-3 py-1.5 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),l.jsx("button",{type:"button",onClick:()=>void Z(),disabled:R||!d.trim(),className:"rounded-md bg-blue-600 px-4 py-1.5 text-xs font-medium text-white hover:bg-blue-500 disabled:opacity-40",children:R?"保存中…":"保存"})]})]}):l.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-sm font-semibold text-fg",children:"配置"}),!q&&l.jsxs("button",{type:"button",onClick:()=>u(!0),className:"flex items-center gap-1 rounded-md border border-line px-2.5 py-1 text-xs text-fg-4 transition-colors hover:bg-elevated hover:text-fg-3",children:[l.jsx(Qh,{className:"h-3 w-3"})," 编辑"]})]}),l.jsxs("div",{className:"mt-3 space-y-2.5",children:[l.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[l.jsx("span",{className:"w-20 shrink-0 text-fg-5",children:"Base Agent"}),l.jsx("span",{className:"font-mono text-fg",children:e.baseAgent})]}),l.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[l.jsx("span",{className:"w-20 shrink-0 text-fg-5",children:"模型"}),l.jsx("span",{className:"font-mono text-fg",children:e.model||"默认"})]}),e.fragments.length>0&&l.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[l.jsx("span",{className:"w-20 shrink-0 pt-0.5 text-fg-5",children:"片段"}),l.jsx("div",{className:"flex flex-wrap gap-1",children:e.fragments.map(F=>l.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] font-medium text-blue-400",children:F.name},F.id))})]}),e.systemPrompt&&l.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[l.jsx("span",{className:"w-20 shrink-0 pt-0.5 text-fg-5",children:"补充指令"}),l.jsx("p",{className:"min-w-0 truncate font-mono text-fg-4",children:e.systemPrompt})]})]})]})}function jB(){const{agentId:e}=pS(),t=Pn(),a=Be(ta),s=fs(A=>A.agents),o=s.find(A=>A.id===e),[u,d]=_.useState([]),[f,m]=_.useState(!1),[h,b]=_.useState(!1);_.useEffect(()=>{jy().then(d).catch(()=>d([]))},[]),_.useEffect(()=>{s.length>0&&!o&&t(a?`/${encodeURIComponent(a)}/agents`:"/repos",{replace:!0})},[s,o,t,a]);const g=async A=>{e&&(await Iy(e,A),fs.getState().loadAgents())},y=async()=>{e&&(await Wh(e),fs.getState().loadAgents(),t(a?`/${encodeURIComponent(a)}/agents`:"/repos",{replace:!0}))},N=async()=>{if(!e||!o)return;const A=await kx(e),R=new Blob([JSON.stringify(A,null,2)],{type:"application/json"}),I=URL.createObjectURL(R),Y=document.createElement("a");Y.href=I,Y.download=`${o.name.replace(/[^a-zA-Z0-9\u4e00-\u9fff_-]/g,"_")}.json`,Y.click(),URL.revokeObjectURL(I)},v=async()=>{if(!e)return;const A=await kx(e);await navigator.clipboard.writeText(JSON.stringify(A,null,2)),m(!0),setTimeout(()=>m(!1),2e3)};if(!o||!e)return l.jsx("div",{className:"flex flex-1 items-center justify-center",children:l.jsx(Kt,{className:"h-5 w-5 fs-spin text-fg-5"})});const S=o.isSystem>=1,w=IB(o.name);return l.jsx("div",{className:"flex-1 overflow-y-auto",children:l.jsxs("div",{className:"mx-auto max-w-3xl space-y-6 p-6",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("button",{type:"button",onClick:()=>t(a?`/${encodeURIComponent(a)}/agents`:"/repos"),className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-line text-fg-4 transition-colors hover:bg-elevated hover:text-fg-3",children:l.jsx(oh,{className:"h-4 w-4"})}),l.jsx("div",{className:se("flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-sm font-semibold",w.bg,w.text),children:w.initial}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("h1",{className:"truncate text-lg font-bold text-fg",children:o.name}),S&&l.jsx("span",{className:"shrink-0 rounded bg-amber-500/10 px-1.5 py-0.5 text-[10px] font-medium text-amber-400",children:"系统"}),o.repoId&&l.jsx("span",{className:"shrink-0 rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] font-medium text-blue-400",children:"repo"})]}),l.jsxs("p",{className:"mt-0.5 text-xs text-fg-4",children:[l.jsx("span",{className:"font-mono",children:o.baseAgent}),o.model&&l.jsxs("span",{className:"ml-1.5 text-fg-5",children:["· ",o.model]})]}),o.description&&l.jsx("p",{className:"mt-1 text-xs text-fg-4",children:o.description})]}),l.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[l.jsx("button",{type:"button",onClick:()=>void N(),title:"导出 JSON",className:"rounded-md border border-line p-1.5 text-fg-4 transition-colors hover:bg-elevated hover:text-fg-3",children:l.jsx(ZA,{className:"h-4 w-4"})}),l.jsx("button",{type:"button",onClick:()=>void v(),title:"复制 JSON",className:"rounded-md border border-line p-1.5 text-fg-4 transition-colors hover:bg-elevated hover:text-fg-3",children:f?l.jsx(Cn,{className:"h-4 w-4 text-green-500"}):l.jsx(GA,{className:"h-4 w-4"})}),!S&&(h?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("button",{type:"button",onClick:()=>void y(),className:"rounded-md border border-red-500/30 p-1.5 text-red-400 hover:bg-red-500/10",children:l.jsx(Cn,{className:"h-4 w-4"})}),l.jsx("button",{type:"button",onClick:()=>b(!1),className:"rounded-md border border-line p-1.5 text-fg-4 hover:bg-elevated",children:l.jsx(gt,{className:"h-4 w-4"})})]}):l.jsx("button",{type:"button",onClick:()=>b(!0),title:"删除",className:"rounded-md border border-line p-1.5 text-fg-4 transition-colors hover:border-red-500/30 hover:text-red-400",children:l.jsx(wr,{className:"h-4 w-4"})}))]})]}),l.jsx(LB,{agent:o,fragments:u,onSave:g}),l.jsx(MB,{agentId:e}),l.jsx(DB,{agentId:e})]})})}let vr=null;function BB(e){const t=Date.now()-e,a=Math.floor(t/6e4);return a<1?"刚刚":a<60?`${a} 分钟前`:`${Math.floor(a/60)} 小时前`}const qE=[{id:"usage",label:"Claude 账号",icon:Zc},{id:"git",label:"Git 源站",icon:Gs},{id:"models",label:"模型",icon:pc},{id:"agents",label:"AGENTS.md",icon:Vh}],PB={id:"server",label:"服务器",icon:vy};function jh(e){if(!e)return null;const t=new Date(e).getTime()-Date.now();if(t<=0)return"已重置";const a=Math.floor(t/36e5),s=Math.floor(t%36e5/6e4);return a>0?`${a}h ${s}m 后重置`:`${s}m 后重置`}function UB(e){return e>=90?"bg-red-500":e>=70?"bg-amber-500":"bg-blue-500"}function ah({label:e,window:t}){if(!t)return null;const a=Math.round(t.utilization),s=jh(t.resets_at),o=a>=90,u=a>=70;return l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsx("span",{className:"min-w-0 truncate text-xs font-medium text-fg-3",children:e}),l.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s&&l.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-elevated px-1.5 py-0.5 text-[10px] font-medium text-fg-4 tabular-nums",children:[l.jsx(Kc,{className:"h-2.5 w-2.5"}),s]}),l.jsxs("span",{className:se("text-sm font-bold leading-none tabular-nums",o?"text-red-400":u?"text-amber-400":"text-fg"),children:[a,"%"]})]})]}),l.jsx("div",{className:"h-2.5 overflow-hidden rounded-full bg-elevated ring-1 ring-inset ring-line/60",children:l.jsx("div",{className:se("h-full rounded-full transition-all duration-500 ease-out",UB(a),o?"shadow-sm shadow-red-500/50":u?"shadow-sm shadow-amber-500/40":null),style:{width:`${Math.min(a,100)}%`}})})]})}function HB({account:e,onSwitch:t,switching:a}){var o;const s=e.active;return l.jsxs("div",{className:se("relative overflow-hidden rounded-xl border bg-base p-4 shadow-sm transition-colors",s?"border-blue-500/30 ring-1 ring-inset ring-blue-500/20":"border-line"),children:[s&&l.jsx("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-1 bg-blue-500"}),l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx("div",{className:se("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg",s?"bg-blue-500/15 text-blue-500":"bg-elevated text-fg-4"),children:l.jsx(Ty,{className:"h-3.5 w-3.5"})}),l.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:e.label}),s&&l.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5 rounded-full bg-blue-500/15 px-2 py-0.5 text-[10px] font-semibold text-blue-500",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-blue-500 shadow-sm shadow-blue-500/60"}),"当前"]}),!s&&t&&l.jsxs("button",{type:"button",onClick:()=>t(e.id),disabled:a,className:"inline-flex shrink-0 items-center gap-1 rounded-full border border-line px-2 py-0.5 text-[10px] font-medium text-fg-4 transition-colors hover:border-blue-500/50 hover:text-blue-500 disabled:opacity-40",children:[a&&l.jsx(Kt,{className:"h-2.5 w-2.5 fs-spin"}),"切换"]}),e.excluded&&l.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-elevated px-2 py-0.5 text-[10px] font-medium text-fg-5",children:[l.jsx(SA,{className:"h-2.5 w-2.5"}),"不自动切"]}),e.needsReauth&&l.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-red-500/15 px-2 py-0.5 text-[10px] font-medium text-red-400",children:[l.jsx(kn,{className:"h-2.5 w-2.5"}),"需重新登录"]})]}),e.holders&&e.holders.length>0&&l.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-fg-5",children:[l.jsx(_y,{className:"h-3 w-3 shrink-0"}),l.jsx("span",{className:"truncate",children:e.holders.join(", ")})]}),e.error&&!e.usage?l.jsxs("div",{className:"mt-3 flex items-start gap-2 rounded-lg bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[l.jsx(kn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),l.jsx("span",{className:"min-w-0 break-words",children:e.error})]}):e.usage?l.jsxs("div",{className:"mt-4 space-y-3",children:[l.jsx(ah,{label:"5 小时窗口",window:e.usage.five_hour}),l.jsx(ah,{label:"7 天窗口",window:e.usage.seven_day}),(o=e.usage.scoped)==null?void 0:o.map(u=>l.jsx(ah,{label:u.label,window:u},u.label))]}):null]})}function FB(){const[e,t]=_.useState((vr==null?void 0:vr.data)??null),[a,s]=_.useState(!vr),[o,u]=_.useState(null),[d,f]=_.useState(null),[m,h]=_.useState((vr==null?void 0:vr.fetchedAt)??null),[,b]=_.useState(0),g=_.useCallback(S=>{const w=Date.now();vr={data:S,fetchedAt:w},t(S),h(w)},[]),y=_.useCallback(()=>{s(!0),u(null),Uy().then(S=>{g(S),s(!1)}).catch(S=>{u(S instanceof Error?S.message:String(S)),s(!1)})},[g]);_.useEffect(()=>{vr||y()},[y]),_.useEffect(()=>{const S=setInterval(()=>b(w=>w+1),3e4);return()=>clearInterval(S)},[]);const N=_.useRef(!1),v=_.useCallback(S=>{N.current||(N.current=!0,f(S),Hy(S).then(w=>{g(w),f(null)}).catch(w=>{u(w instanceof Error?w.message:String(w)),f(null)}).finally(()=>{N.current=!1}))},[g]);return l.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[l.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 text-blue-500",children:l.jsx(u3,{className:"h-4 w-4"})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Claude 订阅额度"}),l.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"各账号的 Pro/Max 订阅窗口用量。"})]})]}),l.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[m&&l.jsx("span",{className:"text-[10px] tabular-nums text-fg-5",children:BB(m)}),l.jsx("button",{type:"button",onClick:y,disabled:a,className:"rounded-md p-1.5 text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2 disabled:opacity-40",children:l.jsx(qs,{className:se("h-4 w-4",a&&"fs-spin")})})]})]}),l.jsx("div",{className:"mt-4 space-y-2.5",children:a&&!e?l.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[l.jsx(Kt,{className:"h-5 w-5 fs-spin"}),l.jsx("p",{className:"text-xs",children:"加载中…"})]}):o&&!e?l.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-red-400",children:[l.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-red-500/10",children:l.jsx(kn,{className:"h-5 w-5"})}),l.jsx("p",{className:"max-w-xs text-center text-xs leading-relaxed",children:o})]}):e&&e.accounts.length===0?l.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[l.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-elevated text-fg-4",children:l.jsx(_y,{className:"h-5 w-5"})}),l.jsx("p",{className:"max-w-xs text-center text-xs leading-relaxed",children:"未找到账号。请在 OpenCode TUI 中通过 claude-accounts-usage 插件登录。"})]}):e?e.accounts.map(S=>l.jsx(HB,{account:S,onSwitch:v,switching:d===S.id},S.id)):null})]})}function zB({host:e,onDelete:t}){const[a,s]=_.useState(!1);return l.jsxs("div",{className:"group flex items-center gap-3 rounded-lg border border-line bg-base px-4 py-3",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm font-medium text-fg",children:e.name}),l.jsx("span",{className:"rounded bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-4",children:e.platform})]}),l.jsxs("div",{className:"mt-0.5 flex items-center gap-2 font-mono text-xs text-fg-4",children:[l.jsx("span",{children:e.host}),l.jsx("span",{className:"text-fg-6",children:"·"}),l.jsx("span",{className:"text-fg-5",children:e.token})]})]}),a?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("button",{type:"button",onClick:t,className:"rounded p-1.5 text-red-400 hover:bg-red-500/10",children:l.jsx(Cn,{className:"h-4 w-4"})}),l.jsx("button",{type:"button",onClick:()=>s(!1),className:"rounded p-1.5 text-fg-4 hover:bg-elevated",children:l.jsx(gt,{className:"h-4 w-4"})})]}):l.jsx("button",{type:"button",onClick:()=>s(!0),className:"rounded p-1.5 text-fg-5 opacity-0 transition-opacity hover:text-red-400 group-hover:opacity-100",children:l.jsx(wr,{className:"h-4 w-4"})})]})}function $B({onAdded:e}){const[t,a]=_.useState(!1),[s,o]=_.useState(""),[u,d]=_.useState(""),[f,m]=_.useState(""),[h,b]=_.useState("gitea"),[g,y]=_.useState(!1),[N,v]=_.useState(!1),S=()=>{o(""),d(""),m(""),b("gitea"),a(!1)},w=async()=>{if(!(!s.trim()||!u.trim()||!f.trim())){y(!0);try{await Aw(s.trim(),u.trim(),f.trim(),h),S(),e()}finally{y(!1)}}};return t?l.jsxs("div",{className:"space-y-3 rounded-lg border border-line bg-base p-4",children:[l.jsxs("div",{className:"flex gap-3",children:[l.jsxs("label",{className:"flex-1",children:[l.jsx("span",{className:"text-xs font-medium text-fg-3",children:"名称"}),l.jsx("input",{type:"text",value:u,onChange:A=>d(A.target.value),placeholder:"公司 Gitea",className:"mt-1 w-full rounded-md border border-line bg-surface px-3 py-1.5 text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),l.jsxs("label",{className:"w-28",children:[l.jsx("span",{className:"text-xs font-medium text-fg-3",children:"平台"}),l.jsxs("select",{value:h,onChange:A=>b(A.target.value),className:"mt-1 w-full rounded-md border border-line bg-surface px-3 py-1.5 text-sm text-fg focus:border-blue-500 focus:outline-none",children:[l.jsx("option",{value:"gitea",children:"Gitea"}),l.jsx("option",{value:"github",children:"GitHub"}),l.jsx("option",{value:"gitlab",children:"GitLab"})]})]})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Host"}),l.jsx("input",{type:"text",value:s,onChange:A=>o(A.target.value),placeholder:"git.btsai.work",className:"mt-1 w-full rounded-md border border-line bg-surface px-3 py-1.5 font-mono text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Token"}),l.jsxs("div",{className:"relative mt-1",children:[l.jsx("input",{type:N?"text":"password",value:f,onChange:A=>m(A.target.value),placeholder:"Personal Access Token",className:"w-full rounded-md border border-line bg-surface px-3 py-1.5 pr-9 font-mono text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"}),l.jsx("button",{type:"button",onClick:()=>v(!N),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-fg-5 hover:text-fg-3",children:N?l.jsx(a3,{className:"h-3.5 w-3.5"}):l.jsx(s3,{className:"h-3.5 w-3.5"})})]})]}),l.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[l.jsx("button",{type:"button",onClick:S,className:"rounded-md px-3 py-1.5 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),l.jsx("button",{type:"button",onClick:()=>void w(),disabled:g||!s.trim()||!u.trim()||!f.trim(),className:"rounded-md bg-blue-600 px-4 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:g?"保存中…":"保存"})]})]}):l.jsxs("button",{type:"button",onClick:()=>a(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-line py-2.5 text-xs text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-3",children:[l.jsx(Ra,{className:"h-3.5 w-3.5"})," 添加 Git 源站"]})}function qB(){const[e,t]=_.useState(""),[a,s]=_.useState(""),[o,u]=_.useState(!0),[d,f]=_.useState(!1),[m,h]=_.useState(null);_.useEffect(()=>{bw().then(y=>{t(y.content),s(y.content),u(!1)}).catch(y=>{h(y instanceof Error?y.message:String(y)),u(!1)})},[]);const b=async()=>{f(!0),h(null);try{await xw(e),s(e)}catch(y){h(y instanceof Error?y.message:String(y))}f(!1)},g=e!==a;return l.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"text-sm font-semibold text-fg",children:"全局 AGENTS.md"}),l.jsx("p",{className:"mt-1 text-xs text-fg-4",children:"此内容会注入到所有仓库的 Agent 系统指令中。修改后 opencode 热加载,即时生效。"})]}),l.jsxs("button",{type:"button",onClick:()=>void b(),disabled:d||!g,className:"flex shrink-0 items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[l.jsx(Wc,{className:"h-3.5 w-3.5"}),d?"保存中…":"保存"]})]}),m&&l.jsxs("div",{className:"mt-3 flex items-start gap-2 rounded-lg bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[l.jsx(kn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),l.jsx("span",{className:"min-w-0 break-words",children:m})]}),l.jsx("div",{className:"mt-4",children:o?l.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[l.jsx(Kt,{className:"h-5 w-5 fs-spin"}),l.jsx("p",{className:"text-xs",children:"加载中…"})]}):l.jsx("textarea",{value:e,onChange:y=>t(y.target.value),spellCheck:!1,className:"h-96 w-full resize-y rounded-lg border border-line bg-base px-4 py-3 font-mono text-sm leading-relaxed text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20",placeholder:`# AGENTS.md
516
+
517
+ 在此编写全局 Agent 指令…`})}),l.jsx("p",{className:"mt-3 text-[11px] text-fg-5",children:"文件路径:~/.config/opencode/AGENTS.md"})]})}function YB(){const[e,t]=_.useState([]),[a,s]=_.useState(!0),o=()=>{Sw().then(d=>{t(d),s(!1)}).catch(()=>s(!1))};_.useEffect(o,[]);const u=async d=>{await ww(d),t(f=>f.filter(m=>m.id!==d))};return l.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[l.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Git 源站管理"}),l.jsx("p",{className:"mt-1 text-xs text-fg-4",children:"为不同的 Git 托管平台配置访问凭证,用于同步 Issues。系统会根据仓库的 git URL 自动匹配对应的源站。"}),l.jsx("div",{className:"mt-4 space-y-2",children:a?l.jsx("p",{className:"py-4 text-center font-mono text-xs text-fg-5",children:"加载中…"}):l.jsxs(l.Fragment,{children:[e.map(d=>l.jsx(zB,{host:d,onDelete:()=>void u(d.id)},d.id)),l.jsx($B,{onAdded:o})]})}),l.jsx("p",{className:"mt-4 text-[11px] text-fg-5",children:"Token 存储在数据库中。也可通过环境变量 GITEA_TOKEN 设置全局 fallback。"})]})}const YE="pinned_models";function GB(e){const t=new Map;for(const a of e){const s=a.providerName||a.providerID,o=t.get(s);o?o.push(a):t.set(s,[a])}return Array.from(t,([a,s])=>({provider:a,models:s})).sort((a,s)=>{const o=a.models.some(d=>d.configured),u=s.models.some(d=>d.configured);return o!==u?o?-1:1:a.provider.localeCompare(s.provider)})}function KB(e){return e?e>=1e6?`${(e/1e6).toFixed(e%1e6===0?0:1)}M`:e>=1e3?`${Math.round(e/1e3)}K`:String(e):""}function VB(e){if(!e)return"";const t=[];return e.input!=null&&t.push(`$${e.input}/Mi`),e.output!=null&&t.push(`$${e.output}/Mo`),t.join(" ")}function XB(){const e=Be(I=>I.activeRepoId),[t,a]=_.useState([]),[s,o]=_.useState(new Set),[u,d]=_.useState(!0),[f,m]=_.useState(null),[h,b]=_.useState(null),[g,y]=_.useState("");_.useEffect(()=>{let I=!1;async function Y(){d(!0),m(null);try{const[B,C]=await Promise.all([ko(),e?Co(e):Promise.resolve([])]);if(I)return;const z=B[YE],W=z?JSON.parse(z):[];o(new Set(W)),a(C),b(null),y("")}catch(B){I||m(B instanceof Error?B.message:String(B))}I||d(!1)}return Y(),()=>{I=!0}},[e]);const N=async I=>{const Y=new Set(s);Y.has(I)?Y.delete(I):Y.add(I),o(Y);try{await fh(YE,JSON.stringify([...Y]))}catch{o(s)}},v=_.useMemo(()=>GB(t),[t]),S=t.filter(I=>s.has(I.id)).length,w=h?v.find(I=>I.provider===h):v[0],A=g.trim().toLowerCase(),R=w?A?w.models.filter(I=>(I.name||I.id).toLowerCase().includes(A)||I.id.toLowerCase().includes(A)):w.models:[];return l.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[l.jsx("div",{className:"flex items-center justify-between gap-3",children:l.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[l.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 text-blue-500",children:l.jsx(pc,{className:"h-4 w-4"})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"text-sm font-semibold text-fg",children:"常用模型"}),l.jsxs("p",{className:"mt-0.5 text-xs text-fg-4",children:["勾选常用模型,在新建对话时快速选择。",S>0&&l.jsxs("span",{className:"ml-1 text-blue-400",children:["已选 ",S," 个"]})]})]})]})}),l.jsx("div",{className:"mt-4",children:e?u?l.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[l.jsx(Kt,{className:"h-5 w-5 fs-spin"}),l.jsx("p",{className:"text-xs",children:"加载模型列表…"})]}):f?l.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-red-400",children:[l.jsx(kn,{className:"h-5 w-5"}),l.jsx("p",{className:"max-w-xs text-center text-xs leading-relaxed",children:f})]}):t.length===0?l.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[l.jsx(pc,{className:"h-5 w-5"}),l.jsx("p",{className:"text-xs",children:"当前仓库没有可用模型。"})]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex gap-1 overflow-x-auto rounded-lg border border-line bg-base p-1",children:v.map(I=>{var C;const Y=I.provider===(h??((C=v[0])==null?void 0:C.provider)),B=I.models.filter(z=>s.has(z.id)).length;return l.jsxs("button",{type:"button",onClick:()=>{b(I.provider),y("")},className:se("flex shrink-0 items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",Y?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-3"),children:[I.provider,B>0&&l.jsx("span",{className:"rounded-full bg-blue-500/15 px-1.5 py-0.5 text-[10px] font-semibold tabular-nums text-blue-500",children:B})]},I.provider)})}),l.jsxs("div",{className:"mt-3 flex items-center gap-2 rounded-md border border-line bg-base px-3 py-1.5",children:[l.jsx(us,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),l.jsx("input",{type:"text",value:g,onChange:I=>y(I.target.value),placeholder:"搜索模型…",className:"min-w-0 flex-1 bg-transparent text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),g&&l.jsx("button",{type:"button",onClick:()=>y(""),className:"text-fg-5 hover:text-fg-3",children:l.jsx(gt,{className:"h-3 w-3"})})]}),l.jsx("div",{className:"mt-3 rounded-lg border border-line bg-base",children:R.length===0?l.jsx("div",{className:"px-3 py-6 text-center text-xs text-fg-5",children:"无匹配模型"}):l.jsx("div",{className:"divide-y divide-line/40",children:R.map(I=>{const Y=s.has(I.id),B=KB(I.contextLimit),C=VB(I.cost);return l.jsxs("label",{className:se("flex cursor-pointer items-center gap-3 px-3 py-2 transition-colors hover:bg-elevated/60",Y&&"bg-blue-500/5"),children:[l.jsx("input",{type:"checkbox",checked:Y,onChange:()=>void N(I.id),className:"h-3.5 w-3.5 shrink-0 cursor-pointer rounded border-line accent-blue-500"}),l.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-fg",children:I.name||I.id}),l.jsxs("span",{className:"flex shrink-0 items-center gap-2",children:[B&&l.jsx("span",{className:"rounded bg-surface px-1.5 py-0.5 text-[10px] text-fg-5",children:B}),C&&l.jsx("span",{className:"text-[10px] text-fg-6",children:C})]})]},I.id)})})})]}):l.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[l.jsx(pc,{className:"h-5 w-5"}),l.jsx("p",{className:"text-xs",children:"请先在左侧选择一个仓库以加载可用模型。"})]})})]})}function QB(){const[e,t]=_.useState(dh),[a,s]=_.useState(!1),[o,u]=_.useState(null),[d,f]=_.useState(dh),m=e!==d,h=async()=>{const g=e.replace(/\/+$/,"");if(g){s(!0),u(null);try{const y=await fetch(`${g}/api/health`,{signal:AbortSignal.timeout(5e3)});u(y.ok?"ok":"fail")}catch{u("fail")}s(!1)}},b=()=>{const g=e.replace(/\/+$/,"");T5(g),f(g),t(g)};return l.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[l.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 text-blue-500",children:l.jsx(vy,{className:"h-4 w-4"})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"text-sm font-semibold text-fg",children:"服务器连接"}),l.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"配置远程 Fourth Spark Server 地址。"})]})]}),l.jsxs("div",{className:"mt-4 space-y-3",children:[l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-fg-3",children:"服务器地址"}),l.jsx("input",{type:"url",value:e,onChange:g=>{t(g.target.value),u(null)},placeholder:"http://192.168.1.100:3000",className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-2 font-mono text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{type:"button",onClick:()=>void h(),disabled:a||!e.trim(),className:"flex items-center gap-1.5 rounded-md border border-line px-3 py-1.5 text-xs font-medium text-fg-3 transition-colors hover:bg-elevated disabled:opacity-40",children:[a?l.jsx(Kt,{className:"h-3.5 w-3.5 fs-spin"}):l.jsx(qs,{className:"h-3.5 w-3.5"}),"测试连接"]}),l.jsxs("button",{type:"button",onClick:b,disabled:!m,className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[l.jsx(Wc,{className:"h-3.5 w-3.5"}),"保存"]}),o==="ok"&&l.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-green-500",children:[l.jsx(Cn,{className:"h-3.5 w-3.5"})," 连接成功"]}),o==="fail"&&l.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-red-400",children:[l.jsx(kn,{className:"h-3.5 w-3.5"})," 连接失败"]})]})]}),l.jsx("p",{className:"mt-4 text-[11px] text-fg-5",children:"保存后需重新打开 App 生效。确保手机与开发机在同一局域网。"})]})}function WB(){const[e,t]=_.useState("local"),[a,s]=_.useState(!1),[o,u]=_.useState(!1);_.useEffect(()=>{mh().then(f=>{const m=f.mode==="worker";s(m),t(m?"cloud":"local")}).catch(()=>{}).finally(()=>u(!0))},[]);const d=_.useCallback(f=>{const m=f.mode==="worker";s(m),m&&t("cloud")},[]);return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex gap-1 rounded-lg border border-line bg-base p-1",children:[l.jsxs("button",{type:"button",onClick:()=>{a||t("local")},disabled:a,className:se("flex flex-1 items-center justify-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",e==="local"?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-3",a&&e!=="local"&&"cursor-not-allowed opacity-40"),title:a?"需先断开账号池连接":void 0,children:[l.jsx(Zc,{className:"h-3.5 w-3.5"}),"本地模式"]}),l.jsxs("button",{type:"button",onClick:()=>t("cloud"),className:se("flex flex-1 items-center justify-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",e==="cloud"?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-3"),children:[l.jsx(Ey,{className:"h-3.5 w-3.5"}),"账号池"]})]}),o&&e==="local"&&l.jsx(FB,{}),o&&e==="cloud"&&l.jsx(JB,{onStatusChange:d})]})}function ZB({onClose:e,onSwitched:t}){const[a,s]=_.useState([]),[o,u]=_.useState(!0),[d,f]=_.useState(null),[m,h]=_.useState(null);_.useEffect(()=>{Uy().then(N=>s(N.accounts)).catch(()=>{}).finally(()=>u(!1))},[]);const b=async N=>{f(N),h(null);try{await Hy(N),t(),e()}catch(v){const S=v instanceof Error?v.message:String(v);h(S||"切换失败"),f(null)}},g=N=>{var v;return(v=N.usage)==null?void 0:v.five_hour},y=N=>{var v;return(v=N.usage)==null?void 0:v.seven_day};return l.jsx("div",{className:"fixed inset-0 z-50 flex items-end justify-center bg-black/50 backdrop-blur-sm sm:items-center",onClick:e,children:l.jsxs("div",{className:"flex max-h-[85vh] w-full flex-col rounded-t-2xl border border-line bg-surface p-4 shadow-2xl sm:mx-4 sm:max-w-lg sm:rounded-xl sm:p-5",onClick:N=>N.stopPropagation(),children:[l.jsxs("div",{className:"flex shrink-0 items-center justify-between",children:[l.jsx("h2",{className:"text-sm font-semibold text-fg",children:"切换账号"}),l.jsx("button",{type:"button",onClick:e,className:"rounded-md p-1 text-fg-4 transition-colors hover:bg-elevated hover:text-fg-3",children:l.jsx(gt,{className:"h-4 w-4"})})]}),o?l.jsx("div",{className:"flex items-center justify-center py-10",children:l.jsx(Kt,{className:"h-5 w-5 fs-spin text-fg-4"})}):a.length===0?l.jsx("p",{className:"py-10 text-center text-xs text-fg-4",children:"暂无可用账号"}):l.jsx("div",{className:"mt-3 min-h-0 flex-1 space-y-1.5 overflow-y-auto pb-[var(--safe-bottom)]",children:a.map(N=>l.jsxs("button",{type:"button",disabled:d!==null,onClick:()=>{N.active||b(N.id)},className:se("flex w-full items-center gap-2 rounded-lg border px-3 py-2.5 text-left transition-colors sm:gap-3",N.active?"border-blue-500/40 bg-blue-500/5":"border-line hover:bg-elevated",d===N.id&&"opacity-60"),children:[l.jsx("div",{className:"min-w-0 flex-1",children:l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"truncate text-xs font-medium text-fg",children:N.label}),N.active&&l.jsx("span",{className:"rounded bg-blue-500/15 px-1.5 py-0.5 text-[9px] font-semibold text-blue-500",children:"当前"}),d===N.id&&l.jsx(Kt,{className:"h-3 w-3 fs-spin text-blue-500"})]})}),l.jsxs("div",{className:"flex shrink-0 gap-2 text-right sm:gap-4",children:[l.jsxs("div",{className:"w-14 sm:w-20",children:[l.jsx("div",{className:"text-[10px] text-fg-5",children:"5h"}),g(N)?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:se("text-xs font-medium",g(N).utilization>80?"text-red-400":"text-fg-3"),children:[Math.round(g(N).utilization),"%"]}),l.jsx("div",{className:"hidden text-[9px] text-fg-5 sm:block",children:g(N).resets_at?jh(g(N).resets_at):""})]}):l.jsx("div",{className:"text-[10px] text-fg-5",children:"—"})]}),l.jsxs("div",{className:"w-14 sm:w-20",children:[l.jsx("div",{className:"text-[10px] text-fg-5",children:"7d"}),y(N)?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:se("text-xs font-medium",y(N).utilization>80?"text-red-400":"text-fg-3"),children:[Math.round(y(N).utilization),"%"]}),l.jsx("div",{className:"hidden text-[9px] text-fg-5 sm:block",children:y(N).resets_at?jh(y(N).resets_at):""})]}):l.jsx("div",{className:"text-[10px] text-fg-5",children:"—"})]})]})]},N.id))}),m&&l.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-1.5 rounded-md border border-red-400/30 bg-red-400/5 px-3 py-2",children:[l.jsx(kn,{className:"h-3.5 w-3.5 shrink-0 text-red-400"}),l.jsx("span",{className:"text-xs text-red-400",children:m})]})]})})}function JB({onStatusChange:e}){const[t,a]=_.useState(""),[s,o]=_.useState(""),[u,d]=_.useState(""),[f,m]=_.useState(""),[h,b]=_.useState(!1),[g,y]=_.useState(null),[N,v]=_.useState(!1),[S,w]=_.useState(null),[A,R]=_.useState(!1);_.useEffect(()=>{let Q=!1;return(async()=>{const[j,ee]=await Promise.all([ko().catch(()=>({})),mh().catch(()=>null)]);if(Q)return;const ue=j.cloud_master_url??"",Z=j.cloud_worker_id||(ee==null?void 0:ee.defaultWorkerId)||"";a(ue),d(ue),o(Z),m(j.cloud_worker_id??""),w(ee)})(),()=>{Q=!0}},[]);const Y=((S==null?void 0:S.mode)??(u?"worker":"local"))==="worker",B=!Y&&!!t.trim()&&!!s.trim(),C=t!==u||s!==f||B,z=async()=>{const Q=t.replace(/\/+$/,"");if(!Q)return;b(!0),y(null);const j=await vw(Q);y(j?"ok":"fail"),b(!1)},W=async()=>{const Q=t.replace(/\/+$/,""),j=s.trim();v(!0);try{await fh("cloud_master_url",Q),await fh("cloud_worker_id",j),d(Q),m(j),a(Q),o(j);const ee=await _w().catch(()=>null);ee&&(w(ee),e==null||e(ee))}finally{v(!1)}};return l.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[l.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 text-blue-500",children:l.jsx(Ey,{className:"h-4 w-4"})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"text-sm font-semibold text-fg",children:"账号池配置"}),l.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"连接 claude-accounts-pool Master,共享多账号池。"})]})]}),l.jsxs("div",{className:"mt-4 space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-line bg-base px-3 py-2",children:[l.jsx("span",{className:se("h-2 w-2 shrink-0 rounded-full",Y?"bg-blue-500 shadow-sm shadow-blue-500/60":"bg-green-500 shadow-sm shadow-green-500/60")}),l.jsx("span",{className:"text-xs font-medium text-fg-3",children:Y?"Worker 模式":"本地模式"}),Y&&(S==null?void 0:S.workerId)&&l.jsx("span",{className:"rounded bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-4",children:S.workerId}),Y&&(S==null?void 0:S.connected)!=null&&l.jsx("span",{className:se("ml-auto text-[10px] font-medium",S.connected?"text-green-500":"text-red-400"),children:S.connected?"已连接":"未连接"})]}),Y&&(S==null?void 0:S.heldAccount)&&l.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-line bg-base px-3 py-2",children:[l.jsx(Ty,{className:"h-3.5 w-3.5 shrink-0 text-blue-500"}),l.jsx("span",{className:"text-xs text-fg-4",children:"当前账号"}),l.jsx("span",{className:"min-w-0 truncate text-xs font-medium text-fg",children:S.heldAccount.label}),l.jsx("button",{type:"button",onClick:()=>R(!0),className:"ml-auto rounded-md border border-line px-2 py-0.5 text-[10px] font-medium text-fg-4 transition-colors hover:bg-elevated hover:text-fg-3",children:"切换账号"})]})]}),l.jsxs("div",{className:"mt-4 space-y-3",children:[l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Master URL"}),l.jsx("input",{type:"url",value:t,onChange:Q=>{a(Q.target.value),y(null)},placeholder:"http://100.64.0.36:8787",className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-2 font-mono text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Worker ID"}),l.jsx("input",{type:"text",value:s,onChange:Q=>o(Q.target.value),placeholder:"fourth-spark-1",className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-2 font-mono text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"}),l.jsx("span",{className:"mt-1 block text-[11px] text-fg-5",children:"此 Worker 在账号池中的唯一标识,建议用小写字母、数字和连字符。"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{type:"button",onClick:()=>void z(),disabled:h||!t.trim(),className:"flex items-center gap-1.5 rounded-md border border-line px-3 py-1.5 text-xs font-medium text-fg-3 transition-colors hover:bg-elevated disabled:opacity-40",children:[h?l.jsx(Kt,{className:"h-3.5 w-3.5 fs-spin"}):l.jsx(qs,{className:"h-3.5 w-3.5"}),"测试连接"]}),l.jsxs("button",{type:"button",onClick:()=>void W(),disabled:!C||N,className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[l.jsx(Wc,{className:"h-3.5 w-3.5"}),N?"保存中…":"保存"]}),g==="ok"&&l.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-green-500",children:[l.jsx(Cn,{className:"h-3.5 w-3.5"})," 连接成功"]}),g==="fail"&&l.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-red-400",children:[l.jsx(kn,{className:"h-3.5 w-3.5"})," 连接失败"]})]})]}),l.jsx("p",{className:"mt-4 text-[11px] text-fg-5",children:"清空 Master URL 可切回本地模式。"}),A&&l.jsx(ZB,{onClose:()=>R(!1),onSwitched:async()=>{const Q=await mh().catch(()=>null);Q&&(w(Q),e==null||e(Q))}})]})}function eP(){const[e,t]=_.useState("usage"),a=_.useMemo(()=>wy()||dh()?[...qE,PB]:qE,[]);return l.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:l.jsxs("div",{className:"mx-auto max-w-2xl",children:[l.jsx("h1",{className:"text-lg font-semibold text-fg",children:"设置"}),l.jsx("p",{className:"mt-0.5 text-sm text-fg-4",children:"全局配置"}),l.jsx("div",{className:"mt-6 flex gap-1 overflow-x-auto rounded-lg border border-line bg-surface p-1 scrollbar-none",children:a.map(s=>l.jsxs("button",{type:"button",onClick:()=>t(s.id),className:se("flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-md px-3 py-1.5 text-xs font-medium transition-colors",e===s.id?"bg-base text-fg shadow-sm":"text-fg-4 hover:text-fg-3"),children:[l.jsx(s.icon,{className:"h-3.5 w-3.5"}),s.label]},s.id))}),l.jsxs("div",{className:"mt-4",children:[e==="usage"&&l.jsx(WB,{}),e==="git"&&l.jsx(YB,{}),e==="models"&&l.jsx(XB,{}),e==="agents"&&l.jsx(qB,{}),e==="server"&&l.jsx(QB,{})]})]})})}const tP=300,nP=4e3,aP={info:{icon:"ℹ",badge:"bg-fg/10 text-fg-2",bar:"bg-fg-4"},success:{icon:"✓",badge:"bg-emerald-500/10 text-emerald-500",bar:"bg-emerald-500"},warning:{icon:"⚠",badge:"bg-amber-500/10 text-amber-500",bar:"bg-amber-500"},error:{icon:"✕",badge:"bg-red-500/10 text-red-500",bar:"bg-red-500"}};function rP(){const e=Ut(h=>h.toasts),t=Ut(h=>h.removeToast),a=Ie(h=>h.setActiveSession),s=Be(ta),o=Pn(),u=h=>{t(h.id),h.sessionId&&(a(h.sessionId),o(`/${encodeURIComponent(s)}/run`))},[d,f]=_.useState([]),m=_.useRef(new Map);return _.useEffect(()=>{const h=new Set(e.map(b=>b.id));f(b=>{let g=b.map(y=>h.has(y.id)||y.exiting?y:{...y,exiting:!0});for(const y of e)g.some(N=>N.id===y.id)||(g=[...g,{...y}]);return g})},[e]),_.useEffect(()=>{const h=m.current;for(const b of d)b.exiting&&!h.has(b.id)&&h.set(b.id,setTimeout(()=>{h.delete(b.id),f(g=>g.filter(y=>y.id!==b.id))},tP))},[d]),_.useEffect(()=>{const h=m.current;return()=>h.forEach(clearTimeout)},[]),d.length===0?null:l.jsx("div",{className:"pointer-events-none fixed top-4 right-4 z-50 flex w-[calc(100%-2rem)] max-w-sm flex-col","aria-live":"polite","aria-atomic":"false",children:d.map(h=>{const b=aP[h.variant];return l.jsx("div",{className:"grid w-full transition-[grid-template-rows] duration-300 ease-out",style:{gridTemplateRows:h.exiting?"0fr":"1fr"},children:l.jsx("div",{className:"min-h-0 overflow-hidden",children:l.jsxs("div",{role:"status",onClick:()=>u(h),style:{animation:`${h.exiting?"toast-out":"toast-in"} 0.3s ease-out forwards`},className:"pointer-events-auto relative mb-2 flex cursor-pointer items-start gap-3 overflow-hidden rounded-xl border border-line bg-surface/80 px-3.5 py-3 shadow-lg shadow-black/5 backdrop-blur-md transition-colors hover:border-line-hard hover:bg-surface/90",children:[l.jsx("span",{"aria-hidden":!0,className:`mt-px flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-xs font-semibold ${b.badge}`,children:b.icon}),l.jsx("p",{className:"min-w-0 flex-1 text-sm leading-snug break-words text-fg",children:h.message}),h.persistent&&!h.exiting&&l.jsx("button",{type:"button","aria-label":"关闭",onClick:g=>{g.stopPropagation(),t(h.id)},className:"mt-px flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-fg-4 transition-colors hover:bg-fg/10 hover:text-fg",children:"✕"}),!h.exiting&&!h.persistent&&l.jsx("span",{"aria-hidden":!0,className:`absolute bottom-0 left-0 h-0.5 w-full origin-left ${b.bar}`,style:{animation:`toast-progress ${nP}ms linear forwards`}})]})})},h.id)})})}const so=jo("PushNotifications",{});let GE=!1;async function sP(e){!wy()||GE||(GE=!0,(await so.requestPermissions()).receive!=="granted")||(so.addListener("registration",async a=>{try{await Cw(a.value,"ios")}catch{}}),so.addListener("registrationError",()=>{}),so.addListener("pushNotificationActionPerformed",a=>{const s=a.notification.data,o=s==null?void 0:s.sessionId;if(o){const u=ta(Be.getState());u&&e(`/${encodeURIComponent(u)}/run?session=${o}`)}}),await so.register())}function iP(e){const t=e.match(/^\/([^/]+)\/(run|agents|issues|pulls)/);return t?decodeURIComponent(t[1]):null}function lP(){const e=Be(s=>s.repos),a=Be(ta)??(e.length>0?e[0].name:null);return a?l.jsx(sh,{to:`/${encodeURIComponent(a)}/run`,replace:!0}):l.jsx(sh,{to:"/repos",replace:!0})}function oP(){const e=Pn(),t=ga(),a=Be(f=>f.activeRepoId),s=Be(f=>f.repos),o=Be(f=>f.setActiveRepo),u=Ie(f=>f.loadSessions),d=Ie(f=>f.clearSessions);return _.useEffect(()=>(Be.getState().loadRepos(),sP(e),ch.getState().init()),[e]),_.useEffect(()=>{if(s.length===0)return;const f=iP(t.pathname);if(!f)return;const m=s.find(h=>h.name===f);m&&m.id!==Be.getState().activeRepoId&&o(m.id)},[t.pathname,s,o]),_.useEffect(()=>(a?(d(),Ve.getState().clearIssues(),Jn.getState().clearPulls(),u(),fs.getState().loadAgents(),Ve.getState().loadIssues(),Jn.getState().loadPulls(),Lc.start(a)):(d(),Ve.getState().clearIssues(),Jn.getState().clearPulls()),()=>Lc.stop()),[a,u,d]),l.jsxs(l.Fragment,{children:[l.jsx(OS,{children:l.jsxs(ja,{element:l.jsx(jw,{}),children:[l.jsx(ja,{path:"/repos",element:l.jsx(Fw,{})}),l.jsx(ja,{path:"/settings",element:l.jsx(eP,{})}),l.jsx(ja,{path:"/:repoId/run",element:l.jsx(XL,{})}),l.jsx(ja,{path:"/:repoId/agents",element:l.jsx(kB,{})}),l.jsx(ja,{path:"/:repoId/agents/:agentId",element:l.jsx(jB,{})}),l.jsx(ja,{path:"/:repoId/issues",element:l.jsx(pB,{})}),l.jsx(ja,{path:"/:repoId/pulls",element:l.jsx(NB,{})}),l.jsx(ja,{path:"/:repoId",element:l.jsx(sh,{to:"run",replace:!0})}),l.jsx(ja,{path:"*",element:l.jsx(lP,{})})]})}),l.jsx(rP,{})]})}function uP(){return l.jsx(nA,{children:l.jsx(oP,{})})}const h_=document.getElementById("root");if(!h_)throw new Error("Root element #root not found in index.html");Cv.createRoot(h_).render(l.jsx(_.StrictMode,{children:l.jsx(uP,{})}));export{gp as W};