fourth-spark 0.10.11 → 0.10.13

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.
@@ -1,512 +0,0 @@
1
- var Sv=Object.defineProperty;var Av=(e,t,a)=>t in e?Sv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var sn=(e,t,a)=>Av(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"]'))r(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).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 r(o){if(o.ep)return;o.ep=!0;const u=a(o);fetch(o.href,u)}})();function zc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dm={exports:{}},Ql={};/**
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 tx;function Cv(){if(tx)return Ql;tx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(r,o,u){var c=null;if(u!==void 0&&(c=""+u),o.key!==void 0&&(c=""+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:r,key:c,ref:o!==void 0?o:null,props:u}}return Ql.Fragment=t,Ql.jsx=a,Ql.jsxs=a,Ql}var nx;function wv(){return nx||(nx=1,dm.exports=Cv()),dm.exports}var i=wv(),fm={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 ax;function kv(){if(ax)return Qe;ax=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=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(H){return H===null||typeof H!="object"?null:(H=y&&H[y]||H["@@iterator"],typeof H=="function"?H:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,C={};function S(H,se,L){this.props=H,this.context=se,this.refs=C,this.updater=L||v}S.prototype.isReactComponent={},S.prototype.setState=function(H,se){if(typeof H!="object"&&typeof H!="function"&&H!=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,H,se,"setState")},S.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function M(){}M.prototype=S.prototype;function O(H,se,L){this.props=H,this.context=se,this.refs=C,this.updater=L||v}var j=O.prototype=new M;j.constructor=O,A(j,S.prototype),j.isPureReactComponent=!0;var I=Array.isArray;function U(){}var $={H:null,A:null,T:null,S:null},Z=Object.prototype.hasOwnProperty;function K(H,se,L){var Ne=L.ref;return{$$typeof:e,type:H,key:se,ref:Ne!==void 0?Ne:null,props:L}}function D(H,se){return K(H.type,se,H.props)}function te(H){return typeof H=="object"&&H!==null&&H.$$typeof===e}function le(H){var se={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(L){return se[L]})}var pe=/\/+/g;function Q(H,se){return typeof H=="object"&&H!==null&&H.key!=null?le(""+H.key):se.toString(36)}function q(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status=="string"?H.then(U,U):(H.status="pending",H.then(function(se){H.status==="pending"&&(H.status="fulfilled",H.value=se)},function(se){H.status==="pending"&&(H.status="rejected",H.reason=se)})),H.status){case"fulfilled":return H.value;case"rejected":throw H.reason}}throw H}function F(H,se,L,Ne,Te){var V=typeof H;(V==="undefined"||V==="boolean")&&(H=null);var ve=!1;if(H===null)ve=!0;else switch(V){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(H.$$typeof){case e:case t:ve=!0;break;case b:return ve=H._init,F(ve(H._payload),se,L,Ne,Te)}}if(ve)return Te=Te(H),ve=Ne===""?"."+Q(H,0):Ne,I(Te)?(L="",ve!=null&&(L=ve.replace(pe,"$&/")+"/"),F(Te,se,L,"",function(xt){return xt})):Te!=null&&(te(Te)&&(Te=D(Te,L+(Te.key==null||H&&H.key===Te.key?"":(""+Te.key).replace(pe,"$&/")+"/")+ve)),se.push(Te)),1;ve=0;var Be=Ne===""?".":Ne+":";if(I(H))for(var Ue=0;Ue<H.length;Ue++)Ne=H[Ue],V=Be+Q(Ne,Ue),ve+=F(Ne,se,L,V,Te);else if(Ue=N(H),typeof Ue=="function")for(H=Ue.call(H),Ue=0;!(Ne=H.next()).done;)Ne=Ne.value,V=Be+Q(Ne,Ue++),ve+=F(Ne,se,L,V,Te);else if(V==="object"){if(typeof H.then=="function")return F(q(H),se,L,Ne,Te);throw se=String(H),Error("Objects are not valid as a React child (found: "+(se==="[object Object]"?"object with keys {"+Object.keys(H).join(", ")+"}":se)+"). If you meant to render a collection of children, use an array instead.")}return ve}function k(H,se,L){if(H==null)return H;var Ne=[],Te=0;return F(H,Ne,"","",function(V){return se.call(L,V,Te++)}),Ne}function P(H){if(H._status===-1){var se=H._result;se=se(),se.then(function(L){(H._status===0||H._status===-1)&&(H._status=1,H._result=L)},function(L){(H._status===0||H._status===-1)&&(H._status=2,H._result=L)}),H._status===-1&&(H._status=0,H._result=se)}if(H._status===1)return H._result.default;throw H._result}var J=typeof reportError=="function"?reportError:function(H){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var se=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof H=="object"&&H!==null&&typeof H.message=="string"?String(H.message):String(H),error:H});if(!window.dispatchEvent(se))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",H);return}console.error(H)},w={map:k,forEach:function(H,se,L){k(H,function(){se.apply(this,arguments)},L)},count:function(H){var se=0;return k(H,function(){se++}),se},toArray:function(H){return k(H,function(se){return se})||[]},only:function(H){if(!te(H))throw Error("React.Children.only expected to receive a single React element child.");return H}};return Qe.Activity=g,Qe.Children=w,Qe.Component=S,Qe.Fragment=a,Qe.Profiler=o,Qe.PureComponent=O,Qe.StrictMode=r,Qe.Suspense=m,Qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,Qe.__COMPILER_RUNTIME={__proto__:null,c:function(H){return $.H.useMemoCache(H)}},Qe.cache=function(H){return function(){return H.apply(null,arguments)}},Qe.cacheSignal=function(){return null},Qe.cloneElement=function(H,se,L){if(H==null)throw Error("The argument must be a React element, but you passed "+H+".");var Ne=A({},H.props),Te=H.key;if(se!=null)for(V in se.key!==void 0&&(Te=""+se.key),se)!Z.call(se,V)||V==="key"||V==="__self"||V==="__source"||V==="ref"&&se.ref===void 0||(Ne[V]=se[V]);var V=arguments.length-2;if(V===1)Ne.children=L;else if(1<V){for(var ve=Array(V),Be=0;Be<V;Be++)ve[Be]=arguments[Be+2];Ne.children=ve}return K(H.type,Te,Ne)},Qe.createContext=function(H){return H={$$typeof:c,_currentValue:H,_currentValue2:H,_threadCount:0,Provider:null,Consumer:null},H.Provider=H,H.Consumer={$$typeof:u,_context:H},H},Qe.createElement=function(H,se,L){var Ne,Te={},V=null;if(se!=null)for(Ne in se.key!==void 0&&(V=""+se.key),se)Z.call(se,Ne)&&Ne!=="key"&&Ne!=="__self"&&Ne!=="__source"&&(Te[Ne]=se[Ne]);var ve=arguments.length-2;if(ve===1)Te.children=L;else if(1<ve){for(var Be=Array(ve),Ue=0;Ue<ve;Ue++)Be[Ue]=arguments[Ue+2];Te.children=Be}if(H&&H.defaultProps)for(Ne in ve=H.defaultProps,ve)Te[Ne]===void 0&&(Te[Ne]=ve[Ne]);return K(H,V,Te)},Qe.createRef=function(){return{current:null}},Qe.forwardRef=function(H){return{$$typeof:f,render:H}},Qe.isValidElement=te,Qe.lazy=function(H){return{$$typeof:b,_payload:{_status:-1,_result:H},_init:P}},Qe.memo=function(H,se){return{$$typeof:h,type:H,compare:se===void 0?null:se}},Qe.startTransition=function(H){var se=$.T,L={};$.T=L;try{var Ne=H(),Te=$.S;Te!==null&&Te(L,Ne),typeof Ne=="object"&&Ne!==null&&typeof Ne.then=="function"&&Ne.then(U,J)}catch(V){J(V)}finally{se!==null&&L.types!==null&&(se.types=L.types),$.T=se}},Qe.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},Qe.use=function(H){return $.H.use(H)},Qe.useActionState=function(H,se,L){return $.H.useActionState(H,se,L)},Qe.useCallback=function(H,se){return $.H.useCallback(H,se)},Qe.useContext=function(H){return $.H.useContext(H)},Qe.useDebugValue=function(){},Qe.useDeferredValue=function(H,se){return $.H.useDeferredValue(H,se)},Qe.useEffect=function(H,se){return $.H.useEffect(H,se)},Qe.useEffectEvent=function(H){return $.H.useEffectEvent(H)},Qe.useId=function(){return $.H.useId()},Qe.useImperativeHandle=function(H,se,L){return $.H.useImperativeHandle(H,se,L)},Qe.useInsertionEffect=function(H,se){return $.H.useInsertionEffect(H,se)},Qe.useLayoutEffect=function(H,se){return $.H.useLayoutEffect(H,se)},Qe.useMemo=function(H,se){return $.H.useMemo(H,se)},Qe.useOptimistic=function(H,se){return $.H.useOptimistic(H,se)},Qe.useReducer=function(H,se,L){return $.H.useReducer(H,se,L)},Qe.useRef=function(H){return $.H.useRef(H)},Qe.useState=function(H){return $.H.useState(H)},Qe.useSyncExternalStore=function(H,se,L){return $.H.useSyncExternalStore(H,se,L)},Qe.useTransition=function(){return $.H.useTransition()},Qe.version="19.2.8",Qe}var sx;function Rh(){return sx||(sx=1,fm.exports=kv()),fm.exports}var T=Rh();const ac=zc(T);var mm={exports:{}},Wl={},hm={exports:{}},pm={};/**
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 rx;function Rv(){return rx||(rx=1,(function(e){function t(F,k){var P=F.length;F.push(k);e:for(;0<P;){var J=P-1>>>1,w=F[J];if(0<o(w,k))F[J]=k,F[P]=w,P=J;else break e}}function a(F){return F.length===0?null:F[0]}function r(F){if(F.length===0)return null;var k=F[0],P=F.pop();if(P!==k){F[0]=P;e:for(var J=0,w=F.length,H=w>>>1;J<H;){var se=2*(J+1)-1,L=F[se],Ne=se+1,Te=F[Ne];if(0>o(L,P))Ne<w&&0>o(Te,L)?(F[J]=Te,F[Ne]=P,J=Ne):(F[J]=L,F[se]=P,J=se);else if(Ne<w&&0>o(Te,P))F[J]=Te,F[Ne]=P,J=Ne;else break e}}return k}function o(F,k){var P=F.sortIndex-k.sortIndex;return P!==0?P:F.id-k.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 c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var m=[],h=[],b=1,g=null,y=3,N=!1,v=!1,A=!1,C=!1,S=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function j(F){for(var k=a(h);k!==null;){if(k.callback===null)r(h);else if(k.startTime<=F)r(h),k.sortIndex=k.expirationTime,t(m,k);else break;k=a(h)}}function I(F){if(A=!1,j(F),!v)if(a(m)!==null)v=!0,U||(U=!0,le());else{var k=a(h);k!==null&&q(I,k.startTime-F)}}var U=!1,$=-1,Z=5,K=-1;function D(){return C?!0:!(e.unstable_now()-K<Z)}function te(){if(C=!1,U){var F=e.unstable_now();K=F;var k=!0;try{e:{v=!1,A&&(A=!1,M($),$=-1),N=!0;var P=y;try{t:{for(j(F),g=a(m);g!==null&&!(g.expirationTime>F&&D());){var J=g.callback;if(typeof J=="function"){g.callback=null,y=g.priorityLevel;var w=J(g.expirationTime<=F);if(F=e.unstable_now(),typeof w=="function"){g.callback=w,j(F),k=!0;break t}g===a(m)&&r(m),j(F)}else r(m);g=a(m)}if(g!==null)k=!0;else{var H=a(h);H!==null&&q(I,H.startTime-F),k=!1}}break e}finally{g=null,y=P,N=!1}k=void 0}}finally{k?le():U=!1}}}var le;if(typeof O=="function")le=function(){O(te)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,Q=pe.port2;pe.port1.onmessage=te,le=function(){Q.postMessage(null)}}else le=function(){S(te,0)};function q(F,k){$=S(function(){F(e.unstable_now())},k)}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(F){F.callback=null},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(F){switch(y){case 1:case 2:case 3:var k=3;break;default:k=y}var P=y;y=k;try{return F()}finally{y=P}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(F,k){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var P=y;y=F;try{return k()}finally{y=P}},e.unstable_scheduleCallback=function(F,k,P){var J=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?J+P:J):P=J,F){case 1:var w=-1;break;case 2:w=250;break;case 5:w=1073741823;break;case 4:w=1e4;break;default:w=5e3}return w=P+w,F={id:b++,callback:k,priorityLevel:F,startTime:P,expirationTime:w,sortIndex:-1},P>J?(F.sortIndex=P,t(h,F),a(m)===null&&F===a(h)&&(A?(M($),$=-1):A=!0,q(I,P-J))):(F.sortIndex=w,t(m,F),v||N||(v=!0,U||(U=!0,le()))),F},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(F){var k=y;return function(){var P=y;y=k;try{return F.apply(this,arguments)}finally{y=P}}}})(pm)),pm}var ix;function Ov(){return ix||(ix=1,hm.exports=Rv()),hm.exports}var gm={exports:{}},wn={};/**
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 lx;function Iv(){if(lx)return wn;lx=1;var e=Rh();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 r={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 c=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 wn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,wn.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)},wn.flushSync=function(m){var h=c.T,b=r.p;try{if(c.T=null,r.p=2,m)return m()}finally{c.T=h,r.p=b,r.d.f()}},wn.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(m,h))},wn.prefetchDNS=function(m){typeof m=="string"&&r.d.D(m)},wn.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"?r.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:N}):b==="script"&&r.d.X(m,{crossOrigin:g,integrity:y,fetchPriority:N,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},wn.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);r.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&&r.d.M(m)},wn.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);r.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})}},wn.preloadModule=function(m,h){if(typeof m=="string")if(h){var b=f(h.as,h.crossOrigin);r.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 r.d.m(m)},wn.requestFormReset=function(m){r.d.r(m)},wn.unstable_batchedUpdates=function(m,h){return m(h)},wn.useFormState=function(m,h,b){return c.H.useFormState(m,h,b)},wn.useFormStatus=function(){return c.H.useHostTransitionStatus()},wn.version="19.2.8",wn}var ox;function Mv(){if(ox)return gm.exports;ox=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(),gm.exports=Iv(),gm.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 ux;function Dv(){if(ux)return Wl;ux=1;var e=Ov(),t=Rh(),a=Mv();function r(n){var s="https://react.dev/errors/"+n;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)s+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+n+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function u(n){var s=n,l=n;if(n.alternate)for(;s.return;)s=s.return;else{n=s;do s=n,(s.flags&4098)!==0&&(l=s.return),n=s.return;while(n)}return s.tag===3?l:null}function c(n){if(n.tag===13){var s=n.memoizedState;if(s===null&&(n=n.alternate,n!==null&&(s=n.memoizedState)),s!==null)return s.dehydrated}return null}function f(n){if(n.tag===31){var s=n.memoizedState;if(s===null&&(n=n.alternate,n!==null&&(s=n.memoizedState)),s!==null)return s.dehydrated}return null}function m(n){if(u(n)!==n)throw Error(r(188))}function h(n){var s=n.alternate;if(!s){if(s=u(n),s===null)throw Error(r(188));return s!==n?null:n}for(var l=n,d=s;;){var p=l.return;if(p===null)break;var x=p.alternate;if(x===null){if(d=p.return,d!==null){l=d;continue}break}if(p.child===x.child){for(x=p.child;x;){if(x===l)return m(p),n;if(x===d)return m(p),s;x=x.sibling}throw Error(r(188))}if(l.return!==d.return)l=p,d=x;else{for(var _=!1,R=p.child;R;){if(R===l){_=!0,l=p,d=x;break}if(R===d){_=!0,d=p,l=x;break}R=R.sibling}if(!_){for(R=x.child;R;){if(R===l){_=!0,l=x,d=p;break}if(R===d){_=!0,d=x,l=p;break}R=R.sibling}if(!_)throw Error(r(189))}}if(l.alternate!==d)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?n:s}function b(n){var s=n.tag;if(s===5||s===26||s===27||s===6)return n;for(n=n.child;n!==null;){if(s=b(n),s!==null)return s;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"),A=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),O=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),D=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function le(n){return n===null||typeof n!="object"?null:(n=te&&n[te]||n["@@iterator"],typeof n=="function"?n:null)}var pe=Symbol.for("react.client.reference");function Q(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===pe?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case A:return"Fragment";case S:return"Profiler";case C:return"StrictMode";case I:return"Suspense";case U:return"SuspenseList";case K:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case v:return"Portal";case O:return n.displayName||"Context";case M:return(n._context.displayName||"Context")+".Consumer";case j:var s=n.render;return n=n.displayName,n||(n=s.displayName||s.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case $:return s=n.displayName||null,s!==null?s:Q(n.type)||"Memo";case Z:s=n._payload,n=n._init;try{return Q(n(s))}catch{}}return null}var q=Array.isArray,F=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P={pending:!1,data:null,method:null,action:null},J=[],w=-1;function H(n){return{current:n}}function se(n){0>w||(n.current=J[w],J[w]=null,w--)}function L(n,s){w++,J[w]=n.current,n.current=s}var Ne=H(null),Te=H(null),V=H(null),ve=H(null);function Be(n,s){switch(L(V,s),L(Te,n),L(Ne,null),s.nodeType){case 9:case 11:n=(n=s.documentElement)&&(n=n.namespaceURI)?vb(n):0;break;default:if(n=s.tagName,s=s.namespaceURI)s=vb(s),n=Sb(s,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}se(Ne),L(Ne,n)}function Ue(){se(Ne),se(Te),se(V)}function xt(n){n.memoizedState!==null&&L(ve,n);var s=Ne.current,l=Sb(s,n.type);s!==l&&(L(Te,n),L(Ne,l))}function un(n){Te.current===n&&(se(Ne),se(Te)),ve.current===n&&(se(ve),Gl._currentValue=P)}var cn,za;function Dn(n){if(cn===void 0)try{throw Error()}catch(l){var s=l.stack.trim().match(/\n( *(at )?)/);cn=s&&s[1]||"",za=-1<l.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+cn+n+za}var $n=!1;function et(n,s){if(!n||$n)return"";$n=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(s){var ge=function(){throw Error()};if(Object.defineProperty(ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(ue){var oe=ue}Reflect.construct(n,[],ge)}else{try{ge.call()}catch(ue){oe=ue}n.call(ge.prototype)}}else{try{throw Error()}catch(ue){oe=ue}(ge=n())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(ue){if(ue&&oe&&typeof ue.stack=="string")return[ue.stack,oe.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=d.DetermineComponentFrameRoot(),_=x[0],R=x[1];if(_&&R){var G=_.split(`
44
- `),ie=R.split(`
45
- `);for(p=d=0;d<G.length&&!G[d].includes("DetermineComponentFrameRoot");)d++;for(;p<ie.length&&!ie[p].includes("DetermineComponentFrameRoot");)p++;if(d===G.length||p===ie.length)for(d=G.length-1,p=ie.length-1;1<=d&&0<=p&&G[d]!==ie[p];)p--;for(;1<=d&&0<=p;d--,p--)if(G[d]!==ie[p]){if(d!==1||p!==1)do if(d--,p--,0>p||G[d]!==ie[p]){var fe=`
46
- `+G[d].replace(" at new "," at ");return n.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",n.displayName)),fe}while(1<=d&&0<=p);break}}}finally{$n=!1,Error.prepareStackTrace=l}return(l=n?n.displayName||n.name:"")?Dn(l):""}function qn(n,s){switch(n.tag){case 26:case 27:case 5:return Dn(n.type);case 16:return Dn("Lazy");case 13:return n.child!==s&&s!==null?Dn("Suspense Fallback"):Dn("Suspense");case 19:return Dn("SuspenseList");case 0:case 15:return et(n.type,!1);case 11:return et(n.type.render,!1);case 1:return et(n.type,!0);case 31:return Dn("Activity");default:return""}}function Ln(n){try{var s="",l=null;do s+=qn(n,l),l=n,n=n.return;while(n);return s}catch(d){return`
47
- Error generating stack: `+d.message+`
48
- `+d.stack}}var Yn=Object.prototype.hasOwnProperty,Da=e.unstable_scheduleCallback,be=e.unstable_cancelCallback,ct=e.unstable_shouldYield,ia=e.unstable_requestPaint,It=e.unstable_now,Qr=e.unstable_getCurrentPriorityLevel,de=e.unstable_ImmediatePriority,Ae=e.unstable_UserBlockingPriority,ze=e.unstable_NormalPriority,tt=e.unstable_LowPriority,mt=e.unstable_IdlePriority,jn=e.log,La=e.unstable_setDisableYieldValue,gn=null,zt=null;function Sn(n){if(typeof jn=="function"&&La(n),zt&&typeof zt.setStrictMode=="function")try{zt.setStrictMode(gn,n)}catch{}}var Et=Math.clz32?Math.clz32:Fo,$a=Math.log,Bn=Math.LN2;function Fo(n){return n>>>=0,n===0?32:31-($a(n)/Bn|0)|0}var dr=256,Wr=262144,fr=4194304;function Gn(n){var s=n&42;if(s!==0)return s;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function X(n,s,l){var d=n.pendingLanes;if(d===0)return 0;var p=0,x=n.suspendedLanes,_=n.pingedLanes;n=n.warmLanes;var R=d&134217727;return R!==0?(d=R&~x,d!==0?p=Gn(d):(_&=R,_!==0?p=Gn(_):l||(l=R&~n,l!==0&&(p=Gn(l))))):(R=d&~x,R!==0?p=Gn(R):_!==0?p=Gn(_):l||(l=d&~n,l!==0&&(p=Gn(l)))),p===0?0:s!==0&&s!==p&&(s&x)===0&&(x=p&-p,l=s&-s,x>=l||x===32&&(l&4194048)!==0)?s:p}function me(n,s){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&s)===0}function we(n,s){switch(n){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ke(){var n=fr;return fr<<=1,(fr&62914560)===0&&(fr=4194304),n}function Dt(n){for(var s=[],l=0;31>l;l++)s.push(n);return s}function wt(n,s){n.pendingLanes|=s,s!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Me(n,s,l,d,p,x){var _=n.pendingLanes;n.pendingLanes=l,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=l,n.entangledLanes&=l,n.errorRecoveryDisabledLanes&=l,n.shellSuspendCounter=0;var R=n.entanglements,G=n.expirationTimes,ie=n.hiddenUpdates;for(l=_&~l;0<l;){var fe=31-Et(l),ge=1<<fe;R[fe]=0,G[fe]=-1;var oe=ie[fe];if(oe!==null)for(ie[fe]=null,fe=0;fe<oe.length;fe++){var ue=oe[fe];ue!==null&&(ue.lane&=-536870913)}l&=~ge}d!==0&&Oe(n,d,0),x!==0&&p===0&&n.tag!==0&&(n.suspendedLanes|=x&~(_&~s))}function Oe(n,s,l){n.pendingLanes|=s,n.suspendedLanes&=~s;var d=31-Et(s);n.entangledLanes|=s,n.entanglements[d]=n.entanglements[d]|1073741824|l&261930}function Ye(n,s){var l=n.entangledLanes|=s;for(n=n.entanglements;l;){var d=31-Et(l),p=1<<d;p&s|n[d]&s&&(n[d]|=s),l&=~p}}function Yt(n,s){var l=s&-s;return l=(l&42)!==0?1:Bt(l),(l&(n.suspendedLanes|s))!==0?0:l}function Bt(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 as(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Zr(){var n=k.p;return n!==0?n:(n=window.event,n===void 0?32:Vb(n.type))}function Jr(n,s){var l=k.p;try{return k.p=n,s()}finally{k.p=l}}var qa=Math.random().toString(36).slice(2),Gt="__reactFiber$"+qa,An="__reactProps$"+qa,ks="__reactContainer$"+qa,al="__reactEvents$"+qa,zo="__reactListeners$"+qa,ei="__reactHandles$"+qa,$o="__reactResources$"+qa,mr="__reactMarker$"+qa;function sl(n){delete n[Gt],delete n[An],delete n[al],delete n[zo],delete n[ei]}function Pn(n){var s=n[Gt];if(s)return s;for(var l=n.parentNode;l;){if(s=l[ks]||l[Gt]){if(l=s.alternate,s.child!==null||l!==null&&l.child!==null)for(n=Ib(n);n!==null;){if(l=n[Gt])return l;n=Ib(n)}return s}n=l,l=n.parentNode}return null}function ss(n){if(n=n[Gt]||n[ks]){var s=n.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return n}return null}function Rs(n){var s=n.tag;if(s===5||s===26||s===27||s===6)return n.stateNode;throw Error(r(33))}function Os(n){var s=n[$o];return s||(s=n[$o]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Zt(n){n[mr]=!0}var qo=new Set,hr={};function rs(n,s){ye(n,s),ye(n+"Capture",s)}function ye(n,s){for(hr[n]=s,n=0;n<s.length;n++)qo.add(s[n])}var Pe=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]*$"),nt={},yt={};function Kt(n){return Yn.call(yt,n)?!0:Yn.call(nt,n)?!1:Pe.test(n)?yt[n]=!0:(nt[n]=!0,!1)}function Cn(n,s,l){if(Kt(s))if(l===null)n.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":n.removeAttribute(s);return;case"boolean":var d=s.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){n.removeAttribute(s);return}}n.setAttribute(s,""+l)}}function la(n,s,l){if(l===null)n.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(s);return}n.setAttribute(s,""+l)}}function Kn(n,s,l,d){if(d===null)n.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(l);return}n.setAttributeNS(s,l,""+d)}}function Mt(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function oa(n){var s=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Yo(n,s,l){var d=Object.getOwnPropertyDescriptor(n.constructor.prototype,s);if(!n.hasOwnProperty(s)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var p=d.get,x=d.set;return Object.defineProperty(n,s,{configurable:!0,get:function(){return p.call(this)},set:function(_){l=""+_,x.call(this,_)}}),Object.defineProperty(n,s,{enumerable:d.enumerable}),{getValue:function(){return l},setValue:function(_){l=""+_},stopTracking:function(){n._valueTracker=null,delete n[s]}}}}function ti(n){if(!n._valueTracker){var s=oa(n)?"checked":"value";n._valueTracker=Yo(n,s,""+n[s])}}function rl(n){if(!n)return!1;var s=n._valueTracker;if(!s)return!0;var l=s.getValue(),d="";return n&&(d=oa(n)?n.checked?"true":"false":n.value),n=d,n!==l?(s.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 ud=/[\n"\\]/g;function Vn(n){return n.replace(ud,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function il(n,s,l,d,p,x,_,R){n.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?n.type=_:n.removeAttribute("type"),s!=null?_==="number"?(s===0&&n.value===""||n.value!=s)&&(n.value=""+Mt(s)):n.value!==""+Mt(s)&&(n.value=""+Mt(s)):_!=="submit"&&_!=="reset"||n.removeAttribute("value"),s!=null?ai(n,_,Mt(s)):l!=null?ai(n,_,Mt(l)):d!=null&&n.removeAttribute("value"),p==null&&x!=null&&(n.defaultChecked=!!x),p!=null&&(n.checked=p&&typeof p!="function"&&typeof p!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?n.name=""+Mt(R):n.removeAttribute("name")}function pr(n,s,l,d,p,x,_,R){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(n.type=x),s!=null||l!=null){if(!(x!=="submit"&&x!=="reset"||s!=null)){ti(n);return}l=l!=null?""+Mt(l):"",s=s!=null?""+Mt(s):l,R||s===n.value||(n.value=s),n.defaultValue=s}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,n.checked=R?n.checked:!!d,n.defaultChecked=!!d,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(n.name=_),ti(n)}function ai(n,s,l){s==="number"&&ni(n.ownerDocument)===n||n.defaultValue===""+l||(n.defaultValue=""+l)}function bn(n,s,l,d){if(n=n.options,s){s={};for(var p=0;p<l.length;p++)s["$"+l[p]]=!0;for(l=0;l<n.length;l++)p=s.hasOwnProperty("$"+n[l].value),n[l].selected!==p&&(n[l].selected=p),p&&d&&(n[l].defaultSelected=!0)}else{for(l=""+Mt(l),s=null,p=0;p<n.length;p++){if(n[p].value===l){n[p].selected=!0,d&&(n[p].defaultSelected=!0);return}s!==null||n[p].disabled||(s=n[p])}s!==null&&(s.selected=!0)}}function Go(n,s,l){if(s!=null&&(s=""+Mt(s),s!==n.value&&(n.value=s),l==null)){n.defaultValue!==s&&(n.defaultValue=s);return}n.defaultValue=l!=null?""+Mt(l):""}function si(n,s,l,d){if(s==null){if(d!=null){if(l!=null)throw Error(r(92));if(q(d)){if(1<d.length)throw Error(r(93));d=d[0]}l=d}l==null&&(l=""),s=l}l=Mt(s),n.defaultValue=l,d=n.textContent,d===l&&d!==""&&d!==null&&(n.value=d),ti(n)}function qe(n,s){if(s){var l=n.firstChild;if(l&&l===n.lastChild&&l.nodeType===3){l.nodeValue=s;return}}n.textContent=s}var Ko=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 Jt(n,s,l){var d=s.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?d?n.setProperty(s,""):s==="float"?n.cssFloat="":n[s]="":d?n.setProperty(s,l):typeof l!="number"||l===0||Ko.has(s)?s==="float"?n.cssFloat=l:n[s]=(""+l).trim():n[s]=l+"px"}function Nt(n,s,l){if(s!=null&&typeof s!="object")throw Error(r(62));if(n=n.style,l!=null){for(var d in l)!l.hasOwnProperty(d)||s!=null&&s.hasOwnProperty(d)||(d.indexOf("--")===0?n.setProperty(d,""):d==="float"?n.cssFloat="":n[d]="");for(var p in s)d=s[p],s.hasOwnProperty(p)&&l[p]!==d&&Jt(n,p,d)}else for(var x in s)s.hasOwnProperty(x)&&Jt(n,x,s[x])}function Is(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 is=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"]]),ll=/^[\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 Ms(n){return ll.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function Ce(){}var De=null;function We(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var lt=null,Ft=null;function ya(n){var s=ss(n);if(s&&(n=s.stateNode)){var l=n[An]||null;e:switch(n=s.stateNode,s.type){case"input":if(il(n,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),s=l.name,l.type==="radio"&&s!=null){for(l=n;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Vn(""+s)+'"][type="radio"]'),s=0;s<l.length;s++){var d=l[s];if(d!==n&&d.form===n.form){var p=d[An]||null;if(!p)throw Error(r(90));il(d,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(s=0;s<l.length;s++)d=l[s],d.form===n.form&&rl(d)}break e;case"textarea":Go(n,l.value,l.defaultValue);break e;case"select":s=l.value,s!=null&&bn(n,!!l.multiple,s,!1)}}}var ol=!1;function Vo(n,s,l){if(ol)return n(s,l);ol=!0;try{var d=n(s);return d}finally{if(ol=!1,(lt!==null||Ft!==null)&&(Lu(),lt&&(s=lt,n=Ft,Ft=lt=null,ya(s),n)))for(s=0;s<n.length;s++)ya(n[s])}}function ul(n,s){var l=n.stateNode;if(l===null)return null;var d=l[An]||null;if(d===null)return null;l=d[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(n=n.type,d=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!d;break e;default:n=!1}if(n)return null;if(l&&typeof l!="function")throw Error(r(231,s,typeof l));return l}var ls=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cd=!1;if(ls)try{var cl={};Object.defineProperty(cl,"passive",{get:function(){cd=!0}}),window.addEventListener("test",cl,cl),window.removeEventListener("test",cl,cl)}catch{cd=!1}var Ds=null,dd=null,Xo=null;function Sp(){if(Xo)return Xo;var n,s=dd,l=s.length,d,p="value"in Ds?Ds.value:Ds.textContent,x=p.length;for(n=0;n<l&&s[n]===p[n];n++);var _=l-n;for(d=1;d<=_&&s[l-d]===p[x-d];d++);return Xo=p.slice(n,1<d?1-d:void 0)}function Qo(n){var s=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&s===13&&(n=13)):n=s,n===10&&(n=13),32<=n||n===13?n:0}function Wo(){return!0}function Ap(){return!1}function Xn(n){function s(l,d,p,x,_){this._reactName=l,this._targetInst=p,this.type=d,this.nativeEvent=x,this.target=_,this.currentTarget=null;for(var R in n)n.hasOwnProperty(R)&&(l=n[R],this[R]=l?l(x):x[R]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Wo:Ap,this.isPropagationStopped=Ap,this}return g(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Wo)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Wo)},persist:function(){},isPersistent:Wo}),s}var gr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zo=Xn(gr),dl=g({},gr,{view:0,detail:0}),__=Xn(dl),fd,md,fl,Jo=g({},dl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pd,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!==fl&&(fl&&n.type==="mousemove"?(fd=n.screenX-fl.screenX,md=n.screenY-fl.screenY):md=fd=0,fl=n),fd)},movementY:function(n){return"movementY"in n?n.movementY:md}}),Cp=Xn(Jo),v_=g({},Jo,{dataTransfer:0}),S_=Xn(v_),A_=g({},dl,{relatedTarget:0}),hd=Xn(A_),C_=g({},gr,{animationName:0,elapsedTime:0,pseudoElement:0}),w_=Xn(C_),k_=g({},gr,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),R_=Xn(k_),O_=g({},gr,{data:0}),wp=Xn(O_),I_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},M_={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"},D_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function L_(n){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(n):(n=D_[n])?!!s[n]:!1}function pd(){return L_}var j_=g({},dl,{key:function(n){if(n.key){var s=I_[n.key]||n.key;if(s!=="Unidentified")return s}return n.type==="keypress"?(n=Qo(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?M_[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pd,charCode:function(n){return n.type==="keypress"?Qo(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Qo(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),B_=Xn(j_),P_=g({},Jo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),kp=Xn(P_),U_=g({},dl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pd}),H_=Xn(U_),F_=g({},gr,{propertyName:0,elapsedTime:0,pseudoElement:0}),z_=Xn(F_),$_=g({},Jo,{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}),q_=Xn($_),Y_=g({},gr,{newState:0,oldState:0}),G_=Xn(Y_),K_=[9,13,27,32],gd=ls&&"CompositionEvent"in window,ml=null;ls&&"documentMode"in document&&(ml=document.documentMode);var V_=ls&&"TextEvent"in window&&!ml,Rp=ls&&(!gd||ml&&8<ml&&11>=ml),Op=" ",Ip=!1;function Mp(n,s){switch(n){case"keyup":return K_.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Dp(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var ri=!1;function X_(n,s){switch(n){case"compositionend":return Dp(s);case"keypress":return s.which!==32?null:(Ip=!0,Op);case"textInput":return n=s.data,n===Op&&Ip?null:n;default:return null}}function Q_(n,s){if(ri)return n==="compositionend"||!gd&&Mp(n,s)?(n=Sp(),Xo=dd=Ds=null,ri=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return Rp&&s.locale!=="ko"?null:s.data;default:return null}}var W_={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 Lp(n){var s=n&&n.nodeName&&n.nodeName.toLowerCase();return s==="input"?!!W_[n.type]:s==="textarea"}function jp(n,s,l,d){lt?Ft?Ft.push(d):Ft=[d]:lt=d,s=zu(s,"onChange"),0<s.length&&(l=new Zo("onChange","change",null,l,d),n.push({event:l,listeners:s}))}var hl=null,pl=null;function Z_(n){xb(n,0)}function eu(n){var s=Rs(n);if(rl(s))return n}function Bp(n,s){if(n==="change")return s}var Pp=!1;if(ls){var bd;if(ls){var xd="oninput"in document;if(!xd){var Up=document.createElement("div");Up.setAttribute("oninput","return;"),xd=typeof Up.oninput=="function"}bd=xd}else bd=!1;Pp=bd&&(!document.documentMode||9<document.documentMode)}function Hp(){hl&&(hl.detachEvent("onpropertychange",Fp),pl=hl=null)}function Fp(n){if(n.propertyName==="value"&&eu(pl)){var s=[];jp(s,pl,n,We(n)),Vo(Z_,s)}}function J_(n,s,l){n==="focusin"?(Hp(),hl=s,pl=l,hl.attachEvent("onpropertychange",Fp)):n==="focusout"&&Hp()}function e2(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return eu(pl)}function t2(n,s){if(n==="click")return eu(s)}function n2(n,s){if(n==="input"||n==="change")return eu(s)}function a2(n,s){return n===s&&(n!==0||1/n===1/s)||n!==n&&s!==s}var ua=typeof Object.is=="function"?Object.is:a2;function gl(n,s){if(ua(n,s))return!0;if(typeof n!="object"||n===null||typeof s!="object"||s===null)return!1;var l=Object.keys(n),d=Object.keys(s);if(l.length!==d.length)return!1;for(d=0;d<l.length;d++){var p=l[d];if(!Yn.call(s,p)||!ua(n[p],s[p]))return!1}return!0}function zp(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function $p(n,s){var l=zp(n);n=0;for(var d;l;){if(l.nodeType===3){if(d=n+l.textContent.length,n<=s&&d>=s)return{node:l,offset:s-n};n=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=zp(l)}}function qp(n,s){return n&&s?n===s?!0:n&&n.nodeType===3?!1:s&&s.nodeType===3?qp(n,s.parentNode):"contains"in n?n.contains(s):n.compareDocumentPosition?!!(n.compareDocumentPosition(s)&16):!1:!1}function Yp(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var s=ni(n.document);s instanceof n.HTMLIFrameElement;){try{var l=typeof s.contentWindow.location.href=="string"}catch{l=!1}if(l)n=s.contentWindow;else break;s=ni(n.document)}return s}function Ed(n){var s=n&&n.nodeName&&n.nodeName.toLowerCase();return s&&(s==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||s==="textarea"||n.contentEditable==="true")}var s2=ls&&"documentMode"in document&&11>=document.documentMode,ii=null,yd=null,bl=null,Nd=!1;function Gp(n,s,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Nd||ii==null||ii!==ni(d)||(d=ii,"selectionStart"in d&&Ed(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),bl&&gl(bl,d)||(bl=d,d=zu(yd,"onSelect"),0<d.length&&(s=new Zo("onSelect","select",null,s,l),n.push({event:s,listeners:d}),s.target=ii)))}function br(n,s){var l={};return l[n.toLowerCase()]=s.toLowerCase(),l["Webkit"+n]="webkit"+s,l["Moz"+n]="moz"+s,l}var li={animationend:br("Animation","AnimationEnd"),animationiteration:br("Animation","AnimationIteration"),animationstart:br("Animation","AnimationStart"),transitionrun:br("Transition","TransitionRun"),transitionstart:br("Transition","TransitionStart"),transitioncancel:br("Transition","TransitionCancel"),transitionend:br("Transition","TransitionEnd")},Td={},Kp={};ls&&(Kp=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 xr(n){if(Td[n])return Td[n];if(!li[n])return n;var s=li[n],l;for(l in s)if(s.hasOwnProperty(l)&&l in Kp)return Td[n]=s[l];return n}var Vp=xr("animationend"),Xp=xr("animationiteration"),Qp=xr("animationstart"),r2=xr("transitionrun"),i2=xr("transitionstart"),l2=xr("transitioncancel"),Wp=xr("transitionend"),Zp=new Map,_d="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(" ");_d.push("scrollEnd");function ja(n,s){Zp.set(n,s),rs(s,[n])}var tu=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Na=[],oi=0,vd=0;function nu(){for(var n=oi,s=vd=oi=0;s<n;){var l=Na[s];Na[s++]=null;var d=Na[s];Na[s++]=null;var p=Na[s];Na[s++]=null;var x=Na[s];if(Na[s++]=null,d!==null&&p!==null){var _=d.pending;_===null?p.next=p:(p.next=_.next,_.next=p),d.pending=p}x!==0&&Jp(l,p,x)}}function au(n,s,l,d){Na[oi++]=n,Na[oi++]=s,Na[oi++]=l,Na[oi++]=d,vd|=d,n.lanes|=d,n=n.alternate,n!==null&&(n.lanes|=d)}function Sd(n,s,l,d){return au(n,s,l,d),su(n)}function Er(n,s){return au(n,null,null,s),su(n)}function Jp(n,s,l){n.lanes|=l;var d=n.alternate;d!==null&&(d.lanes|=l);for(var p=!1,x=n.return;x!==null;)x.childLanes|=l,d=x.alternate,d!==null&&(d.childLanes|=l),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&&s!==null&&(p=31-Et(l),n=x.hiddenUpdates,d=n[p],d===null?n[p]=[s]:d.push(s),s.lane=l|536870912),x):null}function su(n){if(50<Ul)throw Ul=0,Lf=null,Error(r(185));for(var s=n.return;s!==null;)n=s,s=n.return;return n.tag===3?n.stateNode:null}var ui={};function o2(n,s,l,d){this.tag=n,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ca(n,s,l,d){return new o2(n,s,l,d)}function Ad(n){return n=n.prototype,!(!n||!n.isReactComponent)}function os(n,s){var l=n.alternate;return l===null?(l=ca(n.tag,s,n.key,n.mode),l.elementType=n.elementType,l.type=n.type,l.stateNode=n.stateNode,l.alternate=n,n.alternate=l):(l.pendingProps=s,l.type=n.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=n.flags&65011712,l.childLanes=n.childLanes,l.lanes=n.lanes,l.child=n.child,l.memoizedProps=n.memoizedProps,l.memoizedState=n.memoizedState,l.updateQueue=n.updateQueue,s=n.dependencies,l.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},l.sibling=n.sibling,l.index=n.index,l.ref=n.ref,l.refCleanup=n.refCleanup,l}function e0(n,s){n.flags&=65011714;var l=n.alternate;return l===null?(n.childLanes=0,n.lanes=s,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=l.childLanes,n.lanes=l.lanes,n.child=l.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=l.memoizedProps,n.memoizedState=l.memoizedState,n.updateQueue=l.updateQueue,n.type=l.type,s=l.dependencies,n.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),n}function ru(n,s,l,d,p,x){var _=0;if(d=n,typeof n=="function")Ad(n)&&(_=1);else if(typeof n=="string")_=mv(n,l,Ne.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case K:return n=ca(31,l,s,p),n.elementType=K,n.lanes=x,n;case A:return yr(l.children,p,x,s);case C:_=8,p|=24;break;case S:return n=ca(12,l,s,p|2),n.elementType=S,n.lanes=x,n;case I:return n=ca(13,l,s,p),n.elementType=I,n.lanes=x,n;case U:return n=ca(19,l,s,p),n.elementType=U,n.lanes=x,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case O:_=10;break e;case M:_=9;break e;case j:_=11;break e;case $:_=14;break e;case Z:_=16,d=null;break e}_=29,l=Error(r(130,n===null?"null":typeof n,"")),d=null}return s=ca(_,l,s,p),s.elementType=n,s.type=d,s.lanes=x,s}function yr(n,s,l,d){return n=ca(7,n,d,s),n.lanes=l,n}function Cd(n,s,l){return n=ca(6,n,null,s),n.lanes=l,n}function t0(n){var s=ca(18,null,null,0);return s.stateNode=n,s}function wd(n,s,l){return s=ca(4,n.children!==null?n.children:[],n.key,s),s.lanes=l,s.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},s}var n0=new WeakMap;function Ta(n,s){if(typeof n=="object"&&n!==null){var l=n0.get(n);return l!==void 0?l:(s={value:n,source:s,stack:Ln(s)},n0.set(n,s),s)}return{value:n,source:s,stack:Ln(s)}}var ci=[],di=0,iu=null,xl=0,_a=[],va=0,Ls=null,Ya=1,Ga="";function us(n,s){ci[di++]=xl,ci[di++]=iu,iu=n,xl=s}function a0(n,s,l){_a[va++]=Ya,_a[va++]=Ga,_a[va++]=Ls,Ls=n;var d=Ya;n=Ga;var p=32-Et(d)-1;d&=~(1<<p),l+=1;var x=32-Et(s)+p;if(30<x){var _=p-p%5;x=(d&(1<<_)-1).toString(32),d>>=_,p-=_,Ya=1<<32-Et(s)+p|l<<p|d,Ga=x+n}else Ya=1<<x|l<<p|d,Ga=n}function kd(n){n.return!==null&&(us(n,1),a0(n,1,0))}function Rd(n){for(;n===iu;)iu=ci[--di],ci[di]=null,xl=ci[--di],ci[di]=null;for(;n===Ls;)Ls=_a[--va],_a[va]=null,Ga=_a[--va],_a[va]=null,Ya=_a[--va],_a[va]=null}function s0(n,s){_a[va++]=Ya,_a[va++]=Ga,_a[va++]=Ls,Ya=s.id,Ga=s.overflow,Ls=n}var xn=null,Lt=null,dt=!1,js=null,Sa=!1,Od=Error(r(519));function Bs(n){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw El(Ta(s,n)),Od}function r0(n){var s=n.stateNode,l=n.type,d=n.memoizedProps;switch(s[Gt]=n,s[An]=d,l){case"dialog":rt("cancel",s),rt("close",s);break;case"iframe":case"object":case"embed":rt("load",s);break;case"video":case"audio":for(l=0;l<Fl.length;l++)rt(Fl[l],s);break;case"source":rt("error",s);break;case"img":case"image":case"link":rt("error",s),rt("load",s);break;case"details":rt("toggle",s);break;case"input":rt("invalid",s),pr(s,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":rt("invalid",s);break;case"textarea":rt("invalid",s),si(s,d.value,d.defaultValue,d.children)}l=d.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||s.textContent===""+l||d.suppressHydrationWarning===!0||Tb(s.textContent,l)?(d.popover!=null&&(rt("beforetoggle",s),rt("toggle",s)),d.onScroll!=null&&rt("scroll",s),d.onScrollEnd!=null&&rt("scrollend",s),d.onClick!=null&&(s.onclick=Ce),s=!0):s=!1,s||Bs(n,!0)}function i0(n){for(xn=n.return;xn;)switch(xn.tag){case 5:case 31:case 13:Sa=!1;return;case 27:case 3:Sa=!0;return;default:xn=xn.return}}function fi(n){if(n!==xn)return!1;if(!dt)return i0(n),dt=!0,!1;var s=n.tag,l;if((l=s!==3&&s!==27)&&((l=s===5)&&(l=n.type,l=!(l!=="form"&&l!=="button")||Qf(n.type,n.memoizedProps)),l=!l),l&&Lt&&Bs(n),i0(n),s===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));Lt=Ob(n)}else if(s===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));Lt=Ob(n)}else s===27?(s=Lt,Ws(n.type)?(n=tm,tm=null,Lt=n):Lt=s):Lt=xn?Ca(n.stateNode.nextSibling):null;return!0}function Nr(){Lt=xn=null,dt=!1}function Id(){var n=js;return n!==null&&(Jn===null?Jn=n:Jn.push.apply(Jn,n),js=null),n}function El(n){js===null?js=[n]:js.push(n)}var Md=H(null),Tr=null,cs=null;function Ps(n,s,l){L(Md,s._currentValue),s._currentValue=l}function ds(n){n._currentValue=Md.current,se(Md)}function Dd(n,s,l){for(;n!==null;){var d=n.alternate;if((n.childLanes&s)!==s?(n.childLanes|=s,d!==null&&(d.childLanes|=s)):d!==null&&(d.childLanes&s)!==s&&(d.childLanes|=s),n===l)break;n=n.return}}function Ld(n,s,l,d){var p=n.child;for(p!==null&&(p.return=n);p!==null;){var x=p.dependencies;if(x!==null){var _=p.child;x=x.firstContext;e:for(;x!==null;){var R=x;x=p;for(var G=0;G<s.length;G++)if(R.context===s[G]){x.lanes|=l,R=x.alternate,R!==null&&(R.lanes|=l),Dd(x.return,l,n),d||(_=null);break e}x=R.next}}else if(p.tag===18){if(_=p.return,_===null)throw Error(r(341));_.lanes|=l,x=_.alternate,x!==null&&(x.lanes|=l),Dd(_,l,n),_=null}else _=p.child;if(_!==null)_.return=p;else for(_=p;_!==null;){if(_===n){_=null;break}if(p=_.sibling,p!==null){p.return=_.return,_=p;break}_=_.return}p=_}}function mi(n,s,l,d){n=null;for(var p=s,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 _=p.alternate;if(_===null)throw Error(r(387));if(_=_.memoizedProps,_!==null){var R=p.type;ua(p.pendingProps.value,_.value)||(n!==null?n.push(R):n=[R])}}else if(p===ve.current){if(_=p.alternate,_===null)throw Error(r(387));_.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(n!==null?n.push(Gl):n=[Gl])}p=p.return}n!==null&&Ld(s,n,l,d),s.flags|=262144}function lu(n){for(n=n.firstContext;n!==null;){if(!ua(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function _r(n){Tr=n,cs=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function En(n){return l0(Tr,n)}function ou(n,s){return Tr===null&&_r(n),l0(n,s)}function l0(n,s){var l=s._currentValue;if(s={context:s,memoizedValue:l,next:null},cs===null){if(n===null)throw Error(r(308));cs=s,n.dependencies={lanes:0,firstContext:s},n.flags|=524288}else cs=cs.next=s;return l}var u2=typeof AbortController<"u"?AbortController:function(){var n=[],s=this.signal={aborted:!1,addEventListener:function(l,d){n.push(d)}};this.abort=function(){s.aborted=!0,n.forEach(function(l){return l()})}},c2=e.unstable_scheduleCallback,d2=e.unstable_NormalPriority,en={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function jd(){return{controller:new u2,data:new Map,refCount:0}}function yl(n){n.refCount--,n.refCount===0&&c2(d2,function(){n.controller.abort()})}var Nl=null,Bd=0,hi=0,pi=null;function f2(n,s){if(Nl===null){var l=Nl=[];Bd=0,hi=Ff(),pi={status:"pending",value:void 0,then:function(d){l.push(d)}}}return Bd++,s.then(o0,o0),s}function o0(){if(--Bd===0&&Nl!==null){pi!==null&&(pi.status="fulfilled");var n=Nl;Nl=null,hi=0,pi=null;for(var s=0;s<n.length;s++)(0,n[s])()}}function m2(n,s){var l=[],d={status:"pending",value:null,reason:null,then:function(p){l.push(p)}};return n.then(function(){d.status="fulfilled",d.value=s;for(var p=0;p<l.length;p++)(0,l[p])(s)},function(p){for(d.status="rejected",d.reason=p,p=0;p<l.length;p++)(0,l[p])(void 0)}),d}var u0=F.S;F.S=function(n,s){Gg=It(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&f2(n,s),u0!==null&&u0(n,s)};var vr=H(null);function Pd(){var n=vr.current;return n!==null?n:kt.pooledCache}function uu(n,s){s===null?L(vr,vr.current):L(vr,s.pool)}function c0(){var n=Pd();return n===null?null:{parent:en._currentValue,pool:n}}var gi=Error(r(460)),Ud=Error(r(474)),cu=Error(r(542)),du={then:function(){}};function d0(n){return n=n.status,n==="fulfilled"||n==="rejected"}function f0(n,s,l){switch(l=n[l],l===void 0?n.push(s):l!==s&&(s.then(Ce,Ce),s=l),s.status){case"fulfilled":return s.value;case"rejected":throw n=s.reason,h0(n),n;default:if(typeof s.status=="string")s.then(Ce,Ce);else{if(n=kt,n!==null&&100<n.shellSuspendCounter)throw Error(r(482));n=s,n.status="pending",n.then(function(d){if(s.status==="pending"){var p=s;p.status="fulfilled",p.value=d}},function(d){if(s.status==="pending"){var p=s;p.status="rejected",p.reason=d}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw n=s.reason,h0(n),n}throw Ar=s,gi}}function Sr(n){try{var s=n._init;return s(n._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Ar=l,gi):l}}var Ar=null;function m0(){if(Ar===null)throw Error(r(459));var n=Ar;return Ar=null,n}function h0(n){if(n===gi||n===cu)throw Error(r(483))}var bi=null,Tl=0;function fu(n){var s=Tl;return Tl+=1,bi===null&&(bi=[]),f0(bi,n,s)}function _l(n,s){s=s.props.ref,n.ref=s!==void 0?s:null}function mu(n,s){throw s.$$typeof===y?Error(r(525)):(n=Object.prototype.toString.call(s),Error(r(31,n==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":n)))}function p0(n){function s(ee,W){if(n){var re=ee.deletions;re===null?(ee.deletions=[W],ee.flags|=16):re.push(W)}}function l(ee,W){if(!n)return null;for(;W!==null;)s(ee,W),W=W.sibling;return null}function d(ee){for(var W=new Map;ee!==null;)ee.key!==null?W.set(ee.key,ee):W.set(ee.index,ee),ee=ee.sibling;return W}function p(ee,W){return ee=os(ee,W),ee.index=0,ee.sibling=null,ee}function x(ee,W,re){return ee.index=re,n?(re=ee.alternate,re!==null?(re=re.index,re<W?(ee.flags|=67108866,W):re):(ee.flags|=67108866,W)):(ee.flags|=1048576,W)}function _(ee){return n&&ee.alternate===null&&(ee.flags|=67108866),ee}function R(ee,W,re,he){return W===null||W.tag!==6?(W=Cd(re,ee.mode,he),W.return=ee,W):(W=p(W,re),W.return=ee,W)}function G(ee,W,re,he){var He=re.type;return He===A?fe(ee,W,re.props.children,he,re.key):W!==null&&(W.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===Z&&Sr(He)===W.type)?(W=p(W,re.props),_l(W,re),W.return=ee,W):(W=ru(re.type,re.key,re.props,null,ee.mode,he),_l(W,re),W.return=ee,W)}function ie(ee,W,re,he){return W===null||W.tag!==4||W.stateNode.containerInfo!==re.containerInfo||W.stateNode.implementation!==re.implementation?(W=wd(re,ee.mode,he),W.return=ee,W):(W=p(W,re.children||[]),W.return=ee,W)}function fe(ee,W,re,he,He){return W===null||W.tag!==7?(W=yr(re,ee.mode,he,He),W.return=ee,W):(W=p(W,re),W.return=ee,W)}function ge(ee,W,re){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return W=Cd(""+W,ee.mode,re),W.return=ee,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case N:return re=ru(W.type,W.key,W.props,null,ee.mode,re),_l(re,W),re.return=ee,re;case v:return W=wd(W,ee.mode,re),W.return=ee,W;case Z:return W=Sr(W),ge(ee,W,re)}if(q(W)||le(W))return W=yr(W,ee.mode,re,null),W.return=ee,W;if(typeof W.then=="function")return ge(ee,fu(W),re);if(W.$$typeof===O)return ge(ee,ou(ee,W),re);mu(ee,W)}return null}function oe(ee,W,re,he){var He=W!==null?W.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return He!==null?null:R(ee,W,""+re,he);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case N:return re.key===He?G(ee,W,re,he):null;case v:return re.key===He?ie(ee,W,re,he):null;case Z:return re=Sr(re),oe(ee,W,re,he)}if(q(re)||le(re))return He!==null?null:fe(ee,W,re,he,null);if(typeof re.then=="function")return oe(ee,W,fu(re),he);if(re.$$typeof===O)return oe(ee,W,ou(ee,re),he);mu(ee,re)}return null}function ue(ee,W,re,he,He){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return ee=ee.get(re)||null,R(W,ee,""+he,He);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case N:return ee=ee.get(he.key===null?re:he.key)||null,G(W,ee,he,He);case v:return ee=ee.get(he.key===null?re:he.key)||null,ie(W,ee,he,He);case Z:return he=Sr(he),ue(ee,W,re,he,He)}if(q(he)||le(he))return ee=ee.get(re)||null,fe(W,ee,he,He,null);if(typeof he.then=="function")return ue(ee,W,re,fu(he),He);if(he.$$typeof===O)return ue(ee,W,re,ou(W,he),He);mu(W,he)}return null}function Ie(ee,W,re,he){for(var He=null,ht=null,Le=W,Je=W=0,ut=null;Le!==null&&Je<re.length;Je++){Le.index>Je?(ut=Le,Le=null):ut=Le.sibling;var pt=oe(ee,Le,re[Je],he);if(pt===null){Le===null&&(Le=ut);break}n&&Le&&pt.alternate===null&&s(ee,Le),W=x(pt,W,Je),ht===null?He=pt:ht.sibling=pt,ht=pt,Le=ut}if(Je===re.length)return l(ee,Le),dt&&us(ee,Je),He;if(Le===null){for(;Je<re.length;Je++)Le=ge(ee,re[Je],he),Le!==null&&(W=x(Le,W,Je),ht===null?He=Le:ht.sibling=Le,ht=Le);return dt&&us(ee,Je),He}for(Le=d(Le);Je<re.length;Je++)ut=ue(Le,ee,Je,re[Je],he),ut!==null&&(n&&ut.alternate!==null&&Le.delete(ut.key===null?Je:ut.key),W=x(ut,W,Je),ht===null?He=ut:ht.sibling=ut,ht=ut);return n&&Le.forEach(function(nr){return s(ee,nr)}),dt&&us(ee,Je),He}function $e(ee,W,re,he){if(re==null)throw Error(r(151));for(var He=null,ht=null,Le=W,Je=W=0,ut=null,pt=re.next();Le!==null&&!pt.done;Je++,pt=re.next()){Le.index>Je?(ut=Le,Le=null):ut=Le.sibling;var nr=oe(ee,Le,pt.value,he);if(nr===null){Le===null&&(Le=ut);break}n&&Le&&nr.alternate===null&&s(ee,Le),W=x(nr,W,Je),ht===null?He=nr:ht.sibling=nr,ht=nr,Le=ut}if(pt.done)return l(ee,Le),dt&&us(ee,Je),He;if(Le===null){for(;!pt.done;Je++,pt=re.next())pt=ge(ee,pt.value,he),pt!==null&&(W=x(pt,W,Je),ht===null?He=pt:ht.sibling=pt,ht=pt);return dt&&us(ee,Je),He}for(Le=d(Le);!pt.done;Je++,pt=re.next())pt=ue(Le,ee,Je,pt.value,he),pt!==null&&(n&&pt.alternate!==null&&Le.delete(pt.key===null?Je:pt.key),W=x(pt,W,Je),ht===null?He=pt:ht.sibling=pt,ht=pt);return n&&Le.forEach(function(vv){return s(ee,vv)}),dt&&us(ee,Je),He}function At(ee,W,re,he){if(typeof re=="object"&&re!==null&&re.type===A&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case N:e:{for(var He=re.key;W!==null;){if(W.key===He){if(He=re.type,He===A){if(W.tag===7){l(ee,W.sibling),he=p(W,re.props.children),he.return=ee,ee=he;break e}}else if(W.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===Z&&Sr(He)===W.type){l(ee,W.sibling),he=p(W,re.props),_l(he,re),he.return=ee,ee=he;break e}l(ee,W);break}else s(ee,W);W=W.sibling}re.type===A?(he=yr(re.props.children,ee.mode,he,re.key),he.return=ee,ee=he):(he=ru(re.type,re.key,re.props,null,ee.mode,he),_l(he,re),he.return=ee,ee=he)}return _(ee);case v:e:{for(He=re.key;W!==null;){if(W.key===He)if(W.tag===4&&W.stateNode.containerInfo===re.containerInfo&&W.stateNode.implementation===re.implementation){l(ee,W.sibling),he=p(W,re.children||[]),he.return=ee,ee=he;break e}else{l(ee,W);break}else s(ee,W);W=W.sibling}he=wd(re,ee.mode,he),he.return=ee,ee=he}return _(ee);case Z:return re=Sr(re),At(ee,W,re,he)}if(q(re))return Ie(ee,W,re,he);if(le(re)){if(He=le(re),typeof He!="function")throw Error(r(150));return re=He.call(re),$e(ee,W,re,he)}if(typeof re.then=="function")return At(ee,W,fu(re),he);if(re.$$typeof===O)return At(ee,W,ou(ee,re),he);mu(ee,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,W!==null&&W.tag===6?(l(ee,W.sibling),he=p(W,re),he.return=ee,ee=he):(l(ee,W),he=Cd(re,ee.mode,he),he.return=ee,ee=he),_(ee)):l(ee,W)}return function(ee,W,re,he){try{Tl=0;var He=At(ee,W,re,he);return bi=null,He}catch(Le){if(Le===gi||Le===cu)throw Le;var ht=ca(29,Le,null,ee.mode);return ht.lanes=he,ht.return=ee,ht}finally{}}}var Cr=p0(!0),g0=p0(!1),Us=!1;function Hd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fd(n,s){n=n.updateQueue,s.updateQueue===n&&(s.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Hs(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Fs(n,s,l){var d=n.updateQueue;if(d===null)return null;if(d=d.shared,(bt&2)!==0){var p=d.pending;return p===null?s.next=s:(s.next=p.next,p.next=s),d.pending=s,s=su(n),Jp(n,null,l),s}return au(n,d,s,l),su(n)}function vl(n,s,l){if(s=s.updateQueue,s!==null&&(s=s.shared,(l&4194048)!==0)){var d=s.lanes;d&=n.pendingLanes,l|=d,s.lanes=l,Ye(n,l)}}function zd(n,s){var l=n.updateQueue,d=n.alternate;if(d!==null&&(d=d.updateQueue,l===d)){var p=null,x=null;if(l=l.firstBaseUpdate,l!==null){do{var _={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};x===null?p=x=_:x=x.next=_,l=l.next}while(l!==null);x===null?p=x=s:x=x.next=s}else p=x=s;l={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:x,shared:d.shared,callbacks:d.callbacks},n.updateQueue=l;return}n=l.lastBaseUpdate,n===null?l.firstBaseUpdate=s:n.next=s,l.lastBaseUpdate=s}var $d=!1;function Sl(){if($d){var n=pi;if(n!==null)throw n}}function Al(n,s,l,d){$d=!1;var p=n.updateQueue;Us=!1;var x=p.firstBaseUpdate,_=p.lastBaseUpdate,R=p.shared.pending;if(R!==null){p.shared.pending=null;var G=R,ie=G.next;G.next=null,_===null?x=ie:_.next=ie,_=G;var fe=n.alternate;fe!==null&&(fe=fe.updateQueue,R=fe.lastBaseUpdate,R!==_&&(R===null?fe.firstBaseUpdate=ie:R.next=ie,fe.lastBaseUpdate=G))}if(x!==null){var ge=p.baseState;_=0,fe=ie=G=null,R=x;do{var oe=R.lane&-536870913,ue=oe!==R.lane;if(ue?(ot&oe)===oe:(d&oe)===oe){oe!==0&&oe===hi&&($d=!0),fe!==null&&(fe=fe.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var Ie=n,$e=R;oe=s;var At=l;switch($e.tag){case 1:if(Ie=$e.payload,typeof Ie=="function"){ge=Ie.call(At,ge,oe);break e}ge=Ie;break e;case 3:Ie.flags=Ie.flags&-65537|128;case 0:if(Ie=$e.payload,oe=typeof Ie=="function"?Ie.call(At,ge,oe):Ie,oe==null)break e;ge=g({},ge,oe);break e;case 2:Us=!0}}oe=R.callback,oe!==null&&(n.flags|=64,ue&&(n.flags|=8192),ue=p.callbacks,ue===null?p.callbacks=[oe]:ue.push(oe))}else ue={lane:oe,tag:R.tag,payload:R.payload,callback:R.callback,next:null},fe===null?(ie=fe=ue,G=ge):fe=fe.next=ue,_|=oe;if(R=R.next,R===null){if(R=p.shared.pending,R===null)break;ue=R,R=ue.next,ue.next=null,p.lastBaseUpdate=ue,p.shared.pending=null}}while(!0);fe===null&&(G=ge),p.baseState=G,p.firstBaseUpdate=ie,p.lastBaseUpdate=fe,x===null&&(p.shared.lanes=0),Gs|=_,n.lanes=_,n.memoizedState=ge}}function b0(n,s){if(typeof n!="function")throw Error(r(191,n));n.call(s)}function x0(n,s){var l=n.callbacks;if(l!==null)for(n.callbacks=null,n=0;n<l.length;n++)b0(l[n],s)}var xi=H(null),hu=H(0);function E0(n,s){n=ys,L(hu,n),L(xi,s),ys=n|s.baseLanes}function qd(){L(hu,ys),L(xi,xi.current)}function Yd(){ys=hu.current,se(xi),se(hu)}var da=H(null),Aa=null;function zs(n){var s=n.alternate;L(Vt,Vt.current&1),L(da,n),Aa===null&&(s===null||xi.current!==null||s.memoizedState!==null)&&(Aa=n)}function Gd(n){L(Vt,Vt.current),L(da,n),Aa===null&&(Aa=n)}function y0(n){n.tag===22?(L(Vt,Vt.current),L(da,n),Aa===null&&(Aa=n)):$s()}function $s(){L(Vt,Vt.current),L(da,da.current)}function fa(n){se(da),Aa===n&&(Aa=null),se(Vt)}var Vt=H(0);function pu(n){for(var s=n;s!==null;){if(s.tag===13){var l=s.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Jf(l)||em(l)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var fs=0,Ze=null,vt=null,tn=null,gu=!1,Ei=!1,wr=!1,bu=0,Cl=0,yi=null,h2=0;function $t(){throw Error(r(321))}function Kd(n,s){if(s===null)return!1;for(var l=0;l<s.length&&l<n.length;l++)if(!ua(n[l],s[l]))return!1;return!0}function Vd(n,s,l,d,p,x){return fs=x,Ze=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,F.H=n===null||n.memoizedState===null?ag:cf,wr=!1,x=l(d,p),wr=!1,Ei&&(x=T0(s,l,d,p)),N0(n),x}function N0(n){F.H=Rl;var s=vt!==null&&vt.next!==null;if(fs=0,tn=vt=Ze=null,gu=!1,Cl=0,yi=null,s)throw Error(r(300));n===null||nn||(n=n.dependencies,n!==null&&lu(n)&&(nn=!0))}function T0(n,s,l,d){Ze=n;var p=0;do{if(Ei&&(yi=null),Cl=0,Ei=!1,25<=p)throw Error(r(301));if(p+=1,tn=vt=null,n.updateQueue!=null){var x=n.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}F.H=sg,x=s(l,d)}while(Ei);return x}function p2(){var n=F.H,s=n.useState()[0];return s=typeof s.then=="function"?wl(s):s,n=n.useState()[0],(vt!==null?vt.memoizedState:null)!==n&&(Ze.flags|=1024),s}function Xd(){var n=bu!==0;return bu=0,n}function Qd(n,s,l){s.updateQueue=n.updateQueue,s.flags&=-2053,n.lanes&=~l}function Wd(n){if(gu){for(n=n.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}gu=!1}fs=0,tn=vt=Ze=null,Ei=!1,Cl=bu=0,yi=null}function Un(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tn===null?Ze.memoizedState=tn=n:tn=tn.next=n,tn}function Xt(){if(vt===null){var n=Ze.alternate;n=n!==null?n.memoizedState:null}else n=vt.next;var s=tn===null?Ze.memoizedState:tn.next;if(s!==null)tn=s,vt=n;else{if(n===null)throw Ze.alternate===null?Error(r(467)):Error(r(310));vt=n,n={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},tn===null?Ze.memoizedState=tn=n:tn=tn.next=n}return tn}function xu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wl(n){var s=Cl;return Cl+=1,yi===null&&(yi=[]),n=f0(yi,n,s),s=Ze,(tn===null?s.memoizedState:tn.next)===null&&(s=s.alternate,F.H=s===null||s.memoizedState===null?ag:cf),n}function Eu(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return wl(n);if(n.$$typeof===O)return En(n)}throw Error(r(438,String(n)))}function Zd(n){var s=null,l=Ze.updateQueue;if(l!==null&&(s=l.memoCache),s==null){var d=Ze.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(s={data:d.data.map(function(p){return p.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),l===null&&(l=xu(),Ze.updateQueue=l),l.memoCache=s,l=s.data[s.index],l===void 0)for(l=s.data[s.index]=Array(n),d=0;d<n;d++)l[d]=D;return s.index++,l}function ms(n,s){return typeof s=="function"?s(n):s}function yu(n){var s=Xt();return Jd(s,vt,n)}function Jd(n,s,l){var d=n.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=l;var p=n.baseQueue,x=d.pending;if(x!==null){if(p!==null){var _=p.next;p.next=x.next,x.next=_}s.baseQueue=p=x,d.pending=null}if(x=n.baseState,p===null)n.memoizedState=x;else{s=p.next;var R=_=null,G=null,ie=s,fe=!1;do{var ge=ie.lane&-536870913;if(ge!==ie.lane?(ot&ge)===ge:(fs&ge)===ge){var oe=ie.revertLane;if(oe===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),ge===hi&&(fe=!0);else if((fs&oe)===oe){ie=ie.next,oe===hi&&(fe=!0);continue}else ge={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},G===null?(R=G=ge,_=x):G=G.next=ge,Ze.lanes|=oe,Gs|=oe;ge=ie.action,wr&&l(x,ge),x=ie.hasEagerState?ie.eagerState:l(x,ge)}else oe={lane:ge,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},G===null?(R=G=oe,_=x):G=G.next=oe,Ze.lanes|=ge,Gs|=ge;ie=ie.next}while(ie!==null&&ie!==s);if(G===null?_=x:G.next=R,!ua(x,n.memoizedState)&&(nn=!0,fe&&(l=pi,l!==null)))throw l;n.memoizedState=x,n.baseState=_,n.baseQueue=G,d.lastRenderedState=x}return p===null&&(d.lanes=0),[n.memoizedState,d.dispatch]}function ef(n){var s=Xt(),l=s.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=n;var d=l.dispatch,p=l.pending,x=s.memoizedState;if(p!==null){l.pending=null;var _=p=p.next;do x=n(x,_.action),_=_.next;while(_!==p);ua(x,s.memoizedState)||(nn=!0),s.memoizedState=x,s.baseQueue===null&&(s.baseState=x),l.lastRenderedState=x}return[x,d]}function _0(n,s,l){var d=Ze,p=Xt(),x=dt;if(x){if(l===void 0)throw Error(r(407));l=l()}else l=s();var _=!ua((vt||p).memoizedState,l);if(_&&(p.memoizedState=l,nn=!0),p=p.queue,af(A0.bind(null,d,p,n),[n]),p.getSnapshot!==s||_||tn!==null&&tn.memoizedState.tag&1){if(d.flags|=2048,Ni(9,{destroy:void 0},S0.bind(null,d,p,l,s),null),kt===null)throw Error(r(349));x||(fs&127)!==0||v0(d,s,l)}return l}function v0(n,s,l){n.flags|=16384,n={getSnapshot:s,value:l},s=Ze.updateQueue,s===null?(s=xu(),Ze.updateQueue=s,s.stores=[n]):(l=s.stores,l===null?s.stores=[n]:l.push(n))}function S0(n,s,l,d){s.value=l,s.getSnapshot=d,C0(s)&&w0(n)}function A0(n,s,l){return l(function(){C0(s)&&w0(n)})}function C0(n){var s=n.getSnapshot;n=n.value;try{var l=s();return!ua(n,l)}catch{return!0}}function w0(n){var s=Er(n,2);s!==null&&ea(s,n,2)}function tf(n){var s=Un();if(typeof n=="function"){var l=n;if(n=l(),wr){Sn(!0);try{l()}finally{Sn(!1)}}}return s.memoizedState=s.baseState=n,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:n},s}function k0(n,s,l,d){return n.baseState=l,Jd(n,vt,typeof d=="function"?d:ms)}function g2(n,s,l,d,p){if(_u(n))throw Error(r(485));if(n=s.action,n!==null){var x={payload:p,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){x.listeners.push(_)}};F.T!==null?l(!0):x.isTransition=!1,d(x),l=s.pending,l===null?(x.next=s.pending=x,R0(s,x)):(x.next=l.next,s.pending=l.next=x)}}function R0(n,s){var l=s.action,d=s.payload,p=n.state;if(s.isTransition){var x=F.T,_={};F.T=_;try{var R=l(p,d),G=F.S;G!==null&&G(_,R),O0(n,s,R)}catch(ie){nf(n,s,ie)}finally{x!==null&&_.types!==null&&(x.types=_.types),F.T=x}}else try{x=l(p,d),O0(n,s,x)}catch(ie){nf(n,s,ie)}}function O0(n,s,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(d){I0(n,s,d)},function(d){return nf(n,s,d)}):I0(n,s,l)}function I0(n,s,l){s.status="fulfilled",s.value=l,M0(s),n.state=l,s=n.pending,s!==null&&(l=s.next,l===s?n.pending=null:(l=l.next,s.next=l,R0(n,l)))}function nf(n,s,l){var d=n.pending;if(n.pending=null,d!==null){d=d.next;do s.status="rejected",s.reason=l,M0(s),s=s.next;while(s!==d)}n.action=null}function M0(n){n=n.listeners;for(var s=0;s<n.length;s++)(0,n[s])()}function D0(n,s){return s}function L0(n,s){if(dt){var l=kt.formState;if(l!==null){e:{var d=Ze;if(dt){if(Lt){t:{for(var p=Lt,x=Sa;p.nodeType!==8;){if(!x){p=null;break t}if(p=Ca(p.nextSibling),p===null){p=null;break t}}x=p.data,p=x==="F!"||x==="F"?p:null}if(p){Lt=Ca(p.nextSibling),d=p.data==="F!";break e}}Bs(d)}d=!1}d&&(s=l[0])}}return l=Un(),l.memoizedState=l.baseState=s,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:D0,lastRenderedState:s},l.queue=d,l=eg.bind(null,Ze,d),d.dispatch=l,d=tf(!1),x=uf.bind(null,Ze,!1,d.queue),d=Un(),p={state:s,dispatch:null,action:n,pending:null},d.queue=p,l=g2.bind(null,Ze,p,x,l),p.dispatch=l,d.memoizedState=n,[s,l,!1]}function j0(n){var s=Xt();return B0(s,vt,n)}function B0(n,s,l){if(s=Jd(n,s,D0)[0],n=yu(ms)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var d=wl(s)}catch(_){throw _===gi?cu:_}else d=s;s=Xt();var p=s.queue,x=p.dispatch;return l!==s.memoizedState&&(Ze.flags|=2048,Ni(9,{destroy:void 0},b2.bind(null,p,l),null)),[d,x,n]}function b2(n,s){n.action=s}function P0(n){var s=Xt(),l=vt;if(l!==null)return B0(s,l,n);Xt(),s=s.memoizedState,l=Xt();var d=l.queue.dispatch;return l.memoizedState=n,[s,d,!1]}function Ni(n,s,l,d){return n={tag:n,create:l,deps:d,inst:s,next:null},s=Ze.updateQueue,s===null&&(s=xu(),Ze.updateQueue=s),l=s.lastEffect,l===null?s.lastEffect=n.next=n:(d=l.next,l.next=n,n.next=d,s.lastEffect=n),n}function U0(){return Xt().memoizedState}function Nu(n,s,l,d){var p=Un();Ze.flags|=n,p.memoizedState=Ni(1|s,{destroy:void 0},l,d===void 0?null:d)}function Tu(n,s,l,d){var p=Xt();d=d===void 0?null:d;var x=p.memoizedState.inst;vt!==null&&d!==null&&Kd(d,vt.memoizedState.deps)?p.memoizedState=Ni(s,x,l,d):(Ze.flags|=n,p.memoizedState=Ni(1|s,x,l,d))}function H0(n,s){Nu(8390656,8,n,s)}function af(n,s){Tu(2048,8,n,s)}function x2(n){Ze.flags|=4;var s=Ze.updateQueue;if(s===null)s=xu(),Ze.updateQueue=s,s.events=[n];else{var l=s.events;l===null?s.events=[n]:l.push(n)}}function F0(n){var s=Xt().memoizedState;return x2({ref:s,nextImpl:n}),function(){if((bt&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function z0(n,s){return Tu(4,2,n,s)}function $0(n,s){return Tu(4,4,n,s)}function q0(n,s){if(typeof s=="function"){n=n();var l=s(n);return function(){typeof l=="function"?l():s(null)}}if(s!=null)return n=n(),s.current=n,function(){s.current=null}}function Y0(n,s,l){l=l!=null?l.concat([n]):null,Tu(4,4,q0.bind(null,s,n),l)}function sf(){}function G0(n,s){var l=Xt();s=s===void 0?null:s;var d=l.memoizedState;return s!==null&&Kd(s,d[1])?d[0]:(l.memoizedState=[n,s],n)}function K0(n,s){var l=Xt();s=s===void 0?null:s;var d=l.memoizedState;if(s!==null&&Kd(s,d[1]))return d[0];if(d=n(),wr){Sn(!0);try{n()}finally{Sn(!1)}}return l.memoizedState=[d,s],d}function rf(n,s,l){return l===void 0||(fs&1073741824)!==0&&(ot&261930)===0?n.memoizedState=s:(n.memoizedState=l,n=Vg(),Ze.lanes|=n,Gs|=n,l)}function V0(n,s,l,d){return ua(l,s)?l:xi.current!==null?(n=rf(n,l,d),ua(n,s)||(nn=!0),n):(fs&42)===0||(fs&1073741824)!==0&&(ot&261930)===0?(nn=!0,n.memoizedState=l):(n=Vg(),Ze.lanes|=n,Gs|=n,s)}function X0(n,s,l,d,p){var x=k.p;k.p=x!==0&&8>x?x:8;var _=F.T,R={};F.T=R,uf(n,!1,s,l);try{var G=p(),ie=F.S;if(ie!==null&&ie(R,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var fe=m2(G,d);kl(n,s,fe,pa(n))}else kl(n,s,d,pa(n))}catch(ge){kl(n,s,{then:function(){},status:"rejected",reason:ge},pa())}finally{k.p=x,_!==null&&R.types!==null&&(_.types=R.types),F.T=_}}function E2(){}function lf(n,s,l,d){if(n.tag!==5)throw Error(r(476));var p=Q0(n).queue;X0(n,p,s,P,l===null?E2:function(){return W0(n),l(d)})}function Q0(n){var s=n.memoizedState;if(s!==null)return s;s={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:P},next:null};var l={};return s.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:l},next:null},n.memoizedState=s,n=n.alternate,n!==null&&(n.memoizedState=s),s}function W0(n){var s=Q0(n);s.next===null&&(s=n.alternate.memoizedState),kl(n,s.next.queue,{},pa())}function of(){return En(Gl)}function Z0(){return Xt().memoizedState}function J0(){return Xt().memoizedState}function y2(n){for(var s=n.return;s!==null;){switch(s.tag){case 24:case 3:var l=pa();n=Hs(l);var d=Fs(s,n,l);d!==null&&(ea(d,s,l),vl(d,s,l)),s={cache:jd()},n.payload=s;return}s=s.return}}function N2(n,s,l){var d=pa();l={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},_u(n)?tg(s,l):(l=Sd(n,s,l,d),l!==null&&(ea(l,n,d),ng(l,s,d)))}function eg(n,s,l){var d=pa();kl(n,s,l,d)}function kl(n,s,l,d){var p={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(_u(n))tg(s,p);else{var x=n.alternate;if(n.lanes===0&&(x===null||x.lanes===0)&&(x=s.lastRenderedReducer,x!==null))try{var _=s.lastRenderedState,R=x(_,l);if(p.hasEagerState=!0,p.eagerState=R,ua(R,_))return au(n,s,p,0),kt===null&&nu(),!1}catch{}finally{}if(l=Sd(n,s,p,d),l!==null)return ea(l,n,d),ng(l,s,d),!0}return!1}function uf(n,s,l,d){if(d={lane:2,revertLane:Ff(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},_u(n)){if(s)throw Error(r(479))}else s=Sd(n,l,d,2),s!==null&&ea(s,n,2)}function _u(n){var s=n.alternate;return n===Ze||s!==null&&s===Ze}function tg(n,s){Ei=gu=!0;var l=n.pending;l===null?s.next=s:(s.next=l.next,l.next=s),n.pending=s}function ng(n,s,l){if((l&4194048)!==0){var d=s.lanes;d&=n.pendingLanes,l|=d,s.lanes=l,Ye(n,l)}}var Rl={readContext:En,use:Eu,useCallback:$t,useContext:$t,useEffect:$t,useImperativeHandle:$t,useLayoutEffect:$t,useInsertionEffect:$t,useMemo:$t,useReducer:$t,useRef:$t,useState:$t,useDebugValue:$t,useDeferredValue:$t,useTransition:$t,useSyncExternalStore:$t,useId:$t,useHostTransitionStatus:$t,useFormState:$t,useActionState:$t,useOptimistic:$t,useMemoCache:$t,useCacheRefresh:$t};Rl.useEffectEvent=$t;var ag={readContext:En,use:Eu,useCallback:function(n,s){return Un().memoizedState=[n,s===void 0?null:s],n},useContext:En,useEffect:H0,useImperativeHandle:function(n,s,l){l=l!=null?l.concat([n]):null,Nu(4194308,4,q0.bind(null,s,n),l)},useLayoutEffect:function(n,s){return Nu(4194308,4,n,s)},useInsertionEffect:function(n,s){Nu(4,2,n,s)},useMemo:function(n,s){var l=Un();s=s===void 0?null:s;var d=n();if(wr){Sn(!0);try{n()}finally{Sn(!1)}}return l.memoizedState=[d,s],d},useReducer:function(n,s,l){var d=Un();if(l!==void 0){var p=l(s);if(wr){Sn(!0);try{l(s)}finally{Sn(!1)}}}else p=s;return d.memoizedState=d.baseState=p,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:p},d.queue=n,n=n.dispatch=N2.bind(null,Ze,n),[d.memoizedState,n]},useRef:function(n){var s=Un();return n={current:n},s.memoizedState=n},useState:function(n){n=tf(n);var s=n.queue,l=eg.bind(null,Ze,s);return s.dispatch=l,[n.memoizedState,l]},useDebugValue:sf,useDeferredValue:function(n,s){var l=Un();return rf(l,n,s)},useTransition:function(){var n=tf(!1);return n=X0.bind(null,Ze,n.queue,!0,!1),Un().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,s,l){var d=Ze,p=Un();if(dt){if(l===void 0)throw Error(r(407));l=l()}else{if(l=s(),kt===null)throw Error(r(349));(ot&127)!==0||v0(d,s,l)}p.memoizedState=l;var x={value:l,getSnapshot:s};return p.queue=x,H0(A0.bind(null,d,x,n),[n]),d.flags|=2048,Ni(9,{destroy:void 0},S0.bind(null,d,x,l,s),null),l},useId:function(){var n=Un(),s=kt.identifierPrefix;if(dt){var l=Ga,d=Ya;l=(d&~(1<<32-Et(d)-1)).toString(32)+l,s="_"+s+"R_"+l,l=bu++,0<l&&(s+="H"+l.toString(32)),s+="_"}else l=h2++,s="_"+s+"r_"+l.toString(32)+"_";return n.memoizedState=s},useHostTransitionStatus:of,useFormState:L0,useActionState:L0,useOptimistic:function(n){var s=Un();s.memoizedState=s.baseState=n;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=l,s=uf.bind(null,Ze,!0,l),l.dispatch=s,[n,s]},useMemoCache:Zd,useCacheRefresh:function(){return Un().memoizedState=y2.bind(null,Ze)},useEffectEvent:function(n){var s=Un(),l={impl:n};return s.memoizedState=l,function(){if((bt&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},cf={readContext:En,use:Eu,useCallback:G0,useContext:En,useEffect:af,useImperativeHandle:Y0,useInsertionEffect:z0,useLayoutEffect:$0,useMemo:K0,useReducer:yu,useRef:U0,useState:function(){return yu(ms)},useDebugValue:sf,useDeferredValue:function(n,s){var l=Xt();return V0(l,vt.memoizedState,n,s)},useTransition:function(){var n=yu(ms)[0],s=Xt().memoizedState;return[typeof n=="boolean"?n:wl(n),s]},useSyncExternalStore:_0,useId:Z0,useHostTransitionStatus:of,useFormState:j0,useActionState:j0,useOptimistic:function(n,s){var l=Xt();return k0(l,vt,n,s)},useMemoCache:Zd,useCacheRefresh:J0};cf.useEffectEvent=F0;var sg={readContext:En,use:Eu,useCallback:G0,useContext:En,useEffect:af,useImperativeHandle:Y0,useInsertionEffect:z0,useLayoutEffect:$0,useMemo:K0,useReducer:ef,useRef:U0,useState:function(){return ef(ms)},useDebugValue:sf,useDeferredValue:function(n,s){var l=Xt();return vt===null?rf(l,n,s):V0(l,vt.memoizedState,n,s)},useTransition:function(){var n=ef(ms)[0],s=Xt().memoizedState;return[typeof n=="boolean"?n:wl(n),s]},useSyncExternalStore:_0,useId:Z0,useHostTransitionStatus:of,useFormState:P0,useActionState:P0,useOptimistic:function(n,s){var l=Xt();return vt!==null?k0(l,vt,n,s):(l.baseState=n,[n,l.queue.dispatch])},useMemoCache:Zd,useCacheRefresh:J0};sg.useEffectEvent=F0;function df(n,s,l,d){s=n.memoizedState,l=l(d,s),l=l==null?s:g({},s,l),n.memoizedState=l,n.lanes===0&&(n.updateQueue.baseState=l)}var ff={enqueueSetState:function(n,s,l){n=n._reactInternals;var d=pa(),p=Hs(d);p.payload=s,l!=null&&(p.callback=l),s=Fs(n,p,d),s!==null&&(ea(s,n,d),vl(s,n,d))},enqueueReplaceState:function(n,s,l){n=n._reactInternals;var d=pa(),p=Hs(d);p.tag=1,p.payload=s,l!=null&&(p.callback=l),s=Fs(n,p,d),s!==null&&(ea(s,n,d),vl(s,n,d))},enqueueForceUpdate:function(n,s){n=n._reactInternals;var l=pa(),d=Hs(l);d.tag=2,s!=null&&(d.callback=s),s=Fs(n,d,l),s!==null&&(ea(s,n,l),vl(s,n,l))}};function rg(n,s,l,d,p,x,_){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(d,x,_):s.prototype&&s.prototype.isPureReactComponent?!gl(l,d)||!gl(p,x):!0}function ig(n,s,l,d){n=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(l,d),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(l,d),s.state!==n&&ff.enqueueReplaceState(s,s.state,null)}function kr(n,s){var l=s;if("ref"in s){l={};for(var d in s)d!=="ref"&&(l[d]=s[d])}if(n=n.defaultProps){l===s&&(l=g({},l));for(var p in n)l[p]===void 0&&(l[p]=n[p])}return l}function lg(n){tu(n)}function og(n){console.error(n)}function ug(n){tu(n)}function vu(n,s){try{var l=n.onUncaughtError;l(s.value,{componentStack:s.stack})}catch(d){setTimeout(function(){throw d})}}function cg(n,s,l){try{var d=n.onCaughtError;d(l.value,{componentStack:l.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function mf(n,s,l){return l=Hs(l),l.tag=3,l.payload={element:null},l.callback=function(){vu(n,s)},l}function dg(n){return n=Hs(n),n.tag=3,n}function fg(n,s,l,d){var p=l.type.getDerivedStateFromError;if(typeof p=="function"){var x=d.value;n.payload=function(){return p(x)},n.callback=function(){cg(s,l,d)}}var _=l.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(n.callback=function(){cg(s,l,d),typeof p!="function"&&(Ks===null?Ks=new Set([this]):Ks.add(this));var R=d.stack;this.componentDidCatch(d.value,{componentStack:R!==null?R:""})})}function T2(n,s,l,d,p){if(l.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(s=l.alternate,s!==null&&mi(s,l,p,!0),l=da.current,l!==null){switch(l.tag){case 31:case 13:return Aa===null?ju():l.alternate===null&&qt===0&&(qt=3),l.flags&=-257,l.flags|=65536,l.lanes=p,d===du?l.flags|=16384:(s=l.updateQueue,s===null?l.updateQueue=new Set([d]):s.add(d),Pf(n,d,p)),!1;case 22:return l.flags|=65536,d===du?l.flags|=16384:(s=l.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([d])},l.updateQueue=s):(l=s.retryQueue,l===null?s.retryQueue=new Set([d]):l.add(d)),Pf(n,d,p)),!1}throw Error(r(435,l.tag))}return Pf(n,d,p),ju(),!1}if(dt)return s=da.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=p,d!==Od&&(n=Error(r(422),{cause:d}),El(Ta(n,l)))):(d!==Od&&(s=Error(r(423),{cause:d}),El(Ta(s,l))),n=n.current.alternate,n.flags|=65536,p&=-p,n.lanes|=p,d=Ta(d,l),p=mf(n.stateNode,d,p),zd(n,p),qt!==4&&(qt=2)),!1;var x=Error(r(520),{cause:d});if(x=Ta(x,l),Pl===null?Pl=[x]:Pl.push(x),qt!==4&&(qt=2),s===null)return!0;d=Ta(d,l),l=s;do{switch(l.tag){case 3:return l.flags|=65536,n=p&-p,l.lanes|=n,n=mf(l.stateNode,d,n),zd(l,n),!1;case 1:if(s=l.type,x=l.stateNode,(l.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Ks===null||!Ks.has(x))))return l.flags|=65536,p&=-p,l.lanes|=p,p=dg(p),fg(p,n,l,d),zd(l,p),!1}l=l.return}while(l!==null);return!1}var hf=Error(r(461)),nn=!1;function yn(n,s,l,d){s.child=n===null?g0(s,null,l,d):Cr(s,n.child,l,d)}function mg(n,s,l,d,p){l=l.render;var x=s.ref;if("ref"in d){var _={};for(var R in d)R!=="ref"&&(_[R]=d[R])}else _=d;return _r(s),d=Vd(n,s,l,_,x,p),R=Xd(),n!==null&&!nn?(Qd(n,s,p),hs(n,s,p)):(dt&&R&&kd(s),s.flags|=1,yn(n,s,d,p),s.child)}function hg(n,s,l,d,p){if(n===null){var x=l.type;return typeof x=="function"&&!Ad(x)&&x.defaultProps===void 0&&l.compare===null?(s.tag=15,s.type=x,pg(n,s,x,d,p)):(n=ru(l.type,null,d,s,s.mode,p),n.ref=s.ref,n.return=s,s.child=n)}if(x=n.child,!Tf(n,p)){var _=x.memoizedProps;if(l=l.compare,l=l!==null?l:gl,l(_,d)&&n.ref===s.ref)return hs(n,s,p)}return s.flags|=1,n=os(x,d),n.ref=s.ref,n.return=s,s.child=n}function pg(n,s,l,d,p){if(n!==null){var x=n.memoizedProps;if(gl(x,d)&&n.ref===s.ref)if(nn=!1,s.pendingProps=d=x,Tf(n,p))(n.flags&131072)!==0&&(nn=!0);else return s.lanes=n.lanes,hs(n,s,p)}return pf(n,s,l,d,p)}function gg(n,s,l,d){var p=d.children,x=n!==null?n.memoizedState:null;if(n===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((s.flags&128)!==0){if(x=x!==null?x.baseLanes|l:l,n!==null){for(d=s.child=n.child,p=0;d!==null;)p=p|d.lanes|d.childLanes,d=d.sibling;d=p&~x}else d=0,s.child=null;return bg(n,s,x,l,d)}if((l&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},n!==null&&uu(s,x!==null?x.cachePool:null),x!==null?E0(s,x):qd(),y0(s);else return d=s.lanes=536870912,bg(n,s,x!==null?x.baseLanes|l:l,l,d)}else x!==null?(uu(s,x.cachePool),E0(s,x),$s(),s.memoizedState=null):(n!==null&&uu(s,null),qd(),$s());return yn(n,s,p,l),s.child}function Ol(n,s){return n!==null&&n.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function bg(n,s,l,d,p){var x=Pd();return x=x===null?null:{parent:en._currentValue,pool:x},s.memoizedState={baseLanes:l,cachePool:x},n!==null&&uu(s,null),qd(),y0(s),n!==null&&mi(n,s,d,!0),s.childLanes=p,null}function Su(n,s){return s=Cu({mode:s.mode,children:s.children},n.mode),s.ref=n.ref,n.child=s,s.return=n,s}function xg(n,s,l){return Cr(s,n.child,null,l),n=Su(s,s.pendingProps),n.flags|=2,fa(s),s.memoizedState=null,n}function _2(n,s,l){var d=s.pendingProps,p=(s.flags&128)!==0;if(s.flags&=-129,n===null){if(dt){if(d.mode==="hidden")return n=Su(s,d),s.lanes=536870912,Ol(null,n);if(Gd(s),(n=Lt)?(n=Rb(n,Sa),n=n!==null&&n.data==="&"?n:null,n!==null&&(s.memoizedState={dehydrated:n,treeContext:Ls!==null?{id:Ya,overflow:Ga}:null,retryLane:536870912,hydrationErrors:null},l=t0(n),l.return=s,s.child=l,xn=s,Lt=null)):n=null,n===null)throw Bs(s);return s.lanes=536870912,null}return Su(s,d)}var x=n.memoizedState;if(x!==null){var _=x.dehydrated;if(Gd(s),p)if(s.flags&256)s.flags&=-257,s=xg(n,s,l);else if(s.memoizedState!==null)s.child=n.child,s.flags|=128,s=null;else throw Error(r(558));else if(nn||mi(n,s,l,!1),p=(l&n.childLanes)!==0,nn||p){if(d=kt,d!==null&&(_=Yt(d,l),_!==0&&_!==x.retryLane))throw x.retryLane=_,Er(n,_),ea(d,n,_),hf;ju(),s=xg(n,s,l)}else n=x.treeContext,Lt=Ca(_.nextSibling),xn=s,dt=!0,js=null,Sa=!1,n!==null&&s0(s,n),s=Su(s,d),s.flags|=4096;return s}return n=os(n.child,{mode:d.mode,children:d.children}),n.ref=s.ref,s.child=n,n.return=s,n}function Au(n,s){var l=s.ref;if(l===null)n!==null&&n.ref!==null&&(s.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(n===null||n.ref!==l)&&(s.flags|=4194816)}}function pf(n,s,l,d,p){return _r(s),l=Vd(n,s,l,d,void 0,p),d=Xd(),n!==null&&!nn?(Qd(n,s,p),hs(n,s,p)):(dt&&d&&kd(s),s.flags|=1,yn(n,s,l,p),s.child)}function Eg(n,s,l,d,p,x){return _r(s),s.updateQueue=null,l=T0(s,d,l,p),N0(n),d=Xd(),n!==null&&!nn?(Qd(n,s,x),hs(n,s,x)):(dt&&d&&kd(s),s.flags|=1,yn(n,s,l,x),s.child)}function yg(n,s,l,d,p){if(_r(s),s.stateNode===null){var x=ui,_=l.contextType;typeof _=="object"&&_!==null&&(x=En(_)),x=new l(d,x),s.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=ff,s.stateNode=x,x._reactInternals=s,x=s.stateNode,x.props=d,x.state=s.memoizedState,x.refs={},Hd(s),_=l.contextType,x.context=typeof _=="object"&&_!==null?En(_):ui,x.state=s.memoizedState,_=l.getDerivedStateFromProps,typeof _=="function"&&(df(s,l,_,d),x.state=s.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(_=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),_!==x.state&&ff.enqueueReplaceState(x,x.state,null),Al(s,d,x,p),Sl(),x.state=s.memoizedState),typeof x.componentDidMount=="function"&&(s.flags|=4194308),d=!0}else if(n===null){x=s.stateNode;var R=s.memoizedProps,G=kr(l,R);x.props=G;var ie=x.context,fe=l.contextType;_=ui,typeof fe=="object"&&fe!==null&&(_=En(fe));var ge=l.getDerivedStateFromProps;fe=typeof ge=="function"||typeof x.getSnapshotBeforeUpdate=="function",R=s.pendingProps!==R,fe||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(R||ie!==_)&&ig(s,x,d,_),Us=!1;var oe=s.memoizedState;x.state=oe,Al(s,d,x,p),Sl(),ie=s.memoizedState,R||oe!==ie||Us?(typeof ge=="function"&&(df(s,l,ge,d),ie=s.memoizedState),(G=Us||rg(s,l,G,d,oe,ie,_))?(fe||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"&&(s.flags|=4194308)):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=d,s.memoizedState=ie),x.props=d,x.state=ie,x.context=_,d=G):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),d=!1)}else{x=s.stateNode,Fd(n,s),_=s.memoizedProps,fe=kr(l,_),x.props=fe,ge=s.pendingProps,oe=x.context,ie=l.contextType,G=ui,typeof ie=="object"&&ie!==null&&(G=En(ie)),R=l.getDerivedStateFromProps,(ie=typeof R=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(_!==ge||oe!==G)&&ig(s,x,d,G),Us=!1,oe=s.memoizedState,x.state=oe,Al(s,d,x,p),Sl();var ue=s.memoizedState;_!==ge||oe!==ue||Us||n!==null&&n.dependencies!==null&&lu(n.dependencies)?(typeof R=="function"&&(df(s,l,R,d),ue=s.memoizedState),(fe=Us||rg(s,l,fe,d,oe,ue,G)||n!==null&&n.dependencies!==null&&lu(n.dependencies))?(ie||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(d,ue,G),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(d,ue,G)),typeof x.componentDidUpdate=="function"&&(s.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof x.componentDidUpdate!="function"||_===n.memoizedProps&&oe===n.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||_===n.memoizedProps&&oe===n.memoizedState||(s.flags|=1024),s.memoizedProps=d,s.memoizedState=ue),x.props=d,x.state=ue,x.context=G,d=fe):(typeof x.componentDidUpdate!="function"||_===n.memoizedProps&&oe===n.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||_===n.memoizedProps&&oe===n.memoizedState||(s.flags|=1024),d=!1)}return x=d,Au(n,s),d=(s.flags&128)!==0,x||d?(x=s.stateNode,l=d&&typeof l.getDerivedStateFromError!="function"?null:x.render(),s.flags|=1,n!==null&&d?(s.child=Cr(s,n.child,null,p),s.child=Cr(s,null,l,p)):yn(n,s,l,p),s.memoizedState=x.state,n=s.child):n=hs(n,s,p),n}function Ng(n,s,l,d){return Nr(),s.flags|=256,yn(n,s,l,d),s.child}var gf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bf(n){return{baseLanes:n,cachePool:c0()}}function xf(n,s,l){return n=n!==null?n.childLanes&~l:0,s&&(n|=ha),n}function Tg(n,s,l){var d=s.pendingProps,p=!1,x=(s.flags&128)!==0,_;if((_=x)||(_=n!==null&&n.memoizedState===null?!1:(Vt.current&2)!==0),_&&(p=!0,s.flags&=-129),_=(s.flags&32)!==0,s.flags&=-33,n===null){if(dt){if(p?zs(s):$s(),(n=Lt)?(n=Rb(n,Sa),n=n!==null&&n.data!=="&"?n:null,n!==null&&(s.memoizedState={dehydrated:n,treeContext:Ls!==null?{id:Ya,overflow:Ga}:null,retryLane:536870912,hydrationErrors:null},l=t0(n),l.return=s,s.child=l,xn=s,Lt=null)):n=null,n===null)throw Bs(s);return em(n)?s.lanes=32:s.lanes=536870912,null}var R=d.children;return d=d.fallback,p?($s(),p=s.mode,R=Cu({mode:"hidden",children:R},p),d=yr(d,p,l,null),R.return=s,d.return=s,R.sibling=d,s.child=R,d=s.child,d.memoizedState=bf(l),d.childLanes=xf(n,_,l),s.memoizedState=gf,Ol(null,d)):(zs(s),Ef(s,R))}var G=n.memoizedState;if(G!==null&&(R=G.dehydrated,R!==null)){if(x)s.flags&256?(zs(s),s.flags&=-257,s=yf(n,s,l)):s.memoizedState!==null?($s(),s.child=n.child,s.flags|=128,s=null):($s(),R=d.fallback,p=s.mode,d=Cu({mode:"visible",children:d.children},p),R=yr(R,p,l,null),R.flags|=2,d.return=s,R.return=s,d.sibling=R,s.child=d,Cr(s,n.child,null,l),d=s.child,d.memoizedState=bf(l),d.childLanes=xf(n,_,l),s.memoizedState=gf,s=Ol(null,d));else if(zs(s),em(R)){if(_=R.nextSibling&&R.nextSibling.dataset,_)var ie=_.dgst;_=ie,d=Error(r(419)),d.stack="",d.digest=_,El({value:d,source:null,stack:null}),s=yf(n,s,l)}else if(nn||mi(n,s,l,!1),_=(l&n.childLanes)!==0,nn||_){if(_=kt,_!==null&&(d=Yt(_,l),d!==0&&d!==G.retryLane))throw G.retryLane=d,Er(n,d),ea(_,n,d),hf;Jf(R)||ju(),s=yf(n,s,l)}else Jf(R)?(s.flags|=192,s.child=n.child,s=null):(n=G.treeContext,Lt=Ca(R.nextSibling),xn=s,dt=!0,js=null,Sa=!1,n!==null&&s0(s,n),s=Ef(s,d.children),s.flags|=4096);return s}return p?($s(),R=d.fallback,p=s.mode,G=n.child,ie=G.sibling,d=os(G,{mode:"hidden",children:d.children}),d.subtreeFlags=G.subtreeFlags&65011712,ie!==null?R=os(ie,R):(R=yr(R,p,l,null),R.flags|=2),R.return=s,d.return=s,d.sibling=R,s.child=d,Ol(null,d),d=s.child,R=n.child.memoizedState,R===null?R=bf(l):(p=R.cachePool,p!==null?(G=en._currentValue,p=p.parent!==G?{parent:G,pool:G}:p):p=c0(),R={baseLanes:R.baseLanes|l,cachePool:p}),d.memoizedState=R,d.childLanes=xf(n,_,l),s.memoizedState=gf,Ol(n.child,d)):(zs(s),l=n.child,n=l.sibling,l=os(l,{mode:"visible",children:d.children}),l.return=s,l.sibling=null,n!==null&&(_=s.deletions,_===null?(s.deletions=[n],s.flags|=16):_.push(n)),s.child=l,s.memoizedState=null,l)}function Ef(n,s){return s=Cu({mode:"visible",children:s},n.mode),s.return=n,n.child=s}function Cu(n,s){return n=ca(22,n,null,s),n.lanes=0,n}function yf(n,s,l){return Cr(s,n.child,null,l),n=Ef(s,s.pendingProps.children),n.flags|=2,s.memoizedState=null,n}function _g(n,s,l){n.lanes|=s;var d=n.alternate;d!==null&&(d.lanes|=s),Dd(n.return,s,l)}function Nf(n,s,l,d,p,x){var _=n.memoizedState;_===null?n.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:p,treeForkCount:x}:(_.isBackwards=s,_.rendering=null,_.renderingStartTime=0,_.last=d,_.tail=l,_.tailMode=p,_.treeForkCount=x)}function vg(n,s,l){var d=s.pendingProps,p=d.revealOrder,x=d.tail;d=d.children;var _=Vt.current,R=(_&2)!==0;if(R?(_=_&1|2,s.flags|=128):_&=1,L(Vt,_),yn(n,s,d,l),d=dt?xl:0,!R&&n!==null&&(n.flags&128)!==0)e:for(n=s.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&_g(n,l,s);else if(n.tag===19)_g(n,l,s);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===s)break e;for(;n.sibling===null;){if(n.return===null||n.return===s)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(p){case"forwards":for(l=s.child,p=null;l!==null;)n=l.alternate,n!==null&&pu(n)===null&&(p=l),l=l.sibling;l=p,l===null?(p=s.child,s.child=null):(p=l.sibling,l.sibling=null),Nf(s,!1,p,l,x,d);break;case"backwards":case"unstable_legacy-backwards":for(l=null,p=s.child,s.child=null;p!==null;){if(n=p.alternate,n!==null&&pu(n)===null){s.child=p;break}n=p.sibling,p.sibling=l,l=p,p=n}Nf(s,!0,l,null,x,d);break;case"together":Nf(s,!1,null,null,void 0,d);break;default:s.memoizedState=null}return s.child}function hs(n,s,l){if(n!==null&&(s.dependencies=n.dependencies),Gs|=s.lanes,(l&s.childLanes)===0)if(n!==null){if(mi(n,s,l,!1),(l&s.childLanes)===0)return null}else return null;if(n!==null&&s.child!==n.child)throw Error(r(153));if(s.child!==null){for(n=s.child,l=os(n,n.pendingProps),s.child=l,l.return=s;n.sibling!==null;)n=n.sibling,l=l.sibling=os(n,n.pendingProps),l.return=s;l.sibling=null}return s.child}function Tf(n,s){return(n.lanes&s)!==0?!0:(n=n.dependencies,!!(n!==null&&lu(n)))}function v2(n,s,l){switch(s.tag){case 3:Be(s,s.stateNode.containerInfo),Ps(s,en,n.memoizedState.cache),Nr();break;case 27:case 5:xt(s);break;case 4:Be(s,s.stateNode.containerInfo);break;case 10:Ps(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Gd(s),null;break;case 13:var d=s.memoizedState;if(d!==null)return d.dehydrated!==null?(zs(s),s.flags|=128,null):(l&s.child.childLanes)!==0?Tg(n,s,l):(zs(s),n=hs(n,s,l),n!==null?n.sibling:null);zs(s);break;case 19:var p=(n.flags&128)!==0;if(d=(l&s.childLanes)!==0,d||(mi(n,s,l,!1),d=(l&s.childLanes)!==0),p){if(d)return vg(n,s,l);s.flags|=128}if(p=s.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),L(Vt,Vt.current),d)break;return null;case 22:return s.lanes=0,gg(n,s,l,s.pendingProps);case 24:Ps(s,en,n.memoizedState.cache)}return hs(n,s,l)}function Sg(n,s,l){if(n!==null)if(n.memoizedProps!==s.pendingProps)nn=!0;else{if(!Tf(n,l)&&(s.flags&128)===0)return nn=!1,v2(n,s,l);nn=(n.flags&131072)!==0}else nn=!1,dt&&(s.flags&1048576)!==0&&a0(s,xl,s.index);switch(s.lanes=0,s.tag){case 16:e:{var d=s.pendingProps;if(n=Sr(s.elementType),s.type=n,typeof n=="function")Ad(n)?(d=kr(n,d),s.tag=1,s=yg(null,s,n,d,l)):(s.tag=0,s=pf(null,s,n,d,l));else{if(n!=null){var p=n.$$typeof;if(p===j){s.tag=11,s=mg(null,s,n,d,l);break e}else if(p===$){s.tag=14,s=hg(null,s,n,d,l);break e}}throw s=Q(n)||n,Error(r(306,s,""))}}return s;case 0:return pf(n,s,s.type,s.pendingProps,l);case 1:return d=s.type,p=kr(d,s.pendingProps),yg(n,s,d,p,l);case 3:e:{if(Be(s,s.stateNode.containerInfo),n===null)throw Error(r(387));d=s.pendingProps;var x=s.memoizedState;p=x.element,Fd(n,s),Al(s,d,null,l);var _=s.memoizedState;if(d=_.cache,Ps(s,en,d),d!==x.cache&&Ld(s,[en],l,!0),Sl(),d=_.element,x.isDehydrated)if(x={element:d,isDehydrated:!1,cache:_.cache},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){s=Ng(n,s,d,l);break e}else if(d!==p){p=Ta(Error(r(424)),s),El(p),s=Ng(n,s,d,l);break e}else{switch(n=s.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(Lt=Ca(n.firstChild),xn=s,dt=!0,js=null,Sa=!0,l=g0(s,null,d,l),s.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Nr(),d===p){s=hs(n,s,l);break e}yn(n,s,d,l)}s=s.child}return s;case 26:return Au(n,s),n===null?(l=jb(s.type,null,s.pendingProps,null))?s.memoizedState=l:dt||(l=s.type,n=s.pendingProps,d=$u(V.current).createElement(l),d[Gt]=s,d[An]=n,Nn(d,l,n),Zt(d),s.stateNode=d):s.memoizedState=jb(s.type,n.memoizedProps,s.pendingProps,n.memoizedState),null;case 27:return xt(s),n===null&&dt&&(d=s.stateNode=Mb(s.type,s.pendingProps,V.current),xn=s,Sa=!0,p=Lt,Ws(s.type)?(tm=p,Lt=Ca(d.firstChild)):Lt=p),yn(n,s,s.pendingProps.children,l),Au(n,s),n===null&&(s.flags|=4194304),s.child;case 5:return n===null&&dt&&((p=d=Lt)&&(d=ev(d,s.type,s.pendingProps,Sa),d!==null?(s.stateNode=d,xn=s,Lt=Ca(d.firstChild),Sa=!1,p=!0):p=!1),p||Bs(s)),xt(s),p=s.type,x=s.pendingProps,_=n!==null?n.memoizedProps:null,d=x.children,Qf(p,x)?d=null:_!==null&&Qf(p,_)&&(s.flags|=32),s.memoizedState!==null&&(p=Vd(n,s,p2,null,null,l),Gl._currentValue=p),Au(n,s),yn(n,s,d,l),s.child;case 6:return n===null&&dt&&((n=l=Lt)&&(l=tv(l,s.pendingProps,Sa),l!==null?(s.stateNode=l,xn=s,Lt=null,n=!0):n=!1),n||Bs(s)),null;case 13:return Tg(n,s,l);case 4:return Be(s,s.stateNode.containerInfo),d=s.pendingProps,n===null?s.child=Cr(s,null,d,l):yn(n,s,d,l),s.child;case 11:return mg(n,s,s.type,s.pendingProps,l);case 7:return yn(n,s,s.pendingProps,l),s.child;case 8:return yn(n,s,s.pendingProps.children,l),s.child;case 12:return yn(n,s,s.pendingProps.children,l),s.child;case 10:return d=s.pendingProps,Ps(s,s.type,d.value),yn(n,s,d.children,l),s.child;case 9:return p=s.type._context,d=s.pendingProps.children,_r(s),p=En(p),d=d(p),s.flags|=1,yn(n,s,d,l),s.child;case 14:return hg(n,s,s.type,s.pendingProps,l);case 15:return pg(n,s,s.type,s.pendingProps,l);case 19:return vg(n,s,l);case 31:return _2(n,s,l);case 22:return gg(n,s,l,s.pendingProps);case 24:return _r(s),d=En(en),n===null?(p=Pd(),p===null&&(p=kt,x=jd(),p.pooledCache=x,x.refCount++,x!==null&&(p.pooledCacheLanes|=l),p=x),s.memoizedState={parent:d,cache:p},Hd(s),Ps(s,en,p)):((n.lanes&l)!==0&&(Fd(n,s),Al(s,null,null,l),Sl()),p=n.memoizedState,x=s.memoizedState,p.parent!==d?(p={parent:d,cache:d},s.memoizedState=p,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=p),Ps(s,en,d)):(d=x.cache,Ps(s,en,d),d!==p.cache&&Ld(s,[en],l,!0))),yn(n,s,s.pendingProps.children,l),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function ps(n){n.flags|=4}function _f(n,s,l,d,p){if((s=(n.mode&32)!==0)&&(s=!1),s){if(n.flags|=16777216,(p&335544128)===p)if(n.stateNode.complete)n.flags|=8192;else if(Zg())n.flags|=8192;else throw Ar=du,Ud}else n.flags&=-16777217}function Ag(n,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!Fb(s))if(Zg())n.flags|=8192;else throw Ar=du,Ud}function wu(n,s){s!==null&&(n.flags|=4),n.flags&16384&&(s=n.tag!==22?Ke():536870912,n.lanes|=s,Si|=s)}function Il(n,s){if(!dt)switch(n.tailMode){case"hidden":s=n.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?n.tail=null:l.sibling=null;break;case"collapsed":l=n.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?s||n.tail===null?n.tail=null:n.tail.sibling=null:d.sibling=null}}function jt(n){var s=n.alternate!==null&&n.alternate.child===n.child,l=0,d=0;if(s)for(var p=n.child;p!==null;)l|=p.lanes|p.childLanes,d|=p.subtreeFlags&65011712,d|=p.flags&65011712,p.return=n,p=p.sibling;else for(p=n.child;p!==null;)l|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=n,p=p.sibling;return n.subtreeFlags|=d,n.childLanes=l,s}function S2(n,s,l){var d=s.pendingProps;switch(Rd(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jt(s),null;case 1:return jt(s),null;case 3:return l=s.stateNode,d=null,n!==null&&(d=n.memoizedState.cache),s.memoizedState.cache!==d&&(s.flags|=2048),ds(en),Ue(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(n===null||n.child===null)&&(fi(s)?ps(s):n===null||n.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Id())),jt(s),null;case 26:var p=s.type,x=s.memoizedState;return n===null?(ps(s),x!==null?(jt(s),Ag(s,x)):(jt(s),_f(s,p,null,d,l))):x?x!==n.memoizedState?(ps(s),jt(s),Ag(s,x)):(jt(s),s.flags&=-16777217):(n=n.memoizedProps,n!==d&&ps(s),jt(s),_f(s,p,n,d,l)),null;case 27:if(un(s),l=V.current,p=s.type,n!==null&&s.stateNode!=null)n.memoizedProps!==d&&ps(s);else{if(!d){if(s.stateNode===null)throw Error(r(166));return jt(s),null}n=Ne.current,fi(s)?r0(s):(n=Mb(p,d,l),s.stateNode=n,ps(s))}return jt(s),null;case 5:if(un(s),p=s.type,n!==null&&s.stateNode!=null)n.memoizedProps!==d&&ps(s);else{if(!d){if(s.stateNode===null)throw Error(r(166));return jt(s),null}if(x=Ne.current,fi(s))r0(s);else{var _=$u(V.current);switch(x){case 1:x=_.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:x=_.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":x=_.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":x=_.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":x=_.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof d.is=="string"?_.createElement("select",{is:d.is}):_.createElement("select"),d.multiple?x.multiple=!0:d.size&&(x.size=d.size);break;default:x=typeof d.is=="string"?_.createElement(p,{is:d.is}):_.createElement(p)}}x[Gt]=s,x[An]=d;e:for(_=s.child;_!==null;){if(_.tag===5||_.tag===6)x.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===s)break e;for(;_.sibling===null;){if(_.return===null||_.return===s)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}s.stateNode=x;e:switch(Nn(x,p,d),p){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&ps(s)}}return jt(s),_f(s,s.type,n===null?null:n.memoizedProps,s.pendingProps,l),null;case 6:if(n&&s.stateNode!=null)n.memoizedProps!==d&&ps(s);else{if(typeof d!="string"&&s.stateNode===null)throw Error(r(166));if(n=V.current,fi(s)){if(n=s.stateNode,l=s.memoizedProps,d=null,p=xn,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}n[Gt]=s,n=!!(n.nodeValue===l||d!==null&&d.suppressHydrationWarning===!0||Tb(n.nodeValue,l)),n||Bs(s,!0)}else n=$u(n).createTextNode(d),n[Gt]=s,s.stateNode=n}return jt(s),null;case 31:if(l=s.memoizedState,n===null||n.memoizedState!==null){if(d=fi(s),l!==null){if(n===null){if(!d)throw Error(r(318));if(n=s.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(557));n[Gt]=s}else Nr(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;jt(s),n=!1}else l=Id(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=l),n=!0;if(!n)return s.flags&256?(fa(s),s):(fa(s),null);if((s.flags&128)!==0)throw Error(r(558))}return jt(s),null;case 13:if(d=s.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(p=fi(s),d!==null&&d.dehydrated!==null){if(n===null){if(!p)throw Error(r(318));if(p=s.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(317));p[Gt]=s}else Nr(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;jt(s),p=!1}else p=Id(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=p),p=!0;if(!p)return s.flags&256?(fa(s),s):(fa(s),null)}return fa(s),(s.flags&128)!==0?(s.lanes=l,s):(l=d!==null,n=n!==null&&n.memoizedState!==null,l&&(d=s.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool),x=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(x=d.memoizedState.cachePool.pool),x!==p&&(d.flags|=2048)),l!==n&&l&&(s.child.flags|=8192),wu(s,s.updateQueue),jt(s),null);case 4:return Ue(),n===null&&Yf(s.stateNode.containerInfo),jt(s),null;case 10:return ds(s.type),jt(s),null;case 19:if(se(Vt),d=s.memoizedState,d===null)return jt(s),null;if(p=(s.flags&128)!==0,x=d.rendering,x===null)if(p)Il(d,!1);else{if(qt!==0||n!==null&&(n.flags&128)!==0)for(n=s.child;n!==null;){if(x=pu(n),x!==null){for(s.flags|=128,Il(d,!1),n=x.updateQueue,s.updateQueue=n,wu(s,n),s.subtreeFlags=0,n=l,l=s.child;l!==null;)e0(l,n),l=l.sibling;return L(Vt,Vt.current&1|2),dt&&us(s,d.treeForkCount),s.child}n=n.sibling}d.tail!==null&&It()>Mu&&(s.flags|=128,p=!0,Il(d,!1),s.lanes=4194304)}else{if(!p)if(n=pu(x),n!==null){if(s.flags|=128,p=!0,n=n.updateQueue,s.updateQueue=n,wu(s,n),Il(d,!0),d.tail===null&&d.tailMode==="hidden"&&!x.alternate&&!dt)return jt(s),null}else 2*It()-d.renderingStartTime>Mu&&l!==536870912&&(s.flags|=128,p=!0,Il(d,!1),s.lanes=4194304);d.isBackwards?(x.sibling=s.child,s.child=x):(n=d.last,n!==null?n.sibling=x:s.child=x,d.last=x)}return d.tail!==null?(n=d.tail,d.rendering=n,d.tail=n.sibling,d.renderingStartTime=It(),n.sibling=null,l=Vt.current,L(Vt,p?l&1|2:l&1),dt&&us(s,d.treeForkCount),n):(jt(s),null);case 22:case 23:return fa(s),Yd(),d=s.memoizedState!==null,n!==null?n.memoizedState!==null!==d&&(s.flags|=8192):d&&(s.flags|=8192),d?(l&536870912)!==0&&(s.flags&128)===0&&(jt(s),s.subtreeFlags&6&&(s.flags|=8192)):jt(s),l=s.updateQueue,l!==null&&wu(s,l.retryQueue),l=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),d=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==l&&(s.flags|=2048),n!==null&&se(vr),null;case 24:return l=null,n!==null&&(l=n.memoizedState.cache),s.memoizedState.cache!==l&&(s.flags|=2048),ds(en),jt(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function A2(n,s){switch(Rd(s),s.tag){case 1:return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 3:return ds(en),Ue(),n=s.flags,(n&65536)!==0&&(n&128)===0?(s.flags=n&-65537|128,s):null;case 26:case 27:case 5:return un(s),null;case 31:if(s.memoizedState!==null){if(fa(s),s.alternate===null)throw Error(r(340));Nr()}return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 13:if(fa(s),n=s.memoizedState,n!==null&&n.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Nr()}return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 19:return se(Vt),null;case 4:return Ue(),null;case 10:return ds(s.type),null;case 22:case 23:return fa(s),Yd(),n!==null&&se(vr),n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 24:return ds(en),null;case 25:return null;default:return null}}function Cg(n,s){switch(Rd(s),s.tag){case 3:ds(en),Ue();break;case 26:case 27:case 5:un(s);break;case 4:Ue();break;case 31:s.memoizedState!==null&&fa(s);break;case 13:fa(s);break;case 19:se(Vt);break;case 10:ds(s.type);break;case 22:case 23:fa(s),Yd(),n!==null&&se(vr);break;case 24:ds(en)}}function Ml(n,s){try{var l=s.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var p=d.next;l=p;do{if((l.tag&n)===n){d=void 0;var x=l.create,_=l.inst;d=x(),_.destroy=d}l=l.next}while(l!==p)}}catch(R){_t(s,s.return,R)}}function qs(n,s,l){try{var d=s.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var x=p.next;d=x;do{if((d.tag&n)===n){var _=d.inst,R=_.destroy;if(R!==void 0){_.destroy=void 0,p=s;var G=l,ie=R;try{ie()}catch(fe){_t(p,G,fe)}}}d=d.next}while(d!==x)}}catch(fe){_t(s,s.return,fe)}}function wg(n){var s=n.updateQueue;if(s!==null){var l=n.stateNode;try{x0(s,l)}catch(d){_t(n,n.return,d)}}}function kg(n,s,l){l.props=kr(n.type,n.memoizedProps),l.state=n.memoizedState;try{l.componentWillUnmount()}catch(d){_t(n,s,d)}}function Dl(n,s){try{var l=n.ref;if(l!==null){switch(n.tag){case 26:case 27:case 5:var d=n.stateNode;break;case 30:d=n.stateNode;break;default:d=n.stateNode}typeof l=="function"?n.refCleanup=l(d):l.current=d}}catch(p){_t(n,s,p)}}function Ka(n,s){var l=n.ref,d=n.refCleanup;if(l!==null)if(typeof d=="function")try{d()}catch(p){_t(n,s,p)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(p){_t(n,s,p)}else l.current=null}function Rg(n){var s=n.type,l=n.memoizedProps,d=n.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":l.autoFocus&&d.focus();break e;case"img":l.src?d.src=l.src:l.srcSet&&(d.srcset=l.srcSet)}}catch(p){_t(n,n.return,p)}}function vf(n,s,l){try{var d=n.stateNode;V2(d,n.type,l,s),d[An]=s}catch(p){_t(n,n.return,p)}}function Og(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Ws(n.type)||n.tag===4}function Sf(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Og(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&&Ws(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 Af(n,s,l){var d=n.tag;if(d===5||d===6)n=n.stateNode,s?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(n,s):(s=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,s.appendChild(n),l=l._reactRootContainer,l!=null||s.onclick!==null||(s.onclick=Ce));else if(d!==4&&(d===27&&Ws(n.type)&&(l=n.stateNode,s=null),n=n.child,n!==null))for(Af(n,s,l),n=n.sibling;n!==null;)Af(n,s,l),n=n.sibling}function ku(n,s,l){var d=n.tag;if(d===5||d===6)n=n.stateNode,s?l.insertBefore(n,s):l.appendChild(n);else if(d!==4&&(d===27&&Ws(n.type)&&(l=n.stateNode),n=n.child,n!==null))for(ku(n,s,l),n=n.sibling;n!==null;)ku(n,s,l),n=n.sibling}function Ig(n){var s=n.stateNode,l=n.memoizedProps;try{for(var d=n.type,p=s.attributes;p.length;)s.removeAttributeNode(p[0]);Nn(s,d,l),s[Gt]=n,s[An]=l}catch(x){_t(n,n.return,x)}}var gs=!1,an=!1,Cf=!1,Mg=typeof WeakSet=="function"?WeakSet:Set,dn=null;function C2(n,s){if(n=n.containerInfo,Vf=Qu,n=Yp(n),Ed(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var p=d.anchorOffset,x=d.focusNode;d=d.focusOffset;try{l.nodeType,x.nodeType}catch{l=null;break e}var _=0,R=-1,G=-1,ie=0,fe=0,ge=n,oe=null;t:for(;;){for(var ue;ge!==l||p!==0&&ge.nodeType!==3||(R=_+p),ge!==x||d!==0&&ge.nodeType!==3||(G=_+d),ge.nodeType===3&&(_+=ge.nodeValue.length),(ue=ge.firstChild)!==null;)oe=ge,ge=ue;for(;;){if(ge===n)break t;if(oe===l&&++ie===p&&(R=_),oe===x&&++fe===d&&(G=_),(ue=ge.nextSibling)!==null)break;ge=oe,oe=ge.parentNode}ge=ue}l=R===-1||G===-1?null:{start:R,end:G}}else l=null}l=l||{start:0,end:0}}else l=null;for(Xf={focusedElem:n,selectionRange:l},Qu=!1,dn=s;dn!==null;)if(s=dn,n=s.child,(s.subtreeFlags&1028)!==0&&n!==null)n.return=s,dn=n;else for(;dn!==null;){switch(s=dn,x=s.alternate,n=s.flags,s.tag){case 0:if((n&4)!==0&&(n=s.updateQueue,n=n!==null?n.events:null,n!==null))for(l=0;l<n.length;l++)p=n[l],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&x!==null){n=void 0,l=s,p=x.memoizedProps,x=x.memoizedState,d=l.stateNode;try{var Ie=kr(l.type,p);n=d.getSnapshotBeforeUpdate(Ie,x),d.__reactInternalSnapshotBeforeUpdate=n}catch($e){_t(l,l.return,$e)}}break;case 3:if((n&1024)!==0){if(n=s.stateNode.containerInfo,l=n.nodeType,l===9)Zf(n);else if(l===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":Zf(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(r(163))}if(n=s.sibling,n!==null){n.return=s.return,dn=n;break}dn=s.return}}function Dg(n,s,l){var d=l.flags;switch(l.tag){case 0:case 11:case 15:xs(n,l),d&4&&Ml(5,l);break;case 1:if(xs(n,l),d&4)if(n=l.stateNode,s===null)try{n.componentDidMount()}catch(_){_t(l,l.return,_)}else{var p=kr(l.type,s.memoizedProps);s=s.memoizedState;try{n.componentDidUpdate(p,s,n.__reactInternalSnapshotBeforeUpdate)}catch(_){_t(l,l.return,_)}}d&64&&wg(l),d&512&&Dl(l,l.return);break;case 3:if(xs(n,l),d&64&&(n=l.updateQueue,n!==null)){if(s=null,l.child!==null)switch(l.child.tag){case 27:case 5:s=l.child.stateNode;break;case 1:s=l.child.stateNode}try{x0(n,s)}catch(_){_t(l,l.return,_)}}break;case 27:s===null&&d&4&&Ig(l);case 26:case 5:xs(n,l),s===null&&d&4&&Rg(l),d&512&&Dl(l,l.return);break;case 12:xs(n,l);break;case 31:xs(n,l),d&4&&Bg(n,l);break;case 13:xs(n,l),d&4&&Pg(n,l),d&64&&(n=l.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(l=j2.bind(null,l),nv(n,l))));break;case 22:if(d=l.memoizedState!==null||gs,!d){s=s!==null&&s.memoizedState!==null||an,p=gs;var x=an;gs=d,(an=s)&&!x?Es(n,l,(l.subtreeFlags&8772)!==0):xs(n,l),gs=p,an=x}break;case 30:break;default:xs(n,l)}}function Lg(n){var s=n.alternate;s!==null&&(n.alternate=null,Lg(s)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(s=n.stateNode,s!==null&&sl(s)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var Pt=null,Qn=!1;function bs(n,s,l){for(l=l.child;l!==null;)jg(n,s,l),l=l.sibling}function jg(n,s,l){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(gn,l)}catch{}switch(l.tag){case 26:an||Ka(l,s),bs(n,s,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:an||Ka(l,s);var d=Pt,p=Qn;Ws(l.type)&&(Pt=l.stateNode,Qn=!1),bs(n,s,l),$l(l.stateNode),Pt=d,Qn=p;break;case 5:an||Ka(l,s);case 6:if(d=Pt,p=Qn,Pt=null,bs(n,s,l),Pt=d,Qn=p,Pt!==null)if(Qn)try{(Pt.nodeType===9?Pt.body:Pt.nodeName==="HTML"?Pt.ownerDocument.body:Pt).removeChild(l.stateNode)}catch(x){_t(l,s,x)}else try{Pt.removeChild(l.stateNode)}catch(x){_t(l,s,x)}break;case 18:Pt!==null&&(Qn?(n=Pt,wb(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,l.stateNode),Mi(n)):wb(Pt,l.stateNode));break;case 4:d=Pt,p=Qn,Pt=l.stateNode.containerInfo,Qn=!0,bs(n,s,l),Pt=d,Qn=p;break;case 0:case 11:case 14:case 15:qs(2,l,s),an||qs(4,l,s),bs(n,s,l);break;case 1:an||(Ka(l,s),d=l.stateNode,typeof d.componentWillUnmount=="function"&&kg(l,s,d)),bs(n,s,l);break;case 21:bs(n,s,l);break;case 22:an=(d=an)||l.memoizedState!==null,bs(n,s,l),an=d;break;default:bs(n,s,l)}}function Bg(n,s){if(s.memoizedState===null&&(n=s.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{Mi(n)}catch(l){_t(s,s.return,l)}}}function Pg(n,s){if(s.memoizedState===null&&(n=s.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Mi(n)}catch(l){_t(s,s.return,l)}}function w2(n){switch(n.tag){case 31:case 13:case 19:var s=n.stateNode;return s===null&&(s=n.stateNode=new Mg),s;case 22:return n=n.stateNode,s=n._retryCache,s===null&&(s=n._retryCache=new Mg),s;default:throw Error(r(435,n.tag))}}function Ru(n,s){var l=w2(n);s.forEach(function(d){if(!l.has(d)){l.add(d);var p=B2.bind(null,n,d);d.then(p,p)}})}function Wn(n,s){var l=s.deletions;if(l!==null)for(var d=0;d<l.length;d++){var p=l[d],x=n,_=s,R=_;e:for(;R!==null;){switch(R.tag){case 27:if(Ws(R.type)){Pt=R.stateNode,Qn=!1;break e}break;case 5:Pt=R.stateNode,Qn=!1;break e;case 3:case 4:Pt=R.stateNode.containerInfo,Qn=!0;break e}R=R.return}if(Pt===null)throw Error(r(160));jg(x,_,p),Pt=null,Qn=!1,x=p.alternate,x!==null&&(x.return=null),p.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)Ug(s,n),s=s.sibling}var Ba=null;function Ug(n,s){var l=n.alternate,d=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:Wn(s,n),Zn(n),d&4&&(qs(3,n,n.return),Ml(3,n),qs(5,n,n.return));break;case 1:Wn(s,n),Zn(n),d&512&&(an||l===null||Ka(l,l.return)),d&64&&gs&&(n=n.updateQueue,n!==null&&(d=n.callbacks,d!==null&&(l=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=l===null?d:l.concat(d))));break;case 26:var p=Ba;if(Wn(s,n),Zn(n),d&512&&(an||l===null||Ka(l,l.return)),d&4){var x=l!==null?l.memoizedState:null;if(d=n.memoizedState,l===null)if(d===null)if(n.stateNode===null){e:{d=n.type,l=n.memoizedProps,p=p.ownerDocument||p;t:switch(d){case"title":x=p.getElementsByTagName("title")[0],(!x||x[mr]||x[Gt]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=p.createElement(d),p.head.insertBefore(x,p.querySelector("head > title"))),Nn(x,d,l),x[Gt]=n,Zt(x),d=x;break e;case"link":var _=Ub("link","href",p).get(d+(l.href||""));if(_){for(var R=0;R<_.length;R++)if(x=_[R],x.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&x.getAttribute("rel")===(l.rel==null?null:l.rel)&&x.getAttribute("title")===(l.title==null?null:l.title)&&x.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){_.splice(R,1);break t}}x=p.createElement(d),Nn(x,d,l),p.head.appendChild(x);break;case"meta":if(_=Ub("meta","content",p).get(d+(l.content||""))){for(R=0;R<_.length;R++)if(x=_[R],x.getAttribute("content")===(l.content==null?null:""+l.content)&&x.getAttribute("name")===(l.name==null?null:l.name)&&x.getAttribute("property")===(l.property==null?null:l.property)&&x.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&x.getAttribute("charset")===(l.charSet==null?null:l.charSet)){_.splice(R,1);break t}}x=p.createElement(d),Nn(x,d,l),p.head.appendChild(x);break;default:throw Error(r(468,d))}x[Gt]=n,Zt(x),d=x}n.stateNode=d}else Hb(p,n.type,n.stateNode);else n.stateNode=Pb(p,d,n.memoizedProps);else x!==d?(x===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):x.count--,d===null?Hb(p,n.type,n.stateNode):Pb(p,d,n.memoizedProps)):d===null&&n.stateNode!==null&&vf(n,n.memoizedProps,l.memoizedProps)}break;case 27:Wn(s,n),Zn(n),d&512&&(an||l===null||Ka(l,l.return)),l!==null&&d&4&&vf(n,n.memoizedProps,l.memoizedProps);break;case 5:if(Wn(s,n),Zn(n),d&512&&(an||l===null||Ka(l,l.return)),n.flags&32){p=n.stateNode;try{qe(p,"")}catch(Ie){_t(n,n.return,Ie)}}d&4&&n.stateNode!=null&&(p=n.memoizedProps,vf(n,p,l!==null?l.memoizedProps:p)),d&1024&&(Cf=!0);break;case 6:if(Wn(s,n),Zn(n),d&4){if(n.stateNode===null)throw Error(r(162));d=n.memoizedProps,l=n.stateNode;try{l.nodeValue=d}catch(Ie){_t(n,n.return,Ie)}}break;case 3:if(Gu=null,p=Ba,Ba=qu(s.containerInfo),Wn(s,n),Ba=p,Zn(n),d&4&&l!==null&&l.memoizedState.isDehydrated)try{Mi(s.containerInfo)}catch(Ie){_t(n,n.return,Ie)}Cf&&(Cf=!1,Hg(n));break;case 4:d=Ba,Ba=qu(n.stateNode.containerInfo),Wn(s,n),Zn(n),Ba=d;break;case 12:Wn(s,n),Zn(n);break;case 31:Wn(s,n),Zn(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Ru(n,d)));break;case 13:Wn(s,n),Zn(n),n.child.flags&8192&&n.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Iu=It()),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Ru(n,d)));break;case 22:p=n.memoizedState!==null;var G=l!==null&&l.memoizedState!==null,ie=gs,fe=an;if(gs=ie||p,an=fe||G,Wn(s,n),an=fe,gs=ie,Zn(n),d&8192)e:for(s=n.stateNode,s._visibility=p?s._visibility&-2:s._visibility|1,p&&(l===null||G||gs||an||Rr(n)),l=null,s=n;;){if(s.tag===5||s.tag===26){if(l===null){G=l=s;try{if(x=G.stateNode,p)_=x.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{R=G.stateNode;var ge=G.memoizedProps.style,oe=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;R.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(Ie){_t(G,G.return,Ie)}}}else if(s.tag===6){if(l===null){G=s;try{G.stateNode.nodeValue=p?"":G.memoizedProps}catch(Ie){_t(G,G.return,Ie)}}}else if(s.tag===18){if(l===null){G=s;try{var ue=G.stateNode;p?kb(ue,!0):kb(G.stateNode,!1)}catch(Ie){_t(G,G.return,Ie)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===n)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break e;for(;s.sibling===null;){if(s.return===null||s.return===n)break e;l===s&&(l=null),s=s.return}l===s&&(l=null),s.sibling.return=s.return,s=s.sibling}d&4&&(d=n.updateQueue,d!==null&&(l=d.retryQueue,l!==null&&(d.retryQueue=null,Ru(n,l))));break;case 19:Wn(s,n),Zn(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Ru(n,d)));break;case 30:break;case 21:break;default:Wn(s,n),Zn(n)}}function Zn(n){var s=n.flags;if(s&2){try{for(var l,d=n.return;d!==null;){if(Og(d)){l=d;break}d=d.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var p=l.stateNode,x=Sf(n);ku(n,x,p);break;case 5:var _=l.stateNode;l.flags&32&&(qe(_,""),l.flags&=-33);var R=Sf(n);ku(n,R,_);break;case 3:case 4:var G=l.stateNode.containerInfo,ie=Sf(n);Af(n,ie,G);break;default:throw Error(r(161))}}catch(fe){_t(n,n.return,fe)}n.flags&=-3}s&4096&&(n.flags&=-4097)}function Hg(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var s=n;Hg(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),n=n.sibling}}function xs(n,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Dg(n,s.alternate,s),s=s.sibling}function Rr(n){for(n=n.child;n!==null;){var s=n;switch(s.tag){case 0:case 11:case 14:case 15:qs(4,s,s.return),Rr(s);break;case 1:Ka(s,s.return);var l=s.stateNode;typeof l.componentWillUnmount=="function"&&kg(s,s.return,l),Rr(s);break;case 27:$l(s.stateNode);case 26:case 5:Ka(s,s.return),Rr(s);break;case 22:s.memoizedState===null&&Rr(s);break;case 30:Rr(s);break;default:Rr(s)}n=n.sibling}}function Es(n,s,l){for(l=l&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var d=s.alternate,p=n,x=s,_=x.flags;switch(x.tag){case 0:case 11:case 15:Es(p,x,l),Ml(4,x);break;case 1:if(Es(p,x,l),d=x,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(ie){_t(d,d.return,ie)}if(d=x,p=d.updateQueue,p!==null){var R=d.stateNode;try{var G=p.shared.hiddenCallbacks;if(G!==null)for(p.shared.hiddenCallbacks=null,p=0;p<G.length;p++)b0(G[p],R)}catch(ie){_t(d,d.return,ie)}}l&&_&64&&wg(x),Dl(x,x.return);break;case 27:Ig(x);case 26:case 5:Es(p,x,l),l&&d===null&&_&4&&Rg(x),Dl(x,x.return);break;case 12:Es(p,x,l);break;case 31:Es(p,x,l),l&&_&4&&Bg(p,x);break;case 13:Es(p,x,l),l&&_&4&&Pg(p,x);break;case 22:x.memoizedState===null&&Es(p,x,l),Dl(x,x.return);break;case 30:break;default:Es(p,x,l)}s=s.sibling}}function wf(n,s){var l=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),n=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(n=s.memoizedState.cachePool.pool),n!==l&&(n!=null&&n.refCount++,l!=null&&yl(l))}function kf(n,s){n=null,s.alternate!==null&&(n=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==n&&(s.refCount++,n!=null&&yl(n))}function Pa(n,s,l,d){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Fg(n,s,l,d),s=s.sibling}function Fg(n,s,l,d){var p=s.flags;switch(s.tag){case 0:case 11:case 15:Pa(n,s,l,d),p&2048&&Ml(9,s);break;case 1:Pa(n,s,l,d);break;case 3:Pa(n,s,l,d),p&2048&&(n=null,s.alternate!==null&&(n=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==n&&(s.refCount++,n!=null&&yl(n)));break;case 12:if(p&2048){Pa(n,s,l,d),n=s.stateNode;try{var x=s.memoizedProps,_=x.id,R=x.onPostCommit;typeof R=="function"&&R(_,s.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(G){_t(s,s.return,G)}}else Pa(n,s,l,d);break;case 31:Pa(n,s,l,d);break;case 13:Pa(n,s,l,d);break;case 23:break;case 22:x=s.stateNode,_=s.alternate,s.memoizedState!==null?x._visibility&2?Pa(n,s,l,d):Ll(n,s):x._visibility&2?Pa(n,s,l,d):(x._visibility|=2,Ti(n,s,l,d,(s.subtreeFlags&10256)!==0||!1)),p&2048&&wf(_,s);break;case 24:Pa(n,s,l,d),p&2048&&kf(s.alternate,s);break;default:Pa(n,s,l,d)}}function Ti(n,s,l,d,p){for(p=p&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var x=n,_=s,R=l,G=d,ie=_.flags;switch(_.tag){case 0:case 11:case 15:Ti(x,_,R,G,p),Ml(8,_);break;case 23:break;case 22:var fe=_.stateNode;_.memoizedState!==null?fe._visibility&2?Ti(x,_,R,G,p):Ll(x,_):(fe._visibility|=2,Ti(x,_,R,G,p)),p&&ie&2048&&wf(_.alternate,_);break;case 24:Ti(x,_,R,G,p),p&&ie&2048&&kf(_.alternate,_);break;default:Ti(x,_,R,G,p)}s=s.sibling}}function Ll(n,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var l=n,d=s,p=d.flags;switch(d.tag){case 22:Ll(l,d),p&2048&&wf(d.alternate,d);break;case 24:Ll(l,d),p&2048&&kf(d.alternate,d);break;default:Ll(l,d)}s=s.sibling}}var jl=8192;function _i(n,s,l){if(n.subtreeFlags&jl)for(n=n.child;n!==null;)zg(n,s,l),n=n.sibling}function zg(n,s,l){switch(n.tag){case 26:_i(n,s,l),n.flags&jl&&n.memoizedState!==null&&hv(l,Ba,n.memoizedState,n.memoizedProps);break;case 5:_i(n,s,l);break;case 3:case 4:var d=Ba;Ba=qu(n.stateNode.containerInfo),_i(n,s,l),Ba=d;break;case 22:n.memoizedState===null&&(d=n.alternate,d!==null&&d.memoizedState!==null?(d=jl,jl=16777216,_i(n,s,l),jl=d):_i(n,s,l));break;default:_i(n,s,l)}}function $g(n){var s=n.alternate;if(s!==null&&(n=s.child,n!==null)){s.child=null;do s=n.sibling,n.sibling=null,n=s;while(n!==null)}}function Bl(n){var s=n.deletions;if((n.flags&16)!==0){if(s!==null)for(var l=0;l<s.length;l++){var d=s[l];dn=d,Yg(d,n)}$g(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)qg(n),n=n.sibling}function qg(n){switch(n.tag){case 0:case 11:case 15:Bl(n),n.flags&2048&&qs(9,n,n.return);break;case 3:Bl(n);break;case 12:Bl(n);break;case 22:var s=n.stateNode;n.memoizedState!==null&&s._visibility&2&&(n.return===null||n.return.tag!==13)?(s._visibility&=-3,Ou(n)):Bl(n);break;default:Bl(n)}}function Ou(n){var s=n.deletions;if((n.flags&16)!==0){if(s!==null)for(var l=0;l<s.length;l++){var d=s[l];dn=d,Yg(d,n)}$g(n)}for(n=n.child;n!==null;){switch(s=n,s.tag){case 0:case 11:case 15:qs(8,s,s.return),Ou(s);break;case 22:l=s.stateNode,l._visibility&2&&(l._visibility&=-3,Ou(s));break;default:Ou(s)}n=n.sibling}}function Yg(n,s){for(;dn!==null;){var l=dn;switch(l.tag){case 0:case 11:case 15:qs(8,l,s);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var d=l.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:yl(l.memoizedState.cache)}if(d=l.child,d!==null)d.return=l,dn=d;else e:for(l=n;dn!==null;){d=dn;var p=d.sibling,x=d.return;if(Lg(d),d===l){dn=null;break e}if(p!==null){p.return=x,dn=p;break e}dn=x}}}var k2={getCacheForType:function(n){var s=En(en),l=s.data.get(n);return l===void 0&&(l=n(),s.data.set(n,l)),l},cacheSignal:function(){return En(en).controller.signal}},R2=typeof WeakMap=="function"?WeakMap:Map,bt=0,kt=null,st=null,ot=0,Tt=0,ma=null,Ys=!1,vi=!1,Rf=!1,ys=0,qt=0,Gs=0,Or=0,Of=0,ha=0,Si=0,Pl=null,Jn=null,If=!1,Iu=0,Gg=0,Mu=1/0,Du=null,Ks=null,on=0,Vs=null,Ai=null,Ns=0,Mf=0,Df=null,Kg=null,Ul=0,Lf=null;function pa(){return(bt&2)!==0&&ot!==0?ot&-ot:F.T!==null?Ff():Zr()}function Vg(){if(ha===0)if((ot&536870912)===0||dt){var n=Wr;Wr<<=1,(Wr&3932160)===0&&(Wr=262144),ha=n}else ha=536870912;return n=da.current,n!==null&&(n.flags|=32),ha}function ea(n,s,l){(n===kt&&(Tt===2||Tt===9)||n.cancelPendingCommit!==null)&&(Ci(n,0),Xs(n,ot,ha,!1)),wt(n,l),((bt&2)===0||n!==kt)&&(n===kt&&((bt&2)===0&&(Or|=l),qt===4&&Xs(n,ot,ha,!1)),Va(n))}function Xg(n,s,l){if((bt&6)!==0)throw Error(r(327));var d=!l&&(s&127)===0&&(s&n.expiredLanes)===0||me(n,s),p=d?M2(n,s):Bf(n,s,!0),x=d;do{if(p===0){vi&&!d&&Xs(n,s,0,!1);break}else{if(l=n.current.alternate,x&&!O2(l)){p=Bf(n,s,!1),x=!1;continue}if(p===2){if(x=s,n.errorRecoveryDisabledLanes&x)var _=0;else _=n.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){s=_;e:{var R=n;p=Pl;var G=R.current.memoizedState.isDehydrated;if(G&&(Ci(R,_).flags|=256),_=Bf(R,_,!1),_!==2){if(Rf&&!G){R.errorRecoveryDisabledLanes|=x,Or|=x,p=4;break e}x=Jn,Jn=p,x!==null&&(Jn===null?Jn=x:Jn.push.apply(Jn,x))}p=_}if(x=!1,p!==2)continue}}if(p===1){Ci(n,0),Xs(n,s,0,!0);break}e:{switch(d=n,x=p,x){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:Xs(d,s,ha,!Ys);break e;case 2:Jn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(p=Iu+300-It(),10<p)){if(Xs(d,s,ha,!Ys),X(d,0,!0)!==0)break e;Ns=s,d.timeoutHandle=Ab(Qg.bind(null,d,l,Jn,Du,If,s,ha,Or,Si,Ys,x,"Throttled",-0,0),p);break e}Qg(d,l,Jn,Du,If,s,ha,Or,Si,Ys,x,null,-0,0)}}break}while(!0);Va(n)}function Qg(n,s,l,d,p,x,_,R,G,ie,fe,ge,oe,ue){if(n.timeoutHandle=-1,ge=s.subtreeFlags,ge&8192||(ge&16785408)===16785408){ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ce},zg(s,x,ge);var Ie=(x&62914560)===x?Iu-It():(x&4194048)===x?Gg-It():0;if(Ie=pv(ge,Ie),Ie!==null){Ns=x,n.cancelPendingCommit=Ie(sb.bind(null,n,s,x,l,d,p,_,R,G,fe,ge,null,oe,ue)),Xs(n,x,_,!ie);return}}sb(n,s,x,l,d,p,_,R,G)}function O2(n){for(var s=n;;){var l=s.tag;if((l===0||l===11||l===15)&&s.flags&16384&&(l=s.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var d=0;d<l.length;d++){var p=l[d],x=p.getSnapshot;p=p.value;try{if(!ua(x(),p))return!1}catch{return!1}}if(l=s.child,s.subtreeFlags&16384&&l!==null)l.return=s,s=l;else{if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Xs(n,s,l,d){s&=~Of,s&=~Or,n.suspendedLanes|=s,n.pingedLanes&=~s,d&&(n.warmLanes|=s),d=n.expirationTimes;for(var p=s;0<p;){var x=31-Et(p),_=1<<x;d[x]=-1,p&=~_}l!==0&&Oe(n,l,s)}function Lu(){return(bt&6)===0?(Hl(0),!1):!0}function jf(){if(st!==null){if(Tt===0)var n=st.return;else n=st,cs=Tr=null,Wd(n),bi=null,Tl=0,n=st;for(;n!==null;)Cg(n.alternate,n),n=n.return;st=null}}function Ci(n,s){var l=n.timeoutHandle;l!==-1&&(n.timeoutHandle=-1,W2(l)),l=n.cancelPendingCommit,l!==null&&(n.cancelPendingCommit=null,l()),Ns=0,jf(),kt=n,st=l=os(n.current,null),ot=s,Tt=0,ma=null,Ys=!1,vi=me(n,s),Rf=!1,Si=ha=Of=Or=Gs=qt=0,Jn=Pl=null,If=!1,(s&8)!==0&&(s|=s&32);var d=n.entangledLanes;if(d!==0)for(n=n.entanglements,d&=s;0<d;){var p=31-Et(d),x=1<<p;s|=n[p],d&=~x}return ys=s,nu(),l}function Wg(n,s){Ze=null,F.H=Rl,s===gi||s===cu?(s=m0(),Tt=3):s===Ud?(s=m0(),Tt=4):Tt=s===hf?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,ma=s,st===null&&(qt=1,vu(n,Ta(s,n.current)))}function Zg(){var n=da.current;return n===null?!0:(ot&4194048)===ot?Aa===null:(ot&62914560)===ot||(ot&536870912)!==0?n===Aa:!1}function Jg(){var n=F.H;return F.H=Rl,n===null?Rl:n}function eb(){var n=F.A;return F.A=k2,n}function ju(){qt=4,Ys||(ot&4194048)!==ot&&da.current!==null||(vi=!0),(Gs&134217727)===0&&(Or&134217727)===0||kt===null||Xs(kt,ot,ha,!1)}function Bf(n,s,l){var d=bt;bt|=2;var p=Jg(),x=eb();(kt!==n||ot!==s)&&(Du=null,Ci(n,s)),s=!1;var _=qt;e:do try{if(Tt!==0&&st!==null){var R=st,G=ma;switch(Tt){case 8:jf(),_=6;break e;case 3:case 2:case 9:case 6:da.current===null&&(s=!0);var ie=Tt;if(Tt=0,ma=null,wi(n,R,G,ie),l&&vi){_=0;break e}break;default:ie=Tt,Tt=0,ma=null,wi(n,R,G,ie)}}I2(),_=qt;break}catch(fe){Wg(n,fe)}while(!0);return s&&n.shellSuspendCounter++,cs=Tr=null,bt=d,F.H=p,F.A=x,st===null&&(kt=null,ot=0,nu()),_}function I2(){for(;st!==null;)tb(st)}function M2(n,s){var l=bt;bt|=2;var d=Jg(),p=eb();kt!==n||ot!==s?(Du=null,Mu=It()+500,Ci(n,s)):vi=me(n,s);e:do try{if(Tt!==0&&st!==null){s=st;var x=ma;t:switch(Tt){case 1:Tt=0,ma=null,wi(n,s,x,1);break;case 2:case 9:if(d0(x)){Tt=0,ma=null,nb(s);break}s=function(){Tt!==2&&Tt!==9||kt!==n||(Tt=7),Va(n)},x.then(s,s);break e;case 3:Tt=7;break e;case 4:Tt=5;break e;case 7:d0(x)?(Tt=0,ma=null,nb(s)):(Tt=0,ma=null,wi(n,s,x,7));break;case 5:var _=null;switch(st.tag){case 26:_=st.memoizedState;case 5:case 27:var R=st;if(_?Fb(_):R.stateNode.complete){Tt=0,ma=null;var G=R.sibling;if(G!==null)st=G;else{var ie=R.return;ie!==null?(st=ie,Bu(ie)):st=null}break t}}Tt=0,ma=null,wi(n,s,x,5);break;case 6:Tt=0,ma=null,wi(n,s,x,6);break;case 8:jf(),qt=6;break e;default:throw Error(r(462))}}D2();break}catch(fe){Wg(n,fe)}while(!0);return cs=Tr=null,F.H=d,F.A=p,bt=l,st!==null?0:(kt=null,ot=0,nu(),qt)}function D2(){for(;st!==null&&!ct();)tb(st)}function tb(n){var s=Sg(n.alternate,n,ys);n.memoizedProps=n.pendingProps,s===null?Bu(n):st=s}function nb(n){var s=n,l=s.alternate;switch(s.tag){case 15:case 0:s=Eg(l,s,s.pendingProps,s.type,void 0,ot);break;case 11:s=Eg(l,s,s.pendingProps,s.type.render,s.ref,ot);break;case 5:Wd(s);default:Cg(l,s),s=st=e0(s,ys),s=Sg(l,s,ys)}n.memoizedProps=n.pendingProps,s===null?Bu(n):st=s}function wi(n,s,l,d){cs=Tr=null,Wd(s),bi=null,Tl=0;var p=s.return;try{if(T2(n,p,s,l,ot)){qt=1,vu(n,Ta(l,n.current)),st=null;return}}catch(x){if(p!==null)throw st=p,x;qt=1,vu(n,Ta(l,n.current)),st=null;return}s.flags&32768?(dt||d===1?n=!0:vi||(ot&536870912)!==0?n=!1:(Ys=n=!0,(d===2||d===9||d===3||d===6)&&(d=da.current,d!==null&&d.tag===13&&(d.flags|=16384))),ab(s,n)):Bu(s)}function Bu(n){var s=n;do{if((s.flags&32768)!==0){ab(s,Ys);return}n=s.return;var l=S2(s.alternate,s,ys);if(l!==null){st=l;return}if(s=s.sibling,s!==null){st=s;return}st=s=n}while(s!==null);qt===0&&(qt=5)}function ab(n,s){do{var l=A2(n.alternate,n);if(l!==null){l.flags&=32767,st=l;return}if(l=n.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!s&&(n=n.sibling,n!==null)){st=n;return}st=n=l}while(n!==null);qt=6,st=null}function sb(n,s,l,d,p,x,_,R,G){n.cancelPendingCommit=null;do Pu();while(on!==0);if((bt&6)!==0)throw Error(r(327));if(s!==null){if(s===n.current)throw Error(r(177));if(x=s.lanes|s.childLanes,x|=vd,Me(n,l,x,_,R,G),n===kt&&(st=kt=null,ot=0),Ai=s,Vs=n,Ns=l,Mf=x,Df=p,Kg=d,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,P2(ze,function(){return ub(),null})):(n.callbackNode=null,n.callbackPriority=0),d=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||d){d=F.T,F.T=null,p=k.p,k.p=2,_=bt,bt|=4;try{C2(n,s,l)}finally{bt=_,k.p=p,F.T=d}}on=1,rb(),ib(),lb()}}function rb(){if(on===1){on=0;var n=Vs,s=Ai,l=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||l){l=F.T,F.T=null;var d=k.p;k.p=2;var p=bt;bt|=4;try{Ug(s,n);var x=Xf,_=Yp(n.containerInfo),R=x.focusedElem,G=x.selectionRange;if(_!==R&&R&&R.ownerDocument&&qp(R.ownerDocument.documentElement,R)){if(G!==null&&Ed(R)){var ie=G.start,fe=G.end;if(fe===void 0&&(fe=ie),"selectionStart"in R)R.selectionStart=ie,R.selectionEnd=Math.min(fe,R.value.length);else{var ge=R.ownerDocument||document,oe=ge&&ge.defaultView||window;if(oe.getSelection){var ue=oe.getSelection(),Ie=R.textContent.length,$e=Math.min(G.start,Ie),At=G.end===void 0?$e:Math.min(G.end,Ie);!ue.extend&&$e>At&&(_=At,At=$e,$e=_);var ee=$p(R,$e),W=$p(R,At);if(ee&&W&&(ue.rangeCount!==1||ue.anchorNode!==ee.node||ue.anchorOffset!==ee.offset||ue.focusNode!==W.node||ue.focusOffset!==W.offset)){var re=ge.createRange();re.setStart(ee.node,ee.offset),ue.removeAllRanges(),$e>At?(ue.addRange(re),ue.extend(W.node,W.offset)):(re.setEnd(W.node,W.offset),ue.addRange(re))}}}}for(ge=[],ue=R;ue=ue.parentNode;)ue.nodeType===1&&ge.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<ge.length;R++){var he=ge[R];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}Qu=!!Vf,Xf=Vf=null}finally{bt=p,k.p=d,F.T=l}}n.current=s,on=2}}function ib(){if(on===2){on=0;var n=Vs,s=Ai,l=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||l){l=F.T,F.T=null;var d=k.p;k.p=2;var p=bt;bt|=4;try{Dg(n,s.alternate,s)}finally{bt=p,k.p=d,F.T=l}}on=3}}function lb(){if(on===4||on===3){on=0,ia();var n=Vs,s=Ai,l=Ns,d=Kg;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?on=5:(on=0,Ai=Vs=null,ob(n,n.pendingLanes));var p=n.pendingLanes;if(p===0&&(Ks=null),as(l),s=s.stateNode,zt&&typeof zt.onCommitFiberRoot=="function")try{zt.onCommitFiberRoot(gn,s,void 0,(s.current.flags&128)===128)}catch{}if(d!==null){s=F.T,p=k.p,k.p=2,F.T=null;try{for(var x=n.onRecoverableError,_=0;_<d.length;_++){var R=d[_];x(R.value,{componentStack:R.stack})}}finally{F.T=s,k.p=p}}(Ns&3)!==0&&Pu(),Va(n),p=n.pendingLanes,(l&261930)!==0&&(p&42)!==0?n===Lf?Ul++:(Ul=0,Lf=n):Ul=0,Hl(0)}}function ob(n,s){(n.pooledCacheLanes&=s)===0&&(s=n.pooledCache,s!=null&&(n.pooledCache=null,yl(s)))}function Pu(){return rb(),ib(),lb(),ub()}function ub(){if(on!==5)return!1;var n=Vs,s=Mf;Mf=0;var l=as(Ns),d=F.T,p=k.p;try{k.p=32>l?32:l,F.T=null,l=Df,Df=null;var x=Vs,_=Ns;if(on=0,Ai=Vs=null,Ns=0,(bt&6)!==0)throw Error(r(331));var R=bt;if(bt|=4,qg(x.current),Fg(x,x.current,_,l),bt=R,Hl(0,!1),zt&&typeof zt.onPostCommitFiberRoot=="function")try{zt.onPostCommitFiberRoot(gn,x)}catch{}return!0}finally{k.p=p,F.T=d,ob(n,s)}}function cb(n,s,l){s=Ta(l,s),s=mf(n.stateNode,s,2),n=Fs(n,s,2),n!==null&&(wt(n,2),Va(n))}function _t(n,s,l){if(n.tag===3)cb(n,n,l);else for(;s!==null;){if(s.tag===3){cb(s,n,l);break}else if(s.tag===1){var d=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Ks===null||!Ks.has(d))){n=Ta(l,n),l=dg(2),d=Fs(s,l,2),d!==null&&(fg(l,d,s,n),wt(d,2),Va(d));break}}s=s.return}}function Pf(n,s,l){var d=n.pingCache;if(d===null){d=n.pingCache=new R2;var p=new Set;d.set(s,p)}else p=d.get(s),p===void 0&&(p=new Set,d.set(s,p));p.has(l)||(Rf=!0,p.add(l),n=L2.bind(null,n,s,l),s.then(n,n))}function L2(n,s,l){var d=n.pingCache;d!==null&&d.delete(s),n.pingedLanes|=n.suspendedLanes&l,n.warmLanes&=~l,kt===n&&(ot&l)===l&&(qt===4||qt===3&&(ot&62914560)===ot&&300>It()-Iu?(bt&2)===0&&Ci(n,0):Of|=l,Si===ot&&(Si=0)),Va(n)}function db(n,s){s===0&&(s=Ke()),n=Er(n,s),n!==null&&(wt(n,s),Va(n))}function j2(n){var s=n.memoizedState,l=0;s!==null&&(l=s.retryLane),db(n,l)}function B2(n,s){var l=0;switch(n.tag){case 31:case 13:var d=n.stateNode,p=n.memoizedState;p!==null&&(l=p.retryLane);break;case 19:d=n.stateNode;break;case 22:d=n.stateNode._retryCache;break;default:throw Error(r(314))}d!==null&&d.delete(s),db(n,l)}function P2(n,s){return Da(n,s)}var Uu=null,ki=null,Uf=!1,Hu=!1,Hf=!1,Qs=0;function Va(n){n!==ki&&n.next===null&&(ki===null?Uu=ki=n:ki=ki.next=n),Hu=!0,Uf||(Uf=!0,H2())}function Hl(n,s){if(!Hf&&Hu){Hf=!0;do for(var l=!1,d=Uu;d!==null;){if(n!==0){var p=d.pendingLanes;if(p===0)var x=0;else{var _=d.suspendedLanes,R=d.pingedLanes;x=(1<<31-Et(42|n)+1)-1,x&=p&~(_&~R),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(l=!0,pb(d,x))}else x=ot,x=X(d,d===kt?x:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(x&3)===0||me(d,x)||(l=!0,pb(d,x));d=d.next}while(l);Hf=!1}}function U2(){fb()}function fb(){Hu=Uf=!1;var n=0;Qs!==0&&Q2()&&(n=Qs);for(var s=It(),l=null,d=Uu;d!==null;){var p=d.next,x=mb(d,s);x===0?(d.next=null,l===null?Uu=p:l.next=p,p===null&&(ki=l)):(l=d,(n!==0||(x&3)!==0)&&(Hu=!0)),d=p}on!==0&&on!==5||Hl(n),Qs!==0&&(Qs=0)}function mb(n,s){for(var l=n.suspendedLanes,d=n.pingedLanes,p=n.expirationTimes,x=n.pendingLanes&-62914561;0<x;){var _=31-Et(x),R=1<<_,G=p[_];G===-1?((R&l)===0||(R&d)!==0)&&(p[_]=we(R,s)):G<=s&&(n.expiredLanes|=R),x&=~R}if(s=kt,l=ot,l=X(n,n===s?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d=n.callbackNode,l===0||n===s&&(Tt===2||Tt===9)||n.cancelPendingCommit!==null)return d!==null&&d!==null&&be(d),n.callbackNode=null,n.callbackPriority=0;if((l&3)===0||me(n,l)){if(s=l&-l,s===n.callbackPriority)return s;switch(d!==null&&be(d),as(l)){case 2:case 8:l=Ae;break;case 32:l=ze;break;case 268435456:l=mt;break;default:l=ze}return d=hb.bind(null,n),l=Da(l,d),n.callbackPriority=s,n.callbackNode=l,s}return d!==null&&d!==null&&be(d),n.callbackPriority=2,n.callbackNode=null,2}function hb(n,s){if(on!==0&&on!==5)return n.callbackNode=null,n.callbackPriority=0,null;var l=n.callbackNode;if(Pu()&&n.callbackNode!==l)return null;var d=ot;return d=X(n,n===kt?d:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d===0?null:(Xg(n,d,s),mb(n,It()),n.callbackNode!=null&&n.callbackNode===l?hb.bind(null,n):null)}function pb(n,s){if(Pu())return null;Xg(n,s,!0)}function H2(){Z2(function(){(bt&6)!==0?Da(de,U2):fb()})}function Ff(){if(Qs===0){var n=hi;n===0&&(n=dr,dr<<=1,(dr&261888)===0&&(dr=256)),Qs=n}return Qs}function gb(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Ms(""+n)}function bb(n,s){var l=s.ownerDocument.createElement("input");return l.name=s.name,l.value=s.value,n.id&&l.setAttribute("form",n.id),s.parentNode.insertBefore(l,s),n=new FormData(n),l.parentNode.removeChild(l),n}function F2(n,s,l,d,p){if(s==="submit"&&l&&l.stateNode===p){var x=gb((p[An]||null).action),_=d.submitter;_&&(s=(s=_[An]||null)?gb(s.formAction):_.getAttribute("formAction"),s!==null&&(x=s,_=null));var R=new Zo("action","action",null,d,p);n.push({event:R,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(Qs!==0){var G=_?bb(p,_):new FormData(p);lf(l,{pending:!0,data:G,method:p.method,action:x},null,G)}}else typeof x=="function"&&(R.preventDefault(),G=_?bb(p,_):new FormData(p),lf(l,{pending:!0,data:G,method:p.method,action:x},x,G))},currentTarget:p}]})}}for(var zf=0;zf<_d.length;zf++){var $f=_d[zf],z2=$f.toLowerCase(),$2=$f[0].toUpperCase()+$f.slice(1);ja(z2,"on"+$2)}ja(Vp,"onAnimationEnd"),ja(Xp,"onAnimationIteration"),ja(Qp,"onAnimationStart"),ja("dblclick","onDoubleClick"),ja("focusin","onFocus"),ja("focusout","onBlur"),ja(r2,"onTransitionRun"),ja(i2,"onTransitionStart"),ja(l2,"onTransitionCancel"),ja(Wp,"onTransitionEnd"),ye("onMouseEnter",["mouseout","mouseover"]),ye("onMouseLeave",["mouseout","mouseover"]),ye("onPointerEnter",["pointerout","pointerover"]),ye("onPointerLeave",["pointerout","pointerover"]),rs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),rs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),rs("onBeforeInput",["compositionend","keypress","textInput","paste"]),rs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),rs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),rs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fl="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(" "),q2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Fl));function xb(n,s){s=(s&4)!==0;for(var l=0;l<n.length;l++){var d=n[l],p=d.event;d=d.listeners;e:{var x=void 0;if(s)for(var _=d.length-1;0<=_;_--){var R=d[_],G=R.instance,ie=R.currentTarget;if(R=R.listener,G!==x&&p.isPropagationStopped())break e;x=R,p.currentTarget=ie;try{x(p)}catch(fe){tu(fe)}p.currentTarget=null,x=G}else for(_=0;_<d.length;_++){if(R=d[_],G=R.instance,ie=R.currentTarget,R=R.listener,G!==x&&p.isPropagationStopped())break e;x=R,p.currentTarget=ie;try{x(p)}catch(fe){tu(fe)}p.currentTarget=null,x=G}}}}function rt(n,s){var l=s[al];l===void 0&&(l=s[al]=new Set);var d=n+"__bubble";l.has(d)||(Eb(s,n,2,!1),l.add(d))}function qf(n,s,l){var d=0;s&&(d|=4),Eb(l,n,d,s)}var Fu="_reactListening"+Math.random().toString(36).slice(2);function Yf(n){if(!n[Fu]){n[Fu]=!0,qo.forEach(function(l){l!=="selectionchange"&&(q2.has(l)||qf(l,!1,n),qf(l,!0,n))});var s=n.nodeType===9?n:n.ownerDocument;s===null||s[Fu]||(s[Fu]=!0,qf("selectionchange",!1,s))}}function Eb(n,s,l,d){switch(Vb(s)){case 2:var p=xv;break;case 8:p=Ev;break;default:p=im}l=p.bind(null,s,l,n),p=void 0,!cd||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(p=!0),d?p!==void 0?n.addEventListener(s,l,{capture:!0,passive:p}):n.addEventListener(s,l,!0):p!==void 0?n.addEventListener(s,l,{passive:p}):n.addEventListener(s,l,!1)}function Gf(n,s,l,d,p){var x=d;if((s&1)===0&&(s&2)===0&&d!==null)e:for(;;){if(d===null)return;var _=d.tag;if(_===3||_===4){var R=d.stateNode.containerInfo;if(R===p)break;if(_===4)for(_=d.return;_!==null;){var G=_.tag;if((G===3||G===4)&&_.stateNode.containerInfo===p)return;_=_.return}for(;R!==null;){if(_=Pn(R),_===null)return;if(G=_.tag,G===5||G===6||G===26||G===27){d=x=_;continue e}R=R.parentNode}}d=d.return}Vo(function(){var ie=x,fe=We(l),ge=[];e:{var oe=Zp.get(n);if(oe!==void 0){var ue=Zo,Ie=n;switch(n){case"keypress":if(Qo(l)===0)break e;case"keydown":case"keyup":ue=B_;break;case"focusin":Ie="focus",ue=hd;break;case"focusout":Ie="blur",ue=hd;break;case"beforeblur":case"afterblur":ue=hd;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=Cp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=S_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=H_;break;case Vp:case Xp:case Qp:ue=w_;break;case Wp:ue=z_;break;case"scroll":case"scrollend":ue=__;break;case"wheel":ue=q_;break;case"copy":case"cut":case"paste":ue=R_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=kp;break;case"toggle":case"beforetoggle":ue=G_}var $e=(s&4)!==0,At=!$e&&(n==="scroll"||n==="scrollend"),ee=$e?oe!==null?oe+"Capture":null:oe;$e=[];for(var W=ie,re;W!==null;){var he=W;if(re=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||re===null||ee===null||(he=ul(W,ee),he!=null&&$e.push(zl(W,he,re))),At)break;W=W.return}0<$e.length&&(oe=new ue(oe,Ie,null,l,fe),ge.push({event:oe,listeners:$e}))}}if((s&7)===0){e:{if(oe=n==="mouseover"||n==="pointerover",ue=n==="mouseout"||n==="pointerout",oe&&l!==De&&(Ie=l.relatedTarget||l.fromElement)&&(Pn(Ie)||Ie[ks]))break e;if((ue||oe)&&(oe=fe.window===fe?fe:(oe=fe.ownerDocument)?oe.defaultView||oe.parentWindow:window,ue?(Ie=l.relatedTarget||l.toElement,ue=ie,Ie=Ie?Pn(Ie):null,Ie!==null&&(At=u(Ie),$e=Ie.tag,Ie!==At||$e!==5&&$e!==27&&$e!==6)&&(Ie=null)):(ue=null,Ie=ie),ue!==Ie)){if($e=Cp,he="onMouseLeave",ee="onMouseEnter",W="mouse",(n==="pointerout"||n==="pointerover")&&($e=kp,he="onPointerLeave",ee="onPointerEnter",W="pointer"),At=ue==null?oe:Rs(ue),re=Ie==null?oe:Rs(Ie),oe=new $e(he,W+"leave",ue,l,fe),oe.target=At,oe.relatedTarget=re,he=null,Pn(fe)===ie&&($e=new $e(ee,W+"enter",Ie,l,fe),$e.target=re,$e.relatedTarget=At,he=$e),At=he,ue&&Ie)t:{for($e=Y2,ee=ue,W=Ie,re=0,he=ee;he;he=$e(he))re++;he=0;for(var He=W;He;He=$e(He))he++;for(;0<re-he;)ee=$e(ee),re--;for(;0<he-re;)W=$e(W),he--;for(;re--;){if(ee===W||W!==null&&ee===W.alternate){$e=ee;break t}ee=$e(ee),W=$e(W)}$e=null}else $e=null;ue!==null&&yb(ge,oe,ue,$e,!1),Ie!==null&&At!==null&&yb(ge,At,Ie,$e,!0)}}e:{if(oe=ie?Rs(ie):window,ue=oe.nodeName&&oe.nodeName.toLowerCase(),ue==="select"||ue==="input"&&oe.type==="file")var ht=Bp;else if(Lp(oe))if(Pp)ht=n2;else{ht=e2;var Le=J_}else ue=oe.nodeName,!ue||ue.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?ie&&Is(ie.elementType)&&(ht=Bp):ht=t2;if(ht&&(ht=ht(n,ie))){jp(ge,ht,l,fe);break e}Le&&Le(n,oe,ie),n==="focusout"&&ie&&oe.type==="number"&&ie.memoizedProps.value!=null&&ai(oe,"number",oe.value)}switch(Le=ie?Rs(ie):window,n){case"focusin":(Lp(Le)||Le.contentEditable==="true")&&(ii=Le,yd=ie,bl=null);break;case"focusout":bl=yd=ii=null;break;case"mousedown":Nd=!0;break;case"contextmenu":case"mouseup":case"dragend":Nd=!1,Gp(ge,l,fe);break;case"selectionchange":if(s2)break;case"keydown":case"keyup":Gp(ge,l,fe)}var Je;if(gd)e:{switch(n){case"compositionstart":var ut="onCompositionStart";break e;case"compositionend":ut="onCompositionEnd";break e;case"compositionupdate":ut="onCompositionUpdate";break e}ut=void 0}else ri?Mp(n,l)&&(ut="onCompositionEnd"):n==="keydown"&&l.keyCode===229&&(ut="onCompositionStart");ut&&(Rp&&l.locale!=="ko"&&(ri||ut!=="onCompositionStart"?ut==="onCompositionEnd"&&ri&&(Je=Sp()):(Ds=fe,dd="value"in Ds?Ds.value:Ds.textContent,ri=!0)),Le=zu(ie,ut),0<Le.length&&(ut=new wp(ut,n,null,l,fe),ge.push({event:ut,listeners:Le}),Je?ut.data=Je:(Je=Dp(l),Je!==null&&(ut.data=Je)))),(Je=V_?X_(n,l):Q_(n,l))&&(ut=zu(ie,"onBeforeInput"),0<ut.length&&(Le=new wp("onBeforeInput","beforeinput",null,l,fe),ge.push({event:Le,listeners:ut}),Le.data=Je)),F2(ge,n,ie,l,fe)}xb(ge,s)})}function zl(n,s,l){return{instance:n,listener:s,currentTarget:l}}function zu(n,s){for(var l=s+"Capture",d=[];n!==null;){var p=n,x=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||x===null||(p=ul(n,l),p!=null&&d.unshift(zl(n,p,x)),p=ul(n,s),p!=null&&d.push(zl(n,p,x))),n.tag===3)return d;n=n.return}return[]}function Y2(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function yb(n,s,l,d,p){for(var x=s._reactName,_=[];l!==null&&l!==d;){var R=l,G=R.alternate,ie=R.stateNode;if(R=R.tag,G!==null&&G===d)break;R!==5&&R!==26&&R!==27||ie===null||(G=ie,p?(ie=ul(l,x),ie!=null&&_.unshift(zl(l,ie,G))):p||(ie=ul(l,x),ie!=null&&_.push(zl(l,ie,G)))),l=l.return}_.length!==0&&n.push({event:s,listeners:_})}var G2=/\r\n?/g,K2=/\u0000|\uFFFD/g;function Nb(n){return(typeof n=="string"?n:""+n).replace(G2,`
49
- `).replace(K2,"")}function Tb(n,s){return s=Nb(s),Nb(n)===s}function St(n,s,l,d,p,x){switch(l){case"children":typeof d=="string"?s==="body"||s==="textarea"&&d===""||qe(n,d):(typeof d=="number"||typeof d=="bigint")&&s!=="body"&&qe(n,""+d);break;case"className":la(n,"class",d);break;case"tabIndex":la(n,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":la(n,l,d);break;case"style":Nt(n,d,x);break;case"data":if(s!=="object"){la(n,"data",d);break}case"src":case"href":if(d===""&&(s!=="a"||l!=="href")){n.removeAttribute(l);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(l);break}d=Ms(""+d),n.setAttribute(l,d);break;case"action":case"formAction":if(typeof d=="function"){n.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(l==="formAction"?(s!=="input"&&St(n,s,"name",p.name,p,null),St(n,s,"formEncType",p.formEncType,p,null),St(n,s,"formMethod",p.formMethod,p,null),St(n,s,"formTarget",p.formTarget,p,null)):(St(n,s,"encType",p.encType,p,null),St(n,s,"method",p.method,p,null),St(n,s,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(l);break}d=Ms(""+d),n.setAttribute(l,d);break;case"onClick":d!=null&&(n.onclick=Ce);break;case"onScroll":d!=null&&rt("scroll",n);break;case"onScrollEnd":d!=null&&rt("scrollend",n);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(r(61));if(l=d.__html,l!=null){if(p.children!=null)throw Error(r(60));n.innerHTML=l}}break;case"multiple":n.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":n.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){n.removeAttribute("xlink:href");break}l=Ms(""+d),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,""+d):n.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,""):n.removeAttribute(l);break;case"capture":case"download":d===!0?n.setAttribute(l,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,d):n.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?n.setAttribute(l,d):n.removeAttribute(l);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?n.removeAttribute(l):n.setAttribute(l,d);break;case"popover":rt("beforetoggle",n),rt("toggle",n),Cn(n,"popover",d);break;case"xlinkActuate":Kn(n,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":Kn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":Kn(n,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":Kn(n,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":Kn(n,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":Kn(n,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":Kn(n,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":Kn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":Kn(n,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Cn(n,"is",d);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=is.get(l)||l,Cn(n,l,d))}}function Kf(n,s,l,d,p,x){switch(l){case"style":Nt(n,d,x);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(r(61));if(l=d.__html,l!=null){if(p.children!=null)throw Error(r(60));n.innerHTML=l}}break;case"children":typeof d=="string"?qe(n,d):(typeof d=="number"||typeof d=="bigint")&&qe(n,""+d);break;case"onScroll":d!=null&&rt("scroll",n);break;case"onScrollEnd":d!=null&&rt("scrollend",n);break;case"onClick":d!=null&&(n.onclick=Ce);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!hr.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(p=l.endsWith("Capture"),s=l.slice(2,p?l.length-7:void 0),x=n[An]||null,x=x!=null?x[l]:null,typeof x=="function"&&n.removeEventListener(s,x,p),typeof d=="function")){typeof x!="function"&&x!==null&&(l in n?n[l]=null:n.hasAttribute(l)&&n.removeAttribute(l)),n.addEventListener(s,d,p);break e}l in n?n[l]=d:d===!0?n.setAttribute(l,""):Cn(n,l,d)}}}function Nn(n,s,l){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":rt("error",n),rt("load",n);var d=!1,p=!1,x;for(x in l)if(l.hasOwnProperty(x)){var _=l[x];if(_!=null)switch(x){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:St(n,s,x,_,l,null)}}p&&St(n,s,"srcSet",l.srcSet,l,null),d&&St(n,s,"src",l.src,l,null);return;case"input":rt("invalid",n);var R=x=_=p=null,G=null,ie=null;for(d in l)if(l.hasOwnProperty(d)){var fe=l[d];if(fe!=null)switch(d){case"name":p=fe;break;case"type":_=fe;break;case"checked":G=fe;break;case"defaultChecked":ie=fe;break;case"value":x=fe;break;case"defaultValue":R=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,s));break;default:St(n,s,d,fe,l,null)}}pr(n,x,R,G,ie,_,p,!1);return;case"select":rt("invalid",n),d=_=x=null;for(p in l)if(l.hasOwnProperty(p)&&(R=l[p],R!=null))switch(p){case"value":x=R;break;case"defaultValue":_=R;break;case"multiple":d=R;default:St(n,s,p,R,l,null)}s=x,l=_,n.multiple=!!d,s!=null?bn(n,!!d,s,!1):l!=null&&bn(n,!!d,l,!0);return;case"textarea":rt("invalid",n),x=p=d=null;for(_ in l)if(l.hasOwnProperty(_)&&(R=l[_],R!=null))switch(_){case"value":d=R;break;case"defaultValue":p=R;break;case"children":x=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(r(91));break;default:St(n,s,_,R,l,null)}si(n,d,p,x);return;case"option":for(G in l)if(l.hasOwnProperty(G)&&(d=l[G],d!=null))switch(G){case"selected":n.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:St(n,s,G,d,l,null)}return;case"dialog":rt("beforetoggle",n),rt("toggle",n),rt("cancel",n),rt("close",n);break;case"iframe":case"object":rt("load",n);break;case"video":case"audio":for(d=0;d<Fl.length;d++)rt(Fl[d],n);break;case"image":rt("error",n),rt("load",n);break;case"details":rt("toggle",n);break;case"embed":case"source":case"link":rt("error",n),rt("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(ie in l)if(l.hasOwnProperty(ie)&&(d=l[ie],d!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:St(n,s,ie,d,l,null)}return;default:if(Is(s)){for(fe in l)l.hasOwnProperty(fe)&&(d=l[fe],d!==void 0&&Kf(n,s,fe,d,l,void 0));return}}for(R in l)l.hasOwnProperty(R)&&(d=l[R],d!=null&&St(n,s,R,d,l,null))}function V2(n,s,l,d){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,x=null,_=null,R=null,G=null,ie=null,fe=null;for(ue in l){var ge=l[ue];if(l.hasOwnProperty(ue)&&ge!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":G=ge;default:d.hasOwnProperty(ue)||St(n,s,ue,null,d,ge)}}for(var oe in d){var ue=d[oe];if(ge=l[oe],d.hasOwnProperty(oe)&&(ue!=null||ge!=null))switch(oe){case"type":x=ue;break;case"name":p=ue;break;case"checked":ie=ue;break;case"defaultChecked":fe=ue;break;case"value":_=ue;break;case"defaultValue":R=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,s));break;default:ue!==ge&&St(n,s,oe,ue,d,ge)}}il(n,_,R,G,ie,fe,x,p);return;case"select":ue=_=R=oe=null;for(x in l)if(G=l[x],l.hasOwnProperty(x)&&G!=null)switch(x){case"value":break;case"multiple":ue=G;default:d.hasOwnProperty(x)||St(n,s,x,null,d,G)}for(p in d)if(x=d[p],G=l[p],d.hasOwnProperty(p)&&(x!=null||G!=null))switch(p){case"value":oe=x;break;case"defaultValue":R=x;break;case"multiple":_=x;default:x!==G&&St(n,s,p,x,d,G)}s=R,l=_,d=ue,oe!=null?bn(n,!!l,oe,!1):!!d!=!!l&&(s!=null?bn(n,!!l,s,!0):bn(n,!!l,l?[]:"",!1));return;case"textarea":ue=oe=null;for(R in l)if(p=l[R],l.hasOwnProperty(R)&&p!=null&&!d.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:St(n,s,R,null,d,p)}for(_ in d)if(p=d[_],x=l[_],d.hasOwnProperty(_)&&(p!=null||x!=null))switch(_){case"value":oe=p;break;case"defaultValue":ue=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(r(91));break;default:p!==x&&St(n,s,_,p,d,x)}Go(n,oe,ue);return;case"option":for(var Ie in l)if(oe=l[Ie],l.hasOwnProperty(Ie)&&oe!=null&&!d.hasOwnProperty(Ie))switch(Ie){case"selected":n.selected=!1;break;default:St(n,s,Ie,null,d,oe)}for(G in d)if(oe=d[G],ue=l[G],d.hasOwnProperty(G)&&oe!==ue&&(oe!=null||ue!=null))switch(G){case"selected":n.selected=oe&&typeof oe!="function"&&typeof oe!="symbol";break;default:St(n,s,G,oe,d,ue)}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 l)oe=l[$e],l.hasOwnProperty($e)&&oe!=null&&!d.hasOwnProperty($e)&&St(n,s,$e,null,d,oe);for(ie in d)if(oe=d[ie],ue=l[ie],d.hasOwnProperty(ie)&&oe!==ue&&(oe!=null||ue!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,s));break;default:St(n,s,ie,oe,d,ue)}return;default:if(Is(s)){for(var At in l)oe=l[At],l.hasOwnProperty(At)&&oe!==void 0&&!d.hasOwnProperty(At)&&Kf(n,s,At,void 0,d,oe);for(fe in d)oe=d[fe],ue=l[fe],!d.hasOwnProperty(fe)||oe===ue||oe===void 0&&ue===void 0||Kf(n,s,fe,oe,d,ue);return}}for(var ee in l)oe=l[ee],l.hasOwnProperty(ee)&&oe!=null&&!d.hasOwnProperty(ee)&&St(n,s,ee,null,d,oe);for(ge in d)oe=d[ge],ue=l[ge],!d.hasOwnProperty(ge)||oe===ue||oe==null&&ue==null||St(n,s,ge,oe,d,ue)}function _b(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function X2(){if(typeof performance.getEntriesByType=="function"){for(var n=0,s=0,l=performance.getEntriesByType("resource"),d=0;d<l.length;d++){var p=l[d],x=p.transferSize,_=p.initiatorType,R=p.duration;if(x&&R&&_b(_)){for(_=0,R=p.responseEnd,d+=1;d<l.length;d++){var G=l[d],ie=G.startTime;if(ie>R)break;var fe=G.transferSize,ge=G.initiatorType;fe&&_b(ge)&&(G=G.responseEnd,_+=fe*(G<R?1:(R-ie)/(G-ie)))}if(--d,s+=8*(x+_)/(p.duration/1e3),n++,10<n)break}}if(0<n)return s/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var Vf=null,Xf=null;function $u(n){return n.nodeType===9?n:n.ownerDocument}function vb(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 Sb(n,s){if(n===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&s==="foreignObject"?0:n}function Qf(n,s){return n==="textarea"||n==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Wf=null;function Q2(){var n=window.event;return n&&n.type==="popstate"?n===Wf?!1:(Wf=n,!0):(Wf=null,!1)}var Ab=typeof setTimeout=="function"?setTimeout:void 0,W2=typeof clearTimeout=="function"?clearTimeout:void 0,Cb=typeof Promise=="function"?Promise:void 0,Z2=typeof queueMicrotask=="function"?queueMicrotask:typeof Cb<"u"?function(n){return Cb.resolve(null).then(n).catch(J2)}:Ab;function J2(n){setTimeout(function(){throw n})}function Ws(n){return n==="head"}function wb(n,s){var l=s,d=0;do{var p=l.nextSibling;if(n.removeChild(l),p&&p.nodeType===8)if(l=p.data,l==="/$"||l==="/&"){if(d===0){n.removeChild(p),Mi(s);return}d--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")d++;else if(l==="html")$l(n.ownerDocument.documentElement);else if(l==="head"){l=n.ownerDocument.head,$l(l);for(var x=l.firstChild;x;){var _=x.nextSibling,R=x.nodeName;x[mr]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&x.rel.toLowerCase()==="stylesheet"||l.removeChild(x),x=_}}else l==="body"&&$l(n.ownerDocument.body);l=p}while(l);Mi(s)}function kb(n,s){var l=n;n=0;do{var d=l.nextSibling;if(l.nodeType===1?s?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(s?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),d&&d.nodeType===8)if(l=d.data,l==="/$"){if(n===0)break;n--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||n++;l=d}while(l)}function Zf(n){var s=n.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var l=s;switch(s=s.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Zf(l),sl(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}n.removeChild(l)}}function ev(n,s,l,d){for(;n.nodeType===1;){var p=l;if(n.nodeName.toLowerCase()!==s.toLowerCase()){if(!d&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(d){if(!n[mr])switch(s){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(s==="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=Ca(n.nextSibling),n===null)break}return null}function tv(n,s,l){if(s==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!l||(n=Ca(n.nextSibling),n===null))return null;return n}function Rb(n,s){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!s||(n=Ca(n.nextSibling),n===null))return null;return n}function Jf(n){return n.data==="$?"||n.data==="$~"}function em(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function nv(n,s){var l=n.ownerDocument;if(n.data==="$~")n._reactRetry=s;else if(n.data!=="$?"||l.readyState!=="loading")s();else{var d=function(){s(),l.removeEventListener("DOMContentLoaded",d)};l.addEventListener("DOMContentLoaded",d),n._reactRetry=d}}function Ca(n){for(;n!=null;n=n.nextSibling){var s=n.nodeType;if(s===1||s===3)break;if(s===8){if(s=n.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return n}var tm=null;function Ob(n){n=n.nextSibling;for(var s=0;n;){if(n.nodeType===8){var l=n.data;if(l==="/$"||l==="/&"){if(s===0)return Ca(n.nextSibling);s--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||s++}n=n.nextSibling}return null}function Ib(n){n=n.previousSibling;for(var s=0;n;){if(n.nodeType===8){var l=n.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(s===0)return n;s--}else l!=="/$"&&l!=="/&"||s++}n=n.previousSibling}return null}function Mb(n,s,l){switch(s=$u(l),n){case"html":if(n=s.documentElement,!n)throw Error(r(452));return n;case"head":if(n=s.head,!n)throw Error(r(453));return n;case"body":if(n=s.body,!n)throw Error(r(454));return n;default:throw Error(r(451))}}function $l(n){for(var s=n.attributes;s.length;)n.removeAttributeNode(s[0]);sl(n)}var wa=new Map,Db=new Set;function qu(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Ts=k.d;k.d={f:av,r:sv,D:rv,C:iv,L:lv,m:ov,X:cv,S:uv,M:dv};function av(){var n=Ts.f(),s=Lu();return n||s}function sv(n){var s=ss(n);s!==null&&s.tag===5&&s.type==="form"?W0(s):Ts.r(n)}var Ri=typeof document>"u"?null:document;function Lb(n,s,l){var d=Ri;if(d&&typeof s=="string"&&s){var p=Vn(s);p='link[rel="'+n+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),Db.has(p)||(Db.add(p),n={rel:n,crossOrigin:l,href:s},d.querySelector(p)===null&&(s=d.createElement("link"),Nn(s,"link",n),Zt(s),d.head.appendChild(s)))}}function rv(n){Ts.D(n),Lb("dns-prefetch",n,null)}function iv(n,s){Ts.C(n,s),Lb("preconnect",n,s)}function lv(n,s,l){Ts.L(n,s,l);var d=Ri;if(d&&n&&s){var p='link[rel="preload"][as="'+Vn(s)+'"]';s==="image"&&l&&l.imageSrcSet?(p+='[imagesrcset="'+Vn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(p+='[imagesizes="'+Vn(l.imageSizes)+'"]')):p+='[href="'+Vn(n)+'"]';var x=p;switch(s){case"style":x=Oi(n);break;case"script":x=Ii(n)}wa.has(x)||(n=g({rel:"preload",href:s==="image"&&l&&l.imageSrcSet?void 0:n,as:s},l),wa.set(x,n),d.querySelector(p)!==null||s==="style"&&d.querySelector(ql(x))||s==="script"&&d.querySelector(Yl(x))||(s=d.createElement("link"),Nn(s,"link",n),Zt(s),d.head.appendChild(s)))}}function ov(n,s){Ts.m(n,s);var l=Ri;if(l&&n){var d=s&&typeof s.as=="string"?s.as:"script",p='link[rel="modulepreload"][as="'+Vn(d)+'"][href="'+Vn(n)+'"]',x=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Ii(n)}if(!wa.has(x)&&(n=g({rel:"modulepreload",href:n},s),wa.set(x,n),l.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Yl(x)))return}d=l.createElement("link"),Nn(d,"link",n),Zt(d),l.head.appendChild(d)}}}function uv(n,s,l){Ts.S(n,s,l);var d=Ri;if(d&&n){var p=Os(d).hoistableStyles,x=Oi(n);s=s||"default";var _=p.get(x);if(!_){var R={loading:0,preload:null};if(_=d.querySelector(ql(x)))R.loading=5;else{n=g({rel:"stylesheet",href:n,"data-precedence":s},l),(l=wa.get(x))&&nm(n,l);var G=_=d.createElement("link");Zt(G),Nn(G,"link",n),G._p=new Promise(function(ie,fe){G.onload=ie,G.onerror=fe}),G.addEventListener("load",function(){R.loading|=1}),G.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Yu(_,s,d)}_={type:"stylesheet",instance:_,count:1,state:R},p.set(x,_)}}}function cv(n,s){Ts.X(n,s);var l=Ri;if(l&&n){var d=Os(l).hoistableScripts,p=Ii(n),x=d.get(p);x||(x=l.querySelector(Yl(p)),x||(n=g({src:n,async:!0},s),(s=wa.get(p))&&am(n,s),x=l.createElement("script"),Zt(x),Nn(x,"link",n),l.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},d.set(p,x))}}function dv(n,s){Ts.M(n,s);var l=Ri;if(l&&n){var d=Os(l).hoistableScripts,p=Ii(n),x=d.get(p);x||(x=l.querySelector(Yl(p)),x||(n=g({src:n,async:!0,type:"module"},s),(s=wa.get(p))&&am(n,s),x=l.createElement("script"),Zt(x),Nn(x,"link",n),l.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},d.set(p,x))}}function jb(n,s,l,d){var p=(p=V.current)?qu(p):null;if(!p)throw Error(r(446));switch(n){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(s=Oi(l.href),l=Os(p).hoistableStyles,d=l.get(s),d||(d={type:"style",instance:null,count:0,state:null},l.set(s,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){n=Oi(l.href);var x=Os(p).hoistableStyles,_=x.get(n);if(_||(p=p.ownerDocument||p,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(n,_),(x=p.querySelector(ql(n)))&&!x._p&&(_.instance=x,_.state.loading=5),wa.has(n)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},wa.set(n,l),x||fv(p,n,l,_.state))),s&&d===null)throw Error(r(528,""));return _}if(s&&d!==null)throw Error(r(529,""));return null;case"script":return s=l.async,l=l.src,typeof l=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Ii(l),l=Os(p).hoistableScripts,d=l.get(s),d||(d={type:"script",instance:null,count:0,state:null},l.set(s,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,n))}}function Oi(n){return'href="'+Vn(n)+'"'}function ql(n){return'link[rel="stylesheet"]['+n+"]"}function Bb(n){return g({},n,{"data-precedence":n.precedence,precedence:null})}function fv(n,s,l,d){n.querySelector('link[rel="preload"][as="style"]['+s+"]")?d.loading=1:(s=n.createElement("link"),d.preload=s,s.addEventListener("load",function(){return d.loading|=1}),s.addEventListener("error",function(){return d.loading|=2}),Nn(s,"link",l),Zt(s),n.head.appendChild(s))}function Ii(n){return'[src="'+Vn(n)+'"]'}function Yl(n){return"script[async]"+n}function Pb(n,s,l){if(s.count++,s.instance===null)switch(s.type){case"style":var d=n.querySelector('style[data-href~="'+Vn(l.href)+'"]');if(d)return s.instance=d,Zt(d),d;var p=g({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return d=(n.ownerDocument||n).createElement("style"),Zt(d),Nn(d,"style",p),Yu(d,l.precedence,n),s.instance=d;case"stylesheet":p=Oi(l.href);var x=n.querySelector(ql(p));if(x)return s.state.loading|=4,s.instance=x,Zt(x),x;d=Bb(l),(p=wa.get(p))&&nm(d,p),x=(n.ownerDocument||n).createElement("link"),Zt(x);var _=x;return _._p=new Promise(function(R,G){_.onload=R,_.onerror=G}),Nn(x,"link",d),s.state.loading|=4,Yu(x,l.precedence,n),s.instance=x;case"script":return x=Ii(l.src),(p=n.querySelector(Yl(x)))?(s.instance=p,Zt(p),p):(d=l,(p=wa.get(x))&&(d=g({},l),am(d,p)),n=n.ownerDocument||n,p=n.createElement("script"),Zt(p),Nn(p,"link",d),n.head.appendChild(p),s.instance=p);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(d=s.instance,s.state.loading|=4,Yu(d,l.precedence,n));return s.instance}function Yu(n,s,l){for(var d=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,x=p,_=0;_<d.length;_++){var R=d[_];if(R.dataset.precedence===s)x=R;else if(x!==p)break}x?x.parentNode.insertBefore(n,x.nextSibling):(s=l.nodeType===9?l.head:l,s.insertBefore(n,s.firstChild))}function nm(n,s){n.crossOrigin==null&&(n.crossOrigin=s.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=s.referrerPolicy),n.title==null&&(n.title=s.title)}function am(n,s){n.crossOrigin==null&&(n.crossOrigin=s.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=s.referrerPolicy),n.integrity==null&&(n.integrity=s.integrity)}var Gu=null;function Ub(n,s,l){if(Gu===null){var d=new Map,p=Gu=new Map;p.set(l,d)}else p=Gu,d=p.get(l),d||(d=new Map,p.set(l,d));if(d.has(n))return d;for(d.set(n,null),l=l.getElementsByTagName(n),p=0;p<l.length;p++){var x=l[p];if(!(x[mr]||x[Gt]||n==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var _=x.getAttribute(s)||"";_=n+_;var R=d.get(_);R?R.push(x):d.set(_,[x])}}return d}function Hb(n,s,l){n=n.ownerDocument||n,n.head.insertBefore(l,s==="title"?n.querySelector("head > title"):null)}function mv(n,s,l){if(l===1||s.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return n=s.disabled,typeof s.precedence=="string"&&n==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function Fb(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function hv(n,s,l,d){if(l.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var p=Oi(d.href),x=s.querySelector(ql(p));if(x){s=x._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(n.count++,n=Ku.bind(n),s.then(n,n)),l.state.loading|=4,l.instance=x,Zt(x);return}x=s.ownerDocument||s,d=Bb(d),(p=wa.get(p))&&nm(d,p),x=x.createElement("link"),Zt(x);var _=x;_._p=new Promise(function(R,G){_.onload=R,_.onerror=G}),Nn(x,"link",d),l.instance=x}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(l,s),(s=l.state.preload)&&(l.state.loading&3)===0&&(n.count++,l=Ku.bind(n),s.addEventListener("load",l),s.addEventListener("error",l))}}var sm=0;function pv(n,s){return n.stylesheets&&n.count===0&&Xu(n,n.stylesheets),0<n.count||0<n.imgCount?function(l){var d=setTimeout(function(){if(n.stylesheets&&Xu(n,n.stylesheets),n.unsuspend){var x=n.unsuspend;n.unsuspend=null,x()}},6e4+s);0<n.imgBytes&&sm===0&&(sm=62500*X2());var p=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Xu(n,n.stylesheets),n.unsuspend)){var x=n.unsuspend;n.unsuspend=null,x()}},(n.imgBytes>sm?50:800)+s);return n.unsuspend=l,function(){n.unsuspend=null,clearTimeout(d),clearTimeout(p)}}:null}function Ku(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xu(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Vu=null;function Xu(n,s){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Vu=new Map,s.forEach(gv,n),Vu=null,Ku.call(n))}function gv(n,s){if(!(s.state.loading&4)){var l=Vu.get(n);if(l)var d=l.get(null);else{l=new Map,Vu.set(n,l);for(var p=n.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<p.length;x++){var _=p[x];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(l.set(_.dataset.precedence,_),d=_)}d&&l.set(null,d)}p=s.instance,_=p.getAttribute("data-precedence"),x=l.get(_)||d,x===d&&l.set(null,p),l.set(_,p),this.count++,d=Ku.bind(this),p.addEventListener("load",d),p.addEventListener("error",d),x?x.parentNode.insertBefore(p,x.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(p,n.firstChild)),s.state.loading|=4}}var Gl={$$typeof:O,Provider:null,Consumer:null,_currentValue:P,_currentValue2:P,_threadCount:0};function bv(n,s,l,d,p,x,_,R,G){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=Dt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dt(0),this.hiddenUpdates=Dt(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=x,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.incompleteTransitions=new Map}function zb(n,s,l,d,p,x,_,R,G,ie,fe,ge){return n=new bv(n,s,l,_,G,ie,fe,ge,R),s=1,x===!0&&(s|=24),x=ca(3,null,null,s),n.current=x,x.stateNode=n,s=jd(),s.refCount++,n.pooledCache=s,s.refCount++,x.memoizedState={element:d,isDehydrated:l,cache:s},Hd(x),n}function $b(n){return n?(n=ui,n):ui}function qb(n,s,l,d,p,x){p=$b(p),d.context===null?d.context=p:d.pendingContext=p,d=Hs(s),d.payload={element:l},x=x===void 0?null:x,x!==null&&(d.callback=x),l=Fs(n,d,s),l!==null&&(ea(l,n,s),vl(l,n,s))}function Yb(n,s){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var l=n.retryLane;n.retryLane=l!==0&&l<s?l:s}}function rm(n,s){Yb(n,s),(n=n.alternate)&&Yb(n,s)}function Gb(n){if(n.tag===13||n.tag===31){var s=Er(n,67108864);s!==null&&ea(s,n,67108864),rm(n,67108864)}}function Kb(n){if(n.tag===13||n.tag===31){var s=pa();s=Bt(s);var l=Er(n,s);l!==null&&ea(l,n,s),rm(n,s)}}var Qu=!0;function xv(n,s,l,d){var p=F.T;F.T=null;var x=k.p;try{k.p=2,im(n,s,l,d)}finally{k.p=x,F.T=p}}function Ev(n,s,l,d){var p=F.T;F.T=null;var x=k.p;try{k.p=8,im(n,s,l,d)}finally{k.p=x,F.T=p}}function im(n,s,l,d){if(Qu){var p=lm(d);if(p===null)Gf(n,s,d,Wu,l),Xb(n,d);else if(Nv(p,n,s,l,d))d.stopPropagation();else if(Xb(n,d),s&4&&-1<yv.indexOf(n)){for(;p!==null;){var x=ss(p);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var _=Gn(x.pendingLanes);if(_!==0){var R=x;for(R.pendingLanes|=2,R.entangledLanes|=2;_;){var G=1<<31-Et(_);R.entanglements[1]|=G,_&=~G}Va(x),(bt&6)===0&&(Mu=It()+500,Hl(0))}}break;case 31:case 13:R=Er(x,2),R!==null&&ea(R,x,2),Lu(),rm(x,2)}if(x=lm(d),x===null&&Gf(n,s,d,Wu,l),x===p)break;p=x}p!==null&&d.stopPropagation()}else Gf(n,s,d,null,l)}}function lm(n){return n=We(n),om(n)}var Wu=null;function om(n){if(Wu=null,n=Pn(n),n!==null){var s=u(n);if(s===null)n=null;else{var l=s.tag;if(l===13){if(n=c(s),n!==null)return n;n=null}else if(l===31){if(n=f(s),n!==null)return n;n=null}else if(l===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;n=null}else s!==n&&(n=null)}}return Wu=n,null}function Vb(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(Qr()){case de:return 2;case Ae:return 8;case ze:case tt:return 32;case mt:return 268435456;default:return 32}default:return 32}}var um=!1,Zs=null,Js=null,er=null,Kl=new Map,Vl=new Map,tr=[],yv="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 Xb(n,s){switch(n){case"focusin":case"focusout":Zs=null;break;case"dragenter":case"dragleave":Js=null;break;case"mouseover":case"mouseout":er=null;break;case"pointerover":case"pointerout":Kl.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vl.delete(s.pointerId)}}function Xl(n,s,l,d,p,x){return n===null||n.nativeEvent!==x?(n={blockedOn:s,domEventName:l,eventSystemFlags:d,nativeEvent:x,targetContainers:[p]},s!==null&&(s=ss(s),s!==null&&Gb(s)),n):(n.eventSystemFlags|=d,s=n.targetContainers,p!==null&&s.indexOf(p)===-1&&s.push(p),n)}function Nv(n,s,l,d,p){switch(s){case"focusin":return Zs=Xl(Zs,n,s,l,d,p),!0;case"dragenter":return Js=Xl(Js,n,s,l,d,p),!0;case"mouseover":return er=Xl(er,n,s,l,d,p),!0;case"pointerover":var x=p.pointerId;return Kl.set(x,Xl(Kl.get(x)||null,n,s,l,d,p)),!0;case"gotpointercapture":return x=p.pointerId,Vl.set(x,Xl(Vl.get(x)||null,n,s,l,d,p)),!0}return!1}function Qb(n){var s=Pn(n.target);if(s!==null){var l=u(s);if(l!==null){if(s=l.tag,s===13){if(s=c(l),s!==null){n.blockedOn=s,Jr(n.priority,function(){Kb(l)});return}}else if(s===31){if(s=f(l),s!==null){n.blockedOn=s,Jr(n.priority,function(){Kb(l)});return}}else if(s===3&&l.stateNode.current.memoizedState.isDehydrated){n.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Zu(n){if(n.blockedOn!==null)return!1;for(var s=n.targetContainers;0<s.length;){var l=lm(n.nativeEvent);if(l===null){l=n.nativeEvent;var d=new l.constructor(l.type,l);De=d,l.target.dispatchEvent(d),De=null}else return s=ss(l),s!==null&&Gb(s),n.blockedOn=l,!1;s.shift()}return!0}function Wb(n,s,l){Zu(n)&&l.delete(s)}function Tv(){um=!1,Zs!==null&&Zu(Zs)&&(Zs=null),Js!==null&&Zu(Js)&&(Js=null),er!==null&&Zu(er)&&(er=null),Kl.forEach(Wb),Vl.forEach(Wb)}function Ju(n,s){n.blockedOn===s&&(n.blockedOn=null,um||(um=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Tv)))}var ec=null;function Zb(n){ec!==n&&(ec=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ec===n&&(ec=null);for(var s=0;s<n.length;s+=3){var l=n[s],d=n[s+1],p=n[s+2];if(typeof d!="function"){if(om(d||l)===null)continue;break}var x=ss(l);x!==null&&(n.splice(s,3),s-=3,lf(x,{pending:!0,data:p,method:l.method,action:d},d,p))}}))}function Mi(n){function s(G){return Ju(G,n)}Zs!==null&&Ju(Zs,n),Js!==null&&Ju(Js,n),er!==null&&Ju(er,n),Kl.forEach(s),Vl.forEach(s);for(var l=0;l<tr.length;l++){var d=tr[l];d.blockedOn===n&&(d.blockedOn=null)}for(;0<tr.length&&(l=tr[0],l.blockedOn===null);)Qb(l),l.blockedOn===null&&tr.shift();if(l=(n.ownerDocument||n).$$reactFormReplay,l!=null)for(d=0;d<l.length;d+=3){var p=l[d],x=l[d+1],_=p[An]||null;if(typeof x=="function")_||Zb(l);else if(_){var R=null;if(x&&x.hasAttribute("formAction")){if(p=x,_=x[An]||null)R=_.formAction;else if(om(p)!==null)continue}else R=_.action;typeof R=="function"?l[d+1]=R:(l.splice(d,3),d-=3),Zb(l)}}}function Jb(){function n(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(_){return p=_})},focusReset:"manual",scroll:"manual"})}function s(){p!==null&&(p(),p=null),d||setTimeout(l,20)}function l(){if(!d&&!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 d=!1,p=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(l,100),function(){d=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),p!==null&&(p(),p=null)}}}function cm(n){this._internalRoot=n}tc.prototype.render=cm.prototype.render=function(n){var s=this._internalRoot;if(s===null)throw Error(r(409));var l=s.current,d=pa();qb(l,d,n,s,null,null)},tc.prototype.unmount=cm.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var s=n.containerInfo;qb(n.current,2,null,n,null,null),Lu(),s[ks]=null}};function tc(n){this._internalRoot=n}tc.prototype.unstable_scheduleHydration=function(n){if(n){var s=Zr();n={blockedOn:null,target:n,priority:s};for(var l=0;l<tr.length&&s!==0&&s<tr[l].priority;l++);tr.splice(l,0,n),l===0&&Qb(n)}};var ex=t.version;if(ex!=="19.2.8")throw Error(r(527,ex,"19.2.8"));k.findDOMNode=function(n){var s=n._reactInternals;if(s===void 0)throw typeof n.render=="function"?Error(r(188)):(n=Object.keys(n).join(","),Error(r(268,n)));return n=h(s),n=n!==null?b(n):null,n=n===null?null:n.stateNode,n};var _v={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var nc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nc.isDisabled&&nc.supportsFiber)try{gn=nc.inject(_v),zt=nc}catch{}}return Wl.createRoot=function(n,s){if(!o(n))throw Error(r(299));var l=!1,d="",p=lg,x=og,_=ug;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(d=s.identifierPrefix),s.onUncaughtError!==void 0&&(p=s.onUncaughtError),s.onCaughtError!==void 0&&(x=s.onCaughtError),s.onRecoverableError!==void 0&&(_=s.onRecoverableError)),s=zb(n,1,!1,null,null,l,d,null,p,x,_,Jb),n[ks]=s.current,Yf(n),new cm(s)},Wl.hydrateRoot=function(n,s,l){if(!o(n))throw Error(r(299));var d=!1,p="",x=lg,_=og,R=ug,G=null;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(x=l.onUncaughtError),l.onCaughtError!==void 0&&(_=l.onCaughtError),l.onRecoverableError!==void 0&&(R=l.onRecoverableError),l.formState!==void 0&&(G=l.formState)),s=zb(n,1,!0,s,l??null,d,p,G,x,_,R,Jb),s.context=$b(null),l=s.current,d=pa(),d=Bt(d),p=Hs(d),p.callback=null,Fs(l,p,d),l=d,s.current.lanes=l,wt(s,l),Va(s),n[ks]=s.current,Yf(n),new tc(s)},Wl.version="19.2.8",Wl}var cx;function Lv(){if(cx)return mm.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(),mm.exports=Dv(),mm.exports}var jv=Lv();/**
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 Oh=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,VE=/^[\\/]{2}/;function Bv(e,t){return t+e.replace(/\\/g,"/")}var dx="popstate";function fx(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Pv(e={}){function t(r,o){var h;let u=(h=o.state)==null?void 0:h.masked,{pathname:c,search:f,hash:m}=u||r.location;return Jm("",{pathname:c,search:f,hash:m},o.state&&o.state.usr||null,o.state&&o.state.key||"default",u?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function a(r,o){return typeof o=="string"?o:bo(o)}return Hv(t,a,null,e)}function Ht(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Oa(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Uv(){return Math.random().toString(36).substring(2,10)}function mx(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 Jm(e,t,a=null,r,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Xi(t):t,state:a,key:t&&t.key||r||Uv(),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 Xi(e){let t={};if(e){let a=e.indexOf("#");a>=0&&(t.hash=e.substring(a),e=e.substring(0,a));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Hv(e,t,a,r={}){let{window:o=document.defaultView,v5Compat:u=!1}=r,c=o.history,f="POP",m=null,h=b();h==null&&(h=0,c.replaceState({...c.state,idx:h},""));function b(){return(c.state||{idx:null}).idx}function g(){f="POP";let C=b(),S=C==null?null:C-h;h=C,m&&m({action:f,location:A.location,delta:S})}function y(C,S){f="PUSH";let M=fx(C)?C:Jm(A.location,C,S);h=b()+1;let O=mx(M,h),j=A.createHref(M.mask||M);try{c.pushState(O,"",j)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;o.location.assign(j)}u&&m&&m({action:f,location:A.location,delta:1})}function N(C,S){f="REPLACE";let M=fx(C)?C:Jm(A.location,C,S);h=b();let O=mx(M,h),j=A.createHref(M.mask||M);c.replaceState(O,"",j),u&&m&&m({action:f,location:A.location,delta:0})}function v(C){return Fv(o,C)}let A={get action(){return f},get location(){return e(o,c)},listen(C){if(m)throw new Error("A history only accepts one active listener");return o.addEventListener(dx,g),m=C,()=>{o.removeEventListener(dx,g),m=null}},createHref(C){return t(o,C)},createURL:v,encodeLocation(C){let S=v(C);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:y,replace:N,go(C){return c.go(C)}};return A}function Fv(e,t,a=!1){let r="http://localhost";e&&(r=e.location.origin!=="null"?e.location.origin:e.location.href),Ht(r,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:bo(t);return o=o.replace(/ $/,"%20"),!a&&VE.test(o)&&(o=r+o),new URL(o,r)}function XE(e,t,a="/"){return zv(e,t,a,!1)}function zv(e,t,a,r,o){let u=typeof t=="string"?Xi(t):t,c=As(u.pathname||"/",a);if(c==null)return null;let f=$v(e),m=null,h=eS(c);for(let b=0;m==null&&b<f.length;++b)m=Jv(f[b],h,r);return m}function $v(e){let t=QE(e);return qv(t),t}function QE(e,t=[],a=[],r="",o=!1){let u=(c,f,m=o,h)=>{let b={relativePath:h===void 0?c.path||"":h,caseSensitive:c.caseSensitive===!0,childrenIndex:f,route:c};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(r)&&m)return;Ht(b.relativePath.startsWith(r),`Absolute route path "${b.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(r.length)}let g=Ua([r,b.relativePath]),y=a.concat(b);c.children&&c.children.length>0&&(Ht(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),QE(c.children,t,y,g,m)),!(c.path==null&&!c.index)&&t.push({path:g,score:Wv(g,c.index),routesMeta:y.map((N,v)=>{let[A,C]=JE(N.relativePath,N.caseSensitive,v===y.length-1);return{...N,matcher:A,compiledParams:C}})})};return e.forEach((c,f)=>{var m;if(c.path===""||!((m=c.path)!=null&&m.includes("?")))u(c,f);else for(let h of WE(c.path))u(c,f,!0,h)}),t}function WE(e){let t=e.split("/");if(t.length===0)return[];let[a,...r]=t,o=a.endsWith("?"),u=a.replace(/\?$/,"");if(r.length===0)return o?[u,""]:[u];let c=WE(r.join("/")),f=[];return f.push(...c.map(m=>m===""?u:[u,m].join("/"))),o&&f.push(...c),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function qv(e){e.sort((t,a)=>t.score!==a.score?a.score-t.score:Zv(t.routesMeta.map(r=>r.childrenIndex),a.routesMeta.map(r=>r.childrenIndex)))}var Yv=/^:[\w-]+$/,Gv=3,Kv=2,Vv=1,Xv=10,Qv=-2,hx=e=>e==="*";function Wv(e,t){let a=e.split("/"),r=a.length;return a.some(hx)&&(r+=Qv),t&&(r+=Kv),a.filter(o=>!hx(o)).reduce((o,u)=>o+(Yv.test(u)?Gv:u===""?Vv:Xv),r)}function Zv(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function Jv(e,t,a=!1){let{routesMeta:r}=e,o={},u="/",c=[];for(let f=0;f<r.length;++f){let m=r[f],h=f===r.length-1,b=u==="/"?t:t.slice(u.length)||"/",g={path:m.relativePath,caseSensitive:m.caseSensitive,end:h},y=m.matcher&&m.compiledParams?ZE(g,b,m.matcher,m.compiledParams):Tc(g,b),N=m.route;if(!y&&h&&a&&!r[r.length-1].route.index&&(y=Tc({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},b)),!y)return null;Object.assign(o,y.params),c.push({params:o,pathname:Ua([u,y.pathname]),pathnameBase:aS(Ua([u,y.pathnameBase])),route:N}),y.pathnameBase!=="/"&&(u=Ua([u,y.pathnameBase]))}return c}function Tc(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[a,r]=JE(e.path,e.caseSensitive,e.end);return ZE(e,t,a,r)}function ZE(e,t,a,r){let o=t.match(a);if(!o)return null;let u=o[0],c=u.replace(/(.)\/+$/,"$1"),f=o.slice(1);return{params:r.reduce((h,{paramName:b,isOptional:g},y)=>{if(b==="*"){let v=f[y]||"";c=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:c,pattern:e}}function JE(e,t=!1,a=!0){Oa(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 r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,f,m,h,b)=>{if(r.push({paramName:f,isOptional:m!=null}),m){let g=b.charAt(h+c.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function eS(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Oa(!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 As(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,r=e.charAt(a);return r&&r!=="/"?null:e.slice(a)||"/"}function tS(e,t="/"){let{pathname:a,search:r="",hash:o=""}=typeof e=="string"?Xi(e):e,u;return a?(a=ey(a),a.startsWith("/")?u=px(a.substring(1),"/"):u=px(a,t)):u=t,{pathname:u,search:sS(r),hash:rS(o)}}function px(e,t){let a=_c(t).split("/");return e.split("/").forEach(o=>{o===".."?a.length>1&&a.pop():o!=="."&&a.push(o)}),a.length>1?a.join("/"):"/"}function bm(e,t,a,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. 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 nS(e){return e.filter((t,a)=>a===0||t.route.path&&t.route.path.length>0)}function Ih(e){let t=nS(e);return t.map((a,r)=>r===t.length-1?a.pathname:a.pathnameBase)}function $c(e,t,a,r=!1){let o;typeof e=="string"?o=Xi(e):(o={...e},Ht(!o.pathname||!o.pathname.includes("?"),bm("?","pathname","search",o)),Ht(!o.pathname||!o.pathname.includes("#"),bm("#","pathname","hash",o)),Ht(!o.search||!o.search.includes("#"),bm("#","search","hash",o)));let u=e===""||o.pathname==="",c=u?"/":o.pathname,f;if(c==null)f=a;else{let g=t.length-1;if(!r&&c.startsWith("..")){let y=c.split("/");for(;y[0]==="..";)y.shift(),g-=1;o.pathname=y.join("/")}f=g>=0?t[g]:"/"}let m=tS(o,f),h=c&&c!=="/"&&c.endsWith("/"),b=(u||c===".")&&a.endsWith("/");return!m.pathname.endsWith("/")&&(h||b)&&(m.pathname+="/"),m}var ey=e=>e.replace(/[\\/]{2,}/g,"/"),Ua=e=>ey(e.join("/")),_c=e=>e.replace(/\/+$/,""),aS=e=>_c(e).replace(/^\/*/,"/"),sS=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,rS=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,iS=class{constructor(e,t,a,r=!1){this.status=e,this.statusText=t||"",this.internal=r,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function lS(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function oS(e){let t=e.map(a=>a.route.path).filter(Boolean);return Ua(t)||"/"}var ty=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ny(e,t){let a=e;if(typeof a!="string"||!Oh.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let r=a,o=!1;if(ty)try{let u=new URL(window.location.href),c=VE.test(a)?new URL(Bv(a,u.protocol)):new URL(a),f=As(c.pathname,t);c.origin===u.origin&&f!=null?a=f+c.search+c.hash:o=!0}catch{Oa(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:o,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ay=["POST","PUT","PATCH","DELETE"];new Set(ay);var uS=["GET",...ay];new Set(uS);var cS=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function dS(e){try{return cS.includes(new URL(e).protocol)}catch{return!1}}var Qi=T.createContext(null);Qi.displayName="DataRouter";var qc=T.createContext(null);qc.displayName="DataRouterState";var sy=T.createContext(!1);function fS(){return T.useContext(sy)}var ry=T.createContext({isTransitioning:!1});ry.displayName="ViewTransition";var mS=T.createContext(new Map);mS.displayName="Fetchers";var hS=T.createContext(null);hS.displayName="Await";var Ea=T.createContext(null);Ea.displayName="Navigation";var Co=T.createContext(null);Co.displayName="Location";var Ma=T.createContext({outlet:null,matches:[],isDataRoute:!1});Ma.displayName="Route";var Mh=T.createContext(null);Mh.displayName="RouteError";var iy="REACT_ROUTER_ERROR",pS="REDIRECT",gS="ROUTE_ERROR_RESPONSE";function bS(e){if(e.startsWith(`${iy}:${pS}:{`))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 xS(e){if(e.startsWith(`${iy}:${gS}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new iS(t.status,t.statusText,t.data)}catch{}}function ES(e,{relative:t}={}){Ht(Wi(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:r}=T.useContext(Ea),{hash:o,pathname:u,search:c}=wo(e,{relative:t}),f=u;return a!=="/"&&(f=u==="/"?a:Ua([a,u])),r.createHref({pathname:f,search:c,hash:o})}function Wi(){return T.useContext(Co)!=null}function _n(){return Ht(Wi(),"useLocation() may be used only in the context of a <Router> component."),T.useContext(Co).location}var ly="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function oy(e){T.useContext(Ea).static||T.useLayoutEffect(e)}function vn(){let{isDataRoute:e}=T.useContext(Ma);return e?DS():yS()}function yS(){Ht(Wi(),"useNavigate() may be used only in the context of a <Router> component.");let e=T.useContext(Qi),{basename:t,navigator:a}=T.useContext(Ea),{matches:r}=T.useContext(Ma),{pathname:o}=_n(),u=JSON.stringify(Ih(r)),c=T.useRef(!1);return oy(()=>{c.current=!0}),T.useCallback((m,h={})=>{if(Oa(c.current,ly),!c.current)return;if(typeof m=="number"){a.go(m);return}let b=$c(m,JSON.parse(u),o,h.relative==="path");e==null&&t!=="/"&&(b.pathname=b.pathname==="/"?t:Ua([t,b.pathname])),(h.replace?a.replace:a.push)(b,h.state,h)},[t,a,u,o,e])}var NS=T.createContext(null);function TS(e){let t=T.useContext(Ma).outlet;return T.useMemo(()=>t&&T.createElement(NS.Provider,{value:e},t),[t,e])}function uy(){let{matches:e}=T.useContext(Ma),t=e[e.length-1];return(t==null?void 0:t.params)??{}}function wo(e,{relative:t}={}){let{matches:a}=T.useContext(Ma),{pathname:r}=_n(),o=JSON.stringify(Ih(a));return T.useMemo(()=>$c(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function _S(e,t){return cy(e,t)}function cy(e,t,a){var C;Ht(Wi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=T.useContext(Ea),{matches:o}=T.useContext(Ma),u=o[o.length-1],c=u?u.params:{},f=u?u.pathname:"/",m=u?u.pathnameBase:"/",h=u&&u.route;{let S=h&&h.path||"";fy(f,!h||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${S}">) 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="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let b=_n(),g;if(t){let S=typeof t=="string"?Xi(t):t;Ht(m==="/"||((C=S.pathname)==null?void 0:C.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 "${S.pathname}" was given in the \`location\` prop.`),g=S}else g=b;let y=g.pathname||"/",N=y;if(m!=="/"){let S=m.replace(/^\//,"").split("/");N="/"+y.replace(/^\//,"").split("/").slice(S.length).join("/")}let v=a&&a.state.matches.length?a.state.matches.map(S=>Object.assign(S,{route:a.manifest[S.route.id]||S.route})):XE(e,{pathname:N});Oa(h||v!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Oa(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 A=wS(v&&v.map(S=>Object.assign({},S,{params:Object.assign({},c,S.params),pathname:Ua([m,r.encodeLocation?r.encodeLocation(S.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?m:Ua([m,r.encodeLocation?r.encodeLocation(S.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),o,a);return t&&A?T.createElement(Co.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...g},navigationType:"POP"}},A):A}function vS(){let e=MS(),t=lS(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},u={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=T.createElement(T.Fragment,null,T.createElement("p",null,"💿 Hey developer 👋"),T.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",T.createElement("code",{style:u},"ErrorBoundary")," or"," ",T.createElement("code",{style:u},"errorElement")," prop on your route.")),T.createElement(T.Fragment,null,T.createElement("h2",null,"Unexpected Application Error!"),T.createElement("h3",{style:{fontStyle:"italic"}},t),a?T.createElement("pre",{style:o},a):null,c)}var SS=T.createElement(vS,null),dy=class extends T.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=xS(e.digest);a&&(e=a)}let t=e!==void 0?T.createElement(Ma.Provider,{value:this.props.routeContext},T.createElement(Mh.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?T.createElement(AS,{error:e},t):t}};dy.contextType=sy;var xm=new WeakMap;function AS({children:e,error:t}){let{basename:a}=T.useContext(Ea);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=bS(t.digest);if(r){let o=xm.get(t);if(o)throw o;let u=ny(r.location,a),c=u.absoluteURL||u.to;if(dS(c))throw new Error("Invalid redirect location");if(ty&&!xm.get(t))if(u.isExternal||r.reloadDocument)window.location.href=c;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:r.replace}));throw xm.set(t,f),f}return T.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c}`})}}return e}function CS({routeContext:e,match:t,children:a}){let r=T.useContext(Qi);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),T.createElement(Ma.Provider,{value:e},a)}function wS(e,t=[],a){let r=a==null?void 0:a.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,u=r==null?void 0:r.errors;if(u!=null){let b=o.findIndex(g=>g.route.id&&(u==null?void 0:u[g.route.id])!==void 0);Ht(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 c=!1,f=-1;if(a&&r){c=r.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}=r,v=g.route.loader&&!y.hasOwnProperty(g.route.id)&&(!N||N[g.route.id]===void 0);if(g.route.lazy||v){a.isStatic&&(c=!0),f>=0?o=o.slice(0,f+1):o=[o[0]];break}}}}let m=a==null?void 0:a.onError,h=r&&m?(b,g)=>{var y,N;m(b,{location:r.location,params:((N=(y=r.matches)==null?void 0:y[0])==null?void 0:N.params)??{},pattern:oS(r.matches),errorInfo:g})}:void 0;return o.reduceRight((b,g,y)=>{let N,v=!1,A=null,C=null;r&&(N=u&&g.route.id?u[g.route.id]:void 0,A=g.route.errorElement||SS,c&&(f<0&&y===0?(fy("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,C=null):f===y&&(v=!0,C=g.route.hydrateFallbackElement||null)));let S=t.concat(o.slice(0,y+1)),M=()=>{let O;return N?O=A:v?O=C:g.route.Component?O=T.createElement(g.route.Component,null):g.route.element?O=g.route.element:O=b,T.createElement(CS,{match:g,routeContext:{outlet:b,matches:S,isDataRoute:r!=null},children:O})};return r&&(g.route.ErrorBoundary||g.route.errorElement||y===0)?T.createElement(dy,{location:r.location,revalidation:r.revalidation,component:A,error:N,children:M(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:h}):M()},null)}function Dh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function kS(e){let t=T.useContext(Qi);return Ht(t,Dh(e)),t}function RS(e){let t=T.useContext(qc);return Ht(t,Dh(e)),t}function OS(e){let t=T.useContext(Ma);return Ht(t,Dh(e)),t}function Lh(e){let t=OS(e),a=t.matches[t.matches.length-1];return Ht(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function IS(){return Lh("useRouteId")}function MS(){var r;let e=T.useContext(Mh),t=RS("useRouteError"),a=Lh("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[a]}function DS(){let{router:e}=kS("useNavigate"),t=Lh("useNavigate"),a=T.useRef(!1);return oy(()=>{a.current=!0}),T.useCallback(async(o,u={})=>{Oa(a.current,ly),a.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...u}))},[e,t])}var gx={};function fy(e,t,a){!t&&!gx[e]&&(gx[e]=!0,Oa(!1,a))}T.memo(LS);function LS({routes:e,manifest:t,future:a,state:r,isStatic:o,onError:u}){return cy(e,void 0,{manifest:t,state:r,isStatic:o,onError:u})}function Fi({to:e,replace:t,state:a,relative:r}){Ht(Wi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=T.useContext(Ea);Oa(!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}=T.useContext(Ma),{pathname:c}=_n(),f=vn(),m=$c(e,Ih(u),c,r==="path"),h=JSON.stringify(m);return T.useEffect(()=>{f(JSON.parse(h),{replace:t,state:a,relative:r})},[f,h,r,t,a]),null}function jS(e){return TS(e.context)}function na(e){Ht(!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 BS({basename:e="/",children:t=null,location:a,navigationType:r="POP",navigator:o,static:u=!1,useTransitions:c}){Ht(!Wi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),m=T.useMemo(()=>({basename:f,navigator:o,static:u,useTransitions:c,future:{}}),[f,o,u,c]);typeof a=="string"&&(a=Xi(a));let{pathname:h="/",search:b="",hash:g="",state:y=null,key:N="default",mask:v}=a,A=T.useMemo(()=>{let C=As(h,f);return C==null?null:{location:{pathname:C,search:b,hash:g,state:y,key:N,mask:v},navigationType:r}},[f,h,b,g,y,N,r,v]);return Oa(A!=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.`),A==null?null:T.createElement(Ea.Provider,{value:m},T.createElement(Co.Provider,{children:t,value:A}))}function PS({children:e,location:t}){return _S(eh(e),t)}function eh(e,t=[]){let a=[];return T.Children.forEach(e,(r,o)=>{if(!T.isValidElement(r))return;let u=[...t,o];if(r.type===T.Fragment){a.push.apply(a,eh(r.props.children,u));return}Ht(r.type===na,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ht(!r.props.index||!r.props.children,"An index route cannot have child routes.");let c={id:r.props.id||u.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(c.children=eh(r.props.children,u)),a.push(c)}),a}var pc="get",gc="application/x-www-form-urlencoded";function Yc(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function US(e){return Yc(e)&&e.tagName.toLowerCase()==="button"}function HS(e){return Yc(e)&&e.tagName.toLowerCase()==="form"}function FS(e){return Yc(e)&&e.tagName.toLowerCase()==="input"}function zS(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function $S(e,t){return e.button===0&&(!t||t==="_self")&&!zS(e)}function th(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,a)=>{let r=e[a];return t.concat(Array.isArray(r)?r.map(o=>[a,o]):[[a,r]])},[]))}function qS(e,t){let a=th(e);return t&&t.forEach((r,o)=>{a.has(o)||t.getAll(o).forEach(u=>{a.append(o,u)})}),a}var sc=null;function YS(){if(sc===null)try{new FormData(document.createElement("form"),0),sc=!1}catch{sc=!0}return sc}var GS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Em(e){return e!=null&&!GS.has(e)?(Oa(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${gc}"`),null):e}function KS(e,t){let a,r,o,u,c;if(HS(e)){let f=e.getAttribute("action");r=f?As(f,t):null,a=e.getAttribute("method")||pc,o=Em(e.getAttribute("enctype"))||gc,u=new FormData(e)}else if(US(e)||FS(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(r=m?As(m,t):null,a=e.getAttribute("formmethod")||f.getAttribute("method")||pc,o=Em(e.getAttribute("formenctype"))||Em(f.getAttribute("enctype"))||gc,u=new FormData(f,e),!YS()){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(Yc(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=pc,r=null,o=gc,c=e}return u&&o==="text/plain"&&(c=u,u=void 0),{action:r,method:a.toLowerCase(),encType:o,formData:u,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function jh(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function my(e,t,a,r){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}_.${r}`:o.pathname=`${o.pathname}.${r}`:o.pathname==="/"?o.pathname=`_root.${r}`:t&&As(o.pathname,t)==="/"?o.pathname=`${_c(t)}/_root.${r}`:o.pathname=`${_c(o.pathname)}.${r}`,o}async function VS(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 XS(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 QS(e,t,a){let r=await Promise.all(e.map(async o=>{let u=t.routes[o.route.id];if(u){let c=await VS(u,a);return c.links?c.links():[]}return[]}));return eA(r.flat(1).filter(XS).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function bx(e,t,a,r,o,u){let c=(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)=>c(m,h)||f(m,h)):u==="data"?t.filter((m,h)=>{var g;let b=r.routes[m.route.id];if(!b||!b.hasLoader)return!1;if(c(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 WS(e,t,{includeHydrateFallback:a}={}){return ZS(e.map(r=>{let o=t.routes[r.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 ZS(e){return[...new Set(e)]}function JS(e){let t={},a=Object.keys(e).sort();for(let r of a)t[r]=e[r];return t}function eA(e,t){let a=new Set;return new Set(t),e.reduce((r,o)=>{let u=JSON.stringify(JS(o));return a.has(u)||(a.add(u),r.push({key:u,link:o})),r},[])}function Bh(){let e=T.useContext(Qi);return jh(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function tA(){let e=T.useContext(qc);return jh(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Ph=T.createContext(void 0);Ph.displayName="FrameworkContext";function Gc(){let e=T.useContext(Ph);return jh(e,"You must render this element inside a <HydratedRouter> element"),e}function nA(e,t){let a=T.useContext(Ph),[r,o]=T.useState(!1),[u,c]=T.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:b,onTouchStart:g}=t,y=T.useRef(null);T.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let A=S=>{S.forEach(M=>{c(M.isIntersecting)})},C=new IntersectionObserver(A,{threshold:.5});return y.current&&C.observe(y.current),()=>{C.disconnect()}}},[e]),T.useEffect(()=>{if(r){let A=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(A)}}},[r]);let N=()=>{o(!0)},v=()=>{o(!1),c(!1)};return a?e!=="intent"?[u,y,{}]:[u,y,{onFocus:Zl(f,N),onBlur:Zl(m,v),onMouseEnter:Zl(h,N),onMouseLeave:Zl(b,v),onTouchStart:Zl(g,N)}]:[!1,y,{}]}function Zl(e,t){return a=>{e&&e(a),a.defaultPrevented||t(a)}}function aA({page:e,...t}){let a=fS(),{nonce:r}=Gc(),{router:o}=Bh(),u=T.useMemo(()=>XE(o.routes,e,o.basename),[o.routes,e,o.basename]);return u?(t.nonce==null&&r&&(t={...t,nonce:r}),a?T.createElement(rA,{page:e,matches:u,...t}):T.createElement(iA,{page:e,matches:u,...t})):null}function sA(e){let{manifest:t,routeModules:a}=Gc(),[r,o]=T.useState([]);return T.useEffect(()=>{let u=!1;return QS(e,t,a).then(c=>{u||o(c)}),()=>{u=!0}},[e,t,a]),r}function rA({page:e,matches:t,...a}){let r=_n(),{future:o}=Gc(),{basename:u}=Bh(),c=T.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let f=my(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,r,t]);return T.createElement(T.Fragment,null,c.map(f=>T.createElement("link",{key:f,rel:"prefetch",as:"fetch",href:f,...a})))}function iA({page:e,matches:t,...a}){let r=_n(),{future:o,manifest:u,routeModules:c}=Gc(),{basename:f}=Bh(),{loaderData:m,matches:h}=tA(),b=T.useMemo(()=>bx(e,t,h,u,r,"data"),[e,t,h,u,r]),g=T.useMemo(()=>bx(e,t,h,u,r,"assets"),[e,t,h,u,r]),y=T.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let A=new Set,C=!1;if(t.forEach(M=>{var j;let O=u.routes[M.route.id];!O||!O.hasLoader||(!b.some(I=>I.route.id===M.route.id)&&M.route.id in m&&((j=c[M.route.id])!=null&&j.shouldRevalidate)||O.hasClientLoader?C=!0:A.add(M.route.id))}),A.size===0)return[];let S=my(e,f,o.v8_trailingSlashAwareDataRequests,"data");return C&&A.size>0&&S.searchParams.set("_routes",t.filter(M=>A.has(M.route.id)).map(M=>M.route.id).join(",")),[S.pathname+S.search]},[f,o.v8_trailingSlashAwareDataRequests,m,r,u,b,t,e,c]),N=T.useMemo(()=>WS(g,u),[g,u]),v=sA(g);return T.createElement(T.Fragment,null,y.map(A=>T.createElement("link",{key:A,rel:"prefetch",as:"fetch",href:A,...a})),N.map(A=>T.createElement("link",{key:A,rel:"modulepreload",href:A,...a})),v.map(({key:A,link:C})=>T.createElement("link",{key:A,nonce:a.nonce,...C,crossOrigin:C.crossOrigin??a.crossOrigin})))}function lA(...e){return t=>{e.forEach(a=>{typeof a=="function"?a(t):a!=null&&(a.current=t)})}}var oA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{oA&&(window.__reactRouterVersion="7.18.1")}catch{}function uA({basename:e,children:t,useTransitions:a,window:r}){let o=T.useRef();o.current==null&&(o.current=Pv({window:r,v5Compat:!0}));let u=o.current,[c,f]=T.useState({action:u.action,location:u.location}),m=T.useCallback(h=>{a===!1?f(h):T.startTransition(()=>f(h))},[a]);return T.useLayoutEffect(()=>u.listen(m),[u,m]),T.createElement(BS,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:u,useTransitions:a})}var hy=T.forwardRef(function({onClick:t,discover:a="render",prefetch:r="none",relative:o,reloadDocument:u,replace:c,mask:f,state:m,target:h,to:b,preventScrollReset:g,viewTransition:y,defaultShouldRevalidate:N,...v},A){let{basename:C,navigator:S,useTransitions:M}=T.useContext(Ea),O=typeof b=="string"&&Oh.test(b),j=ny(b,C);b=j.to;let I=ES(b,{relative:o}),U=_n(),$=null;if(f){let q=$c(f,[],U.mask?U.mask.pathname:"/",!0);C!=="/"&&(q.pathname=q.pathname==="/"?C:Ua([C,q.pathname])),$=S.createHref(q)}let[Z,K,D]=nA(r,v),te=fA(b,{replace:c,mask:f,state:m,target:h,preventScrollReset:g,relative:o,viewTransition:y,defaultShouldRevalidate:N,useTransitions:M});function le(q){t&&t(q),q.defaultPrevented||te(q)}let pe=!(j.isExternal||u),Q=T.createElement("a",{...v,...D,href:(pe?$:void 0)||j.absoluteURL||I,onClick:pe?le:t,ref:lA(A,K),target:h,"data-discover":!O&&a==="render"?"true":void 0});return Z&&!O?T.createElement(T.Fragment,null,Q,T.createElement(aA,{page:I})):Q});hy.displayName="Link";var vc=T.forwardRef(function({"aria-current":t="page",caseSensitive:a=!1,className:r="",end:o=!1,style:u,to:c,viewTransition:f,children:m,...h},b){let g=wo(c,{relative:h.relative}),y=_n(),N=T.useContext(qc),{navigator:v,basename:A}=T.useContext(Ea),C=N!=null&&bA(g)&&f===!0,S=v.encodeLocation?v.encodeLocation(g).pathname:g.pathname,M=y.pathname,O=N&&N.navigation&&N.navigation.location?N.navigation.location.pathname:null;a||(M=M.toLowerCase(),O=O?O.toLowerCase():null,S=S.toLowerCase()),O&&A&&(O=As(O,A)||O);const j=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let I=M===S||!o&&M.startsWith(S)&&M.charAt(j)==="/",U=O!=null&&(O===S||!o&&O.startsWith(S)&&O.charAt(S.length)==="/"),$={isActive:I,isPending:U,isTransitioning:C},Z=I?t:void 0,K;typeof r=="function"?K=r($):K=[r,I?"active":null,U?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let D=typeof u=="function"?u($):u;return T.createElement(hy,{...h,"aria-current":Z,className:K,ref:b,style:D,to:c,viewTransition:f},typeof m=="function"?m($):m)});vc.displayName="NavLink";var cA=T.forwardRef(({discover:e="render",fetcherKey:t,navigate:a,reloadDocument:r,replace:o,state:u,method:c=pc,action:f,onSubmit:m,relative:h,preventScrollReset:b,viewTransition:g,defaultShouldRevalidate:y,...N},v)=>{let{useTransitions:A}=T.useContext(Ea),C=pA(),S=gA(f,{relative:h}),M=c.toLowerCase()==="get"?"get":"post",O=typeof f=="string"&&Oh.test(f),j=I=>{if(m&&m(I),I.defaultPrevented)return;I.preventDefault();let U=I.nativeEvent.submitter,$=(U==null?void 0:U.getAttribute("formmethod"))||c,Z=()=>C(U||I.currentTarget,{fetcherKey:t,method:$,navigate:a,replace:o,state:u,relative:h,preventScrollReset:b,viewTransition:g,defaultShouldRevalidate:y});A&&a!==!1?T.startTransition(()=>Z()):Z()};return T.createElement("form",{ref:v,method:M,action:S,onSubmit:r?m:j,...N,"data-discover":!O&&e==="render"?"true":void 0})});cA.displayName="Form";function dA(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function py(e){let t=T.useContext(Qi);return Ht(t,dA(e)),t}function fA(e,{target:t,replace:a,mask:r,state:o,preventScrollReset:u,relative:c,viewTransition:f,defaultShouldRevalidate:m,useTransitions:h}={}){let b=vn(),g=_n(),y=wo(e,{relative:c});return T.useCallback(N=>{if($S(N,t)){N.preventDefault();let v=a!==void 0?a:bo(g)===bo(y),A=()=>b(e,{replace:v,mask:r,state:o,preventScrollReset:u,relative:c,viewTransition:f,defaultShouldRevalidate:m});h?T.startTransition(()=>A()):A()}},[g,b,y,a,r,o,t,e,u,c,f,m,h])}function Uh(e){Oa(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=T.useRef(th(e)),a=T.useRef(!1),r=_n(),o=T.useMemo(()=>qS(r.search,a.current?null:t.current),[r.search]),u=vn(),c=T.useCallback((f,m)=>{const h=th(typeof f=="function"?f(new URLSearchParams(o)):f);a.current=!0,u("?"+h,m)},[u,o]);return[o,c]}var mA=0,hA=()=>`__${String(++mA)}__`;function pA(){let{router:e}=py("useSubmit"),{basename:t}=T.useContext(Ea),a=IS(),r=e.fetch,o=e.navigate;return T.useCallback(async(u,c={})=>{let{action:f,method:m,encType:h,formData:b,body:g}=KS(u,t);if(c.navigate===!1){let y=c.fetcherKey||hA();await r(y,a,c.action||f,{defaultShouldRevalidate:c.defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:b,body:g,formMethod:c.method||m,formEncType:c.encType||h,flushSync:c.flushSync})}else await o(c.action||f,{defaultShouldRevalidate:c.defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:b,body:g,formMethod:c.method||m,formEncType:c.encType||h,replace:c.replace,state:c.state,fromRouteId:a,flushSync:c.flushSync,viewTransition:c.viewTransition})},[r,o,t,a])}function gA(e,{relative:t}={}){let{basename:a}=T.useContext(Ea),r=T.useContext(Ma);Ht(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),u={...wo(e||".",{relative:t})},c=_n();if(e==null){u.search=c.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:Ua([a,u.pathname])),bo(u)}function bA(e,{relative:t}={}){let a=T.useContext(ry);Ht(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=py("useViewTransitionState"),o=wo(e,{relative:t});if(!a.isTransitioning)return!1;let u=As(a.currentLocation.pathname,r)||a.currentLocation.pathname,c=As(a.nextLocation.pathname,r)||a.nextLocation.pathname;return Tc(o.pathname,c)!=null||Tc(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 xA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),EA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,r)=>r?r.toUpperCase():a.toLowerCase()),xx=e=>{const t=EA(e);return t.charAt(0).toUpperCase()+t.slice(1)},gy=(...e)=>e.filter((t,a,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===a).join(" ").trim(),yA=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 NA={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 TA=T.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:o="",children:u,iconNode:c,...f},m)=>T.createElement("svg",{ref:m,...NA,width:t,height:t,stroke:e,strokeWidth:r?Number(a)*24/Number(t):a,className:gy("lucide",o),...!u&&!yA(f)&&{"aria-hidden":"true"},...f},[...c.map(([h,b])=>T.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=T.forwardRef(({className:r,...o},u)=>T.createElement(TA,{ref:u,iconNode:t,className:gy(`lucide-${xA(xx(e))}`,`lucide-${e}`,r),...o}));return a.displayName=xx(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 _A=[["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"}]],vA=ke("activity",_A);/**
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 SA=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],AA=ke("arrow-down-to-line",SA);/**
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 CA=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],xo=ke("arrow-left",CA);/**
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 wA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],kA=ke("arrow-right",wA);/**
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 RA=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],by=ke("arrow-up",RA);/**
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 OA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],IA=ke("ban",OA);/**
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 MA=[["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"}]],DA=ke("bot",MA);/**
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 LA=[["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"}]],xy=ke("box",LA);/**
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 jA=[["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"}]],zi=ke("brain",jA);/**
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 BA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],On=ke("check",BA);/**
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 PA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ba=ke("chevron-down",PA);/**
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 UA=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Hh=ke("chevron-left",UA);/**
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 HA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Kc=ke("chevron-right",HA);/**
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 FA=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],zA=ke("chevron-up",FA);/**
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 $A=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],qA=ke("chevrons-left",$A);/**
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 YA=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],GA=ke("chevrons-right",YA);/**
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 KA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ym=ke("circle-check",KA);/**
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 VA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],Yr=ke("circle-dot",VA);/**
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 XA=[["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"}]],Ey=ke("circle-x",XA);/**
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 QA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],WA=ke("circle",QA);/**
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 ZA=[["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"}]],JA=ke("clipboard",ZA);/**
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 e3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],Vc=ke("clock",e3);/**
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 t3=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],yy=ke("cloud",t3);/**
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 n3=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],a3=ke("code-xml",n3);/**
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 s3=[["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"}]],Sc=ke("copy",s3);/**
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 r3=[["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"}]],bc=ke("cpu",r3);/**
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 i3=[["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"}]],l3=ke("download",i3);/**
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 o3=[["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"}]],Fh=ke("ellipsis",o3);/**
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 u3=[["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"}]],Ny=ke("external-link",u3);/**
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 c3=[["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"}]],d3=ke("eye-off",c3);/**
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 f3=[["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"}]],m3=ke("eye",f3);/**
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 h3=[["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"}]],zh=ke("file-text",h3);/**
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 p3=[["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"}]],$h=ke("flag",p3);/**
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 g3=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],b3=ke("gauge",g3);/**
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 x3=[["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"}]],ko=ke("git-branch",x3);/**
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 E3=[["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"}]],y3=ke("git-commit-horizontal",E3);/**
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 N3=[["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"}]],Ex=ke("git-merge",N3);/**
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 T3=[["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"}]],Fr=ke("git-pull-request",T3);/**
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 _3=[["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"}]],v3=ke("hard-drive",_3);/**
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 S3=[["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"}]],A3=ke("image-plus",S3);/**
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 C3=[["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"}]],qh=ke("link-2",C3);/**
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 w3=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ln=ke("loader-circle",w3);/**
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 k3=[["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"}]],R3=ke("maximize-2",k3);/**
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 O3=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],Yh=ke("menu",O3);/**
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 I3=[["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"}]],M3=ke("message-circle-question",I3);/**
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 D3=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],L3=ke("message-circle",D3);/**
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 j3=[["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"}]],B3=ke("mic",j3);/**
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 P3=[["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"}]],U3=ke("minimize-2",P3);/**
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 H3=[["path",{d:"M5 12h14",key:"1ays0h"}]],F3=ke("minus",H3);/**
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 z3=[["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"}]],$3=ke("monitor",z3);/**
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 q3=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Y3=ke("moon",q3);/**
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 G3=[["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"}]],K3=ke("network",G3);/**
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 V3=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],Ty=ke("panel-right",V3);/**
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 X3=[["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"}]],Q3=ke("paperclip",X3);/**
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 W3=[["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"}]],Gh=ke("pen-line",W3);/**
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 Z3=[["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"}]],yx=ke("pencil",Z3);/**
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 J3=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Kh=ke("play",J3);/**
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 e5=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ia=ke("plus",e5);/**
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 t5=[["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"}]],zr=ke("refresh-cw",t5);/**
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 n5=[["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"}]],a5=ke("rotate-ccw",n5);/**
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 s5=[["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"}]],Xc=ke("save",s5);/**
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 r5=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Pr=ke("search",r5);/**
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 i5=[["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"}]],Eo=ke("send",i5);/**
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 l5=[["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"}]],Vh=ke("settings",l5);/**
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 o5=[["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",o5);/**
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 u5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],nh=ke("square",u5);/**
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 c5=[["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"}]],d5=ke("sun",c5);/**
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 f5=[["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"}]],Cs=ke("trash-2",f5);/**
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 m5=[["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"}]],Tn=ke("triangle-alert",m5);/**
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 h5=[["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"}]],_y=ke("upload",h5);/**
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 p5=[["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"}]],vy=ke("user",p5);/**
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 g5=[["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"}]],Sy=ke("users",g5);/**
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 b5=[["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"}]],Ay=ke("wifi",b5);/**
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 x5=[["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"}]],E5=ke("wrench",x5);/**
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 y5=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],gt=ke("x",y5);/**
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 N5=[["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"}]],Qc=ke("zap",N5);function Cy(e){var t,a,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(a=Cy(e[t]))&&(r&&(r+=" "),r+=a)}else for(a in e)e[a]&&(r&&(r+=" "),r+=a);return r}function ne(){for(var e,t,a=0,r="",o=arguments.length;a<o;a++)(e=arguments[a])&&(t=Cy(e))&&(r&&(r+=" "),r+=t);return r}const Nx=e=>{let t;const a=new Set,r=(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:r,getState:o,getInitialState:()=>m,subscribe:h=>(a.add(h),()=>a.delete(h))},m=t=e(r,o,f);return f},T5=(e=>e?Nx(e):Nx),_5=e=>e;function v5(e,t=_5){const a=ac.useSyncExternalStore(e.subscribe,ac.useCallback(()=>t(e.getState()),[e,t]),ac.useCallback(()=>t(e.getInitialState()),[e,t]));return ac.useDebugValue(a),a}const Tx=e=>{const t=T5(e),a=r=>v5(t,r);return Object.assign(a,t),a},es=(e=>e?Tx(e):Tx),Nm="fs-theme";function wy(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function _x(e){return e==="system"?wy():e}function vx(e){e==="system"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}const ah=es((e,t)=>({preference:localStorage.getItem(Nm)??"system",resolved:_x(localStorage.getItem(Nm)??"system"),cycle(){const a=["system","light","dark"],r=a[(a.indexOf(t().preference)+1)%a.length],o=_x(r);localStorage.setItem(Nm,r),vx(r),e({preference:r,resolved:o})},init(){vx(t().preference);const a=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{const{preference:o}=t();if(o==="system"){const u=wy();e({resolved:u})}};return a.addEventListener("change",r),()=>a.removeEventListener("change",r)}})),Ac="fourth-spark-server-url";function ky(){if(typeof window>"u")return!1;const t=window.Capacitor;return typeof(t==null?void 0:t.isNativePlatform)=="function"&&t.isNativePlatform()}function Ry(){return localStorage.getItem(Ac)??""}function S5(e){const t=e.replace(/\/+$/,"");t?localStorage.setItem(Ac,t):localStorage.removeItem(Ac)}function sh(){return localStorage.getItem(Ac)??""}class Ss extends Error{constructor(a,r){super(a);sn(this,"status");this.name="ApiError",this.status=r}}async function Se(e,t){let a;try{a=await fetch(Ry()+e,{...t,headers:{Accept:"application/json",...t!=null&&t.body?{"Content-Type":"application/json"}:{},...t==null?void 0:t.headers}})}catch(o){throw new Ss(o instanceof Error?o.message:"Network request failed",0)}if(!a.ok){const o=await a.text().catch(()=>"");throw new Ss(o.trim()||`${a.status} ${a.statusText}`,a.status)}if(a.status===204)return;const r=await a.text();if(r)return JSON.parse(r)}function sa(e,...t){if(Array.isArray(e))return e;if(e&&typeof e=="object"){const a=e;for(const r of[...t,"data","items"])if(Array.isArray(a[r]))return a[r]}return[]}async function A5(){return sa(await Se("/api/repos"),"repos")}async function C5(e,t,a,r){return Se("/api/repos",{method:"POST",body:JSON.stringify({name:e,gitUrl:t,localPath:a,runtimeType:r})})}async function w5(e){return Se("/api/repos/resolve",{method:"POST",body:JSON.stringify({localPath:e})})}async function k5(e){await Se(`/api/repos/${encodeURIComponent(e)}`,{method:"DELETE"})}async function R5(e){await Se(`/api/repos/${encodeURIComponent(e)}/start`,{method:"POST"})}async function O5(e){await Se(`/api/repos/${encodeURIComponent(e)}/stop`,{method:"POST"})}async function I5(e){return Se(`/api/repos/${encodeURIComponent(e)}/branches`)}async function M5(e,t){return Se(`/api/repos/${encodeURIComponent(e)}/checkout`,{method:"POST",body:JSON.stringify({branch:t})})}async function D5(e){return Se(`/api/repos/${encodeURIComponent(e)}/pull`,{method:"POST"})}function Ge(e){return`/api/repos/${encodeURIComponent(e)}`}async function L5(e){return sa(await Se(`${Ge(e)}/workspaces`),"workspaces")}async function j5(e,t){await Se(`${Ge(e)}/workspaces/${encodeURIComponent(t)}`,{method:"DELETE"})}async function B5(e){return Se(`${Ge(e)}/workspaces/cleanup`,{method:"POST"})}async function P5(e,t){await Se(`/api/repos/${e}/worktree`,{method:"PATCH",body:JSON.stringify({enabled:t})})}async function U5(e,t){await Se(`/api/repos/${e}/runtime`,{method:"PATCH",body:JSON.stringify({runtimeType:t})})}async function H5(e){return sa(await Se(`${Ge(e)}/sessions`),"sessions")}async function F5(e,t,a,r,o,u,c,f){return Se(`${Ge(e)}/sessions`,{method:"POST",body:JSON.stringify({message:t,agent:a,model:r,variant:o,issueId:u,customAgentId:c,files:f})})}async function z5(e,t){await Se(`${Ge(e)}/sessions/${encodeURIComponent(t)}`,{method:"DELETE"})}async function $5(e,t,a,r,o,u,c){await Se(`${Ge(e)}/sessions/${encodeURIComponent(t)}/prompt`,{method:"POST",body:JSON.stringify({content:a,agent:r,model:o,variant:u,files:c})})}async function q5(e,t){await Se(`${Ge(e)}/sessions/${encodeURIComponent(t)}/abort`,{method:"POST"})}async function Y5(e,t,a){await Se(`${Ge(e)}/sessions/${encodeURIComponent(t)}/questions/reply`,{method:"POST",body:JSON.stringify({answers:a})})}async function G5(e,t){await Se(`${Ge(e)}/sessions/${encodeURIComponent(t)}/questions/reject`,{method:"POST"})}async function K5(e,t,a){return Se(`${Ge(e)}/sessions/${encodeURIComponent(t)}/revert`,{method:"POST",body:JSON.stringify({messageID:a})})}function Sx(e){const t=e,a=t.info;if(a&&typeof a.id=="string"){const r=Array.isArray(t.parts)?t.parts:void 0;return{...a,...r?{parts:r}:{}}}return t}async function Ax(e,t,a){const r=new URLSearchParams;a!=null&&a.limit&&r.set("limit",String(a.limit)),a!=null&&a.before&&r.set("before",a.before);const o=r.toString(),u=`${Ge(e)}/sessions/${encodeURIComponent(t)}/messages${o?`?${o}`:""}`,c=await Se(u);if(Array.isArray(c)){const h=c.map(Sx);return{messages:h,total:h.length,hasMore:!1}}const f=c,m=Array.isArray(f.messages)?f.messages:[];return{messages:m.map(Sx),total:f.total??m.length,hasMore:f.hasMore??!1}}async function V5(e,t){return Se(`${Ge(e)}/sessions/${encodeURIComponent(t)}/status`)}async function X5(e,t){return Se(`${Ge(e)}/sessions/${encodeURIComponent(t)}/links`)}async function Q5(e,t){return Se(`${Ge(e)}/sessions/snapshot/${encodeURIComponent(t)}`)}async function Oy(e){return Se(`${Ge(e)}/sessions/all-links`)}async function W5(e,t,a,r){await Se(`${Ge(e)}/sessions/${encodeURIComponent(t)}/links`,{method:"POST",body:JSON.stringify({type:a,targetId:r})})}async function Z5(e,t,a,r){await Se(`${Ge(e)}/sessions/${encodeURIComponent(t)}/links`,{method:"DELETE",body:JSON.stringify({type:a,targetId:r})})}async function Iy(){return sa(await Se("/api/custom-agents"))}async function J5(e){return Se("/api/custom-agents",{method:"POST",body:JSON.stringify(e)})}async function eC(e,t){return Se(`/api/custom-agents/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}async function My(e){await Se(`/api/custom-agents/${encodeURIComponent(e)}`,{method:"DELETE"})}async function Cx(e){return Se(`/api/custom-agents/${encodeURIComponent(e)}/export`)}async function tC(e){return Se("/api/custom-agents/import",{method:"POST",body:JSON.stringify(e)})}async function Dy(e,t){const a=new URLSearchParams;t!=null&&t.category&&a.set("category",t.category),t!=null&&t.includeSuperseded&&a.set("includeSuperseded","true");const r=a.toString();return Se(`/api/custom-agents/${encodeURIComponent(e)}/memories${r?`?${r}`:""}`)}async function nC(e,t,a){return Se(`/api/custom-agents/${encodeURIComponent(e)}/memories/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(a)})}async function aC(e,t){await Se(`/api/custom-agents/${encodeURIComponent(e)}/memories/${encodeURIComponent(t)}`,{method:"DELETE"})}async function sC(e,t){return Se(`/api/custom-agents/${encodeURIComponent(e)}/memories/extract`,{method:"POST",body:JSON.stringify({sessionIds:t})})}async function Xh(e){return Se(`/api/custom-agents/${encodeURIComponent(e)}/sessions`)}async function Ly(e){return sa(await Se(`${Ge(e)}/custom-agents`))}async function rC(e,t){return Se(`${Ge(e)}/custom-agents`,{method:"POST",body:JSON.stringify(t)})}async function Ro(e){return sa(await Se(`${Ge(e)}/models`))}async function jy(){return sa(await Se("/api/prompt-fragments"))}async function iC(e){return Se("/api/prompt-fragments",{method:"POST",body:JSON.stringify(e)})}async function lC(e,t){return Se(`/api/prompt-fragments/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}async function oC(e){await Se(`/api/prompt-fragments/${encodeURIComponent(e)}`,{method:"DELETE"})}async function wx(e){return sa(await Se(`${Ge(e)}/tags`))}async function kx(e,t){return sa(await Se(`${Ge(e)}/milestones`))}async function Rx(e,t="open"){return sa(await Se(`${Ge(e)}/issues?state=${encodeURIComponent(t)}`),"issues")}async function uC(e,t="all"){return Se(`${Ge(e)}/issues/sync`,{method:"POST",body:JSON.stringify({state:t})})}async function cC(e,t,a){return Se(`${Ge(e)}/issues`,{method:"POST",body:JSON.stringify({title:t,body:a})})}async function dC(e,t,a){await Se(`${Ge(e)}/issues/${t}/children`,{method:"POST",body:JSON.stringify({childNumber:a})})}async function By(e,t,a){return Se(`${Ge(e)}/issues/${t}`,{method:"PATCH",body:JSON.stringify(a)})}async function fC(e,t){return sa(await Se(`${Ge(e)}/issues/${t}/pulls`))}async function Ox(e,t="open"){return sa(await Se(`${Ge(e)}/pulls?state=${encodeURIComponent(t)}`))}async function mC(e,t="all"){return Se(`${Ge(e)}/pulls/sync`,{method:"POST",body:JSON.stringify({state:t})})}async function hC(e,t){return Se(`${Ge(e)}/pulls/${t}`)}async function pC(e,t){await Se(`${Ge(e)}/pulls/${t}/merge`,{method:"POST"})}async function Qh(e,t){return sa(await Se(`${Ge(e)}/pulls/${t}/issues`))}async function gC(e,t,a){await Se(`${Ge(e)}/pulls/${t}/issues`,{method:"POST",body:JSON.stringify({issueNumber:a})})}async function bC(e,t,a){await Se(`${Ge(e)}/pulls/${t}/issues/${a}`,{method:"DELETE"})}async function xC(e,t){return Se(`${Ge(e)}/pulls/${t}/comments`)}async function EC(e,t){return Se(`${Ge(e)}/issues/${t}/comments`)}async function Ix(e,t,a){return Se(`${Ge(e)}/issues/${t}/comments`,{method:"POST",body:JSON.stringify({body:a})})}async function yC(e,t,a){return Se(`${Ge(e)}/issues/${t}/polish`,{method:"POST",body:JSON.stringify({draft:a})})}async function Mx(e,t){return Se(`${Ge(e)}/issues/${t}/draft`)}async function NC(e,t,a){return Se(`${Ge(e)}/issues/polish-create`,{method:"POST",body:JSON.stringify({title:t,body:a})})}async function Dx(e){return Se(`${Ge(e)}/issues/draft-create`)}async function TC(e){await Se(`${Ge(e)}/issues/draft-create`,{method:"DELETE"})}async function _C(e,t,a){await Se(`${Ge(e)}/sessions/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({title:a})})}async function vC(e,t,a){await Se(`${Ge(e)}/sessions/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({completedAt:a})})}async function SC(){return Se("/api/agents-md")}async function AC(e){await Se("/api/agents-md",{method:"PUT",body:JSON.stringify({content:e})})}async function CC(e){return Se(`/api/repos/${encodeURIComponent(e)}/agents-md`)}async function wC(e,t){await Se(`/api/repos/${encodeURIComponent(e)}/agents-md`,{method:"PUT",body:JSON.stringify({content:t})})}function kC(e){return`${Ry()}${Ge(e)}/events`}async function RC(e){return Se(`${Ge(e)}/sessions/status`)}async function Oo(){return Se("/api/settings")}async function rh(e,t){await Se(`/api/settings/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({value:t})})}async function ih(){return Se("/api/cloud/status")}async function OC(){return Se("/api/cloud/reload",{method:"POST"})}async function IC(e){try{return(await Se("/api/cloud/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})})).connected}catch{return!1}}async function MC(){return sa(await Se("/api/git-hosts"),"gitHosts")}async function DC(e,t,a,r="gitea"){return Se("/api/git-hosts",{method:"POST",body:JSON.stringify({host:e,name:t,token:a,platform:r})})}async function LC(e){await Se(`/api/git-hosts/${encodeURIComponent(e)}`,{method:"DELETE"})}async function Py(){return Se("/api/usage")}async function Uy(e){return Se("/api/usage/switch",{method:"POST",body:JSON.stringify({accountId:e})})}async function jC(e,t="ios"){await Se("/api/push/register",{method:"POST",body:JSON.stringify({token:e,platform:t})})}const ar="fs-active-repo",je=es((e,t)=>({repos:[],activeRepoId:localStorage.getItem(ar),loading:!1,loadError:null,loadRepos:async()=>{e({loading:!0,loadError:null});try{const a=await A5(),r=t().activeRepoId,o=r&&a.some(c=>c.id===r);e({repos:a,loading:!1,activeRepoId:o?r:a.length>0?a[0].id:null});const u=t().activeRepoId;u?localStorage.setItem(ar,u):localStorage.removeItem(ar)}catch(a){e({loading:!1,loadError:a instanceof Error?a.message:"Failed to load repos"})}},setActiveRepo:a=>{e({activeRepoId:a}),a?localStorage.setItem(ar,a):localStorage.removeItem(ar)},addRepo:async(a,r,o,u)=>{try{const c=await C5(a,r,o,u);return e(f=>({repos:[...f.repos,c],activeRepoId:c.id})),localStorage.setItem(ar,c.id),c}catch(c){return e({loadError:c instanceof Error?c.message:"Failed to add repo"}),null}},removeRepo:async a=>{try{await k5(a)}catch{}e(r=>{const o=r.repos.filter(c=>c.id!==a),u=r.activeRepoId===a?o.length>0?o[0].id:null:r.activeRepoId;return u?localStorage.setItem(ar,u):localStorage.removeItem(ar),{repos:o,activeRepoId:u}})},updateRepoBranch:(a,r)=>{e(o=>({repos:o.repos.map(u=>u.id===a?{...u,branch:r}:u)}))}})),zn=e=>{var t;return((t=e.repos.find(a=>a.id===e.activeRepoId))==null?void 0:t.name)??null},Lx="fs-nav-collapsed",jx="fs-session-panel-collapsed",Cc=es(e=>({navCollapsed:localStorage.getItem(Lx)==="true",sessionPanelCollapsed:localStorage.getItem(jx)==="true",toggleNav(){e(t=>{const a=!t.navCollapsed;return localStorage.setItem(Lx,String(a)),{navCollapsed:a}})},toggleSessionPanel(){e(t=>{const a=!t.sessionPanelCollapsed;return localStorage.setItem(jx,String(a)),{sessionPanelCollapsed:a}})}})),Hy=[{segment:"run",icon:Kh,label:"运行面板",global:!1},{segment:"dev/issues",icon:a3,label:"研发",global:!1,matchPrefix:"dev"},{segment:"agents",icon:DA,label:"Agents",global:!1}];function Fy(e,t,a){return t?`/${e}`:a?`/${encodeURIComponent(a)}/${e}`:`/${e}`}function zy(e,t,a){if(!e.matchPrefix)return!1;const r=e.global?`/${e.matchPrefix}`:a?`/${encodeURIComponent(a)}/${e.matchPrefix}`:null;return r?t===r||t.startsWith(`${r}/`):!1}function BC(e){const t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}function PC({repos:e,activeRepoId:t,onRepoChange:a}){const r=vn(),[o,u]=T.useState(!1),c=T.useRef(null),f=e.find(h=>h.id===t),m=T.useCallback(()=>u(!1),[]);return T.useEffect(()=>{if(!o)return;const h=b=>{c.current&&!c.current.contains(b.target)&&m()};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[o,m]),i.jsxs("div",{ref:c,className:"relative",children:[i.jsxs("button",{type:"button",onClick:()=>u(h=>!h),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:[i.jsx(xy,{className:"h-3 w-3 shrink-0 text-fg-4"}),i.jsxs("span",{className:"truncate",children:[i.jsx("span",{className:"sm:hidden",children:f?BC(f.name):""}),i.jsx("span",{className:"hidden sm:inline",children:(f==null?void 0:f.name)??""})]}),i.jsx(ba,{className:ne("h-3 w-3 shrink-0 text-fg-4 transition-transform",o&&"rotate-180")})]}),o&&i.jsxs("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:[i.jsx("div",{className:"max-h-64 overflow-y-auto py-1",children:e.map(h=>i.jsxs("button",{type:"button",onClick:()=>{a(h.id),m()},className:ne("flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors",h.id===t?"font-medium text-blue-600":"text-fg-2 hover:bg-elevated"),children:[h.id===t?i.jsx(On,{className:"h-3 w-3 shrink-0"}):i.jsx("span",{className:"h-3 w-3 shrink-0"}),i.jsx("span",{className:"truncate",children:h.name})]},h.id))}),i.jsx("div",{className:"border-t border-line",children:i.jsxs("button",{type:"button",onClick:()=>{r("/repos"),m()},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:[i.jsx(Vh,{className:"h-3 w-3 shrink-0"}),i.jsx("span",{children:"管理仓库"})]})})]})]})}function UC({repoId:e,currentBranch:t}){const a=je(S=>S.updateRepoBranch),[r,o]=T.useState(!1),[u,c]=T.useState(null),[f,m]=T.useState(!1),[h,b]=T.useState(null),[g,y]=T.useState(null),N=T.useRef(null),v=T.useCallback(()=>{o(!1),y(null)},[]);T.useEffect(()=>{if(!r)return;const S=M=>{N.current&&!N.current.contains(M.target)&&v()};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[r,v]);const A=async()=>{if(r){v();return}o(!0),m(!0),y(null);try{c(await I5(e))}catch{y("加载分支失败")}finally{m(!1)}},C=async S=>{if(!(S===t||h)){b(S),y(null);try{const M=await M5(e,S);a(e,M.branch),v()}catch(M){y(M instanceof Error?M.message:"切换失败")}finally{b(null)}}};return t?i.jsxs("div",{ref:N,className:"relative",children:[i.jsxs("button",{type:"button",onClick:A,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:[i.jsx(ko,{className:"h-3 w-3"}),t,i.jsx(ba,{className:ne("h-3 w-3 transition-transform",r&&"rotate-180")})]}),r&&i.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?i.jsx("div",{className:"flex items-center justify-center py-4",children:i.jsx(ln,{className:"h-4 w-4 animate-spin text-fg-4"})}):u?i.jsxs("div",{className:"max-h-64 overflow-y-auto py-1",children:[u.local.map(S=>i.jsxs("button",{type:"button",disabled:h!==null,onClick:()=>C(S),className:ne("flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors",S===t?"font-medium text-blue-600":"text-fg-2 hover:bg-elevated"),children:[S===t?i.jsx(On,{className:"h-3 w-3 shrink-0"}):h===S?i.jsx(ln,{className:"h-3 w-3 shrink-0 animate-spin"}):i.jsx("span",{className:"h-3 w-3 shrink-0"}),i.jsx("span",{className:"truncate",children:S})]},S)),u.remote.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"mx-3 my-1 border-t border-line"}),i.jsx("div",{className:"px-3 py-1 text-[10px] font-medium uppercase tracking-wider text-fg-4",children:"Remote"}),u.remote.map(S=>i.jsxs("button",{type:"button",disabled:h!==null,onClick:()=>C(S),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===S?i.jsx(ln,{className:"h-3 w-3 shrink-0 animate-spin"}):i.jsx("span",{className:"h-3 w-3 shrink-0"}),i.jsx("span",{className:"truncate",children:S})]},`remote-${S}`))]})]}):null,g&&i.jsx("div",{className:"border-t border-line px-3 py-2 text-xs text-red-500",children:g})]})]}):null}function HC(){const[e,t]=T.useState(null);return T.useEffect(()=>{const a=()=>fetch("/api/health").then(u=>u.json()).then(u=>{u.latestVersion&&u.latestVersion!=="0.10.11"&&t(u.latestVersion)}).catch(()=>{});a();const r=setInterval(a,30*6e4),o=()=>a();return window.addEventListener("focus",o),()=>{clearInterval(r),window.removeEventListener("focus",o)}},[]),e}function FC(){const e=vn(),t=_n(),a=je(g=>g.repos),r=je(g=>g.activeRepoId),o=je(g=>g.setActiveRepo),u=ah(g=>g.preference),c=ah(g=>g.cycle),f=u==="light"?d5:u==="dark"?Y3:$3,m=a.find(g=>g.id===r),h=HC(),b=g=>{var A;if(!g)return;o(g);const y=a.find(C=>C.id===g);if(!y)return;const N=t.pathname.match(/\/dev\/(issues|pulls)/);if(N){e(`/${encodeURIComponent(y.name)}/dev/${N[1]}`);return}const v=((A=t.pathname.match(/\/(run|agents|issues|pulls)/))==null?void 0:A[1])??"run";e(`/${encodeURIComponent(y.name)}/${v}`)};return i.jsxs("header",{className:"shrink-0 border-b border-line bg-surface pt-[var(--safe-top)]",children:[i.jsxs("div",{className:"flex h-12 items-center justify-between px-4",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx(Qc,{className:"h-5 w-5 text-blue-500"}),i.jsx("span",{className:"hidden text-sm font-bold tracking-tight text-fg sm:inline",children:"Fourth Spark"}),i.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.11"]}),h&&i.jsxs("span",{className:"hidden text-[10px] text-amber-500 sm:inline",children:["→ v",h," 可用,运行 ",i.jsx("code",{className:"rounded bg-amber-500/10 px-1 font-mono",children:"fourth-spark upgrade"})," 更新"]})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[a.length>0&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(PC,{repos:a,activeRepoId:r,onRepoChange:b}),m&&r&&i.jsx(UC,{repoId:r,currentBranch:m.branch})]}),i.jsx("button",{type:"button",onClick:()=>e("/settings"),"aria-label":"设置",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:i.jsx(Vh,{className:"h-4 w-4"})}),i.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:i.jsx("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:i.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"})})}),i.jsx("button",{type:"button",onClick:c,"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:i.jsx(f,{className:"h-4 w-4"})})]})]}),h&&i.jsx("div",{className:"border-t border-line px-4 py-1.5 sm:hidden",children:i.jsxs("span",{className:"text-[10px] text-amber-500",children:["→ v",h," 可用,运行 ",i.jsx("code",{className:"rounded bg-amber-500/10 px-1 font-mono",children:"fourth-spark upgrade"})," 更新"]})})]})}function zC(){const e=je(zn),t=Cc(o=>o.navCollapsed),a=Cc(o=>o.toggleNav),r=_n();return i.jsxs("nav",{className:ne("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:[i.jsx("div",{className:"flex flex-1 flex-col",children:Hy.map(o=>{const u=zy(o,r.pathname,e);return i.jsxs(vc,{to:Fy(o.segment,o.global,e),title:t?o.label:void 0,className:({isActive:c})=>ne("mx-2 flex items-center rounded-md py-2 text-sm transition-colors",t?"justify-center px-2":"gap-2.5 px-3",c||u?"bg-blue-500/10 font-medium text-blue-600":"text-fg-3 hover:bg-elevated hover:text-fg"),children:[i.jsx(o.icon,{className:"h-4 w-4 shrink-0"}),i.jsx("span",{className:ne("truncate transition-[opacity,max-width] duration-200 ease-in-out",t?"max-w-0 opacity-0":"max-w-[8rem] opacity-100"),children:o.label})]},o.segment)})}),i.jsxs(vc,{to:"/settings",title:t?"设置":void 0,className:({isActive:o})=>ne("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-4 hover:bg-elevated hover:text-fg-2"),children:[i.jsx(Vh,{className:"h-4 w-4 shrink-0"}),i.jsx("span",{className:ne("truncate transition-[opacity,max-width] duration-200 ease-in-out",t?"max-w-0 opacity-0":"max-w-[8rem] opacity-100"),children:"设置"})]}),i.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?i.jsx(GA,{className:"h-4 w-4"}):i.jsx(qA,{className:"h-4 w-4"})})]})}function $C(){const e=je(zn),t=_n();return i.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:i.jsx("div",{className:"flex h-14 items-center justify-around",children:Hy.map(a=>{const r=zy(a,t.pathname,e);return i.jsx(vc,{to:Fy(a.segment,a.global,e),"aria-label":a.label,className:({isActive:o})=>ne("flex h-10 w-10 items-center justify-center rounded-md transition-colors",o||r?"bg-blue-500/10 text-blue-600":"text-fg-3 hover:bg-elevated hover:text-fg"),children:i.jsx(a.icon,{className:"h-5 w-5 shrink-0"})},a.segment)})})})}function qC(){return i.jsxs("div",{className:"flex h-full flex-col overflow-hidden bg-base text-fg",children:[i.jsx(FC,{}),i.jsxs("div",{className:"flex min-h-0 flex-1",children:[i.jsx(zC,{}),i.jsx("main",{className:"flex min-w-0 flex-1 flex-col overflow-hidden pb-[calc(3.5rem_+_var(--safe-bottom))] md:pb-0",children:i.jsx(jS,{})})]}),i.jsx($C,{})]})}let YC=0;const Qt=es(e=>({toasts:[],addToast:(t,a="info",r,o)=>{const u=(o==null?void 0:o.id)??`toast-${++YC}-${Date.now()}`;e(c=>c.toasts.some(f=>f.id===u)?c:{toasts:[...c.toasts,{id:u,message:t,variant:a,sessionId:r,persistent:o==null?void 0:o.persistent}]}),o!=null&&o.persistent||setTimeout(()=>{e(c=>({toasts:c.toasts.filter(f=>f.id!==u)}))},4e3)},removeToast:t=>{e(a=>({toasts:a.toasts.filter(r=>r.id!==t)}))}}));function GC({onClose:e}){const[t,a]=T.useState(""),[r,o]=T.useState(""),[u,c]=T.useState(""),[f,m]=T.useState("opencode"),[h,b]=T.useState(!1),[g,y]=T.useState(""),N=je(M=>M.addRepo),v=r.trim()!==""&&u.trim()!==""&&t.trim()!==""&&!h,A=async M=>{const O=M.trim();if(O){b(!0),y("");try{const j=await w5(O);j.name&&!r.trim()&&o(j.name),j.gitUrl&&!u.trim()&&c(j.gitUrl)}catch(j){const I=j instanceof Error?j.message:"无法解析路径";try{const U=JSON.parse(I);y(U.error??I)}catch{y(I)}}b(!1)}},C=T.useRef(A);C.current=A,T.useEffect(()=>{const M=t.trim();if(!M)return;const O=setTimeout(()=>{C.current(M)},500);return()=>clearTimeout(O)},[t]);const S=async()=>{if(!v)return;y(""),await N(r.trim(),u.trim(),t.trim(),f)&&e()};return i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:e,children:i.jsxs("div",{className:"w-full max-w-md rounded-xl border border-line bg-surface p-6 shadow-2xl",onClick:M=>M.stopPropagation(),children:[i.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[i.jsx("h2",{className:"text-base font-semibold text-fg",children:"添加仓库"}),i.jsx("button",{type:"button",onClick:e,className:"rounded-md p-1 text-fg-4 hover:bg-elevated hover:text-fg-2",children:i.jsx(gt,{className:"h-4 w-4"})})]}),i.jsxs("div",{className:"flex flex-col gap-4",children:[i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx("label",{htmlFor:"m-path",className:"text-xs font-medium text-fg-3",children:"本地路径"}),i.jsx("input",{id:"m-path",value:t,onChange:M=>a(M.target.value),onBlur:M=>void A(M.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"}),i.jsx("span",{className:"text-[11px] text-fg-5",children:h?"正在读取 Git 信息…":"输入路径后自动读取仓库信息"})]}),i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx("label",{htmlFor:"m-name",className:"text-xs font-medium text-fg-3",children:"名称"}),i.jsx("input",{id:"m-name",value:r,onChange:M=>o(M.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"})]}),i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx("label",{htmlFor:"m-git",className:"text-xs font-medium text-fg-3",children:"Git 远程地址"}),i.jsx("input",{id:"m-git",value:u,onChange:M=>c(M.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"})]}),i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx("label",{className:"text-xs font-medium text-fg-3",children:"运行时"}),i.jsx("div",{className:"flex gap-2",children:[{value:"opencode",label:"OpenCode"},{value:"claude-code",label:"Claude Code"}].map(M=>i.jsx("button",{type:"button",onClick:()=>m(M.value),className:`flex-1 rounded-lg border px-3 py-2 text-sm font-medium transition-colors ${f===M.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:M.label},M.value))}),i.jsx("span",{className:"text-[11px] text-fg-5",children:f==="claude-code"?"需要本地安装 Claude Code CLI":"需要本地安装 OpenCode CLI"})]}),g&&i.jsx("p",{className:"rounded-md bg-red-500/10 px-3 py-2 text-xs text-red-500",children:g}),i.jsxs("div",{className:"mt-1 flex items-center justify-end gap-2",children:[i.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:"取消"}),i.jsx("button",{type:"button",onClick:S,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 KC({repoId:e,repoName:t,onClose:a}){const[r,o]=T.useState(""),[u,c]=T.useState(""),[f,m]=T.useState(!0),[h,b]=T.useState(!1),[g,y]=T.useState(null);T.useEffect(()=>{CC(e).then(A=>{o(A.content),c(A.content),m(!1)}).catch(A=>{y(A instanceof Error?A.message:String(A)),m(!1)})},[e]);const N=async()=>{b(!0),y(null);try{await wC(e,r),c(r)}catch(A){y(A instanceof Error?A.message:String(A))}b(!1)},v=r!==u;return i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:a,children:i.jsxs("div",{className:"flex w-full max-w-2xl flex-col rounded-xl border border-line bg-surface p-6 shadow-2xl",onClick:A=>A.stopPropagation(),children:[i.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsxs("h2",{className:"text-base font-semibold text-fg",children:[t," — AGENTS.md"]}),i.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"仅对此仓库生效,修改后 opencode 热加载即时生效。"})]}),i.jsx("button",{type:"button",onClick:a,className:"shrink-0 rounded-md p-1 text-fg-4 hover:bg-elevated hover:text-fg-2",children:i.jsx(gt,{className:"h-4 w-4"})})]}),g&&i.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:[i.jsx(Tn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),i.jsx("span",{className:"min-w-0 break-words",children:g})]}),f?i.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-16 text-fg-5",children:[i.jsx(ln,{className:"h-5 w-5 fs-spin"}),i.jsx("p",{className:"text-xs",children:"加载中…"})]}):i.jsx("textarea",{value:r,onChange:A=>o(A.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
461
-
462
- 在此编写该仓库的 Agent 指令…`}),i.jsxs("div",{className:"mt-4 flex items-center justify-end gap-2",children:[i.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:"关闭"}),i.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:[i.jsx(Xc,{className:"h-3.5 w-3.5"}),h?"保存中…":"保存"]})]})]})})}const lh=1024,oh=lh*1024,Bx=oh*1024;function Px(e){return!e||e<=0?"0 B":e<lh?`${e} B`:e<oh?`${(e/lh).toFixed(1)} KB`:e<Bx?`${(e/oh).toFixed(1)} MB`:`${(e/Bx).toFixed(2)} GB`}const Tm="ws/";function VC({repoId:e}){const[t,a]=T.useState(!1),[r,o]=T.useState(null),[u,c]=T.useState(!1),[f,m]=T.useState(null),[h,b]=T.useState(null),[g,y]=T.useState(!1),N=async()=>{c(!0),m(null);try{const M=await L5(e);o(M)}catch(M){m(M instanceof Ss?M.message:"加载失败")}c(!1)};T.useEffect(()=>{t&&r===null&&N()},[t]);const v=async M=>{b(M);try{await j5(e,M),await N()}catch(O){m(O instanceof Ss?O.message:"删除失败")}b(null)},A=async()=>{y(!0);try{await B5(e),await N()}catch(M){m(M instanceof Ss?M.message:"清理失败")}y(!1)},C=(r==null?void 0:r.length)??0,S=(r==null?void 0:r.reduce((M,O)=>M+(O.diskUsage||0),0))??0;return i.jsxs("div",{className:"mt-3 border-t border-line pt-3",children:[i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsxs("button",{type:"button",onClick:()=>a(M=>!M),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?i.jsx(zA,{className:"h-3 w-3 shrink-0"}):i.jsx(ba,{className:"h-3 w-3 shrink-0"}),i.jsx(ko,{className:"h-3 w-3 shrink-0 text-fg-5"}),i.jsx("span",{children:"工作空间"}),r!==null&&i.jsxs("span",{className:"text-fg-5",children:["(",C,") · ",Px(S)]})]}),t&&C>0&&i.jsxs("button",{type:"button",onClick:()=>void A(),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?i.jsx("span",{className:"inline-block h-2.5 w-2.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):null,"清理已合并"]})]}),t&&i.jsxs("div",{className:"mt-2",children:[f&&i.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:[i.jsx("span",{className:"truncate",children:f}),i.jsx("button",{type:"button",onClick:()=>m(null),className:"shrink-0 rounded p-0.5 transition-colors hover:bg-red-500/10",children:i.jsx(gt,{className:"h-3 w-3"})})]}),u&&r===null?i.jsx("div",{className:"flex justify-center py-3",children:i.jsx("span",{className:"inline-block h-3.5 w-3.5 animate-spin rounded-full border-2 border-fg-5 border-t-transparent"})}):C===0?i.jsx("p",{className:"py-2 text-center text-xs text-fg-5",children:"暂无工作空间"}):i.jsx("ul",{className:"space-y-1",children:r==null?void 0:r.map(M=>{const O=M.branch.startsWith(Tm),j=O?M.branch.slice(Tm.length):M.branch,I=M.status==="active"?"bg-emerald-500/10 text-emerald-600":M.status==="idle"?"bg-amber-500/10 text-amber-600":"bg-fg-6/30 text-fg-4",U=M.status==="active"?"活跃":M.status==="idle"?"空闲":M.status==="merged"?"已合并":M.status==="stale"?"陈旧":M.status,$=M.status!=="active";return i.jsxs("li",{className:"flex items-center gap-2 rounded-md border border-line bg-elevated/40 px-2 py-1.5 text-xs",children:[i.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[M.running&&M.port&&i.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-emerald-500",title:`运行中 :${M.port}`}),i.jsxs("span",{className:"min-w-0 truncate font-mono",children:[O&&i.jsx("span",{className:"text-fg-5",children:Tm}),i.jsx("span",{className:"text-fg-2",children:j})]})]}),i.jsx("span",{className:ne("shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium",I),children:U}),i.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 text-fg-5",children:[i.jsx(v3,{className:"h-2.5 w-2.5"}),Px(M.diskUsage)]}),i.jsx("button",{type:"button",onClick:()=>void v(M.id),disabled:!$||h===M.id,title:$?"删除工作空间":"活跃工作空间无法删除",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===M.id?i.jsx("span",{className:"inline-block h-2.5 w-2.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):i.jsx(Cs,{className:"h-3 w-3"})})]},M.id)})})]})]})}function $y(){const e=je(I=>I.repos),t=je(I=>I.activeRepoId),a=je(I=>I.setActiveRepo),r=je(I=>I.removeRepo),o=je(I=>I.loadRepos),[u,c]=T.useState(!1),[f,m]=T.useState(null),[h,b]=T.useState(null),[g,y]=T.useState(null),N=Qt(I=>I.addToast),[v,A]=T.useState(null),[C,S]=T.useState(null),M=T.useRef(null);T.useEffect(()=>{if(!C)return;const I=U=>{M.current&&!M.current.contains(U.target)&&S(null)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[C]);const O=async(I,U)=>{b(I);try{U?await O5(I):await R5(I),await o()}catch{}b(null)},j=async I=>{y(I);try{const U=await D5(I);await o();const $=U.alreadyUpToDate?"info":"success";N(U.summary,$,void 0,{persistent:!0})}catch(U){let $="拉取失败";if(U instanceof Ss)try{$=JSON.parse(U.message).error??U.message}catch{$=U.message}N($,"error",void 0,{persistent:!0})}y(null)};return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"mb-6 flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("h1",{className:"text-lg font-semibold text-fg",children:"仓库管理"}),i.jsx("p",{className:"mt-0.5 text-sm text-fg-4",children:"管理代码仓库,每个仓库对应一个独立的 Agent 运行环境"})]}),i.jsxs("button",{type:"button",onClick:()=>c(!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:[i.jsx(Ia,{className:"h-4 w-4"}),i.jsx("span",{className:"hidden md:inline",children:"添加仓库"})]})]}),e.length===0?i.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-dashed border-line-hard py-16 text-center",children:[i.jsx("div",{className:"rounded-full bg-elevated p-3",children:i.jsx(Ia,{className:"h-6 w-6 text-fg-4"})}),i.jsx("p",{className:"text-sm font-medium text-fg-3",children:"暂无代码仓库"}),i.jsx("p",{className:"text-xs text-fg-5",children:"添加一个本地仓库开始使用"}),i.jsx("button",{type:"button",onClick:()=>c(!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:"添加仓库"})]}):i.jsx(i.Fragment,{children:i.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:e.map(I=>{const U=I.id===t;return i.jsxs("div",{className:ne("rounded-xl border p-4 transition-colors",U?"border-blue-500/40 bg-blue-500/5":"border-line"),children:[i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsxs("button",{type:"button",onClick:()=>a(I.id),className:"flex min-w-0 items-center gap-2 text-left",children:[U?i.jsx(Yr,{className:"h-4 w-4 shrink-0 text-blue-500"}):i.jsx(WA,{className:"h-4 w-4 shrink-0 text-fg-5"}),i.jsx("span",{className:ne("truncate font-medium",U?"text-fg":"text-fg-2"),children:I.name})]}),i.jsxs("span",{className:ne("inline-flex shrink-0 items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium",I.running?"bg-emerald-500/10 text-emerald-600":"bg-fg-6/30 text-fg-4"),children:[i.jsx("span",{className:ne("h-1.5 w-1.5 rounded-full",I.running?"bg-emerald-500":"bg-fg-5")}),I.running?"运行中":"已停止"]})]}),i.jsxs("dl",{className:"mt-3 space-y-1 font-mono text-xs text-fg-4",children:[i.jsxs("div",{className:"flex gap-2",children:[i.jsx("dt",{className:"shrink-0 text-fg-5",children:"Git"}),i.jsx("dd",{className:"min-w-0 truncate",children:I.gitUrl})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("dt",{className:"shrink-0 text-fg-5",children:"路径"}),i.jsxs("dd",{className:"flex min-w-0 items-center gap-1.5",children:[i.jsx("span",{className:"truncate",children:I.localPath}),i.jsx("button",{type:"button",onClick:()=>void navigator.clipboard.writeText(I.localPath),title:"复制路径",className:"shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:text-fg-3",children:i.jsx(Sc,{className:"h-3 w-3"})})]})]}),I.running&&I.port&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("dt",{className:"shrink-0 text-fg-5",children:"直连"}),i.jsxs("dd",{className:"flex min-w-0 items-center gap-1.5",children:[i.jsxs("a",{href:`http://127.0.0.1:${I.port}`,target:"_blank",rel:"noopener noreferrer",className:"truncate text-blue-500 hover:underline",children:["127.0.0.1:",I.port]}),i.jsx("button",{type:"button",onClick:()=>void navigator.clipboard.writeText(`http://127.0.0.1:${I.port}`),title:"复制链接",className:"shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:text-fg-3",children:i.jsx(Sc,{className:"h-3 w-3"})})]})]})]}),i.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[i.jsx("button",{type:"button",onClick:()=>void j(I.id),disabled:g===I.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===I.id?i.jsx("span",{className:"inline-block h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):i.jsxs(i.Fragment,{children:[i.jsx(AA,{className:"h-3 w-3"}),"拉取"]})}),i.jsx("button",{type:"button",onClick:()=>void O(I.id,I.running),disabled:h===I.id,className:ne("flex h-8 flex-1 items-center justify-center gap-1.5 rounded-md border text-xs font-medium transition-colors disabled:opacity-50",I.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===I.id?i.jsx("span",{className:"inline-block h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):I.running?i.jsxs(i.Fragment,{children:[i.jsx(nh,{className:"h-3 w-3 fill-current"}),"停止"]}):i.jsxs(i.Fragment,{children:[i.jsx(Kh,{className:"h-3 w-3 fill-current"}),"启动"]})}),i.jsxs("div",{className:"relative",ref:C===I.id?M:void 0,children:[i.jsx("button",{type:"button",onClick:()=>S(C===I.id?null:I.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:i.jsx(Fh,{className:"h-4 w-4"})}),C===I.id&&i.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:[i.jsx("button",{type:"button",className:ne("flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-colors hover:bg-base/60",I.runtimeType==="claude-code"?"text-orange-500":"text-sky-500"),onClick:async()=>{S(null);const $=I.runtimeType==="claude-code"?"opencode":"claude-code";await U5(I.id,$),o()},children:I.runtimeType==="claude-code"?"Claude → OpenCode":"OpenCode → Claude"}),i.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()=>{S(null),await P5(I.id,!I.worktreeEnabled),o()},children:[i.jsx(ko,{className:"h-3 w-3"}),i.jsx("span",{children:"Worktree"}),i.jsx("span",{className:ne("ml-auto text-[10px]",I.worktreeEnabled?"text-violet-500":"text-fg-5"),children:I.worktreeEnabled?"已开启":"已关闭"})]}),i.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:()=>{S(null),A({id:I.id,name:I.name})},children:[i.jsx(zh,{className:"h-3 w-3"}),"配置"]}),i.jsx("div",{className:"my-0.5 border-t border-line"}),i.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:()=>{S(null),m(I.id)},children:[i.jsx(Cs,{className:"h-3 w-3"}),"删除仓库"]})]})]})]}),f===I.id&&i.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:[i.jsx("span",{className:"text-xs text-red-500",children:"确认删除此仓库?"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{type:"button",onClick:()=>{r(I.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:[i.jsx(On,{className:"h-3 w-3"}),"确认"]}),i.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:"取消"})]})]}),I.worktreeEnabled&&i.jsx(VC,{repoId:I.id})]},I.id)})})}),i.jsxs("p",{className:"mt-3 text-xs text-fg-5",children:[e.length," 个仓库"]}),u&&i.jsx(GC,{onClose:()=>c(!1)}),v&&i.jsx(KC,{repoId:v.id,repoName:v.name,onClose:()=>A(null)})]})}function XC(){return i.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:i.jsx("div",{className:"mx-auto max-w-4xl",children:i.jsx($y,{})})})}const QC=new Set(["tool","tool-use","tool_use","tool-call","tool_call","tool-result","tool_result"]),WC=new Set(["thinking","reasoning","reason"]),ZC=new Set(["text","output_text","message"]),JC=new Set(["file","image"]);function wc(e){var a;const t=((a=e.type)==null?void 0:a.toLowerCase())??"";return QC.has(t)||e.toolName!=null||e.tool!=null?"tool":JC.has(t)?"file":WC.has(t)?"thinking":ZC.has(t)||e.content!=null||e.text!=null?"text":"other"}function kc(e){return e.content??e.text??""}function qy(e){return e.toolName??e.tool??"tool"}function Wc(e){var t;return e.input??((t=e.state)==null?void 0:t.input)}function Wh(e){var t;return e.output??((t=e.state)==null?void 0:t.output)}function Zh(e){var a,r,o;const t=(r=(a=e.state)==null?void 0:a.status)==null?void 0:r.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":Wh(e)!=null?"completed":"running"}function Ux(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function $r(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 Yy(e){return e.filter(t=>$r(t.status)==="completed").length}function yo(e){const t=qy(e).toLowerCase();return t==="question"||t==="mcp_question"}function ew(e){const t=Wc(e);if(!t||typeof t!="object")return null;const a=t;return Array.isArray(a.questions)?a.questions:null}function Rc(e){if(!yo(e))return!1;const t=Zh(e);return t==="pending"||t==="running"}const tw=/\bses_[a-zA-Z0-9]+/;function nw(e){var o;const t=Wc(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 r=Wh(e);if(typeof r=="string"){const u=tw.exec(r);if(u)return u[0]}if(r&&typeof r=="object"){const u=r,c=u.session_id??u.sessionId??u.task_id;if(typeof c=="string"&&c.startsWith("ses_"))return c}return null}const aw=es(()=>({agents:[],loaded:!1}));function Gy(e){return`question-${e}`}function _m(e,t){const a=t.find(o=>o.id===e),r=(a==null?void 0:a.title)||e.slice(-8);Qt.getState().addToast(`${r} — 等待回复`,"warning",e,{id:Gy(e),persistent:!0})}function sw(e){var t;for(const a of e)if((t=a.parts)!=null&&t.some(r=>yo(r)&&Rc(r)))return!0;return!1}const No=[],To=[],Hx=[],Ir={};function Fx(e){return e.id??e.callID}function kn(){return je.getState().activeRepoId}async function zx(e,t){const a=kn();if(a)try{const[r,o]=await Promise.all([X5(a,e),Oy(a).catch(()=>null)]);t(u=>{const c={sessionLinks:{...u.sessionLinks,[e]:r}};return o&&(c.allSessionLinks=o),c})}catch{}}const $x=20,Re=es((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 r=kn();if(!r)return;const o=t().sessions.find(c=>c.id===a);if(!o)return;const u=o.completedAt?null:Date.now();e(c=>({sessions:c.sessions.map(f=>f.id===a?{...f,completedAt:u??void 0}:f)}));try{await vC(r,a,u)}catch{await t().loadSessions()}},loadSessions:async()=>{const a=kn();if(!a){e({sessions:[],loadingSessions:!1});return}e({loadingSessions:!0,loadError:null});try{const[r,o]=await Promise.all([H5(a),Oy(a).catch(()=>null)]),u={sessions:r,loadingSessions:!1};o&&(u.allSessionLinks=o),e(u)}catch(r){e({loadingSessions:!1,loadError:r instanceof Error?r.message:"Failed to load sessions"})}},createSession:async(a,r,o,u,c,f,m)=>{const h=kn();if(!h)return null;e({sendError:null});try{const b=await F5(h,a,r,o,u,c,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=>{kn()&&(e({activeSessionId:a,sendError:null}),await t().refreshSessionData(a))},refreshSessionData:async a=>{var b,g;const r=kn();if(!r)return;const u=!t().messages[a]||t().messages[a].length===0?{limit:$x}:void 0,[c,f]=await Promise.allSettled([Q5(r,a),Ax(r,a,u)]),m=c.status==="fulfilled"?c.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 C=v.findIndex(S=>S.id===h);C>=0&&(v=v.slice(0,C+1))}const A=y.messages[a]??[];v.length>=A.length&&(N.messages={...y.messages,[a]:v}),N.messagesMeta={...y.messagesMeta,[a]:{total:Math.max(f.value.total,A.length),hasMore:f.value.hasMore,loading:!1}}}return N}),f.status==="fulfilled"&&sw(f.value.messages)&&_m(a,t().sessions)},loadMoreMessages:async a=>{var f;const r=kn();if(!r)return;const o=t().messagesMeta[a];if(!(o!=null&&o.hasMore)||o.loading)return;const c=(f=(t().messages[a]??[])[0])==null?void 0:f.id;e(m=>({messagesMeta:{...m.messagesMeta,[a]:{...o,loading:!0}}}));try{const m=await Ax(r,a,{limit:$x,before:c});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}}}))}},addLink:async(a,r,o)=>{const u=kn();if(!u)return!1;try{return await W5(u,a,r,o),await zx(a,e),!0}catch{return!1}},removeLink:async(a,r,o)=>{const u=kn();if(!u)return!1;try{return await Z5(u,a,r,o),await zx(a,e),!0}catch{return!1}},deleteSession:async a=>{const r=kn();if(r)try{await z5(r,a)}catch{}delete Ir[a],e(o=>{const{[a]:u,...c}=o.messages,{[a]:f,...m}=o.messagesMeta,{[a]:h,...b}=o.todos,{[a]:g,...y}=o.sessionStatuses,{[a]:N,...v}=o.errorReasons,{[a]:A,...C}=o.queuedMessageIds,{[a]:S,...M}=o.sessionLinks,{[a]:O,...j}=o.allSessionLinks;return{sessions:o.sessions.filter(I=>I.id!==a),messages:c,messagesMeta:m,todos:b,sessionStatuses:y,errorReasons:v,queuedMessageIds:C,sessionLinks:M,allSessionLinks:j,activeSessionId:o.activeSessionId===a?null:o.activeSessionId}})},sendMessage:async(a,r,o,u)=>{const c=kn(),f=t().activeSessionId;if(!c||!f)return!1;const m=t().sessions.find(b=>b.id===f),h=t().sessionStatuses[f]==="busy";e({sendError:null}),m!=null&&m.completedAt&&e(b=>({sessions:b.sessions.map(g=>g.id===f?{...g,completedAt:void 0}:g)})),h||t().setSessionStatus(f,"busy");try{const b=aw.getState(),g=m!=null&&m.agent&&b.loaded&&b.agents.some(y=>y.name===m.agent||y.id===m.agent)?m.agent:void 0;return await $5(c,f,a,g,r,o,u),h&&(Ir[f]=(Ir[f]||0)+1),!0}catch(b){return e({sendError:b instanceof Error?b.message:"Failed to send message"}),h||t().setSessionStatus(f,"idle"),!1}},replyQuestion:async a=>{const r=kn(),o=t().activeSessionId;if(!(!r||!o))try{await Y5(r,o,a)}catch(u){e({sendError:u instanceof Error?u.message:"Failed to reply to question"})}},rejectQuestion:async()=>{const a=kn(),r=t().activeSessionId;if(!(!a||!r))try{await G5(a,r)}catch{}},abortSession:async()=>{const a=kn(),r=t().activeSessionId;if(!(!a||!r)){try{await q5(a,r)}catch{}t().setSessionStatus(r,"idle")}},clearSessions:()=>{for(const a of Object.keys(Ir))delete Ir[a];e({sessions:[],activeSessionId:null,messages:{},messagesMeta:{},todos:{},sessionStatuses:{},errorReasons:{},queuedMessageIds:{},sessionLinks:{},allSessionLinks:{},loadError:null,sendError:null})},updateMessage:(a,r)=>{var o;e(u=>{const c=u.messages[a]??[],f=c.findIndex(g=>g.id===r.id);let m,h=u.queuedMessageIds,b=u.messagesMeta;if(f>=0){const g={...c[f],...r};(!r.parts||r.parts.length===0)&&c[f].parts&&(g.parts=c[f].parts),m=[...c],m[f]=g}else{m=[...c,r];const g=b[a];g&&(b={...b,[a]:{...g,total:g.total+1}});const y=Ir[a]||0;if(r.role==="user"&&y>0){const N=[...h[a]??[]];N.push(r.id),h={...h,[a]:N},Ir[a]=y-1}else if(r.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=r.parts)!=null&&o.some(u=>yo(u)&&Rc(u))&&_m(a,t().sessions)},updateMessagePart:(a,r,o)=>{e(u=>{const c=u.messages[a]??[],f=c.findIndex(v=>v.id===r),m=f>=0?c[f]:{id:r,role:"assistant"},h=m.parts?[...m.parts]:[],b=Fx(o),g=b!=null?h.findIndex(v=>Fx(v)===b):-1;g>=0?h[g]={...h[g],...o}:h.push(o);const y={...m,parts:h},N=f>=0?[...c]:[...c,y];return f>=0&&(N[f]=y),{messages:{...u.messages,[a]:N}}}),yo(o)&&Rc(o)&&_m(a,t().sessions)},appendMessagePartDelta:(a,r,o,u)=>{e(c=>{const f=c.messages[a]??[],m=f.findIndex(v=>v.id===r),h=m>=0?f[m]:{id:r,role:"assistant"},b=h.parts?[...h.parts]:[],g=b.findIndex(v=>v.id===o);if(g>=0){const v=b[g],A=kc(v)+u;b[g]=v.content!=null?{...v,content:A}:{...v,text:A}}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:{...c.messages,[a]:N}}})},updateTodos:(a,r)=>{e(o=>({todos:{...o.todos,[a]:r}}))},updateSessionInfo:a=>{e(r=>r.sessions.some(u=>u.id===a.id)?{sessions:r.sessions.map(u=>u.id===a.id?{...u,...a}:u)}:{sessions:[a,...r.sessions]})},setSessionStatus:(a,r,o)=>{const u=t().sessionStatuses[a];if(u!==r){const c=t().sessions.find(m=>m.id===a),f=(c==null?void 0:c.title)||a.slice(-8);if(r==="idle"&&u!==void 0&&u!=="idle")Qt.getState().removeToast(Gy(a)),Qt.getState().addToast(`${f} — 完成`,"success",a);else if(r==="busy"&&(u===void 0||u==="idle"))Qt.getState().addToast(`${f} — 开始运行`,"info",a);else if(r==="retry")Qt.getState().addToast(`${f} — 进入重试`,"warning",a);else if(r==="error"){const m=o?`${f} — 错误: ${o}`:`${f} — 发生错误`;Qt.getState().addToast(m,"error",a)}}e(c=>{const f=o?{...c.errorReasons,[a]:o}:r!=="error"?(()=>{const{[a]:m,...h}=c.errorReasons;return h})():c.errorReasons;return{sessionStatuses:{...c.sessionStatuses,[a]:r},errorReasons:f}})},bulkSetStatuses:a=>{e({sessionStatuses:{...t().sessionStatuses,...a}})},renameSession:async(a,r)=>{const o=kn();if(o){e(u=>({sessions:u.sessions.map(c=>c.id===a?{...c,title:r}:c)}));try{await _C(o,a,r)}catch{await t().loadSessions()}}},revertToMessage:async(a,r)=>{const o=kn();if(!o)return!1;try{return await K5(o,a,r),await t().refreshSessionData(a),!0}catch{return!1}}})),Ve=es((e,t)=>({issues:[],tags:[],tagFilterMode:new Map,milestones:[],selectedMilestoneId:null,loaded:!1,syncing:!1,selectedIssueId:null,viewingIssueId:null,viewingTreeRootId:null,matchingParentId:null,matchingCandidateId:null,clearIssues:()=>e({issues:[],tags:[],tagFilterMode:new Map,milestones:[],selectedMilestoneId:null,loaded:!1,selectedIssueId:null,viewingIssueId:null,viewingTreeRootId:null,matchingParentId:null,matchingCandidateId:null}),setSelectedIssue:a=>e({selectedIssueId:a}),setViewingIssue:(a,r)=>e({viewingIssueId:a,viewingTreeRootId:r??null}),enterMatchMode:a=>e({matchingParentId:a,matchingCandidateId:null}),exitMatchMode:()=>{e({matchingParentId:null,matchingCandidateId:null})},linkChild:async(a,r)=>{var u;const o=je.getState().activeRepoId;if(!o)return!1;try{await dC(o,a,r);const c=(u=t().issues.find(f=>f.number===a))==null?void 0:u.id;return c&&e(f=>({issues:f.issues.map(m=>m.number===r?{...m,parentId:c}:m),matchingCandidateId:null})),!0}catch{return!1}},updateIssueState:async(a,r)=>{const o=je.getState().activeRepoId;if(!o)return!1;try{const u=await By(o,a,{state:r});return e(c=>({issues:c.issues.map(f=>f.number===a?{...f,state:u.state}:f)})),!0}catch{return!1}},loadIssues:async()=>{const a=je.getState().activeRepoId;if(!a){e({issues:[],loaded:!0});return}try{const r=await Rx(a,"all");e({issues:r,loaded:!0})}catch{e({loaded:!0})}},syncIssues:async()=>{const a=je.getState().activeRepoId;if(a){e({syncing:!0});try{await uC(a,"open");const[r,o,u]=await Promise.all([Rx(a,"all"),wx(a),kx(a)]);e({issues:r,tags:o,milestones:u,syncing:!1})}catch(r){e({syncing:!1});let o="同步 Issue 失败";if(r instanceof Ss)try{const u=JSON.parse(r.message);u.error&&(o=u.error)}catch{r.message&&(o=r.message)}Qt.getState().addToast(o,"error")}}},createIssue:async(a,r)=>{const o=je.getState().activeRepoId;if(!o)return null;try{const u=await cC(o,a,r);return e(c=>({issues:[u,...c.issues]})),u}catch{return null}},loadTags:async()=>{const a=je.getState().activeRepoId;if(!a){e({tags:[]});return}try{const r=await wx(a);e({tags:r})}catch{}},cycleTagFilter:a=>{e(r=>{const o=new Map(r.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=je.getState().activeRepoId;if(!a){e({milestones:[]});return}try{const r=await kx(a);e({milestones:r})}catch{}},setMilestoneFilter:a=>e({selectedMilestoneId:a})})),xc=es(e=>({drafts:{},setDraft:(t,a)=>e(r=>{if(!a.trim()){const{[t]:o,...u}=r.drafts;return{drafts:u}}return{drafts:{...r.drafts,[t]:a}}}),clearDraft:t=>e(a=>{const{[t]:r,...o}=a.drafts;return{drafts:o}})}));function qx(e){const t=[],a=String(e||"");let r=a.indexOf(","),o=0,u=!1;for(;!u;){r===-1&&(r=a.length,u=!0);const c=a.slice(o,r).trim();(c||!u)&&t.push(c),o=r+1,r=a.indexOf(",",o)}return t}function Ky(e,t){const a={};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const rw=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,iw=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lw={};function Yx(e,t){return(lw.jsx?iw:rw).test(e)}const ow=/[ \t\n\f\r]/g;function uw(e){return typeof e=="object"?e.type==="text"?Gx(e.value):!1:Gx(e)}function Gx(e){return e.replace(ow,"")===""}class Io{constructor(t,a,r){this.normal=a,this.property=t,r&&(this.space=r)}}Io.prototype.normal={};Io.prototype.property={};Io.prototype.space=void 0;function Vy(e,t){const a={},r={};for(const o of e)Object.assign(a,o.property),Object.assign(r,o.normal);return new Io(a,r,t)}function _o(e){return e.toLowerCase()}class ra{constructor(t,a){this.attribute=a,this.property=t}}ra.prototype.attribute="";ra.prototype.booleanish=!1;ra.prototype.boolean=!1;ra.prototype.commaOrSpaceSeparated=!1;ra.prototype.commaSeparated=!1;ra.prototype.defined=!1;ra.prototype.mustUseProperty=!1;ra.prototype.number=!1;ra.prototype.overloadedBoolean=!1;ra.prototype.property="";ra.prototype.spaceSeparated=!1;ra.prototype.space=void 0;let cw=0;const Xe=Gr(),rn=Gr(),uh=Gr(),_e=Gr(),Rt=Gr(),Ur=Gr(),ga=Gr();function Gr(){return 2**++cw}const ch=Object.freeze(Object.defineProperty({__proto__:null,boolean:Xe,booleanish:rn,commaOrSpaceSeparated:ga,commaSeparated:Ur,number:_e,overloadedBoolean:uh,spaceSeparated:Rt},Symbol.toStringTag,{value:"Module"})),vm=Object.keys(ch);class Jh extends ra{constructor(t,a,r,o){let u=-1;if(super(t,a),Kx(this,"space",o),typeof r=="number")for(;++u<vm.length;){const c=vm[u];Kx(this,vm[u],(r&ch[c])===ch[c])}}}Jh.prototype.defined=!0;function Kx(e,t,a){a&&(e[t]=a)}function Zi(e){const t={},a={};for(const[r,o]of Object.entries(e.properties)){const u=new Jh(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(u.mustUseProperty=!0),t[r]=u,a[_o(r)]=r,a[_o(u.attribute)]=r}return new Io(t,a,e.space)}const Xy=Zi({properties:{ariaActiveDescendant:null,ariaAtomic:rn,ariaAutoComplete:null,ariaBusy:rn,ariaChecked:rn,ariaColCount:_e,ariaColIndex:_e,ariaColSpan:_e,ariaControls:Rt,ariaCurrent:null,ariaDescribedBy:Rt,ariaDetails:null,ariaDisabled:rn,ariaDropEffect:Rt,ariaErrorMessage:null,ariaExpanded:rn,ariaFlowTo:Rt,ariaGrabbed:rn,ariaHasPopup:null,ariaHidden:rn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Rt,ariaLevel:_e,ariaLive:null,ariaModal:rn,ariaMultiLine:rn,ariaMultiSelectable:rn,ariaOrientation:null,ariaOwns:Rt,ariaPlaceholder:null,ariaPosInSet:_e,ariaPressed:rn,ariaReadOnly:rn,ariaRelevant:null,ariaRequired:rn,ariaRoleDescription:Rt,ariaRowCount:_e,ariaRowIndex:_e,ariaRowSpan:_e,ariaSelected:rn,ariaSetSize:_e,ariaSort:null,ariaValueMax:_e,ariaValueMin:_e,ariaValueNow:_e,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Qy(e,t){return t in e?e[t]:t}function Wy(e,t){return Qy(e,t.toLowerCase())}const dw=Zi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ur,acceptCharset:Rt,accessKey:Rt,action:null,allow:null,allowFullScreen:Xe,allowPaymentRequest:Xe,allowUserMedia:Xe,alpha:Xe,alt:null,as:null,async:Xe,autoCapitalize:null,autoComplete:Rt,autoFocus:Xe,autoPlay:Xe,blocking:Rt,capture:null,charSet:null,checked:Xe,cite:null,className:Rt,closedBy:null,colorSpace:null,cols:_e,colSpan:_e,command:null,commandFor:null,content:null,contentEditable:rn,controls:Xe,controlsList:Rt,coords:_e|Ur,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Xe,defer:Xe,dir:null,dirName:null,disabled:Xe,download:uh,draggable:rn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Xe,formTarget:null,headers:Rt,height:_e,hidden:uh,high:_e,href:null,hrefLang:null,htmlFor:Rt,httpEquiv:Rt,id:null,imageSizes:null,imageSrcSet:null,inert:Xe,inputMode:null,integrity:null,is:null,isMap:Xe,itemId:null,itemProp:Rt,itemRef:Rt,itemScope:Xe,itemType:Rt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Xe,low:_e,manifest:null,max:null,maxLength:_e,media:null,method:null,min:null,minLength:_e,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:_e,pattern:null,ping:Rt,placeholder:null,playsInline:Xe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Xe,referrerPolicy:null,rel:Rt,required:Xe,reversed:Xe,rows:_e,rowSpan:_e,sandbox:Rt,scope:null,scoped:Xe,seamless:Xe,selected:Xe,shadowRootClonable:Xe,shadowRootCustomElementRegistry:Xe,shadowRootDelegatesFocus:Xe,shadowRootMode:null,shadowRootSerializable:Xe,shape:null,size:_e,sizes:null,slot:null,span:_e,spellCheck:rn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:_e,step:null,style:null,tabIndex:_e,target:null,title:null,translate:null,type:null,typeMustMatch:Xe,useMap:null,value:rn,width:_e,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Rt,axis:null,background:null,bgColor:null,border:_e,borderColor:null,bottomMargin:_e,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:_e,leftMargin:_e,link:null,longDesc:null,lowSrc:null,marginHeight:_e,marginWidth:_e,noResize:Xe,noHref:Xe,noShade:Xe,noWrap:Xe,object:null,profile:null,prompt:null,rev:null,rightMargin:_e,rules:null,scheme:null,scrolling:rn,standby:null,summary:null,text:null,topMargin:_e,valueType:null,version:null,vAlign:null,vLink:null,vSpace:_e,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Xe,disablePictureInPicture:Xe,disableRemotePlayback:Xe,exportParts:Ur,part:Rt,prefix:null,property:null,results:_e,security:null,unselectable:null},space:"html",transform:Wy}),fw=Zi({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:ga,accentHeight:_e,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:_e,amplitude:_e,arabicForm:null,ascent:_e,attributeName:null,attributeType:null,azimuth:_e,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:_e,by:null,calcMode:null,capHeight:_e,className:Rt,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:_e,diffuseConstant:_e,direction:null,display:null,dur:null,divisor:_e,dominantBaseline:null,download:Xe,dx:null,dy:null,edgeMode:null,editable:null,elevation:_e,enableBackground:null,end:null,event:null,exponent:_e,externalResourcesRequired:null,fill:null,fillOpacity:_e,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:Ur,g2:Ur,glyphName:Ur,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:_e,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:_e,horizOriginX:_e,horizOriginY:_e,id:null,ideographic:_e,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:_e,k:_e,k1:_e,k2:_e,k3:_e,k4:_e,kernelMatrix:ga,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:_e,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:_e,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:_e,overlineThickness:_e,paintOrder:null,panose1:null,path:null,pathLength:_e,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Rt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:_e,pointsAtY:_e,pointsAtZ:_e,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ga,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ga,rev:ga,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ga,requiredFeatures:ga,requiredFonts:ga,requiredFormats:ga,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:_e,specularExponent:_e,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:_e,strikethroughThickness:_e,string:null,stroke:null,strokeDashArray:ga,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:_e,strokeOpacity:_e,strokeWidth:null,style:null,surfaceScale:_e,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ga,tabIndex:_e,tableValues:null,target:null,targetX:_e,targetY:_e,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ga,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:_e,underlineThickness:_e,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:_e,values:null,vAlphabetic:_e,vMathematical:_e,vectorEffect:null,vHanging:_e,vIdeographic:_e,version:null,vertAdvY:_e,vertOriginX:_e,vertOriginY:_e,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:_e,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Qy}),Zy=Zi({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()}}),Jy=Zi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Wy}),eN=Zi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),mw={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"},hw=/[A-Z]/g,Vx=/-[a-z]/g,pw=/^data[-\w.:]+$/i;function Zc(e,t){const a=_o(t);let r=t,o=ra;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&pw.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(Vx,bw);r="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!Vx.test(u)){let c=u.replace(hw,gw);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}o=Jh}return new o(r,t)}function gw(e){return"-"+e.toLowerCase()}function bw(e){return e.charAt(1).toUpperCase()}const Mo=Vy([Xy,dw,Zy,Jy,eN],"html"),ur=Vy([Xy,fw,Zy,Jy,eN],"svg");function Xx(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function tN(e){return e.join(" ").trim()}var Di={},Sm,Qx;function xw(){if(Qx)return Sm;Qx=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,a=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
463
- `,h="/",b="*",g="",y="comment",N="declaration";function v(C,S){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];S=S||{};var M=1,O=1;function j(Q){var q=Q.match(t);q&&(M+=q.length);var F=Q.lastIndexOf(m);O=~F?Q.length-F:O+Q.length}function I(){var Q={line:M,column:O};return function(q){return q.position=new U(Q),K(),q}}function U(Q){this.start=Q,this.end={line:M,column:O},this.source=S.source}U.prototype.content=C;function $(Q){var q=new Error(S.source+":"+M+":"+O+": "+Q);if(q.reason=Q,q.filename=S.source,q.line=M,q.column=O,q.source=C,!S.silent)throw q}function Z(Q){var q=Q.exec(C);if(q){var F=q[0];return j(F),C=C.slice(F.length),q}}function K(){Z(a)}function D(Q){var q;for(Q=Q||[];q=te();)q!==!1&&Q.push(q);return Q}function te(){var Q=I();if(!(h!=C.charAt(0)||b!=C.charAt(1))){for(var q=2;g!=C.charAt(q)&&(b!=C.charAt(q)||h!=C.charAt(q+1));)++q;if(q+=2,g===C.charAt(q-1))return $("End of comment missing");var F=C.slice(2,q-2);return O+=2,j(F),C=C.slice(q),O+=2,Q({type:y,comment:F})}}function le(){var Q=I(),q=Z(r);if(q){if(te(),!Z(o))return $("property missing ':'");var F=Z(u),k=Q({type:N,property:A(q[0].replace(e,g)),value:F?A(F[0].replace(e,g)):g});return Z(c),k}}function pe(){var Q=[];D(Q);for(var q;q=le();)q!==!1&&(Q.push(q),D(Q));return Q}return K(),pe()}function A(C){return C?C.replace(f,g):g}return Sm=v,Sm}var Wx;function Ew(){if(Wx)return Di;Wx=1;var e=Di&&Di.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Di,"__esModule",{value:!0}),Di.default=a;const t=e(xw());function a(r,o){let u=null;if(!r||typeof r!="string")return u;const c=(0,t.default)(r),f=typeof o=="function";return c.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 Jl={},Zx;function yw(){if(Zx)return Jl;Zx=1,Object.defineProperty(Jl,"__esModule",{value:!0}),Jl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,a=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,u=function(h){return!h||a.test(h)||e.test(h)},c=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(r,f),h.replace(t,c))};return Jl.camelCase=m,Jl}var eo,Jx;function Nw(){if(Jx)return eo;Jx=1;var e=eo&&eo.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(Ew()),a=yw();function r(o,u){var c={};return!o||typeof o!="string"||(0,t.default)(o,function(f,m){f&&m&&(c[(0,a.camelCase)(f,u)]=m)}),c}return r.default=r,eo=r,eo}var Tw=Nw();const _w=zc(Tw),Jc=nN("end"),ts=nN("start");function nN(e){return t;function t(a){const r=a&&a.position&&a.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function vw(e){const t=ts(e),a=Jc(e);if(t&&a)return{start:t,end:a}}function oo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?e1(e.position):"start"in e||"end"in e?e1(e):"line"in e||"column"in e?dh(e):""}function dh(e){return t1(e&&e.line)+":"+t1(e&&e.column)}function e1(e){return dh(e&&e.start)+"-"+dh(e&&e.end)}function t1(e){return e&&typeof e=="number"?e:1}class In extends Error{constructor(t,a,r){super(),typeof a=="string"&&(r=a,a=void 0);let o="",u={},c=!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&&(c=!0,o=t.message,u.cause=t),!u.ruleId&&!u.source&&typeof r=="string"){const m=r.indexOf(":");m===-1?u.ruleId=r:(u.source=r.slice(0,m),u.ruleId=r.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=oo(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=c&&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}}In.prototype.file="";In.prototype.name="";In.prototype.reason="";In.prototype.message="";In.prototype.stack="";In.prototype.column=void 0;In.prototype.line=void 0;In.prototype.ancestors=void 0;In.prototype.cause=void 0;In.prototype.fatal=void 0;In.prototype.place=void 0;In.prototype.ruleId=void 0;In.prototype.source=void 0;const ep={}.hasOwnProperty,Sw=new Map,Aw=/[A-Z]/g,Cw=new Set(["table","tbody","thead","tfoot","tr"]),ww=new Set(["td","th"]),aN="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function kw(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Bw(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");r=jw(a,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ur:Mo,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},u=sN(o,e,void 0);return u&&typeof u!="string"?u:o.create(e,o.Fragment,{children:u||void 0},void 0)}function sN(e,t,a){if(t.type==="element")return Rw(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Ow(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Mw(e,t,a);if(t.type==="mdxjsEsm")return Iw(e,t);if(t.type==="root")return Dw(e,t,a);if(t.type==="text")return Lw(e,t)}function Rw(e,t,a){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=ur,e.schema=o),e.ancestors.push(t);const u=iN(e,t.tagName,!1),c=Pw(e,t);let f=np(e,t);return Cw.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!uw(m):!0})),rN(e,c,u,t),tp(c,f),e.ancestors.pop(),e.schema=r,e.create(t,u,c,a)}function Ow(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}vo(e,t.position)}function Iw(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);vo(e,t.position)}function Mw(e,t,a){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=ur,e.schema=o),e.ancestors.push(t);const u=t.name===null?e.Fragment:iN(e,t.name,!0),c=Uw(e,t),f=np(e,t);return rN(e,c,u,t),tp(c,f),e.ancestors.pop(),e.schema=r,e.create(t,u,c,a)}function Dw(e,t,a){const r={};return tp(r,np(e,t)),e.create(t,e.Fragment,r,a)}function Lw(e,t){return t.value}function rN(e,t,a,r){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(t.node=r)}function tp(e,t){if(t.length>0){const a=t.length>1?t:t[0];a&&(e.children=a)}}function jw(e,t,a){return r;function r(o,u,c,f){const h=Array.isArray(c.children)?a:t;return f?h(u,c,f):h(u,c)}}function Bw(e,t){return a;function a(r,o,u,c){const f=Array.isArray(u.children),m=ts(r);return t(o,u,c,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function Pw(e,t){const a={};let r,o;for(o in t.properties)if(o!=="children"&&ep.call(t.properties,o)){const u=Hw(e,o,t.properties[o]);if(u){const[c,f]=u;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&ww.has(t.tagName)?r=f:a[c]=f}}if(r){const u=a.style||(a.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return a}function Uw(e,t){const a={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const u=r.data.estree.body[0];u.type;const c=u.expression;c.type;const f=c.properties[0];f.type,Object.assign(a,e.evaluater.evaluateExpression(f.argument))}else vo(e,t.position);else{const o=r.name;let u;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const f=r.value.data.estree.body[0];f.type,u=e.evaluater.evaluateExpression(f.expression)}else vo(e,t.position);else u=r.value===null?!0:r.value;a[o]=u}return a}function np(e,t){const a=[];let r=-1;const o=e.passKeys?new Map:Sw;for(;++r<t.children.length;){const u=t.children[r];let c;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;c=m+"-"+h,o.set(m,h+1)}}const f=sN(e,u,c);f!==void 0&&a.push(f)}return a}function Hw(e,t,a){const r=Zc(e.schema,t);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=r.commaSeparated?Ky(a):tN(a)),r.property==="style"){let o=typeof a=="object"?a:Fw(e,String(a));return e.stylePropertyNameCase==="css"&&(o=zw(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?mw[r.property]||r.property:r.attribute,a]}}function Fw(e,t){try{return _w(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const r=a,o=new In("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=aN+"#cannot-parse-style-attribute",o}}function iN(e,t,a){let r;if(!a)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let u=-1,c;for(;++u<o.length;){const f=Yx(o[u])?{type:"Identifier",name:o[u]}:{type:"Literal",value:o[u]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(u&&f.type==="Literal"),optional:!1}:f}r=c}else r=Yx(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return ep.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);vo(e)}function vo(e,t){const a=new In("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=aN+"#cannot-handle-mdx-estrees-without-createevaluater",a}function zw(e){const t={};let a;for(a in e)ep.call(e,a)&&(t[$w(a)]=e[a]);return t}function $w(e){let t=e.replace(Aw,qw);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function qw(e){return"-"+e.toLowerCase()}const Am={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"]},Yw={};function ap(e,t){const a=Yw,r=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,o=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return lN(e,r,o)}function lN(e,t,a){if(Gw(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 n1(e.children,t,a)}return Array.isArray(e)?n1(e,t,a):""}function n1(e,t,a){const r=[];let o=-1;for(;++o<e.length;)r[o]=lN(e[o],t,a);return r.join("")}function Gw(e){return!!(e&&typeof e=="object")}const a1=document.createElement("i");function sp(e){const t="&"+e+";";a1.innerHTML=t;const a=a1.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===t?!1:a}function xa(e,t,a,r){const o=e.length;let u=0,c;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,a=a>0?a:0,r.length<1e4)c=Array.from(r),c.unshift(t,a),e.splice(...c);else for(a&&e.splice(t,a);u<r.length;)c=r.slice(u,u+1e4),c.unshift(t,0),e.splice(...c),u+=1e4,t+=1e4}function ka(e,t){return e.length>0?(xa(e,e.length,0,t),e):t}const s1={}.hasOwnProperty;function oN(e){const t={};let a=-1;for(;++a<e.length;)Kw(t,e[a]);return t}function Kw(e,t){let a;for(a in t){const o=(s1.call(e,a)?e[a]:void 0)||(e[a]={}),u=t[a];let c;if(u)for(c in u){s1.call(o,c)||(o[c]=[]);const f=u[c];Vw(o[c],Array.isArray(f)?f:f?[f]:[])}}}function Vw(e,t){let a=-1;const r=[];for(;++a<t.length;)(t[a].add==="after"?e:r).push(t[a]);xa(e,0,0,r)}function uN(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 Ha(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Fn=cr(/[A-Za-z]/),Rn=cr(/[\dA-Za-z]/),Xw=cr(/[#-'*+\--9=?A-Z^-~]/);function Oc(e){return e!==null&&(e<32||e===127)}const fh=cr(/\d/),Qw=cr(/[\dA-Fa-f]/),Ww=cr(/[!-/:-@[-`{-~]/);function Fe(e){return e!==null&&e<-2}function Ot(e){return e!==null&&(e<0||e===32)}function it(e){return e===-2||e===-1||e===32}const ed=cr(new RegExp("\\p{P}|\\p{S}","u")),qr=cr(/\s/);function cr(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function Ji(e){const t=[];let a=-1,r=0,o=0;for(;++a<e.length;){const u=e.charCodeAt(a);let c="";if(u===37&&Rn(e.charCodeAt(a+1))&&Rn(e.charCodeAt(a+2)))o=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(c=String.fromCharCode(u));else if(u>55295&&u<57344){const f=e.charCodeAt(a+1);u<56320&&f>56319&&f<57344?(c=String.fromCharCode(u,f),o=1):c="�"}else c=String.fromCharCode(u);c&&(t.push(e.slice(r,a),encodeURIComponent(c)),r=a+o+1,c=""),o&&(a+=o,o=0)}return t.join("")+e.slice(r)}function ft(e,t,a,r){const o=r?r-1:Number.POSITIVE_INFINITY;let u=0;return c;function c(m){return it(m)?(e.enter(a),f(m)):t(m)}function f(m){return it(m)&&u++<o?(e.consume(m),f):(e.exit(a),t(m))}}const Zw={tokenize:Jw};function Jw(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let a;return t;function r(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,c(f)}function c(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Fe(f)?(e.consume(f),e.exit("chunkText"),u):(e.consume(f),c)}}const ek={tokenize:tk},r1={tokenize:nk};function tk(e){const t=this,a=[];let r=0,o,u,c;return f;function f(O){if(r<a.length){const j=a[r];return t.containerState=j[1],e.attempt(j[0].continuation,m,h)(O)}return h(O)}function m(O){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&M();const j=t.events.length;let I=j,U;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){U=t.events[I][1].end;break}S(r);let $=j;for(;$<t.events.length;)t.events[$][1].end={...U},$++;return xa(t.events,I+1,0,t.events.slice(j)),t.events.length=$,h(O)}return f(O)}function h(O){if(r===a.length){if(!o)return y(O);if(o.currentConstruct&&o.currentConstruct.concrete)return v(O);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(r1,b,g)(O)}function b(O){return o&&M(),S(r),y(O)}function g(O){return t.parser.lazy[t.now().line]=r!==a.length,c=t.now().offset,v(O)}function y(O){return t.containerState={},e.attempt(r1,N,v)(O)}function N(O){return r++,a.push([t.currentConstruct,t.containerState]),y(O)}function v(O){if(O===null){o&&M(),S(0),e.consume(O);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:u}),A(O)}function A(O){if(O===null){C(e.exit("chunkFlow"),!0),S(0),e.consume(O);return}return Fe(O)?(e.consume(O),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,f):(e.consume(O),A)}function C(O,j){const I=t.sliceStream(O);if(j&&I.push(null),O.previous=u,u&&(u.next=O),u=O,o.defineSkip(O.start),o.write(I),t.parser.lazy[O.start.line]){let U=o.events.length;for(;U--;)if(o.events[U][1].start.offset<c&&(!o.events[U][1].end||o.events[U][1].end.offset>c))return;const $=t.events.length;let Z=$,K,D;for(;Z--;)if(t.events[Z][0]==="exit"&&t.events[Z][1].type==="chunkFlow"){if(K){D=t.events[Z][1].end;break}K=!0}for(S(r),U=$;U<t.events.length;)t.events[U][1].end={...D},U++;xa(t.events,Z+1,0,t.events.slice($)),t.events.length=U}}function S(O){let j=a.length;for(;j-- >O;){const I=a[j];t.containerState=I[1],I[0].exit.call(t,e)}a.length=O}function M(){o.write([null]),u=void 0,o=void 0,t.containerState._closeFlow=void 0}}function nk(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 $i(e){if(e===null||Ot(e)||qr(e))return 1;if(ed(e))return 2}function td(e,t,a){const r=[];let o=-1;for(;++o<e.length;){const u=e[o].resolveAll;u&&!r.includes(u)&&(t=u(t,a),r.push(u))}return t}const mh={name:"attention",resolveAll:ak,tokenize:sk};function ak(e,t){let a=-1,r,o,u,c,f,m,h,b;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(r=a;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[r][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;m=e[r][1].end.offset-e[r][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;const g={...e[r][1].end},y={...e[a][1].start};i1(g,-m),i1(y,m),c={type:m>1?"strongSequence":"emphasisSequence",start:g,end:{...e[r][1].end}},f={type:m>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:y},u={type:m>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[a][1].start}},o={type:m>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},e[r][1].end={...c.start},e[a][1].start={...f.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=ka(h,[["enter",e[r][1],t],["exit",e[r][1],t]])),h=ka(h,[["enter",o,t],["enter",c,t],["exit",c,t],["enter",u,t]]),h=ka(h,td(t.parser.constructs.insideSpan.null,e.slice(r+1,a),t)),h=ka(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=ka(h,[["enter",e[a][1],t],["exit",e[a][1],t]])):b=0,xa(e,r-1,a-r+3,h),a=r+h.length-b-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function sk(e,t){const a=this.parser.constructs.attentionMarkers.null,r=this.previous,o=$i(r);let u;return c;function c(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=$i(m),g=!b||b===2&&o||a.includes(m),y=!o||o===2&&b||a.includes(r);return h._open=!!(u===42?g:g&&(o||!y)),h._close=!!(u===42?y:y&&(b||!g)),t(m)}}function i1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const rk={name:"autolink",tokenize:ik};function ik(e,t,a){let r=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 Fn(N)?(e.consume(N),c):N===64?a(N):h(N)}function c(N){return N===43||N===45||N===46||Rn(N)?(r=1,f(N)):h(N)}function f(N){return N===58?(e.consume(N),r=0,m):(N===43||N===45||N===46||Rn(N))&&r++<32?(e.consume(N),f):(r=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):Xw(N)?(e.consume(N),h):a(N)}function b(N){return Rn(N)?g(N):a(N)}function g(N){return N===46?(e.consume(N),r=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||Rn(N))&&r++<63){const v=N===45?y:g;return e.consume(N),v}return a(N)}}const Do={partial:!0,tokenize:lk};function lk(e,t,a){return r;function r(u){return it(u)?ft(e,o,"linePrefix")(u):o(u)}function o(u){return u===null||Fe(u)?t(u):a(u)}}const cN={continuation:{tokenize:uk},exit:ck,name:"blockQuote",tokenize:ok};function ok(e,t,a){const r=this;return o;function o(c){if(c===62){const f=r.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),u}return a(c)}function u(c){return it(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function uk(e,t,a){const r=this;return o;function o(c){return it(c)?ft(e,u,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):u(c)}function u(c){return e.attempt(cN,t,a)(c)}}function ck(e){e.exit("blockQuote")}const dN={name:"characterEscape",tokenize:dk};function dk(e,t,a){return r;function r(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),o}function o(u){return Ww(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):a(u)}}const fN={name:"characterReference",tokenize:fk};function fk(e,t,a){const r=this;let o=0,u,c;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,c=Rn,b(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,c=Qw,b):(e.enter("characterReferenceValue"),u=7,c=fh,b(g))}function b(g){if(g===59&&o){const y=e.exit("characterReferenceValue");return c===Rn&&!sp(r.sliceSerialize(y))?a(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(g)&&o++<u?(e.consume(g),b):a(g)}}const l1={partial:!0,tokenize:hk},o1={concrete:!0,name:"codeFenced",tokenize:mk};function mk(e,t,a){const r=this,o={partial:!0,tokenize:I};let u=0,c=0,f;return m;function m(U){return h(U)}function h(U){const $=r.events[r.events.length-1];return u=$&&$[1].type==="linePrefix"?$[2].sliceSerialize($[1],!0).length:0,f=U,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),b(U)}function b(U){return U===f?(c++,e.consume(U),b):c<3?a(U):(e.exit("codeFencedFenceSequence"),it(U)?ft(e,g,"whitespace")(U):g(U))}function g(U){return U===null||Fe(U)?(e.exit("codeFencedFence"),r.interrupt?t(U):e.check(l1,A,j)(U)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(U))}function y(U){return U===null||Fe(U)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(U)):it(U)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ft(e,N,"whitespace")(U)):U===96&&U===f?a(U):(e.consume(U),y)}function N(U){return U===null||Fe(U)?g(U):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(U))}function v(U){return U===null||Fe(U)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(U)):U===96&&U===f?a(U):(e.consume(U),v)}function A(U){return e.attempt(o,j,C)(U)}function C(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),S}function S(U){return u>0&&it(U)?ft(e,M,"linePrefix",u+1)(U):M(U)}function M(U){return U===null||Fe(U)?e.check(l1,A,j)(U):(e.enter("codeFlowValue"),O(U))}function O(U){return U===null||Fe(U)?(e.exit("codeFlowValue"),M(U)):(e.consume(U),O)}function j(U){return e.exit("codeFenced"),t(U)}function I(U,$,Z){let K=0;return D;function D(q){return U.enter("lineEnding"),U.consume(q),U.exit("lineEnding"),te}function te(q){return U.enter("codeFencedFence"),it(q)?ft(U,le,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):le(q)}function le(q){return q===f?(U.enter("codeFencedFenceSequence"),pe(q)):Z(q)}function pe(q){return q===f?(K++,U.consume(q),pe):K>=c?(U.exit("codeFencedFenceSequence"),it(q)?ft(U,Q,"whitespace")(q):Q(q)):Z(q)}function Q(q){return q===null||Fe(q)?(U.exit("codeFencedFence"),$(q)):Z(q)}}}function hk(e,t,a){const r=this;return o;function o(c){return c===null?a(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u)}function u(c){return r.parser.lazy[r.now().line]?a(c):t(c)}}const Cm={name:"codeIndented",tokenize:gk},pk={partial:!0,tokenize:bk};function gk(e,t,a){const r=this;return o;function o(h){return e.enter("codeIndented"),ft(e,u,"linePrefix",5)(h)}function u(h){const b=r.events[r.events.length-1];return b&&b[1].type==="linePrefix"&&b[2].sliceSerialize(b[1],!0).length>=4?c(h):a(h)}function c(h){return h===null?m(h):Fe(h)?e.attempt(pk,c,m)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||Fe(h)?(e.exit("codeFlowValue"),c(h)):(e.consume(h),f)}function m(h){return e.exit("codeIndented"),t(h)}}function bk(e,t,a){const r=this;return o;function o(c){return r.parser.lazy[r.now().line]?a(c):Fe(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):ft(e,u,"linePrefix",5)(c)}function u(c){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):Fe(c)?o(c):a(c)}}const xk={name:"codeText",previous:yk,resolve:Ek,tokenize:Nk};function Ek(e){let t=e.length-4,a=3,r,o;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=a;++r<t;)if(e[r][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[t][1].type="codeTextPadding",a+=2,t-=2;break}}for(r=a-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function yk(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Nk(e,t,a){let r=0,o,u;return c;function c(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),r++,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)):Fe(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||Fe(g)?(e.exit("codeTextData"),m(g)):(e.consume(g),h)}function b(g){return g===96?(e.consume(g),o++,b):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(u.type="codeTextData",h(g))}}class Tk{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 r=a??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,a,r){const o=a||0;this.setCursor(Math.trunc(t));const u=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&to(this.left,r),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),to(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),to(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);to(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);to(this.left,a.reverse())}}}function to(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 mN(e){const t={};let a=-1,r,o,u,c,f,m,h;const b=new Tk(e);for(;++a<b.length;){for(;a in t;)a=t[a];if(r=b.get(a),a&&r[1].type==="chunkFlow"&&b.get(a-1)[1].type==="listItemPrefix"&&(m=r[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(r[0]==="enter")r[1].contentType&&(Object.assign(t,_k(b,a)),a=t[a],h=!0);else if(r[1]._container){for(u=a,o=void 0;u--;)if(c=b.get(u),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(o&&(b.get(o)[1].type="lineEndingBlank"),c[1].type="lineEnding",o=u);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;o&&(r[1].end={...b.get(o)[1].start},f=b.slice(o,a),f.unshift(r),b.splice(o,a-o+1,f))}}return xa(e,0,Number.POSITIVE_INFINITY,b.slice(0)),!h}function _k(e,t){const a=e.get(t)[1],r=e.get(t)[2];let o=t-1;const u=[];let c=a._tokenizer;c||(c=r.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,m=[],h={};let b,g,y=-1,N=a,v=0,A=0;const C=[A];for(;N;){for(;e.get(++o)[1]!==N;);u.push(o),N._tokenizer||(b=r.sliceStream(N),N.next||b.push(null),g&&c.defineSkip(N.start),N._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(b),N._isInFirstContentOfListItem&&(c._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&&(A=y+1,C.push(A),N._tokenizer=void 0,N.previous=void 0,N=N.next);for(c.events=[],N?(N._tokenizer=void 0,N.previous=void 0):C.pop(),y=C.length;y--;){const S=f.slice(C[y],C[y+1]),M=u.pop();m.push([M,M+S.length-1]),e.splice(M,2,S)}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 vk={resolve:Ak,tokenize:Ck},Sk={partial:!0,tokenize:wk};function Ak(e){return mN(e),e}function Ck(e,t){let a;return r;function r(f){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),o(f)}function o(f){return f===null?u(f):Fe(f)?e.check(Sk,c,u)(f):(e.consume(f),o)}function u(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function c(f){return e.consume(f),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,o}}function wk(e,t,a){const r=this;return o;function o(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),ft(e,u,"linePrefix")}function u(c){if(c===null||Fe(c))return a(c);const f=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):e.interrupt(r.parser.constructs.flow,a,t)(c)}}function hN(e,t,a,r,o,u,c,f,m){const h=m||Number.POSITIVE_INFINITY;let b=0;return g;function g(S){return S===60?(e.enter(r),e.enter(o),e.enter(u),e.consume(S),e.exit(u),y):S===null||S===32||S===41||Oc(S)?a(S):(e.enter(r),e.enter(c),e.enter(f),e.enter("chunkString",{contentType:"string"}),A(S))}function y(S){return S===62?(e.enter(u),e.consume(S),e.exit(u),e.exit(o),e.exit(r),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),N(S))}function N(S){return S===62?(e.exit("chunkString"),e.exit(f),y(S)):S===null||S===60||Fe(S)?a(S):(e.consume(S),S===92?v:N)}function v(S){return S===60||S===62||S===92?(e.consume(S),N):N(S)}function A(S){return!b&&(S===null||S===41||Ot(S))?(e.exit("chunkString"),e.exit(f),e.exit(c),e.exit(r),t(S)):b<h&&S===40?(e.consume(S),b++,A):S===41?(e.consume(S),b--,A):S===null||S===32||S===40||Oc(S)?a(S):(e.consume(S),S===92?C:A)}function C(S){return S===40||S===41||S===92?(e.consume(S),A):A(S)}}function pN(e,t,a,r,o,u){const c=this;let f=0,m;return h;function h(N){return e.enter(r),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 c.parser.constructs?a(N):N===93?(e.exit(u),e.enter(o),e.consume(N),e.exit(o),e.exit(r),t):Fe(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||Fe(N)||f++>999?(e.exit("chunkString"),b(N)):(e.consume(N),m||(m=!it(N)),N===92?y:g)}function y(N){return N===91||N===92||N===93?(e.consume(N),f++,g):g(N)}}function gN(e,t,a,r,o,u){let c;return f;function f(y){return y===34||y===39||y===40?(e.enter(r),e.enter(o),e.consume(y),e.exit(o),c=y===40?41:y,m):a(y)}function m(y){return y===c?(e.enter(o),e.consume(y),e.exit(o),e.exit(r),t):(e.enter(u),h(y))}function h(y){return y===c?(e.exit(u),m(c)):y===null?a(y):Fe(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===c||y===null||Fe(y)?(e.exit("chunkString"),h(y)):(e.consume(y),y===92?g:b)}function g(y){return y===c||y===92?(e.consume(y),b):b(y)}}function uo(e,t){let a;return r;function r(o){return Fe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a=!0,r):it(o)?ft(e,r,a?"linePrefix":"lineSuffix")(o):t(o)}}const kk={name:"definition",tokenize:Ok},Rk={partial:!0,tokenize:Ik};function Ok(e,t,a){const r=this;let o;return u;function u(N){return e.enter("definition"),c(N)}function c(N){return pN.call(r,e,f,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(N)}function f(N){return o=Ha(r.sliceSerialize(r.events[r.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 Ot(N)?uo(e,h)(N):h(N)}function h(N){return hN(e,b,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(N)}function b(N){return e.attempt(Rk,g,g)(N)}function g(N){return it(N)?ft(e,y,"whitespace")(N):y(N)}function y(N){return N===null||Fe(N)?(e.exit("definition"),r.parser.defined.push(o),t(N)):a(N)}}function Ik(e,t,a){return r;function r(f){return Ot(f)?uo(e,o)(f):a(f)}function o(f){return gN(e,u,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function u(f){return it(f)?ft(e,c,"whitespace")(f):c(f)}function c(f){return f===null||Fe(f)?t(f):a(f)}}const Mk={name:"hardBreakEscape",tokenize:Dk};function Dk(e,t,a){return r;function r(u){return e.enter("hardBreakEscape"),e.consume(u),o}function o(u){return Fe(u)?(e.exit("hardBreakEscape"),t(u)):a(u)}}const Lk={name:"headingAtx",resolve:jk,tokenize:Bk};function jk(e,t){let a=e.length-2,r=3,o,u;return e[r][1].type==="whitespace"&&(r+=2),a-2>r&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(r===a-1||a-4>r&&e[a-2][1].type==="whitespace")&&(a-=r+1===a?2:4),a>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[a][1].end},u={type:"chunkText",start:e[r][1].start,end:e[a][1].end,contentType:"text"},xa(e,r,a-r+1,[["enter",o,t],["enter",u,t],["exit",u,t],["exit",o,t]])),e}function Bk(e,t,a){let r=0;return o;function o(b){return e.enter("atxHeading"),u(b)}function u(b){return e.enter("atxHeadingSequence"),c(b)}function c(b){return b===35&&r++<6?(e.consume(b),c):b===null||Ot(b)?(e.exit("atxHeadingSequence"),f(b)):a(b)}function f(b){return b===35?(e.enter("atxHeadingSequence"),m(b)):b===null||Fe(b)?(e.exit("atxHeading"),t(b)):it(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||Ot(b)?(e.exit("atxHeadingText"),f(b)):(e.consume(b),h)}}const Pk=["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"],u1=["pre","script","style","textarea"],Uk={concrete:!0,name:"htmlFlow",resolveTo:zk,tokenize:$k},Hk={partial:!0,tokenize:Yk},Fk={partial:!0,tokenize:qk};function zk(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 $k(e,t,a){const r=this;let o,u,c,f,m;return h;function h(L){return b(L)}function b(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),g}function g(L){return L===33?(e.consume(L),y):L===47?(e.consume(L),u=!0,A):L===63?(e.consume(L),o=3,r.interrupt?t:w):Fn(L)?(e.consume(L),c=String.fromCharCode(L),C):a(L)}function y(L){return L===45?(e.consume(L),o=2,N):L===91?(e.consume(L),o=5,f=0,v):Fn(L)?(e.consume(L),o=4,r.interrupt?t:w):a(L)}function N(L){return L===45?(e.consume(L),r.interrupt?t:w):a(L)}function v(L){const Ne="CDATA[";return L===Ne.charCodeAt(f++)?(e.consume(L),f===Ne.length?r.interrupt?t:le:v):a(L)}function A(L){return Fn(L)?(e.consume(L),c=String.fromCharCode(L),C):a(L)}function C(L){if(L===null||L===47||L===62||Ot(L)){const Ne=L===47,Te=c.toLowerCase();return!Ne&&!u&&u1.includes(Te)?(o=1,r.interrupt?t(L):le(L)):Pk.includes(c.toLowerCase())?(o=6,Ne?(e.consume(L),S):r.interrupt?t(L):le(L)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?a(L):u?M(L):O(L))}return L===45||Rn(L)?(e.consume(L),c+=String.fromCharCode(L),C):a(L)}function S(L){return L===62?(e.consume(L),r.interrupt?t:le):a(L)}function M(L){return it(L)?(e.consume(L),M):D(L)}function O(L){return L===47?(e.consume(L),D):L===58||L===95||Fn(L)?(e.consume(L),j):it(L)?(e.consume(L),O):D(L)}function j(L){return L===45||L===46||L===58||L===95||Rn(L)?(e.consume(L),j):I(L)}function I(L){return L===61?(e.consume(L),U):it(L)?(e.consume(L),I):O(L)}function U(L){return L===null||L===60||L===61||L===62||L===96?a(L):L===34||L===39?(e.consume(L),m=L,$):it(L)?(e.consume(L),U):Z(L)}function $(L){return L===m?(e.consume(L),m=null,K):L===null||Fe(L)?a(L):(e.consume(L),$)}function Z(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||Ot(L)?I(L):(e.consume(L),Z)}function K(L){return L===47||L===62||it(L)?O(L):a(L)}function D(L){return L===62?(e.consume(L),te):a(L)}function te(L){return L===null||Fe(L)?le(L):it(L)?(e.consume(L),te):a(L)}function le(L){return L===45&&o===2?(e.consume(L),F):L===60&&o===1?(e.consume(L),k):L===62&&o===4?(e.consume(L),H):L===63&&o===3?(e.consume(L),w):L===93&&o===5?(e.consume(L),J):Fe(L)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(Hk,se,pe)(L)):L===null||Fe(L)?(e.exit("htmlFlowData"),pe(L)):(e.consume(L),le)}function pe(L){return e.check(Fk,Q,se)(L)}function Q(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),q}function q(L){return L===null||Fe(L)?pe(L):(e.enter("htmlFlowData"),le(L))}function F(L){return L===45?(e.consume(L),w):le(L)}function k(L){return L===47?(e.consume(L),c="",P):le(L)}function P(L){if(L===62){const Ne=c.toLowerCase();return u1.includes(Ne)?(e.consume(L),H):le(L)}return Fn(L)&&c.length<8?(e.consume(L),c+=String.fromCharCode(L),P):le(L)}function J(L){return L===93?(e.consume(L),w):le(L)}function w(L){return L===62?(e.consume(L),H):L===45&&o===2?(e.consume(L),w):le(L)}function H(L){return L===null||Fe(L)?(e.exit("htmlFlowData"),se(L)):(e.consume(L),H)}function se(L){return e.exit("htmlFlow"),t(L)}}function qk(e,t,a){const r=this;return o;function o(c){return Fe(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):a(c)}function u(c){return r.parser.lazy[r.now().line]?a(c):t(c)}}function Yk(e,t,a){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Do,t,a)}}const Gk={name:"htmlText",tokenize:Kk};function Kk(e,t,a){const r=this;let o,u,c;return f;function f(w){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(w),m}function m(w){return w===33?(e.consume(w),h):w===47?(e.consume(w),I):w===63?(e.consume(w),O):Fn(w)?(e.consume(w),Z):a(w)}function h(w){return w===45?(e.consume(w),b):w===91?(e.consume(w),u=0,v):Fn(w)?(e.consume(w),M):a(w)}function b(w){return w===45?(e.consume(w),N):a(w)}function g(w){return w===null?a(w):w===45?(e.consume(w),y):Fe(w)?(c=g,k(w)):(e.consume(w),g)}function y(w){return w===45?(e.consume(w),N):g(w)}function N(w){return w===62?F(w):w===45?y(w):g(w)}function v(w){const H="CDATA[";return w===H.charCodeAt(u++)?(e.consume(w),u===H.length?A:v):a(w)}function A(w){return w===null?a(w):w===93?(e.consume(w),C):Fe(w)?(c=A,k(w)):(e.consume(w),A)}function C(w){return w===93?(e.consume(w),S):A(w)}function S(w){return w===62?F(w):w===93?(e.consume(w),S):A(w)}function M(w){return w===null||w===62?F(w):Fe(w)?(c=M,k(w)):(e.consume(w),M)}function O(w){return w===null?a(w):w===63?(e.consume(w),j):Fe(w)?(c=O,k(w)):(e.consume(w),O)}function j(w){return w===62?F(w):O(w)}function I(w){return Fn(w)?(e.consume(w),U):a(w)}function U(w){return w===45||Rn(w)?(e.consume(w),U):$(w)}function $(w){return Fe(w)?(c=$,k(w)):it(w)?(e.consume(w),$):F(w)}function Z(w){return w===45||Rn(w)?(e.consume(w),Z):w===47||w===62||Ot(w)?K(w):a(w)}function K(w){return w===47?(e.consume(w),F):w===58||w===95||Fn(w)?(e.consume(w),D):Fe(w)?(c=K,k(w)):it(w)?(e.consume(w),K):F(w)}function D(w){return w===45||w===46||w===58||w===95||Rn(w)?(e.consume(w),D):te(w)}function te(w){return w===61?(e.consume(w),le):Fe(w)?(c=te,k(w)):it(w)?(e.consume(w),te):K(w)}function le(w){return w===null||w===60||w===61||w===62||w===96?a(w):w===34||w===39?(e.consume(w),o=w,pe):Fe(w)?(c=le,k(w)):it(w)?(e.consume(w),le):(e.consume(w),Q)}function pe(w){return w===o?(e.consume(w),o=void 0,q):w===null?a(w):Fe(w)?(c=pe,k(w)):(e.consume(w),pe)}function Q(w){return w===null||w===34||w===39||w===60||w===61||w===96?a(w):w===47||w===62||Ot(w)?K(w):(e.consume(w),Q)}function q(w){return w===47||w===62||Ot(w)?K(w):a(w)}function F(w){return w===62?(e.consume(w),e.exit("htmlTextData"),e.exit("htmlText"),t):a(w)}function k(w){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),P}function P(w){return it(w)?ft(e,J,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):J(w)}function J(w){return e.enter("htmlTextData"),c(w)}}const rp={name:"labelEnd",resolveAll:Wk,resolveTo:Zk,tokenize:Jk},Vk={tokenize:eR},Xk={tokenize:tR},Qk={tokenize:nR};function Wk(e){let t=-1;const a=[];for(;++t<e.length;){const r=e[t][1];if(a.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==a.length&&xa(e,0,e.length,a),e}function Zk(e,t){let a=e.length,r=0,o,u,c,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(c){if(e[a][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(u=a,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(c=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[c][1].end}},b={type:"labelText",start:{...e[u+r+2][1].end},end:{...e[c-2][1].start}};return f=[["enter",m,t],["enter",h,t]],f=ka(f,e.slice(u+1,u+r+3)),f=ka(f,[["enter",b,t]]),f=ka(f,td(t.parser.constructs.insideSpan.null,e.slice(u+r+4,c-3),t)),f=ka(f,[["exit",b,t],e[c-2],e[c-1],["exit",h,t]]),f=ka(f,e.slice(c+1)),f=ka(f,[["exit",m,t]]),xa(e,u,e.length,f),e}function Jk(e,t,a){const r=this;let o=r.events.length,u,c;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){u=r.events[o][1];break}return f;function f(y){return u?u._inactive?g(y):(c=r.parser.defined.includes(Ha(r.sliceSerialize({start:u.end,end:r.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(Vk,b,c?b:g)(y):y===91?e.attempt(Xk,b,c?h:g)(y):c?b(y):g(y)}function h(y){return e.attempt(Qk,b,g)(y)}function b(y){return t(y)}function g(y){return u._balanced=!0,a(y)}}function eR(e,t,a){return r;function r(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),o}function o(g){return Ot(g)?uo(e,u)(g):u(g)}function u(g){return g===41?b(g):hN(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function c(g){return Ot(g)?uo(e,m)(g):b(g)}function f(g){return a(g)}function m(g){return g===34||g===39||g===40?gN(e,h,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):b(g)}function h(g){return Ot(g)?uo(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 tR(e,t,a){const r=this;return o;function o(f){return pN.call(r,e,u,c,"reference","referenceMarker","referenceString")(f)}function u(f){return r.parser.defined.includes(Ha(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(f):a(f)}function c(f){return a(f)}}function nR(e,t,a){return r;function r(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 aR={name:"labelStartImage",resolveAll:rp.resolveAll,tokenize:sR};function sR(e,t,a){const r=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"),c):a(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(f):t(f)}}const rR={name:"labelStartLink",resolveAll:rp.resolveAll,tokenize:iR};function iR(e,t,a){const r=this;return o;function o(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),u}function u(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(c):t(c)}}const wm={name:"lineEnding",tokenize:lR};function lR(e,t){return a;function a(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ft(e,t,"linePrefix")}}const Ec={name:"thematicBreak",tokenize:oR};function oR(e,t,a){let r=0,o;return u;function u(h){return e.enter("thematicBreak"),c(h)}function c(h){return o=h,f(h)}function f(h){return h===o?(e.enter("thematicBreakSequence"),m(h)):r>=3&&(h===null||Fe(h))?(e.exit("thematicBreak"),t(h)):a(h)}function m(h){return h===o?(e.consume(h),r++,m):(e.exit("thematicBreakSequence"),it(h)?ft(e,f,"whitespace")(h):f(h))}}const aa={continuation:{tokenize:fR},exit:hR,name:"list",tokenize:dR},uR={partial:!0,tokenize:pR},cR={partial:!0,tokenize:mR};function dR(e,t,a){const r=this,o=r.events[r.events.length-1];let u=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,c=0;return f;function f(N){const v=r.containerState.type||(N===42||N===43||N===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||N===r.containerState.marker:fh(N)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),N===42||N===45?e.check(Ec,a,h)(N):h(N);if(!r.interrupt||N===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(N)}return a(N)}function m(N){return fh(N)&&++c<10?(e.consume(N),m):(!r.interrupt||c<2)&&(r.containerState.marker?N===r.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"),r.containerState.marker=r.containerState.marker||N,e.check(Do,r.interrupt?a:b,e.attempt(uR,y,g))}function b(N){return r.containerState.initialBlankLine=!0,u++,y(N)}function g(N){return it(N)?(e.enter("listItemPrefixWhitespace"),e.consume(N),e.exit("listItemPrefixWhitespace"),y):a(N)}function y(N){return r.containerState.size=u+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(N)}}function fR(e,t,a){const r=this;return r.containerState._closeFlow=void 0,e.check(Do,o,u);function o(f){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ft(e,t,"listItemIndent",r.containerState.size+1)(f)}function u(f){return r.containerState.furtherBlankLines||!it(f)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,c(f)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(cR,t,c)(f))}function c(f){return r.containerState._closeFlow=!0,r.interrupt=void 0,ft(e,e.attempt(aa,t,a),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function mR(e,t,a){const r=this;return ft(e,o,"listItemIndent",r.containerState.size+1);function o(u){const c=r.events[r.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===r.containerState.size?t(u):a(u)}}function hR(e){e.exit(this.containerState.type)}function pR(e,t,a){const r=this;return ft(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(u){const c=r.events[r.events.length-1];return!it(u)&&c&&c[1].type==="listItemPrefixWhitespace"?t(u):a(u)}}const c1={name:"setextUnderline",resolveTo:gR,tokenize:bR};function gR(e,t){let a=e.length,r,o,u;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){r=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 c={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",u?(e.splice(o,0,["enter",c,t]),e.splice(u+1,0,["exit",e[r][1],t]),e[r][1].end={...e[u][1].end}):e[r][1]=c,e.push(["exit",c,t]),e}function bR(e,t,a){const r=this;let o;return u;function u(h){let b=r.events.length,g;for(;b--;)if(r.events[b][1].type!=="lineEnding"&&r.events[b][1].type!=="linePrefix"&&r.events[b][1].type!=="content"){g=r.events[b][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||g)?(e.enter("setextHeadingLine"),o=h,c(h)):a(h)}function c(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===o?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),it(h)?ft(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||Fe(h)?(e.exit("setextHeadingLine"),t(h)):a(h)}}const xR={tokenize:ER};function ER(e){const t=this,a=e.attempt(Do,r,e.attempt(this.parser.constructs.flowInitial,o,ft(e,e.attempt(this.parser.constructs.flow,o,e.attempt(vk,o)),"linePrefix")));return a;function r(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 yR={resolveAll:xN()},NR=bN("string"),TR=bN("text");function bN(e){return{resolveAll:xN(e==="text"?_R:void 0),tokenize:t};function t(a){const r=this,o=this.parser.constructs[e],u=a.attempt(o,c,f);return c;function c(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(r,r.previous))return!0}return!1}}}function xN(e){return t;function t(a,r){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,r):a}}function _R(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 r=e[a-1][1],o=t.sliceStream(r);let u=o.length,c=-1,f=0,m;for(;u--;){const h=o[u];if(typeof h=="string"){for(c=h.length;h.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-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?c:r.start._bufferIndex+c,_index:r.start._index+u,line:r.end.line,column:r.end.column-f,offset:r.end.offset-f},end:{...r.end}};r.end={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(e.splice(a,0,["enter",h,t],["exit",h,t]),a+=2)}a++}return e}const vR={42:aa,43:aa,45:aa,48:aa,49:aa,50:aa,51:aa,52:aa,53:aa,54:aa,55:aa,56:aa,57:aa,62:cN},SR={91:kk},AR={[-2]:Cm,[-1]:Cm,32:Cm},CR={35:Lk,42:Ec,45:[c1,Ec],60:Uk,61:c1,95:Ec,96:o1,126:o1},wR={38:fN,92:dN},kR={[-5]:wm,[-4]:wm,[-3]:wm,33:aR,38:fN,42:mh,60:[rk,Gk],91:rR,92:[Mk,dN],93:rp,95:mh,96:xk},RR={null:[mh,yR]},OR={null:[42,95]},IR={null:[]},MR=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:OR,contentInitial:SR,disable:IR,document:vR,flow:CR,flowInitial:AR,insideSpan:RR,string:wR,text:kR},Symbol.toStringTag,{value:"Module"}));function DR(e,t,a){let r={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const o={},u=[];let c=[],f=[];const m={attempt:$(I),check:$(U),consume:M,enter:O,exit:j,interrupt:$(U,{interrupt:!0})},h={code:null,containerState:{},defineSkip:A,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(te){return c=ka(c,te),C(),c[c.length-1]!==null?[]:(Z(t,0),h.events=td(u,h.events,h),h.events)}function y(te,le){return jR(N(te),le)}function N(te){return LR(c,te)}function v(){const{_bufferIndex:te,_index:le,line:pe,column:Q,offset:q}=r;return{_bufferIndex:te,_index:le,line:pe,column:Q,offset:q}}function A(te){o[te.line]=te.column,D()}function C(){let te;for(;r._index<c.length;){const le=c[r._index];if(typeof le=="string")for(te=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===te&&r._bufferIndex<le.length;)S(le.charCodeAt(r._bufferIndex));else S(le)}}function S(te){b=b(te)}function M(te){Fe(te)?(r.line++,r.column=1,r.offset+=te===-3?2:1,D()):te!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===c[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=te}function O(te,le){const pe=le||{};return pe.type=te,pe.start=v(),h.events.push(["enter",pe,h]),f.push(pe),pe}function j(te){const le=f.pop();return le.end=v(),h.events.push(["exit",le,h]),le}function I(te,le){Z(te,le.from)}function U(te,le){le.restore()}function $(te,le){return pe;function pe(Q,q,F){let k,P,J,w;return Array.isArray(Q)?se(Q):"tokenize"in Q?se([Q]):H(Q);function H(V){return ve;function ve(Be){const Ue=Be!==null&&V[Be],xt=Be!==null&&V.null,un=[...Array.isArray(Ue)?Ue:Ue?[Ue]:[],...Array.isArray(xt)?xt:xt?[xt]:[]];return se(un)(Be)}}function se(V){return k=V,P=0,V.length===0?F:L(V[P])}function L(V){return ve;function ve(Be){return w=K(),J=V,V.partial||(h.currentConstruct=V),V.name&&h.parser.constructs.disable.null.includes(V.name)?Te():V.tokenize.call(le?Object.assign(Object.create(h),le):h,m,Ne,Te)(Be)}}function Ne(V){return te(J,w),q}function Te(V){return w.restore(),++P<k.length?L(k[P]):F}}}function Z(te,le){te.resolveAll&&!u.includes(te)&&u.push(te),te.resolve&&xa(h.events,le,h.events.length-le,te.resolve(h.events.slice(le),h)),te.resolveTo&&(h.events=te.resolveTo(h.events,h))}function K(){const te=v(),le=h.previous,pe=h.currentConstruct,Q=h.events.length,q=Array.from(f);return{from:Q,restore:F};function F(){r=te,h.previous=le,h.currentConstruct=pe,h.events.length=Q,f=q,D()}}function D(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function LR(e,t){const a=t.start._index,r=t.start._bufferIndex,o=t.end._index,u=t.end._bufferIndex;let c;if(a===o)c=[e[a].slice(r,u)];else{if(c=e.slice(a,o),r>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(r):c.shift()}u>0&&c.push(e[o].slice(0,u))}return c}function jR(e,t){let a=-1;const r=[];let o;for(;++a<e.length;){const u=e[a];let c;if(typeof u=="string")c=u;else switch(u){case-5:{c="\r";break}case-4:{c=`
464
- `;break}case-3:{c=`\r
465
- `;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&o)continue;c=" ";break}default:c=String.fromCharCode(u)}o=u===-2,r.push(c)}return r.join("")}function BR(e){const r={constructs:oN([MR,...(e||{}).extensions||[]]),content:o(Zw),defined:[],document:o(ek),flow:o(xR),lazy:{},string:o(NR),text:o(TR)};return r;function o(u){return c;function c(f){return DR(r,u,f)}}}function PR(e){for(;!mN(e););return e}const d1=/[\0\t\n\r]/g;function UR(){let e=1,t="",a=!0,r;return o;function o(u,c,f){const m=[];let h,b,g,y,N;for(u=t+(typeof u=="string"?u.toString():new TextDecoder(c||void 0).decode(u)),g=0,t="",a&&(u.charCodeAt(0)===65279&&g++,a=void 0);g<u.length;){if(d1.lastIndex=g,h=d1.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&&r)m.push(-3),r=void 0;else switch(r&&(m.push(-5),r=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:r=!0,e=1}g=y+1}return f&&(r&&m.push(-5),t&&m.push(t),m.push(null)),m}}const HR=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function FR(e){return e.replace(HR,zR)}function zR(e,t,a){if(t)return t;if(a.charCodeAt(0)===35){const o=a.charCodeAt(1),u=o===120||o===88;return uN(a.slice(u?2:1),u?16:10)}return sp(a)||e}const EN={}.hasOwnProperty;function $R(e,t,a){return t&&typeof t=="object"&&(a=t,t=void 0),qR(a)(PR(BR(a).document().write(UR()(e,t,!0))))}function qR(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(Yn),autolinkProtocol:K,autolinkEmail:K,atxHeading:u($n),blockQuote:u(xt),characterEscape:K,characterReference:K,codeFenced:u(un),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:u(un,c),codeText:u(cn,c),codeTextData:K,data:K,codeFlowValue:K,definition:u(za),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:u(Dn),hardBreakEscape:u(et),hardBreakTrailing:u(et),htmlFlow:u(qn,c),htmlFlowData:K,htmlText:u(qn,c),htmlTextData:K,image:u(Ln),label:c,link:u(Yn),listItem:u(be),listItemValue:y,listOrdered:u(Da,g),listUnordered:u(Da),paragraph:u(ct),reference:L,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:u($n),strong:u(ia),thematicBreak:u(Qr)},exit:{atxHeading:m(),atxHeadingSequence:I,autolink:m(),autolinkEmail:Ue,autolinkProtocol:Be,blockQuote:m(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:Te,characterReferenceMarkerNumeric:Te,characterReferenceValue:V,characterReference:ve,codeFenced:m(C),codeFencedFence:A,codeFencedFenceInfo:N,codeFencedFenceMeta:v,codeFlowValue:D,codeIndented:m(S),codeText:m(q),codeTextData:D,data:D,definition:m(),definitionDestinationString:j,definitionLabelString:M,definitionTitleString:O,emphasis:m(),hardBreakEscape:m(le),hardBreakTrailing:m(le),htmlFlow:m(pe),htmlFlowData:D,htmlText:m(Q),htmlTextData:D,image:m(k),label:J,labelText:P,lineEnding:te,link:m(F),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:Ne,resourceDestinationString:w,resourceTitleString:H,resource:se,setextHeading:m(Z),setextHeadingLineSequence:$,setextHeadingText:U,strong:m(),thematicBreak:m()}};yN(t,(e||{}).mdastExtensions||[]);const a={};return r;function r(de){let Ae={type:"root",children:[]};const ze={stack:[Ae],tokenStack:[],config:t,enter:f,exit:h,buffer:c,resume:b,data:a},tt=[];let mt=-1;for(;++mt<de.length;)if(de[mt][1].type==="listOrdered"||de[mt][1].type==="listUnordered")if(de[mt][0]==="enter")tt.push(mt);else{const jn=tt.pop();mt=o(de,jn,mt)}for(mt=-1;++mt<de.length;){const jn=t[de[mt][0]];EN.call(jn,de[mt][1].type)&&jn[de[mt][1].type].call(Object.assign({sliceSerialize:de[mt][2].sliceSerialize},ze),de[mt][1])}if(ze.tokenStack.length>0){const jn=ze.tokenStack[ze.tokenStack.length-1];(jn[1]||f1).call(ze,void 0,jn[0])}for(Ae.position={start:sr(de.length>0?de[0][1].start:{line:1,column:1,offset:0}),end:sr(de.length>0?de[de.length-2][1].end:{line:1,column:1,offset:0})},mt=-1;++mt<t.transforms.length;)Ae=t.transforms[mt](Ae)||Ae;return Ae}function o(de,Ae,ze){let tt=Ae-1,mt=-1,jn=!1,La,gn,zt,Sn;for(;++tt<=ze;){const Et=de[tt];switch(Et[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Et[0]==="enter"?mt++:mt--,Sn=void 0;break}case"lineEndingBlank":{Et[0]==="enter"&&(La&&!Sn&&!mt&&!zt&&(zt=tt),Sn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Sn=void 0}if(!mt&&Et[0]==="enter"&&Et[1].type==="listItemPrefix"||mt===-1&&Et[0]==="exit"&&(Et[1].type==="listUnordered"||Et[1].type==="listOrdered")){if(La){let $a=tt;for(gn=void 0;$a--;){const Bn=de[$a];if(Bn[1].type==="lineEnding"||Bn[1].type==="lineEndingBlank"){if(Bn[0]==="exit")continue;gn&&(de[gn][1].type="lineEndingBlank",jn=!0),Bn[1].type="lineEnding",gn=$a}else if(!(Bn[1].type==="linePrefix"||Bn[1].type==="blockQuotePrefix"||Bn[1].type==="blockQuotePrefixWhitespace"||Bn[1].type==="blockQuoteMarker"||Bn[1].type==="listItemIndent"))break}zt&&(!gn||zt<gn)&&(La._spread=!0),La.end=Object.assign({},gn?de[gn][1].start:Et[1].end),de.splice(gn||tt,0,["exit",La,Et[2]]),tt++,ze++}if(Et[1].type==="listItemPrefix"){const $a={type:"listItem",_spread:!1,start:Object.assign({},Et[1].start),end:void 0};La=$a,de.splice(tt,0,["enter",$a,Et[2]]),tt++,ze++,zt=void 0,Sn=!0}}}return de[Ae][1]._spread=jn,ze}function u(de,Ae){return ze;function ze(tt){f.call(this,de(tt),tt),Ae&&Ae.call(this,tt)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(de,Ae,ze){this.stack[this.stack.length-1].children.push(de),this.stack.push(de),this.tokenStack.push([Ae,ze||void 0]),de.position={start:sr(Ae.start),end:void 0}}function m(de){return Ae;function Ae(ze){de&&de.call(this,ze),h.call(this,ze)}}function h(de,Ae){const ze=this.stack.pop(),tt=this.tokenStack.pop();if(tt)tt[0].type!==de.type&&(Ae?Ae.call(this,de,tt[0]):(tt[1]||f1).call(this,de,tt[0]));else throw new Error("Cannot close `"+de.type+"` ("+oo({start:de.start,end:de.end})+"): it’s not open");ze.position.end=sr(de.end)}function b(){return ap(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function y(de){if(this.data.expectingFirstListItemValue){const Ae=this.stack[this.stack.length-2];Ae.start=Number.parseInt(this.sliceSerialize(de),10),this.data.expectingFirstListItemValue=void 0}}function N(){const de=this.resume(),Ae=this.stack[this.stack.length-1];Ae.lang=de}function v(){const de=this.resume(),Ae=this.stack[this.stack.length-1];Ae.meta=de}function A(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const de=this.resume(),Ae=this.stack[this.stack.length-1];Ae.value=de.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const de=this.resume(),Ae=this.stack[this.stack.length-1];Ae.value=de.replace(/(\r?\n|\r)$/g,"")}function M(de){const Ae=this.resume(),ze=this.stack[this.stack.length-1];ze.label=Ae,ze.identifier=Ha(this.sliceSerialize(de)).toLowerCase()}function O(){const de=this.resume(),Ae=this.stack[this.stack.length-1];Ae.title=de}function j(){const de=this.resume(),Ae=this.stack[this.stack.length-1];Ae.url=de}function I(de){const Ae=this.stack[this.stack.length-1];if(!Ae.depth){const ze=this.sliceSerialize(de).length;Ae.depth=ze}}function U(){this.data.setextHeadingSlurpLineEnding=!0}function $(de){const Ae=this.stack[this.stack.length-1];Ae.depth=this.sliceSerialize(de).codePointAt(0)===61?1:2}function Z(){this.data.setextHeadingSlurpLineEnding=void 0}function K(de){const ze=this.stack[this.stack.length-1].children;let tt=ze[ze.length-1];(!tt||tt.type!=="text")&&(tt=It(),tt.position={start:sr(de.start),end:void 0},ze.push(tt)),this.stack.push(tt)}function D(de){const Ae=this.stack.pop();Ae.value+=this.sliceSerialize(de),Ae.position.end=sr(de.end)}function te(de){const Ae=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ze=Ae.children[Ae.children.length-1];ze.position.end=sr(de.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ae.type)&&(K.call(this,de),D.call(this,de))}function le(){this.data.atHardBreak=!0}function pe(){const de=this.resume(),Ae=this.stack[this.stack.length-1];Ae.value=de}function Q(){const de=this.resume(),Ae=this.stack[this.stack.length-1];Ae.value=de}function q(){const de=this.resume(),Ae=this.stack[this.stack.length-1];Ae.value=de}function F(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const Ae=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=Ae,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function k(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const Ae=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=Ae,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function P(de){const Ae=this.sliceSerialize(de),ze=this.stack[this.stack.length-2];ze.label=FR(Ae),ze.identifier=Ha(Ae).toLowerCase()}function J(){const de=this.stack[this.stack.length-1],Ae=this.resume(),ze=this.stack[this.stack.length-1];if(this.data.inReference=!0,ze.type==="link"){const tt=de.children;ze.children=tt}else ze.alt=Ae}function w(){const de=this.resume(),Ae=this.stack[this.stack.length-1];Ae.url=de}function H(){const de=this.resume(),Ae=this.stack[this.stack.length-1];Ae.title=de}function se(){this.data.inReference=void 0}function L(){this.data.referenceType="collapsed"}function Ne(de){const Ae=this.resume(),ze=this.stack[this.stack.length-1];ze.label=Ae,ze.identifier=Ha(this.sliceSerialize(de)).toLowerCase(),this.data.referenceType="full"}function Te(de){this.data.characterReferenceType=de.type}function V(de){const Ae=this.sliceSerialize(de),ze=this.data.characterReferenceType;let tt;ze?(tt=uN(Ae,ze==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):tt=sp(Ae);const mt=this.stack[this.stack.length-1];mt.value+=tt}function ve(de){const Ae=this.stack.pop();Ae.position.end=sr(de.end)}function Be(de){D.call(this,de);const Ae=this.stack[this.stack.length-1];Ae.url=this.sliceSerialize(de)}function Ue(de){D.call(this,de);const Ae=this.stack[this.stack.length-1];Ae.url="mailto:"+this.sliceSerialize(de)}function xt(){return{type:"blockquote",children:[]}}function un(){return{type:"code",lang:null,meta:null,value:""}}function cn(){return{type:"inlineCode",value:""}}function za(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Dn(){return{type:"emphasis",children:[]}}function $n(){return{type:"heading",depth:0,children:[]}}function et(){return{type:"break"}}function qn(){return{type:"html",value:""}}function Ln(){return{type:"image",title:null,url:"",alt:null}}function Yn(){return{type:"link",title:null,url:"",children:[]}}function Da(de){return{type:"list",ordered:de.type==="listOrdered",start:null,spread:de._spread,children:[]}}function be(de){return{type:"listItem",spread:de._spread,checked:null,children:[]}}function ct(){return{type:"paragraph",children:[]}}function ia(){return{type:"strong",children:[]}}function It(){return{type:"text",value:""}}function Qr(){return{type:"thematicBreak"}}}function sr(e){return{line:e.line,column:e.column,offset:e.offset}}function yN(e,t){let a=-1;for(;++a<t.length;){const r=t[a];Array.isArray(r)?yN(e,r):YR(e,r)}}function YR(e,t){let a;for(a in t)if(EN.call(t,a))switch(a){case"canContainEols":{const r=t[a];r&&e[a].push(...r);break}case"transforms":{const r=t[a];r&&e[a].push(...r);break}case"enter":case"exit":{const r=t[a];r&&Object.assign(e[a],r);break}}}function f1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+oo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+oo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+oo({start:t.start,end:t.end})+") is still open")}function GR(e){const t=this;t.parser=a;function a(r){return $R(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function KR(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 VR(e,t){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,a),[e.applyData(t,a),{type:"text",value:`
466
- `}]}function XR(e,t){const a=t.value?t.value+`
467
- `:"",r={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let u={type:"element",tagName:"code",properties:r,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 QR(e,t){const a={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function WR(e,t){const a={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function ZR(e,t){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Ji(r.toLowerCase()),u=e.footnoteOrder.indexOf(r);let c,f=e.footnoteCounts.get(r);f===void 0?(f=0,e.footnoteOrder.push(r),c=e.footnoteOrder.length):c=u+1,f+=1,e.footnoteCounts.set(r,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(c)}]};e.patch(t,m);const h={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,h),e.applyData(t,h)}function JR(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 e4(e,t){if(e.options.allowDangerousHtml){const a={type:"raw",value:t.value};return e.patch(t,a),e.applyData(t,a)}}function NN(e,t){const a=t.referenceType;let r="]";if(a==="collapsed"?r+="[]":a==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),u=o[0];u&&u.type==="text"?u.value="["+u.value:o.unshift({type:"text",value:"["});const c=o[o.length-1];return c&&c.type==="text"?c.value+=r:o.push({type:"text",value:r}),o}function t4(e,t){const a=String(t.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return NN(e,t);const o={src:Ji(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const u={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,u),e.applyData(t,u)}function n4(e,t){const a={src:Ji(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 r={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,r),e.applyData(t,r)}function a4(e,t){const a={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,a);const r={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(t,r),e.applyData(t,r)}function s4(e,t){const a=String(t.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return NN(e,t);const o={href:Ji(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const u={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,u),e.applyData(t,u)}function r4(e,t){const a={href:Ji(t.url)};t.title!==null&&t.title!==void 0&&(a.title=t.title);const r={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function i4(e,t,a){const r=e.all(t),o=a?l4(a):TN(t),u={},c=[];if(typeof t.checked=="boolean"){const b=r[0];let g;b&&b.type==="element"&&b.tagName==="p"?g=b:(g={type:"element",tagName:"p",properties:{},children:[]},r.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let f=-1;for(;++f<r.length;){const b=r[f];(o||f!==0||b.type!=="element"||b.tagName!=="p")&&c.push({type:"text",value:`
468
- `}),b.type==="element"&&b.tagName==="p"&&!o?c.push(...b.children):c.push(b)}const m=r[r.length-1];m&&(o||m.type!=="element"||m.tagName!=="p")&&c.push({type:"text",value:`
469
- `});const h={type:"element",tagName:"li",properties:u,children:c};return e.patch(t,h),e.applyData(t,h)}function l4(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const a=e.children;let r=-1;for(;!t&&++r<a.length;)t=TN(a[r])}return t}function TN(e){const t=e.spread;return t??e.children.length>1}function o4(e,t){const a={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(a.start=t.start);++o<r.length;){const c=r[o];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const u={type:"element",tagName:t.ordered?"ol":"ul",properties:a,children:e.wrap(r,!0)};return e.patch(t,u),e.applyData(t,u)}function u4(e,t){const a={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function c4(e,t){const a={type:"root",children:e.wrap(e.all(t))};return e.patch(t,a),e.applyData(t,a)}function d4(e,t){const a={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function f4(e,t){const a=e.all(t),r=a.shift(),o=[];if(r){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],c),o.push(c)}if(a.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},f=ts(t.children[1]),m=Jc(t.children[t.children.length-1]);f&&m&&(c.position={start:f,end:m}),o.push(c)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,u),e.applyData(t,u)}function m4(e,t,a){const r=a?a.children:void 0,u=(r?r.indexOf(t):1)===0?"th":"td",c=a&&a.type==="table"?a.align:void 0,f=c?c.length:t.children.length;let m=-1;const h=[];for(;++m<f;){const g=t.children[m],y={},N=c?c[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 h4(e,t){const a={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}const m1=9,h1=32;function p4(e){const t=String(e),a=/\r?\n|\r/g;let r=a.exec(t),o=0;const u=[];for(;r;)u.push(p1(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=a.exec(t);return u.push(p1(t.slice(o),o>0,!1)),u.join("")}function p1(e,t,a){let r=0,o=e.length;if(t){let u=e.codePointAt(r);for(;u===m1||u===h1;)r++,u=e.codePointAt(r)}if(a){let u=e.codePointAt(o-1);for(;u===m1||u===h1;)o--,u=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function g4(e,t){const a={type:"text",value:p4(String(t.value))};return e.patch(t,a),e.applyData(t,a)}function b4(e,t){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,a),e.applyData(t,a)}const x4={blockquote:KR,break:VR,code:XR,delete:QR,emphasis:WR,footnoteReference:ZR,heading:JR,html:e4,imageReference:t4,image:n4,inlineCode:a4,linkReference:s4,link:r4,listItem:i4,list:o4,paragraph:u4,root:c4,strong:d4,table:f4,tableCell:h4,tableRow:m4,text:g4,thematicBreak:b4,toml:rc,yaml:rc,definition:rc,footnoteDefinition:rc};function rc(){}const _N=-1,nd=0,co=1,Ic=2,ip=3,lp=4,op=5,up=6,vN=7,SN=8,AN=typeof self=="object"?self:globalThis,g1=(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 AN[e](t)},E4=(e,t)=>{const a=(o,u)=>(e.set(u,o),o),r=o=>{if(e.has(o))return e.get(o);const[u,c]=t[o];switch(u){case nd:case _N:return a(c,o);case co:{const f=a([],o);for(const m of c)f.push(r(m));return f}case Ic:{const f=a({},o);for(const[m,h]of c)f[r(m)]=r(h);return f}case ip:return a(new Date(c),o);case lp:{const{source:f,flags:m}=c;return a(new RegExp(f,m),o)}case op:{const f=a(new Map,o);for(const[m,h]of c)f.set(r(m),r(h));return f}case up:{const f=a(new Set,o);for(const m of c)f.add(r(m));return f}case vN:{const{name:f,message:m}=c;return a(typeof AN[f]=="function"?g1(f,m):new Error(m),o)}case SN:return a(BigInt(c),o);case"BigInt":return a(Object(BigInt(c)),o);case"ArrayBuffer":return a(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:f}=new Uint8Array(c);return a(new DataView(f),c)}}return a(g1(u,c),o)};return r},b1=e=>E4(new Map,e)(0),jr="",{toString:y4}={},{keys:N4}=Object,no=e=>{const t=typeof e;if(t!=="object"||!e)return[nd,t];const a=y4.call(e).slice(8,-1);switch(a){case"Array":return[co,jr];case"Object":return[Ic,jr];case"Date":return[ip,jr];case"RegExp":return[lp,jr];case"Map":return[op,jr];case"Set":return[up,jr];case"DataView":return[co,a]}return a.includes("Array")?[co,a]:e instanceof Error?[vN,e.name||"Error"]:[Ic,a]},ic=([e,t])=>e===nd&&(t==="function"||t==="symbol"),T4=(e,t,a,r)=>{const o=(c,f)=>{const m=r.push(c)-1;return a.set(f,m),m},u=c=>{if(a.has(c))return a.get(c);let[f,m]=no(c);switch(f){case nd:{let b=c;switch(m){case"bigint":f=SN,b=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);b=null;break;case"undefined":return o([_N],c)}return o([f,b],c)}case co:{if(m){let y=c;return m==="DataView"?y=new Uint8Array(c.buffer):m==="ArrayBuffer"&&(y=new Uint8Array(c)),o([m,[...y]],c)}const b=[],g=o([f,b],c);for(const y of c)b.push(u(y));return g}case Ic:{if(m)switch(m){case"BigInt":return o([m,c.toString()],c);case"Boolean":case"Number":case"String":return o([m,c.valueOf()],c)}if(t&&"toJSON"in c)return u(c.toJSON());const b=[],g=o([f,b],c);for(const y of N4(c))(e||!ic(no(c[y])))&&b.push([u(y),u(c[y])]);return g}case ip:return o([f,isNaN(c.getTime())?jr:c.toISOString()],c);case lp:{const{source:b,flags:g}=c;return o([f,{source:b,flags:g}],c)}case op:{const b=[],g=o([f,b],c);for(const[y,N]of c)(e||!(ic(no(y))||ic(no(N))))&&b.push([u(y),u(N)]);return g}case up:{const b=[],g=o([f,b],c);for(const y of c)(e||!ic(no(y)))&&b.push(u(y));return g}}const{message:h}=c;return o([f,{name:m,message:h}],c)};return u},x1=(e,{json:t,lossy:a}={})=>{const r=[];return T4(!(t||a),!!t,new Map,r)(e),r},qi=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?b1(x1(e,t)):structuredClone(e):(e,t)=>b1(x1(e,t));function _4(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 v4(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function S4(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||_4,r=e.options.footnoteBackLabel||v4,o=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",c=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=Ji(g.toLowerCase());let N=0;const v=[],A=e.footnoteCounts.get(g);for(;A!==void 0&&++N<=A;){v.length>0&&v.push({type:"text",value:" "});let M=typeof a=="string"?a:a(m,N);typeof M=="string"&&(M={type:"text",value:M}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(N>1?"-"+N:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(m,N),className:["data-footnote-backref"]},children:Array.isArray(M)?M:[M]})}const C=b[b.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const M=C.children[C.children.length-1];M&&M.type==="text"?M.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...v)}else b.push(...v);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(b,!0)};e.patch(h,S),f.push(S)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...qi(c),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
470
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
471
- `}]}}const Lo=(function(e){if(e==null)return k4;if(typeof e=="function")return ad(e);if(typeof e=="object")return Array.isArray(e)?A4(e):C4(e);if(typeof e=="string")return w4(e);throw new Error("Expected function, string, or object as test")});function A4(e){const t=[];let a=-1;for(;++a<e.length;)t[a]=Lo(e[a]);return ad(r);function r(...o){let u=-1;for(;++u<t.length;)if(t[u].apply(this,o))return!0;return!1}}function C4(e){const t=e;return ad(a);function a(r){const o=r;let u;for(u in e)if(o[u]!==t[u])return!1;return!0}}function w4(e){return ad(t);function t(a){return a&&a.type===e}}function ad(e){return t;function t(a,r,o){return!!(R4(a)&&e.call(this,a,typeof r=="number"?r:void 0,o||void 0))}}function k4(){return!0}function R4(e){return e!==null&&typeof e=="object"&&"type"in e}const CN=[],O4=!0,hh=!1,I4="skip";function wN(e,t,a,r){let o;typeof t=="function"&&typeof a!="function"?(r=a,a=t):o=t;const u=Lo(o),c=r?-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=CN,v,A,C;if((!t||u(m,h,b[b.length-1]||void 0))&&(N=M4(a(m,b)),N[0]===hh))return N;if("children"in m&&m.children){const S=m;if(S.children&&N[0]!==I4)for(A=(r?S.children.length:-1)+c,C=b.concat(S);A>-1&&A<S.children.length;){const M=S.children[A];if(v=f(M,A,C)(),v[0]===hh)return v;A=typeof v[1]=="number"?v[1]:A+c}}return N}}}function M4(e){return Array.isArray(e)?e:typeof e=="number"?[O4,e]:e==null?CN:[e]}function jo(e,t,a,r){let o,u,c;typeof t=="function"&&typeof a!="function"?(u=void 0,c=t,o=a):(u=t,c=a,o=r),wN(e,u,f,o);function f(m,h){const b=h[h.length-1],g=b?b.children.indexOf(m):void 0;return c(m,g,b)}}const ph={}.hasOwnProperty,D4={};function L4(e,t){const a=t||D4,r=new Map,o=new Map,u=new Map,c={...x4,...a.handlers},f={all:h,applyData:B4,definitionById:r,footnoteById:o,footnoteCounts:u,footnoteOrder:[],handlers:c,one:m,options:a,patch:j4,wrap:U4};return jo(e,function(b){if(b.type==="definition"||b.type==="footnoteDefinition"){const g=b.type==="definition"?r: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(ph.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:A,...C}=b,S=qi(C);return S.children=f.all(b),S}return qi(b)}return(f.options.unknownHandler||P4)(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=E1(v.value)),!Array.isArray(v)&&v.type==="element")){const A=v.children[0];A&&A.type==="text"&&(A.value=E1(A.value))}Array.isArray(v)?g.push(...v):g.push(v)}}}return g}}function j4(e,t){e.position&&(t.position=vw(e))}function B4(e,t){let a=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,u=e.data.hProperties;if(typeof r=="string")if(a.type==="element")a.tagName=r;else{const c="children"in a?a.children:[a];a={type:"element",tagName:r,properties:{},children:c}}a.type==="element"&&u&&Object.assign(a.properties,qi(u)),"children"in a&&a.children&&o!==null&&o!==void 0&&(a.children=o)}return a}function P4(e,t){const a=t.data||{},r="value"in t&&!(ph.call(a,"hProperties")||ph.call(a,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function U4(e,t){const a=[];let r=-1;for(t&&a.push({type:"text",value:`
472
- `});++r<e.length;)r&&a.push({type:"text",value:`
473
- `}),a.push(e[r]);return t&&e.length>0&&a.push({type:"text",value:`
474
- `}),a}function E1(e){let t=0,a=e.charCodeAt(t);for(;a===9||a===32;)t++,a=e.charCodeAt(t);return e.slice(t)}function y1(e,t){const a=L4(e,t),r=a.one(e,void 0),o=S4(a),u=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&u.children.push({type:"text",value:`
475
- `},o),u}function H4(e,t){return e&&"run"in e?async function(a,r){const o=y1(a,{file:r,...t});await e.run(o,r)}:function(a,r){return y1(a,{file:r,...e||t})}}function N1(e){if(e)throw e}var km,T1;function F4(){if(T1)return km;T1=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,a=Object.defineProperty,r=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)},c=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(r)return r(h,b).value}else return;return h[b]};return km=function m(){var h,b,g,y,N,v,A=arguments[0],C=1,S=arguments.length,M=!1;for(typeof A=="boolean"&&(M=A,A=arguments[1]||{},C=2),(A==null||typeof A!="object"&&typeof A!="function")&&(A={});C<S;++C)if(h=arguments[C],h!=null)for(b in h)g=f(A,b),y=f(h,b),A!==y&&(M&&y&&(u(y)||(N=o(y)))?(N?(N=!1,v=g&&o(g)?g:[]):v=g&&u(g)?g:{},c(A,{name:b,newValue:m(M,v,y)})):typeof y<"u"&&c(A,{name:b,newValue:y}));return A},km}var z4=F4();const Rm=zc(z4);function gh(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 $4(){const e=[],t={run:a,use:r};return t;function a(...o){let u=-1;const c=o.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);f(null,...o);function f(m,...h){const b=e[++u];let g=-1;if(m){c(m);return}for(;++g<o.length;)(h[g]===null||h[g]===void 0)&&(h[g]=o[g]);o=h,b?q4(b,f)(...h):c(null,...h)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function q4(e,t){let a;return r;function r(...c){const f=e.length>c.length;let m;f&&c.push(o);try{m=e.apply(this,c)}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(c,...f){a||(a=!0,t(c,...f))}function u(c){o(null,c)}}const Wa={basename:Y4,dirname:G4,extname:K4,join:V4,sep:"/"};function Y4(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Bo(e);let a=0,r=-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 r<0&&(u=!0,r=o+1);return r<0?"":e.slice(a,r)}if(t===e)return"";let c=-1,f=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(u){a=o+1;break}}else c<0&&(u=!0,c=o+1),f>-1&&(e.codePointAt(o)===t.codePointAt(f--)?f<0&&(r=o):(f=-1,r=c));return a===r?r=c:r<0&&(r=e.length),e.slice(a,r)}function G4(e){if(Bo(e),e.length===0)return".";let t=-1,a=e.length,r;for(;--a;)if(e.codePointAt(a)===47){if(r){t=a;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function K4(e){Bo(e);let t=e.length,a=-1,r=0,o=-1,u=0,c;for(;t--;){const f=e.codePointAt(t);if(f===47){if(c){r=t+1;break}continue}a<0&&(c=!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===r+1?"":e.slice(o,a)}function V4(...e){let t=-1,a;for(;++t<e.length;)Bo(e[t]),e[t]&&(a=a===void 0?e[t]:a+"/"+e[t]);return a===void 0?".":X4(a)}function X4(e){Bo(e);const t=e.codePointAt(0)===47;let a=Q4(e,!t);return a.length===0&&!t&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),t?"/"+a:a}function Q4(e,t){let a="",r=0,o=-1,u=0,c=-1,f,m;for(;++c<=e.length;){if(c<e.length)f=e.codePointAt(c);else{if(f===47)break;f=47}if(f===47){if(!(o===c-1||u===1))if(o!==c-1&&u===2){if(a.length<2||r!==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="",r=0):(a=a.slice(0,m),r=a.length-1-a.lastIndexOf("/")),o=c,u=0;continue}}else if(a.length>0){a="",r=0,o=c,u=0;continue}}t&&(a=a.length>0?a+"/..":"..",r=2)}else a.length>0?a+="/"+e.slice(o+1,c):a=e.slice(o+1,c),r=c-o-1;o=c,u=0}else f===46&&u>-1?u++:u=-1}return a}function Bo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const W4={cwd:Z4};function Z4(){return"/"}function bh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function J4(e){if(typeof e=="string")e=new URL(e);else if(!bh(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 eO(e)}function eO(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let a=-1;for(;++a<t.length;)if(t.codePointAt(a)===37&&t.codePointAt(a+1)===50){const r=t.codePointAt(a+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const Om=["history","path","basename","stem","extname","dirname"];class kN{constructor(t){let a;t?bh(t)?a={path:t}:typeof t=="string"||tO(t)?a={value:t}:a=t:a={},this.cwd="cwd"in a?"":W4.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Om.length;){const u=Om[r];u in a&&a[u]!==void 0&&a[u]!==null&&(this[u]=u==="history"?[...a[u]]:a[u])}let o;for(o in a)Om.includes(o)||(this[o]=a[o])}get basename(){return typeof this.path=="string"?Wa.basename(this.path):void 0}set basename(t){Mm(t,"basename"),Im(t,"basename"),this.path=Wa.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Wa.dirname(this.path):void 0}set dirname(t){_1(this.basename,"dirname"),this.path=Wa.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Wa.extname(this.path):void 0}set extname(t){if(Im(t,"extname"),_1(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=Wa.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){bh(t)&&(t=J4(t)),Mm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Wa.basename(this.path,this.extname):void 0}set stem(t){Mm(t,"stem"),Im(t,"stem"),this.path=Wa.join(this.dirname||"",t+(this.extname||""))}fail(t,a,r){const o=this.message(t,a,r);throw o.fatal=!0,o}info(t,a,r){const o=this.message(t,a,r);return o.fatal=void 0,o}message(t,a,r){const o=new In(t,a,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Im(e,t){if(e&&e.includes(Wa.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Wa.sep+"`")}function Mm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function _1(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function tO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const nO=(function(e){const r=this.constructor.prototype,o=r[e],u=function(){return o.apply(u,arguments)};return Object.setPrototypeOf(u,r),u}),aO={}.hasOwnProperty;class cp extends nO{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=$4()}copy(){const t=new cp;let a=-1;for(;++a<this.attachers.length;){const r=this.attachers[a];t.use(...r)}return t.data(Rm(!0,{},this.namespace)),t}data(t,a){return typeof t=="string"?arguments.length===2?(jm("data",this.frozen),this.namespace[t]=a,this):aO.call(this.namespace,t)&&this.namespace[t]||void 0:t?(jm("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,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=a.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const a=lc(t),r=this.parser||this.Parser;return Dm("parse",r),r(String(a),a)}process(t,a){const r=this;return this.freeze(),Dm("process",this.parser||this.Parser),Lm("process",this.compiler||this.Compiler),a?o(void 0,a):new Promise(o);function o(u,c){const f=lc(t),m=r.parse(f);r.run(m,f,function(b,g,y){if(b||!g||!y)return h(b);const N=g,v=r.stringify(N,y);iO(v)?y.value=v:y.result=v,h(b,y)});function h(b,g){b||!g?c(b):u?u(g):a(void 0,g)}}}processSync(t){let a=!1,r;return this.freeze(),Dm("processSync",this.parser||this.Parser),Lm("processSync",this.compiler||this.Compiler),this.process(t,o),S1("processSync","process",a),r;function o(u,c){a=!0,N1(u),r=c}}run(t,a,r){v1(t),this.freeze();const o=this.transformers;return!r&&typeof a=="function"&&(r=a,a=void 0),r?u(void 0,r):new Promise(u);function u(c,f){const m=lc(a);o.run(t,m,h);function h(b,g,y){const N=g||t;b?f(b):c?c(N):r(void 0,N,y)}}}runSync(t,a){let r=!1,o;return this.run(t,a,u),S1("runSync","run",r),o;function u(c,f){N1(c),o=f,r=!0}}stringify(t,a){this.freeze();const r=lc(a),o=this.compiler||this.Compiler;return Lm("stringify",o),v1(t),o(t,r)}use(t,...a){const r=this.attachers,o=this.namespace;if(jm("use",this.frozen),t!=null)if(typeof t=="function")m(t,a);else if(typeof t=="object")Array.isArray(t)?f(t):c(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 c(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function c(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=Rm(!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<r.length;)if(r[g][0]===h){y=g;break}if(y===-1)r.push([h,...b]);else if(b.length>0){let[N,...v]=b;const A=r[y][1];gh(A)&&gh(N)&&(N=Rm(!0,A,N)),r[y]=[h,N,...v]}}}}const sO=new cp().freeze();function Dm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Lm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function jm(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 v1(e){if(!gh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function S1(e,t,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function lc(e){return rO(e)?e:new kN(e)}function rO(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function iO(e){return typeof e=="string"||lO(e)}function lO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const oO="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",A1=[],C1={allowDangerousHtml:!0},uO=/^(https?|ircs?|mailto|xmpp)$/i,cO=[{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 Yi(e){const t=dO(e),a=fO(e);return mO(t.runSync(t.parse(a),a),e)}function dO(e){const t=e.rehypePlugins||A1,a=e.remarkPlugins||A1,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...C1}:C1;return sO().use(GR).use(a).use(H4,r).use(t)}function fO(e){const t=e.children||"",a=new kN;return typeof t=="string"&&(a.value=t),a}function mO(e,t){const a=t.allowedElements,r=t.allowElement,o=t.components,u=t.disallowedElements,c=t.skipHtml,f=t.unwrapDisallowed,m=t.urlTransform||hO;for(const b of cO)Object.hasOwn(t,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+oO+b.id,void 0);return jo(e,h),kw(e,{Fragment:i.Fragment,components:o,ignoreInvalidStyle:!0,jsx:i.jsx,jsxs:i.jsxs,passKeys:!0,passNode:!0});function h(b,g,y){if(b.type==="raw"&&y&&typeof g=="number")return c?y.children.splice(g,1):y.children[g]={type:"text",value:b.value},g;if(b.type==="element"){let N;for(N in Am)if(Object.hasOwn(Am,N)&&Object.hasOwn(b.properties,N)){const v=b.properties[N],A=Am[N];(A===null||A.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&&r&&typeof g=="number"&&(N=!r(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 hO(e){const t=e.indexOf(":"),a=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||a!==-1&&t>a||r!==-1&&t>r||uO.test(e.slice(0,t))?e:""}function w1(e,t){const a=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,o=a.indexOf(t);for(;o!==-1;)r++,o=a.indexOf(t,o+t.length);return r}function pO(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function gO(e,t,a){const o=Lo((a||{}).ignore||[]),u=bO(t);let c=-1;for(;++c<u.length;)wN(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[c][0],N=u[c][1];let v=0;const C=g.children.indexOf(h);let S=!1,M=[];y.lastIndex=0;let O=y.exec(h.value);for(;O;){const j=O.index,I={index:O.index,input:O.input,stack:[...b,h]};let U=N(...O,I);if(typeof U=="string"&&(U=U.length>0?{type:"text",value:U}:void 0),U===!1?y.lastIndex=j+1:(v!==j&&M.push({type:"text",value:h.value.slice(v,j)}),Array.isArray(U)?M.push(...U):U&&M.push(U),v=j+O[0].length,S=!0),!y.global)break;O=y.exec(h.value)}return S?(v<h.value.length&&M.push({type:"text",value:h.value.slice(v)}),g.children.splice(C,1,...M)):M=[h],C+M.length}}function bO(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 r=-1;for(;++r<a.length;){const o=a[r];t.push([xO(o[0]),EO(o[1])])}return t}function xO(e){return typeof e=="string"?new RegExp(pO(e),"g"):e}function EO(e){return typeof e=="function"?e:function(){return e}}const Bm="phrasing",Pm=["autolink","link","image","label"];function yO(){return{transforms:[CO],enter:{literalAutolink:TO,literalAutolinkEmail:Um,literalAutolinkHttp:Um,literalAutolinkWww:Um},exit:{literalAutolink:AO,literalAutolinkEmail:SO,literalAutolinkHttp:_O,literalAutolinkWww:vO}}}function NO(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Bm,notInConstruct:Pm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Bm,notInConstruct:Pm},{character:":",before:"[ps]",after:"\\/",inConstruct:Bm,notInConstruct:Pm}]}}function TO(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Um(e){this.config.enter.autolinkProtocol.call(this,e)}function _O(e){this.config.exit.autolinkProtocol.call(this,e)}function vO(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 SO(e){this.config.exit.autolinkEmail.call(this,e)}function AO(e){this.exit(e)}function CO(e){gO(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,wO],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),kO]],{ignore:["link","linkReference"]})}function wO(e,t,a,r,o){let u="";if(!RN(o)||(/^w/i.test(t)&&(a=t+a,t="",u="http://"),!RO(a)))return!1;const c=OO(a+r);if(!c[0])return!1;const f={type:"link",title:null,url:u+t+c[0],children:[{type:"text",value:t+c[0]}]};return c[1]?[f,{type:"text",value:c[1]}]:f}function kO(e,t,a,r){return!RN(r,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function RO(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 OO(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let a=t[0],r=a.indexOf(")");const o=w1(e,"(");let u=w1(e,")");for(;r!==-1&&o>u;)e+=a.slice(0,r+1),a=a.slice(r+1),r=a.indexOf(")"),u++;return[e,a]}function RN(e,t){const a=e.input.charCodeAt(e.index-1);return(e.index===0||qr(a)||ed(a))&&(!t||a!==47)}ON.peek=HO;function IO(){this.buffer()}function MO(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function DO(){this.buffer()}function LO(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function jO(e){const t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Ha(this.sliceSerialize(e)).toLowerCase(),a.label=t}function BO(e){this.exit(e)}function PO(e){const t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Ha(this.sliceSerialize(e)).toLowerCase(),a.label=t}function UO(e){this.exit(e)}function HO(){return"["}function ON(e,t,a,r){const o=a.createTracker(r);let u=o.move("[^");const c=a.enter("footnoteReference"),f=a.enter("reference");return u+=o.move(a.safe(a.associationId(e),{after:"]",before:u})),f(),c(),u+=o.move("]"),u}function FO(){return{enter:{gfmFootnoteCallString:IO,gfmFootnoteCall:MO,gfmFootnoteDefinitionLabelString:DO,gfmFootnoteDefinition:LO},exit:{gfmFootnoteCallString:jO,gfmFootnoteCall:BO,gfmFootnoteDefinitionLabelString:PO,gfmFootnoteDefinition:UO}}}function zO(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:a,footnoteReference:ON},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(r,o,u,c){const f=u.createTracker(c);let m=f.move("[^");const h=u.enter("footnoteDefinition"),b=u.enter("label");return m+=f.move(u.safe(u.associationId(r),{before:m,after:"]"})),b(),m+=f.move("]:"),r.children&&r.children.length>0&&(f.shift(4),m+=f.move((t?`
476
- `:" ")+u.indentLines(u.containerFlow(r,f.current()),t?IN:$O))),h(),m}}function $O(e,t,a){return t===0?e:IN(e,t,a)}function IN(e,t,a){return(a?"":" ")+e}const qO=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];MN.peek=XO;function YO(){return{canContainEols:["delete"],enter:{strikethrough:KO},exit:{strikethrough:VO}}}function GO(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:qO}],handlers:{delete:MN}}}function KO(e){this.enter({type:"delete",children:[]},e)}function VO(e){this.exit(e)}function MN(e,t,a,r){const o=a.createTracker(r),u=a.enter("strikethrough");let c=o.move("~~");return c+=a.containerPhrasing(e,{...o.current(),before:c,after:"~"}),c+=o.move("~~"),u(),c}function XO(){return"~"}function QO(e){return e.length}function WO(e,t){const a=t||{},r=(a.align||[]).concat(),o=a.stringLength||QO,u=[],c=[],f=[],m=[];let h=0,b=-1;for(;++b<e.length;){const A=[],C=[];let S=-1;for(e[b].length>h&&(h=e[b].length);++S<e[b].length;){const M=ZO(e[b][S]);if(a.alignDelimiters!==!1){const O=o(M);C[S]=O,(m[S]===void 0||O>m[S])&&(m[S]=O)}A.push(M)}c[b]=A,f[b]=C}let g=-1;if(typeof r=="object"&&"length"in r)for(;++g<h;)u[g]=k1(r[g]);else{const A=k1(r);for(;++g<h;)u[g]=A}g=-1;const y=[],N=[];for(;++g<h;){const A=u[g];let C="",S="";A===99?(C=":",S=":"):A===108?C=":":A===114&&(S=":");let M=a.alignDelimiters===!1?1:Math.max(1,m[g]-C.length-S.length);const O=C+"-".repeat(M)+S;a.alignDelimiters!==!1&&(M=C.length+M+S.length,M>m[g]&&(m[g]=M),N[g]=M),y[g]=O}c.splice(1,0,y),f.splice(1,0,N),b=-1;const v=[];for(;++b<c.length;){const A=c[b],C=f[b];g=-1;const S=[];for(;++g<h;){const M=A[g]||"";let O="",j="";if(a.alignDelimiters!==!1){const I=m[g]-(C[g]||0),U=u[g];U===114?O=" ".repeat(I):U===99?I%2?(O=" ".repeat(I/2+.5),j=" ".repeat(I/2-.5)):(O=" ".repeat(I/2),j=O):j=" ".repeat(I)}a.delimiterStart!==!1&&!g&&S.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&M==="")&&(a.delimiterStart!==!1||g)&&S.push(" "),a.alignDelimiters!==!1&&S.push(O),S.push(M),a.alignDelimiters!==!1&&S.push(j),a.padding!==!1&&S.push(" "),(a.delimiterEnd!==!1||g!==h-1)&&S.push("|")}v.push(a.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return v.join(`
477
- `)}function ZO(e){return e==null?"":String(e)}function k1(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 R1={}.hasOwnProperty;function DN(e,t){const a=t||{};function r(o,...u){let c=r.invalid;const f=r.handlers;if(o&&R1.call(o,e)){const m=String(o[e]);c=R1.call(f,m)?f[m]:r.unknown}if(c)return c.call(this,o,...u)}return r.handlers=a.handlers||{},r.invalid=a.invalid,r.unknown=a.unknown,r}function JO(e,t,a,r){const o=a.enter("blockquote"),u=a.createTracker(r);u.move("> "),u.shift(2);const c=a.indentLines(a.containerFlow(e,u.current()),eI);return o(),c}function eI(e,t,a){return">"+(a?"":" ")+e}function tI(e,t){return O1(e,t.inConstruct,!0)&&!O1(e,t.notInConstruct,!1)}function O1(e,t,a){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return a;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function I1(e,t,a,r){let o=-1;for(;++o<a.unsafe.length;)if(a.unsafe[o].character===`
478
- `&&tI(a.stack,a.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return`\\
479
- `}function nI(e,t){const a=String(e);let r=a.indexOf(t),o=r,u=0,c=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===o?++u>c&&(c=u):u=1,o=r+t.length,r=a.indexOf(t,o);return c}function aI(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 sI(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 rI(e,t,a,r){const o=sI(a),u=e.value||"",c=o==="`"?"GraveAccent":"Tilde";if(aI(e,a)){const g=a.enter("codeIndented"),y=a.indentLines(u,iI);return g(),y}const f=a.createTracker(r),m=o.repeat(Math.max(nI(u,o)+1,3)),h=a.enter("codeFenced");let b=f.move(m);if(e.lang){const g=a.enter(`codeFencedLang${c}`);b+=f.move(a.safe(e.lang,{before:b,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=a.enter(`codeFencedMeta${c}`);b+=f.move(" "),b+=f.move(a.safe(e.meta,{before:b,after:`
480
- `,encode:["`"],...f.current()})),g()}return b+=f.move(`
481
- `),u&&(b+=f.move(u+`
482
- `)),b+=f.move(m),h(),b}function iI(e,t,a){return(a?"":" ")+e}function dp(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 lI(e,t,a,r){const o=dp(a),u=o==='"'?"Quote":"Apostrophe",c=a.enter("definition");let f=a.enter("label");const m=a.createTracker(r);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?" ":`
483
- `,...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()),c(),h}function oI(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 So(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Mc(e,t,a){const r=$i(e),o=$i(t);return r===void 0?o===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===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}}LN.peek=uI;function LN(e,t,a,r){const o=oI(a),u=a.enter("emphasis"),c=a.createTracker(r),f=c.move(o);let m=c.move(a.containerPhrasing(e,{after:o,before:f,...c.current()}));const h=m.charCodeAt(0),b=Mc(r.before.charCodeAt(r.before.length-1),h,o);b.inside&&(m=So(h)+m.slice(1));const g=m.charCodeAt(m.length-1),y=Mc(r.after.charCodeAt(0),g,o);y.inside&&(m=m.slice(0,-1)+So(g));const N=c.move(o);return u(),a.attentionEncodeSurroundingInfo={after:y.outside,before:b.outside},f+m+N}function uI(e,t,a){return a.options.emphasis||"*"}function cI(e,t){let a=!1;return jo(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return a=!0,hh}),!!((!e.depth||e.depth<3)&&ap(e)&&(t.options.setext||a))}function dI(e,t,a,r){const o=Math.max(Math.min(6,e.depth||1),1),u=a.createTracker(r);if(cI(e,a)){const b=a.enter("headingSetext"),g=a.enter("phrasing"),y=a.containerPhrasing(e,{...u.current(),before:`
484
- `,after:`
485
- `});return g(),b(),y+`
486
- `+(o===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
487
- `))+1))}const c="#".repeat(o),f=a.enter("headingAtx"),m=a.enter("phrasing");u.move(c+" ");let h=a.containerPhrasing(e,{before:"# ",after:`
488
- `,...u.current()});return/^[\t ]/.test(h)&&(h=So(h.charCodeAt(0))+h.slice(1)),h=h?c+" "+h:c,a.options.closeAtx&&(h+=" "+c),m(),f(),h}jN.peek=fI;function jN(e){return e.value||""}function fI(){return"<"}BN.peek=mI;function BN(e,t,a,r){const o=dp(a),u=o==='"'?"Quote":"Apostrophe",c=a.enter("image");let f=a.enter("label");const m=a.createTracker(r);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(")"),c(),h}function mI(){return"!"}PN.peek=hI;function PN(e,t,a,r){const o=e.referenceType,u=a.enter("imageReference");let c=a.enter("label");const f=a.createTracker(r);let m=f.move("![");const h=a.safe(e.alt,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),c();const b=a.stack;a.stack=[],c=a.enter("reference");const g=a.safe(a.associationId(e),{before:m,after:"]",...f.current()});return c(),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 hI(){return"!"}UN.peek=pI;function UN(e,t,a){let r=e.value||"",o="`",u=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++u<a.unsafe.length;){const c=a.unsafe[u],f=a.compilePattern(c);let m;if(c.atBreak)for(;m=f.exec(r);){let h=m.index;r.charCodeAt(h)===10&&r.charCodeAt(h-1)===13&&h--,r=r.slice(0,h)+" "+r.slice(m.index+1)}}return o+r+o}function pI(){return"`"}function HN(e,t){const a=ap(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))}FN.peek=gI;function FN(e,t,a,r){const o=dp(a),u=o==='"'?"Quote":"Apostrophe",c=a.createTracker(r);let f,m;if(HN(e,a)){const b=a.stack;a.stack=[],f=a.enter("autolink");let g=c.move("<");return g+=c.move(a.containerPhrasing(e,{before:g,after:">",...c.current()})),g+=c.move(">"),f(),a.stack=b,g}f=a.enter("link"),m=a.enter("label");let h=c.move("[");return h+=c.move(a.containerPhrasing(e,{before:h,after:"](",...c.current()})),h+=c.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=a.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(a.safe(e.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(m=a.enter("destinationRaw"),h+=c.move(a.safe(e.url,{before:h,after:e.title?" ":")",...c.current()}))),m(),e.title&&(m=a.enter(`title${u}`),h+=c.move(" "+o),h+=c.move(a.safe(e.title,{before:h,after:o,...c.current()})),h+=c.move(o),m()),h+=c.move(")"),f(),h}function gI(e,t,a){return HN(e,a)?"<":"["}zN.peek=bI;function zN(e,t,a,r){const o=e.referenceType,u=a.enter("linkReference");let c=a.enter("label");const f=a.createTracker(r);let m=f.move("[");const h=a.containerPhrasing(e,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),c();const b=a.stack;a.stack=[],c=a.enter("reference");const g=a.safe(a.associationId(e),{before:m,after:"]",...f.current()});return c(),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 bI(){return"["}function fp(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 xI(e){const t=fp(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 EI(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 $N(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 yI(e,t,a,r){const o=a.enter("list"),u=a.bulletCurrent;let c=e.ordered?EI(a):fp(a);const f=e.ordered?c==="."?")":".":xI(a);let m=t&&a.bulletLastUsed?c===a.bulletLastUsed:!1;if(!e.ordered){const b=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&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),$N(a)===c&&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&&(c=f),a.bulletCurrent=c;const h=a.containerFlow(e,r);return a.bulletLastUsed=c,a.bulletCurrent=u,o(),h}function NI(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 TI(e,t,a,r){const o=NI(a);let u=a.bulletCurrent||fp(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 c=u.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(c=Math.ceil(c/4)*4);const f=a.createTracker(r);f.move(u+" ".repeat(c-u.length)),f.shift(c);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(c))+g:(N?u:u+" ".repeat(c-u.length))+g}}function _I(e,t,a,r){const o=a.enter("paragraph"),u=a.enter("phrasing"),c=a.containerPhrasing(e,r);return u(),o(),c}const vI=Lo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function SI(e,t,a,r){return(e.children.some(function(c){return vI(c)})?a.containerPhrasing:a.containerFlow).call(a,e,r)}function AI(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}qN.peek=CI;function qN(e,t,a,r){const o=AI(a),u=a.enter("strong"),c=a.createTracker(r),f=c.move(o+o);let m=c.move(a.containerPhrasing(e,{after:o,before:f,...c.current()}));const h=m.charCodeAt(0),b=Mc(r.before.charCodeAt(r.before.length-1),h,o);b.inside&&(m=So(h)+m.slice(1));const g=m.charCodeAt(m.length-1),y=Mc(r.after.charCodeAt(0),g,o);y.inside&&(m=m.slice(0,-1)+So(g));const N=c.move(o+o);return u(),a.attentionEncodeSurroundingInfo={after:y.outside,before:b.outside},f+m+N}function CI(e,t,a){return a.options.strong||"*"}function wI(e,t,a,r){return a.safe(e.value,r)}function kI(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 RI(e,t,a){const r=($N(a)+(a.options.ruleSpaces?" ":"")).repeat(kI(a));return a.options.ruleSpaces?r.slice(0,-1):r}const YN={blockquote:JO,break:I1,code:rI,definition:lI,emphasis:LN,hardBreak:I1,heading:dI,html:jN,image:BN,imageReference:PN,inlineCode:UN,link:FN,linkReference:zN,list:yI,listItem:TI,paragraph:_I,root:SI,strong:qN,text:wI,thematicBreak:RI};function OI(){return{enter:{table:II,tableData:M1,tableHeader:M1,tableRow:DI},exit:{codeText:LI,table:MI,tableData:Hm,tableHeader:Hm,tableRow:Hm}}}function II(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 MI(e){this.exit(e),this.data.inTable=void 0}function DI(e){this.enter({type:"tableRow",children:[]},e)}function Hm(e){this.exit(e)}function M1(e){this.enter({type:"tableCell",children:[]},e)}function LI(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,jI));const a=this.stack[this.stack.length-1];a.type,a.value=t,this.exit(e)}function jI(e,t){return t==="|"?t:e}function BI(e){const t=e||{},a=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,u=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
489
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:c,tableCell:m,tableRow:f}};function c(N,v,A,C){return h(b(N,A,C),N.align)}function f(N,v,A,C){const S=g(N,A,C),M=h([S]);return M.slice(0,M.indexOf(`
490
- `))}function m(N,v,A,C){const S=A.enter("tableCell"),M=A.enter("phrasing"),O=A.containerPhrasing(N,{...C,before:u,after:u});return M(),S(),O}function h(N,v){return WO(N,{align:v,alignDelimiters:r,padding:a,stringLength:o})}function b(N,v,A){const C=N.children;let S=-1;const M=[],O=v.enter("table");for(;++S<C.length;)M[S]=g(C[S],v,A);return O(),M}function g(N,v,A){const C=N.children;let S=-1;const M=[],O=v.enter("tableRow");for(;++S<C.length;)M[S]=m(C[S],N,v,A);return O(),M}function y(N,v,A){let C=YN.inlineCode(N,v,A);return A.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function PI(){return{exit:{taskListCheckValueChecked:D1,taskListCheckValueUnchecked:D1,paragraph:HI}}}function UI(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:FI}}}function D1(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function HI(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 r=a.children[0];if(r&&r.type==="text"){const o=t.children;let u=-1,c;for(;++u<o.length;){const f=o[u];if(f.type==="paragraph"){c=f;break}}c===a&&(r.value=r.value.slice(1),r.value.length===0?a.children.shift():a.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,a.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function FI(e,t,a,r){const o=e.children[0],u=typeof e.checked=="boolean"&&o&&o.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",f=a.createTracker(r);u&&f.move(c);let m=YN.listItem(e,t,a,{...r,...f.current()});return u&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(b){return b+c}}function zI(){return[yO(),FO(),YO(),OI(),PI()]}function $I(e){return{extensions:[NO(),zO(e),GO(),BI(e),UI()]}}const qI={tokenize:QI,partial:!0},GN={tokenize:WI,partial:!0},KN={tokenize:ZI,partial:!0},VN={tokenize:JI,partial:!0},YI={tokenize:e6,partial:!0},XN={name:"wwwAutolink",tokenize:VI,previous:WN},QN={name:"protocolAutolink",tokenize:XI,previous:ZN},ws={name:"emailAutolink",tokenize:KI,previous:JN},ns={};function GI(){return{text:ns}}let Mr=48;for(;Mr<123;)ns[Mr]=ws,Mr++,Mr===58?Mr=65:Mr===91&&(Mr=97);ns[43]=ws;ns[45]=ws;ns[46]=ws;ns[95]=ws;ns[72]=[ws,QN];ns[104]=[ws,QN];ns[87]=[ws,XN];ns[119]=[ws,XN];function KI(e,t,a){const r=this;let o,u;return c;function c(g){return!xh(g)||!JN.call(r,r.previous)||mp(r.events)?a(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return xh(g)?(e.consume(g),f):g===64?(e.consume(g),m):a(g)}function m(g){return g===46?e.check(YI,b,h)(g):g===45||g===95||Rn(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&&Fn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):a(g)}}function VI(e,t,a){const r=this;return o;function o(c){return c!==87&&c!==119||!WN.call(r,r.previous)||mp(r.events)?a(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(qI,e.attempt(GN,e.attempt(KN,u),a),a)(c))}function u(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function XI(e,t,a){const r=this;let o="",u=!1;return c;function c(g){return(g===72||g===104)&&ZN.call(r,r.previous)&&!mp(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(g),e.consume(g),f):a(g)}function f(g){if(Fn(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)||Ot(g)||qr(g)||ed(g)?a(g):e.attempt(GN,e.attempt(KN,b),a)(g)}function b(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function QI(e,t,a){let r=0;return o;function o(c){return(c===87||c===119)&&r<3?(r++,e.consume(c),o):c===46&&r===3?(e.consume(c),u):a(c)}function u(c){return c===null?a(c):t(c)}}function WI(e,t,a){let r,o,u;return c;function c(h){return h===46||h===95?e.check(VN,m,f)(h):h===null||Ot(h)||qr(h)||h!==45&&ed(h)?m(h):(u=!0,e.consume(h),c)}function f(h){return h===95?r=!0:(o=r,r=void 0),e.consume(h),c}function m(h){return o||r||!u?a(h):t(h)}}function ZI(e,t){let a=0,r=0;return o;function o(c){return c===40?(a++,e.consume(c),o):c===41&&r<a?u(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(VN,t,u)(c):c===null||Ot(c)||qr(c)?t(c):(e.consume(c),o)}function u(c){return c===41&&r++,e.consume(c),o}}function JI(e,t,a){return r;function r(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),r):f===38?(e.consume(f),u):f===93?(e.consume(f),o):f===60||f===null||Ot(f)||qr(f)?t(f):a(f)}function o(f){return f===null||f===40||f===91||Ot(f)||qr(f)?t(f):r(f)}function u(f){return Fn(f)?c(f):a(f)}function c(f){return f===59?(e.consume(f),r):Fn(f)?(e.consume(f),c):a(f)}}function e6(e,t,a){return r;function r(u){return e.consume(u),o}function o(u){return Rn(u)?a(u):t(u)}}function WN(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ot(e)}function ZN(e){return!Fn(e)}function JN(e){return!(e===47||xh(e))}function xh(e){return e===43||e===45||e===46||e===95||Rn(e)}function mp(e){let t=e.length,a=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){a=!0;break}if(r._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const t6={tokenize:u6,partial:!0};function n6(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:i6,continuation:{tokenize:l6},exit:o6}},text:{91:{name:"gfmFootnoteCall",tokenize:r6},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:a6,resolveTo:s6}}}}function a6(e,t,a){const r=this;let o=r.events.length;const u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c;for(;o--;){const m=r.events[o][1];if(m.type==="labelImage"){c=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(!c||!c._balanced)return a(m);const h=Ha(r.sliceSerialize({start:c.end,end:r.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 s6(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 r={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)},c={type:"chunkString",contentType:"string",start:Object.assign({},u.start),end:Object.assign({},u.end)},f=[e[a+1],e[a+2],["enter",r,t],e[a+3],e[a+4],["enter",o,t],["exit",o,t],["enter",u,t],["enter",c,t],["exit",c,t],["exit",u,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(a,e.length-a+1,...f),e}function r6(e,t,a){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u=0,c;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&&!c||g===null||g===91||Ot(g))return a(g);if(g===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return o.includes(Ha(r.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):a(g)}return Ot(g)||(c=!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 i6(e,t,a){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u,c=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(c>999||v===93&&!f||v===null||v===91||Ot(v))return a(v);if(v===93){e.exit("chunkString");const A=e.exit("gfmFootnoteDefinitionLabelString");return u=Ha(r.sliceSerialize(A)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return Ot(v)||(f=!0),c++,e.consume(v),v===92?g:b}function g(v){return v===91||v===92||v===93?(e.consume(v),c++,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 l6(e,t,a){return e.check(Do,t,e.attempt(t6,t,a))}function o6(e){e.exit("gfmFootnoteDefinition")}function u6(e,t,a){const r=this;return ft(e,o,"gfmFootnoteDefinitionIndent",5);function o(u){const c=r.events[r.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?t(u):a(u)}}function c6(e){let a=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:u,resolveAll:o};return a==null&&(a=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(c,f){let m=-1;for(;++m<c.length;)if(c[m][0]==="enter"&&c[m][1].type==="strikethroughSequenceTemporary"&&c[m][1]._close){let h=m;for(;h--;)if(c[h][0]==="exit"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._open&&c[m][1].end.offset-c[m][1].start.offset===c[h][1].end.offset-c[h][1].start.offset){c[m][1].type="strikethroughSequence",c[h][1].type="strikethroughSequence";const b={type:"strikethrough",start:Object.assign({},c[h][1].start),end:Object.assign({},c[m][1].end)},g={type:"strikethroughText",start:Object.assign({},c[h][1].end),end:Object.assign({},c[m][1].start)},y=[["enter",b,f],["enter",c[h][1],f],["exit",c[h][1],f],["enter",g,f]],N=f.parser.constructs.insideSpan.null;N&&xa(y,y.length,0,td(N,c.slice(h+1,m),f)),xa(y,y.length,0,[["exit",g,f],["enter",c[m][1],f],["exit",c[m][1],f],["exit",b,f]]),xa(c,h-1,m-h+3,y),m=h+y.length-2;break}}for(m=-1;++m<c.length;)c[m][1].type==="strikethroughSequenceTemporary"&&(c[m][1].type="data");return c}function u(c,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):(c.enter("strikethroughSequenceTemporary"),N(v))}function N(v){const A=$i(h);if(v===126)return g>1?m(v):(c.consume(v),g++,N);if(g<2&&!a)return m(v);const C=c.exit("strikethroughSequenceTemporary"),S=$i(v);return C._open=!S||S===2&&!!A,C._close=!A||A===2&&!!S,f(v)}}}class d6{constructor(){this.map=[]}add(t,a,r){f6(this,t,a,r)}consume(t){if(this.map.sort(function(u,c){return u[0]-c[0]}),this.map.length===0)return;let a=this.map.length;const r=[];for(;a>0;)a-=1,r.push(t.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),t.length=this.map[a][0];r.push(t.slice()),t.length=0;let o=r.pop();for(;o;){for(const u of o)t.push(u);o=r.pop()}this.map.length=0}}function f6(e,t,a,r){let o=0;if(!(a===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=a,e.map[o][2].push(...r);return}o+=1}e.map.push([t,a,r])}}function m6(e,t){let a=!1;const r=[];for(;t<e.length;){const o=e[t];if(a){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const u=r.length-1;r[u]=r[u]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(a=!0);t+=1}return r}function h6(){return{flow:{null:{name:"table",tokenize:p6,resolveAll:g6}}}}function p6(e,t,a){const r=this;let o=0,u=0,c;return f;function f(D){let te=r.events.length-1;for(;te>-1;){const Q=r.events[te][1].type;if(Q==="lineEnding"||Q==="linePrefix")te--;else break}const le=te>-1?r.events[te][1].type:null,pe=le==="tableHead"||le==="tableRow"?U:m;return pe===U&&r.parser.lazy[r.now().line]?a(D):pe(D)}function m(D){return e.enter("tableHead"),e.enter("tableRow"),h(D)}function h(D){return D===124||(c=!0,u+=1),b(D)}function b(D){return D===null?a(D):Fe(D)?u>1?(u=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),N):a(D):it(D)?ft(e,b,"whitespace")(D):(u+=1,c&&(c=!1,o+=1),D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),c=!0,b):(e.enter("data"),g(D)))}function g(D){return D===null||D===124||Ot(D)?(e.exit("data"),b(D)):(e.consume(D),D===92?y:g)}function y(D){return D===92||D===124?(e.consume(D),g):g(D)}function N(D){return r.interrupt=!1,r.parser.lazy[r.now().line]?a(D):(e.enter("tableDelimiterRow"),c=!1,it(D)?ft(e,v,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):v(D))}function v(D){return D===45||D===58?C(D):D===124?(c=!0,e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),A):I(D)}function A(D){return it(D)?ft(e,C,"whitespace")(D):C(D)}function C(D){return D===58?(u+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),S):D===45?(u+=1,S(D)):D===null||Fe(D)?j(D):I(D)}function S(D){return D===45?(e.enter("tableDelimiterFiller"),M(D)):I(D)}function M(D){return D===45?(e.consume(D),M):D===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),O):(e.exit("tableDelimiterFiller"),O(D))}function O(D){return it(D)?ft(e,j,"whitespace")(D):j(D)}function j(D){return D===124?v(D):D===null||Fe(D)?!c||o!==u?I(D):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(D)):I(D)}function I(D){return a(D)}function U(D){return e.enter("tableRow"),$(D)}function $(D){return D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),$):D===null||Fe(D)?(e.exit("tableRow"),t(D)):it(D)?ft(e,$,"whitespace")(D):(e.enter("data"),Z(D))}function Z(D){return D===null||D===124||Ot(D)?(e.exit("data"),$(D)):(e.consume(D),D===92?K:Z)}function K(D){return D===92||D===124?(e.consume(D),Z):Z(D)}}function g6(e,t){let a=-1,r=!0,o=0,u=[0,0,0,0],c=[0,0,0,0],f=!1,m=0,h,b,g;const y=new d6;for(;++a<e.length;){const N=e[a],v=N[1];N[0]==="enter"?v.type==="tableHead"?(f=!1,m!==0&&(L1(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"?(r=!0,g=void 0,u=[0,0,0,0],c=[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")?(r=!1,c[2]===0&&(u[1]!==0&&(c[0]=c[1],g=oc(y,t,u,o,void 0,g),u=[0,0,0,0]),c[2]=a)):v.type==="tableCellDivider"&&(r?r=!1:(u[1]!==0&&(c[0]=c[1],g=oc(y,t,u,o,void 0,g)),u=c,c=[u[1],a,0,0])):v.type==="tableHead"?(f=!0,m=a):v.type==="tableRow"||v.type==="tableDelimiterRow"?(m=a,u[1]!==0?(c[0]=c[1],g=oc(y,t,u,o,a,g)):c[1]!==0&&(g=oc(y,t,c,o,a,g)),o=0):o&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")&&(c[3]=a)}for(m!==0&&L1(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=m6(t.events,a))}return e}function oc(e,t,a,r,o,u){const c=r===1?"tableHeader":r===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:c,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]]),r!==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,A=a[3]-a[2]-1;e.add(v,A,[])}}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 L1(e,t,a,r,o){const u=[],c=ji(t.events,a);o&&(o.end=Object.assign({},c),u.push(["exit",o,t])),r.end=Object.assign({},c),u.push(["exit",r,t]),e.add(a+1,0,u)}function ji(e,t){const a=e[t],r=a[0]==="enter"?"start":"end";return a[1][r]}const b6={name:"tasklistCheck",tokenize:E6};function x6(){return{text:{91:b6}}}function E6(e,t,a){const r=this;return o;function o(m){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?a(m):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),u)}function u(m){return Ot(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),c):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),c):a(m)}function c(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):a(m)}function f(m){return Fe(m)?t(m):it(m)?e.check({tokenize:y6},t,a)(m):a(m)}}function y6(e,t,a){return ft(e,r,"whitespace");function r(o){return o===null?a(o):t(o)}}function N6(e){return oN([GI(),n6(),c6(e),h6(),x6()])}const T6={};function Gi(e){const t=this,a=e||T6,r=t.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),u=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),c=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(N6(a)),u.push(zI()),c.push($I(a))}const _6=5*1024*1024,j1=10,eT=["image/png","image/jpeg","image/gif","image/webp"];let v6=0;function S6(e){return new Promise((t,a)=>{const r=new FileReader;r.onload=()=>t(String(r.result)),r.onerror=()=>a(r.error),r.readAsDataURL(e)})}function A6({url:e,label:t,onClose:a}){return T.useEffect(()=>{const r=o=>{o.key==="Escape"&&(o.preventDefault(),a())};return window.addEventListener("keydown",r,!0),()=>window.removeEventListener("keydown",r,!0)},[a]),i.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:i.jsx("img",{src:e,alt:t,className:"max-h-full max-w-full object-contain"})})}function tT({url:e,label:t,className:a}){const[r,o]=T.useState(!1);return i.jsxs(i.Fragment,{children:[i.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:i.jsx("img",{src:e,alt:t,className:ne("rounded-md border border-line",a)})}),r&&i.jsx(A6,{url:e,label:t,onClose:()=>o(!1)})]})}function nT(e=!0){const[t,a]=T.useState([]),[r,o]=T.useState(null);T.useEffect(()=>{o(null),e||a([])},[e]);const u=async b=>{const g=[],y=[],N=t.length;let v=j1-N;for(const A of b){if(v<=0){y.push(`最多 ${j1} 张图片`);break}if(!eT.includes(A.type)){y.push(`${A.name||"文件"}:格式不支持`);continue}if(A.size>_6){y.push(`${A.name}:超过 5MB`);continue}g.push({_id:`att-${++v6}`,mime:A.type,url:await S6(A),filename:A.name}),v--}g.length>0&&a(A=>[...A,...g]),o(y.length>0?y.join(";"):null)},c=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=T.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:r,setError:o,addFiles:u,onPaste:c,remove:f,clear:m}}function aT({onFiles:e,disabled:t,allowed:a}){const r=T.useRef(null);return i.jsxs(i.Fragment,{children:[i.jsx("input",{ref:r,type:"file",accept:eT.join(","),multiple:!0,hidden:!0,onChange:o=>{e(Array.from(o.target.files??[])),o.target.value=""}}),i.jsx("button",{type:"button",onClick:()=>{var o;return(o=r.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:i.jsx(A3,{className:"h-4 w-4"})})]})}function sT({attachments:e,error:t,onRemove:a,className:r}){return e.length===0&&!t?null:i.jsxs("div",{className:r,children:[e.length>0&&i.jsx("div",{className:"mb-2 flex flex-wrap gap-2",children:e.map(o=>i.jsxs("div",{className:"group relative",children:[i.jsx(tT,{url:o.url,label:o.filename??"attachment",className:"h-16 w-16 object-cover"}),i.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:i.jsx(gt,{className:"h-2.5 w-2.5",strokeWidth:2.5})})]},o._id))}),t&&i.jsx("div",{className:"mb-2 font-mono text-[11px] text-red-400",children:t})]})}function rT({isListening:e,disabled:t,onStart:a,onStop:r}){const o=T.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,r()};document.addEventListener("touchend",m,{once:!0}),document.addEventListener("touchcancel",m,{once:!0})},c=()=>{if(t||o.current)return;a();const f=()=>{document.removeEventListener("mouseup",f),r()};document.addEventListener("mouseup",f,{once:!0})};return i.jsx("button",{type:"button",disabled:t,onTouchStart:u,onMouseDown:c,onContextMenu:f=>f.preventDefault(),"aria-label":"按住说话",title:"按住说话",style:{WebkitTouchCallout:"none"},className:ne("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:i.jsx(B3,{className:ne("h-6 w-6 sm:h-4 sm:w-4",e&&"animate-pulse")})})}const C6=[.85,1.25,.65,1.4,.75,1.15,.95],Fm=4,B1=24;function w6(e){const t=Math.floor(e/60).toString().padStart(2,"0"),a=Math.floor(e%60).toString().padStart(2,"0");return`${t}:${a}`}function k6({volumeLevel:e}){const t=Math.min(Math.max(e,0),1);return i.jsx("div",{className:"flex h-6 items-center gap-1","aria-hidden":"true",children:C6.map((a,r)=>{const o=Fm+t*a*(B1-Fm),u=Math.max(Fm,Math.min(B1,o));return i.jsx("span",{className:"w-1 rounded-full bg-red-400 transition-[height] duration-150 ease-out",style:{height:`${u}px`}},r)})})}function iT({phase:e,transcript:t,interimTranscript:a,editText:r,onEditTextChange:o,onTextareaKeyDown:u,textareaRef:c,wrapperClassName:f}){if(e==="idle")return null;const m=t.length>0||a.length>0;return i.jsx("div",{className:f,children:i.jsxs("div",{className:"max-h-[40vh] overflow-y-auto px-4 py-4",children:[e==="recording"&&i.jsx("div",{className:"text-xl leading-relaxed",children:m?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-fg",children:t}),a&&i.jsx("span",{className:"text-fg-4",children:a})]}):i.jsx("span",{className:"italic text-fg-5",children:"正在聆听…"})}),e==="recognizing"&&i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(ln,{className:"h-5 w-5 shrink-0 text-emerald-400 fs-spin"}),i.jsx("span",{className:"font-mono text-sm text-emerald-400",children:"识别中…"}),a&&i.jsx("span",{className:"truncate text-base text-fg-4",children:a})]}),e==="done"&&i.jsx("textarea",{ref:c,value:r,onChange:h=>o(h.target.value),onKeyDown:u,rows:2,placeholder:"识别结果(可编辑)",className:"w-full resize-none bg-transparent text-xl leading-relaxed text-fg placeholder:text-fg-5 focus:outline-none"})]})})}function lT({phase:e,volumeLevel:t,elapsed:a,editText:r,error:o,onCancel:u,onConfirm:c,idleHint:f,className:m}){return e==="idle"?i.jsx("div",{className:m,children:o?i.jsx("span",{className:"font-mono text-[10px] text-red-400",children:o}):f?i.jsx("span",{className:"font-mono text-[10px] text-fg-6",children:f}):null}):e==="done"?i.jsxs("div",{className:m,children:[i.jsx("span",{className:"hidden font-mono text-[10px] text-fg-6 sm:inline",children:"⌘/Ctrl+⏎ 发送 · Esc 取消"}),i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("button",{type:"button",onClick:u,className:"rounded-md border border-line px-3 py-1 text-xs text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:"取消"}),i.jsxs("button",{type:"button",onClick:c,disabled:r.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:[i.jsx(Eo,{className:"h-3.5 w-3.5",strokeWidth:2.5}),i.jsx("span",{children:"发送"})]})]})]}):i.jsx("div",{className:m,children:e==="recording"?i.jsxs(i.Fragment,{children:[i.jsx(k6,{volumeLevel:t}),i.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-[11px] font-medium text-red-400",children:[i.jsx("span",{className:"h-1.5 w-1.5 shrink-0 animate-pulse rounded-full bg-red-400"}),"录音中"]}),i.jsx("span",{className:"font-mono text-[11px] tabular-nums text-fg-4",children:w6(a)})]}):i.jsxs(i.Fragment,{children:[i.jsx(ln,{className:"h-4 w-4 shrink-0 text-emerald-400 fs-spin"}),i.jsx("span",{className:"font-mono text-[11px] text-emerald-400",children:"识别中…"})]})})}/*! Capacitor: https://capacitorjs.com/ - MIT License */var Ki;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(Ki||(Ki={}));class zm extends Error{constructor(t,a,r){super(t),this.message=t,this.code=a,this.data=r}}const R6=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"},O6=e=>{const t=e.CapacitorCustomPlatform||null,a=e.Capacitor||{},r=a.Plugins=a.Plugins||{},o=()=>t!==null?t.name:R6(e),u=()=>o()!=="web",c=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(),A=f(g);let C;const S=async()=>(!C&&v in y?C=typeof y[v]=="function"?C=await y[v]():C=y[v]:t!==null&&!C&&"web"in y&&(C=typeof y.web=="function"?C=await y.web():C=y.web),C),M=(Z,K)=>{var D,te;if(A){const le=A==null?void 0:A.methods.find(pe=>K===pe.name);if(le)return le.rtype==="promise"?pe=>a.nativePromise(g,K.toString(),pe):(pe,Q)=>a.nativeCallback(g,K.toString(),pe,Q);if(Z)return(D=Z[K])===null||D===void 0?void 0:D.bind(Z)}else{if(Z)return(te=Z[K])===null||te===void 0?void 0:te.bind(Z);throw new zm(`"${g}" plugin is not implemented on ${v}`,Ki.Unimplemented)}},O=Z=>{let K;const D=(...te)=>{const le=S().then(pe=>{const Q=M(pe,Z);if(Q){const q=Q(...te);return K=q==null?void 0:q.remove,q}else throw new zm(`"${g}.${Z}()" is not implemented on ${v}`,Ki.Unimplemented)});return Z==="addListener"&&(le.remove=async()=>K()),le};return D.toString=()=>`${Z.toString()}() { [capacitor code] }`,Object.defineProperty(D,"name",{value:Z,writable:!1,configurable:!1}),D},j=O("addListener"),I=O("removeListener"),U=(Z,K)=>{const D=j({eventName:Z},K),te=async()=>{const pe=await D;I({eventName:Z,callbackId:pe},K)},le=new Promise(pe=>D.then(()=>pe({remove:te})));return le.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await te()},le},$=new Proxy({},{get(Z,K){switch(K){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return A?U:j;case"removeListener":return I;default:return O(K)}}});return r[g]=$,h.set(g,{name:g,proxy:$,platforms:new Set([...Object.keys(y),...A?[v]:[]])}),$};return a.convertFileSrc||(a.convertFileSrc=g=>g),a.getPlatform=o,a.handleError=m,a.isNativePlatform=u,a.isPluginAvailable=c,a.registerPlugin=b,a.Exception=zm,a.DEBUG=!!a.DEBUG,a.isLoggingEnabled=!!a.isLoggingEnabled,a},I6=e=>e.Capacitor=O6(e),Dc=I6(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Po=Dc.registerPlugin;class hp{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(t,a){let r=!1;this.listeners[t]||(this.listeners[t]=[],r=!0),this.listeners[t].push(a);const u=this.windowListeners[t];u&&!u.registered&&this.addWindowListener(u),r&&this.sendRetainedArgumentsForEvent(t);const c=async()=>this.removeListener(t,a);return Promise.resolve({remove:c})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,a,r){const o=this.listeners[t];if(!o){if(r){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:r=>{this.notifyListeners(a,r)}}}unimplemented(t="not implemented"){return new Dc.Exception(t,Ki.Unimplemented)}unavailable(t="not available"){return new Dc.Exception(t,Ki.Unavailable)}async removeListener(t,a){const r=this.listeners[t];if(!r)return;const o=r.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(r=>{this.notifyListeners(t,r)}))}}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 M6 extends hp{async getCookies(){const t=document.cookie,a={};return t.split(";").forEach(r=>{if(r.length<=0)return;let[o,u]=r.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),r=P1(t.value),o=t.expires?`; expires=${t.expires.replace("expires=","")}`:"",u=(t.path||"/").replace("path=",""),c=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${a}=${r||""}${o}; path=${u}; ${c};`}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)}}}Po("CapacitorCookies",{web:()=>new M6});const D6=async e=>new Promise((t,a)=>{const r=new FileReader;r.onload=()=>{const o=r.result;t(o.indexOf(",")>=0?o.split(",")[1]:o)},r.onerror=o=>a(o),r.readAsDataURL(e)}),L6=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(o=>o.toLocaleLowerCase()).reduce((o,u,c)=>(o[u]=e[t[c]],o),{})},j6=(e,t=!0)=>e?Object.entries(e).reduce((r,o)=>{const[u,c]=o;let f,m;return Array.isArray(c)?(m="",c.forEach(h=>{f=t?encodeURIComponent(h):h,m+=`${u}=${f}&`}),m.slice(0,-1)):(f=t?encodeURIComponent(c):c,m=`${u}=${f}`),`${r}&${m}`},"").substr(1):null,B6=(e,t={})=>{const a=Object.assign({method:e.method||"GET",headers:e.headers},t),o=L6(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[c,f]of Object.entries(e.data||{}))u.set(c,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 c=new Headers(a.headers);c.delete("content-type"),a.headers=c}else(o.includes("application/json")||typeof e.data=="object")&&(a.body=JSON.stringify(e.data));return a};class P6 extends hp{async request(t){const a=B6(t,t.webFetchExtra),r=j6(t.params,t.shouldEncodeUrlParams),o=r?`${t.url}?${r}`:t.url,u=await fetch(o,a),c=u.headers.get("content-type")||"";let{responseType:f="text"}=u.ok?t:{};c.includes("application/json")&&(f="json");let m,h;switch(f){case"arraybuffer":case"blob":h=await u.blob(),m=await D6(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"}))}}Po("CapacitorHttp",{web:()=>new P6});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 U6 extends hp{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")}}Po("SystemBars",{web:()=>new U6});const H6="modulepreload",F6=function(e){return"/"+e},z1={},z6=function(t,a,r){let o=Promise.resolve();if(a&&a.length>0){let c=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=c(a.map(h=>{if(h=F6(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":H6,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(c){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=c,window.dispatchEvent(f),!f.defaultPrevented)throw c}return o.then(c=>{for(const f of c||[])f.status==="rejected"&&u(f.reason);return t().catch(u)})},Li=Po("SpeechRecognition",{web:()=>z6(()=>import("./web-CsMK9uDO.js"),[]).then(e=>new e.SpeechRecognitionWeb)});function $6(e,t){const a=e.length,r=new ArrayBuffer(44+a*2),o=new DataView(r),u=(c,f)=>{for(let m=0;m<f.length;m++)o.setUint8(c+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 c=0;c<a;c++){const f=Math.max(-1,Math.min(1,e[c]));o.setInt16(44+c*2,f<0?f*32768:f*32767,!0)}return new Blob([r],{type:"audio/wav"})}const Eh=Dc.isNativePlatform(),$m=!Eh&&typeof window<"u"?window.SpeechRecognition??window.webkitSpeechRecognition:void 0,qm=16e3;function q6(e="zh-CN"){const[t,a]=T.useState(!1),[r,o]=T.useState(""),[u,c]=T.useState(""),[f,m]=T.useState(null),[h,b]=T.useState(0),[g,y]=T.useState("idle"),N=T.useRef(null),v=T.useRef(!1),A=T.useRef([]),C=T.useRef(!1),S=T.useRef(null),M=T.useRef(!1),O=T.useRef(null),j=T.useRef(null),I=T.useRef(null),U=T.useRef([]),$=T.useRef(!1),Z=!0,K=T.useCallback(async()=>{var se,L,Ne;(se=I.current)==null||se.disconnect(),(L=j.current)==null||L.getTracks().forEach(Te=>Te.stop()),await((Ne=O.current)==null?void 0:Ne.close().catch(()=>{}));const F=U.current;if(U.current=[],I.current=null,j.current=null,O.current=null,F.length===0||$.current){a(!1),y("idle");return}c("识别中…"),y("recognizing");const k=F.reduce((Te,V)=>Te+V.length,0),P=new Float32Array(k);let J=0;for(const Te of F)P.set(Te,J),J+=Te.length;const w=$6(P,qm),H=new FormData;H.append("audio",w,"recording.wav");try{const Te=await fetch("/api/transcribe",{method:"POST",body:H});if($.current)return;if(Te.ok){const{text:V}=await Te.json();V?(o(V),y("done")):y("idle")}else{const V=await Te.json().catch(()=>({error:`HTTP ${Te.status}`}));m(V.error??`HTTP ${Te.status}`),y("idle")}}catch(Te){m(`语音识别失败:${Te instanceof Error?Te.message:String(Te)}`),y("idle")}finally{c(""),a(!1)}},[]),D=T.useCallback(async()=>{if(v.current=!0,S.current&&(clearTimeout(S.current),S.current=null),Eh){await Li.stop().catch(()=>{});for(const F of A.current)await F.remove().catch(()=>{});A.current=[],a(!1),c("")}else N.current?N.current.stop():O.current?await K():(a(!1),y("idle"))},[K]),te=T.useCallback(async()=>{var J;$.current=!1,o(""),c(""),m(null),y("idle");const{available:F}=await Li.available();if(!F){m("当前设备不支持语音识别");return}if((await Li.requestPermissions()).speechRecognition!=="granted"){m("请允许语音识别权限");return}const P=[];P.push(await Li.addListener("partialResults",w=>{c(w.matches[0]??"")})),P.push(await Li.addListener("listeningState",w=>{const H=w.status==="started";a(H),H&&y("recording"),H||c("")})),A.current=P;try{const w=await Li.start({language:e,partialResults:!0,maxResults:1});(J=w.matches)!=null&&J.length&&o(H=>H+w.matches.join(""))}catch(w){m(`语音识别错误:${w instanceof Error?w.message:String(w)}`);for(const H of P)await H.remove().catch(()=>{});A.current=[]}},[e]),le=T.useCallback(()=>{if(!$m)return!1;$.current=!1,o(""),c(""),m(null),y("idle"),v.current=!1;const F=new $m;F.lang=e,F.continuous=!0,F.interimResults=!0,F.maxAlternatives=1,F.onstart=()=>{a(!0),y("recording"),C.current=!1,S.current=setTimeout(()=>{!C.current&&!v.current&&(M.current=!0,v.current=!0,F.stop(),m("语音识别服务不可用(Chrome/Edge 需连接 Google 服务器),下次将使用服务端识别"))},5e3)},F.onresult=k=>{C.current=!0,S.current&&(clearTimeout(S.current),S.current=null);let P="",J="";for(let w=k.resultIndex;w<k.results.length;w++){const H=k.results[w][0].transcript;k.results[w].isFinal?P+=H:J+=H}P&&o(w=>w+P),c(J)},F.onerror=k=>{switch(k.error!=="no-speech"&&k.error!=="aborted"&&(v.current=!0),k.error){case"not-allowed":m("请允许麦克风权限");break;case"network":m("网络错误,请检查连接");break;case"no-speech":case"aborted":return;default:m(`语音识别错误:${k.error}`)}},F.onend=()=>{if(c(""),!v.current)try{F.start();return}catch{}a(!1),N.current=null},N.current=F;try{return F.start(),!0}catch{return!1}},[e]),pe=T.useCallback(async()=>{$.current=!1,o(""),c(""),m(null),y("idle");try{const w=await fetch("/api/transcribe/status"),{available:H}=await w.json();if(!H){m("语音识别服务未就绪,请稍后重试");return}}catch{m("无法连接语音识别服务");return}let F;try{F=await navigator.mediaDevices.getUserMedia({audio:{sampleRate:qm,channelCount:1}})}catch{m("请允许麦克风权限");return}const k=new AudioContext({sampleRate:qm}),P=k.createMediaStreamSource(F),J=k.createScriptProcessor(4096,1,1);U.current=[],J.onaudioprocess=w=>{U.current.push(new Float32Array(w.inputBuffer.getChannelData(0)))},P.connect(J),J.connect(k.destination),O.current=k,j.current=F,I.current=J,a(!0),y("recording")},[]),Q=T.useCallback(()=>{Eh?te():$m&&!M.current&&le()||pe()},[te,le,pe]);T.useEffect(()=>{if(!t){b(0);return}if(N.current)return;let F=!1,k=null,P=null,J=0;return(async()=>{try{if(k=await navigator.mediaDevices.getUserMedia({audio:!0}),F){k.getTracks().forEach(Te=>Te.stop());return}P=new AudioContext;const w=P.createMediaStreamSource(k),H=P.createAnalyser();H.fftSize=256,w.connect(H);const se=new Uint8Array(H.frequencyBinCount);let L=0;const Ne=()=>{if(F)return;H.getByteFrequencyData(se);const Te=performance.now();if(Te-L>80){let V=0;for(let ve=0;ve<se.length;ve++)V+=se[ve];b(V/(se.length*255)),L=Te}J=requestAnimationFrame(Ne)};J=requestAnimationFrame(Ne)}catch{}})(),()=>{F=!0,cancelAnimationFrame(J),k==null||k.getTracks().forEach(w=>w.stop()),P==null||P.close().catch(()=>{}),b(0)}},[t]),T.useEffect(()=>{!t&&g==="recording"&&y(r?"done":"idle")},[t,g,r]),T.useEffect(()=>()=>{var F,k,P,J;v.current=!0,(F=N.current)==null||F.stop(),(k=I.current)==null||k.disconnect(),(P=j.current)==null||P.getTracks().forEach(w=>w.stop()),(J=O.current)==null||J.close().catch(()=>{});for(const w of A.current)w.remove().catch(()=>{})},[]);const q=T.useCallback(()=>{$.current=!0,o(""),c(""),y("idle")},[]);return{isSupported:Z,isListening:t,phase:g,transcript:r,interimTranscript:u,error:f,volumeLevel:h,start:Q,stop:D,resetTranscript:q}}const Y6=240,G6=1e3;function oT(e){const t=q6(),[a,r]=T.useState(""),[o,u]=T.useState(0),c=T.useRef(null),f=T.useRef(null),m=T.useRef(0);T.useEffect(()=>(t.phase==="recording"?(m.current=Date.now(),u(0),f.current=setInterval(()=>{u(Math.floor((Date.now()-m.current)/1e3))},G6)):f.current&&(clearInterval(f.current),f.current=null),()=>{f.current&&(clearInterval(f.current),f.current=null)}),[t.phase]),T.useEffect(()=>{t.phase==="done"&&(r(t.transcript),requestAnimationFrame(()=>{const y=c.current;y&&(y.focus(),y.setSelectionRange(y.value.length,y.value.length))}))},[t.phase,t.transcript]),T.useLayoutEffect(()=>{if(t.phase!=="done")return;const y=c.current;y&&(y.style.height="auto",y.style.height=`${Math.min(y.scrollHeight,Y6)}px`)},[t.phase,a]);const h=T.useCallback(()=>{t.stop(),t.resetTranscript(),r("")},[t]),b=T.useCallback(async()=>{const y=a.trim();if(!y){h();return}await e(y)!==!1&&(t.resetTranscript(),r(""))},[a,e,h,t]);T.useEffect(()=>{if(t.phase==="idle")return;const y=N=>{if(N.key==="Escape"&&t.phase!=="recognizing"){N.preventDefault(),h();return}if(t.phase==="done"&&N.key==="Enter"&&(N.metaKey||N.ctrlKey)){if(N.isComposing)return;N.preventDefault(),b()}};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[t.phase,h,b]);const g=T.useCallback(y=>{y.nativeEvent.isComposing||y.keyCode===229||y.key==="Enter"&&(y.metaKey||y.ctrlKey)&&(y.preventDefault(),b())},[b]);return{stt:t,editText:a,setEditText:r,elapsed:o,textareaRef:c,cancel:h,confirm:b,handleTextareaKeyDown:g}}const or=es(e=>({agents:[],loaded:!1,loadAgents:async()=>{const t=je.getState().activeRepoId;try{const a=t?await Ly(t):await Iy();e({agents:a,loaded:!0})}catch{e({loaded:!0})}}}));function K6(e){if(typeof e!="string")return e;const t=e.trim();if(t)try{return JSON.parse(t)}catch{return t}}function pn(e){return e&&typeof e=="object"?e:null}function Kr(e){const t=pn(e);return t&&"properties"in t?t.properties:e}function V6(e){const t=pn(e);return typeof(t==null?void 0:t.type)=="string"?t.type:void 0}function X6(e){const t=pn(Kr(e));if(!t)return null;const a=pn(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 r=pn(t.message);return r&&typeof r.id=="string"?r:null}function Q6(e){const t=pn(Kr(e));if(!t)return{};const a=pn(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 W6(e){const t=pn(Kr(e));if(!t||t.field!=="text")return null;const a=typeof t.messageID=="string"?t.messageID:null,r=typeof t.partID=="string"?t.partID:null,o=typeof t.delta=="string"?t.delta:null;return!a||!r||o===null?null:{messageId:a,partId:r,delta:o}}function Z6(e){const t=Kr(e);if(Array.isArray(t))return t;const a=pn(t);return a&&Array.isArray(a.todos)?a.todos:[]}function Xa(e){return typeof e=="number"?e:0}function J6(e){const t=pn(Kr(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 r=typeof t.parentID=="string"?t.parentID:typeof t.parent_id=="string"?t.parent_id:void 0;r&&(a.parentID=r);const o=pn(t.tokens),u=typeof t.tokens_input=="number"||typeof t.tokens_output=="number";if(o||u){const f=o?pn(o.cache):null;a.tokens={input:Xa(o==null?void 0:o.input)||Xa(t.tokens_input),output:Xa(o==null?void 0:o.output)||Xa(t.tokens_output),reasoning:Xa(o==null?void 0:o.reasoning)||Xa(t.tokens_reasoning),cache:{read:Xa(f==null?void 0:f.read)||Xa(t.tokens_cache_read),write:Xa(f==null?void 0:f.write)||Xa(t.tokens_cache_write)}}}const c=pn(t.model);return c&&(a.model={providerID:typeof c.providerID=="string"?c.providerID:void 0,modelID:typeof c.modelID=="string"?c.modelID:void 0,variant:typeof c.variant=="string"?c.variant:void 0}),a}function eM(e){const t=pn(Kr(e));if(!t)return null;if(typeof t.message=="string")return t.message;const a=pn(t.error);if(a){const r=pn(a.data);if(typeof(r==null?void 0:r.message)=="string")return`${a.name??"Error"}: ${r.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 tM(e){const t=Kr(e);if(typeof t=="string")return t;const a=pn(t);if(typeof(a==null?void 0:a.status)=="string")return a.status;const r=pn(a==null?void 0:a.status);return typeof(r==null?void 0:r.type)=="string"?r.type:typeof(a==null?void 0:a.type)=="string"?a.type:null}function nM(e,t,a,r){switch(e==="message"||e===""?V6(t)??e:e){case"message.updated":{const u=X6(t);u&&r.updateMessage(a,u);break}case"session.updated":{const u=J6(t);u&&r.updateSessionInfo(u);break}case"message.part.updated":{const{messageId:u,part:c}=Q6(t);c&&u&&r.updateMessagePart(a,u,c);break}case"message.part.delta":{const u=W6(t);u&&r.appendMessagePartDelta(a,u.messageId,u.partId,u.delta);break}case"todo.updated":{r.updateTodos(a,Z6(t));break}case"session.status":{const u=tM(t);u&&r.setSessionStatus(a,u);break}case"session.idle":{r.setSessionStatus(a,"idle");break}case"session.error":{const u=eM(t);r.setSessionStatus(a,"error",u??void 0);break}}}const aM=600*1e3;class sM{constructor(t,a){sn(this,"sessionId");sn(this,"idleTimer",null);sn(this,"active",!1);sn(this,"alive",!0);sn(this,"callbacks");this.sessionId=t,this.callbacks=a,this.resetIdleTimer()}dispatch(t,a){if(!this.alive)return;this.resetIdleTimer();const r=Re.getState();nM(t,a,this.sessionId,r)}activate(){this.active=!0,this.clearIdleTimer()}deactivate(){this.active=!1,this.resetIdleTimer()}refreshOnIdle(){Re.getState().refreshSessionData(this.sessionId)}stop(){this.alive=!1,this.clearIdleTimer()}resetIdleTimer(){this.clearIdleTimer(),!this.active&&(this.idleTimer=setTimeout(()=>{this.callbacks.onWorkerIdle(this.sessionId)},aM))}clearIdleTimer(){this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null)}}const rM=1e3,iM=3e4;class lM{constructor(t,a){sn(this,"source",null);sn(this,"reconnectTimer",null);sn(this,"attempts",0);sn(this,"disposed",!1);sn(this,"repoId");sn(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=kC(this.repoId),a=new EventSource(t);this.source=a,a.onopen=()=>{this.attempts=0},a.onmessage=o=>{this.handleRaw("message",o)};const r=["message.updated","message.part.updated","message.part.delta","message.removed","todo.updated","session.status","session.idle","session.error","session.updated"];for(const o of r)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(rM*2**this.attempts,iM);this.attempts++,this.reconnectTimer=setTimeout(()=>this.connect(),o)}}}handleRaw(t,a){if(!(a instanceof MessageEvent))return;const r=K6(a.data);if(r===void 0)return;const o=this.extractSessionId(r);if(!o)return;let u=t;if(t==="message"||t===""){const c=r&&typeof r=="object"?r:null;typeof(c==null?void 0:c.type)=="string"&&(u=c.type)}this.onEvent(o,u,r)}extractSessionId(t){if(!t||typeof t!="object")return null;const a=t;if(a.properties&&typeof a.properties=="object"){const r=a.properties;if(typeof r.sessionID=="string")return r.sessionID;if(typeof r.id=="string")return r.id}return typeof a.sessionID=="string"?a.sessionID:typeof a.sessionId=="string"?a.sessionId:null}}const oM=6e4;class uM{constructor(t){sn(this,"timer",null);sn(this,"paused",!1);sn(this,"callbacks");this.callbacks=t}start(){this.tick(),this.timer=setInterval(()=>{this.paused||this.tick()},oM)}stop(){this.timer&&(clearInterval(this.timer),this.timer=null)}pause(){this.paused=!0}resume(){this.paused=!1,this.tick()}tick(){const t=je.getState().activeRepoId;t&&(Re.getState().loadSessions(),RC(t).then(a=>{const r={};for(const[o,u]of Object.entries(a))r[o]=u.type??"idle";Re.getState().bulkSetStatuses(r);for(const[o,u]of Object.entries(r))(u==="busy"||u==="retry")&&this.callbacks.ensureWorker(o)}).catch(()=>{}))}}class cM{constructor(){sn(this,"workers",new Map);sn(this,"dispatcher",null);sn(this,"supervisor",null);sn(this,"visibilityHandler",null)}start(t){this.stop();const a={onWorkerIdle:r=>this.removeWorker(r)};this.dispatcher=new lM(t,(r,o,u)=>{const c=this.ensureWorker(r,a);if(o==="session.idle"||o==="session.status"){const f=Re.getState().sessionStatuses[r];c.dispatch(o,u);const m=Re.getState().sessionStatuses[r];f&&f!=="idle"&&m==="idle"&&c.refreshOnIdle()}else c.dispatch(o,u)}),this.dispatcher.start(),this.supervisor=new uM({ensureWorker:r=>this.ensureWorker(r,a)}),this.supervisor.start(),this.visibilityHandler=()=>{var r,o;document.hidden?(r=this.supervisor)==null||r.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 r of this.workers.values())r.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(),Re.getState().refreshSessionData(t)}deactivateSession(t){var a;(a=this.workers.get(t))==null||a.deactivate()}ensureWorker(t,a){let r=this.workers.get(t);return r||(r=new sM(t,a),this.workers.set(t,r)),r}removeWorker(t){const a=Re.getState().activeSessionId;if(t===a)return;const r=this.workers.get(t);r&&(r.stop(),this.workers.delete(t))}}const Lc=new cM,$1=(function(e,t,a){const r=Lo(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(r(e.children[t],t,e))return e.children[t]}),Vr=(function(e){if(e==null)return mM;if(typeof e=="string")return fM(e);if(typeof e=="object")return dM(e);if(typeof e=="function")return pp(e);throw new Error("Expected function, string, or array as `test`")});function dM(e){const t=[];let a=-1;for(;++a<e.length;)t[a]=Vr(e[a]);return pp(r);function r(...o){let u=-1;for(;++u<t.length;)if(t[u].apply(this,o))return!0;return!1}}function fM(e){return pp(t);function t(a){return a.tagName===e}}function pp(e){return t;function t(a,r,o){return!!(hM(a)&&e.call(this,a,typeof r=="number"?r:void 0,o||void 0))}}function mM(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function hM(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const q1=/\n/g,Y1=/[\t ]+/g,yh=Vr("br"),G1=Vr(TM),pM=Vr("p"),K1=Vr("tr"),gM=Vr(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",NM,_M]),uT=Vr(["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 bM(e,t){const a=t||{},r="children"in e?e.children:[],o=uT(e),u=fT(e,{whitespace:a.whitespace||"normal"}),c=[];(e.type==="text"||e.type==="comment")&&c.push(...dT(e,{breakBefore:!0,breakAfter:!0}));let f=-1;for(;++f<r.length;)c.push(...cT(r[f],e,{whitespace:u,breakBefore:f?void 0:o,breakAfter:f<r.length-1?yh(r[f+1]):o}));const m=[];let h;for(f=-1;++f<c.length;){const b=c[f];typeof b=="number"?h!==void 0&&b>h&&(h=b):b&&(h!==void 0&&h>-1&&m.push(`
491
- `.repeat(h)||" "),h=-1,m.push(b))}return m.join("")}function cT(e,t,a){return e.type==="element"?xM(e,t,a):e.type==="text"?a.whitespace==="normal"?dT(e,a):EM(e):[]}function xM(e,t,a){const r=fT(e,a),o=e.children||[];let u=-1,c=[];if(gM(e))return c;let f,m;for(yh(e)||K1(e)&&$1(t,e,K1)?m=`
492
- `:pM(e)?(f=2,m=2):uT(e)&&(f=1,m=1);++u<o.length;)c=c.concat(cT(o[u],e,{whitespace:r,breakBefore:u?void 0:f,breakAfter:u<o.length-1?yh(o[u+1]):m}));return G1(e)&&$1(t,e,G1)&&c.push(" "),f&&c.unshift(f),m&&c.push(m),c}function dT(e,t){const a=String(e.value),r=[],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;r.push(yM(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 c=-1,f;for(;++c<r.length;)r[c].charCodeAt(r[c].length-1)===8203||c<r.length-1&&r[c+1].charCodeAt(0)===8203?(o.push(r[c]),f=void 0):r[c]?(typeof f=="number"&&o.push(f),o.push(r[c]),f=0):(c===0||c===r.length-1)&&o.push(0);return o}function EM(e){return[String(e.value)]}function yM(e,t,a){const r=[];let o=0,u;for(;o<e.length;){Y1.lastIndex=o;const c=Y1.exec(e);u=c?c.index:e.length,!o&&!u&&c&&!t&&r.push(""),o!==u&&r.push(e.slice(o,u)),o=c?u+c[0].length:u}return o!==u&&!a&&r.push(""),r.join(" ")}function fT(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 NM(e){return!!(e.properties||{}).hidden}function TM(e){return e.tagName==="td"||e.tagName==="th"}function _M(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function vM(e){const t=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",c="(?!struct)("+r+"|"+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"],A=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],C=["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"],S=["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"],j={type:A,keyword:v,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:C},I={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},U=[I,g,f,a,e.C_BLOCK_COMMENT_MODE,b,h],$={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:j,contains:U.concat([{begin:/\(/,end:/\)/,keywords:j,contains:U.concat(["self"]),relevance:0}]),relevance:0},Z={className:"function",begin:"("+c+"[\\*&\\s]+)+"+N,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:j,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:j,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:j,relevance:0,contains:[a,e.C_BLOCK_COMMENT_MODE,h,b,f,{begin:/\(/,end:/\)/,keywords:j,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:j,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat($,Z,I,U,[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:j,contains:["self",f]},{begin:e.IDENT_RE+"::",keywords:j},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function SM(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=vM(e),r=a.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,a.name="Arduino",a.aliases=["ino"],a.supersetOf="cpp",a}function AM(e){const t=e.regex,a={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[a]}]};Object.assign(a,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},u=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),c={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},A=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],C=["true","false"],S={match:/(\/[a-z._-]+)+/},M=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],O=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],j=["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"],I=["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:A,literal:C,built_in:[...M,...O,"set","shopt",...j,...I]},contains:[N,e.SHEBANG(),v,g,u,c,S,f,m,h,b,a]}}function CM(e){const t=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",c="("+r+"|"+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*\\(",C={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"},S=[g,f,a,e.C_BLOCK_COMMENT_MODE,b,h],M={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:C,contains:S.concat([{begin:/\(/,end:/\)/,keywords:C,contains:S.concat(["self"]),relevance:0}]),relevance:0},O={begin:"("+c+"[\\*&\\s]+)+"+N,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:C,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:C,relevance:0},{begin:N,returnBegin:!0,contains:[e.inherit(y,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:[a,e.C_BLOCK_COMMENT_MODE,h,b,f,{begin:/\(/,end:/\)/,keywords:C,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:C,disableAutodetect:!0,illegal:"</",contains:[].concat(M,O,S,[g,{begin:e.IDENT_RE+"::",keywords:C},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:g,strings:h,keywords:C}}}function wM(e){const t=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",c="(?!struct)("+r+"|"+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"],A=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],C=["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"],S=["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"],j={type:A,keyword:v,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:C},I={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},U=[I,g,f,a,e.C_BLOCK_COMMENT_MODE,b,h],$={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:j,contains:U.concat([{begin:/\(/,end:/\)/,keywords:j,contains:U.concat(["self"]),relevance:0}]),relevance:0},Z={className:"function",begin:"("+c+"[\\*&\\s]+)+"+N,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:j,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:j,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:j,relevance:0,contains:[a,e.C_BLOCK_COMMENT_MODE,h,b,f,{begin:/\(/,end:/\)/,keywords:j,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:j,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat($,Z,I,U,[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:j,contains:["self",f]},{begin:e.IDENT_RE+"::",keywords:j},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function kM(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"],r=["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"],c={keyword:o.concat(u),built_in:t,literal:r},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:c},N=e.inherit(y,{illegal:/\n/}),v={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,N]},A={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]},C=e.inherit(A,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},N]});y.contains=[A,v,b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,e.C_BLOCK_COMMENT_MODE],N.contains=[C,v,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const S={variants:[h,A,v,b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},M={begin:"<",end:">",contains:[{beginKeywords:"in out"},f]},O=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",j={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:c,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"}},S,m,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},f,M,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,M,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:"("+O+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:c,contains:[{beginKeywords:a.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,M],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,relevance:0,contains:[S,m,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},j]}}const RM=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_-]*/}}),OM=["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"],IM=["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"],MM=[...OM,...IM],DM=["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(),LM=["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(),jM=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),BM=["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 PM(e){const t=e.regex,a=RM(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},o="and or not only",u=/@-?\w[\w]*(-\w+)*/,c="[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,r,a.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+c,relevance:0},a.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+LM.join("|")+")"},{begin:":(:)?("+jM.join("|")+")"}]},a.CSS_VARIABLE,{className:"attribute",begin:"\\b("+BM.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:DM.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...f,a.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+MM.join("|")+")\\b"}]}}function UM(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 HM(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 FM(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 zM(e){const t=e.regex,a={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.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/},c={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},f={begin:/\[/,end:/\]/,contains:[r,u,o,c,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:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:y,className:"attr",starts:{end:/$/,contains:[r,f,u,o,c,a]}}]}}var Bi="[0-9](_*[0-9])*",uc=`\\.(${Bi})`,cc="[0-9a-fA-F](_*[0-9a-fA-F])*",V1={className:"number",variants:[{begin:`(\\b(${Bi})((${uc})|\\.)?|(${uc}))[eE][+-]?(${Bi})[fFdD]?\\b`},{begin:`\\b(${Bi})((${uc})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${uc})[fFdD]?\\b`},{begin:`\\b(${Bi})[fFdD]\\b`},{begin:`\\b0[xX]((${cc})\\.?|(${cc})?\\.(${cc}))[pP][+-]?(${Bi})[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 mT(e,t,a){return a===-1?"":e.replace(t,r=>mT(e,t,a-1))}function $M(e){const t=e.regex,a="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=a+mT("(?:<"+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:["(?:"+r+"\\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$_]*",qM=["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"],YM=["true","false","null","undefined","NaN","Infinity"],hT=["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"],pT=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],gT=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],GM=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],KM=[].concat(gT,hT,pT);function VM(e){const t=e.regex,a=(P,{after:J})=>{const w="</"+P[0].slice(1);return P.input.indexOf(w,J)!==-1},r=X1,o={begin:"<>",end:"</>"},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(P,J)=>{const w=P[0].length+P.index,H=P.input[w];if(H==="<"||H===","){J.ignoreMatch();return}H===">"&&(a(P,{after:w})||J.ignoreMatch());let se;const L=P.input.substring(w);if(se=L.match(/^\s*=/)){J.ignoreMatch();return}if((se=L.match(/^\s+extends\s+/))&&se.index===0){J.ignoreMatch();return}}},f={$pattern:X1,keyword:qM,literal:YM,built_in:KM,"variable.language":GM},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"}},A={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},C={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,y]},M={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:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},O=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,N,v,A,C,{match:/\$\d+/},g];y.contains=O.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(O)});const j=[].concat(M,y.contains),I=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(j)}]),U={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:I},$={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},Z={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:{_:[...hT,...pT]}},K={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},D={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[U],illegal:/%/},te={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function le(P){return t.concat("(?!",P.join("|"),")")}const pe={match:t.concat(/\b/,le([...gT,"super","import"].map(P=>`${P}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},Q={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},q={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},U]},F="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",k={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(F)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[U]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:I,CLASS_REFERENCE:Z},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),K,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,N,v,A,C,M,{match:/\$\d+/},g,Z,{scope:"attr",match:r+t.lookahead(":"),relevance:0},k,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[M,e.REGEXP_MODE,{className:"function",begin:F,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:I}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:u},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},D,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[U,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Q,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[U]},pe,te,$,q,{match:/\$[(.]/}]}}function XM(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},a={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],o={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},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])*",dc=`\\.(${Pi})`,fc="[0-9a-fA-F](_*[0-9a-fA-F])*",QM={className:"number",variants:[{begin:`(\\b(${Pi})((${dc})|\\.)?|(${dc}))[eE][+-]?(${Pi})[fFdD]?\\b`},{begin:`\\b(${Pi})((${dc})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${dc})[fFdD]?\\b`},{begin:`\\b(${Pi})[fFdD]\\b`},{begin:`\\b0[xX]((${fc})\\.?|(${fc})?\\.(${fc}))[pP][+-]?(${Pi})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${fc})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function WM(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+/}]}},r={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},c={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(c);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(c,{className:"string"}),"self"]}]},h=QM,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,r,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,c,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]},c,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
493
- `},h]}}const ZM=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_-]*/}}),JM=["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"],eD=["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"],tD=[...JM,...eD],nD=["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(),bT=["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(),xT=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),aD=["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(),sD=bT.concat(xT).sort().reverse();function rD(e){const t=ZM(e),a=sD,r="and or not only",o="[\\w-]+",u="("+o+"|@\\{"+o+"\\})",c=[],f=[],m=function(O){return{className:"string",begin:"~?"+O+".*?"+O}},h=function(O,j,I){return{className:O,begin:j,relevance:I}},b={$pattern:/[a-z-]+/,keyword:r,attribute:nD.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:c}),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("+aD.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:f}}]},A={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}},C={className:"variable",variants:[{begin:"@"+o+"\\s*:",relevance:15},{begin:"@"+o}],starts:{end:"[;}]",returnEnd:!0,contains:y}},S={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("+tD.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:":("+bT.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+xT.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:y},{begin:"!important"},t.FUNCTION_DISPATCH]},M={begin:o+`:(:)?(${a.join("|")})`,returnBegin:!0,contains:[S]};return c.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,A,C,M,v,S,N,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:c}}function iD(e){const t="\\[=*\\[",a="\\]=*\\]",r={begin:t,end:a,contains:["self"]},o=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,a,{contains:[r],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:[r],relevance:5}])}}function lD(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]},r={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"}},c={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,r,o,u,c]}}function oD(e){const t=e.regex,a={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={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},c={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(S=>{S.contains=S.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,r,m,c,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function uD(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 cD(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"],r=/[dualxmsipngr]{0,12}/,o={$pattern:/[\w.]+/,keyword:a.join(" ")},u={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:o},c={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=(A,C,S="\\1")=>{const M=S==="\\1"?S:t.concat(S,C);return t.concat(t.concat("(?:",A,")"),C,/(?:\\.|[^\\\/])*?/,M,/(?:\\.|[^\\\/])*?/,S,r)},N=(A,C,S)=>t.concat(t.concat("(?:",A,")"),C,/(?:\\.|[^\\\/])*?/,S,r),v=[m,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),c,{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,c.contains=v,{name:"Perl",aliases:["pl","pm"],keywords:o,contains:v}}function dD(e){const t=e.regex,a=/(?![A-Za-z0-9])(?![$])/,r=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),c={scope:"variable",match:"\\$+"+r},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,q)=>{q.data._beginMatch=Q[1]||Q[2]},"on:end":(Q,q)=>{q.data._beginMatch!==Q[1]&&q.ignoreMatch()}},y=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),N=`[
494
- ]`,v={scope:"string",variants:[b,h,g,y]},A={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},C=["false","null","true"],S=["__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"],M=["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"],j={keyword:S,literal:(Q=>{const q=[];return Q.forEach(F=>{q.push(F),F.toLowerCase()===F?q.push(F.toUpperCase()):q.push(F.toLowerCase())}),q})(C),built_in:M},I=Q=>Q.map(q=>q.replace(/\|\d+$/,"")),U={variants:[{match:[/new/,t.concat(N,"+"),t.concat("(?!",I(M).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},$=t.concat(r,"\\b(?!\\()"),Z={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),$],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,t.concat(/::/,t.lookahead(/(?!class\b)/)),$],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"}}]},K={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},D={relevance:0,begin:/\(/,end:/\)/,keywords:j,contains:[K,c,Z,e.C_BLOCK_COMMENT_MODE,v,A,U]},te={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",I(S).join("\\b|"),"|",I(M).join("\\b|"),"\\b)"),r,t.concat(N,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[D]};D.contains.push(te);const le=[K,Z,e.C_BLOCK_COMMENT_MODE,v,A,U],pe={begin:t.concat(/#\[\s*\\?/,t.either(o,u)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:C,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:C,keyword:["new","array"]},contains:["self",...le]},...le,{scope:"meta",variants:[{match:o},{match:u}]}]};return{case_insensitive:!1,keywords:j,contains:[pe,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/},c,te,Z,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},U,{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:j,contains:["self",pe,c,Z,e.C_BLOCK_COMMENT_MODE,v,A]}]},{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,A]}}function fD(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 mD(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function hD(e){const t=e.regex,a=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["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:r,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|${r.join("|")}`,A={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})`}]},C={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:f,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},S={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:["self",m,A,g,e.HASH_COMMENT_MODE]}]};return h.contains=[g,A,m],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:f,illegal:/(<\/|\?)|=>/,contains:[m,A,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},g,C,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[S]},{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:[A,S,g]}]}}function pD(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function gD(e){const t=e.regex,a=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=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,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[u,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{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 bD(e){const t=e.regex,a="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=t.concat(r,/(::\w+)*/),c={"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:c},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"}]},A={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:c}]},U=[g,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:c},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:c},{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:r,scope:"title.class"},{match:[/def/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[A]},{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:c},{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=U,A.contains=U;const D=[{begin:/^\s*=>/,starts:{end:"$",contains:U}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:c,contains:U}}];return h.unshift(m),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:c,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(D).concat(h).concat(U)}}function xD(e){const t=e.regex,a=/(r#)?/,r=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*\(/))},c="([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_]+)"+c},{begin:"\\b0o([0-7_]+)"+c},{begin:"\\b0x([A-Fa-f0-9_]+)"+c},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+c}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:h,type:b}},{className:"punctuation",begin:"->"},u]}}const ED=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_-]*/}}),yD=["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"],ND=["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"],TD=[...yD,...ND],_D=["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(),vD=["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(),SD=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),AD=["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 CD(e){const t=ED(e),a=SD,r=vD,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("+TD.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+a.join("|")+")"},f,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+AD.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:_D.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 wD(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function kD(e){const t=e.regex,a=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},o={begin:/"/,end:/"/,contains:[{match:/""/}]},u=["true","false","unknown"],c=["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(I=>!b.includes(I)),A={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},C={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},S={match:t.concat(/\b/,t.either(...N),/\s*\(/),relevance:0,keywords:{built_in:N}};function M(I){return t.concat(/\b/,t.either(...I.map(U=>U.replace(/\s+/,"\\s+"))),/\b/)}const O={scope:"keyword",match:M(y),relevance:0};function j(I,{exceptions:U,when:$}={}){const Z=$;return U=U||[],I.map(K=>K.match(/\|\d+$/)||U.includes(K)?K:Z(K)?`${K}|0`:K)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:j(v,{when:I=>I.length<3}),literal:u,type:f,built_in:g},contains:[{scope:"type",match:M(c)},O,S,A,r,o,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,a,C]}}function ET(e){return e?typeof e=="string"?e:e.source:null}function ao(e){return Ct("(?=",e,")")}function Ct(...e){return e.map(a=>ET(a)).join("")}function RD(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Hn(...e){return"("+(RD(e).capture?"":"?:")+e.map(r=>ET(r)).join("|")+")"}const gp=e=>Ct(/\b/,e,/\w$/.test(e)?/\b/:/\B/),OD=["Protocol","Type"].map(gp),Q1=["init","self"].map(gp),ID=["Any","Self"],Ym=["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"],MD=["assignment","associativity","higherThan","left","lowerThan","none","right"],DD=["#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"],yT=Hn(/[/=\-+!*%<>&|^~?]/,/[\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]/),NT=Hn(yT,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Gm=Ct(yT,NT,"*"),TT=Hn(/[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=Hn(TT,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Qa=Ct(TT,jc,"*"),mc=Ct(/[A-Z]/,jc,"*"),LD=["attached","autoclosure",Ct(/convention\(/,Hn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Ct(/objc\(/,Qa,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],jD=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function BD(e){const t={match:/\s+/,relevance:0},a=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,a],o={match:[/\./,Hn(...OD,...Q1)],className:{2:"keyword"}},u={match:Ct(/\./,Hn(...Ym)),relevance:0},c=Ym.filter(et=>typeof et=="string").concat(["_|0"]),f=Ym.filter(et=>typeof et!="string").concat(ID).map(gp),m={variants:[{className:"keyword",match:Hn(...f,...Q1)}]},h={$pattern:Hn(/\b\w+/,/#\w+/),keyword:c.concat(DD),literal:W1},b=[o,u,m],g={match:Ct(/\./,Hn(...Z1)),relevance:0},y={className:"built_in",match:Ct(/\b/,Hn(...Z1),/(?=\()/)},N=[g,y],v={match:/->/,relevance:0},A={className:"operator",relevance:0,variants:[{match:Gm},{match:`\\.(\\.|${NT})+`}]},C=[v,A],S="([0-9]_*)+",M="([0-9a-fA-F]_*)+",O={className:"number",relevance:0,variants:[{match:`\\b(${S})(\\.(${S}))?([eE][+-]?(${S}))?\\b`},{match:`\\b0x(${M})(\\.(${M}))?([pP][+-]?(${S}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},j=(et="")=>({className:"subst",variants:[{match:Ct(/\\/,et,/[0\\tnr"']/)},{match:Ct(/\\/,et,/u\{[0-9a-fA-F]{1,8}\}/)}]}),I=(et="")=>({className:"subst",match:Ct(/\\/,et,/[\t ]*(?:[\r\n]|\r\n)/)}),U=(et="")=>({className:"subst",label:"interpol",begin:Ct(/\\/,et,/\(/),end:/\)/}),$=(et="")=>({begin:Ct(et,/"""/),end:Ct(/"""/,et),contains:[j(et),I(et),U(et)]}),Z=(et="")=>({begin:Ct(et,/"/),end:Ct(/"/,et),contains:[j(et),U(et)]}),K={className:"string",variants:[$(),$("#"),$("##"),$("###"),Z(),Z("#"),Z("##"),Z("###")]},D=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],te={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:D},le=et=>{const qn=Ct(et,/\//),Ln=Ct(/\//,et);return{begin:qn,end:Ln,contains:[...D,{scope:"comment",begin:`#(?!.*${Ln})`,end:/$/}]}},pe={scope:"regexp",variants:[le("###"),le("##"),le("#"),te]},Q={match:Ct(/`/,Qa,/`/)},q={className:"variable",match:/\$\d+/},F={className:"variable",match:`\\$${jc}+`},k=[Q,q,F],P={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:jD,contains:[...C,O,K]}]}},J={scope:"keyword",match:Ct(/@/,Hn(...LD),ao(Hn(/\(/,/\s+/)))},w={scope:"meta",match:Ct(/@/,Qa)},H=[P,J,w],se={match:ao(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Ct(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,jc,"+")},{className:"type",match:mc,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Ct(/\s+&\s+/,ao(mc)),relevance:0}]},L={begin:/</,end:/>/,keywords:h,contains:[...r,...b,...H,v,se]};se.contains.push(L);const Ne={match:Ct(Qa,/\s*:/),keywords:"_|0",relevance:0},Te={begin:/\(/,end:/\)/,relevance:0,keywords:h,contains:["self",Ne,...r,pe,...b,...N,...C,O,K,...k,...H,se]},V={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,se]},ve={begin:Hn(ao(Ct(Qa,/\s*:/)),ao(Ct(Qa,/\s+/,Qa,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Qa}]},Be={begin:/\(/,end:/\)/,keywords:h,contains:[ve,...r,...b,...C,O,K,...H,se,Te],endsParent:!0,illegal:/["']/},Ue={match:[/(func|macro)/,/\s+/,Hn(Q.match,Qa,Gm)],className:{1:"keyword",3:"title.function"},contains:[V,Be,t],illegal:[/\[/,/%/]},xt={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[V,Be,t],illegal:/\[|%/},un={match:[/operator/,/\s+/,Gm],className:{1:"keyword",3:"title"}},cn={begin:[/precedencegroup/,/\s+/,mc],className:{1:"keyword",3:"title"},contains:[se],keywords:[...MD,...W1],end:/}/},za={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Dn={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},$n={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Qa,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:h,contains:[V,...b,{begin:/:/,end:/\{/,keywords:h,contains:[{scope:"title.class.inherited",match:mc},...b],relevance:0}]};for(const et of K.variants){const qn=et.contains.find(Yn=>Yn.label==="interpol");qn.keywords=h;const Ln=[...b,...N,...C,O,K,...k];qn.contains=[...Ln,{begin:/\(/,end:/\)/,contains:["self",...Ln]}]}return{name:"Swift",keywords:h,contains:[...r,Ue,xt,za,Dn,$n,un,cn,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},pe,...b,...N,...C,O,K,...k,...H,se,Te]}}const Bc="[A-Za-z$_][0-9A-Za-z$_]*",_T=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],vT=["true","false","null","undefined","NaN","Infinity"],ST=["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"],AT=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],CT=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],wT=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],kT=[].concat(CT,ST,AT);function PD(e){const t=e.regex,a=(P,{after:J})=>{const w="</"+P[0].slice(1);return P.input.indexOf(w,J)!==-1},r=Bc,o={begin:"<>",end:"</>"},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(P,J)=>{const w=P[0].length+P.index,H=P.input[w];if(H==="<"||H===","){J.ignoreMatch();return}H===">"&&(a(P,{after:w})||J.ignoreMatch());let se;const L=P.input.substring(w);if(se=L.match(/^\s*=/)){J.ignoreMatch();return}if((se=L.match(/^\s+extends\s+/))&&se.index===0){J.ignoreMatch();return}}},f={$pattern:Bc,keyword:_T,literal:vT,built_in:kT,"variable.language":wT},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"}},A={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},C={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,y]},M={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:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},O=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,N,v,A,C,{match:/\$\d+/},g];y.contains=O.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(O)});const j=[].concat(M,y.contains),I=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(j)}]),U={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:I},$={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},Z={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:{_:[...ST,...AT]}},K={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},D={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[U],illegal:/%/},te={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function le(P){return t.concat("(?!",P.join("|"),")")}const pe={match:t.concat(/\b/,le([...CT,"super","import"].map(P=>`${P}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},Q={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},q={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},U]},F="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",k={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(F)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[U]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:I,CLASS_REFERENCE:Z},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),K,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,N,v,A,C,M,{match:/\$\d+/},g,Z,{scope:"attr",match:r+t.lookahead(":"),relevance:0},k,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[M,e.REGEXP_MODE,{className:"function",begin:F,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:I}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:u},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},D,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[U,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Q,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[U]},pe,te,$,q,{match:/\$[(.]/}]}}function UD(e){const t=e.regex,a=PD(e),r=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"}},c={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:_T.concat(m),literal:vT,built_in:kT.concat(o),"variable.language":wT},b={className:"meta",begin:"@"+r},g=(A,C,S)=>{const M=A.contains.findIndex(O=>O.label===C);if(M===-1)throw new Error("can not find mode to replace");A.contains.splice(M,1,S)};Object.assign(a.keywords,h),a.exports.PARAMS_CONTAINS.push(b);const y=a.contains.find(A=>A.scope==="attr"),N=Object.assign({},y,{match:t.concat(r,t.lookahead(/\s*\?:/))});a.exports.PARAMS_CONTAINS.push([a.exports.CLASS_REFERENCE,y,N]),a.contains=a.contains.concat([b,u,c,N]),g(a,"shebang",e.SHEBANG()),g(a,"use_strict",f);const v=a.contains.find(A=>A.label==="func.def");return v.relevance=0,Object.assign(a,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),a}function HD(e){const t=e.regex,a={className:"string",begin:/"(""|[^/n])"C\b/},r={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}/,c=/(\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(/# */,c,/ *#/)},{begin:t.concat(/# */,t.either(u,o),/ +/,t.either(c,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,r,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 FD(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const a=e.COMMENT(/;;/,/$/),r=["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_]+/},c={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:r},contains:[a,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},u,c,o,e.QUOTE_STRING_MODE,m,h,f]}}function zD(e){const t=e.regex,a=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\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/}]},c=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:r,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,c,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[u,c,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 $D(e){const t="true false yes no null",a="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={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}]},c={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,o]},f=e.inherit(c,{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},A={begin:"\\[",end:"\\]",contains:[N],illegal:"\\n",relevance:0},C=[r,{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,A,u,c],S=[...C];return S.pop(),S.push(f),N.contains=S,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:C}}const qD={arduino:SM,bash:AM,c:CM,cpp:wM,csharp:kM,css:PM,diff:UM,go:HM,graphql:FM,ini:zM,java:$M,javascript:VM,json:XM,kotlin:WM,less:rD,lua:iD,makefile:lD,markdown:oD,objectivec:uD,perl:cD,php:dD,"php-template":fD,plaintext:mD,python:hD,"python-repl":pD,r:gD,ruby:bD,rust:xD,scss:CD,shell:wD,sql:kD,swift:BD,typescript:UD,vbnet:HD,wasm:FD,xml:zD,yaml:$D};var Km,J1;function YD(){if(J1)return Km;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(me=>{const we=X[me],Ke=typeof we;(Ke==="object"||Ke==="function")&&!Object.isFrozen(we)&&e(we)}),X}class t{constructor(me){me.data===void 0&&(me.data={}),this.data=me.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 r(X,...me){const we=Object.create(null);for(const Ke in X)we[Ke]=X[Ke];return me.forEach(function(Ke){for(const Dt in Ke)we[Dt]=Ke[Dt]}),we}const o="</span>",u=X=>!!X.scope,c=(X,{prefix:me})=>{if(X.startsWith("language:"))return X.replace("language:","language-");if(X.includes(".")){const we=X.split(".");return[`${me}${we.shift()}`,...we.map((Ke,Dt)=>`${Ke}${"_".repeat(Dt+1)}`)].join(" ")}return`${me}${X}`};class f{constructor(me,we){this.buffer="",this.classPrefix=we.classPrefix,me.walk(this)}addText(me){this.buffer+=a(me)}openNode(me){if(!u(me))return;const we=c(me.scope,{prefix:this.classPrefix});this.span(we)}closeNode(me){u(me)&&(this.buffer+=o)}value(){return this.buffer}span(me){this.buffer+=`<span class="${me}">`}}const m=(X={})=>{const me={children:[]};return Object.assign(me,X),me};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(me){this.top.children.push(me)}openNode(me){const we=m({scope:me});this.add(we),this.stack.push(we)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(me){return this.constructor._walk(me,this.rootNode)}static _walk(me,we){return typeof we=="string"?me.addText(we):we.children&&(me.openNode(we),we.children.forEach(Ke=>this._walk(me,Ke)),me.closeNode(we)),me}static _collapse(me){typeof me!="string"&&me.children&&(me.children.every(we=>typeof we=="string")?me.children=[me.children.join("")]:me.children.forEach(we=>{h._collapse(we)}))}}class b extends h{constructor(me){super(),this.options=me}addText(me){me!==""&&this.add(me)}startScope(me){this.openNode(me)}endScope(){this.closeNode()}__addSublanguage(me,we){const Ke=me.root;we&&(Ke.scope=`language:${we}`),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 A("(?=",X,")")}function N(X){return A("(?:",X,")*")}function v(X){return A("(?:",X,")?")}function A(...X){return X.map(we=>g(we)).join("")}function C(X){const me=X[X.length-1];return typeof me=="object"&&me.constructor===Object?(X.splice(X.length-1,1),me):{}}function S(...X){return"("+(C(X).capture?"":"?:")+X.map(Ke=>g(Ke)).join("|")+")"}function M(X){return new RegExp(X.toString()+"|").exec("").length-1}function O(X,me){const we=X&&X.exec(me);return we&&we.index===0}const j=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function I(X,{joinWith:me}){let we=0;return X.map(Ke=>{we+=1;const Dt=we;let wt=g(Ke),Me="";for(;wt.length>0;){const Oe=j.exec(wt);if(!Oe){Me+=wt;break}Me+=wt.substring(0,Oe.index),wt=wt.substring(Oe.index+Oe[0].length),Oe[0][0]==="\\"&&Oe[1]?Me+="\\"+String(Number(Oe[1])+Dt):(Me+=Oe[0],Oe[0]==="("&&we++)}return Me}).map(Ke=>`(${Ke})`).join(me)}const U=/\b\B/,$="[a-zA-Z]\\w*",Z="[a-zA-Z_]\\w*",K="\\b\\d+(\\.\\d+)?",D="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",te="\\b(0b[01]+)",le="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",pe=(X={})=>{const me=/^#![ ]*\//;return X.binary&&(X.begin=A(me,/.*\b/,X.binary,/\b.*/)),r({scope:"meta",begin:me,end:/$/,relevance:0,"on:begin":(we,Ke)=>{we.index!==0&&Ke.ignoreMatch()}},X)},Q={begin:"\\\\[\\s\\S]",relevance:0},q={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Q]},F={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Q]},k={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/},P=function(X,me,we={}){const Ke=r({scope:"comment",begin:X,end:me,contains:[]},we);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 Dt=S("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:A(/[ ]+/,"(",Dt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ke},J=P("//","$"),w=P("/\\*","\\*/"),H=P("#","$"),se={scope:"number",begin:K,relevance:0},L={scope:"number",begin:D,relevance:0},Ne={scope:"number",begin:te,relevance:0},Te={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Q,{begin:/\[/,end:/\]/,relevance:0,contains:[Q]}]},V={scope:"title",begin:$,relevance:0},ve={scope:"title",begin:Z,relevance:0},Be={begin:"\\.\\s*"+Z,relevance:0};var xt=Object.freeze({__proto__:null,APOS_STRING_MODE:q,BACKSLASH_ESCAPE:Q,BINARY_NUMBER_MODE:Ne,BINARY_NUMBER_RE:te,COMMENT:P,C_BLOCK_COMMENT_MODE:w,C_LINE_COMMENT_MODE:J,C_NUMBER_MODE:L,C_NUMBER_RE:D,END_SAME_AS_BEGIN:function(X){return Object.assign(X,{"on:begin":(me,we)=>{we.data._beginMatch=me[1]},"on:end":(me,we)=>{we.data._beginMatch!==me[1]&&we.ignoreMatch()}})},HASH_COMMENT_MODE:H,IDENT_RE:$,MATCH_NOTHING_RE:U,METHOD_GUARD:Be,NUMBER_MODE:se,NUMBER_RE:K,PHRASAL_WORDS_MODE:k,QUOTE_STRING_MODE:F,REGEXP_MODE:Te,RE_STARTERS_RE:le,SHEBANG:pe,TITLE_MODE:V,UNDERSCORE_IDENT_RE:Z,UNDERSCORE_TITLE_MODE:ve});function un(X,me){X.input[X.index-1]==="."&&me.ignoreMatch()}function cn(X,me){X.className!==void 0&&(X.scope=X.className,delete X.className)}function za(X,me){me&&X.beginKeywords&&(X.begin="\\b("+X.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",X.__beforeBegin=un,X.keywords=X.keywords||X.beginKeywords,delete X.beginKeywords,X.relevance===void 0&&(X.relevance=0))}function Dn(X,me){Array.isArray(X.illegal)&&(X.illegal=S(...X.illegal))}function $n(X,me){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 et(X,me){X.relevance===void 0&&(X.relevance=1)}const qn=(X,me)=>{if(!X.beforeMatch)return;if(X.starts)throw new Error("beforeMatch cannot be used with starts");const we=Object.assign({},X);Object.keys(X).forEach(Ke=>{delete X[Ke]}),X.keywords=we.keywords,X.begin=A(we.beforeMatch,y(we.begin)),X.starts={relevance:0,contains:[Object.assign(we,{endsParent:!0})]},X.relevance=0,delete we.beforeMatch},Ln=["of","and","for","in","not","or","if","then","parent","list","value"],Yn="keyword";function Da(X,me,we=Yn){const Ke=Object.create(null);return typeof X=="string"?Dt(we,X.split(" ")):Array.isArray(X)?Dt(we,X):Object.keys(X).forEach(function(wt){Object.assign(Ke,Da(X[wt],me,wt))}),Ke;function Dt(wt,Me){me&&(Me=Me.map(Oe=>Oe.toLowerCase())),Me.forEach(function(Oe){const Ye=Oe.split("|");Ke[Ye[0]]=[wt,be(Ye[0],Ye[1])]})}}function be(X,me){return me?Number(me):ct(X)?0:1}function ct(X){return Ln.includes(X.toLowerCase())}const ia={},It=X=>{console.error(X)},Qr=(X,...me)=>{console.log(`WARN: ${X}`,...me)},de=(X,me)=>{ia[`${X}/${me}`]||(console.log(`Deprecated as of ${X}. ${me}`),ia[`${X}/${me}`]=!0)},Ae=new Error;function ze(X,me,{key:we}){let Ke=0;const Dt=X[we],wt={},Me={};for(let Oe=1;Oe<=me.length;Oe++)Me[Oe+Ke]=Dt[Oe],wt[Oe+Ke]=!0,Ke+=M(me[Oe-1]);X[we]=Me,X[we]._emit=wt,X[we]._multi=!0}function tt(X){if(Array.isArray(X.begin)){if(X.skip||X.excludeBegin||X.returnBegin)throw It("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ae;if(typeof X.beginScope!="object"||X.beginScope===null)throw It("beginScope must be object"),Ae;ze(X,X.begin,{key:"beginScope"}),X.begin=I(X.begin,{joinWith:""})}}function mt(X){if(Array.isArray(X.end)){if(X.skip||X.excludeEnd||X.returnEnd)throw It("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ae;if(typeof X.endScope!="object"||X.endScope===null)throw It("endScope must be object"),Ae;ze(X,X.end,{key:"endScope"}),X.end=I(X.end,{joinWith:""})}}function jn(X){X.scope&&typeof X.scope=="object"&&X.scope!==null&&(X.beginScope=X.scope,delete X.scope)}function La(X){jn(X),typeof X.beginScope=="string"&&(X.beginScope={_wrap:X.beginScope}),typeof X.endScope=="string"&&(X.endScope={_wrap:X.endScope}),tt(X),mt(X)}function gn(X){function me(Me,Oe){return new RegExp(g(Me),"m"+(X.case_insensitive?"i":"")+(X.unicodeRegex?"u":"")+(Oe?"g":""))}class we{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+=M(Oe)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Oe=this.regexes.map(Ye=>Ye[1]);this.matcherRe=me(I(Oe,{joinWith:"|"}),!0),this.lastIndex=0}exec(Oe){this.matcherRe.lastIndex=this.lastIndex;const Ye=this.matcherRe.exec(Oe);if(!Ye)return null;const Yt=Ye.findIndex((as,Zr)=>Zr>0&&as!==void 0),Bt=this.matchIndexes[Yt];return Ye.splice(0,Yt),Object.assign(Ye,Bt)}}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 we;return this.rules.slice(Oe).forEach(([Yt,Bt])=>Ye.addRule(Yt,Bt)),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 Yt=Ye.exec(Oe);if(this.resumingScanAtSamePosition()&&!(Yt&&Yt.index===this.lastIndex)){const Bt=this.getMatcher(0);Bt.lastIndex=this.lastIndex+1,Yt=Bt.exec(Oe)}return Yt&&(this.regexIndex+=Yt.position+1,this.regexIndex===this.count&&this.considerAll()),Yt}}function Dt(Me){const Oe=new Ke;return Me.contains.forEach(Ye=>Oe.addRule(Ye.begin,{rule:Ye,type:"begin"})),Me.terminatorEnd&&Oe.addRule(Me.terminatorEnd,{type:"end"}),Me.illegal&&Oe.addRule(Me.illegal,{type:"illegal"}),Oe}function wt(Me,Oe){const Ye=Me;if(Me.isCompiled)return Ye;[cn,$n,La,qn].forEach(Bt=>Bt(Me,Oe)),X.compilerExtensions.forEach(Bt=>Bt(Me,Oe)),Me.__beforeBegin=null,[za,Dn,et].forEach(Bt=>Bt(Me,Oe)),Me.isCompiled=!0;let Yt=null;return typeof Me.keywords=="object"&&Me.keywords.$pattern&&(Me.keywords=Object.assign({},Me.keywords),Yt=Me.keywords.$pattern,delete Me.keywords.$pattern),Yt=Yt||/\w+/,Me.keywords&&(Me.keywords=Da(Me.keywords,X.case_insensitive)),Ye.keywordPatternRe=me(Yt,!0),Oe&&(Me.begin||(Me.begin=/\B|\b/),Ye.beginRe=me(Ye.begin),!Me.end&&!Me.endsWithParent&&(Me.end=/\B|\b/),Me.end&&(Ye.endRe=me(Ye.end)),Ye.terminatorEnd=g(Ye.end)||"",Me.endsWithParent&&Oe.terminatorEnd&&(Ye.terminatorEnd+=(Me.end?"|":"")+Oe.terminatorEnd)),Me.illegal&&(Ye.illegalRe=me(Me.illegal)),Me.contains||(Me.contains=[]),Me.contains=[].concat(...Me.contains.map(function(Bt){return Sn(Bt==="self"?Me:Bt)})),Me.contains.forEach(function(Bt){wt(Bt,Ye)}),Me.starts&&wt(Me.starts,Oe),Ye.matcher=Dt(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=r(X.classNameAliases||{}),wt(X)}function zt(X){return X?X.endsWithParent||zt(X.starts):!1}function Sn(X){return X.variants&&!X.cachedVariants&&(X.cachedVariants=X.variants.map(function(me){return r(X,{variants:null},me)})),X.cachedVariants?X.cachedVariants:zt(X)?r(X,{starts:X.starts?r(X.starts):null}):Object.isFrozen(X)?r(X):X}var Et="11.11.1";class $a extends Error{constructor(me,we){super(me),this.name="HTMLInjectionError",this.html=we}}const Bn=a,Fo=r,dr=Symbol("nomatch"),Wr=7,fr=function(X){const me=Object.create(null),we=Object.create(null),Ke=[];let Dt=!0;const wt="Could not find the language '{}', did you forget to load/include a language module?",Me={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(ye){return Oe.noHighlightRe.test(ye)}function Yt(ye){let Pe=ye.className+" ";Pe+=ye.parentNode?ye.parentNode.className:"";const nt=Oe.languageDetectRe.exec(Pe);if(nt){const yt=Pn(nt[1]);return yt||(Qr(wt.replace("{}",nt[1])),Qr("Falling back to no-highlight mode for this block.",ye)),yt?nt[1]:"no-highlight"}return Pe.split(/\s+/).find(yt=>Ye(yt)||Pn(yt))}function Bt(ye,Pe,nt){let yt="",Kt="";typeof Pe=="object"?(yt=ye,nt=Pe.ignoreIllegals,Kt=Pe.language):(de("10.7.0","highlight(lang, code, ...args) has been deprecated."),de("10.7.0",`Please use highlight(code, options) instead.
495
- https://github.com/highlightjs/highlight.js/issues/2277`),Kt=ye,yt=Pe),nt===void 0&&(nt=!0);const Cn={code:yt,language:Kt};hr("before:highlight",Cn);const la=Cn.result?Cn.result:as(Cn.language,Cn.code,nt);return la.code=Cn.code,hr("after:highlight",la),la}function as(ye,Pe,nt,yt){const Kt=Object.create(null);function Cn(Ce,De){return Ce.keywords[De]}function la(){if(!qe.keywords){Jt.addText(Nt);return}let Ce=0;qe.keywordPatternRe.lastIndex=0;let De=qe.keywordPatternRe.exec(Nt),We="";for(;De;){We+=Nt.substring(Ce,De.index);const lt=bn.case_insensitive?De[0].toLowerCase():De[0],Ft=Cn(qe,lt);if(Ft){const[ya,ol]=Ft;if(Jt.addText(We),We="",Kt[lt]=(Kt[lt]||0)+1,Kt[lt]<=Wr&&(Is+=ol),ya.startsWith("_"))We+=De[0];else{const Vo=bn.classNameAliases[ya]||ya;oa(De[0],Vo)}}else We+=De[0];Ce=qe.keywordPatternRe.lastIndex,De=qe.keywordPatternRe.exec(Nt)}We+=Nt.substring(Ce),Jt.addText(We)}function Kn(){if(Nt==="")return;let Ce=null;if(typeof qe.subLanguage=="string"){if(!me[qe.subLanguage]){Jt.addText(Nt);return}Ce=as(qe.subLanguage,Nt,!0,Ko[qe.subLanguage]),Ko[qe.subLanguage]=Ce._top}else Ce=Jr(Nt,qe.subLanguage.length?qe.subLanguage:null);qe.relevance>0&&(Is+=Ce.relevance),Jt.__addSublanguage(Ce._emitter,Ce.language)}function Mt(){qe.subLanguage!=null?Kn():la(),Nt=""}function oa(Ce,De){Ce!==""&&(Jt.startScope(De),Jt.addText(Ce),Jt.endScope())}function Yo(Ce,De){let We=1;const lt=De.length-1;for(;We<=lt;){if(!Ce._emit[We]){We++;continue}const Ft=bn.classNameAliases[Ce[We]]||Ce[We],ya=De[We];Ft?oa(ya,Ft):(Nt=ya,la(),Nt=""),We++}}function ti(Ce,De){return Ce.scope&&typeof Ce.scope=="string"&&Jt.openNode(bn.classNameAliases[Ce.scope]||Ce.scope),Ce.beginScope&&(Ce.beginScope._wrap?(oa(Nt,bn.classNameAliases[Ce.beginScope._wrap]||Ce.beginScope._wrap),Nt=""):Ce.beginScope._multi&&(Yo(Ce.beginScope,De),Nt="")),qe=Object.create(Ce,{parent:{value:qe}}),qe}function rl(Ce,De,We){let lt=O(Ce.endRe,We);if(lt){if(Ce["on:end"]){const Ft=new t(Ce);Ce["on:end"](De,Ft),Ft.isMatchIgnored&&(lt=!1)}if(lt){for(;Ce.endsParent&&Ce.parent;)Ce=Ce.parent;return Ce}}if(Ce.endsWithParent)return rl(Ce.parent,De,We)}function ni(Ce){return qe.matcher.regexIndex===0?(Nt+=Ce[0],1):(Ms=!0,0)}function ud(Ce){const De=Ce[0],We=Ce.rule,lt=new t(We),Ft=[We.__beforeBegin,We["on:begin"]];for(const ya of Ft)if(ya&&(ya(Ce,lt),lt.isMatchIgnored))return ni(De);return We.skip?Nt+=De:(We.excludeBegin&&(Nt+=De),Mt(),!We.returnBegin&&!We.excludeBegin&&(Nt=De)),ti(We,Ce),We.returnBegin?0:De.length}function Vn(Ce){const De=Ce[0],We=Pe.substring(Ce.index),lt=rl(qe,Ce,We);if(!lt)return dr;const Ft=qe;qe.endScope&&qe.endScope._wrap?(Mt(),oa(De,qe.endScope._wrap)):qe.endScope&&qe.endScope._multi?(Mt(),Yo(qe.endScope,Ce)):Ft.skip?Nt+=De:(Ft.returnEnd||Ft.excludeEnd||(Nt+=De),Mt(),Ft.excludeEnd&&(Nt=De));do qe.scope&&Jt.closeNode(),!qe.skip&&!qe.subLanguage&&(Is+=qe.relevance),qe=qe.parent;while(qe!==lt.parent);return lt.starts&&ti(lt.starts,Ce),Ft.returnEnd?0:De.length}function il(){const Ce=[];for(let De=qe;De!==bn;De=De.parent)De.scope&&Ce.unshift(De.scope);Ce.forEach(De=>Jt.openNode(De))}let pr={};function ai(Ce,De){const We=De&&De[0];if(Nt+=Ce,We==null)return Mt(),0;if(pr.type==="begin"&&De.type==="end"&&pr.index===De.index&&We===""){if(Nt+=Pe.slice(De.index,De.index+1),!Dt){const lt=new Error(`0 width match regex (${ye})`);throw lt.languageName=ye,lt.badRule=pr.rule,lt}return 1}if(pr=De,De.type==="begin")return ud(De);if(De.type==="illegal"&&!nt){const lt=new Error('Illegal lexeme "'+We+'" for mode "'+(qe.scope||"<unnamed>")+'"');throw lt.mode=qe,lt}else if(De.type==="end"){const lt=Vn(De);if(lt!==dr)return lt}if(De.type==="illegal"&&We==="")return Nt+=`
496
- `,1;if(ll>1e5&&ll>De.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Nt+=We,We.length}const bn=Pn(ye);if(!bn)throw It(wt.replace("{}",ye)),new Error('Unknown language: "'+ye+'"');const Go=gn(bn);let si="",qe=yt||Go;const Ko={},Jt=new Oe.__emitter(Oe);il();let Nt="",Is=0,is=0,ll=0,Ms=!1;try{if(bn.__emitTokens)bn.__emitTokens(Pe,Jt);else{for(qe.matcher.considerAll();;){ll++,Ms?Ms=!1:qe.matcher.considerAll(),qe.matcher.lastIndex=is;const Ce=qe.matcher.exec(Pe);if(!Ce)break;const De=Pe.substring(is,Ce.index),We=ai(De,Ce);is=Ce.index+We}ai(Pe.substring(is))}return Jt.finalize(),si=Jt.toHTML(),{language:ye,value:si,relevance:Is,illegal:!1,_emitter:Jt,_top:qe}}catch(Ce){if(Ce.message&&Ce.message.includes("Illegal"))return{language:ye,value:Bn(Pe),illegal:!0,relevance:0,_illegalBy:{message:Ce.message,index:is,context:Pe.slice(is-100,is+100),mode:Ce.mode,resultSoFar:si},_emitter:Jt};if(Dt)return{language:ye,value:Bn(Pe),illegal:!1,relevance:0,errorRaised:Ce,_emitter:Jt,_top:qe};throw Ce}}function Zr(ye){const Pe={value:Bn(ye),illegal:!1,relevance:0,_top:Me,_emitter:new Oe.__emitter(Oe)};return Pe._emitter.addText(ye),Pe}function Jr(ye,Pe){Pe=Pe||Oe.languages||Object.keys(me);const nt=Zr(ye),yt=Pe.filter(Pn).filter(Rs).map(Mt=>as(Mt,ye,!1));yt.unshift(nt);const Kt=yt.sort((Mt,oa)=>{if(Mt.relevance!==oa.relevance)return oa.relevance-Mt.relevance;if(Mt.language&&oa.language){if(Pn(Mt.language).supersetOf===oa.language)return 1;if(Pn(oa.language).supersetOf===Mt.language)return-1}return 0}),[Cn,la]=Kt,Kn=Cn;return Kn.secondBest=la,Kn}function qa(ye,Pe,nt){const yt=Pe&&we[Pe]||nt;ye.classList.add("hljs"),ye.classList.add(`language-${yt}`)}function Gt(ye){let Pe=null;const nt=Yt(ye);if(Ye(nt))return;if(hr("before:highlightElement",{el:ye,language:nt}),ye.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ye);return}if(ye.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(ye)),Oe.throwUnescapedHTML))throw new $a("One of your code blocks includes unescaped HTML.",ye.innerHTML);Pe=ye;const yt=Pe.textContent,Kt=nt?Bt(yt,{language:nt,ignoreIllegals:!0}):Jr(yt);ye.innerHTML=Kt.value,ye.dataset.highlighted="yes",qa(ye,nt,Kt.language),ye.result={language:Kt.language,re:Kt.relevance,relevance:Kt.relevance},Kt.secondBest&&(ye.secondBest={language:Kt.secondBest.language,relevance:Kt.secondBest.relevance}),hr("after:highlightElement",{el:ye,result:Kt,text:yt})}function An(ye){Oe=Fo(Oe,ye)}const ks=()=>{ei(),de("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function al(){ei(),de("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let zo=!1;function ei(){function ye(){ei()}if(document.readyState==="loading"){zo||window.addEventListener("DOMContentLoaded",ye,!1),zo=!0;return}document.querySelectorAll(Oe.cssSelector).forEach(Gt)}function $o(ye,Pe){let nt=null;try{nt=Pe(X)}catch(yt){if(It("Language definition for '{}' could not be registered.".replace("{}",ye)),Dt)It(yt);else throw yt;nt=Me}nt.name||(nt.name=ye),me[ye]=nt,nt.rawDefinition=Pe.bind(null,X),nt.aliases&&ss(nt.aliases,{languageName:ye})}function mr(ye){delete me[ye];for(const Pe of Object.keys(we))we[Pe]===ye&&delete we[Pe]}function sl(){return Object.keys(me)}function Pn(ye){return ye=(ye||"").toLowerCase(),me[ye]||me[we[ye]]}function ss(ye,{languageName:Pe}){typeof ye=="string"&&(ye=[ye]),ye.forEach(nt=>{we[nt.toLowerCase()]=Pe})}function Rs(ye){const Pe=Pn(ye);return Pe&&!Pe.disableAutodetect}function Os(ye){ye["before:highlightBlock"]&&!ye["before:highlightElement"]&&(ye["before:highlightElement"]=Pe=>{ye["before:highlightBlock"](Object.assign({block:Pe.el},Pe))}),ye["after:highlightBlock"]&&!ye["after:highlightElement"]&&(ye["after:highlightElement"]=Pe=>{ye["after:highlightBlock"](Object.assign({block:Pe.el},Pe))})}function Zt(ye){Os(ye),Ke.push(ye)}function qo(ye){const Pe=Ke.indexOf(ye);Pe!==-1&&Ke.splice(Pe,1)}function hr(ye,Pe){const nt=ye;Ke.forEach(function(yt){yt[nt]&&yt[nt](Pe)})}function rs(ye){return de("10.7.0","highlightBlock will be removed entirely in v12.0"),de("10.7.0","Please use highlightElement now."),Gt(ye)}Object.assign(X,{highlight:Bt,highlightAuto:Jr,highlightAll:ei,highlightElement:Gt,highlightBlock:rs,configure:An,initHighlighting:ks,initHighlightingOnLoad:al,registerLanguage:$o,unregisterLanguage:mr,listLanguages:sl,getLanguage:Pn,registerAliases:ss,autoDetection:Rs,inherit:Fo,addPlugin:Zt,removePlugin:qo}),X.debugMode=function(){Dt=!1},X.safeMode=function(){Dt=!0},X.versionString=Et,X.regex={concat:A,lookahead:y,either:S,optional:v,anyNumberOfTimes:N};for(const ye in xt)typeof xt[ye]=="object"&&e(xt[ye]);return Object.assign(X,xt),X},Gn=fr({});return Gn.newInstance=()=>fr({}),Km=Gn,Gn.HighlightJS=Gn,Gn.default=Gn,Km}var GD=YD();const KD=zc(GD),eE={},VD="hljs-";function XD(e){const t=KD.newInstance();return e&&u(e),{highlight:a,highlightAuto:r,listLanguages:o,register:u,registerAlias:c,registered:f};function a(m,h,b){const g=b||eE,y=typeof g.prefix=="string"?g.prefix:VD;if(!t.getLanguage(m))throw new Error("Unknown language: `"+m+"` is not registered");t.configure({__emitter:QD,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,A=v.data;return A.language=N.language,A.relevance=N.relevance,v}function r(m,h){const g=(h||eE).subset||o();let y=-1,N=0,v;for(;++y<g.length;){const A=g[y];if(!t.getLanguage(A))continue;const C=a(A,m,h);C.data&&C.data.relevance!==void 0&&C.data.relevance>N&&(N=C.data.relevance,v=C)}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 c(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 QD{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],r=a.children[a.children.length-1];r&&r.type==="text"?r.value+=t:a.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,a){const r=this.stack[this.stack.length-1],o=t.root.children;a?r.children.push({type:"element",tagName:"span",properties:{className:[a]},children:o}):r.children.push(...o)}openNode(t){const a=this,r=t.split(".").map(function(c,f){return f?c+"_".repeat(f):a.options.classPrefix+c}),o=this.stack[this.stack.length-1],u={type:"element",tagName:"span",properties:{className:r},children:[]};o.children.push(u),this.stack.push(u)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const WD={};function ZD(e){const t=e||WD,a=t.aliases,r=t.detect||!1,o=t.languages||qD,u=t.plainText,c=t.prefix,f=t.subset;let m="hljs";const h=XD(o);if(a&&h.registerAlias(a),c){const b=c.indexOf("-");m=b===-1?c:c.slice(0,b)}return function(b,g){jo(b,"element",function(y,N,v){if(y.tagName!=="code"||!v||v.type!=="element"||v.tagName!=="pre")return;const A=JD(y);if(A===!1||!A&&!r||A&&u&&u.includes(A))return;Array.isArray(y.properties.className)||(y.properties.className=[]),y.properties.className.includes(m)||y.properties.className.unshift(m);const C=bM(y,{whitespace:"pre"});let S;try{S=A?h.highlight(A,C,{prefix:c}):h.highlightAuto(C,{prefix:c,subset:f})}catch(M){const O=M;if(A&&/Unknown language/.test(O.message)){g.message("Cannot highlight as `"+A+"`, it’s not registered",{ancestors:[v,y],cause:O,place:y.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw O}!A&&S.data&&S.data.language&&y.properties.className.push("language-"+S.data.language),S.children.length>0&&(y.children=S.children)})}}function JD(e){const t=e.properties.className;let a=-1;if(!Array.isArray(t))return;let r;for(;++a<t.length;){const o=String(t[a]);if(o==="no-highlight"||o==="nohighlight")return!1;!r&&o.slice(0,5)==="lang-"&&(r=o.slice(5)),!r&&o.slice(0,9)==="language-"&&(r=o.slice(9))}return r}function eL(e){const[t,a]=T.useState("fit"),r=t==="wide";return i.jsxs("div",{className:`md-table-wrap ${r?"md-table-wide":"md-table-fit"}`,children:[i.jsxs("button",{type:"button",className:"md-table-toggle",title:r?"适应屏幕":"超宽展开",onClick:()=>a(r?"fit":"wide"),children:[r?i.jsx(U3,{className:"h-3 w-3"}):i.jsx(R3,{className:"h-3 w-3"}),i.jsx("span",{children:r?"适应屏幕":"超宽展开"})]}),i.jsx("div",{className:"md-table-scroll",children:i.jsx("table",{...e})})]})}function tL({q:e,pending:t,selected:a,customText:r,onSelect:o,onCustomTextChange:u,onClearSelections:c,onSubmitCustom:f,isSingle:m}){const[h,b]=T.useState(!1),g=h||r.length>0;return i.jsxs("div",{className:"space-y-2",children:[e.header&&i.jsx("div",{className:"text-xs font-semibold text-fg-3",children:e.header}),i.jsx("p",{className:"text-sm text-fg-2",children:e.question}),e.options.length>0&&i.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 i.jsxs("button",{type:"button",disabled:!t,onClick:()=>{b(!1),u(""),o(y.label)},className:ne("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&&i.jsx(On,{className:"mr-1 inline h-3 w-3"}),i.jsx("span",{className:"font-medium",children:y.label}),y.description&&i.jsx("span",{className:"ml-1.5 text-fg-5",children:y.description})]},y.label)}),t&&i.jsxs("button",{type:"button",onClick:()=>{g?(b(!1),u("")):(b(!0),c())},className:ne("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&&i.jsx(On,{className:"mr-1 inline h-3 w-3"}),i.jsx("span",{className:"font-medium",children:"其他…"})]})]}),g&&t&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"text",value:r,onChange:y=>{u(y.target.value),y.target.value&&c()},onKeyDown:y=>{y.key==="Enter"&&r.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&&i.jsx("button",{type:"button",disabled:!r.trim(),onClick:f,className:ne("flex items-center gap-1 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",r.trim()?"bg-emerald-600 text-white hover:bg-emerald-500":"bg-surface/50 text-fg-5 cursor-not-allowed"),children:i.jsx(Eo,{className:"h-3 w-3"})})]})]})}function nL({part:e}){const t=ew(e),a=Zh(e),r=a==="pending"||a==="running",o=Re(Z=>Z.activeSessionId),u=Re(Z=>Z.replyQuestion),c=Re(Z=>Z.rejectQuestion),[f,m]=T.useState(null),[h,b]=T.useState({}),[g,y]=T.useState({});if(!t||t.length===0)return null;const N=t.length===1,v=()=>{o&&Qt.getState().removeToast(`question-${o}`)},A=(Z,K)=>{if(!f){if(y(D=>{const{[Z]:te,...le}=D;return le}),N){m("answered"),v(),u([[K]]);return}b(D=>{const te=t[Z],le=D[Z]??[];if(te.multiple){const pe=le.includes(K);return{...D,[Z]:pe?le.filter(Q=>Q!==K):[...le,K]}}return{...D,[Z]:[K]}})}},C=(Z,K)=>{y(D=>{if(K)return{...D,[Z]:K};const{[Z]:te,...le}=D;return le})},S=Z=>{b(K=>{const{[Z]:D,...te}=K;return te})},M=Z=>{var D;const K=(D=g[Z])==null?void 0:D.trim();f||!K||(m("answered"),v(),u([[K]]))},O=t.filter((Z,K)=>{var D,te;return(((D=h[K])==null?void 0:D.length)??0)>0||(((te=g[K])==null?void 0:te.trim().length)??0)>0}).length,j=!N&&O===t.length,I=()=>{if(f||!j)return;m("answered"),v();const Z=t.map((K,D)=>{var le;const te=(le=g[D])==null?void 0:le.trim();return te?[te]:h[D]??[]});u(Z)},U=()=>{f||(m("dismissed"),v(),c())},$=r&&!f;return i.jsxs("div",{className:ne("my-1 overflow-hidden rounded-md border bg-term/70",$?"border-blue-500/40":"border-line"),children:[i.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 font-mono text-xs",children:[i.jsx(M3,{className:ne("h-3.5 w-3.5 shrink-0",$?"text-blue-400":"text-fg-4")}),i.jsx("span",{className:ne("font-medium",$?"text-blue-300":"text-fg-3"),children:f==="answered"?"已回复":f==="dismissed"?"已取消":$?"等待回复":"Question"}),!N&&$&&i.jsxs("span",{className:"text-fg-5",children:["(",O,"/",t.length,")"]}),$&&i.jsxs("button",{type:"button",onClick:U,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:[i.jsx(gt,{className:"h-3 w-3"}),i.jsx("span",{children:"取消"})]})]}),i.jsxs("div",{className:"border-t border-line px-4 py-3 space-y-3",children:[t.map((Z,K)=>i.jsx(tL,{q:Z,pending:$,selected:h[K],customText:g[K]??"",onSelect:D=>A(K,D),onCustomTextChange:D=>C(K,D),onClearSelections:()=>S(K),onSubmitCustom:N?()=>M(K):void 0,isSingle:N},K)),!N&&$&&i.jsx("div",{className:"flex justify-end pt-1",children:i.jsxs("button",{type:"button",disabled:!j,onClick:I,className:ne("flex items-center gap-1.5 rounded-md px-4 py-1.5 text-xs font-medium transition-colors",j?"bg-emerald-600 text-white hover:bg-emerald-500":"bg-surface/50 text-fg-5 cursor-not-allowed"),children:[i.jsx(Eo,{className:"h-3 w-3"}),i.jsx("span",{children:"提交回答"})]})})]})]})}const Vm=2e3,aL={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"},sL={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 sd(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function Za(e,t){if(!e)return null;for(const a of t){const r=e[a];if(typeof r=="string"&&r.trim())return r.trim()}return null}function rL(e,t){const a=e.toLowerCase(),r=aL[a]??e.charAt(0).toUpperCase()+e.slice(1),o=sd(t);switch(a){case"read":case"write":case"edit":case"patch":return{label:r,arg:Za(o,["filePath","path","file"])};case"grep":{const u=Za(o,["pattern","query"]);return{label:r,arg:u?`"${u}"`:null}}case"glob":return{label:r,arg:Za(o,["pattern","query"])};case"bash":case"shell":{const u=Za(o,["command","cmd","script"]);return{label:r,arg:u?u.split(`
497
- `)[0]:null}}case"webfetch":case"fetch":return{label:r,arg:Za(o,["url"])};case"task":case"agent":return{label:r,arg:Za(o,["description","prompt","title"])};default:return{label:r,arg:Za(o,["filePath","path","pattern","query","command","url","description"])}}}function iL({oldStr:e,newStr:t}){const a=e.split(`
498
- `),r=t.split(`
499
- `);return i.jsxs("div",{className:"grid grid-cols-1 gap-px overflow-x-auto rounded text-xs md:grid-cols-2",children:[i.jsx("pre",{className:"min-w-0 whitespace-pre-wrap break-words p-1.5 fs-diff-del",children:a.map((o,u)=>i.jsxs("div",{children:[i.jsx("span",{className:"select-none text-red-400/70",children:"− "}),i.jsx("span",{className:"text-red-400",children:o})]},u))}),i.jsx("pre",{className:"min-w-0 whitespace-pre-wrap break-words p-1.5 fs-diff-add",children:r.map((o,u)=>i.jsxs("div",{children:[i.jsx("span",{className:"select-none text-emerald-400/70",children:"+ "}),i.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 RT({todos:e}){return i.jsx("ul",{className:"space-y-0.5 text-xs",children:e.map((t,a)=>{var f;const r=((f=t.status)==null?void 0:f.toLowerCase())??"pending",o=r==="in-progress"||r==="active"?"in_progress":r==="done"||r==="complete"?"completed":r==="canceled"?"cancelled":r,u=tE[o]??tE.pending,c=o==="completed"||o==="cancelled";return i.jsxs("li",{className:"flex items-start gap-1.5",children:[i.jsx("span",{className:ne("shrink-0 leading-5",u.color,o==="in_progress"&&"fs-spin"),children:u.glyph}),i.jsx("span",{className:ne("leading-5",c?"text-fg-5 line-through":"text-fg-2"),children:t.content}),t.priority&&i.jsx("span",{className:"ml-auto shrink-0 text-fg-5",children:t.priority})]},a)})})}const lL={"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"},oL={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 uL({record:e}){const[t,a]=T.useState(!1),r=typeof e.category=="string"?e.category:null,o=typeof e.subagent_type=="string"?e.subagent_type:null,u=Za(e,["description","title"]),c=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=r??o,g=(r&&lL[r])??(o&&oL[o])??"bg-elevated text-fg-3";return i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[b&&i.jsx("span",{className:ne("rounded px-1.5 py-0.5 text-[10px] font-medium",g),children:b}),f.map(y=>i.jsx("span",{className:"rounded bg-elevated px-1.5 py-0.5 text-[10px] text-fg-4",children:y},y)),m&&i.jsx("span",{className:"rounded bg-elevated px-1.5 py-0.5 text-[10px] text-fg-5",children:"bg"}),h&&i.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&&i.jsx("p",{className:"text-xs text-fg-2",children:u}),c&&i.jsxs("div",{children:[i.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:[i.jsx(Kc,{className:ne("h-3 w-3 transition-transform",t&&"rotate-90")}),"Prompt",i.jsxs("span",{className:"text-fg-5",children:["(",c.length," chars)"]})]}),t&&i.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:c})]})]})}function cL(e){const t=nw(e),a=Re(m=>m.activeSessionId),r=Re(m=>m.sessions);if(t)return t;if(!a)return null;const o=Wc(e),u=sd(o),c=Za(u,["description","title"]),f=r.filter(m=>m.parentID===a);if(f.length===0)return null;if(f.length===1)return f[0].id;if(c){const m=f.find(h=>h.title===c);if(m)return m.id}return null}function dL({part:e}){const t=cL(e),a=Re(r=>r.setActiveSession);return t?i.jsxs("button",{type:"button",onClick:r=>{r.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:[i.jsxs("span",{className:"truncate text-fg-5",children:[t.slice(0,20),"…"]}),i.jsx(kA,{className:"h-3 w-3 shrink-0"}),i.jsx("span",{className:"shrink-0",children:"查看子会话"})]}):null}function fL(e,t){const a=sd(t);if(!a)return null;const r=e.toLowerCase();if(r==="edit"||r==="patch"){const o=typeof a.oldString=="string"?a.oldString:"",u=typeof a.newString=="string"?a.newString:"";if(o||u)return i.jsx(iL,{oldStr:o,newStr:u})}if(r==="todowrite"||r==="write_todos"){const o=Array.isArray(a.todos)?a.todos:null;if(o&&o.length>0)return i.jsx(RT,{todos:o})}if(r==="bash"||r==="shell"){const o=Za(a,["command","cmd","script"]);if(o)return i.jsxs("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-fg-2",children:[i.jsx("span",{className:"select-none text-emerald-400/70",children:"❯ "}),o]})}if(r==="task"||r==="agent")return i.jsx(uL,{record:a});if(r==="read")return null;if(r==="write"){const o=typeof a.content=="string"?a.content:null;if(o){const u=o.length>500?`${o.slice(0,500)}…`:o;return i.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-fg-2",children:u})}}return null}function mL(e,t){const a=e.toLowerCase();if(a==="todowrite"||a==="write_todos"){const r=Array.isArray(t)?t:null;if(r&&r.length>0)return i.jsx(RT,{todos:r})}return null}function hL({part:e}){const t=Zh(e),a=t==="running"||t==="pending",[r,o]=T.useState(a),[u,c]=T.useState(!1),f=T.useRef(a);T.useEffect(()=>{f.current!==a&&(o(a),f.current=a)},[a]);const m=qy(e),h=m.toLowerCase(),b=h==="task"||h==="agent",g=Wc(e),{label:y,arg:N}=rL(m,g),v=fL(m,g),A=v?null:Ux(g),C=Wh(e),S=mL(m,C),M=S?"":Ux(C),O=sL[t],j=h==="edit"||h==="patch";let I=0,U=0;if(j){const K=sd(g);if(K){const D=typeof K.oldString=="string"?K.oldString:"",te=typeof K.newString=="string"?K.newString:"";D&&(U=D.split(`
500
- `).length),te&&(I=te.split(`
501
- `).length)}}const $=M.length>Vm,Z=u||!$?M:`${M.slice(0,Vm)}…`;return i.jsxs("div",{className:"my-1 overflow-hidden rounded-md border border-line bg-term/70",children:[i.jsxs("button",{type:"button",onClick:()=>o(K=>!K),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:[i.jsx("span",{className:ne("shrink-0 leading-none",O.color),children:r?"▾":"▸"}),i.jsx("span",{className:"shrink-0 font-medium text-fg",children:y}),N&&i.jsx("span",{className:"truncate text-fg-3",children:N}),j&&(I>0||U>0)&&i.jsxs("span",{className:"flex shrink-0 items-center gap-1.5 text-[11px] leading-none",children:[I>0&&i.jsxs("span",{className:"text-emerald-400",children:["+",I]}),U>0&&i.jsxs("span",{className:"text-red-400",children:["-",U]})]}),i.jsxs("span",{className:ne("ml-auto flex shrink-0 items-center gap-1.5 leading-none",O.color),children:[i.jsx("span",{className:ne(O.spin&&"fs-spin"),children:O.glyph}),i.jsx("span",{children:O.label})]})]}),r&&i.jsx("div",{className:"border-t border-line px-3 py-2",children:i.jsxs("div",{className:ne("ml-1 border-l-2 pl-3 font-mono text-xs",O.accent),children:[v&&i.jsx("section",{className:"mb-2",children:v}),A&&i.jsxs("section",{className:"mb-2",children:[i.jsx("div",{className:"mb-1 text-[10px] uppercase tracking-wider text-fg-5",children:"input"}),i.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-fg-2",children:A})]}),b&&i.jsx(dL,{part:e}),S&&i.jsx("section",{children:S}),M&&i.jsxs("section",{children:[i.jsx("div",{className:"mb-1 text-[10px] uppercase tracking-wider text-fg-5",children:"output"}),i.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-fg-2",children:Z}),$&&i.jsx("button",{type:"button",onClick:()=>c(K=>!K),className:"mt-1 text-blue-400 transition-colors hover:text-blue-300",children:u?"show less":`show ${M.length-Vm} more chars`})]}),!v&&!A&&!S&&!M&&i.jsx("div",{className:"text-fg-5",children:"no parameters"})]})})]})}function pL({text:e}){const[t,a]=T.useState(!1);return i.jsxs("div",{className:"my-1",children:[i.jsxs("button",{type:"button",onClick:()=>a(r=>!r),className:"flex items-center gap-1.5 font-mono text-xs text-fg-5 transition-colors hover:text-fg-3",children:[t?i.jsx(ba,{className:"h-3 w-3 shrink-0"}):i.jsx(Kc,{className:"h-3 w-3 shrink-0"}),i.jsx(zi,{className:"h-3 w-3 shrink-0"}),i.jsx("span",{children:"thinking"})]}),t&&i.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 gL(){const[e,t]=T.useState(0);return T.useEffect(()=>{const a=Date.now(),r=setInterval(()=>{t(Math.floor((Date.now()-a)/1e3))},1e3);return()=>clearInterval(r)},[]),i.jsxs("div",{className:"my-1 flex items-center gap-1.5 font-mono text-xs text-fg-5",children:[i.jsx(zi,{className:"h-3 w-3 shrink-0 animate-pulse"}),i.jsx("span",{children:"thinking"}),e>0&&i.jsxs("span",{className:"text-fg-6",children:[e,"s"]})]})}function OT({part:e,className:t}){var a;return e.url?(a=e.mime)!=null&&a.startsWith("image/")?i.jsx(tT,{url:e.url,label:e.filename??"attachment",className:ne("object-contain",t??"max-h-80")}):i.jsxs("div",{className:"flex items-center gap-1.5 font-mono text-xs text-fg-5",children:[i.jsx(Q3,{className:"h-3 w-3 shrink-0"}),i.jsx("span",{children:e.filename??e.mime??"attachment"})]}):null}function bL({part:e,isStreaming:t}){switch(wc(e)){case"text":{const r=kc(e);return r.trim()?i.jsx("div",{className:"markdown-body leading-relaxed",children:i.jsx(Yi,{remarkPlugins:[Gi],rehypePlugins:[ZD],components:{table:eL},children:r})}):null}case"thinking":{const r=kc(e);return r.trim()?i.jsx(pL,{text:r}):t?i.jsx(gL,{}):null}case"tool":return yo(e)?i.jsx(nL,{part:e}):i.jsx(hL,{part:e});case"file":return i.jsx(OT,{part:e});default:return null}}function xL({message:e,isStreaming:t,queued:a}){var b,g,y,N,v,A;const r=e.role==="user",o=e.parts??[],u=o.filter(C=>wc(C)!=="other");if(r){const C=o.map(kc).join("").trim(),S=o.filter(j=>wc(j)==="file"),M=(b=e.time)==null?void 0:b.created,O=M?new Date(M*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):null;return i.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:[i.jsxs("div",{className:"mb-1 flex items-center gap-2 text-[11px]",children:[i.jsx("span",{className:"font-medium text-emerald-400",children:"You"}),O&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-fg-6",children:"·"}),i.jsx("span",{className:"text-fg-5",children:O})]}),a&&i.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:[i.jsx("span",{className:"leading-none",children:"○"}),i.jsx("span",{children:"queued"})]})]}),i.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[i.jsx("span",{className:"shrink-0 select-none text-emerald-400",children:"❯"}),i.jsx("span",{className:"min-w-0 flex-1 whitespace-pre-wrap break-words text-fg",children:C||"…"})]}),S.length>0&&i.jsx("div",{className:"mt-2 flex flex-wrap gap-2 pl-5",children:S.map((j,I)=>i.jsx(OT,{part:j,className:"max-h-40"},j.id??I))})]})}const c=((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 i.jsxs("div",{className:"fs-fade-in font-mono",children:[(c||f)&&i.jsxs("div",{className:"mb-1 flex items-center gap-2 text-xs",children:[c&&i.jsx("span",{className:"text-fg-3",children:c}),c&&f&&i.jsx("span",{className:"text-fg-6",children:"·"}),f&&i.jsx("span",{className:"text-fg-5",children:f})]}),m&&i.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:[i.jsx(Tn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"font-semibold",children:m.name??"Error"}),((A=m.data)==null?void 0:A.message)&&i.jsx("p",{className:"mt-0.5 text-red-400/80",children:m.data.message}),h&&h!=="end"&&i.jsxs("p",{className:"mt-0.5 text-red-400/60",children:["finish: ",h]})]})]}),i.jsx("div",{className:"space-y-2 text-sm text-fg",children:u.length>0?u.map((C,S)=>i.jsx(bL,{part:C,isStreaming:t},C.id??C.callID??S)):!m&&(t?i.jsx("span",{className:"text-fg-5",children:"…"}):i.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-amber-400/80",children:[i.jsx(Tn,{className:"h-3 w-3 shrink-0"}),i.jsx("span",{children:"空响应 — Agent 未产出任何内容"})]}))})]})}const EL={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 yL(e){const t=e.find(r=>$r(r.status)==="in_progress");if(t)return t.content;const a=e.find(r=>$r(r.status)==="pending");return a?a.content:"all steps complete"}function NL({todos:e,onClick:t}){if(e.length===0)return null;const a=e.length,r=Yy(e);return i.jsx("div",{className:"rounded-md border border-line bg-term/60 px-3 py-2",children:i.jsxs("button",{type:"button",onClick:t,className:"flex w-full items-center gap-2 text-left font-mono text-xs",children:[i.jsxs("span",{className:"shrink-0 tabular-nums text-fg-4",children:["[",r,"/",a,"]"]}),i.jsx("span",{className:"shrink-0 tracking-tight",children:e.map(o=>{const u=EL[$r(o.status)];return i.jsx("span",{className:u.color,children:u.glyph},o.id)})}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-fg-2",children:yL(e)}),i.jsx("span",{className:"shrink-0 text-[10px] text-fg-5",children:"详情 →"})]})})}const TL=200;function _L(){return Re(e=>{const t=e.activeSessionId;if(!t)return!1;const a=e.messages[t]??No;for(let r=a.length-1;r>=0;r--){const o=a[r].parts;if(o){for(const u of o)if(wc(u)==="tool"&&Rc(u))return!0}}return!1})}function vL(){var F;const[e,t]=T.useState(""),[a,r]=T.useState(""),[o,u]=T.useState(""),[c,f]=T.useState([]),m=T.useRef(null),h=Re(k=>k.activeSessionId),b=je(k=>k.activeRepoId),g=Re(k=>{const P=k.activeSessionId;return P?k.sessionStatuses[P]:void 0}),y=Re(k=>k.sendMessage),N=xc(k=>k.setDraft),v=xc(k=>k.clearDraft),A=_L(),C=T.useCallback(async k=>{if(!await y(k,a||void 0,o||void 0))return!1},[y,a,o]),S=oT(C);T.useEffect(()=>{if(!b){f([]);return}let k=!1;return(async()=>{try{const[P,J]=await Promise.all([Oo(),Ro(b)]);if(k)return;const w=P.pinned_models,H=w?JSON.parse(w):[];f(H.length>0?J.filter(se=>H.includes(se.id)):[])}catch{k||f([])}})(),()=>{k=!0}},[b]);const M=g==="busy"&&!A,O=!h;T.useLayoutEffect(()=>{const k=m.current;k&&(k.style.height="auto",k.style.height=`${Math.min(k.scrollHeight,TL)}px`)},[e]);const j=((F=c.find(k=>k.id===a))==null?void 0:F.supportsImage)!==!1,{attachments:I,promptFiles:U,error:$,addFiles:Z,onPaste:K,remove:D,clear:te}=nT(j);T.useEffect(()=>{t(h?xc.getState().drafts[h]??"":""),te(),S.stt.stop()},[h,te,S.stt.stop]);const le=async()=>{const k=e.trim();if(O||!k&&I.length===0)return;await y(k,a||void 0,o||void 0,U.length>0?U:void 0)&&(t(""),te(),h&&v(h))},pe=k=>{k.nativeEvent.isComposing||k.keyCode===229||k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),le())},Q=h?A?"输入回复,或点击上方选项…":M?"输入消息将排队等待处理…":"enter a command…":"select or start a run",q=h?M?"text-amber-400 fs-blink":A?"text-blue-400":"text-emerald-400":"text-fg-6";return i.jsxs("div",{className:"relative border-t border-line bg-term px-4 py-4",children:[i.jsx(iT,{phase:S.stt.phase,transcript:S.stt.transcript,interimTranscript:S.stt.interimTranscript,editText:S.editText,onEditTextChange:S.setEditText,onTextareaKeyDown:S.handleTextareaKeyDown,textareaRef:S.textareaRef,wrapperClassName:"absolute bottom-full left-0 right-0 z-20 border-t border-line bg-surface/95 backdrop-blur-sm"}),i.jsx(sT,{attachments:I,error:$,onRemove:D,className:"mx-auto max-w-4xl"}),i.jsxs("div",{className:ne("mx-auto flex max-w-4xl items-start gap-2 rounded-lg border px-3 py-2 transition-colors duration-150",O?"border-line":"border-fg-5 focus-within:border-fg-4"),children:[i.jsx("span",{className:ne("select-none pt-px font-mono text-sm leading-6",q),children:"❯"}),i.jsx("textarea",{ref:m,rows:2,value:e,disabled:O,onChange:k=>{const P=k.target.value;t(P),h&&N(h,P)},onKeyDown:pe,onPaste:K,placeholder:Q,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"}),i.jsx(aT,{onFiles:k=>void Z(k),disabled:O,allowed:j}),i.jsx(rT,{isListening:S.stt.isListening,disabled:O,onStart:S.stt.start,onStop:()=>void S.stt.stop()}),i.jsx("button",{type:"button",onClick:le,disabled:O||e.trim().length===0&&I.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:i.jsx(by,{className:"h-4 w-4",strokeWidth:2.5})})]}),S.stt.phase==="idle"?i.jsxs("div",{className:"mx-auto mt-1.5 flex max-w-4xl items-center gap-3 pl-5",children:[S.stt.error&&i.jsx("span",{className:"font-mono text-[10px] text-red-400",children:S.stt.error}),i.jsx("span",{className:"font-mono text-[10px] text-fg-6",children:"⏎ to run · shift+⏎ for newline"}),i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsxs("select",{value:o,onChange:k=>u(k.target.value),className:"max-w-[100px] 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:[i.jsx("option",{value:"",children:"默认"}),i.jsx("option",{value:"max",children:"max"}),i.jsx("option",{value:"high",children:"high"})]}),c.length>0&&i.jsxs("select",{value:a,onChange:k=>r(k.target.value),className:"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:[i.jsx("option",{value:"",children:"默认模型"}),c.map(k=>i.jsx("option",{value:k.id,children:k.name||k.id},k.id))]})]})]}):i.jsx(lT,{phase:S.stt.phase,volumeLevel:S.stt.volumeLevel,elapsed:S.elapsed,editText:S.editText,error:S.stt.error,onCancel:S.cancel,onConfirm:()=>void S.confirm(),className:"mx-auto mt-1.5 flex max-w-4xl items-center gap-3 pl-5"})]})}const nE={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}},aE=[{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 SL(e){const t=e.trim(),a=t.charCodeAt(0)||0;return{...aE[a%aE.length],initial:(t.charAt(0)||"?").toUpperCase()}}function sE({status:e,reason:t}){const a=nE[e??"idle"]??nE.idle;return i.jsxs("span",{className:ne("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:[i.jsx("span",{className:ne("leading-none",a.spin&&"fs-spin"),children:a.glyph}),i.jsx("span",{children:a.label})]})}const AL={"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},rE=1e6;function CL(e){if(!e)return rE;for(const[t,a]of Object.entries(AL))if(e.startsWith(t))return a;return rE}function iE(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function wL(e){return e>=1?`$${e.toFixed(2)}`:e>=.01?`$${e.toFixed(3)}`:e>0?`$${e.toFixed(4)}`:"$0"}function kL(e){for(let t=e.length-1;t>=0;t--){const a=e[t];if(a.role==="assistant"&&a.tokens){const r=a.tokens;if(r.cache&&(r.cache.read>0||r.cache.write>0)||r.input>0||r.output>0)return r}}return null}function lE({session:e,messages:t}){var m,h,b;const a=kL(t),r=(e==null?void 0:e.cost)??0;if(!a&&!r)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=CL((b=e==null?void 0:e.model)==null?void 0:b.modelID),c=o>0?Math.min(Math.round(o/u*100),999):0,f=c>=80?"text-red-400":c>=50?"text-amber-400":"text-fg-5";return i.jsxs("div",{className:"flex items-center gap-2 font-mono text-[11px] text-fg-5",children:[o>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{title:"当前上下文 = cache_read + cache_write + input (最近一次请求)",children:iE(o)}),i.jsx("span",{className:"text-fg-6",children:"·"}),i.jsxs("span",{className:f,title:`上下文占比 (${iE(u)} 窗口)`,children:[c,"%"]}),i.jsx("span",{className:"text-fg-6",children:"·"})]}),i.jsx("span",{title:"会话累计费用",children:wL(r)})]})}const RL=144,OL=64;function IL({onToggleSidebar:e}){var J;const[t,a]=T.useState(""),[r,o]=T.useState(""),[u,c]=T.useState(""),[f,m]=T.useState(""),h=T.useRef(null),[b,g]=T.useState([]),y=Re(w=>w.createSession),N=Re(w=>w.sendError),v=je(w=>w.activeRepoId),C=or(w=>w.agents).filter(w=>w.isSystem<2),S=Ve(w=>w.selectedIssueId),M=Ve(w=>{if(!f)return null;const H=w.issues.find(se=>se.id===f);return H?`#${H.number} ${H.title}`:null}),[O,j]=Uh();T.useEffect(()=>{C.length>0&&!r&&o(C[0].id)},[C,r]),T.useEffect(()=>{if(!v){g([]);return}let w=!1;return Ro(v).then(H=>{w||g(H)}).catch(()=>{w||g([])}),()=>{w=!0}},[v]);const I=b.length===0||b.some(w=>w.supportsImage!==!1),{attachments:U,promptFiles:$,error:Z,addFiles:K,onPaste:D,remove:te,clear:le}=nT(I);T.useEffect(()=>{S&&(m(S),Ve.getState().setSelectedIssue(null))},[S]),T.useEffect(()=>{const w=O.get("draft");w&&(a(w),j({},{replace:!0}))},[O,j]),T.useLayoutEffect(()=>{const w=h.current;w&&(w.style.height="auto",w.style.height=`${Math.min(w.scrollHeight,RL)}px`)},[t]);const pe=(J=C.find(w=>w.id===r))==null?void 0:J.description,Q=!!f,q=()=>{const w=t.trim();!v||!w&&!Q&&U.length===0||(a(""),le(),y(w,void 0,void 0,u||void 0,f||void 0,r||void 0,$.length>0?$:void 0))},F=w=>{w.nativeEvent.isComposing||w.keyCode===229||w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),q())},k=T.useCallback(w=>{y(w,void 0,void 0,u||void 0,f||void 0,r||void 0)},[y,f,r,u]),P=oT(k);return i.jsxs("div",{className:"relative flex flex-1 flex-col items-center justify-center bg-term",children:[i.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:i.jsx(Yh,{className:"h-5 w-5"})}),i.jsxs("div",{className:"w-full max-w-2xl px-6",children:[i.jsx("div",{className:"mb-8 text-center",children:i.jsxs("div",{className:"font-mono text-2xl text-fg-6",children:[i.jsx("span",{className:"text-emerald-500/60",children:"❯"}),i.jsx("span",{className:"fs-blink text-fg-4",children:" ▋"})]})}),i.jsx(sT,{attachments:U,error:Z,onRemove:te}),i.jsxs("div",{className:ne("relative rounded-xl border bg-base/80 shadow-sm transition-colors","border-line focus-within:border-fg-5"),children:[i.jsx(iT,{phase:P.stt.phase,transcript:P.stt.transcript,interimTranscript:P.stt.interimTranscript,editText:P.editText,onEditTextChange:P.setEditText,onTextareaKeyDown:P.handleTextareaKeyDown,textareaRef:P.textareaRef,wrapperClassName:"absolute bottom-full left-0 right-0 z-20 mb-2 overflow-hidden rounded-xl border border-line bg-surface/95 backdrop-blur-sm"}),C.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex gap-1.5 overflow-x-auto px-4 pt-3 pb-1 scrollbar-none",children:C.map(w=>{const H=SL(w.name);return i.jsxs("button",{type:"button",onClick:()=>o(w.id),className:ne("flex shrink-0 items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium transition-colors",r===w.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:[i.jsx("span",{className:ne("inline-flex h-4 w-4 items-center justify-center rounded-full text-[10px] font-bold",H.bg,H.text),children:H.initial}),w.name]},w.id)})}),pe&&i.jsx("p",{className:"px-4 pb-1 text-[11px] leading-relaxed text-fg-5",children:pe})]}),i.jsxs("div",{className:"flex items-start gap-2 px-4 py-3",children:[i.jsx("span",{className:ne("select-none pt-px font-mono text-sm leading-6","text-emerald-400"),children:"❯"}),i.jsx("textarea",{ref:h,rows:1,value:t,autoFocus:!0,disabled:!v,onChange:w=>a(w.target.value),onKeyDown:F,onPaste:D,placeholder:v?f?"输入补充指令,或直接发送":"让 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"}),i.jsx(aT,{onFiles:w=>void K(w),disabled:!v,allowed:!0}),i.jsx(rT,{isListening:P.stt.isListening,disabled:!v,onStart:P.stt.start,onStop:()=>void P.stt.stop()}),i.jsx("button",{type:"button",onClick:q,disabled:!v||!t.trim()&&!Q&&U.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:i.jsx(by,{className:"h-4 w-4",strokeWidth:2.5})})]}),i.jsxs("div",{className:"flex items-center gap-2 border-t border-line/60 px-4 py-1.5",children:[M&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"shrink-0 font-mono text-[11px] text-fg-5",children:"关联"}),i.jsx("span",{className:"min-w-0 truncate rounded bg-blue-500/10 px-1.5 py-0.5 font-mono text-[11px] text-blue-400",children:M}),i.jsx("button",{type:"button",onClick:()=>m(""),className:"shrink-0 text-fg-5 hover:text-fg-3","aria-label":"取消关联",children:i.jsx(gt,{className:"h-3 w-3"})})]}),i.jsxs("div",{className:"ml-auto flex items-center gap-1.5",children:[i.jsx("span",{className:"font-mono text-[11px] text-fg-5",children:"variant"}),i.jsxs("select",{value:u,onChange:w=>c(w.target.value),className:"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:[i.jsx("option",{value:"",children:"默认"}),i.jsx("option",{value:"max",children:"max"}),i.jsx("option",{value:"high",children:"high"})]})]})]})]}),i.jsx(lT,{phase:P.stt.phase,volumeLevel:P.stt.volumeLevel,elapsed:P.elapsed,editText:P.editText,error:P.stt.error,onCancel:P.cancel,onConfirm:()=>void P.confirm(),idleHint:"⌘⏎ / ctrl+⏎ 开始运行",className:"mt-2 flex items-center justify-center gap-2"}),N&&i.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:N})]})]})}function oE({body:e}){return e?i.jsx("div",{className:"markdown-body leading-relaxed",children:i.jsx(Yi,{remarkPlugins:[Gi],children:e})}):i.jsx("p",{className:"py-10 text-center font-mono text-xs text-fg-5",children:"该 Issue 没有描述内容"})}function uE({issue:e}){var t;return i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:ne("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=>i.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))]}),i.jsx("h2",{className:"mt-0.5 truncate text-sm font-medium text-fg",children:e.title})]})}function ML({onToggleSidebar:e}){const t=Ve(b=>b.matchingParentId),a=Ve(b=>b.matchingCandidateId),r=Ve(b=>b.issues.find(g=>g.id===t)),o=Ve(b=>b.issues.find(g=>g.id===a)),u=Ve(b=>b.exitMatchMode),c=Ve(b=>b.linkChild),[f,m]=T.useState(!1);if(!r)return null;const h=async()=>{o&&(m(!0),await c(r.number,o.number),m(!1))};return i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden bg-term",children:[i.jsxs("header",{className:"flex items-center gap-3 border-b border-line bg-base px-4 py-2.5",children:[i.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:i.jsx(Yh,{className:"h-5 w-5"})}),i.jsx("span",{className:"text-xs font-medium text-fg-4",children:"匹配子任务"}),i.jsxs("span",{className:"font-mono text-xs text-fg-3",children:["父: #",r.number]}),i.jsx("div",{className:"flex-1"}),i.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:[i.jsx(gt,{className:"h-3.5 w-3.5"}),"退出匹配"]})]}),i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col md:flex-row",children:[i.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:[i.jsx("div",{className:"border-b border-line/60 px-4 py-2.5",children:i.jsx(uE,{issue:r})}),i.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-6",children:i.jsx(oE,{body:r.body})})]}),i.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:o?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"border-b border-line/60 px-4 py-2.5",children:i.jsx(uE,{issue:o})}),i.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-6",children:i.jsx(oE,{body:o.body})})]}):i.jsx("div",{className:"flex flex-1 items-center justify-center",children:i.jsx("p",{className:"font-mono text-xs text-fg-5",children:"← 从左侧列表选择候选 Issue"})})})]}),o&&i.jsx("div",{className:"flex items-center justify-center gap-3 border-t border-line bg-base px-4 py-3",children:i.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:[i.jsx(On,{className:"h-3.5 w-3.5"}),f?"关联中…":`确认: 将 #${o.number} 设为 #${r.number} 的子任务`]})})]})}function DL({onToggleSidebar:e,onToggleRightPanel:t,rightPanelOpen:a}){var F,k;const r=vn(),o=je(zn),u=Re(P=>P.activeSessionId),c=Re(P=>P.sessions.find(J=>J.id===P.activeSessionId)??null),f=Re(P=>{const J=P.activeSessionId;return J?P.messages[J]??No:No}),m=Re(P=>{const J=P.activeSessionId;return J?P.todos[J]??To:To}),h=Re(P=>{const J=P.activeSessionId;return J?P.sessionStatuses[J]:void 0}),b=Re(P=>{const J=P.activeSessionId;return J?P.queuedMessageIds[J]??Hx:Hx}),g=Re(P=>{const J=P.activeSessionId;return J?P.errorReasons[J]:void 0}),y=Re(P=>{const J=P.activeSessionId;return J?P.messagesMeta[J]:void 0}),N=Re(P=>P.loadMoreMessages),v=Re(P=>P.sendError),A=Re(P=>P.abortSession),C=Re(P=>P.revertToMessage),S=je(P=>P.repos.find(J=>J.id===P.activeRepoId)),M=(S==null?void 0:S.runtimeType)!=="claude-code",[O,j]=T.useState(null),[I,U]=T.useState(!1),$=Ve(P=>c!=null&&c.issueId?P.issues.find(J=>J.id===c.issueId):void 0);T.useEffect(()=>{if(u)return Lc.activateSession(u),()=>Lc.deactivateSession(u)},[u]);const Z=T.useRef(null),K=T.useRef(!0),[D,te]=T.useState(!1);T.useEffect(()=>{const P=Z.current;P&&K.current&&(P.scrollTop=P.scrollHeight)},[f,m]),T.useEffect(()=>{K.current=!0,te(!1)},[u]),T.useEffect(()=>{if(h!=="busy"&&h!=="retry")return;const P=J=>{if(J.key!=="Escape"||J.defaultPrevented)return;const w=J.target;w instanceof HTMLInputElement||w instanceof HTMLTextAreaElement||w!=null&&w.isContentEditable||A()};return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[h,A]);const le=Ve(P=>P.matchingParentId);if(!u)return le?i.jsx(ML,{onToggleSidebar:e}):i.jsx(IL,{onToggleSidebar:e});const pe=h==="busy",Q=h==="retry",q=pe||Q;return i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden bg-term",children:[i.jsxs("header",{className:"border-b border-line bg-base md:hidden",children:[i.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",onClick:()=>U(P=>!P),children:[i.jsxs("div",{className:"flex items-center gap-1",onClick:P=>P.stopPropagation(),children:[i.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:i.jsx(Yh,{className:"h-5 w-5"})}),i.jsx("button",{type:"button",onClick:()=>Re.setState({activeSessionId:null}),"aria-label":"新建运行",title:"新建运行",className:"rounded-lg p-1.5 text-fg-3 hover:bg-elevated",children:i.jsx(Ia,{className:"h-5 w-5"})})]}),i.jsxs("div",{className:"min-w-0 flex-1",children:[(c==null?void 0:c.parentID)&&i.jsxs("button",{type:"button",onClick:P=>{P.stopPropagation(),Re.getState().setActiveSession(c.parentID)},className:"mb-0.5 flex items-center gap-1 text-[11px] text-fg-4 transition-colors hover:text-blue-400",children:[i.jsx(xo,{className:"h-3 w-3"}),"返回父会话"]}),i.jsx("h2",{className:"text-sm font-medium leading-snug text-fg",children:((F=c==null?void 0:c.title)==null?void 0:F.trim())||"untitled run"})]}),q&&i.jsx("span",{className:ne("h-2 w-2 shrink-0 rounded-full","bg-amber-400 animate-pulse")}),!q&&h==="error"&&i.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-red-400"}),i.jsx(ba,{className:ne("h-4 w-4 shrink-0 text-fg-5 transition-transform duration-200",I&&"rotate-180")})]}),i.jsx("div",{className:ne("grid transition-[grid-template-rows] duration-200 ease-in-out",I?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:i.jsx("div",{className:"overflow-hidden",children:i.jsxs("div",{className:"flex flex-col gap-2.5 border-t border-line/60 px-4 py-3",children:[(c==null?void 0:c.agent)&&i.jsxs("div",{className:"flex items-center gap-2 font-mono text-xs text-fg-4",children:[i.jsx("span",{className:"w-14 shrink-0 text-fg-5",children:"Agent"}),i.jsx("span",{className:"truncate",children:c.agent})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"w-14 shrink-0 font-mono text-xs text-fg-5",children:"Status"}),i.jsx(sE,{status:h,reason:g})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"w-14 shrink-0 font-mono text-xs text-fg-5",children:"Context"}),i.jsx(lE,{session:c,messages:f})]}),$&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"w-14 shrink-0 font-mono text-xs text-fg-5",children:"Issue"}),i.jsxs("button",{type:"button",onClick:()=>r(`/${encodeURIComponent(o)}/dev/issues?id=${$.id}`),className:"flex items-center gap-1.5 truncate font-mono text-xs text-fg-3 transition-colors hover:text-blue-400",children:[i.jsxs("span",{className:ne("shrink-0 rounded px-1 py-0.5 text-[10px] font-semibold",$.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",$.number]}),i.jsx("span",{className:"truncate",children:$.title})]})]}),q&&i.jsxs("button",{type:"button",onClick:()=>void A(),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:[i.jsx(nh,{className:"h-3 w-3 fill-current"}),Q?"stop retry":"stop"]})]})})})]}),i.jsxs("header",{className:"hidden items-center gap-3 border-b border-line bg-base px-4 py-2.5 md:flex",children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[(c==null?void 0:c.parentID)&&i.jsxs("button",{type:"button",onClick:()=>void Re.getState().setActiveSession(c.parentID),className:"mb-0.5 flex items-center gap-1 text-[11px] text-fg-4 transition-colors hover:text-blue-400",children:[i.jsx(xo,{className:"h-3 w-3"}),"返回父会话"]}),i.jsx("h2",{className:"truncate text-sm font-medium text-fg",children:((k=c==null?void 0:c.title)==null?void 0:k.trim())||"untitled run"}),(c==null?void 0:c.agent)&&i.jsx("p",{className:"truncate font-mono text-xs text-fg-4",children:c.agent}),i.jsx(lE,{session:c,messages:f})]}),$&&i.jsxs("button",{type:"button",onClick:()=>r(`/${encodeURIComponent(o)}/dev/issues?id=${$.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:[i.jsxs("span",{className:ne("rounded px-1 py-0.5 text-[10px] font-semibold",$.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",$.number]}),i.jsx("span",{className:"hidden max-w-[120px] truncate sm:inline",children:$.title})]}),i.jsx(sE,{status:h,reason:g}),t&&i.jsx("button",{type:"button",onClick:t,"aria-label":a?"关闭侧边栏":"打开侧边栏",className:ne("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:i.jsx(Ty,{className:"h-4 w-4"})}),q&&i.jsxs("button",{type:"button",onClick:()=>void A(),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:[i.jsx(nh,{className:"h-3 w-3 fill-current"}),Q?"stop retry":"stop"]})]}),i.jsxs("div",{className:"relative min-h-0 flex-1",children:[i.jsx("div",{ref:Z,onScroll:()=>{const P=Z.current;if(!P)return;const J=P.scrollHeight-P.clientHeight-P.scrollTop<=OL;if(K.current=J,te(!J),P.scrollTop<200&&u&&(y!=null&&y.hasMore)&&!y.loading){const w=P.scrollHeight;N(u).then(()=>{requestAnimationFrame(()=>{Z.current&&(Z.current.scrollTop=Z.current.scrollHeight-w)})})}},className:"h-full overflow-y-auto",children:i.jsxs("div",{className:"mx-auto flex max-w-4xl flex-col gap-3 px-4 py-4",children:[(y==null?void 0:y.loading)&&i.jsx("div",{className:"flex justify-center py-2",children:i.jsx("span",{className:"inline-block h-4 w-4 animate-spin rounded-full border-2 border-fg-5 border-t-transparent"})}),y&&!y.loading&&y.hasMore&&i.jsx("button",{type:"button",onClick:()=>u&&N(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:"加载更早的消息"}),f.length===0?i.jsxs("p",{className:"py-10 text-center font-mono text-xs text-fg-6",children:[i.jsx("span",{className:"text-emerald-500/60",children:"❯"})," waiting for input",i.jsx("span",{className:"fs-blink",children:" ▋"})]}):f.map((P,J)=>i.jsxs(T.Fragment,{children:[J>0&&P.role==="user"&&i.jsx("div",{className:"group/revert relative border-t border-line py-2",children:M&&!q&&i.jsxs("button",{type:"button",disabled:O!==null,onClick:async()=>{const w=f.length-J;window.confirm(`回退到此处?将移除后续 ${w} 条对话记录(不影响已产生的代码改动)。`)&&(j(P.id),await C(u,P.id),j(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:[O===P.id?i.jsx("span",{className:"inline-block h-3 w-3 animate-spin rounded-full border-2 border-current border-t-transparent"}):i.jsx(a5,{className:"h-3 w-3"}),"回退到此处"]})}),i.jsx("div",{"data-message-id":P.id,children:i.jsx(xL,{message:P,isStreaming:pe&&J===f.length-1,queued:b.includes(P.id)})})]},P.id)),m.length>0&&i.jsx(NL,{todos:[...m],onClick:t})]})}),i.jsx("button",{type:"button",onClick:()=>{const P=Z.current;P&&(P.scrollTo({top:P.scrollHeight,behavior:"smooth"}),K.current=!0)},"aria-label":"滚动到底部",className:ne("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",D?"translate-y-0 opacity-100":"pointer-events-none translate-y-2 opacity-0"),children:i.jsx(ba,{className:"h-4 w-4"})})]}),h==="error"&&g&&i.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:[i.jsx(Tn,{className:"h-3.5 w-3.5 shrink-0"}),i.jsx("span",{className:"truncate",children:g})]}),v&&i.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:[i.jsx(Tn,{className:"h-3.5 w-3.5 shrink-0"}),i.jsx("span",{className:"truncate",children:v})]}),i.jsx(vL,{})]})}const mn=es((e,t)=>({pulls:[],loaded:!1,syncing:!1,selectedPrId:null,viewingPrId:null,matchingPrId:null,matchingCandidateIssueId:null,clearPulls:()=>e({pulls:[],loaded:!1,selectedPrId:null,viewingPrId:null,matchingPrId:null,matchingCandidateIssueId:null}),setViewingPr:a=>e({viewingPrId:a}),enterMatchMode:a=>e({matchingPrId:a,matchingCandidateIssueId:null}),exitMatchMode:()=>{const a=t().matchingPrId;e({matchingPrId:null,matchingCandidateIssueId:null,selectedPrId:a})},linkIssue:async(a,r)=>{const o=je.getState().activeRepoId;if(!o)return!1;try{return await gC(o,a,r),!0}catch{return!1}},unlinkIssue:async(a,r)=>{const o=je.getState().activeRepoId;if(!o)return!1;try{return await bC(o,a,r),!0}catch{return!1}},loadPulls:async()=>{const a=je.getState().activeRepoId;if(!a){e({pulls:[],loaded:!0});return}try{const r=await Ox(a,"all");e({pulls:r,loaded:!0})}catch{e({loaded:!0})}},syncPulls:async()=>{const a=je.getState().activeRepoId;if(a){e({syncing:!0});try{await mC(a,"open");const r=await Ox(a,"all");e({pulls:r,syncing:!1})}catch(r){e({syncing:!1});let o="同步 PR 失败";if(r instanceof Ss)try{const u=JSON.parse(r.message);u.error&&(o=u.error)}catch{r.message&&(o=r.message)}Qt.getState().addToast(o,"error")}}}})),LL={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 jL(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 BL(e){if(!e.parts)return"";for(const t of e.parts){const a=t.content??t.text;if(a)return a}return""}function PL({todos:e}){if(e.length===0)return i.jsx("div",{className:"flex flex-1 items-center justify-center",children:i.jsx("p",{className:"font-mono text-xs text-fg-5",children:"暂无待办项"})});const t=e.filter(a=>{const r=$r(a.status);return r==="completed"||r==="cancelled"}).length;return i.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3",children:[i.jsxs("div",{className:"mb-2 font-mono text-[10px] tabular-nums text-fg-5",children:["进度 ",t,"/",e.length]}),i.jsx("ul",{className:"space-y-1.5",children:e.map(a=>{const r=$r(a.status),o=LL[r],u=r==="completed"||r==="cancelled";return i.jsxs("li",{className:"flex items-start gap-2 font-mono text-xs",children:[i.jsx("span",{className:ne("shrink-0 leading-5",o.color,o.spin&&"fs-spin"),children:o.glyph}),i.jsx("span",{className:ne("leading-5",u?"text-fg-5 line-through":"text-fg-2"),children:a.content})]},a.id)})})]})}function UL({messages:e,onScrollToMessage:t}){const a=e.filter(r=>r.role==="user");return a.length===0?i.jsx("div",{className:"flex flex-1 items-center justify-center",children:i.jsx("p",{className:"font-mono text-xs text-fg-5",children:"暂无输入记录"})}):i.jsx("div",{className:"flex-1 overflow-y-auto px-3 py-2",children:i.jsx("ul",{className:"space-y-1",children:a.map((r,o)=>{const u=BL(r),c=jL(r);return i.jsx("li",{children:i.jsxs("button",{type:"button",onClick:()=>t==null?void 0:t(r.id),className:"group w-full rounded-md px-2 py-1.5 text-left transition-colors hover:bg-elevated/60",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"shrink-0 font-mono text-[10px] text-emerald-400/60",children:"❯"}),i.jsxs("span",{className:"shrink-0 font-mono text-[10px] tabular-nums text-fg-5",children:["#",o+1]}),c&&i.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] text-fg-6",children:c})]}),u&&i.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})]})},r.id)})})})}function HL({linked:e,number:t,title:a,state:r,mergedAt:o,isPr:u,onToggle:c}){const f=u?r==="open"?"bg-emerald-500/15 text-emerald-400":o?"bg-purple-500/15 text-purple-400":"bg-red-500/15 text-red-400":r==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400";return i.jsx("li",{children:i.jsx("button",{type:"button",onClick:c,className:ne("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:i.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[i.jsxs("span",{className:ne("shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-semibold",f),children:["#",t]}),i.jsx("span",{className:"min-w-0 truncate text-xs text-fg-2",children:a}),e&&i.jsx(qh,{className:"ml-auto h-3 w-3 shrink-0 text-emerald-400"})]})})})}function FL({links:e,sessionId:t}){var U,$,Z,K;const a=vn(),r=je(zn),[o,u]=T.useState(null),[c,f]=T.useState(""),m=T.useRef(null),h=Ve(D=>D.issues),b=mn(D=>D.pulls),g=Re(D=>D.addLink),y=Re(D=>D.removeLink),N=new Set(((U=e==null?void 0:e.issues)==null?void 0:U.map(D=>D.id))??[]),v=new Set((($=e==null?void 0:e.pullRequests)==null?void 0:$.map(D=>D.id))??[]);T.useEffect(()=>{var D;o&&((D=m.current)==null||D.focus())},[o]);const A=()=>{u(null),f("")},C=async(D,te,le)=>{t&&(le?await y(t,D,te):await g(t,D,te))},S=c.trim().toLowerCase(),M=S?h.filter(D=>`#${D.number} ${D.title}`.toLowerCase().includes(S)):h,O=S?b.filter(D=>`#${D.number} ${D.title} ${D.headBranch}`.toLowerCase().includes(S)):b,j=((Z=e==null?void 0:e.issues)==null?void 0:Z.length)??0,I=((K=e==null?void 0:e.pullRequests)==null?void 0:K.length)??0;if(o){const D=o==="issue",te=D?M:O,le=D?N:v;return i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-2",children:[i.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-blue-400",children:D?"关联 Issue":"关联 PR"}),i.jsxs("button",{type:"button",onClick:A,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:[i.jsx(gt,{className:"h-3.5 w-3.5"}),"完成"]})]}),i.jsx("div",{className:"border-b border-line px-3 py-2",children:i.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2 py-1",children:[i.jsx(Pr,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),i.jsx("input",{ref:m,type:"text",value:c,onChange:pe=>f(pe.target.value),placeholder:D?"搜索 issue...":"搜索 PR...",className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),c&&i.jsx("button",{type:"button",onClick:()=>f(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:i.jsx(gt,{className:"h-3 w-3"})})]})}),i.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:te.length===0?i.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:(D?h:b).length===0?D?"暂无 Issue,请先同步":"暂无 PR,请先同步":"无匹配结果"}):i.jsx("ul",{className:"space-y-0.5",children:te.map(pe=>i.jsx(HL,{linked:le.has(pe.id),number:pe.number,title:pe.title,state:pe.state,mergedAt:D?void 0:pe.mergedAt,isPr:!D,onToggle:()=>C(o,pe.id,le.has(pe.id))},pe.id))})})]})}return i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center gap-1.5 border-b border-line px-3 py-2",children:[i.jsx("span",{className:"flex-1 font-mono text-[10px] text-fg-5",children:j+I>0?`${j+I} 项关联`:"暂无关联"}),i.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:[i.jsx(Ia,{className:"h-3 w-3"}),i.jsx("span",{className:"text-[10px] font-medium",children:"Issue"})]}),i.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:[i.jsx(Ia,{className:"h-3 w-3"}),i.jsx("span",{className:"text-[10px] font-medium",children:"PR"})]})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3",children:[j>0&&i.jsxs("div",{className:"mb-3",children:[i.jsxs("div",{className:"mb-1.5 font-mono text-[10px] font-medium uppercase tracking-wider text-fg-5",children:["Issues (",j,")"]}),i.jsx("ul",{className:"space-y-1",children:e.issues.map(D=>i.jsxs("li",{className:"group flex items-start gap-1",children:[i.jsxs("button",{type:"button",onClick:()=>a(`/${encodeURIComponent(r)}/dev/issues?id=${encodeURIComponent(D.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:[i.jsxs("span",{className:ne("mt-0.5 shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-semibold",D.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",D.number]}),i.jsx("span",{className:"line-clamp-2 text-xs leading-5 text-fg-3 group-hover:text-fg-2",children:D.title})]}),i.jsx("button",{type:"button",onClick:()=>void C("issue",D.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:i.jsx(gt,{className:"h-3 w-3"})})]},D.id))})]}),I>0&&i.jsxs("div",{children:[i.jsxs("div",{className:"mb-1.5 font-mono text-[10px] font-medium uppercase tracking-wider text-fg-5",children:["Pull Requests (",I,")"]}),i.jsx("ul",{className:"space-y-1",children:e.pullRequests.map(D=>i.jsxs("li",{className:"group flex items-start gap-1",children:[i.jsxs("button",{type:"button",onClick:()=>a(`/${encodeURIComponent(r)}/dev/pulls?id=${encodeURIComponent(D.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:[i.jsxs("span",{className:ne("mt-0.5 shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-semibold",D.state==="open"?"bg-emerald-500/15 text-emerald-400":D.mergedAt?"bg-purple-500/15 text-purple-400":"bg-red-500/15 text-red-400"),children:["#",D.number]}),i.jsx("span",{className:"line-clamp-2 text-xs leading-5 text-fg-3 group-hover:text-fg-2",children:D.title})]}),i.jsx("button",{type:"button",onClick:()=>void C("pr",D.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:i.jsx(gt,{className:"h-3 w-3"})})]},D.id))})]}),j===0&&I===0&&i.jsx("div",{className:"flex flex-1 items-center justify-center py-10",children:i.jsx("p",{className:"font-mono text-xs text-fg-5",children:"点击上方按钮添加关联"})})]})]})}const zL={"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 $L(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 Xm(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 r=Date.parse(e.createdAt);if(!Number.isNaN(r))return r}return null}function qL(e){const t=Date.now()-e,a=Math.floor(t/1e3);if(a<60)return"just now";const r=Math.floor(a/60);if(r<60)return`${r}m ago`;const o=Math.floor(r/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function YL(){const e=Re(m=>m.sessions),t=Re(m=>m.activeSessionId),a=Re(m=>m.sessionStatuses),r=Re(m=>m.setActiveSession),o=e.find(m=>m.id===t),u=(o==null?void 0:o.parentID)??t,c=!!(o!=null&&o.parentID),f=e.filter(m=>m.parentID===u).sort((m,h)=>(Xm(h)??0)-(Xm(m)??0));return f.length===0?i.jsx("div",{className:"flex flex-1 items-center justify-center",children:i.jsx("p",{className:"font-mono text-xs text-fg-5",children:"暂无子任务"})}):i.jsxs("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:[c&&i.jsxs("div",{className:"mb-1.5 px-2 font-mono text-[10px] text-fg-5",children:["同级子任务 (",f.length,")"]}),i.jsx("ul",{className:"space-y-0.5",children:f.map(m=>{const h=m.id===t,b=a[m.id],g=Xm(m),y=(m.agent&&zL[m.agent])??"bg-elevated text-fg-4",N=m.title||`${m.id.slice(0,9)}...`;return i.jsx("li",{children:i.jsxs("button",{type:"button",onClick:()=>{h||r(m.id)},className:ne("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:[i.jsx("span",{className:ne("mt-1 h-2 w-2 shrink-0 rounded-full",$L(b))}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[m.agent&&i.jsx("span",{className:ne("shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-medium",y),children:m.agent}),g!=null&&i.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] tabular-nums text-fg-6",children:qL(g)})]}),i.jsx("p",{className:ne("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 cE({todos:e,messages:t,sessionLinks:a,sessionId:r,onScrollToMessage:o}){var v,A;const[u,c]=T.useState("todo"),f=Re(C=>C.sessions),m=Re(C=>C.activeSessionId),h=t.filter(C=>C.role==="user").length,b=(((v=a==null?void 0:a.issues)==null?void 0:v.length)??0)+(((A=a==null?void 0:a.pullRequests)==null?void 0:A.length)??0),g=f.find(C=>C.id===m),y=(g==null?void 0:g.parentID)??m,N=f.filter(C=>C.parentID===y).length;return i.jsxs("div",{className:"flex h-full w-72 shrink-0 flex-col border-l border-line bg-surface",children:[i.jsxs("div",{className:"flex items-center border-b border-line",children:[i.jsxs("button",{type:"button",onClick:()=>c("todo"),className:ne("flex flex-1 items-center justify-center gap-1 border-b-2 px-2 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:["待办",e.length>0&&i.jsx("span",{className:"font-mono text-[10px] text-fg-5",children:e.length})]}),i.jsxs("button",{type:"button",onClick:()=>c("prompts"),className:ne("flex flex-1 items-center justify-center gap-1 border-b-2 px-2 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:["输入",h>0&&i.jsx("span",{className:"font-mono text-[10px] text-fg-5",children:h})]}),i.jsxs("button",{type:"button",onClick:()=>c("links"),className:ne("flex flex-1 items-center justify-center gap-1 border-b-2 px-2 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:["关联",b>0&&i.jsx("span",{className:"font-mono text-[10px] text-fg-5",children:b})]}),i.jsxs("button",{type:"button",onClick:()=>c("subtasks"),className:ne("flex flex-1 items-center justify-center gap-1 border-b-2 px-2 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:["子任务",N>0&&i.jsx("span",{className:"font-mono text-[10px] text-fg-5",children:N})]})]}),u==="todo"?i.jsx(PL,{todos:e}):u==="prompts"?i.jsx(UL,{messages:t,onScrollToMessage:o}):u==="links"?i.jsx(FL,{links:a,sessionId:r}):i.jsx(YL,{})]})}const dE=8;function GL(e,t){let a=e instanceof Element?e:null;for(;a&&a!==t;){if(a.scrollWidth>a.clientWidth){const r=getComputedStyle(a).overflowX;if(r==="auto"||r==="scroll")return!0}a=a.parentElement}return!1}function IT({onSwipeLeft:e,onSwipeRight:t,threshold:a=40,disabled:r=!1}={}){const o=T.useRef({x0:0,y0:0,dir:null,on:!1}),u=T.useRef(0),c=T.useCallback(h=>{if(r||GL(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},[r]),f=T.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)>dE||Math.abs(y)>dE)&&(b.dir=Math.abs(g)>Math.abs(y)?"h":"v");return}if(b.dir==="v"){b.on=!1;return}u.current=g},[]),m=T.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:c,onTouchMove:f,onTouchEnd:m}}function Nh({side:e,open:t,onClose:a,children:r,width:o="w-80"}){const u=e==="left";return i.jsxs("div",{className:"md:hidden",children:[t&&i.jsx("div",{className:"fixed inset-0 z-40 bg-black/50",onClick:a,"aria-hidden":"true"}),i.jsx("div",{className:ne("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:r})]})}function Th(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 r=Date.parse(e.createdAt);return Number.isNaN(r)?0:r}return 0}function KL(e){const t=Th(e);if(!t)return"";const a=t<1e12?t*1e3:t,r=new Date(a);return r.toDateString()===new Date().toDateString()?r.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):r.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function fE(e){navigator.clipboard?navigator.clipboard.writeText(e).catch(()=>mE(e)):mE(e)}function mE(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 VL(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"}}const hE="fs:swipe-hint-shown";function XL({session:e,isActive:t,isConfirming:a,peekHint:r,onSelect:o,onDelete:u,onConfirm:c,onCancelConfirm:f,onRename:m,onToggleComplete:h,status:b,issue:g,linkedItems:y,todos:N}){var Ne,Te;const v=xc(V=>V.drafts[e.id]),A=!!e.completedAt,C=KL(e),[S,M]=T.useState(!1),[O,j]=T.useState(""),I=T.useRef(null),U=()=>{var V;j(((V=e.title)==null?void 0:V.trim())||""),M(!0),requestAnimationFrame(()=>{var ve;return(ve=I.current)==null?void 0:ve.focus()})},$=()=>{var ve;M(!1);const V=O.trim();V&&V!==(((ve=e.title)==null?void 0:ve.trim())||"")&&m(V)},[Z,K]=T.useState(null),D=T.useRef(null),te=T.useRef(!1),le=()=>{D.current&&(clearTimeout(D.current),D.current=null)},pe=144,Q=T.useRef(null),q=T.useRef(null),F=T.useRef(0),k=T.useRef({x0:0,y0:0,base:0,dir:null,on:!1}),P=V=>{F.current=V;const ve=Q.current,Be=q.current;ve&&(ve.style.transform=V!==0?`translateX(${V}px)`:"",ve.style.pointerEvents=V===-pe?"none":""),Be&&(Be.style.width=`${Math.abs(V)}px`)},J=V=>{const ve=V.touches[0];k.current={x0:ve.clientX,y0:ve.clientY,base:F.current,dir:null,on:!0},Q.current&&(Q.current.style.transition="none"),q.current&&(q.current.style.transition="none"),te.current=!1,le(),D.current=setTimeout(()=>{te.current=!0,k.current.on=!1,K({x:ve.clientX,y:ve.clientY})},500)},w=V=>{const ve=k.current;if(!ve.on){le();return}const Be=V.touches[0].clientX-ve.x0,Ue=V.touches[0].clientY-ve.y0;if(!ve.dir){(Math.abs(Be)>5||Math.abs(Ue)>5)&&(ve.dir=Math.abs(Be)>Math.abs(Ue)?"h":"v",le());return}ve.dir!=="v"&&P(Math.max(-pe,Math.min(0,ve.base+Be)))},H=V=>{const ve=Q.current,Be=q.current;ve&&(ve.style.transition="transform 200ms ease-out"),Be&&(Be.style.transition="width 200ms ease-out"),P(V)},se=()=>{if(le(),te.current){te.current=!1;return}k.current.on=!1,H(F.current<-pe/2?-pe:0)},L=()=>H(0);return T.useEffect(()=>{if(!r)return;const V=-60,ve=setTimeout(()=>{const Be=Q.current,Ue=q.current;Be&&(Be.style.transition="transform 400ms cubic-bezier(.25,.8,.25,1)"),Ue&&(Ue.style.transition="width 400ms cubic-bezier(.25,.8,.25,1)"),P(V);const xt=setTimeout(()=>{Be&&(Be.style.transition="transform 500ms cubic-bezier(.25,.8,.25,1)"),Ue&&(Ue.style.transition="width 500ms cubic-bezier(.25,.8,.25,1)"),P(0)},800);return()=>clearTimeout(xt)},600);return()=>clearTimeout(ve)},[r]),i.jsxs("li",{className:"relative overflow-hidden rounded-md",children:[i.jsx("div",{ref:q,className:"absolute right-0 top-0 bottom-0 z-10 overflow-hidden md:hidden",style:{width:0},children:i.jsx("div",{className:"absolute right-0 top-0 bottom-0 flex",style:{width:pe},children:a?i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",onClick:()=>{u(),L()},className:"flex w-12 items-center justify-center bg-red-500 text-white active:bg-red-600",children:i.jsx(On,{className:"h-4 w-4"})}),i.jsx("button",{type:"button",onClick:()=>{f(),L()},className:"flex w-12 items-center justify-center bg-neutral-500 text-white active:bg-neutral-600",children:i.jsx(gt,{className:"h-4 w-4"})})]}):i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",onClick:()=>{h(),L()},className:ne("flex w-12 flex-col items-center justify-center gap-0.5 text-white",A?"bg-neutral-500 active:bg-neutral-600":"bg-emerald-500 active:bg-emerald-600"),children:[i.jsx(ym,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"text-[9px] leading-none",children:A?"撤销":"完成"})]}),i.jsxs("button",{type:"button",onClick:()=>{U(),L()},className:"flex w-12 flex-col items-center justify-center gap-0.5 bg-amber-500 text-white active:bg-amber-600",children:[i.jsx(yx,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"text-[9px] leading-none",children:"重命名"})]}),i.jsxs("button",{type:"button",onClick:()=>c(),className:"flex w-12 flex-col items-center justify-center gap-0.5 bg-red-500 text-white active:bg-red-600",children:[i.jsx(Cs,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"text-[9px] leading-none",children:"删除"})]})]})})}),i.jsxs("div",{ref:Q,className:ne("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:J,onTouchMove:w,onTouchEnd:se,onContextMenu:V=>V.preventDefault(),children:[i.jsxs("button",{type:"button",onClick:()=>{S||(o(),L())},className:ne("block w-full px-2.5 py-2 text-left",A&&!t&&"opacity-50"),style:{pointerEvents:"auto"},children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:ne("h-1.5 w-1.5 shrink-0 rounded-full",VL(b))}),i.jsx("span",{className:"min-w-0 truncate font-mono text-xs text-fg-3",children:((Ne=e.agent)==null?void 0:Ne.trim())||"默认"}),A&&i.jsx(ym,{className:"h-3 w-3 shrink-0 text-emerald-400"}),C&&i.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] tabular-nums text-fg-5",children:C})]}),S?i.jsx("input",{ref:I,type:"text",value:O,onChange:V=>j(V.target.value),onBlur:$,onKeyDown:V=>{V.key==="Enter"&&$(),V.key==="Escape"&&M(!1)},onClick:V=>V.stopPropagation(),className:"mt-0.5 w-full rounded border border-blue-500 bg-base pl-3.5 text-sm text-fg-2 outline-none"}):i.jsxs("div",{className:"mt-0.5 pl-3.5",onDoubleClick:V=>{V.stopPropagation(),U()},children:[(g||y)&&i.jsxs("div",{className:"mb-0.5 flex flex-wrap gap-1",children:[g&&i.jsxs("span",{className:ne("shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-medium leading-none",g.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",g.number]}),y==null?void 0:y.map(V=>i.jsx("span",{className:ne("shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-medium leading-none",V.type==="pr"?V.state==="open"?"bg-blue-500/15 text-blue-400":V.mergedAt?"bg-purple-500/15 text-purple-400":"bg-red-500/15 text-red-400":V.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:V.type==="pr"?`PR#${V.number}`:`#${V.number}`},`${V.type}-${V.number}`))]}),i.jsx("span",{className:"block truncate text-sm text-fg-2",children:((Te=e.title)==null?void 0:Te.trim())||"未命名运行"}),v&&i.jsxs("span",{className:"mt-0.5 block truncate text-xs text-amber-400/80",children:["✏️ ",v]}),N.length>0&&(()=>{const V=N.length,ve=Yy(N);return i.jsxs("span",{className:"mt-0.5 flex items-center gap-1.5 font-mono text-[10px]",children:[i.jsx("span",{className:"shrink-0 tracking-tight",children:N.map(Be=>{const Ue=$r(Be.status);return i.jsx("span",{className:Ue==="completed"?"text-emerald-400":Ue==="in_progress"?"text-amber-400":Ue==="cancelled"?"text-fg-6":"text-fg-5",children:Ue==="pending"?"□":"■"},Be.id)})}),i.jsxs("span",{className:"tabular-nums text-fg-4",children:[ve,"/",V]})]})})()]})]}),a?i.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:[i.jsx("button",{type:"button",onClick:u,className:"rounded p-1 text-red-400 hover:bg-red-500/10",children:i.jsx(On,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",onClick:f,className:"rounded p-1 text-fg-3 hover:bg-elevated",children:i.jsx(gt,{className:"h-3.5 w-3.5"})})]}):i.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:[i.jsx("button",{type:"button",onClick:h,title:A?"取消完成":"标记完成",className:ne("rounded p-1",A?"text-emerald-400 hover:text-emerald-300":"text-fg-5 hover:text-emerald-400"),children:i.jsx(ym,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",onClick:U,title:"重命名",className:"rounded p-1 text-fg-5 hover:text-fg-2",children:i.jsx(yx,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",onClick:()=>{var V;fE(JSON.stringify({id:e.id,name:((V=e.title)==null?void 0:V.trim())||""},null,2))},title:"复制 Session JSON",className:"rounded p-1 text-fg-5 hover:text-fg-2",children:i.jsx(Sc,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",onClick:c,className:"rounded p-1 text-fg-5 hover:text-red-400",children:i.jsx(Cs,{className:"h-3.5 w-3.5"})})]})]}),Z&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"fixed inset-0 z-50",onClick:()=>K(null),onTouchEnd:()=>K(null)}),i.jsx("div",{className:"fixed z-50 min-w-[160px] rounded-lg border border-line bg-surface py-1 shadow-xl",style:{left:Math.min(Z.x,window.innerWidth-176),top:Z.y,animation:"ctx-fade-in 150ms ease-out"},children:i.jsxs("button",{type:"button",className:"flex w-full items-center gap-2.5 px-3 py-2 text-left text-sm text-fg-2 active:bg-elevated",onClick:()=>{var V;fE(JSON.stringify({id:e.id,name:((V=e.title)==null?void 0:V.trim())||""},null,2)),K(null)},children:[i.jsx(Sc,{className:"h-3.5 w-3.5 text-fg-5"}),"复制 Session JSON"]})})]})]})}function pE({onClose:e}){const[t,a]=T.useState(null),[r]=T.useState(()=>typeof window>"u"||localStorage.getItem(hE)?!1:(localStorage.setItem(hE,"1"),!0)),o=Re(j=>j.sessions),u=Re(j=>j.activeSessionId),c=Re(j=>j.sessionStatuses),f=Re(j=>j.sessionFilter),m=Re(j=>j.setSessionFilter),h=Re(j=>j.setActiveSession),b=Re(j=>j.deleteSession),g=Re(j=>j.renameSession),y=Re(j=>j.toggleSessionComplete),N=je(j=>j.activeRepoId),v=Ve(j=>j.issues),A=Re(j=>j.allSessionLinks),C=Re(j=>j.todos),S=[...o].filter(j=>j.parentID?!1:f==="active"?!j.completedAt:!0).sort((j,I)=>Th(I)-Th(j)),M=new Map(v.map(j=>[j.id,j])),O=j=>i.jsx("ul",{className:"space-y-0.5",children:j.map((I,U)=>{const $=I.issueId?M.get(I.issueId):void 0,Z=A[I.id],K=[];if(Z){for(const D of Z.issues)K.push({number:D.number,state:D.state,type:"issue"});for(const D of Z.pullRequests)K.push({number:D.number,state:D.state,type:"pr",mergedAt:D.mergedAt})}return i.jsx(XL,{session:I,isActive:I.id===u,isConfirming:t===I.id,peekHint:r&&U===0,status:c[I.id],issue:$?{number:$.number,title:$.title,state:$.state}:void 0,linkedItems:K.length>0?K:void 0,onSelect:()=>{h(I.id),e==null||e()},onDelete:()=>{b(I.id),a(null)},onConfirm:()=>a(I.id),onCancelConfirm:()=>a(null),onRename:D=>void g(I.id,D),onToggleComplete:()=>void y(I.id),todos:C[I.id]??To},I.id)})});return i.jsx("div",{className:"flex h-full w-80 shrink-0 flex-col border-r border-line bg-surface",children:i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-3",children:[i.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-fg-3",children:"运行记录"}),N&&i.jsx("button",{type:"button",onClick:()=>{Re.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:i.jsx(Ia,{className:"h-4 w-4"})})]}),N&&i.jsx("div",{className:"flex gap-1 border-b border-line px-3 py-1.5",children:[["active","进行中"],["all","全部"]].map(([j,I])=>i.jsx("button",{type:"button",onClick:()=>m(j),className:ne("rounded-md px-2 py-0.5 font-mono text-[11px] transition-colors",f===j?"bg-elevated text-fg-2":"text-fg-5 hover:text-fg-3"),children:I},j))}),i.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:N?S.length===0?i.jsx("p",{className:"px-2 py-6 text-center font-mono text-xs text-fg-5",children:"暂无运行记录"}):i.jsx("div",{children:O(S)}):i.jsx("p",{className:"px-2 py-6 text-center font-mono text-xs text-fg-5",children:"请先选择一个仓库"})})]})})}function QL(){const[e,t]=T.useState(()=>typeof window<"u"&&window.matchMedia("(min-width: 1280px)").matches);return T.useEffect(()=>{const a=window.matchMedia("(min-width: 1280px)"),r=o=>t(o.matches);return a.addEventListener("change",r),()=>a.removeEventListener("change",r)},[]),e}function gE(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 WL(){const[e,t]=T.useState(!1),[a,r]=T.useState(!1),[o,u]=T.useState(!1),c=QL(),f=Re(C=>C.activeSessionId),m=Cc(C=>C.sessionPanelCollapsed),h=Cc(C=>C.toggleSessionPanel),b=Re(C=>{const S=C.activeSessionId;return S?C.todos[S]??To:To}),g=Re(C=>{const S=C.activeSessionId;return S?C.messages[S]??No:No}),y=Re(C=>{const S=C.activeSessionId;return S?C.sessionLinks[S]:void 0});T.useEffect(()=>{c&&f?u(!0):c||u(!1)},[c,f]);const N=o&&!!f,v=()=>{window.matchMedia("(max-width: 767px)").matches?r(C=>!C):u(C=>!C)},A=IT({onSwipeRight:()=>t(!0),onSwipeLeft:()=>r(!0),disabled:e||a});return i.jsxs("div",{className:"flex min-h-0 flex-1",...A,children:[i.jsxs("div",{className:"relative hidden shrink-0 md:flex",children:[i.jsx("div",{className:ne("overflow-hidden transition-[width] duration-200 ease-in-out",m?"w-0":"w-80"),children:i.jsx("div",{className:"h-full w-80",children:i.jsx(pE,{})})}),i.jsx("button",{type:"button",onClick:h,title:m?"展开运行记录":"收起运行记录",className:ne("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?i.jsx(Kc,{className:"h-3 w-3"}):i.jsx(Hh,{className:"h-3 w-3"})})]}),i.jsx(Nh,{side:"left",open:e,onClose:()=>t(!1),children:i.jsx(pE,{onClose:()=>t(!1)})}),i.jsx(Nh,{side:"right",open:a,onClose:()=>r(!1),children:i.jsx(cE,{todos:b,messages:g,sessionLinks:y,sessionId:f,onScrollToMessage:C=>{r(!1),setTimeout(()=>gE(C),300)}})}),i.jsx("div",{className:"flex min-w-0 flex-1 flex-col",children:i.jsx(DL,{onToggleSidebar:()=>t(C=>!C),onToggleRightPanel:v,rightPanelOpen:N})}),N&&i.jsx("div",{className:"hidden shrink-0 md:flex",children:i.jsx(cE,{todos:b,messages:g,sessionLinks:y,sessionId:f,onScrollToMessage:gE})})]})}function ZL({issues:e,tags:t,milestones:a,tagFilterMode:r,stateFilter:o,typeFilter:u,searchQuery:c,selectedMilestoneId:f,selectedAuthor:m,selectedAssignee:h}){const{childIssueIds:b,childrenMap:g}=T.useMemo(()=>{const O=new Set(e.filter(I=>I.parentId).map(I=>I.parentId)),j=new Map;for(const I of e)if(I.parentId){const U=j.get(I.parentId);U?U.push(I):j.set(I.parentId,[I])}return{childIssueIds:O,childrenMap:j}},[e]),y=T.useMemo(()=>O=>O.parentId?"task":b.has(O.id)?"epic":"stray",[b]),N=T.useMemo(()=>new Map(a.map(O=>[O.id,O])),[a]),{afterState:v,finalFiltered:A}=T.useMemo(()=>{const O=o==="all"?e:e.filter(te=>te.state===o),j=u==="all"?O:O.filter(te=>y(te)===u),I=r.size===0?j:j.filter(te=>{var pe;const le=new Set((te.labels??[]).map(Q=>Q.name));for(const[Q,q]of r){const F=(pe=t.find(k=>k.id===Q))==null?void 0:pe.name;if(F&&(q==="include"&&!le.has(F)||q==="exclude"&&le.has(F)))return!1}return!0}),U=c.trim().toLowerCase(),$=U?I.filter(te=>`#${te.number} ${te.title}`.toLowerCase().includes(U)):I,Z=f?$.filter(te=>te.milestoneId===f):$,K=m?Z.filter(te=>te.authorLogin===m):Z,D=h?K.filter(te=>(te.assignees??[]).some(le=>le.login===h)):K;return{afterState:O,finalFiltered:D}},[e,o,u,r,t,c,f,m,h,y]),C=T.useMemo(()=>({open:e.filter(O=>O.state==="open").length,closed:e.filter(O=>O.state==="closed").length,epic:v.filter(O=>y(O)==="epic").length,task:v.filter(O=>y(O)==="task").length,stray:v.filter(O=>y(O)==="stray").length,afterState:v.length}),[e,v,y]),S=T.useMemo(()=>{const O=new Map;for(const j of e)j.authorLogin&&!O.has(j.authorLogin)&&O.set(j.authorLogin,{login:j.authorLogin,avatar:j.authorAvatar});return[...O.values()]},[e]),M=T.useMemo(()=>{const O=new Map;for(const j of e)for(const I of j.assignees??[])O.has(I.login)||O.set(I.login,{login:I.login,avatar:I.avatar_url});return[...O.values()]},[e]);return{childrenMap:g,issueType:y,milestoneMap:N,afterState:v,finalFiltered:A,counts:C,uniqueAuthors:S,uniqueAssignees:M}}const bE=/[#.]/g;function JL(e,t){const a=e||"",r={};let o=0,u,c;for(;o<a.length;){bE.lastIndex=o;const f=bE.exec(a),m=a.slice(o,f?f.index:a.length);m&&(u?u==="#"?r.id=m:Array.isArray(r.className)?r.className.push(m):r.className=[m]:c=m,o+=m.length),f&&(u=f[0],o++)}return{type:"element",tagName:c||t||"div",properties:r,children:[]}}function MT(e,t,a){const r=a?aj(a):void 0;function o(u,c,...f){let m;if(u==null){m={type:"root",children:[]};const h=c;f.unshift(h)}else{m=JL(u,t);const h=m.tagName.toLowerCase(),b=r?r.get(h):void 0;if(m.tagName=b||h,ej(c))f.unshift(c);else for(const[g,y]of Object.entries(c))tj(e,m.properties,g,y)}for(const h of f)_h(m.children,h);return m.type==="element"&&m.tagName==="template"&&(m.content={type:"root",children:m.children},m.children=[]),m}return o}function ej(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 r of a){const o=t[r];if(o&&typeof o=="object"){if(!Array.isArray(o))return!0;const u=o;for(const c of u)if(typeof c!="number"&&typeof c!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function tj(e,t,a,r){const o=Zc(e,a);let u;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;u=r}else typeof r=="boolean"?u=r:typeof r=="string"?o.spaceSeparated?u=Xx(r):o.commaSeparated?u=qx(r):o.commaOrSpaceSeparated?u=Xx(qx(r).join(" ")):u=xE(o,o.property,r):Array.isArray(r)?u=[...r]:u=o.property==="style"?nj(r):String(r);if(Array.isArray(u)){const c=[];for(const f of u)c.push(xE(o,o.property,f));u=c}o.property==="className"&&Array.isArray(t.className)&&(u=t.className.concat(u)),t[o.property]=u}}function _h(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)_h(e,a);else if(typeof t=="object"&&"type"in t)t.type==="root"?_h(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function xE(e,t,a){if(typeof a=="string"){if(e.number&&a&&!Number.isNaN(Number(a)))return Number(a);if((e.boolean||e.overloadedBoolean)&&(a===""||_o(a)===_o(t)))return!0}return a}function nj(e){const t=[];for(const[a,r]of Object.entries(e))t.push([a,r].join(": "));return t.join("; ")}function aj(e){const t=new Map;for(const a of e)t.set(a.toLowerCase(),a);return t}const sj=["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"],rj=MT(Mo,"div"),ij=MT(ur,"g",sj);function lj(e){const t=String(e),a=[];return{toOffset:o,toPoint:r};function r(u){if(typeof u=="number"&&u>-1&&u<=t.length){let c=0;for(;;){let f=a[c];if(f===void 0){const m=EE(t,a[c-1]);f=m===-1?t.length+1:m+1,a[c]=f}if(f>u)return{line:c+1,column:u-(c>0?a[c-1]:0)+1,offset:u};c++}}}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=EE(t,f),h=m===-1?t.length+1:m+1;if(f===h)break;a.push(h)}const c=(u.line>1?a[u.line-2]:0)+u.column-1;if(c<a[u.line-1])return c}}}function EE(e,t){const a=e.indexOf("\r",t),r=e.indexOf(`
502
- `,t);return r===-1?a:a===-1||a+1===r?r:a<r?a:r}const Br={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/"},DT={}.hasOwnProperty,oj=Object.prototype;function uj(e,t){const a=t||{};return bp({file:a.file||void 0,location:!1,schema:a.space==="svg"?ur:Mo,verbose:a.verbose||!1},e)}function bp(e,t){let a;switch(t.nodeName){case"#comment":{const r=t;return a={type:"comment",value:r.data},yc(e,r,a),a}case"#document":case"#document-fragment":{const r=t,o="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(a={type:"root",children:LT(e,t.childNodes),data:{quirksMode:o}},e.file&&e.location){const u=String(e.file),c=lj(u),f=c.toPoint(0),m=c.toPoint(u.length);a.position={start:f,end:m}}return a}case"#documentType":{const r=t;return a={type:"doctype"},yc(e,r,a),a}case"#text":{const r=t;return a={type:"text",value:r.value},yc(e,r,a),a}default:return a=cj(e,t),a}}function LT(e,t){let a=-1;const r=[];for(;++a<t.length;){const o=bp(e,t[a]);r.push(o)}return r}function cj(e,t){const a=e.schema;e.schema=t.namespaceURI===Br.svg?ur:Mo;let r=-1;const o={};for(;++r<t.attrs.length;){const f=t.attrs[r],m=(f.prefix?f.prefix+":":"")+f.name;DT.call(oj,m)||(o[m]=f.value)}const c=(e.schema.space==="svg"?ij:rj)(t.tagName,o,LT(e,t.childNodes));if(yc(e,t,c),c.tagName==="template"){const f=t,m=f.sourceCodeLocation,h=m&&m.startTag&&Ui(m.startTag),b=m&&m.endTag&&Ui(m.endTag),g=bp(e,f.content);h&&b&&e.file&&(g.position={start:h.end,end:b.start}),c.content=g}return e.schema=a,c}function yc(e,t,a){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=dj(e,a,t.sourceCodeLocation);r&&(e.location=!0,a.position=r)}}function dj(e,t,a){const r=Ui(a);if(t.type==="element"){const o=t.children[t.children.length-1];if(r&&!a.endTag&&o&&o.position&&o.position.end&&(r.end=Object.assign({},o.position.end)),e.verbose){const u={};let c;if(a.attrs)for(c in a.attrs)DT.call(a.attrs,c)&&(u[Zc(e.schema,c).property]=Ui(a.attrs[c]));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 r}function Ui(e){const t=yE({line:e.startLine,column:e.startCol,offset:e.startOffset}),a=yE({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||a?{start:t,end:a}:void 0}function yE(e){return e.line&&e.column?e:void 0}const fj={},mj={}.hasOwnProperty,jT=DN("type",{handlers:{root:pj,element:yj,text:xj,comment:Ej,doctype:bj}});function hj(e,t){const r=(t||fj).space;return jT(e,r==="svg"?ur:Mo)}function pj(e,t){const a={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return a.childNodes=xp(e.children,a,t),el(e,a),a}function gj(e,t){const a={nodeName:"#document-fragment",childNodes:[]};return a.childNodes=xp(e.children,a,t),el(e,a),a}function bj(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return el(e,t),t}function xj(e){const t={nodeName:"#text",value:e.value,parentNode:null};return el(e,t),t}function Ej(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return el(e,t),t}function yj(e,t){const a=t;let r=a;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&a.space==="html"&&(r=ur);const o=[];let u;if(e.properties){for(u in e.properties)if(u!=="children"&&mj.call(e.properties,u)){const m=Nj(r,u,e.properties[u]);m&&o.push(m)}}const c=r.space,f={nodeName:e.tagName,tagName:e.tagName,attrs:o,namespaceURI:Br[c],childNodes:[],parentNode:null};return f.childNodes=xp(e.children,f,r),el(e,f),e.tagName==="template"&&e.content&&(f.content=gj(e.content,r)),f}function Nj(e,t,a){const r=Zc(e,t);if(a===!1||a===null||a===void 0||typeof a=="number"&&Number.isNaN(a)||!a&&r.boolean)return;Array.isArray(a)&&(a=r.commaSeparated?Ky(a):tN(a));const o={name:r.attribute,value:a===!0?"":String(a)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const u=o.name.indexOf(":");u<0?o.prefix="":(o.name=o.name.slice(u+1),o.prefix=r.attribute.slice(0,u)),o.namespace=Br[r.space]}return o}function xp(e,t,a){let r=-1;const o=[];if(e)for(;++r<e.length;){const u=jT(e[r],a);u.parentNode=t,o.push(u)}return o}function el(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 Tj=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],_j=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]),Ut="�";var B;(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"})(B||(B={}));const ta={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function BT(e){return e>=55296&&e<=57343}function vj(e){return e>=56320&&e<=57343}function Sj(e,t){return(e-55296)*1024+9216+t}function PT(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function UT(e){return e>=64976&&e<=65007||_j.has(e)}var ce;(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"})(ce||(ce={}));const Aj=65536;class Cj{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=Aj,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:r,col:o,offset:u}=this,c=o+a,f=u+a;return{code:t,startLine:r,endLine:r,startCol:c,endCol:c,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(vj(a))return this.pos++,this._addGap(),Sj(t,a)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,B.EOF;return this._err(ce.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 r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const a=this.pos+t;if(a>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,B.EOF;const r=this.html.charCodeAt(a);return r===B.CARRIAGE_RETURN?B.LINE_FEED:r}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,B.EOF;let t=this.html.charCodeAt(this.pos);return t===B.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,B.LINE_FEED):t===B.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,BT(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===B.LINE_FEED||t===B.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){PT(t)?this._err(ce.controlCharacterInInputStream):UT(t)&&this._err(ce.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var at;(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"})(at||(at={}));function HT(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 wj=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))),kj=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 Rj(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=kj.get(e))!==null&&t!==void 0?t:e}var hn;(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"})(hn||(hn={}));const Oj=32;var lr;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(lr||(lr={}));function vh(e){return e>=hn.ZERO&&e<=hn.NINE}function Ij(e){return e>=hn.UPPER_A&&e<=hn.UPPER_F||e>=hn.LOWER_A&&e<=hn.LOWER_F}function Mj(e){return e>=hn.UPPER_A&&e<=hn.UPPER_Z||e>=hn.LOWER_A&&e<=hn.LOWER_Z||vh(e)}function Dj(e){return e===hn.EQUALS||Mj(e)}var fn;(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"})(fn||(fn={}));var vs;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(vs||(vs={}));class Lj{constructor(t,a,r){this.decodeTree=t,this.emitCodePoint=a,this.errors=r,this.state=fn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=vs.Strict}startEntity(t){this.decodeMode=t,this.state=fn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,a){switch(this.state){case fn.EntityStart:return t.charCodeAt(a)===hn.NUM?(this.state=fn.NumericStart,this.consumed+=1,this.stateNumericStart(t,a+1)):(this.state=fn.NamedEntity,this.stateNamedEntity(t,a));case fn.NumericStart:return this.stateNumericStart(t,a);case fn.NumericDecimal:return this.stateNumericDecimal(t,a);case fn.NumericHex:return this.stateNumericHex(t,a);case fn.NamedEntity:return this.stateNamedEntity(t,a)}}stateNumericStart(t,a){return a>=t.length?-1:(t.charCodeAt(a)|Oj)===hn.LOWER_X?(this.state=fn.NumericHex,this.consumed+=1,this.stateNumericHex(t,a+1)):(this.state=fn.NumericDecimal,this.stateNumericDecimal(t,a))}addToNumericResult(t,a,r,o){if(a!==r){const u=r-a;this.result=this.result*Math.pow(o,u)+Number.parseInt(t.substr(a,u),o),this.consumed+=u}}stateNumericHex(t,a){const r=a;for(;a<t.length;){const o=t.charCodeAt(a);if(vh(o)||Ij(o))a+=1;else return this.addToNumericResult(t,r,a,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(t,r,a,16),-1}stateNumericDecimal(t,a){const r=a;for(;a<t.length;){const o=t.charCodeAt(a);if(vh(o))a+=1;else return this.addToNumericResult(t,r,a,10),this.emitNumericEntity(o,2)}return this.addToNumericResult(t,r,a,10),-1}emitNumericEntity(t,a){var r;if(this.consumed<=a)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===hn.SEMI)this.consumed+=1;else if(this.decodeMode===vs.Strict)return 0;return this.emitCodePoint(Rj(this.result),this.consumed),this.errors&&(t!==hn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,a){const{decodeTree:r}=this;let o=r[this.treeIndex],u=(o&lr.VALUE_LENGTH)>>14;for(;a<t.length;a++,this.excess++){const c=t.charCodeAt(a);if(this.treeIndex=jj(r,o,this.treeIndex+Math.max(1,u),c),this.treeIndex<0)return this.result===0||this.decodeMode===vs.Attribute&&(u===0||Dj(c))?0:this.emitNotTerminatedNamedEntity();if(o=r[this.treeIndex],u=(o&lr.VALUE_LENGTH)>>14,u!==0){if(c===hn.SEMI)return this.emitNamedEntityData(this.treeIndex,u,this.consumed+this.excess);this.decodeMode!==vs.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:a,decodeTree:r}=this,o=(r[a]&lr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(a,o,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,a,r){const{decodeTree:o}=this;return this.emitCodePoint(a===1?o[t]&~lr.VALUE_LENGTH:o[t+1],r),a===3&&this.emitCodePoint(o[t+2],r),r}end(){var t;switch(this.state){case fn.NamedEntity:return this.result!==0&&(this.decodeMode!==vs.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case fn.NumericDecimal:return this.emitNumericEntity(0,2);case fn.NumericHex:return this.emitNumericEntity(0,3);case fn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case fn.EntityStart:return 0}}}function jj(e,t,a,r){const o=(t&lr.BRANCH_LENGTH)>>7,u=t&lr.JUMP_TABLE;if(o===0)return u!==0&&r===u?a:-1;if(u){const m=r-u;return m<0||m>=o?-1:e[a+m]-1}let c=a,f=c+o-1;for(;c<=f;){const m=c+f>>>1,h=e[m];if(h<r)c=m+1;else if(h>r)f=m-1;else return e[m+o]}return-1}var xe;(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/"})(xe||(xe={}));var Hr;(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"})(Hr||(Hr={}));var Ra;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Ra||(Ra={}));var ae;(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"})(ae||(ae={}));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 Bj=new Map([[ae.A,E.A],[ae.ADDRESS,E.ADDRESS],[ae.ANNOTATION_XML,E.ANNOTATION_XML],[ae.APPLET,E.APPLET],[ae.AREA,E.AREA],[ae.ARTICLE,E.ARTICLE],[ae.ASIDE,E.ASIDE],[ae.B,E.B],[ae.BASE,E.BASE],[ae.BASEFONT,E.BASEFONT],[ae.BGSOUND,E.BGSOUND],[ae.BIG,E.BIG],[ae.BLOCKQUOTE,E.BLOCKQUOTE],[ae.BODY,E.BODY],[ae.BR,E.BR],[ae.BUTTON,E.BUTTON],[ae.CAPTION,E.CAPTION],[ae.CENTER,E.CENTER],[ae.CODE,E.CODE],[ae.COL,E.COL],[ae.COLGROUP,E.COLGROUP],[ae.DD,E.DD],[ae.DESC,E.DESC],[ae.DETAILS,E.DETAILS],[ae.DIALOG,E.DIALOG],[ae.DIR,E.DIR],[ae.DIV,E.DIV],[ae.DL,E.DL],[ae.DT,E.DT],[ae.EM,E.EM],[ae.EMBED,E.EMBED],[ae.FIELDSET,E.FIELDSET],[ae.FIGCAPTION,E.FIGCAPTION],[ae.FIGURE,E.FIGURE],[ae.FONT,E.FONT],[ae.FOOTER,E.FOOTER],[ae.FOREIGN_OBJECT,E.FOREIGN_OBJECT],[ae.FORM,E.FORM],[ae.FRAME,E.FRAME],[ae.FRAMESET,E.FRAMESET],[ae.H1,E.H1],[ae.H2,E.H2],[ae.H3,E.H3],[ae.H4,E.H4],[ae.H5,E.H5],[ae.H6,E.H6],[ae.HEAD,E.HEAD],[ae.HEADER,E.HEADER],[ae.HGROUP,E.HGROUP],[ae.HR,E.HR],[ae.HTML,E.HTML],[ae.I,E.I],[ae.IMG,E.IMG],[ae.IMAGE,E.IMAGE],[ae.INPUT,E.INPUT],[ae.IFRAME,E.IFRAME],[ae.KEYGEN,E.KEYGEN],[ae.LABEL,E.LABEL],[ae.LI,E.LI],[ae.LINK,E.LINK],[ae.LISTING,E.LISTING],[ae.MAIN,E.MAIN],[ae.MALIGNMARK,E.MALIGNMARK],[ae.MARQUEE,E.MARQUEE],[ae.MATH,E.MATH],[ae.MENU,E.MENU],[ae.META,E.META],[ae.MGLYPH,E.MGLYPH],[ae.MI,E.MI],[ae.MO,E.MO],[ae.MN,E.MN],[ae.MS,E.MS],[ae.MTEXT,E.MTEXT],[ae.NAV,E.NAV],[ae.NOBR,E.NOBR],[ae.NOFRAMES,E.NOFRAMES],[ae.NOEMBED,E.NOEMBED],[ae.NOSCRIPT,E.NOSCRIPT],[ae.OBJECT,E.OBJECT],[ae.OL,E.OL],[ae.OPTGROUP,E.OPTGROUP],[ae.OPTION,E.OPTION],[ae.P,E.P],[ae.PARAM,E.PARAM],[ae.PLAINTEXT,E.PLAINTEXT],[ae.PRE,E.PRE],[ae.RB,E.RB],[ae.RP,E.RP],[ae.RT,E.RT],[ae.RTC,E.RTC],[ae.RUBY,E.RUBY],[ae.S,E.S],[ae.SCRIPT,E.SCRIPT],[ae.SEARCH,E.SEARCH],[ae.SECTION,E.SECTION],[ae.SELECT,E.SELECT],[ae.SOURCE,E.SOURCE],[ae.SMALL,E.SMALL],[ae.SPAN,E.SPAN],[ae.STRIKE,E.STRIKE],[ae.STRONG,E.STRONG],[ae.STYLE,E.STYLE],[ae.SUB,E.SUB],[ae.SUMMARY,E.SUMMARY],[ae.SUP,E.SUP],[ae.TABLE,E.TABLE],[ae.TBODY,E.TBODY],[ae.TEMPLATE,E.TEMPLATE],[ae.TEXTAREA,E.TEXTAREA],[ae.TFOOT,E.TFOOT],[ae.TD,E.TD],[ae.TH,E.TH],[ae.THEAD,E.THEAD],[ae.TITLE,E.TITLE],[ae.TR,E.TR],[ae.TRACK,E.TRACK],[ae.TT,E.TT],[ae.U,E.U],[ae.UL,E.UL],[ae.SVG,E.SVG],[ae.VAR,E.VAR],[ae.WBR,E.WBR],[ae.XMP,E.XMP]]);function tl(e){var t;return(t=Bj.get(e))!==null&&t!==void 0?t:E.UNKNOWN}const Ee=E,Pj={[xe.HTML]:new Set([Ee.ADDRESS,Ee.APPLET,Ee.AREA,Ee.ARTICLE,Ee.ASIDE,Ee.BASE,Ee.BASEFONT,Ee.BGSOUND,Ee.BLOCKQUOTE,Ee.BODY,Ee.BR,Ee.BUTTON,Ee.CAPTION,Ee.CENTER,Ee.COL,Ee.COLGROUP,Ee.DD,Ee.DETAILS,Ee.DIR,Ee.DIV,Ee.DL,Ee.DT,Ee.EMBED,Ee.FIELDSET,Ee.FIGCAPTION,Ee.FIGURE,Ee.FOOTER,Ee.FORM,Ee.FRAME,Ee.FRAMESET,Ee.H1,Ee.H2,Ee.H3,Ee.H4,Ee.H5,Ee.H6,Ee.HEAD,Ee.HEADER,Ee.HGROUP,Ee.HR,Ee.HTML,Ee.IFRAME,Ee.IMG,Ee.INPUT,Ee.LI,Ee.LINK,Ee.LISTING,Ee.MAIN,Ee.MARQUEE,Ee.MENU,Ee.META,Ee.NAV,Ee.NOEMBED,Ee.NOFRAMES,Ee.NOSCRIPT,Ee.OBJECT,Ee.OL,Ee.P,Ee.PARAM,Ee.PLAINTEXT,Ee.PRE,Ee.SCRIPT,Ee.SECTION,Ee.SELECT,Ee.SOURCE,Ee.STYLE,Ee.SUMMARY,Ee.TABLE,Ee.TBODY,Ee.TD,Ee.TEMPLATE,Ee.TEXTAREA,Ee.TFOOT,Ee.TH,Ee.THEAD,Ee.TITLE,Ee.TR,Ee.TRACK,Ee.UL,Ee.WBR,Ee.XMP]),[xe.MATHML]:new Set([Ee.MI,Ee.MO,Ee.MN,Ee.MS,Ee.MTEXT,Ee.ANNOTATION_XML]),[xe.SVG]:new Set([Ee.TITLE,Ee.FOREIGN_OBJECT,Ee.DESC]),[xe.XLINK]:new Set,[xe.XML]:new Set,[xe.XMLNS]:new Set},Sh=new Set([Ee.H1,Ee.H2,Ee.H3,Ee.H4,Ee.H5,Ee.H6]);ae.STYLE,ae.SCRIPT,ae.XMP,ae.IFRAME,ae.NOEMBED,ae.NOFRAMES,ae.PLAINTEXT;var z;(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"})(z||(z={}));const Wt={DATA:z.DATA,RCDATA:z.RCDATA,RAWTEXT:z.RAWTEXT,SCRIPT_DATA:z.SCRIPT_DATA,PLAINTEXT:z.PLAINTEXT,CDATA_SECTION:z.CDATA_SECTION};function Uj(e){return e>=B.DIGIT_0&&e<=B.DIGIT_9}function lo(e){return e>=B.LATIN_CAPITAL_A&&e<=B.LATIN_CAPITAL_Z}function Hj(e){return e>=B.LATIN_SMALL_A&&e<=B.LATIN_SMALL_Z}function rr(e){return Hj(e)||lo(e)}function NE(e){return rr(e)||Uj(e)}function hc(e){return e+32}function FT(e){return e===B.SPACE||e===B.LINE_FEED||e===B.TABULATION||e===B.FORM_FEED}function TE(e){return FT(e)||e===B.SOLIDUS||e===B.GREATER_THAN_SIGN}function Fj(e){return e===B.NULL?ce.nullCharacterReference:e>1114111?ce.characterReferenceOutsideUnicodeRange:BT(e)?ce.surrogateCharacterReference:UT(e)?ce.noncharacterCharacterReference:PT(e)||e===B.CARRIAGE_RETURN?ce.controlCharacterReference:null}class zj{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=z.DATA,this.returnState=z.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Cj(a),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Lj(wj,(r,o)=>{this.preprocessor.pos=this.entityStartPos+o-1,this._flushCodePointConsumedAsCharacterReference(r)},a.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ce.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(ce.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const o=Fj(r);o&&this._err(o,1)}}:void 0)}_err(t,a=0){var r,o;(o=(r=this.handler).onParseError)===null||o===void 0||o.call(r,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,r){this.active=!0,this.preprocessor.write(t,a),this._runParsingLoop(),this.paused||r==null||r()}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:at.START_TAG,tagName:"",tagID:E.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:at.END_TAG,tagName:"",tagID:E.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:at.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:at.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 r=this.currentToken;if(HT(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const o=(t=(a=r.location).attrs)!==null&&t!==void 0?t:a.attrs=Object.create(null);o[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(ce.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=tl(t.tagName),t.type===at.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(ce.endTagWithAttributes),t.selfClosing&&this._err(ce.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 at.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case at.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case at.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:at.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=FT(t)?at.WHITESPACE_CHARACTER:t===B.NULL?at.NULL_CHARACTER:at.CHARACTER;this._appendCharToCurrentCharacterToken(a,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(at.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=z.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?vs.Attribute:vs.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===z.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===z.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===z.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case z.DATA:{this._stateData(t);break}case z.RCDATA:{this._stateRcdata(t);break}case z.RAWTEXT:{this._stateRawtext(t);break}case z.SCRIPT_DATA:{this._stateScriptData(t);break}case z.PLAINTEXT:{this._statePlaintext(t);break}case z.TAG_OPEN:{this._stateTagOpen(t);break}case z.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case z.TAG_NAME:{this._stateTagName(t);break}case z.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case z.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case z.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case z.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case z.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case z.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case z.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case z.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case z.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case z.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case z.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case z.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case z.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case z.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case z.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case z.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case z.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case z.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case z.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case z.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case z.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case z.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case z.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case z.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case z.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case z.BOGUS_COMMENT:{this._stateBogusComment(t);break}case z.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case z.COMMENT_START:{this._stateCommentStart(t);break}case z.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case z.COMMENT:{this._stateComment(t);break}case z.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case z.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case z.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case z.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case z.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case z.COMMENT_END:{this._stateCommentEnd(t);break}case z.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case z.DOCTYPE:{this._stateDoctype(t);break}case z.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case z.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case z.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case z.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case z.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case z.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case z.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case z.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case z.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case z.CDATA_SECTION:{this._stateCdataSection(t);break}case z.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case z.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case z.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case z.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case B.LESS_THAN_SIGN:{this.state=z.TAG_OPEN;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this._emitCodePoint(t);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case B.AMPERSAND:{this._startCharacterReference();break}case B.LESS_THAN_SIGN:{this.state=z.RCDATA_LESS_THAN_SIGN;break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this._emitChars(Ut);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case B.LESS_THAN_SIGN:{this.state=z.RAWTEXT_LESS_THAN_SIGN;break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this._emitChars(Ut);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case B.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_LESS_THAN_SIGN;break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this._emitChars(Ut);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case B.NULL:{this._err(ce.unexpectedNullCharacter),this._emitChars(Ut);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(rr(t))this._createStartTagToken(),this.state=z.TAG_NAME,this._stateTagName(t);else switch(t){case B.EXCLAMATION_MARK:{this.state=z.MARKUP_DECLARATION_OPEN;break}case B.SOLIDUS:{this.state=z.END_TAG_OPEN;break}case B.QUESTION_MARK:{this._err(ce.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=z.BOGUS_COMMENT,this._stateBogusComment(t);break}case B.EOF:{this._err(ce.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ce.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=z.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(rr(t))this._createEndTagToken(),this.state=z.TAG_NAME,this._stateTagName(t);else switch(t){case B.GREATER_THAN_SIGN:{this._err(ce.missingEndTagName),this.state=z.DATA;break}case B.EOF:{this._err(ce.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(ce.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=z.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const a=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=z.BEFORE_ATTRIBUTE_NAME;break}case B.SOLIDUS:{this.state=z.SELF_CLOSING_START_TAG;break}case B.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentTagToken();break}case B.NULL:{this._err(ce.unexpectedNullCharacter),a.tagName+=Ut;break}case B.EOF:{this._err(ce.eofInTag),this._emitEOFToken();break}default:a.tagName+=String.fromCodePoint(lo(t)?hc(t):t)}}_stateRcdataLessThanSign(t){t===B.SOLIDUS?this.state=z.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=z.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){rr(t)?(this.state=z.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=z.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 B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=z.BEFORE_ATTRIBUTE_NAME,!1;case B.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=z.SELF_CLOSING_START_TAG,!1;case B.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=z.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=z.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===B.SOLIDUS?this.state=z.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=z.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){rr(t)?(this.state=z.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=z.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=z.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case B.SOLIDUS:{this.state=z.SCRIPT_DATA_END_TAG_OPEN;break}case B.EXCLAMATION_MARK:{this.state=z.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=z.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){rr(t)?(this.state=z.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===B.HYPHEN_MINUS?(this.state=z.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===B.HYPHEN_MINUS?(this.state=z.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case B.HYPHEN_MINUS:{this.state=z.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this._emitChars(Ut);break}case B.EOF:{this._err(ce.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case B.HYPHEN_MINUS:{this.state=z.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_ESCAPED,this._emitChars(Ut);break}case B.EOF:{this._err(ce.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=z.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case B.HYPHEN_MINUS:{this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case B.GREATER_THAN_SIGN:{this.state=z.SCRIPT_DATA,this._emitChars(">");break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_ESCAPED,this._emitChars(Ut);break}case B.EOF:{this._err(ce.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=z.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===B.SOLIDUS?this.state=z.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:rr(t)?(this._emitChars("<"),this.state=z.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){rr(t)?(this.state=z.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(ta.SCRIPT,!1)&&TE(this.preprocessor.peek(ta.SCRIPT.length))){this._emitCodePoint(t);for(let a=0;a<ta.SCRIPT.length;a++)this._emitCodePoint(this._consume());this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case B.HYPHEN_MINUS:{this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this._emitChars(Ut);break}case B.EOF:{this._err(ce.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case B.HYPHEN_MINUS:{this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ut);break}case B.EOF:{this._err(ce.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case B.HYPHEN_MINUS:{this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case B.GREATER_THAN_SIGN:{this.state=z.SCRIPT_DATA,this._emitChars(">");break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ut);break}case B.EOF:{this._err(ce.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===B.SOLIDUS?(this.state=z.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(ta.SCRIPT,!1)&&TE(this.preprocessor.peek(ta.SCRIPT.length))){this._emitCodePoint(t);for(let a=0;a<ta.SCRIPT.length;a++)this._emitCodePoint(this._consume());this.state=z.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.SOLIDUS:case B.GREATER_THAN_SIGN:case B.EOF:{this.state=z.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case B.EQUALS_SIGN:{this._err(ce.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=z.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=z.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:case B.SOLIDUS:case B.GREATER_THAN_SIGN:case B.EOF:{this._leaveAttrName(),this.state=z.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case B.EQUALS_SIGN:{this._leaveAttrName(),this.state=z.BEFORE_ATTRIBUTE_VALUE;break}case B.QUOTATION_MARK:case B.APOSTROPHE:case B.LESS_THAN_SIGN:{this._err(ce.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this.currentAttr.name+=Ut;break}default:this.currentAttr.name+=String.fromCodePoint(lo(t)?hc(t):t)}}_stateAfterAttributeName(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.SOLIDUS:{this.state=z.SELF_CLOSING_START_TAG;break}case B.EQUALS_SIGN:{this.state=z.BEFORE_ATTRIBUTE_VALUE;break}case B.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentTagToken();break}case B.EOF:{this._err(ce.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=z.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.QUOTATION_MARK:{this.state=z.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this.state=z.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(ce.missingAttributeValue),this.state=z.DATA,this.emitCurrentTagToken();break}default:this.state=z.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case B.QUOTATION_MARK:{this.state=z.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this.currentAttr.value+=Ut;break}case B.EOF:{this._err(ce.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case B.APOSTROPHE:{this.state=z.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this.currentAttr.value+=Ut;break}case B.EOF:{this._err(ce.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this._leaveAttrValue(),this.state=z.BEFORE_ATTRIBUTE_NAME;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=z.DATA,this.emitCurrentTagToken();break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this.currentAttr.value+=Ut;break}case B.QUOTATION_MARK:case B.APOSTROPHE:case B.LESS_THAN_SIGN:case B.EQUALS_SIGN:case B.GRAVE_ACCENT:{this._err(ce.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case B.EOF:{this._err(ce.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this._leaveAttrValue(),this.state=z.BEFORE_ATTRIBUTE_NAME;break}case B.SOLIDUS:{this._leaveAttrValue(),this.state=z.SELF_CLOSING_START_TAG;break}case B.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=z.DATA,this.emitCurrentTagToken();break}case B.EOF:{this._err(ce.eofInTag),this._emitEOFToken();break}default:this._err(ce.missingWhitespaceBetweenAttributes),this.state=z.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case B.GREATER_THAN_SIGN:{const a=this.currentToken;a.selfClosing=!0,this.state=z.DATA,this.emitCurrentTagToken();break}case B.EOF:{this._err(ce.eofInTag),this._emitEOFToken();break}default:this._err(ce.unexpectedSolidusInTag),this.state=z.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const a=this.currentToken;switch(t){case B.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentComment(a);break}case B.EOF:{this.emitCurrentComment(a),this._emitEOFToken();break}case B.NULL:{this._err(ce.unexpectedNullCharacter),a.data+=Ut;break}default:a.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(ta.DASH_DASH,!0)?(this._createCommentToken(ta.DASH_DASH.length+1),this.state=z.COMMENT_START):this._consumeSequenceIfMatch(ta.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(ta.DOCTYPE.length+1),this.state=z.DOCTYPE):this._consumeSequenceIfMatch(ta.CDATA_START,!0)?this.inForeignNode?this.state=z.CDATA_SECTION:(this._err(ce.cdataInHtmlContent),this._createCommentToken(ta.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=z.BOGUS_COMMENT):this._ensureHibernation()||(this._err(ce.incorrectlyOpenedComment),this._createCommentToken(2),this.state=z.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case B.HYPHEN_MINUS:{this.state=z.COMMENT_START_DASH;break}case B.GREATER_THAN_SIGN:{this._err(ce.abruptClosingOfEmptyComment),this.state=z.DATA;const a=this.currentToken;this.emitCurrentComment(a);break}default:this.state=z.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const a=this.currentToken;switch(t){case B.HYPHEN_MINUS:{this.state=z.COMMENT_END;break}case B.GREATER_THAN_SIGN:{this._err(ce.abruptClosingOfEmptyComment),this.state=z.DATA,this.emitCurrentComment(a);break}case B.EOF:{this._err(ce.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+="-",this.state=z.COMMENT,this._stateComment(t)}}_stateComment(t){const a=this.currentToken;switch(t){case B.HYPHEN_MINUS:{this.state=z.COMMENT_END_DASH;break}case B.LESS_THAN_SIGN:{a.data+="<",this.state=z.COMMENT_LESS_THAN_SIGN;break}case B.NULL:{this._err(ce.unexpectedNullCharacter),a.data+=Ut;break}case B.EOF:{this._err(ce.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const a=this.currentToken;switch(t){case B.EXCLAMATION_MARK:{a.data+="!",this.state=z.COMMENT_LESS_THAN_SIGN_BANG;break}case B.LESS_THAN_SIGN:{a.data+="<";break}default:this.state=z.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===B.HYPHEN_MINUS?this.state=z.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=z.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===B.HYPHEN_MINUS?this.state=z.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=z.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==B.GREATER_THAN_SIGN&&t!==B.EOF&&this._err(ce.nestedComment),this.state=z.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const a=this.currentToken;switch(t){case B.HYPHEN_MINUS:{this.state=z.COMMENT_END;break}case B.EOF:{this._err(ce.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+="-",this.state=z.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const a=this.currentToken;switch(t){case B.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentComment(a);break}case B.EXCLAMATION_MARK:{this.state=z.COMMENT_END_BANG;break}case B.HYPHEN_MINUS:{a.data+="-";break}case B.EOF:{this._err(ce.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+="--",this.state=z.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const a=this.currentToken;switch(t){case B.HYPHEN_MINUS:{a.data+="--!",this.state=z.COMMENT_END_DASH;break}case B.GREATER_THAN_SIGN:{this._err(ce.incorrectlyClosedComment),this.state=z.DATA,this.emitCurrentComment(a);break}case B.EOF:{this._err(ce.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+="--!",this.state=z.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=z.BEFORE_DOCTYPE_NAME;break}case B.GREATER_THAN_SIGN:{this.state=z.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case B.EOF:{this._err(ce.eofInDoctype),this._createDoctypeToken(null);const a=this.currentToken;a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(ce.missingWhitespaceBeforeDoctypeName),this.state=z.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(lo(t))this._createDoctypeToken(String.fromCharCode(hc(t))),this.state=z.DOCTYPE_NAME;else switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.NULL:{this._err(ce.unexpectedNullCharacter),this._createDoctypeToken(Ut),this.state=z.DOCTYPE_NAME;break}case B.GREATER_THAN_SIGN:{this._err(ce.missingDoctypeName),this._createDoctypeToken(null);const a=this.currentToken;a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=z.DATA;break}case B.EOF:{this._err(ce.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=z.DOCTYPE_NAME}}_stateDoctypeName(t){const a=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=z.AFTER_DOCTYPE_NAME;break}case B.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentDoctype(a);break}case B.NULL:{this._err(ce.unexpectedNullCharacter),a.name+=Ut;break}case B.EOF:{this._err(ce.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:a.name+=String.fromCodePoint(lo(t)?hc(t):t)}}_stateAfterDoctypeName(t){const a=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentDoctype(a);break}case B.EOF:{this._err(ce.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(ta.PUBLIC,!1)?this.state=z.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(ta.SYSTEM,!1)?this.state=z.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(ce.invalidCharacterSequenceAfterDoctypeName),a.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const a=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=z.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case B.QUOTATION_MARK:{this._err(ce.missingWhitespaceAfterDoctypePublicKeyword),a.publicId="",this.state=z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this._err(ce.missingWhitespaceAfterDoctypePublicKeyword),a.publicId="",this.state=z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(ce.missingDoctypePublicIdentifier),a.forceQuirks=!0,this.state=z.DATA,this.emitCurrentDoctype(a);break}case B.EOF:{this._err(ce.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(ce.missingQuoteBeforeDoctypePublicIdentifier),a.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const a=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.QUOTATION_MARK:{a.publicId="",this.state=z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{a.publicId="",this.state=z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(ce.missingDoctypePublicIdentifier),a.forceQuirks=!0,this.state=z.DATA,this.emitCurrentDoctype(a);break}case B.EOF:{this._err(ce.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(ce.missingQuoteBeforeDoctypePublicIdentifier),a.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const a=this.currentToken;switch(t){case B.QUOTATION_MARK:{this.state=z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case B.NULL:{this._err(ce.unexpectedNullCharacter),a.publicId+=Ut;break}case B.GREATER_THAN_SIGN:{this._err(ce.abruptDoctypePublicIdentifier),a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=z.DATA;break}case B.EOF:{this._err(ce.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 B.APOSTROPHE:{this.state=z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case B.NULL:{this._err(ce.unexpectedNullCharacter),a.publicId+=Ut;break}case B.GREATER_THAN_SIGN:{this._err(ce.abruptDoctypePublicIdentifier),a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=z.DATA;break}case B.EOF:{this._err(ce.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 B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=z.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case B.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentDoctype(a);break}case B.QUOTATION_MARK:{this._err(ce.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),a.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this._err(ce.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),a.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.EOF:{this._err(ce.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(ce.missingQuoteBeforeDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const a=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.GREATER_THAN_SIGN:{this.emitCurrentDoctype(a),this.state=z.DATA;break}case B.QUOTATION_MARK:{a.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{a.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.EOF:{this._err(ce.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(ce.missingQuoteBeforeDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const a=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=z.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case B.QUOTATION_MARK:{this._err(ce.missingWhitespaceAfterDoctypeSystemKeyword),a.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this._err(ce.missingWhitespaceAfterDoctypeSystemKeyword),a.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(ce.missingDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=z.DATA,this.emitCurrentDoctype(a);break}case B.EOF:{this._err(ce.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(ce.missingQuoteBeforeDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const a=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.QUOTATION_MARK:{a.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{a.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(ce.missingDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=z.DATA,this.emitCurrentDoctype(a);break}case B.EOF:{this._err(ce.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(ce.missingQuoteBeforeDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const a=this.currentToken;switch(t){case B.QUOTATION_MARK:{this.state=z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case B.NULL:{this._err(ce.unexpectedNullCharacter),a.systemId+=Ut;break}case B.GREATER_THAN_SIGN:{this._err(ce.abruptDoctypeSystemIdentifier),a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=z.DATA;break}case B.EOF:{this._err(ce.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 B.APOSTROPHE:{this.state=z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case B.NULL:{this._err(ce.unexpectedNullCharacter),a.systemId+=Ut;break}case B.GREATER_THAN_SIGN:{this._err(ce.abruptDoctypeSystemIdentifier),a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=z.DATA;break}case B.EOF:{this._err(ce.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 B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.GREATER_THAN_SIGN:{this.emitCurrentDoctype(a),this.state=z.DATA;break}case B.EOF:{this._err(ce.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(ce.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const a=this.currentToken;switch(t){case B.GREATER_THAN_SIGN:{this.emitCurrentDoctype(a),this.state=z.DATA;break}case B.NULL:{this._err(ce.unexpectedNullCharacter);break}case B.EOF:{this.emitCurrentDoctype(a),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case B.RIGHT_SQUARE_BRACKET:{this.state=z.CDATA_SECTION_BRACKET;break}case B.EOF:{this._err(ce.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===B.RIGHT_SQUARE_BRACKET?this.state=z.CDATA_SECTION_END:(this._emitChars("]"),this.state=z.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case B.GREATER_THAN_SIGN:{this.state=z.DATA;break}case B.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=z.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(B.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&NE(this.preprocessor.peek(1))?z.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){NE(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===B.SEMICOLON&&this._err(ce.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const zT=new Set([E.DD,E.DT,E.LI,E.OPTGROUP,E.OPTION,E.P,E.RB,E.RP,E.RT,E.RTC]),_E=new Set([...zT,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]),$j=new Set([...Pc,E.OL,E.UL]),qj=new Set([...Pc,E.BUTTON]),vE=new Set([E.ANNOTATION_XML,E.MI,E.MN,E.MO,E.MS,E.MTEXT]),SE=new Set([E.DESC,E.FOREIGN_OBJECT,E.TITLE]),Yj=new Set([E.TR,E.TEMPLATE,E.HTML]),Gj=new Set([E.TBODY,E.TFOOT,E.THEAD,E.TEMPLATE,E.HTML]),Kj=new Set([E.TABLE,E.TEMPLATE,E.HTML]),Vj=new Set([E.TD,E.TH]);class Xj{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,a,r){this.treeAdapter=a,this.handler=r,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)===xe.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 r=this._indexOf(t);this.items[r]=a,r===this.stackTop&&(this.current=a)}insertAfter(t,a,r){const o=this._indexOf(t)+1;this.items.splice(o,0,a),this.tagIDs.splice(o,0,r),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])!==xe.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 r=this._indexOfTagNames(t,a);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Sh,xe.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Vj,xe.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,a){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===a)return r;return-1}clearBackTo(t,a){const r=this._indexOfTagNames(t,a);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(Kj,xe.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Gj,xe.HTML)}clearBackToTableRowContext(){this.clearBackTo(Yj,xe.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 r=this.stackTop;r>=0;r--){const o=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case xe.HTML:{if(o===t)return!0;if(a.has(o))return!1;break}case xe.SVG:{if(SE.has(o))return!1;break}case xe.MATHML:{if(vE.has(o))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Pc)}hasInListItemScope(t){return this.hasInDynamicScope(t,$j)}hasInButtonScope(t){return this.hasInDynamicScope(t,qj)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const a=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case xe.HTML:{if(Sh.has(a))return!0;if(Pc.has(a))return!1;break}case xe.SVG:{if(SE.has(a))return!1;break}case xe.MATHML:{if(vE.has(a))return!1;break}}}return!0}hasInTableScope(t){for(let a=this.stackTop;a>=0;a--)if(this.treeAdapter.getNamespaceURI(this.items[a])===xe.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])===xe.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])===xe.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&&zT.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&_E.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&_E.has(this.currentTagId);)this.pop()}}const Qm=3;var Ja;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Ja||(Ja={}));const AE={type:Ja.Marker};class Qj{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,a){const r=[],o=a.length,u=this.treeAdapter.getTagName(t),c=this.treeAdapter.getNamespaceURI(t);for(let f=0;f<this.entries.length;f++){const m=this.entries[f];if(m.type===Ja.Marker)break;const{element:h}=m;if(this.treeAdapter.getTagName(h)===u&&this.treeAdapter.getNamespaceURI(h)===c){const b=this.treeAdapter.getAttrList(h);b.length===o&&r.push({idx:f,attrs:b})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<Qm)return;const a=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,a);if(r.length<Qm)return;const o=new Map(a.map(c=>[c.name,c.value]));let u=0;for(let c=0;c<r.length;c++){const f=r[c];f.attrs.every(m=>o.get(m.name)===m.value)&&(u+=1,u>=Qm&&this.entries.splice(f.idx,1))}}insertMarker(){this.entries.unshift(AE)}pushElement(t,a){this._ensureNoahArkCondition(t),this.entries.unshift({type:Ja.Element,element:t,token:a})}insertElementAfterBookmark(t,a){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Ja.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(AE);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const a=this.entries.find(r=>r.type===Ja.Marker||this.treeAdapter.getTagName(r.element)===t);return a&&a.type===Ja.Element?a:null}getElementEntry(t){return this.entries.find(a=>a.type===Ja.Element&&a.element===t)}}const ir={createDocument(){return{nodeName:"#document",mode:Ra.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 r=e.childNodes.indexOf(a);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,a,r){const o=e.childNodes.find(u=>u.nodeName==="#documentType");if(o)o.name=t,o.publicId=a,o.systemId=r;else{const u={nodeName:"#documentType",name:t,publicId:a,systemId:r,parentNode:null};ir.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(ir.isTextNode(a)){a.value+=t;return}}ir.appendChild(e,ir.createTextNode(t))},insertTextBefore(e,t,a){const r=e.childNodes[e.childNodes.indexOf(a)-1];r&&ir.isTextNode(r)?r.value+=t:ir.insertBefore(e,ir.createTextNode(t),a)},adoptAttributes(e,t){const a=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)a.has(t[r].name)||e.attrs.push(t[r])},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}}},$T="html",Wj="about:legacy-compat",Zj="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",qT=["+//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//"],Jj=[...qT,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],e8=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),YT=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],t8=[...YT,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function CE(e,t){return t.some(a=>e.startsWith(a))}function n8(e){return e.name===$T&&e.publicId===null&&(e.systemId===null||e.systemId===Wj)}function a8(e){if(e.name!==$T)return Ra.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===Zj)return Ra.QUIRKS;let{publicId:a}=e;if(a!==null){if(a=a.toLowerCase(),e8.has(a))return Ra.QUIRKS;let r=t===null?Jj:qT;if(CE(a,r))return Ra.QUIRKS;if(r=t===null?YT:t8,CE(a,r))return Ra.LIMITED_QUIRKS}return Ra.NO_QUIRKS}const wE={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},s8="definitionurl",r8="definitionURL",i8=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])),l8=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:xe.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:xe.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:xe.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:xe.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:xe.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:xe.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:xe.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:xe.XML}],["xml:space",{prefix:"xml",name:"space",namespace:xe.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:xe.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:xe.XMLNS}]]),o8=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])),u8=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 c8(e){const t=e.tagID;return t===E.FONT&&e.attrs.some(({name:r})=>r===Hr.COLOR||r===Hr.SIZE||r===Hr.FACE)||u8.has(t)}function GT(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===s8){e.attrs[t].name=r8;break}}function KT(e){for(let t=0;t<e.attrs.length;t++){const a=i8.get(e.attrs[t].name);a!=null&&(e.attrs[t].name=a)}}function Ep(e){for(let t=0;t<e.attrs.length;t++){const a=l8.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 d8(e){const t=o8.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=tl(e.tagName))}function f8(e,t){return t===xe.MATHML&&(e===E.MI||e===E.MO||e===E.MN||e===E.MS||e===E.MTEXT)}function m8(e,t,a){if(t===xe.MATHML&&e===E.ANNOTATION_XML){for(let r=0;r<a.length;r++)if(a[r].name===Hr.ENCODING){const o=a[r].value.toLowerCase();return o===wE.TEXT_HTML||o===wE.APPLICATION_XML}}return t===xe.SVG&&(e===E.FOREIGN_OBJECT||e===E.DESC||e===E.TITLE)}function h8(e,t,a,r){return(!r||r===xe.HTML)&&m8(e,t,a)||(!r||r===xe.MATHML)&&f8(e,t)}const p8="hidden",g8=8,b8=3;var Y;(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"})(Y||(Y={}));const x8={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},VT=new Set([E.TABLE,E.TBODY,E.TFOOT,E.THEAD,E.TR]),kE={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:ir,onParseError:null};class RE{constructor(t,a,r=null,o=null){this.fragmentContext=r,this.scriptHandler=o,this.currentToken=null,this.stopped=!1,this.insertionMode=Y.INITIAL,this.originalInsertionMode=Y.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={...kE,...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 zj(this.options,this),this.activeFormattingElements=new Qj(this.treeAdapter),this.fragmentContextID=r?tl(this.treeAdapter.getTagName(r)):E.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new Xj(this.document,this.treeAdapter,this)}static parse(t,a){const r=new this(a);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,a){const r={...kE,...a};t??(t=r.treeAdapter.createElement(ae.TEMPLATE,xe.HTML,[]));const o=r.treeAdapter.createElement("documentmock",xe.HTML,[]),u=new this(r,o,t);return u.fragmentContextID===E.TEMPLATE&&u.tmplInsertionModeStack.unshift(Y.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,r){var o;if(!this.onParseError)return;const u=(o=t.location)!==null&&o!==void 0?o:x8,c={code:a,startLine:u.startLine,startCol:u.startCol,startOffset:u.startOffset,endLine:r?u.startLine:u.endLine,endCol:r?u.startCol:u.endCol,endOffset:r?u.startOffset:u.endOffset};this.onParseError(c)}onItemPush(t,a,r){var o,u;(u=(o=this.treeAdapter).onItemPush)===null||u===void 0||u.call(o,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,a)}onItemPop(t,a){var r,o;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(o=(r=this.treeAdapter).onItemPop)===null||o===void 0||o.call(r,t,this.openElements.current),a){let u,c;this.openElements.stackTop===0&&this.fragmentContext?(u=this.fragmentContext,c=this.fragmentContextID):{current:u,currentTagId:c}=this.openElements,this._setContextModes(u,c)}}_setContextModes(t,a){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===xe.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&a!==void 0&&!this._isIntegrationPoint(a,t)}_switchToTextParsing(t,a){this._insertElement(t,xe.HTML),this.tokenizer.state=a,this.originalInsertionMode=this.insertionMode,this.insertionMode=Y.TEXT}switchToPlaintextParsing(){this.insertionMode=Y.TEXT,this.originalInsertionMode=Y.IN_BODY,this.tokenizer.state=Wt.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)===ae.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==xe.HTML))switch(this.fragmentContextID){case E.TITLE:case E.TEXTAREA:{this.tokenizer.state=Wt.RCDATA;break}case E.STYLE:case E.XMP:case E.IFRAME:case E.NOEMBED:case E.NOFRAMES:case E.NOSCRIPT:{this.tokenizer.state=Wt.RAWTEXT;break}case E.SCRIPT:{this.tokenizer.state=Wt.SCRIPT_DATA;break}case E.PLAINTEXT:{this.tokenizer.state=Wt.PLAINTEXT;break}}}_setDocumentType(t){const a=t.name||"",r=t.publicId||"",o=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,a,r,o),t.location){const c=this.treeAdapter.getChildNodes(this.document).find(f=>this.treeAdapter.isDocumentTypeNode(f));c&&this.treeAdapter.setNodeSourceCodeLocation(c,t.location)}}_attachElementToTree(t,a){if(this.options.sourceCodeLocationInfo){const r=a&&{...a,startTag:a};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,a){const r=this.treeAdapter.createElement(t.tagName,a,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,a){const r=this.treeAdapter.createElement(t.tagName,a,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,a){const r=this.treeAdapter.createElement(t,xe.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,a)}_insertTemplate(t){const a=this.treeAdapter.createElement(t.tagName,xe.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(a,r),this._attachElementToTree(a,t.location),this.openElements.push(a,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(ae.HTML,xe.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 r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(a,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let a,r;if(this._shouldFosterParentOnInsertion()?({parent:a,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(a,t.chars,r):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=r?o.lastIndexOf(r):o.length,c=o[u-1];if(this.treeAdapter.getNodeSourceCodeLocation(c)){const{endLine:m,endCol:h,endOffset:b}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(c,{endLine:m,endCol:h,endOffset:b})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(c,t.location)}_adoptNodes(t,a){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(a,r)}_setEndLocation(t,a){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&a.location){const r=a.location,o=this.treeAdapter.getTagName(t),u=a.type===at.END_TAG&&o===a.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,u)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let a,r;return this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,r=this.fragmentContextID):{current:a,currentTagId:r}=this.openElements,t.tagID===E.SVG&&this.treeAdapter.getTagName(a)===ae.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(a)===xe.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===E.MGLYPH||t.tagID===E.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,a,xe.HTML)}_processToken(t){switch(t.type){case at.CHARACTER:{this.onCharacter(t);break}case at.NULL_CHARACTER:{this.onNullCharacter(t);break}case at.COMMENT:{this.onComment(t);break}case at.DOCTYPE:{this.onDoctype(t);break}case at.START_TAG:{this._processStartTag(t);break}case at.END_TAG:{this.onEndTag(t);break}case at.EOF:{this.onEof(t);break}case at.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,a,r){const o=this.treeAdapter.getNamespaceURI(a),u=this.treeAdapter.getAttrList(a);return h8(t,o,u,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const a=this.activeFormattingElements.entries.findIndex(o=>o.type===Ja.Marker||this.openElements.contains(o.element)),r=a===-1?t-1:a-1;for(let o=r;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=Y.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=Y.IN_ROW;return}case E.TBODY:case E.THEAD:case E.TFOOT:{this.insertionMode=Y.IN_TABLE_BODY;return}case E.CAPTION:{this.insertionMode=Y.IN_CAPTION;return}case E.COLGROUP:{this.insertionMode=Y.IN_COLUMN_GROUP;return}case E.TABLE:{this.insertionMode=Y.IN_TABLE;return}case E.BODY:{this.insertionMode=Y.IN_BODY;return}case E.FRAMESET:{this.insertionMode=Y.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?Y.AFTER_HEAD:Y.BEFORE_HEAD;return}case E.TD:case E.TH:{if(t>0){this.insertionMode=Y.IN_CELL;return}break}case E.HEAD:{if(t>0){this.insertionMode=Y.IN_HEAD;return}break}}this.insertionMode=Y.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let a=t-1;a>0;a--){const r=this.openElements.tagIDs[a];if(r===E.TEMPLATE)break;if(r===E.TABLE){this.insertionMode=Y.IN_SELECT_IN_TABLE;return}}this.insertionMode=Y.IN_SELECT}_isElementCausesFosterParenting(t){return VT.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)===xe.HTML)return{parent:this.treeAdapter.getTemplateContent(a),beforeElement:null};break}case E.TABLE:{const r=this.treeAdapter.getParentNode(a);return r?{parent:r,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 r=this.treeAdapter.getNamespaceURI(t);return Pj[r].has(a)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){V9(this,t);return}switch(this.insertionMode){case Y.INITIAL:{so(this,t);break}case Y.BEFORE_HTML:{fo(this,t);break}case Y.BEFORE_HEAD:{mo(this,t);break}case Y.IN_HEAD:{ho(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{po(this,t);break}case Y.AFTER_HEAD:{go(this,t);break}case Y.IN_BODY:case Y.IN_CAPTION:case Y.IN_CELL:case Y.IN_TEMPLATE:{QT(this,t);break}case Y.TEXT:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case Y.IN_TABLE:case Y.IN_TABLE_BODY:case Y.IN_ROW:{Wm(this,t);break}case Y.IN_TABLE_TEXT:{n_(this,t);break}case Y.IN_COLUMN_GROUP:{Uc(this,t);break}case Y.AFTER_BODY:{Hc(this,t);break}case Y.AFTER_AFTER_BODY:{Nc(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){K9(this,t);return}switch(this.insertionMode){case Y.INITIAL:{so(this,t);break}case Y.BEFORE_HTML:{fo(this,t);break}case Y.BEFORE_HEAD:{mo(this,t);break}case Y.IN_HEAD:{ho(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{po(this,t);break}case Y.AFTER_HEAD:{go(this,t);break}case Y.TEXT:{this._insertCharacters(t);break}case Y.IN_TABLE:case Y.IN_TABLE_BODY:case Y.IN_ROW:{Wm(this,t);break}case Y.IN_COLUMN_GROUP:{Uc(this,t);break}case Y.AFTER_BODY:{Hc(this,t);break}case Y.AFTER_AFTER_BODY:{Nc(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){Ah(this,t);return}switch(this.insertionMode){case Y.INITIAL:case Y.BEFORE_HTML:case Y.BEFORE_HEAD:case Y.IN_HEAD:case Y.IN_HEAD_NO_SCRIPT:case Y.AFTER_HEAD:case Y.IN_BODY:case Y.IN_TABLE:case Y.IN_CAPTION:case Y.IN_COLUMN_GROUP:case Y.IN_TABLE_BODY:case Y.IN_ROW:case Y.IN_CELL:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:case Y.IN_TEMPLATE:case Y.IN_FRAMESET:case Y.AFTER_FRAMESET:{Ah(this,t);break}case Y.IN_TABLE_TEXT:{ro(this,t);break}case Y.AFTER_BODY:{S8(this,t);break}case Y.AFTER_AFTER_BODY:case Y.AFTER_AFTER_FRAMESET:{A8(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case Y.INITIAL:{C8(this,t);break}case Y.BEFORE_HEAD:case Y.IN_HEAD:case Y.IN_HEAD_NO_SCRIPT:case Y.AFTER_HEAD:{this._err(t,ce.misplacedDoctype);break}case Y.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,ce.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?X9(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case Y.INITIAL:{so(this,t);break}case Y.BEFORE_HTML:{w8(this,t);break}case Y.BEFORE_HEAD:{R8(this,t);break}case Y.IN_HEAD:{Fa(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{M8(this,t);break}case Y.AFTER_HEAD:{L8(this,t);break}case Y.IN_BODY:{Mn(this,t);break}case Y.IN_TABLE:{Vi(this,t);break}case Y.IN_TABLE_TEXT:{ro(this,t);break}case Y.IN_CAPTION:{O9(this,t);break}case Y.IN_COLUMN_GROUP:{Tp(this,t);break}case Y.IN_TABLE_BODY:{ld(this,t);break}case Y.IN_ROW:{od(this,t);break}case Y.IN_CELL:{D9(this,t);break}case Y.IN_SELECT:{r_(this,t);break}case Y.IN_SELECT_IN_TABLE:{j9(this,t);break}case Y.IN_TEMPLATE:{P9(this,t);break}case Y.AFTER_BODY:{H9(this,t);break}case Y.IN_FRAMESET:{F9(this,t);break}case Y.AFTER_FRAMESET:{$9(this,t);break}case Y.AFTER_AFTER_BODY:{Y9(this,t);break}case Y.AFTER_AFTER_FRAMESET:{G9(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?Q9(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case Y.INITIAL:{so(this,t);break}case Y.BEFORE_HTML:{k8(this,t);break}case Y.BEFORE_HEAD:{O8(this,t);break}case Y.IN_HEAD:{I8(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{D8(this,t);break}case Y.AFTER_HEAD:{j8(this,t);break}case Y.IN_BODY:{id(this,t);break}case Y.TEXT:{N9(this,t);break}case Y.IN_TABLE:{Ao(this,t);break}case Y.IN_TABLE_TEXT:{ro(this,t);break}case Y.IN_CAPTION:{I9(this,t);break}case Y.IN_COLUMN_GROUP:{M9(this,t);break}case Y.IN_TABLE_BODY:{Ch(this,t);break}case Y.IN_ROW:{s_(this,t);break}case Y.IN_CELL:{L9(this,t);break}case Y.IN_SELECT:{i_(this,t);break}case Y.IN_SELECT_IN_TABLE:{B9(this,t);break}case Y.IN_TEMPLATE:{U9(this,t);break}case Y.AFTER_BODY:{o_(this,t);break}case Y.IN_FRAMESET:{z9(this,t);break}case Y.AFTER_FRAMESET:{q9(this,t);break}case Y.AFTER_AFTER_BODY:{Nc(this,t);break}}}onEof(t){switch(this.insertionMode){case Y.INITIAL:{so(this,t);break}case Y.BEFORE_HTML:{fo(this,t);break}case Y.BEFORE_HEAD:{mo(this,t);break}case Y.IN_HEAD:{ho(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{po(this,t);break}case Y.AFTER_HEAD:{go(this,t);break}case Y.IN_BODY:case Y.IN_TABLE:case Y.IN_CAPTION:case Y.IN_COLUMN_GROUP:case Y.IN_TABLE_BODY:case Y.IN_ROW:case Y.IN_CELL:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:{e_(this,t);break}case Y.TEXT:{T9(this,t);break}case Y.IN_TABLE_TEXT:{ro(this,t);break}case Y.IN_TEMPLATE:{l_(this,t);break}case Y.AFTER_BODY:case Y.IN_FRAMESET:case Y.AFTER_FRAMESET:case Y.AFTER_AFTER_BODY:case Y.AFTER_AFTER_FRAMESET:{Np(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===B.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 Y.IN_HEAD:case Y.IN_HEAD_NO_SCRIPT:case Y.AFTER_HEAD:case Y.TEXT:case Y.IN_COLUMN_GROUP:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:case Y.IN_FRAMESET:case Y.AFTER_FRAMESET:{this._insertCharacters(t);break}case Y.IN_BODY:case Y.IN_CAPTION:case Y.IN_CELL:case Y.IN_TEMPLATE:case Y.AFTER_BODY:case Y.AFTER_AFTER_BODY:case Y.AFTER_AFTER_FRAMESET:{XT(this,t);break}case Y.IN_TABLE:case Y.IN_TABLE_BODY:case Y.IN_ROW:{Wm(this,t);break}case Y.IN_TABLE_TEXT:{t_(this,t);break}}}}function E8(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):JT(e,t),a}function y8(e,t){let a=null,r=e.openElements.stackTop;for(;r>=0;r--){const o=e.openElements.items[r];if(o===t.element)break;e._isSpecialElement(o,e.openElements.tagIDs[r])&&(a=o)}return a||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),a}function N8(e,t,a){let r=t,o=e.openElements.getCommonAncestor(t);for(let u=0,c=o;c!==a;u++,c=o){o=e.openElements.getCommonAncestor(c);const f=e.activeFormattingElements.getElementEntry(c),m=f&&u>=b8;!f||m?(m&&e.activeFormattingElements.removeEntry(f),e.openElements.remove(c)):(c=T8(e,f),r===t&&(e.activeFormattingElements.bookmark=f),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(c,r),r=c)}return r}function T8(e,t){const a=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,a,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function _8(e,t,a){const r=e.treeAdapter.getTagName(t),o=tl(r);if(e._isElementCausesFosterParenting(o))e._fosterParentElement(a);else{const u=e.treeAdapter.getNamespaceURI(t);o===E.TEMPLATE&&u===xe.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,a)}}function v8(e,t,a){const r=e.treeAdapter.getNamespaceURI(a.element),{token:o}=a,u=e.treeAdapter.createElement(o.tagName,r,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 yp(e,t){for(let a=0;a<g8;a++){const r=E8(e,t);if(!r)break;const o=y8(e,r);if(!o)break;e.activeFormattingElements.bookmark=r;const u=N8(e,o,r.element),c=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(u),c&&_8(e,c,u),v8(e,o,r)}}function Ah(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function S8(e,t){e._appendCommentNode(t,e.openElements.items[0])}function A8(e,t){e._appendCommentNode(t,e.document)}function Np(e,t){if(e.stopped=!0,t.location){const a=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=a;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],o=e.treeAdapter.getNodeSourceCodeLocation(r);if(o&&!o.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const u=e.openElements.items[1],c=e.treeAdapter.getNodeSourceCodeLocation(u);c&&!c.endTag&&e._setEndLocation(u,t)}}}}function C8(e,t){e._setDocumentType(t);const a=t.forceQuirks?Ra.QUIRKS:a8(t);n8(t)||e._err(t,ce.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,a),e.insertionMode=Y.BEFORE_HTML}function so(e,t){e._err(t,ce.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Ra.QUIRKS),e.insertionMode=Y.BEFORE_HTML,e._processToken(t)}function w8(e,t){t.tagID===E.HTML?(e._insertElement(t,xe.HTML),e.insertionMode=Y.BEFORE_HEAD):fo(e,t)}function k8(e,t){const a=t.tagID;(a===E.HTML||a===E.HEAD||a===E.BODY||a===E.BR)&&fo(e,t)}function fo(e,t){e._insertFakeRootElement(),e.insertionMode=Y.BEFORE_HEAD,e._processToken(t)}function R8(e,t){switch(t.tagID){case E.HTML:{Mn(e,t);break}case E.HEAD:{e._insertElement(t,xe.HTML),e.headElement=e.openElements.current,e.insertionMode=Y.IN_HEAD;break}default:mo(e,t)}}function O8(e,t){const a=t.tagID;a===E.HEAD||a===E.BODY||a===E.HTML||a===E.BR?mo(e,t):e._err(t,ce.endTagWithoutMatchingOpenElement)}function mo(e,t){e._insertFakeElement(ae.HEAD,E.HEAD),e.headElement=e.openElements.current,e.insertionMode=Y.IN_HEAD,e._processToken(t)}function Fa(e,t){switch(t.tagID){case E.HTML:{Mn(e,t);break}case E.BASE:case E.BASEFONT:case E.BGSOUND:case E.LINK:case E.META:{e._appendElement(t,xe.HTML),t.ackSelfClosing=!0;break}case E.TITLE:{e._switchToTextParsing(t,Wt.RCDATA);break}case E.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Wt.RAWTEXT):(e._insertElement(t,xe.HTML),e.insertionMode=Y.IN_HEAD_NO_SCRIPT);break}case E.NOFRAMES:case E.STYLE:{e._switchToTextParsing(t,Wt.RAWTEXT);break}case E.SCRIPT:{e._switchToTextParsing(t,Wt.SCRIPT_DATA);break}case E.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Y.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Y.IN_TEMPLATE);break}case E.HEAD:{e._err(t,ce.misplacedStartTagForHeadElement);break}default:ho(e,t)}}function I8(e,t){switch(t.tagID){case E.HEAD:{e.openElements.pop(),e.insertionMode=Y.AFTER_HEAD;break}case E.BODY:case E.BR:case E.HTML:{ho(e,t);break}case E.TEMPLATE:{Xr(e,t);break}default:e._err(t,ce.endTagWithoutMatchingOpenElement)}}function Xr(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==E.TEMPLATE&&e._err(t,ce.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(E.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,ce.endTagWithoutMatchingOpenElement)}function ho(e,t){e.openElements.pop(),e.insertionMode=Y.AFTER_HEAD,e._processToken(t)}function M8(e,t){switch(t.tagID){case E.HTML:{Mn(e,t);break}case E.BASEFONT:case E.BGSOUND:case E.HEAD:case E.LINK:case E.META:case E.NOFRAMES:case E.STYLE:{Fa(e,t);break}case E.NOSCRIPT:{e._err(t,ce.nestedNoscriptInHead);break}default:po(e,t)}}function D8(e,t){switch(t.tagID){case E.NOSCRIPT:{e.openElements.pop(),e.insertionMode=Y.IN_HEAD;break}case E.BR:{po(e,t);break}default:e._err(t,ce.endTagWithoutMatchingOpenElement)}}function po(e,t){const a=t.type===at.EOF?ce.openElementsLeftAfterEof:ce.disallowedContentInNoscriptInHead;e._err(t,a),e.openElements.pop(),e.insertionMode=Y.IN_HEAD,e._processToken(t)}function L8(e,t){switch(t.tagID){case E.HTML:{Mn(e,t);break}case E.BODY:{e._insertElement(t,xe.HTML),e.framesetOk=!1,e.insertionMode=Y.IN_BODY;break}case E.FRAMESET:{e._insertElement(t,xe.HTML),e.insertionMode=Y.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,ce.abandonedHeadElementChild),e.openElements.push(e.headElement,E.HEAD),Fa(e,t),e.openElements.remove(e.headElement);break}case E.HEAD:{e._err(t,ce.misplacedStartTagForHeadElement);break}default:go(e,t)}}function j8(e,t){switch(t.tagID){case E.BODY:case E.HTML:case E.BR:{go(e,t);break}case E.TEMPLATE:{Xr(e,t);break}default:e._err(t,ce.endTagWithoutMatchingOpenElement)}}function go(e,t){e._insertFakeElement(ae.BODY,E.BODY),e.insertionMode=Y.IN_BODY,rd(e,t)}function rd(e,t){switch(t.type){case at.CHARACTER:{QT(e,t);break}case at.WHITESPACE_CHARACTER:{XT(e,t);break}case at.COMMENT:{Ah(e,t);break}case at.START_TAG:{Mn(e,t);break}case at.END_TAG:{id(e,t);break}case at.EOF:{e_(e,t);break}}}function XT(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function QT(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function B8(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function P8(e,t){const a=e.openElements.tryPeekProperlyNestedBodyElement();a&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(a,t.attrs))}function U8(e,t){const a=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&a&&(e.treeAdapter.detachNode(a),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,xe.HTML),e.insertionMode=Y.IN_FRAMESET)}function H8(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,xe.HTML)}function F8(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Sh.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,xe.HTML)}function z8(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,xe.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function $8(e,t){const a=e.openElements.tmplCount>0;(!e.formElement||a)&&(e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,xe.HTML),a||(e.formElement=e.openElements.current))}function q8(e,t){e.framesetOk=!1;const a=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const o=e.openElements.tagIDs[r];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[r],o))break}e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,xe.HTML)}function Y8(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,xe.HTML),e.tokenizer.state=Wt.PLAINTEXT}function G8(e,t){e.openElements.hasInScope(E.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(E.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML),e.framesetOk=!1}function K8(e,t){const a=e.activeFormattingElements.getElementEntryInScopeWithTagName(ae.A);a&&(yp(e,t),e.openElements.remove(a.element),e.activeFormattingElements.removeEntry(a)),e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function V8(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function X8(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(E.NOBR)&&(yp(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,xe.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Q8(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function W8(e,t){e.treeAdapter.getDocumentMode(e.document)!==Ra.QUIRKS&&e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,xe.HTML),e.framesetOk=!1,e.insertionMode=Y.IN_TABLE}function WT(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,xe.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function ZT(e){const t=HT(e,Hr.TYPE);return t!=null&&t.toLowerCase()===p8}function Z8(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,xe.HTML),ZT(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function J8(e,t){e._appendElement(t,xe.HTML),t.ackSelfClosing=!0}function e9(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._appendElement(t,xe.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function t9(e,t){t.tagName=ae.IMG,t.tagID=E.IMG,WT(e,t)}function n9(e,t){e._insertElement(t,xe.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Wt.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Y.TEXT}function a9(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Wt.RAWTEXT)}function s9(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Wt.RAWTEXT)}function OE(e,t){e._switchToTextParsing(t,Wt.RAWTEXT)}function r9(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Y.IN_TABLE||e.insertionMode===Y.IN_CAPTION||e.insertionMode===Y.IN_TABLE_BODY||e.insertionMode===Y.IN_ROW||e.insertionMode===Y.IN_CELL?Y.IN_SELECT_IN_TABLE:Y.IN_SELECT}function i9(e,t){e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML)}function l9(e,t){e.openElements.hasInScope(E.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,xe.HTML)}function o9(e,t){e.openElements.hasInScope(E.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(E.RTC),e._insertElement(t,xe.HTML)}function u9(e,t){e._reconstructActiveFormattingElements(),GT(t),Ep(t),t.selfClosing?e._appendElement(t,xe.MATHML):e._insertElement(t,xe.MATHML),t.ackSelfClosing=!0}function c9(e,t){e._reconstructActiveFormattingElements(),KT(t),Ep(t),t.selfClosing?e._appendElement(t,xe.SVG):e._insertElement(t,xe.SVG),t.ackSelfClosing=!0}function IE(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML)}function Mn(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:{V8(e,t);break}case E.A:{K8(e,t);break}case E.H1:case E.H2:case E.H3:case E.H4:case E.H5:case E.H6:{F8(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:{H8(e,t);break}case E.LI:case E.DD:case E.DT:{q8(e,t);break}case E.BR:case E.IMG:case E.WBR:case E.AREA:case E.EMBED:case E.KEYGEN:{WT(e,t);break}case E.HR:{e9(e,t);break}case E.RB:case E.RTC:{l9(e,t);break}case E.RT:case E.RP:{o9(e,t);break}case E.PRE:case E.LISTING:{z8(e,t);break}case E.XMP:{a9(e,t);break}case E.SVG:{c9(e,t);break}case E.HTML:{B8(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:{Fa(e,t);break}case E.BODY:{P8(e,t);break}case E.FORM:{$8(e,t);break}case E.NOBR:{X8(e,t);break}case E.MATH:{u9(e,t);break}case E.TABLE:{W8(e,t);break}case E.INPUT:{Z8(e,t);break}case E.PARAM:case E.TRACK:case E.SOURCE:{J8(e,t);break}case E.IMAGE:{t9(e,t);break}case E.BUTTON:{G8(e,t);break}case E.APPLET:case E.OBJECT:case E.MARQUEE:{Q8(e,t);break}case E.IFRAME:{s9(e,t);break}case E.SELECT:{r9(e,t);break}case E.OPTION:case E.OPTGROUP:{i9(e,t);break}case E.NOEMBED:case E.NOFRAMES:{OE(e,t);break}case E.FRAMESET:{U8(e,t);break}case E.TEXTAREA:{n9(e,t);break}case E.NOSCRIPT:{e.options.scriptingEnabled?OE(e,t):IE(e,t);break}case E.PLAINTEXT:{Y8(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:IE(e,t)}}function d9(e,t){if(e.openElements.hasInScope(E.BODY)&&(e.insertionMode=Y.AFTER_BODY,e.options.sourceCodeLocationInfo)){const a=e.openElements.tryPeekProperlyNestedBodyElement();a&&e._setEndLocation(a,t)}}function f9(e,t){e.openElements.hasInScope(E.BODY)&&(e.insertionMode=Y.AFTER_BODY,o_(e,t))}function m9(e,t){const a=t.tagID;e.openElements.hasInScope(a)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(a))}function h9(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 p9(e){e.openElements.hasInButtonScope(E.P)||e._insertFakeElement(ae.P,E.P),e._closePElement()}function g9(e){e.openElements.hasInListItemScope(E.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(E.LI),e.openElements.popUntilTagNamePopped(E.LI))}function b9(e,t){const a=t.tagID;e.openElements.hasInScope(a)&&(e.openElements.generateImpliedEndTagsWithExclusion(a),e.openElements.popUntilTagNamePopped(a))}function x9(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function E9(e,t){const a=t.tagID;e.openElements.hasInScope(a)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(a),e.activeFormattingElements.clearToLastMarker())}function y9(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(ae.BR,E.BR),e.openElements.pop(),e.framesetOk=!1}function JT(e,t){const a=t.tagName,r=t.tagID;for(let o=e.openElements.stackTop;o>0;o--){const u=e.openElements.items[o],c=e.openElements.tagIDs[o];if(r===c&&(r!==E.UNKNOWN||e.treeAdapter.getTagName(u)===a)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=o&&e.openElements.shortenToLength(o);break}if(e._isSpecialElement(u,c))break}}function id(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:{yp(e,t);break}case E.P:{p9(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:{m9(e,t);break}case E.LI:{g9(e);break}case E.DD:case E.DT:{b9(e,t);break}case E.H1:case E.H2:case E.H3:case E.H4:case E.H5:case E.H6:{x9(e);break}case E.BR:{y9(e);break}case E.BODY:{d9(e,t);break}case E.HTML:{f9(e,t);break}case E.FORM:{h9(e);break}case E.APPLET:case E.OBJECT:case E.MARQUEE:{E9(e,t);break}case E.TEMPLATE:{Xr(e,t);break}default:JT(e,t)}}function e_(e,t){e.tmplInsertionModeStack.length>0?l_(e,t):Np(e,t)}function N9(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 T9(e,t){e._err(t,ce.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Wm(e,t){if(e.openElements.currentTagId!==void 0&&VT.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Y.IN_TABLE_TEXT,t.type){case at.CHARACTER:{n_(e,t);break}case at.WHITESPACE_CHARACTER:{t_(e,t);break}}else Uo(e,t)}function _9(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,xe.HTML),e.insertionMode=Y.IN_CAPTION}function v9(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,xe.HTML),e.insertionMode=Y.IN_COLUMN_GROUP}function S9(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ae.COLGROUP,E.COLGROUP),e.insertionMode=Y.IN_COLUMN_GROUP,Tp(e,t)}function A9(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,xe.HTML),e.insertionMode=Y.IN_TABLE_BODY}function C9(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ae.TBODY,E.TBODY),e.insertionMode=Y.IN_TABLE_BODY,ld(e,t)}function w9(e,t){e.openElements.hasInTableScope(E.TABLE)&&(e.openElements.popUntilTagNamePopped(E.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function k9(e,t){ZT(t)?e._appendElement(t,xe.HTML):Uo(e,t),t.ackSelfClosing=!0}function R9(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,xe.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Vi(e,t){switch(t.tagID){case E.TD:case E.TH:case E.TR:{C9(e,t);break}case E.STYLE:case E.SCRIPT:case E.TEMPLATE:{Fa(e,t);break}case E.COL:{S9(e,t);break}case E.FORM:{R9(e,t);break}case E.TABLE:{w9(e,t);break}case E.TBODY:case E.TFOOT:case E.THEAD:{A9(e,t);break}case E.INPUT:{k9(e,t);break}case E.CAPTION:{_9(e,t);break}case E.COLGROUP:{v9(e,t);break}default:Uo(e,t)}}function Ao(e,t){switch(t.tagID){case E.TABLE:{e.openElements.hasInTableScope(E.TABLE)&&(e.openElements.popUntilTagNamePopped(E.TABLE),e._resetInsertionMode());break}case E.TEMPLATE:{Xr(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:Uo(e,t)}}function Uo(e,t){const a=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,rd(e,t),e.fosterParentingEnabled=a}function t_(e,t){e.pendingCharacterTokens.push(t)}function n_(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++)Uo(e,e.pendingCharacterTokens[a]);else for(;a<e.pendingCharacterTokens.length;a++)e._insertCharacters(e.pendingCharacterTokens[a]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const a_=new Set([E.CAPTION,E.COL,E.COLGROUP,E.TBODY,E.TD,E.TFOOT,E.TH,E.THEAD,E.TR]);function O9(e,t){const a=t.tagID;a_.has(a)?e.openElements.hasInTableScope(E.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(E.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Y.IN_TABLE,Vi(e,t)):Mn(e,t)}function I9(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=Y.IN_TABLE,a===E.TABLE&&Ao(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:id(e,t)}}function Tp(e,t){switch(t.tagID){case E.HTML:{Mn(e,t);break}case E.COL:{e._appendElement(t,xe.HTML),t.ackSelfClosing=!0;break}case E.TEMPLATE:{Fa(e,t);break}default:Uc(e,t)}}function M9(e,t){switch(t.tagID){case E.COLGROUP:{e.openElements.currentTagId===E.COLGROUP&&(e.openElements.pop(),e.insertionMode=Y.IN_TABLE);break}case E.TEMPLATE:{Xr(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=Y.IN_TABLE,e._processToken(t))}function ld(e,t){switch(t.tagID){case E.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,xe.HTML),e.insertionMode=Y.IN_ROW;break}case E.TH:case E.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(ae.TR,E.TR),e.insertionMode=Y.IN_ROW,od(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=Y.IN_TABLE,Vi(e,t));break}default:Vi(e,t)}}function Ch(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=Y.IN_TABLE);break}case E.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE,Ao(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:Ao(e,t)}}function od(e,t){switch(t.tagID){case E.TH:case E.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,xe.HTML),e.insertionMode=Y.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=Y.IN_TABLE_BODY,ld(e,t));break}default:Vi(e,t)}}function s_(e,t){switch(t.tagID){case E.TR:{e.openElements.hasInTableScope(E.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE_BODY);break}case E.TABLE:{e.openElements.hasInTableScope(E.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE_BODY,Ch(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=Y.IN_TABLE_BODY,Ch(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:Ao(e,t)}}function D9(e,t){const a=t.tagID;a_.has(a)?(e.openElements.hasInTableScope(E.TD)||e.openElements.hasInTableScope(E.TH))&&(e._closeTableCell(),od(e,t)):Mn(e,t)}function L9(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=Y.IN_ROW);break}case E.TABLE:case E.TBODY:case E.TFOOT:case E.THEAD:case E.TR:{e.openElements.hasInTableScope(a)&&(e._closeTableCell(),s_(e,t));break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:break;default:id(e,t)}}function r_(e,t){switch(t.tagID){case E.HTML:{Mn(e,t);break}case E.OPTION:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e._insertElement(t,xe.HTML);break}case E.OPTGROUP:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e.openElements.currentTagId===E.OPTGROUP&&e.openElements.pop(),e._insertElement(t,xe.HTML);break}case E.HR:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e.openElements.currentTagId===E.OPTGROUP&&e.openElements.pop(),e._appendElement(t,xe.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:{Fa(e,t);break}}}function i_(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:{Xr(e,t);break}}}function j9(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)):r_(e,t)}function B9(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)):i_(e,t)}function P9(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:{Fa(e,t);break}case E.CAPTION:case E.COLGROUP:case E.TBODY:case E.TFOOT:case E.THEAD:{e.tmplInsertionModeStack[0]=Y.IN_TABLE,e.insertionMode=Y.IN_TABLE,Vi(e,t);break}case E.COL:{e.tmplInsertionModeStack[0]=Y.IN_COLUMN_GROUP,e.insertionMode=Y.IN_COLUMN_GROUP,Tp(e,t);break}case E.TR:{e.tmplInsertionModeStack[0]=Y.IN_TABLE_BODY,e.insertionMode=Y.IN_TABLE_BODY,ld(e,t);break}case E.TD:case E.TH:{e.tmplInsertionModeStack[0]=Y.IN_ROW,e.insertionMode=Y.IN_ROW,od(e,t);break}default:e.tmplInsertionModeStack[0]=Y.IN_BODY,e.insertionMode=Y.IN_BODY,Mn(e,t)}}function U9(e,t){t.tagID===E.TEMPLATE&&Xr(e,t)}function l_(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(E.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Np(e,t)}function H9(e,t){t.tagID===E.HTML?Mn(e,t):Hc(e,t)}function o_(e,t){var a;if(t.tagID===E.HTML){if(e.fragmentContext||(e.insertionMode=Y.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===E.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((a=e.treeAdapter.getNodeSourceCodeLocation(r))===null||a===void 0)&&a.endTag)&&e._setEndLocation(r,t)}}else Hc(e,t)}function Hc(e,t){e.insertionMode=Y.IN_BODY,rd(e,t)}function F9(e,t){switch(t.tagID){case E.HTML:{Mn(e,t);break}case E.FRAMESET:{e._insertElement(t,xe.HTML);break}case E.FRAME:{e._appendElement(t,xe.HTML),t.ackSelfClosing=!0;break}case E.NOFRAMES:{Fa(e,t);break}}}function z9(e,t){t.tagID===E.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==E.FRAMESET&&(e.insertionMode=Y.AFTER_FRAMESET))}function $9(e,t){switch(t.tagID){case E.HTML:{Mn(e,t);break}case E.NOFRAMES:{Fa(e,t);break}}}function q9(e,t){t.tagID===E.HTML&&(e.insertionMode=Y.AFTER_AFTER_FRAMESET)}function Y9(e,t){t.tagID===E.HTML?Mn(e,t):Nc(e,t)}function Nc(e,t){e.insertionMode=Y.IN_BODY,rd(e,t)}function G9(e,t){switch(t.tagID){case E.HTML:{Mn(e,t);break}case E.NOFRAMES:{Fa(e,t);break}}}function K9(e,t){t.chars=Ut,e._insertCharacters(t)}function V9(e,t){e._insertCharacters(t),e.framesetOk=!1}function u_(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==xe.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function X9(e,t){if(c8(t))u_(e),e._startTagOutsideForeignContent(t);else{const a=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(a);r===xe.MATHML?GT(t):r===xe.SVG&&(d8(t),KT(t)),Ep(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function Q9(e,t){if(t.tagID===E.P||t.tagID===E.BR){u_(e),e._endTagOutsideForeignContent(t);return}for(let a=e.openElements.stackTop;a>0;a--){const r=e.openElements.items[a];if(e.treeAdapter.getNamespaceURI(r)===xe.HTML){e._endTagOutsideForeignContent(t);break}const o=e.treeAdapter.getTagName(r);if(o.toLowerCase()===t.tagName){t.tagName=o,e.openElements.shortenToLength(a);break}}}ae.AREA,ae.BASE,ae.BASEFONT,ae.BGSOUND,ae.BR,ae.COL,ae.EMBED,ae.FRAME,ae.HR,ae.IMG,ae.INPUT,ae.KEYGEN,ae.LINK,ae.META,ae.PARAM,ae.SOURCE,ae.TRACK,ae.WBR;const W9=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,Z9=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),ME={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function c_(e,t){const a=oB(e),r=DN("type",{handlers:{root:J9,element:eB,text:tB,comment:f_,doctype:nB,raw:sB},unknown:rB}),o={parser:a?new RE(ME):RE.getFragmentParser(void 0,ME),handle(f){r(f,o)},stitches:!1,options:t||{}};r(e,o),nl(o,ts());const u=a?o.parser.document:o.parser.getFragment(),c=uj(u,{file:o.options.file});return o.stitches&&jo(c,"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}}),c.type==="root"&&c.children.length===1&&c.children[0].type===e.type?c.children[0]:c}function d_(e,t){let a=-1;if(e)for(;++a<e.length;)t.handle(e[a])}function J9(e,t){d_(e.children,t)}function eB(e,t){iB(e,t),d_(e.children,t),lB(e,t)}function tB(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const a={type:at.CHARACTER,chars:e.value,location:Ho(e)};nl(t,ts(e)),t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken)}function nB(e,t){const a={type:at.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Ho(e)};nl(t,ts(e)),t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken)}function aB(e,t){t.stitches=!0;const a=uB(e);if("children"in e&&"children"in a){const r=c_({type:"root",children:e.children},t.options);a.children=r.children}f_({type:"comment",value:{stitch:a}},t)}function f_(e,t){const a=e.value,r={type:at.COMMENT,data:a,location:Ho(e)};nl(t,ts(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function sB(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,m_(t,ts(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(W9,"&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 rB(e,t){const a=e;if(t.options.passThrough&&t.options.passThrough.includes(a.type))aB(a,t);else{let r="";throw Z9.has(a.type)&&(r=". 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"+r)}}function nl(e,t){m_(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=Wt.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 m_(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 iB(e,t){const a=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Wt.PLAINTEXT)return;nl(t,ts(e));const r=t.parser.openElements.current;let o="namespaceURI"in r?r.namespaceURI:Br.html;o===Br.html&&a==="svg"&&(o=Br.svg);const u=hj({...e,children:[]},{space:o===Br.svg?"svg":"html"}),c={type:at.START_TAG,tagName:a,tagID:tl(a),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in u?u.attrs:[],location:Ho(e)};t.parser.currentToken=c,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=a}function lB(e,t){const a=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Tj.includes(a)||t.parser.tokenizer.state===Wt.PLAINTEXT)return;nl(t,Jc(e));const r={type:at.END_TAG,tagName:a,tagID:tl(a),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Ho(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),a===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Wt.RCDATA||t.parser.tokenizer.state===Wt.RAWTEXT||t.parser.tokenizer.state===Wt.SCRIPT_DATA)&&(t.parser.tokenizer.state=Wt.DATA)}function oB(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Ho(e){const t=ts(e)||{line:void 0,column:void 0,offset:void 0},a=Jc(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 uB(e){return"children"in e?qi({...e,children:[]}):qi(e)}function Fc(e){return function(t,a){return c_(t,{...e,file:a})}}const cB=2e3;function h_({repoId:e,startPolish:t,fetchResult:a,loadExisting:r,cleanup:o}){const u=vn(),c=je(zn),[f,m]=T.useState("idle"),[h,b]=T.useState(null),[g,y]=T.useState(null),[N,v]=T.useState(!1),A=T.useRef(null),C=T.useCallback(()=>{A.current&&(clearInterval(A.current),A.current=null)},[]);T.useEffect(()=>()=>C(),[C]),T.useEffect(()=>{if(!e||!r)return;let j=!1;return r().then(I=>{!j&&I&&(b(I),m("preview"))}).catch(()=>{}),()=>{j=!0}},[e]);const S=T.useCallback(async()=>{if(!(!e||f==="polishing")){m("polishing");try{const{sessionId:j}=await t();y(j),A.current=setInterval(async()=>{try{if((await V5(e,j)).type==="idle"){C();const U=await a();b(U),m("preview")}}catch{C(),m("idle"),Qt.getState().addToast("润色状态检查失败","error")}},cB)}catch(j){m("idle"),Qt.getState().addToast(j instanceof Error?j.message:"润色启动失败","error")}}},[e,f,t,a,C]),M=T.useCallback(()=>{C(),o==null||o().catch(()=>{}),b(null),y(null),m("idle")},[C,o]),O=T.useCallback(()=>{!g||!c||(Re.setState({activeSessionId:g}),u(`/${encodeURIComponent(c)}/run`))},[g,c,u]);return{phase:f,result:h,sessionId:g,busy:N,setBusy:v,polish:S,discard:M,escalate:O,setResult:b,setPhase:m}}function dB({repoId:e,issueNumber:t,onPublished:a}){const[r,o]=T.useState(""),[u,c]=T.useState(!1),f=T.useRef(null),m=T.useCallback(()=>yC(e,t,r.trim()),[e,t,r]),h=T.useCallback(()=>Mx(e,t).then(I=>I.body),[e,t]),b=T.useCallback(()=>Mx(e,t).then(I=>I.body||null),[e,t]),{phase:g,result:y,busy:N,setBusy:v,polish:A,discard:C,escalate:S,setResult:M}=h_({repoId:e,startPolish:m,fetchResult:h,loadExisting:b});T.useEffect(()=>{if(!u)return;const I=U=>{f.current&&!f.current.contains(U.target)&&c(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[u]);const O=async()=>{if(!(!r.trim()||N)){v(!0);try{const I=await Ix(e,t,r.trim());a(I),o(""),Qt.getState().addToast("评论已发布","success")}catch(I){Qt.getState().addToast(I instanceof Error?I.message:"发布失败","error")}finally{v(!1)}}},j=async()=>{if(!(!(y!=null&&y.trim())||N)){v(!0);try{const I=await Ix(e,t,y.trim());a(I),o(""),C(),Qt.getState().addToast("评论已发布","success")}catch(I){Qt.getState().addToast(I instanceof Error?I.message:"发布失败","error")}finally{v(!1)}}};return g==="preview"?i.jsxs("div",{className:"mt-8 border-t border-line pt-6",children:[i.jsxs("h3",{className:"mb-3 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-fg-4",children:[i.jsx(Hi,{className:"h-3.5 w-3.5 text-amber-400"}),"AI 润色结果"]}),i.jsx("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-4 py-3",children:i.jsx("textarea",{value:y??"",onChange:I=>M(I.target.value),rows:6,className:"w-full resize-none bg-transparent text-sm text-fg placeholder:text-fg-6 focus:outline-none"})}),i.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[i.jsxs("button",{type:"button",disabled:N,onClick:()=>void j(),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:[i.jsx(Eo,{className:"h-3.5 w-3.5"}),"发布评论"]}),i.jsx("button",{type:"button",onClick:C,className:"ml-auto rounded-md px-2.5 py-1.5 text-xs text-fg-5 transition-colors hover:text-fg-3",children:"放弃"}),i.jsxs("div",{className:"relative",ref:f,children:[i.jsx("button",{type:"button",onClick:()=>c(!u),className:"flex h-7 w-7 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:i.jsx(Fh,{className:"h-3.5 w-3.5"})}),u&&i.jsxs("div",{className:"absolute right-0 bottom-full z-20 mb-1 min-w-[140px] overflow-hidden rounded-lg border border-line bg-elevated shadow-lg",children:[i.jsxs("button",{type:"button",onClick:()=>{c(!1),A()},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",children:[i.jsx(Hi,{className:"h-3 w-3"}),"重新润色"]}),i.jsx("button",{type:"button",onClick:()=>{c(!1),S()},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",children:"转入深度对话"})]})]})]})]}):i.jsxs("div",{className:"mt-8 border-t border-line pt-6",children:[i.jsx("h3",{className:"mb-3 text-xs font-semibold uppercase tracking-wider text-fg-4",children:"添加评论"}),i.jsx("textarea",{value:r,onChange:I=>o(I.target.value),placeholder:"写下你的评论...",rows:4,disabled:g==="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"}),i.jsxs("div",{className:"mt-2.5 flex items-center gap-2",children:[i.jsxs("button",{type:"button",disabled:!r.trim()||N||g==="polishing",onClick:()=>void O(),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:[i.jsx(Eo,{className:"h-3.5 w-3.5"}),N?"发送中...":"直接发送"]}),i.jsxs("button",{type:"button",disabled:!r.trim()||g==="polishing",onClick:()=>void A(),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:[i.jsx(Hi,{className:"h-3.5 w-3.5"}),g==="polishing"?"润色中...":"AI 润色"]})]})]})}function _p(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 p_(e){const t=new Date(e);return t.toLocaleDateString("zh-CN",{month:"short",day:"numeric"})+" "+t.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"})}function g_(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 fB(e){return e==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"}function b_({issue:e,milestone:t,onBack:a,onClose:r,onToggleSidebar:o}){var C;const u=vn(),c=je(S=>S.activeRepoId),f=je(zn),[m,h]=T.useState([]),[b,g]=T.useState(!1),[y,N]=T.useState(!1),v=Ve(S=>S.updateIssueState);T.useEffect(()=>{c&&(g(!0),EC(c,e.number).then(h).catch(()=>h([])).finally(()=>g(!1)))},[c,e.number]);const A=()=>{Ve.getState().setSelectedIssue(e.id),Re.setState({activeSessionId:null}),u(`/${encodeURIComponent(f)}/run`)};return i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[i.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:[i.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[i.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:i.jsx(Hh,{className:"h-5 w-5"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[i.jsxs("span",{className:ne("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]}),(C=e.labels)==null?void 0:C.map(S=>i.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${S.color}20`,color:`#${S.color}`},children:S.name},S.id)),t&&i.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:[i.jsx($h,{className:"h-2.5 w-2.5"}),t.title]})]}),i.jsx("h2",{className:"mt-1 text-base font-semibold text-fg",children:e.title}),(e.authorLogin||e.assignees&&e.assignees.length>0)&&i.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 text-xs text-fg-4",children:[e.authorLogin&&i.jsxs("span",{className:"flex items-center gap-1.5",children:[e.authorAvatar&&i.jsx("img",{src:e.authorAvatar,alt:"",className:"h-4 w-4 rounded-full"}),e.authorLogin]}),e.assignees&&e.assignees.length>0&&i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"text-fg-5",children:"→"}),i.jsx("span",{className:"flex items-center -space-x-1",children:e.assignees.map(S=>i.jsx("img",{src:S.avatar_url,alt:S.login,title:S.login,className:"h-4 w-4 rounded-full ring-1 ring-surface"},S.login))}),i.jsx("span",{className:"text-fg-4",children:e.assignees.map(S=>S.login).join(", ")})]})]})]})]}),i.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:[e.htmlUrl&&i.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:[i.jsx(Ny,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"hidden sm:inline",children:"源站"})]}),i.jsxs("button",{type:"button",onClick:()=>{Ve.getState().enterMatchMode(e.id),Re.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:[i.jsx(ko,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"hidden sm:inline",children:"匹配子任务"})]}),i.jsx("button",{type:"button",disabled:y,onClick:async()=>{N(!0),await v(e.number,e.state==="open"?"closed":"open"),N(!1)},className:ne("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"?i.jsxs(i.Fragment,{children:[i.jsx(Ey,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"hidden sm:inline",children:"关闭"})]}):i.jsxs(i.Fragment,{children:[i.jsx(Yr,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"hidden sm:inline",children:"重新打开"})]})}),i.jsxs("button",{type:"button",onClick:A,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:[i.jsx(Kh,{className:"h-3.5 w-3.5 fill-current"}),i.jsx("span",{className:"hidden sm:inline",children:"新建任务"})]}),o&&i.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:i.jsx(Ty,{className:"h-4 w-4"})}),r&&i.jsx("button",{type:"button",onClick:r,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:i.jsx(gt,{className:"h-4 w-4"})})]})]}),i.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-6 md:px-6",children:[e.body?i.jsx("div",{className:"markdown-body leading-relaxed",children:i.jsx(Yi,{remarkPlugins:[Gi],rehypePlugins:[Fc],children:e.body})}):i.jsx("p",{className:"py-10 text-center font-mono text-xs text-fg-5",children:"该 Issue 没有描述内容"}),b?i.jsx("p",{className:"mt-8 text-center font-mono text-xs text-fg-6",children:"加载评论…"}):m.length>0&&i.jsxs("div",{className:"mt-8 border-t border-line pt-6",children:[i.jsxs("h3",{className:"mb-4 text-xs font-semibold uppercase tracking-wider text-fg-4",children:["评论 (",m.length,")"]}),i.jsx("div",{className:"space-y-4",children:m.map(S=>i.jsxs("div",{className:"rounded-lg border border-line bg-elevated/40 px-4 py-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("img",{src:S.user.avatar_url,alt:S.user.login,className:"h-5 w-5 rounded-full"}),i.jsx("span",{className:"text-xs font-semibold text-fg-2",children:S.user.login}),i.jsx("span",{className:"text-[10px] text-fg-6",children:p_(S.created_at)})]}),i.jsx("div",{className:"markdown-body mt-2 text-sm leading-relaxed text-fg-3",children:i.jsx(Yi,{remarkPlugins:[Gi],rehypePlugins:[Fc],children:S.body})})]},S.id))})]}),c&&i.jsx(dB,{repoId:c,issueNumber:e.number,onPublished:S=>h(M=>[...M,S])},e.id)]})})]})}function x_({pr:e,onBack:t,onClose:a,onEnterMatch:r,onNavigateToIssue:o}){var U;const u=je($=>$.activeRepoId),c=je(zn),[f,m]=T.useState(!1),[h,b]=T.useState([]),[g,y]=T.useState(!1),[N,v]=T.useState([]),[A,C]=T.useState(!1),S=vn(),M=mn($=>$.unlinkIssue);T.useEffect(()=>{u&&(y(!0),xC(u,e.number).then(b).catch(()=>b([])).finally(()=>y(!1)))},[u,e.number]),T.useEffect(()=>{u&&Qh(u,e.number).then(v).catch(()=>v([]))},[u,e.number]);const O=async $=>{if(!(f||!u)){m(!0);try{if(await pC(u,e.number),$&&N.length>0){const Z=N.filter(K=>K.state==="open");await Promise.all(Z.map(K=>By(u,K.number,{state:"closed"}))),v(K=>K.map(D=>D.state==="open"?{...D,state:"closed"}:D)),Ve.getState().loadIssues(),Qt.getState().addToast(`PR #${e.number} 合入成功,已关闭 ${Z.length} 个 Issue`,"success")}else Qt.getState().addToast(`PR #${e.number} 合入成功`,"success");mn.getState().loadPulls()}catch(Z){let K="合入失败";if(Z instanceof Ss)try{K=JSON.parse(Z.message).error??K}catch{K=Z.message}Qt.getState().addToast(K,"error")}finally{m(!1)}}},j=async $=>{await M(e.number,$)&&v(K=>K.filter(D=>D.number!==$))},I=()=>{const $=`请解决 PR #${e.number} 的合并冲突: ${e.title}`;Re.setState({activeSessionId:null}),S(`/${encodeURIComponent(c)}/run?draft=${encodeURIComponent($)}`)};return i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[i.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:[i.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[i.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:i.jsx(Hh,{className:"h-5 w-5"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[i.jsxs("span",{className:ne("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",g_(e.state)),children:["#",e.number," ",e.state]}),e.draft===1&&i.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"&&i.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"}),(U=e.labels)==null?void 0:U.map($=>i.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${$.color}20`,color:`#${$.color}`},children:$.name},$.id))]}),i.jsx("h2",{className:"mt-1 text-base font-semibold text-fg",children:e.title}),i.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 text-xs text-fg-4",children:[i.jsxs("span",{className:"flex min-w-0 items-center gap-1 font-mono text-[11px] text-fg-5",children:[i.jsx(Fr,{className:"h-3.5 w-3.5 shrink-0"}),i.jsxs("span",{className:"truncate",children:[e.headBranch," → ",e.baseBranch]})]}),e.authorLogin&&i.jsxs("span",{className:"flex items-center gap-1.5",children:[e.authorAvatar&&i.jsx("img",{src:e.authorAvatar,alt:"",className:"h-4 w-4 rounded-full"}),e.authorLogin]}),e.mergedAt&&i.jsxs("span",{className:"text-purple-400",children:["合并于 ",_p(e.mergedAt)]})]})]})]}),i.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:[e.htmlUrl&&i.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:[i.jsx(Ny,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"hidden sm:inline",children:"源站"})]}),i.jsxs("button",{type:"button",onClick:r,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:[i.jsx(qh,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"hidden sm:inline",children:"关联 Issue"})]}),e.state==="open"&&i.jsxs(i.Fragment,{children:[e.mergeable==="false"&&i.jsxs("button",{type:"button",onClick:I,className:"flex h-8 items-center gap-1.5 rounded-md border border-amber-500/30 px-2.5 text-xs font-medium text-amber-400 transition-colors hover:border-amber-500/60 hover:bg-amber-500/10",children:[i.jsx(E5,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"hidden sm:inline",children:"解冲突"})]}),i.jsxs("button",{type:"button",disabled:f||e.mergeable==="false",onClick:()=>void O(!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:[i.jsx(Ex,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"hidden sm:inline",children:"合入"})]}),N.some($=>$.state==="open")&&i.jsxs("button",{type:"button",disabled:f||e.mergeable==="false",onClick:()=>void O(!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:[i.jsx(Ex,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"hidden sm:inline",children:"合入并关闭 Issues"})]})]}),a&&i.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:i.jsx(gt,{className:"h-4 w-4"})})]})]}),i.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-6 md:px-6",children:[N.length>0&&i.jsxs("div",{className:"mb-6 rounded-lg border border-line bg-elevated/30 px-4 py-3",children:[i.jsxs("h3",{className:"mb-2 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-fg-4",children:[i.jsx(Yr,{className:"h-3.5 w-3.5"}),"关联 Issues (",N.length,")"]}),i.jsx("div",{className:"space-y-1.5",children:N.map($=>i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{type:"button",onClick:()=>o==null?void 0:o($.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:[i.jsxs("span",{className:ne("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-medium",$.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",$.number]}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-left text-sm text-fg-2",children:$.title})]}),i.jsx("button",{type:"button",onClick:()=>void j($.number),title:"取消关联",className:"shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:bg-red-500/10 hover:text-red-400",children:i.jsx(Ey,{className:"h-3.5 w-3.5"})})]},$.id))})]}),(e.commitCount!=null||e.additions!=null)&&i.jsxs("div",{className:"mb-6 rounded-lg border border-line bg-elevated/30 px-4 py-3",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-fg-3",children:[e.commitCount!=null&&i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(y3,{className:"h-3.5 w-3.5 text-fg-5"}),i.jsx("span",{className:"font-medium",children:e.commitCount})," 次提交"]}),e.changedFilesCount!=null&&i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(zh,{className:"h-3.5 w-3.5 text-fg-5"}),i.jsx("span",{className:"font-medium",children:e.changedFilesCount})," 个文件"]}),e.additions!=null&&i.jsxs("span",{className:"flex items-center gap-1 text-emerald-400",children:[i.jsx(Ia,{className:"h-3 w-3"}),i.jsx("span",{className:"font-mono font-medium",children:e.additions})]}),e.deletions!=null&&i.jsxs("span",{className:"flex items-center gap-1 text-red-400",children:[i.jsx(F3,{className:"h-3 w-3"}),i.jsx("span",{className:"font-mono font-medium",children:e.deletions})]})]}),e.diffStats&&e.diffStats.length>0&&i.jsxs("div",{className:"mt-3 border-t border-line pt-3",children:[i.jsxs("button",{type:"button",onClick:()=>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:[A?i.jsx(ba,{className:"h-3.5 w-3.5"}):i.jsx(Kc,{className:"h-3.5 w-3.5"}),"变更文件 (",e.diffStats.length,")"]}),A&&i.jsx("div",{className:"mt-2 space-y-0.5",children:e.diffStats.map($=>i.jsxs("div",{className:"flex items-center gap-2 rounded px-2 py-1 text-xs hover:bg-elevated/50",children:[i.jsx("span",{className:ne("w-14 shrink-0 rounded px-1 py-0.5 text-center font-mono text-[10px] font-medium",$.status==="added"?"bg-emerald-500/15 text-emerald-400":$.status==="removed"?"bg-red-500/15 text-red-400":"bg-blue-500/15 text-blue-400"),children:$.status==="added"?"新增":$.status==="removed"?"删除":$.status==="renamed"?"重命名":"修改"}),i.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-fg-3",title:$.filename,children:$.filename}),i.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-emerald-400",children:["+",$.additions]}),i.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-red-400",children:["-",$.deletions]})]},$.filename))})]})]}),e.body?i.jsx("div",{className:"markdown-body leading-relaxed",children:i.jsx(Yi,{remarkPlugins:[Gi],rehypePlugins:[Fc],children:e.body})}):i.jsx("p",{className:"py-10 text-center font-mono text-xs text-fg-5",children:"该 PR 没有描述内容"}),g?i.jsx("p",{className:"mt-8 text-center font-mono text-xs text-fg-6",children:"加载评论…"}):h.length>0&&i.jsxs("div",{className:"mt-8 border-t border-line pt-6",children:[i.jsxs("h3",{className:"mb-4 text-xs font-semibold uppercase tracking-wider text-fg-4",children:["评论 (",h.length,")"]}),i.jsx("div",{className:"space-y-4",children:h.map($=>i.jsxs("div",{className:"rounded-lg border border-line bg-elevated/40 px-4 py-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("img",{src:$.user.avatar_url,alt:$.user.login,className:"h-5 w-5 rounded-full"}),i.jsx("span",{className:"text-xs font-semibold text-fg-2",children:$.user.login}),i.jsx("span",{className:"text-[10px] text-fg-6",children:p_($.created_at)})]}),i.jsx("div",{className:"markdown-body mt-2 text-sm leading-relaxed text-fg-3",children:i.jsx(Yi,{remarkPlugins:[Gi],rehypePlugins:[Fc],children:$.body})})]},$.id))})]})]})})]})}function mB({prs:e,onSelect:t}){return e.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-fg-5",children:[i.jsx(Fr,{className:"h-8 w-8"}),i.jsx("p",{className:"font-mono text-xs",children:"该 Issue 没有关联的 PR"})]}):i.jsx("ul",{className:"space-y-2",children:e.map(a=>{var r;return i.jsx("li",{children:i.jsxs("button",{type:"button",onClick:()=>t(a.number),className:"group flex w-full flex-col gap-1.5 rounded-lg border border-line bg-elevated/30 px-4 py-3 text-left transition-colors hover:border-blue-500/40 hover:bg-elevated/60",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:ne("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",g_(a.state)),children:["#",a.number," ",a.state]}),a.mergeable===!1&&i.jsxs("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-semibold bg-red-500/15 text-red-400",children:[i.jsx(Tn,{className:"inline h-3 w-3 -mt-px"})," Conflict"]}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-fg-2 group-hover:text-fg",children:a.title})]}),i.jsx("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-fg-5",children:((r=a.user)==null?void 0:r.login)&&i.jsxs("span",{className:"flex items-center gap-1",children:[a.user.avatar_url&&i.jsx("img",{src:a.user.avatar_url,alt:"",className:"h-3.5 w-3.5 rounded-full"}),a.user.login]})})]})},a.number)})})}function hB({issue:e,milestone:t,tab:a,prNumber:r,onTabChange:o,onSelectPr:u,onBackToPrList:c,onBack:f,onClose:m,onToggleSidebar:h}){const b=je(O=>O.activeRepoId),g=mn(O=>O.enterMatchMode),[y,N]=T.useState([]),[v,A]=T.useState(null),[C,S]=T.useState(!1);T.useEffect(()=>{if(!b){N([]);return}fC(b,e.number).then(N).catch(()=>N([]))},[b,e.number]),T.useEffect(()=>{if(!b||r==null){A(null);return}let O=!1;return S(!0),hC(b,r).then(j=>{O||A(j)}).catch(()=>{O||A(null)}).finally(()=>{O||S(!1)}),()=>{O=!0}},[b,r]);const M=y.some(O=>O.mergeable===!1);return i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[y.length>0&&i.jsxs("div",{className:"flex shrink-0 items-center border-b border-line bg-surface",children:[i.jsxs("button",{type:"button",onClick:()=>o("issue"),className:ne("flex items-center gap-1.5 border-b-2 px-4 py-2.5 text-xs font-medium transition-colors",a==="issue"?"border-blue-500 text-fg":"border-transparent text-fg-4 hover:text-fg-2"),children:[i.jsx(Yr,{className:"h-3.5 w-3.5"}),"Issue"]}),i.jsxs("button",{type:"button",onClick:()=>o("pr"),className:ne("flex items-center gap-1.5 border-b-2 px-4 py-2.5 text-xs font-medium transition-colors",a==="pr"?"border-blue-500 text-fg":"border-transparent text-fg-4 hover:text-fg-2"),children:[i.jsx(Fr,{className:"h-3.5 w-3.5"}),"PR",i.jsx("span",{className:ne("rounded-full px-1.5 py-0.5 font-mono text-[10px]",a==="pr"?"bg-blue-500/10 text-blue-500":"bg-elevated text-fg-5"),children:y.length}),M&&i.jsxs("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-semibold bg-red-500/15 text-red-400",children:[i.jsx(Tn,{className:"inline h-3 w-3 -mt-px"})," Conflict"]})]})]}),a==="issue"||y.length===0?i.jsx(b_,{issue:e,milestone:t,onBack:f,onClose:m,onToggleSidebar:h}):r!=null?v?i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[i.jsx("div",{className:"flex shrink-0 items-center border-b border-line bg-elevated/30 px-4 py-2",children:i.jsxs("button",{type:"button",onClick:c,className:"flex items-center gap-1 rounded-md px-2 py-1 text-xs text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:[i.jsx(xo,{className:"h-3.5 w-3.5"}),"返回列表"]})}),i.jsx(x_,{pr:v,onBack:c,onEnterMatch:()=>g(v.id)})]}):i.jsx("div",{className:"flex flex-1 items-center justify-center",children:i.jsx("p",{className:"font-mono text-xs text-fg-5",children:C?"加载 PR…":"PR 未找到"})}):i.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i.jsx("div",{className:"mx-auto max-w-3xl px-4 py-6 md:px-6",children:i.jsx(mB,{prs:y,onSelect:u})})})]})}function DE({onDone:e}){const[t,a]=T.useState(""),[r,o]=T.useState(""),[u,c]=T.useState(!1),f=T.useRef(null),m=Ve(K=>K.createIssue),h=je(K=>K.activeRepoId),b=T.useCallback(()=>NC(h,t.trim(),r.trim()||void 0),[h,t,r]),g=T.useCallback(()=>Dx(h),[h]),y=T.useCallback(()=>Dx(h).then(K=>K.title?K:null),[h]),N=T.useCallback(()=>TC(h),[h]),{phase:v,result:A,busy:C,setBusy:S,polish:M,discard:O,escalate:j,setResult:I}=h_({repoId:h,startPolish:b,fetchResult:g,loadExisting:y,cleanup:N});T.useEffect(()=>{if(!u)return;const K=D=>{f.current&&!f.current.contains(D.target)&&c(!1)};return document.addEventListener("mousedown",K),()=>document.removeEventListener("mousedown",K)},[u]);const U=async()=>{!t.trim()||C||(S(!0),await m(t.trim(),r.trim()||void 0),S(!1),e())},$=async()=>{!(A!=null&&A.title.trim())||C||(S(!0),await m(A.title.trim(),A.body.trim()||void 0),S(!1),O(),e())},Z=K=>{(K.metaKey||K.ctrlKey)&&K.key==="Enter"&&(K.preventDefault(),U())};return v==="preview"&&A?i.jsxs("div",{className:"border-b border-line px-3 py-3",children:[i.jsxs("h4",{className:"mb-2 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-fg-4",children:[i.jsx(Hi,{className:"h-3.5 w-3.5 text-amber-400"}),"AI 润色结果"]}),i.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-3 py-2.5",children:[i.jsx("input",{type:"text",value:A.title,onChange:K=>I({...A,title:K.target.value}),className:"w-full bg-transparent text-xs font-medium text-fg placeholder:text-fg-6 focus:outline-none",placeholder:"润色后标题"}),i.jsx("textarea",{value:A.body,onChange:K=>I({...A,body:K.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:"润色后描述"})]}),i.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[i.jsxs("button",{type:"button",disabled:!A.title.trim()||C,onClick:()=>void $(),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:[i.jsx(Ia,{className:"h-3.5 w-3.5"}),"创建 Issue"]}),i.jsx("button",{type:"button",onClick:O,className:"ml-auto rounded-md px-2.5 py-1 text-xs text-fg-5 transition-colors hover:text-fg-3",children:"放弃"}),i.jsxs("div",{className:"relative",ref:f,children:[i.jsx("button",{type:"button",onClick:()=>c(!u),className:"flex h-6 w-6 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:i.jsx(Fh,{className:"h-3.5 w-3.5"})}),u&&i.jsxs("div",{className:"absolute right-0 bottom-full z-20 mb-1 min-w-[140px] overflow-hidden rounded-lg border border-line bg-elevated shadow-lg",children:[i.jsxs("button",{type:"button",onClick:()=>{c(!1),M()},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",children:[i.jsx(Hi,{className:"h-3 w-3"}),"重新润色"]}),i.jsx("button",{type:"button",onClick:()=>{c(!1),j()},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",children:"转入深度对话"})]})]})]})]}):i.jsxs("div",{className:"border-b border-line px-3 py-3",children:[i.jsx("input",{type:"text",value:t,onChange:K=>a(K.target.value),onKeyDown:Z,placeholder:"Issue 标题",autoFocus:!0,disabled:v==="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"}),i.jsx("textarea",{value:r,onChange:K=>o(K.target.value),onKeyDown:Z,placeholder:"描述(可选) ⌘⏎ 创建",rows:3,disabled:v==="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"}),i.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2",children:[i.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:"取消"}),i.jsxs("button",{type:"button",disabled:!t.trim()||v==="polishing",onClick:()=>void M(),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:[i.jsx(Hi,{className:"h-3.5 w-3.5"}),v==="polishing"?"润色中...":"AI 润色"]}),i.jsx("button",{type:"button",onClick:()=>void U(),disabled:!t.trim()||C||v==="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 LE({issue:e,sessionCount:t,isActive:a,isEpic:r,milestone:o,onSelect:u}){return i.jsx("li",{children:i.jsxs("button",{type:"button",onClick:u,className:ne("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:[i.jsx("span",{className:ne("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}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[r&&i.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"}),i.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&&i.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:e.labels.map(c=>i.jsx("span",{className:"rounded px-1 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${c.color}20`,color:`#${c.color}`},children:c.name},c.id))}),o&&i.jsxs("span",{className:"mt-1 flex items-center gap-1 text-[10px] text-indigo-400/70",children:[i.jsx($h,{className:"h-2.5 w-2.5"}),o.title]})]}),t>0&&i.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 pB({issue:e,sessionCount:t,isEpic:a,milestone:r,onSelect:o}){return i.jsx("li",{children:i.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:[i.jsx("span",{className:ne("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}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[a&&i.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"}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-fg-2 group-hover:text-fg",children:e.title}),r&&i.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:[i.jsx($h,{className:"h-2.5 w-2.5"}),r.title]}),t>0&&i.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&&i.jsxs("div",{className:"hidden shrink-0 items-center -space-x-1.5 sm:flex",children:[e.assignees.slice(0,3).map(u=>i.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&&i.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]})]})]}),i.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1",children:[e.authorLogin&&i.jsxs("span",{className:"shrink-0 text-[11px] text-fg-5",title:e.authorLogin,children:[e.authorAvatar&&i.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&&i.jsx("span",{className:"text-fg-6",children:"·"}),i.jsx("span",{className:"shrink-0 text-[11px] text-fg-6",children:_p(e.createdAt)}),(e.commentCount??0)>0&&i.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 text-[11px] text-fg-6",children:[i.jsx("span",{className:"text-fg-6",children:"·"}),i.jsx(L3,{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&&i.jsx("span",{className:"text-fg-6",children:"·"}),e.labels&&e.labels.length>0?e.labels.map(u=>i.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:i.jsx("span",{className:"text-[11px] text-fg-6",children:" "})]})]})]})})}function gB(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,r=new Date(a);return r.toDateString()===new Date().toDateString()?r.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):r.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function jE({session:e,onSelect:t}){var r,o;const a=gB(e);return i.jsx("li",{children:i.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:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"min-w-0 truncate font-mono text-xs text-fg-3",children:((r=e.agent)==null?void 0:r.trim())||"默认"}),a&&i.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] tabular-nums text-fg-5",children:a})]}),i.jsx("div",{className:"mt-0.5 truncate text-sm text-fg-2",children:((o=e.title)==null?void 0:o.trim())||"未命名运行"})]})})}function E_({sessions:e,onSelect:t}){const a=Ve(c=>c.issues),r=new Map(a.map(c=>[c.id,c])),o=new Map,u=[];for(const c of e)if(c.issueId&&r.has(c.issueId)){const f=o.get(c.issueId)??[];f.push(c),o.set(c.issueId,f)}else u.push(c);return i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col border-t border-line",children:[i.jsxs("div",{className:"flex items-center gap-1.5 border-b border-line px-3 py-3",children:[i.jsx(vA,{className:"h-3.5 w-3.5 text-fg-5"}),i.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-fg-4",children:"运行记录"}),i.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})]}),i.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:e.length===0?i.jsx("p",{className:"px-2 py-4 text-center font-mono text-[10px] text-fg-6",children:"暂无运行记录"}):i.jsxs("div",{className:"space-y-3",children:[[...o.entries()].map(([c,f])=>{const m=r.get(c);return i.jsxs("div",{children:[i.jsxs("div",{className:"mb-1 flex items-center gap-1.5 px-1",children:[i.jsxs("span",{className:ne("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]}),i.jsx("span",{className:"min-w-0 truncate text-xs font-medium text-fg-3",children:m.title})]}),i.jsx("ul",{className:"space-y-0.5",children:f.map(h=>i.jsx(jE,{session:h,onSelect:()=>t(h.id)},h.id))})]},c)}),u.length>0&&i.jsxs("div",{children:[o.size>0&&i.jsx("div",{className:"mb-1 px-1",children:i.jsx("span",{className:"text-xs font-medium text-fg-5",children:"未关联 Issue"})}),i.jsx("ul",{className:"space-y-0.5",children:u.map(c=>i.jsx(jE,{session:c,onSelect:()=>t(c.id)},c.id))})]})]})})]})}function bB({sessions:e,onSessionSelect:t}){return i.jsx("div",{className:"flex w-full flex-col",children:i.jsx(E_,{sessions:e,onSelect:t})})}function y_({issue:e,childrenMap:t,currentId:a,onSelect:r,depth:o}){const u=t.get(e.id)??[],c=e.id===a;return i.jsxs("div",{children:[i.jsxs("button",{type:"button",onClick:()=>r(e.id),className:ne("group flex w-full items-center gap-1.5 rounded-md px-2 py-1.5 text-left text-xs transition-colors",c?"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:[i.jsx("span",{className:ne("h-1.5 w-1.5 shrink-0 rounded-full",e.state==="open"?"bg-emerald-400":"bg-purple-400")}),i.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-fg-6",children:["#",e.number]}),i.jsx("span",{className:"min-w-0 truncate",children:e.title})]}),u.length>0&&i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"absolute top-0 bottom-3 w-px bg-line",style:{left:`${o*18+16}px`}}),u.map(f=>i.jsx(y_,{issue:f,childrenMap:t,currentId:a,onSelect:r,depth:o+1},f.id))]})]})}function xB(e,t){let a=0,r=0;const o=[...t.get(e)??[]];for(let u=0;u<o.length;u++){const c=o[u];a++,c.state==="closed"&&r++;const f=t.get(c.id);f&&o.push(...f)}return{total:a,closed:r}}function EB({rootIssue:e,childrenMap:t,currentId:a,onSelect:r,sessions:o,onSessionSelect:u}){const{total:c,closed:f}=xB(e.id,t),m=c===0?0:Math.round(f/c*100);return i.jsxs("div",{className:"flex w-full flex-col",children:[i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[i.jsxs("div",{className:"flex items-center gap-1.5 border-b border-line px-3 py-3",children:[i.jsx(K3,{className:"h-3.5 w-3.5 text-fg-5"}),i.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-fg-4",children:"子任务树"})]}),c>0&&i.jsxs("div",{className:"border-b border-line px-3 py-2",children:[i.jsx("div",{className:"h-1 overflow-hidden rounded-full bg-elevated",children:i.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-emerald-400 to-blue-500 transition-all",style:{width:`${m}%`}})}),i.jsxs("p",{className:"mt-1 font-mono text-[10px] text-fg-6",children:[f," / ",c," completed"]})]}),i.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:i.jsx(y_,{issue:e,childrenMap:t,currentId:a,onSelect:r,depth:0})})]}),i.jsx(E_,{sessions:o,onSelect:u})]})}const N_=[{key:"open",label:"开放"},{key:"closed",label:"已关闭"},{key:"all",label:"全部"}];function yB({stateFilter:e,setStateFilter:t,typeFilter:a,setTypeFilter:r,searchQuery:o,setSearchQuery:u,expandedFilter:c,setExpandedFilter:f,selectedAuthor:m,setSelectedAuthor:h,selectedAssignee:b,setSelectedAssignee:g,creating:y,setCreating:N,openCount:v,closedCount:A,totalCount:C,epicCount:S,taskCount:M,strayCount:O,afterStateCount:j,uniqueAuthors:I,uniqueAssignees:U}){const $=Ve(k=>k.syncing),Z=Ve(k=>k.syncIssues),K=Ve(k=>k.tags),D=Ve(k=>k.tagFilterMode),te=Ve(k=>k.cycleTagFilter),le=Ve(k=>k.clearTagFilter),pe=Ve(k=>k.milestones),Q=Ve(k=>k.selectedMilestoneId),q=Ve(k=>k.setMilestoneFilter),F=je(k=>k.activeRepoId);return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-2 border-b border-line px-4 py-2.5",children:[i.jsx("span",{className:"shrink-0 text-sm font-semibold text-fg md:order-1",children:"Issues"}),F&&i.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1 md:order-last md:ml-0",children:[i.jsx("button",{type:"button",onClick:()=>void Z(),disabled:$,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:i.jsx(zr,{className:ne("h-3.5 w-3.5",$&&"animate-spin")})}),i.jsx("button",{type:"button",onClick:()=>N(!y),title:"新建 Issue",className:ne("flex h-8 w-8 items-center justify-center rounded-md transition-colors",y?"bg-blue-600 text-white":"text-fg-4 hover:bg-elevated hover:text-fg-2"),children:i.jsx(Ia,{className:"h-3.5 w-3.5"})})]}),i.jsx("div",{className:"w-full md:order-2 md:w-auto",children:i.jsx("div",{className:"flex shrink-0 items-center rounded-lg bg-elevated/60 p-0.5",children:N_.map(({key:k,label:P})=>{const J=k==="open"?v:k==="closed"?A:C;return i.jsxs("button",{type:"button",onClick:()=>t(k),className:ne("flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",e===k?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-2"),children:[P,i.jsx("span",{className:ne("rounded-full px-1.5 py-0.5 font-mono text-[10px]",e===k?"bg-blue-500/10 text-blue-500":"text-fg-5"),children:J})]},k)})})}),i.jsx("div",{className:"w-full md:order-5 md:w-auto md:min-w-0 md:flex-1 md:px-1",children:i.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2.5 py-1.5",children:[i.jsx(Pr,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),i.jsx("input",{type:"text",value:o,onChange:k=>u(k.target.value),placeholder:"搜索 issue...",className:"min-w-0 flex-1 bg-transparent text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),o&&i.jsx("button",{type:"button",onClick:()=>u(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:i.jsx(gt,{className:"h-3 w-3"})})]})}),i.jsx("div",{className:"hidden md:order-3 md:mx-1 md:block md:h-4 md:w-px md:shrink-0 md:bg-line"}),i.jsxs("div",{className:"flex w-full gap-2 overflow-x-auto scrollbar-none md:order-4 md:w-auto md:overflow-visible",children:[i.jsxs("button",{type:"button",onClick:()=>f(c==="type"?null:"type"),className:ne("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",c==="type"?"bg-elevated text-fg":a!=="all"?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["类型",a!=="all"&&i.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"?"任务":"游离"}),i.jsx(ba,{className:ne("h-3 w-3 transition-transform",c==="type"&&"rotate-180")})]}),i.jsxs("button",{type:"button",onClick:()=>f(c==="tag"?null:"tag"),className:ne("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",c==="tag"?"bg-elevated text-fg":D.size>0?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["标签",D.size>0&&i.jsx("span",{className:"rounded-full bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:D.size}),i.jsx(ba,{className:ne("h-3 w-3 transition-transform",c==="tag"&&"rotate-180")})]}),i.jsxs("button",{type:"button",onClick:()=>f(c==="milestone"?null:"milestone"),className:ne("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",c==="milestone"?"bg-elevated text-fg":Q?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["Milestone",Q&&(()=>{const k=pe.find(P=>P.id===Q);return k?i.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:k.title}):null})(),i.jsx(ba,{className:ne("h-3 w-3 transition-transform",c==="milestone"&&"rotate-180")})]}),i.jsxs("button",{type:"button",onClick:()=>f(c==="author"?null:"author"),className:ne("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",c==="author"?"bg-elevated text-fg":m?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["Author",m&&i.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:m}),i.jsx(ba,{className:ne("h-3 w-3 transition-transform",c==="author"&&"rotate-180")})]}),i.jsxs("button",{type:"button",onClick:()=>f(c==="assignee"?null:"assignee"),className:ne("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",c==="assignee"?"bg-elevated text-fg":b?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["Assignee",b&&i.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:b}),i.jsx(ba,{className:ne("h-3 w-3 transition-transform",c==="assignee"&&"rotate-180")})]})]})]}),c==="type"&&i.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(k=>{const P=k==="epic"?"Epic":k==="stray"?"游离":k==="task"?"任务":"全部",J=k==="epic"?S:k==="stray"?O:k==="task"?M:j,w=a===k;return i.jsxs("button",{type:"button",onClick:()=>r(w&&k!=="all"?"all":k),className:ne("flex shrink-0 items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-semibold transition-colors",w?k==="epic"?"bg-amber-400/15 text-amber-400":k==="stray"?"bg-sky-400/15 text-sky-400":k==="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:[P,i.jsx("span",{className:ne("rounded-full px-1.5 py-0.5 font-mono text-[10px] font-medium",w?"opacity-70":"text-fg-6"),children:J})]},k)})}),c==="tag"&&i.jsx("div",{className:"flex items-center gap-2 overflow-x-auto border-b border-line px-4 py-2",style:{scrollbarWidth:"none"},children:K.length===0?i.jsx("span",{className:"text-xs text-fg-5",children:"暂无标签"}):i.jsxs(i.Fragment,{children:[K.map(k=>{const P=D.get(k.id);return i.jsxs("button",{type:"button",onClick:()=>te(k.id),className:ne("shrink-0 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",P==="include"?"ring-1 ring-current shadow-sm":P==="exclude"?"opacity-90 line-through decoration-2":"opacity-50 hover:opacity-80"),style:P==="exclude"?{backgroundColor:`#${k.color}10`,color:`#${k.color}`,boxShadow:`inset 0 0 0 1px color-mix(in srgb, #${k.color} 30%, transparent)`}:{backgroundColor:`#${k.color}18`,color:`#${k.color}`,boxShadow:P==="include"?`inset 0 0 0 1px color-mix(in srgb, #${k.color} 50%, transparent)`:void 0},children:[P==="exclude"&&i.jsx("span",{className:"mr-1 text-[10px]",children:"✕"}),k.name]},k.id)}),D.size>0&&i.jsx("button",{type:"button",onClick:le,className:"shrink-0 rounded-md px-2 py-1 text-[10px] text-fg-5 transition-colors hover:bg-elevated hover:text-fg-3",children:"清除"})]})}),c==="milestone"&&i.jsx("div",{className:"flex items-center gap-2 overflow-x-auto border-b border-line px-4 py-2",style:{scrollbarWidth:"none"},children:pe.length===0?i.jsx("span",{className:"text-xs text-fg-5",children:"暂无里程碑"}):i.jsxs(i.Fragment,{children:[pe.map(k=>{const P=Q===k.id;return i.jsxs("button",{type:"button",onClick:()=>q(P?null:k.id),className:ne("shrink-0 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",P?"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:[k.title,k.state==="closed"&&i.jsx("span",{className:"ml-1 text-[10px] opacity-60",children:"✓"})]},k.id)}),Q&&i.jsx("button",{type:"button",onClick:()=>q(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:"清除"})]})}),c==="author"&&i.jsx("div",{className:"flex items-center gap-2 overflow-x-auto border-b border-line px-4 py-2",style:{scrollbarWidth:"none"},children:I.length===0?i.jsx("span",{className:"text-xs text-fg-5",children:"同步后可见作者"}):i.jsxs(i.Fragment,{children:[I.map(k=>i.jsxs("button",{type:"button",onClick:()=>h(m===k.login?null:k.login),className:ne("flex shrink-0 items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",m===k.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:[k.avatar&&i.jsx("img",{src:k.avatar,alt:"",className:"h-4 w-4 rounded-full"}),k.login]},k.login)),m&&i.jsx("button",{type:"button",onClick:()=>h(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:"清除"})]})}),c==="assignee"&&i.jsx("div",{className:"flex items-center gap-2 overflow-x-auto border-b border-line px-4 py-2",style:{scrollbarWidth:"none"},children:U.length===0?i.jsx("span",{className:"text-xs text-fg-5",children:"同步后可见指派人"}):i.jsxs(i.Fragment,{children:[U.map(k=>i.jsxs("button",{type:"button",onClick:()=>g(b===k.login?null:k.login),className:ne("flex shrink-0 items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",b===k.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:[k.avatar&&i.jsx("img",{src:k.avatar,alt:"",className:"h-4 w-4 rounded-full"}),k.login]},k.login)),b&&i.jsx("button",{type:"button",onClick:()=>g(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:"清除"})]})})]})}function NB(){const[e,t]=T.useState("open"),[a,r]=T.useState("stray"),[o,u]=T.useState(!1),[c,f]=T.useState(""),m=Ve(be=>be.viewingTreeRootId),h=Ve(be=>be.setViewingIssue),[b,g]=T.useState(!1),[y,N]=T.useState(!1),[v,A]=T.useState(null),[C,S]=T.useState(null),[M,O]=T.useState(null),[j,I]=Uh(),U=Ve(be=>be.issues),$=Ve(be=>be.syncing),Z=Ve(be=>be.syncIssues),K=Ve(be=>be.tags),D=Ve(be=>be.tagFilterMode),te=Ve(be=>be.loadTags),le=Ve(be=>be.milestones),pe=Ve(be=>be.selectedMilestoneId),Q=Ve(be=>be.loadMilestones),q=je(be=>be.activeRepoId),F=je(zn),k=Re(be=>be.sessions),P=vn(),J=j.get("id"),w=j.get("tab")==="pr"?"pr":"issue",H=j.get("prId"),se=H?Number.parseInt(H,10):null;T.useEffect(()=>{const be=j.get("issueId");if(!be)return;const ct=new URLSearchParams(j);ct.delete("issueId"),ct.set("id",be),I(ct,{replace:!0})},[j,I]),T.useEffect(()=>{if(j.get("id"))return;const be=Ve.getState().viewingIssueId;be&&I({id:be},{replace:!0})},[]);const L=T.useCallback(be=>{I({id:be},{replace:!1})},[I]),Ne=T.useCallback(()=>{I({},{replace:!1}),h(null)},[I,h]),Te=T.useCallback(be=>{if(!J)return;const ct={id:J};be==="pr"&&(ct.tab="pr"),I(ct,{replace:!1})},[J,I]),V=T.useCallback(be=>{J&&I({id:J,tab:"pr",prId:String(be)},{replace:!1})},[J,I]),ve=T.useCallback(()=>{J&&I({id:J,tab:"pr"},{replace:!1})},[J,I]);T.useEffect(()=>{q&&(te(),Q())},[q,te,Q]);const{childrenMap:Be,issueType:Ue,milestoneMap:xt,finalFiltered:un,counts:cn,uniqueAuthors:za,uniqueAssignees:Dn}=ZL({issues:U,tags:K,milestones:le,tagFilterMode:D,stateFilter:e,typeFilter:a,searchQuery:c,selectedMilestoneId:pe,selectedAuthor:C,selectedAssignee:M}),$n=T.useMemo(()=>{const be=new Map;for(const ct of k)ct.issueId&&!ct.parentID&&be.set(ct.issueId,(be.get(ct.issueId)??0)+1);return be},[k]),et=U.find(be=>be.id===J)??null,qn=T.useMemo(()=>{if(!J)return[];const be=new Set([J]);if(m){be.add(m);const ct=[...Be.get(m)??[]];for(let ia=0;ia<ct.length;ia++){be.add(ct[ia].id);const It=Be.get(ct[ia].id);It&&ct.push(...It)}}return k.filter(ct=>ct.issueId&&be.has(ct.issueId)&&!ct.parentID)},[J,m,Be,k]),Ln=T.useCallback(be=>{Re.setState({activeSessionId:be}),P(`/${encodeURIComponent(F)}/run`)},[P,F]),Yn=T.useCallback((be,ct)=>{L(be),h(be,ct==="epic"?be:null)},[L,h]),Da=IT({onSwipeRight:()=>N(!0),onSwipeLeft:()=>g(!0),disabled:!J||y||b});return i.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 overflow-hidden",...Da,children:[i.jsxs("div",{className:ne("shrink-0 flex-col bg-surface",J?"hidden md:flex md:w-80 border-r border-line":"flex w-full"),children:[J?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-3",children:[i.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-fg-3",children:"Issues"}),q&&i.jsx("div",{className:"flex items-center gap-1",children:i.jsx("button",{type:"button",onClick:()=>void Z(),disabled:$,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:i.jsx(zr,{className:ne("h-3.5 w-3.5",$&&"animate-spin")})})})]}),o&&i.jsx(DE,{onDone:()=>u(!1)}),i.jsx("div",{className:"flex border-b border-line",children:N_.map(({key:be,label:ct})=>{const ia=be==="open"?cn.open:be==="closed"?cn.closed:U.length;return i.jsxs("button",{type:"button",onClick:()=>t(be),className:ne("flex flex-1 items-center justify-center gap-1.5 py-2 text-xs font-medium transition-colors",e===be?"border-b-2 border-blue-500 text-blue-500":"text-fg-4 hover:text-fg-2"),children:[ct,i.jsx("span",{className:ne("rounded-full px-1.5 py-0.5 font-mono text-[10px]",e===be?"bg-blue-500/10 text-blue-500":"bg-elevated text-fg-5"),children:ia})]},be)})}),i.jsx("div",{className:"border-b border-line px-3 py-2",children:i.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2 py-1",children:[i.jsx(Pr,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),i.jsx("input",{type:"text",value:c,onChange:be=>f(be.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"}),c&&i.jsx("button",{type:"button",onClick:()=>f(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:i.jsx(gt,{className:"h-3 w-3"})})]})})]}):i.jsxs(i.Fragment,{children:[i.jsx(yB,{stateFilter:e,setStateFilter:t,typeFilter:a,setTypeFilter:r,searchQuery:c,setSearchQuery:f,expandedFilter:v,setExpandedFilter:A,selectedAuthor:C,setSelectedAuthor:S,selectedAssignee:M,setSelectedAssignee:O,creating:o,setCreating:u,openCount:cn.open,closedCount:cn.closed,totalCount:U.length,epicCount:cn.epic,taskCount:cn.task,strayCount:cn.stray,afterStateCount:cn.afterState,uniqueAuthors:za,uniqueAssignees:Dn}),o&&i.jsx(DE,{onDone:()=>u(!1)})]}),i.jsx("div",{className:ne("flex-1 overflow-y-auto",J?"px-2 py-2":"px-3 py-3"),children:q?un.length===0?i.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:U.length===0?"点击 ↻ 同步 Issues":"无匹配 Issue"}):i.jsx("ul",{className:ne(J?"space-y-0.5":"space-y-1"),children:un.map(be=>J?i.jsx(LE,{issue:be,sessionCount:$n.get(be.id)??0,isActive:J===be.id,isEpic:Ue(be)==="epic",milestone:be.milestoneId?xt.get(be.milestoneId):void 0,onSelect:()=>Yn(be.id,Ue(be))},be.id):i.jsx(pB,{issue:be,sessionCount:$n.get(be.id)??0,isEpic:Ue(be)==="epic",milestone:be.milestoneId?xt.get(be.milestoneId):void 0,onSelect:()=>Yn(be.id,Ue(be))},be.id))}):i.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:"请先选择一个仓库"})})]}),J&&i.jsx(Nh,{side:"left",open:y,onClose:()=>N(!1),children:i.jsxs("div",{className:"flex h-full flex-col",children:[i.jsx("div",{className:"border-b border-line px-3 py-3",children:i.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-fg-3",children:"Issues"})}),i.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:un.length===0?i.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:"无匹配 Issue"}):i.jsx("ul",{className:"space-y-0.5",children:un.map(be=>i.jsx(LE,{issue:be,sessionCount:$n.get(be.id)??0,isActive:J===be.id,isEpic:Ue(be)==="epic",milestone:be.milestoneId?xt.get(be.milestoneId):void 0,onSelect:()=>{Yn(be.id,Ue(be)),N(!1)}},be.id))})})]})}),J&&i.jsx("div",{className:"relative flex min-w-0 flex-1 flex-col bg-term",children:et?i.jsxs(i.Fragment,{children:[i.jsx(hB,{issue:et,milestone:et.milestoneId?xt.get(et.milestoneId):void 0,tab:w,prNumber:se,onTabChange:Te,onSelectPr:V,onBackToPrList:ve,onBack:()=>{Ne(),g(!1)},onClose:()=>{Ne(),g(!1)},onToggleSidebar:()=>g(be=>!be)}),b&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"absolute inset-0 z-10 bg-black/30",onClick:()=>g(!1)}),i.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:[i.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-line px-3 py-2.5",children:[i.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-fg-4",children:m?"子任务树 & 运行记录":"运行记录"}),i.jsx("button",{type:"button",onClick:()=>g(!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:i.jsx(gt,{className:"h-4 w-4"})})]}),i.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:m?(()=>{const be=U.find(ct=>ct.id===m);return be?i.jsx(EB,{rootIssue:be,childrenMap:Be,currentId:J,onSelect:ct=>{L(ct),h(ct,m),g(!1)},sessions:qn,onSessionSelect:Ln}):null})():i.jsx(bB,{sessions:qn,onSessionSelect:Ln})})]})]})]}):i.jsx("div",{className:"flex flex-1 items-center justify-center",children:i.jsx("p",{className:"font-mono text-xs text-fg-5",children:"Issue 未找到"})})})]})}function TB({issues:e,onSelect:t}){const a=Re(o=>o.sessions),r=new Map;for(const o of a)o.issueId&&!o.parentID&&r.set(o.issueId,(r.get(o.issueId)??0)+1);return e.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-fg-5",children:[i.jsx(Yr,{className:"h-8 w-8"}),i.jsx("p",{className:"font-mono text-xs",children:"该 PR 没有关联的 Issue"})]}):i.jsx("ul",{className:"space-y-2",children:e.map(o=>{const u=r.get(o.id)??0;return i.jsx("li",{children:i.jsxs("button",{type:"button",onClick:()=>t(o.id),className:"group flex w-full flex-col gap-1.5 rounded-lg border border-line bg-elevated/30 px-4 py-3 text-left transition-colors hover:border-blue-500/40 hover:bg-elevated/60",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:ne("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",fB(o.state)),children:["#",o.number," ",o.state]}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-fg-2 group-hover:text-fg",children:o.title}),u>0&&i.jsxs("span",{className:"shrink-0 rounded-full bg-elevated px-2 py-0.5 font-mono text-[10px] text-fg-5",children:[u," 次运行"]})]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-fg-5",children:[o.authorLogin&&i.jsxs("span",{className:"flex items-center gap-1",children:[o.authorAvatar&&i.jsx("img",{src:o.authorAvatar,alt:"",className:"h-3.5 w-3.5 rounded-full"}),o.authorLogin]}),o.labels&&o.labels.length>0&&o.labels.map(c=>i.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${c.color}20`,color:`#${c.color}`},children:c.name},c.id))]})]})},o.id)})})}function _B({pr:e,isActive:t,onSelect:a}){return i.jsx("li",{children:i.jsxs("button",{type:"button",onClick:a,className:ne("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:[i.jsx("span",{className:ne("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}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[e.draft===1&&i.jsx("span",{className:"shrink-0 rounded px-1 py-0.5 text-[9px] font-bold bg-fg-6/15 text-fg-4",children:"DRAFT"}),i.jsx("span",{className:"min-w-0 text-xs font-medium text-fg-2 group-hover:text-fg",children:e.title})]}),i.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&&i.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:e.labels.map(r=>i.jsx("span",{className:"rounded px-1 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${r.color}20`,color:`#${r.color}`},children:r.name},r.id))})]})]})})}function vB({pr:e,onSelect:t}){return i.jsx("li",{children:i.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:[i.jsx("span",{className:ne("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}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[e.draft===1&&i.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"}),i.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"&&i.jsxs("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-semibold bg-red-500/15 text-red-400",children:[i.jsx(Tn,{className:"inline h-3 w-3 -mt-px"})," Conflict"]}),e.assignees&&e.assignees.length>0&&i.jsx("div",{className:"hidden shrink-0 items-center -space-x-1.5 sm:flex",children:e.assignees.slice(0,3).map(a=>i.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))})]}),i.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1",children:[i.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-fg-5",children:[e.headBranch," → ",e.baseBranch]}),i.jsx("span",{className:"text-fg-6",children:"·"}),e.authorLogin&&i.jsxs(i.Fragment,{children:[i.jsxs("span",{className:"shrink-0 text-[11px] text-fg-5",title:e.authorLogin,children:[e.authorAvatar&&i.jsx("img",{src:e.authorAvatar,alt:"",className:"mr-1 inline-block h-3.5 w-3.5 rounded-full align-text-bottom"}),e.authorLogin]}),i.jsx("span",{className:"text-fg-6",children:"·"})]}),i.jsx("span",{className:"shrink-0 text-[11px] text-fg-6",children:_p(e.createdAt)}),e.labels&&e.labels.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-fg-6",children:"·"}),e.labels.map(a=>i.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))]})]})]})]})})}const BE=[{key:"open",label:"开放"},{key:"merged",label:"已合并"},{key:"closed",label:"已关闭"},{key:"all",label:"全部"}];function SB({issue:e,linked:t,onToggle:a}){return i.jsx("li",{children:i.jsx("button",{type:"button",onClick:a,className:ne("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:i.jsx("div",{className:"min-w-0 flex-1",children:i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsxs("span",{className:ne("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]}),i.jsx("span",{className:"min-w-0 truncate text-sm font-medium text-fg-2",children:e.title}),t&&i.jsx(qh,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-emerald-400"})]})})})})}function AB({pr:e,tab:t,issueId:a,onTabChange:r,onSelectIssue:o,onBackToIssueList:u,onBack:c,onClose:f,onEnterMatch:m,onNavigateToIssue:h}){const b=je(A=>A.activeRepoId),g=Ve(A=>A.issues),[y,N]=T.useState([]);T.useEffect(()=>{if(!b){N([]);return}Qh(b,e.number).then(N).catch(()=>N([]))},[b,e.number]);const v=a?g.find(A=>A.id===a)??y.find(A=>A.id===a)??null:null;return i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[y.length>0&&i.jsxs("div",{className:"flex shrink-0 items-center border-b border-line bg-surface",children:[i.jsxs("button",{type:"button",onClick:()=>r("pr"),className:ne("flex items-center gap-1.5 border-b-2 px-4 py-2.5 text-xs font-medium transition-colors",t==="pr"?"border-blue-500 text-fg":"border-transparent text-fg-4 hover:text-fg-2"),children:[i.jsx(Fr,{className:"h-3.5 w-3.5"}),"PR"]}),i.jsxs("button",{type:"button",onClick:()=>r("issue"),className:ne("flex items-center gap-1.5 border-b-2 px-4 py-2.5 text-xs font-medium transition-colors",t==="issue"?"border-blue-500 text-fg":"border-transparent text-fg-4 hover:text-fg-2"),children:[i.jsx(Yr,{className:"h-3.5 w-3.5"}),"Issue",i.jsx("span",{className:ne("rounded-full px-1.5 py-0.5 font-mono text-[10px]",t==="issue"?"bg-blue-500/10 text-blue-500":"bg-elevated text-fg-5"),children:y.length})]})]}),t==="pr"||y.length===0?i.jsx(x_,{pr:e,onBack:c,onClose:f,onEnterMatch:m,onNavigateToIssue:h}):v?i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[i.jsx("div",{className:"flex shrink-0 items-center border-b border-line bg-elevated/30 px-4 py-2",children:i.jsxs("button",{type:"button",onClick:u,className:"flex items-center gap-1 rounded-md px-2 py-1 text-xs text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:[i.jsx(xo,{className:"h-3.5 w-3.5"}),"返回列表"]})}),i.jsx(b_,{issue:v,onBack:u})]}):i.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i.jsx("div",{className:"mx-auto max-w-3xl px-4 py-6 md:px-6",children:i.jsx(TB,{issues:y,onSelect:o})})})]})}function CB(){const[e,t]=T.useState("open"),[a,r]=T.useState(""),o=mn(V=>V.setViewingPr),[u,c]=T.useState(""),[f,m]=Uh(),h=vn(),b=je(zn),g=mn(V=>V.pulls),y=mn(V=>V.syncing),N=mn(V=>V.syncPulls),v=mn(V=>V.matchingPrId),A=mn(V=>V.enterMatchMode),C=mn(V=>V.exitMatchMode),S=mn(V=>V.linkIssue),M=je(V=>V.activeRepoId),O=Ve(V=>V.issues),j=f.get("id"),I=f.get("tab")==="issue"?"issue":"pr",U=f.get("issueId");T.useEffect(()=>{const V=f.get("prId");if(!V)return;const ve=new URLSearchParams(f);ve.delete("prId"),ve.set("id",V),m(ve,{replace:!0})},[f,m]),T.useEffect(()=>{if(f.get("id"))return;const V=mn.getState().viewingPrId;V&&m({id:V},{replace:!0})},[]);const $=T.useCallback(V=>{m({id:V},{replace:!1}),o(V)},[m,o]),Z=T.useCallback(()=>{m({},{replace:!1}),o(null)},[m,o]),K=T.useCallback(V=>{if(!j)return;const ve={id:j};V==="issue"&&(ve.tab="issue"),m(ve,{replace:!1})},[j,m]),D=T.useCallback(V=>{j&&m({id:j,tab:"issue",issueId:V},{replace:!1})},[j,m]),te=T.useCallback(()=>{j&&m({id:j,tab:"issue"},{replace:!1})},[j,m]),le=v?g.find(V=>V.id===v)??null:null,[pe,Q]=T.useState(new Set);T.useEffect(()=>{if(!M||!le){Q(new Set);return}Qh(M,le.number).then(V=>Q(new Set(V.map(ve=>ve.id)))).catch(()=>Q(new Set))},[M,le]);const q=async V=>{if(!le)return;pe.has(V.id)?await mn.getState().unlinkIssue(le.number,V.number)&&Q(Ue=>{const xt=new Set(Ue);return xt.delete(V.id),xt}):await S(le.number,V.number)&&Q(Ue=>new Set(Ue).add(V.id))},F=g.filter(V=>V.state==="open").length,k=g.filter(V=>V.state==="merged").length,P=g.filter(V=>V.state==="closed").length,J=e==="all"?g:g.filter(V=>V.state===e),w=a.trim().toLowerCase(),H=w?J.filter(V=>`#${V.number} ${V.title} ${V.headBranch} ${V.baseBranch}`.toLowerCase().includes(w)):J,se=u.trim().toLowerCase(),L=se?O.filter(V=>`#${V.number} ${V.title}`.toLowerCase().includes(se)):O,Ne=g.find(V=>V.id===j)??null,Te=le??Ne;return i.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 overflow-hidden",children:[i.jsxs("div",{className:ne("shrink-0 flex-col bg-surface",Te?"hidden md:flex md:w-80 border-r border-line":"flex w-full"),children:[v?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-3",children:[i.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-blue-400",children:"选择 Issue 关联"}),i.jsxs("button",{type:"button",onClick:C,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:[i.jsx(gt,{className:"h-3.5 w-3.5"}),"完成"]})]}),i.jsx("div",{className:"border-b border-line px-3 py-2",children:i.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2 py-1",children:[i.jsx(Pr,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),i.jsx("input",{type:"text",value:u,onChange:V=>c(V.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"}),u&&i.jsx("button",{type:"button",onClick:()=>c(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:i.jsx(gt,{className:"h-3 w-3"})})]})}),i.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:L.length===0?i.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:O.length===0?"暂无 Issue,请先同步":"无匹配 Issue"}):i.jsx("ul",{className:"space-y-0.5",children:L.map(V=>i.jsx(SB,{issue:V,linked:pe.has(V.id),onToggle:()=>void q(V)},V.id))})})]}):Te?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-3",children:[i.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-fg-3",children:"Pull Requests"}),M&&i.jsx("button",{type:"button",onClick:()=>void N(),disabled:y,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:i.jsx(zr,{className:ne("h-3.5 w-3.5",y&&"animate-spin")})})]}),i.jsx("div",{className:"flex border-b border-line",children:BE.map(({key:V,label:ve})=>{const Be=V==="open"?F:V==="merged"?k:V==="closed"?P:g.length;return i.jsxs("button",{type:"button",onClick:()=>t(V),className:ne("flex flex-1 items-center justify-center gap-1.5 py-2 text-xs font-medium transition-colors",e===V?"border-b-2 border-blue-500 text-blue-500":"text-fg-4 hover:text-fg-2"),children:[ve,i.jsx("span",{className:ne("rounded-full px-1.5 py-0.5 font-mono text-[10px]",e===V?"bg-blue-500/10 text-blue-500":"bg-elevated text-fg-5"),children:Be})]},V)})}),i.jsx("div",{className:"border-b border-line px-3 py-2",children:i.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2 py-1",children:[i.jsx(Pr,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),i.jsx("input",{type:"text",value:a,onChange:V=>r(V.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&&i.jsx("button",{type:"button",onClick:()=>r(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:i.jsx(gt,{className:"h-3 w-3"})})]})})]}):i.jsx(i.Fragment,{children:i.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-2 border-b border-line px-4 py-2.5",children:[i.jsx("span",{className:"shrink-0 text-sm font-semibold text-fg md:order-1",children:"Pull Requests"}),i.jsx("button",{type:"button",onClick:()=>void N(),disabled:y||!M,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:i.jsx(zr,{className:ne("h-4 w-4",y&&"animate-spin")})}),i.jsx("div",{className:"w-full md:order-2 md:w-auto",children:i.jsx("div",{className:"flex shrink-0 items-center rounded-lg bg-elevated/60 p-0.5",children:BE.map(({key:V,label:ve})=>{const Be=V==="open"?F:V==="merged"?k:V==="closed"?P:g.length;return i.jsxs("button",{type:"button",onClick:()=>t(V),className:ne("flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",e===V?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-2"),children:[ve,i.jsx("span",{className:ne("rounded-full px-1.5 py-0.5 font-mono text-[10px]",e===V?"bg-blue-500/10 text-blue-500":"text-fg-5"),children:Be})]},V)})})}),i.jsx("div",{className:"w-full md:order-3 md:w-auto md:min-w-0 md:flex-1 md:px-1",children:i.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2.5 py-1.5",children:[i.jsx(Pr,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),i.jsx("input",{type:"text",value:a,onChange:V=>r(V.target.value),placeholder:"搜索 PR...",className:"min-w-0 flex-1 bg-transparent text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),a&&i.jsx("button",{type:"button",onClick:()=>r(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:i.jsx(gt,{className:"h-3 w-3"})})]})})]})}),!v&&i.jsx("div",{className:ne("flex-1 overflow-y-auto",Te?"px-2 py-2":"px-3 py-3"),children:M?H.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-fg-5",children:[i.jsx(Fr,{className:"h-8 w-8"}),i.jsx("p",{className:"font-mono text-xs",children:g.length===0?"点击 ↻ 同步 PR":"没有匹配的 PR"})]}):i.jsx("ul",{className:ne(Te?"space-y-0.5":"space-y-1"),children:H.map(V=>Te?i.jsx(_B,{pr:V,isActive:V.id===(j??v),onSelect:()=>$(V.id)},V.id):i.jsx(vB,{pr:V,onSelect:()=>$(V.id)},V.id))}):i.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:"请先选择一个仓库"})})]}),Te?i.jsx(AB,{pr:Te,tab:I,issueId:U,onTabChange:K,onSelectIssue:D,onBackToIssueList:te,onBack:()=>{Z(),v&&C()},onClose:()=>{Z(),v&&C()},onEnterMatch:()=>A(Te.id),onNavigateToIssue:V=>{b&&h(`/${encodeURIComponent(b)}/dev/issues?id=${encodeURIComponent(V)}`)}},`${Te.id}-${v??"view"}`):i.jsx("div",{className:"hidden flex-1 items-center justify-center md:flex",children:i.jsxs("div",{className:"text-center text-fg-5",children:[i.jsx(Fr,{className:"mx-auto h-12 w-12 opacity-20"}),i.jsx("p",{className:"mt-3 font-mono text-xs",children:"选择一个 PR 查看详情"})]})})]})}function PE(e,t){return e?`/${encodeURIComponent(e)}/dev/${t}`:`/dev/${t}`}function UE(){const e=vn(),t=_n(),a=je(zn),r=Ve(m=>m.issues),o=mn(m=>m.pulls),u=t.pathname.endsWith("/pulls")?"pulls":"issues",c=r.filter(m=>m.state==="open").length,f=o.filter(m=>m.state==="open").length;return i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[i.jsx("div",{className:"flex shrink-0 items-center gap-1 border-b border-line bg-surface px-3 py-2",children:i.jsxs("div",{className:"flex items-center rounded-lg bg-elevated/60 p-0.5",children:[i.jsxs("button",{type:"button",onClick:()=>e(PE(a,"issues")),className:ne("flex items-center gap-1.5 rounded-md px-3 py-1 text-xs font-medium transition-colors",u==="issues"?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-2"),children:[i.jsx(Yr,{className:"h-3.5 w-3.5"}),"Issues",i.jsx("span",{className:ne("rounded-full px-1.5 py-0.5 font-mono text-[10px]",u==="issues"?"bg-blue-500/10 text-blue-500":"text-fg-5"),children:c})]}),i.jsxs("button",{type:"button",onClick:()=>e(PE(a,"pulls")),className:ne("flex items-center gap-1.5 rounded-md px-3 py-1 text-xs font-medium transition-colors",u==="pulls"?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-2"),children:[i.jsx(Fr,{className:"h-3.5 w-3.5"}),"PRs",i.jsx("span",{className:ne("rounded-full px-1.5 py-0.5 font-mono text-[10px]",u==="pulls"?"bg-blue-500/10 text-blue-500":"text-fg-5"),children:f})]})]})}),i.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 overflow-hidden",children:u==="issues"?i.jsx(NB,{}):i.jsx(CB,{})})]})}const wB=["Sisyphus - ultraworker","Prometheus - Plan Builder","Atlas - Plan Executor"],kB="pinned_models",Dr="__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 RB(e){const t=e.trim(),a=t.charCodeAt(0)||0;return{...HE[a%HE.length],initial:(t.charAt(0)||"?").toUpperCase()}}function OB({agent:e,memoryCount:t,sessionCount:a,onClick:r,onDelete:o}){const[u,c]=T.useState(!1),f=e.isSystem===1,m=RB(e.name);return i.jsxs("div",{className:"flex cursor-pointer flex-col rounded-xl border border-line bg-surface transition-colors hover:border-fg-6/60",onClick:r,children:[i.jsxs("div",{className:"flex items-start gap-3 p-4 pb-3",children:[i.jsx("div",{className:ne("flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-sm font-semibold",m.bg,m.text),children:m.initial}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"truncate text-sm font-semibold text-fg",children:e.name}),f&&i.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&&i.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"})]}),i.jsxs("p",{className:"mt-0.5 text-[11px] text-fg-4",children:[i.jsx("span",{className:"font-mono",children:e.baseAgent}),e.model&&i.jsxs("span",{className:"ml-1.5 text-fg-5",children:["· ",e.model]})]}),e.description&&i.jsx("p",{className:"mt-1 text-xs text-fg-5 line-clamp-2",children:e.description})]})]}),i.jsxs("div",{className:"flex items-center gap-4 border-t border-line/60 px-4 py-2.5",children:[i.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-fg-5",children:[i.jsx(zi,{className:"h-3 w-3"}),i.jsxs("span",{children:["记忆 ",t]})]}),i.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-fg-5",children:[i.jsx(Vc,{className:"h-3 w-3"}),i.jsxs("span",{children:["会话 ",a]})]}),i.jsx("div",{className:"flex-1"}),!f&&!u&&i.jsx("button",{type:"button",onClick:h=>{h.stopPropagation(),c(!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:i.jsx(Cs,{className:"h-3.5 w-3.5"})}),u&&i.jsxs("div",{className:"flex items-center gap-0.5",onClick:h=>h.stopPropagation(),children:[i.jsx("button",{type:"button",onClick:o,className:"rounded p-1 text-red-400 hover:bg-red-500/10",children:i.jsx(On,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",onClick:()=>c(!1),className:"rounded p-1 text-fg-4 hover:bg-elevated",children:i.jsx(gt,{className:"h-3.5 w-3.5"})})]})]})]})}function IB({initial:e,availableFragments:t,onSave:a,onCancel:r}){const o=je(q=>q.activeRepoId),[u,c]=T.useState((e==null?void 0:e.name)??""),[f,m]=T.useState((e==null?void 0:e.description)??""),[h,b]=T.useState((e==null?void 0:e.baseAgent)??"Sisyphus - ultraworker"),[g,y]=T.useState((e==null?void 0:e.model)??""),[N,v]=T.useState((e==null?void 0:e.variant)??""),[A,C]=T.useState((e==null?void 0:e.systemPrompt)??""),[S,M]=T.useState(!1),[O,j]=T.useState(!1),[I,U]=T.useState([]);T.useEffect(()=>{if(!o){U([]);return}let q=!1;return(async()=>{try{const[F,k]=await Promise.all([Oo(),Ro(o)]);if(q)return;const P=F[kB],J=P?JSON.parse(P):[];U(J.length>0?k.filter(w=>J.includes(w.id)):[])}catch{q||U([])}})(),()=>{q=!0}},[o]);const[$,Z]=T.useState(()=>{const q=(e==null?void 0:e.fragments.map(J=>J.id))??[],F=(e==null?void 0:e.systemPromptPosition)??-1,k=F>=0&&F<=q.length?F:q.length,P=[...q];return P.splice(k,0,Dr),P}),K=q=>{Z(F=>{if(F.includes(q))return F.filter(J=>J!==q);const k=F.indexOf(Dr),P=[...F];return P.splice(k>=0?k:P.length,0,q),P})},D=(q,F)=>{const k=q+F;k<0||k>=$.length||Z(P=>{const J=[...P];return[J[q],J[k]]=[J[k],J[q]],J})},te=$.filter(q=>q!==Dr),le=(()=>{const q=$.indexOf(Dr);return q<0?-1:$.slice(0,q).filter(F=>F!==Dr).length})(),pe=$.map(q=>{var F;return q===Dr?A:(F=t.find(k=>k.id===q))==null?void 0:F.content}).filter(Boolean).join(`
503
-
504
- ---
505
-
506
- `),Q=async()=>{if(!(!u.trim()||!h)){j(!0);try{await a({name:u.trim(),description:f.trim()||void 0,baseAgent:h,model:g.trim()||void 0,variant:N.trim()||void 0,systemPrompt:A,systemPromptPosition:le,fragmentIds:te})}finally{j(!1)}}};return i.jsxs("div",{className:"space-y-3 rounded-xl border border-line bg-surface p-5",children:[i.jsxs("div",{className:"flex gap-3",children:[i.jsxs("label",{className:"flex-1",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"名称"}),i.jsx("input",{type:"text",value:u,onChange:q=>c(q.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"})]}),i.jsxs("label",{className:"w-36",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Base Agent"}),i.jsx("select",{value:h,onChange:q=>b(q.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:wB.map(q=>i.jsx("option",{value:q,children:q},q))})]})]}),i.jsxs("label",{className:"block",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"描述(可选)"}),i.jsx("input",{type:"text",value:f,onChange:q=>m(q.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"})]}),i.jsxs("div",{className:"flex gap-3",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"模型(可选)"}),i.jsxs("select",{value:g,onChange:q=>y(q.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:[i.jsx("option",{value:"",children:"默认模型"}),I.map(q=>i.jsx("option",{value:q.id,children:q.name||q.id},q.id))]}),I.length===0&&i.jsx("p",{className:"mt-1 text-[11px] text-fg-5",children:"在设置的「模型」中勾选常用模型后可选择。"})]}),i.jsxs("div",{className:"w-28",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Variant"}),i.jsxs("select",{value:N,onChange:q=>v(q.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:[i.jsx("option",{value:"",children:"默认"}),i.jsx("option",{value:"max",children:"max"}),i.jsx("option",{value:"high",children:"high"})]})]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"提示词组合"}),i.jsx("p",{className:"mt-0.5 text-[11px] text-fg-5",children:"排序片段与补充指令的拼接顺序。"}),i.jsxs("div",{className:"mt-1.5 space-y-1",children:[$.map((q,F)=>{if(q===Dr)return i.jsxs("div",{className:"flex items-center gap-2 rounded border border-amber-500/30 bg-amber-500/5 px-2 py-1",children:[i.jsxs("div",{className:"flex flex-col",children:[i.jsx("button",{type:"button",onClick:()=>D(F,-1),disabled:F===0,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▲"}),i.jsx("button",{type:"button",onClick:()=>D(F,1),disabled:F===$.length-1,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▼"})]}),i.jsx("span",{className:"flex-1 truncate text-xs font-medium text-amber-400",children:"✎ 补充指令"})]},q);const k=t.find(P=>P.id===q);return k?i.jsxs("div",{className:"flex items-center gap-2 rounded border border-blue-500/30 bg-blue-500/5 px-2 py-1",children:[i.jsxs("div",{className:"flex flex-col",children:[i.jsx("button",{type:"button",onClick:()=>D(F,-1),disabled:F===0,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▲"}),i.jsx("button",{type:"button",onClick:()=>D(F,1),disabled:F===$.length-1,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▼"})]}),i.jsx("span",{className:"flex-1 truncate text-xs text-fg",children:k.name}),i.jsx("button",{type:"button",onClick:()=>K(q),className:"text-fg-5 hover:text-red-400",children:i.jsx(gt,{className:"h-3 w-3"})})]},q):null}),t.filter(q=>!te.includes(q.id)).length>0&&i.jsxs("select",{value:"",onChange:q=>{q.target.value&&K(q.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:[i.jsx("option",{value:"",children:"+ 添加片段…"}),t.filter(q=>!te.includes(q.id)).map(q=>i.jsx("option",{value:q.id,children:q.name},q.id))]})]})]}),i.jsxs("label",{className:"block",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"补充指令内容"}),i.jsx("textarea",{value:A,onChange:q=>C(q.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"})]}),(te.length>0||A)&&i.jsxs("div",{children:[i.jsxs("button",{type:"button",onClick:()=>M(!S),className:"flex items-center gap-1 text-xs font-medium text-fg-4 hover:text-fg-3",children:[i.jsx("span",{children:S?"▾":"▸"})," 预览最终提示词"]}),S&&i.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:pe||"(空)"})]}),i.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[i.jsx("button",{type:"button",onClick:r,className:"rounded-md px-3 py-1.5 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),i.jsx("button",{type:"button",onClick:()=>void Q(),disabled:O||!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:O?"保存中…":e?"更新":"创建"})]})]})}function MB({fragment:e,onEdit:t,onDelete:a}){const[r,o]=T.useState(!1);return i.jsxs("div",{className:"group flex items-center gap-3 rounded-lg border border-line bg-base px-3 py-2",children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"text-xs font-medium text-fg",children:e.name}),e.content&&i.jsx("p",{className:"mt-0.5 truncate font-mono text-[11px] text-fg-5",children:e.content})]}),i.jsx("div",{className:"flex items-center gap-1",children:r?i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",onClick:a,className:"rounded p-1 text-red-400 hover:bg-red-500/10",children:i.jsx(On,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",onClick:()=>o(!1),className:"rounded p-1 text-fg-4 hover:bg-elevated",children:i.jsx(gt,{className:"h-3.5 w-3.5"})})]}):i.jsxs(i.Fragment,{children:[i.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:i.jsx(Gh,{className:"h-3.5 w-3.5"})}),i.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:i.jsx(Cs,{className:"h-3.5 w-3.5"})})]})})]})}function FE({initial:e,onSave:t,onCancel:a}){const[r,o]=T.useState((e==null?void 0:e.name)??""),[u,c]=T.useState((e==null?void 0:e.content)??""),[f,m]=T.useState(!1),h=async()=>{if(r.trim()){m(!0);try{await t({name:r.trim(),content:u})}finally{m(!1)}}};return i.jsxs("div",{className:"space-y-2 rounded-lg border border-line bg-base p-3",children:[i.jsx("input",{type:"text",value:r,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"}),i.jsx("textarea",{value:u,onChange:b=>c(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"}),i.jsxs("div",{className:"flex justify-end gap-2",children:[i.jsx("button",{type:"button",onClick:a,className:"rounded-md px-3 py-1 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),i.jsx("button",{type:"button",onClick:()=>void h(),disabled:f||!r.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 DB({onImported:e,onCancel:t}){const[a,r]=T.useState(""),[o,u]=T.useState(!1),[c,f]=T.useState(null),m=T.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 tC(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 A=N.result;r(A),h(A)},N.readAsText(y)};return i.jsxs("div",{className:"space-y-3 rounded-xl border border-line bg-surface p-5",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"导入 Custom Agent"}),i.jsx("button",{type:"button",onClick:t,className:"rounded p-1 text-fg-5 hover:text-fg-3",children:i.jsx(gt,{className:"h-3.5 w-3.5"})})]}),i.jsx("input",{ref:m,type:"file",accept:".json",onChange:b,className:"hidden"}),i.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:[i.jsx(_y,{className:"h-3.5 w-3.5"})," 上传 JSON 文件"]}),i.jsx("textarea",{value:a,onChange:g=>r(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"}),c&&i.jsxs("div",{className:"flex items-start gap-2 rounded-lg bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[i.jsx(Tn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),i.jsx("span",{children:c})]}),i.jsxs("div",{className:"flex justify-end gap-2",children:[i.jsx("button",{type:"button",onClick:t,className:"rounded-md px-3 py-1.5 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),i.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 LB(){const e=vn(),t=je(zn),a=je(Q=>Q.activeRepoId),[r,o]=T.useState([]),[u,c]=T.useState([]),[f,m]=T.useState(!0),[h,b]=T.useState(!1),[g,y]=T.useState(!1),[N,v]=T.useState(null),[A,C]=T.useState(!1),[S,M]=T.useState(!1),[O,j]=T.useState({}),[I,U]=T.useState({}),$=T.useCallback(()=>{const Q=a?Ly(a):Iy();Promise.all([Q,jy()]).then(([q,F])=>{o(q),c(F),m(!1)}).catch(()=>m(!1))},[a]);T.useEffect(()=>{m(!0),$()},[$]),T.useEffect(()=>{if(r.length===0)return;const Q=r.filter(q=>q.isSystem<2);for(const q of Q)Dy(q.id).then(F=>{j(k=>({...k,[q.id]:F.filter(P=>!P.supersededBy).length}))}).catch(()=>{}),Xh(q.id).then(F=>{U(k=>({...k,[q.id]:F.length}))}).catch(()=>{})},[r]);const Z=r.filter(Q=>Q.isSystem<2),K=async Q=>{a?await rC(a,Q):await J5(Q),b(!1),$(),or.getState().loadAgents()},D=async Q=>{await My(Q),o(q=>q.filter(F=>F.id!==Q)),or.getState().loadAgents()},te=async Q=>{await iC(Q),y(!1),$()},le=async Q=>{N&&(await lC(N.id,Q),v(null),$())},pe=async Q=>{await oC(Q),c(q=>q.filter(F=>F.id!==Q))};return a?i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsxs("div",{className:"mx-auto max-w-4xl space-y-6 p-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-lg font-bold text-fg",children:"Agents"}),i.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"组合 base agent + 模型 + 提示词片段,创建 Session 时选择。"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{type:"button",onClick:()=>{C(!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:[i.jsx(_y,{className:"h-3.5 w-3.5"})," 导入"]}),i.jsxs("button",{type:"button",onClick:()=>{b(!0),C(!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:[i.jsx(Ia,{className:"h-3.5 w-3.5"})," 创建"]})]})]}),h&&i.jsx(IB,{availableFragments:u,onSave:K,onCancel:()=>b(!1)}),A&&i.jsx(DB,{onImported:()=>{C(!1),$(),or.getState().loadAgents()},onCancel:()=>C(!1)}),f?i.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-16 text-fg-5",children:[i.jsx(ln,{className:"h-5 w-5 fs-spin"}),i.jsx("p",{className:"text-xs",children:"加载中…"})]}):Z.length===0&&!h?i.jsxs("div",{className:"flex flex-col items-center gap-3 py-16 text-fg-5",children:[i.jsx(zi,{className:"h-8 w-8 text-fg-6"}),i.jsx("p",{className:"text-sm",children:"还没有 Agent"}),i.jsx("p",{className:"text-xs text-fg-5",children:"点击上方「创建」开始。"})]}):i.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:Z.map(Q=>i.jsx("div",{className:"group",children:i.jsx(OB,{agent:Q,memoryCount:O[Q.id]??0,sessionCount:I[Q.id]??0,onClick:()=>e(`/${encodeURIComponent(t??"")}/agents/${Q.id}`),onDelete:()=>void D(Q.id)})},Q.id))}),i.jsxs("section",{className:"rounded-xl border border-line bg-surface",children:[i.jsxs("button",{type:"button",onClick:()=>M(!S),className:"flex w-full items-center justify-between px-5 py-4 text-left",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-sm font-semibold text-fg",children:"提示词片段"}),i.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"可复用的提示词模块,可在多个 Agent 间共享。"})]}),i.jsx(ba,{className:ne("h-4 w-4 shrink-0 text-fg-4 transition-transform",S&&"rotate-180")})]}),S&&i.jsx("div",{className:"border-t border-line px-5 pb-5 pt-3",children:i.jsxs("div",{className:"space-y-1.5",children:[u.map(Q=>(N==null?void 0:N.id)===Q.id?i.jsx(FE,{initial:Q,onSave:le,onCancel:()=>v(null)},Q.id):i.jsx(MB,{fragment:Q,onEdit:()=>v(Q),onDelete:()=>void pe(Q.id)},Q.id)),g?i.jsx(FE,{onSave:te,onCancel:()=>y(!1)}):i.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:[i.jsx(Ia,{className:"h-3.5 w-3.5"})," 添加片段"]})]})})]})]})}):i.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:i.jsx("p",{className:"text-sm text-fg-4",children:"请先在顶部选择一个仓库。"})})}const jB=["Sisyphus - ultraworker","Prometheus - Plan Builder","Atlas - Plan Executor"],BB="pinned_models",Lr="__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 PB(e){const t=e.trim(),a=t.charCodeAt(0)||0;return{...zE[a%zE.length],initial:(t.charAt(0)||"?").toUpperCase()}}const wh={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 vp(e){const t=Date.now()-e,a=Math.floor(t/6e4);if(a<1)return"刚刚";if(a<60)return`${a} 分钟前`;const r=Math.floor(a/60);if(r<24)return`${r} 小时前`;const o=Math.floor(r/24);return o<30?`${o} 天前`:`${Math.floor(o/30)} 个月前`}function $E({memory:e,onUpdate:t,onDelete:a}){const[r,o]=T.useState(!1),[u,c]=T.useState(e.content),[f,m]=T.useState(e.category),[h,b]=T.useState(!1),[g,y]=T.useState(!1),N=wh[e.category]??wh.general,v=async()=>{b(!0);try{await t(e.id,{content:u,category:f}),o(!1)}finally{b(!1)}},A=async()=>{y(!1),await a(e.id)};return r?i.jsxs("div",{className:"rounded-lg border border-blue-500/30 bg-blue-500/5 p-3 space-y-2",children:[i.jsx("textarea",{value:u,onChange:C=>c(C.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"}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("select",{value:f,onChange:C=>m(C.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:[i.jsx("option",{value:"decision",children:"decision"}),i.jsx("option",{value:"lesson",children:"lesson"}),i.jsx("option",{value:"preference",children:"preference"}),i.jsx("option",{value:"pattern",children:"pattern"}),i.jsx("option",{value:"general",children:"general"})]}),i.jsx("div",{className:"flex-1"}),i.jsx("button",{type:"button",onClick:()=>{o(!1),c(e.content),m(e.category)},className:"rounded-md px-3 py-1 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),i.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?"保存中…":"保存"})]})]}):i.jsxs("div",{className:"group/mem rounded-lg border border-line bg-base px-3 py-2.5",children:[i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx("span",{className:ne("mt-0.5 shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium",N.bg,N.text),children:e.category}),i.jsx("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-fg",children:e.content})]}),i.jsxs("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-fg-5",children:[i.jsxs("span",{className:"flex items-center gap-0.5",children:[i.jsx(Qc,{className:"h-3 w-3"})," ",e.importance.toFixed(2)]}),i.jsx("span",{children:"·"}),i.jsx("span",{children:vp(e.updatedAt)}),e.supersededBy&&i.jsxs(i.Fragment,{children:[i.jsx("span",{children:"·"}),i.jsx("span",{className:"text-amber-400",children:e.supersededBy==="user-deleted"?"已删除":"已合并"})]}),i.jsx("div",{className:"flex-1"}),!e.supersededBy&&i.jsx("div",{className:"flex items-center gap-0.5 opacity-0 transition-opacity group-hover/mem:opacity-100",children:g?i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",onClick:()=>void A(),className:"rounded p-1 text-red-400 hover:bg-red-500/10",children:i.jsx(On,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",onClick:()=>y(!1),className:"rounded p-1 text-fg-4 hover:bg-elevated",children:i.jsx(gt,{className:"h-3.5 w-3.5"})})]}):i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",onClick:()=>o(!0),className:"rounded p-1 text-fg-5 hover:text-fg-3",children:i.jsx(Gh,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",onClick:()=>y(!0),className:"rounded p-1 text-fg-5 hover:text-red-400",children:i.jsx(Cs,{className:"h-3.5 w-3.5"})})]})})]})]})}function UB({agentId:e}){const[t,a]=T.useState([]),[r,o]=T.useState(!0),[u,c]=T.useState(null),[f,m]=T.useState(!1),[h,b]=T.useState([]),[g,y]=T.useState(!0),[N,v]=T.useState(!1),[A,C]=T.useState(new Set),[S,M]=T.useState(!1),[O,j]=T.useState(null),I=T.useCallback(async()=>{o(!0);try{const Q=await Dy(e,{category:u??void 0,includeSuperseded:f});a(Q)}catch{a([])}o(!1)},[e,u,f]);T.useEffect(()=>{I()},[I]),T.useEffect(()=>{if(!N)return;let Q=!1;return y(!0),Xh(e).then(q=>{Q||b(q)}).catch(()=>{Q||b([])}).finally(()=>{Q||y(!1)}),()=>{Q=!0}},[e,N]);const U=t.filter(Q=>!Q.supersededBy),$=t.filter(Q=>Q.supersededBy),Z=T.useMemo(()=>new Set(t.map(Q=>Q.sessionId).filter(Boolean)),[t]),K=async(Q,q)=>{await nC(e,Q,q),await I()},D=async Q=>{await aC(e,Q),await I()},te=Q=>{C(q=>{const F=new Set(q);return F.has(Q)?F.delete(Q):F.add(Q),F})},le=async()=>{if(A.size!==0){M(!0),j(null);try{const F=(await sC(e,[...A])).results;if(F){const k=F.filter(J=>J.status==="ok"),P=F.filter(J=>J.status!=="ok");k.length>0&&j(`提取成功 ${k.reduce((J,w)=>J+(w.actions??0),0)} 条记忆`),P.length>0&&j(J=>(J?J+";":"")+P.map(w=>w.error??w.status).join(";")),k.length>0&&await I()}C(new Set)}catch(Q){j(`请求失败: ${Q instanceof Error?Q.message:String(Q)}`)}M(!1)}},pe=["decision","lesson","preference","pattern"];return i.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5 space-y-4",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(zi,{className:"h-4 w-4 text-purple-400"}),i.jsx("h2",{className:"text-sm font-semibold text-fg",children:"记忆"}),!r&&i.jsx("span",{className:"rounded-full bg-elevated px-1.5 py-0.5 text-[10px] tabular-nums text-fg-4",children:U.length})]})}),i.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[i.jsx("button",{type:"button",onClick:()=>c(null),className:ne("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:"全部"}),pe.map(Q=>{const q=wh[Q];return i.jsx("button",{type:"button",onClick:()=>c(u===Q?null:Q),className:ne("rounded-full px-2.5 py-0.5 text-[11px] font-medium transition-colors",u===Q?ne(q.bg,q.text):"text-fg-4 hover:text-fg-3"),children:Q},Q)})]}),r?i.jsx("div",{className:"flex items-center justify-center py-8",children:i.jsx(ln,{className:"h-4 w-4 fs-spin text-fg-5"})}):U.length===0&&$.length===0?i.jsx("div",{className:"py-8 text-center text-xs text-fg-5",children:"暂无记忆。使用此 Agent 完成 Session 后将自动提取。"}):i.jsxs("div",{className:"space-y-1.5",children:[U.map(Q=>i.jsx($E,{memory:Q,onUpdate:K,onDelete:D},Q.id)),$.length>0&&i.jsxs("div",{className:"pt-1",children:[i.jsxs("button",{type:"button",onClick:()=>m(!f),className:"flex items-center gap-1 text-[11px] text-fg-5 hover:text-fg-3",children:[i.jsx("span",{children:f?"▾":"▸"}),"已合并/已删除 (",$.length,")"]}),f&&i.jsx("div",{className:"mt-1.5 space-y-1.5 opacity-60",children:$.map(Q=>i.jsx($E,{memory:Q,onUpdate:K,onDelete:D},Q.id))})]})]}),i.jsxs("div",{className:"border-t border-line pt-3",children:[i.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:[i.jsx(Vc,{className:"h-3.5 w-3.5"}),i.jsxs("span",{children:[N?"▾":"▸"," 从 Session 提取记忆"]})]}),N&&i.jsx("div",{className:"mt-2 space-y-1.5",children:g?i.jsx("div",{className:"flex items-center justify-center py-4",children:i.jsx(ln,{className:"h-4 w-4 fs-spin text-fg-5"})}):h.length===0?i.jsx("p",{className:"py-4 text-center text-xs text-fg-5",children:"暂无 Session 记录。"}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"max-h-64 space-y-1 overflow-y-auto",children:h.map(Q=>{const q=Z.has(Q.id);return i.jsxs("label",{className:ne("flex cursor-pointer items-center gap-2.5 rounded-md border px-3 py-2 transition-colors",A.has(Q.id)?"border-purple-500/30 bg-purple-500/5":"border-line bg-base hover:bg-elevated/60"),children:[i.jsx("input",{type:"checkbox",checked:A.has(Q.id),onChange:()=>te(Q.id),className:"h-3.5 w-3.5 shrink-0 cursor-pointer rounded border-line accent-purple-500"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"block truncate text-xs text-fg",children:Q.title||Q.id.slice(-8)}),i.jsx("span",{className:"text-[11px] text-fg-5",children:vp(Q.timeCreated)})]}),i.jsx("span",{className:ne("shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium",q?"bg-green-500/10 text-green-400":"bg-elevated text-fg-5"),children:q?"已提取":"未提取"})]},Q.id)})}),A.size>0&&i.jsxs("button",{type:"button",onClick:()=>void le(),disabled:S,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:[S?i.jsx(ln,{className:"h-3.5 w-3.5 fs-spin"}):i.jsx(zi,{className:"h-3.5 w-3.5"}),S?"提取中…":`提取选中 Session 的记忆 (${A.size})`]}),O&&i.jsx("p",{className:ne("mt-1.5 rounded-md px-3 py-1.5 text-xs",O.includes("成功")?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"),children:O})]})})]})]})}function HB({agentId:e}){const[t,a]=T.useState([]),[r,o]=T.useState(!0);return T.useEffect(()=>{let u=!1;return Xh(e).then(c=>{u||a(c)}).catch(()=>{u||a([])}).finally(()=>{u||o(!1)}),()=>{u=!0}},[e]),i.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Vc,{className:"h-4 w-4 text-fg-4"}),i.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Session 历史"}),!r&&i.jsx("span",{className:"rounded-full bg-elevated px-1.5 py-0.5 text-[10px] tabular-nums text-fg-4",children:t.length})]}),i.jsx("div",{className:"mt-3",children:r?i.jsx("div",{className:"flex items-center justify-center py-8",children:i.jsx(ln,{className:"h-4 w-4 fs-spin text-fg-5"})}):t.length===0?i.jsx("p",{className:"py-8 text-center text-xs text-fg-5",children:"暂无 Session 记录。"}):i.jsx("div",{className:"space-y-1",children:t.map(u=>i.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-line bg-base px-4 py-2.5",children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"block truncate text-xs font-medium text-fg",children:u.title||u.id.slice(-8)}),i.jsxs("div",{className:"mt-0.5 flex items-center gap-2 text-[11px] text-fg-5",children:[i.jsx("span",{children:vp(u.timeCreated)}),u.cost>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{children:"·"}),i.jsxs("span",{children:["$",u.cost.toFixed(4)]})]}),(u.tokensInput>0||u.tokensOutput>0)&&i.jsxs(i.Fragment,{children:[i.jsx("span",{children:"·"}),i.jsxs("span",{children:[Math.round((u.tokensInput+u.tokensOutput)/1e3),"K tokens"]})]})]})]}),u.completedAt?i.jsx("span",{className:"shrink-0 rounded-full bg-green-500/10 px-2 py-0.5 text-[10px] font-medium text-green-400",children:"完成"}):i.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 FB({agent:e,fragments:t,onSave:a}){const r=je(k=>k.activeRepoId),[o,u]=T.useState(!1),[c,f]=T.useState(e.name),[m,h]=T.useState(e.description??""),[b,g]=T.useState(e.baseAgent),[y,N]=T.useState(e.model??""),[v,A]=T.useState(e.variant??""),[C,S]=T.useState(e.systemPrompt),[M,O]=T.useState(!1),[j,I]=T.useState(!1),[U,$]=T.useState([]);T.useEffect(()=>{if(!r){$([]);return}let k=!1;return(async()=>{try{const[P,J]=await Promise.all([Oo(),Ro(r)]);if(k)return;const w=P[BB],H=w?JSON.parse(w):[];$(H.length>0?J.filter(se=>H.includes(se.id)):[])}catch{k||$([])}})(),()=>{k=!0}},[r]);const[Z,K]=T.useState(()=>{const k=e.fragments.map(H=>H.id),P=e.systemPromptPosition??-1,J=P>=0&&P<=k.length?P:k.length,w=[...k];return w.splice(J,0,Lr),w}),D=k=>{K(P=>{if(P.includes(k))return P.filter(H=>H!==k);const J=P.indexOf(Lr),w=[...P];return w.splice(J>=0?J:w.length,0,k),w})},te=(k,P)=>{const J=k+P;J<0||J>=Z.length||K(w=>{const H=[...w];return[H[k],H[J]]=[H[J],H[k]],H})},le=Z.filter(k=>k!==Lr),pe=(()=>{const k=Z.indexOf(Lr);return k<0?-1:Z.slice(0,k).filter(P=>P!==Lr).length})(),Q=Z.map(k=>{var P;return k===Lr?C:(P=t.find(J=>J.id===k))==null?void 0:P.content}).filter(Boolean).join(`
507
-
508
- ---
509
-
510
- `),q=async()=>{if(!(!c.trim()||!b)){I(!0);try{await a({name:c.trim(),description:m.trim()||void 0,baseAgent:b,model:y.trim()||void 0,variant:v.trim()||void 0,systemPrompt:C,systemPromptPosition:pe,fragmentIds:le}),u(!1)}finally{I(!1)}}},F=e.isSystem>=1;return o?i.jsxs("section",{className:"rounded-xl border border-blue-500/30 bg-surface p-5 space-y-3",children:[i.jsx("h2",{className:"text-sm font-semibold text-fg",children:"编辑配置"}),!F&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex gap-3",children:[i.jsxs("label",{className:"flex-1",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"名称"}),i.jsx("input",{type:"text",value:c,onChange:k=>f(k.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"})]}),i.jsxs("label",{className:"w-36",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Base Agent"}),i.jsx("select",{value:b,onChange:k=>g(k.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:jB.map(k=>i.jsx("option",{value:k,children:k},k))})]})]}),i.jsxs("label",{className:"block",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"描述(可选)"}),i.jsx("input",{type:"text",value:m,onChange:k=>h(k.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"})]})]}),i.jsxs("div",{className:"flex gap-3",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"模型(可选)"}),i.jsxs("select",{value:y,onChange:k=>N(k.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:[i.jsx("option",{value:"",children:"默认模型"}),U.map(k=>i.jsx("option",{value:k.id,children:k.name||k.id},k.id))]})]}),i.jsxs("div",{className:"w-28",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Variant"}),i.jsxs("select",{value:v,onChange:k=>A(k.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:[i.jsx("option",{value:"",children:"默认"}),i.jsx("option",{value:"max",children:"max"}),i.jsx("option",{value:"high",children:"high"})]})]})]}),!F&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"提示词组合"}),i.jsxs("div",{className:"mt-1.5 space-y-1",children:[Z.map((k,P)=>{if(k===Lr)return i.jsxs("div",{className:"flex items-center gap-2 rounded border border-amber-500/30 bg-amber-500/5 px-2 py-1",children:[i.jsxs("div",{className:"flex flex-col",children:[i.jsx("button",{type:"button",onClick:()=>te(P,-1),disabled:P===0,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▲"}),i.jsx("button",{type:"button",onClick:()=>te(P,1),disabled:P===Z.length-1,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▼"})]}),i.jsx("span",{className:"flex-1 truncate text-xs font-medium text-amber-400",children:"✎ 补充指令"})]},k);const J=t.find(w=>w.id===k);return J?i.jsxs("div",{className:"flex items-center gap-2 rounded border border-blue-500/30 bg-blue-500/5 px-2 py-1",children:[i.jsxs("div",{className:"flex flex-col",children:[i.jsx("button",{type:"button",onClick:()=>te(P,-1),disabled:P===0,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▲"}),i.jsx("button",{type:"button",onClick:()=>te(P,1),disabled:P===Z.length-1,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▼"})]}),i.jsx("span",{className:"flex-1 truncate text-xs text-fg",children:J.name}),i.jsx("button",{type:"button",onClick:()=>D(k),className:"text-fg-5 hover:text-red-400",children:i.jsx(gt,{className:"h-3 w-3"})})]},k):null}),t.filter(k=>!le.includes(k.id)).length>0&&i.jsxs("select",{value:"",onChange:k=>{k.target.value&&D(k.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:[i.jsx("option",{value:"",children:"+ 添加片段…"}),t.filter(k=>!le.includes(k.id)).map(k=>i.jsx("option",{value:k.id,children:k.name},k.id))]})]})]}),i.jsxs("label",{className:"block",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"补充指令内容"}),i.jsx("textarea",{value:C,onChange:k=>S(k.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"})]}),(le.length>0||C)&&i.jsxs("div",{children:[i.jsxs("button",{type:"button",onClick:()=>O(!M),className:"flex items-center gap-1 text-xs font-medium text-fg-4 hover:text-fg-3",children:[i.jsx("span",{children:M?"▾":"▸"})," 预览最终提示词"]}),M&&i.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:Q||"(空)"})]})]}),i.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[i.jsx("button",{type:"button",onClick:()=>u(!1),className:"rounded-md px-3 py-1.5 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),i.jsx("button",{type:"button",onClick:()=>void q(),disabled:j||!c.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:j?"保存中…":"保存"})]})]}):i.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h2",{className:"text-sm font-semibold text-fg",children:"配置"}),i.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:[i.jsx(Gh,{className:"h-3 w-3"})," 编辑"]})]}),i.jsxs("div",{className:"mt-3 space-y-2.5",children:[i.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[i.jsx("span",{className:"w-20 shrink-0 text-fg-5",children:"Base Agent"}),i.jsx("span",{className:"font-mono text-fg",children:e.baseAgent})]}),i.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[i.jsx("span",{className:"w-20 shrink-0 text-fg-5",children:"模型"}),i.jsx("span",{className:"font-mono text-fg",children:e.model||"默认"})]}),i.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[i.jsx("span",{className:"w-20 shrink-0 text-fg-5",children:"Variant"}),i.jsx("span",{className:"font-mono text-fg",children:e.variant||"默认"})]}),e.fragments.length>0&&i.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[i.jsx("span",{className:"w-20 shrink-0 pt-0.5 text-fg-5",children:"片段"}),i.jsx("div",{className:"flex flex-wrap gap-1",children:e.fragments.map(k=>i.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] font-medium text-blue-400",children:k.name},k.id))})]}),e.systemPrompt&&i.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[i.jsx("span",{className:"w-20 shrink-0 pt-0.5 text-fg-5",children:"补充指令"}),i.jsx("p",{className:"min-w-0 truncate font-mono text-fg-4",children:e.systemPrompt})]})]})]})}function zB(){const{agentId:e}=uy(),t=vn(),a=je(zn),r=or(S=>S.agents),o=r.find(S=>S.id===e),[u,c]=T.useState([]),[f,m]=T.useState(!1),[h,b]=T.useState(!1);T.useEffect(()=>{jy().then(c).catch(()=>c([]))},[]),T.useEffect(()=>{r.length>0&&!o&&t(a?`/${encodeURIComponent(a)}/agents`:"/repos",{replace:!0})},[r,o,t,a]);const g=async S=>{e&&(await eC(e,S),or.getState().loadAgents())},y=async()=>{e&&(await My(e),or.getState().loadAgents(),t(a?`/${encodeURIComponent(a)}/agents`:"/repos",{replace:!0}))},N=async()=>{if(!e||!o)return;const S=await Cx(e),M=new Blob([JSON.stringify(S,null,2)],{type:"application/json"}),O=URL.createObjectURL(M),j=document.createElement("a");j.href=O,j.download=`${o.name.replace(/[^a-zA-Z0-9\u4e00-\u9fff_-]/g,"_")}.json`,j.click(),URL.revokeObjectURL(O)},v=async()=>{if(!e)return;const S=await Cx(e);await navigator.clipboard.writeText(JSON.stringify(S,null,2)),m(!0),setTimeout(()=>m(!1),2e3)};if(!o||!e)return i.jsx("div",{className:"flex flex-1 items-center justify-center",children:i.jsx(ln,{className:"h-5 w-5 fs-spin text-fg-5"})});const A=o.isSystem>=1,C=PB(o.name);return i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsxs("div",{className:"mx-auto max-w-3xl space-y-6 p-6",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.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:i.jsx(xo,{className:"h-4 w-4"})}),i.jsx("div",{className:ne("flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-sm font-semibold",C.bg,C.text),children:C.initial}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h1",{className:"truncate text-lg font-bold text-fg",children:o.name}),A&&i.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&&i.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"})]}),i.jsxs("p",{className:"mt-0.5 text-xs text-fg-4",children:[i.jsx("span",{className:"font-mono",children:o.baseAgent}),o.model&&i.jsxs("span",{className:"ml-1.5 text-fg-5",children:["· ",o.model]})]}),o.description&&i.jsx("p",{className:"mt-1 text-xs text-fg-4",children:o.description})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[i.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:i.jsx(l3,{className:"h-4 w-4"})}),i.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?i.jsx(On,{className:"h-4 w-4 text-green-500"}):i.jsx(JA,{className:"h-4 w-4"})}),!A&&(h?i.jsxs("div",{className:"flex items-center gap-1",children:[i.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:i.jsx(On,{className:"h-4 w-4"})}),i.jsx("button",{type:"button",onClick:()=>b(!1),className:"rounded-md border border-line p-1.5 text-fg-4 hover:bg-elevated",children:i.jsx(gt,{className:"h-4 w-4"})})]}):i.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:i.jsx(Cs,{className:"h-4 w-4"})}))]})]}),i.jsx(FB,{agent:o,fragments:u,onSave:g}),i.jsx(UB,{agentId:e}),i.jsx(HB,{agentId:e})]})})}let _s=null;function $B(e){const t=Date.now()-e,a=Math.floor(t/6e4);return a<1?"刚刚":a<60?`${a} 分钟前`:`${Math.floor(a/60)} 小时前`}const qE=[{id:"repos",label:"仓库",icon:xy},{id:"usage",label:"Claude 账号",icon:Qc},{id:"git",label:"Git 源站",icon:ko},{id:"models",label:"模型",icon:bc},{id:"agents",label:"AGENTS.md",icon:zh}],qB={id:"server",label:"服务器",icon:Ay};function kh(e){if(!e)return null;const t=new Date(e).getTime()-Date.now();if(t<=0)return"已重置";const a=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4);return a>0?`${a}h ${r}m 后重置`:`${r}m 后重置`}function YB(e){return e>=90?"bg-red-500":e>=70?"bg-amber-500":"bg-blue-500"}function Zm({label:e,window:t}){if(!t)return null;const a=Math.round(t.utilization),r=kh(t.resets_at),o=a>=90,u=a>=70;return i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsx("span",{className:"min-w-0 truncate text-xs font-medium text-fg-3",children:e}),i.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r&&i.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:[i.jsx(Vc,{className:"h-2.5 w-2.5"}),r]}),i.jsxs("span",{className:ne("text-sm font-bold leading-none tabular-nums",o?"text-red-400":u?"text-amber-400":"text-fg"),children:[a,"%"]})]})]}),i.jsx("div",{className:"h-2.5 overflow-hidden rounded-full bg-elevated ring-1 ring-inset ring-line/60",children:i.jsx("div",{className:ne("h-full rounded-full transition-all duration-500 ease-out",YB(a),o?"shadow-sm shadow-red-500/50":u?"shadow-sm shadow-amber-500/40":null),style:{width:`${Math.min(a,100)}%`}})})]})}function GB({account:e,onSwitch:t,switching:a}){var o;const r=e.active;return i.jsxs("div",{className:ne("relative overflow-hidden rounded-xl border bg-base p-4 shadow-sm transition-colors",r?"border-blue-500/30 ring-1 ring-inset ring-blue-500/20":"border-line"),children:[r&&i.jsx("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-1 bg-blue-500"}),i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("div",{className:ne("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg",r?"bg-blue-500/15 text-blue-500":"bg-elevated text-fg-4"),children:i.jsx(vy,{className:"h-3.5 w-3.5"})}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:e.label}),r&&i.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:[i.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-blue-500 shadow-sm shadow-blue-500/60"}),"当前"]}),!r&&t&&i.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&&i.jsx(ln,{className:"h-2.5 w-2.5 fs-spin"}),"切换"]}),e.excluded&&i.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:[i.jsx(IA,{className:"h-2.5 w-2.5"}),"不自动切"]}),e.needsReauth&&i.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:[i.jsx(Tn,{className:"h-2.5 w-2.5"}),"需重新登录"]})]}),e.holders&&e.holders.length>0&&i.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-fg-5",children:[i.jsx(Sy,{className:"h-3 w-3 shrink-0"}),i.jsx("span",{className:"truncate",children:e.holders.join(", ")})]}),e.error&&!e.usage?i.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:[i.jsx(Tn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),i.jsx("span",{className:"min-w-0 break-words",children:e.error})]}):e.usage?i.jsxs("div",{className:"mt-4 space-y-3",children:[i.jsx(Zm,{label:"5 小时窗口",window:e.usage.five_hour}),i.jsx(Zm,{label:"7 天窗口",window:e.usage.seven_day}),(o=e.usage.scoped)==null?void 0:o.map(u=>i.jsx(Zm,{label:u.label,window:u},u.label))]}):null]})}function KB(){const[e,t]=T.useState((_s==null?void 0:_s.data)??null),[a,r]=T.useState(!_s),[o,u]=T.useState(null),[c,f]=T.useState(null),[m,h]=T.useState((_s==null?void 0:_s.fetchedAt)??null),[,b]=T.useState(0),g=T.useCallback(A=>{const C=Date.now();_s={data:A,fetchedAt:C},t(A),h(C)},[]),y=T.useCallback(()=>{r(!0),u(null),Py().then(A=>{g(A),r(!1)}).catch(A=>{u(A instanceof Error?A.message:String(A)),r(!1)})},[g]);T.useEffect(()=>{_s||y()},[y]),T.useEffect(()=>{const A=setInterval(()=>b(C=>C+1),3e4);return()=>clearInterval(A)},[]);const N=T.useRef(!1),v=T.useCallback(A=>{N.current||(N.current=!0,f(A),Uy(A).then(C=>{g(C),f(null)}).catch(C=>{u(C instanceof Error?C.message:String(C)),f(null)}).finally(()=>{N.current=!1}))},[g]);return i.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[i.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 text-blue-500",children:i.jsx(b3,{className:"h-4 w-4"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Claude 订阅额度"}),i.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"各账号的 Pro/Max 订阅窗口用量。"})]})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[m&&i.jsx("span",{className:"text-[10px] tabular-nums text-fg-5",children:$B(m)}),i.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:i.jsx(zr,{className:ne("h-4 w-4",a&&"fs-spin")})})]})]}),i.jsx("div",{className:"mt-4 space-y-2.5",children:a&&!e?i.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[i.jsx(ln,{className:"h-5 w-5 fs-spin"}),i.jsx("p",{className:"text-xs",children:"加载中…"})]}):o&&!e?i.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-red-400",children:[i.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-red-500/10",children:i.jsx(Tn,{className:"h-5 w-5"})}),i.jsx("p",{className:"max-w-xs text-center text-xs leading-relaxed",children:o})]}):e&&e.accounts.length===0?i.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[i.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-elevated text-fg-4",children:i.jsx(Sy,{className:"h-5 w-5"})}),i.jsx("p",{className:"max-w-xs text-center text-xs leading-relaxed",children:"未找到账号。请在 OpenCode TUI 中通过 claude-accounts-usage 插件登录。"})]}):e?e.accounts.map(A=>i.jsx(GB,{account:A,onSwitch:v,switching:c===A.id},A.id)):null})]})}function VB({host:e,onDelete:t}){const[a,r]=T.useState(!1);return i.jsxs("div",{className:"group flex items-center gap-3 rounded-lg border border-line bg-base px-4 py-3",children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm font-medium text-fg",children:e.name}),i.jsx("span",{className:"rounded bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-4",children:e.platform})]}),i.jsxs("div",{className:"mt-0.5 flex items-center gap-2 font-mono text-xs text-fg-4",children:[i.jsx("span",{children:e.host}),i.jsx("span",{className:"text-fg-6",children:"·"}),i.jsx("span",{className:"text-fg-5",children:e.token})]})]}),a?i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("button",{type:"button",onClick:t,className:"rounded p-1.5 text-red-400 hover:bg-red-500/10",children:i.jsx(On,{className:"h-4 w-4"})}),i.jsx("button",{type:"button",onClick:()=>r(!1),className:"rounded p-1.5 text-fg-4 hover:bg-elevated",children:i.jsx(gt,{className:"h-4 w-4"})})]}):i.jsx("button",{type:"button",onClick:()=>r(!0),className:"rounded p-1.5 text-fg-5 opacity-0 transition-opacity hover:text-red-400 group-hover:opacity-100",children:i.jsx(Cs,{className:"h-4 w-4"})})]})}function XB({onAdded:e}){const[t,a]=T.useState(!1),[r,o]=T.useState(""),[u,c]=T.useState(""),[f,m]=T.useState(""),[h,b]=T.useState("gitea"),[g,y]=T.useState(!1),[N,v]=T.useState(!1),A=()=>{o(""),c(""),m(""),b("gitea"),a(!1)},C=async()=>{if(!(!r.trim()||!u.trim()||!f.trim())){y(!0);try{await DC(r.trim(),u.trim(),f.trim(),h),A(),e()}finally{y(!1)}}};return t?i.jsxs("div",{className:"space-y-3 rounded-lg border border-line bg-base p-4",children:[i.jsxs("div",{className:"flex gap-3",children:[i.jsxs("label",{className:"flex-1",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"名称"}),i.jsx("input",{type:"text",value:u,onChange:S=>c(S.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"})]}),i.jsxs("label",{className:"w-28",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"平台"}),i.jsxs("select",{value:h,onChange:S=>b(S.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:[i.jsx("option",{value:"gitea",children:"Gitea"}),i.jsx("option",{value:"github",children:"GitHub"}),i.jsx("option",{value:"gitlab",children:"GitLab"})]})]})]}),i.jsxs("label",{className:"block",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Host"}),i.jsx("input",{type:"text",value:r,onChange:S=>o(S.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"})]}),i.jsxs("label",{className:"block",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Token"}),i.jsxs("div",{className:"relative mt-1",children:[i.jsx("input",{type:N?"text":"password",value:f,onChange:S=>m(S.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"}),i.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?i.jsx(d3,{className:"h-3.5 w-3.5"}):i.jsx(m3,{className:"h-3.5 w-3.5"})})]})]}),i.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[i.jsx("button",{type:"button",onClick:A,className:"rounded-md px-3 py-1.5 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),i.jsx("button",{type:"button",onClick:()=>void C(),disabled:g||!r.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?"保存中…":"保存"})]})]}):i.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:[i.jsx(Ia,{className:"h-3.5 w-3.5"})," 添加 Git 源站"]})}function QB(){const[e,t]=T.useState(""),[a,r]=T.useState(""),[o,u]=T.useState(!0),[c,f]=T.useState(!1),[m,h]=T.useState(null);T.useEffect(()=>{SC().then(y=>{t(y.content),r(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 AC(e),r(e)}catch(y){h(y instanceof Error?y.message:String(y))}f(!1)},g=e!==a;return i.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-sm font-semibold text-fg",children:"全局 AGENTS.md"}),i.jsx("p",{className:"mt-1 text-xs text-fg-4",children:"此内容会注入到所有仓库的 Agent 系统指令中。修改后 opencode 热加载,即时生效。"})]}),i.jsxs("button",{type:"button",onClick:()=>void b(),disabled:c||!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:[i.jsx(Xc,{className:"h-3.5 w-3.5"}),c?"保存中…":"保存"]})]}),m&&i.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:[i.jsx(Tn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),i.jsx("span",{className:"min-w-0 break-words",children:m})]}),i.jsx("div",{className:"mt-4",children:o?i.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[i.jsx(ln,{className:"h-5 w-5 fs-spin"}),i.jsx("p",{className:"text-xs",children:"加载中…"})]}):i.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
511
-
512
- 在此编写全局 Agent 指令…`})}),i.jsx("p",{className:"mt-3 text-[11px] text-fg-5",children:"文件路径:~/.config/opencode/AGENTS.md"})]})}function WB(){const[e,t]=T.useState([]),[a,r]=T.useState(!0),o=()=>{MC().then(c=>{t(c),r(!1)}).catch(()=>r(!1))};T.useEffect(o,[]);const u=async c=>{await LC(c),t(f=>f.filter(m=>m.id!==c))};return i.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[i.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Git 源站管理"}),i.jsx("p",{className:"mt-1 text-xs text-fg-4",children:"为不同的 Git 托管平台配置访问凭证,用于同步 Issues。系统会根据仓库的 git URL 自动匹配对应的源站。"}),i.jsx("div",{className:"mt-4 space-y-2",children:a?i.jsx("p",{className:"py-4 text-center font-mono text-xs text-fg-5",children:"加载中…"}):i.jsxs(i.Fragment,{children:[e.map(c=>i.jsx(VB,{host:c,onDelete:()=>void u(c.id)},c.id)),i.jsx(XB,{onAdded:o})]})}),i.jsx("p",{className:"mt-4 text-[11px] text-fg-5",children:"Token 存储在数据库中。也可通过环境变量 GITEA_TOKEN 设置全局 fallback。"})]})}const YE="pinned_models";function ZB(e){const t=new Map;for(const a of e){const r=a.providerName||a.providerID,o=t.get(r);o?o.push(a):t.set(r,[a])}return Array.from(t,([a,r])=>({provider:a,models:r})).sort((a,r)=>{const o=a.models.some(c=>c.configured),u=r.models.some(c=>c.configured);return o!==u?o?-1:1:a.provider.localeCompare(r.provider)})}function JB(e){return e?e>=1e6?`${(e/1e6).toFixed(e%1e6===0?0:1)}M`:e>=1e3?`${Math.round(e/1e3)}K`:String(e):""}function eP(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 tP(){const e=je(O=>O.activeRepoId),[t,a]=T.useState([]),[r,o]=T.useState(new Set),[u,c]=T.useState(!0),[f,m]=T.useState(null),[h,b]=T.useState(null),[g,y]=T.useState("");T.useEffect(()=>{let O=!1;async function j(){c(!0),m(null);try{const[I,U]=await Promise.all([Oo(),e?Ro(e):Promise.resolve([])]);if(O)return;const $=I[YE],Z=$?JSON.parse($):[];o(new Set(Z)),a(U),b(null),y("")}catch(I){O||m(I instanceof Error?I.message:String(I))}O||c(!1)}return j(),()=>{O=!0}},[e]);const N=async O=>{const j=new Set(r);j.has(O)?j.delete(O):j.add(O),o(j);try{await rh(YE,JSON.stringify([...j]))}catch{o(r)}},v=T.useMemo(()=>ZB(t),[t]),A=t.filter(O=>r.has(O.id)).length,C=h?v.find(O=>O.provider===h):v[0],S=g.trim().toLowerCase(),M=C?S?C.models.filter(O=>(O.name||O.id).toLowerCase().includes(S)||O.id.toLowerCase().includes(S)):C.models:[];return i.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[i.jsx("div",{className:"flex items-center justify-between gap-3",children:i.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[i.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 text-blue-500",children:i.jsx(bc,{className:"h-4 w-4"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-sm font-semibold text-fg",children:"常用模型"}),i.jsxs("p",{className:"mt-0.5 text-xs text-fg-4",children:["勾选常用模型,在新建对话时快速选择。",A>0&&i.jsxs("span",{className:"ml-1 text-blue-400",children:["已选 ",A," 个"]})]})]})]})}),i.jsx("div",{className:"mt-4",children:e?u?i.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[i.jsx(ln,{className:"h-5 w-5 fs-spin"}),i.jsx("p",{className:"text-xs",children:"加载模型列表…"})]}):f?i.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-red-400",children:[i.jsx(Tn,{className:"h-5 w-5"}),i.jsx("p",{className:"max-w-xs text-center text-xs leading-relaxed",children:f})]}):t.length===0?i.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[i.jsx(bc,{className:"h-5 w-5"}),i.jsx("p",{className:"text-xs",children:"当前仓库没有可用模型。"})]}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex gap-1 overflow-x-auto rounded-lg border border-line bg-base p-1",children:v.map(O=>{var U;const j=O.provider===(h??((U=v[0])==null?void 0:U.provider)),I=O.models.filter($=>r.has($.id)).length;return i.jsxs("button",{type:"button",onClick:()=>{b(O.provider),y("")},className:ne("flex shrink-0 items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",j?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-3"),children:[O.provider,I>0&&i.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:I})]},O.provider)})}),i.jsxs("div",{className:"mt-3 flex items-center gap-2 rounded-md border border-line bg-base px-3 py-1.5",children:[i.jsx(Pr,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),i.jsx("input",{type:"text",value:g,onChange:O=>y(O.target.value),placeholder:"搜索模型…",className:"min-w-0 flex-1 bg-transparent text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),g&&i.jsx("button",{type:"button",onClick:()=>y(""),className:"text-fg-5 hover:text-fg-3",children:i.jsx(gt,{className:"h-3 w-3"})})]}),i.jsx("div",{className:"mt-3 rounded-lg border border-line bg-base",children:M.length===0?i.jsx("div",{className:"px-3 py-6 text-center text-xs text-fg-5",children:"无匹配模型"}):i.jsx("div",{className:"divide-y divide-line/40",children:M.map(O=>{const j=r.has(O.id),I=JB(O.contextLimit),U=eP(O.cost);return i.jsxs("label",{className:ne("flex cursor-pointer items-center gap-3 px-3 py-2 transition-colors hover:bg-elevated/60",j&&"bg-blue-500/5"),children:[i.jsx("input",{type:"checkbox",checked:j,onChange:()=>void N(O.id),className:"h-3.5 w-3.5 shrink-0 cursor-pointer rounded border-line accent-blue-500"}),i.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-fg",children:O.name||O.id}),i.jsxs("span",{className:"flex shrink-0 items-center gap-2",children:[I&&i.jsx("span",{className:"rounded bg-surface px-1.5 py-0.5 text-[10px] text-fg-5",children:I}),U&&i.jsx("span",{className:"text-[10px] text-fg-6",children:U})]})]},O.id)})})})]}):i.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[i.jsx(bc,{className:"h-5 w-5"}),i.jsx("p",{className:"text-xs",children:"请先在左侧选择一个仓库以加载可用模型。"})]})})]})}function nP(){const[e,t]=T.useState(sh),[a,r]=T.useState(!1),[o,u]=T.useState(null),[c,f]=T.useState(sh),m=e!==c,h=async()=>{const g=e.replace(/\/+$/,"");if(g){r(!0),u(null);try{const y=await fetch(`${g}/api/health`,{signal:AbortSignal.timeout(5e3)});u(y.ok?"ok":"fail")}catch{u("fail")}r(!1)}},b=()=>{const g=e.replace(/\/+$/,"");S5(g),f(g),t(g)};return i.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[i.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 text-blue-500",children:i.jsx(Ay,{className:"h-4 w-4"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-sm font-semibold text-fg",children:"服务器连接"}),i.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"配置远程 Fourth Spark Server 地址。"})]})]}),i.jsxs("div",{className:"mt-4 space-y-3",children:[i.jsxs("label",{className:"block",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"服务器地址"}),i.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"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.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?i.jsx(ln,{className:"h-3.5 w-3.5 fs-spin"}):i.jsx(zr,{className:"h-3.5 w-3.5"}),"测试连接"]}),i.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:[i.jsx(Xc,{className:"h-3.5 w-3.5"}),"保存"]}),o==="ok"&&i.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-green-500",children:[i.jsx(On,{className:"h-3.5 w-3.5"})," 连接成功"]}),o==="fail"&&i.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-red-400",children:[i.jsx(Tn,{className:"h-3.5 w-3.5"})," 连接失败"]})]})]}),i.jsx("p",{className:"mt-4 text-[11px] text-fg-5",children:"保存后需重新打开 App 生效。确保手机与开发机在同一局域网。"})]})}function aP(){const[e,t]=T.useState("local"),[a,r]=T.useState(!1),[o,u]=T.useState(!1);T.useEffect(()=>{ih().then(f=>{const m=f.mode==="worker";r(m),t(m?"cloud":"local")}).catch(()=>{}).finally(()=>u(!0))},[]);const c=T.useCallback(f=>{const m=f.mode==="worker";r(m),m&&t("cloud")},[]);return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex gap-1 rounded-lg border border-line bg-base p-1",children:[i.jsxs("button",{type:"button",onClick:()=>{a||t("local")},disabled:a,className:ne("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:[i.jsx(Qc,{className:"h-3.5 w-3.5"}),"本地模式"]}),i.jsxs("button",{type:"button",onClick:()=>t("cloud"),className:ne("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:[i.jsx(yy,{className:"h-3.5 w-3.5"}),"账号池"]})]}),o&&e==="local"&&i.jsx(KB,{}),o&&e==="cloud"&&i.jsx(rP,{onStatusChange:c})]})}function sP({onClose:e,onSwitched:t}){const[a,r]=T.useState([]),[o,u]=T.useState(!0),[c,f]=T.useState(null),[m,h]=T.useState(null);T.useEffect(()=>{Py().then(N=>r(N.accounts)).catch(()=>{}).finally(()=>u(!1))},[]);const b=async N=>{f(N),h(null);try{await Uy(N),t(),e()}catch(v){const A=v instanceof Error?v.message:String(v);h(A||"切换失败"),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 i.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:i.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:[i.jsxs("div",{className:"flex shrink-0 items-center justify-between",children:[i.jsx("h2",{className:"text-sm font-semibold text-fg",children:"切换账号"}),i.jsx("button",{type:"button",onClick:e,className:"rounded-md p-1 text-fg-4 transition-colors hover:bg-elevated hover:text-fg-3",children:i.jsx(gt,{className:"h-4 w-4"})})]}),o?i.jsx("div",{className:"flex items-center justify-center py-10",children:i.jsx(ln,{className:"h-5 w-5 fs-spin text-fg-4"})}):a.length===0?i.jsx("p",{className:"py-10 text-center text-xs text-fg-4",children:"暂无可用账号"}):i.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=>i.jsxs("button",{type:"button",disabled:c!==null,onClick:()=>{N.active||b(N.id)},className:ne("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",c===N.id&&"opacity-60"),children:[i.jsx("div",{className:"min-w-0 flex-1",children:i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"truncate text-xs font-medium text-fg",children:N.label}),N.active&&i.jsx("span",{className:"rounded bg-blue-500/15 px-1.5 py-0.5 text-[9px] font-semibold text-blue-500",children:"当前"}),c===N.id&&i.jsx(ln,{className:"h-3 w-3 fs-spin text-blue-500"})]})}),i.jsxs("div",{className:"flex shrink-0 gap-2 text-right sm:gap-4",children:[i.jsxs("div",{className:"w-14 sm:w-20",children:[i.jsx("div",{className:"text-[10px] text-fg-5",children:"5h"}),g(N)?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:ne("text-xs font-medium",g(N).utilization>80?"text-red-400":"text-fg-3"),children:[Math.round(g(N).utilization),"%"]}),i.jsx("div",{className:"hidden text-[9px] text-fg-5 sm:block",children:g(N).resets_at?kh(g(N).resets_at):""})]}):i.jsx("div",{className:"text-[10px] text-fg-5",children:"—"})]}),i.jsxs("div",{className:"w-14 sm:w-20",children:[i.jsx("div",{className:"text-[10px] text-fg-5",children:"7d"}),y(N)?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:ne("text-xs font-medium",y(N).utilization>80?"text-red-400":"text-fg-3"),children:[Math.round(y(N).utilization),"%"]}),i.jsx("div",{className:"hidden text-[9px] text-fg-5 sm:block",children:y(N).resets_at?kh(y(N).resets_at):""})]}):i.jsx("div",{className:"text-[10px] text-fg-5",children:"—"})]})]})]},N.id))}),m&&i.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:[i.jsx(Tn,{className:"h-3.5 w-3.5 shrink-0 text-red-400"}),i.jsx("span",{className:"text-xs text-red-400",children:m})]})]})})}function rP({onStatusChange:e}){const[t,a]=T.useState(""),[r,o]=T.useState(""),[u,c]=T.useState(""),[f,m]=T.useState(""),[h,b]=T.useState(!1),[g,y]=T.useState(null),[N,v]=T.useState(!1),[A,C]=T.useState(null),[S,M]=T.useState(!1);T.useEffect(()=>{let K=!1;return(async()=>{const[D,te]=await Promise.all([Oo().catch(()=>({})),ih().catch(()=>null)]);if(K)return;const le=D.cloud_master_url??"",pe=D.cloud_worker_id||(te==null?void 0:te.defaultWorkerId)||"";a(le),c(le),o(pe),m(D.cloud_worker_id??""),C(te)})(),()=>{K=!0}},[]);const j=((A==null?void 0:A.mode)??(u?"worker":"local"))==="worker",I=!j&&!!t.trim()&&!!r.trim(),U=t!==u||r!==f||I,$=async()=>{const K=t.replace(/\/+$/,"");if(!K)return;b(!0),y(null);const D=await IC(K);y(D?"ok":"fail"),b(!1)},Z=async()=>{const K=t.replace(/\/+$/,""),D=r.trim();v(!0);try{await rh("cloud_master_url",K),await rh("cloud_worker_id",D),c(K),m(D),a(K),o(D);const te=await OC().catch(()=>null);te&&(C(te),e==null||e(te))}finally{v(!1)}};return i.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[i.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 text-blue-500",children:i.jsx(yy,{className:"h-4 w-4"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-sm font-semibold text-fg",children:"账号池配置"}),i.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"连接 claude-accounts-pool Master,共享多账号池。"})]})]}),i.jsxs("div",{className:"mt-4 space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-line bg-base px-3 py-2",children:[i.jsx("span",{className:ne("h-2 w-2 shrink-0 rounded-full",j?"bg-blue-500 shadow-sm shadow-blue-500/60":"bg-green-500 shadow-sm shadow-green-500/60")}),i.jsx("span",{className:"text-xs font-medium text-fg-3",children:j?"Worker 模式":"本地模式"}),j&&(A==null?void 0:A.workerId)&&i.jsx("span",{className:"rounded bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-4",children:A.workerId}),j&&(A==null?void 0:A.connected)!=null&&i.jsx("span",{className:ne("ml-auto text-[10px] font-medium",A.connected?"text-green-500":"text-red-400"),children:A.connected?"已连接":"未连接"})]}),j&&(A==null?void 0:A.heldAccount)&&i.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-line bg-base px-3 py-2",children:[i.jsx(vy,{className:"h-3.5 w-3.5 shrink-0 text-blue-500"}),i.jsx("span",{className:"text-xs text-fg-4",children:"当前账号"}),i.jsx("span",{className:"min-w-0 truncate text-xs font-medium text-fg",children:A.heldAccount.label}),i.jsx("button",{type:"button",onClick:()=>M(!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:"切换账号"})]})]}),i.jsxs("div",{className:"mt-4 space-y-3",children:[i.jsxs("label",{className:"block",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Master URL"}),i.jsx("input",{type:"url",value:t,onChange:K=>{a(K.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"})]}),i.jsxs("label",{className:"block",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Worker ID"}),i.jsx("input",{type:"text",value:r,onChange:K=>o(K.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"}),i.jsx("span",{className:"mt-1 block text-[11px] text-fg-5",children:"此 Worker 在账号池中的唯一标识,建议用小写字母、数字和连字符。"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{type:"button",onClick:()=>void $(),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?i.jsx(ln,{className:"h-3.5 w-3.5 fs-spin"}):i.jsx(zr,{className:"h-3.5 w-3.5"}),"测试连接"]}),i.jsxs("button",{type:"button",onClick:()=>void Z(),disabled:!U||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:[i.jsx(Xc,{className:"h-3.5 w-3.5"}),N?"保存中…":"保存"]}),g==="ok"&&i.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-green-500",children:[i.jsx(On,{className:"h-3.5 w-3.5"})," 连接成功"]}),g==="fail"&&i.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-red-400",children:[i.jsx(Tn,{className:"h-3.5 w-3.5"})," 连接失败"]})]})]}),i.jsx("p",{className:"mt-4 text-[11px] text-fg-5",children:"清空 Master URL 可切回本地模式。"}),S&&i.jsx(sP,{onClose:()=>M(!1),onSwitched:async()=>{const K=await ih().catch(()=>null);K&&(C(K),e==null||e(K))}})]})}function iP(){const[e,t]=T.useState("usage"),a=T.useMemo(()=>ky()||sh()?[...qE,qB]:qE,[]);return i.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:i.jsxs("div",{className:ne("mx-auto",e==="repos"?"max-w-4xl":"max-w-2xl"),children:[i.jsx("h1",{className:"text-lg font-semibold text-fg",children:"设置"}),i.jsx("p",{className:"mt-0.5 text-sm text-fg-4",children:"全局配置"}),i.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(r=>i.jsxs("button",{type:"button",onClick:()=>t(r.id),className:ne("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===r.id?"bg-base text-fg shadow-sm":"text-fg-4 hover:text-fg-3"),children:[i.jsx(r.icon,{className:"h-3.5 w-3.5"}),r.label]},r.id))}),i.jsxs("div",{className:"mt-4",children:[e==="repos"&&i.jsx($y,{}),e==="usage"&&i.jsx(aP,{}),e==="git"&&i.jsx(WB,{}),e==="models"&&i.jsx(tP,{}),e==="agents"&&i.jsx(QB,{}),e==="server"&&i.jsx(nP,{})]})]})})}const lP=300,oP=4e3,uP={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 cP(){const e=Qt(h=>h.toasts),t=Qt(h=>h.removeToast),a=Re(h=>h.setActiveSession),r=je(zn),o=vn(),u=h=>{t(h.id),h.sessionId&&(a(h.sessionId),o(`/${encodeURIComponent(r)}/run`))},[c,f]=T.useState([]),m=T.useRef(new Map);return T.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]),T.useEffect(()=>{const h=m.current;for(const b of c)b.exiting&&!h.has(b.id)&&h.set(b.id,setTimeout(()=>{h.delete(b.id),f(g=>g.filter(y=>y.id!==b.id))},lP))},[c]),T.useEffect(()=>{const h=m.current;return()=>h.forEach(clearTimeout)},[]),c.length===0?null:i.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:c.map(h=>{const b=uP[h.variant];return i.jsx("div",{className:"grid w-full transition-[grid-template-rows] duration-300 ease-out",style:{gridTemplateRows:h.exiting?"0fr":"1fr"},children:i.jsx("div",{className:"min-h-0 overflow-hidden",children:i.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:[i.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}),i.jsx("p",{className:"min-w-0 flex-1 text-sm leading-snug break-words text-fg",children:h.message}),h.persistent&&!h.exiting&&i.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&&i.jsx("span",{"aria-hidden":!0,className:`absolute bottom-0 left-0 h-0.5 w-full origin-left ${b.bar}`,style:{animation:`toast-progress ${oP}ms linear forwards`}})]})})},h.id)})})}const io=Po("PushNotifications",{});let GE=!1;async function dP(e){!ky()||GE||(GE=!0,(await io.requestPermissions()).receive!=="granted")||(io.addListener("registration",async a=>{try{await jC(a.value,"ios")}catch{}}),io.addListener("registrationError",()=>{}),io.addListener("pushNotificationActionPerformed",a=>{const r=a.notification.data,o=r==null?void 0:r.sessionId;if(o){const u=zn(je.getState());u&&e(`/${encodeURIComponent(u)}/run?session=${o}`)}}),await io.register())}function fP(e){const t=e.match(/^\/([^/]+)\/(run|agents|issues|pulls|dev)/);return t?decodeURIComponent(t[1]):null}function mP(){const e=je(r=>r.repos),a=je(zn)??(e.length>0?e[0].name:null);return a?i.jsx(Fi,{to:`/${encodeURIComponent(a)}/run`,replace:!0}):i.jsx(Fi,{to:"/repos",replace:!0})}function KE({segment:e}){const{repoId:t}=uy(),{search:a}=_n();return t?i.jsx(Fi,{to:`/${encodeURIComponent(t)}/dev/${e}${a}`,replace:!0}):i.jsx(Fi,{to:"/repos",replace:!0})}function hP(){const e=vn(),t=_n(),a=je(f=>f.activeRepoId),r=je(f=>f.repos),o=je(f=>f.setActiveRepo),u=Re(f=>f.loadSessions),c=Re(f=>f.clearSessions);return T.useEffect(()=>(je.getState().loadRepos(),dP(e),ah.getState().init()),[e]),T.useEffect(()=>{if(r.length===0)return;const f=fP(t.pathname);if(!f)return;const m=r.find(h=>h.name===f);m&&m.id!==je.getState().activeRepoId&&o(m.id)},[t.pathname,r,o]),T.useEffect(()=>(a?(c(),Ve.getState().clearIssues(),mn.getState().clearPulls(),u(),or.getState().loadAgents(),Ve.getState().loadIssues(),mn.getState().loadPulls(),Lc.start(a)):(c(),Ve.getState().clearIssues(),mn.getState().clearPulls()),()=>Lc.stop()),[a,u,c]),i.jsxs(i.Fragment,{children:[i.jsx(PS,{children:i.jsxs(na,{element:i.jsx(qC,{}),children:[i.jsx(na,{path:"/repos",element:i.jsx(XC,{})}),i.jsx(na,{path:"/settings",element:i.jsx(iP,{})}),i.jsx(na,{path:"/:repoId/run",element:i.jsx(WL,{})}),i.jsx(na,{path:"/:repoId/agents",element:i.jsx(LB,{})}),i.jsx(na,{path:"/:repoId/agents/:agentId",element:i.jsx(zB,{})}),i.jsx(na,{path:"/:repoId/dev",element:i.jsx(Fi,{to:"issues",replace:!0})}),i.jsx(na,{path:"/:repoId/dev/issues",element:i.jsx(UE,{})}),i.jsx(na,{path:"/:repoId/dev/pulls",element:i.jsx(UE,{})}),i.jsx(na,{path:"/:repoId/issues",element:i.jsx(KE,{segment:"issues"})}),i.jsx(na,{path:"/:repoId/pulls",element:i.jsx(KE,{segment:"pulls"})}),i.jsx(na,{path:"/:repoId",element:i.jsx(Fi,{to:"run",replace:!0})}),i.jsx(na,{path:"*",element:i.jsx(mP,{})})]})}),i.jsx(cP,{})]})}function pP(){return i.jsx(uA,{children:i.jsx(hP,{})})}const T_=document.getElementById("root");if(!T_)throw new Error("Root element #root not found in index.html");jv.createRoot(T_).render(i.jsx(T.StrictMode,{children:i.jsx(pP,{})}));export{hp as W};