@xbghc/warden 0.6.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,198 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/scss-OYdSNvt2.js","assets/css-DPfMkruS.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/vue-DVfSmUF7.js","assets/typescript-BPQ3VLAy.js","assets/json-Cp-IABpG.js","assets/svelte-DZMnMd3x.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/cpp-BRuaLJcg.js","assets/c-BIGW1oBm.js","assets/sql-BLtJtn59.js","assets/php-Dhbhpdrm.js","assets/ruby-BGX7qA9Y.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/tsx-COt5Ahok.js","assets/shellscript-Yzrsuije.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/nginx-BpAMiNFr.js"])))=>i.map(i=>d[i]);
2
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();function qc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ru={exports:{}},ms={},Lu={exports:{}},Me={};var dp;function Ew(){if(dp)return Me;dp=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.iterator;function y(M){return M===null||typeof M!="object"?null:(M=m&&M[m]||M["@@iterator"],typeof M=="function"?M:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,_={};function N(M,W,T){this.props=M,this.context=W,this.refs=_,this.updater=T||v}N.prototype.isReactComponent={},N.prototype.setState=function(M,W){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,W,"setState")},N.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function C(){}C.prototype=N.prototype;function b(M,W,T){this.props=M,this.context=W,this.refs=_,this.updater=T||v}var E=b.prototype=new C;E.constructor=b,w(E,N.prototype),E.isPureReactComponent=!0;var B=Array.isArray,O=Object.prototype.hasOwnProperty,D={current:null},ie={key:!0,ref:!0,__self:!0,__source:!0};function U(M,W,T){var ye,be={},ge=null,je=null;if(W!=null)for(ye in W.ref!==void 0&&(je=W.ref),W.key!==void 0&&(ge=""+W.key),W)O.call(W,ye)&&!ie.hasOwnProperty(ye)&&(be[ye]=W[ye]);var Ie=arguments.length-2;if(Ie===1)be.children=T;else if(1<Ie){for(var Le=Array(Ie),He=0;He<Ie;He++)Le[He]=arguments[He+2];be.children=Le}if(M&&M.defaultProps)for(ye in Ie=M.defaultProps,Ie)be[ye]===void 0&&(be[ye]=Ie[ye]);return{$$typeof:e,type:M,key:ge,ref:je,props:be,_owner:D.current}}function ce(M,W){return{$$typeof:e,type:M.type,key:W,ref:M.ref,props:M.props,_owner:M._owner}}function R(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function H(M){var W={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(T){return W[T]})}var J=/\/+/g;function fe(M,W){return typeof M=="object"&&M!==null&&M.key!=null?H(""+M.key):W.toString(36)}function ee(M,W,T,ye,be){var ge=typeof M;(ge==="undefined"||ge==="boolean")&&(M=null);var je=!1;if(M===null)je=!0;else switch(ge){case"string":case"number":je=!0;break;case"object":switch(M.$$typeof){case e:case t:je=!0}}if(je)return je=M,be=be(je),M=ye===""?"."+fe(je,0):ye,B(be)?(T="",M!=null&&(T=M.replace(J,"$&/")+"/"),ee(be,W,T,"",function(He){return He})):be!=null&&(R(be)&&(be=ce(be,T+(!be.key||je&&je.key===be.key?"":(""+be.key).replace(J,"$&/")+"/")+M)),W.push(be)),1;if(je=0,ye=ye===""?".":ye+":",B(M))for(var Ie=0;Ie<M.length;Ie++){ge=M[Ie];var Le=ye+fe(ge,Ie);je+=ee(ge,W,T,Le,be)}else if(Le=y(M),typeof Le=="function")for(M=Le.call(M),Ie=0;!(ge=M.next()).done;)ge=ge.value,Le=ye+fe(ge,Ie++),je+=ee(ge,W,T,Le,be);else if(ge==="object")throw W=String(M),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.");return je}function te(M,W,T){if(M==null)return M;var ye=[],be=0;return ee(M,ye,"","",function(ge){return W.call(T,ge,be++)}),ye}function xe(M){if(M._status===-1){var W=M._result;W=W(),W.then(function(T){(M._status===0||M._status===-1)&&(M._status=1,M._result=T)},function(T){(M._status===0||M._status===-1)&&(M._status=2,M._result=T)}),M._status===-1&&(M._status=0,M._result=W)}if(M._status===1)return M._result.default;throw M._result}var _e={current:null},re={transition:null},ae={ReactCurrentDispatcher:_e,ReactCurrentBatchConfig:re,ReactCurrentOwner:D};function I(){throw Error("act(...) is not supported in production builds of React.")}return Me.Children={map:te,forEach:function(M,W,T){te(M,function(){W.apply(this,arguments)},T)},count:function(M){var W=0;return te(M,function(){W++}),W},toArray:function(M){return te(M,function(W){return W})||[]},only:function(M){if(!R(M))throw Error("React.Children.only expected to receive a single React element child.");return M}},Me.Component=N,Me.Fragment=n,Me.Profiler=o,Me.PureComponent=b,Me.StrictMode=i,Me.Suspense=f,Me.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ae,Me.act=I,Me.cloneElement=function(M,W,T){if(M==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+M+".");var ye=w({},M.props),be=M.key,ge=M.ref,je=M._owner;if(W!=null){if(W.ref!==void 0&&(ge=W.ref,je=D.current),W.key!==void 0&&(be=""+W.key),M.type&&M.type.defaultProps)var Ie=M.type.defaultProps;for(Le in W)O.call(W,Le)&&!ie.hasOwnProperty(Le)&&(ye[Le]=W[Le]===void 0&&Ie!==void 0?Ie[Le]:W[Le])}var Le=arguments.length-2;if(Le===1)ye.children=T;else if(1<Le){Ie=Array(Le);for(var He=0;He<Le;He++)Ie[He]=arguments[He+2];ye.children=Ie}return{$$typeof:e,type:M.type,key:be,ref:ge,props:ye,_owner:je}},Me.createContext=function(M){return M={$$typeof:l,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},M.Provider={$$typeof:a,_context:M},M.Consumer=M},Me.createElement=U,Me.createFactory=function(M){var W=U.bind(null,M);return W.type=M,W},Me.createRef=function(){return{current:null}},Me.forwardRef=function(M){return{$$typeof:c,render:M}},Me.isValidElement=R,Me.lazy=function(M){return{$$typeof:p,_payload:{_status:-1,_result:M},_init:xe}},Me.memo=function(M,W){return{$$typeof:d,type:M,compare:W===void 0?null:W}},Me.startTransition=function(M){var W=re.transition;re.transition={};try{M()}finally{re.transition=W}},Me.unstable_act=I,Me.useCallback=function(M,W){return _e.current.useCallback(M,W)},Me.useContext=function(M){return _e.current.useContext(M)},Me.useDebugValue=function(){},Me.useDeferredValue=function(M){return _e.current.useDeferredValue(M)},Me.useEffect=function(M,W){return _e.current.useEffect(M,W)},Me.useId=function(){return _e.current.useId()},Me.useImperativeHandle=function(M,W,T){return _e.current.useImperativeHandle(M,W,T)},Me.useInsertionEffect=function(M,W){return _e.current.useInsertionEffect(M,W)},Me.useLayoutEffect=function(M,W){return _e.current.useLayoutEffect(M,W)},Me.useMemo=function(M,W){return _e.current.useMemo(M,W)},Me.useReducer=function(M,W,T){return _e.current.useReducer(M,W,T)},Me.useRef=function(M){return _e.current.useRef(M)},Me.useState=function(M){return _e.current.useState(M)},Me.useSyncExternalStore=function(M,W,T){return _e.current.useSyncExternalStore(M,W,T)},Me.useTransition=function(){return _e.current.useTransition()},Me.version="18.3.1",Me}var hp;function Kc(){return hp||(hp=1,Lu.exports=Ew()),Lu.exports}var pp;function Iw(){if(pp)return ms;pp=1;var e=Kc(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(c,f,d){var p,m={},y=null,v=null;d!==void 0&&(y=""+d),f.key!==void 0&&(y=""+f.key),f.ref!==void 0&&(v=f.ref);for(p in f)i.call(f,p)&&!a.hasOwnProperty(p)&&(m[p]=f[p]);if(c&&c.defaultProps)for(p in f=c.defaultProps,f)m[p]===void 0&&(m[p]=f[p]);return{$$typeof:t,type:c,key:y,ref:v,props:m,_owner:o.current}}return ms.Fragment=n,ms.jsx=l,ms.jsxs=l,ms}var mp;function Nw(){return mp||(mp=1,Ru.exports=Iw()),Ru.exports}var x=Nw(),q=Kc();const Ss=qc(q);var Xo={},ju={exports:{}},zt={},Mu={exports:{}},Ou={};var gp;function Tw(){return gp||(gp=1,(function(e){function t(re,ae){var I=re.length;re.push(ae);e:for(;0<I;){var M=I-1>>>1,W=re[M];if(0<o(W,ae))re[M]=ae,re[I]=W,I=M;else break e}}function n(re){return re.length===0?null:re[0]}function i(re){if(re.length===0)return null;var ae=re[0],I=re.pop();if(I!==ae){re[0]=I;e:for(var M=0,W=re.length,T=W>>>1;M<T;){var ye=2*(M+1)-1,be=re[ye],ge=ye+1,je=re[ge];if(0>o(be,I))ge<W&&0>o(je,be)?(re[M]=je,re[ge]=I,M=ge):(re[M]=be,re[ye]=I,M=ye);else if(ge<W&&0>o(je,I))re[M]=je,re[ge]=I,M=ge;else break e}}return ae}function o(re,ae){var I=re.sortIndex-ae.sortIndex;return I!==0?I:re.id-ae.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],d=[],p=1,m=null,y=3,v=!1,w=!1,_=!1,N=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(re){for(var ae=n(d);ae!==null;){if(ae.callback===null)i(d);else if(ae.startTime<=re)i(d),ae.sortIndex=ae.expirationTime,t(f,ae);else break;ae=n(d)}}function B(re){if(_=!1,E(re),!w)if(n(f)!==null)w=!0,xe(O);else{var ae=n(d);ae!==null&&_e(B,ae.startTime-re)}}function O(re,ae){w=!1,_&&(_=!1,C(U),U=-1),v=!0;var I=y;try{for(E(ae),m=n(f);m!==null&&(!(m.expirationTime>ae)||re&&!H());){var M=m.callback;if(typeof M=="function"){m.callback=null,y=m.priorityLevel;var W=M(m.expirationTime<=ae);ae=e.unstable_now(),typeof W=="function"?m.callback=W:m===n(f)&&i(f),E(ae)}else i(f);m=n(f)}if(m!==null)var T=!0;else{var ye=n(d);ye!==null&&_e(B,ye.startTime-ae),T=!1}return T}finally{m=null,y=I,v=!1}}var D=!1,ie=null,U=-1,ce=5,R=-1;function H(){return!(e.unstable_now()-R<ce)}function J(){if(ie!==null){var re=e.unstable_now();R=re;var ae=!0;try{ae=ie(!0,re)}finally{ae?fe():(D=!1,ie=null)}}else D=!1}var fe;if(typeof b=="function")fe=function(){b(J)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,te=ee.port2;ee.port1.onmessage=J,fe=function(){te.postMessage(null)}}else fe=function(){N(J,0)};function xe(re){ie=re,D||(D=!0,fe())}function _e(re,ae){U=N(function(){re(e.unstable_now())},ae)}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(re){re.callback=null},e.unstable_continueExecution=function(){w||v||(w=!0,xe(O))},e.unstable_forceFrameRate=function(re){0>re||125<re?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ce=0<re?Math.floor(1e3/re):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(re){switch(y){case 1:case 2:case 3:var ae=3;break;default:ae=y}var I=y;y=ae;try{return re()}finally{y=I}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(re,ae){switch(re){case 1:case 2:case 3:case 4:case 5:break;default:re=3}var I=y;y=re;try{return ae()}finally{y=I}},e.unstable_scheduleCallback=function(re,ae,I){var M=e.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?M+I:M):I=M,re){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=I+W,re={id:p++,callback:ae,priorityLevel:re,startTime:I,expirationTime:W,sortIndex:-1},I>M?(re.sortIndex=I,t(d,re),n(f)===null&&re===n(d)&&(_?(C(U),U=-1):_=!0,_e(B,I-M))):(re.sortIndex=W,t(f,re),w||v||(w=!0,xe(O))),re},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(re){var ae=y;return function(){var I=y;y=ae;try{return re.apply(this,arguments)}finally{y=I}}}})(Ou)),Ou}var yp;function Aw(){return yp||(yp=1,Mu.exports=Tw()),Mu.exports}var kp;function Pw(){if(kp)return zt;kp=1;var e=Kc(),t=Aw();function n(r){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+r,u=1;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u]);return"Minified React error #"+r+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,o={};function a(r,s){l(r,s),l(r+"Capture",s)}function l(r,s){for(o[r]=s,r=0;r<s.length;r++)i.add(s[r])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,d=/^[: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]*$/,p={},m={};function y(r){return f.call(m,r)?!0:f.call(p,r)?!1:d.test(r)?m[r]=!0:(p[r]=!0,!1)}function v(r,s,u,h){if(u!==null&&u.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return h?!1:u!==null?!u.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function w(r,s,u,h){if(s===null||typeof s>"u"||v(r,s,u,h))return!0;if(h)return!1;if(u!==null)switch(u.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function _(r,s,u,h,g,k,S){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=h,this.attributeNamespace=g,this.mustUseProperty=u,this.propertyName=r,this.type=s,this.sanitizeURL=k,this.removeEmptyString=S}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){N[r]=new _(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var s=r[0];N[s]=new _(s,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){N[r]=new _(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){N[r]=new _(r,2,!1,r,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){N[r]=new _(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){N[r]=new _(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){N[r]=new _(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){N[r]=new _(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){N[r]=new _(r,5,!1,r.toLowerCase(),null,!1,!1)});var C=/[\-:]([a-z])/g;function b(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var s=r.replace(C,b);N[s]=new _(s,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var s=r.replace(C,b);N[s]=new _(s,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var s=r.replace(C,b);N[s]=new _(s,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){N[r]=new _(r,1,!1,r.toLowerCase(),null,!1,!1)}),N.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){N[r]=new _(r,1,!1,r.toLowerCase(),null,!0,!0)});function E(r,s,u,h){var g=N.hasOwnProperty(s)?N[s]:null;(g!==null?g.type!==0:h||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(w(s,u,g,h)&&(u=null),h||g===null?y(s)&&(u===null?r.removeAttribute(s):r.setAttribute(s,""+u)):g.mustUseProperty?r[g.propertyName]=u===null?g.type===3?!1:"":u:(s=g.attributeName,h=g.attributeNamespace,u===null?r.removeAttribute(s):(g=g.type,u=g===3||g===4&&u===!0?"":""+u,h?r.setAttributeNS(h,s,u):r.setAttribute(s,u))))}var B=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,O=Symbol.for("react.element"),D=Symbol.for("react.portal"),ie=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),ce=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),H=Symbol.for("react.context"),J=Symbol.for("react.forward_ref"),fe=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),xe=Symbol.for("react.lazy"),_e=Symbol.for("react.offscreen"),re=Symbol.iterator;function ae(r){return r===null||typeof r!="object"?null:(r=re&&r[re]||r["@@iterator"],typeof r=="function"?r:null)}var I=Object.assign,M;function W(r){if(M===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);M=s&&s[1]||""}return`
3
+ `+M+r}var T=!1;function ye(r,s){if(!r||T)return"";T=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(s)if(s=function(){throw Error()},Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(G){var h=G}Reflect.construct(r,[],s)}else{try{s.call()}catch(G){h=G}r.call(s.prototype)}else{try{throw Error()}catch(G){h=G}r()}}catch(G){if(G&&h&&typeof G.stack=="string"){for(var g=G.stack.split(`
4
+ `),k=h.stack.split(`
5
+ `),S=g.length-1,P=k.length-1;1<=S&&0<=P&&g[S]!==k[P];)P--;for(;1<=S&&0<=P;S--,P--)if(g[S]!==k[P]){if(S!==1||P!==1)do if(S--,P--,0>P||g[S]!==k[P]){var L=`
6
+ `+g[S].replace(" at new "," at ");return r.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",r.displayName)),L}while(1<=S&&0<=P);break}}}finally{T=!1,Error.prepareStackTrace=u}return(r=r?r.displayName||r.name:"")?W(r):""}function be(r){switch(r.tag){case 5:return W(r.type);case 16:return W("Lazy");case 13:return W("Suspense");case 19:return W("SuspenseList");case 0:case 2:case 15:return r=ye(r.type,!1),r;case 11:return r=ye(r.type.render,!1),r;case 1:return r=ye(r.type,!0),r;default:return""}}function ge(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case ie:return"Fragment";case D:return"Portal";case ce:return"Profiler";case U:return"StrictMode";case fe:return"Suspense";case ee:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case H:return(r.displayName||"Context")+".Consumer";case R:return(r._context.displayName||"Context")+".Provider";case J:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case te:return s=r.displayName||null,s!==null?s:ge(r.type)||"Memo";case xe:s=r._payload,r=r._init;try{return ge(r(s))}catch{}}return null}function je(r){var s=r.type;switch(r.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=s.render,r=r.displayName||r.name||"",s.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ge(s);case 8:return s===U?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function Ie(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Le(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function He(r){var s=Le(r)?"checked":"value",u=Object.getOwnPropertyDescriptor(r.constructor.prototype,s),h=""+r[s];if(!r.hasOwnProperty(s)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var g=u.get,k=u.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return g.call(this)},set:function(S){h=""+S,k.call(this,S)}}),Object.defineProperty(r,s,{enumerable:u.enumerable}),{getValue:function(){return h},setValue:function(S){h=""+S},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function At(r){r._valueTracker||(r._valueTracker=He(r))}function fn(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var u=s.getValue(),h="";return r&&(h=Le(r)?r.checked?"true":"false":r.value),r=h,r!==u?(s.setValue(r),!0):!1}function Jt(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function Rn(r,s){var u=s.checked;return I({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??r._wrapperState.initialChecked})}function Ln(r,s){var u=s.defaultValue==null?"":s.defaultValue,h=s.checked!=null?s.checked:s.defaultChecked;u=Ie(s.value!=null?s.value:u),r._wrapperState={initialChecked:h,initialValue:u,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function Cn(r,s){s=s.checked,s!=null&&E(r,"checked",s,!1)}function dn(r,s){Cn(r,s);var u=Ie(s.value),h=s.type;if(u!=null)h==="number"?(u===0&&r.value===""||r.value!=u)&&(r.value=""+u):r.value!==""+u&&(r.value=""+u);else if(h==="submit"||h==="reset"){r.removeAttribute("value");return}s.hasOwnProperty("value")?Ne(r,s.type,u):s.hasOwnProperty("defaultValue")&&Ne(r,s.type,Ie(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(r.defaultChecked=!!s.defaultChecked)}function le(r,s,u){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var h=s.type;if(!(h!=="submit"&&h!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+r._wrapperState.initialValue,u||s===r.value||(r.value=s),r.defaultValue=s}u=r.name,u!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,u!==""&&(r.name=u)}function Ne(r,s,u){(s!=="number"||Jt(r.ownerDocument)!==r)&&(u==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+u&&(r.defaultValue=""+u))}var Oe=Array.isArray;function st(r,s,u,h){if(r=r.options,s){s={};for(var g=0;g<u.length;g++)s["$"+u[g]]=!0;for(u=0;u<r.length;u++)g=s.hasOwnProperty("$"+r[u].value),r[u].selected!==g&&(r[u].selected=g),g&&h&&(r[u].defaultSelected=!0)}else{for(u=""+Ie(u),s=null,g=0;g<r.length;g++){if(r[g].value===u){r[g].selected=!0,h&&(r[g].defaultSelected=!0);return}s!==null||r[g].disabled||(s=r[g])}s!==null&&(s.selected=!0)}}function Pt(r,s){if(s.dangerouslySetInnerHTML!=null)throw Error(n(91));return I({},s,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function pt(r,s){var u=s.value;if(u==null){if(u=s.children,s=s.defaultValue,u!=null){if(s!=null)throw Error(n(92));if(Oe(u)){if(1<u.length)throw Error(n(93));u=u[0]}s=u}s==null&&(s=""),u=s}r._wrapperState={initialValue:Ie(u)}}function jn(r,s){var u=Ie(s.value),h=Ie(s.defaultValue);u!=null&&(u=""+u,u!==r.value&&(r.value=u),s.defaultValue==null&&r.defaultValue!==u&&(r.defaultValue=u)),h!=null&&(r.defaultValue=""+h)}function Mn(r){var s=r.textContent;s===r._wrapperState.initialValue&&s!==""&&s!==null&&(r.value=s)}function K(r){switch(r){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function A(r,s){return r==null||r==="http://www.w3.org/1999/xhtml"?K(s):r==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var $,Q=(function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(s,u,h,g){MSApp.execUnsafeLocalFunction(function(){return r(s,u,h,g)})}:r})(function(r,s){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=s;else{for($=$||document.createElement("div"),$.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=$.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;s.firstChild;)r.appendChild(s.firstChild)}});function oe(r,s){if(s){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=s;return}}r.textContent=s}var Te={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Se=["Webkit","ms","Moz","O"];Object.keys(Te).forEach(function(r){Se.forEach(function(s){s=s+r.charAt(0).toUpperCase()+r.substring(1),Te[s]=Te[r]})});function De(r,s,u){return s==null||typeof s=="boolean"||s===""?"":u||typeof s!="number"||s===0||Te.hasOwnProperty(r)&&Te[r]?(""+s).trim():s+"px"}function ot(r,s){r=r.style;for(var u in s)if(s.hasOwnProperty(u)){var h=u.indexOf("--")===0,g=De(u,s[u],h);u==="float"&&(u="cssFloat"),h?r.setProperty(u,g):r[u]=g}}var qe=I({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Je(r,s){if(s){if(qe[r]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(n(137,r));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(n(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(n(61))}if(s.style!=null&&typeof s.style!="object")throw Error(n(62))}}function Gt(r,s){if(r.indexOf("-")===-1)return typeof s.is=="string";switch(r){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 Wt=null;function ql(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Kl=null,Hr=null,qr=null;function Tf(r){if(r=es(r)){if(typeof Kl!="function")throw Error(n(280));var s=r.stateNode;s&&(s=co(s),Kl(r.stateNode,r.type,s))}}function Af(r){Hr?qr?qr.push(r):qr=[r]:Hr=r}function Pf(){if(Hr){var r=Hr,s=qr;if(qr=Hr=null,Tf(r),s)for(r=0;r<s.length;r++)Tf(s[r])}}function Rf(r,s){return r(s)}function Lf(){}var Ql=!1;function jf(r,s,u){if(Ql)return r(s,u);Ql=!0;try{return Rf(r,s,u)}finally{Ql=!1,(Hr!==null||qr!==null)&&(Lf(),Pf())}}function Li(r,s){var u=r.stateNode;if(u===null)return null;var h=co(u);if(h===null)return null;u=h[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":(h=!h.disabled)||(r=r.type,h=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!h;break e;default:r=!1}if(r)return null;if(u&&typeof u!="function")throw Error(n(231,s,typeof u));return u}var Xl=!1;if(c)try{var ji={};Object.defineProperty(ji,"passive",{get:function(){Xl=!0}}),window.addEventListener("test",ji,ji),window.removeEventListener("test",ji,ji)}catch{Xl=!1}function Rk(r,s,u,h,g,k,S,P,L){var G=Array.prototype.slice.call(arguments,3);try{s.apply(u,G)}catch(Y){this.onError(Y)}}var Mi=!1,Us=null,Vs=!1,Yl=null,Lk={onError:function(r){Mi=!0,Us=r}};function jk(r,s,u,h,g,k,S,P,L){Mi=!1,Us=null,Rk.apply(Lk,arguments)}function Mk(r,s,u,h,g,k,S,P,L){if(jk.apply(this,arguments),Mi){if(Mi){var G=Us;Mi=!1,Us=null}else throw Error(n(198));Vs||(Vs=!0,Yl=G)}}function vr(r){var s=r,u=r;if(r.alternate)for(;s.return;)s=s.return;else{r=s;do s=r,(s.flags&4098)!==0&&(u=s.return),r=s.return;while(r)}return s.tag===3?u:null}function Mf(r){if(r.tag===13){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function Of(r){if(vr(r)!==r)throw Error(n(188))}function Ok(r){var s=r.alternate;if(!s){if(s=vr(r),s===null)throw Error(n(188));return s!==r?null:r}for(var u=r,h=s;;){var g=u.return;if(g===null)break;var k=g.alternate;if(k===null){if(h=g.return,h!==null){u=h;continue}break}if(g.child===k.child){for(k=g.child;k;){if(k===u)return Of(g),r;if(k===h)return Of(g),s;k=k.sibling}throw Error(n(188))}if(u.return!==h.return)u=g,h=k;else{for(var S=!1,P=g.child;P;){if(P===u){S=!0,u=g,h=k;break}if(P===h){S=!0,h=g,u=k;break}P=P.sibling}if(!S){for(P=k.child;P;){if(P===u){S=!0,u=k,h=g;break}if(P===h){S=!0,h=k,u=g;break}P=P.sibling}if(!S)throw Error(n(189))}}if(u.alternate!==h)throw Error(n(190))}if(u.tag!==3)throw Error(n(188));return u.stateNode.current===u?r:s}function Df(r){return r=Ok(r),r!==null?$f(r):null}function $f(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var s=$f(r);if(s!==null)return s;r=r.sibling}return null}var Ff=t.unstable_scheduleCallback,zf=t.unstable_cancelCallback,Dk=t.unstable_shouldYield,$k=t.unstable_requestPaint,nt=t.unstable_now,Fk=t.unstable_getCurrentPriorityLevel,Jl=t.unstable_ImmediatePriority,Bf=t.unstable_UserBlockingPriority,Gs=t.unstable_NormalPriority,zk=t.unstable_LowPriority,Uf=t.unstable_IdlePriority,Ws=null,_n=null;function Bk(r){if(_n&&typeof _n.onCommitFiberRoot=="function")try{_n.onCommitFiberRoot(Ws,r,void 0,(r.current.flags&128)===128)}catch{}}var hn=Math.clz32?Math.clz32:Gk,Uk=Math.log,Vk=Math.LN2;function Gk(r){return r>>>=0,r===0?32:31-(Uk(r)/Vk|0)|0}var Hs=64,qs=4194304;function Oi(r){switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function Ks(r,s){var u=r.pendingLanes;if(u===0)return 0;var h=0,g=r.suspendedLanes,k=r.pingedLanes,S=u&268435455;if(S!==0){var P=S&~g;P!==0?h=Oi(P):(k&=S,k!==0&&(h=Oi(k)))}else S=u&~g,S!==0?h=Oi(S):k!==0&&(h=Oi(k));if(h===0)return 0;if(s!==0&&s!==h&&(s&g)===0&&(g=h&-h,k=s&-s,g>=k||g===16&&(k&4194240)!==0))return s;if((h&4)!==0&&(h|=u&16),s=r.entangledLanes,s!==0)for(r=r.entanglements,s&=h;0<s;)u=31-hn(s),g=1<<u,h|=r[u],s&=~g;return h}function Wk(r,s){switch(r){case 1:case 2:case 4:return s+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Hk(r,s){for(var u=r.suspendedLanes,h=r.pingedLanes,g=r.expirationTimes,k=r.pendingLanes;0<k;){var S=31-hn(k),P=1<<S,L=g[S];L===-1?((P&u)===0||(P&h)!==0)&&(g[S]=Wk(P,s)):L<=s&&(r.expiredLanes|=P),k&=~P}}function Zl(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function Vf(){var r=Hs;return Hs<<=1,(Hs&4194240)===0&&(Hs=64),r}function ea(r){for(var s=[],u=0;31>u;u++)s.push(r);return s}function Di(r,s,u){r.pendingLanes|=s,s!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,s=31-hn(s),r[s]=u}function qk(r,s){var u=r.pendingLanes&~s;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=s,r.mutableReadLanes&=s,r.entangledLanes&=s,s=r.entanglements;var h=r.eventTimes;for(r=r.expirationTimes;0<u;){var g=31-hn(u),k=1<<g;s[g]=0,h[g]=-1,r[g]=-1,u&=~k}}function ta(r,s){var u=r.entangledLanes|=s;for(r=r.entanglements;u;){var h=31-hn(u),g=1<<h;g&s|r[h]&s&&(r[h]|=s),u&=~g}}var Ve=0;function Gf(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var Wf,na,Hf,qf,Kf,ra=!1,Qs=[],Kn=null,Qn=null,Xn=null,$i=new Map,Fi=new Map,Yn=[],Kk="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Qf(r,s){switch(r){case"focusin":case"focusout":Kn=null;break;case"dragenter":case"dragleave":Qn=null;break;case"mouseover":case"mouseout":Xn=null;break;case"pointerover":case"pointerout":$i.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fi.delete(s.pointerId)}}function zi(r,s,u,h,g,k){return r===null||r.nativeEvent!==k?(r={blockedOn:s,domEventName:u,eventSystemFlags:h,nativeEvent:k,targetContainers:[g]},s!==null&&(s=es(s),s!==null&&na(s)),r):(r.eventSystemFlags|=h,s=r.targetContainers,g!==null&&s.indexOf(g)===-1&&s.push(g),r)}function Qk(r,s,u,h,g){switch(s){case"focusin":return Kn=zi(Kn,r,s,u,h,g),!0;case"dragenter":return Qn=zi(Qn,r,s,u,h,g),!0;case"mouseover":return Xn=zi(Xn,r,s,u,h,g),!0;case"pointerover":var k=g.pointerId;return $i.set(k,zi($i.get(k)||null,r,s,u,h,g)),!0;case"gotpointercapture":return k=g.pointerId,Fi.set(k,zi(Fi.get(k)||null,r,s,u,h,g)),!0}return!1}function Xf(r){var s=wr(r.target);if(s!==null){var u=vr(s);if(u!==null){if(s=u.tag,s===13){if(s=Mf(u),s!==null){r.blockedOn=s,Kf(r.priority,function(){Hf(u)});return}}else if(s===3&&u.stateNode.current.memoizedState.isDehydrated){r.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Xs(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var u=sa(r.domEventName,r.eventSystemFlags,s[0],r.nativeEvent);if(u===null){u=r.nativeEvent;var h=new u.constructor(u.type,u);Wt=h,u.target.dispatchEvent(h),Wt=null}else return s=es(u),s!==null&&na(s),r.blockedOn=u,!1;s.shift()}return!0}function Yf(r,s,u){Xs(r)&&u.delete(s)}function Xk(){ra=!1,Kn!==null&&Xs(Kn)&&(Kn=null),Qn!==null&&Xs(Qn)&&(Qn=null),Xn!==null&&Xs(Xn)&&(Xn=null),$i.forEach(Yf),Fi.forEach(Yf)}function Bi(r,s){r.blockedOn===s&&(r.blockedOn=null,ra||(ra=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Xk)))}function Ui(r){function s(g){return Bi(g,r)}if(0<Qs.length){Bi(Qs[0],r);for(var u=1;u<Qs.length;u++){var h=Qs[u];h.blockedOn===r&&(h.blockedOn=null)}}for(Kn!==null&&Bi(Kn,r),Qn!==null&&Bi(Qn,r),Xn!==null&&Bi(Xn,r),$i.forEach(s),Fi.forEach(s),u=0;u<Yn.length;u++)h=Yn[u],h.blockedOn===r&&(h.blockedOn=null);for(;0<Yn.length&&(u=Yn[0],u.blockedOn===null);)Xf(u),u.blockedOn===null&&Yn.shift()}var Kr=B.ReactCurrentBatchConfig,Ys=!0;function Yk(r,s,u,h){var g=Ve,k=Kr.transition;Kr.transition=null;try{Ve=1,ia(r,s,u,h)}finally{Ve=g,Kr.transition=k}}function Jk(r,s,u,h){var g=Ve,k=Kr.transition;Kr.transition=null;try{Ve=4,ia(r,s,u,h)}finally{Ve=g,Kr.transition=k}}function ia(r,s,u,h){if(Ys){var g=sa(r,s,u,h);if(g===null)Sa(r,s,h,Js,u),Qf(r,h);else if(Qk(g,r,s,u,h))h.stopPropagation();else if(Qf(r,h),s&4&&-1<Kk.indexOf(r)){for(;g!==null;){var k=es(g);if(k!==null&&Wf(k),k=sa(r,s,u,h),k===null&&Sa(r,s,h,Js,u),k===g)break;g=k}g!==null&&h.stopPropagation()}else Sa(r,s,h,null,u)}}var Js=null;function sa(r,s,u,h){if(Js=null,r=ql(h),r=wr(r),r!==null)if(s=vr(r),s===null)r=null;else if(u=s.tag,u===13){if(r=Mf(s),r!==null)return r;r=null}else if(u===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;r=null}else s!==r&&(r=null);return Js=r,null}function Jf(r){switch(r){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Fk()){case Jl:return 1;case Bf:return 4;case Gs:case zk:return 16;case Uf:return 536870912;default:return 16}default:return 16}}var Jn=null,oa=null,Zs=null;function Zf(){if(Zs)return Zs;var r,s=oa,u=s.length,h,g="value"in Jn?Jn.value:Jn.textContent,k=g.length;for(r=0;r<u&&s[r]===g[r];r++);var S=u-r;for(h=1;h<=S&&s[u-h]===g[k-h];h++);return Zs=g.slice(r,1<h?1-h:void 0)}function eo(r){var s=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&s===13&&(r=13)):r=s,r===10&&(r=13),32<=r||r===13?r:0}function to(){return!0}function ed(){return!1}function Ht(r){function s(u,h,g,k,S){this._reactName=u,this._targetInst=g,this.type=h,this.nativeEvent=k,this.target=S,this.currentTarget=null;for(var P in r)r.hasOwnProperty(P)&&(u=r[P],this[P]=u?u(k):k[P]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?to:ed,this.isPropagationStopped=ed,this}return I(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=to)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=to)},persist:function(){},isPersistent:to}),s}var Qr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},la=Ht(Qr),Vi=I({},Qr,{view:0,detail:0}),Zk=Ht(Vi),aa,ua,Gi,no=I({},Vi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fa,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Gi&&(Gi&&r.type==="mousemove"?(aa=r.screenX-Gi.screenX,ua=r.screenY-Gi.screenY):ua=aa=0,Gi=r),aa)},movementY:function(r){return"movementY"in r?r.movementY:ua}}),td=Ht(no),ev=I({},no,{dataTransfer:0}),tv=Ht(ev),nv=I({},Vi,{relatedTarget:0}),ca=Ht(nv),rv=I({},Qr,{animationName:0,elapsedTime:0,pseudoElement:0}),iv=Ht(rv),sv=I({},Qr,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),ov=Ht(sv),lv=I({},Qr,{data:0}),nd=Ht(lv),av={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},uv={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"},cv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fv(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=cv[r])?!!s[r]:!1}function fa(){return fv}var dv=I({},Vi,{key:function(r){if(r.key){var s=av[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=eo(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?uv[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fa,charCode:function(r){return r.type==="keypress"?eo(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?eo(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),hv=Ht(dv),pv=I({},no,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),rd=Ht(pv),mv=I({},Vi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fa}),gv=Ht(mv),yv=I({},Qr,{propertyName:0,elapsedTime:0,pseudoElement:0}),kv=Ht(yv),vv=I({},no,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),wv=Ht(vv),xv=[9,13,27,32],da=c&&"CompositionEvent"in window,Wi=null;c&&"documentMode"in document&&(Wi=document.documentMode);var Sv=c&&"TextEvent"in window&&!Wi,id=c&&(!da||Wi&&8<Wi&&11>=Wi),sd=" ",od=!1;function ld(r,s){switch(r){case"keyup":return xv.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ad(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Xr=!1;function Cv(r,s){switch(r){case"compositionend":return ad(s);case"keypress":return s.which!==32?null:(od=!0,sd);case"textInput":return r=s.data,r===sd&&od?null:r;default:return null}}function _v(r,s){if(Xr)return r==="compositionend"||!da&&ld(r,s)?(r=Zf(),Zs=oa=Jn=null,Xr=!1,r):null;switch(r){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 id&&s.locale!=="ko"?null:s.data;default:return null}}var bv={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 ud(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!bv[r.type]:s==="textarea"}function cd(r,s,u,h){Af(h),s=lo(s,"onChange"),0<s.length&&(u=new la("onChange","change",null,u,h),r.push({event:u,listeners:s}))}var Hi=null,qi=null;function Ev(r){Nd(r,0)}function ro(r){var s=ti(r);if(fn(s))return r}function Iv(r,s){if(r==="change")return s}var fd=!1;if(c){var ha;if(c){var pa="oninput"in document;if(!pa){var dd=document.createElement("div");dd.setAttribute("oninput","return;"),pa=typeof dd.oninput=="function"}ha=pa}else ha=!1;fd=ha&&(!document.documentMode||9<document.documentMode)}function hd(){Hi&&(Hi.detachEvent("onpropertychange",pd),qi=Hi=null)}function pd(r){if(r.propertyName==="value"&&ro(qi)){var s=[];cd(s,qi,r,ql(r)),jf(Ev,s)}}function Nv(r,s,u){r==="focusin"?(hd(),Hi=s,qi=u,Hi.attachEvent("onpropertychange",pd)):r==="focusout"&&hd()}function Tv(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return ro(qi)}function Av(r,s){if(r==="click")return ro(s)}function Pv(r,s){if(r==="input"||r==="change")return ro(s)}function Rv(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var pn=typeof Object.is=="function"?Object.is:Rv;function Ki(r,s){if(pn(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var u=Object.keys(r),h=Object.keys(s);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var g=u[h];if(!f.call(s,g)||!pn(r[g],s[g]))return!1}return!0}function md(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function gd(r,s){var u=md(r);r=0;for(var h;u;){if(u.nodeType===3){if(h=r+u.textContent.length,r<=s&&h>=s)return{node:u,offset:s-r};r=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=md(u)}}function yd(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?yd(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function kd(){for(var r=window,s=Jt();s instanceof r.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)r=s.contentWindow;else break;s=Jt(r.document)}return s}function ma(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}function Lv(r){var s=kd(),u=r.focusedElem,h=r.selectionRange;if(s!==u&&u&&u.ownerDocument&&yd(u.ownerDocument.documentElement,u)){if(h!==null&&ma(u)){if(s=h.start,r=h.end,r===void 0&&(r=s),"selectionStart"in u)u.selectionStart=s,u.selectionEnd=Math.min(r,u.value.length);else if(r=(s=u.ownerDocument||document)&&s.defaultView||window,r.getSelection){r=r.getSelection();var g=u.textContent.length,k=Math.min(h.start,g);h=h.end===void 0?k:Math.min(h.end,g),!r.extend&&k>h&&(g=h,h=k,k=g),g=gd(u,k);var S=gd(u,h);g&&S&&(r.rangeCount!==1||r.anchorNode!==g.node||r.anchorOffset!==g.offset||r.focusNode!==S.node||r.focusOffset!==S.offset)&&(s=s.createRange(),s.setStart(g.node,g.offset),r.removeAllRanges(),k>h?(r.addRange(s),r.extend(S.node,S.offset)):(s.setEnd(S.node,S.offset),r.addRange(s)))}}for(s=[],r=u;r=r.parentNode;)r.nodeType===1&&s.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<s.length;u++)r=s[u],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var jv=c&&"documentMode"in document&&11>=document.documentMode,Yr=null,ga=null,Qi=null,ya=!1;function vd(r,s,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;ya||Yr==null||Yr!==Jt(h)||(h=Yr,"selectionStart"in h&&ma(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Qi&&Ki(Qi,h)||(Qi=h,h=lo(ga,"onSelect"),0<h.length&&(s=new la("onSelect","select",null,s,u),r.push({event:s,listeners:h}),s.target=Yr)))}function io(r,s){var u={};return u[r.toLowerCase()]=s.toLowerCase(),u["Webkit"+r]="webkit"+s,u["Moz"+r]="moz"+s,u}var Jr={animationend:io("Animation","AnimationEnd"),animationiteration:io("Animation","AnimationIteration"),animationstart:io("Animation","AnimationStart"),transitionend:io("Transition","TransitionEnd")},ka={},wd={};c&&(wd=document.createElement("div").style,"AnimationEvent"in window||(delete Jr.animationend.animation,delete Jr.animationiteration.animation,delete Jr.animationstart.animation),"TransitionEvent"in window||delete Jr.transitionend.transition);function so(r){if(ka[r])return ka[r];if(!Jr[r])return r;var s=Jr[r],u;for(u in s)if(s.hasOwnProperty(u)&&u in wd)return ka[r]=s[u];return r}var xd=so("animationend"),Sd=so("animationiteration"),Cd=so("animationstart"),_d=so("transitionend"),bd=new Map,Ed="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Zn(r,s){bd.set(r,s),a(s,[r])}for(var va=0;va<Ed.length;va++){var wa=Ed[va],Mv=wa.toLowerCase(),Ov=wa[0].toUpperCase()+wa.slice(1);Zn(Mv,"on"+Ov)}Zn(xd,"onAnimationEnd"),Zn(Sd,"onAnimationIteration"),Zn(Cd,"onAnimationStart"),Zn("dblclick","onDoubleClick"),Zn("focusin","onFocus"),Zn("focusout","onBlur"),Zn(_d,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Xi="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(" "),Dv=new Set("cancel close invalid load scroll toggle".split(" ").concat(Xi));function Id(r,s,u){var h=r.type||"unknown-event";r.currentTarget=u,Mk(h,s,void 0,r),r.currentTarget=null}function Nd(r,s){s=(s&4)!==0;for(var u=0;u<r.length;u++){var h=r[u],g=h.event;h=h.listeners;e:{var k=void 0;if(s)for(var S=h.length-1;0<=S;S--){var P=h[S],L=P.instance,G=P.currentTarget;if(P=P.listener,L!==k&&g.isPropagationStopped())break e;Id(g,P,G),k=L}else for(S=0;S<h.length;S++){if(P=h[S],L=P.instance,G=P.currentTarget,P=P.listener,L!==k&&g.isPropagationStopped())break e;Id(g,P,G),k=L}}}if(Vs)throw r=Yl,Vs=!1,Yl=null,r}function Qe(r,s){var u=s[Na];u===void 0&&(u=s[Na]=new Set);var h=r+"__bubble";u.has(h)||(Td(s,r,2,!1),u.add(h))}function xa(r,s,u){var h=0;s&&(h|=4),Td(u,r,h,s)}var oo="_reactListening"+Math.random().toString(36).slice(2);function Yi(r){if(!r[oo]){r[oo]=!0,i.forEach(function(u){u!=="selectionchange"&&(Dv.has(u)||xa(u,!1,r),xa(u,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[oo]||(s[oo]=!0,xa("selectionchange",!1,s))}}function Td(r,s,u,h){switch(Jf(s)){case 1:var g=Yk;break;case 4:g=Jk;break;default:g=ia}u=g.bind(null,s,u,r),g=void 0,!Xl||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(g=!0),h?g!==void 0?r.addEventListener(s,u,{capture:!0,passive:g}):r.addEventListener(s,u,!0):g!==void 0?r.addEventListener(s,u,{passive:g}):r.addEventListener(s,u,!1)}function Sa(r,s,u,h,g){var k=h;if((s&1)===0&&(s&2)===0&&h!==null)e:for(;;){if(h===null)return;var S=h.tag;if(S===3||S===4){var P=h.stateNode.containerInfo;if(P===g||P.nodeType===8&&P.parentNode===g)break;if(S===4)for(S=h.return;S!==null;){var L=S.tag;if((L===3||L===4)&&(L=S.stateNode.containerInfo,L===g||L.nodeType===8&&L.parentNode===g))return;S=S.return}for(;P!==null;){if(S=wr(P),S===null)return;if(L=S.tag,L===5||L===6){h=k=S;continue e}P=P.parentNode}}h=h.return}jf(function(){var G=k,Y=ql(u),Z=[];e:{var X=bd.get(r);if(X!==void 0){var ue=la,he=r;switch(r){case"keypress":if(eo(u)===0)break e;case"keydown":case"keyup":ue=hv;break;case"focusin":he="focus",ue=ca;break;case"focusout":he="blur",ue=ca;break;case"beforeblur":case"afterblur":ue=ca;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=td;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=tv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=gv;break;case xd:case Sd:case Cd:ue=iv;break;case _d:ue=kv;break;case"scroll":ue=Zk;break;case"wheel":ue=wv;break;case"copy":case"cut":case"paste":ue=ov;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=rd}var pe=(s&4)!==0,rt=!pe&&r==="scroll",F=pe?X!==null?X+"Capture":null:X;pe=[];for(var j=G,z;j!==null;){z=j;var se=z.stateNode;if(z.tag===5&&se!==null&&(z=se,F!==null&&(se=Li(j,F),se!=null&&pe.push(Ji(j,se,z)))),rt)break;j=j.return}0<pe.length&&(X=new ue(X,he,null,u,Y),Z.push({event:X,listeners:pe}))}}if((s&7)===0){e:{if(X=r==="mouseover"||r==="pointerover",ue=r==="mouseout"||r==="pointerout",X&&u!==Wt&&(he=u.relatedTarget||u.fromElement)&&(wr(he)||he[On]))break e;if((ue||X)&&(X=Y.window===Y?Y:(X=Y.ownerDocument)?X.defaultView||X.parentWindow:window,ue?(he=u.relatedTarget||u.toElement,ue=G,he=he?wr(he):null,he!==null&&(rt=vr(he),he!==rt||he.tag!==5&&he.tag!==6)&&(he=null)):(ue=null,he=G),ue!==he)){if(pe=td,se="onMouseLeave",F="onMouseEnter",j="mouse",(r==="pointerout"||r==="pointerover")&&(pe=rd,se="onPointerLeave",F="onPointerEnter",j="pointer"),rt=ue==null?X:ti(ue),z=he==null?X:ti(he),X=new pe(se,j+"leave",ue,u,Y),X.target=rt,X.relatedTarget=z,se=null,wr(Y)===G&&(pe=new pe(F,j+"enter",he,u,Y),pe.target=z,pe.relatedTarget=rt,se=pe),rt=se,ue&&he)t:{for(pe=ue,F=he,j=0,z=pe;z;z=Zr(z))j++;for(z=0,se=F;se;se=Zr(se))z++;for(;0<j-z;)pe=Zr(pe),j--;for(;0<z-j;)F=Zr(F),z--;for(;j--;){if(pe===F||F!==null&&pe===F.alternate)break t;pe=Zr(pe),F=Zr(F)}pe=null}else pe=null;ue!==null&&Ad(Z,X,ue,pe,!1),he!==null&&rt!==null&&Ad(Z,rt,he,pe,!0)}}e:{if(X=G?ti(G):window,ue=X.nodeName&&X.nodeName.toLowerCase(),ue==="select"||ue==="input"&&X.type==="file")var me=Iv;else if(ud(X))if(fd)me=Pv;else{me=Tv;var ke=Nv}else(ue=X.nodeName)&&ue.toLowerCase()==="input"&&(X.type==="checkbox"||X.type==="radio")&&(me=Av);if(me&&(me=me(r,G))){cd(Z,me,u,Y);break e}ke&&ke(r,X,G),r==="focusout"&&(ke=X._wrapperState)&&ke.controlled&&X.type==="number"&&Ne(X,"number",X.value)}switch(ke=G?ti(G):window,r){case"focusin":(ud(ke)||ke.contentEditable==="true")&&(Yr=ke,ga=G,Qi=null);break;case"focusout":Qi=ga=Yr=null;break;case"mousedown":ya=!0;break;case"contextmenu":case"mouseup":case"dragend":ya=!1,vd(Z,u,Y);break;case"selectionchange":if(jv)break;case"keydown":case"keyup":vd(Z,u,Y)}var ve;if(da)e:{switch(r){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else Xr?ld(r,u)&&(Ce="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(Ce="onCompositionStart");Ce&&(id&&u.locale!=="ko"&&(Xr||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&Xr&&(ve=Zf()):(Jn=Y,oa="value"in Jn?Jn.value:Jn.textContent,Xr=!0)),ke=lo(G,Ce),0<ke.length&&(Ce=new nd(Ce,r,null,u,Y),Z.push({event:Ce,listeners:ke}),ve?Ce.data=ve:(ve=ad(u),ve!==null&&(Ce.data=ve)))),(ve=Sv?Cv(r,u):_v(r,u))&&(G=lo(G,"onBeforeInput"),0<G.length&&(Y=new nd("onBeforeInput","beforeinput",null,u,Y),Z.push({event:Y,listeners:G}),Y.data=ve))}Nd(Z,s)})}function Ji(r,s,u){return{instance:r,listener:s,currentTarget:u}}function lo(r,s){for(var u=s+"Capture",h=[];r!==null;){var g=r,k=g.stateNode;g.tag===5&&k!==null&&(g=k,k=Li(r,u),k!=null&&h.unshift(Ji(r,k,g)),k=Li(r,s),k!=null&&h.push(Ji(r,k,g))),r=r.return}return h}function Zr(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function Ad(r,s,u,h,g){for(var k=s._reactName,S=[];u!==null&&u!==h;){var P=u,L=P.alternate,G=P.stateNode;if(L!==null&&L===h)break;P.tag===5&&G!==null&&(P=G,g?(L=Li(u,k),L!=null&&S.unshift(Ji(u,L,P))):g||(L=Li(u,k),L!=null&&S.push(Ji(u,L,P)))),u=u.return}S.length!==0&&r.push({event:s,listeners:S})}var $v=/\r\n?/g,Fv=/\u0000|\uFFFD/g;function Pd(r){return(typeof r=="string"?r:""+r).replace($v,`
7
+ `).replace(Fv,"")}function ao(r,s,u){if(s=Pd(s),Pd(r)!==s&&u)throw Error(n(425))}function uo(){}var Ca=null,_a=null;function ba(r,s){return r==="textarea"||r==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Ea=typeof setTimeout=="function"?setTimeout:void 0,zv=typeof clearTimeout=="function"?clearTimeout:void 0,Rd=typeof Promise=="function"?Promise:void 0,Bv=typeof queueMicrotask=="function"?queueMicrotask:typeof Rd<"u"?function(r){return Rd.resolve(null).then(r).catch(Uv)}:Ea;function Uv(r){setTimeout(function(){throw r})}function Ia(r,s){var u=s,h=0;do{var g=u.nextSibling;if(r.removeChild(u),g&&g.nodeType===8)if(u=g.data,u==="/$"){if(h===0){r.removeChild(g),Ui(s);return}h--}else u!=="$"&&u!=="$?"&&u!=="$!"||h++;u=g}while(u);Ui(s)}function er(r){for(;r!=null;r=r.nextSibling){var s=r.nodeType;if(s===1||s===3)break;if(s===8){if(s=r.data,s==="$"||s==="$!"||s==="$?")break;if(s==="/$")return null}}return r}function Ld(r){r=r.previousSibling;for(var s=0;r;){if(r.nodeType===8){var u=r.data;if(u==="$"||u==="$!"||u==="$?"){if(s===0)return r;s--}else u==="/$"&&s++}r=r.previousSibling}return null}var ei=Math.random().toString(36).slice(2),bn="__reactFiber$"+ei,Zi="__reactProps$"+ei,On="__reactContainer$"+ei,Na="__reactEvents$"+ei,Vv="__reactListeners$"+ei,Gv="__reactHandles$"+ei;function wr(r){var s=r[bn];if(s)return s;for(var u=r.parentNode;u;){if(s=u[On]||u[bn]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(r=Ld(r);r!==null;){if(u=r[bn])return u;r=Ld(r)}return s}r=u,u=r.parentNode}return null}function es(r){return r=r[bn]||r[On],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function ti(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function co(r){return r[Zi]||null}var Ta=[],ni=-1;function tr(r){return{current:r}}function Xe(r){0>ni||(r.current=Ta[ni],Ta[ni]=null,ni--)}function Ke(r,s){ni++,Ta[ni]=r.current,r.current=s}var nr={},St=tr(nr),Mt=tr(!1),xr=nr;function ri(r,s){var u=r.type.contextTypes;if(!u)return nr;var h=r.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===s)return h.__reactInternalMemoizedMaskedChildContext;var g={},k;for(k in u)g[k]=s[k];return h&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=s,r.__reactInternalMemoizedMaskedChildContext=g),g}function Ot(r){return r=r.childContextTypes,r!=null}function fo(){Xe(Mt),Xe(St)}function jd(r,s,u){if(St.current!==nr)throw Error(n(168));Ke(St,s),Ke(Mt,u)}function Md(r,s,u){var h=r.stateNode;if(s=s.childContextTypes,typeof h.getChildContext!="function")return u;h=h.getChildContext();for(var g in h)if(!(g in s))throw Error(n(108,je(r)||"Unknown",g));return I({},u,h)}function ho(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||nr,xr=St.current,Ke(St,r),Ke(Mt,Mt.current),!0}function Od(r,s,u){var h=r.stateNode;if(!h)throw Error(n(169));u?(r=Md(r,s,xr),h.__reactInternalMemoizedMergedChildContext=r,Xe(Mt),Xe(St),Ke(St,r)):Xe(Mt),Ke(Mt,u)}var Dn=null,po=!1,Aa=!1;function Dd(r){Dn===null?Dn=[r]:Dn.push(r)}function Wv(r){po=!0,Dd(r)}function rr(){if(!Aa&&Dn!==null){Aa=!0;var r=0,s=Ve;try{var u=Dn;for(Ve=1;r<u.length;r++){var h=u[r];do h=h(!0);while(h!==null)}Dn=null,po=!1}catch(g){throw Dn!==null&&(Dn=Dn.slice(r+1)),Ff(Jl,rr),g}finally{Ve=s,Aa=!1}}return null}var ii=[],si=0,mo=null,go=0,Zt=[],en=0,Sr=null,$n=1,Fn="";function Cr(r,s){ii[si++]=go,ii[si++]=mo,mo=r,go=s}function $d(r,s,u){Zt[en++]=$n,Zt[en++]=Fn,Zt[en++]=Sr,Sr=r;var h=$n;r=Fn;var g=32-hn(h)-1;h&=~(1<<g),u+=1;var k=32-hn(s)+g;if(30<k){var S=g-g%5;k=(h&(1<<S)-1).toString(32),h>>=S,g-=S,$n=1<<32-hn(s)+g|u<<g|h,Fn=k+r}else $n=1<<k|u<<g|h,Fn=r}function Pa(r){r.return!==null&&(Cr(r,1),$d(r,1,0))}function Ra(r){for(;r===mo;)mo=ii[--si],ii[si]=null,go=ii[--si],ii[si]=null;for(;r===Sr;)Sr=Zt[--en],Zt[en]=null,Fn=Zt[--en],Zt[en]=null,$n=Zt[--en],Zt[en]=null}var qt=null,Kt=null,Ye=!1,mn=null;function Fd(r,s){var u=sn(5,null,null,0);u.elementType="DELETED",u.stateNode=s,u.return=r,s=r.deletions,s===null?(r.deletions=[u],r.flags|=16):s.push(u)}function zd(r,s){switch(r.tag){case 5:var u=r.type;return s=s.nodeType!==1||u.toLowerCase()!==s.nodeName.toLowerCase()?null:s,s!==null?(r.stateNode=s,qt=r,Kt=er(s.firstChild),!0):!1;case 6:return s=r.pendingProps===""||s.nodeType!==3?null:s,s!==null?(r.stateNode=s,qt=r,Kt=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(u=Sr!==null?{id:$n,overflow:Fn}:null,r.memoizedState={dehydrated:s,treeContext:u,retryLane:1073741824},u=sn(18,null,null,0),u.stateNode=s,u.return=r,r.child=u,qt=r,Kt=null,!0):!1;default:return!1}}function La(r){return(r.mode&1)!==0&&(r.flags&128)===0}function ja(r){if(Ye){var s=Kt;if(s){var u=s;if(!zd(r,s)){if(La(r))throw Error(n(418));s=er(u.nextSibling);var h=qt;s&&zd(r,s)?Fd(h,u):(r.flags=r.flags&-4097|2,Ye=!1,qt=r)}}else{if(La(r))throw Error(n(418));r.flags=r.flags&-4097|2,Ye=!1,qt=r}}}function Bd(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;qt=r}function yo(r){if(r!==qt)return!1;if(!Ye)return Bd(r),Ye=!0,!1;var s;if((s=r.tag!==3)&&!(s=r.tag!==5)&&(s=r.type,s=s!=="head"&&s!=="body"&&!ba(r.type,r.memoizedProps)),s&&(s=Kt)){if(La(r))throw Ud(),Error(n(418));for(;s;)Fd(r,s),s=er(s.nextSibling)}if(Bd(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));e:{for(r=r.nextSibling,s=0;r;){if(r.nodeType===8){var u=r.data;if(u==="/$"){if(s===0){Kt=er(r.nextSibling);break e}s--}else u!=="$"&&u!=="$!"&&u!=="$?"||s++}r=r.nextSibling}Kt=null}}else Kt=qt?er(r.stateNode.nextSibling):null;return!0}function Ud(){for(var r=Kt;r;)r=er(r.nextSibling)}function oi(){Kt=qt=null,Ye=!1}function Ma(r){mn===null?mn=[r]:mn.push(r)}var Hv=B.ReactCurrentBatchConfig;function ts(r,s,u){if(r=u.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(n(309));var h=u.stateNode}if(!h)throw Error(n(147,r));var g=h,k=""+r;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===k?s.ref:(s=function(S){var P=g.refs;S===null?delete P[k]:P[k]=S},s._stringRef=k,s)}if(typeof r!="string")throw Error(n(284));if(!u._owner)throw Error(n(290,r))}return r}function ko(r,s){throw r=Object.prototype.toString.call(s),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r))}function Vd(r){var s=r._init;return s(r._payload)}function Gd(r){function s(F,j){if(r){var z=F.deletions;z===null?(F.deletions=[j],F.flags|=16):z.push(j)}}function u(F,j){if(!r)return null;for(;j!==null;)s(F,j),j=j.sibling;return null}function h(F,j){for(F=new Map;j!==null;)j.key!==null?F.set(j.key,j):F.set(j.index,j),j=j.sibling;return F}function g(F,j){return F=fr(F,j),F.index=0,F.sibling=null,F}function k(F,j,z){return F.index=z,r?(z=F.alternate,z!==null?(z=z.index,z<j?(F.flags|=2,j):z):(F.flags|=2,j)):(F.flags|=1048576,j)}function S(F){return r&&F.alternate===null&&(F.flags|=2),F}function P(F,j,z,se){return j===null||j.tag!==6?(j=Eu(z,F.mode,se),j.return=F,j):(j=g(j,z),j.return=F,j)}function L(F,j,z,se){var me=z.type;return me===ie?Y(F,j,z.props.children,se,z.key):j!==null&&(j.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===xe&&Vd(me)===j.type)?(se=g(j,z.props),se.ref=ts(F,j,z),se.return=F,se):(se=Uo(z.type,z.key,z.props,null,F.mode,se),se.ref=ts(F,j,z),se.return=F,se)}function G(F,j,z,se){return j===null||j.tag!==4||j.stateNode.containerInfo!==z.containerInfo||j.stateNode.implementation!==z.implementation?(j=Iu(z,F.mode,se),j.return=F,j):(j=g(j,z.children||[]),j.return=F,j)}function Y(F,j,z,se,me){return j===null||j.tag!==7?(j=Pr(z,F.mode,se,me),j.return=F,j):(j=g(j,z),j.return=F,j)}function Z(F,j,z){if(typeof j=="string"&&j!==""||typeof j=="number")return j=Eu(""+j,F.mode,z),j.return=F,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case O:return z=Uo(j.type,j.key,j.props,null,F.mode,z),z.ref=ts(F,null,j),z.return=F,z;case D:return j=Iu(j,F.mode,z),j.return=F,j;case xe:var se=j._init;return Z(F,se(j._payload),z)}if(Oe(j)||ae(j))return j=Pr(j,F.mode,z,null),j.return=F,j;ko(F,j)}return null}function X(F,j,z,se){var me=j!==null?j.key:null;if(typeof z=="string"&&z!==""||typeof z=="number")return me!==null?null:P(F,j,""+z,se);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case O:return z.key===me?L(F,j,z,se):null;case D:return z.key===me?G(F,j,z,se):null;case xe:return me=z._init,X(F,j,me(z._payload),se)}if(Oe(z)||ae(z))return me!==null?null:Y(F,j,z,se,null);ko(F,z)}return null}function ue(F,j,z,se,me){if(typeof se=="string"&&se!==""||typeof se=="number")return F=F.get(z)||null,P(j,F,""+se,me);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case O:return F=F.get(se.key===null?z:se.key)||null,L(j,F,se,me);case D:return F=F.get(se.key===null?z:se.key)||null,G(j,F,se,me);case xe:var ke=se._init;return ue(F,j,z,ke(se._payload),me)}if(Oe(se)||ae(se))return F=F.get(z)||null,Y(j,F,se,me,null);ko(j,se)}return null}function he(F,j,z,se){for(var me=null,ke=null,ve=j,Ce=j=0,yt=null;ve!==null&&Ce<z.length;Ce++){ve.index>Ce?(yt=ve,ve=null):yt=ve.sibling;var Be=X(F,ve,z[Ce],se);if(Be===null){ve===null&&(ve=yt);break}r&&ve&&Be.alternate===null&&s(F,ve),j=k(Be,j,Ce),ke===null?me=Be:ke.sibling=Be,ke=Be,ve=yt}if(Ce===z.length)return u(F,ve),Ye&&Cr(F,Ce),me;if(ve===null){for(;Ce<z.length;Ce++)ve=Z(F,z[Ce],se),ve!==null&&(j=k(ve,j,Ce),ke===null?me=ve:ke.sibling=ve,ke=ve);return Ye&&Cr(F,Ce),me}for(ve=h(F,ve);Ce<z.length;Ce++)yt=ue(ve,F,Ce,z[Ce],se),yt!==null&&(r&&yt.alternate!==null&&ve.delete(yt.key===null?Ce:yt.key),j=k(yt,j,Ce),ke===null?me=yt:ke.sibling=yt,ke=yt);return r&&ve.forEach(function(dr){return s(F,dr)}),Ye&&Cr(F,Ce),me}function pe(F,j,z,se){var me=ae(z);if(typeof me!="function")throw Error(n(150));if(z=me.call(z),z==null)throw Error(n(151));for(var ke=me=null,ve=j,Ce=j=0,yt=null,Be=z.next();ve!==null&&!Be.done;Ce++,Be=z.next()){ve.index>Ce?(yt=ve,ve=null):yt=ve.sibling;var dr=X(F,ve,Be.value,se);if(dr===null){ve===null&&(ve=yt);break}r&&ve&&dr.alternate===null&&s(F,ve),j=k(dr,j,Ce),ke===null?me=dr:ke.sibling=dr,ke=dr,ve=yt}if(Be.done)return u(F,ve),Ye&&Cr(F,Ce),me;if(ve===null){for(;!Be.done;Ce++,Be=z.next())Be=Z(F,Be.value,se),Be!==null&&(j=k(Be,j,Ce),ke===null?me=Be:ke.sibling=Be,ke=Be);return Ye&&Cr(F,Ce),me}for(ve=h(F,ve);!Be.done;Ce++,Be=z.next())Be=ue(ve,F,Ce,Be.value,se),Be!==null&&(r&&Be.alternate!==null&&ve.delete(Be.key===null?Ce:Be.key),j=k(Be,j,Ce),ke===null?me=Be:ke.sibling=Be,ke=Be);return r&&ve.forEach(function(bw){return s(F,bw)}),Ye&&Cr(F,Ce),me}function rt(F,j,z,se){if(typeof z=="object"&&z!==null&&z.type===ie&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case O:e:{for(var me=z.key,ke=j;ke!==null;){if(ke.key===me){if(me=z.type,me===ie){if(ke.tag===7){u(F,ke.sibling),j=g(ke,z.props.children),j.return=F,F=j;break e}}else if(ke.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===xe&&Vd(me)===ke.type){u(F,ke.sibling),j=g(ke,z.props),j.ref=ts(F,ke,z),j.return=F,F=j;break e}u(F,ke);break}else s(F,ke);ke=ke.sibling}z.type===ie?(j=Pr(z.props.children,F.mode,se,z.key),j.return=F,F=j):(se=Uo(z.type,z.key,z.props,null,F.mode,se),se.ref=ts(F,j,z),se.return=F,F=se)}return S(F);case D:e:{for(ke=z.key;j!==null;){if(j.key===ke)if(j.tag===4&&j.stateNode.containerInfo===z.containerInfo&&j.stateNode.implementation===z.implementation){u(F,j.sibling),j=g(j,z.children||[]),j.return=F,F=j;break e}else{u(F,j);break}else s(F,j);j=j.sibling}j=Iu(z,F.mode,se),j.return=F,F=j}return S(F);case xe:return ke=z._init,rt(F,j,ke(z._payload),se)}if(Oe(z))return he(F,j,z,se);if(ae(z))return pe(F,j,z,se);ko(F,z)}return typeof z=="string"&&z!==""||typeof z=="number"?(z=""+z,j!==null&&j.tag===6?(u(F,j.sibling),j=g(j,z),j.return=F,F=j):(u(F,j),j=Eu(z,F.mode,se),j.return=F,F=j),S(F)):u(F,j)}return rt}var li=Gd(!0),Wd=Gd(!1),vo=tr(null),wo=null,ai=null,Oa=null;function Da(){Oa=ai=wo=null}function $a(r){var s=vo.current;Xe(vo),r._currentValue=s}function Fa(r,s,u){for(;r!==null;){var h=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,h!==null&&(h.childLanes|=s)):h!==null&&(h.childLanes&s)!==s&&(h.childLanes|=s),r===u)break;r=r.return}}function ui(r,s){wo=r,Oa=ai=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&s)!==0&&(Dt=!0),r.firstContext=null)}function tn(r){var s=r._currentValue;if(Oa!==r)if(r={context:r,memoizedValue:s,next:null},ai===null){if(wo===null)throw Error(n(308));ai=r,wo.dependencies={lanes:0,firstContext:r}}else ai=ai.next=r;return s}var _r=null;function za(r){_r===null?_r=[r]:_r.push(r)}function Hd(r,s,u,h){var g=s.interleaved;return g===null?(u.next=u,za(s)):(u.next=g.next,g.next=u),s.interleaved=u,zn(r,h)}function zn(r,s){r.lanes|=s;var u=r.alternate;for(u!==null&&(u.lanes|=s),u=r,r=r.return;r!==null;)r.childLanes|=s,u=r.alternate,u!==null&&(u.childLanes|=s),u=r,r=r.return;return u.tag===3?u.stateNode:null}var ir=!1;function Ba(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qd(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function Bn(r,s){return{eventTime:r,lane:s,tag:0,payload:null,callback:null,next:null}}function sr(r,s,u){var h=r.updateQueue;if(h===null)return null;if(h=h.shared,(ze&2)!==0){var g=h.pending;return g===null?s.next=s:(s.next=g.next,g.next=s),h.pending=s,zn(r,u)}return g=h.interleaved,g===null?(s.next=s,za(h)):(s.next=g.next,g.next=s),h.interleaved=s,zn(r,u)}function xo(r,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194240)!==0)){var h=s.lanes;h&=r.pendingLanes,u|=h,s.lanes=u,ta(r,u)}}function Kd(r,s){var u=r.updateQueue,h=r.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var g=null,k=null;if(u=u.firstBaseUpdate,u!==null){do{var S={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};k===null?g=k=S:k=k.next=S,u=u.next}while(u!==null);k===null?g=k=s:k=k.next=s}else g=k=s;u={baseState:h.baseState,firstBaseUpdate:g,lastBaseUpdate:k,shared:h.shared,effects:h.effects},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=s:r.next=s,u.lastBaseUpdate=s}function So(r,s,u,h){var g=r.updateQueue;ir=!1;var k=g.firstBaseUpdate,S=g.lastBaseUpdate,P=g.shared.pending;if(P!==null){g.shared.pending=null;var L=P,G=L.next;L.next=null,S===null?k=G:S.next=G,S=L;var Y=r.alternate;Y!==null&&(Y=Y.updateQueue,P=Y.lastBaseUpdate,P!==S&&(P===null?Y.firstBaseUpdate=G:P.next=G,Y.lastBaseUpdate=L))}if(k!==null){var Z=g.baseState;S=0,Y=G=L=null,P=k;do{var X=P.lane,ue=P.eventTime;if((h&X)===X){Y!==null&&(Y=Y.next={eventTime:ue,lane:0,tag:P.tag,payload:P.payload,callback:P.callback,next:null});e:{var he=r,pe=P;switch(X=s,ue=u,pe.tag){case 1:if(he=pe.payload,typeof he=="function"){Z=he.call(ue,Z,X);break e}Z=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=pe.payload,X=typeof he=="function"?he.call(ue,Z,X):he,X==null)break e;Z=I({},Z,X);break e;case 2:ir=!0}}P.callback!==null&&P.lane!==0&&(r.flags|=64,X=g.effects,X===null?g.effects=[P]:X.push(P))}else ue={eventTime:ue,lane:X,tag:P.tag,payload:P.payload,callback:P.callback,next:null},Y===null?(G=Y=ue,L=Z):Y=Y.next=ue,S|=X;if(P=P.next,P===null){if(P=g.shared.pending,P===null)break;X=P,P=X.next,X.next=null,g.lastBaseUpdate=X,g.shared.pending=null}}while(!0);if(Y===null&&(L=Z),g.baseState=L,g.firstBaseUpdate=G,g.lastBaseUpdate=Y,s=g.shared.interleaved,s!==null){g=s;do S|=g.lane,g=g.next;while(g!==s)}else k===null&&(g.shared.lanes=0);Ir|=S,r.lanes=S,r.memoizedState=Z}}function Qd(r,s,u){if(r=s.effects,s.effects=null,r!==null)for(s=0;s<r.length;s++){var h=r[s],g=h.callback;if(g!==null){if(h.callback=null,h=u,typeof g!="function")throw Error(n(191,g));g.call(h)}}}var ns={},En=tr(ns),rs=tr(ns),is=tr(ns);function br(r){if(r===ns)throw Error(n(174));return r}function Ua(r,s){switch(Ke(is,s),Ke(rs,r),Ke(En,ns),r=s.nodeType,r){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:A(null,"");break;default:r=r===8?s.parentNode:s,s=r.namespaceURI||null,r=r.tagName,s=A(s,r)}Xe(En),Ke(En,s)}function ci(){Xe(En),Xe(rs),Xe(is)}function Xd(r){br(is.current);var s=br(En.current),u=A(s,r.type);s!==u&&(Ke(rs,r),Ke(En,u))}function Va(r){rs.current===r&&(Xe(En),Xe(rs))}var Ze=tr(0);function Co(r){for(var s=r;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Ga=[];function Wa(){for(var r=0;r<Ga.length;r++)Ga[r]._workInProgressVersionPrimary=null;Ga.length=0}var _o=B.ReactCurrentDispatcher,Ha=B.ReactCurrentBatchConfig,Er=0,et=null,ct=null,mt=null,bo=!1,ss=!1,os=0,qv=0;function Ct(){throw Error(n(321))}function qa(r,s){if(s===null)return!1;for(var u=0;u<s.length&&u<r.length;u++)if(!pn(r[u],s[u]))return!1;return!0}function Ka(r,s,u,h,g,k){if(Er=k,et=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,_o.current=r===null||r.memoizedState===null?Yv:Jv,r=u(h,g),ss){k=0;do{if(ss=!1,os=0,25<=k)throw Error(n(301));k+=1,mt=ct=null,s.updateQueue=null,_o.current=Zv,r=u(h,g)}while(ss)}if(_o.current=No,s=ct!==null&&ct.next!==null,Er=0,mt=ct=et=null,bo=!1,s)throw Error(n(300));return r}function Qa(){var r=os!==0;return os=0,r}function In(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mt===null?et.memoizedState=mt=r:mt=mt.next=r,mt}function nn(){if(ct===null){var r=et.alternate;r=r!==null?r.memoizedState:null}else r=ct.next;var s=mt===null?et.memoizedState:mt.next;if(s!==null)mt=s,ct=r;else{if(r===null)throw Error(n(310));ct=r,r={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},mt===null?et.memoizedState=mt=r:mt=mt.next=r}return mt}function ls(r,s){return typeof s=="function"?s(r):s}function Xa(r){var s=nn(),u=s.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var h=ct,g=h.baseQueue,k=u.pending;if(k!==null){if(g!==null){var S=g.next;g.next=k.next,k.next=S}h.baseQueue=g=k,u.pending=null}if(g!==null){k=g.next,h=h.baseState;var P=S=null,L=null,G=k;do{var Y=G.lane;if((Er&Y)===Y)L!==null&&(L=L.next={lane:0,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),h=G.hasEagerState?G.eagerState:r(h,G.action);else{var Z={lane:Y,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null};L===null?(P=L=Z,S=h):L=L.next=Z,et.lanes|=Y,Ir|=Y}G=G.next}while(G!==null&&G!==k);L===null?S=h:L.next=P,pn(h,s.memoizedState)||(Dt=!0),s.memoizedState=h,s.baseState=S,s.baseQueue=L,u.lastRenderedState=h}if(r=u.interleaved,r!==null){g=r;do k=g.lane,et.lanes|=k,Ir|=k,g=g.next;while(g!==r)}else g===null&&(u.lanes=0);return[s.memoizedState,u.dispatch]}function Ya(r){var s=nn(),u=s.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var h=u.dispatch,g=u.pending,k=s.memoizedState;if(g!==null){u.pending=null;var S=g=g.next;do k=r(k,S.action),S=S.next;while(S!==g);pn(k,s.memoizedState)||(Dt=!0),s.memoizedState=k,s.baseQueue===null&&(s.baseState=k),u.lastRenderedState=k}return[k,h]}function Yd(){}function Jd(r,s){var u=et,h=nn(),g=s(),k=!pn(h.memoizedState,g);if(k&&(h.memoizedState=g,Dt=!0),h=h.queue,Ja(th.bind(null,u,h,r),[r]),h.getSnapshot!==s||k||mt!==null&&mt.memoizedState.tag&1){if(u.flags|=2048,as(9,eh.bind(null,u,h,g,s),void 0,null),gt===null)throw Error(n(349));(Er&30)!==0||Zd(u,s,g)}return g}function Zd(r,s,u){r.flags|=16384,r={getSnapshot:s,value:u},s=et.updateQueue,s===null?(s={lastEffect:null,stores:null},et.updateQueue=s,s.stores=[r]):(u=s.stores,u===null?s.stores=[r]:u.push(r))}function eh(r,s,u,h){s.value=u,s.getSnapshot=h,nh(s)&&rh(r)}function th(r,s,u){return u(function(){nh(s)&&rh(r)})}function nh(r){var s=r.getSnapshot;r=r.value;try{var u=s();return!pn(r,u)}catch{return!0}}function rh(r){var s=zn(r,1);s!==null&&vn(s,r,1,-1)}function ih(r){var s=In();return typeof r=="function"&&(r=r()),s.memoizedState=s.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:r},s.queue=r,r=r.dispatch=Xv.bind(null,et,r),[s.memoizedState,r]}function as(r,s,u,h){return r={tag:r,create:s,destroy:u,deps:h,next:null},s=et.updateQueue,s===null?(s={lastEffect:null,stores:null},et.updateQueue=s,s.lastEffect=r.next=r):(u=s.lastEffect,u===null?s.lastEffect=r.next=r:(h=u.next,u.next=r,r.next=h,s.lastEffect=r)),r}function sh(){return nn().memoizedState}function Eo(r,s,u,h){var g=In();et.flags|=r,g.memoizedState=as(1|s,u,void 0,h===void 0?null:h)}function Io(r,s,u,h){var g=nn();h=h===void 0?null:h;var k=void 0;if(ct!==null){var S=ct.memoizedState;if(k=S.destroy,h!==null&&qa(h,S.deps)){g.memoizedState=as(s,u,k,h);return}}et.flags|=r,g.memoizedState=as(1|s,u,k,h)}function oh(r,s){return Eo(8390656,8,r,s)}function Ja(r,s){return Io(2048,8,r,s)}function lh(r,s){return Io(4,2,r,s)}function ah(r,s){return Io(4,4,r,s)}function uh(r,s){if(typeof s=="function")return r=r(),s(r),function(){s(null)};if(s!=null)return r=r(),s.current=r,function(){s.current=null}}function ch(r,s,u){return u=u!=null?u.concat([r]):null,Io(4,4,uh.bind(null,s,r),u)}function Za(){}function fh(r,s){var u=nn();s=s===void 0?null:s;var h=u.memoizedState;return h!==null&&s!==null&&qa(s,h[1])?h[0]:(u.memoizedState=[r,s],r)}function dh(r,s){var u=nn();s=s===void 0?null:s;var h=u.memoizedState;return h!==null&&s!==null&&qa(s,h[1])?h[0]:(r=r(),u.memoizedState=[r,s],r)}function hh(r,s,u){return(Er&21)===0?(r.baseState&&(r.baseState=!1,Dt=!0),r.memoizedState=u):(pn(u,s)||(u=Vf(),et.lanes|=u,Ir|=u,r.baseState=!0),s)}function Kv(r,s){var u=Ve;Ve=u!==0&&4>u?u:4,r(!0);var h=Ha.transition;Ha.transition={};try{r(!1),s()}finally{Ve=u,Ha.transition=h}}function ph(){return nn().memoizedState}function Qv(r,s,u){var h=ur(r);if(u={lane:h,action:u,hasEagerState:!1,eagerState:null,next:null},mh(r))gh(s,u);else if(u=Hd(r,s,u,h),u!==null){var g=Lt();vn(u,r,h,g),yh(u,s,h)}}function Xv(r,s,u){var h=ur(r),g={lane:h,action:u,hasEagerState:!1,eagerState:null,next:null};if(mh(r))gh(s,g);else{var k=r.alternate;if(r.lanes===0&&(k===null||k.lanes===0)&&(k=s.lastRenderedReducer,k!==null))try{var S=s.lastRenderedState,P=k(S,u);if(g.hasEagerState=!0,g.eagerState=P,pn(P,S)){var L=s.interleaved;L===null?(g.next=g,za(s)):(g.next=L.next,L.next=g),s.interleaved=g;return}}catch{}u=Hd(r,s,g,h),u!==null&&(g=Lt(),vn(u,r,h,g),yh(u,s,h))}}function mh(r){var s=r.alternate;return r===et||s!==null&&s===et}function gh(r,s){ss=bo=!0;var u=r.pending;u===null?s.next=s:(s.next=u.next,u.next=s),r.pending=s}function yh(r,s,u){if((u&4194240)!==0){var h=s.lanes;h&=r.pendingLanes,u|=h,s.lanes=u,ta(r,u)}}var No={readContext:tn,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useInsertionEffect:Ct,useLayoutEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useMutableSource:Ct,useSyncExternalStore:Ct,useId:Ct,unstable_isNewReconciler:!1},Yv={readContext:tn,useCallback:function(r,s){return In().memoizedState=[r,s===void 0?null:s],r},useContext:tn,useEffect:oh,useImperativeHandle:function(r,s,u){return u=u!=null?u.concat([r]):null,Eo(4194308,4,uh.bind(null,s,r),u)},useLayoutEffect:function(r,s){return Eo(4194308,4,r,s)},useInsertionEffect:function(r,s){return Eo(4,2,r,s)},useMemo:function(r,s){var u=In();return s=s===void 0?null:s,r=r(),u.memoizedState=[r,s],r},useReducer:function(r,s,u){var h=In();return s=u!==void 0?u(s):s,h.memoizedState=h.baseState=s,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:s},h.queue=r,r=r.dispatch=Qv.bind(null,et,r),[h.memoizedState,r]},useRef:function(r){var s=In();return r={current:r},s.memoizedState=r},useState:ih,useDebugValue:Za,useDeferredValue:function(r){return In().memoizedState=r},useTransition:function(){var r=ih(!1),s=r[0];return r=Kv.bind(null,r[1]),In().memoizedState=r,[s,r]},useMutableSource:function(){},useSyncExternalStore:function(r,s,u){var h=et,g=In();if(Ye){if(u===void 0)throw Error(n(407));u=u()}else{if(u=s(),gt===null)throw Error(n(349));(Er&30)!==0||Zd(h,s,u)}g.memoizedState=u;var k={value:u,getSnapshot:s};return g.queue=k,oh(th.bind(null,h,k,r),[r]),h.flags|=2048,as(9,eh.bind(null,h,k,u,s),void 0,null),u},useId:function(){var r=In(),s=gt.identifierPrefix;if(Ye){var u=Fn,h=$n;u=(h&~(1<<32-hn(h)-1)).toString(32)+u,s=":"+s+"R"+u,u=os++,0<u&&(s+="H"+u.toString(32)),s+=":"}else u=qv++,s=":"+s+"r"+u.toString(32)+":";return r.memoizedState=s},unstable_isNewReconciler:!1},Jv={readContext:tn,useCallback:fh,useContext:tn,useEffect:Ja,useImperativeHandle:ch,useInsertionEffect:lh,useLayoutEffect:ah,useMemo:dh,useReducer:Xa,useRef:sh,useState:function(){return Xa(ls)},useDebugValue:Za,useDeferredValue:function(r){var s=nn();return hh(s,ct.memoizedState,r)},useTransition:function(){var r=Xa(ls)[0],s=nn().memoizedState;return[r,s]},useMutableSource:Yd,useSyncExternalStore:Jd,useId:ph,unstable_isNewReconciler:!1},Zv={readContext:tn,useCallback:fh,useContext:tn,useEffect:Ja,useImperativeHandle:ch,useInsertionEffect:lh,useLayoutEffect:ah,useMemo:dh,useReducer:Ya,useRef:sh,useState:function(){return Ya(ls)},useDebugValue:Za,useDeferredValue:function(r){var s=nn();return ct===null?s.memoizedState=r:hh(s,ct.memoizedState,r)},useTransition:function(){var r=Ya(ls)[0],s=nn().memoizedState;return[r,s]},useMutableSource:Yd,useSyncExternalStore:Jd,useId:ph,unstable_isNewReconciler:!1};function gn(r,s){if(r&&r.defaultProps){s=I({},s),r=r.defaultProps;for(var u in r)s[u]===void 0&&(s[u]=r[u]);return s}return s}function eu(r,s,u,h){s=r.memoizedState,u=u(h,s),u=u==null?s:I({},s,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var To={isMounted:function(r){return(r=r._reactInternals)?vr(r)===r:!1},enqueueSetState:function(r,s,u){r=r._reactInternals;var h=Lt(),g=ur(r),k=Bn(h,g);k.payload=s,u!=null&&(k.callback=u),s=sr(r,k,g),s!==null&&(vn(s,r,g,h),xo(s,r,g))},enqueueReplaceState:function(r,s,u){r=r._reactInternals;var h=Lt(),g=ur(r),k=Bn(h,g);k.tag=1,k.payload=s,u!=null&&(k.callback=u),s=sr(r,k,g),s!==null&&(vn(s,r,g,h),xo(s,r,g))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var u=Lt(),h=ur(r),g=Bn(u,h);g.tag=2,s!=null&&(g.callback=s),s=sr(r,g,h),s!==null&&(vn(s,r,h,u),xo(s,r,h))}};function kh(r,s,u,h,g,k,S){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(h,k,S):s.prototype&&s.prototype.isPureReactComponent?!Ki(u,h)||!Ki(g,k):!0}function vh(r,s,u){var h=!1,g=nr,k=s.contextType;return typeof k=="object"&&k!==null?k=tn(k):(g=Ot(s)?xr:St.current,h=s.contextTypes,k=(h=h!=null)?ri(r,g):nr),s=new s(u,k),r.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=To,r.stateNode=s,s._reactInternals=r,h&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=g,r.__reactInternalMemoizedMaskedChildContext=k),s}function wh(r,s,u,h){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,h),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,h),s.state!==r&&To.enqueueReplaceState(s,s.state,null)}function tu(r,s,u,h){var g=r.stateNode;g.props=u,g.state=r.memoizedState,g.refs={},Ba(r);var k=s.contextType;typeof k=="object"&&k!==null?g.context=tn(k):(k=Ot(s)?xr:St.current,g.context=ri(r,k)),g.state=r.memoizedState,k=s.getDerivedStateFromProps,typeof k=="function"&&(eu(r,s,k,u),g.state=r.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(s=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),s!==g.state&&To.enqueueReplaceState(g,g.state,null),So(r,u,g,h),g.state=r.memoizedState),typeof g.componentDidMount=="function"&&(r.flags|=4194308)}function fi(r,s){try{var u="",h=s;do u+=be(h),h=h.return;while(h);var g=u}catch(k){g=`
8
+ Error generating stack: `+k.message+`
9
+ `+k.stack}return{value:r,source:s,stack:g,digest:null}}function nu(r,s,u){return{value:r,source:null,stack:u??null,digest:s??null}}function ru(r,s){try{console.error(s.value)}catch(u){setTimeout(function(){throw u})}}var ew=typeof WeakMap=="function"?WeakMap:Map;function xh(r,s,u){u=Bn(-1,u),u.tag=3,u.payload={element:null};var h=s.value;return u.callback=function(){Oo||(Oo=!0,ku=h),ru(r,s)},u}function Sh(r,s,u){u=Bn(-1,u),u.tag=3;var h=r.type.getDerivedStateFromError;if(typeof h=="function"){var g=s.value;u.payload=function(){return h(g)},u.callback=function(){ru(r,s)}}var k=r.stateNode;return k!==null&&typeof k.componentDidCatch=="function"&&(u.callback=function(){ru(r,s),typeof h!="function"&&(lr===null?lr=new Set([this]):lr.add(this));var S=s.stack;this.componentDidCatch(s.value,{componentStack:S!==null?S:""})}),u}function Ch(r,s,u){var h=r.pingCache;if(h===null){h=r.pingCache=new ew;var g=new Set;h.set(s,g)}else g=h.get(s),g===void 0&&(g=new Set,h.set(s,g));g.has(u)||(g.add(u),r=pw.bind(null,r,s,u),s.then(r,r))}function _h(r){do{var s;if((s=r.tag===13)&&(s=r.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return r;r=r.return}while(r!==null);return null}function bh(r,s,u,h,g){return(r.mode&1)===0?(r===s?r.flags|=65536:(r.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(s=Bn(-1,1),s.tag=2,sr(u,s,1))),u.lanes|=1),r):(r.flags|=65536,r.lanes=g,r)}var tw=B.ReactCurrentOwner,Dt=!1;function Rt(r,s,u,h){s.child=r===null?Wd(s,null,u,h):li(s,r.child,u,h)}function Eh(r,s,u,h,g){u=u.render;var k=s.ref;return ui(s,g),h=Ka(r,s,u,h,k,g),u=Qa(),r!==null&&!Dt?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~g,Un(r,s,g)):(Ye&&u&&Pa(s),s.flags|=1,Rt(r,s,h,g),s.child)}function Ih(r,s,u,h,g){if(r===null){var k=u.type;return typeof k=="function"&&!bu(k)&&k.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(s.tag=15,s.type=k,Nh(r,s,k,h,g)):(r=Uo(u.type,null,h,s,s.mode,g),r.ref=s.ref,r.return=s,s.child=r)}if(k=r.child,(r.lanes&g)===0){var S=k.memoizedProps;if(u=u.compare,u=u!==null?u:Ki,u(S,h)&&r.ref===s.ref)return Un(r,s,g)}return s.flags|=1,r=fr(k,h),r.ref=s.ref,r.return=s,s.child=r}function Nh(r,s,u,h,g){if(r!==null){var k=r.memoizedProps;if(Ki(k,h)&&r.ref===s.ref)if(Dt=!1,s.pendingProps=h=k,(r.lanes&g)!==0)(r.flags&131072)!==0&&(Dt=!0);else return s.lanes=r.lanes,Un(r,s,g)}return iu(r,s,u,h,g)}function Th(r,s,u){var h=s.pendingProps,g=h.children,k=r!==null?r.memoizedState:null;if(h.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ke(hi,Qt),Qt|=u;else{if((u&1073741824)===0)return r=k!==null?k.baseLanes|u:u,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:r,cachePool:null,transitions:null},s.updateQueue=null,Ke(hi,Qt),Qt|=r,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},h=k!==null?k.baseLanes:u,Ke(hi,Qt),Qt|=h}else k!==null?(h=k.baseLanes|u,s.memoizedState=null):h=u,Ke(hi,Qt),Qt|=h;return Rt(r,s,g,u),s.child}function Ah(r,s){var u=s.ref;(r===null&&u!==null||r!==null&&r.ref!==u)&&(s.flags|=512,s.flags|=2097152)}function iu(r,s,u,h,g){var k=Ot(u)?xr:St.current;return k=ri(s,k),ui(s,g),u=Ka(r,s,u,h,k,g),h=Qa(),r!==null&&!Dt?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~g,Un(r,s,g)):(Ye&&h&&Pa(s),s.flags|=1,Rt(r,s,u,g),s.child)}function Ph(r,s,u,h,g){if(Ot(u)){var k=!0;ho(s)}else k=!1;if(ui(s,g),s.stateNode===null)Po(r,s),vh(s,u,h),tu(s,u,h,g),h=!0;else if(r===null){var S=s.stateNode,P=s.memoizedProps;S.props=P;var L=S.context,G=u.contextType;typeof G=="object"&&G!==null?G=tn(G):(G=Ot(u)?xr:St.current,G=ri(s,G));var Y=u.getDerivedStateFromProps,Z=typeof Y=="function"||typeof S.getSnapshotBeforeUpdate=="function";Z||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(P!==h||L!==G)&&wh(s,S,h,G),ir=!1;var X=s.memoizedState;S.state=X,So(s,h,S,g),L=s.memoizedState,P!==h||X!==L||Mt.current||ir?(typeof Y=="function"&&(eu(s,u,Y,h),L=s.memoizedState),(P=ir||kh(s,u,P,h,X,L,G))?(Z||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(s.flags|=4194308)):(typeof S.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=h,s.memoizedState=L),S.props=h,S.state=L,S.context=G,h=P):(typeof S.componentDidMount=="function"&&(s.flags|=4194308),h=!1)}else{S=s.stateNode,qd(r,s),P=s.memoizedProps,G=s.type===s.elementType?P:gn(s.type,P),S.props=G,Z=s.pendingProps,X=S.context,L=u.contextType,typeof L=="object"&&L!==null?L=tn(L):(L=Ot(u)?xr:St.current,L=ri(s,L));var ue=u.getDerivedStateFromProps;(Y=typeof ue=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(P!==Z||X!==L)&&wh(s,S,h,L),ir=!1,X=s.memoizedState,S.state=X,So(s,h,S,g);var he=s.memoizedState;P!==Z||X!==he||Mt.current||ir?(typeof ue=="function"&&(eu(s,u,ue,h),he=s.memoizedState),(G=ir||kh(s,u,G,h,X,he,L)||!1)?(Y||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(h,he,L),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(h,he,L)),typeof S.componentDidUpdate=="function"&&(s.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof S.componentDidUpdate!="function"||P===r.memoizedProps&&X===r.memoizedState||(s.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||P===r.memoizedProps&&X===r.memoizedState||(s.flags|=1024),s.memoizedProps=h,s.memoizedState=he),S.props=h,S.state=he,S.context=L,h=G):(typeof S.componentDidUpdate!="function"||P===r.memoizedProps&&X===r.memoizedState||(s.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||P===r.memoizedProps&&X===r.memoizedState||(s.flags|=1024),h=!1)}return su(r,s,u,h,k,g)}function su(r,s,u,h,g,k){Ah(r,s);var S=(s.flags&128)!==0;if(!h&&!S)return g&&Od(s,u,!1),Un(r,s,k);h=s.stateNode,tw.current=s;var P=S&&typeof u.getDerivedStateFromError!="function"?null:h.render();return s.flags|=1,r!==null&&S?(s.child=li(s,r.child,null,k),s.child=li(s,null,P,k)):Rt(r,s,P,k),s.memoizedState=h.state,g&&Od(s,u,!0),s.child}function Rh(r){var s=r.stateNode;s.pendingContext?jd(r,s.pendingContext,s.pendingContext!==s.context):s.context&&jd(r,s.context,!1),Ua(r,s.containerInfo)}function Lh(r,s,u,h,g){return oi(),Ma(g),s.flags|=256,Rt(r,s,u,h),s.child}var ou={dehydrated:null,treeContext:null,retryLane:0};function lu(r){return{baseLanes:r,cachePool:null,transitions:null}}function jh(r,s,u){var h=s.pendingProps,g=Ze.current,k=!1,S=(s.flags&128)!==0,P;if((P=S)||(P=r!==null&&r.memoizedState===null?!1:(g&2)!==0),P?(k=!0,s.flags&=-129):(r===null||r.memoizedState!==null)&&(g|=1),Ke(Ze,g&1),r===null)return ja(s),r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?((s.mode&1)===0?s.lanes=1:r.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(S=h.children,r=h.fallback,k?(h=s.mode,k=s.child,S={mode:"hidden",children:S},(h&1)===0&&k!==null?(k.childLanes=0,k.pendingProps=S):k=Vo(S,h,0,null),r=Pr(r,h,u,null),k.return=s,r.return=s,k.sibling=r,s.child=k,s.child.memoizedState=lu(u),s.memoizedState=ou,r):au(s,S));if(g=r.memoizedState,g!==null&&(P=g.dehydrated,P!==null))return nw(r,s,S,h,P,g,u);if(k){k=h.fallback,S=s.mode,g=r.child,P=g.sibling;var L={mode:"hidden",children:h.children};return(S&1)===0&&s.child!==g?(h=s.child,h.childLanes=0,h.pendingProps=L,s.deletions=null):(h=fr(g,L),h.subtreeFlags=g.subtreeFlags&14680064),P!==null?k=fr(P,k):(k=Pr(k,S,u,null),k.flags|=2),k.return=s,h.return=s,h.sibling=k,s.child=h,h=k,k=s.child,S=r.child.memoizedState,S=S===null?lu(u):{baseLanes:S.baseLanes|u,cachePool:null,transitions:S.transitions},k.memoizedState=S,k.childLanes=r.childLanes&~u,s.memoizedState=ou,h}return k=r.child,r=k.sibling,h=fr(k,{mode:"visible",children:h.children}),(s.mode&1)===0&&(h.lanes=u),h.return=s,h.sibling=null,r!==null&&(u=s.deletions,u===null?(s.deletions=[r],s.flags|=16):u.push(r)),s.child=h,s.memoizedState=null,h}function au(r,s){return s=Vo({mode:"visible",children:s},r.mode,0,null),s.return=r,r.child=s}function Ao(r,s,u,h){return h!==null&&Ma(h),li(s,r.child,null,u),r=au(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function nw(r,s,u,h,g,k,S){if(u)return s.flags&256?(s.flags&=-257,h=nu(Error(n(422))),Ao(r,s,S,h)):s.memoizedState!==null?(s.child=r.child,s.flags|=128,null):(k=h.fallback,g=s.mode,h=Vo({mode:"visible",children:h.children},g,0,null),k=Pr(k,g,S,null),k.flags|=2,h.return=s,k.return=s,h.sibling=k,s.child=h,(s.mode&1)!==0&&li(s,r.child,null,S),s.child.memoizedState=lu(S),s.memoizedState=ou,k);if((s.mode&1)===0)return Ao(r,s,S,null);if(g.data==="$!"){if(h=g.nextSibling&&g.nextSibling.dataset,h)var P=h.dgst;return h=P,k=Error(n(419)),h=nu(k,h,void 0),Ao(r,s,S,h)}if(P=(S&r.childLanes)!==0,Dt||P){if(h=gt,h!==null){switch(S&-S){case 4:g=2;break;case 16:g=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:g=32;break;case 536870912:g=268435456;break;default:g=0}g=(g&(h.suspendedLanes|S))!==0?0:g,g!==0&&g!==k.retryLane&&(k.retryLane=g,zn(r,g),vn(h,r,g,-1))}return _u(),h=nu(Error(n(421))),Ao(r,s,S,h)}return g.data==="$?"?(s.flags|=128,s.child=r.child,s=mw.bind(null,r),g._reactRetry=s,null):(r=k.treeContext,Kt=er(g.nextSibling),qt=s,Ye=!0,mn=null,r!==null&&(Zt[en++]=$n,Zt[en++]=Fn,Zt[en++]=Sr,$n=r.id,Fn=r.overflow,Sr=s),s=au(s,h.children),s.flags|=4096,s)}function Mh(r,s,u){r.lanes|=s;var h=r.alternate;h!==null&&(h.lanes|=s),Fa(r.return,s,u)}function uu(r,s,u,h,g){var k=r.memoizedState;k===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:g}:(k.isBackwards=s,k.rendering=null,k.renderingStartTime=0,k.last=h,k.tail=u,k.tailMode=g)}function Oh(r,s,u){var h=s.pendingProps,g=h.revealOrder,k=h.tail;if(Rt(r,s,h.children,u),h=Ze.current,(h&2)!==0)h=h&1|2,s.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=s.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Mh(r,u,s);else if(r.tag===19)Mh(r,u,s);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}h&=1}if(Ke(Ze,h),(s.mode&1)===0)s.memoizedState=null;else switch(g){case"forwards":for(u=s.child,g=null;u!==null;)r=u.alternate,r!==null&&Co(r)===null&&(g=u),u=u.sibling;u=g,u===null?(g=s.child,s.child=null):(g=u.sibling,u.sibling=null),uu(s,!1,g,u,k);break;case"backwards":for(u=null,g=s.child,s.child=null;g!==null;){if(r=g.alternate,r!==null&&Co(r)===null){s.child=g;break}r=g.sibling,g.sibling=u,u=g,g=r}uu(s,!0,u,null,k);break;case"together":uu(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function Po(r,s){(s.mode&1)===0&&r!==null&&(r.alternate=null,s.alternate=null,s.flags|=2)}function Un(r,s,u){if(r!==null&&(s.dependencies=r.dependencies),Ir|=s.lanes,(u&s.childLanes)===0)return null;if(r!==null&&s.child!==r.child)throw Error(n(153));if(s.child!==null){for(r=s.child,u=fr(r,r.pendingProps),s.child=u,u.return=s;r.sibling!==null;)r=r.sibling,u=u.sibling=fr(r,r.pendingProps),u.return=s;u.sibling=null}return s.child}function rw(r,s,u){switch(s.tag){case 3:Rh(s),oi();break;case 5:Xd(s);break;case 1:Ot(s.type)&&ho(s);break;case 4:Ua(s,s.stateNode.containerInfo);break;case 10:var h=s.type._context,g=s.memoizedProps.value;Ke(vo,h._currentValue),h._currentValue=g;break;case 13:if(h=s.memoizedState,h!==null)return h.dehydrated!==null?(Ke(Ze,Ze.current&1),s.flags|=128,null):(u&s.child.childLanes)!==0?jh(r,s,u):(Ke(Ze,Ze.current&1),r=Un(r,s,u),r!==null?r.sibling:null);Ke(Ze,Ze.current&1);break;case 19:if(h=(u&s.childLanes)!==0,(r.flags&128)!==0){if(h)return Oh(r,s,u);s.flags|=128}if(g=s.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),Ke(Ze,Ze.current),h)break;return null;case 22:case 23:return s.lanes=0,Th(r,s,u)}return Un(r,s,u)}var Dh,cu,$h,Fh;Dh=function(r,s){for(var u=s.child;u!==null;){if(u.tag===5||u.tag===6)r.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return;u=u.return}u.sibling.return=u.return,u=u.sibling}},cu=function(){},$h=function(r,s,u,h){var g=r.memoizedProps;if(g!==h){r=s.stateNode,br(En.current);var k=null;switch(u){case"input":g=Rn(r,g),h=Rn(r,h),k=[];break;case"select":g=I({},g,{value:void 0}),h=I({},h,{value:void 0}),k=[];break;case"textarea":g=Pt(r,g),h=Pt(r,h),k=[];break;default:typeof g.onClick!="function"&&typeof h.onClick=="function"&&(r.onclick=uo)}Je(u,h);var S;u=null;for(G in g)if(!h.hasOwnProperty(G)&&g.hasOwnProperty(G)&&g[G]!=null)if(G==="style"){var P=g[G];for(S in P)P.hasOwnProperty(S)&&(u||(u={}),u[S]="")}else G!=="dangerouslySetInnerHTML"&&G!=="children"&&G!=="suppressContentEditableWarning"&&G!=="suppressHydrationWarning"&&G!=="autoFocus"&&(o.hasOwnProperty(G)?k||(k=[]):(k=k||[]).push(G,null));for(G in h){var L=h[G];if(P=g?.[G],h.hasOwnProperty(G)&&L!==P&&(L!=null||P!=null))if(G==="style")if(P){for(S in P)!P.hasOwnProperty(S)||L&&L.hasOwnProperty(S)||(u||(u={}),u[S]="");for(S in L)L.hasOwnProperty(S)&&P[S]!==L[S]&&(u||(u={}),u[S]=L[S])}else u||(k||(k=[]),k.push(G,u)),u=L;else G==="dangerouslySetInnerHTML"?(L=L?L.__html:void 0,P=P?P.__html:void 0,L!=null&&P!==L&&(k=k||[]).push(G,L)):G==="children"?typeof L!="string"&&typeof L!="number"||(k=k||[]).push(G,""+L):G!=="suppressContentEditableWarning"&&G!=="suppressHydrationWarning"&&(o.hasOwnProperty(G)?(L!=null&&G==="onScroll"&&Qe("scroll",r),k||P===L||(k=[])):(k=k||[]).push(G,L))}u&&(k=k||[]).push("style",u);var G=k;(s.updateQueue=G)&&(s.flags|=4)}},Fh=function(r,s,u,h){u!==h&&(s.flags|=4)};function us(r,s){if(!Ye)switch(r.tailMode){case"hidden":s=r.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?r.tail=null:u.sibling=null;break;case"collapsed":u=r.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:h.sibling=null}}function _t(r){var s=r.alternate!==null&&r.alternate.child===r.child,u=0,h=0;if(s)for(var g=r.child;g!==null;)u|=g.lanes|g.childLanes,h|=g.subtreeFlags&14680064,h|=g.flags&14680064,g.return=r,g=g.sibling;else for(g=r.child;g!==null;)u|=g.lanes|g.childLanes,h|=g.subtreeFlags,h|=g.flags,g.return=r,g=g.sibling;return r.subtreeFlags|=h,r.childLanes=u,s}function iw(r,s,u){var h=s.pendingProps;switch(Ra(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _t(s),null;case 1:return Ot(s.type)&&fo(),_t(s),null;case 3:return h=s.stateNode,ci(),Xe(Mt),Xe(St),Wa(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(r===null||r.child===null)&&(yo(s)?s.flags|=4:r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,mn!==null&&(xu(mn),mn=null))),cu(r,s),_t(s),null;case 5:Va(s);var g=br(is.current);if(u=s.type,r!==null&&s.stateNode!=null)$h(r,s,u,h,g),r.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!h){if(s.stateNode===null)throw Error(n(166));return _t(s),null}if(r=br(En.current),yo(s)){h=s.stateNode,u=s.type;var k=s.memoizedProps;switch(h[bn]=s,h[Zi]=k,r=(s.mode&1)!==0,u){case"dialog":Qe("cancel",h),Qe("close",h);break;case"iframe":case"object":case"embed":Qe("load",h);break;case"video":case"audio":for(g=0;g<Xi.length;g++)Qe(Xi[g],h);break;case"source":Qe("error",h);break;case"img":case"image":case"link":Qe("error",h),Qe("load",h);break;case"details":Qe("toggle",h);break;case"input":Ln(h,k),Qe("invalid",h);break;case"select":h._wrapperState={wasMultiple:!!k.multiple},Qe("invalid",h);break;case"textarea":pt(h,k),Qe("invalid",h)}Je(u,k),g=null;for(var S in k)if(k.hasOwnProperty(S)){var P=k[S];S==="children"?typeof P=="string"?h.textContent!==P&&(k.suppressHydrationWarning!==!0&&ao(h.textContent,P,r),g=["children",P]):typeof P=="number"&&h.textContent!==""+P&&(k.suppressHydrationWarning!==!0&&ao(h.textContent,P,r),g=["children",""+P]):o.hasOwnProperty(S)&&P!=null&&S==="onScroll"&&Qe("scroll",h)}switch(u){case"input":At(h),le(h,k,!0);break;case"textarea":At(h),Mn(h);break;case"select":case"option":break;default:typeof k.onClick=="function"&&(h.onclick=uo)}h=g,s.updateQueue=h,h!==null&&(s.flags|=4)}else{S=g.nodeType===9?g:g.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=K(u)),r==="http://www.w3.org/1999/xhtml"?u==="script"?(r=S.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof h.is=="string"?r=S.createElement(u,{is:h.is}):(r=S.createElement(u),u==="select"&&(S=r,h.multiple?S.multiple=!0:h.size&&(S.size=h.size))):r=S.createElementNS(r,u),r[bn]=s,r[Zi]=h,Dh(r,s,!1,!1),s.stateNode=r;e:{switch(S=Gt(u,h),u){case"dialog":Qe("cancel",r),Qe("close",r),g=h;break;case"iframe":case"object":case"embed":Qe("load",r),g=h;break;case"video":case"audio":for(g=0;g<Xi.length;g++)Qe(Xi[g],r);g=h;break;case"source":Qe("error",r),g=h;break;case"img":case"image":case"link":Qe("error",r),Qe("load",r),g=h;break;case"details":Qe("toggle",r),g=h;break;case"input":Ln(r,h),g=Rn(r,h),Qe("invalid",r);break;case"option":g=h;break;case"select":r._wrapperState={wasMultiple:!!h.multiple},g=I({},h,{value:void 0}),Qe("invalid",r);break;case"textarea":pt(r,h),g=Pt(r,h),Qe("invalid",r);break;default:g=h}Je(u,g),P=g;for(k in P)if(P.hasOwnProperty(k)){var L=P[k];k==="style"?ot(r,L):k==="dangerouslySetInnerHTML"?(L=L?L.__html:void 0,L!=null&&Q(r,L)):k==="children"?typeof L=="string"?(u!=="textarea"||L!=="")&&oe(r,L):typeof L=="number"&&oe(r,""+L):k!=="suppressContentEditableWarning"&&k!=="suppressHydrationWarning"&&k!=="autoFocus"&&(o.hasOwnProperty(k)?L!=null&&k==="onScroll"&&Qe("scroll",r):L!=null&&E(r,k,L,S))}switch(u){case"input":At(r),le(r,h,!1);break;case"textarea":At(r),Mn(r);break;case"option":h.value!=null&&r.setAttribute("value",""+Ie(h.value));break;case"select":r.multiple=!!h.multiple,k=h.value,k!=null?st(r,!!h.multiple,k,!1):h.defaultValue!=null&&st(r,!!h.multiple,h.defaultValue,!0);break;default:typeof g.onClick=="function"&&(r.onclick=uo)}switch(u){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}}h&&(s.flags|=4)}s.ref!==null&&(s.flags|=512,s.flags|=2097152)}return _t(s),null;case 6:if(r&&s.stateNode!=null)Fh(r,s,r.memoizedProps,h);else{if(typeof h!="string"&&s.stateNode===null)throw Error(n(166));if(u=br(is.current),br(En.current),yo(s)){if(h=s.stateNode,u=s.memoizedProps,h[bn]=s,(k=h.nodeValue!==u)&&(r=qt,r!==null))switch(r.tag){case 3:ao(h.nodeValue,u,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&ao(h.nodeValue,u,(r.mode&1)!==0)}k&&(s.flags|=4)}else h=(u.nodeType===9?u:u.ownerDocument).createTextNode(h),h[bn]=s,s.stateNode=h}return _t(s),null;case 13:if(Xe(Ze),h=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(Ye&&Kt!==null&&(s.mode&1)!==0&&(s.flags&128)===0)Ud(),oi(),s.flags|=98560,k=!1;else if(k=yo(s),h!==null&&h.dehydrated!==null){if(r===null){if(!k)throw Error(n(318));if(k=s.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(n(317));k[bn]=s}else oi(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;_t(s),k=!1}else mn!==null&&(xu(mn),mn=null),k=!0;if(!k)return s.flags&65536?s:null}return(s.flags&128)!==0?(s.lanes=u,s):(h=h!==null,h!==(r!==null&&r.memoizedState!==null)&&h&&(s.child.flags|=8192,(s.mode&1)!==0&&(r===null||(Ze.current&1)!==0?ft===0&&(ft=3):_u())),s.updateQueue!==null&&(s.flags|=4),_t(s),null);case 4:return ci(),cu(r,s),r===null&&Yi(s.stateNode.containerInfo),_t(s),null;case 10:return $a(s.type._context),_t(s),null;case 17:return Ot(s.type)&&fo(),_t(s),null;case 19:if(Xe(Ze),k=s.memoizedState,k===null)return _t(s),null;if(h=(s.flags&128)!==0,S=k.rendering,S===null)if(h)us(k,!1);else{if(ft!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(S=Co(r),S!==null){for(s.flags|=128,us(k,!1),h=S.updateQueue,h!==null&&(s.updateQueue=h,s.flags|=4),s.subtreeFlags=0,h=u,u=s.child;u!==null;)k=u,r=h,k.flags&=14680066,S=k.alternate,S===null?(k.childLanes=0,k.lanes=r,k.child=null,k.subtreeFlags=0,k.memoizedProps=null,k.memoizedState=null,k.updateQueue=null,k.dependencies=null,k.stateNode=null):(k.childLanes=S.childLanes,k.lanes=S.lanes,k.child=S.child,k.subtreeFlags=0,k.deletions=null,k.memoizedProps=S.memoizedProps,k.memoizedState=S.memoizedState,k.updateQueue=S.updateQueue,k.type=S.type,r=S.dependencies,k.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),u=u.sibling;return Ke(Ze,Ze.current&1|2),s.child}r=r.sibling}k.tail!==null&&nt()>pi&&(s.flags|=128,h=!0,us(k,!1),s.lanes=4194304)}else{if(!h)if(r=Co(S),r!==null){if(s.flags|=128,h=!0,u=r.updateQueue,u!==null&&(s.updateQueue=u,s.flags|=4),us(k,!0),k.tail===null&&k.tailMode==="hidden"&&!S.alternate&&!Ye)return _t(s),null}else 2*nt()-k.renderingStartTime>pi&&u!==1073741824&&(s.flags|=128,h=!0,us(k,!1),s.lanes=4194304);k.isBackwards?(S.sibling=s.child,s.child=S):(u=k.last,u!==null?u.sibling=S:s.child=S,k.last=S)}return k.tail!==null?(s=k.tail,k.rendering=s,k.tail=s.sibling,k.renderingStartTime=nt(),s.sibling=null,u=Ze.current,Ke(Ze,h?u&1|2:u&1),s):(_t(s),null);case 22:case 23:return Cu(),h=s.memoizedState!==null,r!==null&&r.memoizedState!==null!==h&&(s.flags|=8192),h&&(s.mode&1)!==0?(Qt&1073741824)!==0&&(_t(s),s.subtreeFlags&6&&(s.flags|=8192)):_t(s),null;case 24:return null;case 25:return null}throw Error(n(156,s.tag))}function sw(r,s){switch(Ra(s),s.tag){case 1:return Ot(s.type)&&fo(),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return ci(),Xe(Mt),Xe(St),Wa(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 5:return Va(s),null;case 13:if(Xe(Ze),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(n(340));oi()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return Xe(Ze),null;case 4:return ci(),null;case 10:return $a(s.type._context),null;case 22:case 23:return Cu(),null;case 24:return null;default:return null}}var Ro=!1,bt=!1,ow=typeof WeakSet=="function"?WeakSet:Set,de=null;function di(r,s){var u=r.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(h){tt(r,s,h)}else u.current=null}function fu(r,s,u){try{u()}catch(h){tt(r,s,h)}}var zh=!1;function lw(r,s){if(Ca=Ys,r=kd(),ma(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var g=h.anchorOffset,k=h.focusNode;h=h.focusOffset;try{u.nodeType,k.nodeType}catch{u=null;break e}var S=0,P=-1,L=-1,G=0,Y=0,Z=r,X=null;t:for(;;){for(var ue;Z!==u||g!==0&&Z.nodeType!==3||(P=S+g),Z!==k||h!==0&&Z.nodeType!==3||(L=S+h),Z.nodeType===3&&(S+=Z.nodeValue.length),(ue=Z.firstChild)!==null;)X=Z,Z=ue;for(;;){if(Z===r)break t;if(X===u&&++G===g&&(P=S),X===k&&++Y===h&&(L=S),(ue=Z.nextSibling)!==null)break;Z=X,X=Z.parentNode}Z=ue}u=P===-1||L===-1?null:{start:P,end:L}}else u=null}u=u||{start:0,end:0}}else u=null;for(_a={focusedElem:r,selectionRange:u},Ys=!1,de=s;de!==null;)if(s=de,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,de=r;else for(;de!==null;){s=de;try{var he=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(he!==null){var pe=he.memoizedProps,rt=he.memoizedState,F=s.stateNode,j=F.getSnapshotBeforeUpdate(s.elementType===s.type?pe:gn(s.type,pe),rt);F.__reactInternalSnapshotBeforeUpdate=j}break;case 3:var z=s.stateNode.containerInfo;z.nodeType===1?z.textContent="":z.nodeType===9&&z.documentElement&&z.removeChild(z.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(se){tt(s,s.return,se)}if(r=s.sibling,r!==null){r.return=s.return,de=r;break}de=s.return}return he=zh,zh=!1,he}function cs(r,s,u){var h=s.updateQueue;if(h=h!==null?h.lastEffect:null,h!==null){var g=h=h.next;do{if((g.tag&r)===r){var k=g.destroy;g.destroy=void 0,k!==void 0&&fu(s,u,k)}g=g.next}while(g!==h)}}function Lo(r,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var u=s=s.next;do{if((u.tag&r)===r){var h=u.create;u.destroy=h()}u=u.next}while(u!==s)}}function du(r){var s=r.ref;if(s!==null){var u=r.stateNode;r.tag,r=u,typeof s=="function"?s(r):s.current=r}}function Bh(r){var s=r.alternate;s!==null&&(r.alternate=null,Bh(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&(delete s[bn],delete s[Zi],delete s[Na],delete s[Vv],delete s[Gv])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function Uh(r){return r.tag===5||r.tag===3||r.tag===4}function Vh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Uh(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function hu(r,s,u){var h=r.tag;if(h===5||h===6)r=r.stateNode,s?u.nodeType===8?u.parentNode.insertBefore(r,s):u.insertBefore(r,s):(u.nodeType===8?(s=u.parentNode,s.insertBefore(r,u)):(s=u,s.appendChild(r)),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=uo));else if(h!==4&&(r=r.child,r!==null))for(hu(r,s,u),r=r.sibling;r!==null;)hu(r,s,u),r=r.sibling}function pu(r,s,u){var h=r.tag;if(h===5||h===6)r=r.stateNode,s?u.insertBefore(r,s):u.appendChild(r);else if(h!==4&&(r=r.child,r!==null))for(pu(r,s,u),r=r.sibling;r!==null;)pu(r,s,u),r=r.sibling}var wt=null,yn=!1;function or(r,s,u){for(u=u.child;u!==null;)Gh(r,s,u),u=u.sibling}function Gh(r,s,u){if(_n&&typeof _n.onCommitFiberUnmount=="function")try{_n.onCommitFiberUnmount(Ws,u)}catch{}switch(u.tag){case 5:bt||di(u,s);case 6:var h=wt,g=yn;wt=null,or(r,s,u),wt=h,yn=g,wt!==null&&(yn?(r=wt,u=u.stateNode,r.nodeType===8?r.parentNode.removeChild(u):r.removeChild(u)):wt.removeChild(u.stateNode));break;case 18:wt!==null&&(yn?(r=wt,u=u.stateNode,r.nodeType===8?Ia(r.parentNode,u):r.nodeType===1&&Ia(r,u),Ui(r)):Ia(wt,u.stateNode));break;case 4:h=wt,g=yn,wt=u.stateNode.containerInfo,yn=!0,or(r,s,u),wt=h,yn=g;break;case 0:case 11:case 14:case 15:if(!bt&&(h=u.updateQueue,h!==null&&(h=h.lastEffect,h!==null))){g=h=h.next;do{var k=g,S=k.destroy;k=k.tag,S!==void 0&&((k&2)!==0||(k&4)!==0)&&fu(u,s,S),g=g.next}while(g!==h)}or(r,s,u);break;case 1:if(!bt&&(di(u,s),h=u.stateNode,typeof h.componentWillUnmount=="function"))try{h.props=u.memoizedProps,h.state=u.memoizedState,h.componentWillUnmount()}catch(P){tt(u,s,P)}or(r,s,u);break;case 21:or(r,s,u);break;case 22:u.mode&1?(bt=(h=bt)||u.memoizedState!==null,or(r,s,u),bt=h):or(r,s,u);break;default:or(r,s,u)}}function Wh(r){var s=r.updateQueue;if(s!==null){r.updateQueue=null;var u=r.stateNode;u===null&&(u=r.stateNode=new ow),s.forEach(function(h){var g=gw.bind(null,r,h);u.has(h)||(u.add(h),h.then(g,g))})}}function kn(r,s){var u=s.deletions;if(u!==null)for(var h=0;h<u.length;h++){var g=u[h];try{var k=r,S=s,P=S;e:for(;P!==null;){switch(P.tag){case 5:wt=P.stateNode,yn=!1;break e;case 3:wt=P.stateNode.containerInfo,yn=!0;break e;case 4:wt=P.stateNode.containerInfo,yn=!0;break e}P=P.return}if(wt===null)throw Error(n(160));Gh(k,S,g),wt=null,yn=!1;var L=g.alternate;L!==null&&(L.return=null),g.return=null}catch(G){tt(g,s,G)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)Hh(s,r),s=s.sibling}function Hh(r,s){var u=r.alternate,h=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(kn(s,r),Nn(r),h&4){try{cs(3,r,r.return),Lo(3,r)}catch(pe){tt(r,r.return,pe)}try{cs(5,r,r.return)}catch(pe){tt(r,r.return,pe)}}break;case 1:kn(s,r),Nn(r),h&512&&u!==null&&di(u,u.return);break;case 5:if(kn(s,r),Nn(r),h&512&&u!==null&&di(u,u.return),r.flags&32){var g=r.stateNode;try{oe(g,"")}catch(pe){tt(r,r.return,pe)}}if(h&4&&(g=r.stateNode,g!=null)){var k=r.memoizedProps,S=u!==null?u.memoizedProps:k,P=r.type,L=r.updateQueue;if(r.updateQueue=null,L!==null)try{P==="input"&&k.type==="radio"&&k.name!=null&&Cn(g,k),Gt(P,S);var G=Gt(P,k);for(S=0;S<L.length;S+=2){var Y=L[S],Z=L[S+1];Y==="style"?ot(g,Z):Y==="dangerouslySetInnerHTML"?Q(g,Z):Y==="children"?oe(g,Z):E(g,Y,Z,G)}switch(P){case"input":dn(g,k);break;case"textarea":jn(g,k);break;case"select":var X=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!k.multiple;var ue=k.value;ue!=null?st(g,!!k.multiple,ue,!1):X!==!!k.multiple&&(k.defaultValue!=null?st(g,!!k.multiple,k.defaultValue,!0):st(g,!!k.multiple,k.multiple?[]:"",!1))}g[Zi]=k}catch(pe){tt(r,r.return,pe)}}break;case 6:if(kn(s,r),Nn(r),h&4){if(r.stateNode===null)throw Error(n(162));g=r.stateNode,k=r.memoizedProps;try{g.nodeValue=k}catch(pe){tt(r,r.return,pe)}}break;case 3:if(kn(s,r),Nn(r),h&4&&u!==null&&u.memoizedState.isDehydrated)try{Ui(s.containerInfo)}catch(pe){tt(r,r.return,pe)}break;case 4:kn(s,r),Nn(r);break;case 13:kn(s,r),Nn(r),g=r.child,g.flags&8192&&(k=g.memoizedState!==null,g.stateNode.isHidden=k,!k||g.alternate!==null&&g.alternate.memoizedState!==null||(yu=nt())),h&4&&Wh(r);break;case 22:if(Y=u!==null&&u.memoizedState!==null,r.mode&1?(bt=(G=bt)||Y,kn(s,r),bt=G):kn(s,r),Nn(r),h&8192){if(G=r.memoizedState!==null,(r.stateNode.isHidden=G)&&!Y&&(r.mode&1)!==0)for(de=r,Y=r.child;Y!==null;){for(Z=de=Y;de!==null;){switch(X=de,ue=X.child,X.tag){case 0:case 11:case 14:case 15:cs(4,X,X.return);break;case 1:di(X,X.return);var he=X.stateNode;if(typeof he.componentWillUnmount=="function"){h=X,u=X.return;try{s=h,he.props=s.memoizedProps,he.state=s.memoizedState,he.componentWillUnmount()}catch(pe){tt(h,u,pe)}}break;case 5:di(X,X.return);break;case 22:if(X.memoizedState!==null){Qh(Z);continue}}ue!==null?(ue.return=X,de=ue):Qh(Z)}Y=Y.sibling}e:for(Y=null,Z=r;;){if(Z.tag===5){if(Y===null){Y=Z;try{g=Z.stateNode,G?(k=g.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none"):(P=Z.stateNode,L=Z.memoizedProps.style,S=L!=null&&L.hasOwnProperty("display")?L.display:null,P.style.display=De("display",S))}catch(pe){tt(r,r.return,pe)}}}else if(Z.tag===6){if(Y===null)try{Z.stateNode.nodeValue=G?"":Z.memoizedProps}catch(pe){tt(r,r.return,pe)}}else if((Z.tag!==22&&Z.tag!==23||Z.memoizedState===null||Z===r)&&Z.child!==null){Z.child.return=Z,Z=Z.child;continue}if(Z===r)break e;for(;Z.sibling===null;){if(Z.return===null||Z.return===r)break e;Y===Z&&(Y=null),Z=Z.return}Y===Z&&(Y=null),Z.sibling.return=Z.return,Z=Z.sibling}}break;case 19:kn(s,r),Nn(r),h&4&&Wh(r);break;case 21:break;default:kn(s,r),Nn(r)}}function Nn(r){var s=r.flags;if(s&2){try{e:{for(var u=r.return;u!==null;){if(Uh(u)){var h=u;break e}u=u.return}throw Error(n(160))}switch(h.tag){case 5:var g=h.stateNode;h.flags&32&&(oe(g,""),h.flags&=-33);var k=Vh(r);pu(r,k,g);break;case 3:case 4:var S=h.stateNode.containerInfo,P=Vh(r);hu(r,P,S);break;default:throw Error(n(161))}}catch(L){tt(r,r.return,L)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function aw(r,s,u){de=r,qh(r)}function qh(r,s,u){for(var h=(r.mode&1)!==0;de!==null;){var g=de,k=g.child;if(g.tag===22&&h){var S=g.memoizedState!==null||Ro;if(!S){var P=g.alternate,L=P!==null&&P.memoizedState!==null||bt;P=Ro;var G=bt;if(Ro=S,(bt=L)&&!G)for(de=g;de!==null;)S=de,L=S.child,S.tag===22&&S.memoizedState!==null?Xh(g):L!==null?(L.return=S,de=L):Xh(g);for(;k!==null;)de=k,qh(k),k=k.sibling;de=g,Ro=P,bt=G}Kh(r)}else(g.subtreeFlags&8772)!==0&&k!==null?(k.return=g,de=k):Kh(r)}}function Kh(r){for(;de!==null;){var s=de;if((s.flags&8772)!==0){var u=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:bt||Lo(5,s);break;case 1:var h=s.stateNode;if(s.flags&4&&!bt)if(u===null)h.componentDidMount();else{var g=s.elementType===s.type?u.memoizedProps:gn(s.type,u.memoizedProps);h.componentDidUpdate(g,u.memoizedState,h.__reactInternalSnapshotBeforeUpdate)}var k=s.updateQueue;k!==null&&Qd(s,k,h);break;case 3:var S=s.updateQueue;if(S!==null){if(u=null,s.child!==null)switch(s.child.tag){case 5:u=s.child.stateNode;break;case 1:u=s.child.stateNode}Qd(s,S,u)}break;case 5:var P=s.stateNode;if(u===null&&s.flags&4){u=P;var L=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":L.autoFocus&&u.focus();break;case"img":L.src&&(u.src=L.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var G=s.alternate;if(G!==null){var Y=G.memoizedState;if(Y!==null){var Z=Y.dehydrated;Z!==null&&Ui(Z)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}bt||s.flags&512&&du(s)}catch(X){tt(s,s.return,X)}}if(s===r){de=null;break}if(u=s.sibling,u!==null){u.return=s.return,de=u;break}de=s.return}}function Qh(r){for(;de!==null;){var s=de;if(s===r){de=null;break}var u=s.sibling;if(u!==null){u.return=s.return,de=u;break}de=s.return}}function Xh(r){for(;de!==null;){var s=de;try{switch(s.tag){case 0:case 11:case 15:var u=s.return;try{Lo(4,s)}catch(L){tt(s,u,L)}break;case 1:var h=s.stateNode;if(typeof h.componentDidMount=="function"){var g=s.return;try{h.componentDidMount()}catch(L){tt(s,g,L)}}var k=s.return;try{du(s)}catch(L){tt(s,k,L)}break;case 5:var S=s.return;try{du(s)}catch(L){tt(s,S,L)}}}catch(L){tt(s,s.return,L)}if(s===r){de=null;break}var P=s.sibling;if(P!==null){P.return=s.return,de=P;break}de=s.return}}var uw=Math.ceil,jo=B.ReactCurrentDispatcher,mu=B.ReactCurrentOwner,rn=B.ReactCurrentBatchConfig,ze=0,gt=null,lt=null,xt=0,Qt=0,hi=tr(0),ft=0,fs=null,Ir=0,Mo=0,gu=0,ds=null,$t=null,yu=0,pi=1/0,Vn=null,Oo=!1,ku=null,lr=null,Do=!1,ar=null,$o=0,hs=0,vu=null,Fo=-1,zo=0;function Lt(){return(ze&6)!==0?nt():Fo!==-1?Fo:Fo=nt()}function ur(r){return(r.mode&1)===0?1:(ze&2)!==0&&xt!==0?xt&-xt:Hv.transition!==null?(zo===0&&(zo=Vf()),zo):(r=Ve,r!==0||(r=window.event,r=r===void 0?16:Jf(r.type)),r)}function vn(r,s,u,h){if(50<hs)throw hs=0,vu=null,Error(n(185));Di(r,u,h),((ze&2)===0||r!==gt)&&(r===gt&&((ze&2)===0&&(Mo|=u),ft===4&&cr(r,xt)),Ft(r,h),u===1&&ze===0&&(s.mode&1)===0&&(pi=nt()+500,po&&rr()))}function Ft(r,s){var u=r.callbackNode;Hk(r,s);var h=Ks(r,r===gt?xt:0);if(h===0)u!==null&&zf(u),r.callbackNode=null,r.callbackPriority=0;else if(s=h&-h,r.callbackPriority!==s){if(u!=null&&zf(u),s===1)r.tag===0?Wv(Jh.bind(null,r)):Dd(Jh.bind(null,r)),Bv(function(){(ze&6)===0&&rr()}),u=null;else{switch(Gf(h)){case 1:u=Jl;break;case 4:u=Bf;break;case 16:u=Gs;break;case 536870912:u=Uf;break;default:u=Gs}u=op(u,Yh.bind(null,r))}r.callbackPriority=s,r.callbackNode=u}}function Yh(r,s){if(Fo=-1,zo=0,(ze&6)!==0)throw Error(n(327));var u=r.callbackNode;if(mi()&&r.callbackNode!==u)return null;var h=Ks(r,r===gt?xt:0);if(h===0)return null;if((h&30)!==0||(h&r.expiredLanes)!==0||s)s=Bo(r,h);else{s=h;var g=ze;ze|=2;var k=ep();(gt!==r||xt!==s)&&(Vn=null,pi=nt()+500,Tr(r,s));do try{dw();break}catch(P){Zh(r,P)}while(!0);Da(),jo.current=k,ze=g,lt!==null?s=0:(gt=null,xt=0,s=ft)}if(s!==0){if(s===2&&(g=Zl(r),g!==0&&(h=g,s=wu(r,g))),s===1)throw u=fs,Tr(r,0),cr(r,h),Ft(r,nt()),u;if(s===6)cr(r,h);else{if(g=r.current.alternate,(h&30)===0&&!cw(g)&&(s=Bo(r,h),s===2&&(k=Zl(r),k!==0&&(h=k,s=wu(r,k))),s===1))throw u=fs,Tr(r,0),cr(r,h),Ft(r,nt()),u;switch(r.finishedWork=g,r.finishedLanes=h,s){case 0:case 1:throw Error(n(345));case 2:Ar(r,$t,Vn);break;case 3:if(cr(r,h),(h&130023424)===h&&(s=yu+500-nt(),10<s)){if(Ks(r,0)!==0)break;if(g=r.suspendedLanes,(g&h)!==h){Lt(),r.pingedLanes|=r.suspendedLanes&g;break}r.timeoutHandle=Ea(Ar.bind(null,r,$t,Vn),s);break}Ar(r,$t,Vn);break;case 4:if(cr(r,h),(h&4194240)===h)break;for(s=r.eventTimes,g=-1;0<h;){var S=31-hn(h);k=1<<S,S=s[S],S>g&&(g=S),h&=~k}if(h=g,h=nt()-h,h=(120>h?120:480>h?480:1080>h?1080:1920>h?1920:3e3>h?3e3:4320>h?4320:1960*uw(h/1960))-h,10<h){r.timeoutHandle=Ea(Ar.bind(null,r,$t,Vn),h);break}Ar(r,$t,Vn);break;case 5:Ar(r,$t,Vn);break;default:throw Error(n(329))}}}return Ft(r,nt()),r.callbackNode===u?Yh.bind(null,r):null}function wu(r,s){var u=ds;return r.current.memoizedState.isDehydrated&&(Tr(r,s).flags|=256),r=Bo(r,s),r!==2&&(s=$t,$t=u,s!==null&&xu(s)),r}function xu(r){$t===null?$t=r:$t.push.apply($t,r)}function cw(r){for(var s=r;;){if(s.flags&16384){var u=s.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var h=0;h<u.length;h++){var g=u[h],k=g.getSnapshot;g=g.value;try{if(!pn(k(),g))return!1}catch{return!1}}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;else{if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function cr(r,s){for(s&=~gu,s&=~Mo,r.suspendedLanes|=s,r.pingedLanes&=~s,r=r.expirationTimes;0<s;){var u=31-hn(s),h=1<<u;r[u]=-1,s&=~h}}function Jh(r){if((ze&6)!==0)throw Error(n(327));mi();var s=Ks(r,0);if((s&1)===0)return Ft(r,nt()),null;var u=Bo(r,s);if(r.tag!==0&&u===2){var h=Zl(r);h!==0&&(s=h,u=wu(r,h))}if(u===1)throw u=fs,Tr(r,0),cr(r,s),Ft(r,nt()),u;if(u===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=s,Ar(r,$t,Vn),Ft(r,nt()),null}function Su(r,s){var u=ze;ze|=1;try{return r(s)}finally{ze=u,ze===0&&(pi=nt()+500,po&&rr())}}function Nr(r){ar!==null&&ar.tag===0&&(ze&6)===0&&mi();var s=ze;ze|=1;var u=rn.transition,h=Ve;try{if(rn.transition=null,Ve=1,r)return r()}finally{Ve=h,rn.transition=u,ze=s,(ze&6)===0&&rr()}}function Cu(){Qt=hi.current,Xe(hi)}function Tr(r,s){r.finishedWork=null,r.finishedLanes=0;var u=r.timeoutHandle;if(u!==-1&&(r.timeoutHandle=-1,zv(u)),lt!==null)for(u=lt.return;u!==null;){var h=u;switch(Ra(h),h.tag){case 1:h=h.type.childContextTypes,h!=null&&fo();break;case 3:ci(),Xe(Mt),Xe(St),Wa();break;case 5:Va(h);break;case 4:ci();break;case 13:Xe(Ze);break;case 19:Xe(Ze);break;case 10:$a(h.type._context);break;case 22:case 23:Cu()}u=u.return}if(gt=r,lt=r=fr(r.current,null),xt=Qt=s,ft=0,fs=null,gu=Mo=Ir=0,$t=ds=null,_r!==null){for(s=0;s<_r.length;s++)if(u=_r[s],h=u.interleaved,h!==null){u.interleaved=null;var g=h.next,k=u.pending;if(k!==null){var S=k.next;k.next=g,h.next=S}u.pending=h}_r=null}return r}function Zh(r,s){do{var u=lt;try{if(Da(),_o.current=No,bo){for(var h=et.memoizedState;h!==null;){var g=h.queue;g!==null&&(g.pending=null),h=h.next}bo=!1}if(Er=0,mt=ct=et=null,ss=!1,os=0,mu.current=null,u===null||u.return===null){ft=1,fs=s,lt=null;break}e:{var k=r,S=u.return,P=u,L=s;if(s=xt,P.flags|=32768,L!==null&&typeof L=="object"&&typeof L.then=="function"){var G=L,Y=P,Z=Y.tag;if((Y.mode&1)===0&&(Z===0||Z===11||Z===15)){var X=Y.alternate;X?(Y.updateQueue=X.updateQueue,Y.memoizedState=X.memoizedState,Y.lanes=X.lanes):(Y.updateQueue=null,Y.memoizedState=null)}var ue=_h(S);if(ue!==null){ue.flags&=-257,bh(ue,S,P,k,s),ue.mode&1&&Ch(k,G,s),s=ue,L=G;var he=s.updateQueue;if(he===null){var pe=new Set;pe.add(L),s.updateQueue=pe}else he.add(L);break e}else{if((s&1)===0){Ch(k,G,s),_u();break e}L=Error(n(426))}}else if(Ye&&P.mode&1){var rt=_h(S);if(rt!==null){(rt.flags&65536)===0&&(rt.flags|=256),bh(rt,S,P,k,s),Ma(fi(L,P));break e}}k=L=fi(L,P),ft!==4&&(ft=2),ds===null?ds=[k]:ds.push(k),k=S;do{switch(k.tag){case 3:k.flags|=65536,s&=-s,k.lanes|=s;var F=xh(k,L,s);Kd(k,F);break e;case 1:P=L;var j=k.type,z=k.stateNode;if((k.flags&128)===0&&(typeof j.getDerivedStateFromError=="function"||z!==null&&typeof z.componentDidCatch=="function"&&(lr===null||!lr.has(z)))){k.flags|=65536,s&=-s,k.lanes|=s;var se=Sh(k,P,s);Kd(k,se);break e}}k=k.return}while(k!==null)}np(u)}catch(me){s=me,lt===u&&u!==null&&(lt=u=u.return);continue}break}while(!0)}function ep(){var r=jo.current;return jo.current=No,r===null?No:r}function _u(){(ft===0||ft===3||ft===2)&&(ft=4),gt===null||(Ir&268435455)===0&&(Mo&268435455)===0||cr(gt,xt)}function Bo(r,s){var u=ze;ze|=2;var h=ep();(gt!==r||xt!==s)&&(Vn=null,Tr(r,s));do try{fw();break}catch(g){Zh(r,g)}while(!0);if(Da(),ze=u,jo.current=h,lt!==null)throw Error(n(261));return gt=null,xt=0,ft}function fw(){for(;lt!==null;)tp(lt)}function dw(){for(;lt!==null&&!Dk();)tp(lt)}function tp(r){var s=sp(r.alternate,r,Qt);r.memoizedProps=r.pendingProps,s===null?np(r):lt=s,mu.current=null}function np(r){var s=r;do{var u=s.alternate;if(r=s.return,(s.flags&32768)===0){if(u=iw(u,s,Qt),u!==null){lt=u;return}}else{if(u=sw(u,s),u!==null){u.flags&=32767,lt=u;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{ft=6,lt=null;return}}if(s=s.sibling,s!==null){lt=s;return}lt=s=r}while(s!==null);ft===0&&(ft=5)}function Ar(r,s,u){var h=Ve,g=rn.transition;try{rn.transition=null,Ve=1,hw(r,s,u,h)}finally{rn.transition=g,Ve=h}return null}function hw(r,s,u,h){do mi();while(ar!==null);if((ze&6)!==0)throw Error(n(327));u=r.finishedWork;var g=r.finishedLanes;if(u===null)return null;if(r.finishedWork=null,r.finishedLanes=0,u===r.current)throw Error(n(177));r.callbackNode=null,r.callbackPriority=0;var k=u.lanes|u.childLanes;if(qk(r,k),r===gt&&(lt=gt=null,xt=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||Do||(Do=!0,op(Gs,function(){return mi(),null})),k=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||k){k=rn.transition,rn.transition=null;var S=Ve;Ve=1;var P=ze;ze|=4,mu.current=null,lw(r,u),Hh(u,r),Lv(_a),Ys=!!Ca,_a=Ca=null,r.current=u,aw(u),$k(),ze=P,Ve=S,rn.transition=k}else r.current=u;if(Do&&(Do=!1,ar=r,$o=g),k=r.pendingLanes,k===0&&(lr=null),Bk(u.stateNode),Ft(r,nt()),s!==null)for(h=r.onRecoverableError,u=0;u<s.length;u++)g=s[u],h(g.value,{componentStack:g.stack,digest:g.digest});if(Oo)throw Oo=!1,r=ku,ku=null,r;return($o&1)!==0&&r.tag!==0&&mi(),k=r.pendingLanes,(k&1)!==0?r===vu?hs++:(hs=0,vu=r):hs=0,rr(),null}function mi(){if(ar!==null){var r=Gf($o),s=rn.transition,u=Ve;try{if(rn.transition=null,Ve=16>r?16:r,ar===null)var h=!1;else{if(r=ar,ar=null,$o=0,(ze&6)!==0)throw Error(n(331));var g=ze;for(ze|=4,de=r.current;de!==null;){var k=de,S=k.child;if((de.flags&16)!==0){var P=k.deletions;if(P!==null){for(var L=0;L<P.length;L++){var G=P[L];for(de=G;de!==null;){var Y=de;switch(Y.tag){case 0:case 11:case 15:cs(8,Y,k)}var Z=Y.child;if(Z!==null)Z.return=Y,de=Z;else for(;de!==null;){Y=de;var X=Y.sibling,ue=Y.return;if(Bh(Y),Y===G){de=null;break}if(X!==null){X.return=ue,de=X;break}de=ue}}}var he=k.alternate;if(he!==null){var pe=he.child;if(pe!==null){he.child=null;do{var rt=pe.sibling;pe.sibling=null,pe=rt}while(pe!==null)}}de=k}}if((k.subtreeFlags&2064)!==0&&S!==null)S.return=k,de=S;else e:for(;de!==null;){if(k=de,(k.flags&2048)!==0)switch(k.tag){case 0:case 11:case 15:cs(9,k,k.return)}var F=k.sibling;if(F!==null){F.return=k.return,de=F;break e}de=k.return}}var j=r.current;for(de=j;de!==null;){S=de;var z=S.child;if((S.subtreeFlags&2064)!==0&&z!==null)z.return=S,de=z;else e:for(S=j;de!==null;){if(P=de,(P.flags&2048)!==0)try{switch(P.tag){case 0:case 11:case 15:Lo(9,P)}}catch(me){tt(P,P.return,me)}if(P===S){de=null;break e}var se=P.sibling;if(se!==null){se.return=P.return,de=se;break e}de=P.return}}if(ze=g,rr(),_n&&typeof _n.onPostCommitFiberRoot=="function")try{_n.onPostCommitFiberRoot(Ws,r)}catch{}h=!0}return h}finally{Ve=u,rn.transition=s}}return!1}function rp(r,s,u){s=fi(u,s),s=xh(r,s,1),r=sr(r,s,1),s=Lt(),r!==null&&(Di(r,1,s),Ft(r,s))}function tt(r,s,u){if(r.tag===3)rp(r,r,u);else for(;s!==null;){if(s.tag===3){rp(s,r,u);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(lr===null||!lr.has(h))){r=fi(u,r),r=Sh(s,r,1),s=sr(s,r,1),r=Lt(),s!==null&&(Di(s,1,r),Ft(s,r));break}}s=s.return}}function pw(r,s,u){var h=r.pingCache;h!==null&&h.delete(s),s=Lt(),r.pingedLanes|=r.suspendedLanes&u,gt===r&&(xt&u)===u&&(ft===4||ft===3&&(xt&130023424)===xt&&500>nt()-yu?Tr(r,0):gu|=u),Ft(r,s)}function ip(r,s){s===0&&((r.mode&1)===0?s=1:(s=qs,qs<<=1,(qs&130023424)===0&&(qs=4194304)));var u=Lt();r=zn(r,s),r!==null&&(Di(r,s,u),Ft(r,u))}function mw(r){var s=r.memoizedState,u=0;s!==null&&(u=s.retryLane),ip(r,u)}function gw(r,s){var u=0;switch(r.tag){case 13:var h=r.stateNode,g=r.memoizedState;g!==null&&(u=g.retryLane);break;case 19:h=r.stateNode;break;default:throw Error(n(314))}h!==null&&h.delete(s),ip(r,u)}var sp;sp=function(r,s,u){if(r!==null)if(r.memoizedProps!==s.pendingProps||Mt.current)Dt=!0;else{if((r.lanes&u)===0&&(s.flags&128)===0)return Dt=!1,rw(r,s,u);Dt=(r.flags&131072)!==0}else Dt=!1,Ye&&(s.flags&1048576)!==0&&$d(s,go,s.index);switch(s.lanes=0,s.tag){case 2:var h=s.type;Po(r,s),r=s.pendingProps;var g=ri(s,St.current);ui(s,u),g=Ka(null,s,h,r,g,u);var k=Qa();return s.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,Ot(h)?(k=!0,ho(s)):k=!1,s.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,Ba(s),g.updater=To,s.stateNode=g,g._reactInternals=s,tu(s,h,r,u),s=su(null,s,h,!0,k,u)):(s.tag=0,Ye&&k&&Pa(s),Rt(null,s,g,u),s=s.child),s;case 16:h=s.elementType;e:{switch(Po(r,s),r=s.pendingProps,g=h._init,h=g(h._payload),s.type=h,g=s.tag=kw(h),r=gn(h,r),g){case 0:s=iu(null,s,h,r,u);break e;case 1:s=Ph(null,s,h,r,u);break e;case 11:s=Eh(null,s,h,r,u);break e;case 14:s=Ih(null,s,h,gn(h.type,r),u);break e}throw Error(n(306,h,""))}return s;case 0:return h=s.type,g=s.pendingProps,g=s.elementType===h?g:gn(h,g),iu(r,s,h,g,u);case 1:return h=s.type,g=s.pendingProps,g=s.elementType===h?g:gn(h,g),Ph(r,s,h,g,u);case 3:e:{if(Rh(s),r===null)throw Error(n(387));h=s.pendingProps,k=s.memoizedState,g=k.element,qd(r,s),So(s,h,null,u);var S=s.memoizedState;if(h=S.element,k.isDehydrated)if(k={element:h,isDehydrated:!1,cache:S.cache,pendingSuspenseBoundaries:S.pendingSuspenseBoundaries,transitions:S.transitions},s.updateQueue.baseState=k,s.memoizedState=k,s.flags&256){g=fi(Error(n(423)),s),s=Lh(r,s,h,u,g);break e}else if(h!==g){g=fi(Error(n(424)),s),s=Lh(r,s,h,u,g);break e}else for(Kt=er(s.stateNode.containerInfo.firstChild),qt=s,Ye=!0,mn=null,u=Wd(s,null,h,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(oi(),h===g){s=Un(r,s,u);break e}Rt(r,s,h,u)}s=s.child}return s;case 5:return Xd(s),r===null&&ja(s),h=s.type,g=s.pendingProps,k=r!==null?r.memoizedProps:null,S=g.children,ba(h,g)?S=null:k!==null&&ba(h,k)&&(s.flags|=32),Ah(r,s),Rt(r,s,S,u),s.child;case 6:return r===null&&ja(s),null;case 13:return jh(r,s,u);case 4:return Ua(s,s.stateNode.containerInfo),h=s.pendingProps,r===null?s.child=li(s,null,h,u):Rt(r,s,h,u),s.child;case 11:return h=s.type,g=s.pendingProps,g=s.elementType===h?g:gn(h,g),Eh(r,s,h,g,u);case 7:return Rt(r,s,s.pendingProps,u),s.child;case 8:return Rt(r,s,s.pendingProps.children,u),s.child;case 12:return Rt(r,s,s.pendingProps.children,u),s.child;case 10:e:{if(h=s.type._context,g=s.pendingProps,k=s.memoizedProps,S=g.value,Ke(vo,h._currentValue),h._currentValue=S,k!==null)if(pn(k.value,S)){if(k.children===g.children&&!Mt.current){s=Un(r,s,u);break e}}else for(k=s.child,k!==null&&(k.return=s);k!==null;){var P=k.dependencies;if(P!==null){S=k.child;for(var L=P.firstContext;L!==null;){if(L.context===h){if(k.tag===1){L=Bn(-1,u&-u),L.tag=2;var G=k.updateQueue;if(G!==null){G=G.shared;var Y=G.pending;Y===null?L.next=L:(L.next=Y.next,Y.next=L),G.pending=L}}k.lanes|=u,L=k.alternate,L!==null&&(L.lanes|=u),Fa(k.return,u,s),P.lanes|=u;break}L=L.next}}else if(k.tag===10)S=k.type===s.type?null:k.child;else if(k.tag===18){if(S=k.return,S===null)throw Error(n(341));S.lanes|=u,P=S.alternate,P!==null&&(P.lanes|=u),Fa(S,u,s),S=k.sibling}else S=k.child;if(S!==null)S.return=k;else for(S=k;S!==null;){if(S===s){S=null;break}if(k=S.sibling,k!==null){k.return=S.return,S=k;break}S=S.return}k=S}Rt(r,s,g.children,u),s=s.child}return s;case 9:return g=s.type,h=s.pendingProps.children,ui(s,u),g=tn(g),h=h(g),s.flags|=1,Rt(r,s,h,u),s.child;case 14:return h=s.type,g=gn(h,s.pendingProps),g=gn(h.type,g),Ih(r,s,h,g,u);case 15:return Nh(r,s,s.type,s.pendingProps,u);case 17:return h=s.type,g=s.pendingProps,g=s.elementType===h?g:gn(h,g),Po(r,s),s.tag=1,Ot(h)?(r=!0,ho(s)):r=!1,ui(s,u),vh(s,h,g),tu(s,h,g,u),su(null,s,h,!0,r,u);case 19:return Oh(r,s,u);case 22:return Th(r,s,u)}throw Error(n(156,s.tag))};function op(r,s){return Ff(r,s)}function yw(r,s,u,h){this.tag=r,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sn(r,s,u,h){return new yw(r,s,u,h)}function bu(r){return r=r.prototype,!(!r||!r.isReactComponent)}function kw(r){if(typeof r=="function")return bu(r)?1:0;if(r!=null){if(r=r.$$typeof,r===J)return 11;if(r===te)return 14}return 2}function fr(r,s){var u=r.alternate;return u===null?(u=sn(r.tag,s,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u.alternate=r,r.alternate=u):(u.pendingProps=s,u.type=r.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=r.flags&14680064,u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue,s=r.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u}function Uo(r,s,u,h,g,k){var S=2;if(h=r,typeof r=="function")bu(r)&&(S=1);else if(typeof r=="string")S=5;else e:switch(r){case ie:return Pr(u.children,g,k,s);case U:S=8,g|=8;break;case ce:return r=sn(12,u,s,g|2),r.elementType=ce,r.lanes=k,r;case fe:return r=sn(13,u,s,g),r.elementType=fe,r.lanes=k,r;case ee:return r=sn(19,u,s,g),r.elementType=ee,r.lanes=k,r;case _e:return Vo(u,g,k,s);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case R:S=10;break e;case H:S=9;break e;case J:S=11;break e;case te:S=14;break e;case xe:S=16,h=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return s=sn(S,u,s,g),s.elementType=r,s.type=h,s.lanes=k,s}function Pr(r,s,u,h){return r=sn(7,r,h,s),r.lanes=u,r}function Vo(r,s,u,h){return r=sn(22,r,h,s),r.elementType=_e,r.lanes=u,r.stateNode={isHidden:!1},r}function Eu(r,s,u){return r=sn(6,r,null,s),r.lanes=u,r}function Iu(r,s,u){return s=sn(4,r.children!==null?r.children:[],r.key,s),s.lanes=u,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}function vw(r,s,u,h,g){this.tag=s,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ea(0),this.expirationTimes=ea(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ea(0),this.identifierPrefix=h,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Nu(r,s,u,h,g,k,S,P,L){return r=new vw(r,s,u,P,L),s===1?(s=1,k===!0&&(s|=8)):s=0,k=sn(3,null,null,s),r.current=k,k.stateNode=r,k.memoizedState={element:h,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ba(k),r}function ww(r,s,u){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:D,key:h==null?null:""+h,children:r,containerInfo:s,implementation:u}}function lp(r){if(!r)return nr;r=r._reactInternals;e:{if(vr(r)!==r||r.tag!==1)throw Error(n(170));var s=r;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(Ot(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(s!==null);throw Error(n(171))}if(r.tag===1){var u=r.type;if(Ot(u))return Md(r,u,s)}return s}function ap(r,s,u,h,g,k,S,P,L){return r=Nu(u,h,!0,r,g,k,S,P,L),r.context=lp(null),u=r.current,h=Lt(),g=ur(u),k=Bn(h,g),k.callback=s??null,sr(u,k,g),r.current.lanes=g,Di(r,g,h),Ft(r,h),r}function Go(r,s,u,h){var g=s.current,k=Lt(),S=ur(g);return u=lp(u),s.context===null?s.context=u:s.pendingContext=u,s=Bn(k,S),s.payload={element:r},h=h===void 0?null:h,h!==null&&(s.callback=h),r=sr(g,s,S),r!==null&&(vn(r,g,S,k),xo(r,g,S)),S}function Wo(r){return r=r.current,r.child?(r.child.tag===5,r.child.stateNode):null}function up(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<s?u:s}}function Tu(r,s){up(r,s),(r=r.alternate)&&up(r,s)}function xw(){return null}var cp=typeof reportError=="function"?reportError:function(r){console.error(r)};function Au(r){this._internalRoot=r}Ho.prototype.render=Au.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(n(409));Go(r,s,null,null)},Ho.prototype.unmount=Au.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;Nr(function(){Go(null,r,null,null)}),s[On]=null}};function Ho(r){this._internalRoot=r}Ho.prototype.unstable_scheduleHydration=function(r){if(r){var s=qf();r={blockedOn:null,target:r,priority:s};for(var u=0;u<Yn.length&&s!==0&&s<Yn[u].priority;u++);Yn.splice(u,0,r),u===0&&Xf(r)}};function Pu(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function qo(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function fp(){}function Sw(r,s,u,h,g){if(g){if(typeof h=="function"){var k=h;h=function(){var G=Wo(S);k.call(G)}}var S=ap(s,h,r,0,null,!1,!1,"",fp);return r._reactRootContainer=S,r[On]=S.current,Yi(r.nodeType===8?r.parentNode:r),Nr(),S}for(;g=r.lastChild;)r.removeChild(g);if(typeof h=="function"){var P=h;h=function(){var G=Wo(L);P.call(G)}}var L=Nu(r,0,!1,null,null,!1,!1,"",fp);return r._reactRootContainer=L,r[On]=L.current,Yi(r.nodeType===8?r.parentNode:r),Nr(function(){Go(s,L,u,h)}),L}function Ko(r,s,u,h,g){var k=u._reactRootContainer;if(k){var S=k;if(typeof g=="function"){var P=g;g=function(){var L=Wo(S);P.call(L)}}Go(s,S,r,g)}else S=Sw(u,s,r,g,h);return Wo(S)}Wf=function(r){switch(r.tag){case 3:var s=r.stateNode;if(s.current.memoizedState.isDehydrated){var u=Oi(s.pendingLanes);u!==0&&(ta(s,u|1),Ft(s,nt()),(ze&6)===0&&(pi=nt()+500,rr()))}break;case 13:Nr(function(){var h=zn(r,1);if(h!==null){var g=Lt();vn(h,r,1,g)}}),Tu(r,1)}},na=function(r){if(r.tag===13){var s=zn(r,134217728);if(s!==null){var u=Lt();vn(s,r,134217728,u)}Tu(r,134217728)}},Hf=function(r){if(r.tag===13){var s=ur(r),u=zn(r,s);if(u!==null){var h=Lt();vn(u,r,s,h)}Tu(r,s)}},qf=function(){return Ve},Kf=function(r,s){var u=Ve;try{return Ve=r,s()}finally{Ve=u}},Kl=function(r,s,u){switch(s){case"input":if(dn(r,u),s=u.name,u.type==="radio"&&s!=null){for(u=r;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll("input[name="+JSON.stringify(""+s)+'][type="radio"]'),s=0;s<u.length;s++){var h=u[s];if(h!==r&&h.form===r.form){var g=co(h);if(!g)throw Error(n(90));fn(h),dn(h,g)}}}break;case"textarea":jn(r,u);break;case"select":s=u.value,s!=null&&st(r,!!u.multiple,s,!1)}},Rf=Su,Lf=Nr;var Cw={usingClientEntryPoint:!1,Events:[es,ti,co,Af,Pf,Su]},ps={findFiberByHostInstance:wr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},_w={bundleType:ps.bundleType,version:ps.version,rendererPackageName:ps.rendererPackageName,rendererConfig:ps.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:B.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=Df(r),r===null?null:r.stateNode},findFiberByHostInstance:ps.findFiberByHostInstance||xw,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Qo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qo.isDisabled&&Qo.supportsFiber)try{Ws=Qo.inject(_w),_n=Qo}catch{}}return zt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Cw,zt.createPortal=function(r,s){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Pu(s))throw Error(n(200));return ww(r,s,null,u)},zt.createRoot=function(r,s){if(!Pu(r))throw Error(n(299));var u=!1,h="",g=cp;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(h=s.identifierPrefix),s.onRecoverableError!==void 0&&(g=s.onRecoverableError)),s=Nu(r,1,!1,null,null,u,!1,h,g),r[On]=s.current,Yi(r.nodeType===8?r.parentNode:r),new Au(s)},zt.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var s=r._reactInternals;if(s===void 0)throw typeof r.render=="function"?Error(n(188)):(r=Object.keys(r).join(","),Error(n(268,r)));return r=Df(s),r=r===null?null:r.stateNode,r},zt.flushSync=function(r){return Nr(r)},zt.hydrate=function(r,s,u){if(!qo(s))throw Error(n(200));return Ko(null,r,s,!0,u)},zt.hydrateRoot=function(r,s,u){if(!Pu(r))throw Error(n(405));var h=u!=null&&u.hydratedSources||null,g=!1,k="",S=cp;if(u!=null&&(u.unstable_strictMode===!0&&(g=!0),u.identifierPrefix!==void 0&&(k=u.identifierPrefix),u.onRecoverableError!==void 0&&(S=u.onRecoverableError)),s=ap(s,null,r,1,u??null,g,!1,k,S),r[On]=s.current,Yi(r),h)for(r=0;r<h.length;r++)u=h[r],g=u._getVersion,g=g(u._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[u,g]:s.mutableSourceEagerHydrationData.push(u,g);return new Ho(s)},zt.render=function(r,s,u){if(!qo(s))throw Error(n(200));return Ko(null,r,s,!1,u)},zt.unmountComponentAtNode=function(r){if(!qo(r))throw Error(n(40));return r._reactRootContainer?(Nr(function(){Ko(null,null,r,!1,function(){r._reactRootContainer=null,r[On]=null})}),!0):!1},zt.unstable_batchedUpdates=Su,zt.unstable_renderSubtreeIntoContainer=function(r,s,u,h){if(!qo(u))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return Ko(r,s,u,!1,h)},zt.version="18.3.1-next-f1338f8080-20240426",zt}var vp;function hg(){if(vp)return ju.exports;vp=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(),ju.exports=Pw(),ju.exports}var wp;function Rw(){if(wp)return Xo;wp=1;var e=hg();return Xo.createRoot=e.createRoot,Xo.hydrateRoot=e.hydrateRoot,Xo}var Lw=Rw();class gr extends Error{constructor(t){super(t),this.name="TargetKeyError"}}function Yo(e){return!(!e||e.length>256||e.startsWith("-")||e.startsWith(".")||/[\s\0]/.test(e)||e.includes(".."))}function xp(e){if(e==="working"||e==="staged"||e==="all")return{kind:e};if(e.startsWith("commit:")){const t=e.slice(7);if(!Yo(t))throw new gr(`invalid commit ref: ${t}`);return{kind:"commit",sha:t}}if(e.startsWith("base:")){const t=e.slice(5);if(!Yo(t))throw new gr(`invalid base ref: ${t}`);return{kind:"base",ref:t}}if(e.startsWith("range:")){const t=e.slice(6),n=t.indexOf("..");if(n<=0)throw new gr(`invalid range: ${t}`);const i=t.slice(0,n),o=t.slice(n+2);if(!Yo(i)||!Yo(o))throw new gr(`invalid range refs: ${t}`);return{kind:"range",base:i,head:o}}throw new gr(`unknown target key: ${e}`)}function jl(e){if(typeof e!="string"||!e)throw new gr("empty target key");if(e.startsWith("worktree:")){const t=e.slice(9),n=/^(.+):(working|staged|all|commit:.+|range:.+|base:.+)$/.exec(t);if(!n||!n[1]||!n[2])throw new gr(`invalid worktree target key: ${e}`);const i=n[1];if(!i.startsWith("/"))throw new gr(`worktree path must be absolute: ${i}`);return{...xp(n[2]),worktree:i}}return xp(e)}function Ut(e){let t;switch(e.kind){case"working":case"staged":case"all":t=e.kind;break;case"commit":t=`commit:${e.sha}`;break;case"range":t=`range:${e.base}..${e.head}`;break;case"base":t=`base:${e.ref}`;break}return e.worktree?`worktree:${e.worktree}:${t}`:t}function wc(e){let t;switch(e.kind){case"working":t="Working tree";break;case"staged":t="Staged";break;case"all":t="Working tree vs HEAD";break;case"commit":t=`Commit ${e.sha.length>12?e.sha.slice(0,8):e.sha}`;break;case"range":t=`${e.base}..${e.head}`;break;case"base":t=`Branch vs ${e.ref}`;break}return e.worktree?`[${e.worktree.split("/").filter(Boolean).pop()??e.worktree}] ${t}`:t}function an(e){try{return jl(e)}catch{return}}function $r(e){return e.kind==="working"||e.kind==="staged"||e.kind==="all"}function jw(e){const t=an(e);return!t||!$r(t)?e:t.worktree?`worktree:${t.worktree}:local`:"local"}function Qc(e){if(e.kind==="working")return"stage";if(e.kind==="staged")return"unstage"}function Mw(e){const t=an(e),n=t?.worktree?{worktree:t.worktree}:{};return[Ut({kind:"working",...n}),Ut({kind:"staged",...n}),Ut({kind:"all",...n})]}function Sp(e,t,n){const i=n===void 0?-1:e.findIndex(o=>o.id===n);return i<0?[t,...e]:[...e.slice(0,i+1),t,...e.slice(i+1)]}function Cp(e,t,n){const i=e.find(l=>l.id===t);if(!i)return null;if(n===t)return[...e];const o=e.filter(l=>l.id!==t);if(n===null)return[...o,i];const a=o.findIndex(l=>l.id===n);return a<0?null:(o.splice(a,0,i),o)}const _p=e=>{let t;const n=new Set,i=(d,p)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const y=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(v=>v(t,y))}},o=()=>t,c={setState:i,getState:o,getInitialState:()=>f,subscribe:d=>(n.add(d),()=>n.delete(d))},f=t=e(i,o,c);return c},Ow=(e=>e?_p(e):_p),Dw=e=>e;function $w(e,t=Dw){const n=Ss.useSyncExternalStore(e.subscribe,Ss.useCallback(()=>t(e.getState()),[e,t]),Ss.useCallback(()=>t(e.getInitialState()),[e,t]));return Ss.useDebugValue(n),n}const bp=e=>{const t=Ow(e),n=i=>$w(t,i);return Object.assign(n,t),n},Fw=(e=>e?bp(e):bp);class Ur extends Error{constructor(t,n,i){super(t),this.status=n,this.code=i,this.name="ApiError"}status;code}async function Ue(e,t,n){const i=await fetch(t,{method:e,headers:n===void 0?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}),o=await i.text();let a=null;if(o)try{a=JSON.parse(o)}catch{a=null}if(!i.ok){const l=a??{};throw new Ur(l.error??`${i.status} ${i.statusText}`,i.status,l.code)}return a}const at=encodeURIComponent,Rr=e=>{const t=[];for(const[n,i]of Object.entries(e))i===void 0||i===""||i===!1||t.push(`${at(n)}=${at(i===!0?"1":String(i))}`);return t.length?`?${t.join("&")}`:""},Re={repo:()=>Ue("GET","/api/repo"),state:()=>Ue("GET","/api/state"),patchPrefs:e=>Ue("PATCH","/api/prefs",e),files:e=>Ue("GET",`/api/targets/${at(e)}/files`),file:(e,t,n={})=>Ue("GET",`/api/targets/${at(e)}/file${Rr({path:t,old:n.oldPath,untracked:n.untracked})}`),fullFile:(e,t,n)=>Ue("GET",`/api/targets/${at(e)}/file/full${Rr({path:t,side:n})}`),setViewed:(e,t,n,i)=>Ue("PUT",`/api/targets/${at(e)}/viewed`,{path:t,viewed:n,contentHash:i}),stage:(e,t)=>Ue("POST",`/api/targets/${at(e)}/stage`,t),createComment:(e,t)=>Ue("POST",`/api/targets/${at(e)}/comments`,t),updateComment:(e,t,n)=>Ue("PATCH",`/api/targets/${at(e)}/comments/${at(t)}`,n),deleteComment:(e,t)=>Ue("DELETE",`/api/targets/${at(e)}/comments/${at(t)}`),reanchor:(e,t)=>Ue("POST",`/api/targets/${at(e)}/comments/reanchor`,{files:t}),exportComments:e=>Ue("POST","/api/comments/export",{commentIds:e}),issues:()=>Ue("GET","/api/issues"),createIssue:e=>Ue("POST","/api/issues",e),updateIssue:(e,t)=>Ue("PATCH",`/api/issues/${at(e)}`,t),deleteIssue:e=>Ue("DELETE",`/api/issues/${at(e)}`),moveIssue:(e,t)=>Ue("POST",`/api/issues/${at(e)}/move`,{before:t}),exportIssue:e=>Ue("POST",`/api/issues/${at(e)}/export`),todos:e=>Ue("GET",`/api/todos${Rr({branch:e})}`),createTodo:e=>Ue("POST","/api/todos",e),updateTodo:(e,t)=>Ue("PATCH",`/api/todos/${at(e)}`,t),deleteTodo:e=>Ue("DELETE",`/api/todos/${at(e)}`),moveTodo:(e,t)=>Ue("POST",`/api/todos/${at(e)}/move`,{before:t}),events:e=>new EventSource(`/api/events${Rr({root:e})}`),commits:e=>Ue("GET",`/api/commits${Rr(e)}`),forkPoint:e=>Ue("GET",`/api/fork-point${Rr(e)}`),worktrees:()=>Ue("GET","/api/worktrees"),createWorktree:e=>Ue("POST","/api/worktrees",e),removeWorktree:e=>Ue("POST","/api/worktrees/remove",e),nvimInstances:(e,t=!1)=>Ue("GET",`/api/nvim/instances${Rr({root:e,rescan:t})}`),nvimSelect:(e,t)=>Ue("POST","/api/nvim/select",{root:e,socket:t}),nvimOpen:(e,t,n)=>Ue("POST","/api/nvim/open",{socket:e,absPath:t,line:n})};async function fl(e){if(navigator.clipboard&&window.isSecureContext){await navigator.clipboard.writeText(e);return}const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.left="-9999px",document.body.appendChild(t),t.select();try{if(!document.execCommand("copy"))throw new Error("copy command failed")}finally{document.body.removeChild(t)}}function zw(e){const t=e.body.replace(/\r\n/g,`
10
+ `).trim();return t?`${e.title}
11
+
12
+ ${t}`:e.title}function pg(e,t){return e?e.worktrees.find(n=>n.path===t)?.branch??e.branch:""}function Xc(){return V(e=>{const t=an(e.targetKey);return t?Qc(t):void 0})}let Bw=0,Du=null;function Jo(e){return e instanceof Ur||e instanceof Error?e.message:String(e)}const V=Fw((e,t)=>{const n=l=>t().showToast(Jo(l),"error"),i=l=>{const c=t();if(l===c.targetKey)return c.files;const f=an(l);return!f||!$r(f)?[]:f.kind==="working"?c.unstaged:f.kind==="staged"?c.staged:c.allFiles},o=(l,c,f)=>{const d=an(l),p=d&&$r(d)?d.kind:null,m=y=>y.map(v=>v.path===c?{...v,...f}:v);e(y=>({...p==="working"?{unstaged:m(y.unstaged)}:{},...p==="staged"?{staged:m(y.staged)}:{},...p==="all"?{allFiles:m(y.allFiles)}:{},...l===y.targetKey?{files:m(y.files)}:{}}))},a=async l=>{const{targetKey:c,files:f}=t(),d=f.find(p=>p.path===l);e(p=>({diffs:{...p.diffs,[l]:{status:"loading"}}}));try{const p=await Re.file(c,l,{oldPath:d?.oldPath,untracked:d?.untracked});return t().targetKey!==c?void 0:(e(m=>({diffs:{...m.diffs,[l]:{status:"ok",diff:p}}})),p)}catch(p){if(t().targetKey!==c)return;e(m=>({diffs:{...m.diffs,[l]:{status:"error",message:Jo(p)}}}));return}};return{repo:null,initError:null,prefs:{viewMode:"unified",nvimSocketByRoot:{},autoRefresh:!0},targetKey:"working",root:"",files:[],unstaged:[],staged:[],allFiles:[],filesLoading:!1,filesError:null,activeFile:null,diffs:{},comments:[],issues:[],todos:[],allComments:[],nvim:null,nvimScanning:!1,panel:"diff",includeExported:!1,selectedCommentIds:[],jumpTo:null,toast:null,reattaching:null,refreshNonce:0,refreshing:!1,refreshPending:!1,lastRefreshAt:null,restoreScroll:!1,editor:null,focusedCommentId:null,railFilter:"file",railTab:"comments",stageSel:null,staging:!1,async init(){try{const[l,c]=await Promise.all([Re.repo(),Re.state()]);e({repo:l,prefs:c.prefs,issues:c.issues,todos:c.todos,root:l.root}),await t().setTarget(l.defaultTarget||"working")}catch(l){e({initError:Jo(l)})}},async reloadRepo(){try{e({repo:await Re.repo()})}catch(l){n(l)}},async setTarget(l){e({targetKey:l,files:[],unstaged:[],staged:[],allFiles:[],diffs:{},activeFile:null,comments:[],filesError:null,selectedCommentIds:[],reattaching:null,panel:"diff",editor:null,focusedCommentId:null,stageSel:null}),Re.patchPrefs({lastTarget:l}).catch(()=>{}),await t().loadFiles()},async switchView(l,c){const f=an(l);if(!f||!$r(f)){await t().setTarget(l);return}const{unstaged:d,staged:p,allFiles:m}=t(),y=c!==void 0?c:t().activeFile,v=f.kind==="working"?d:f.kind==="staged"?p:m;e({targetKey:l,files:v,diffs:{},filesError:null,activeFile:y,stageSel:null}),Re.patchPrefs({lastTarget:l}).catch(()=>{}),f.kind==="all"&&await t().loadFiles(),y&&t().files.some(w=>w.path===y)&&await a(y)},async loadFiles(){const l=t().targetKey,c=an(l);e({filesLoading:!0,filesError:null});try{await Re.reanchor(l).catch(()=>{});const f=p=>t().activeFile&&p.some(m=>m.path===t().activeFile)?t().activeFile:null;if(c&&$r(c)){const[p,m]=Mw(l),[y,v,w]=await Promise.all([Re.files(p),Re.files(m),c.kind==="all"?Re.files(l):Promise.resolve(null)]);if(t().targetKey!==l)return;const _=c.kind==="working"?y.files:c.kind==="staged"?v.files:w.files,N=w??y;e({unstaged:y.files,staged:v.files,allFiles:w?.files??[],files:_,root:N.root,comments:N.comments,filesLoading:!1,activeFile:f(_)}),N.root!==t().nvim?.root&&t().scanNvim();return}const d=await Re.files(l);if(t().targetKey!==l)return;e({files:d.files,unstaged:[],staged:[],allFiles:[],root:d.root,comments:d.comments,filesLoading:!1,activeFile:f(d.files)}),d.root!==t().nvim?.root&&t().scanNvim()}catch(f){if(t().targetKey!==l)return;e({filesLoading:!1,filesError:Jo(f),files:[]})}},async refresh(){if(t().refreshing){e({refreshPending:!0});return}const{activeFile:l}=t();e({refreshing:!0,restoreScroll:!0,diffs:{},stageSel:null,refreshNonce:t().refreshNonce+1});try{await t().loadFiles(),l&&t().files.some(c=>c.path===l)&&await a(l),e({lastRefreshAt:new Date().toISOString()})}finally{e({refreshing:!1})}t().refreshPending&&(e({refreshPending:!1}),await t().refresh())},onRepoChanged(l){const c=t().root;e(f=>{if(!f.repo)return{};const d=f.repo.worktrees.map(m=>m.path===c?{...m,head:l.head,branch:l.branch}:m),p=c===f.repo.root;return{repo:{...f.repo,worktrees:d,...p?{head:l.head,branch:l.branch}:{}}}}),t().prefs.autoRefresh&&t().refresh()},setAutoRefresh(l){e(c=>({prefs:{...c.prefs,autoRefresh:l}})),Re.patchPrefs({autoRefresh:l}).catch(n)},consumeRestoreScroll(){return t().restoreScroll?(e({restoreScroll:!1}),!0):!1},async openFile(l,c=!1){e(d=>({activeFile:l,panel:"diff",stageSel:d.stageSel?.filePath===l?d.stageSel:null}));const f=t().diffs[l];!c&&f&&f.status!=="error"||await a(l)},setActiveFile(l){e({activeFile:l}),l&&t().openFile(l)},setViewMode(l){e(c=>({prefs:{...c.prefs,viewMode:l},stageSel:null})),Re.patchPrefs({viewMode:l}).catch(n)},async toggleViewed(l,c){const f=c??t().targetKey,d=i(f).find(m=>m.path===l);if(!d)return;const p=!d.viewed;o(f,l,{viewed:p,changed:!1});try{await Re.setViewed(f,l,p,d.contentHash)}catch(m){n(m),o(f,l,{viewed:!p})}},async createComment(l){try{const c=await Re.createComment(t().targetKey,l);return e(f=>({comments:[...f.comments,c],editor:null,focusedCommentId:c.id})),c}catch(c){n(c);return}},async updateComment(l,c){try{const f=await Re.updateComment(t().targetKey,l,c);return e(d=>({comments:d.comments.map(p=>p.id===l?f:p),reattaching:d.reattaching===l?null:d.reattaching})),f}catch(f){n(f);return}},async deleteComment(l){try{await Re.deleteComment(t().targetKey,l),e(c=>({comments:c.comments.filter(f=>f.id!==l),selectedCommentIds:c.selectedCommentIds.filter(f=>f!==l),focusedCommentId:c.focusedCommentId===l?null:c.focusedCommentId,issues:c.issues.map(f=>f.commentIds.includes(l)?{...f,commentIds:f.commentIds.filter(d=>d!==l)}:f)}))}catch(c){n(c)}},async exportComments(l){if(l.length===0){t().showToast("没有可复制的评论");return}try{const c=await Re.exportComments(l);await fl(c.text);const f=new Date().toISOString();e(d=>({comments:d.comments.map(p=>c.commentIds.includes(p.id)?{...p,status:p.status==="active"?"exported":p.status,exportedAt:f}:p)})),t().showToast(`已复制 ${c.count} 条评论到剪贴板`)}catch(c){n(c)}},async copyAllComments(){const{comments:l,includeExported:c}=t(),f=l.filter(d=>d.status==="active"||c&&d.status==="exported").map(d=>d.id);await t().exportComments(f)},async loadIssues(){try{const l=await Re.state(),c=Object.values(l.targets).flatMap(f=>f.comments);e({issues:l.issues,allComments:c})}catch(l){n(l)}},async createIssue(l){try{const c=await Re.createIssue(l);return e(f=>({issues:Sp(f.issues,c,l.after),selectedCommentIds:[]})),c}catch(c){n(c);return}},async updateIssue(l,c){try{const f=await Re.updateIssue(l,c);e(d=>({issues:d.issues.map(p=>p.id===l?f:p)}))}catch(f){n(f)}},async deleteIssue(l){const c=t().issues,f=c.findIndex(m=>m.id===l),d=c[f];if(!d)return;const p=c[f-1]?.id;try{await Re.deleteIssue(l),e(m=>({issues:m.issues.filter(y=>y.id!==l)})),t().showToast(`已删除「${d.title}」`,"info",{label:"撤消",run:()=>{t().createIssue({title:d.title,body:d.body,commentIds:d.commentIds,status:d.status,after:p})}})}catch(m){n(m)}},async deleteIssues(l){const c=[];for(const f of l){const d=t().issues.find(p=>p.id===f);if(d)try{await Re.deleteIssue(f),c.push(d),e(p=>({issues:p.issues.filter(m=>m.id!==f)}))}catch(p){n(p);break}}c.length!==0&&t().showToast(`已删除 ${c.length} 个 Issue`,"info",{label:"撤消",run:async()=>{for(const f of[...c].reverse())await t().createIssue({title:f.title,body:f.body,commentIds:f.commentIds,status:f.status})}})},async moveIssue(l,c){const f=t().issues,d=Cp(f,l,c);if(d){e({issues:d});try{const p=await Re.moveIssue(l,c);e({issues:p.issues})}catch(p){n(p),e({issues:f})}}},async exportIssue(l){try{const c=await Re.exportIssue(l);await fl(c.text);const f=new Date().toISOString();e(d=>({comments:d.comments.map(p=>c.commentIds.includes(p.id)?{...p,status:p.status==="active"?"exported":p.status,exportedAt:f}:p)})),t().showToast(`已复制 Issue(含 ${c.count} 条评论)到剪贴板`)}catch(c){n(c)}},async scanNvim(l=!1){const c=t().root||t().repo?.root;if(c){e({nvimScanning:!0});try{const f=await Re.nvimInstances(c,l);e({nvim:f,nvimScanning:!1})}catch(f){e({nvimScanning:!1}),n(f)}}},async selectNvim(l){const c=t().root;e(f=>f.nvim?{nvim:{...f.nvim,selected:l}}:{});try{await Re.nvimSelect(c,l)}catch(f){n(f)}},async openInNvim(l,c){const{nvim:f,root:d}=t(),p=f?.selected;if(!p){t().showToast(f&&f.instances.length>1?"请先在顶部选择一个 nvim 实例":"未发现在此仓库打开的 nvim","error");return}const m=`${d.replace(/\/+$/,"")}/${l}`;try{await Re.nvimOpen(p,m,c)}catch(y){n(y),y instanceof Ur&&y.code==="nvim_gone"&&t().scanNvim(!0)}},setPanel(l){e({panel:l}),l==="issues"&&t().loadIssues()},setIncludeExported(l){e({includeExported:l})},toggleSelectComment(l){e(c=>({selectedCommentIds:c.selectedCommentIds.includes(l)?c.selectedCommentIds.filter(f=>f!==l):[...c.selectedCommentIds,l]}))},clearSelectedComments(){e({selectedCommentIds:[]})},async jumpToComment(l){l.targetKey!==t().targetKey&&await t().switchView(l.targetKey),e({panel:"diff"}),await t().openFile(l.filePath),e({jumpTo:{file:l.filePath,side:l.side,line:l.endLine,nonce:Date.now()}})},setReattaching(l){e({reattaching:l,editor:l?null:t().editor}),l&&t().showToast("在 diff 中点击或拖选行,将评论重新附着到该位置")},setEditor(l){e({editor:l,focusedCommentId:l?null:t().focusedCommentId})},async focusComment(l,c=!0){if(e({focusedCommentId:l}),!l||!c)return;const f=t().comments.find(d=>d.id===l)??t().allComments.find(d=>d.id===l);!f||f.status==="orphaned"||await t().jumpToComment(f)},setRailFilter(l){e({railFilter:l})},setRailTab(l){e({railTab:l}),l==="todos"&&t().loadTodos()},async loadTodos(){try{const l=await Re.todos();e({todos:l.todos})}catch(l){n(l)}},async createTodo(l){try{const c=await Re.createTodo({...l,root:l.root??t().root});return e(f=>({todos:Sp(f.todos,c,l.after)})),c}catch(c){n(c);return}},async updateTodo(l,c){try{const f=await Re.updateTodo(l,c);e(d=>({todos:d.todos.map(p=>p.id===l?f:p)}))}catch(f){n(f)}},async deleteTodo(l){const c=t().todos,f=c.findIndex(m=>m.id===l),d=c[f];if(!d)return;const p=c[f-1]?.id;try{await Re.deleteTodo(l),e(m=>({todos:m.todos.filter(y=>y.id!==l)})),t().showToast(`已删除「${d.title}」`,"info",{label:"撤消",run:()=>{t().createTodo({title:d.title,body:d.body,branch:d.branch,status:d.status,after:p})}})}catch(m){n(m)}},async deleteTodos(l){const c=[];for(const f of l){const d=t().todos.find(p=>p.id===f);if(d)try{await Re.deleteTodo(f),c.push(d),e(p=>({todos:p.todos.filter(m=>m.id!==f)}))}catch(p){n(p);break}}c.length!==0&&t().showToast(`已删除 ${c.length} 条 Todo`,"info",{label:"撤消",run:async()=>{for(const f of[...c].reverse())await t().createTodo({title:f.title,body:f.body,branch:f.branch,status:f.status})}})},async moveTodo(l,c){const f=t().todos,d=Cp(f,l,c);if(d){e({todos:d});try{const p=await Re.moveTodo(l,c);e({todos:p.todos})}catch(p){n(p),e({todos:f})}}},async copyTodo(l){const c=t().todos.find(f=>f.id===l);if(c)try{await fl(zw(c)),t().showToast("已复制 Todo 到剪贴板")}catch(f){n(f)}},setStageSel(l){e({stageSel:l})},async stageLines(l,c,f){const d=f??t().targetKey,p=an(d);if(!p||!Qc(p)||t().staging)return!1;const m=d===t().targetKey?t().diffs[l]:void 0,y=m?.status==="ok"?m.diff.contentHash:i(d).find(_=>_.path===l)?.contentHash;if(!y)return!1;e({staging:!0});try{await Re.stage(d,{path:l,contentHash:y,hunks:c})}catch(_){return e({staging:!1}),n(_),_ instanceof Ur&&(_.code==="diff_changed"||_.code==="apply_failed")&&t().refresh(),!1}const v=t().files.map(_=>_.path),w=t().activeFile;if(e({staging:!1,stageSel:null}),await t().refresh(),w&&w===l&&d===t().targetKey&&!t().files.some(_=>_.path===w)){const _=t().files,N=_[Math.min(Math.max(v.indexOf(w),0),_.length-1)];N&&t().openFile(N.path)}return!0},async stageSelection(){const l=t().stageSel;!l||l.lines.length===0||await t().stageLines(l.filePath,[{index:l.hunkIndex,lines:l.lines}])},showToast(l,c="info",f){const d=++Bw;e({toast:{id:d,message:l,kind:c,...f?{action:f}:{}}}),Du&&clearTimeout(Du),Du=setTimeout(()=>{t().toast?.id===d&&e({toast:null})},f?8e3:c==="error"?6e3:3e3)}}});function Uw(){const e=V(l=>l.nvim),t=V(l=>l.nvimScanning),n=V(l=>l.scanNvim),i=V(l=>l.selectNvim),o=e?.instances??[];let a;if(!e)a=x.jsx("span",{className:"muted",children:"nvim: 未扫描"});else if(!e.nvimAvailable)a=x.jsx("span",{className:"muted",title:"PATH 中找不到 nvim 可执行文件",children:"nvim 不可用"});else if(o.length===0)a=x.jsx("span",{className:"muted",children:"未发现在此仓库打开的 nvim"});else if(o.length===1){const l=o[0];a=x.jsxs("span",{className:"nvim-one",title:`${l.socket}
13
+ cwd: ${l.cwd}`,children:["nvim",l.pid?` #${l.pid}`:""]})}else a=x.jsxs("select",{value:e.selected??"",onChange:l=>{i(l.target.value)},title:"多个 nvim 实例,请选择跳转目标",children:[!e.selected&&x.jsx("option",{value:"",children:"选择 nvim…"}),o.map(l=>x.jsxs("option",{value:l.socket,children:["nvim",l.pid?` #${l.pid}`:""," — ",l.cwd]},l.socket))]});return x.jsxs("div",{className:"nvim",children:[a,x.jsx("button",{className:"icon",onClick:()=>{n(!0)},disabled:t,title:"重新扫描 nvim 实例",children:t?"…":"⟳"})]})}function Vw(e){if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Gw(){return x.jsxs("svg",{className:"mark",viewBox:"0 0 16 16","aria-hidden":"true",children:[x.jsx("rect",{width:"16",height:"16",rx:"3",fill:"#5b47d9"}),x.jsx("rect",{x:"3.5",y:"4",width:"2",height:"8",rx:"1",fill:"#fff"}),x.jsx("path",{d:"M8 5.5h4.5M8 10.5h3",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round"})]})}function Ww(){const e=V(C=>C.repo),t=V(C=>C.targetKey),n=V(C=>C.setTarget),i=V(C=>C.refresh),o=V(C=>C.filesLoading),a=V(C=>C.prefs.autoRefresh),l=V(C=>C.setAutoRefresh),c=V(C=>C.lastRefreshAt),f=V(C=>C.prefs.viewMode),d=V(C=>C.setViewMode),p=V(C=>C.panel),m=V(C=>C.setPanel),y=V(C=>C.issues),v=q.useMemo(()=>jl(t),[t]),w=y.filter(C=>C.status==="open").length,_=e.worktrees.filter(C=>C.path!==e.root),N=C=>{const b=Ut({...v,worktree:C||void 0});b!==t&&n(b)};return x.jsxs("header",{className:"topbar",children:[x.jsxs("div",{className:"brand",title:e.root,children:[x.jsx(Gw,{}),x.jsx("span",{className:"wordmark",children:"warden"})]}),x.jsxs("div",{className:"scope",children:[x.jsx("span",{className:"repo-name",children:e.root.split("/").filter(Boolean).pop()}),x.jsx("span",{className:"branch",children:e.branch}),_.length>0&&x.jsxs("select",{value:v.worktree??"",title:"Worktree",onChange:C=>N(C.target.value),children:[x.jsxs("option",{value:"",children:["主仓库 (",e.branch,")"]}),_.map(C=>x.jsxs("option",{value:C.path,children:["worktree: ",C.path.split("/").filter(Boolean).pop()," (",C.branch??C.head.slice(0,7),")"]},C.path))]})]}),x.jsxs("div",{className:"topbar-right",children:[x.jsxs("nav",{className:"tabs","aria-label":"面板",children:[x.jsx("button",{className:`tab ${p==="commits"?"active":""}`,onClick:()=>m(p==="commits"?"diff":"commits"),title:"历史 commit",children:"Commits"}),x.jsxs("button",{className:`tab ${p==="issues"?"active":""}`,onClick:()=>m(p==="issues"?"diff":"issues"),title:"本地 Issue",children:["Issues",w>0&&x.jsx("span",{className:"tab-count",children:w})]}),x.jsxs("button",{className:`tab ${p==="worktrees"?"active":""}`,onClick:()=>m(p==="worktrees"?"diff":"worktrees"),title:"新建、切换和删除 worktree",children:["Worktrees",_.length>0&&x.jsx("span",{className:"tab-count",children:_.length})]})]}),x.jsxs("div",{className:"tools",children:[x.jsxs("div",{className:"seg",role:"group","aria-label":"diff 布局",children:[x.jsx("button",{className:f==="unified"?"active":"","aria-pressed":f==="unified",onClick:()=>d("unified"),children:"Unified"}),x.jsx("button",{className:f==="split"?"active":"","aria-pressed":f==="split",onClick:()=>d("split"),children:"Split"})]}),x.jsx(Uw,{}),x.jsx("button",{onClick:()=>{i()},disabled:o,title:c?`上次刷新 ${Vw(c)}(r)`:"刷新 (r)",children:o?"刷新中…":"刷新"}),x.jsx("button",{className:"toggle","aria-pressed":a,"aria-label":"自动刷新",onClick:()=>l(!a),title:`仓库发生变化时自动刷新(当前${a?"开启":"关闭"})`,children:"自动"})]})]})]})}function mg(e,t,n){const i=[];let o=0;const a=[...e.dirs.keys()].sort((l,c)=>l.localeCompare(c));for(const l of a){let c=mg(e.dirs.get(l),l,n?`${n}/${l}`:l);for(;c.children.length===1&&c.children[0].kind==="dir";){const f=c.children[0];c={...f,name:`${c.name}/${f.name}`}}o+=c.fileCount,i.push(c)}for(const l of[...e.files].sort((c,f)=>c.path.localeCompare(f.path)))i.push({kind:"file",name:l.path.split("/").pop()??l.path,path:l.path,entry:l}),o++;return{kind:"dir",name:t,path:n,children:i,fileCount:o}}function Hw(e){const t={dirs:new Map,files:[]};for(const n of e){const i=n.path.split("/");let o=t;for(let a=0;a<i.length-1;a++){const l=i[a];let c=o.dirs.get(l);c||(c={dirs:new Map,files:[]},o.dirs.set(l,c)),o=c}o.files.push(n)}return mg(t,"","")}function Yc(e,t=[]){for(const n of e.children)n.kind==="dir"&&(t.push(n.path),Yc(n,t));return t}const gg={added:"A",modified:"M",deleted:"D",renamed:"R"};function yg({node:e,depth:t,view:n}){const i=V(w=>w.activeFile===e.path&&w.targetKey===n),o=V(w=>w.targetKey===n),a=V(w=>w.openFile),l=V(w=>w.switchView),c=V(w=>w.toggleViewed),f=V(w=>w.comments.filter(_=>_.filePath===e.path&&_.targetKey===n).length),d=V(w=>w.stageLines),p=V(w=>w.staging),m=e.entry,y=q.useMemo(()=>{const w=an(n);return w?Qc(w):void 0},[n]),v=async()=>{o||await l(n,e.path),await a(e.path)};return x.jsxs("div",{className:`tree-row file ${i?"active":""} ${m.viewed?"viewed":""}`,style:{paddingLeft:8+t*14},onClick:()=>{v()},title:m.oldPath?`${m.oldPath} → ${m.path}`:m.path,children:[x.jsx("input",{type:"checkbox",className:"viewed-box",checked:m.viewed,onClick:w=>w.stopPropagation(),onChange:()=>{c(e.path,n)},title:"标记为已查看"}),x.jsx("span",{className:`status status-${m.status}`,children:gg[m.status]}),x.jsx("span",{className:"name",children:e.name}),m.changed&&x.jsx("span",{className:"changed",title:"文件自上次标记已查看后发生变化",children:"已变化"}),f>0&&x.jsx("span",{className:"cc",title:"评论数",children:f}),x.jsx("span",{className:"counts",children:m.binary?x.jsx("span",{className:"muted",children:"bin"}):x.jsxs(x.Fragment,{children:[x.jsxs("span",{className:"add",children:["+",m.additions]}),x.jsxs("span",{className:"del",children:["-",m.deletions]})]})}),y&&!m.binary&&x.jsx("button",{className:"link stage-file",disabled:p,onClick:w=>{w.stopPropagation(),d(e.path,void 0,n)},title:y==="stage"?"把这个文件的全部改动放入暂存区":"把这个文件的全部改动移出暂存区",children:y==="stage"?"暂存":"取消暂存"})]})}function kg({node:e,depth:t,view:n,open:i,toggle:o}){const a=i.has(e.path);return x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"tree-row dir",style:{paddingLeft:8+t*14},onClick:()=>o(e.path),children:[x.jsx("span",{className:`chev ${a?"open":""}`,children:"▸"}),x.jsx("span",{className:"name",children:e.name}),x.jsx("span",{className:"muted count",children:e.fileCount})]}),a&&e.children.map(l=>l.kind==="dir"?x.jsx(kg,{node:l,depth:t+1,view:n,open:i,toggle:o},l.path):x.jsx(yg,{node:l,depth:t+1,view:n},l.path))]})}function qw(e,t){const[n,i]=q.useState(new Set),o=V(c=>c.activeFile),a=V(c=>c.targetKey===t);return q.useEffect(()=>{!o||!a||i(c=>{const f=new Set(c);for(const d of Yc(e))o.startsWith(d+"/")&&f.add(d);return f.size===c.size?c:f})},[o,a,e]),{open:n,setOpen:i,toggle:c=>i(f=>{const d=new Set(f);return d.has(c)?d.delete(c):d.add(c),d})}}function $u({title:e,view:t,files:n,empty:i}){const o=q.useMemo(()=>Hw(n),[n]),{open:a,setOpen:l,toggle:c}=qw(o,t),f=n.reduce((m,y)=>m+y.additions,0),d=n.reduce((m,y)=>m+y.deletions,0),p=n.filter(m=>m.viewed).length;return x.jsxs("section",{className:"tree-block",children:[x.jsxs("div",{className:"block-head",children:[x.jsx("span",{className:"block-title",children:e}),x.jsx("span",{className:"block-n",children:n.length}),x.jsxs("span",{className:"counts",children:[x.jsxs("span",{className:"add",children:["+",f]}),x.jsxs("span",{className:"del",children:["-",d]})]}),x.jsx("span",{className:"spacer"}),n.length>0&&x.jsxs("span",{className:"block-viewed",title:"已标记为 viewed 的文件",children:[p,"/",n.length," viewed"]}),x.jsxs("span",{className:"tree-tools",children:[x.jsx("button",{className:"link",onClick:()=>l(new Set(Yc(o))),title:"展开全部目录",children:"展开"}),x.jsx("button",{className:"link",onClick:()=>l(new Set),title:"折叠全部目录",children:"折叠"})]})]}),n.length>0&&x.jsx("div",{className:"block-progress",role:"progressbar","aria-label":`${e} 已查看`,"aria-valuemin":0,"aria-valuemax":n.length,"aria-valuenow":p,children:x.jsx("span",{style:{width:`${p/n.length*100}%`}})}),x.jsx("div",{className:"tree",children:n.length===0?x.jsx("div",{className:"muted empty",children:i}):o.children.map(m=>m.kind==="dir"?x.jsx(kg,{node:m,depth:0,view:t,open:a,toggle:c},m.path):x.jsx(yg,{node:m,depth:0,view:t},m.path))})]})}function Kw(){const e=V(v=>v.files),t=V(v=>v.unstaged),n=V(v=>v.staged),i=V(v=>v.filesLoading),o=V(v=>v.filesError),a=V(v=>v.targetKey),l=V(v=>v.setTarget),c=q.useMemo(()=>an(a),[a]),f=!!c&&$r(c),d=c?.worktree?{worktree:c.worktree}:{},p=jw(a),m=!!o&&!!c?.worktree,y=(!f||m)&&x.jsxs("div",{className:"sidebar-target",children:[x.jsx("span",{className:"sidebar-target-name",title:a,children:c?wc(m?c:{...c,worktree:void 0}):a}),x.jsx("span",{className:"spacer"}),x.jsx("button",{className:"link",onClick:()=>{l(Ut(m?{kind:"working"}:{kind:"working",...d}))},title:m?"回到主仓库的工作区":"回到工作区的 Unstaged / Staged 视图",children:m?"← 回到主仓库":"← 返回工作区"})]});return o?x.jsxs("aside",{className:"sidebar",children:[y,x.jsx("div",{className:"error-box",children:o})]}):f?x.jsxs("aside",{className:"sidebar dual",children:[x.jsx($u,{title:"Unstaged",view:Ut({kind:"working",...d}),files:t,empty:i?"加载中…":"没有未暂存的改动"},`${p}:unstaged`),x.jsx($u,{title:"Staged",view:Ut({kind:"staged",...d}),files:n,empty:i?"加载中…":"暂存区为空"},`${p}:staged`)]}):x.jsxs("aside",{className:"sidebar",children:[y,x.jsx($u,{title:"改动",view:a,files:e,empty:i?"加载中…":"没有改动"},p)]})}var Qw=hg();function Xw(e,t,n){const i=new Array(e);return new Proxy(i,{get(o,a,l){if(typeof a=="string"){const c=a.charCodeAt(0);if(c>=48&&c<=57){const f=+a;if(Number.isInteger(f)&&f>=0&&f<e){let d=o[f];if(!d){const p=t[f*2];d=o[f]={index:f,key:n(f),start:p,size:t[f*2+1],end:p+t[f*2+1],lane:0}}return d}}if(a==="length")return e}return Reflect.get(o,a,l)}})}function gi(e,t,n){let i=n.initialDeps??[],o,a=!0;function l(){const c=e();return(c.length!==i.length||c.some((d,p)=>i[p]!==d))&&(i=c,o=t(...c),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(o),a=!1),o}return l.updateDeps=c=>{i=c},l}function Ep(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Yw=(e,t)=>Math.abs(e-t)<1.01,Jw=(e,t,n)=>{let i;return Object.assign(function(...o){e.clearTimeout(i),i=e.setTimeout(()=>t.apply(this,o),n)},{cancel:()=>{e.clearTimeout(i)}})};let gs;const Fu=()=>{if(gs!==void 0)return gs;if(typeof navigator>"u")return gs=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return gs=!0;const e=navigator.maxTouchPoints;return gs=navigator.platform==="MacIntel"&&e!==void 0&&e>0},Ip=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Zw=e=>e,ex=e=>{const t=Math.max(e.startIndex-e.overscan,0),i=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,o=new Array(i);for(let a=0;a<i;a++)o[a]=t+a;return o},tx=(e,t)=>{const n=e.scrollElement;if(!n)return;const i=e.targetWindow;if(!i)return;const o=l=>{const{width:c,height:f}=l;t({width:Math.round(c),height:Math.round(f)})};if(o(Ip(n)),!i.ResizeObserver)return()=>{};const a=new i.ResizeObserver(l=>{const c=()=>{const f=l[0];if(f?.borderBoxSize){const d=f.borderBoxSize[0];if(d){o({width:d.inlineSize,height:d.blockSize});return}}o(Ip(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return a.observe(n,{box:"border-box"}),()=>{a.unobserve(n)}},yl={passive:!0},nx=typeof window>"u"?!0:"onscrollend"in window,rx=(e,t,n)=>{const i=e.scrollElement;if(!i)return;const o=e.targetWindow;if(!o)return;const a=e.options.useScrollendEvent&&nx;let l=0;const c=a?null:Jw(o,()=>t(l,!1),e.options.isScrollingResetDelay),f=m=>()=>{l=n(i),c?.(),t(l,m)},d=f(!0),p=f(!1);return i.addEventListener("scroll",d,yl),a&&i.addEventListener("scrollend",p,yl),()=>{i.removeEventListener("scroll",d),a&&i.removeEventListener("scrollend",p),c?.cancel()}},ix=(e,t)=>rx(e,t,n=>{const{horizontal:i,isRtl:o}=e.options;return i?n.scrollLeft*(o&&-1||1):n.scrollTop}),sx=(e,t,n)=>{if(n.options.useCachedMeasurements){const i=n.indexFromElement(e),o=n.options.getItemKey(i);return n.itemSizeCache.get(o)??n.options.estimateSize(i)}if(t?.borderBoxSize){const i=t.borderBoxSize[0];if(i)return Math.round(i[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){const i=n.indexFromElement(e),o=n.options.getItemKey(i),a=n.itemSizeCache.get(o);if(a!==void 0)return a}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},ox=(e,{adjustments:t=0,behavior:n},i)=>{var o,a;(a=(o=i.scrollElement)==null?void 0:o.scrollTo)==null||a.call(o,{[i.options.horizontal?"left":"top"]:e+t,behavior:n})},lx=ox;class ax{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var n,i,o;return((o=(i=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:i.now)==null?void 0:o.call(i))??Date.now()},this.observer=(()=>{let n=null;const i=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(a=>{const l=()=>{const c=a.target,f=this.indexFromElement(c);if(!c.isConnected){this.observer.unobserve(c);for(const[d,p]of this.elementsCache)if(p===c){this.elementsCache.delete(d);break}return}this.isIndexInRange(f)&&this.shouldMeasureDuringScroll(f)&&this.resizeItem(f,this.options.measureElement(c,a,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()})}));return{disconnect:()=>{var o;(o=i())==null||o.disconnect(),n=null},observe:o=>{var a;return(a=i())==null?void 0:a.observe(o,{box:"border-box"})},unobserve:o=>{var a;return(a=i())==null?void 0:a.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{var i,o;const a={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Zw,rangeExtractor:ex,onChange:()=>{},measureElement:sx,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const y in n){const v=n[y];v!==void 0&&(a[y]=v)}const l=this.options;let c=null,f=null,d=!1;if(l!==void 0&&l.enabled&&a.enabled&&a.anchorTo==="end"&&this.scrollElement!==null){const y=l.count,v=a.count,w=this.getMeasurements(),_=y>0?((i=w[0])==null?void 0:i.key)??l.getItemKey(0):null,N=y>0?((o=w[y-1])==null?void 0:o.key)??l.getItemKey(y-1):null;if(v!==y||y>0&&v>0&&(a.getItemKey(0)!==_||a.getItemKey(v-1)!==N)){d=!0;const E=y>0?this.getVirtualItemForOffset(this.getScrollOffset())??w[0]:null;E&&(c=[E.key,this.getScrollOffset()-E.start]);const B=a.followOnAppend===!0?"auto":a.followOnAppend||null;B&&v>y&&this.isAtEnd(l.scrollEndThreshold)&&(y===0||a.getItemKey(v-1)!==N)&&(f=B)}}this.options=a,d&&(this.pendingMin=0,this.itemSizeCacheVersion++);let p=!1,m=0;if(c&&this.scrollOffset!==null){const[y,v]=c,w=this.getMeasurements(),{count:_,getItemKey:N}=this.options;let C=0;for(;C<_&&N(C)!==y;)C++;if(C<_){const b=w[C];if(b){const E=Math.max(0,b.start+v);E!==this.scrollOffset&&(m=E-this.scrollOffset,this.scrollOffset=E,p=!0)}}}(p||f)&&(this.pendingScrollAnchor=[p?c[0]:null,p?c[1]:0,f,m])},this.notify=n=>{var i,o;(o=(i=this.options).onChange)==null||o.call(i,this,n)},this.maybeNotify=gi(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}if(this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(a=>{this.observer.observe(a)}),this.unsubs.push(this.options.observeElementRect(this,a=>{this.scrollRect=a,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(a,l)=>{if(l&&this._intendedScrollOffset===null&&a===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(a-this._intendedScrollOffset)<1.5&&(a=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(a-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;const c=this.getScrollOffset();this.scrollDirection=l?c===a?this.scrollDirection:c<a?"forward":"backward":null,this.scrollOffset=a,this.isScrolling=l,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const a=this.scrollElement,l=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},c=()=>{this._iosTouching=!1,!(!Fu()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};a.addEventListener("touchstart",l,yl),a.addEventListener("touchend",c,yl),this.unsubs.push(()=>{a.removeEventListener("touchstart",l),a.removeEventListener("touchend",c),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const o=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,o&&this.scrollElement&&this.options.enabled){const[a,l,c,f]=o;a!==null&&!c&&(Fu()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?f!==0&&(this._iosDeferredAdjustment+=f):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),c&&this.scrollToEnd({behavior:c})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;const{target:n,maxAtWrite:i}=this._clampedAdjustment,o=this.getMaxScrollOffset();o>i+.5&&(this._clampedAdjustment=n>o+.5?{target:n,maxAtWrite:o}:null,this._scrollToOffset(n,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),i=this.getMaxScrollOffset();if(n<0||n>i)return;if(this._iosDeferredAdjustment<0&&n>=i-1){this._iosDeferredAdjustment=0;return}const o=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=o,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=gi(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(n,i,o,a,l,c,f,d)=>(this.prevLanes!==void 0&&this.prevLanes!==c&&(this.lanesChangedFlag=!0),this.prevLanes=c,this.pendingMin=null,{count:n,paddingStart:i,scrollMargin:o,getItemKey:a,enabled:l,lanes:c,laneAssignmentMode:f,gap:d}),{key:!1}),this.isIndexInRange=n=>n>=0&&n<this.options.count,this.getMeasurements=gi(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:i,scrollMargin:o,getItemKey:a,enabled:l,lanes:c,laneAssignmentMode:f,gap:d},p)=>{const m=this.itemSizeCache;if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const C of this.laneAssignments.keys())C>=n&&this.laneAssignments.delete(C);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(C=>{this.itemSizeCache.set(C.key,C.size)}));const y=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),c===1){const C=n*2;let b=this._flatMeasurements;if(!b||b.length<C){const O=new Float64Array(C);b&&y>0&&O.set(b.subarray(0,y*2)),b=O,this._flatMeasurements=b}let E;if(y===0)E=i+o;else{const O=y-1;E=b[O*2]+b[O*2+1]+d}for(let O=y;O<n;O++){const D=a(O),ie=m.get(D),U=typeof ie=="number"?ie:this.options.estimateSize(O);b[O*2]=E,b[O*2+1]=U,E+=U+d}const B=Xw(n,b,a);return this.measurementsCache=B,B}const v=this.measurementsCache.slice(0,y),w=new Array(c).fill(void 0),_=new Float64Array(c);let N=0;for(let C=0;C<y;C++){const b=v[C];b&&(w[b.lane]===void 0&&N++,w[b.lane]=C,_[b.lane]=b.end)}for(let C=y;C<n;C++){const b=a(C),E=this.laneAssignments.get(C);let B,O;const D=f==="estimate"||m.has(b);if(E!==void 0&&this.options.lanes>1){B=E;const R=w[B],H=R!==void 0?v[R]:void 0;O=H?H.end+d:i+o}else if(N===c){let R=0,H=_[0],J=w[0];for(let fe=1;fe<c;fe++){const ee=_[fe];(ee<H||ee===H&&w[fe]<J)&&(R=fe,H=ee,J=w[fe])}B=R,O=H+d,D&&this.laneAssignments.set(C,B)}else B=C%this.options.lanes,O=i+o,D&&this.laneAssignments.set(C,B);const ie=m.get(b),U=typeof ie=="number"?ie:this.options.estimateSize(C),ce=O+U;v[C]={index:C,start:O,size:U,end:ce,key:b,lane:B},w[B]===void 0&&N++,w[B]=C,_[B]=ce}return this.measurementsCache=v,v},{key:!1,debug:()=>this.options.debug}),this.calculateRange=gi(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,i,o,a)=>n.length===0||i===0?(this.range=null,null):(this.range=cx(n,i,o,a,a===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=gi(()=>{let n=null,i=null;const o=this.calculateRange();return o&&(n=o.startIndex,i=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,i]},(n,i,o,a,l)=>a===null||l===null?[]:n({startIndex:a,endIndex:l,overscan:i,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const i=this.options.indexAttribute,o=n.getAttribute(i);return o?parseInt(o,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const o=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.index);if(o!==void 0&&this.range){const a=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),l=Math.max(0,o-a),c=Math.min(this.options.count-1,o+a);return n>=l&&n<=c}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((l,c)=>{l.isConnected||(this.observer.unobserve(l),this.elementsCache.delete(c))});return}const i=this.indexFromElement(n);if(!this.isIndexInRange(i))return;const o=this.options.getItemKey(i),a=this.elementsCache.get(o);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(o,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,i)=>{var o,a;if(!this.isIndexInRange(n))return;let l,c,f;const d=this._flatMeasurements;if(this.options.lanes===1&&d!==null)f=this.options.getItemKey(n),c=d[n*2],l=d[n*2+1];else{const y=this.measurementsCache[n];if(!y)return;f=y.key,c=y.start,l=y.size}const p=this.itemSizeCache.get(f)??l,m=i-p;if(m!==0){const y=this.options.anchorTo==="end"&&((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,v=y?this.getTotalSize():0,w=this.getScrollOffset()+this.scrollAdjustments,N=!this.itemSizeCache.has(f)?c<w:c+p<=w&&this.scrollDirection!=="backward",C=((a=this.scrollState)==null?void 0:a.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:f,start:c,size:l,end:c+l,lane:0},m,this):N);(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(f,i),this.itemSizeCacheVersion++;let b=!1;y?b=this.applyScrollAdjustment(this.getTotalSize()-v):C&&(b=this.applyScrollAdjustment(m)),this.notify(b),this._retryClampedAdjustment()}},this.getVirtualItems=gi(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,i)=>{const o=[];for(let a=0,l=n.length;a<l;a++){const c=n[a],f=i[c];o.push(f)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const i=this.getMeasurements();if(i.length===0)return;const o=this._flatMeasurements,a=this.options.lanes===1&&o!=null,l=vg(0,i.length-1,a?c=>o[c*2]:c=>Ep(i[c]).start,n);return Ep(i[l])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,i,o=0)=>{if(!this.scrollElement)return 0;const a=this.getSize(),l=this.getScrollOffset();i==="auto"&&(i=n>=l+a?"end":"start"),i==="center"?n+=(o-a)/2:i==="end"&&(n-=a);const c=this.getMaxScrollOffset();return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,i="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getSize(),a=this.getScrollOffset(),l=this.measurementsCache[n];if(!l)return;if(i==="auto")if(l.end>=a+o-this.options.scrollPaddingEnd)i="end";else if(l.start<=a+this.options.scrollPaddingStart)i="start";else return[a,i];if(i==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),i];const c=i==="end"?l.end+this.options.scrollPaddingEnd:l.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,i,l.size),i]},this.scrollToOffset=(n,{align:i="start",behavior:o="auto"}={})=>{this._iosDeferredAdjustment=0;const a=this.getOffsetForAlignment(n,i),l=this.now();this.scrollState={index:null,align:i,behavior:o,startedAt:l,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:i="auto",behavior:o="auto"}={})=>{this._iosDeferredAdjustment=0,n=Math.max(0,Math.min(n,this.options.count-1));const a=this.getOffsetForIndex(n,i);if(!a)return;const[l,c]=a,f=this.now();this.scrollState={index:n,align:c,behavior:o,startedAt:f,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:i="auto"}={})=>{const o=this.getScrollOffset()+n,a=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:a,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const i=this.getMeasurements();let o;if(i.length===0)o=this.options.paddingStart;else if(this.options.lanes===1){const a=i.length-1,l=this._flatMeasurements;l!=null?o=l[a*2]+l[a*2+1]:o=((n=i[a])==null?void 0:n.end)??0}else{const a=Array(this.options.lanes).fill(null);let l=i.length-1;for(;l>=0&&a.some(c=>c===null);){const c=i[l];a[c.lane]===null&&(a[c.lane]=c.end),l--}o=Math.max(...a.filter(c=>c!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const i=this.getMeasurements();for(const o of i)o&&this.itemSizeCache.has(o.key)&&n.push({index:o.index,key:o.key,start:o.start,size:o.size,end:o.end,lane:o.lane});return n},this._scrollToOffset=(n,{adjustments:i,behavior:o})=>{this._intendedScrollOffset=n+(i??0),this.options.scrollToFn(n,{behavior:o,adjustments:i},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,n){if(t===0)return!1;if(Fu()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=t,!1;{const i=this.getScrollOffset()+this.scrollAdjustments+t,o=this.scrollElement,a=o!==null&&("scrollHeight"in o||"document"in o)?this.getMaxScrollOffset():null;return this._clampedAdjustment=a!==null&&i>a+.5?{target:i,maxAtWrite:a}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:n}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,o=i?i[0]:this.scrollState.lastTargetOffset,a=1,l=o!==this.scrollState.lastTargetOffset;if(!l&&Yw(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=a){this.getScrollOffset()!==o&&this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,l){const c=this.getSize()||600,f=Math.abs(o-this.getScrollOffset()),d=this.scrollState.behavior==="smooth"&&f>c;this.scrollState.lastTargetOffset=o,d||(this.scrollState.behavior="auto"),this._scrollToOffset(o,{adjustments:void 0,behavior:d?"smooth":"auto"})}this.scheduleScrollReconcile()}}const vg=(e,t,n,i)=>{for(;e<=t;){const o=(e+t)/2|0,a=n(o);if(a<i)e=o+1;else if(a>i)t=o-1;else return o}return e>0?e-1:0};function ux(e,t,n){let i=0;for(;i<=t;){const o=(i+t)/2|0,a=e[o*2];if(a<n)i=o+1;else if(a>n)t=o-1;else return o}return i>0?i-1:0}function cx(e,t,n,i,o){const a=e.length-1;if(e.length<=i)return{startIndex:0,endIndex:a};if(i===1&&o!==null){const d=ux(o,a,n);let p=d;const m=n+t;for(;p<a&&o[p*2]+o[p*2+1]<m;)p++;return{startIndex:d,endIndex:p}}let c=vg(0,a,d=>e[d].start,n),f=c;if(i===1)for(;f<a&&e[f].end<n+t;)f++;else if(i>1){const d=Array(i).fill(0);for(;f<a&&d.some(m=>m<n+t);){const m=e[f];d[m.lane]=m.end,f++}const p=Array(i).fill(n+t);for(;c>=0&&p.some(m=>m>=n);){const m=e[c];p[m.lane]=m.start,c--}c=Math.max(0,c-c%i),f=Math.min(a,f+(i-1-f%i))}return{startIndex:c,endIndex:f}}const zu=typeof document<"u"?q.useLayoutEffect:q.useEffect;function fx({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...i}){const o=q.useReducer(p=>p+1,0)[1],a=q.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;const l=p=>{const m=a.current;if(!m.enabled||!m.container)return;const y=p.getTotalSize();if(y!==m.lastSize){m.lastSize=y;const v=p.options.horizontal?"width":"height";m.container.style[v]=`${y}px`}},c=p=>{const m=a.current;if(!m.enabled||!m.container)return;l(p);const y=!!p.options.horizontal,v=m.mode==="transform",w=y?"left":"top",_=p.options.scrollMargin,N=p.getVirtualItems();for(const C of N){const b=C.start-_,E=p.elementsCache.get(C.key);E&&m.lastPositions.get(E)!==b&&(m.lastPositions.set(E,b),v?E.style.transform=y?`translate3d(${b}px, 0, 0)`:`translate3d(0, ${b}px, 0)`:E.style[w]=`${b}px`)}},f={...i,onChange:(p,m)=>{var y;const v=a.current;let w=!0;if(v.enabled){c(p);const _=p.range,N=v.prevRange;w=!N||N.isScrolling!==p.isScrolling||N.startIndex!==_?.startIndex||N.endIndex!==_?.endIndex,w&&(v.prevRange=_?{startIndex:_.startIndex,endIndex:_.endIndex,isScrolling:p.isScrolling}:null)}w&&(e&&m?Qw.flushSync(o):o()),(y=i.onChange)==null||y.call(i,p,m)}},[d]=q.useState(()=>{const p=new ax(f);return Object.assign(p,{containerRef:m=>{const y=a.current;if(y.container=m,y.lastSize=null,m&&y.enabled){const v=p.getTotalSize();y.lastSize=v;const w=p.options.horizontal?"width":"height";m.style[w]=`${v}px`}}})});return d.setOptions(f),zu(()=>d._didMount(),[]),zu(()=>(l(d),d._willUpdate())),zu(()=>{c(d)}),d}function dx(e){return fx({observeElementRect:tx,observeElementOffset:ix,scrollToFn:lx,...e})}function hx(e,t){const n=[],i=e.hunks;if(i.length===0)return n;const o=i[0];n.push({index:0,newFrom:1,newTo:o.newStart-1,oldFrom:1});for(let l=1;l<i.length;l++){const c=i[l-1],f=i[l];n.push({index:l,newFrom:c.newStart+c.newLines,newTo:f.newStart-1,oldFrom:c.oldStart+c.oldLines})}const a=i[i.length-1];return n.push({index:i.length,newFrom:a.newStart+a.newLines,newTo:t,oldFrom:a.oldStart+a.oldLines}),n}function Np(e,t,n){const i={top:[],bottom:[],hidden:e.newTo===null?null:Math.max(0,e.newTo-e.newFrom+1)};if(!n||!t)return i;const o=e.newTo??n.length,a=Math.max(0,o-e.newFrom+1);if(a===0)return{top:[],bottom:[],hidden:0};let l=t.all?a:Math.min(a,t.top),c=t.all?0:Math.min(a-l,t.bottom);l+c>=a&&(l=a,c=0);const f=e.oldFrom-e.newFrom,d=y=>({type:"context",newLineNo:y,oldLineNo:y+f,content:n[y-1]??""}),p=[];for(let y=e.newFrom;y<e.newFrom+l;y++)p.push(d(y));const m=[];for(let y=o-c+1;y<=o;y++)m.push(d(y));return{top:p,bottom:m,hidden:a-l-c}}function px(e){const t=[];let n=[],i=[];const o=()=>{const a=Math.max(n.length,i.length);for(let l=0;l<a;l++){const c=n[l],f=i[l];t.push({left:c===void 0?void 0:e[c],right:f===void 0?void 0:e[f],indices:[c,f].filter(d=>d!==void 0)})}n=[],i=[]};return e.forEach((a,l)=>{a.type==="del"?n.push(l):a.type==="add"?i.push(l):(o(),t.push({left:a,right:a,indices:[]}))}),o(),t}function mx({diff:e,viewMode:t,expansions:n,fullLines:i}){const o=[],l=e.status!=="deleted"&&e.status!=="added"&&!e.binary?hx(e,i?i.length:null):[],c=(d,p,m)=>{t==="unified"?d.forEach((y,v)=>{o.push({key:`l:${p}:${y.oldLineNo??"-"}:${y.newLineNo??"-"}`,kind:"line",line:y,hunkIndex:p,expanded:m,pos:m?-1:v,indices:m||y.type==="context"?[]:[v]})}):px(d).forEach((y,v)=>{o.push({key:`p:${p}:${y.left?.oldLineNo??"-"}:${y.right?.newLineNo??"-"}`,kind:"pair",left:y.left,right:y.right,hunkIndex:p,expanded:m,pos:m?-1:v,indices:m?[]:y.indices})})};e.hunks.forEach((d,p)=>{const m=l[p];if(m){const{top:y,bottom:v,hidden:w}=Np(m,n[m.index],i);y.length&&c(y,p-1,!0),(w===null||w>0)&&o.push({key:`g:${m.index}`,kind:"gap",gap:m,hidden:w}),v.length&&c(v,p,!0)}o.push({key:`h:${p}`,kind:"hunk",hunkIndex:p,hunk:d}),c(d.lines,p,!1)});const f=l[e.hunks.length];if(f){const{top:d,hidden:p}=Np(f,n[f.index],i);d.length&&c(d,e.hunks.length-1,!0),(p===null||p>0)&&o.push({key:`g:${f.index}`,kind:"gap",gap:f,hidden:p})}return o}function Tp(e,t,n){return e.findIndex(i=>i.kind==="line"?t==="new"?i.line.newLineNo===n:i.line.oldLineNo===n:i.kind==="pair"?t==="new"?i.right?.newLineNo===n:i.left?.oldLineNo===n:!1)}function gx(e,t,n,i){const o=Math.min(n,i),a=Math.max(n,i),l=[];for(const c of e)c.kind!=="line"&&c.kind!=="pair"||c.hunkIndex!==t||c.pos<o||c.pos>a||l.push(...c.indices);return l.sort((c,f)=>c-f)}function yx(e){const t=[];return e.forEach((n,i)=>{n.kind==="hunk"&&t.push(i)}),t}function kx(e){let t=0;for(const n of e.hunks)t+=n.lines.length;return t}const vx="modulepreload",wx=function(e){return"/"+e},Ap={},Pe=function(t,n,i){let o=Promise.resolve();if(n&&n.length>0){let d=function(p){return Promise.all(p.map(m=>Promise.resolve(m).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};var l=d;document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),f=c?.nonce||c?.getAttribute("nonce");o=d(n.map(p=>{if(p=wx(p),p in Ap)return;Ap[p]=!0;const m=p.endsWith(".css"),y=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${y}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":vx,m||(v.as="script"),v.crossOrigin="",v.href=p,f&&v.setAttribute("nonce",f),document.head.appendChild(v),m)return new Promise((w,_)=>{v.addEventListener("load",w),v.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${p}`)))})}))}function a(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"&&a(f.reason);return t().catch(a)})};let kt=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function xx(e){return Jc(e)}function Jc(e){return Array.isArray(e)?Sx(e):e instanceof RegExp?e:typeof e=="object"?Cx(e):e}function Sx(e){let t=[];for(let n=0,i=e.length;n<i;n++)t[n]=Jc(e[n]);return t}function Cx(e){let t={};for(let n in e)t[n]=Jc(e[n]);return t}function wg(e,...t){return t.forEach(n=>{for(let i in n)e[i]=n[i]}),e}function xg(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?xg(e.substring(0,e.length-1)):e.substr(~t+1)}var Bu=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Zo=class{static hasCaptures(e){return e===null?!1:(Bu.lastIndex=0,Bu.test(e))}static replaceCaptures(e,t,n){return e.replace(Bu,(i,o,a,l)=>{let c=n[parseInt(o||a,10)];if(c){let f=t.substring(c.start,c.end);for(;f[0]===".";)f=f.substring(1);switch(l){case"downcase":return f.toLowerCase();case"upcase":return f.toUpperCase();default:return f}}else return i})}};function Sg(e,t){return e<t?-1:e>t?1:0}function Cg(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,i=t.length;if(n===i){for(let o=0;o<n;o++){let a=Sg(e[o],t[o]);if(a!==0)return a}return 0}return n-i}function Pp(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function _g(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var bg=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},kl=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Ex(e),t)}static createFromParsedTheme(e,t){return Nx(e,t)}_cachedMatchRoot=new bg(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,i=this._cachedMatchRoot.get(t).find(o=>_x(e.parent,o.parentScopes));return i?new Eg(i.fontStyle,i.foreground,i.background):null}},Uu=class dl{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const i of n)t=new dl(t,i);return t}static from(...t){let n=null;for(let i=0;i<t.length;i++)n=new dl(n,t[i]);return n}push(t){return new dl(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let i=this;for(;i&&i!==t;)n.push(i.scopeName),i=i.parent;return i===t?n.reverse():void 0}};function _x(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let i=t[n],o=!1;if(i===">"){if(n===t.length-1)return!1;i=t[++n],o=!0}for(;e&&!bx(e.scopeName,i);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function bx(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Eg=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Ex(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],i=0;for(let o=0,a=t.length;o<a;o++){let l=t[o];if(!l.settings)continue;let c;if(typeof l.scope=="string"){let m=l.scope;m=m.replace(/^[,]+/,""),m=m.replace(/[,]+$/,""),c=m.split(",")}else Array.isArray(l.scope)?c=l.scope:c=[""];let f=-1;if(typeof l.settings.fontStyle=="string"){f=0;let m=l.settings.fontStyle.split(" ");for(let y=0,v=m.length;y<v;y++)switch(m[y]){case"italic":f=f|1;break;case"bold":f=f|2;break;case"underline":f=f|4;break;case"strikethrough":f=f|8;break}}let d=null;typeof l.settings.foreground=="string"&&Pp(l.settings.foreground)&&(d=l.settings.foreground);let p=null;typeof l.settings.background=="string"&&Pp(l.settings.background)&&(p=l.settings.background);for(let m=0,y=c.length;m<y;m++){let w=c[m].trim().split(" "),_=w[w.length-1],N=null;w.length>1&&(N=w.slice(0,w.length-1),N.reverse()),n[i++]=new Ix(_,N,o,f,d,p)}}return n}var Ix=class{constructor(e,t,n,i,o,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=i,this.foreground=o,this.background=a}},It=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(It||{});function Nx(e,t){e.sort((f,d)=>{let p=Sg(f.scope,d.scope);return p!==0||(p=Cg(f.parentScopes,d.parentScopes),p!==0)?p:f.index-d.index});let n=0,i="#000000",o="#ffffff";for(;e.length>=1&&e[0].scope==="";){let f=e.shift();f.fontStyle!==-1&&(n=f.fontStyle),f.foreground!==null&&(i=f.foreground),f.background!==null&&(o=f.background)}let a=new Tx(t),l=new Eg(n,a.getId(i),a.getId(o)),c=new Px(new xc(0,null,-1,0,0),[]);for(let f=0,d=e.length;f<d;f++){let p=e[f];c.insert(0,p.scope,p.parentScopes,p.fontStyle,a.getId(p.foreground),a.getId(p.background))}return new kl(a,l,c)}var Tx=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Ax=Object.freeze([]),xc=class Ig{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,i,o,a){this.scopeDepth=t,this.parentScopes=n||Ax,this.fontStyle=i,this.foreground=o,this.background=a}clone(){return new Ig(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let i=0,o=t.length;i<o;i++)n[i]=t[i].clone();return n}acceptOverwrite(t,n,i,o){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),i!==0&&(this.foreground=i),o!==0&&(this.background=o)}},Px=class Sc{constructor(t,n=[],i={}){this._mainRule=t,this._children=i,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let i=0,o=0;for(;t.parentScopes[i]===">"&&i++,n.parentScopes[o]===">"&&o++,!(i>=t.parentScopes.length||o>=n.parentScopes.length);){const a=n.parentScopes[o].length-t.parentScopes[i].length;if(a!==0)return a;i++,o++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let i=t.indexOf("."),o,a;if(i===-1?(o=t,a=""):(o=t.substring(0,i),a=t.substring(i+1)),this._children.hasOwnProperty(o))return this._children[o].match(a)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Sc._cmpBySpecificity),n}insert(t,n,i,o,a,l){if(n===""){this._doInsertHere(t,i,o,a,l);return}let c=n.indexOf("."),f,d;c===-1?(f=n,d=""):(f=n.substring(0,c),d=n.substring(c+1));let p;this._children.hasOwnProperty(f)?p=this._children[f]:(p=new Sc(this._mainRule.clone(),xc.cloneArr(this._rulesWithParentScopes)),this._children[f]=p),p.insert(t+1,d,i,o,a,l)}_doInsertHere(t,n,i,o,a){if(n===null){this._mainRule.acceptOverwrite(t,i,o,a);return}for(let l=0,c=this._rulesWithParentScopes.length;l<c;l++){let f=this._rulesWithParentScopes[l];if(Cg(f.parentScopes,n)===0){f.acceptOverwrite(t,i,o,a);return}}i===-1&&(i=this._mainRule.fontStyle),o===0&&(o=this._mainRule.foreground),a===0&&(a=this._mainRule.background),this._rulesWithParentScopes.push(new xc(t,n,i,o,a))}},Ei=class on{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=on.getLanguageId(t),i=on.getTokenType(t),o=on.getFontStyle(t),a=on.getForeground(t),l=on.getBackground(t);console.log({languageId:n,tokenType:i,fontStyle:o,foreground:a,background:l})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,i,o,a,l,c){let f=on.getLanguageId(t),d=on.getTokenType(t),p=on.containsBalancedBrackets(t)?1:0,m=on.getFontStyle(t),y=on.getForeground(t),v=on.getBackground(t);return n!==0&&(f=n),i!==8&&(d=i),o!==null&&(p=o?1:0),a!==-1&&(m=a),l!==0&&(y=l),c!==0&&(v=c),(f<<0|d<<8|p<<10|m<<11|y<<15|v<<24)>>>0}};function vl(e,t){const n=[],i=Rx(e);let o=i.next();for(;o!==null;){let f=0;if(o.length===2&&o.charAt(1)===":"){switch(o.charAt(0)){case"R":f=1;break;case"L":f=-1;break;default:console.log(`Unknown priority ${o} in scope selector`)}o=i.next()}let d=l();if(n.push({matcher:d,priority:f}),o!==",")break;o=i.next()}return n;function a(){if(o==="-"){o=i.next();const f=a();return d=>!!f&&!f(d)}if(o==="("){o=i.next();const f=c();return o===")"&&(o=i.next()),f}if(Rp(o)){const f=[];do f.push(o),o=i.next();while(Rp(o));return d=>t(f,d)}return null}function l(){const f=[];let d=a();for(;d;)f.push(d),d=a();return p=>f.every(m=>m(p))}function c(){const f=[];let d=l();for(;d&&(f.push(d),o==="|"||o===",");){do o=i.next();while(o==="|"||o===",");d=l()}return p=>f.some(m=>m(p))}}function Rp(e){return!!e&&!!e.match(/[\w\.:]+/)}function Rx(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const i=n[0];return n=t.exec(e),i}}}function Ng(e){typeof e.dispose=="function"&&e.dispose()}var Ts=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Lx=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},jx=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Mx=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ts(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new jx;for(const n of e)Ox(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Ts){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function Ox(e,t,n,i){const o=n.lookup(e.scopeName);if(!o){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const a=n.lookup(t);e instanceof Ts?hl({baseGrammar:a,selfGrammar:o},i):Cc(e.ruleName,{baseGrammar:a,selfGrammar:o,repository:o.repository},i);const l=n.injections(e.scopeName);if(l)for(const c of l)i.add(new Ts(c))}function Cc(e,t,n){if(t.repository&&t.repository[e]){const i=t.repository[e];wl([i],t,n)}}function hl(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&wl(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&wl(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function wl(e,t,n){for(const i of e){if(n.visitedRule.has(i))continue;n.visitedRule.add(i);const o=i.repository?wg({},t.repository,i.repository):t.repository;Array.isArray(i.patterns)&&wl(i.patterns,{...t,repository:o},n);const a=i.include;if(!a)continue;const l=Tg(a);switch(l.kind){case 0:hl({...t,selfGrammar:t.baseGrammar},n);break;case 1:hl(t,n);break;case 2:Cc(l.ruleName,{...t,repository:o},n);break;case 3:case 4:const c=l.scopeName===t.selfGrammar.scopeName?t.selfGrammar:l.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(c){const f={baseGrammar:t.baseGrammar,selfGrammar:c,repository:o};l.kind===4?Cc(l.ruleName,f,n):hl(f,n)}else l.kind===4?n.add(new Lx(l.scopeName,l.ruleName)):n.add(new Ts(l.scopeName));break}}}var Dx=class{kind=0},$x=class{kind=1},Fx=class{constructor(e){this.ruleName=e}kind=2},zx=class{constructor(e){this.scopeName=e}kind=3},Bx=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Tg(e){if(e==="$base")return new Dx;if(e==="$self")return new $x;const t=e.indexOf("#");if(t===-1)return new zx(e);if(t===0)return new Fx(e.substring(1));{const n=e.substring(0,t),i=e.substring(t+1);return new Bx(n,i)}}var Ux=/\\(\d+)/,Lp=/\\(\d+)/g,Vx=-1,Ag=-2;var Os=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,i){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Zo.hasCaptures(this._name),this._contentName=i||null,this._contentNameIsCapturing=Zo.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${xg(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Zo.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Zo.replaceCaptures(this._contentName,e,t)}},Gx=class extends Os{retokenizeCapturedWithRuleId;constructor(e,t,n,i,o){super(e,t,n,i),this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,i){throw new Error("Not supported!")}},Wx=class extends Os{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,i,o){super(e,t,n,null),this._match=new As(i,this.id),this.captures=o,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Ps,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},jp=class extends Os{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,o){super(e,t,n,i),this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Ps,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},_c=class extends Os{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,o,a,l,c,f,d){super(e,t,n,i),this._begin=new As(o,this.id),this.beginCaptures=a,this._end=new As(l||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=c,this.applyEndPatternLast=f||!1,this.patterns=d.patterns,this.hasMissingPatterns=d.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,i)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Ps;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},xl=class extends Os{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,i,o,a,l,c,f){super(e,t,n,i),this._begin=new As(o,this.id),this.beginCaptures=a,this.whileCaptures=c,this._while=new As(l,Ag),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=f.patterns,this.hasMissingPatterns=f.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Ps;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,i){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,i)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Ps,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},Pg=class Et{static createCaptureRule(t,n,i,o,a){return t.registerRule(l=>new Gx(n,l,i,o,a))}static getCompiledRuleId(t,n,i){return t.id||n.registerRule(o=>{if(t.id=o,t.match)return new Wx(t.$vscodeTextmateLocation,t.id,t.name,t.match,Et._compileCaptures(t.captures,n,i));if(typeof t.begin>"u"){t.repository&&(i=wg({},i,t.repository));let a=t.patterns;return typeof a>"u"&&t.include&&(a=[{include:t.include}]),new jp(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Et._compilePatterns(a,n,i))}return t.while?new xl(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Et._compileCaptures(t.beginCaptures||t.captures,n,i),t.while,Et._compileCaptures(t.whileCaptures||t.captures,n,i),Et._compilePatterns(t.patterns,n,i)):new _c(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Et._compileCaptures(t.beginCaptures||t.captures,n,i),t.end,Et._compileCaptures(t.endCaptures||t.captures,n,i),t.applyEndPatternLast,Et._compilePatterns(t.patterns,n,i))}),t.id}static _compileCaptures(t,n,i){let o=[];if(t){let a=0;for(const l in t){if(l==="$vscodeTextmateLocation")continue;const c=parseInt(l,10);c>a&&(a=c)}for(let l=0;l<=a;l++)o[l]=null;for(const l in t){if(l==="$vscodeTextmateLocation")continue;const c=parseInt(l,10);let f=0;t[l].patterns&&(f=Et.getCompiledRuleId(t[l],n,i)),o[c]=Et.createCaptureRule(n,t[l].$vscodeTextmateLocation,t[l].name,t[l].contentName,f)}}return o}static _compilePatterns(t,n,i){let o=[];if(t)for(let a=0,l=t.length;a<l;a++){const c=t[a];let f=-1;if(c.include){const d=Tg(c.include);switch(d.kind){case 0:case 1:f=Et.getCompiledRuleId(i[c.include],n,i);break;case 2:let p=i[d.ruleName];p&&(f=Et.getCompiledRuleId(p,n,i));break;case 3:case 4:const m=d.scopeName,y=d.kind===4?d.ruleName:null,v=n.getExternalGrammar(m,i);if(v)if(y){let w=v.repository[y];w&&(f=Et.getCompiledRuleId(w,n,v.repository))}else f=Et.getCompiledRuleId(v.repository.$self,n,v.repository);break}}else f=Et.getCompiledRuleId(c,n,i);if(f!==-1){const d=n.getRule(f);let p=!1;if((d instanceof jp||d instanceof _c||d instanceof xl)&&d.hasMissingPatterns&&d.patterns.length===0&&(p=!0),p)continue;o.push(f)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}}},As=class Rg{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const i=t.length;let o=0,a=[],l=!1;for(let c=0;c<i;c++)if(t.charAt(c)==="\\"&&c+1<i){const d=t.charAt(c+1);d==="z"?(a.push(t.substring(o,c)),a.push("$(?!\\n)(?<!\\n)"),o=c+2):(d==="A"||d==="G")&&(l=!0),c++}this.hasAnchor=l,o===0?this.source=t:(a.push(t.substring(o,i)),this.source=a.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=Ux.test(this.source):this.hasBackReferences=!1}clone(){return new Rg(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let i=n.map(o=>t.substring(o.start,o.end));return Lp.lastIndex=0,this.source.replace(Lp,(o,a)=>_g(i[parseInt(a,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],i=[],o=[],a,l,c,f;for(a=0,l=this.source.length;a<l;a++)c=this.source.charAt(a),t[a]=c,n[a]=c,i[a]=c,o[a]=c,c==="\\"&&a+1<l&&(f=this.source.charAt(a+1),f==="A"?(t[a+1]="￿",n[a+1]="￿",i[a+1]="A",o[a+1]="A"):f==="G"?(t[a+1]="￿",n[a+1]="G",i[a+1]="￿",o[a+1]="G"):(t[a+1]=f,n[a+1]=f,i[a+1]=f,o[a+1]=f),a++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:i.join(""),A1_G1:o.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Ps=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new Mp(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let i=this._items.map(o=>o.resolveAnchors(t,n));return new Mp(e,i,this._items.map(o=>o.ruleId))}},Mp=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
14
+ `)}findNextMatchSync(e,t,n){const i=this.scanner.findNextMatchSync(e,t,n);return i?{ruleId:this.rules[i.index],captureIndices:i.captureIndices}:null}},Vu=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Hx=class bc{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Vu(t,8),this._embeddedLanguagesMatcher=new qx(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?bc._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Vu(0,0);_getBasicScopeAttributes=new bg(t=>{const n=this._scopeToLanguage(t),i=this._toStandardTokenType(t);return new Vu(n,i)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(bc.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},qx=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,i])=>_g(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Op=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Lg(e,t,n,i,o,a,l,c){const f=t.content.length;let d=!1,p=-1;if(l){const v=Kx(e,t,n,i,o,a);o=v.stack,i=v.linePos,n=v.isFirstLine,p=v.anchorPosition}const m=Date.now();for(;!d;){if(c!==0&&Date.now()-m>c)return new Op(o,!0);y()}return new Op(o,!1);function y(){const v=Qx(e,t,n,i,o,p);if(!v){a.produce(o,f),d=!0;return}const w=v.captureIndices,_=v.matchedRuleId,N=w&&w.length>0?w[0].end>i:!1;if(_===Vx){const C=o.getRule(e);a.produce(o,w[0].start),o=o.withContentNameScopesList(o.nameScopesList),Cs(e,t,n,o,a,C.endCaptures,w),a.produce(o,w[0].end);const b=o;if(o=o.parent,p=b.getAnchorPos(),!N&&b.getEnterPos()===i){o=b,a.produce(o,f),d=!0;return}}else{const C=e.getRule(_);a.produce(o,w[0].start);const b=o,E=C.getName(t.content,w),B=o.contentNameScopesList.pushAttributed(E,e);if(o=o.push(_,i,p,w[0].end===f,null,B,B),C instanceof _c){const O=C;Cs(e,t,n,o,a,O.beginCaptures,w),a.produce(o,w[0].end),p=w[0].end;const D=O.getContentName(t.content,w),ie=B.pushAttributed(D,e);if(o=o.withContentNameScopesList(ie),O.endHasBackReferences&&(o=o.withEndRule(O.getEndWithResolvedBackReferences(t.content,w))),!N&&b.hasSameRuleAs(o)){o=o.pop(),a.produce(o,f),d=!0;return}}else if(C instanceof xl){const O=C;Cs(e,t,n,o,a,O.beginCaptures,w),a.produce(o,w[0].end),p=w[0].end;const D=O.getContentName(t.content,w),ie=B.pushAttributed(D,e);if(o=o.withContentNameScopesList(ie),O.whileHasBackReferences&&(o=o.withEndRule(O.getWhileWithResolvedBackReferences(t.content,w))),!N&&b.hasSameRuleAs(o)){o=o.pop(),a.produce(o,f),d=!0;return}}else if(Cs(e,t,n,o,a,C.captures,w),a.produce(o,w[0].end),o=o.pop(),!N){o=o.safePop(),a.produce(o,f),d=!0;return}}w[0].end>i&&(i=w[0].end,n=!1)}}function Kx(e,t,n,i,o,a){let l=o.beginRuleCapturedEOL?0:-1;const c=[];for(let f=o;f;f=f.pop()){const d=f.getRule(e);d instanceof xl&&c.push({rule:d,stack:f})}for(let f=c.pop();f;f=c.pop()){const{ruleScanner:d,findOptions:p}=Jx(f.rule,e,f.stack.endRule,n,i===l),m=d.findNextMatchSync(t,i,p);if(m){if(m.ruleId!==Ag){o=f.stack.pop();break}m.captureIndices&&m.captureIndices.length&&(a.produce(f.stack,m.captureIndices[0].start),Cs(e,t,n,f.stack,a,f.rule.whileCaptures,m.captureIndices),a.produce(f.stack,m.captureIndices[0].end),l=m.captureIndices[0].end,m.captureIndices[0].end>i&&(i=m.captureIndices[0].end,n=!1))}else{o=f.stack.pop();break}}return{stack:o,linePos:i,anchorPosition:l,isFirstLine:n}}function Qx(e,t,n,i,o,a){const l=Xx(e,t,n,i,o,a),c=e.getInjections();if(c.length===0)return l;const f=Yx(c,e,t,n,i,o,a);if(!f)return l;if(!l)return f;const d=l.captureIndices[0].start,p=f.captureIndices[0].start;return p<d||f.priorityMatch&&p===d?f:l}function Xx(e,t,n,i,o,a){const l=o.getRule(e),{ruleScanner:c,findOptions:f}=jg(l,e,o.endRule,n,i===a),d=c.findNextMatchSync(t,i,f);return d?{captureIndices:d.captureIndices,matchedRuleId:d.ruleId}:null}function Yx(e,t,n,i,o,a,l){let c=Number.MAX_VALUE,f=null,d,p=0;const m=a.contentNameScopesList.getScopeNames();for(let y=0,v=e.length;y<v;y++){const w=e[y];if(!w.matcher(m))continue;const _=t.getRule(w.ruleId),{ruleScanner:N,findOptions:C}=jg(_,t,null,i,o===l),b=N.findNextMatchSync(n,o,C);if(!b)continue;const E=b.captureIndices[0].start;if(!(E>=c)&&(c=E,f=b.captureIndices,d=b.ruleId,p=w.priority,c===o))break}return f?{priorityMatch:p===-1,captureIndices:f,matchedRuleId:d}:null}function jg(e,t,n,i,o){return{ruleScanner:e.compileAG(t,n,i,o),findOptions:0}}function Jx(e,t,n,i,o){return{ruleScanner:e.compileWhileAG(t,n,i,o),findOptions:0}}function Cs(e,t,n,i,o,a,l){if(a.length===0)return;const c=t.content,f=Math.min(a.length,l.length),d=[],p=l[0].end;for(let m=0;m<f;m++){const y=a[m];if(y===null)continue;const v=l[m];if(v.length===0)continue;if(v.start>p)break;for(;d.length>0&&d[d.length-1].endPos<=v.start;)o.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop();if(d.length>0?o.produceFromScopes(d[d.length-1].scopes,v.start):o.produce(i,v.start),y.retokenizeCapturedWithRuleId){const _=y.getName(c,l),N=i.contentNameScopesList.pushAttributed(_,e),C=y.getContentName(c,l),b=N.pushAttributed(C,e),E=i.push(y.retokenizeCapturedWithRuleId,v.start,-1,!1,null,N,b),B=e.createOnigString(c.substring(0,v.end));Lg(e,B,n&&v.start===0,v.start,E,o,!1,0),Ng(B);continue}const w=y.getName(c,l);if(w!==null){const N=(d.length>0?d[d.length-1].scopes:i.contentNameScopesList).pushAttributed(w,e);d.push(new Zx(N,v.end))}}for(;d.length>0;)o.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop()}var Zx=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function e0(e,t,n,i,o,a,l,c){return new n0(e,t,n,i,o,a,l,c)}function Dp(e,t,n,i,o){const a=vl(t,Sl),l=Pg.getCompiledRuleId(n,i,o.repository);for(const c of a)e.push({debugSelector:t,matcher:c.matcher,ruleId:l,grammar:o,priority:c.priority})}function Sl(e,t){if(t.length<e.length)return!1;let n=0;return e.every(i=>{for(let o=n;o<t.length;o++)if(t0(t[o],i))return n=o+1,!0;return!1})}function t0(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var n0=class{constructor(e,t,n,i,o,a,l,c){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=c,this._basicScopeAttributesProvider=new Hx(n,i),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=l,this._grammar=$p(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const f of Object.keys(o)){const d=vl(f,Sl);for(const p of d)this._tokenTypeMatchers.push({matcher:p.matcher,type:o[f]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:o=>o===this._rootScopeName?this._grammar:this.getExternalGrammar(o),injections:o=>this._grammarRepository.injections(o)},t=[],n=this._rootScopeName,i=e.lookup(n);if(i){const o=i.injections;if(o)for(let l in o)Dp(t,l,o[l],this,i);const a=this._grammarRepository.injections(n);a&&a.forEach(l=>{const c=this.getExternalGrammar(l);if(c){const f=c.injectionSelector;f&&Dp(t,f,c,this,c)}})}return t.sort((o,a)=>o.priority-a.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=$p(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const i=this._tokenize(e,t,!1,n);return{tokens:i.lineTokens.getResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}tokenizeLine2(e,t,n=0){const i=this._tokenize(e,t,!0,n);return{tokens:i.lineTokens.getBinaryResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}_tokenize(e,t,n,i){this._rootId===-1&&(this._rootId=Pg.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!t||t===Ec.NULL){o=!0;const d=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),m=Ei.set(0,d.languageId,d.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),y=this.getRule(this._rootId).getName(null,null);let v;y?v=_s.createRootAndLookUpScopeName(y,m,this):v=_s.createRoot("unknown",m),t=new Ec(null,this._rootId,-1,-1,!1,null,v,v)}else o=!1,t.reset();e=e+`
15
+ `;const a=this.createOnigString(e),l=a.content.length,c=new i0(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),f=Lg(this,a,o,0,t,c,!0,i);return Ng(a),{lineLength:l,lineTokens:c,ruleStack:f.stack,stoppedEarly:f.stoppedEarly}}};function $p(e,t){return e=xx(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var _s=class Tn{constructor(t,n,i){this.parent=t,this.scopePath=n,this.tokenAttributes=i}static fromExtension(t,n){let i=t,o=t?.scopePath??null;for(const a of n)o=Uu.push(o,a.scopeNames),i=new Tn(i,o,a.encodedTokenAttributes);return i}static createRoot(t,n){return new Tn(null,new Uu(null,t),n)}static createRootAndLookUpScopeName(t,n,i){const o=i.getMetadataForScope(t),a=new Uu(null,t),l=i.themeProvider.themeMatch(a),c=Tn.mergeAttributes(n,o,l);return new Tn(null,a,c)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Tn.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,i){let o=-1,a=0,l=0;return i!==null&&(o=i.fontStyle,a=i.foregroundId,l=i.backgroundId),Ei.set(t,n.languageId,n.tokenType,null,o,a,l)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return Tn._pushAttributed(this,t,n);const i=t.split(/ /g);let o=this;for(const a of i)o=Tn._pushAttributed(o,a,n);return o}static _pushAttributed(t,n,i){const o=i.getMetadataForScope(n),a=t.scopePath.push(n),l=i.themeProvider.themeMatch(a),c=Tn.mergeAttributes(t.tokenAttributes,o,l);return new Tn(t,a,c)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let i=this;for(;i&&i!==t;)n.push({encodedTokenAttributes:i.tokenAttributes,scopeNames:i.scopePath.getExtensionIfDefined(i.parent?.scopePath??null)}),i=i.parent;return i===t?n.reverse():void 0}},Ec=class Mr{constructor(t,n,i,o,a,l,c,f){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=a,this.endRule=l,this.nameScopesList=c,this.contentNameScopesList=f,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=i,this._anchorPos=o}_stackElementBrand=void 0;static NULL=new Mr(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:Mr._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?_s.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){Mr._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,i,o,a,l,c){return new Mr(this,t,n,i,o,a,l,c)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new Mr(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const i=_s.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new Mr(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,i,_s.fromExtension(i,n.contentNameScopesList))}},r0=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):vl(n,Sl).map(i=>i.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>vl(n,Sl).map(i=>i.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},i0=class{constructor(e,t,n,i){this.balancedBracketSelectors=i,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let i=e?.tokenAttributes??0,o=!1;if(this.balancedBracketSelectors?.matchesAlways&&(o=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const a=e?.getScopeNames()??[];for(const l of this._tokenTypeOverrides)l.matcher(a)&&(i=Ei.set(i,0,l.type,null,-1,0,0));this.balancedBracketSelectors&&(o=this.balancedBracketSelectors.match(a))}if(o&&(i=Ei.set(i,0,8,o,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===i){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(i),this._lastTokenEndIndex=t;return}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let i=0,o=this._binaryTokens.length;i<o;i++)n[i]=this._binaryTokens[i];return n}},s0=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,i,o){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,e0(e,a,t,n,i,o,this,this._onigLib))}return this._grammars.get(e)}},o0=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new s0(kl.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(kl.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,i){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:i})}loadGrammarWithConfiguration(t,n,i){return this._loadGrammar(t,n,i.embeddedLanguages,i.tokenTypes,new r0(i.balancedBracketSelectors||[],i.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,i,o,a){const l=new Mx(this._syncRegistry,t);for(;l.Q.length>0;)l.Q.map(c=>this._loadSingleGrammar(c.scopeName)),l.processQueue();return this._grammarForScopeName(t,n,i,o,a)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const i=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,i)}}addGrammar(t,n=[],i=0,o=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,i,o)}_grammarForScopeName(t,n=0,i=null,o=null,a=null){return this._syncRegistry.grammarForScopeName(t,n,i,o,a)}},Ic=Ec.NULL;const l0=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Ds{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}Ds.prototype.normal={};Ds.prototype.property={};Ds.prototype.space=void 0;function Mg(e,t){const n={},i={};for(const o of e)Object.assign(n,o.property),Object.assign(i,o.normal);return new Ds(n,i,t)}function Nc(e){return e.toLowerCase()}class Vt{constructor(t,n){this.attribute=n,this.property=t}}Vt.prototype.attribute="";Vt.prototype.booleanish=!1;Vt.prototype.boolean=!1;Vt.prototype.commaOrSpaceSeparated=!1;Vt.prototype.commaSeparated=!1;Vt.prototype.defined=!1;Vt.prototype.mustUseProperty=!1;Vt.prototype.number=!1;Vt.prototype.overloadedBoolean=!1;Vt.prototype.property="";Vt.prototype.spaceSeparated=!1;Vt.prototype.space=void 0;let a0=0;const Ee=Wr(),ut=Wr(),Tc=Wr(),ne=Wr(),Ge=Wr(),Br=Wr(),Xt=Wr();function Wr(){return 2**++a0}const Ac=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ee,booleanish:ut,commaOrSpaceSeparated:Xt,commaSeparated:Br,number:ne,overloadedBoolean:Tc,spaceSeparated:Ge},Symbol.toStringTag,{value:"Module"})),Gu=Object.keys(Ac);class Zc extends Vt{constructor(t,n,i,o){let a=-1;if(super(t,n),Fp(this,"space",o),typeof i=="number")for(;++a<Gu.length;){const l=Gu[a];Fp(this,Gu[a],(i&Ac[l])===Ac[l])}}}Zc.prototype.defined=!0;function Fp(e,t,n){n&&(e[t]=n)}function Ni(e){const t={},n={};for(const[i,o]of Object.entries(e.properties)){const a=new Zc(i,e.transform(e.attributes||{},i),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(a.mustUseProperty=!0),t[i]=a,n[Nc(i)]=i,n[Nc(a.attribute)]=i}return new Ds(t,n,e.space)}const Og=Ni({properties:{ariaActiveDescendant:null,ariaAtomic:ut,ariaAutoComplete:null,ariaBusy:ut,ariaChecked:ut,ariaColCount:ne,ariaColIndex:ne,ariaColSpan:ne,ariaControls:Ge,ariaCurrent:null,ariaDescribedBy:Ge,ariaDetails:null,ariaDisabled:ut,ariaDropEffect:Ge,ariaErrorMessage:null,ariaExpanded:ut,ariaFlowTo:Ge,ariaGrabbed:ut,ariaHasPopup:null,ariaHidden:ut,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ge,ariaLevel:ne,ariaLive:null,ariaModal:ut,ariaMultiLine:ut,ariaMultiSelectable:ut,ariaOrientation:null,ariaOwns:Ge,ariaPlaceholder:null,ariaPosInSet:ne,ariaPressed:ut,ariaReadOnly:ut,ariaRelevant:null,ariaRequired:ut,ariaRoleDescription:Ge,ariaRowCount:ne,ariaRowIndex:ne,ariaRowSpan:ne,ariaSelected:ut,ariaSetSize:ne,ariaSort:null,ariaValueMax:ne,ariaValueMin:ne,ariaValueNow:ne,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Dg(e,t){return t in e?e[t]:t}function $g(e,t){return Dg(e,t.toLowerCase())}const u0=Ni({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Br,acceptCharset:Ge,accessKey:Ge,action:null,allow:null,allowFullScreen:Ee,allowPaymentRequest:Ee,allowUserMedia:Ee,alpha:Ee,alt:null,as:null,async:Ee,autoCapitalize:null,autoComplete:Ge,autoFocus:Ee,autoPlay:Ee,blocking:Ge,capture:null,charSet:null,checked:Ee,cite:null,className:Ge,closedBy:null,colorSpace:null,cols:ne,colSpan:ne,command:null,commandFor:null,content:null,contentEditable:ut,controls:Ee,controlsList:Ge,coords:ne|Br,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ee,defer:Ee,dir:null,dirName:null,disabled:Ee,download:Tc,draggable:ut,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ee,formTarget:null,headers:Ge,height:ne,hidden:Tc,high:ne,href:null,hrefLang:null,htmlFor:Ge,httpEquiv:Ge,id:null,imageSizes:null,imageSrcSet:null,inert:Ee,inputMode:null,integrity:null,is:null,isMap:Ee,itemId:null,itemProp:Ge,itemRef:Ge,itemScope:Ee,itemType:Ge,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ee,low:ne,manifest:null,max:null,maxLength:ne,media:null,method:null,min:null,minLength:ne,multiple:Ee,muted:Ee,name:null,nonce:null,noModule:Ee,noValidate:Ee,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:Ee,optimum:ne,pattern:null,ping:Ge,placeholder:null,playsInline:Ee,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ee,referrerPolicy:null,rel:Ge,required:Ee,reversed:Ee,rows:ne,rowSpan:ne,sandbox:Ge,scope:null,scoped:Ee,seamless:Ee,selected:Ee,shadowRootClonable:Ee,shadowRootCustomElementRegistry:Ee,shadowRootDelegatesFocus:Ee,shadowRootMode:null,shadowRootSerializable:Ee,shape:null,size:ne,sizes:null,slot:null,span:ne,spellCheck:ut,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ne,step:null,style:null,tabIndex:ne,target:null,title:null,translate:null,type:null,typeMustMatch:Ee,useMap:null,value:ut,width:ne,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ge,axis:null,background:null,bgColor:null,border:ne,borderColor:null,bottomMargin:ne,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ee,declare:Ee,event:null,face:null,frame:null,frameBorder:null,hSpace:ne,leftMargin:ne,link:null,longDesc:null,lowSrc:null,marginHeight:ne,marginWidth:ne,noResize:Ee,noHref:Ee,noShade:Ee,noWrap:Ee,object:null,profile:null,prompt:null,rev:null,rightMargin:ne,rules:null,scheme:null,scrolling:ut,standby:null,summary:null,text:null,topMargin:ne,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ne,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ee,disablePictureInPicture:Ee,disableRemotePlayback:Ee,exportParts:Br,part:Ge,prefix:null,property:null,results:ne,security:null,unselectable:null},space:"html",transform:$g}),c0=Ni({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:Xt,accentHeight:ne,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ne,amplitude:ne,arabicForm:null,ascent:ne,attributeName:null,attributeType:null,azimuth:ne,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ne,by:null,calcMode:null,capHeight:ne,className:Ge,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:ne,diffuseConstant:ne,direction:null,display:null,dur:null,divisor:ne,dominantBaseline:null,download:Ee,dx:null,dy:null,edgeMode:null,editable:null,elevation:ne,enableBackground:null,end:null,event:null,exponent:ne,externalResourcesRequired:null,fill:null,fillOpacity:ne,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:Br,g2:Br,glyphName:Br,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ne,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ne,horizOriginX:ne,horizOriginY:ne,id:null,ideographic:ne,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ne,k:ne,k1:ne,k2:ne,k3:ne,k4:ne,kernelMatrix:Xt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ne,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:ne,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:ne,overlineThickness:ne,paintOrder:null,panose1:null,path:null,pathLength:ne,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ge,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ne,pointsAtY:ne,pointsAtZ:ne,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Xt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Xt,rev:Xt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Xt,requiredFeatures:Xt,requiredFonts:Xt,requiredFormats:Xt,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:ne,specularExponent:ne,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ne,strikethroughThickness:ne,string:null,stroke:null,strokeDashArray:Xt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ne,strokeOpacity:ne,strokeWidth:null,style:null,surfaceScale:ne,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Xt,tabIndex:ne,tableValues:null,target:null,targetX:ne,targetY:ne,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Xt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ne,underlineThickness:ne,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ne,values:null,vAlphabetic:ne,vMathematical:ne,vectorEffect:null,vHanging:ne,vIdeographic:ne,version:null,vertAdvY:ne,vertOriginX:ne,vertOriginY:ne,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ne,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Dg}),Fg=Ni({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()}}),zg=Ni({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:$g}),Bg=Ni({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),f0={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"},d0=/[A-Z]/g,zp=/-[a-z]/g,h0=/^data[-\w.:]+$/i;function Ug(e,t){const n=Nc(t);let i=t,o=Vt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&h0.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(zp,m0);i="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!zp.test(a)){let l=a.replace(d0,p0);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=Zc}return new o(i,t)}function p0(e){return"-"+e.toLowerCase()}function m0(e){return e.charAt(1).toUpperCase()}const Vg=Mg([Og,u0,Fg,zg,Bg],"html"),$s=Mg([Og,c0,Fg,zg,Bg],"svg"),Bp={}.hasOwnProperty;function g0(e,t){const n=t||{};function i(o,...a){let l=i.invalid;const c=i.handlers;if(o&&Bp.call(o,e)){const f=String(o[e]);l=Bp.call(c,f)?c[f]:i.unknown}if(l)return l.call(this,o,...a)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}const y0=/["&'<>`]/g,k0=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,v0=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,w0=/[|\\{}()[\]^$+*?.]/g,Up=new WeakMap;function x0(e,t){if(e=e.replace(t.subset?S0(t.subset):y0,i),t.subset||t.escapeOnly)return e;return e.replace(k0,n).replace(v0,i);function n(o,a,l){return t.format((o.charCodeAt(0)-55296)*1024+o.charCodeAt(1)-56320+65536,l.charCodeAt(a+2),t)}function i(o,a,l){return t.format(o.charCodeAt(0),l.charCodeAt(a+1),t)}}function S0(e){let t=Up.get(e);return t||(t=C0(e),Up.set(e,t)),t}function C0(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(w0,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const _0=/[\dA-Fa-f]/;function b0(e,t,n){const i="&#x"+e.toString(16).toUpperCase();return n&&t&&!_0.test(String.fromCharCode(t))?i:i+";"}const E0=/\d/;function I0(e,t,n){const i="&#"+String(e);return n&&t&&!E0.test(String.fromCharCode(t))?i:i+";"}const N0=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Wu={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},T0=["cent","copy","divide","gt","lt","not","para","times"],Gg={}.hasOwnProperty,Pc={};let el;for(el in Wu)Gg.call(Wu,el)&&(Pc[Wu[el]]=el);const A0=/[^\dA-Za-z]/;function P0(e,t,n,i){const o=String.fromCharCode(e);if(Gg.call(Pc,o)){const a=Pc[o],l="&"+a;return n&&N0.includes(a)&&!T0.includes(a)&&(!i||t&&t!==61&&A0.test(String.fromCharCode(t)))?l:l+";"}return""}function R0(e,t,n){let i=b0(e,t,n.omitOptionalSemicolons),o;if((n.useNamedReferences||n.useShortestReferences)&&(o=P0(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!o)&&n.useShortestReferences){const a=I0(e,t,n.omitOptionalSemicolons);a.length<i.length&&(i=a)}return o&&(!n.useShortestReferences||o.length<i.length)?o:i}function bi(e,t){return x0(e,Object.assign({format:R0},t))}const L0=/^>|^->|<!--|-->|--!>|<!-$/g,j0=[">"],M0=["<",">"];function O0(e,t,n,i){return i.settings.bogusComments?"<?"+bi(e.value,Object.assign({},i.settings.characterReferences,{subset:j0}))+">":"<!--"+e.value.replace(L0,o)+"-->";function o(a){return bi(a,Object.assign({},i.settings.characterReferences,{subset:M0}))}}function D0(e,t,n,i){return"<!"+(i.settings.upperDoctype?"DOCTYPE":"doctype")+(i.settings.tightDoctype?"":" ")+"html>"}function Cl(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,o=n.indexOf(t);for(;o!==-1;)i++,o=n.indexOf(t,o+t.length);return i}function Wg(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Hg(e){return e.join(" ").trim()}const $0=/[ \t\n\f\r]/g;function Ml(e){return typeof e=="object"?e.type==="text"?Vp(e.value):!1:Vp(e)}function Vp(e){return e.replace($0,"")===""}const ht=Kg(1),qg=Kg(-1),F0=[];function Kg(e){return t;function t(n,i,o){const a=n?n.children:F0;let l=(i||0)+e,c=a[l];if(!o)for(;c&&Ml(c);)l+=e,c=a[l];return c}}const z0={}.hasOwnProperty;function Qg(e){return t;function t(n,i,o){return z0.call(e,n.tagName)&&e[n.tagName](n,i,o)}}const ef=Qg({body:U0,caption:Hu,colgroup:Hu,dd:H0,dt:W0,head:Hu,html:B0,li:G0,optgroup:q0,option:K0,p:V0,rp:Gp,rt:Gp,tbody:X0,td:Wp,tfoot:Y0,th:Wp,thead:Q0,tr:J0});function Hu(e,t,n){const i=ht(n,t,!0);return!i||i.type!=="comment"&&!(i.type==="text"&&Ml(i.value.charAt(0)))}function B0(e,t,n){const i=ht(n,t);return!i||i.type!=="comment"}function U0(e,t,n){const i=ht(n,t);return!i||i.type!=="comment"}function V0(e,t,n){const i=ht(n,t);return i?i.type==="element"&&(i.tagName==="address"||i.tagName==="article"||i.tagName==="aside"||i.tagName==="blockquote"||i.tagName==="details"||i.tagName==="div"||i.tagName==="dl"||i.tagName==="fieldset"||i.tagName==="figcaption"||i.tagName==="figure"||i.tagName==="footer"||i.tagName==="form"||i.tagName==="h1"||i.tagName==="h2"||i.tagName==="h3"||i.tagName==="h4"||i.tagName==="h5"||i.tagName==="h6"||i.tagName==="header"||i.tagName==="hgroup"||i.tagName==="hr"||i.tagName==="main"||i.tagName==="menu"||i.tagName==="nav"||i.tagName==="ol"||i.tagName==="p"||i.tagName==="pre"||i.tagName==="section"||i.tagName==="table"||i.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function G0(e,t,n){const i=ht(n,t);return!i||i.type==="element"&&i.tagName==="li"}function W0(e,t,n){const i=ht(n,t);return!!(i&&i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd"))}function H0(e,t,n){const i=ht(n,t);return!i||i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd")}function Gp(e,t,n){const i=ht(n,t);return!i||i.type==="element"&&(i.tagName==="rp"||i.tagName==="rt")}function q0(e,t,n){const i=ht(n,t);return!i||i.type==="element"&&i.tagName==="optgroup"}function K0(e,t,n){const i=ht(n,t);return!i||i.type==="element"&&(i.tagName==="option"||i.tagName==="optgroup")}function Q0(e,t,n){const i=ht(n,t);return!!(i&&i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot"))}function X0(e,t,n){const i=ht(n,t);return!i||i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot")}function Y0(e,t,n){return!ht(n,t)}function J0(e,t,n){const i=ht(n,t);return!i||i.type==="element"&&i.tagName==="tr"}function Wp(e,t,n){const i=ht(n,t);return!i||i.type==="element"&&(i.tagName==="td"||i.tagName==="th")}const Z0=Qg({body:n1,colgroup:r1,head:t1,html:e1,tbody:i1});function e1(e){const t=ht(e,-1);return!t||t.type!=="comment"}function t1(e){const t=new Set;for(const i of e.children)if(i.type==="element"&&(i.tagName==="base"||i.tagName==="title")){if(t.has(i.tagName))return!1;t.add(i.tagName)}const n=e.children[0];return!n||n.type==="element"}function n1(e){const t=ht(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Ml(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function r1(e,t,n){const i=qg(n,t),o=ht(e,-1,!0);return n&&i&&i.type==="element"&&i.tagName==="colgroup"&&ef(i,n.children.indexOf(i),n)?!1:!!(o&&o.type==="element"&&o.tagName==="col")}function i1(e,t,n){const i=qg(n,t),o=ht(e,-1);return n&&i&&i.type==="element"&&(i.tagName==="thead"||i.tagName==="tbody")&&ef(i,n.children.indexOf(i),n)?!1:!!(o&&o.type==="element"&&o.tagName==="tr")}const tl={name:[[`
16
+ \f\r &/=>`.split(""),`
17
+ \f\r "&'/=>\``.split("")],[`\0
18
+ \f\r "&'/<=>`.split(""),`\0
19
+ \f\r "&'/<=>\``.split("")]],unquoted:[[`
20
+ \f\r &>`.split(""),`\0
21
+ \f\r "&'<=>\``.split("")],[`\0
22
+ \f\r "&'<=>\``.split(""),`\0
23
+ \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function s1(e,t,n,i){const o=i.schema,a=o.space==="svg"?!1:i.settings.omitOptionalTags;let l=o.space==="svg"?i.settings.closeEmptyElements:i.settings.voids.includes(e.tagName.toLowerCase());const c=[];let f;o.space==="html"&&e.tagName==="svg"&&(i.schema=$s);const d=o1(i,e.properties),p=i.all(o.space==="html"&&e.tagName==="template"?e.content:e);return i.schema=o,p&&(l=!1),(d||!a||!Z0(e,t,n))&&(c.push("<",e.tagName,d?" "+d:""),l&&(o.space==="svg"||i.settings.closeSelfClosing)&&(f=d.charAt(d.length-1),(!i.settings.tightSelfClosing||f==="/"||f&&f!=='"'&&f!=="'")&&c.push(" "),c.push("/")),c.push(">")),c.push(p),!l&&(!a||!ef(e,t,n))&&c.push("</"+e.tagName+">"),c.join("")}function o1(e,t){const n=[];let i=-1,o;if(t){for(o in t)if(t[o]!==null&&t[o]!==void 0){const a=l1(e,o,t[o]);a&&n.push(a)}}for(;++i<n.length;){const a=e.settings.tightAttributes?n[i].charAt(n[i].length-1):void 0;i!==n.length-1&&a!=='"'&&a!=="'"&&(n[i]+=" ")}return n.join("")}function l1(e,t,n){const i=Ug(e.schema,t),o=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,a=e.settings.allowDangerousCharacters?0:1;let l=e.quote,c;if(i.overloadedBoolean&&(n===i.attribute||n==="")?n=!0:(i.boolean||i.overloadedBoolean)&&(typeof n!="string"||n===i.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const f=bi(i.attribute,Object.assign({},e.settings.characterReferences,{subset:tl.name[o][a]}));return n===!0||(n=Array.isArray(n)?(i.commaSeparated?Wg:Hg)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?f:(e.settings.preferUnquoted&&(c=bi(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:tl.unquoted[o][a]}))),c!==n&&(e.settings.quoteSmart&&Cl(n,l)>Cl(n,e.alternative)&&(l=e.alternative),c=l+bi(n,Object.assign({},e.settings.characterReferences,{subset:(l==="'"?tl.single:tl.double)[o][a],attribute:!0}))+l),f+(c&&"="+c))}const a1=["<","&"];function Xg(e,t,n,i){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:bi(e.value,Object.assign({},i.settings.characterReferences,{subset:a1}))}function u1(e,t,n,i){return i.settings.allowDangerousHtml?e.value:Xg(e,t,n,i)}function c1(e,t,n,i){return i.all(e)}const f1=g0("type",{invalid:d1,unknown:h1,handlers:{comment:O0,doctype:D0,element:s1,raw:u1,root:c1,text:Xg}});function d1(e){throw new Error("Expected node, not `"+e+"`")}function h1(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const p1={},m1={},g1=[];function y1(e,t){const n=t||p1,i=n.quote||'"',o=i==='"'?"'":'"';if(i!=='"'&&i!=="'")throw new Error("Invalid quote `"+i+"`, expected `'` or `\"`");return{one:k1,all:v1,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||l0,characterReferences:n.characterReferences||m1,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?$s:Vg,quote:i,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function k1(e,t,n){return f1(e,t,n,this)}function v1(e){const t=[],n=e&&e.children||g1;let i=-1;for(;++i<n.length;)t[i]=this.one(n[i],i,e);return t.join("")}function _l(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},i=typeof e=="string"?e:e.name;for(const[o,a]of Object.entries(t?.colorReplacements||{}))typeof a=="string"?n[o]=a:o===i&&Object.assign(n,a);return n}function yr(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function w1(e){return Array.isArray(e)?e:[e]}async function Yg(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function tf(e){return!e||["plaintext","txt","text","plain"].includes(e)}function x1(e){return e==="ansi"||tf(e)}function nf(e){return e==="none"}function S1(e){return nf(e)}function Jg(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const i of n)i&&!e.properties.class.includes(i)&&e.properties.class.push(i);return e}function Ol(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(/(\r?\n)/g);let i=0;const o=[];for(let a=0;a<n.length;a+=2){const l=t?n[a]+(n[a+1]||""):n[a];o.push([l,i]),i+=n[a].length,i+=n[a+1]?.length||0}return o}function C1(e){const t=Ol(e,!0).map(([o])=>o);function n(o){if(o===e.length)return{line:t.length-1,character:t[t.length-1].length};let a=o,l=0;for(const c of t){if(a<c.length)break;a-=c.length,l++}return{line:l,character:a}}function i(o,a){let l=0;for(let c=0;c<o;c++)l+=t[c].length;return l+=a,l}return{lines:t,indexToPos:n,posToIndex:i}}const rf="light-dark()",_1=["color","background-color"];function b1(e,t){let n=0;const i=[];for(const o of t)o>n&&i.push({...e,content:e.content.slice(n,o),offset:e.offset+n}),n=o;return n<e.content.length&&i.push({...e,content:e.content.slice(n),offset:e.offset+n}),i}function E1(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((i,o)=>i-o);return n.length?e.map(i=>i.flatMap(o=>{const a=n.filter(l=>o.offset<l&&l<o.offset+o.content.length).map(l=>l-o.offset).sort((l,c)=>l-c);return a.length?b1(o,a):o})):e}function I1(e,t,n,i,o="css-vars"){const a={content:e.content,explanation:e.explanation,offset:e.offset},l=t.map(p=>bl(e.variants[p])),c=new Set(l.flatMap(p=>Object.keys(p))),f={},d=(p,m)=>{const y=m==="color"?"":m==="background-color"?"-bg":`-${m}`;return n+t[p]+(m==="color"?"":y)};return l.forEach((p,m)=>{for(const y of c){const v=p[y]||"inherit";if(m===0&&i&&_1.includes(y))if(i===rf&&l.length>1){const w=t.findIndex(b=>b==="light"),_=t.findIndex(b=>b==="dark");if(w===-1||_===-1)throw new kt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const N=l[w][y]||"inherit",C=l[_][y]||"inherit";f[y]=`light-dark(${N}, ${C})`,o==="css-vars"&&(f[d(m,y)]=v)}else f[y]=v;else o==="css-vars"&&(f[d(m,y)]=v)}}),a.htmlStyle=f,a}function bl(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&It.Italic&&(t["font-style"]="italic"),e.fontStyle&It.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&It.Underline&&n.push("underline"),e.fontStyle&It.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function Rc(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const Zg=new WeakMap;function Dl(e,t){Zg.set(e,t)}function Rs(e){return Zg.get(e)}class Ti{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new Ti(Object.fromEntries(w1(n).map(i=>[i,Ic])),t)}constructor(...t){if(t.length===2){const[n,i]=t;this.lang=i,this._stacks=n}else{const[n,i,o]=t;this.lang=i,this._stacks={[o]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return N1(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function N1(e){const t=[],n=new Set;function i(o){if(n.has(o))return;n.add(o);const a=o?.nameScopesList?.scopeName;a&&t.push(a),o.parent&&i(o.parent)}return i(e),t}function T1(e,t){if(!(e instanceof Ti))throw new kt("Invalid grammar state");return e.getInternalStack(t)}function A1(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let i=function(l){if(typeof l=="number"){if(l<0||l>n.source.length)throw new kt(`Invalid decoration offset: ${l}. Code length: ${n.source.length}`);return{...o.indexToPos(l),offset:l}}else{const c=o.lines[l.line];if(c===void 0)throw new kt(`Invalid decoration position ${JSON.stringify(l)}. Lines length: ${o.lines.length}`);let f=l.character;if(f<0&&(f=c.length+f),f<0||f>c.length)throw new kt(`Invalid decoration position ${JSON.stringify(l)}. Line ${l.line} length: ${c.length}`);return{...l,character:f,offset:o.posToIndex(l.line,f)}}};const o=C1(n.source),a=(n.options.decorations||[]).map(l=>({...l,start:i(l.start),end:i(l.end)}));P1(a),e.set(n.meta,{decorations:a,converter:o,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const o=t(this).decorations.flatMap(l=>[l.start.offset,l.end.offset]);return E1(n,o)},code(n){if(!this.options.decorations?.length)return;const i=t(this),o=Array.from(n.children).filter(p=>p.type==="element"&&p.tagName==="span");if(o.length!==i.converter.lines.length)throw new kt(`Number of lines in code element (${o.length}) does not match the number of lines in the source (${i.converter.lines.length}). Failed to apply decorations.`);function a(p,m,y,v){const w=o[p];let _="",N=-1,C=-1;if(m===0&&(N=0),y===0&&(C=0),y===Number.POSITIVE_INFINITY&&(C=w.children.length),N===-1||C===-1)for(let E=0;E<w.children.length;E++)_+=ey(w.children[E]),N===-1&&_.length===m&&(N=E+1),C===-1&&_.length===y&&(C=E+1);if(N===-1)throw new kt(`Failed to find start index for decoration ${JSON.stringify(v.start)}`);if(C===-1)throw new kt(`Failed to find end index for decoration ${JSON.stringify(v.end)}`);const b=w.children.slice(N,C);if(!v.alwaysWrap&&b.length===w.children.length)c(w,v,"line");else if(!v.alwaysWrap&&b.length===1&&b[0].type==="element")c(b[0],v,"token");else{const E={type:"element",tagName:"span",properties:{},children:b};c(E,v,"wrapper"),w.children.splice(N,b.length,E)}}function l(p,m){o[p]=c(o[p],m,"line")}function c(p,m,y){const v=m.properties||{},w=m.transform||(_=>_);return p.tagName=m.tagName||"span",p.properties={...p.properties,...v,class:p.properties.class},m.properties?.class&&Jg(p,m.properties.class),p=w(p,y)||p,p}const f=[],d=i.decorations.sort((p,m)=>m.start.offset-p.start.offset||p.end.offset-m.end.offset);for(const p of d){const{start:m,end:y}=p;if(m.line===y.line)a(m.line,m.character,y.character,p);else if(m.line<y.line){a(m.line,m.character,Number.POSITIVE_INFINITY,p);for(let v=m.line+1;v<y.line;v++)f.unshift(()=>l(v,p));a(y.line,0,y.character,p)}}f.forEach(p=>p())}}}function P1(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new kt(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let i=t+1;i<e.length;i++){const o=e[i],a=n.start.offset<=o.start.offset&&o.start.offset<n.end.offset,l=n.start.offset<o.end.offset&&o.end.offset<=n.end.offset,c=o.start.offset<=n.start.offset&&n.start.offset<o.end.offset,f=o.start.offset<n.end.offset&&n.end.offset<=o.end.offset;if(a||l||c||f){if(a&&l||c&&f||c&&n.start.offset===n.end.offset||l&&o.start.offset===o.end.offset)continue;throw new kt(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function ey(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(ey).join(""):""}const R1=[A1()];function El(e){const t=L1(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...R1]}function L1(e){const t=[],n=[],i=[];for(const o of e)switch(o.enforce){case"pre":t.push(o);break;case"post":n.push(o);break;default:i.push(o)}return{pre:t,post:n,normal:i}}var Fr=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],qu={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function j1(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const i=e.indexOf("m",n);if(i!==-1)return{sequence:e.substring(n+2,i).split(";"),startPosition:n,position:i+1}}return{position:e.length}}function Hp(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(i=>Number.parseInt(i));return n.length!==3||n.some(i=>Number.isNaN(i))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function M1(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const i=Number.parseInt(n);if(!Number.isNaN(i))if(i===0)t.push({type:"resetAll"});else if(i<=9)qu[i]&&t.push({type:"setDecoration",value:qu[i]});else if(i<=29){const o=qu[i-20];o&&(t.push({type:"resetDecoration",value:o}),o==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(i<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Fr[i-30]}});else if(i===38){const o=Hp(e);o&&t.push({type:"setForegroundColor",value:o})}else if(i===39)t.push({type:"resetForegroundColor"});else if(i<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Fr[i-40]}});else if(i===48){const o=Hp(e);o&&t.push({type:"setBackgroundColor",value:o})}else i===49?t.push({type:"resetBackgroundColor"}):i===53?t.push({type:"setDecoration",value:"overline"}):i===55?t.push({type:"resetDecoration",value:"overline"}):i>=90&&i<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Fr[i-90+8]}}):i>=100&&i<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Fr[i-100+8]}})}return t}function O1(){let e=null,t=null,n=new Set;return{parse(i){const o=[];let a=0;do{const l=j1(i,a),c=l.sequence?i.substring(a,l.startPosition):i.substring(a);if(c.length>0&&o.push({value:c,foreground:e,background:t,decorations:new Set(n)}),l.sequence){const f=M1(l.sequence);for(const d of f)d.type==="resetAll"?(e=null,t=null,n.clear()):d.type==="resetForegroundColor"?e=null:d.type==="resetBackgroundColor"?t=null:d.type==="resetDecoration"&&n.delete(d.value);for(const d of f)d.type==="setForegroundColor"?e=d.value:d.type==="setBackgroundColor"?t=d.value:d.type==="setDecoration"&&n.add(d.value)}a=l.position}while(a<i.length);return o}}}var D1={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function $1(e=D1){function t(c){return e[c]}function n(c){return`#${c.map(f=>Math.max(0,Math.min(f,255)).toString(16).padStart(2,"0")).join("")}`}let i;function o(){if(i)return i;i=[];for(let d=0;d<Fr.length;d++)i.push(t(Fr[d]));let c=[0,95,135,175,215,255];for(let d=0;d<6;d++)for(let p=0;p<6;p++)for(let m=0;m<6;m++)i.push(n([c[d],c[p],c[m]]));let f=8;for(let d=0;d<24;d++,f+=10)i.push(n([f,f,f]));return i}function a(c){return o()[c]}function l(c){switch(c.type){case"named":return t(c.name);case"rgb":return n(c.rgb);case"table":return a(c.index)}}return{value:l}}const F1={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function z1(e,t,n){const i=_l(e,n),o=Ol(t),a=Object.fromEntries(Fr.map(f=>{const d=`terminal.ansi${f[0].toUpperCase()}${f.substring(1)}`,p=e.colors?.[d];return[f,p||F1[f]]})),l=$1(a),c=O1();return o.map(f=>c.parse(f[0]).map(d=>{let p,m;d.decorations.has("reverse")?(p=d.background?l.value(d.background):e.bg,m=d.foreground?l.value(d.foreground):e.fg):(p=d.foreground?l.value(d.foreground):e.fg,m=d.background?l.value(d.background):void 0),p=yr(p,i),m=yr(m,i),d.decorations.has("dim")&&(p=B1(p));let y=It.None;return d.decorations.has("bold")&&(y|=It.Bold),d.decorations.has("italic")&&(y|=It.Italic),d.decorations.has("underline")&&(y|=It.Underline),d.decorations.has("strikethrough")&&(y|=It.Strikethrough),{content:d.value,offset:f[1],color:p,bgColor:m,fontStyle:y}}))}function B1(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const i=t[1];if(i.length===8){const o=Math.round(Number.parseInt(i.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${i.slice(0,6)}${o}`}else{if(i.length===6)return`#${i}80`;if(i.length===4){const o=i[0],a=i[1],l=i[2],c=i[3],f=Math.round(Number.parseInt(`${c}${c}`,16)/2).toString(16).padStart(2,"0");return`#${o}${o}${a}${a}${l}${l}${f}`}else if(i.length===3){const o=i[0],a=i[1],l=i[2];return`#${o}${o}${a}${a}${l}${l}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function sf(e,t,n={}){const{theme:i=e.getLoadedThemes()[0]}=n,o=e.resolveLangAlias(n.lang||"text");if(tf(o)||nf(i))return Ol(t).map(f=>[{content:f[0],offset:f[1]}]);const{theme:a,colorMap:l}=e.setTheme(i);if(o==="ansi")return z1(a,t,n);const c=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==c.name)throw new kt(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${c.name}"`);if(!n.grammarState.themes.includes(a.name))throw new kt(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return V1(t,c,a,l,n)}function U1(...e){if(e.length===2)return Rs(e[1]);const[t,n,i={}]=e,{lang:o="text",theme:a=t.getLoadedThemes()[0]}=i;if(tf(o)||nf(a))throw new kt("Plain language does not have grammar state");if(o==="ansi")throw new kt("ANSI language does not have grammar state");const{theme:l,colorMap:c}=t.setTheme(a),f=t.getLanguage(o);return new Ti(of(n,f,l,c,i).stateStack,f.name,l.name)}function V1(e,t,n,i,o){const a=of(e,t,n,i,o),l=new Ti(a.stateStack,t.name,n.name);return Dl(a.tokens,l),a.tokens}function of(e,t,n,i,o){const a=_l(n,o),{tokenizeMaxLineLength:l=0,tokenizeTimeLimit:c=500}=o,f=Ol(e);let d=o.grammarState?T1(o.grammarState,n.name)??Ic:o.grammarContextCode!=null?of(o.grammarContextCode,t,n,i,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:Ic,p=[];const m=[];for(let y=0,v=f.length;y<v;y++){const[w,_]=f[y];if(w===""){p=[],m.push([]);continue}if(l>0&&w.length>=l){p=[],m.push([{content:w,offset:_,color:"",fontStyle:0}]);continue}let N,C,b;o.includeExplanation&&(N=t.tokenizeLine(w,d,c),C=N.tokens,b=0);const E=t.tokenizeLine2(w,d,c),B=E.tokens.length/2;for(let O=0;O<B;O++){const D=E.tokens[2*O],ie=O+1<B?E.tokens[2*O+2]:w.length;if(D===ie)continue;const U=E.tokens[2*O+1],ce=yr(i[Ei.getForeground(U)],a),R=Ei.getFontStyle(U),H={content:w.substring(D,ie),offset:_+D,color:ce,fontStyle:R};if(o.includeExplanation){const J=[];if(o.includeExplanation!=="scopeName")for(const ee of n.settings){let te;switch(typeof ee.scope){case"string":te=ee.scope.split(/,/).map(xe=>xe.trim());break;case"object":te=ee.scope;break;default:continue}J.push({settings:ee,selectors:te.map(xe=>xe.split(/ /))})}H.explanation=[];let fe=0;for(;D+fe<ie;){const ee=C[b],te=w.substring(ee.startIndex,ee.endIndex);fe+=te.length,H.explanation.push({content:te,scopes:o.includeExplanation==="scopeName"?G1(ee.scopes):W1(J,ee.scopes)}),b+=1}}p.push(H)}m.push(p),p=[],d=E.ruleStack}return{tokens:m,stateStack:d}}function G1(e){return e.map(t=>({scopeName:t}))}function W1(e,t){const n=[];for(let i=0,o=t.length;i<o;i++){const a=t[i];n[i]={scopeName:a,themeMatches:q1(e,a,t.slice(0,i))}}return n}function qp(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function H1(e,t,n){if(!qp(e[e.length-1],t))return!1;let i=e.length-2,o=n.length-1;for(;i>=0&&o>=0;)qp(e[i],n[o])&&(i-=1),o-=1;return i===-1}function q1(e,t,n){const i=[];for(const{selectors:o,settings:a}of e)for(const l of o)if(H1(l,t,n)){i.push(a);break}return i}function ty(e,t,n){const i=Object.entries(n.themes).filter(f=>f[1]).map(f=>({color:f[0],theme:f[1]})),o=i.map(f=>{const d=sf(e,t,{...n,theme:f.theme}),p=Rs(d),m=typeof f.theme=="string"?f.theme:f.theme.name;return{tokens:d,state:p,theme:m}}),a=K1(...o.map(f=>f.tokens)),l=a[0].map((f,d)=>f.map((p,m)=>{const y={content:p.content,variants:{},offset:p.offset};return"includeExplanation"in n&&n.includeExplanation&&(y.explanation=p.explanation),a.forEach((v,w)=>{const{content:_,explanation:N,offset:C,...b}=v[d][m];y.variants[i[w].color]=b}),y})),c=o[0].state?new Ti(Object.fromEntries(o.map(f=>[f.theme,f.state?.getInternalStack(f.theme)])),o[0].state.lang):void 0;return c&&Dl(l,c),l}function K1(...e){const t=e.map(()=>[]),n=e.length;for(let i=0;i<e[0].length;i++){const o=e.map(f=>f[i]),a=t.map(()=>[]);t.forEach((f,d)=>f.push(a[d]));const l=o.map(()=>0),c=o.map(f=>f[0]);for(;c.every(f=>f);){const f=Math.min(...c.map(d=>d.content.length));for(let d=0;d<n;d++){const p=c[d];p.content.length===f?(a[d].push(p),l[d]+=1,c[d]=o[d][l[d]]):(a[d].push({...p,content:p.content.slice(0,f)}),c[d]={...p,content:p.content.slice(f),offset:p.offset+f})}}}return t}function Il(e,t,n){let i,o,a,l,c,f;if("themes"in n){const{defaultColor:d="light",cssVariablePrefix:p="--shiki-",colorsRendering:m="css-vars"}=n,y=Object.entries(n.themes).filter(C=>C[1]).map(C=>({color:C[0],theme:C[1]})).sort((C,b)=>C.color===d?-1:b.color===d?1:0);if(y.length===0)throw new kt("`themes` option must not be empty");const v=ty(e,t,n);if(f=Rs(v),d&&rf!==d&&!y.find(C=>C.color===d))throw new kt(`\`themes\` option must contain the defaultColor key \`${d}\``);const w=y.map(C=>e.getTheme(C.theme)),_=y.map(C=>C.color);a=v.map(C=>C.map(b=>I1(b,_,p,d,m))),f&&Dl(a,f);const N=y.map(C=>_l(C.theme,n));o=Kp(y,w,N,p,d,"fg",m),i=Kp(y,w,N,p,d,"bg",m),l=`shiki-themes ${w.map(C=>C.name).join(" ")}`,c=d?void 0:[o,i].join(";")}else if("theme"in n){const d=_l(n.theme,n);a=sf(e,t,n);const p=e.getTheme(n.theme);i=yr(p.bg,d),o=yr(p.fg,d),l=p.name,f=Rs(a)}else throw new kt("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:o,bg:i,themeName:l,rootStyle:c,grammarState:f}}function Kp(e,t,n,i,o,a,l){return e.map((c,f)=>{const d=yr(t[f][a],n[f])||"inherit",p=`${i+c.color}${a==="bg"?"-bg":""}:${d}`;if(f===0&&o){if(o===rf&&e.length>1){const m=e.findIndex(_=>_.color==="light"),y=e.findIndex(_=>_.color==="dark");if(m===-1||y===-1)throw new kt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const v=yr(t[m][a],n[m])||"inherit",w=yr(t[y][a],n[y])||"inherit";return`light-dark(${v}, ${w});${p}`}return d}return l==="css-vars"?p:null}).filter(c=>!!c).join(";")}function Nl(e,t,n,i={meta:{},options:n,codeToHast:(o,a)=>Nl(e,o,a),codeToTokens:(o,a)=>Il(e,o,a)}){let o=t;for(const w of El(n))o=w.preprocess?.call(i,o,n)||o;let{tokens:a,fg:l,bg:c,themeName:f,rootStyle:d,grammarState:p}=Il(e,o,n);const{mergeWhitespaces:m=!0,mergeSameStyleTokens:y=!1}=n;m===!0?a=X1(a):m==="never"&&(a=Y1(a)),y&&(a=J1(a));const v={...i,get source(){return o}};for(const w of El(n))a=w.tokens?.call(v,a)||a;return Q1(a,{...n,fg:l,bg:c,themeName:f,rootStyle:n.rootStyle===!1?!1:n.rootStyle??d},v,p)}function Q1(e,t,n,i=Rs(e)){const o=El(t),a=[],l={type:"root",children:[]},{structure:c="classic",tabindex:f="0"}=t,d={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?d.style=t.rootStyle:d.style=`background-color:${t.bg};color:${t.fg}`),f!==!1&&f!=null&&(d.tabindex=f.toString());for(const[_,N]of Object.entries(t.meta||{}))_.startsWith("_")||(d[_]=N);let p={type:"element",tagName:"pre",properties:d,children:[],data:t.data},m={type:"element",tagName:"code",properties:{},children:a};const y=[],v={...n,structure:c,addClassToHast:Jg,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return l},get pre(){return p},get code(){return m},get lines(){return y}};if(e.forEach((_,N)=>{N&&(c==="inline"?l.children.push({type:"element",tagName:"br",properties:{},children:[]}):c==="classic"&&a.push({type:"text",value:`
24
+ `}));let C={type:"element",tagName:"span",properties:{class:"line"},children:[]},b=0;for(const E of _){let B={type:"element",tagName:"span",properties:{...E.htmlAttrs},children:[{type:"text",value:E.content}]};const O=Rc(E.htmlStyle||bl(E));O&&(B.properties.style=O);for(const D of o)B=D?.span?.call(v,B,N+1,b,C,E)||B;c==="inline"?l.children.push(B):c==="classic"&&C.children.push(B),b+=E.content.length}if(c==="classic"){for(const E of o)C=E?.line?.call(v,C,N+1)||C;y.push(C),a.push(C)}else c==="inline"&&y.push(C)}),c==="classic"){for(const _ of o)m=_?.code?.call(v,m)||m;p.children.push(m);for(const _ of o)p=_?.pre?.call(v,p)||p;l.children.push(p)}else if(c==="inline"){const _=[];let N={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const E of l.children)E.type==="element"&&E.tagName==="br"?(_.push(N),N={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(E.type==="element"||E.type==="text")&&N.children.push(E);_.push(N);let b={type:"element",tagName:"code",properties:{},children:_};for(const E of o)b=E?.code?.call(v,b)||b;l.children=[];for(let E=0;E<b.children.length;E++){E>0&&l.children.push({type:"element",tagName:"br",properties:{},children:[]});const B=b.children[E];B.type==="element"&&l.children.push(...B.children)}}let w=l;for(const _ of o)w=_?.root?.call(v,w)||w;return i&&Dl(w,i),w}function X1(e){return e.map(t=>{const n=[];let i="",o;return t.forEach((a,l)=>{const f=!(a.fontStyle&&(a.fontStyle&It.Underline||a.fontStyle&It.Strikethrough));f&&a.content.match(/^\s+$/)&&t[l+1]?(o===void 0&&(o=a.offset),i+=a.content):i?(f?n.push({...a,offset:o,content:i+a.content}):n.push({content:i,offset:o},a),o=void 0,i=""):n.push(a)}),n})}function Y1(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const i=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!i)return n;const[,o,a,l]=i;if(!o&&!l)return n;const c=[{...n,offset:n.offset+o.length,content:a}];return o&&c.unshift({content:o,offset:n.offset}),l&&c.push({content:l,offset:n.offset+o.length+a.length}),c}))}function J1(e){return e.map(t=>{const n=[];for(const i of t){if(n.length===0){n.push({...i});continue}const o=n[n.length-1],a=Rc(o.htmlStyle||bl(o)),l=Rc(i.htmlStyle||bl(i)),c=o.fontStyle&&(o.fontStyle&It.Underline||o.fontStyle&It.Strikethrough),f=i.fontStyle&&(i.fontStyle&It.Underline||i.fontStyle&It.Strikethrough);!c&&!f&&a===l?o.content+=i.content:n.push({...i})}return n})}const Z1=y1;function eS(e,t,n){const i={meta:{},options:n,codeToHast:(a,l)=>Nl(e,a,l),codeToTokens:(a,l)=>Il(e,a,l)};let o=Z1(Nl(e,t,n,i));for(const a of El(n))o=a.postprocess?.call(i,o,n)||o;return o}const Qp={light:"#333333",dark:"#bbbbbb"},Xp={light:"#fffffe",dark:"#1e1e1e"},Yp="__shiki_resolved";function lf(e){if(e?.[Yp])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:i}=t;if(!n||!i){const c=t.settings?t.settings.find(f=>!f.name&&!f.scope):void 0;c?.settings?.foreground&&(i=c.settings.foreground),c?.settings?.background&&(n=c.settings.background),!i&&t?.colors?.["editor.foreground"]&&(i=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),i||(i=t.type==="light"?Qp.light:Qp.dark),n||(n=t.type==="light"?Xp.light:Xp.dark),t.fg=i,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let o=0;const a=new Map;function l(c){if(a.has(c))return a.get(c);o+=1;const f=`#${o.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${f}`]?l(c):(a.set(c,f),f)}t.settings=t.settings.map(c=>{const f=c.settings?.foreground&&!c.settings.foreground.startsWith("#"),d=c.settings?.background&&!c.settings.background.startsWith("#");if(!f&&!d)return c;const p={...c,settings:{...c.settings}};if(f){const m=l(c.settings.foreground);t.colorReplacements[m]=c.settings.foreground,p.settings.foreground=m}if(d){const m=l(c.settings.background);t.colorReplacements[m]=c.settings.background,p.settings.background=m}return p});for(const c of Object.keys(t.colors||{}))if((c==="editor.foreground"||c==="editor.background"||c.startsWith("terminal.ansi"))&&!t.colors[c]?.startsWith("#")){const f=l(t.colors[c]);t.colorReplacements[f]=t.colors[c],t.colors[c]=f}return Object.defineProperty(t,Yp,{enumerable:!1,writable:!1,value:!0}),t}async function ny(e){return Array.from(new Set((await Promise.all(e.filter(t=>!x1(t)).map(async t=>await Yg(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function ry(e){return(await Promise.all(e.map(async n=>S1(n)?null:lf(await Yg(n))))).filter(n=>!!n)}let tS=3;function nS(e,t=3){t>tS||console.trace(`[SHIKI DEPRECATE]: ${e}`)}class _i extends Error{constructor(t){super(t),this.name="ShikiError"}}function iy(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new _i(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class rS extends o0{constructor(t,n,i,o={}){super(t),this._resolver=t,this._themes=n,this._langs=i,this._alias=o,this._themes.map(a=>this.loadTheme(a)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const n=lf(t);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let n=this._textmateThemeCache.get(t);n||(n=kl.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){return t=iy(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const n=new Set([...this._langMap.values()].filter(a=>a.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const i={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const o=this.loadGrammarWithConfiguration(t.scopeName,1,i);if(o.name=t.name,this._resolvedGrammars.set(t.name,o),t.aliases&&t.aliases.forEach(a=>{this._alias[a]=t.name}),this._loadedLanguagesCache=null,n.size)for(const a of n)this._resolvedGrammars.delete(a.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(a.scopeName),this._syncRegistry?._grammars?.delete(a.scopeName),this.loadLanguage(this._langMap.get(a.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const o of t)this.resolveEmbeddedLanguages(o);const n=Array.from(this._langGraph.entries()),i=n.filter(([o,a])=>!a);if(i.length){const o=n.filter(([a,l])=>l?(l.embeddedLanguages||l.embeddedLangs)?.some(f=>i.map(([d])=>d).includes(f)):!1).filter(a=>!i.includes(a));throw new _i(`Missing languages ${i.map(([a])=>`\`${a}\``).join(", ")}, required by ${o.map(([a])=>`\`${a}\``).join(", ")}`)}for(const[o,a]of n)this._resolver.addLanguage(a);for(const[o,a]of n)this.loadLanguage(a)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);const n=t.embeddedLanguages??t.embeddedLangs;if(n)for(const i of n)this._langGraph.set(i,this._langMap.get(i))}}class iS{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(t,n){this._onigLib={createOnigScanner:i=>t.createScanner(i),createOnigString:i=>t.createString(i)},n.forEach(i=>this.addLanguage(i))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(n=>{this._langs.set(n,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(t.scopeName)})}getInjections(t){const n=t.split(".");let i=[];for(let o=1;o<=n.length;o++){const a=n.slice(0,o).join(".");i=[...i,...this._injections.get(a)||[]]}return i}}let ys=0;function sS(e){ys+=1,e.warnings!==!1&&ys>=10&&ys%10===0&&console.warn(`[Shiki] ${ys} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new _i("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),i=(e.themes||[]).flat(1).map(lf),o=new iS(e.engine,n),a=new rS(o,i,n,e.langAlias);let l;function c(E){return iy(E,e.langAlias)}function f(E){C();const B=a.getGrammar(typeof E=="string"?E:E.name);if(!B)throw new _i(`Language \`${E}\` not found, you may need to load it first`);return B}function d(E){if(E==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};C();const B=a.getTheme(E);if(!B)throw new _i(`Theme \`${E}\` not found, you may need to load it first`);return B}function p(E){C();const B=d(E);l!==E&&(a.setTheme(B),l=E);const O=a.getColorMap();return{theme:B,colorMap:O}}function m(){return C(),a.getLoadedThemes()}function y(){return C(),a.getLoadedLanguages()}function v(...E){C(),a.loadLanguages(E.flat(1))}async function w(...E){return v(await ny(E))}function _(...E){C();for(const B of E.flat(1))a.loadTheme(B)}async function N(...E){return C(),_(await ry(E))}function C(){if(t)throw new _i("Shiki instance has been disposed")}function b(){t||(t=!0,a.dispose(),ys-=1)}return{setTheme:p,getTheme:d,getLanguage:f,getLoadedThemes:m,getLoadedLanguages:y,resolveLangAlias:c,loadLanguage:w,loadLanguageSync:v,loadTheme:N,loadThemeSync:_,dispose:b,[Symbol.dispose]:b}}async function oS(e){e.engine||nS("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,i]=await Promise.all([ry(e.themes||[]),ny(e.langs||[]),e.engine]);return sS({...e,themes:t,langs:n,engine:i})}async function lS(e){const t=await oS(e);return{getLastGrammarState:(...n)=>U1(t,...n),codeToTokensBase:(n,i)=>sf(t,n,i),codeToTokensWithThemes:(n,i)=>ty(t,n,i),codeToTokens:(n,i)=>Il(t,n,i),codeToHast:(n,i)=>Nl(t,n,i),codeToHtml:(n,i)=>eS(t,n,i),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Ai(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function aS(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const af=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),vt=String.raw;function Pi(e,t){if(e==null)throw new Error(t??"Value expected");return e}const sy=vt`\[\^?`,oy=`c.? | C(?:-.?)?|${vt`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${vt`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${vt`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${vt`o\{[^\}]*\}?`}|${vt`\d{1,3}`}`,uf=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,nl=new RegExp(vt`
25
+ \\ (?:
26
+ ${oy}
27
+ | [gk]<[^>]*>?
28
+ | [gk]'[^']*'?
29
+ | .
30
+ )
31
+ | \( (?:
32
+ \? (?:
33
+ [:=!>({]
34
+ | <[=!]
35
+ | <[^>]*>
36
+ | '[^']*'
37
+ | ~\|?
38
+ | #(?:[^)\\]|\\.?)*
39
+ | [^:)]*[:)]
40
+ )?
41
+ | \*[^\)]*\)?
42
+ )?
43
+ | (?:${uf.source})+
44
+ | ${sy}
45
+ | .
46
+ `.replace(/\s+/g,""),"gsu"),Ku=new RegExp(vt`
47
+ \\ (?:
48
+ ${oy}
49
+ | .
50
+ )
51
+ | \[:(?:\^?\p{Alpha}+|\^):\]
52
+ | ${sy}
53
+ | &&
54
+ | .
55
+ `.replace(/\s+/g,""),"gsu");function uS(e,t={}){const n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const i=NS(n.flags),o=[i.extended],a={captureGroup:n.rules.captureGroup,getCurrentModX(){return o.at(-1)},numOpenGroups:0,popModX(){o.pop()},pushModX(m){o.push(m)},replaceCurrentModX(m){o[o.length-1]=m},singleline:n.rules.singleline};let l=[],c;for(nl.lastIndex=0;c=nl.exec(e);){const m=cS(a,e,c[0],nl.lastIndex);m.tokens?l.push(...m.tokens):m.token&&l.push(m.token),m.lastIndex!==void 0&&(nl.lastIndex=m.lastIndex)}const f=[];let d=0;l.filter(m=>m.type==="GroupOpen").forEach(m=>{m.kind==="capturing"?m.number=++d:m.raw==="("&&f.push(m)}),d||f.forEach((m,y)=>{m.kind="capturing",m.number=y+1});const p=d||f.length;return{tokens:l.map(m=>m.type==="EscapedNumber"?AS(m,p):m).flat(),flags:i}}function cS(e,t,n,i){const[o,a]=n;if(n==="["||n==="[^"){const l=fS(t,n,i);return{tokens:l.tokens,lastIndex:l.lastIndex}}if(o==="\\"){if("AbBGyYzZ".includes(a))return{token:Jp(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:xS(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:ay(n)}}if(a==="K")return{token:uy("keep",n)};if(a==="N"||a==="R")return{token:zr("newline",n,{negate:a==="N"})};if(a==="O")return{token:zr("any",n)};if(a==="X")return{token:zr("text_segment",n)};const l=ly(n,{inCharClass:!1});return Array.isArray(l)?{tokens:l}:{token:l}}if(o==="("){if(a==="*")return{token:bS(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[i]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:i+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:_S(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:xi("group",n)};if(n==="(?>")return{token:xi("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:xi(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:xi("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:xi("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:kS(n)}}if(e.getCurrentModX()){if(n==="#"){const l=t.indexOf(`
56
+ `,i);return{lastIndex:l===-1?t.length:l}}if(/^\s$/.test(n)){const l=/\s+/y;return l.lastIndex=i,{lastIndex:l.exec(t)?l.lastIndex:i}}}if(n===".")return{token:zr("dot",n)};if(n==="^"||n==="$"){const l=e.singleline?{"^":vt`\A`,$:vt`\Z`}[n]:n;return{token:Jp(l,n)}}return n==="|"?{token:hS(n)}:uf.test(n)?{tokens:PS(n)}:{token:Hn(Ai(n),n)}}function fS(e,t,n){const i=[Zp(t[1]==="^",t)];let o=1,a;for(Ku.lastIndex=n;a=Ku.exec(e);){const l=a[0];if(l[0]==="["&&l[1]!==":")o++,i.push(Zp(l[1]==="^",l));else if(l==="]"){if(i.at(-1).type==="CharacterClassOpen")i.push(Hn(93,l));else if(o--,i.push(pS(l)),!o)break}else{const c=dS(l);Array.isArray(c)?i.push(...c):i.push(c)}}return{tokens:i,lastIndex:Ku.lastIndex||e.length}}function dS(e){if(e[0]==="\\")return ly(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!af.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return zr("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?mS(e):e==="&&"?gS(e):Hn(Ai(e),e)}function ly(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return CS(e);if("dDhHsSwW".includes(n))return ES(e);if(e.startsWith(vt`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return IS(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const i=e.split(/\\x/).slice(1).map(l=>parseInt(l,16)),o=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(i)),a=new TextEncoder;return[...o].map(l=>{const c=[...a.encode(l)].map(f=>`\\x${f.toString(16)}`).join("");return Hn(Ai(l),c)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Hn(TS(e),e);if(em.has(n))return Hn(em.get(n),e);if(/\d/.test(n))return yS(t,e);if(e==="\\")throw new Error(vt`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Hn(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function hS(e){return{type:"Alternator",raw:e}}function Jp(e,t){return{type:"Assertion",kind:e,raw:t}}function ay(e){return{type:"Backreference",raw:e}}function Hn(e,t){return{type:"Character",value:e,raw:t}}function pS(e){return{type:"CharacterClassClose",raw:e}}function mS(e){return{type:"CharacterClassHyphen",raw:e}}function gS(e){return{type:"CharacterClassIntersector",raw:e}}function Zp(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function zr(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function uy(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Pi(n.flags),raw:t}}function yS(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function kS(e){return{type:"GroupClose",raw:e}}function xi(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function vS(e,t,n,i){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:i}}function wS(e,t,n,i){return{type:"Quantifier",kind:e,min:t,max:n,raw:i}}function xS(e){return{type:"Subroutine",raw:e}}const SS=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),em=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function CS(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return Hn(Ai(t.toUpperCase())-64,e)}function _S(e,t){let{on:n,off:i}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;i??="";const o=(t.getCurrentModX()||n.includes("x"))&&!i.includes("x"),a=nm(n),l=nm(i),c={};if(a&&(c.enable=a),l&&(c.disable=l),e.endsWith(")"))return t.replaceCurrentModX(o),uy("flags",e,{flags:c});if(e.endsWith(":"))return t.pushModX(o),t.numOpenGroups++,xi("group",e,{...(a||l)&&{flags:c}});throw new Error(`Unexpected flag modifier "${e}"`)}function bS(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:i,args:o}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(i==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const a=o?o.split(",").filter(p=>p!=="").map(p=>/^[+-]?\d+$/.test(p)?+p:p):[],[l,c,f]=a,d=SS.has(n)?n.toLowerCase():"custom";switch(d){case"fail":case"mismatch":case"skip":if(a.length>0)throw new Error(`Named callout arguments not allowed "${a}"`);break;case"error":if(a.length>1)throw new Error(`Named callout allows only one argument "${a}"`);if(typeof l=="string")throw new Error(`Named callout argument must be a number "${l}"`);break;case"max":if(!a.length||a.length>2)throw new Error(`Named callout must have one or two arguments "${a}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument one must be a tag or number "${l}"`);if(a.length===2&&(typeof c=="number"||!/^[<>X]$/.test(c)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${c}"`);break;case"count":case"total_count":if(a.length>1)throw new Error(`Named callout allows only one argument "${a}"`);if(a.length===1&&(typeof l=="number"||!/^[<>X]$/.test(l)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${l}"`);break;case"cmp":if(a.length!==3)throw new Error(`Named callout must have three arguments "${a}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument one must be a tag or number "${l}"`);if(typeof c=="number"||!/^(?:[<>!=]=|[<>])$/.test(c))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${c}"`);if(typeof f=="string"&&!/^[A-Za-z_]\w*$/.test(f))throw new Error(`Named callout argument three must be a tag or number "${f}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${d}"`)}return vS(d,i??null,o?.split(",")??null,e)}function tm(e){let t=null,n,i;if(e[0]==="{"){const{minStr:o,maxStr:a}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,l=1e5;if(+o>l||a&&+a>l)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+o,i=a===void 0?+o:a===""?1/0:+a,n>i&&(t="possessive",[n,i]=[i,n]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=e[0]==="+"?1:0,i=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return wS(t,n,i,e)}function ES(e){const t=e[1].toLowerCase();return zr({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function IS(e){const{p:t,neg:n,value:i}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return zr("property",e,{value:i,negate:t==="P"&&!n||t==="p"&&!!n})}function nm(e){const t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function NS(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){const i=e[n];if(!"imxDPSWy".includes(i))throw new Error(`Invalid flag "${i}"`);if(i==="y"){if(!/^y{[gw]}/.test(e.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[n+2]==="g"?"grapheme":"word",n+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[i]]=!0}return t}function TS(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function AS(e,t){const{raw:n,inCharClass:i}=e,o=n.slice(1);if(!i&&(o!=="0"&&o.length===1||o[0]!=="0"&&+o<=t))return[ay(n)];const a=[],l=o.match(/^[0-7]+|\d/g);for(let c=0;c<l.length;c++){const f=l[c];let d;if(c===0&&f!=="8"&&f!=="9"){if(d=parseInt(f,8),d>127)throw new Error(vt`Octal encoded byte above 177 unsupported "${n}"`)}else d=Ai(f);a.push(Hn(d,(c===0?"\\":"")+f))}return a}function PS(e){const t=[],n=new RegExp(uf,"gy");let i;for(;i=n.exec(e);){const o=i[0];if(o[0]==="{"){const a=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(o);if(a){const{min:l,max:c}=a.groups;if(+l>+c&&o.endsWith("?")){n.lastIndex--,t.push(tm(o.slice(0,-1)));continue}}}t.push(tm(o))}return t}function cy(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const n=e.body[0];return!t||Object.keys(t).every(i=>t[i]===n[i])}function RS(e){return LS.has(e.type)}const LS=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function fy(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},i=uS(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),o=(y,v)=>{const w=i.tokens[a.nextIndex];switch(a.parent=y,a.nextIndex++,w.type){case"Alternator":return Vr();case"Assertion":return jS(w);case"Backreference":return MS(w,a);case"Character":return $l(w.value,{useLastValid:!!v.isCheckingRangeEnd});case"CharacterClassHyphen":return OS(w,a,v);case"CharacterClassOpen":return DS(w,a,v);case"CharacterSet":return $S(w,a);case"Directive":return GS(w.kind,{flags:w.flags});case"GroupOpen":return FS(w,a,v);case"NamedCallout":return HS(w.kind,w.tag,w.arguments);case"Quantifier":return zS(w,a);case"Subroutine":return BS(w,a);default:throw new Error(`Unexpected token type "${w.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:i.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:o},l=KS(WS(i.flags));let c=l.body[0];for(;a.nextIndex<i.tokens.length;){const y=o(c,{});y.type==="Alternative"?(l.body.push(y),c=y):c.body.push(y)}const{capturingGroups:f,hasNumberedRef:d,namedGroupsByName:p,subroutines:m}=a;if(d&&p.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:y}of m)if(typeof y=="number"){if(y>f.length)throw new Error("Subroutine uses a group number that's not defined");y&&(f[y-1].isSubroutined=!0)}else if(p.has(y)){if(p.get(y).length>1)throw new Error(vt`Subroutine uses a duplicate group name "\g<${y}>"`);p.get(y)[0].isSubroutined=!0}else throw new Error(vt`Subroutine uses a group name that's not defined "\g<${y}>"`);return l}function jS({kind:e}){return Lc(Pi({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===vt`\B`||e===vt`\Y`})}function MS({raw:e},t){const n=/^\\k[<']/.test(e),i=n?e.slice(3,-1):e.slice(1),o=(a,l=!1)=>{const c=t.capturingGroups.length;let f=!1;if(a>c)if(t.skipBackrefValidation)f=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,jc(l?c+1-a:a,{orphan:f})};if(n){const a=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(i);if(a)return o(+a.groups.num,!!a.groups.sign);if(/[-+]/.test(i))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(i))throw new Error(`Group name not defined to the left "${e}"`);return jc(i)}return o(+i)}function OS(e,t,n){const{tokens:i,walk:o}=t,a=t.parent,l=a.body.at(-1),c=i[t.nextIndex];if(!n.isCheckingRangeEnd&&l&&l.type!=="CharacterClass"&&l.type!=="CharacterClassRange"&&c&&c.type!=="CharacterClassOpen"&&c.type!=="CharacterClassClose"&&c.type!=="CharacterClassIntersector"){const f=o(a,{...n,isCheckingRangeEnd:!0});if(l.type==="Character"&&f.type==="Character")return a.body.pop(),VS(l,f);throw new Error("Invalid character class range")}return $l(Ai("-"))}function DS({negate:e},t,n){const{tokens:i,walk:o}=t,a=[pl()],l=i[t.nextIndex];let c=sm(l);for(;c.type!=="CharacterClassClose";){if(c.type==="CharacterClassIntersector")a.push(pl()),t.nextIndex++;else{const d=a.at(-1);d.body.push(o(d,n))}c=sm(i[t.nextIndex],l)}const f=pl({negate:e});return a.length===1?f.body=a[0].body:(f.kind="intersection",f.body=a.map(d=>d.body.length===1?d.body[0]:d)),t.nextIndex++,f}function $S({kind:e,negate:t,value:n},i){const{normalizeUnknownPropertyNames:o,skipPropertyNameValidation:a,unicodePropertyMap:l}=i;if(e==="property"){const c=Fl(n);if(af.has(c)&&!l?.has(c))e="posix",n=c;else return Si(n,{negate:t,normalizeUnknownPropertyNames:o,skipPropertyNameValidation:a,unicodePropertyMap:l})}return e==="posix"?qS(n,{negate:t}):Mc(e,{negate:t})}function FS(e,t,n){const{tokens:i,capturingGroups:o,namedGroupsByName:a,skipLookbehindValidation:l,walk:c}=t,f=QS(e),d=f.type==="AbsenceFunction",p=im(f),m=p&&f.negate;if(f.type==="CapturingGroup"&&(o.push(f),f.name&&aS(a,f.name,[]).push(f)),d&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let y=om(i[t.nextIndex]);for(;y.type!=="GroupClose";){if(y.type==="Alternator")f.body.push(Vr()),t.nextIndex++;else{const v=f.body.at(-1),w=c(v,{...n,isInAbsenceFunction:n.isInAbsenceFunction||d,isInLookbehind:n.isInLookbehind||p,isInNegLookbehind:n.isInNegLookbehind||m});if(v.body.push(w),(p||n.isInLookbehind)&&!l){const _="Lookbehind includes a pattern not allowed by Oniguruma";if(m||n.isInNegLookbehind){if(rm(w)||w.type==="CapturingGroup")throw new Error(_)}else if(rm(w)||im(w)&&w.negate)throw new Error(_)}}y=om(i[t.nextIndex])}return t.nextIndex++,f}function zS({kind:e,min:t,max:n},i){const o=i.parent,a=o.body.at(-1);if(!a||!RS(a))throw new Error("Quantifier requires a repeatable token");const l=hy(e,t,n,a);return o.body.pop(),l}function BS({raw:e},t){const{capturingGroups:n,subroutines:i}=t;let o=e.slice(3,-1);const a=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(o);if(a){const c=+a.groups.num,f=n.length;if(t.hasNumberedRef=!0,o={"":c,"+":f+c,"-":f+1-c}[a.groups.sign],o<1)throw new Error("Invalid subroutine number")}else o==="0"&&(o=0);const l=py(o);return i.push(l),l}function US(e,t){return{type:"AbsenceFunction",kind:e,body:Fs(t?.body)}}function Vr(e){return{type:"Alternative",body:my(e?.body)}}function Lc(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function jc(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function dy(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!XS(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:Fs(t?.body)}}function $l(e,t){const n={useLastValid:!1,...t};if(e>1114111){const i=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${i}}"`):new Error(`Invalid code point out of range in JS "\\x{${i}}"`)}return{type:"Character",value:e}}function pl(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:my(e?.body)}}function VS(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Mc(e,t){const n=!!t?.negate,i={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(i.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(i.variableLength=!0),i}function GS(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:Pi(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function WS(e){return{type:"Flags",...e}}function wn(e){const t=e?.atomic,n=e?.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:Fs(e?.body)}}function Dr(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:Fs(e?.body)}}function HS(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function qS(e,t){const n=!!t?.negate;if(!af.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function hy(e,t,n,i){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:i}}function KS(e,t){return{type:"Regex",body:Fs(t?.body),flags:e}}function py(e){return{type:"Subroutine",ref:e}}function Si(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let i=n.unicodePropertyMap?.get(Fl(e));if(!i){if(n.normalizeUnknownPropertyNames)i=YS(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(vt`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:i??e,negate:n.negate}}function QS({flags:e,kind:t,name:n,negate:i,number:o}){switch(t){case"absence_repeater":return US("repeater");case"atomic":return wn({atomic:!0});case"capturing":return dy(o,{name:n});case"group":return wn({flags:e});case"lookahead":case"lookbehind":return Dr({behind:t==="lookbehind",negate:i});default:throw new Error(`Unexpected group kind "${t}"`)}}function Fs(e){if(e===void 0)e=[Vr()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function my(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function rm(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function im(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function XS(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function YS(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function Fl(e){return e.replace(/[- _]+/g,"").toLowerCase()}function sm(e,t){const n=t;return Pi(e,`Unclosed character class${n?.type==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function om(e){return Pi(e,"Unclosed group")}function bs(e,t,n=null){function i(a,l){for(let c=0;c<a.length;c++){const f=o(a[c],l,c,a);c=Math.max(-1,c+f)}}function o(a,l=null,c=null,f=null){let d=0,p=!1;const m={node:a,parent:l,key:c,container:f,root:e,remove(){rl(f).splice(Math.max(0,yi(c)+d),1),d--,p=!0},removeAllNextSiblings(){return rl(f).splice(yi(c)+1)},removeAllPrevSiblings(){const C=yi(c)+d;return d-=C,rl(f).splice(0,Math.max(0,C))},replaceWith(C,b={}){const E=!!b.traverse;f?f[Math.max(0,yi(c)+d)]=C:Pi(l,"Can't replace root node")[c]=C,E&&o(C,l,c,f),p=!0},replaceWithMultiple(C,b={}){const E=!!b.traverse;if(rl(f).splice(Math.max(0,yi(c)+d),1,...C),d+=C.length-1,E){let B=0;for(let O=0;O<C.length;O++)B+=o(C[O],l,yi(c)+O+B,f)}p=!0},skip(){p=!0}},{type:y}=a,v=t["*"],w=t[y],_=typeof v=="function"?v:v?.enter,N=typeof w=="function"?w:w?.enter;if(_?.(m,n),N?.(m,n),!p)switch(y){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":i(a.body,a);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":o(a.min,a,"min"),o(a.max,a,"max");break;case"Quantifier":o(a.body,a,"body");break;case"Regex":i(a.body,a),o(a.flags,a,"flags");break;default:throw new Error(`Unexpected node type "${y}"`)}return w?.exit?.(m,n),v?.exit?.(m,n),d}return o(e),e}function rl(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function yi(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const JS=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function ZS(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function eC(e,t,n,i){return e.slice(0,t)+i+e.slice(t+n.length)}const cn=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function cf(e,t,n,i){const o=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),a=[!1];let l=0,c="";for(const f of e.matchAll(o)){const{0:d,groups:{$skip:p}}=f;if(!p&&(!i||i===cn.DEFAULT==!l)){n instanceof Function?c+=n(f,{context:l?cn.CHAR_CLASS:cn.DEFAULT,negated:a[a.length-1]}):c+=n;continue}d[0]==="["?(l++,a.push(d[1]==="^")):d==="]"&&l&&(l--,a.pop()),c+=d}return c}function gy(e,t,n,i){cf(e,t,n,i)}function tC(e,t,n=0,i){if(!new RegExp(t,"su").test(e))return null;const o=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");o.lastIndex=n;let a=0,l;for(;l=o.exec(e);){const{0:c,groups:{$skip:f}}=l;if(!f&&(!i||i===cn.DEFAULT==!a))return l;c==="["?a++:c==="]"&&a&&a--,o.lastIndex==l.index&&o.lastIndex++}return null}function il(e,t,n){return!!tC(e,t,0,n)}function nC(e,t){const n=/\\?./gsu;n.lastIndex=t;let i=e.length,o=0,a=1,l;for(;l=n.exec(e);){const[c]=l;if(c==="[")o++;else if(o)c==="]"&&o--;else if(c==="(")a++;else if(c===")"&&(a--,!a)){i=l.index;break}}return e.slice(t,i)}const lm=new RegExp(String.raw`(?<noncapturingStart>${JS})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function rC(e,t){const n=t?.hiddenCaptures??[];let i=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};const o="(?>",a="(?:(?=(",l=[0],c=[];let f=0,d=0,p=NaN,m;do{m=!1;let y=0,v=0,w=!1,_;for(lm.lastIndex=Number.isNaN(p)?0:p+a.length;_=lm.exec(e);){const{0:N,index:C,groups:{capturingStart:b,noncapturingStart:E}}=_;if(N==="[")y++;else if(y)N==="]"&&y--;else if(N===o&&!w)p=C,w=!0;else if(w&&E)v++;else if(b)w?v++:(f++,l.push(f+d));else if(N===")"&&w){if(!v){d++;const B=f+d;if(e=`${e.slice(0,p)}${a}${e.slice(p+o.length,C)}))<$$${B}>)${e.slice(C+1)}`,m=!0,c.push(B),ZS(n,B),i.size){const O=new Map;i.forEach((D,ie)=>{O.set(ie>=B?ie+1:ie,D.map(U=>U>=B?U+1:U))}),i=O}break}v--}}}while(m);return n.push(...c),e=cf(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:y,groups:{backrefNum:v,wrappedBackrefNum:w}})=>{if(v){const _=+v;if(_>l.length-1)throw new Error(`Backref "${y}" greater than number of captures`);return`\\${l[_]}`}return`\\${w}`},cn.DEFAULT),{pattern:e,captureTransfers:i,hiddenCaptures:n}}const yy=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Qu=new RegExp(String.raw`
57
+ \\(?: \d+
58
+ | c[A-Za-z]
59
+ | [gk]<[^>]+>
60
+ | [pPu]\{[^\}]+\}
61
+ | u[A-Fa-f\d]{4}
62
+ | x[A-Fa-f\d]{2}
63
+ )
64
+ | \((?: \? (?: [:=!>]
65
+ | <(?:[=!]|[^>]+>)
66
+ | [A-Za-z\-]+:
67
+ | \(DEFINE\)
68
+ ))?
69
+ | (?<qBase>${yy})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
70
+ | \\?.
71
+ `.replace(/\s+/g,""),"gsu");function iC(e){if(!new RegExp(`${yy}\\+`).test(e))return{pattern:e};const t=[];let n=null,i=null,o="",a=0,l;for(Qu.lastIndex=0;l=Qu.exec(e);){const{0:c,index:f,groups:{qBase:d,qMod:p,invalidQ:m}}=l;if(c==="[")a||(i=f),a++;else if(c==="]")a?a--:i=null;else if(!a)if(p==="+"&&o&&!o.startsWith("(")){if(m)throw new Error(`Invalid quantifier "${c}"`);let y=-1;if(/^\{\d+\}$/.test(d))e=eC(e,f+d.length,p,"");else{if(o===")"||o==="]"){const v=o===")"?n:i;if(v===null)throw new Error(`Invalid unmatched "${o}"`);e=`${e.slice(0,v)}(?>${e.slice(v,f)}${d})${e.slice(f+c.length)}`}else e=`${e.slice(0,f-o.length)}(?>${o}${d})${e.slice(f+c.length)}`;y+=4}Qu.lastIndex+=y}else c[0]==="("?t.push(f):c===")"&&(n=t.length?t.pop():null);o=c}return{pattern:e}}const un=String.raw,sC=un`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Oc=un`\(\?R=(?<rDepth>[^\)]+)\)|${sC}`,zl=un`\(\?<(?![=!])(?<captureName>[^>]+)>`,ky=un`${zl}|(?<unnamed>\()(?!\?)`,Lr=new RegExp(un`${zl}|${Oc}|\(\?|\\?.`,"gsu"),Xu="Cannot use multiple overlapping recursions";function oC(e,t){const{hiddenCaptures:n,mode:i}={hiddenCaptures:[],mode:"plugin",...t};let o=t?.captureTransfers??new Map;if(!new RegExp(Oc,"su").test(e))return{pattern:e,captureTransfers:o,hiddenCaptures:n};if(i==="plugin"&&il(e,un`\(\?\(DEFINE\)`,cn.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const a=[],l=il(e,un`\\[1-9]`,cn.DEFAULT),c=new Map,f=[];let d=!1,p=0,m=0,y;for(Lr.lastIndex=0;y=Lr.exec(e);){const{0:v,groups:{captureName:w,rDepth:_,gRNameOrNum:N,gRDepth:C}}=y;if(v==="[")p++;else if(p)v==="]"&&p--;else if(_){if(am(_),d)throw new Error(Xu);if(l)throw new Error(`${i==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const b=e.slice(0,y.index),E=e.slice(Lr.lastIndex);if(il(E,Oc,cn.DEFAULT))throw new Error(Xu);const B=+_-1;e=um(b,E,B,!1,n,a,m),o=fm(o,b,B,a.length,0,m);break}else if(N){am(C);let b=!1;for(const J of f)if(J.name===N||J.num===+N){if(b=!0,J.hasRecursedWithin)throw new Error(Xu);break}if(!b)throw new Error(un`Recursive \g cannot be used outside the referenced group "${i==="external"?N:un`\g<${N}&R=${C}>`}"`);const E=c.get(N),B=nC(e,E);if(l&&il(B,un`${zl}|\((?!\?)`,cn.DEFAULT))throw new Error(`${i==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const O=e.slice(E,y.index),D=B.slice(O.length+v.length),ie=a.length,U=+C-1,ce=um(O,D,U,!0,n,a,m);o=fm(o,O,U,a.length-ie,ie,m);const R=e.slice(0,E),H=e.slice(E+B.length);e=`${R}${ce}${H}`,Lr.lastIndex+=ce.length-v.length-O.length-D.length,f.forEach(J=>J.hasRecursedWithin=!0),d=!0}else if(w)m++,c.set(String(m),Lr.lastIndex),c.set(w,Lr.lastIndex),f.push({num:m,name:w});else if(v[0]==="("){const b=v==="(";b&&(m++,c.set(String(m),Lr.lastIndex)),f.push(b?{num:m}:{})}else v===")"&&f.pop()}return n.push(...a),{pattern:e,captureTransfers:o,hiddenCaptures:n}}function am(e){const t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if(e=+e,e<2||e>100)throw new Error(t)}function um(e,t,n,i,o,a,l){const c=new Set;i&&gy(e+t,zl,({groups:{captureName:d}})=>{c.add(d)},cn.DEFAULT);const f=[n,i?c:null,o,a,l];return`${e}${cm(`(?:${e}`,"forward",...f)}(?:)${cm(`${t})`,"backward",...f)}${t}`}function cm(e,t,n,i,o,a,l){const f=p=>t==="forward"?p+2:n-p+2-1;let d="";for(let p=0;p<n;p++){const m=f(p);d+=cf(e,un`${ky}|\\k<(?<backref>[^>]+)>`,({0:y,groups:{captureName:v,unnamed:w,backref:_}})=>{if(_&&i&&!i.has(_))return y;const N=`_$${m}`;if(w||v){const C=l+a.length+1;return a.push(C),lC(o,C),w?y:`(?<${v}${N}>`}return un`\k<${_}${N}>`},cn.DEFAULT)}return d}function lC(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function fm(e,t,n,i,o,a){if(e.size&&i){let l=0;gy(t,ky,()=>l++,cn.DEFAULT);const c=a-l+o,f=new Map;return e.forEach((d,p)=>{const m=(i-l*n)/n,y=l*n,v=p>c+l?p+i:p,w=[];for(const _ of d)if(_<=c)w.push(_);else if(_>c+l+m)w.push(_+i);else if(_<=c+l)for(let N=0;N<=n;N++)w.push(_+l*N);else for(let N=0;N<=n;N++)w.push(_+y+m*N);f.set(v,w)}),f}return e}var dt=String.fromCodePoint,Ae=String.raw,xn={},Bl=globalThis.RegExp;xn.flagGroups=(()=>{try{new Bl("(?i:)")}catch{return!1}return!0})();xn.unicodeSets=(()=>{try{new Bl("[[]]","v")}catch{return!1}return!0})();xn.bugFlagVLiteralHyphenIsRange=xn.unicodeSets?(()=>{try{new Bl(Ae`[\d\-a]`,"v")}catch{return!0}return!1})():!1;xn.bugNestedClassIgnoresNegation=xn.unicodeSets&&new Bl("[[^a]]","v").test("a");function Tl(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function Ls(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Dc(e,t){return dm[e]>=dm[t]}function aC(e,t){if(e==null)throw new Error(t??"Value expected");return e}var dm={ES2025:2025,ES2024:2024,ES2018:2018},uC={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function vy(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!uC[e.target])throw new Error(`Unexpected target "${e.target}"`);const t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target==="auto"&&(t.target=xn.flagGroups?"ES2025":xn.unicodeSets?"ES2024":"ES2018"),t}var cC="[ -\r ]",fC=new Set([dt(304),dt(305)]),Gn=Ae`[\p{L}\p{M}\p{N}\p{Pc}]`;function wy(e){if(fC.has(e))return[e];const t=new Set,n=e.toLowerCase(),i=n.toUpperCase(),o=pC.get(n),a=dC.get(n),l=hC.get(n);return[...i].length===1&&t.add(i),l&&t.add(l),o&&t.add(o),t.add(n),a&&t.add(a),[...t]}var ff=new Map(`C Other
72
+ Cc Control cntrl
73
+ Cf Format
74
+ Cn Unassigned
75
+ Co Private_Use
76
+ Cs Surrogate
77
+ L Letter
78
+ LC Cased_Letter
79
+ Ll Lowercase_Letter
80
+ Lm Modifier_Letter
81
+ Lo Other_Letter
82
+ Lt Titlecase_Letter
83
+ Lu Uppercase_Letter
84
+ M Mark Combining_Mark
85
+ Mc Spacing_Mark
86
+ Me Enclosing_Mark
87
+ Mn Nonspacing_Mark
88
+ N Number
89
+ Nd Decimal_Number digit
90
+ Nl Letter_Number
91
+ No Other_Number
92
+ P Punctuation punct
93
+ Pc Connector_Punctuation
94
+ Pd Dash_Punctuation
95
+ Pe Close_Punctuation
96
+ Pf Final_Punctuation
97
+ Pi Initial_Punctuation
98
+ Po Other_Punctuation
99
+ Ps Open_Punctuation
100
+ S Symbol
101
+ Sc Currency_Symbol
102
+ Sk Modifier_Symbol
103
+ Sm Math_Symbol
104
+ So Other_Symbol
105
+ Z Separator
106
+ Zl Line_Separator
107
+ Zp Paragraph_Separator
108
+ Zs Space_Separator
109
+ ASCII
110
+ ASCII_Hex_Digit AHex
111
+ Alphabetic Alpha
112
+ Any
113
+ Assigned
114
+ Bidi_Control Bidi_C
115
+ Bidi_Mirrored Bidi_M
116
+ Case_Ignorable CI
117
+ Cased
118
+ Changes_When_Casefolded CWCF
119
+ Changes_When_Casemapped CWCM
120
+ Changes_When_Lowercased CWL
121
+ Changes_When_NFKC_Casefolded CWKCF
122
+ Changes_When_Titlecased CWT
123
+ Changes_When_Uppercased CWU
124
+ Dash
125
+ Default_Ignorable_Code_Point DI
126
+ Deprecated Dep
127
+ Diacritic Dia
128
+ Emoji
129
+ Emoji_Component EComp
130
+ Emoji_Modifier EMod
131
+ Emoji_Modifier_Base EBase
132
+ Emoji_Presentation EPres
133
+ Extended_Pictographic ExtPict
134
+ Extender Ext
135
+ Grapheme_Base Gr_Base
136
+ Grapheme_Extend Gr_Ext
137
+ Hex_Digit Hex
138
+ IDS_Binary_Operator IDSB
139
+ IDS_Trinary_Operator IDST
140
+ ID_Continue IDC
141
+ ID_Start IDS
142
+ Ideographic Ideo
143
+ Join_Control Join_C
144
+ Logical_Order_Exception LOE
145
+ Lowercase Lower
146
+ Math
147
+ Noncharacter_Code_Point NChar
148
+ Pattern_Syntax Pat_Syn
149
+ Pattern_White_Space Pat_WS
150
+ Quotation_Mark QMark
151
+ Radical
152
+ Regional_Indicator RI
153
+ Sentence_Terminal STerm
154
+ Soft_Dotted SD
155
+ Terminal_Punctuation Term
156
+ Unified_Ideograph UIdeo
157
+ Uppercase Upper
158
+ Variation_Selector VS
159
+ White_Space space
160
+ XID_Continue XIDC
161
+ XID_Start XIDS`.split(/\s/).map(e=>[Fl(e),e])),dC=new Map([["s",dt(383)],[dt(383),"s"]]),hC=new Map([[dt(223),dt(7838)],[dt(107),dt(8490)],[dt(229),dt(8491)],[dt(969),dt(8486)]]),pC=new Map([pr(453),pr(456),pr(459),pr(498),...Yu(8072,8079),...Yu(8088,8095),...Yu(8104,8111),pr(8124),pr(8140),pr(8188)]),mC=new Map([["alnum",Ae`[\p{Alpha}\p{Nd}]`],["alpha",Ae`\p{Alpha}`],["ascii",Ae`\p{ASCII}`],["blank",Ae`[\p{Zs}\t]`],["cntrl",Ae`\p{Cc}`],["digit",Ae`\p{Nd}`],["graph",Ae`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",Ae`\p{Lower}`],["print",Ae`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",Ae`[\p{P}\p{S}]`],["space",Ae`\p{space}`],["upper",Ae`\p{Upper}`],["word",Ae`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",Ae`\p{AHex}`]]);function gC(e,t){const n=[];for(let i=e;i<=t;i++)n.push(i);return n}function pr(e){const t=dt(e);return[t.toLowerCase(),t]}function Yu(e,t){return gC(e,t).map(n=>pr(n))}var xy=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function yC(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};Sy(e);const i={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Dc(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};bs(e,kC,i);const o={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:o,prevFlags:null,globalFlags:o,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:i.subroutineRefMap};bs(e,vC,a);const l={groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer};return bs(e,wC,l),e._originMap=a.groupOriginByCopy,e._strategy=i.strategy,e}var kC={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:i,kind:o}=e;if(o==="repeater"){const a=wn();a.body[0].body.push(Dr({negate:!0,body:i}),Si("Any"));const l=wn();l.body[0].body.push(hy("greedy",0,1/0,a)),n(it(l,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:i}){const o=e.body.filter(a=>a.kind==="flags");for(let a=n+1;a<t.body.length;a++){const l=t.body[a];Ls(i,l,[]).push(...o)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const n=_y(t.get(e));if(n){const i=wn({flags:n});i.body[0].body=e.body,e.body=[it(i,e)]}}}},Assertion({node:e,parent:t,key:n,container:i,root:o,remove:a,replaceWith:l},c){const{kind:f,negate:d}=e,{asciiWordBoundaries:p,avoidSubclass:m,supportedGNodes:y,wordIsAscii:v}=c;if(f==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${d?"Y":"y"}"`);if(f==="line_end")l(it(Dr({body:[Vr({body:[Lc("string_end")]}),Vr({body:[$l(10)]})]}),t));else if(f==="line_start")l(it(Wn(Ae`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(f==="search_start")if(y.has(e))o.flags.sticky=!0,a();else{const w=i[n-1];if(w&&EC(w))l(it(Dr({negate:!0}),t));else{if(m)throw new Error(Ae`Uses "\G" in a way that requires a subclass`);l(mr(Lc("string_start"),t)),c.strategy="clip_search"}}else if(!(f==="string_end"||f==="string_start"))if(f==="string_end_newline")l(it(Wn(Ae`(?=\n?\z)`),t));else if(f==="word_boundary"){if(!v&&!p){const w=`(?:(?<=${Gn})(?!${Gn})|(?<!${Gn})(?=${Gn}))`,_=`(?:(?<=${Gn})(?=${Gn})|(?<!${Gn})(?!${Gn}))`;l(it(Wn(d?_:w),t))}}else throw new Error(`Unexpected assertion kind "${f}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Zu(n)&&(n=Ju(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:i}=e;i&&!Zu(i)&&(i=Ju(i,t),e.name=i),n.set(e.number,e),i&&n.set(i,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){const i=pl({body:[e]});n(it(i,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:i,minTargetEs2024:o,digitIsAscii:a,spaceIsAscii:l,wordIsAscii:c}){const{kind:f,negate:d,value:p}=e;if(a&&(f==="digit"||p==="digit")){n(mr(Mc("digit",{negate:d}),t));return}if(l&&(f==="space"||p==="space")){n(it(ec(Wn(cC),d),t));return}if(c&&(f==="word"||p==="word")){n(mr(Mc("word",{negate:d}),t));return}if(f==="any")n(mr(Si("Any"),t));else if(f==="digit")n(mr(Si("Nd",{negate:d}),t));else if(f!=="dot")if(f==="text_segment"){if(i==="strict")throw new Error(Ae`Use of "\X" requires non-strict accuracy`);const m="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",y=Ae`\p{RI}{2}|${m}(?:\u200D${m})*`;n(it(Wn(Ae`(?>\r\n|${o?Ae`\p{RGI_Emoji}`:y}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(f==="hex")n(mr(Si("AHex",{negate:d}),t));else if(f==="newline")n(it(Wn(d?`[^
162
+ ]`:`(?>\r
163
+ ?|[
164
+ \v\f…\u2028\u2029])`),t));else if(f==="posix")if(!o&&(p==="graph"||p==="print")){if(i==="strict")throw new Error(`POSIX class "${p}" requires min target ES2024 or non-strict accuracy`);let m={graph:"!-~",print:" -~"}[p];d&&(m=`\0-${dt(m.codePointAt(0)-1)}${dt(m.codePointAt(2)+1)}-􏿿`),n(it(Wn(`[${m}]`),t))}else n(it(ec(Wn(mC.get(p)),d),t));else if(f==="property")ff.has(Fl(p))||(e.key="sc");else if(f==="space")n(mr(Si("space",{negate:d}),t));else if(f==="word")n(it(ec(Wn(Gn),d),t));else throw new Error(`Unexpected character set kind "${f}"`)},Directive({node:e,parent:t,root:n,remove:i,replaceWith:o,removeAllPrevSiblings:a,removeAllNextSiblings:l}){const{kind:c,flags:f}=e;if(c==="flags")if(!f.enable&&!f.disable)i();else{const d=wn({flags:f});d.body[0].body=l(),o(it(d,t),{traverse:!0})}else if(c==="keep"){const d=n.body[0],m=n.body.length===1&&cy(d,{type:"Group"})&&d.body[0].body.length===1?d.body[0]:n;if(t.parent!==m||m.body.length>1)throw new Error(Ae`Uses "\K" in a way that's unsupported`);const y=Dr({behind:!0});y.body[0].body=a(),o(it(y,t))}else throw new Error(`Unexpected directive kind "${c}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:i}=e;if(i==="fail")n(it(Dr({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${i.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=wn();t.body[0].body.push(e.body),e.body=it(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let i=!1,o=!1;for(const a of e.body)if(a.body.length===1&&a.body[0].kind==="search_start")a.body.pop();else{const l=Ey(a.body);l?(i=!0,Array.isArray(l)?n.push(...l):n.push(l)):o=!0}i&&!o&&n.forEach(a=>t.add(a))},exit(e,{accuracy:t,passedLookbehind:n,strategy:i}){if(t==="strict"&&n&&i)throw new Error(Ae`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Zu(n)&&(n=Ju(n,t),e.ref=n)}},vC={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:i,ref:o}=e;i||n.set(e,[...t.get(o).map(({node:a})=>a)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:i},{groupOriginByCopy:o,groupsByName:a,multiplexCapturesToLeftByRef:l,openRefs:c,reffedNodesByReferencer:f}){const d=o.get(e);if(d&&c.has(e.number)){const m=mr(hm(e.number),t);f.set(m,c.get(e.number)),n(m);return}c.set(e.number,e),l.set(e.number,[]),e.name&&Ls(l,e.name,[]);const p=l.get(e.name??e.number);for(let m=0;m<p.length;m++){const y=p[m];if(d===y.node||d&&d===y.origin||e===y.origin){p.splice(m,1);break}}if(l.get(e.number).push({node:e,origin:d}),e.name&&l.get(e.name).push({node:e,origin:d}),e.name){const m=Ls(a,e.name,new Map);let y=!1;if(d)y=!0;else for(const v of m.values())if(!v.hasDuplicateNameToRemove){y=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:y})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=Tl(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},i){const{isRecursive:o,ref:a}=e;if(o){let p=t;for(;(p=p.parent)&&!(p.type==="CapturingGroup"&&(p.name===a||p.number===a)););i.reffedNodesByReferencer.set(e,p);return}const l=i.subroutineRefMap.get(a),c=a===0,f=c?hm(0):Cy(l,i.groupOriginByCopy,null);let d=f;if(!c){const p=_y(CC(l,y=>y.type==="Group"&&!!y.flags)),m=p?Tl(i.globalFlags,p):i.globalFlags;xC(m,i.currentFlags)||(d=wn({flags:_C(m)}),d.body[0].body.push(f))}n(it(d,t),{traverse:!c})}},wC={Backreference({node:e,parent:t,replaceWith:n},i){if(e.orphan){i.highestOrphanBackref=Math.max(i.highestOrphanBackref,e.ref);return}const a=i.reffedNodesByReferencer.get(e).filter(l=>SC(l,e));if(!a.length)n(it(Dr({negate:!0}),t));else if(a.length>1){const l=wn({atomic:!0,body:a.reverse().map(c=>Vr({body:[jc(c.number)]}))});n(it(l,t))}else e.ref=a[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let i=0;i<n;i++){const o=dy();e.body.at(-1).body.push(o)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function Sy(e){bs(e,{"*"({node:t,parent:n}){t.parent=n}})}function xC(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function SC(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const i=by(n.parent);for(const o of i){if(o===n)break;if(o===e||Iy(o,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function Cy(e,t,n,i){const o=Array.isArray(e)?[]:{};for(const[a,l]of Object.entries(e))a==="parent"?o.parent=Array.isArray(n)?i:n:l&&typeof l=="object"?o[a]=Cy(l,t,o,n):(a==="type"&&l==="CapturingGroup"&&t.set(o,t.get(e)??e),o[a]=l);return o}function hm(e){const t=py(e);return t.isRecursive=!0,t}function CC(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Ju(e,t){if(t.has(e))return t.get(e);const n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function _y(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:i})=>{t.forEach(o=>{i.enable?.[o]&&(delete n.disable[o],n.enable[o]=!0),i.disable?.[o]&&(n.disable[o]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function _C({dotAll:e,ignoreCase:t}){const n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function by(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Ey(e){const t=e.find(n=>n.kind==="search_start"||IC(n,{negate:!1})||!bC(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const n=[];for(const i of t.body){const o=Ey(i.body);if(!o)return null;Array.isArray(o)?n.push(...o):n.push(o)}return n}return null}function Iy(e,t){const n=by(e)??[];for(const i of n)if(i===t||Iy(i,t))return!0;return!1}function bC({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function EC(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function IC(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&cy(e.body[0],{type:"Assertion",kind:"search_start"})}function Zu(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Wn(e,t){const i=fy(e,{...t,unicodePropertyMap:ff}).body;return i.length>1||i[0].body.length>1?wn({body:i}):i[0].body[0]}function ec(e,t){return e.negate=t,e}function mr(e,t){return e.parent=t,e}function it(e,t){return Sy(e),e.parent=t,e}function NC(e,t){const n=vy(t),i=Dc(n.target,"ES2024"),o=Dc(n.target,"ES2025"),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw new Error("Invalid recursionLimit; use 2-20");let l=null,c=null;if(!o){const v=[e.flags.ignoreCase];bs(e,TC,{getCurrentModI:()=>v.at(-1),popModI(){v.pop()},pushModI(w){v.push(w)},setHasCasedChar(){v.at(-1)?l=!0:c=!0}})}const f={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||l)&&!c)};let d=e;const p={accuracy:n.accuracy,appliedGlobalFlags:f,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:d,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!o&&l&&c),useFlagMods:o,useFlagV:i,verbose:n.verbose};function m(v){return p.lastNode=d,d=v,aC(AC[v.type],`Unexpected node type "${v.type}"`)(v,p,m)}const y={pattern:e.body.map(m).join("|"),flags:m(e.flags),options:{...e.options}};return i||(delete y.options.force.v,y.options.disable.v=!0,y.options.unicodeSetsPlugin=null),y._captureTransfers=new Map,y._hiddenCaptures=[],p.captureMap.forEach((v,w)=>{v.hidden&&y._hiddenCaptures.push(w),v.transferTo&&Ls(y._captureTransfers,v.transferTo,[]).push(w)}),y}var TC={"*":{enter({node:e},t){if(mm(e)){const n=t.getCurrentModI();t.pushModI(e.flags?Tl({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){mm(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){df(dt(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),Ny(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&xy.has(e.value)&&t.setHasCasedChar()}},AC={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?Ae`\B`:Ae`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){const{body:i,name:o,number:a}=e,l={ignoreCase:t.currentFlags.ignoreCase},c=t.originMap.get(e);return c&&(l.hidden=!0,a>c.number&&(l.transferTo=c.number)),t.captureMap.set(a,l),`(${o?`?<${o}>`:""}${i.map(n).join("|")})`},Character({value:e},t){const n=dt(e),i=ki(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(i!==n)return i;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&df(n)){const o=wy(n);return t.inCharClass?o.join(""):o.length>1?`[${o.join("")}]`:o[0]}return n},CharacterClass(e,t,n){const{kind:i,negate:o,parent:a}=e;let{body:l}=e;if(i==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");xn.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&l.some(gm)&&(l=[$l(45),...l.filter(d=>!gm(d))]);const c=()=>`[${o?"^":""}${l.map(n).join(i==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||xn.bugNestedClassIgnoresNegation)&&!o){const p=l.filter(m=>m.type==="CharacterClass"&&m.kind==="union"&&m.negate);if(p.length){const m=wn(),y=m.body[0];return m.parent=a,y.parent=m,l=l.filter(v=>!p.includes(v)),e.body=l,l.length?(e.parent=y,y.body.push(e)):m.body.pop(),p.forEach(v=>{const w=Vr({body:[v]});v.parent=w,w.parent=m,m.body.push(w)}),n(m)}}t.inCharClass=!0;const d=c();return t.inCharClass=!1,d}const f=l[0];if(i==="union"&&!o&&f&&((!t.useFlagV||!t.verbose)&&a.kind==="union"&&!(xn.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind==="intersection"&&l.length===1&&f.type!=="CharacterClassRange"))return l.map(n).join("");if(!t.useFlagV&&a.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return c()},CharacterClassRange(e,t){const n=e.min.value,i=e.max.value,o={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=ki(n,o),l=ki(i,o),c=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const f=Ny(e);MC(f).forEach(p=>{c.add(Array.isArray(p)?`${ki(p[0],o)}-${ki(p[1],o)}`:ki(p,o))})}return`${a}-${l}${[...c].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:i},o){if(e==="dot")return o.currentFlags.dotAll?o.appliedGlobalFlags.dotAll||o.useFlagMods?".":"[^]":Ae`[^\n]`;if(e==="digit")return t?Ae`\D`:Ae`\d`;if(e==="property"){if(o.useAppliedIgnoreCase&&o.currentFlags.ignoreCase&&xy.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Ae`\P`:Ae`\p`}{${i?`${i}=`:""}${n}}`}if(e==="word")return t?Ae`\W`:Ae`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:i},o,a){const l=o.currentFlags;n&&(o.currentFlags=Tl(l,n));const c=t.map(a).join("|"),f=!o.verbose&&t.length===1&&i.type!=="Quantifier"&&!e&&(!o.useFlagMods||!n)?c:`(?${OC(e,n,o.useFlagMods)}${c})`;return o.currentFlags=l,f},LookaroundAssertion({body:e,kind:t,negate:n},i,o){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(o).join("|")})`},Quantifier(e,t,n){return n(e.body)+DC(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const i=n.recursionLimit;return t===0?`(?R=${i})`:Ae`\g<${t}&R=${i}>`}},PC=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),RC=new Set(["-","\\","]","^","["]),LC=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),pm=new Map([[9,Ae`\t`],[10,Ae`\n`],[11,Ae`\v`],[12,Ae`\f`],[13,Ae`\r`],[8232,Ae`\u2028`],[8233,Ae`\u2029`],[65279,Ae`\uFEFF`]]),jC=new RegExp("^\\p{Cased}$","u");function df(e){return jC.test(e)}function Ny(e,t){const n=!!t?.firstOnly,i=e.min.value,o=e.max.value,a=[];if(i<65&&(o===65535||o>=131071)||i===65536&&o>=131071)return a;for(let l=i;l<=o;l++){const c=dt(l);if(!df(c))continue;const f=wy(c).filter(d=>{const p=d.codePointAt(0);return p<i||p>o});if(f.length&&(a.push(...f),n))break}return a}function ki(e,{escDigit:t,inCharClass:n,useFlagV:i}){if(pm.has(e))return pm.get(e);if(e<32||e>126&&e<160||e>262143||t&&$C(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const o=n?i?LC:RC:PC,a=dt(e);return(o.has(a)?"\\":"")+a}function MC(e){const t=e.map(o=>o.codePointAt(0)).sort((o,a)=>o-a),n=[];let i=null;for(let o=0;o<t.length;o++)t[o+1]===t[o]+1?i??=t[o]:i===null?n.push(t[o]):(n.push([i,t[o]]),i=null);return n}function OC(e,t,n){if(e)return">";let i="";if(t&&n){const{enable:o,disable:a}=t;i=(o?.ignoreCase?"i":"")+(o?.dotAll?"s":"")+(a?"-":"")+(a?.ignoreCase?"i":"")+(a?.dotAll?"s":"")}return`${i}:`}function DC({kind:e,max:t,min:n}){let i;return!n&&t===1?i="?":!n&&t===1/0?i="*":n===1&&t===1/0?i="+":n===t?i=`{${n}}`:i=`{${n},${t===1/0?"":t}}`,i+{greedy:"",lazy:"?",possessive:"+"}[e]}function mm({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function $C(e){return e>47&&e<58}function gm({type:e,value:t}){return e==="Character"&&t===45}var FC=class $c extends RegExp{#t=new Map;#e=null;#r;#n=null;#i=null;rawOptions={};get source(){return this.#r||"(?:)"}constructor(t,n,i){const o=!!i?.lazyCompile;if(t instanceof RegExp){if(i)throw new Error("Cannot provide options when copying a regexp");const a=t;super(a,n),this.#r=a.source,a instanceof $c&&(this.#t=a.#t,this.#n=a.#n,this.#i=a.#i,this.rawOptions=a.rawOptions)}else{const a={hiddenCaptures:[],strategy:null,transfers:[],...i};super(o?"":t,n),this.#r=t,this.#t=BC(a.hiddenCaptures,a.transfers),this.#i=a.strategy,this.rawOptions=i??{}}o||(this.#e=this)}exec(t){if(!this.#e){const{lazyCompile:o,...a}=this.rawOptions;this.#e=new $c(this.#r,this.flags,a)}const n=this.global||this.sticky,i=this.lastIndex;if(this.#i==="clip_search"&&n&&i){this.lastIndex=0;const o=this.#s(t.slice(i));return o&&(zC(o,i,t,this.hasIndices),this.lastIndex+=i),o}return this.#s(t)}#s(t){this.#e.lastIndex=this.lastIndex;const n=super.exec.call(this.#e,t);if(this.lastIndex=this.#e.lastIndex,!n||!this.#t.size)return n;const i=[...n];n.length=1;let o;this.hasIndices&&(o=[...n.indices],n.indices.length=1);const a=[0];for(let l=1;l<i.length;l++){const{hidden:c,transferTo:f}=this.#t.get(l)??{};if(c?a.push(null):(a.push(n.length),n.push(i[l]),this.hasIndices&&n.indices.push(o[l])),f&&i[l]!==void 0){const d=a[f];if(!d)throw new Error(`Invalid capture transfer to "${d}"`);if(n[d]=i[l],this.hasIndices&&(n.indices[d]=o[l]),n.groups){this.#n||(this.#n=UC(this.source));const p=this.#n.get(f);p&&(n.groups[p]=i[l],this.hasIndices&&(n.indices.groups[p]=o[l]))}}}return n}};function zC(e,t,n,i){if(e.index+=t,e.input=n,i){const o=e.indices;for(let l=0;l<o.length;l++){const c=o[l];c&&(o[l]=[c[0]+t,c[1]+t])}const a=o.groups;a&&Object.keys(a).forEach(l=>{const c=a[l];c&&(a[l]=[c[0]+t,c[1]+t])})}}function BC(e,t){const n=new Map;for(const i of e)n.set(i,{hidden:!0});for(const[i,o]of t)for(const a of o)Ls(n,a,{}).transferTo=i;return n}function UC(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let i=0,o=0,a;for(;a=t.exec(e);){const{0:l,groups:{capture:c,name:f}}=a;l==="["?i++:i?l==="]"&&i--:c&&(o++,f&&n.set(o,f))}return n}function VC(e,t){const n=GC(e,t);return n.options?new FC(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function GC(e,t){const n=vy(t),i=fy(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:ff}),o=yC(i,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),a=NC(o,n),l=oC(a.pattern,{captureTransfers:a._captureTransfers,hiddenCaptures:a._hiddenCaptures,mode:"external"}),c=iC(l.pattern),f=rC(c.pattern,{captureTransfers:l.captureTransfers,hiddenCaptures:l.hiddenCaptures}),d={pattern:f.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${a.flags}${a.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const p=f.hiddenCaptures.sort((w,_)=>w-_),m=Array.from(f.captureTransfers),y=o._strategy,v=d.pattern.length>=n.lazyCompileLength;(p.length||m.length||y||v)&&(d.options={...p.length&&{hiddenCaptures:p},...m.length&&{transfers:m},...y&&{strategy:y},...v&&{lazyCompile:v}})}return d}const ym=4294967295;class WC{constructor(t,n={}){this.patterns=t,this.options=n;const{forgiving:i=!1,cache:o,regexConstructor:a}=n;if(!a)throw new Error("Option `regexConstructor` is not provided");this.regexps=t.map(l=>{if(typeof l!="string")return l;const c=o?.get(l);if(c){if(c instanceof RegExp)return c;if(i)return null;throw c}try{const f=a(l);return o?.set(l,f),f}catch(f){if(o?.set(l,f),i)return null;throw f}})}regexps;findNextMatchSync(t,n,i){const o=typeof t=="string"?t:t.content,a=[];function l(c,f,d=0){return{index:c,captureIndices:f.indices.map(p=>p==null?{start:ym,end:ym,length:0}:{start:p[0]+d,end:p[1]+d,length:p[1]-p[0]})}}for(let c=0;c<this.regexps.length;c++){const f=this.regexps[c];if(f)try{f.lastIndex=n;const d=f.exec(o);if(!d)continue;if(d.index===n)return l(c,d,0);a.push([c,d,0])}catch(d){if(this.options.forgiving)continue;throw d}}if(a.length){const c=Math.min(...a.map(f=>f[1].index));for(const[f,d,p]of a)if(d.index===c)return l(f,d,p)}return null}}function HC(e,t){return VC(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function qC(e={}){const t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||=n=>HC(n,{target:t.target}),{createScanner(n){return new WC(n,t)},createString(n){return{content:n}}}}const KC="github-light",Ty={typescript:()=>Pe(()=>import("./typescript-BPQ3VLAy.js"),[]),tsx:()=>Pe(()=>import("./tsx-COt5Ahok.js"),[]),javascript:()=>Pe(()=>import("./javascript-wDzz0qaB.js"),[]),jsx:()=>Pe(()=>import("./jsx-g9-lgVsj.js"),[]),json:()=>Pe(()=>import("./json-Cp-IABpG.js"),[]),jsonc:()=>Pe(()=>import("./jsonc-Des-eS-w.js"),[]),json5:()=>Pe(()=>import("./json5-C9tS-k6U.js"),[]),css:()=>Pe(()=>import("./css-DPfMkruS.js"),[]),scss:()=>Pe(()=>import("./scss-OYdSNvt2.js"),__vite__mapDeps([0,1])),less:()=>Pe(()=>import("./less-B1dDrJ26.js"),[]),html:()=>Pe(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([2,3,1])),vue:()=>Pe(()=>import("./vue-DVfSmUF7.js"),__vite__mapDeps([4,1,3,5,6,2])),svelte:()=>Pe(()=>import("./svelte-DZMnMd3x.js"),__vite__mapDeps([7,3,5,1])),markdown:()=>Pe(()=>import("./markdown-Cvjx9yec.js"),[]),mdx:()=>Pe(()=>import("./mdx-Cmh6b_Ma.js"),[]),yaml:()=>Pe(()=>import("./yaml-Buea-lGh.js"),[]),toml:()=>Pe(()=>import("./toml-vGWfd6FD.js"),[]),ini:()=>Pe(()=>import("./ini-BEwlwnbL.js"),[]),xml:()=>Pe(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([8,9])),shellscript:()=>Pe(()=>import("./shellscript-Yzrsuije.js"),[]),python:()=>Pe(()=>import("./python-B6aJPvgy.js"),[]),go:()=>Pe(()=>import("./go-CxLEBnE3.js"),[]),rust:()=>Pe(()=>import("./rust-B1yitclQ.js"),[]),java:()=>Pe(()=>import("./java-CylS5w8V.js"),[]),kotlin:()=>Pe(()=>import("./kotlin-BdnUsdx6.js"),[]),c:()=>Pe(()=>import("./c-BIGW1oBm.js"),[]),cpp:()=>Pe(()=>import("./cpp-BRuaLJcg.js"),__vite__mapDeps([10,11,12])),csharp:()=>Pe(()=>import("./csharp-COcwbKMJ.js"),[]),php:()=>Pe(()=>import("./php-Dhbhpdrm.js"),__vite__mapDeps([13,2,3,1,8,9,12,6])),ruby:()=>Pe(()=>import("./ruby-BGX7qA9Y.js"),__vite__mapDeps([14,2,3,1,8,9,12,15,5,16,17,10,11,18,19,20])),sql:()=>Pe(()=>import("./sql-BLtJtn59.js"),[]),graphql:()=>Pe(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([15,3,5,16,17])),dockerfile:()=>Pe(()=>import("./dockerfile-BcOcwvcX.js"),[]),makefile:()=>Pe(()=>import("./makefile-CHLpvVh8.js"),[]),lua:()=>Pe(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([19,11])),swift:()=>Pe(()=>import("./swift-D82vCrfD.js"),[]),dart:()=>Pe(()=>import("./dart-CF10PKvl.js"),[]),diff:()=>Pe(()=>import("./diff-D97Zzqfu.js"),[]),dotenv:()=>Pe(()=>import("./dotenv-Da5cRb03.js"),[]),prisma:()=>Pe(()=>import("./prisma-Dd19v3D-.js"),[]),nginx:()=>Pe(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([21,19,11]))},QC={ts:"typescript",mts:"typescript",cts:"typescript",tsx:"tsx",js:"javascript",mjs:"javascript",cjs:"javascript",jsx:"jsx",json:"json",jsonc:"jsonc",json5:"json5",css:"css",scss:"scss",less:"less",html:"html",htm:"html",vue:"vue",svelte:"svelte",md:"markdown",markdown:"markdown",mdx:"mdx",yml:"yaml",yaml:"yaml",toml:"toml",ini:"ini",cfg:"ini",conf:"ini",xml:"xml",svg:"xml",plist:"xml",sh:"shellscript",bash:"shellscript",zsh:"shellscript",py:"python",go:"go",rs:"rust",java:"java",kt:"kotlin",kts:"kotlin",c:"c",h:"c",cc:"cpp",cpp:"cpp",cxx:"cpp",hpp:"cpp",hh:"cpp",cs:"csharp",php:"php",rb:"ruby",sql:"sql",graphql:"graphql",gql:"graphql",lua:"lua",swift:"swift",dart:"dart",diff:"diff",patch:"diff",env:"dotenv",prisma:"prisma"},XC={dockerfile:"dockerfile",makefile:"makefile",gnumakefile:"makefile",".env":"dotenv","nginx.conf":"nginx",".bashrc":"shellscript",".zshrc":"shellscript",".prettierrc":"json",".eslintrc":"json",".babelrc":"json","tsconfig.json":"jsonc","jsconfig.json":"jsonc"};function YC(e){const t=(e.split("/").pop()??"").toLowerCase(),n=XC[t];if(n)return n;if(t.startsWith(".env."))return"dotenv";if(t.startsWith("dockerfile."))return"dockerfile";const i=t.lastIndexOf(".");if(i<0)return null;const o=QC[t.slice(i+1)];return o&&Ty[o]?o:null}let tc=null;function JC(){return tc||(tc=lS({themes:[Pe(()=>import("./github-light-DAi9KRSo.js"),[])],langs:[],engine:qC({forgiving:!0})})),tc}const km=new Set,nc=new Map;async function ZC(e,t){if(km.has(t))return!0;let n=nc.get(t);if(!n){const i=Ty[t];if(!i)return!1;n=i().then(async o=>(await e.loadLanguage(...o.default),km.add(t),!0)).catch(()=>!1).finally(()=>nc.delete(t)),nc.set(t,n)}return n}async function e_(e,t){if(t.length===0)return[];const n=await JC();if(!await ZC(n,e))return null;const i=t.join(`
165
+ `),a=n.codeToTokensBase(i,{lang:e,theme:KC,includeExplanation:!1}).map(l=>l.map(c=>({content:c.content,color:c.color})));for(;a.length<t.length;)a.push([{content:t[a.length]??""}]);return a.slice(0,t.length)}const sl=20,vm=new Map;function t_(e){const t=(n,i)=>{const o=i==="old"?n.oldLineNo:n.newLineNo;return o===void 0?void 0:{side:i,line:o}};if(e.kind==="line")return t(e.line,e.line.type==="del"?"old":"new");if(e.kind==="pair")return(e.right&&t(e.right,"new"))??(e.left&&t(e.left,"old"))}function ol(e,t){return e.type==="context"||t==="new"?`new:${e.newLineNo??e.oldLineNo}`:`old:${e.oldLineNo}`}function wm({content:e,tokens:t}){return t?x.jsxs("span",{className:"code-text",children:[t.map((n,i)=>x.jsx("span",{style:n.color?{color:n.color}:void 0,children:n.content},i)),e===""&&"​"]}):x.jsx("span",{className:"code-text",children:e||"​"})}function n_(e,t){if(e.newLineNo!==void 0)return e.newLineNo;if(!t)return e.oldLineNo??1;const n=t.lines.indexOf(e);for(let i=n+1;i<t.lines.length;i++){const o=t.lines[i].newLineNo;if(o!==void 0)return o}for(let i=n-1;i>=0;i--){const o=t.lines[i].newLineNo;if(o!==void 0)return o}return t.newStart}function r_(e){switch(e.kind){case"hunk":case"gap":return 26;default:return 22}}function i_({diff:e}){const t=V(A=>A.prefs.viewMode),n=V(A=>A.targetKey),i=V(A=>A.comments),o=q.useMemo(()=>i.filter(A=>A.filePath===e.path&&A.targetKey===n),[i,e.path,n]),a=V(A=>A.updateComment),l=V(A=>A.setEditor),c=V(A=>A.focusComment),f=V(A=>A.editor),d=V(A=>A.focusedCommentId),p=V(A=>A.openInNvim),m=V(A=>A.showToast),y=V(A=>A.reattaching),v=V(A=>A.jumpTo),w=Xc(),_=V(A=>A.stageSel?.filePath===e.path?A.stageSel:null),N=V(A=>A.setStageSel),C=V(A=>A.stageLines),b=V(A=>A.staging),[E,B]=q.useState({}),[O,D]=q.useState(null),ie=q.useRef(null),[U,ce]=q.useState(null),R=q.useRef(null),H=q.useCallback(A=>{R.current=A,ce(A)},[]),[J,fe]=q.useState(null),ee=q.useMemo(()=>mx({diff:e,viewMode:t,expansions:E,fullLines:O}),[e,t,E,O]),te=q.useMemo(()=>{const A=new Map;for(const $ of o){if($.status==="orphaned")continue;const Q=`${$.side}:${$.endLine}`,oe=A.get(Q)??{count:0,active:!1,ids:[]};oe.count++,oe.ids.push($.id),$.status==="active"&&(oe.active=!0),A.set(Q,oe)}return A},[o]),xe=q.useMemo(()=>o.find(A=>A.id===d&&A.status!=="orphaned")??null,[o,d]),_e=f&&f.filePath===e.path?f:null,re=q.useMemo(()=>YC(e.path),[e.path]),ae=q.useRef(new Map),[,I]=q.useState(0);q.useEffect(()=>{if(!re)return;const A=ae.current,$=new Map,Q=(Se,De,ot)=>{if(A.has(De))return;let qe=$.get(Se);qe||(qe={keys:[],lines:[]},$.set(Se,qe)),!qe.keys.includes(De)&&(qe.keys.push(De),qe.lines.push(ot))},oe=(Se,De)=>{Se.type==="del"?Q(`${De}:old`,ol(Se,"old"),Se.content):Q(`${De}:new`,ol(Se,"new"),Se.content)};for(const Se of ee)Se.kind==="line"?oe(Se.line,Se.hunkIndex):Se.kind==="pair"&&(Se.left&&oe(Se.left,Se.hunkIndex),Se.right&&Se.right!==Se.left&&oe(Se.right,Se.hunkIndex));if($.size===0)return;let Te=!1;return(async()=>{let Se=!1;for(const De of $.values()){const ot=await e_(re,De.lines);if(Te||!ot)return;De.keys.forEach((qe,Je)=>{const Gt=ot[Je];Gt&&A.set(qe,Gt)}),Se=!0}Se&&I(De=>De+1)})().catch(()=>{}),()=>{Te=!0}},[ee,re]);const M=q.useRef(null),W=dx({count:ee.length,getScrollElement:()=>M.current,estimateSize:A=>r_(ee[A]),overscan:12,getItemKey:A=>ee[A].key});q.useEffect(()=>{const A=M.current;if(!A)return;let $=0;const Q=()=>{$=0;const Te=W.getVirtualItems()[0],Se=Te?t_(ee[Te.index]):void 0;Se&&vm.set(e.path,Se)},oe=()=>{$||($=requestAnimationFrame(Q))};return A.addEventListener("scroll",oe,{passive:!0}),()=>{A.removeEventListener("scroll",oe),$&&cancelAnimationFrame($)}},[ee,W,e.path]);const T=q.useRef(!1);q.useEffect(()=>{if(T.current||(T.current=!0,!V.getState().consumeRestoreScroll()))return;const A=vm.get(e.path);if(!A)return;const $=Tp(ee,A.side,A.line);$>=0&&W.scrollToIndex($,{align:"start"})},[]),q.useEffect(()=>{if(!v||v.file!==e.path)return;const A=Tp(ee,v.side,v.line);if(A<0)return;W.scrollToIndex(A,{align:"center"}),fe({side:v.side,line:v.line});const $=setTimeout(()=>fe(null),1600);return()=>clearTimeout($)},[v]),q.useEffect(()=>{const A=$=>{if($.ctrlKey||$.metaKey||$.altKey)return;const Q=$.target;if(Q&&(Q.tagName==="INPUT"&&Q.type!=="checkbox"||Q.tagName==="TEXTAREA"||Q.tagName==="SELECT"||Q.isContentEditable)||$.key!=="n"&&$.key!=="p")return;const oe=yx(ee);if(!oe.length)return;const Te=M.current,Se=Te?Te.scrollTop:0,De=oe.map(qe=>W.getOffsetForIndex(qe,"start")?.[0]??0);let ot;if($.key==="n")ot=oe.find((qe,Je)=>De[Je]>Se+4);else for(let qe=oe.length-1;qe>=0;qe--)if(De[qe]<Se-4){ot=oe[qe];break}ot!==void 0&&($.preventDefault(),W.scrollToIndex(ot,{align:"start"}))};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[ee,W]),q.useEffect(()=>{const A=()=>{const $=R.current;if(!$)return;H(null);const Q=Math.min($.anchor,$.head),oe=Math.max($.anchor,$.head),Te=V.getState().reattaching;Te?a(Te,{side:$.side,startLine:Q,endLine:oe}):l({filePath:e.path,side:$.side,startLine:Q,endLine:oe})};return window.addEventListener("mouseup",A),()=>window.removeEventListener("mouseup",A)},[H,a,l,e.path]);const ye=q.useRef(null),[be,ge]=q.useState(!1);q.useEffect(()=>{const A=()=>{ye.current=null,ge(!1)};return window.addEventListener("mouseup",A),()=>window.removeEventListener("mouseup",A)},[]);const je=(A,$,Q)=>N({filePath:e.path,hunkIndex:A,anchor:$,head:Q,lines:gx(ee,A,$,Q)}),Ie=(A,$,Q)=>{if(!(A.button!==0||!w)){if(A.preventDefault(),A.stopPropagation(),_&&_.hunkIndex===$&&_.anchor===Q&&_.head===Q){N(null);return}ye.current={hunkIndex:$,anchor:Q},ge(!0),je($,Q,Q)}},Le=(A,$)=>{const Q=ye.current;!Q||Q.hunkIndex!==A||$<0||_&&_.head===$||je(Q.hunkIndex,Q.anchor,$)},He=A=>!!_&&A.hunkIndex===_.hunkIndex&&A.indices.length>0&&A.pos>=Math.min(_.anchor,_.head)&&A.pos<=Math.max(_.anchor,_.head),At=(A,$,Q)=>x.jsx("span",{className:"stagec",children:w&&!A.expanded&&$&&$.type!=="context"&&x.jsx("button",{className:`stage-box ${Q?"on":""}`,onMouseDown:oe=>Ie(oe,A.hunkIndex,A.pos),title:w==="stage"?"选中要暂存的行(可拖选)":"选中要取消暂存的行(可拖选)","aria-pressed":Q})}),fn=(A,$,Q,oe)=>{A.button===0&&(A.preventDefault(),A.stopPropagation(),H({side:$,hunkIndex:Q,anchor:oe,head:oe}))},Jt=(A,$,Q)=>{const oe=R.current;!oe||oe.side!==A||oe.hunkIndex!==$||oe.head===Q||H({...oe,head:Q})},Rn=(A,$)=>!U||$===void 0||U.side!==A?!1:$>=Math.min(U.anchor,U.head)&&$<=Math.max(U.anchor,U.head),Ln=(A,$)=>!!J&&J.side===A&&J.line===$,Cn=(A,$,Q)=>!!A&&Q!==void 0&&A.side===$&&Q>=A.startLine&&Q<=A.endLine,dn=(A,$)=>[Rn(A,$)||Cn(_e,A,$)?"selected":"",Cn(xe,A,$)?"focused":"",Ln(A,$)?"flash":""].join(" "),le=(A,$)=>{if($===void 0)return null;const Q=te.get(`${A}:${$}`);return Q?x.jsxs(x.Fragment,{children:[x.jsx("button",{className:`pill ${Q.active?"":"muted"}`,title:"查看评论",onClick:()=>{c(Q.ids[0]??null,!1)},children:Q.count}),x.jsx("span",{className:`pin ${Q.active?"":"muted"}`})]}):null},Ne=q.useCallback(async()=>O||(ie.current||(ie.current=Re.fullFile(n,e.path,"new").then(A=>{if(A.content===null)return null;const $=A.content.split(`
166
+ `);return $.length&&$[$.length-1]===""&&$.pop(),D($),$}).catch(A=>(m(A instanceof Error?A.message:String(A),"error"),null)).finally(()=>{ie.current=null})),ie.current),[O,n,e.path,m]),Oe=async(A,$)=>{if(!await Ne()){m("无法读取完整文件内容","error");return}B(oe=>{const Te=oe[A.index]??{top:0,bottom:0,all:!1},Se=$==="all"?{...Te,all:!0}:$==="top"?{...Te,top:Te.top+sl}:{...Te,bottom:Te.bottom+sl};return{...oe,[A.index]:Se}})},st=(A,$)=>{const Q=e.hunks[$];p(e.path,n_(A,Q))},Pt=A=>{const{gap:$,hidden:Q}=A,oe=$.index===0,Te=$.index===e.hunks.length;return x.jsxs("div",{className:"row gap-row",children:[!oe&&x.jsxs("button",{className:"link",onClick:()=>{Oe($,"top")},title:"展开紧接上一个 hunk 之后的 20 行",children:["↑ 展开上方 ",sl," 行"]}),x.jsxs("button",{className:"link",onClick:()=>{Oe($,"all")},children:["展开全部",Q!==null?` (${Q} 行)`:""]}),!Te&&x.jsxs("button",{className:"link",onClick:()=>{Oe($,"bottom")},title:"展开紧接下一个 hunk 之前的 20 行",children:["↓ 展开下方 ",sl," 行"]})]})},pt=A=>{const $=A.line,Q=$.type==="del"?"old":"new",oe=Q==="old"?$.oldLineNo:$.newLineNo,Te=ae.current.get(ol($,Q)),Se=He(A);return x.jsxs("div",{className:`row line ${$.type} ${dn(Q,oe)} ${A.expanded?"expanded":""} ${Se?"picked":""}`,onMouseEnter:()=>{oe!==void 0&&Jt(Q,A.hunkIndex,oe),Le(A.hunkIndex,A.pos)},children:[At(A,$,Se),x.jsx("span",{className:"gut",onClick:()=>st($,A.hunkIndex),title:"在 nvim 中打开此行",children:$.oldLineNo??""}),x.jsx("span",{className:"gut",onClick:()=>st($,A.hunkIndex),title:"在 nvim 中打开此行",children:$.newLineNo??""}),x.jsx("span",{className:"addc",children:!A.expanded&&oe!==void 0&&x.jsx("button",{className:"add-btn",onMouseDown:De=>fn(De,Q,A.hunkIndex,oe),title:"添加评论(可拖选多行)",children:"+"})}),x.jsx("span",{className:"marker",children:$.type==="add"?"+":$.type==="del"?"-":" "}),x.jsxs("span",{className:"code",children:[x.jsx(wm,{content:$.content,tokens:Te}),$.noNewline&&x.jsx("span",{className:"nonl",title:"No newline at end of file",children:"⏎"})]}),le(Q,oe)]})},jn=(A,$,Q,oe)=>{if(!$)return x.jsx("span",{className:"cell empty"});const{hunkIndex:Te,expanded:Se}=A,De=Q==="old"?$.oldLineNo:$.newLineNo,ot=$.type==="context"?"context":Q==="old"?"del":"add",qe=ae.current.get(ol($,Q));return x.jsxs("span",{className:`cell ${ot} ${dn(Q,De)} ${oe?"picked":""}`,onMouseEnter:()=>De!==void 0&&Jt(Q,Te,De),children:[At(A,$,oe),x.jsx("span",{className:"gut",onClick:()=>st($,Te),title:"在 nvim 中打开此行",children:De??""}),x.jsx("span",{className:"addc",children:!Se&&De!==void 0&&x.jsx("button",{className:"add-btn",onMouseDown:Je=>fn(Je,Q,Te,De),title:"添加评论(可拖选多行)",children:"+"})}),x.jsx("span",{className:"code",children:x.jsx(wm,{content:$.content,tokens:qe})}),le(Q,De)]})},Mn=A=>{switch(A.kind){case"gap":return Pt(A);case"hunk":return x.jsxs("div",{className:"row hunk-head",children:[x.jsxs("span",{className:"hunk-text",children:["@@ -",A.hunk.oldStart,",",A.hunk.oldLines," +",A.hunk.newStart,",",A.hunk.newLines," @@ ",x.jsx("span",{className:"muted",children:A.hunk.header})]}),w&&x.jsx("button",{className:"link hunk-stage",disabled:b,onClick:()=>{C(e.path,[{index:A.hunkIndex}])},title:w==="stage"?"把这个 hunk 的全部改动放入暂存区":"把这个 hunk 的全部改动移出暂存区",children:w==="stage"?"暂存此 hunk":"取消暂存此 hunk"})]});case"line":return pt(A);case"pair":{const $=He(A);return x.jsxs("div",{className:`row pair ${A.expanded?"expanded":""} ${$?"picked":""}`,onMouseEnter:()=>Le(A.hunkIndex,A.pos),children:[jn(A,A.left,"old",$),jn(A,A.right,"new",$)]})}}},K=W.getVirtualItems();return x.jsx("div",{ref:M,className:`diff-scroll ${U?"selecting":""} ${be?"picking":""} ${y?"reattaching":""}`,children:x.jsx("div",{className:`diff-list ${t}`,style:{height:W.getTotalSize(),position:"relative"},children:K.map(A=>x.jsx("div",{"data-index":A.index,ref:W.measureElement,className:"vrow",style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${A.start}px)`},children:Mn(ee[A.index])},A.key))})})}const s_=5e3;function o_({path:e}){const t=e.lastIndexOf("/")+1;return x.jsxs(x.Fragment,{children:[t>0&&x.jsx("span",{className:"dir",children:e.slice(0,t)}),x.jsx("span",{className:"base",children:e.slice(t)})]})}function l_({entry:e}){const t=V(c=>c.toggleViewed),n=V(c=>c.openInNvim),i=V(c=>!!c.nvim?.selected),o=V(c=>c.stageLines),a=V(c=>c.staging),l=Xc();return x.jsxs("div",{className:"file-head",children:[x.jsx("span",{className:`status status-${e.status}`,title:e.status,children:gg[e.status]}),x.jsxs("span",{className:"path",children:[e.oldPath&&x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"dir",children:e.oldPath})," ",x.jsx("span",{className:"muted",children:"→"})," "]}),x.jsx(o_,{path:e.path})]}),e.oldMode&&e.newMode&&x.jsxs("span",{className:"muted mono",children:["mode ",e.oldMode," → ",e.newMode]}),x.jsxs("span",{className:"counts",children:[x.jsxs("span",{className:"add",children:["+",e.additions]})," ",x.jsxs("span",{className:"del",children:["-",e.deletions]})]}),e.changed&&x.jsx("span",{className:"changed",children:"文件已变化,viewed 已取消"}),x.jsx("span",{className:"spacer"}),x.jsx("button",{className:"link",disabled:!i,onClick:()=>{n(e.path,1)},title:"在 nvim 中打开",children:"在 nvim 中打开"}),l&&x.jsx("button",{disabled:a||e.binary,onClick:()=>{o(e.path)},title:e.binary?"二进制文件无法从这里暂存,请用 git add / git restore --staged":l==="stage"?"把这个文件的全部改动放入暂存区(含模式变更)":"把这个文件的全部改动移出暂存区",children:l==="stage"?"暂存文件":"取消暂存文件"}),x.jsxs("label",{className:"check",children:[x.jsx("input",{type:"checkbox",checked:e.viewed,onChange:()=>{t(e.path)}}),"Viewed"]})]})}function a_({filePath:e}){const t=V(c=>c.stageSel?.filePath===e?c.stageSel:null),n=V(c=>c.staging),i=V(c=>c.stageSelection),o=V(c=>c.setStageSel),a=Xc();if(!t||!a)return null;const l=t.lines.length;return x.jsxs("div",{className:"stage-bar",role:"toolbar","aria-label":"暂存所选行",children:[x.jsxs("span",{className:"stage-bar-count",children:["已选 ",x.jsx("b",{children:l})," 行"]}),x.jsxs("button",{className:"primary",disabled:n||l===0,onClick:()=>{i()},title:"s",children:[n?"处理中…":a==="stage"?"暂存所选":"取消暂存所选",x.jsx("kbd",{children:"s"})]}),x.jsxs("button",{onClick:()=>o(null),title:"Esc",children:["放弃",x.jsx("kbd",{children:"Esc"})]})]})}function u_(){const e=V(p=>p.activeFile),t=V(p=>p.files.find(m=>m.path===p.activeFile)),n=V(p=>p.activeFile?p.diffs[p.activeFile]:void 0),i=V(p=>p.filesLoading),o=V(p=>p.files),a=V(p=>p.openFile),[l,c]=q.useState(null),f=q.useMemo(()=>n?.status==="ok"?kx(n.diff):0,[n]);if(!e||!t)return x.jsx("div",{className:"placeholder",children:i&&o.length===0?x.jsx("p",{children:"加载文件列表…"}):o.length===0?x.jsx("p",{children:"当前 Target 没有改动。"}):x.jsxs(x.Fragment,{children:[x.jsx("p",{children:"在左侧选择一个文件查看 diff。"}),x.jsxs("p",{className:"muted",children:["快捷键:",x.jsx("kbd",{children:"j"}),"/",x.jsx("kbd",{children:"k"})," 切换文件,",x.jsx("kbd",{children:"n"}),"/",x.jsx("kbd",{children:"p"})," 切换 hunk,",x.jsx("kbd",{children:"r"})," 刷新"]})]})});let d;return!n||n.status==="loading"?d=x.jsx("div",{className:"placeholder",children:"加载 diff…"}):n.status==="error"?d=x.jsxs("div",{className:"placeholder error-box",children:[n.message," ",x.jsx("button",{className:"link",onClick:()=>{a(e,!0)},children:"重试"})]}):n.diff.binary?d=x.jsx("div",{className:"placeholder",children:"二进制文件,不展示 diff"}):n.diff.hunks.length===0?d=x.jsx("div",{className:"placeholder",children:t.oldMode&&t.newMode?`仅文件模式变更:${t.oldMode} → ${t.newMode}`:t.status==="renamed"?"仅重命名,内容无变化":"空文件 / 无内容变化"}):f>s_&&l!==e?d=x.jsxs("div",{className:"placeholder",children:[x.jsxs("p",{children:["该文件 diff 有 ",f," 行,默认不渲染。"]}),x.jsx("button",{className:"primary",onClick:()=>c(e),children:"仍然渲染"})]}):d=x.jsx(i_,{diff:n.diff},e+":"+n.diff.contentHash),x.jsxs("div",{className:"diff-panel",children:[x.jsx(l_,{entry:t}),d,x.jsx(a_,{filePath:e})]})}const xm=200,c_=3,Sm={q:"",author:"",path:""},f_=(e,t)=>e.q===t.q&&e.author===t.author&&e.path===t.path;function ml(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`}function d_(e,t){const n=ml(e);if(n===ml(t))return"今天";const i=new Date(t);return i.setDate(t.getDate()-1),n===ml(i)?"昨天":e.toLocaleDateString(void 0,{...e.getFullYear()!==t.getFullYear()?{year:"numeric"}:{},month:"short",day:"numeric",weekday:"short"})}function h_(e){const t=/^(.*?)\s*\((#\d+)\)\s*$/.exec(e);return t?{text:t[1]??"",pr:t[2]??null}:{text:e,pr:null}}function p_({refs:e,head:t}){const n=t&&e[0]?.kind==="branch";if(e.length===0&&!t)return null;const i=e.slice(0,c_),o=e.length-i.length,a=e.map(l=>l.kind==="tag"?`tag: ${l.name}`:l.name).join(", ");return x.jsxs("span",{className:"refs",title:a,children:[t&&!n&&x.jsx("span",{className:"ref ref-head",children:"HEAD"}),i.map((l,c)=>x.jsx("span",{className:`ref ref-${l.kind} ${n&&c===0?"ref-head":""}`,children:l.name},`${l.kind}:${l.name}`)),o>0&&x.jsxs("span",{className:"ref ref-more",children:["+",o]})]})}function m_({state:e,shortSha:t,onPick:n}){if(e.kind==="error")return x.jsx("span",{className:"fork-note muted",children:e.message});const{base:i,sha:o,ahead:a,behind:l}=e.fork;return a===0&&l===0?x.jsxs("span",{className:"fork-note muted",children:["与 ",i," 相同"]}):x.jsxs("span",{className:"fork-note muted",children:["分叉于"," ",x.jsx("button",{type:"button",className:"link mono",onClick:()=>n(o),title:`${o}
167
+ 查看这个提交`,children:t(o)})," ","· 领先 ",a," · 落后 ",l]})}function g_({active:e}){const t=V(le=>le.root),n=V(le=>le.repo),i=V(le=>le.targetKey),o=V(le=>le.setTarget),a=V(le=>le.showToast),l=V(le=>le.repo?.worktrees.find(Ne=>Ne.path===le.root)?.head??le.repo?.head??""),[c,f]=q.useState([]),[d,p]=q.useState(!1),[m,y]=q.useState(!1),[v,w]=q.useState(Sm),[_,N]=q.useState(Sm),[C,b]=q.useState(!1),E=q.useRef(null),B=q.useRef(0),O=q.useRef(0),D=q.useMemo(()=>jl(i),[i]),ie=D.worktree?{worktree:D.worktree}:{},U=D.kind==="commit"?D.sha:null,ce=n?.worktrees.find(le=>le.isMain),R=t!==ce?.path&&ce?.branch||n?.defaultBase||"main",[H,J]=q.useState(D.kind==="base"?D.ref:""),[fe,ee]=q.useState(D.kind==="range"?D.base:"@"),[te,xe]=q.useState(D.kind==="range"?D.head:""),_e=()=>{o(Ut({kind:"base",ref:H.trim()||R,...ie}))},re=()=>{const le=te.trim();le&&o(Ut({kind:"range",base:fe.trim()||"@",head:le,...ie}))},ae=H.trim()||R,[I,M]=q.useState(null),W=q.useRef(0);q.useEffect(()=>{const le=++W.current,Ne=setTimeout(async()=>{try{const Oe=await Re.forkPoint({root:t,base:ae});le===W.current&&M({kind:"ok",base:ae,fork:Oe})}catch(Oe){if(le!==W.current)return;Oe instanceof Ur&&Oe.code==="unknown_ref"?M(null):Oe instanceof Ur&&Oe.code==="no_merge_base"?M({kind:"error",base:ae,message:`与 ${ae} 没有共同历史`}):M({kind:"error",base:ae,message:Oe instanceof Error?Oe.message:String(Oe)})}},300);return()=>clearTimeout(Ne)},[t,ae,l]);const T=I?.base===ae?I:null,ye=T?.kind==="ok"&&(T.fork.ahead>0||T.fork.behind>0)?T.fork.sha:null,be=le=>{o(Ut({kind:"commit",sha:le,...ie}))},ge=q.useCallback(le=>N(Ne=>f_(Ne,le)?Ne:le),[]);q.useEffect(()=>{const le=setTimeout(()=>ge(v),300);return()=>clearTimeout(le)},[v,ge]);const je=le=>{le.key==="Enter"&&ge(v)},Ie=q.useRef(l),Le=q.useCallback(async(le={})=>{const Ne=++O.current;y(!0);try{const Oe=await Re.commits({root:t,ref:Ie.current||void 0,q:_.q||void 0,author:_.author||void 0,path:_.path||void 0,firstParent:C,offset:le.offset,limit:le.limit??xm});if(Ne!==O.current)return;f(st=>{if(!le.offset)return Oe.commits;const Pt=new Set(st.map(pt=>pt.sha));return[...st,...Oe.commits.filter(pt=>!Pt.has(pt.sha))]}),p(Oe.hasMore)}catch(Oe){Ne===O.current&&a(Oe instanceof Error?Oe.message:String(Oe),"error")}finally{Ne===O.current&&y(!1)}},[t,_,C,a]),He=q.useRef(Le);He.current=Le;const At=q.useRef(0);At.current=c.length;const fn=q.useRef(l);q.useEffect(()=>{f([]),p(!1),B.current=0,E.current&&(E.current.scrollTop=0),fn.current=l,Ie.current=l,Le()},[Le]),q.useEffect(()=>{fn.current!==l&&(fn.current=l,Ie.current=l,He.current({limit:Math.min(Math.max(At.current,xm),1e3)}))},[l]),q.useLayoutEffect(()=>{e&&E.current&&(E.current.scrollTop=B.current)},[e]);const Jt=()=>{c.length>0&&!m&&d&&Le({offset:c.length})},Rn=()=>{const le=E.current;le&&(B.current=le.scrollTop,le.scrollTop+le.clientHeight>=le.scrollHeight-300&&Jt())},Ln=q.useMemo(()=>{const le=new Date,Ne=[];let Oe="";for(const st of c){const Pt=new Date(st.date),pt=Number.isNaN(Pt.getTime())?"":ml(Pt);(pt!==Oe||Ne.length===0)&&(Oe=pt,Ne.push({kind:"day",key:`day:${pt}:${Ne.length}`,label:pt?d_(Pt,le):"未知日期"})),Ne.push({kind:"commit",c:st})}return Ne},[c]),Cn=!!(_.q||_.author||_.path||C),dn=m&&c.length===0?"加载中…":d?`已加载 ${c.length} 条`:`共 ${c.length} 条`;return x.jsxs("div",{className:"commits-panel",hidden:!e,children:[x.jsxs("div",{className:"commits-tools",children:[x.jsx("input",{className:"search",value:v.q,onChange:le=>w({...v,q:le.target.value}),onKeyDown:je,placeholder:"搜索 message 或 sha",spellCheck:!1,"aria-label":"搜索 commit message 或 sha"}),x.jsx("input",{value:v.author,onChange:le=>w({...v,author:le.target.value}),onKeyDown:je,placeholder:"作者",spellCheck:!1,"aria-label":"按作者过滤"}),x.jsx("input",{className:"mono path",value:v.path,onChange:le=>w({...v,path:le.target.value}),onKeyDown:je,placeholder:"路径",spellCheck:!1,"aria-label":"按路径过滤"}),x.jsx("button",{className:"toggle","aria-pressed":C,onClick:()=>b(!C),title:"只沿第一父提交走(git log --first-parent):合并进来的分支折叠成它们的 merge commit",children:"主线"}),x.jsx("span",{className:"muted commits-count",children:dn})]}),x.jsxs("div",{className:"commits-compare",children:[x.jsxs("form",{className:"inline-form",title:"分支自 base 分叉以来的全部改动,已提交和未提交都算(含未跟踪文件)",onSubmit:le=>{le.preventDefault(),_e()},children:[x.jsx("span",{className:"compare-label",children:"Branch vs"}),x.jsx("input",{value:H,onChange:le=>J(le.target.value),placeholder:R,spellCheck:!1,"aria-label":"base 分支"}),x.jsx("button",{type:"submit",children:"对比"}),T&&x.jsx(m_,{state:T,shortSha:le=>c.find(Ne=>Ne.sha===le)?.shortSha??le.slice(0,7),onPick:be})]}),x.jsxs("form",{className:"inline-form",title:"对比两个 ref",onSubmit:le=>{le.preventDefault(),re()},children:[x.jsx("span",{className:"compare-label",children:"Range"}),x.jsx("input",{value:fe,onChange:le=>ee(le.target.value),placeholder:"base (@ = HEAD)",spellCheck:!1,"aria-label":"range 的 base"}),x.jsx("span",{className:"muted",children:".."}),x.jsx("input",{value:te,onChange:le=>xe(le.target.value),placeholder:"head",spellCheck:!1,"aria-label":"range 的 head"}),x.jsx("button",{type:"submit",disabled:!te.trim(),children:"对比"})]})]}),x.jsxs("div",{className:"commits-list",ref:E,onScroll:Rn,children:[Ln.map(le=>{if(le.kind==="day")return x.jsx("div",{className:"commit-day",children:le.label},le.key);const Ne=le.c,Oe=new Date(Ne.date),st=Number.isNaN(Oe.getTime())?"":Oe.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),{text:Pt,pr:pt}=h_(Ne.subject),jn=!!U&&(Ne.sha===U||Ne.sha.startsWith(U)),Mn=Ne.sha===ye;return x.jsxs("div",{className:`commit-row ${jn?"active":""} ${Mn?"fork":""}`,onClick:()=>be(Ne.sha),title:`${Ne.sha}
168
+ ${Ne.author} <${Ne.email}>
169
+ ${Oe.toLocaleString()}`,children:[x.jsx("span",{className:"mono sha",children:Ne.shortSha}),x.jsxs("span",{className:"subject",children:[Pt,pt&&x.jsx("span",{className:"pr",children:pt})]}),x.jsx(p_,{refs:Ne.refs,head:Ne.head}),Mn&&x.jsxs("span",{className:"ref ref-fork",title:`与 ${ae} 的共同祖先(merge-base)`,children:["分叉自 ",ae]}),Ne.parents.length>1&&x.jsx("span",{className:"badge",children:"merge"}),x.jsx("span",{className:"author",children:Ne.author}),x.jsx("span",{className:"time",children:st})]},Ne.sha)}),x.jsxs("div",{className:"commits-foot muted",children:[m&&c.length>0&&"加载中…",!m&&d&&x.jsx("button",{className:"link",onClick:Jt,children:"加载更多"}),!m&&!d&&c.length>0&&"已到最早的 commit",!m&&c.length===0&&(Cn?"没有匹配的 commit":"没有 commit")]})]})]})}const y_=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,k_=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,v_={};function Cm(e,t){return(v_.jsx?k_:y_).test(e)}var vi={},rc,_m;function w_(){if(_m)return rc;_m=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,f=`
170
+ `,d="/",p="*",m="",y="comment",v="declaration";function w(N,C){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];C=C||{};var b=1,E=1;function B(ee){var te=ee.match(t);te&&(b+=te.length);var xe=ee.lastIndexOf(f);E=~xe?ee.length-xe:E+ee.length}function O(){var ee={line:b,column:E};return function(te){return te.position=new D(ee),ce(),te}}function D(ee){this.start=ee,this.end={line:b,column:E},this.source=C.source}D.prototype.content=N;function ie(ee){var te=new Error(C.source+":"+b+":"+E+": "+ee);if(te.reason=ee,te.filename=C.source,te.line=b,te.column=E,te.source=N,!C.silent)throw te}function U(ee){var te=ee.exec(N);if(te){var xe=te[0];return B(xe),N=N.slice(xe.length),te}}function ce(){U(n)}function R(ee){var te;for(ee=ee||[];te=H();)te!==!1&&ee.push(te);return ee}function H(){var ee=O();if(!(d!=N.charAt(0)||p!=N.charAt(1))){for(var te=2;m!=N.charAt(te)&&(p!=N.charAt(te)||d!=N.charAt(te+1));)++te;if(te+=2,m===N.charAt(te-1))return ie("End of comment missing");var xe=N.slice(2,te-2);return E+=2,B(xe),N=N.slice(te),E+=2,ee({type:y,comment:xe})}}function J(){var ee=O(),te=U(i);if(te){if(H(),!U(o))return ie("property missing ':'");var xe=U(a),_e=ee({type:v,property:_(te[0].replace(e,m)),value:xe?_(xe[0].replace(e,m)):m});return U(l),_e}}function fe(){var ee=[];R(ee);for(var te;te=J();)te!==!1&&(ee.push(te),R(ee));return ee}return ce(),fe()}function _(N){return N?N.replace(c,m):m}return rc=w,rc}var bm;function x_(){if(bm)return vi;bm=1;var e=vi&&vi.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(vi,"__esModule",{value:!0}),vi.default=n;const t=e(w_());function n(i,o){let a=null;if(!i||typeof i!="string")return a;const l=(0,t.default)(i),c=typeof o=="function";return l.forEach(f=>{if(f.type!=="declaration")return;const{property:d,value:p}=f;c?o(d,p,f):p&&(a=a||{},a[d]=p)}),a}return vi}var ks={},Em;function S_(){if(Em)return ks;Em=1,Object.defineProperty(ks,"__esModule",{value:!0}),ks.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,a=function(d){return!d||n.test(d)||e.test(d)},l=function(d,p){return p.toUpperCase()},c=function(d,p){return"".concat(p,"-")},f=function(d,p){return p===void 0&&(p={}),a(d)?d:(d=d.toLowerCase(),p.reactCompat?d=d.replace(o,c):d=d.replace(i,c),d.replace(t,l))};return ks.camelCase=f,ks}var vs,Im;function C_(){if(Im)return vs;Im=1;var e=vs&&vs.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(x_()),n=S_();function i(o,a){var l={};return!o||typeof o!="string"||(0,t.default)(o,function(c,f){c&&f&&(l[(0,n.camelCase)(c,a)]=f)}),l}return i.default=i,vs=i,vs}var __=C_();const b_=qc(__),Ay=Py("end"),hf=Py("start");function Py(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function E_(e){const t=hf(e),n=Ay(e);if(t&&n)return{start:t,end:n}}function Es(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Nm(e.position):"start"in e||"end"in e?Nm(e):"line"in e||"column"in e?Fc(e):""}function Fc(e){return Tm(e&&e.line)+":"+Tm(e&&e.column)}function Nm(e){return Fc(e&&e.start)+"-"+Fc(e&&e.end)}function Tm(e){return e&&typeof e=="number"?e:1}class Tt extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let o="",a={},l=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?o=t:!a.cause&&t&&(l=!0,o=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof i=="string"){const f=i.indexOf(":");f===-1?a.ruleId=i:(a.source=i.slice(0,f),a.ruleId=i.slice(f+1))}if(!a.place&&a.ancestors&&a.ancestors){const f=a.ancestors[a.ancestors.length-1];f&&(a.place=f.position)}const c=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=c?c.line:void 0,this.name=Es(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Tt.prototype.file="";Tt.prototype.name="";Tt.prototype.reason="";Tt.prototype.message="";Tt.prototype.stack="";Tt.prototype.column=void 0;Tt.prototype.line=void 0;Tt.prototype.ancestors=void 0;Tt.prototype.cause=void 0;Tt.prototype.fatal=void 0;Tt.prototype.place=void 0;Tt.prototype.ruleId=void 0;Tt.prototype.source=void 0;const pf={}.hasOwnProperty,I_=new Map,N_=/[A-Z]/g,T_=new Set(["table","tbody","thead","tfoot","tr"]),A_=new Set(["td","th"]),Ry="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function P_(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=F_(n,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");i=$_(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?$s:Vg,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Ly(o,e,void 0);return a&&typeof a!="string"?a:o.create(e,o.Fragment,{children:a||void 0},void 0)}function Ly(e,t,n){if(t.type==="element")return R_(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return L_(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return M_(e,t,n);if(t.type==="mdxjsEsm")return j_(e,t);if(t.type==="root")return O_(e,t,n);if(t.type==="text")return D_(e,t)}function R_(e,t,n){const i=e.schema;let o=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(o=$s,e.schema=o),e.ancestors.push(t);const a=My(e,t.tagName,!1),l=z_(e,t);let c=gf(e,t);return T_.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!Ml(f):!0})),jy(e,l,a,t),mf(l,c),e.ancestors.pop(),e.schema=i,e.create(t,a,l,n)}function L_(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}js(e,t.position)}function j_(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);js(e,t.position)}function M_(e,t,n){const i=e.schema;let o=i;t.name==="svg"&&i.space==="html"&&(o=$s,e.schema=o),e.ancestors.push(t);const a=t.name===null?e.Fragment:My(e,t.name,!0),l=B_(e,t),c=gf(e,t);return jy(e,l,a,t),mf(l,c),e.ancestors.pop(),e.schema=i,e.create(t,a,l,n)}function O_(e,t,n){const i={};return mf(i,gf(e,t)),e.create(t,e.Fragment,i,n)}function D_(e,t){return t.value}function jy(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function mf(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function $_(e,t,n){return i;function i(o,a,l,c){const d=Array.isArray(l.children)?n:t;return c?d(a,l,c):d(a,l)}}function F_(e,t){return n;function n(i,o,a,l){const c=Array.isArray(a.children),f=hf(i);return t(o,a,l,c,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function z_(e,t){const n={};let i,o;for(o in t.properties)if(o!=="children"&&pf.call(t.properties,o)){const a=U_(e,o,t.properties[o]);if(a){const[l,c]=a;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&A_.has(t.tagName)?i=c:n[l]=c}}if(i){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function B_(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const a=i.data.estree.body[0];a.type;const l=a.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else js(e,t.position);else{const o=i.name;let a;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const c=i.value.data.estree.body[0];c.type,a=e.evaluater.evaluateExpression(c.expression)}else js(e,t.position);else a=i.value===null?!0:i.value;n[o]=a}return n}function gf(e,t){const n=[];let i=-1;const o=e.passKeys?new Map:I_;for(;++i<t.children.length;){const a=t.children[i];let l;if(e.passKeys){const f=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(f){const d=o.get(f)||0;l=f+"-"+d,o.set(f,d+1)}}const c=Ly(e,a,l);c!==void 0&&n.push(c)}return n}function U_(e,t,n){const i=Ug(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?Wg(n):Hg(n)),i.property==="style"){let o=typeof n=="object"?n:V_(e,String(n));return e.stylePropertyNameCase==="css"&&(o=G_(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&i.space?f0[i.property]||i.property:i.attribute,n]}}function V_(e,t){try{return b_(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,o=new Tt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=Ry+"#cannot-parse-style-attribute",o}}function My(e,t,n){let i;if(!n)i={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let a=-1,l;for(;++a<o.length;){const c=Cm(o[a])?{type:"Identifier",name:o[a]}:{type:"Literal",value:o[a]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(a&&c.type==="Literal"),optional:!1}:c}i=l}else i=Cm(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const o=i.value;return pf.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(i);js(e)}function js(e,t){const n=new Tt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Ry+"#cannot-handle-mdx-estrees-without-createevaluater",n}function G_(e){const t={};let n;for(n in e)pf.call(e,n)&&(t[W_(n)]=e[n]);return t}function W_(e){let t=e.replace(N_,H_);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function H_(e){return"-"+e.toLowerCase()}const ic={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"]},q_={};function yf(e,t){const n=q_,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Oy(e,i,o)}function Oy(e,t,n){if(K_(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Am(e.children,t,n)}return Array.isArray(e)?Am(e,t,n):""}function Am(e,t,n){const i=[];let o=-1;for(;++o<e.length;)i[o]=Oy(e[o],t,n);return i.join("")}function K_(e){return!!(e&&typeof e=="object")}const Pm=document.createElement("i");function kf(e){const t="&"+e+";";Pm.innerHTML=t;const n=Pm.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Yt(e,t,n,i){const o=e.length;let a=0,l;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,i.length<1e4)l=Array.from(i),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<i.length;)l=i.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function ln(e,t){return e.length>0?(Yt(e,e.length,0,t),e):t}const Rm={}.hasOwnProperty;function Dy(e){const t={};let n=-1;for(;++n<e.length;)Q_(t,e[n]);return t}function Q_(e,t){let n;for(n in t){const o=(Rm.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){Rm.call(o,l)||(o[l]=[]);const c=a[l];X_(o[l],Array.isArray(c)?c:c?[c]:[])}}}function X_(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);Yt(e,0,0,i)}function $y(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Sn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const jt=kr(/[A-Za-z]/),Nt=kr(/[\dA-Za-z]/),Y_=kr(/[#-'*+\--9=?A-Z^-~]/);function Al(e){return e!==null&&(e<32||e===127)}const zc=kr(/\d/),J_=kr(/[\dA-Fa-f]/),Z_=kr(/[!-/:-@[-`{-~]/);function we(e){return e!==null&&e<-2}function We(e){return e!==null&&(e<0||e===32)}function $e(e){return e===-2||e===-1||e===32}const Ul=kr(new RegExp("\\p{P}|\\p{S}","u")),Gr=kr(/\s/);function kr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ri(e){const t=[];let n=-1,i=0,o=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&Nt(e.charCodeAt(n+1))&&Nt(e.charCodeAt(n+2)))o=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const c=e.charCodeAt(n+1);a<56320&&c>56319&&c<57344?(l=String.fromCharCode(a,c),o=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(i,n),encodeURIComponent(l)),i=n+o+1,l=""),o&&(n+=o,o=0)}return t.join("")+e.slice(i)}function Fe(e,t,n,i){const o=i?i-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(f){return $e(f)?(e.enter(n),c(f)):t(f)}function c(f){return $e(f)&&a++<o?(e.consume(f),c):(e.exit(n),t(f))}}const eb={tokenize:tb};function tb(e){const t=e.attempt(this.parser.constructs.contentInitial,i,o);let n;return t;function i(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Fe(e,t,"linePrefix")}function o(c){return e.enter("paragraph"),a(c)}function a(c){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return we(c)?(e.consume(c),e.exit("chunkText"),a):(e.consume(c),l)}}const nb={tokenize:rb},Lm={tokenize:ib};function rb(e){const t=this,n=[];let i=0,o,a,l;return c;function c(E){if(i<n.length){const B=n[i];return t.containerState=B[1],e.attempt(B[0].continuation,f,d)(E)}return d(E)}function f(E){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&b();const B=t.events.length;let O=B,D;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){D=t.events[O][1].end;break}C(i);let ie=B;for(;ie<t.events.length;)t.events[ie][1].end={...D},ie++;return Yt(t.events,O+1,0,t.events.slice(B)),t.events.length=ie,d(E)}return c(E)}function d(E){if(i===n.length){if(!o)return y(E);if(o.currentConstruct&&o.currentConstruct.concrete)return w(E);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Lm,p,m)(E)}function p(E){return o&&b(),C(i),y(E)}function m(E){return t.parser.lazy[t.now().line]=i!==n.length,l=t.now().offset,w(E)}function y(E){return t.containerState={},e.attempt(Lm,v,w)(E)}function v(E){return i++,n.push([t.currentConstruct,t.containerState]),y(E)}function w(E){if(E===null){o&&b(),C(0),e.consume(E);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:a}),_(E)}function _(E){if(E===null){N(e.exit("chunkFlow"),!0),C(0),e.consume(E);return}return we(E)?(e.consume(E),N(e.exit("chunkFlow")),i=0,t.interrupt=void 0,c):(e.consume(E),_)}function N(E,B){const O=t.sliceStream(E);if(B&&O.push(null),E.previous=a,a&&(a.next=E),a=E,o.defineSkip(E.start),o.write(O),t.parser.lazy[E.start.line]){let D=o.events.length;for(;D--;)if(o.events[D][1].start.offset<l&&(!o.events[D][1].end||o.events[D][1].end.offset>l))return;const ie=t.events.length;let U=ie,ce,R;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if(ce){R=t.events[U][1].end;break}ce=!0}for(C(i),D=ie;D<t.events.length;)t.events[D][1].end={...R},D++;Yt(t.events,U+1,0,t.events.slice(ie)),t.events.length=D}}function C(E){let B=n.length;for(;B-- >E;){const O=n[B];t.containerState=O[1],O[0].exit.call(t,e)}n.length=E}function b(){o.write([null]),a=void 0,o=void 0,t.containerState._closeFlow=void 0}}function ib(e,t,n){return Fe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ii(e){if(e===null||We(e)||Gr(e))return 1;if(Ul(e))return 2}function Vl(e,t,n){const i=[];let o=-1;for(;++o<e.length;){const a=e[o].resolveAll;a&&!i.includes(a)&&(t=a(t,n),i.push(a))}return t}const Bc={name:"attention",resolveAll:sb,tokenize:ob};function sb(e,t){let n=-1,i,o,a,l,c,f,d,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(i=n;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[i][1].end},y={...e[n][1].start};jm(m,-f),jm(y,f),l={type:f>1?"strongSequence":"emphasisSequence",start:m,end:{...e[i][1].end}},c={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},a={type:f>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},o={type:f>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[i][1].end={...l.start},e[n][1].start={...c.end},d=[],e[i][1].end.offset-e[i][1].start.offset&&(d=ln(d,[["enter",e[i][1],t],["exit",e[i][1],t]])),d=ln(d,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",a,t]]),d=ln(d,Vl(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),d=ln(d,[["exit",a,t],["enter",c,t],["exit",c,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,d=ln(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Yt(e,i-1,n-i+3,d),n=i+d.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function ob(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,o=Ii(i);let a;return l;function l(f){return a=f,e.enter("attentionSequence"),c(f)}function c(f){if(f===a)return e.consume(f),c;const d=e.exit("attentionSequence"),p=Ii(f),m=!p||p===2&&o||n.includes(f),y=!o||o===2&&p||n.includes(i);return d._open=!!(a===42?m:m&&(o||!y)),d._close=!!(a===42?y:y&&(p||!m)),t(f)}}function jm(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const lb={name:"autolink",tokenize:ab};function ab(e,t,n){let i=0;return o;function o(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(v){return jt(v)?(e.consume(v),l):v===64?n(v):d(v)}function l(v){return v===43||v===45||v===46||Nt(v)?(i=1,c(v)):d(v)}function c(v){return v===58?(e.consume(v),i=0,f):(v===43||v===45||v===46||Nt(v))&&i++<32?(e.consume(v),c):(i=0,d(v))}function f(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||Al(v)?n(v):(e.consume(v),f)}function d(v){return v===64?(e.consume(v),p):Y_(v)?(e.consume(v),d):n(v)}function p(v){return Nt(v)?m(v):n(v)}function m(v){return v===46?(e.consume(v),i=0,p):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):y(v)}function y(v){if((v===45||Nt(v))&&i++<63){const w=v===45?y:m;return e.consume(v),w}return n(v)}}const zs={partial:!0,tokenize:ub};function ub(e,t,n){return i;function i(a){return $e(a)?Fe(e,o,"linePrefix")(a):o(a)}function o(a){return a===null||we(a)?t(a):n(a)}}const Fy={continuation:{tokenize:fb},exit:db,name:"blockQuote",tokenize:cb};function cb(e,t,n){const i=this;return o;function o(l){if(l===62){const c=i.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return $e(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function fb(e,t,n){const i=this;return o;function o(l){return $e(l)?Fe(e,a,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(Fy,t,n)(l)}}function db(e){e.exit("blockQuote")}const zy={name:"characterEscape",tokenize:hb};function hb(e,t,n){return i;function i(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),o}function o(a){return Z_(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const By={name:"characterReference",tokenize:pb};function pb(e,t,n){const i=this;let o=0,a,l;return c;function c(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),f}function f(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),a=31,l=Nt,p(m))}function d(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=J_,p):(e.enter("characterReferenceValue"),a=7,l=zc,p(m))}function p(m){if(m===59&&o){const y=e.exit("characterReferenceValue");return l===Nt&&!kf(i.sliceSerialize(y))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(m)&&o++<a?(e.consume(m),p):n(m)}}const Mm={partial:!0,tokenize:gb},Om={concrete:!0,name:"codeFenced",tokenize:mb};function mb(e,t,n){const i=this,o={partial:!0,tokenize:O};let a=0,l=0,c;return f;function f(D){return d(D)}function d(D){const ie=i.events[i.events.length-1];return a=ie&&ie[1].type==="linePrefix"?ie[2].sliceSerialize(ie[1],!0).length:0,c=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(D)}function p(D){return D===c?(l++,e.consume(D),p):l<3?n(D):(e.exit("codeFencedFenceSequence"),$e(D)?Fe(e,m,"whitespace")(D):m(D))}function m(D){return D===null||we(D)?(e.exit("codeFencedFence"),i.interrupt?t(D):e.check(Mm,_,B)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(D))}function y(D){return D===null||we(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(D)):$e(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Fe(e,v,"whitespace")(D)):D===96&&D===c?n(D):(e.consume(D),y)}function v(D){return D===null||we(D)?m(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(D))}function w(D){return D===null||we(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(D)):D===96&&D===c?n(D):(e.consume(D),w)}function _(D){return e.attempt(o,B,N)(D)}function N(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),C}function C(D){return a>0&&$e(D)?Fe(e,b,"linePrefix",a+1)(D):b(D)}function b(D){return D===null||we(D)?e.check(Mm,_,B)(D):(e.enter("codeFlowValue"),E(D))}function E(D){return D===null||we(D)?(e.exit("codeFlowValue"),b(D)):(e.consume(D),E)}function B(D){return e.exit("codeFenced"),t(D)}function O(D,ie,U){let ce=0;return R;function R(te){return D.enter("lineEnding"),D.consume(te),D.exit("lineEnding"),H}function H(te){return D.enter("codeFencedFence"),$e(te)?Fe(D,J,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(te):J(te)}function J(te){return te===c?(D.enter("codeFencedFenceSequence"),fe(te)):U(te)}function fe(te){return te===c?(ce++,D.consume(te),fe):ce>=l?(D.exit("codeFencedFenceSequence"),$e(te)?Fe(D,ee,"whitespace")(te):ee(te)):U(te)}function ee(te){return te===null||we(te)?(D.exit("codeFencedFence"),ie(te)):U(te)}}}function gb(e,t,n){const i=this;return o;function o(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return i.parser.lazy[i.now().line]?n(l):t(l)}}const sc={name:"codeIndented",tokenize:kb},yb={partial:!0,tokenize:vb};function kb(e,t,n){const i=this;return o;function o(d){return e.enter("codeIndented"),Fe(e,a,"linePrefix",5)(d)}function a(d){const p=i.events[i.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(d):n(d)}function l(d){return d===null?f(d):we(d)?e.attempt(yb,l,f)(d):(e.enter("codeFlowValue"),c(d))}function c(d){return d===null||we(d)?(e.exit("codeFlowValue"),l(d)):(e.consume(d),c)}function f(d){return e.exit("codeIndented"),t(d)}}function vb(e,t,n){const i=this;return o;function o(l){return i.parser.lazy[i.now().line]?n(l):we(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):Fe(e,a,"linePrefix",5)(l)}function a(l){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):we(l)?o(l):n(l)}}const wb={name:"codeText",previous:Sb,resolve:xb,tokenize:Cb};function xb(e){let t=e.length-4,n=3,i,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i<t;)if(e[i][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(i=n-1,t++;++i<=t;)o===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(o=i):(i===t||e[i][1].type==="lineEnding")&&(e[o][1].type="codeTextData",i!==o+2&&(e[o][1].end=e[i-1][1].end,e.splice(o+2,i-o-2),t-=i-o-2,i=o+2),o=void 0);return e}function Sb(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Cb(e,t,n){let i=0,o,a;return l;function l(m){return e.enter("codeText"),e.enter("codeTextSequence"),c(m)}function c(m){return m===96?(e.consume(m),i++,c):(e.exit("codeTextSequence"),f(m))}function f(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),f):m===96?(a=e.enter("codeTextSequence"),o=0,p(m)):we(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),f):(e.enter("codeTextData"),d(m))}function d(m){return m===null||m===32||m===96||we(m)?(e.exit("codeTextData"),f(m)):(e.consume(m),d)}function p(m){return m===96?(e.consume(m),o++,p):o===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(a.type="codeTextData",d(m))}}class _b{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,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const o=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&ws(this.left,i),a.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),ws(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ws(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 n=this.left.splice(t,Number.POSITIVE_INFINITY);ws(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ws(this.left,n.reverse())}}}function ws(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Uy(e){const t={};let n=-1,i,o,a,l,c,f,d;const p=new _b(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(i=p.get(n),n&&i[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(f=i[1]._tokenizer.events,a=0,a<f.length&&f[a][1].type==="lineEndingBlank"&&(a+=2),a<f.length&&f[a][1].type==="content"))for(;++a<f.length&&f[a][1].type!=="content";)f[a][1].type==="chunkText"&&(f[a][1]._isInFirstContentOfListItem=!0,a++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,bb(p,n)),n=t[n],d=!0);else if(i[1]._container){for(a=n,o=void 0;a--;)if(l=p.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(o&&(p.get(o)[1].type="lineEndingBlank"),l[1].type="lineEnding",o=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;o&&(i[1].end={...p.get(o)[1].start},c=p.slice(o,n),c.unshift(i),p.splice(o,n-o+1,c))}}return Yt(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!d}function bb(e,t){const n=e.get(t)[1],i=e.get(t)[2];let o=t-1;const a=[];let l=n._tokenizer;l||(l=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,f=[],d={};let p,m,y=-1,v=n,w=0,_=0;const N=[_];for(;v;){for(;e.get(++o)[1]!==v;);a.push(o),v._tokenizer||(p=i.sliceStream(v),v.next||p.push(null),m&&l.defineSkip(v.start),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),m=v,v=v.next}for(v=n;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(_=y+1,N.push(_),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(l.events=[],v?(v._tokenizer=void 0,v.previous=void 0):N.pop(),y=N.length;y--;){const C=c.slice(N[y],N[y+1]),b=a.pop();f.push([b,b+C.length-1]),e.splice(b,2,C)}for(f.reverse(),y=-1;++y<f.length;)d[w+f[y][0]]=w+f[y][1],w+=f[y][1]-f[y][0]-1;return d}const Eb={resolve:Nb,tokenize:Tb},Ib={partial:!0,tokenize:Ab};function Nb(e){return Uy(e),e}function Tb(e,t){let n;return i;function i(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(c)}function o(c){return c===null?a(c):we(c)?e.check(Ib,l,a)(c):(e.consume(c),o)}function a(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function Ab(e,t,n){const i=this;return o;function o(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Fe(e,a,"linePrefix")}function a(l){if(l===null||we(l))return n(l);const c=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(i.parser.constructs.flow,n,t)(l)}}function Vy(e,t,n,i,o,a,l,c,f){const d=f||Number.POSITIVE_INFINITY;let p=0;return m;function m(C){return C===60?(e.enter(i),e.enter(o),e.enter(a),e.consume(C),e.exit(a),y):C===null||C===32||C===41||Al(C)?n(C):(e.enter(i),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),_(C))}function y(C){return C===62?(e.enter(a),e.consume(C),e.exit(a),e.exit(o),e.exit(i),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),v(C))}function v(C){return C===62?(e.exit("chunkString"),e.exit(c),y(C)):C===null||C===60||we(C)?n(C):(e.consume(C),C===92?w:v)}function w(C){return C===60||C===62||C===92?(e.consume(C),v):v(C)}function _(C){return!p&&(C===null||C===41||We(C))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(i),t(C)):p<d&&C===40?(e.consume(C),p++,_):C===41?(e.consume(C),p--,_):C===null||C===32||C===40||Al(C)?n(C):(e.consume(C),C===92?N:_)}function N(C){return C===40||C===41||C===92?(e.consume(C),_):_(C)}}function Gy(e,t,n,i,o,a){const l=this;let c=0,f;return d;function d(v){return e.enter(i),e.enter(o),e.consume(v),e.exit(o),e.enter(a),p}function p(v){return c>999||v===null||v===91||v===93&&!f||v===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(v):v===93?(e.exit(a),e.enter(o),e.consume(v),e.exit(o),e.exit(i),t):we(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===null||v===91||v===93||we(v)||c++>999?(e.exit("chunkString"),p(v)):(e.consume(v),f||(f=!$e(v)),v===92?y:m)}function y(v){return v===91||v===92||v===93?(e.consume(v),c++,m):m(v)}}function Wy(e,t,n,i,o,a){let l;return c;function c(y){return y===34||y===39||y===40?(e.enter(i),e.enter(o),e.consume(y),e.exit(o),l=y===40?41:y,f):n(y)}function f(y){return y===l?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),t):(e.enter(a),d(y))}function d(y){return y===l?(e.exit(a),f(l)):y===null?n(y):we(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),Fe(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===l||y===null||we(y)?(e.exit("chunkString"),d(y)):(e.consume(y),y===92?m:p)}function m(y){return y===l||y===92?(e.consume(y),p):p(y)}}function Is(e,t){let n;return i;function i(o){return we(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):$e(o)?Fe(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}const Pb={name:"definition",tokenize:Lb},Rb={partial:!0,tokenize:jb};function Lb(e,t,n){const i=this;let o;return a;function a(v){return e.enter("definition"),l(v)}function l(v){return Gy.call(i,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return o=Sn(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),f):n(v)}function f(v){return We(v)?Is(e,d)(v):d(v)}function d(v){return Vy(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(Rb,m,m)(v)}function m(v){return $e(v)?Fe(e,y,"whitespace")(v):y(v)}function y(v){return v===null||we(v)?(e.exit("definition"),i.parser.defined.push(o),t(v)):n(v)}}function jb(e,t,n){return i;function i(c){return We(c)?Is(e,o)(c):n(c)}function o(c){return Wy(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function a(c){return $e(c)?Fe(e,l,"whitespace")(c):l(c)}function l(c){return c===null||we(c)?t(c):n(c)}}const Mb={name:"hardBreakEscape",tokenize:Ob};function Ob(e,t,n){return i;function i(a){return e.enter("hardBreakEscape"),e.consume(a),o}function o(a){return we(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Db={name:"headingAtx",resolve:$b,tokenize:Fb};function $b(e,t){let n=e.length-2,i=3,o,a;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},a={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Yt(e,i,n-i+1,[["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t]])),e}function Fb(e,t,n){let i=0;return o;function o(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&i++<6?(e.consume(p),l):p===null||We(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),f(p)):p===null||we(p)?(e.exit("atxHeading"),t(p)):$e(p)?Fe(e,c,"whitespace")(p):(e.enter("atxHeadingText"),d(p))}function f(p){return p===35?(e.consume(p),f):(e.exit("atxHeadingSequence"),c(p))}function d(p){return p===null||p===35||We(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),d)}}const zb=["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"],Dm=["pre","script","style","textarea"],Bb={concrete:!0,name:"htmlFlow",resolveTo:Gb,tokenize:Wb},Ub={partial:!0,tokenize:qb},Vb={partial:!0,tokenize:Hb};function Gb(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 Wb(e,t,n){const i=this;let o,a,l,c,f;return d;function d(T){return p(T)}function p(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),m}function m(T){return T===33?(e.consume(T),y):T===47?(e.consume(T),a=!0,_):T===63?(e.consume(T),o=3,i.interrupt?t:I):jt(T)?(e.consume(T),l=String.fromCharCode(T),N):n(T)}function y(T){return T===45?(e.consume(T),o=2,v):T===91?(e.consume(T),o=5,c=0,w):jt(T)?(e.consume(T),o=4,i.interrupt?t:I):n(T)}function v(T){return T===45?(e.consume(T),i.interrupt?t:I):n(T)}function w(T){const ye="CDATA[";return T===ye.charCodeAt(c++)?(e.consume(T),c===ye.length?i.interrupt?t:J:w):n(T)}function _(T){return jt(T)?(e.consume(T),l=String.fromCharCode(T),N):n(T)}function N(T){if(T===null||T===47||T===62||We(T)){const ye=T===47,be=l.toLowerCase();return!ye&&!a&&Dm.includes(be)?(o=1,i.interrupt?t(T):J(T)):zb.includes(l.toLowerCase())?(o=6,ye?(e.consume(T),C):i.interrupt?t(T):J(T)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(T):a?b(T):E(T))}return T===45||Nt(T)?(e.consume(T),l+=String.fromCharCode(T),N):n(T)}function C(T){return T===62?(e.consume(T),i.interrupt?t:J):n(T)}function b(T){return $e(T)?(e.consume(T),b):R(T)}function E(T){return T===47?(e.consume(T),R):T===58||T===95||jt(T)?(e.consume(T),B):$e(T)?(e.consume(T),E):R(T)}function B(T){return T===45||T===46||T===58||T===95||Nt(T)?(e.consume(T),B):O(T)}function O(T){return T===61?(e.consume(T),D):$e(T)?(e.consume(T),O):E(T)}function D(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),f=T,ie):$e(T)?(e.consume(T),D):U(T)}function ie(T){return T===f?(e.consume(T),f=null,ce):T===null||we(T)?n(T):(e.consume(T),ie)}function U(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||We(T)?O(T):(e.consume(T),U)}function ce(T){return T===47||T===62||$e(T)?E(T):n(T)}function R(T){return T===62?(e.consume(T),H):n(T)}function H(T){return T===null||we(T)?J(T):$e(T)?(e.consume(T),H):n(T)}function J(T){return T===45&&o===2?(e.consume(T),xe):T===60&&o===1?(e.consume(T),_e):T===62&&o===4?(e.consume(T),M):T===63&&o===3?(e.consume(T),I):T===93&&o===5?(e.consume(T),ae):we(T)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(Ub,W,fe)(T)):T===null||we(T)?(e.exit("htmlFlowData"),fe(T)):(e.consume(T),J)}function fe(T){return e.check(Vb,ee,W)(T)}function ee(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),te}function te(T){return T===null||we(T)?fe(T):(e.enter("htmlFlowData"),J(T))}function xe(T){return T===45?(e.consume(T),I):J(T)}function _e(T){return T===47?(e.consume(T),l="",re):J(T)}function re(T){if(T===62){const ye=l.toLowerCase();return Dm.includes(ye)?(e.consume(T),M):J(T)}return jt(T)&&l.length<8?(e.consume(T),l+=String.fromCharCode(T),re):J(T)}function ae(T){return T===93?(e.consume(T),I):J(T)}function I(T){return T===62?(e.consume(T),M):T===45&&o===2?(e.consume(T),I):J(T)}function M(T){return T===null||we(T)?(e.exit("htmlFlowData"),W(T)):(e.consume(T),M)}function W(T){return e.exit("htmlFlow"),t(T)}}function Hb(e,t,n){const i=this;return o;function o(l){return we(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return i.parser.lazy[i.now().line]?n(l):t(l)}}function qb(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(zs,t,n)}}const Kb={name:"htmlText",tokenize:Qb};function Qb(e,t,n){const i=this;let o,a,l;return c;function c(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),f}function f(I){return I===33?(e.consume(I),d):I===47?(e.consume(I),O):I===63?(e.consume(I),E):jt(I)?(e.consume(I),U):n(I)}function d(I){return I===45?(e.consume(I),p):I===91?(e.consume(I),a=0,w):jt(I)?(e.consume(I),b):n(I)}function p(I){return I===45?(e.consume(I),v):n(I)}function m(I){return I===null?n(I):I===45?(e.consume(I),y):we(I)?(l=m,_e(I)):(e.consume(I),m)}function y(I){return I===45?(e.consume(I),v):m(I)}function v(I){return I===62?xe(I):I===45?y(I):m(I)}function w(I){const M="CDATA[";return I===M.charCodeAt(a++)?(e.consume(I),a===M.length?_:w):n(I)}function _(I){return I===null?n(I):I===93?(e.consume(I),N):we(I)?(l=_,_e(I)):(e.consume(I),_)}function N(I){return I===93?(e.consume(I),C):_(I)}function C(I){return I===62?xe(I):I===93?(e.consume(I),C):_(I)}function b(I){return I===null||I===62?xe(I):we(I)?(l=b,_e(I)):(e.consume(I),b)}function E(I){return I===null?n(I):I===63?(e.consume(I),B):we(I)?(l=E,_e(I)):(e.consume(I),E)}function B(I){return I===62?xe(I):E(I)}function O(I){return jt(I)?(e.consume(I),D):n(I)}function D(I){return I===45||Nt(I)?(e.consume(I),D):ie(I)}function ie(I){return we(I)?(l=ie,_e(I)):$e(I)?(e.consume(I),ie):xe(I)}function U(I){return I===45||Nt(I)?(e.consume(I),U):I===47||I===62||We(I)?ce(I):n(I)}function ce(I){return I===47?(e.consume(I),xe):I===58||I===95||jt(I)?(e.consume(I),R):we(I)?(l=ce,_e(I)):$e(I)?(e.consume(I),ce):xe(I)}function R(I){return I===45||I===46||I===58||I===95||Nt(I)?(e.consume(I),R):H(I)}function H(I){return I===61?(e.consume(I),J):we(I)?(l=H,_e(I)):$e(I)?(e.consume(I),H):ce(I)}function J(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),o=I,fe):we(I)?(l=J,_e(I)):$e(I)?(e.consume(I),J):(e.consume(I),ee)}function fe(I){return I===o?(e.consume(I),o=void 0,te):I===null?n(I):we(I)?(l=fe,_e(I)):(e.consume(I),fe)}function ee(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||We(I)?ce(I):(e.consume(I),ee)}function te(I){return I===47||I===62||We(I)?ce(I):n(I)}function xe(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function _e(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),re}function re(I){return $e(I)?Fe(e,ae,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):ae(I)}function ae(I){return e.enter("htmlTextData"),l(I)}}const vf={name:"labelEnd",resolveAll:Zb,resolveTo:eE,tokenize:tE},Xb={tokenize:nE},Yb={tokenize:rE},Jb={tokenize:iE};function Zb(e){let t=-1;const n=[];for(;++t<e.length;){const i=e[t][1];if(n.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const o=i.type==="labelImage"?4:2;i.type="data",t+=o}}return e.length!==n.length&&Yt(e,0,e.length,n),e}function eE(e,t){let n=e.length,i=0,o,a,l,c;for(;n--;)if(o=e[n][1],a){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(a=n,o.type!=="labelLink")){i=2;break}}else o.type==="labelEnd"&&(l=n);const f={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},p={type:"labelText",start:{...e[a+i+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",f,t],["enter",d,t]],c=ln(c,e.slice(a+1,a+i+3)),c=ln(c,[["enter",p,t]]),c=ln(c,Vl(t.parser.constructs.insideSpan.null,e.slice(a+i+4,l-3),t)),c=ln(c,[["exit",p,t],e[l-2],e[l-1],["exit",d,t]]),c=ln(c,e.slice(l+1)),c=ln(c,[["exit",f,t]]),Yt(e,a,e.length,c),e}function tE(e,t,n){const i=this;let o=i.events.length,a,l;for(;o--;)if((i.events[o][1].type==="labelImage"||i.events[o][1].type==="labelLink")&&!i.events[o][1]._balanced){a=i.events[o][1];break}return c;function c(y){return a?a._inactive?m(y):(l=i.parser.defined.includes(Sn(i.sliceSerialize({start:a.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),f):n(y)}function f(y){return y===40?e.attempt(Xb,p,l?p:m)(y):y===91?e.attempt(Yb,p,l?d:m)(y):l?p(y):m(y)}function d(y){return e.attempt(Jb,p,m)(y)}function p(y){return t(y)}function m(y){return a._balanced=!0,n(y)}}function nE(e,t,n){return i;function i(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),o}function o(m){return We(m)?Is(e,a)(m):a(m)}function a(m){return m===41?p(m):Vy(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function l(m){return We(m)?Is(e,f)(m):p(m)}function c(m){return n(m)}function f(m){return m===34||m===39||m===40?Wy(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function d(m){return We(m)?Is(e,p)(m):p(m)}function p(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function rE(e,t,n){const i=this;return o;function o(c){return Gy.call(i,e,a,l,"reference","referenceMarker","referenceString")(c)}function a(c){return i.parser.defined.includes(Sn(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function iE(e,t,n){return i;function i(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),o}function o(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const sE={name:"labelStartImage",resolveAll:vf.resolveAll,tokenize:oE};function oE(e,t,n){const i=this;return o;function o(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),a}function a(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(c):t(c)}}const lE={name:"labelStartLink",resolveAll:vf.resolveAll,tokenize:aE};function aE(e,t,n){const i=this;return o;function o(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(l):t(l)}}const oc={name:"lineEnding",tokenize:uE};function uE(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),Fe(e,t,"linePrefix")}}const gl={name:"thematicBreak",tokenize:cE};function cE(e,t,n){let i=0,o;return a;function a(d){return e.enter("thematicBreak"),l(d)}function l(d){return o=d,c(d)}function c(d){return d===o?(e.enter("thematicBreakSequence"),f(d)):i>=3&&(d===null||we(d))?(e.exit("thematicBreak"),t(d)):n(d)}function f(d){return d===o?(e.consume(d),i++,f):(e.exit("thematicBreakSequence"),$e(d)?Fe(e,c,"whitespace")(d):c(d))}}const Bt={continuation:{tokenize:pE},exit:gE,name:"list",tokenize:hE},fE={partial:!0,tokenize:yE},dE={partial:!0,tokenize:mE};function hE(e,t,n){const i=this,o=i.events[i.events.length-1];let a=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,l=0;return c;function c(v){const w=i.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!i.containerState.marker||v===i.containerState.marker:zc(v)){if(i.containerState.type||(i.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(gl,n,d)(v):d(v);if(!i.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(v)}return n(v)}function f(v){return zc(v)&&++l<10?(e.consume(v),f):(!i.interrupt||l<2)&&(i.containerState.marker?v===i.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),d(v)):n(v)}function d(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||v,e.check(zs,i.interrupt?n:p,e.attempt(fE,y,m))}function p(v){return i.containerState.initialBlankLine=!0,a++,y(v)}function m(v){return $e(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),y):n(v)}function y(v){return i.containerState.size=a+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function pE(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(zs,o,a);function o(c){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Fe(e,t,"listItemIndent",i.containerState.size+1)(c)}function a(c){return i.containerState.furtherBlankLines||!$e(c)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,l(c)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(dE,t,l)(c))}function l(c){return i.containerState._closeFlow=!0,i.interrupt=void 0,Fe(e,e.attempt(Bt,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function mE(e,t,n){const i=this;return Fe(e,o,"listItemIndent",i.containerState.size+1);function o(a){const l=i.events[i.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===i.containerState.size?t(a):n(a)}}function gE(e){e.exit(this.containerState.type)}function yE(e,t,n){const i=this;return Fe(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(a){const l=i.events[i.events.length-1];return!$e(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const $m={name:"setextUnderline",resolveTo:kE,tokenize:vE};function kE(e,t){let n=e.length,i,o,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const l={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",a?(e.splice(o,0,["enter",l,t]),e.splice(a+1,0,["exit",e[i][1],t]),e[i][1].end={...e[a][1].end}):e[i][1]=l,e.push(["exit",l,t]),e}function vE(e,t,n){const i=this;let o;return a;function a(d){let p=i.events.length,m;for(;p--;)if(i.events[p][1].type!=="lineEnding"&&i.events[p][1].type!=="linePrefix"&&i.events[p][1].type!=="content"){m=i.events[p][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||m)?(e.enter("setextHeadingLine"),o=d,l(d)):n(d)}function l(d){return e.enter("setextHeadingLineSequence"),c(d)}function c(d){return d===o?(e.consume(d),c):(e.exit("setextHeadingLineSequence"),$e(d)?Fe(e,f,"lineSuffix")(d):f(d))}function f(d){return d===null||we(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const wE={tokenize:xE};function xE(e){const t=this,n=e.attempt(zs,i,e.attempt(this.parser.constructs.flowInitial,o,Fe(e,e.attempt(this.parser.constructs.flow,o,e.attempt(Eb,o)),"linePrefix")));return n;function i(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const SE={resolveAll:qy()},CE=Hy("string"),_E=Hy("text");function Hy(e){return{resolveAll:qy(e==="text"?bE:void 0),tokenize:t};function t(n){const i=this,o=this.parser.constructs[e],a=n.attempt(o,l,c);return l;function l(p){return d(p)?a(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),f}function f(p){return d(p)?(n.exit("data"),a(p)):(n.consume(p),f)}function d(p){if(p===null)return!0;const m=o[p];let y=-1;if(m)for(;++y<m.length;){const v=m[y];if(!v.previous||v.previous.call(i,i.previous))return!0}return!1}}}function qy(e){return t;function t(n,i){let o=-1,a;for(;++o<=n.length;)a===void 0?n[o]&&n[o][1].type==="data"&&(a=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==a+2&&(n[a][1].end=n[o-1][1].end,n.splice(a+2,o-a-2),o=a+2),a=void 0);return e?e(n,i):n}}function bE(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const i=e[n-1][1],o=t.sliceStream(i);let a=o.length,l=-1,c=0,f;for(;a--;){const d=o[a];if(typeof d=="string"){for(l=d.length;d.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(d===-2)f=!0,c++;else if(d!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const d={type:n===e.length||f||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:i.start._bufferIndex+l,_index:i.start._index+a,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...d.start},i.start.offset===i.end.offset?Object.assign(i,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const EE={42:Bt,43:Bt,45:Bt,48:Bt,49:Bt,50:Bt,51:Bt,52:Bt,53:Bt,54:Bt,55:Bt,56:Bt,57:Bt,62:Fy},IE={91:Pb},NE={[-2]:sc,[-1]:sc,32:sc},TE={35:Db,42:gl,45:[$m,gl],60:Bb,61:$m,95:gl,96:Om,126:Om},AE={38:By,92:zy},PE={[-5]:oc,[-4]:oc,[-3]:oc,33:sE,38:By,42:Bc,60:[lb,Kb],91:lE,92:[Mb,zy],93:vf,95:Bc,96:wb},RE={null:[Bc,SE]},LE={null:[42,95]},jE={null:[]},ME=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:LE,contentInitial:IE,disable:jE,document:EE,flow:TE,flowInitial:NE,insideSpan:RE,string:AE,text:PE},Symbol.toStringTag,{value:"Module"}));function OE(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},a=[];let l=[],c=[];const f={attempt:ie(O),check:ie(D),consume:b,enter:E,exit:B,interrupt:ie(D,{interrupt:!0})},d={code:null,containerState:{},defineSkip:_,events:[],now:w,parser:e,previous:null,sliceSerialize:y,sliceStream:v,write:m};let p=t.tokenize.call(d,f);return t.resolveAll&&a.push(t),d;function m(H){return l=ln(l,H),N(),l[l.length-1]!==null?[]:(U(t,0),d.events=Vl(a,d.events,d),d.events)}function y(H,J){return $E(v(H),J)}function v(H){return DE(l,H)}function w(){const{_bufferIndex:H,_index:J,line:fe,column:ee,offset:te}=i;return{_bufferIndex:H,_index:J,line:fe,column:ee,offset:te}}function _(H){o[H.line]=H.column,R()}function N(){let H;for(;i._index<l.length;){const J=l[i._index];if(typeof J=="string")for(H=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===H&&i._bufferIndex<J.length;)C(J.charCodeAt(i._bufferIndex));else C(J)}}function C(H){p=p(H)}function b(H){we(H)?(i.line++,i.column=1,i.offset+=H===-3?2:1,R()):H!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===l[i._index].length&&(i._bufferIndex=-1,i._index++)),d.previous=H}function E(H,J){const fe=J||{};return fe.type=H,fe.start=w(),d.events.push(["enter",fe,d]),c.push(fe),fe}function B(H){const J=c.pop();return J.end=w(),d.events.push(["exit",J,d]),J}function O(H,J){U(H,J.from)}function D(H,J){J.restore()}function ie(H,J){return fe;function fe(ee,te,xe){let _e,re,ae,I;return Array.isArray(ee)?W(ee):"tokenize"in ee?W([ee]):M(ee);function M(ge){return je;function je(Ie){const Le=Ie!==null&&ge[Ie],He=Ie!==null&&ge.null,At=[...Array.isArray(Le)?Le:Le?[Le]:[],...Array.isArray(He)?He:He?[He]:[]];return W(At)(Ie)}}function W(ge){return _e=ge,re=0,ge.length===0?xe:T(ge[re])}function T(ge){return je;function je(Ie){return I=ce(),ae=ge,ge.partial||(d.currentConstruct=ge),ge.name&&d.parser.constructs.disable.null.includes(ge.name)?be():ge.tokenize.call(J?Object.assign(Object.create(d),J):d,f,ye,be)(Ie)}}function ye(ge){return H(ae,I),te}function be(ge){return I.restore(),++re<_e.length?T(_e[re]):xe}}}function U(H,J){H.resolveAll&&!a.includes(H)&&a.push(H),H.resolve&&Yt(d.events,J,d.events.length-J,H.resolve(d.events.slice(J),d)),H.resolveTo&&(d.events=H.resolveTo(d.events,d))}function ce(){const H=w(),J=d.previous,fe=d.currentConstruct,ee=d.events.length,te=Array.from(c);return{from:ee,restore:xe};function xe(){i=H,d.previous=J,d.currentConstruct=fe,d.events.length=ee,c=te,R()}}function R(){i.line in o&&i.column<2&&(i.column=o[i.line],i.offset+=o[i.line]-1)}}function DE(e,t){const n=t.start._index,i=t.start._bufferIndex,o=t.end._index,a=t.end._bufferIndex;let l;if(n===o)l=[e[n].slice(i,a)];else{if(l=e.slice(n,o),i>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(i):l.shift()}a>0&&l.push(e[o].slice(0,a))}return l}function $E(e,t){let n=-1;const i=[];let o;for(;++n<e.length;){const a=e[n];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
171
+ `;break}case-3:{l=`\r
172
+ `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&o)continue;l=" ";break}default:l=String.fromCharCode(a)}o=a===-2,i.push(l)}return i.join("")}function FE(e){const i={constructs:Dy([ME,...(e||{}).extensions||[]]),content:o(eb),defined:[],document:o(nb),flow:o(wE),lazy:{},string:o(CE),text:o(_E)};return i;function o(a){return l;function l(c){return OE(i,a,c)}}}function zE(e){for(;!Uy(e););return e}const Fm=/[\0\t\n\r]/g;function BE(){let e=1,t="",n=!0,i;return o;function o(a,l,c){const f=[];let d,p,m,y,v;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),m=0,t="",n&&(a.charCodeAt(0)===65279&&m++,n=void 0);m<a.length;){if(Fm.lastIndex=m,d=Fm.exec(a),y=d&&d.index!==void 0?d.index:a.length,v=a.charCodeAt(y),!d){t=a.slice(m);break}if(v===10&&m===y&&i)f.push(-3),i=void 0;else switch(i&&(f.push(-5),i=void 0),m<y&&(f.push(a.slice(m,y)),e+=y-m),v){case 0:{f.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,f.push(-2);e++<p;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:i=!0,e=1}m=y+1}return c&&(i&&f.push(-5),t&&f.push(t),f.push(null)),f}}const UE=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function VE(e){return e.replace(UE,GE)}function GE(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),a=o===120||o===88;return $y(n.slice(a?2:1),a?16:10)}return kf(n)||e}const Ky={}.hasOwnProperty;function WE(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),HE(n)(zE(FE(n).document().write(BE()(e,t,!0))))}function HE(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Ne),autolinkProtocol:ce,autolinkEmail:ce,atxHeading:a(Ln),blockQuote:a(He),characterEscape:ce,characterReference:ce,codeFenced:a(At),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(At,l),codeText:a(fn,l),codeTextData:ce,data:ce,codeFlowValue:ce,definition:a(Jt),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(Rn),hardBreakEscape:a(Cn),hardBreakTrailing:a(Cn),htmlFlow:a(dn,l),htmlFlowData:ce,htmlText:a(dn,l),htmlTextData:ce,image:a(le),label:l,link:a(Ne),listItem:a(st),listItemValue:y,listOrdered:a(Oe,m),listUnordered:a(Oe),paragraph:a(Pt),reference:T,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Ln),strong:a(pt),thematicBreak:a(Mn)},exit:{atxHeading:f(),atxHeadingSequence:O,autolink:f(),autolinkEmail:Le,autolinkProtocol:Ie,blockQuote:f(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:be,characterReferenceMarkerNumeric:be,characterReferenceValue:ge,characterReference:je,codeFenced:f(N),codeFencedFence:_,codeFencedFenceInfo:v,codeFencedFenceMeta:w,codeFlowValue:R,codeIndented:f(C),codeText:f(te),codeTextData:R,data:R,definition:f(),definitionDestinationString:B,definitionLabelString:b,definitionTitleString:E,emphasis:f(),hardBreakEscape:f(J),hardBreakTrailing:f(J),htmlFlow:f(fe),htmlFlowData:R,htmlText:f(ee),htmlTextData:R,image:f(_e),label:ae,labelText:re,lineEnding:H,link:f(xe),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:ye,resourceDestinationString:I,resourceTitleString:M,resource:W,setextHeading:f(U),setextHeadingLineSequence:ie,setextHeadingText:D,strong:f(),thematicBreak:f()}};Qy(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(K){let A={type:"root",children:[]};const $={stack:[A],tokenStack:[],config:t,enter:c,exit:d,buffer:l,resume:p,data:n},Q=[];let oe=-1;for(;++oe<K.length;)if(K[oe][1].type==="listOrdered"||K[oe][1].type==="listUnordered")if(K[oe][0]==="enter")Q.push(oe);else{const Te=Q.pop();oe=o(K,Te,oe)}for(oe=-1;++oe<K.length;){const Te=t[K[oe][0]];Ky.call(Te,K[oe][1].type)&&Te[K[oe][1].type].call(Object.assign({sliceSerialize:K[oe][2].sliceSerialize},$),K[oe][1])}if($.tokenStack.length>0){const Te=$.tokenStack[$.tokenStack.length-1];(Te[1]||zm).call($,void 0,Te[0])}for(A.position={start:hr(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:hr(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},oe=-1;++oe<t.transforms.length;)A=t.transforms[oe](A)||A;return A}function o(K,A,$){let Q=A-1,oe=-1,Te=!1,Se,De,ot,qe;for(;++Q<=$;){const Je=K[Q];switch(Je[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Je[0]==="enter"?oe++:oe--,qe=void 0;break}case"lineEndingBlank":{Je[0]==="enter"&&(Se&&!qe&&!oe&&!ot&&(ot=Q),qe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:qe=void 0}if(!oe&&Je[0]==="enter"&&Je[1].type==="listItemPrefix"||oe===-1&&Je[0]==="exit"&&(Je[1].type==="listUnordered"||Je[1].type==="listOrdered")){if(Se){let Gt=Q;for(De=void 0;Gt--;){const Wt=K[Gt];if(Wt[1].type==="lineEnding"||Wt[1].type==="lineEndingBlank"){if(Wt[0]==="exit")continue;De&&(K[De][1].type="lineEndingBlank",Te=!0),Wt[1].type="lineEnding",De=Gt}else if(!(Wt[1].type==="linePrefix"||Wt[1].type==="blockQuotePrefix"||Wt[1].type==="blockQuotePrefixWhitespace"||Wt[1].type==="blockQuoteMarker"||Wt[1].type==="listItemIndent"))break}ot&&(!De||ot<De)&&(Se._spread=!0),Se.end=Object.assign({},De?K[De][1].start:Je[1].end),K.splice(De||Q,0,["exit",Se,Je[2]]),Q++,$++}if(Je[1].type==="listItemPrefix"){const Gt={type:"listItem",_spread:!1,start:Object.assign({},Je[1].start),end:void 0};Se=Gt,K.splice(Q,0,["enter",Gt,Je[2]]),Q++,$++,ot=void 0,qe=!0}}}return K[A][1]._spread=Te,$}function a(K,A){return $;function $(Q){c.call(this,K(Q),Q),A&&A.call(this,Q)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(K,A,$){this.stack[this.stack.length-1].children.push(K),this.stack.push(K),this.tokenStack.push([A,$||void 0]),K.position={start:hr(A.start),end:void 0}}function f(K){return A;function A($){K&&K.call(this,$),d.call(this,$)}}function d(K,A){const $=this.stack.pop(),Q=this.tokenStack.pop();if(Q)Q[0].type!==K.type&&(A?A.call(this,K,Q[0]):(Q[1]||zm).call(this,K,Q[0]));else throw new Error("Cannot close `"+K.type+"` ("+Es({start:K.start,end:K.end})+"): it’s not open");$.position.end=hr(K.end)}function p(){return yf(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function y(K){if(this.data.expectingFirstListItemValue){const A=this.stack[this.stack.length-2];A.start=Number.parseInt(this.sliceSerialize(K),10),this.data.expectingFirstListItemValue=void 0}}function v(){const K=this.resume(),A=this.stack[this.stack.length-1];A.lang=K}function w(){const K=this.resume(),A=this.stack[this.stack.length-1];A.meta=K}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const K=this.resume(),A=this.stack[this.stack.length-1];A.value=K.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const K=this.resume(),A=this.stack[this.stack.length-1];A.value=K.replace(/(\r?\n|\r)$/g,"")}function b(K){const A=this.resume(),$=this.stack[this.stack.length-1];$.label=A,$.identifier=Sn(this.sliceSerialize(K)).toLowerCase()}function E(){const K=this.resume(),A=this.stack[this.stack.length-1];A.title=K}function B(){const K=this.resume(),A=this.stack[this.stack.length-1];A.url=K}function O(K){const A=this.stack[this.stack.length-1];if(!A.depth){const $=this.sliceSerialize(K).length;A.depth=$}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function ie(K){const A=this.stack[this.stack.length-1];A.depth=this.sliceSerialize(K).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function ce(K){const $=this.stack[this.stack.length-1].children;let Q=$[$.length-1];(!Q||Q.type!=="text")&&(Q=jn(),Q.position={start:hr(K.start),end:void 0},$.push(Q)),this.stack.push(Q)}function R(K){const A=this.stack.pop();A.value+=this.sliceSerialize(K),A.position.end=hr(K.end)}function H(K){const A=this.stack[this.stack.length-1];if(this.data.atHardBreak){const $=A.children[A.children.length-1];$.position.end=hr(K.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(A.type)&&(ce.call(this,K),R.call(this,K))}function J(){this.data.atHardBreak=!0}function fe(){const K=this.resume(),A=this.stack[this.stack.length-1];A.value=K}function ee(){const K=this.resume(),A=this.stack[this.stack.length-1];A.value=K}function te(){const K=this.resume(),A=this.stack[this.stack.length-1];A.value=K}function xe(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const A=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=A,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function _e(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const A=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=A,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function re(K){const A=this.sliceSerialize(K),$=this.stack[this.stack.length-2];$.label=VE(A),$.identifier=Sn(A).toLowerCase()}function ae(){const K=this.stack[this.stack.length-1],A=this.resume(),$=this.stack[this.stack.length-1];if(this.data.inReference=!0,$.type==="link"){const Q=K.children;$.children=Q}else $.alt=A}function I(){const K=this.resume(),A=this.stack[this.stack.length-1];A.url=K}function M(){const K=this.resume(),A=this.stack[this.stack.length-1];A.title=K}function W(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function ye(K){const A=this.resume(),$=this.stack[this.stack.length-1];$.label=A,$.identifier=Sn(this.sliceSerialize(K)).toLowerCase(),this.data.referenceType="full"}function be(K){this.data.characterReferenceType=K.type}function ge(K){const A=this.sliceSerialize(K),$=this.data.characterReferenceType;let Q;$?(Q=$y(A,$==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Q=kf(A);const oe=this.stack[this.stack.length-1];oe.value+=Q}function je(K){const A=this.stack.pop();A.position.end=hr(K.end)}function Ie(K){R.call(this,K);const A=this.stack[this.stack.length-1];A.url=this.sliceSerialize(K)}function Le(K){R.call(this,K);const A=this.stack[this.stack.length-1];A.url="mailto:"+this.sliceSerialize(K)}function He(){return{type:"blockquote",children:[]}}function At(){return{type:"code",lang:null,meta:null,value:""}}function fn(){return{type:"inlineCode",value:""}}function Jt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Rn(){return{type:"emphasis",children:[]}}function Ln(){return{type:"heading",depth:0,children:[]}}function Cn(){return{type:"break"}}function dn(){return{type:"html",value:""}}function le(){return{type:"image",title:null,url:"",alt:null}}function Ne(){return{type:"link",title:null,url:"",children:[]}}function Oe(K){return{type:"list",ordered:K.type==="listOrdered",start:null,spread:K._spread,children:[]}}function st(K){return{type:"listItem",spread:K._spread,checked:null,children:[]}}function Pt(){return{type:"paragraph",children:[]}}function pt(){return{type:"strong",children:[]}}function jn(){return{type:"text",value:""}}function Mn(){return{type:"thematicBreak"}}}function hr(e){return{line:e.line,column:e.column,offset:e.offset}}function Qy(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?Qy(e,i):qE(e,i)}}function qE(e,t){let n;for(n in t)if(Ky.call(t,n))switch(n){case"canContainEols":{const i=t[n];i&&e[n].push(...i);break}case"transforms":{const i=t[n];i&&e[n].push(...i);break}case"enter":case"exit":{const i=t[n];i&&Object.assign(e[n],i);break}}}function zm(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Es({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Es({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Es({start:t.start,end:t.end})+") is still open")}function KE(e){const t=this;t.parser=n;function n(i){return WE(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function QE(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function XE(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
173
+ `}]}function YE(e,t){const n=t.value?t.value+`
174
+ `:"",i={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(i.className=["language-"+o[0]]);let a={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function JE(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ZE(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function eI(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),o=Ri(i.toLowerCase()),a=e.footnoteOrder.indexOf(i);let l,c=e.footnoteCounts.get(i);c===void 0?(c=0,e.footnoteOrder.push(i),l=e.footnoteOrder.length):l=a+1,c+=1,e.footnoteCounts.set(i,c);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,f);const d={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,d),e.applyData(t,d)}function tI(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nI(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Xy(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const o=e.all(t),a=o[0];a&&a.type==="text"?a.value="["+a.value:o.unshift({type:"text",value:"["});const l=o[o.length-1];return l&&l.type==="text"?l.value+=i:o.push({type:"text",value:i}),o}function rI(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return Xy(e,t);const o={src:Ri(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(o.title=i.title);const a={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,a),e.applyData(t,a)}function iI(e,t){const n={src:Ri(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function sI(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)}function oI(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return Xy(e,t);const o={href:Ri(i.url||"")};i.title!==null&&i.title!==void 0&&(o.title=i.title);const a={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function lI(e,t){const n={href:Ri(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function aI(e,t,n){const i=e.all(t),o=n?uI(n):Yy(t),a={},l=[];if(typeof t.checked=="boolean"){const p=i[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},i.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let c=-1;for(;++c<i.length;){const p=i[c];(o||c!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
175
+ `}),p.type==="element"&&p.tagName==="p"&&!o?l.push(...p.children):l.push(p)}const f=i[i.length-1];f&&(o||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
176
+ `});const d={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,d),e.applyData(t,d)}function uI(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i<n.length;)t=Yy(n[i])}return t}function Yy(e){const t=e.spread;return t??e.children.length>1}function cI(e,t){const n={},i=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<i.length;){const l=i[o];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function fI(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dI(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function hI(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pI(e,t){const n=e.all(t),i=n.shift(),o=[];if(i){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],l),o.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=hf(t.children[1]),f=Ay(t.children[t.children.length-1]);c&&f&&(l.position={start:c,end:f}),o.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,a),e.applyData(t,a)}function mI(e,t,n){const i=n?n.children:void 0,a=(i?i.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:t.children.length;let f=-1;const d=[];for(;++f<c;){const m=t.children[f],y={},v=l?l[f]:void 0;v&&(y.align=v);let w={type:"element",tagName:a,properties:y,children:[]};m&&(w.children=e.all(m),e.patch(m,w),w=e.applyData(m,w)),d.push(w)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,p),e.applyData(t,p)}function gI(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Bm=9,Um=32;function yI(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),o=0;const a=[];for(;i;)a.push(Vm(t.slice(o,i.index),o>0,!0),i[0]),o=i.index+i[0].length,i=n.exec(t);return a.push(Vm(t.slice(o),o>0,!1)),a.join("")}function Vm(e,t,n){let i=0,o=e.length;if(t){let a=e.codePointAt(i);for(;a===Bm||a===Um;)i++,a=e.codePointAt(i)}if(n){let a=e.codePointAt(o-1);for(;a===Bm||a===Um;)o--,a=e.codePointAt(o-1)}return o>i?e.slice(i,o):""}function kI(e,t){const n={type:"text",value:yI(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function vI(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const wI={blockquote:QE,break:XE,code:YE,delete:JE,emphasis:ZE,footnoteReference:eI,heading:tI,html:nI,imageReference:rI,image:iI,inlineCode:sI,linkReference:oI,link:lI,listItem:aI,list:cI,paragraph:fI,root:dI,strong:hI,table:pI,tableCell:gI,tableRow:mI,text:kI,thematicBreak:vI,toml:ll,yaml:ll,definition:ll,footnoteDefinition:ll};function ll(){}const Jy=-1,Gl=0,Ns=1,Pl=2,wf=3,xf=4,Sf=5,Cf=6,Zy=7,ek=8,{defineProperty:xI}=Object,tk=typeof self=="object"?self:globalThis,Gm=(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 tk[e](t)},SI=(e,t)=>{const n=(o,a)=>(e.set(a,o),o),i=o=>{if(e.has(o))return e.get(o);const[a,l]=t[o];switch(a){case Gl:case Jy:return n(l,o);case Ns:{const c=n([],o);for(const f of l)c.push(i(f));return c}case Pl:{const c=n({},o);for(const[f,d]of l){const p=i(f),m=i(d);p==="__proto__"?xI(c,p,{value:m,configurable:!0,enumerable:!0,writable:!0}):c[p]=m}return c}case wf:return n(new Date(l),o);case xf:{const{source:c,flags:f}=l;return n(new RegExp(c,f),o)}case Sf:{const c=n(new Map,o);for(const[f,d]of l)c.set(i(f),i(d));return c}case Cf:{const c=n(new Set,o);for(const f of l)c.add(i(f));return c}case Zy:{const{name:c,message:f}=l;return n(typeof tk[c]=="function"?Gm(c,f):new Error(f),o)}case ek:return n(BigInt(l),o);case"BigInt":return n(Object(BigInt(l)),o);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}case"-0":return-0}return n(Gm(a,l),o)};return i},Wm=e=>SI(new Map,e)(0),Or="",{toString:CI}={},{keys:_I,is:bI}=Object,xs=e=>{const t=typeof e;if(t!=="object"||!e)return[Gl,t];const n=CI.call(e).slice(8,-1);switch(n){case"Array":return[Ns,Or];case"Object":return[Pl,Or];case"Date":return[wf,Or];case"RegExp":return[xf,Or];case"Map":return[Sf,Or];case"Set":return[Cf,Or];case"DataView":return[Ns,n]}return n.includes("Array")?[Ns,n]:e instanceof Error?[Zy,e.name||"Error"]:[Pl,n]},al=([e,t])=>e===Gl&&(t==="function"||t==="symbol"),EI=(e,t,n,i)=>{const o=(l,c)=>{const f=i.push(l)-1;return n.set(c,f),f},a=l=>{if(n.has(l))return n.get(l);let[c,f]=xs(l);switch(c){case Gl:{let p=l;switch(f){case"bigint":c=ek,p=l.toString();break;case"number":if(!l&&bI(l,-0))return i.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);p=null;break;case"undefined":return o([Jy],l)}return o([c,p],l)}case Ns:{if(f){let y=l;return f==="DataView"?y=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(y=new Uint8Array(l)),o([f,[...y]],l)}const p=[],m=o([c,p],l);for(const y of l)p.push(a(y));return m}case Pl:{if(f)switch(f){case"BigInt":return o([f,l.toString()],l);case"Boolean":case"Number":case"String":return o([f,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const p=[],m=o([c,p],l);for(const y of _I(l))(e||!al(xs(l[y])))&&p.push([a(y),a(l[y])]);return m}case wf:return o([c,isNaN(l.getTime())?Or:l.toISOString()],l);case xf:{const{source:p,flags:m}=l;return o([c,{source:p,flags:m}],l)}case Sf:{const p=[],m=o([c,p],l);for(const[y,v]of l)(e||!(al(xs(y))||al(xs(v))))&&p.push([a(y),a(v)]);return m}case Cf:{const p=[],m=o([c,p],l);for(const y of l)(e||!al(xs(y)))&&p.push(a(y));return m}}const{message:d}=l;return o([c,{name:f,message:d}],l)};return a},Hm=(e,{json:t,lossy:n}={})=>{const i=[];return EI(!(t||n),!!t,new Map,i)(e),i},Rl=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Wm(Hm(e,t)):structuredClone(e):(e,t)=>Wm(Hm(e,t));function II(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function NI(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function TI(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||II,i=e.options.footnoteBackLabel||NI,o=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let f=-1;for(;++f<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[f]);if(!d)continue;const p=e.all(d),m=String(d.identifier).toUpperCase(),y=Ri(m.toLowerCase());let v=0;const w=[],_=e.footnoteCounts.get(m);for(;_!==void 0&&++v<=_;){w.length>0&&w.push({type:"text",value:" "});let b=typeof n=="string"?n:n(f,v);typeof b=="string"&&(b={type:"text",value:b}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(f,v),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const N=p[p.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const b=N.children[N.children.length-1];b&&b.type==="text"?b.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...w)}else p.push(...w);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(p,!0)};e.patch(d,C),c.push(C)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Rl(l),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
177
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
178
+ `}]}}const Wl=(function(e){if(e==null)return LI;if(typeof e=="function")return Hl(e);if(typeof e=="object")return Array.isArray(e)?AI(e):PI(e);if(typeof e=="string")return RI(e);throw new Error("Expected function, string, or object as test")});function AI(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Wl(e[n]);return Hl(i);function i(...o){let a=-1;for(;++a<t.length;)if(t[a].apply(this,o))return!0;return!1}}function PI(e){const t=e;return Hl(n);function n(i){const o=i;let a;for(a in e)if(o[a]!==t[a])return!1;return!0}}function RI(e){return Hl(t);function t(n){return n&&n.type===e}}function Hl(e){return t;function t(n,i,o){return!!(jI(n)&&e.call(this,n,typeof i=="number"?i:void 0,o||void 0))}}function LI(){return!0}function jI(e){return e!==null&&typeof e=="object"&&"type"in e}const nk=[],MI=!0,Uc=!1,OI="skip";function rk(e,t,n,i){let o;typeof t=="function"&&typeof n!="function"?(i=n,n=t):o=t;const a=Wl(o),l=i?-1:1;c(e,void 0,[])();function c(f,d,p){const m=f&&typeof f=="object"?f:{};if(typeof m.type=="string"){const v=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(f.type+(v?"<"+v+">":""))+")"})}return y;function y(){let v=nk,w,_,N;if((!t||a(f,d,p[p.length-1]||void 0))&&(v=DI(n(f,p)),v[0]===Uc))return v;if("children"in f&&f.children){const C=f;if(C.children&&v[0]!==OI)for(_=(i?C.children.length:-1)+l,N=p.concat(C);_>-1&&_<C.children.length;){const b=C.children[_];if(w=c(b,_,N)(),w[0]===Uc)return w;_=typeof w[1]=="number"?w[1]:_+l}}return v}}}function DI(e){return Array.isArray(e)?e:typeof e=="number"?[MI,e]:e==null?nk:[e]}function _f(e,t,n,i){let o,a,l;typeof t=="function"&&typeof n!="function"?(a=void 0,l=t,o=n):(a=t,l=n,o=i),rk(e,a,c,o);function c(f,d){const p=d[d.length-1],m=p?p.children.indexOf(f):void 0;return l(f,m,p)}}const Vc={}.hasOwnProperty,$I={};function FI(e,t){const n=t||$I,i=new Map,o=new Map,a=new Map,l={...wI,...n.handlers},c={all:d,applyData:BI,definitionById:i,footnoteById:o,footnoteCounts:a,footnoteOrder:[],handlers:l,one:f,options:n,patch:zI,wrap:VI};return _f(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?i:o,y=String(p.identifier).toUpperCase();m.has(y)||m.set(y,p)}}),c;function f(p,m){const y=p.type,v=c.handlers[y];if(Vc.call(c.handlers,y)&&v)return v(c,p,m);if(c.options.passThrough&&c.options.passThrough.includes(y)){if("children"in p){const{children:_,...N}=p,C=Rl(N);return C.children=c.all(p),C}return Rl(p)}return(c.options.unknownHandler||UI)(c,p,m)}function d(p){const m=[];if("children"in p){const y=p.children;let v=-1;for(;++v<y.length;){const w=c.one(y[v],p);if(w){if(v&&y[v-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=qm(w.value)),!Array.isArray(w)&&w.type==="element")){const _=w.children[0];_&&_.type==="text"&&(_.value=qm(_.value))}Array.isArray(w)?m.push(...w):m.push(w)}}}return m}}function zI(e,t){e.position&&(t.position=E_(e))}function BI(e,t){let n=t;if(e&&e.data){const i=e.data.hName,o=e.data.hChildren,a=e.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const l="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:l}}n.type==="element"&&a&&Object.assign(n.properties,Rl(a)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function UI(e,t){const n=t.data||{},i="value"in t&&!(Vc.call(n,"hProperties")||Vc.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function VI(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:`
179
+ `});++i<e.length;)i&&n.push({type:"text",value:`
180
+ `}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:`
181
+ `}),n}function qm(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Km(e,t){const n=FI(e,t),i=n.one(e,void 0),o=TI(n),a=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return o&&a.children.push({type:"text",value:`
182
+ `},o),a}function GI(e,t){return e&&"run"in e?async function(n,i){const o=Km(n,{file:i,...t});await e.run(o,i)}:function(n,i){return Km(n,{file:i,...e||t})}}function Qm(e){if(e)throw e}var lc,Xm;function WI(){if(Xm)return lc;Xm=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},a=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var p=e.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!p&&!m)return!1;var y;for(y in d);return typeof y>"u"||e.call(d,y)},l=function(d,p){n&&p.name==="__proto__"?n(d,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):d[p.name]=p.newValue},c=function(d,p){if(p==="__proto__")if(e.call(d,p)){if(i)return i(d,p).value}else return;return d[p]};return lc=function f(){var d,p,m,y,v,w,_=arguments[0],N=1,C=arguments.length,b=!1;for(typeof _=="boolean"&&(b=_,_=arguments[1]||{},N=2),(_==null||typeof _!="object"&&typeof _!="function")&&(_={});N<C;++N)if(d=arguments[N],d!=null)for(p in d)m=c(_,p),y=c(d,p),_!==y&&(b&&y&&(a(y)||(v=o(y)))?(v?(v=!1,w=m&&o(m)?m:[]):w=m&&a(m)?m:{},l(_,{name:p,newValue:f(b,w,y)})):typeof y<"u"&&l(_,{name:p,newValue:y}));return _},lc}var HI=WI();const ac=qc(HI);function Gc(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 qI(){const e=[],t={run:n,use:i};return t;function n(...o){let a=-1;const l=o.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...o);function c(f,...d){const p=e[++a];let m=-1;if(f){l(f);return}for(;++m<o.length;)(d[m]===null||d[m]===void 0)&&(d[m]=o[m]);o=d,p?KI(p,c)(...d):l(null,...d)}}function i(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function KI(e,t){let n;return i;function i(...l){const c=e.length>l.length;let f;c&&l.push(o);try{f=e.apply(this,l)}catch(d){const p=d;if(c&&n)throw p;return o(p)}c||(f&&f.then&&typeof f.then=="function"?f.then(a,o):f instanceof Error?o(f):a(f))}function o(l,...c){n||(n=!0,t(l,...c))}function a(l){o(null,l)}}const An={basename:QI,dirname:XI,extname:YI,join:JI,sep:"/"};function QI(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Bs(e);let n=0,i=-1,o=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(a){n=o+1;break}}else i<0&&(a=!0,i=o+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let l=-1,c=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(a){n=o+1;break}}else l<0&&(a=!0,l=o+1),c>-1&&(e.codePointAt(o)===t.codePointAt(c--)?c<0&&(i=o):(c=-1,i=l));return n===i?i=l:i<0&&(i=e.length),e.slice(n,i)}function XI(e){if(Bs(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function YI(e){Bs(e);let t=e.length,n=-1,i=0,o=-1,a=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){i=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?o<0?o=t:a!==1&&(a=1):o>-1&&(a=-1)}return o<0||n<0||a===0||a===1&&o===n-1&&o===i+1?"":e.slice(o,n)}function JI(...e){let t=-1,n;for(;++t<e.length;)Bs(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":ZI(n)}function ZI(e){Bs(e);const t=e.codePointAt(0)===47;let n=eN(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function eN(e,t){let n="",i=0,o=-1,a=0,l=-1,c,f;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(o===l-1||a===1))if(o!==l-1&&a===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",i=0):(n=n.slice(0,f),i=n.length-1-n.lastIndexOf("/")),o=l,a=0;continue}}else if(n.length>0){n="",i=0,o=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(o+1,l):n=e.slice(o+1,l),i=l-o-1;o=l,a=0}else c===46&&a>-1?a++:a=-1}return n}function Bs(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const tN={cwd:nN};function nN(){return"/"}function Wc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function rN(e){if(typeof e=="string")e=new URL(e);else if(!Wc(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 iN(e)}function iN(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const i=t.codePointAt(n+2);if(i===70||i===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 uc=["history","path","basename","stem","extname","dirname"];class ik{constructor(t){let n;t?Wc(t)?n={path:t}:typeof t=="string"||sN(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":tN.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<uc.length;){const a=uc[i];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let o;for(o in n)uc.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?An.basename(this.path):void 0}set basename(t){fc(t,"basename"),cc(t,"basename"),this.path=An.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?An.dirname(this.path):void 0}set dirname(t){Ym(this.basename,"dirname"),this.path=An.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?An.extname(this.path):void 0}set extname(t){if(cc(t,"extname"),Ym(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=An.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Wc(t)&&(t=rN(t)),fc(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?An.basename(this.path,this.extname):void 0}set stem(t){fc(t,"stem"),cc(t,"stem"),this.path=An.join(this.dirname||"",t+(this.extname||""))}fail(t,n,i){const o=this.message(t,n,i);throw o.fatal=!0,o}info(t,n,i){const o=this.message(t,n,i);return o.fatal=void 0,o}message(t,n,i){const o=new Tt(t,n,i);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 cc(e,t){if(e&&e.includes(An.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+An.sep+"`")}function fc(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Ym(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function sN(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const oN=(function(e){const i=this.constructor.prototype,o=i[e],a=function(){return o.apply(a,arguments)};return Object.setPrototypeOf(a,i),a}),lN={}.hasOwnProperty;class bf extends oN{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=qI()}copy(){const t=new bf;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(ac(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(pc("data",this.frozen),this.namespace[t]=n,this):lN.call(this.namespace,t)&&this.namespace[t]||void 0:t?(pc("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[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const o=n.call(t,...i);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=ul(t),i=this.parser||this.Parser;return dc("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),dc("process",this.parser||this.Parser),hc("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(a,l){const c=ul(t),f=i.parse(c);i.run(f,c,function(p,m,y){if(p||!m||!y)return d(p);const v=m,w=i.stringify(v,y);cN(w)?y.value=w:y.result=w,d(p,y)});function d(p,m){p||!m?l(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,i;return this.freeze(),dc("processSync",this.parser||this.Parser),hc("processSync",this.compiler||this.Compiler),this.process(t,o),Zm("processSync","process",n),i;function o(a,l){n=!0,Qm(a),i=l}}run(t,n,i){Jm(t),this.freeze();const o=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?a(void 0,i):new Promise(a);function a(l,c){const f=ul(n);o.run(t,f,d);function d(p,m,y){const v=m||t;p?c(p):l?l(v):i(void 0,v,y)}}}runSync(t,n){let i=!1,o;return this.run(t,n,a),Zm("runSync","run",i),o;function a(l,c){Qm(l),o=c,i=!0}}stringify(t,n){this.freeze();const i=ul(n),o=this.compiler||this.Compiler;return hc("stringify",o),Jm(t),o(t,i)}use(t,...n){const i=this.attachers,o=this.namespace;if(pc("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(d){if(typeof d=="function")f(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[p,...m]=d;f(p,m)}else l(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function l(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(d.plugins),d.settings&&(o.settings=ac(!0,o.settings,d.settings))}function c(d){let p=-1;if(d!=null)if(Array.isArray(d))for(;++p<d.length;){const m=d[p];a(m)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function f(d,p){let m=-1,y=-1;for(;++m<i.length;)if(i[m][0]===d){y=m;break}if(y===-1)i.push([d,...p]);else if(p.length>0){let[v,...w]=p;const _=i[y][1];Gc(_)&&Gc(v)&&(v=ac(!0,_,v)),i[y]=[d,v,...w]}}}}const aN=new bf().freeze();function dc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function hc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function pc(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 Jm(e){if(!Gc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Zm(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ul(e){return uN(e)?e:new ik(e)}function uN(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function cN(e){return typeof e=="string"||fN(e)}function fN(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const dN="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",eg=[],tg={allowDangerousHtml:!0},hN=/^(https?|ircs?|mailto|xmpp)$/i,pN=[{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 mN(e){const t=gN(e),n=yN(e);return kN(t.runSync(t.parse(n),n),e)}function gN(e){const t=e.rehypePlugins||eg,n=e.remarkPlugins||eg,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...tg}:tg;return aN().use(KE).use(n).use(GI,i).use(t)}function yN(e){const t=e.children||"",n=new ik;return typeof t=="string"&&(n.value=t),n}function kN(e,t){const n=t.allowedElements,i=t.allowElement,o=t.components,a=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,f=t.urlTransform||vN;for(const p of pN)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+dN+p.id,void 0);return _f(e,d),P_(e,{Fragment:x.Fragment,components:o,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function d(p,m,y){if(p.type==="raw"&&y&&typeof m=="number")return l?y.children.splice(m,1):y.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let v;for(v in ic)if(Object.hasOwn(ic,v)&&Object.hasOwn(p.properties,v)){const w=p.properties[v],_=ic[v];(_===null||_.includes(p.tagName))&&(p.properties[v]=f(String(w||""),v,p))}}if(p.type==="element"){let v=n?!n.includes(p.tagName):a?a.includes(p.tagName):!1;if(!v&&i&&typeof m=="number"&&(v=!i(p,m,y)),v&&y&&typeof m=="number")return c&&p.children?y.children.splice(m,1,...p.children):y.children.splice(m,1),m}}}function vN(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||i!==-1&&t>i||hN.test(e.slice(0,t))?e:""}function wN(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function xN(e,t,n){const o=Wl((n||{}).ignore||[]),a=SN(t);let l=-1;for(;++l<a.length;)rk(e,"text",c);function c(d,p){let m=-1,y;for(;++m<p.length;){const v=p[m],w=y?y.children:void 0;if(o(v,w?w.indexOf(v):void 0,y))return;y=v}if(y)return f(d,p)}function f(d,p){const m=p[p.length-1],y=a[l][0],v=a[l][1];let w=0;const N=m.children.indexOf(d);let C=!1,b=[];y.lastIndex=0;let E=y.exec(d.value);for(;E;){const B=E.index,O={index:E.index,input:E.input,stack:[...p,d]};let D=v(...E,O);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?y.lastIndex=B+1:(w!==B&&b.push({type:"text",value:d.value.slice(w,B)}),Array.isArray(D)?b.push(...D):D&&b.push(D),w=B+E[0].length,C=!0),!y.global)break;E=y.exec(d.value)}return C?(w<d.value.length&&b.push({type:"text",value:d.value.slice(w)}),m.children.splice(N,1,...b)):b=[d],N+b.length}}function SN(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<n.length;){const o=n[i];t.push([CN(o[0]),_N(o[1])])}return t}function CN(e){return typeof e=="string"?new RegExp(wN(e),"g"):e}function _N(e){return typeof e=="function"?e:function(){return e}}const mc="phrasing",gc=["autolink","link","image","label"];function bN(){return{transforms:[RN],enter:{literalAutolink:IN,literalAutolinkEmail:yc,literalAutolinkHttp:yc,literalAutolinkWww:yc},exit:{literalAutolink:PN,literalAutolinkEmail:AN,literalAutolinkHttp:NN,literalAutolinkWww:TN}}}function EN(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:mc,notInConstruct:gc},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:mc,notInConstruct:gc},{character:":",before:"[ps]",after:"\\/",inConstruct:mc,notInConstruct:gc}]}}function IN(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function yc(e){this.config.enter.autolinkProtocol.call(this,e)}function NN(e){this.config.exit.autolinkProtocol.call(this,e)}function TN(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 AN(e){this.config.exit.autolinkEmail.call(this,e)}function PN(e){this.exit(e)}function RN(e){xN(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,LN],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),jN]],{ignore:["link","linkReference"]})}function LN(e,t,n,i,o){let a="";if(!sk(o)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!MN(n)))return!1;const l=ON(n+i);if(!l[0])return!1;const c={type:"link",title:null,url:a+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function jN(e,t,n,i){return!sk(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function MN(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 ON(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const o=Cl(e,"(");let a=Cl(e,")");for(;i!==-1&&o>a;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),a++;return[e,n]}function sk(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Gr(n)||Ul(n))&&(!t||n!==47)}ok.peek=WN;function DN(){this.buffer()}function $N(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function FN(){this.buffer()}function zN(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function BN(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Sn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function UN(e){this.exit(e)}function VN(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Sn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function GN(e){this.exit(e)}function WN(){return"["}function ok(e,t,n,i){const o=n.createTracker(i);let a=o.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return a+=o.move(n.safe(n.associationId(e),{after:"]",before:a})),c(),l(),a+=o.move("]"),a}function HN(){return{enter:{gfmFootnoteCallString:DN,gfmFootnoteCall:$N,gfmFootnoteDefinitionLabelString:FN,gfmFootnoteDefinition:zN},exit:{gfmFootnoteCallString:BN,gfmFootnoteCall:UN,gfmFootnoteDefinitionLabelString:VN,gfmFootnoteDefinition:GN}}}function qN(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:ok},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,o,a,l){const c=a.createTracker(l);let f=c.move("[^");const d=a.enter("footnoteDefinition"),p=a.enter("label");return f+=c.move(a.safe(a.associationId(i),{before:f,after:"]"})),p(),f+=c.move("]:"),i.children&&i.children.length>0&&(c.shift(4),f+=c.move((t?`
183
+ `:" ")+a.indentLines(a.containerFlow(i,c.current()),t?lk:KN))),d(),f}}function KN(e,t,n){return t===0?e:lk(e,t,n)}function lk(e,t,n){return(n?"":" ")+e}const QN=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ak.peek=eT;function XN(){return{canContainEols:["delete"],enter:{strikethrough:JN},exit:{strikethrough:ZN}}}function YN(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:QN}],handlers:{delete:ak}}}function JN(e){this.enter({type:"delete",children:[]},e)}function ZN(e){this.exit(e)}function ak(e,t,n,i){const o=n.createTracker(i),a=n.enter("strikethrough");let l=o.move("~~");return l+=n.containerPhrasing(e,{...o.current(),before:l,after:"~"}),l+=o.move("~~"),a(),l}function eT(){return"~"}function tT(e){return e.length}function nT(e,t){const n=t||{},i=(n.align||[]).concat(),o=n.stringLength||tT,a=[],l=[],c=[],f=[];let d=0,p=-1;for(;++p<e.length;){const _=[],N=[];let C=-1;for(e[p].length>d&&(d=e[p].length);++C<e[p].length;){const b=rT(e[p][C]);if(n.alignDelimiters!==!1){const E=o(b);N[C]=E,(f[C]===void 0||E>f[C])&&(f[C]=E)}_.push(b)}l[p]=_,c[p]=N}let m=-1;if(typeof i=="object"&&"length"in i)for(;++m<d;)a[m]=ng(i[m]);else{const _=ng(i);for(;++m<d;)a[m]=_}m=-1;const y=[],v=[];for(;++m<d;){const _=a[m];let N="",C="";_===99?(N=":",C=":"):_===108?N=":":_===114&&(C=":");let b=n.alignDelimiters===!1?1:Math.max(1,f[m]-N.length-C.length);const E=N+"-".repeat(b)+C;n.alignDelimiters!==!1&&(b=N.length+b+C.length,b>f[m]&&(f[m]=b),v[m]=b),y[m]=E}l.splice(1,0,y),c.splice(1,0,v),p=-1;const w=[];for(;++p<l.length;){const _=l[p],N=c[p];m=-1;const C=[];for(;++m<d;){const b=_[m]||"";let E="",B="";if(n.alignDelimiters!==!1){const O=f[m]-(N[m]||0),D=a[m];D===114?E=" ".repeat(O):D===99?O%2?(E=" ".repeat(O/2+.5),B=" ".repeat(O/2-.5)):(E=" ".repeat(O/2),B=E):B=" ".repeat(O)}n.delimiterStart!==!1&&!m&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&b==="")&&(n.delimiterStart!==!1||m)&&C.push(" "),n.alignDelimiters!==!1&&C.push(E),C.push(b),n.alignDelimiters!==!1&&C.push(B),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||m!==d-1)&&C.push("|")}w.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return w.join(`
184
+ `)}function rT(e){return e==null?"":String(e)}function ng(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}function iT(e,t,n,i){const o=n.enter("blockquote"),a=n.createTracker(i);a.move("> "),a.shift(2);const l=n.indentLines(n.containerFlow(e,a.current()),sT);return o(),l}function sT(e,t,n){return">"+(n?"":" ")+e}function oT(e,t){return rg(e,t.inConstruct,!0)&&!rg(e,t.notInConstruct,!1)}function rg(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++i<t.length;)if(e.includes(t[i]))return!0;return!1}function ig(e,t,n,i){let o=-1;for(;++o<n.unsafe.length;)if(n.unsafe[o].character===`
185
+ `&&oT(n.stack,n.unsafe[o]))return/[ \t]/.test(i.before)?"":" ";return`\\
186
+ `}function lT(e,t){const n=String(e);let i=n.indexOf(t),o=i,a=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===o?++a>l&&(l=a):a=1,o=i+t.length,i=n.indexOf(t,o);return l}function aT(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 uT(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 cT(e,t,n,i){const o=uT(n),a=e.value||"",l=o==="`"?"GraveAccent":"Tilde";if(aT(e,n)){const m=n.enter("codeIndented"),y=n.indentLines(a,fT);return m(),y}const c=n.createTracker(i),f=o.repeat(Math.max(lT(a,o)+1,3)),d=n.enter("codeFenced");let p=c.move(f);if(e.lang){const m=n.enter(`codeFencedLang${l}`);p+=c.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...c.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${l}`);p+=c.move(" "),p+=c.move(n.safe(e.meta,{before:p,after:`
187
+ `,encode:["`"],...c.current()})),m()}return p+=c.move(`
188
+ `),a&&(p+=c.move(a+`
189
+ `)),p+=c.move(f),d(),p}function fT(e,t,n){return(n?"":" ")+e}function Ef(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 dT(e,t,n,i){const o=Ef(n),a=o==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const f=n.createTracker(i);let d=f.move("[");return d+=f.move(n.safe(n.associationId(e),{before:d,after:"]",...f.current()})),d+=f.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(c=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":`
190
+ `,...f.current()}))),c(),e.title&&(c=n.enter(`title${a}`),d+=f.move(" "+o),d+=f.move(n.safe(e.title,{before:d,after:o,...f.current()})),d+=f.move(o),c()),l(),d}function hT(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 Ms(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Ll(e,t,n){const i=Ii(e),o=Ii(t);return i===void 0?o===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===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}}uk.peek=pT;function uk(e,t,n,i){const o=hT(n),a=n.enter("emphasis"),l=n.createTracker(i),c=l.move(o);let f=l.move(n.containerPhrasing(e,{after:o,before:c,...l.current()}));const d=f.charCodeAt(0),p=Ll(i.before.charCodeAt(i.before.length-1),d,o);p.inside&&(f=Ms(d)+f.slice(1));const m=f.charCodeAt(f.length-1),y=Ll(i.after.charCodeAt(0),m,o);y.inside&&(f=f.slice(0,-1)+Ms(m));const v=l.move(o);return a(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},c+f+v}function pT(e,t,n){return n.options.emphasis||"*"}function mT(e,t){let n=!1;return _f(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,Uc}),!!((!e.depth||e.depth<3)&&yf(e)&&(t.options.setext||n))}function gT(e,t,n,i){const o=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(i);if(mT(e,n)){const p=n.enter("headingSetext"),m=n.enter("phrasing"),y=n.containerPhrasing(e,{...a.current(),before:`
191
+ `,after:`
192
+ `});return m(),p(),y+`
193
+ `+(o===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
194
+ `))+1))}const l="#".repeat(o),c=n.enter("headingAtx"),f=n.enter("phrasing");a.move(l+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
195
+ `,...a.current()});return/^[\t ]/.test(d)&&(d=Ms(d.charCodeAt(0))+d.slice(1)),d=d?l+" "+d:l,n.options.closeAtx&&(d+=" "+l),f(),c(),d}ck.peek=yT;function ck(e){return e.value||""}function yT(){return"<"}fk.peek=kT;function fk(e,t,n,i){const o=Ef(n),a=o==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const f=n.createTracker(i);let d=f.move("![");return d+=f.move(n.safe(e.alt,{before:d,after:"]",...f.current()})),d+=f.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(c=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":")",...f.current()}))),c(),e.title&&(c=n.enter(`title${a}`),d+=f.move(" "+o),d+=f.move(n.safe(e.title,{before:d,after:o,...f.current()})),d+=f.move(o),c()),d+=f.move(")"),l(),d}function kT(){return"!"}dk.peek=vT;function dk(e,t,n,i){const o=e.referenceType,a=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(i);let f=c.move("![");const d=n.safe(e.alt,{before:f,after:"]",...c.current()});f+=c.move(d+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=p,a(),o==="full"||!d||d!==m?f+=c.move(m+"]"):o==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function vT(){return"!"}hk.peek=wT;function hk(e,t,n){let i=e.value||"",o="`",a=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(i);)o+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++a<n.unsafe.length;){const l=n.unsafe[a],c=n.compilePattern(l);let f;if(l.atBreak)for(;f=c.exec(i);){let d=f.index;i.charCodeAt(d)===10&&i.charCodeAt(d-1)===13&&d--,i=i.slice(0,d)+" "+i.slice(f.index+1)}}return o+i+o}function wT(){return"`"}function pk(e,t){const n=yf(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}mk.peek=xT;function mk(e,t,n,i){const o=Ef(n),a=o==='"'?"Quote":"Apostrophe",l=n.createTracker(i);let c,f;if(pk(e,n)){const p=n.stack;n.stack=[],c=n.enter("autolink");let m=l.move("<");return m+=l.move(n.containerPhrasing(e,{before:m,after:">",...l.current()})),m+=l.move(">"),c(),n.stack=p,m}c=n.enter("link"),f=n.enter("label");let d=l.move("[");return d+=l.move(n.containerPhrasing(e,{before:d,after:"](",...l.current()})),d+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),d+=l.move("<"),d+=l.move(n.safe(e.url,{before:d,after:">",...l.current()})),d+=l.move(">")):(f=n.enter("destinationRaw"),d+=l.move(n.safe(e.url,{before:d,after:e.title?" ":")",...l.current()}))),f(),e.title&&(f=n.enter(`title${a}`),d+=l.move(" "+o),d+=l.move(n.safe(e.title,{before:d,after:o,...l.current()})),d+=l.move(o),f()),d+=l.move(")"),c(),d}function xT(e,t,n){return pk(e,n)?"<":"["}gk.peek=ST;function gk(e,t,n,i){const o=e.referenceType,a=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(i);let f=c.move("[");const d=n.containerPhrasing(e,{before:f,after:"]",...c.current()});f+=c.move(d+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=p,a(),o==="full"||!d||d!==m?f+=c.move(m+"]"):o==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function ST(){return"["}function If(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 CT(e){const t=If(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function _T(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 yk(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 bT(e,t,n,i){const o=n.enter("list"),a=n.bulletCurrent;let l=e.ordered?_T(n):If(n);const c=e.ordered?l==="."?")":".":CT(n);let f=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),yk(n)===l&&p){let m=-1;for(;++m<e.children.length;){const y=e.children[m];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(l=c),n.bulletCurrent=l;const d=n.containerFlow(e,i);return n.bulletLastUsed=l,n.bulletCurrent=a,o(),d}function ET(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 IT(e,t,n,i){const o=ET(n);let a=n.bulletCurrent||If(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let l=a.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(i);c.move(a+" ".repeat(l-a.length)),c.shift(l);const f=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,c.current()),p);return f(),d;function p(m,y,v){return y?(v?"":" ".repeat(l))+m:(v?a:a+" ".repeat(l-a.length))+m}}function NT(e,t,n,i){const o=n.enter("paragraph"),a=n.enter("phrasing"),l=n.containerPhrasing(e,i);return a(),o(),l}const TT=Wl(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function AT(e,t,n,i){return(e.children.some(function(l){return TT(l)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function PT(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}kk.peek=RT;function kk(e,t,n,i){const o=PT(n),a=n.enter("strong"),l=n.createTracker(i),c=l.move(o+o);let f=l.move(n.containerPhrasing(e,{after:o,before:c,...l.current()}));const d=f.charCodeAt(0),p=Ll(i.before.charCodeAt(i.before.length-1),d,o);p.inside&&(f=Ms(d)+f.slice(1));const m=f.charCodeAt(f.length-1),y=Ll(i.after.charCodeAt(0),m,o);y.inside&&(f=f.slice(0,-1)+Ms(m));const v=l.move(o+o);return a(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},c+f+v}function RT(e,t,n){return n.options.strong||"*"}function LT(e,t,n,i){return n.safe(e.value,i)}function jT(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 MT(e,t,n){const i=(yk(n)+(n.options.ruleSpaces?" ":"")).repeat(jT(n));return n.options.ruleSpaces?i.slice(0,-1):i}const vk={blockquote:iT,break:ig,code:cT,definition:dT,emphasis:uk,hardBreak:ig,heading:gT,html:ck,image:fk,imageReference:dk,inlineCode:hk,link:mk,linkReference:gk,list:bT,listItem:IT,paragraph:NT,root:AT,strong:kk,text:LT,thematicBreak:MT};function OT(){return{enter:{table:DT,tableData:sg,tableHeader:sg,tableRow:FT},exit:{codeText:zT,table:$T,tableData:kc,tableHeader:kc,tableRow:kc}}}function DT(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function $T(e){this.exit(e),this.data.inTable=void 0}function FT(e){this.enter({type:"tableRow",children:[]},e)}function kc(e){this.exit(e)}function sg(e){this.enter({type:"tableCell",children:[]},e)}function zT(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,BT));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function BT(e,t){return t==="|"?t:e}function UT(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,o=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
196
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:l,tableCell:f,tableRow:c}};function l(v,w,_,N){return d(p(v,_,N),v.align)}function c(v,w,_,N){const C=m(v,_,N),b=d([C]);return b.slice(0,b.indexOf(`
197
+ `))}function f(v,w,_,N){const C=_.enter("tableCell"),b=_.enter("phrasing"),E=_.containerPhrasing(v,{...N,before:a,after:a});return b(),C(),E}function d(v,w){return nT(v,{align:w,alignDelimiters:i,padding:n,stringLength:o})}function p(v,w,_){const N=v.children;let C=-1;const b=[],E=w.enter("table");for(;++C<N.length;)b[C]=m(N[C],w,_);return E(),b}function m(v,w,_){const N=v.children;let C=-1;const b=[],E=w.enter("tableRow");for(;++C<N.length;)b[C]=f(N[C],v,w,_);return E(),b}function y(v,w,_){let N=vk.inlineCode(v,w,_);return _.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function VT(){return{exit:{taskListCheckValueChecked:og,taskListCheckValueUnchecked:og,paragraph:WT}}}function GT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:HT}}}function og(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function WT(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const i=n.children[0];if(i&&i.type==="text"){const o=t.children;let a=-1,l;for(;++a<o.length;){const c=o[a];if(c.type==="paragraph"){l=c;break}}l===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function HT(e,t,n,i){const o=e.children[0],a=typeof e.checked=="boolean"&&o&&o.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=n.createTracker(i);a&&c.move(l);let f=vk.listItem(e,t,n,{...i,...c.current()});return a&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),f;function d(p){return p+l}}function qT(){return[bN(),HN(),XN(),OT(),VT()]}function KT(e){return{extensions:[EN(),qN(e),YN(),UT(e),GT()]}}const QT={tokenize:tA,partial:!0},wk={tokenize:nA,partial:!0},xk={tokenize:rA,partial:!0},Sk={tokenize:iA,partial:!0},XT={tokenize:sA,partial:!0},Ck={name:"wwwAutolink",tokenize:ZT,previous:bk},_k={name:"protocolAutolink",tokenize:eA,previous:Ek},qn={name:"emailAutolink",tokenize:JT,previous:Ik},Pn={};function YT(){return{text:Pn}}let jr=48;for(;jr<123;)Pn[jr]=qn,jr++,jr===58?jr=65:jr===91&&(jr=97);Pn[43]=qn;Pn[45]=qn;Pn[46]=qn;Pn[95]=qn;Pn[72]=[qn,_k];Pn[104]=[qn,_k];Pn[87]=[qn,Ck];Pn[119]=[qn,Ck];function JT(e,t,n){const i=this;let o,a;return l;function l(m){return!Hc(m)||!Ik.call(i,i.previous)||Nf(i.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(m))}function c(m){return Hc(m)?(e.consume(m),c):m===64?(e.consume(m),f):n(m)}function f(m){return m===46?e.check(XT,p,d)(m):m===45||m===95||Nt(m)?(a=!0,e.consume(m),f):p(m)}function d(m){return e.consume(m),o=!0,f}function p(m){return a&&o&&jt(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function ZT(e,t,n){const i=this;return o;function o(l){return l!==87&&l!==119||!bk.call(i,i.previous)||Nf(i.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(QT,e.attempt(wk,e.attempt(xk,a),n),n)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function eA(e,t,n){const i=this;let o="",a=!1;return l;function l(m){return(m===72||m===104)&&Ek.call(i,i.previous)&&!Nf(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(m),e.consume(m),c):n(m)}function c(m){if(jt(m)&&o.length<5)return o+=String.fromCodePoint(m),e.consume(m),c;if(m===58){const y=o.toLowerCase();if(y==="http"||y==="https")return e.consume(m),f}return n(m)}function f(m){return m===47?(e.consume(m),a?d:(a=!0,f)):n(m)}function d(m){return m===null||Al(m)||We(m)||Gr(m)||Ul(m)?n(m):e.attempt(wk,e.attempt(xk,p),n)(m)}function p(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function tA(e,t,n){let i=0;return o;function o(l){return(l===87||l===119)&&i<3?(i++,e.consume(l),o):l===46&&i===3?(e.consume(l),a):n(l)}function a(l){return l===null?n(l):t(l)}}function nA(e,t,n){let i,o,a;return l;function l(d){return d===46||d===95?e.check(Sk,f,c)(d):d===null||We(d)||Gr(d)||d!==45&&Ul(d)?f(d):(a=!0,e.consume(d),l)}function c(d){return d===95?i=!0:(o=i,i=void 0),e.consume(d),l}function f(d){return o||i||!a?n(d):t(d)}}function rA(e,t){let n=0,i=0;return o;function o(l){return l===40?(n++,e.consume(l),o):l===41&&i<n?a(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(Sk,t,a)(l):l===null||We(l)||Gr(l)?t(l):(e.consume(l),o)}function a(l){return l===41&&i++,e.consume(l),o}}function iA(e,t,n){return i;function i(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),i):c===38?(e.consume(c),a):c===93?(e.consume(c),o):c===60||c===null||We(c)||Gr(c)?t(c):n(c)}function o(c){return c===null||c===40||c===91||We(c)||Gr(c)?t(c):i(c)}function a(c){return jt(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),i):jt(c)?(e.consume(c),l):n(c)}}function sA(e,t,n){return i;function i(a){return e.consume(a),o}function o(a){return Nt(a)?n(a):t(a)}}function bk(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||We(e)}function Ek(e){return!jt(e)}function Ik(e){return!(e===47||Hc(e))}function Hc(e){return e===43||e===45||e===46||e===95||Nt(e)}function Nf(e){let t=e.length,n=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const oA={tokenize:pA,partial:!0};function lA(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:fA,continuation:{tokenize:dA},exit:hA}},text:{91:{name:"gfmFootnoteCall",tokenize:cA},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:aA,resolveTo:uA}}}}function aA(e,t,n){const i=this;let o=i.events.length;const a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l;for(;o--;){const f=i.events[o][1];if(f.type==="labelImage"){l=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return c;function c(f){if(!l||!l._balanced)return n(f);const d=Sn(i.sliceSerialize({start:l.end,end:i.now()}));return d.codePointAt(0)!==94||!a.includes(d.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function uA(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},c=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...c),e}function cA(e,t,n){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a=0,l;return c;function c(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),f}function f(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(m){if(a>999||m===93&&!l||m===null||m===91||We(m))return n(m);if(m===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return o.includes(Sn(i.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return We(m)||(l=!0),a++,e.consume(m),m===92?p:d}function p(m){return m===91||m===92||m===93?(e.consume(m),a++,d):d(m)}}function fA(e,t,n){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a,l=0,c;return f;function f(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(w)}function p(w){if(l>999||w===93&&!c||w===null||w===91||We(w))return n(w);if(w===93){e.exit("chunkString");const _=e.exit("gfmFootnoteDefinitionLabelString");return a=Sn(i.sliceSerialize(_)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return We(w)||(c=!0),l++,e.consume(w),w===92?m:p}function m(w){return w===91||w===92||w===93?(e.consume(w),l++,p):p(w)}function y(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),o.includes(a)||o.push(a),Fe(e,v,"gfmFootnoteDefinitionWhitespace")):n(w)}function v(w){return t(w)}}function dA(e,t,n){return e.check(zs,t,e.attempt(oA,t,n))}function hA(e){e.exit("gfmFootnoteDefinition")}function pA(e,t,n){const i=this;return Fe(e,o,"gfmFootnoteDefinitionIndent",5);function o(a){const l=i.events[i.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(a):n(a)}}function mA(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:a,resolveAll:o};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function o(l,c){let f=-1;for(;++f<l.length;)if(l[f][0]==="enter"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._close){let d=f;for(;d--;)if(l[d][0]==="exit"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._open&&l[f][1].end.offset-l[f][1].start.offset===l[d][1].end.offset-l[d][1].start.offset){l[f][1].type="strikethroughSequence",l[d][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},l[d][1].start),end:Object.assign({},l[f][1].end)},m={type:"strikethroughText",start:Object.assign({},l[d][1].end),end:Object.assign({},l[f][1].start)},y=[["enter",p,c],["enter",l[d][1],c],["exit",l[d][1],c],["enter",m,c]],v=c.parser.constructs.insideSpan.null;v&&Yt(y,y.length,0,Vl(v,l.slice(d+1,f),c)),Yt(y,y.length,0,[["exit",m,c],["enter",l[f][1],c],["exit",l[f][1],c],["exit",p,c]]),Yt(l,d-1,f-d+3,y),f=d+y.length-2;break}}for(f=-1;++f<l.length;)l[f][1].type==="strikethroughSequenceTemporary"&&(l[f][1].type="data");return l}function a(l,c,f){const d=this.previous,p=this.events;let m=0;return y;function y(w){return d===126&&p[p.length-1][1].type!=="characterEscape"?f(w):(l.enter("strikethroughSequenceTemporary"),v(w))}function v(w){const _=Ii(d);if(w===126)return m>1?f(w):(l.consume(w),m++,v);if(m<2&&!n)return f(w);const N=l.exit("strikethroughSequenceTemporary"),C=Ii(w);return N._open=!C||C===2&&!!_,N._close=!_||_===2&&!!C,c(w)}}}class gA{constructor(){this.map=[]}add(t,n,i){yA(this,t,n,i)}consume(t){if(this.map.sort(function(a,l){return a[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let o=i.pop();for(;o;){for(const a of o)t.push(a);o=i.pop()}this.map.length=0}}function yA(e,t,n,i){let o=0;if(!(n===0&&i.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=n,e.map[o][2].push(...i);return}o+=1}e.map.push([t,n,i])}}function kA(e,t){let n=!1;const i=[];for(;t<e.length;){const o=e[t];if(n){if(o[0]==="enter")o[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=i.length-1;i[a]=i[a]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return i}function vA(){return{flow:{null:{name:"table",tokenize:wA,resolveAll:xA}}}}function wA(e,t,n){const i=this;let o=0,a=0,l;return c;function c(R){let H=i.events.length-1;for(;H>-1;){const ee=i.events[H][1].type;if(ee==="lineEnding"||ee==="linePrefix")H--;else break}const J=H>-1?i.events[H][1].type:null,fe=J==="tableHead"||J==="tableRow"?D:f;return fe===D&&i.parser.lazy[i.now().line]?n(R):fe(R)}function f(R){return e.enter("tableHead"),e.enter("tableRow"),d(R)}function d(R){return R===124||(l=!0,a+=1),p(R)}function p(R){return R===null?n(R):we(R)?a>1?(a=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),v):n(R):$e(R)?Fe(e,p,"whitespace")(R):(a+=1,l&&(l=!1,o+=1),R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),l=!0,p):(e.enter("data"),m(R)))}function m(R){return R===null||R===124||We(R)?(e.exit("data"),p(R)):(e.consume(R),R===92?y:m)}function y(R){return R===92||R===124?(e.consume(R),m):m(R)}function v(R){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(R):(e.enter("tableDelimiterRow"),l=!1,$e(R)?Fe(e,w,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):w(R))}function w(R){return R===45||R===58?N(R):R===124?(l=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),_):O(R)}function _(R){return $e(R)?Fe(e,N,"whitespace")(R):N(R)}function N(R){return R===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),C):R===45?(a+=1,C(R)):R===null||we(R)?B(R):O(R)}function C(R){return R===45?(e.enter("tableDelimiterFiller"),b(R)):O(R)}function b(R){return R===45?(e.consume(R),b):R===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(R))}function E(R){return $e(R)?Fe(e,B,"whitespace")(R):B(R)}function B(R){return R===124?w(R):R===null||we(R)?!l||o!==a?O(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(R)):O(R)}function O(R){return n(R)}function D(R){return e.enter("tableRow"),ie(R)}function ie(R){return R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),ie):R===null||we(R)?(e.exit("tableRow"),t(R)):$e(R)?Fe(e,ie,"whitespace")(R):(e.enter("data"),U(R))}function U(R){return R===null||R===124||We(R)?(e.exit("data"),ie(R)):(e.consume(R),R===92?ce:U)}function ce(R){return R===92||R===124?(e.consume(R),U):U(R)}}function xA(e,t){let n=-1,i=!0,o=0,a=[0,0,0,0],l=[0,0,0,0],c=!1,f=0,d,p,m;const y=new gA;for(;++n<e.length;){const v=e[n],w=v[1];v[0]==="enter"?w.type==="tableHead"?(c=!1,f!==0&&(lg(y,t,f,d,p),p=void 0,f=0),d={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},y.add(n,0,[["enter",d,t]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(i=!0,m=void 0,a=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,p={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},y.add(n,0,[["enter",p,t]])),o=w.type==="tableDelimiterRow"?2:p?3:1):o&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(i=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],m=cl(y,t,a,o,void 0,m),a=[0,0,0,0]),l[2]=n)):w.type==="tableCellDivider"&&(i?i=!1:(a[1]!==0&&(l[0]=l[1],m=cl(y,t,a,o,void 0,m)),a=l,l=[a[1],n,0,0])):w.type==="tableHead"?(c=!0,f=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(f=n,a[1]!==0?(l[0]=l[1],m=cl(y,t,a,o,n,m)):l[1]!==0&&(m=cl(y,t,l,o,n,m)),o=0):o&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&lg(y,t,f,d,p),y.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=kA(t.events,n))}return e}function cl(e,t,n,i,o,a){const l=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(a.end=Object.assign({},Ci(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const f=Ci(t.events,n[1]);if(a={type:l,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const d=Ci(t.events,n[2]),p=Ci(t.events,n[3]),m={type:c,start:Object.assign({},d),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",m,t]]),i!==2){const y=t.events[n[2]],v=t.events[n[3]];if(y[1].end=Object.assign({},v[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,_=n[3]-n[2]-1;e.add(w,_,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return o!==void 0&&(a.end=Object.assign({},Ci(t.events,o)),e.add(o,0,[["exit",a,t]]),a=void 0),a}function lg(e,t,n,i,o){const a=[],l=Ci(t.events,n);o&&(o.end=Object.assign({},l),a.push(["exit",o,t])),i.end=Object.assign({},l),a.push(["exit",i,t]),e.add(n+1,0,a)}function Ci(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const SA={name:"tasklistCheck",tokenize:_A};function CA(){return{text:{91:SA}}}function _A(e,t,n){const i=this;return o;function o(f){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),a)}function a(f){return We(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),l):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),l):n(f)}function l(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(f)}function c(f){return we(f)?t(f):$e(f)?e.check({tokenize:bA},t,n)(f):n(f)}}function bA(e,t,n){return Fe(e,i,"whitespace");function i(o){return o===null?n(o):t(o)}}function EA(e){return Dy([YT(),lA(),mA(e),vA(),CA()])}const IA={};function NA(e){const t=this,n=e||IA,i=t.data(),o=i.micromarkExtensions||(i.micromarkExtensions=[]),a=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),l=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);o.push(EA(n)),a.push(qT()),l.push(KT(n))}function Nk({text:e}){return x.jsx("div",{className:"md",children:x.jsx(mN,{remarkPlugins:[NA],children:e})})}const TA=320;function ag({value:e,inputRef:t,className:n,...i}){const o=q.useRef(null);return q.useLayoutEffect(()=>{const a=o.current;a&&(a.style.height="0",a.style.height=`${a.scrollHeight}px`)},[e]),x.jsx("textarea",{ref:a=>{o.current=a,t?.(a)},rows:1,value:e,className:`task-ta ${n??""}`,spellCheck:!1,...i})}function AA(){return x.jsx("svg",{viewBox:"0 0 10 16",width:"10",height:"16","aria-hidden":"true",children:[3,8,13].flatMap(e=>[2,7].map(t=>x.jsx("circle",{cx:t+.5,cy:e,r:"1.3",fill:"currentColor"},`${t}${e}`)))})}function ug(e){const{item:t}=e,[n,i]=q.useState(t.title),[o,a]=q.useState(t.body);q.useEffect(()=>i(t.title),[t.title]),q.useEffect(()=>a(t.body),[t.body]);const l=q.useRef(null),c=q.useRef(null),f=q.useRef(!1);q.useEffect(()=>{if(!e.focus)return;const w=e.focus==="title"?l.current:c.current;w&&(w.focus(),w.setSelectionRange(w.value.length,w.value.length)),e.onFocused()},[e.focus]);const d=async()=>{const w=n.trim();if(e.draft){w?await e.onTitle(w):e.onCancel();return}if(!w){i(t.title);return}w!==t.title&&await e.onTitle(w)},p=async()=>{o!==t.body&&await e.onBody(o)},m=w=>{if(w.key==="Enter"&&!w.shiftKey&&!w.nativeEvent.isComposing){w.preventDefault(),f.current=!0;const _=n.trim();if(e.draft&&!_){e.onCancel();return}e.onEnter(_)}else w.key==="Escape"?(w.preventDefault(),f.current=!0,i(t.title),e.draft?e.onCancel():w.currentTarget.blur()):w.key==="Backspace"&&n===""&&(w.preventDefault(),f.current=!0,e.draft?e.onCancel():e.onBackspaceEmpty())},y=w=>{w.key==="Escape"&&(w.preventDefault(),a(t.body),w.currentTarget.blur())},v=["task-row",t.done?"done":"",e.open?"open":"",e.draft?"draft":"",e.completing?"completing":"",e.drag?.dragging?"dragging":"",e.drag?.over?`drop-${e.drag.over}`:""].join(" ");return x.jsxs("div",{className:v,draggable:!!e.drag?.armed,onDragStart:e.drag?.onDragStart,onDragEnd:e.drag?.onDragEnd,onDragOver:e.drag?.onDragOver,onDrop:e.drag?.onDrop,onFocus:e.onOpen,onBlur:w=>{w.currentTarget.contains(w.relatedTarget)||e.onClose()},children:[e.drag?x.jsx("span",{className:"task-grip",title:"拖动排序",onMouseDown:e.drag.onArm,onMouseUp:e.drag.onDisarm,children:x.jsx(AA,{})}):x.jsx("span",{className:"task-grip"}),x.jsx("button",{type:"button",className:"task-check","aria-label":t.done?"标记为未完成":"标记为完成",title:t.done?"标记为未完成":"标记为完成",disabled:!!e.draft,onClick:e.onToggle}),x.jsxs("div",{className:"task-main",children:[x.jsxs("div",{className:"task-line",children:[x.jsx(ag,{className:"task-title",value:n,placeholder:e.titlePlaceholder,inputRef:w=>l.current=w,autoFocus:!!e.draft,onChange:w=>i(w.target.value),onKeyDown:m,onBlur:()=>{if(f.current){f.current=!1;return}d()},"aria-label":"标题"}),e.meta,!e.draft&&x.jsxs("span",{className:"task-actions",children:[e.actions,x.jsx("button",{type:"button",className:"link danger",onClick:e.onDelete,children:"删除"})]})]}),e.open&&!e.draft?x.jsx(ag,{className:"task-body",value:o,placeholder:"详情(Markdown)",inputRef:w=>c.current=w,onChange:w=>a(w.target.value),onKeyDown:y,onBlur:()=>{p()},"aria-label":"详情"}):t.body&&x.jsx("div",{className:"task-details",onMouseDown:w=>{w.target.closest("a")||(w.preventDefault(),e.onOpen(),e.onFocused(),requestAnimationFrame(()=>c.current?.focus()))},children:x.jsx(Nk,{text:t.body})}),e.open&&e.extra]})]})}function Tk(e){const{items:t}=e,n=t.filter(R=>!R.done),i=t.filter(R=>R.done),[o,a]=q.useState(null),[l,c]=q.useState(null),[f,d]=q.useState(!1),[p,m]=q.useState(new Set),[y,v]=q.useState(null),[w,_]=q.useState(null),[N,C]=q.useState(null),[b,E]=q.useState(null);q.useEffect(()=>{e.adding?v({}):v(R=>R&&R.after===void 0?null:R)},[e.adding]);const B=()=>{v(null),e.onAddingChange(!1)},O=R=>{if(R.done){e.onToggle(R.id,!1);return}a(H=>H===R.id?null:H),m(H=>new Set(H).add(R.id)),setTimeout(()=>{e.onToggle(R.id,!0).finally(()=>m(H=>{const J=new Set(H);return J.delete(R.id),J}))},TA)},D=R=>{const H=n.findIndex(fe=>fe.id===R.id);e.onDelete(R.id);const J=H>0?n[H-1]:void 0;J&&c({id:J.id,field:"title"})},ie=R=>({armed:w===R.id,dragging:N===R.id,over:b?.id===R.id?b.pos:null,onArm:()=>_(R.id),onDisarm:()=>_(null),onDragStart:H=>{C(R.id),H.dataTransfer.effectAllowed="move",H.dataTransfer.setData("text/plain",R.id)},onDragEnd:()=>{C(null),E(null),_(null)},onDragOver:H=>{if(!N||N===R.id)return;H.preventDefault(),H.dataTransfer.dropEffect="move";const J=H.currentTarget.getBoundingClientRect(),fe=H.clientY<J.top+J.height/2?"before":"after";(b?.id!==R.id||b.pos!==fe)&&E({id:R.id,pos:fe})},onDrop:H=>{if(H.preventDefault(),!N||!b)return;const J=n.findIndex(ee=>ee.id===b.id),fe=b.pos==="before"?b.id:n[J+1]?.id??null;fe!==N&&e.onMove(N,fe),C(null),E(null),_(null)}}),U=R=>x.jsx(ug,{item:{id:"draft",title:"",body:"",done:!1},draft:!0,open:!1,focus:null,onFocused:()=>{},onOpen:()=>a(null),onClose:()=>{},onTitle:async H=>{await e.onCreate(H,R),B()},onBody:async()=>{},onEnter:async H=>{const J=await e.onCreate(H,R);J?(e.onAddingChange(!1),v({after:J.id})):B()},onBackspaceEmpty:B,onCancel:B,onToggle:()=>{},completing:!1,onDelete:()=>{},titlePlaceholder:e.titlePlaceholder,drag:null},`draft:${R??"top"}`),ce=R=>x.jsx(ug,{item:R,open:o===R.id,focus:l?.id===R.id?l.field:null,onFocused:()=>c(null),onOpen:()=>a(R.id),onClose:()=>a(H=>H===R.id?null:H),onTitle:H=>e.onUpdate(R.id,{title:H}),onBody:H=>e.onUpdate(R.id,{body:H}),onEnter:async H=>{H&&H!==R.title&&await e.onUpdate(R.id,{title:H}),!R.done&&(e.onAddingChange(!1),v({after:R.id}))},onBackspaceEmpty:()=>D(R),onCancel:()=>{},onToggle:()=>O(R),completing:p.has(R.id),onDelete:()=>D(R),meta:e.meta?.(R),extra:e.extra?.(R),actions:e.actions?.(R),titlePlaceholder:e.titlePlaceholder,drag:R.done?null:ie(R)},R.id);return x.jsxs("div",{className:`task-list ${N?"dragging":""}`,children:[y&&y.after===void 0&&x.jsxs(x.Fragment,{children:[U(),e.addHint&&x.jsx("div",{className:"task-add-hint",children:e.addHint})]}),n.map(R=>x.jsxs(q.Fragment,{children:[ce(R),y?.after===R.id&&U(R.id)]},R.id)),n.length===0&&!y&&x.jsx("div",{className:"task-empty",children:t.length>0?e.allDoneText:e.emptyText}),i.length>0&&x.jsxs("div",{className:"task-done",children:[x.jsxs("div",{className:"task-done-head",children:[x.jsxs("button",{type:"button",className:"task-done-toggle","aria-expanded":f,onClick:()=>d(R=>!R),children:[x.jsx("span",{className:`chev ${f?"open":""}`,children:"▸"}),e.doneLabel," (",i.length,")"]}),x.jsx("span",{className:"spacer"}),f&&e.onClearDone&&x.jsx("button",{type:"button",className:"link",onClick:()=>{e.onClearDone?.()},children:"全部删除"})]}),f&&i.map(ce)]})]})}function PA({comment:e,onUnlink:t}){const n=V(o=>o.jumpToComment),i=e.startLine===e.endLine?`${e.startLine}`:`${e.startLine}-${e.endLine}`;return x.jsxs("div",{className:`task-sub status-${e.status}`,children:[x.jsx("span",{className:"task-sub-dot"}),x.jsxs("div",{className:"task-sub-main",children:[x.jsxs("div",{className:"task-sub-head",children:[x.jsxs("span",{className:"mono",title:`${e.filePath} (${e.side})`,children:[e.filePath.split("/").pop(),":",i]}),x.jsx("span",{className:`badge badge-${e.status}`,children:e.status}),x.jsxs("span",{className:"task-actions",children:[e.status!=="orphaned"&&x.jsx("button",{type:"button",className:"link",onClick:()=>{n(e)},children:"跳转"}),x.jsx("button",{type:"button",className:"link danger",onClick:t,children:"解除关联"})]})]}),x.jsx("div",{className:"task-sub-body",children:e.body})]})]})}function RA({issue:e,byId:t}){const n=V(c=>c.updateIssue),i=V(c=>c.selectedCommentIds),o=V(c=>c.clearSelectedComments),a=i.filter(c=>!e.commentIds.includes(c)),l=c=>{n(e.id,{commentIds:e.commentIds.filter(f=>f!==c)})};return x.jsxs("div",{className:"task-subs",children:[e.commentIds.map(c=>{const f=t.get(c);return f?x.jsx(PA,{comment:f,onUnlink:()=>l(c)},c):x.jsxs("div",{className:"task-sub muted",children:["评论 ",c.slice(0,8)," 已不存在",x.jsx("button",{type:"button",className:"link",onClick:()=>l(c),children:"移除"})]},c)}),a.length>0&&x.jsxs("button",{type:"button",className:"link task-sub-add",onClick:async()=>{await n(e.id,{commentIds:[...e.commentIds,...a]}),o()},children:["+ 关联选中的 ",a.length," 条评论"]}),e.commentIds.length===0&&a.length===0&&x.jsx("div",{className:"task-sub-none",children:"没有关联评论。在评论卡片上勾选几条,再回到这里关联。"})]})}function LA(){const e=V(b=>b.issues),t=V(b=>b.loadIssues),n=V(b=>b.createIssue),i=V(b=>b.updateIssue),o=V(b=>b.deleteIssue),a=V(b=>b.deleteIssues),l=V(b=>b.moveIssue),c=V(b=>b.exportIssue),f=V(b=>b.selectedCommentIds),d=V(b=>b.clearSelectedComments),p=V(b=>b.setPanel),m=V(b=>b.allComments),y=V(b=>b.comments),[v,w]=q.useState(!1);q.useEffect(()=>{t()},[t]),q.useEffect(()=>{f.length>0&&w(!0)},[f.length]);const _=q.useMemo(()=>{const b=new Map;for(const E of m)b.set(E.id,E);for(const E of y)b.set(E.id,E);return b},[m,y]),N=q.useMemo(()=>e.map(b=>({...b,done:b.status==="closed"})),[e]),C=N.filter(b=>!b.done).length;return x.jsxs("aside",{className:"issues-drawer",children:[x.jsxs("div",{className:"drawer-head",children:[x.jsx("span",{className:"drawer-title",children:"Issues"}),x.jsxs("span",{className:"muted",children:[C," open"]}),x.jsx("span",{className:"spacer"}),x.jsx("button",{className:"icon",onClick:()=>p("diff"),title:"关闭 (Esc)",children:"✕"})]}),x.jsxs("div",{className:"rail-list tasks",children:[x.jsxs("button",{type:"button",className:"task-add",onClick:()=>w(!0),title:"添加一个 Issue(回车可以连着写)",children:[x.jsx("span",{className:"task-add-plus",children:"+"}),"添加 Issue"]}),x.jsx(Tk,{items:N,adding:v,onAddingChange:b=>{w(b),b||d()},addHint:f.length>0?`将关联 ${f.length} 条选中的评论`:void 0,titlePlaceholder:"标题",doneLabel:"已关闭",emptyText:"还没有 Issue。在评论卡片上勾选几条,或点上面的“添加 Issue”。",allDoneText:"没有打开的 Issue",onCreate:(b,E)=>n({title:b,body:"",commentIds:f,after:E}),onUpdate:(b,E)=>i(b,E),onToggle:(b,E)=>i(b,{status:E?"closed":"open"}),onDelete:o,onMove:l,onClearDone:()=>a(N.filter(b=>b.done).map(b=>b.id)),meta:b=>b.commentIds.length>0?x.jsxs("span",{className:"task-count",title:"关联的评论数",children:[b.commentIds.length," 评论"]}):null,actions:b=>x.jsx("button",{type:"button",className:"link",onClick:()=>{c(b.id)},title:"把 Issue 和它的评论复制为 agent 可读的提示词",children:"复制"}),extra:b=>x.jsx(RA,{issue:b,byId:_})})]})]})}const jA=e=>e.trim().replace(/\//g,"-"),wi=e=>e.split("/").filter(Boolean).pop()??e;function MA({data:e,onDone:t}){const n=V(b=>b.repo),i=V(b=>b.showToast),[o,a]=q.useState(""),[l,c]=q.useState(""),[f,d]=q.useState(null),[p,m]=q.useState(!1),y=o.trim(),v=q.useMemo(()=>e.branches.find(b=>b.name===y),[e.branches,y]),w=n?.defaultBase??"HEAD",_=f??(y?e.pathPrefix+jA(y):""),N=e.branches.filter(b=>!b.worktree),C=async b=>{b.preventDefault();const E=_.trim();if(!(!y||!E||p)){m(!0);try{const B=await Re.createWorktree({path:E,branch:y,...v?{}:{base:l.trim()||w}});t(B.path)}catch(B){i(B instanceof Error?B.message:String(B),"error")}finally{m(!1)}}};return x.jsxs("form",{className:"wt-add",onSubmit:b=>{C(b)},children:[x.jsxs("label",{children:["分支",x.jsx("input",{list:"wt-branches",value:o,onChange:b=>a(b.target.value),placeholder:"新分支名,或一个现有分支",spellCheck:!1,autoFocus:!0,"aria-label":"分支"}),x.jsx("datalist",{id:"wt-branches",children:N.map(b=>x.jsx("option",{value:b.name},b.name))})]}),x.jsxs("label",{title:v?"现有分支直接检出,不需要 base":"新分支从这个 ref 创建",children:["基于",x.jsx("input",{value:l,onChange:b=>c(b.target.value),placeholder:w,disabled:!!v,spellCheck:!1,"aria-label":"base"})]}),x.jsxs("label",{children:["路径",x.jsx("input",{className:"mono",value:_,onChange:b=>d(b.target.value),placeholder:`${e.pathPrefix}<branch>`,spellCheck:!1,"aria-label":"路径"})]}),x.jsx("button",{type:"submit",disabled:p||!y||!_.trim(),children:p?"创建中…":v?"检出到新 worktree":"新建分支和 worktree"})]})}function OA(){const e=V(U=>U.root),t=V(U=>U.repo),n=V(U=>U.targetKey),i=V(U=>U.setTarget),o=V(U=>U.reloadRepo),a=V(U=>U.showToast),[l,c]=q.useState(null),[f,d]=q.useState(null),[p,m]=q.useState(!1),[y,v]=q.useState(!0),[w,_]=q.useState(null),[N,C]=q.useState(null),b=q.useCallback(async()=>{try{c(await Re.worktrees()),d(null)}catch(U){d(U instanceof Error?U.message:String(U))}},[]);q.useEffect(()=>{b()},[b]);const E=q.useMemo(()=>jl(n),[n]),B=U=>{i(Ut({...E,worktree:U.path===t?.root?void 0:U.path}))},O=async U=>{m(!1),a(`已创建 worktree ${wi(U)}`),await Promise.all([b(),o()])},D=async(U,ce)=>{C(U.path);try{const R=await Re.removeWorktree({path:U.path,force:ce,deleteBranch:y&&!!U.branch});_(null),R.branchError?a(`已删除 ${wi(U.path)},分支 ${U.branch} 保留:${R.branchError}`):R.branchDeleted?a(`已删除 ${wi(U.path)} 和分支 ${U.branch}`):a(U.prunable?`已清理 ${wi(U.path)}`:`已删除 ${wi(U.path)}`),e===U.path&&await i(Ut({kind:"working"})),await Promise.all([b(),o()])}catch(R){R instanceof Ur&&(R.code==="worktree_dirty"||R.code==="needs_force")?(await b(),_({path:U.path,dirty:R.code==="worktree_dirty",message:R.message})):a(R instanceof Error?R.message:String(R),"error")}finally{C(null)}},ie=U=>fl(U).then(()=>a("已复制路径"),ce=>a(ce instanceof Error?ce.message:String(ce),"error"));return x.jsxs("div",{className:"worktrees-panel",children:[x.jsxs("div",{className:"wt-tools",children:[x.jsx("button",{onClick:()=>m(!p),"aria-pressed":p,children:"新建 worktree"}),x.jsxs("label",{className:"wt-opt",title:"删除 worktree 时 git branch -d 它的分支;没合并的分支会保留",children:[x.jsx("input",{type:"checkbox",checked:y,onChange:U=>v(U.target.checked)}),"一并删除已合并的分支"]}),x.jsx("span",{className:"spacer"}),x.jsx("span",{className:"muted",children:l?`${l.worktrees.length} 个 worktree`:"加载中…"}),x.jsx("button",{className:"link",onClick:()=>{b()},children:"刷新"})]}),p&&l&&x.jsx(MA,{data:l,onDone:U=>{O(U)}}),x.jsxs("div",{className:"wt-list",children:[f&&x.jsx("div",{className:"wt-empty muted",children:f}),l?.worktrees.map(U=>{const ce=U.path===e;return x.jsxs("div",{className:`wt-row ${ce?"active":""} ${U.prunable?"gone":""}`,children:[x.jsxs("div",{className:"wt-main",children:[x.jsxs("div",{className:"wt-head",children:[x.jsx("span",{className:"wt-name",children:wi(U.path)}),U.isMain&&x.jsx("span",{className:"badge",children:"主仓库"}),U.branch?x.jsx("span",{className:"ref ref-branch",children:U.branch}):x.jsxs("span",{className:"ref",children:["detached ",U.head.slice(0,7)]}),U.prunable?x.jsx("span",{className:"badge badge-orphaned",children:"目录已不存在"}):U.dirty>0?x.jsxs("span",{className:"badge",children:[U.dirty," 处未提交改动"]}):x.jsx("span",{className:"muted small",children:"干净"}),ce&&x.jsx("span",{className:"badge badge-open",children:"当前"})]}),x.jsx("div",{className:"wt-path mono muted",title:U.path,children:U.path}),w?.path===U.path&&x.jsxs("div",{className:"wt-confirm",children:[x.jsx("span",{children:w.dirty?`${U.dirty>0?`有 ${U.dirty} 处未提交的改动`:"有未提交的改动"},删除会把它们一起丢掉。`:`git 拒绝了:${w.message}。要强制删除吗?`}),x.jsx("button",{className:"link danger",disabled:N===U.path,onClick:()=>{D(U,!0)},children:w.dirty?"仍然删除":"强制删除"}),x.jsx("button",{className:"link",onClick:()=>_(null),children:"取消"})]})]}),x.jsxs("div",{className:"wt-actions",children:[!U.prunable&&!ce&&x.jsx("button",{className:"link",onClick:()=>B(U),title:"把 review 切换到这个 worktree",children:"查看"}),x.jsx("button",{className:"link",onClick:()=>{ie(U.path)},title:"复制路径,贴给 agent",children:"复制路径"}),!U.isMain&&x.jsx("button",{className:"link danger",disabled:N===U.path,onClick:()=>{D(U,!1)},children:U.prunable?"清理":"删除"})]})]},U.path)}),l&&l.worktrees.length===1&&!p&&x.jsx("div",{className:"wt-empty muted",children:"只有主仓库。新建一个 worktree,让 agent 在自己的分支和目录里工作。"})]})]})}function Ak({title:e,initial:t="",submitLabel:n="保存评论",onSave:i,onCancel:o}){const[a,l]=q.useState(t),[c,f]=q.useState(!1),d=q.useRef(null);q.useEffect(()=>{d.current?.focus()},[]);const p=async()=>{if(!(!a.trim()||c)){f(!0);try{await i(a)}finally{f(!1)}}};return x.jsxs("div",{className:"comment-editor",onMouseDown:m=>m.stopPropagation(),children:[x.jsx("div",{className:"comment-editor-head",children:e}),x.jsx("textarea",{ref:d,value:a,onChange:m=>l(m.target.value),placeholder:"写评论,支持 Markdown。Ctrl+Enter 保存,Esc 取消。",rows:4,onKeyDown:m=>{(m.ctrlKey||m.metaKey)&&m.key==="Enter"?(m.preventDefault(),p()):m.key==="Escape"&&(m.preventDefault(),o()),m.stopPropagation()}}),x.jsxs("div",{className:"comment-editor-actions",children:[x.jsx("button",{className:"primary",onClick:()=>{p()},disabled:!a.trim()||c,children:n}),x.jsx("button",{onClick:o,children:"取消"})]})]})}function cg(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function DA(e){const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const n=new Date;return t.toDateString()===n.toDateString()?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):t.toLocaleDateString([],{month:"numeric",day:"numeric"})}function $A(e){const t=an(e);return t?t.kind==="working"?"Unstaged":t.kind==="staged"?"Staged":t.kind==="all"?"All":wc(t):e}function fg({comment:e,showSnippet:t=!1,showFile:n=!1}){const i=V(C=>C.updateComment),o=V(C=>C.deleteComment),a=V(C=>C.exportComments),l=V(C=>C.selectedCommentIds.includes(e.id)),c=V(C=>C.toggleSelectComment),f=V(C=>C.setReattaching),d=V(C=>C.reattaching===e.id),p=V(C=>C.focusedCommentId===e.id),m=V(C=>C.focusComment),y=V(C=>C.targetKey),[v,w]=q.useState(!1),_=e.startLine===e.endLine?`${e.startLine}`:`${e.startLine}-${e.endLine}`,N=e.status!=="orphaned"&&e.targetKey!==y?$A(e.targetKey):null;return x.jsxs("div",{className:`comment-card status-${e.status} ${l?"selected":""} ${p?"focused":""} ${d?"reattaching":""}`,onClick:()=>{p||m(e.id)},children:[x.jsxs("div",{className:"comment-head",children:[n&&x.jsx("span",{className:"mono file",title:e.filePath,children:e.filePath.split("/").pop()}),x.jsx("label",{className:"check",title:"选中以创建 / 关联 Issue",onClick:C=>C.stopPropagation(),children:x.jsx("input",{type:"checkbox",checked:l,onChange:()=>c(e.id)})}),x.jsxs("span",{className:"mono",children:[e.side," ",_]}),x.jsx("span",{className:`badge badge-${e.status}`,children:e.status}),N&&x.jsx("span",{className:"badge",title:`这条评论现在位于 ${e.targetKey},点击卡片可跳转`,children:N}),x.jsx("span",{className:"muted time",title:`created ${cg(e.createdAt)}${e.exportedAt?`
198
+ exported ${cg(e.exportedAt)}`:""}`,children:DA(e.updatedAt)}),x.jsxs("span",{className:"card-actions",children:[e.status==="orphaned"&&x.jsx("button",{className:`link ${d?"active":""}`,onClick:C=>{C.stopPropagation(),f(d?null:e.id)},children:d?"取消重附着":"重新附着"}),x.jsx("button",{className:"link",onClick:C=>{C.stopPropagation(),a([e.id])},title:"复制此条评论",children:"复制"}),x.jsx("button",{className:"link",onClick:C=>{C.stopPropagation(),w(!0)},children:"编辑"}),x.jsx("button",{className:"link danger",onClick:C=>{C.stopPropagation(),window.confirm("删除这条评论?")&&o(e.id)},children:"删除"})]})]}),(t||e.status==="orphaned")&&e.codeSnippet.length>0&&x.jsx("pre",{className:"snippet",children:e.codeSnippet.map((C,b)=>x.jsxs("div",{children:[x.jsx("span",{className:"ln",children:e.startLine+b}),C]},b))}),v?x.jsx(Ak,{title:"编辑评论",initial:e.body,onSave:async C=>{await i(e.id,{body:C}),w(!1)},onCancel:()=>w(!1)}):x.jsx(Nk,{text:e.body})]})}function dg(e){return[e.filePath,e.side==="old"?0:1,e.endLine]}function vc(e,t){const[n,i,o]=dg(e),[a,l,c]=dg(t);return n!==a?n<a?-1:1:o!==c?o-c:i-l}function FA(){const e=V(O=>O.comments),t=V(O=>O.activeFile),n=V(O=>O.railFilter),i=V(O=>O.setRailFilter),o=V(O=>O.editor),a=V(O=>O.setEditor),l=V(O=>O.createComment),c=V(O=>O.copyAllComments),f=V(O=>O.includeExported),d=V(O=>O.setIncludeExported),p=V(O=>O.selectedCommentIds),m=V(O=>O.setPanel),y=V(O=>O.reattaching),v=V(O=>O.setReattaching),w=q.useMemo(()=>({file:e.filter(O=>O.filePath===t).length,all:e.length,unexported:e.filter(O=>O.status==="active").length,orphaned:e.filter(O=>O.status==="orphaned").length}),[e,t]),_=q.useMemo(()=>{let O=e;n==="file"?O=O.filter(U=>U.filePath===t):n==="unexported"&&(O=O.filter(U=>U.status==="active"));const D=O.filter(U=>U.status==="orphaned").sort(vc),ie=O.filter(U=>U.status!=="orphaned").sort(vc);return{orphaned:D,attached:ie}},[e,n,t]),N=q.useMemo(()=>{if(!o||n==="file"&&o.filePath!==t)return-1;const O={filePath:o.filePath,side:o.side,endLine:o.endLine};let D=0;for(;D<_.attached.length&&vc(_.attached[D],O)<=0;)D++;return D},[o,_.attached,n,t]),C=w.unexported+(f?e.filter(O=>O.status==="exported").length:0),b=n!=="file",E=[["file","此文件",w.file],["all","全部",w.all],["unexported","未导出",w.unexported]],B=o&&x.jsx(Ak,{title:`新评论 · ${o.filePath.split("/").pop()} ${o.side} ${o.startLine===o.endLine?o.startLine:`${o.startLine}-${o.endLine}`}`,onSave:async O=>{await l({filePath:o.filePath,side:o.side,startLine:o.startLine,endLine:o.endLine,body:O})},onCancel:()=>a(null)},`${o.filePath}:${o.side}:${o.startLine}:${o.endLine}`);return x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"rail-tools",children:[x.jsx("div",{className:"seg small",role:"group","aria-label":"评论筛选",children:E.map(([O,D,ie])=>x.jsxs("button",{className:n===O?"active":"","aria-pressed":n===O,onClick:()=>i(O),children:[D,x.jsx("span",{className:"tab-count",children:ie})]},O))}),x.jsx("span",{className:"spacer"}),w.orphaned>0&&x.jsxs("span",{className:"badge badge-orphaned",children:[w.orphaned," orphaned"]})]}),y&&x.jsxs("div",{className:"rail-notice",children:["在 diff 中点击或拖选行,把评论附着到该位置。",x.jsx("button",{className:"link",onClick:()=>v(null),children:"取消"})]}),x.jsxs("div",{className:"rail-list",children:[_.orphaned.map(O=>x.jsx(fg,{comment:O,showFile:b},O.id)),_.attached.map((O,D)=>x.jsxs("div",{className:"rail-slot",children:[N===D&&B,x.jsx(fg,{comment:O,showFile:b})]},O.id)),o&&N===_.attached.length&&B,o&&N===-1&&B,w.all===0&&!o&&x.jsxs("div",{className:"muted empty",children:["还没有评论。在 diff 行旁点击 ",x.jsx("span",{className:"add-btn static",children:"+"})," 或拖选多行开始。"]}),w.all>0&&_.orphaned.length+_.attached.length===0&&!o&&x.jsx("div",{className:"muted empty",children:"没有符合筛选的评论"})]}),x.jsxs("div",{className:"rail-foot",children:[x.jsxs("div",{className:"rail-foot-row",children:[x.jsxs("button",{className:"send",onClick:()=>{c()},disabled:C===0,title:"把评论复制为 agent 可读的提示词",children:["复制评论",w.unexported>0&&x.jsxs("span",{className:"send-n",children:[w.unexported," 未导出"]})]}),x.jsxs("label",{className:"check",children:[x.jsx("input",{type:"checkbox",checked:f,onChange:O=>d(O.target.checked)}),"含已导出"]})]}),p.length>0&&x.jsxs("button",{className:"accent",onClick:()=>m("issues"),children:["从 ",p.length," 条选中评论创建 Issue"]})]})]})}function zA(){const e=V(E=>E.todos),t=V(E=>E.loadTodos),n=V(E=>E.createTodo),i=V(E=>E.updateTodo),o=V(E=>E.deleteTodo),a=V(E=>E.deleteTodos),l=V(E=>E.moveTodo),c=V(E=>E.copyTodo),f=V(E=>E.repo),d=V(E=>E.root),p=pg(f,d),[m,y]=q.useState("current"),[v,w]=q.useState(!1);q.useEffect(()=>{t()},[t]);const _=q.useMemo(()=>[...new Set(e.map(E=>E.branch))].filter(E=>E!==p).sort(),[e,p]);q.useEffect(()=>{m.startsWith("b:")&&!_.includes(m.slice(2))&&y("current")},[m,_]);const N=m==="all"?null:m==="current"?p:m.slice(2),C=q.useMemo(()=>e.filter(E=>N===null||E.branch===N).map(E=>({...E,done:E.status==="done"})),[e,N]),b=C.filter(E=>!E.done).length;return x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"rail-tools",children:[x.jsxs("select",{className:"task-list-pick",value:m,onChange:E=>y(E.target.value),"aria-label":"Todo 列表",title:"哪个分支的 Todo",children:[x.jsxs("option",{value:"current",children:[p,"(当前分支)"]}),_.map(E=>x.jsx("option",{value:`b:${E}`,children:E},E)),x.jsx("option",{value:"all",children:"所有分支"})]}),x.jsx("span",{className:"spacer"}),x.jsxs("span",{className:"muted",children:[b," 待办"]})]}),x.jsxs("div",{className:"rail-list tasks",children:[x.jsxs("button",{type:"button",className:"task-add",onClick:()=>w(!0),title:"添加一条 Todo(回车可以连着写)",children:[x.jsx("span",{className:"task-add-plus",children:"+"}),"添加 Todo"]}),x.jsx(Tk,{items:C,adding:v,onAddingChange:w,titlePlaceholder:"标题",doneLabel:"已完成",emptyText:`${N??"所有分支"} 还没有 Todo。点上面的“添加 Todo”写第一条。`,allDoneText:"全部完成了",onCreate:(E,B)=>n({title:E,body:"",branch:N??p,after:B}),onUpdate:(E,B)=>i(E,B),onToggle:(E,B)=>i(E,{status:B?"done":"open"}),onDelete:o,onMove:l,onClearDone:()=>a(C.filter(E=>E.done).map(E=>E.id)),meta:E=>N===null?x.jsx("span",{className:"badge",children:E.branch}):null,actions:E=>x.jsx("button",{type:"button",className:"link",onClick:()=>{c(E.id)},title:"只复制这条 Todo 的标题和描述",children:"复制"})})]})]})}function BA(){const e=V(c=>c.railTab),t=V(c=>c.setRailTab),n=V(c=>c.comments.length),i=V(c=>c.repo),o=V(c=>c.root),a=pg(i,o),l=V(c=>c.todos.filter(f=>f.branch===a&&f.status==="open").length);return x.jsxs("aside",{className:"rail",children:[x.jsx("div",{className:"rail-head",children:x.jsxs("div",{className:"tabs",role:"group","aria-label":"右栏",children:[x.jsxs("button",{className:`tab ${e==="comments"?"active":""}`,"aria-pressed":e==="comments",onClick:()=>t("comments"),children:["评论",n>0&&x.jsx("span",{className:"tab-count",children:n})]}),x.jsxs("button",{className:`tab ${e==="todos"?"active":""}`,"aria-pressed":e==="todos",onClick:()=>t("todos"),title:`${a} 分支的 Todo`,children:["Todo",l>0&&x.jsx("span",{className:"tab-count",children:l})]})]})}),e==="comments"?x.jsx(FA,{}):x.jsx(zA,{})]})}function UA(){const e=V(n=>n.toast);if(!e)return null;const t=e.action;return x.jsxs("div",{className:`toast toast-${e.kind}`,role:"status",children:[e.message,t&&x.jsx("button",{type:"button",className:"toast-action",onClick:()=>{V.setState({toast:null}),t.run()},children:t.label})]})}function VA(e){if(!(e instanceof HTMLElement))return!1;const t=e.tagName;return t==="INPUT"?e.type!=="checkbox":t==="TEXTAREA"||t==="SELECT"||e.isContentEditable}function GA(e){const t=an(e.targetKey);if(!t||!$r(t))return e.files.map(a=>({view:e.targetKey,path:a.path}));const n=t.worktree?{worktree:t.worktree}:{},i=Ut({kind:"working",...n}),o=Ut({kind:"staged",...n});return[...e.unstaged.map(a=>({view:i,path:a.path})),...e.staged.map(a=>({view:o,path:a.path}))]}function WA(){const e=V(c=>c.init),t=V(c=>c.initError),n=V(c=>c.repo),i=V(c=>c.panel),o=V(c=>c.root),[a,l]=q.useState(i==="commits");return i==="commits"&&!a&&l(!0),q.useEffect(()=>{e()},[e]),q.useEffect(()=>{if(!o)return;const c=Re.events(o);let f=!1;const d=p=>{try{V.getState().onRepoChanged(JSON.parse(p.data))}catch{}};return c.addEventListener("changed",d),c.onopen=()=>{f&&(f=!1,V.getState().refresh())},c.onerror=()=>{f=!0},()=>{c.removeEventListener("changed",d),c.close()}},[o]),q.useEffect(()=>{const c=f=>{if(f.ctrlKey||f.metaKey||f.altKey||VA(f.target))return;const d=V.getState();if(f.key==="r")f.preventDefault(),d.refresh();else if(f.key==="s"){if(d.panel!=="diff"||!d.stageSel||d.staging)return;f.preventDefault(),d.stageSelection()}else if(f.key==="j"||f.key==="k"){if(d.panel!=="diff")return;const p=GA(d);if(p.length===0)return;f.preventDefault();let m=p.findIndex(w=>w.path===d.activeFile&&w.view===d.targetKey);m<0&&(m=p.findIndex(w=>w.path===d.activeFile));const y=f.key==="j"?Math.min(p.length-1,m+1):Math.max(0,m-1),v=p[y];if(!v)return;(async()=>(v.view!==d.targetKey&&await d.switchView(v.view,v.path),await d.openFile(v.path)))()}else f.key==="Escape"&&(d.stageSel?d.setStageSel(null):d.reattaching?d.setReattaching(null):d.editor?d.setEditor(null):d.focusedCommentId?d.focusComment(null):d.panel!=="diff"&&d.setPanel("diff"))};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[]),t?x.jsxs("div",{className:"fatal",children:[x.jsx("h1",{children:"warden"}),x.jsxs("p",{children:["无法连接服务端:",t]}),x.jsx("button",{onClick:()=>{e()},children:"重试"})]}):n?x.jsxs("div",{className:"app",children:[x.jsx(Ww,{}),x.jsxs("div",{className:"body",children:[x.jsx(Kw,{}),x.jsxs("main",{className:"main",children:[a&&x.jsx(g_,{active:i==="commits"}),i==="worktrees"&&x.jsx(OA,{}),i!=="commits"&&i!=="worktrees"&&x.jsx(u_,{})]}),i==="issues"?x.jsx(LA,{}):i==="diff"?x.jsx(BA,{}):null]}),x.jsx(UA,{})]}):x.jsx("div",{className:"loading-screen",children:"加载中…"})}const Pk=document.getElementById("root");if(!Pk)throw new Error("#root missing");Lw.createRoot(Pk).render(x.jsx(Ss.StrictMode,{children:x.jsx(WA,{})}));