@xbghc/warden 0.5.0 → 0.6.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.
- package/README.md +18 -14
- package/dist/cli.js +1 -20
- package/dist/web/assets/index-Bi9N5cIP.js +197 -0
- package/dist/web/assets/index-pyKaNQqX.css +1 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-BRm8bZtC.css +0 -1
- package/dist/web/assets/index-CZMo0jXP.js +0 -194
|
@@ -1,194 +0,0 @@
|
|
|
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 Wc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tu={exports:{}},ds={},Au={exports:{}},Re={};var fp;function vk(){if(fp)return Re;fp=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 w(L){return L===null||typeof L!="object"?null:(L=m&&L[m]||L["@@iterator"],typeof L=="function"?L:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,E={};function N(L,V,I){this.props=L,this.context=V,this.refs=E,this.updater=I||v}N.prototype.isReactComponent={},N.prototype.setState=function(L,V){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,V,"setState")},N.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function C(){}C.prototype=N.prototype;function b(L,V,I){this.props=L,this.context=V,this.refs=E,this.updater=I||v}var A=b.prototype=new C;A.constructor=b,k(A,N.prototype),A.isPureReactComponent=!0;var B=Array.isArray,P=Object.prototype.hasOwnProperty,M={current:null},ee={key:!0,ref:!0,__self:!0,__source:!0};function oe(L,V,I){var ue,Se={},ye=null,je=null;if(V!=null)for(ue in V.ref!==void 0&&(je=V.ref),V.key!==void 0&&(ye=""+V.key),V)P.call(V,ue)&&!ee.hasOwnProperty(ue)&&(Se[ue]=V[ue]);var Te=arguments.length-2;if(Te===1)Se.children=I;else if(1<Te){for(var De=Array(Te),Ze=0;Ze<Te;Ze++)De[Ze]=arguments[Ze+2];Se.children=De}if(L&&L.defaultProps)for(ue in Te=L.defaultProps,Te)Se[ue]===void 0&&(Se[ue]=Te[ue]);return{$$typeof:e,type:L,key:ye,ref:je,props:Se,_owner:M.current}}function ae(L,V){return{$$typeof:e,type:L.type,key:V,ref:L.ref,props:L.props,_owner:L._owner}}function F(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function ne(L){var V={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(I){return V[I]})}var re=/\/+/g;function de(L,V){return typeof L=="object"&&L!==null&&L.key!=null?ne(""+L.key):V.toString(36)}function ie(L,V,I,ue,Se){var ye=typeof L;(ye==="undefined"||ye==="boolean")&&(L=null);var je=!1;if(L===null)je=!0;else switch(ye){case"string":case"number":je=!0;break;case"object":switch(L.$$typeof){case e:case t:je=!0}}if(je)return je=L,Se=Se(je),L=ue===""?"."+de(je,0):ue,B(Se)?(I="",L!=null&&(I=L.replace(re,"$&/")+"/"),ie(Se,V,I,"",function(Ze){return Ze})):Se!=null&&(F(Se)&&(Se=ae(Se,I+(!Se.key||je&&je.key===Se.key?"":(""+Se.key).replace(re,"$&/")+"/")+L)),V.push(Se)),1;if(je=0,ue=ue===""?".":ue+":",B(L))for(var Te=0;Te<L.length;Te++){ye=L[Te];var De=ue+de(ye,Te);je+=ie(ye,V,I,De,Se)}else if(De=w(L),typeof De=="function")for(L=De.call(L),Te=0;!(ye=L.next()).done;)ye=ye.value,De=ue+de(ye,Te++),je+=ie(ye,V,I,De,Se);else if(ye==="object")throw V=String(L),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.");return je}function X(L,V,I){if(L==null)return L;var ue=[],Se=0;return ie(L,ue,"","",function(ye){return V.call(I,ye,Se++)}),ue}function ge(L){if(L._status===-1){var V=L._result;V=V(),V.then(function(I){(L._status===0||L._status===-1)&&(L._status=1,L._result=I)},function(I){(L._status===0||L._status===-1)&&(L._status=2,L._result=I)}),L._status===-1&&(L._status=0,L._result=V)}if(L._status===1)return L._result.default;throw L._result}var me={current:null},J={transition:null},O={ReactCurrentDispatcher:me,ReactCurrentBatchConfig:J,ReactCurrentOwner:M};function _(){throw Error("act(...) is not supported in production builds of React.")}return Re.Children={map:X,forEach:function(L,V,I){X(L,function(){V.apply(this,arguments)},I)},count:function(L){var V=0;return X(L,function(){V++}),V},toArray:function(L){return X(L,function(V){return V})||[]},only:function(L){if(!F(L))throw Error("React.Children.only expected to receive a single React element child.");return L}},Re.Component=N,Re.Fragment=n,Re.Profiler=o,Re.PureComponent=b,Re.StrictMode=i,Re.Suspense=f,Re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=O,Re.act=_,Re.cloneElement=function(L,V,I){if(L==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+L+".");var ue=k({},L.props),Se=L.key,ye=L.ref,je=L._owner;if(V!=null){if(V.ref!==void 0&&(ye=V.ref,je=M.current),V.key!==void 0&&(Se=""+V.key),L.type&&L.type.defaultProps)var Te=L.type.defaultProps;for(De in V)P.call(V,De)&&!ee.hasOwnProperty(De)&&(ue[De]=V[De]===void 0&&Te!==void 0?Te[De]:V[De])}var De=arguments.length-2;if(De===1)ue.children=I;else if(1<De){Te=Array(De);for(var Ze=0;Ze<De;Ze++)Te[Ze]=arguments[Ze+2];ue.children=Te}return{$$typeof:e,type:L.type,key:Se,ref:ye,props:ue,_owner:je}},Re.createContext=function(L){return L={$$typeof:l,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},L.Provider={$$typeof:a,_context:L},L.Consumer=L},Re.createElement=oe,Re.createFactory=function(L){var V=oe.bind(null,L);return V.type=L,V},Re.createRef=function(){return{current:null}},Re.forwardRef=function(L){return{$$typeof:c,render:L}},Re.isValidElement=F,Re.lazy=function(L){return{$$typeof:p,_payload:{_status:-1,_result:L},_init:ge}},Re.memo=function(L,V){return{$$typeof:d,type:L,compare:V===void 0?null:V}},Re.startTransition=function(L){var V=J.transition;J.transition={};try{L()}finally{J.transition=V}},Re.unstable_act=_,Re.useCallback=function(L,V){return me.current.useCallback(L,V)},Re.useContext=function(L){return me.current.useContext(L)},Re.useDebugValue=function(){},Re.useDeferredValue=function(L){return me.current.useDeferredValue(L)},Re.useEffect=function(L,V){return me.current.useEffect(L,V)},Re.useId=function(){return me.current.useId()},Re.useImperativeHandle=function(L,V,I){return me.current.useImperativeHandle(L,V,I)},Re.useInsertionEffect=function(L,V){return me.current.useInsertionEffect(L,V)},Re.useLayoutEffect=function(L,V){return me.current.useLayoutEffect(L,V)},Re.useMemo=function(L,V){return me.current.useMemo(L,V)},Re.useReducer=function(L,V,I){return me.current.useReducer(L,V,I)},Re.useRef=function(L){return me.current.useRef(L)},Re.useState=function(L){return me.current.useState(L)},Re.useSyncExternalStore=function(L,V,I){return me.current.useSyncExternalStore(L,V,I)},Re.useTransition=function(){return me.current.useTransition()},Re.version="18.3.1",Re}var dp;function Hc(){return dp||(dp=1,Au.exports=vk()),Au.exports}var hp;function kk(){if(hp)return ds;hp=1;var e=Hc(),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={},w=null,v=null;d!==void 0&&(w=""+d),f.key!==void 0&&(w=""+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:w,ref:v,props:m,_owner:o.current}}return ds.Fragment=n,ds.jsx=l,ds.jsxs=l,ds}var pp;function xk(){return pp||(pp=1,Tu.exports=kk()),Tu.exports}var S=xk(),Q=Hc();const vs=Wc(Q);var Ko={},Pu={exports:{}},Ft={},Ru={exports:{}},Lu={};var mp;function Sk(){return mp||(mp=1,(function(e){function t(J,O){var _=J.length;J.push(O);e:for(;0<_;){var L=_-1>>>1,V=J[L];if(0<o(V,O))J[L]=O,J[_]=V,_=L;else break e}}function n(J){return J.length===0?null:J[0]}function i(J){if(J.length===0)return null;var O=J[0],_=J.pop();if(_!==O){J[0]=_;e:for(var L=0,V=J.length,I=V>>>1;L<I;){var ue=2*(L+1)-1,Se=J[ue],ye=ue+1,je=J[ye];if(0>o(Se,_))ye<V&&0>o(je,Se)?(J[L]=je,J[ye]=_,L=ye):(J[L]=Se,J[ue]=_,L=ue);else if(ye<V&&0>o(je,_))J[L]=je,J[ye]=_,L=ye;else break e}}return O}function o(J,O){var _=J.sortIndex-O.sortIndex;return _!==0?_:J.id-O.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,w=3,v=!1,k=!1,E=!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 A(J){for(var O=n(d);O!==null;){if(O.callback===null)i(d);else if(O.startTime<=J)i(d),O.sortIndex=O.expirationTime,t(f,O);else break;O=n(d)}}function B(J){if(E=!1,A(J),!k)if(n(f)!==null)k=!0,ge(P);else{var O=n(d);O!==null&&me(B,O.startTime-J)}}function P(J,O){k=!1,E&&(E=!1,C(oe),oe=-1),v=!0;var _=w;try{for(A(O),m=n(f);m!==null&&(!(m.expirationTime>O)||J&&!ne());){var L=m.callback;if(typeof L=="function"){m.callback=null,w=m.priorityLevel;var V=L(m.expirationTime<=O);O=e.unstable_now(),typeof V=="function"?m.callback=V:m===n(f)&&i(f),A(O)}else i(f);m=n(f)}if(m!==null)var I=!0;else{var ue=n(d);ue!==null&&me(B,ue.startTime-O),I=!1}return I}finally{m=null,w=_,v=!1}}var M=!1,ee=null,oe=-1,ae=5,F=-1;function ne(){return!(e.unstable_now()-F<ae)}function re(){if(ee!==null){var J=e.unstable_now();F=J;var O=!0;try{O=ee(!0,J)}finally{O?de():(M=!1,ee=null)}}else M=!1}var de;if(typeof b=="function")de=function(){b(re)};else if(typeof MessageChannel<"u"){var ie=new MessageChannel,X=ie.port2;ie.port1.onmessage=re,de=function(){X.postMessage(null)}}else de=function(){N(re,0)};function ge(J){ee=J,M||(M=!0,de())}function me(J,O){oe=N(function(){J(e.unstable_now())},O)}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(J){J.callback=null},e.unstable_continueExecution=function(){k||v||(k=!0,ge(P))},e.unstable_forceFrameRate=function(J){0>J||125<J?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ae=0<J?Math.floor(1e3/J):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(J){switch(w){case 1:case 2:case 3:var O=3;break;default:O=w}var _=w;w=O;try{return J()}finally{w=_}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(J,O){switch(J){case 1:case 2:case 3:case 4:case 5:break;default:J=3}var _=w;w=J;try{return O()}finally{w=_}},e.unstable_scheduleCallback=function(J,O,_){var L=e.unstable_now();switch(typeof _=="object"&&_!==null?(_=_.delay,_=typeof _=="number"&&0<_?L+_:L):_=L,J){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=_+V,J={id:p++,callback:O,priorityLevel:J,startTime:_,expirationTime:V,sortIndex:-1},_>L?(J.sortIndex=_,t(d,J),n(f)===null&&J===n(d)&&(E?(C(oe),oe=-1):E=!0,me(B,_-L))):(J.sortIndex=V,t(f,J),k||v||(k=!0,ge(P))),J},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(J){var O=w;return function(){var _=w;w=O;try{return J.apply(this,arguments)}finally{w=_}}}})(Lu)),Lu}var gp;function Ck(){return gp||(gp=1,Ru.exports=Sk()),Ru.exports}var yp;function _k(){if(yp)return Ft;yp=1;var e=Hc(),t=Ck();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 w(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 k(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 E(r,s,u,h,g,y,x){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=y,this.removeEmptyString=x}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){N[r]=new E(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 E(s,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){N[r]=new E(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){N[r]=new E(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 E(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){N[r]=new E(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){N[r]=new E(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){N[r]=new E(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){N[r]=new E(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 E(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 E(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 E(s,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){N[r]=new E(r,1,!1,r.toLowerCase(),null,!1,!1)}),N.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){N[r]=new E(r,1,!1,r.toLowerCase(),null,!0,!0)});function A(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")&&(k(s,u,g,h)&&(u=null),h||g===null?w(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,P=Symbol.for("react.element"),M=Symbol.for("react.portal"),ee=Symbol.for("react.fragment"),oe=Symbol.for("react.strict_mode"),ae=Symbol.for("react.profiler"),F=Symbol.for("react.provider"),ne=Symbol.for("react.context"),re=Symbol.for("react.forward_ref"),de=Symbol.for("react.suspense"),ie=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),ge=Symbol.for("react.lazy"),me=Symbol.for("react.offscreen"),J=Symbol.iterator;function O(r){return r===null||typeof r!="object"?null:(r=J&&r[J]||r["@@iterator"],typeof r=="function"?r:null)}var _=Object.assign,L;function V(r){if(L===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);L=s&&s[1]||""}return`
|
|
3
|
-
`+L+r}var I=!1;function ue(r,s){if(!r||I)return"";I=!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(z){var h=z}Reflect.construct(r,[],s)}else{try{s.call()}catch(z){h=z}r.call(s.prototype)}else{try{throw Error()}catch(z){h=z}r()}}catch(z){if(z&&h&&typeof z.stack=="string"){for(var g=z.stack.split(`
|
|
4
|
-
`),y=h.stack.split(`
|
|
5
|
-
`),x=g.length-1,T=y.length-1;1<=x&&0<=T&&g[x]!==y[T];)T--;for(;1<=x&&0<=T;x--,T--)if(g[x]!==y[T]){if(x!==1||T!==1)do if(x--,T--,0>T||g[x]!==y[T]){var R=`
|
|
6
|
-
`+g[x].replace(" at new "," at ");return r.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",r.displayName)),R}while(1<=x&&0<=T);break}}}finally{I=!1,Error.prepareStackTrace=u}return(r=r?r.displayName||r.name:"")?V(r):""}function Se(r){switch(r.tag){case 5:return V(r.type);case 16:return V("Lazy");case 13:return V("Suspense");case 19:return V("SuspenseList");case 0:case 2:case 15:return r=ue(r.type,!1),r;case 11:return r=ue(r.type.render,!1),r;case 1:return r=ue(r.type,!0),r;default:return""}}function ye(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 ee:return"Fragment";case M:return"Portal";case ae:return"Profiler";case oe:return"StrictMode";case de:return"Suspense";case ie:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case ne:return(r.displayName||"Context")+".Consumer";case F:return(r._context.displayName||"Context")+".Provider";case re:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case X:return s=r.displayName||null,s!==null?s:ye(r.type)||"Memo";case ge:s=r._payload,r=r._init;try{return ye(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 ye(s);case 8:return s===oe?"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 Te(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function De(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Ze(r){var s=De(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,y=u.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return g.call(this)},set:function(x){h=""+x,y.call(this,x)}}),Object.defineProperty(r,s,{enumerable:u.enumerable}),{getValue:function(){return h},setValue:function(x){h=""+x},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function Kt(r){r._valueTracker||(r._valueTracker=Ze(r))}function Ur(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var u=s.getValue(),h="";return r&&(h=De(r)?r.checked?"true":"false":r.value),r=h,r!==u?(s.setValue(r),!0):!1}function Bn(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 U(r,s){var u=s.checked;return _({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??r._wrapperState.initialChecked})}function H(r,s){var u=s.defaultValue==null?"":s.defaultValue,h=s.checked!=null?s.checked:s.defaultChecked;u=Te(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 we(r,s){s=s.checked,s!=null&&A(r,"checked",s,!1)}function Ce(r,s){we(r,s);var u=Te(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")?Ie(r,s.type,u):s.hasOwnProperty("defaultValue")&&Ie(r,s.type,Te(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(r.defaultChecked=!!s.defaultChecked)}function Oe(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 Ie(r,s,u){(s!=="number"||Bn(r.ownerDocument)!==r)&&(u==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+u&&(r.defaultValue=""+u))}var qe=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=""+Te(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 et(r,s){if(s.dangerouslySetInnerHTML!=null)throw Error(n(91));return _({},s,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function Un(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(qe(u)){if(1<u.length)throw Error(n(93));u=u[0]}s=u}s==null&&(s=""),u=s}r._wrapperState={initialValue:Te(u)}}function gr(r,s){var u=Te(s.value),h=Te(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 $s(r){var s=r.textContent;s===r._wrapperState.initialValue&&s!==""&&s!==null&&(r.value=s)}function W(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 se(r,s){return r==null||r==="http://www.w3.org/1999/xhtml"?W(s):r==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var _e,Pe=(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(_e=_e||document.createElement("div"),_e.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=_e.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;s.firstChild;)r.appendChild(s.firstChild)}});function Fe(r,s){if(s){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=s;return}}r.textContent=s}var yt={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},bn=["Webkit","ms","Moz","O"];Object.keys(yt).forEach(function(r){bn.forEach(function(s){s=s+r.charAt(0).toUpperCase()+r.substring(1),yt[s]=yt[r]})});function Qt(r,s,u){return s==null||typeof s=="boolean"||s===""?"":u||typeof s!="number"||s===0||yt.hasOwnProperty(r)&&yt[r]?(""+s).trim():s+"px"}function Vn(r,s){r=r.style;for(var u in s)if(s.hasOwnProperty(u)){var h=u.indexOf("--")===0,g=Qt(u,s[u],h);u==="float"&&(u="cssFloat"),h?r.setProperty(u,g):r[u]=g}}var yr=_({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 wt(r,s){if(s){if(yr[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 yn(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 Bt=null;function Gl(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Wl=null,Vr=null,Gr=null;function Nf(r){if(r=Yi(r)){if(typeof Wl!="function")throw Error(n(280));var s=r.stateNode;s&&(s=ao(s),Wl(r.stateNode,r.type,s))}}function Tf(r){Vr?Gr?Gr.push(r):Gr=[r]:Vr=r}function Af(){if(Vr){var r=Vr,s=Gr;if(Gr=Vr=null,Nf(r),s)for(r=0;r<s.length;r++)Nf(s[r])}}function Pf(r,s){return r(s)}function Rf(){}var Hl=!1;function Lf(r,s,u){if(Hl)return r(s,u);Hl=!0;try{return Pf(r,s,u)}finally{Hl=!1,(Vr!==null||Gr!==null)&&(Rf(),Af())}}function Ai(r,s){var u=r.stateNode;if(u===null)return null;var h=ao(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 ql=!1;if(c)try{var Pi={};Object.defineProperty(Pi,"passive",{get:function(){ql=!0}}),window.addEventListener("test",Pi,Pi),window.removeEventListener("test",Pi,Pi)}catch{ql=!1}function Ew(r,s,u,h,g,y,x,T,R){var z=Array.prototype.slice.call(arguments,3);try{s.apply(u,z)}catch(K){this.onError(K)}}var Ri=!1,zs=null,Bs=!1,Kl=null,bw={onError:function(r){Ri=!0,zs=r}};function Iw(r,s,u,h,g,y,x,T,R){Ri=!1,zs=null,Ew.apply(bw,arguments)}function Nw(r,s,u,h,g,y,x,T,R){if(Iw.apply(this,arguments),Ri){if(Ri){var z=zs;Ri=!1,zs=null}else throw Error(n(198));Bs||(Bs=!0,Kl=z)}}function wr(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 jf(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(wr(r)!==r)throw Error(n(188))}function Tw(r){var s=r.alternate;if(!s){if(s=wr(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 y=g.alternate;if(y===null){if(h=g.return,h!==null){u=h;continue}break}if(g.child===y.child){for(y=g.child;y;){if(y===u)return Of(g),r;if(y===h)return Of(g),s;y=y.sibling}throw Error(n(188))}if(u.return!==h.return)u=g,h=y;else{for(var x=!1,T=g.child;T;){if(T===u){x=!0,u=g,h=y;break}if(T===h){x=!0,h=g,u=y;break}T=T.sibling}if(!x){for(T=y.child;T;){if(T===u){x=!0,u=y,h=g;break}if(T===h){x=!0,h=y,u=g;break}T=T.sibling}if(!x)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 Mf(r){return r=Tw(r),r!==null?Df(r):null}function Df(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var s=Df(r);if(s!==null)return s;r=r.sibling}return null}var Ff=t.unstable_scheduleCallback,$f=t.unstable_cancelCallback,Aw=t.unstable_shouldYield,Pw=t.unstable_requestPaint,nt=t.unstable_now,Rw=t.unstable_getCurrentPriorityLevel,Ql=t.unstable_ImmediatePriority,zf=t.unstable_UserBlockingPriority,Us=t.unstable_NormalPriority,Lw=t.unstable_LowPriority,Bf=t.unstable_IdlePriority,Vs=null,wn=null;function jw(r){if(wn&&typeof wn.onCommitFiberRoot=="function")try{wn.onCommitFiberRoot(Vs,r,void 0,(r.current.flags&128)===128)}catch{}}var ln=Math.clz32?Math.clz32:Dw,Ow=Math.log,Mw=Math.LN2;function Dw(r){return r>>>=0,r===0?32:31-(Ow(r)/Mw|0)|0}var Gs=64,Ws=4194304;function Li(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 Hs(r,s){var u=r.pendingLanes;if(u===0)return 0;var h=0,g=r.suspendedLanes,y=r.pingedLanes,x=u&268435455;if(x!==0){var T=x&~g;T!==0?h=Li(T):(y&=x,y!==0&&(h=Li(y)))}else x=u&~g,x!==0?h=Li(x):y!==0&&(h=Li(y));if(h===0)return 0;if(s!==0&&s!==h&&(s&g)===0&&(g=h&-h,y=s&-s,g>=y||g===16&&(y&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-ln(s),g=1<<u,h|=r[u],s&=~g;return h}function Fw(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 $w(r,s){for(var u=r.suspendedLanes,h=r.pingedLanes,g=r.expirationTimes,y=r.pendingLanes;0<y;){var x=31-ln(y),T=1<<x,R=g[x];R===-1?((T&u)===0||(T&h)!==0)&&(g[x]=Fw(T,s)):R<=s&&(r.expiredLanes|=T),y&=~T}}function Xl(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function Uf(){var r=Gs;return Gs<<=1,(Gs&4194240)===0&&(Gs=64),r}function Yl(r){for(var s=[],u=0;31>u;u++)s.push(r);return s}function ji(r,s,u){r.pendingLanes|=s,s!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,s=31-ln(s),r[s]=u}function zw(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-ln(u),y=1<<g;s[g]=0,h[g]=-1,r[g]=-1,u&=~y}}function Jl(r,s){var u=r.entangledLanes|=s;for(r=r.entanglements;u;){var h=31-ln(u),g=1<<h;g&s|r[h]&s&&(r[h]|=s),u&=~g}}var Ue=0;function Vf(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var Gf,Zl,Wf,Hf,qf,ea=!1,qs=[],Gn=null,Wn=null,Hn=null,Oi=new Map,Mi=new Map,qn=[],Bw="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 Kf(r,s){switch(r){case"focusin":case"focusout":Gn=null;break;case"dragenter":case"dragleave":Wn=null;break;case"mouseover":case"mouseout":Hn=null;break;case"pointerover":case"pointerout":Oi.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Mi.delete(s.pointerId)}}function Di(r,s,u,h,g,y){return r===null||r.nativeEvent!==y?(r={blockedOn:s,domEventName:u,eventSystemFlags:h,nativeEvent:y,targetContainers:[g]},s!==null&&(s=Yi(s),s!==null&&Zl(s)),r):(r.eventSystemFlags|=h,s=r.targetContainers,g!==null&&s.indexOf(g)===-1&&s.push(g),r)}function Uw(r,s,u,h,g){switch(s){case"focusin":return Gn=Di(Gn,r,s,u,h,g),!0;case"dragenter":return Wn=Di(Wn,r,s,u,h,g),!0;case"mouseover":return Hn=Di(Hn,r,s,u,h,g),!0;case"pointerover":var y=g.pointerId;return Oi.set(y,Di(Oi.get(y)||null,r,s,u,h,g)),!0;case"gotpointercapture":return y=g.pointerId,Mi.set(y,Di(Mi.get(y)||null,r,s,u,h,g)),!0}return!1}function Qf(r){var s=vr(r.target);if(s!==null){var u=wr(s);if(u!==null){if(s=u.tag,s===13){if(s=jf(u),s!==null){r.blockedOn=s,qf(r.priority,function(){Wf(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 Ks(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var u=na(r.domEventName,r.eventSystemFlags,s[0],r.nativeEvent);if(u===null){u=r.nativeEvent;var h=new u.constructor(u.type,u);Bt=h,u.target.dispatchEvent(h),Bt=null}else return s=Yi(u),s!==null&&Zl(s),r.blockedOn=u,!1;s.shift()}return!0}function Xf(r,s,u){Ks(r)&&u.delete(s)}function Vw(){ea=!1,Gn!==null&&Ks(Gn)&&(Gn=null),Wn!==null&&Ks(Wn)&&(Wn=null),Hn!==null&&Ks(Hn)&&(Hn=null),Oi.forEach(Xf),Mi.forEach(Xf)}function Fi(r,s){r.blockedOn===s&&(r.blockedOn=null,ea||(ea=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Vw)))}function $i(r){function s(g){return Fi(g,r)}if(0<qs.length){Fi(qs[0],r);for(var u=1;u<qs.length;u++){var h=qs[u];h.blockedOn===r&&(h.blockedOn=null)}}for(Gn!==null&&Fi(Gn,r),Wn!==null&&Fi(Wn,r),Hn!==null&&Fi(Hn,r),Oi.forEach(s),Mi.forEach(s),u=0;u<qn.length;u++)h=qn[u],h.blockedOn===r&&(h.blockedOn=null);for(;0<qn.length&&(u=qn[0],u.blockedOn===null);)Qf(u),u.blockedOn===null&&qn.shift()}var Wr=B.ReactCurrentBatchConfig,Qs=!0;function Gw(r,s,u,h){var g=Ue,y=Wr.transition;Wr.transition=null;try{Ue=1,ta(r,s,u,h)}finally{Ue=g,Wr.transition=y}}function Ww(r,s,u,h){var g=Ue,y=Wr.transition;Wr.transition=null;try{Ue=4,ta(r,s,u,h)}finally{Ue=g,Wr.transition=y}}function ta(r,s,u,h){if(Qs){var g=na(r,s,u,h);if(g===null)va(r,s,h,Xs,u),Kf(r,h);else if(Uw(g,r,s,u,h))h.stopPropagation();else if(Kf(r,h),s&4&&-1<Bw.indexOf(r)){for(;g!==null;){var y=Yi(g);if(y!==null&&Gf(y),y=na(r,s,u,h),y===null&&va(r,s,h,Xs,u),y===g)break;g=y}g!==null&&h.stopPropagation()}else va(r,s,h,null,u)}}var Xs=null;function na(r,s,u,h){if(Xs=null,r=Gl(h),r=vr(r),r!==null)if(s=wr(r),s===null)r=null;else if(u=s.tag,u===13){if(r=jf(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 Xs=r,null}function Yf(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(Rw()){case Ql:return 1;case zf:return 4;case Us:case Lw:return 16;case Bf:return 536870912;default:return 16}default:return 16}}var Kn=null,ra=null,Ys=null;function Jf(){if(Ys)return Ys;var r,s=ra,u=s.length,h,g="value"in Kn?Kn.value:Kn.textContent,y=g.length;for(r=0;r<u&&s[r]===g[r];r++);var x=u-r;for(h=1;h<=x&&s[u-h]===g[y-h];h++);return Ys=g.slice(r,1<h?1-h:void 0)}function Js(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 Zs(){return!0}function Zf(){return!1}function Ut(r){function s(u,h,g,y,x){this._reactName=u,this._targetInst=g,this.type=h,this.nativeEvent=y,this.target=x,this.currentTarget=null;for(var T in r)r.hasOwnProperty(T)&&(u=r[T],this[T]=u?u(y):y[T]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Zs:Zf,this.isPropagationStopped=Zf,this}return _(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=Zs)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Zs)},persist:function(){},isPersistent:Zs}),s}var Hr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ia=Ut(Hr),zi=_({},Hr,{view:0,detail:0}),Hw=Ut(zi),sa,oa,Bi,eo=_({},zi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:aa,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!==Bi&&(Bi&&r.type==="mousemove"?(sa=r.screenX-Bi.screenX,oa=r.screenY-Bi.screenY):oa=sa=0,Bi=r),sa)},movementY:function(r){return"movementY"in r?r.movementY:oa}}),ed=Ut(eo),qw=_({},eo,{dataTransfer:0}),Kw=Ut(qw),Qw=_({},zi,{relatedTarget:0}),la=Ut(Qw),Xw=_({},Hr,{animationName:0,elapsedTime:0,pseudoElement:0}),Yw=Ut(Xw),Jw=_({},Hr,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Zw=Ut(Jw),ev=_({},Hr,{data:0}),td=Ut(ev),tv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},nv={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"},rv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function iv(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=rv[r])?!!s[r]:!1}function aa(){return iv}var sv=_({},zi,{key:function(r){if(r.key){var s=tv[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=Js(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?nv[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:aa,charCode:function(r){return r.type==="keypress"?Js(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Js(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),ov=Ut(sv),lv=_({},eo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nd=Ut(lv),av=_({},zi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:aa}),uv=Ut(av),cv=_({},Hr,{propertyName:0,elapsedTime:0,pseudoElement:0}),fv=Ut(cv),dv=_({},eo,{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}),hv=Ut(dv),pv=[9,13,27,32],ua=c&&"CompositionEvent"in window,Ui=null;c&&"documentMode"in document&&(Ui=document.documentMode);var mv=c&&"TextEvent"in window&&!Ui,rd=c&&(!ua||Ui&&8<Ui&&11>=Ui),id=" ",sd=!1;function od(r,s){switch(r){case"keyup":return pv.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ld(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var qr=!1;function gv(r,s){switch(r){case"compositionend":return ld(s);case"keypress":return s.which!==32?null:(sd=!0,id);case"textInput":return r=s.data,r===id&&sd?null:r;default:return null}}function yv(r,s){if(qr)return r==="compositionend"||!ua&&od(r,s)?(r=Jf(),Ys=ra=Kn=null,qr=!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 rd&&s.locale!=="ko"?null:s.data;default:return null}}var wv={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 ad(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!wv[r.type]:s==="textarea"}function ud(r,s,u,h){Tf(h),s=so(s,"onChange"),0<s.length&&(u=new ia("onChange","change",null,u,h),r.push({event:u,listeners:s}))}var Vi=null,Gi=null;function vv(r){Id(r,0)}function to(r){var s=Jr(r);if(Ur(s))return r}function kv(r,s){if(r==="change")return s}var cd=!1;if(c){var ca;if(c){var fa="oninput"in document;if(!fa){var fd=document.createElement("div");fd.setAttribute("oninput","return;"),fa=typeof fd.oninput=="function"}ca=fa}else ca=!1;cd=ca&&(!document.documentMode||9<document.documentMode)}function dd(){Vi&&(Vi.detachEvent("onpropertychange",hd),Gi=Vi=null)}function hd(r){if(r.propertyName==="value"&&to(Gi)){var s=[];ud(s,Gi,r,Gl(r)),Lf(vv,s)}}function xv(r,s,u){r==="focusin"?(dd(),Vi=s,Gi=u,Vi.attachEvent("onpropertychange",hd)):r==="focusout"&&dd()}function Sv(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return to(Gi)}function Cv(r,s){if(r==="click")return to(s)}function _v(r,s){if(r==="input"||r==="change")return to(s)}function Ev(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var an=typeof Object.is=="function"?Object.is:Ev;function Wi(r,s){if(an(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)||!an(r[g],s[g]))return!1}return!0}function pd(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function md(r,s){var u=pd(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=pd(u)}}function gd(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?gd(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function yd(){for(var r=window,s=Bn();s instanceof r.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)r=s.contentWindow;else break;s=Bn(r.document)}return s}function da(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 bv(r){var s=yd(),u=r.focusedElem,h=r.selectionRange;if(s!==u&&u&&u.ownerDocument&&gd(u.ownerDocument.documentElement,u)){if(h!==null&&da(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,y=Math.min(h.start,g);h=h.end===void 0?y:Math.min(h.end,g),!r.extend&&y>h&&(g=h,h=y,y=g),g=md(u,y);var x=md(u,h);g&&x&&(r.rangeCount!==1||r.anchorNode!==g.node||r.anchorOffset!==g.offset||r.focusNode!==x.node||r.focusOffset!==x.offset)&&(s=s.createRange(),s.setStart(g.node,g.offset),r.removeAllRanges(),y>h?(r.addRange(s),r.extend(x.node,x.offset)):(s.setEnd(x.node,x.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 Iv=c&&"documentMode"in document&&11>=document.documentMode,Kr=null,ha=null,Hi=null,pa=!1;function wd(r,s,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;pa||Kr==null||Kr!==Bn(h)||(h=Kr,"selectionStart"in h&&da(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}),Hi&&Wi(Hi,h)||(Hi=h,h=so(ha,"onSelect"),0<h.length&&(s=new ia("onSelect","select",null,s,u),r.push({event:s,listeners:h}),s.target=Kr)))}function no(r,s){var u={};return u[r.toLowerCase()]=s.toLowerCase(),u["Webkit"+r]="webkit"+s,u["Moz"+r]="moz"+s,u}var Qr={animationend:no("Animation","AnimationEnd"),animationiteration:no("Animation","AnimationIteration"),animationstart:no("Animation","AnimationStart"),transitionend:no("Transition","TransitionEnd")},ma={},vd={};c&&(vd=document.createElement("div").style,"AnimationEvent"in window||(delete Qr.animationend.animation,delete Qr.animationiteration.animation,delete Qr.animationstart.animation),"TransitionEvent"in window||delete Qr.transitionend.transition);function ro(r){if(ma[r])return ma[r];if(!Qr[r])return r;var s=Qr[r],u;for(u in s)if(s.hasOwnProperty(u)&&u in vd)return ma[r]=s[u];return r}var kd=ro("animationend"),xd=ro("animationiteration"),Sd=ro("animationstart"),Cd=ro("transitionend"),_d=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 Qn(r,s){_d.set(r,s),a(s,[r])}for(var ga=0;ga<Ed.length;ga++){var ya=Ed[ga],Nv=ya.toLowerCase(),Tv=ya[0].toUpperCase()+ya.slice(1);Qn(Nv,"on"+Tv)}Qn(kd,"onAnimationEnd"),Qn(xd,"onAnimationIteration"),Qn(Sd,"onAnimationStart"),Qn("dblclick","onDoubleClick"),Qn("focusin","onFocus"),Qn("focusout","onBlur"),Qn(Cd,"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 qi="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(" "),Av=new Set("cancel close invalid load scroll toggle".split(" ").concat(qi));function bd(r,s,u){var h=r.type||"unknown-event";r.currentTarget=u,Nw(h,s,void 0,r),r.currentTarget=null}function Id(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 y=void 0;if(s)for(var x=h.length-1;0<=x;x--){var T=h[x],R=T.instance,z=T.currentTarget;if(T=T.listener,R!==y&&g.isPropagationStopped())break e;bd(g,T,z),y=R}else for(x=0;x<h.length;x++){if(T=h[x],R=T.instance,z=T.currentTarget,T=T.listener,R!==y&&g.isPropagationStopped())break e;bd(g,T,z),y=R}}}if(Bs)throw r=Kl,Bs=!1,Kl=null,r}function Ke(r,s){var u=s[Ea];u===void 0&&(u=s[Ea]=new Set);var h=r+"__bubble";u.has(h)||(Nd(s,r,2,!1),u.add(h))}function wa(r,s,u){var h=0;s&&(h|=4),Nd(u,r,h,s)}var io="_reactListening"+Math.random().toString(36).slice(2);function Ki(r){if(!r[io]){r[io]=!0,i.forEach(function(u){u!=="selectionchange"&&(Av.has(u)||wa(u,!1,r),wa(u,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[io]||(s[io]=!0,wa("selectionchange",!1,s))}}function Nd(r,s,u,h){switch(Yf(s)){case 1:var g=Gw;break;case 4:g=Ww;break;default:g=ta}u=g.bind(null,s,u,r),g=void 0,!ql||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 va(r,s,u,h,g){var y=h;if((s&1)===0&&(s&2)===0&&h!==null)e:for(;;){if(h===null)return;var x=h.tag;if(x===3||x===4){var T=h.stateNode.containerInfo;if(T===g||T.nodeType===8&&T.parentNode===g)break;if(x===4)for(x=h.return;x!==null;){var R=x.tag;if((R===3||R===4)&&(R=x.stateNode.containerInfo,R===g||R.nodeType===8&&R.parentNode===g))return;x=x.return}for(;T!==null;){if(x=vr(T),x===null)return;if(R=x.tag,R===5||R===6){h=y=x;continue e}T=T.parentNode}}h=h.return}Lf(function(){var z=y,K=Gl(u),Y=[];e:{var q=_d.get(r);if(q!==void 0){var le=ia,fe=r;switch(r){case"keypress":if(Js(u)===0)break e;case"keydown":case"keyup":le=ov;break;case"focusin":fe="focus",le=la;break;case"focusout":fe="blur",le=la;break;case"beforeblur":case"afterblur":le=la;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":le=ed;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=Kw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=uv;break;case kd:case xd:case Sd:le=Yw;break;case Cd:le=fv;break;case"scroll":le=Hw;break;case"wheel":le=hv;break;case"copy":case"cut":case"paste":le=Zw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=nd}var he=(s&4)!==0,rt=!he&&r==="scroll",D=he?q!==null?q+"Capture":null:q;he=[];for(var j=z,$;j!==null;){$=j;var te=$.stateNode;if($.tag===5&&te!==null&&($=te,D!==null&&(te=Ai(j,D),te!=null&&he.push(Qi(j,te,$)))),rt)break;j=j.return}0<he.length&&(q=new le(q,fe,null,u,K),Y.push({event:q,listeners:he}))}}if((s&7)===0){e:{if(q=r==="mouseover"||r==="pointerover",le=r==="mouseout"||r==="pointerout",q&&u!==Bt&&(fe=u.relatedTarget||u.fromElement)&&(vr(fe)||fe[In]))break e;if((le||q)&&(q=K.window===K?K:(q=K.ownerDocument)?q.defaultView||q.parentWindow:window,le?(fe=u.relatedTarget||u.toElement,le=z,fe=fe?vr(fe):null,fe!==null&&(rt=wr(fe),fe!==rt||fe.tag!==5&&fe.tag!==6)&&(fe=null)):(le=null,fe=z),le!==fe)){if(he=ed,te="onMouseLeave",D="onMouseEnter",j="mouse",(r==="pointerout"||r==="pointerover")&&(he=nd,te="onPointerLeave",D="onPointerEnter",j="pointer"),rt=le==null?q:Jr(le),$=fe==null?q:Jr(fe),q=new he(te,j+"leave",le,u,K),q.target=rt,q.relatedTarget=$,te=null,vr(K)===z&&(he=new he(D,j+"enter",fe,u,K),he.target=$,he.relatedTarget=rt,te=he),rt=te,le&&fe)t:{for(he=le,D=fe,j=0,$=he;$;$=Xr($))j++;for($=0,te=D;te;te=Xr(te))$++;for(;0<j-$;)he=Xr(he),j--;for(;0<$-j;)D=Xr(D),$--;for(;j--;){if(he===D||D!==null&&he===D.alternate)break t;he=Xr(he),D=Xr(D)}he=null}else he=null;le!==null&&Td(Y,q,le,he,!1),fe!==null&&rt!==null&&Td(Y,rt,fe,he,!0)}}e:{if(q=z?Jr(z):window,le=q.nodeName&&q.nodeName.toLowerCase(),le==="select"||le==="input"&&q.type==="file")var pe=kv;else if(ad(q))if(cd)pe=_v;else{pe=Sv;var ve=xv}else(le=q.nodeName)&&le.toLowerCase()==="input"&&(q.type==="checkbox"||q.type==="radio")&&(pe=Cv);if(pe&&(pe=pe(r,z))){ud(Y,pe,u,K);break e}ve&&ve(r,q,z),r==="focusout"&&(ve=q._wrapperState)&&ve.controlled&&q.type==="number"&&Ie(q,"number",q.value)}switch(ve=z?Jr(z):window,r){case"focusin":(ad(ve)||ve.contentEditable==="true")&&(Kr=ve,ha=z,Hi=null);break;case"focusout":Hi=ha=Kr=null;break;case"mousedown":pa=!0;break;case"contextmenu":case"mouseup":case"dragend":pa=!1,wd(Y,u,K);break;case"selectionchange":if(Iv)break;case"keydown":case"keyup":wd(Y,u,K)}var ke;if(ua)e:{switch(r){case"compositionstart":var Ee="onCompositionStart";break e;case"compositionend":Ee="onCompositionEnd";break e;case"compositionupdate":Ee="onCompositionUpdate";break e}Ee=void 0}else qr?od(r,u)&&(Ee="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(Ee="onCompositionStart");Ee&&(rd&&u.locale!=="ko"&&(qr||Ee!=="onCompositionStart"?Ee==="onCompositionEnd"&&qr&&(ke=Jf()):(Kn=K,ra="value"in Kn?Kn.value:Kn.textContent,qr=!0)),ve=so(z,Ee),0<ve.length&&(Ee=new td(Ee,r,null,u,K),Y.push({event:Ee,listeners:ve}),ke?Ee.data=ke:(ke=ld(u),ke!==null&&(Ee.data=ke)))),(ke=mv?gv(r,u):yv(r,u))&&(z=so(z,"onBeforeInput"),0<z.length&&(K=new td("onBeforeInput","beforeinput",null,u,K),Y.push({event:K,listeners:z}),K.data=ke))}Id(Y,s)})}function Qi(r,s,u){return{instance:r,listener:s,currentTarget:u}}function so(r,s){for(var u=s+"Capture",h=[];r!==null;){var g=r,y=g.stateNode;g.tag===5&&y!==null&&(g=y,y=Ai(r,u),y!=null&&h.unshift(Qi(r,y,g)),y=Ai(r,s),y!=null&&h.push(Qi(r,y,g))),r=r.return}return h}function Xr(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function Td(r,s,u,h,g){for(var y=s._reactName,x=[];u!==null&&u!==h;){var T=u,R=T.alternate,z=T.stateNode;if(R!==null&&R===h)break;T.tag===5&&z!==null&&(T=z,g?(R=Ai(u,y),R!=null&&x.unshift(Qi(u,R,T))):g||(R=Ai(u,y),R!=null&&x.push(Qi(u,R,T)))),u=u.return}x.length!==0&&r.push({event:s,listeners:x})}var Pv=/\r\n?/g,Rv=/\u0000|\uFFFD/g;function Ad(r){return(typeof r=="string"?r:""+r).replace(Pv,`
|
|
7
|
-
`).replace(Rv,"")}function oo(r,s,u){if(s=Ad(s),Ad(r)!==s&&u)throw Error(n(425))}function lo(){}var ka=null,xa=null;function Sa(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 Ca=typeof setTimeout=="function"?setTimeout:void 0,Lv=typeof clearTimeout=="function"?clearTimeout:void 0,Pd=typeof Promise=="function"?Promise:void 0,jv=typeof queueMicrotask=="function"?queueMicrotask:typeof Pd<"u"?function(r){return Pd.resolve(null).then(r).catch(Ov)}:Ca;function Ov(r){setTimeout(function(){throw r})}function _a(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),$i(s);return}h--}else u!=="$"&&u!=="$?"&&u!=="$!"||h++;u=g}while(u);$i(s)}function Xn(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 Rd(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 Yr=Math.random().toString(36).slice(2),vn="__reactFiber$"+Yr,Xi="__reactProps$"+Yr,In="__reactContainer$"+Yr,Ea="__reactEvents$"+Yr,Mv="__reactListeners$"+Yr,Dv="__reactHandles$"+Yr;function vr(r){var s=r[vn];if(s)return s;for(var u=r.parentNode;u;){if(s=u[In]||u[vn]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(r=Rd(r);r!==null;){if(u=r[vn])return u;r=Rd(r)}return s}r=u,u=r.parentNode}return null}function Yi(r){return r=r[vn]||r[In],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function Jr(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function ao(r){return r[Xi]||null}var ba=[],Zr=-1;function Yn(r){return{current:r}}function Qe(r){0>Zr||(r.current=ba[Zr],ba[Zr]=null,Zr--)}function We(r,s){Zr++,ba[Zr]=r.current,r.current=s}var Jn={},St=Yn(Jn),Lt=Yn(!1),kr=Jn;function ei(r,s){var u=r.type.contextTypes;if(!u)return Jn;var h=r.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===s)return h.__reactInternalMemoizedMaskedChildContext;var g={},y;for(y in u)g[y]=s[y];return h&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=s,r.__reactInternalMemoizedMaskedChildContext=g),g}function jt(r){return r=r.childContextTypes,r!=null}function uo(){Qe(Lt),Qe(St)}function Ld(r,s,u){if(St.current!==Jn)throw Error(n(168));We(St,s),We(Lt,u)}function jd(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 _({},u,h)}function co(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||Jn,kr=St.current,We(St,r),We(Lt,Lt.current),!0}function Od(r,s,u){var h=r.stateNode;if(!h)throw Error(n(169));u?(r=jd(r,s,kr),h.__reactInternalMemoizedMergedChildContext=r,Qe(Lt),Qe(St),We(St,r)):Qe(Lt),We(Lt,u)}var Nn=null,fo=!1,Ia=!1;function Md(r){Nn===null?Nn=[r]:Nn.push(r)}function Fv(r){fo=!0,Md(r)}function Zn(){if(!Ia&&Nn!==null){Ia=!0;var r=0,s=Ue;try{var u=Nn;for(Ue=1;r<u.length;r++){var h=u[r];do h=h(!0);while(h!==null)}Nn=null,fo=!1}catch(g){throw Nn!==null&&(Nn=Nn.slice(r+1)),Ff(Ql,Zn),g}finally{Ue=s,Ia=!1}}return null}var ti=[],ni=0,ho=null,po=0,Xt=[],Yt=0,xr=null,Tn=1,An="";function Sr(r,s){ti[ni++]=po,ti[ni++]=ho,ho=r,po=s}function Dd(r,s,u){Xt[Yt++]=Tn,Xt[Yt++]=An,Xt[Yt++]=xr,xr=r;var h=Tn;r=An;var g=32-ln(h)-1;h&=~(1<<g),u+=1;var y=32-ln(s)+g;if(30<y){var x=g-g%5;y=(h&(1<<x)-1).toString(32),h>>=x,g-=x,Tn=1<<32-ln(s)+g|u<<g|h,An=y+r}else Tn=1<<y|u<<g|h,An=r}function Na(r){r.return!==null&&(Sr(r,1),Dd(r,1,0))}function Ta(r){for(;r===ho;)ho=ti[--ni],ti[ni]=null,po=ti[--ni],ti[ni]=null;for(;r===xr;)xr=Xt[--Yt],Xt[Yt]=null,An=Xt[--Yt],Xt[Yt]=null,Tn=Xt[--Yt],Xt[Yt]=null}var Vt=null,Gt=null,Xe=!1,un=null;function Fd(r,s){var u=tn(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 $d(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,Vt=r,Gt=Xn(s.firstChild),!0):!1;case 6:return s=r.pendingProps===""||s.nodeType!==3?null:s,s!==null?(r.stateNode=s,Vt=r,Gt=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(u=xr!==null?{id:Tn,overflow:An}:null,r.memoizedState={dehydrated:s,treeContext:u,retryLane:1073741824},u=tn(18,null,null,0),u.stateNode=s,u.return=r,r.child=u,Vt=r,Gt=null,!0):!1;default:return!1}}function Aa(r){return(r.mode&1)!==0&&(r.flags&128)===0}function Pa(r){if(Xe){var s=Gt;if(s){var u=s;if(!$d(r,s)){if(Aa(r))throw Error(n(418));s=Xn(u.nextSibling);var h=Vt;s&&$d(r,s)?Fd(h,u):(r.flags=r.flags&-4097|2,Xe=!1,Vt=r)}}else{if(Aa(r))throw Error(n(418));r.flags=r.flags&-4097|2,Xe=!1,Vt=r}}}function zd(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;Vt=r}function mo(r){if(r!==Vt)return!1;if(!Xe)return zd(r),Xe=!0,!1;var s;if((s=r.tag!==3)&&!(s=r.tag!==5)&&(s=r.type,s=s!=="head"&&s!=="body"&&!Sa(r.type,r.memoizedProps)),s&&(s=Gt)){if(Aa(r))throw Bd(),Error(n(418));for(;s;)Fd(r,s),s=Xn(s.nextSibling)}if(zd(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){Gt=Xn(r.nextSibling);break e}s--}else u!=="$"&&u!=="$!"&&u!=="$?"||s++}r=r.nextSibling}Gt=null}}else Gt=Vt?Xn(r.stateNode.nextSibling):null;return!0}function Bd(){for(var r=Gt;r;)r=Xn(r.nextSibling)}function ri(){Gt=Vt=null,Xe=!1}function Ra(r){un===null?un=[r]:un.push(r)}var $v=B.ReactCurrentBatchConfig;function Ji(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,y=""+r;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===y?s.ref:(s=function(x){var T=g.refs;x===null?delete T[y]:T[y]=x},s._stringRef=y,s)}if(typeof r!="string")throw Error(n(284));if(!u._owner)throw Error(n(290,r))}return r}function go(r,s){throw r=Object.prototype.toString.call(s),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r))}function Ud(r){var s=r._init;return s(r._payload)}function Vd(r){function s(D,j){if(r){var $=D.deletions;$===null?(D.deletions=[j],D.flags|=16):$.push(j)}}function u(D,j){if(!r)return null;for(;j!==null;)s(D,j),j=j.sibling;return null}function h(D,j){for(D=new Map;j!==null;)j.key!==null?D.set(j.key,j):D.set(j.index,j),j=j.sibling;return D}function g(D,j){return D=lr(D,j),D.index=0,D.sibling=null,D}function y(D,j,$){return D.index=$,r?($=D.alternate,$!==null?($=$.index,$<j?(D.flags|=2,j):$):(D.flags|=2,j)):(D.flags|=1048576,j)}function x(D){return r&&D.alternate===null&&(D.flags|=2),D}function T(D,j,$,te){return j===null||j.tag!==6?(j=Cu($,D.mode,te),j.return=D,j):(j=g(j,$),j.return=D,j)}function R(D,j,$,te){var pe=$.type;return pe===ee?K(D,j,$.props.children,te,$.key):j!==null&&(j.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===ge&&Ud(pe)===j.type)?(te=g(j,$.props),te.ref=Ji(D,j,$),te.return=D,te):(te=zo($.type,$.key,$.props,null,D.mode,te),te.ref=Ji(D,j,$),te.return=D,te)}function z(D,j,$,te){return j===null||j.tag!==4||j.stateNode.containerInfo!==$.containerInfo||j.stateNode.implementation!==$.implementation?(j=_u($,D.mode,te),j.return=D,j):(j=g(j,$.children||[]),j.return=D,j)}function K(D,j,$,te,pe){return j===null||j.tag!==7?(j=Ar($,D.mode,te,pe),j.return=D,j):(j=g(j,$),j.return=D,j)}function Y(D,j,$){if(typeof j=="string"&&j!==""||typeof j=="number")return j=Cu(""+j,D.mode,$),j.return=D,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case P:return $=zo(j.type,j.key,j.props,null,D.mode,$),$.ref=Ji(D,null,j),$.return=D,$;case M:return j=_u(j,D.mode,$),j.return=D,j;case ge:var te=j._init;return Y(D,te(j._payload),$)}if(qe(j)||O(j))return j=Ar(j,D.mode,$,null),j.return=D,j;go(D,j)}return null}function q(D,j,$,te){var pe=j!==null?j.key:null;if(typeof $=="string"&&$!==""||typeof $=="number")return pe!==null?null:T(D,j,""+$,te);if(typeof $=="object"&&$!==null){switch($.$$typeof){case P:return $.key===pe?R(D,j,$,te):null;case M:return $.key===pe?z(D,j,$,te):null;case ge:return pe=$._init,q(D,j,pe($._payload),te)}if(qe($)||O($))return pe!==null?null:K(D,j,$,te,null);go(D,$)}return null}function le(D,j,$,te,pe){if(typeof te=="string"&&te!==""||typeof te=="number")return D=D.get($)||null,T(j,D,""+te,pe);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case P:return D=D.get(te.key===null?$:te.key)||null,R(j,D,te,pe);case M:return D=D.get(te.key===null?$:te.key)||null,z(j,D,te,pe);case ge:var ve=te._init;return le(D,j,$,ve(te._payload),pe)}if(qe(te)||O(te))return D=D.get($)||null,K(j,D,te,pe,null);go(j,te)}return null}function fe(D,j,$,te){for(var pe=null,ve=null,ke=j,Ee=j=0,pt=null;ke!==null&&Ee<$.length;Ee++){ke.index>Ee?(pt=ke,ke=null):pt=ke.sibling;var Be=q(D,ke,$[Ee],te);if(Be===null){ke===null&&(ke=pt);break}r&&ke&&Be.alternate===null&&s(D,ke),j=y(Be,j,Ee),ve===null?pe=Be:ve.sibling=Be,ve=Be,ke=pt}if(Ee===$.length)return u(D,ke),Xe&&Sr(D,Ee),pe;if(ke===null){for(;Ee<$.length;Ee++)ke=Y(D,$[Ee],te),ke!==null&&(j=y(ke,j,Ee),ve===null?pe=ke:ve.sibling=ke,ve=ke);return Xe&&Sr(D,Ee),pe}for(ke=h(D,ke);Ee<$.length;Ee++)pt=le(ke,D,Ee,$[Ee],te),pt!==null&&(r&&pt.alternate!==null&&ke.delete(pt.key===null?Ee:pt.key),j=y(pt,j,Ee),ve===null?pe=pt:ve.sibling=pt,ve=pt);return r&&ke.forEach(function(ar){return s(D,ar)}),Xe&&Sr(D,Ee),pe}function he(D,j,$,te){var pe=O($);if(typeof pe!="function")throw Error(n(150));if($=pe.call($),$==null)throw Error(n(151));for(var ve=pe=null,ke=j,Ee=j=0,pt=null,Be=$.next();ke!==null&&!Be.done;Ee++,Be=$.next()){ke.index>Ee?(pt=ke,ke=null):pt=ke.sibling;var ar=q(D,ke,Be.value,te);if(ar===null){ke===null&&(ke=pt);break}r&&ke&&ar.alternate===null&&s(D,ke),j=y(ar,j,Ee),ve===null?pe=ar:ve.sibling=ar,ve=ar,ke=pt}if(Be.done)return u(D,ke),Xe&&Sr(D,Ee),pe;if(ke===null){for(;!Be.done;Ee++,Be=$.next())Be=Y(D,Be.value,te),Be!==null&&(j=y(Be,j,Ee),ve===null?pe=Be:ve.sibling=Be,ve=Be);return Xe&&Sr(D,Ee),pe}for(ke=h(D,ke);!Be.done;Ee++,Be=$.next())Be=le(ke,D,Ee,Be.value,te),Be!==null&&(r&&Be.alternate!==null&&ke.delete(Be.key===null?Ee:Be.key),j=y(Be,j,Ee),ve===null?pe=Be:ve.sibling=Be,ve=Be);return r&&ke.forEach(function(wk){return s(D,wk)}),Xe&&Sr(D,Ee),pe}function rt(D,j,$,te){if(typeof $=="object"&&$!==null&&$.type===ee&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case P:e:{for(var pe=$.key,ve=j;ve!==null;){if(ve.key===pe){if(pe=$.type,pe===ee){if(ve.tag===7){u(D,ve.sibling),j=g(ve,$.props.children),j.return=D,D=j;break e}}else if(ve.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===ge&&Ud(pe)===ve.type){u(D,ve.sibling),j=g(ve,$.props),j.ref=Ji(D,ve,$),j.return=D,D=j;break e}u(D,ve);break}else s(D,ve);ve=ve.sibling}$.type===ee?(j=Ar($.props.children,D.mode,te,$.key),j.return=D,D=j):(te=zo($.type,$.key,$.props,null,D.mode,te),te.ref=Ji(D,j,$),te.return=D,D=te)}return x(D);case M:e:{for(ve=$.key;j!==null;){if(j.key===ve)if(j.tag===4&&j.stateNode.containerInfo===$.containerInfo&&j.stateNode.implementation===$.implementation){u(D,j.sibling),j=g(j,$.children||[]),j.return=D,D=j;break e}else{u(D,j);break}else s(D,j);j=j.sibling}j=_u($,D.mode,te),j.return=D,D=j}return x(D);case ge:return ve=$._init,rt(D,j,ve($._payload),te)}if(qe($))return fe(D,j,$,te);if(O($))return he(D,j,$,te);go(D,$)}return typeof $=="string"&&$!==""||typeof $=="number"?($=""+$,j!==null&&j.tag===6?(u(D,j.sibling),j=g(j,$),j.return=D,D=j):(u(D,j),j=Cu($,D.mode,te),j.return=D,D=j),x(D)):u(D,j)}return rt}var ii=Vd(!0),Gd=Vd(!1),yo=Yn(null),wo=null,si=null,La=null;function ja(){La=si=wo=null}function Oa(r){var s=yo.current;Qe(yo),r._currentValue=s}function Ma(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 oi(r,s){wo=r,La=si=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&s)!==0&&(Ot=!0),r.firstContext=null)}function Jt(r){var s=r._currentValue;if(La!==r)if(r={context:r,memoizedValue:s,next:null},si===null){if(wo===null)throw Error(n(308));si=r,wo.dependencies={lanes:0,firstContext:r}}else si=si.next=r;return s}var Cr=null;function Da(r){Cr===null?Cr=[r]:Cr.push(r)}function Wd(r,s,u,h){var g=s.interleaved;return g===null?(u.next=u,Da(s)):(u.next=g.next,g.next=u),s.interleaved=u,Pn(r,h)}function Pn(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 er=!1;function Fa(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Hd(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 Rn(r,s){return{eventTime:r,lane:s,tag:0,payload:null,callback:null,next:null}}function tr(r,s,u){var h=r.updateQueue;if(h===null)return null;if(h=h.shared,($e&2)!==0){var g=h.pending;return g===null?s.next=s:(s.next=g.next,g.next=s),h.pending=s,Pn(r,u)}return g=h.interleaved,g===null?(s.next=s,Da(h)):(s.next=g.next,g.next=s),h.interleaved=s,Pn(r,u)}function vo(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,Jl(r,u)}}function qd(r,s){var u=r.updateQueue,h=r.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var g=null,y=null;if(u=u.firstBaseUpdate,u!==null){do{var x={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};y===null?g=y=x:y=y.next=x,u=u.next}while(u!==null);y===null?g=y=s:y=y.next=s}else g=y=s;u={baseState:h.baseState,firstBaseUpdate:g,lastBaseUpdate:y,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 ko(r,s,u,h){var g=r.updateQueue;er=!1;var y=g.firstBaseUpdate,x=g.lastBaseUpdate,T=g.shared.pending;if(T!==null){g.shared.pending=null;var R=T,z=R.next;R.next=null,x===null?y=z:x.next=z,x=R;var K=r.alternate;K!==null&&(K=K.updateQueue,T=K.lastBaseUpdate,T!==x&&(T===null?K.firstBaseUpdate=z:T.next=z,K.lastBaseUpdate=R))}if(y!==null){var Y=g.baseState;x=0,K=z=R=null,T=y;do{var q=T.lane,le=T.eventTime;if((h&q)===q){K!==null&&(K=K.next={eventTime:le,lane:0,tag:T.tag,payload:T.payload,callback:T.callback,next:null});e:{var fe=r,he=T;switch(q=s,le=u,he.tag){case 1:if(fe=he.payload,typeof fe=="function"){Y=fe.call(le,Y,q);break e}Y=fe;break e;case 3:fe.flags=fe.flags&-65537|128;case 0:if(fe=he.payload,q=typeof fe=="function"?fe.call(le,Y,q):fe,q==null)break e;Y=_({},Y,q);break e;case 2:er=!0}}T.callback!==null&&T.lane!==0&&(r.flags|=64,q=g.effects,q===null?g.effects=[T]:q.push(T))}else le={eventTime:le,lane:q,tag:T.tag,payload:T.payload,callback:T.callback,next:null},K===null?(z=K=le,R=Y):K=K.next=le,x|=q;if(T=T.next,T===null){if(T=g.shared.pending,T===null)break;q=T,T=q.next,q.next=null,g.lastBaseUpdate=q,g.shared.pending=null}}while(!0);if(K===null&&(R=Y),g.baseState=R,g.firstBaseUpdate=z,g.lastBaseUpdate=K,s=g.shared.interleaved,s!==null){g=s;do x|=g.lane,g=g.next;while(g!==s)}else y===null&&(g.shared.lanes=0);br|=x,r.lanes=x,r.memoizedState=Y}}function Kd(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 Zi={},kn=Yn(Zi),es=Yn(Zi),ts=Yn(Zi);function _r(r){if(r===Zi)throw Error(n(174));return r}function $a(r,s){switch(We(ts,s),We(es,r),We(kn,Zi),r=s.nodeType,r){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:se(null,"");break;default:r=r===8?s.parentNode:s,s=r.namespaceURI||null,r=r.tagName,s=se(s,r)}Qe(kn),We(kn,s)}function li(){Qe(kn),Qe(es),Qe(ts)}function Qd(r){_r(ts.current);var s=_r(kn.current),u=se(s,r.type);s!==u&&(We(es,r),We(kn,u))}function za(r){es.current===r&&(Qe(kn),Qe(es))}var Ye=Yn(0);function xo(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 Ba=[];function Ua(){for(var r=0;r<Ba.length;r++)Ba[r]._workInProgressVersionPrimary=null;Ba.length=0}var So=B.ReactCurrentDispatcher,Va=B.ReactCurrentBatchConfig,Er=0,Je=null,at=null,dt=null,Co=!1,ns=!1,rs=0,zv=0;function Ct(){throw Error(n(321))}function Ga(r,s){if(s===null)return!1;for(var u=0;u<s.length&&u<r.length;u++)if(!an(r[u],s[u]))return!1;return!0}function Wa(r,s,u,h,g,y){if(Er=y,Je=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,So.current=r===null||r.memoizedState===null?Gv:Wv,r=u(h,g),ns){y=0;do{if(ns=!1,rs=0,25<=y)throw Error(n(301));y+=1,dt=at=null,s.updateQueue=null,So.current=Hv,r=u(h,g)}while(ns)}if(So.current=bo,s=at!==null&&at.next!==null,Er=0,dt=at=Je=null,Co=!1,s)throw Error(n(300));return r}function Ha(){var r=rs!==0;return rs=0,r}function xn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dt===null?Je.memoizedState=dt=r:dt=dt.next=r,dt}function Zt(){if(at===null){var r=Je.alternate;r=r!==null?r.memoizedState:null}else r=at.next;var s=dt===null?Je.memoizedState:dt.next;if(s!==null)dt=s,at=r;else{if(r===null)throw Error(n(310));at=r,r={memoizedState:at.memoizedState,baseState:at.baseState,baseQueue:at.baseQueue,queue:at.queue,next:null},dt===null?Je.memoizedState=dt=r:dt=dt.next=r}return dt}function is(r,s){return typeof s=="function"?s(r):s}function qa(r){var s=Zt(),u=s.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var h=at,g=h.baseQueue,y=u.pending;if(y!==null){if(g!==null){var x=g.next;g.next=y.next,y.next=x}h.baseQueue=g=y,u.pending=null}if(g!==null){y=g.next,h=h.baseState;var T=x=null,R=null,z=y;do{var K=z.lane;if((Er&K)===K)R!==null&&(R=R.next={lane:0,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),h=z.hasEagerState?z.eagerState:r(h,z.action);else{var Y={lane:K,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null};R===null?(T=R=Y,x=h):R=R.next=Y,Je.lanes|=K,br|=K}z=z.next}while(z!==null&&z!==y);R===null?x=h:R.next=T,an(h,s.memoizedState)||(Ot=!0),s.memoizedState=h,s.baseState=x,s.baseQueue=R,u.lastRenderedState=h}if(r=u.interleaved,r!==null){g=r;do y=g.lane,Je.lanes|=y,br|=y,g=g.next;while(g!==r)}else g===null&&(u.lanes=0);return[s.memoizedState,u.dispatch]}function Ka(r){var s=Zt(),u=s.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var h=u.dispatch,g=u.pending,y=s.memoizedState;if(g!==null){u.pending=null;var x=g=g.next;do y=r(y,x.action),x=x.next;while(x!==g);an(y,s.memoizedState)||(Ot=!0),s.memoizedState=y,s.baseQueue===null&&(s.baseState=y),u.lastRenderedState=y}return[y,h]}function Xd(){}function Yd(r,s){var u=Je,h=Zt(),g=s(),y=!an(h.memoizedState,g);if(y&&(h.memoizedState=g,Ot=!0),h=h.queue,Qa(eh.bind(null,u,h,r),[r]),h.getSnapshot!==s||y||dt!==null&&dt.memoizedState.tag&1){if(u.flags|=2048,ss(9,Zd.bind(null,u,h,g,s),void 0,null),ht===null)throw Error(n(349));(Er&30)!==0||Jd(u,s,g)}return g}function Jd(r,s,u){r.flags|=16384,r={getSnapshot:s,value:u},s=Je.updateQueue,s===null?(s={lastEffect:null,stores:null},Je.updateQueue=s,s.stores=[r]):(u=s.stores,u===null?s.stores=[r]:u.push(r))}function Zd(r,s,u,h){s.value=u,s.getSnapshot=h,th(s)&&nh(r)}function eh(r,s,u){return u(function(){th(s)&&nh(r)})}function th(r){var s=r.getSnapshot;r=r.value;try{var u=s();return!an(r,u)}catch{return!0}}function nh(r){var s=Pn(r,1);s!==null&&hn(s,r,1,-1)}function rh(r){var s=xn();return typeof r=="function"&&(r=r()),s.memoizedState=s.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:r},s.queue=r,r=r.dispatch=Vv.bind(null,Je,r),[s.memoizedState,r]}function ss(r,s,u,h){return r={tag:r,create:s,destroy:u,deps:h,next:null},s=Je.updateQueue,s===null?(s={lastEffect:null,stores:null},Je.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 ih(){return Zt().memoizedState}function _o(r,s,u,h){var g=xn();Je.flags|=r,g.memoizedState=ss(1|s,u,void 0,h===void 0?null:h)}function Eo(r,s,u,h){var g=Zt();h=h===void 0?null:h;var y=void 0;if(at!==null){var x=at.memoizedState;if(y=x.destroy,h!==null&&Ga(h,x.deps)){g.memoizedState=ss(s,u,y,h);return}}Je.flags|=r,g.memoizedState=ss(1|s,u,y,h)}function sh(r,s){return _o(8390656,8,r,s)}function Qa(r,s){return Eo(2048,8,r,s)}function oh(r,s){return Eo(4,2,r,s)}function lh(r,s){return Eo(4,4,r,s)}function ah(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 uh(r,s,u){return u=u!=null?u.concat([r]):null,Eo(4,4,ah.bind(null,s,r),u)}function Xa(){}function ch(r,s){var u=Zt();s=s===void 0?null:s;var h=u.memoizedState;return h!==null&&s!==null&&Ga(s,h[1])?h[0]:(u.memoizedState=[r,s],r)}function fh(r,s){var u=Zt();s=s===void 0?null:s;var h=u.memoizedState;return h!==null&&s!==null&&Ga(s,h[1])?h[0]:(r=r(),u.memoizedState=[r,s],r)}function dh(r,s,u){return(Er&21)===0?(r.baseState&&(r.baseState=!1,Ot=!0),r.memoizedState=u):(an(u,s)||(u=Uf(),Je.lanes|=u,br|=u,r.baseState=!0),s)}function Bv(r,s){var u=Ue;Ue=u!==0&&4>u?u:4,r(!0);var h=Va.transition;Va.transition={};try{r(!1),s()}finally{Ue=u,Va.transition=h}}function hh(){return Zt().memoizedState}function Uv(r,s,u){var h=sr(r);if(u={lane:h,action:u,hasEagerState:!1,eagerState:null,next:null},ph(r))mh(s,u);else if(u=Wd(r,s,u,h),u!==null){var g=Pt();hn(u,r,h,g),gh(u,s,h)}}function Vv(r,s,u){var h=sr(r),g={lane:h,action:u,hasEagerState:!1,eagerState:null,next:null};if(ph(r))mh(s,g);else{var y=r.alternate;if(r.lanes===0&&(y===null||y.lanes===0)&&(y=s.lastRenderedReducer,y!==null))try{var x=s.lastRenderedState,T=y(x,u);if(g.hasEagerState=!0,g.eagerState=T,an(T,x)){var R=s.interleaved;R===null?(g.next=g,Da(s)):(g.next=R.next,R.next=g),s.interleaved=g;return}}catch{}u=Wd(r,s,g,h),u!==null&&(g=Pt(),hn(u,r,h,g),gh(u,s,h))}}function ph(r){var s=r.alternate;return r===Je||s!==null&&s===Je}function mh(r,s){ns=Co=!0;var u=r.pending;u===null?s.next=s:(s.next=u.next,u.next=s),r.pending=s}function gh(r,s,u){if((u&4194240)!==0){var h=s.lanes;h&=r.pendingLanes,u|=h,s.lanes=u,Jl(r,u)}}var bo={readContext:Jt,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},Gv={readContext:Jt,useCallback:function(r,s){return xn().memoizedState=[r,s===void 0?null:s],r},useContext:Jt,useEffect:sh,useImperativeHandle:function(r,s,u){return u=u!=null?u.concat([r]):null,_o(4194308,4,ah.bind(null,s,r),u)},useLayoutEffect:function(r,s){return _o(4194308,4,r,s)},useInsertionEffect:function(r,s){return _o(4,2,r,s)},useMemo:function(r,s){var u=xn();return s=s===void 0?null:s,r=r(),u.memoizedState=[r,s],r},useReducer:function(r,s,u){var h=xn();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=Uv.bind(null,Je,r),[h.memoizedState,r]},useRef:function(r){var s=xn();return r={current:r},s.memoizedState=r},useState:rh,useDebugValue:Xa,useDeferredValue:function(r){return xn().memoizedState=r},useTransition:function(){var r=rh(!1),s=r[0];return r=Bv.bind(null,r[1]),xn().memoizedState=r,[s,r]},useMutableSource:function(){},useSyncExternalStore:function(r,s,u){var h=Je,g=xn();if(Xe){if(u===void 0)throw Error(n(407));u=u()}else{if(u=s(),ht===null)throw Error(n(349));(Er&30)!==0||Jd(h,s,u)}g.memoizedState=u;var y={value:u,getSnapshot:s};return g.queue=y,sh(eh.bind(null,h,y,r),[r]),h.flags|=2048,ss(9,Zd.bind(null,h,y,u,s),void 0,null),u},useId:function(){var r=xn(),s=ht.identifierPrefix;if(Xe){var u=An,h=Tn;u=(h&~(1<<32-ln(h)-1)).toString(32)+u,s=":"+s+"R"+u,u=rs++,0<u&&(s+="H"+u.toString(32)),s+=":"}else u=zv++,s=":"+s+"r"+u.toString(32)+":";return r.memoizedState=s},unstable_isNewReconciler:!1},Wv={readContext:Jt,useCallback:ch,useContext:Jt,useEffect:Qa,useImperativeHandle:uh,useInsertionEffect:oh,useLayoutEffect:lh,useMemo:fh,useReducer:qa,useRef:ih,useState:function(){return qa(is)},useDebugValue:Xa,useDeferredValue:function(r){var s=Zt();return dh(s,at.memoizedState,r)},useTransition:function(){var r=qa(is)[0],s=Zt().memoizedState;return[r,s]},useMutableSource:Xd,useSyncExternalStore:Yd,useId:hh,unstable_isNewReconciler:!1},Hv={readContext:Jt,useCallback:ch,useContext:Jt,useEffect:Qa,useImperativeHandle:uh,useInsertionEffect:oh,useLayoutEffect:lh,useMemo:fh,useReducer:Ka,useRef:ih,useState:function(){return Ka(is)},useDebugValue:Xa,useDeferredValue:function(r){var s=Zt();return at===null?s.memoizedState=r:dh(s,at.memoizedState,r)},useTransition:function(){var r=Ka(is)[0],s=Zt().memoizedState;return[r,s]},useMutableSource:Xd,useSyncExternalStore:Yd,useId:hh,unstable_isNewReconciler:!1};function cn(r,s){if(r&&r.defaultProps){s=_({},s),r=r.defaultProps;for(var u in r)s[u]===void 0&&(s[u]=r[u]);return s}return s}function Ya(r,s,u,h){s=r.memoizedState,u=u(h,s),u=u==null?s:_({},s,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var Io={isMounted:function(r){return(r=r._reactInternals)?wr(r)===r:!1},enqueueSetState:function(r,s,u){r=r._reactInternals;var h=Pt(),g=sr(r),y=Rn(h,g);y.payload=s,u!=null&&(y.callback=u),s=tr(r,y,g),s!==null&&(hn(s,r,g,h),vo(s,r,g))},enqueueReplaceState:function(r,s,u){r=r._reactInternals;var h=Pt(),g=sr(r),y=Rn(h,g);y.tag=1,y.payload=s,u!=null&&(y.callback=u),s=tr(r,y,g),s!==null&&(hn(s,r,g,h),vo(s,r,g))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var u=Pt(),h=sr(r),g=Rn(u,h);g.tag=2,s!=null&&(g.callback=s),s=tr(r,g,h),s!==null&&(hn(s,r,h,u),vo(s,r,h))}};function yh(r,s,u,h,g,y,x){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(h,y,x):s.prototype&&s.prototype.isPureReactComponent?!Wi(u,h)||!Wi(g,y):!0}function wh(r,s,u){var h=!1,g=Jn,y=s.contextType;return typeof y=="object"&&y!==null?y=Jt(y):(g=jt(s)?kr:St.current,h=s.contextTypes,y=(h=h!=null)?ei(r,g):Jn),s=new s(u,y),r.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Io,r.stateNode=s,s._reactInternals=r,h&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=g,r.__reactInternalMemoizedMaskedChildContext=y),s}function vh(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&&Io.enqueueReplaceState(s,s.state,null)}function Ja(r,s,u,h){var g=r.stateNode;g.props=u,g.state=r.memoizedState,g.refs={},Fa(r);var y=s.contextType;typeof y=="object"&&y!==null?g.context=Jt(y):(y=jt(s)?kr:St.current,g.context=ei(r,y)),g.state=r.memoizedState,y=s.getDerivedStateFromProps,typeof y=="function"&&(Ya(r,s,y,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&&Io.enqueueReplaceState(g,g.state,null),ko(r,u,g,h),g.state=r.memoizedState),typeof g.componentDidMount=="function"&&(r.flags|=4194308)}function ai(r,s){try{var u="",h=s;do u+=Se(h),h=h.return;while(h);var g=u}catch(y){g=`
|
|
8
|
-
Error generating stack: `+y.message+`
|
|
9
|
-
`+y.stack}return{value:r,source:s,stack:g,digest:null}}function Za(r,s,u){return{value:r,source:null,stack:u??null,digest:s??null}}function eu(r,s){try{console.error(s.value)}catch(u){setTimeout(function(){throw u})}}var qv=typeof WeakMap=="function"?WeakMap:Map;function kh(r,s,u){u=Rn(-1,u),u.tag=3,u.payload={element:null};var h=s.value;return u.callback=function(){jo||(jo=!0,mu=h),eu(r,s)},u}function xh(r,s,u){u=Rn(-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(){eu(r,s)}}var y=r.stateNode;return y!==null&&typeof y.componentDidCatch=="function"&&(u.callback=function(){eu(r,s),typeof h!="function"&&(rr===null?rr=new Set([this]):rr.add(this));var x=s.stack;this.componentDidCatch(s.value,{componentStack:x!==null?x:""})}),u}function Sh(r,s,u){var h=r.pingCache;if(h===null){h=r.pingCache=new qv;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=lk.bind(null,r,s,u),s.then(r,r))}function Ch(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 _h(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=Rn(-1,1),s.tag=2,tr(u,s,1))),u.lanes|=1),r):(r.flags|=65536,r.lanes=g,r)}var Kv=B.ReactCurrentOwner,Ot=!1;function At(r,s,u,h){s.child=r===null?Gd(s,null,u,h):ii(s,r.child,u,h)}function Eh(r,s,u,h,g){u=u.render;var y=s.ref;return oi(s,g),h=Wa(r,s,u,h,y,g),u=Ha(),r!==null&&!Ot?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~g,Ln(r,s,g)):(Xe&&u&&Na(s),s.flags|=1,At(r,s,h,g),s.child)}function bh(r,s,u,h,g){if(r===null){var y=u.type;return typeof y=="function"&&!Su(y)&&y.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(s.tag=15,s.type=y,Ih(r,s,y,h,g)):(r=zo(u.type,null,h,s,s.mode,g),r.ref=s.ref,r.return=s,s.child=r)}if(y=r.child,(r.lanes&g)===0){var x=y.memoizedProps;if(u=u.compare,u=u!==null?u:Wi,u(x,h)&&r.ref===s.ref)return Ln(r,s,g)}return s.flags|=1,r=lr(y,h),r.ref=s.ref,r.return=s,s.child=r}function Ih(r,s,u,h,g){if(r!==null){var y=r.memoizedProps;if(Wi(y,h)&&r.ref===s.ref)if(Ot=!1,s.pendingProps=h=y,(r.lanes&g)!==0)(r.flags&131072)!==0&&(Ot=!0);else return s.lanes=r.lanes,Ln(r,s,g)}return tu(r,s,u,h,g)}function Nh(r,s,u){var h=s.pendingProps,g=h.children,y=r!==null?r.memoizedState:null;if(h.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},We(ci,Wt),Wt|=u;else{if((u&1073741824)===0)return r=y!==null?y.baseLanes|u:u,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:r,cachePool:null,transitions:null},s.updateQueue=null,We(ci,Wt),Wt|=r,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},h=y!==null?y.baseLanes:u,We(ci,Wt),Wt|=h}else y!==null?(h=y.baseLanes|u,s.memoizedState=null):h=u,We(ci,Wt),Wt|=h;return At(r,s,g,u),s.child}function Th(r,s){var u=s.ref;(r===null&&u!==null||r!==null&&r.ref!==u)&&(s.flags|=512,s.flags|=2097152)}function tu(r,s,u,h,g){var y=jt(u)?kr:St.current;return y=ei(s,y),oi(s,g),u=Wa(r,s,u,h,y,g),h=Ha(),r!==null&&!Ot?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~g,Ln(r,s,g)):(Xe&&h&&Na(s),s.flags|=1,At(r,s,u,g),s.child)}function Ah(r,s,u,h,g){if(jt(u)){var y=!0;co(s)}else y=!1;if(oi(s,g),s.stateNode===null)To(r,s),wh(s,u,h),Ja(s,u,h,g),h=!0;else if(r===null){var x=s.stateNode,T=s.memoizedProps;x.props=T;var R=x.context,z=u.contextType;typeof z=="object"&&z!==null?z=Jt(z):(z=jt(u)?kr:St.current,z=ei(s,z));var K=u.getDerivedStateFromProps,Y=typeof K=="function"||typeof x.getSnapshotBeforeUpdate=="function";Y||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(T!==h||R!==z)&&vh(s,x,h,z),er=!1;var q=s.memoizedState;x.state=q,ko(s,h,x,g),R=s.memoizedState,T!==h||q!==R||Lt.current||er?(typeof K=="function"&&(Ya(s,u,K,h),R=s.memoizedState),(T=er||yh(s,u,T,h,q,R,z))?(Y||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(s.flags|=4194308)):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=h,s.memoizedState=R),x.props=h,x.state=R,x.context=z,h=T):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),h=!1)}else{x=s.stateNode,Hd(r,s),T=s.memoizedProps,z=s.type===s.elementType?T:cn(s.type,T),x.props=z,Y=s.pendingProps,q=x.context,R=u.contextType,typeof R=="object"&&R!==null?R=Jt(R):(R=jt(u)?kr:St.current,R=ei(s,R));var le=u.getDerivedStateFromProps;(K=typeof le=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(T!==Y||q!==R)&&vh(s,x,h,R),er=!1,q=s.memoizedState,x.state=q,ko(s,h,x,g);var fe=s.memoizedState;T!==Y||q!==fe||Lt.current||er?(typeof le=="function"&&(Ya(s,u,le,h),fe=s.memoizedState),(z=er||yh(s,u,z,h,q,fe,R)||!1)?(K||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(h,fe,R),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(h,fe,R)),typeof x.componentDidUpdate=="function"&&(s.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof x.componentDidUpdate!="function"||T===r.memoizedProps&&q===r.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||T===r.memoizedProps&&q===r.memoizedState||(s.flags|=1024),s.memoizedProps=h,s.memoizedState=fe),x.props=h,x.state=fe,x.context=R,h=z):(typeof x.componentDidUpdate!="function"||T===r.memoizedProps&&q===r.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||T===r.memoizedProps&&q===r.memoizedState||(s.flags|=1024),h=!1)}return nu(r,s,u,h,y,g)}function nu(r,s,u,h,g,y){Th(r,s);var x=(s.flags&128)!==0;if(!h&&!x)return g&&Od(s,u,!1),Ln(r,s,y);h=s.stateNode,Kv.current=s;var T=x&&typeof u.getDerivedStateFromError!="function"?null:h.render();return s.flags|=1,r!==null&&x?(s.child=ii(s,r.child,null,y),s.child=ii(s,null,T,y)):At(r,s,T,y),s.memoizedState=h.state,g&&Od(s,u,!0),s.child}function Ph(r){var s=r.stateNode;s.pendingContext?Ld(r,s.pendingContext,s.pendingContext!==s.context):s.context&&Ld(r,s.context,!1),$a(r,s.containerInfo)}function Rh(r,s,u,h,g){return ri(),Ra(g),s.flags|=256,At(r,s,u,h),s.child}var ru={dehydrated:null,treeContext:null,retryLane:0};function iu(r){return{baseLanes:r,cachePool:null,transitions:null}}function Lh(r,s,u){var h=s.pendingProps,g=Ye.current,y=!1,x=(s.flags&128)!==0,T;if((T=x)||(T=r!==null&&r.memoizedState===null?!1:(g&2)!==0),T?(y=!0,s.flags&=-129):(r===null||r.memoizedState!==null)&&(g|=1),We(Ye,g&1),r===null)return Pa(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):(x=h.children,r=h.fallback,y?(h=s.mode,y=s.child,x={mode:"hidden",children:x},(h&1)===0&&y!==null?(y.childLanes=0,y.pendingProps=x):y=Bo(x,h,0,null),r=Ar(r,h,u,null),y.return=s,r.return=s,y.sibling=r,s.child=y,s.child.memoizedState=iu(u),s.memoizedState=ru,r):su(s,x));if(g=r.memoizedState,g!==null&&(T=g.dehydrated,T!==null))return Qv(r,s,x,h,T,g,u);if(y){y=h.fallback,x=s.mode,g=r.child,T=g.sibling;var R={mode:"hidden",children:h.children};return(x&1)===0&&s.child!==g?(h=s.child,h.childLanes=0,h.pendingProps=R,s.deletions=null):(h=lr(g,R),h.subtreeFlags=g.subtreeFlags&14680064),T!==null?y=lr(T,y):(y=Ar(y,x,u,null),y.flags|=2),y.return=s,h.return=s,h.sibling=y,s.child=h,h=y,y=s.child,x=r.child.memoizedState,x=x===null?iu(u):{baseLanes:x.baseLanes|u,cachePool:null,transitions:x.transitions},y.memoizedState=x,y.childLanes=r.childLanes&~u,s.memoizedState=ru,h}return y=r.child,r=y.sibling,h=lr(y,{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 su(r,s){return s=Bo({mode:"visible",children:s},r.mode,0,null),s.return=r,r.child=s}function No(r,s,u,h){return h!==null&&Ra(h),ii(s,r.child,null,u),r=su(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function Qv(r,s,u,h,g,y,x){if(u)return s.flags&256?(s.flags&=-257,h=Za(Error(n(422))),No(r,s,x,h)):s.memoizedState!==null?(s.child=r.child,s.flags|=128,null):(y=h.fallback,g=s.mode,h=Bo({mode:"visible",children:h.children},g,0,null),y=Ar(y,g,x,null),y.flags|=2,h.return=s,y.return=s,h.sibling=y,s.child=h,(s.mode&1)!==0&&ii(s,r.child,null,x),s.child.memoizedState=iu(x),s.memoizedState=ru,y);if((s.mode&1)===0)return No(r,s,x,null);if(g.data==="$!"){if(h=g.nextSibling&&g.nextSibling.dataset,h)var T=h.dgst;return h=T,y=Error(n(419)),h=Za(y,h,void 0),No(r,s,x,h)}if(T=(x&r.childLanes)!==0,Ot||T){if(h=ht,h!==null){switch(x&-x){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|x))!==0?0:g,g!==0&&g!==y.retryLane&&(y.retryLane=g,Pn(r,g),hn(h,r,g,-1))}return xu(),h=Za(Error(n(421))),No(r,s,x,h)}return g.data==="$?"?(s.flags|=128,s.child=r.child,s=ak.bind(null,r),g._reactRetry=s,null):(r=y.treeContext,Gt=Xn(g.nextSibling),Vt=s,Xe=!0,un=null,r!==null&&(Xt[Yt++]=Tn,Xt[Yt++]=An,Xt[Yt++]=xr,Tn=r.id,An=r.overflow,xr=s),s=su(s,h.children),s.flags|=4096,s)}function jh(r,s,u){r.lanes|=s;var h=r.alternate;h!==null&&(h.lanes|=s),Ma(r.return,s,u)}function ou(r,s,u,h,g){var y=r.memoizedState;y===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:g}:(y.isBackwards=s,y.rendering=null,y.renderingStartTime=0,y.last=h,y.tail=u,y.tailMode=g)}function Oh(r,s,u){var h=s.pendingProps,g=h.revealOrder,y=h.tail;if(At(r,s,h.children,u),h=Ye.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&&jh(r,u,s);else if(r.tag===19)jh(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(We(Ye,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&&xo(r)===null&&(g=u),u=u.sibling;u=g,u===null?(g=s.child,s.child=null):(g=u.sibling,u.sibling=null),ou(s,!1,g,u,y);break;case"backwards":for(u=null,g=s.child,s.child=null;g!==null;){if(r=g.alternate,r!==null&&xo(r)===null){s.child=g;break}r=g.sibling,g.sibling=u,u=g,g=r}ou(s,!0,u,null,y);break;case"together":ou(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function To(r,s){(s.mode&1)===0&&r!==null&&(r.alternate=null,s.alternate=null,s.flags|=2)}function Ln(r,s,u){if(r!==null&&(s.dependencies=r.dependencies),br|=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=lr(r,r.pendingProps),s.child=u,u.return=s;r.sibling!==null;)r=r.sibling,u=u.sibling=lr(r,r.pendingProps),u.return=s;u.sibling=null}return s.child}function Xv(r,s,u){switch(s.tag){case 3:Ph(s),ri();break;case 5:Qd(s);break;case 1:jt(s.type)&&co(s);break;case 4:$a(s,s.stateNode.containerInfo);break;case 10:var h=s.type._context,g=s.memoizedProps.value;We(yo,h._currentValue),h._currentValue=g;break;case 13:if(h=s.memoizedState,h!==null)return h.dehydrated!==null?(We(Ye,Ye.current&1),s.flags|=128,null):(u&s.child.childLanes)!==0?Lh(r,s,u):(We(Ye,Ye.current&1),r=Ln(r,s,u),r!==null?r.sibling:null);We(Ye,Ye.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),We(Ye,Ye.current),h)break;return null;case 22:case 23:return s.lanes=0,Nh(r,s,u)}return Ln(r,s,u)}var Mh,lu,Dh,Fh;Mh=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}},lu=function(){},Dh=function(r,s,u,h){var g=r.memoizedProps;if(g!==h){r=s.stateNode,_r(kn.current);var y=null;switch(u){case"input":g=U(r,g),h=U(r,h),y=[];break;case"select":g=_({},g,{value:void 0}),h=_({},h,{value:void 0}),y=[];break;case"textarea":g=et(r,g),h=et(r,h),y=[];break;default:typeof g.onClick!="function"&&typeof h.onClick=="function"&&(r.onclick=lo)}wt(u,h);var x;u=null;for(z in g)if(!h.hasOwnProperty(z)&&g.hasOwnProperty(z)&&g[z]!=null)if(z==="style"){var T=g[z];for(x in T)T.hasOwnProperty(x)&&(u||(u={}),u[x]="")}else z!=="dangerouslySetInnerHTML"&&z!=="children"&&z!=="suppressContentEditableWarning"&&z!=="suppressHydrationWarning"&&z!=="autoFocus"&&(o.hasOwnProperty(z)?y||(y=[]):(y=y||[]).push(z,null));for(z in h){var R=h[z];if(T=g?.[z],h.hasOwnProperty(z)&&R!==T&&(R!=null||T!=null))if(z==="style")if(T){for(x in T)!T.hasOwnProperty(x)||R&&R.hasOwnProperty(x)||(u||(u={}),u[x]="");for(x in R)R.hasOwnProperty(x)&&T[x]!==R[x]&&(u||(u={}),u[x]=R[x])}else u||(y||(y=[]),y.push(z,u)),u=R;else z==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,T=T?T.__html:void 0,R!=null&&T!==R&&(y=y||[]).push(z,R)):z==="children"?typeof R!="string"&&typeof R!="number"||(y=y||[]).push(z,""+R):z!=="suppressContentEditableWarning"&&z!=="suppressHydrationWarning"&&(o.hasOwnProperty(z)?(R!=null&&z==="onScroll"&&Ke("scroll",r),y||T===R||(y=[])):(y=y||[]).push(z,R))}u&&(y=y||[]).push("style",u);var z=y;(s.updateQueue=z)&&(s.flags|=4)}},Fh=function(r,s,u,h){u!==h&&(s.flags|=4)};function os(r,s){if(!Xe)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 Yv(r,s,u){var h=s.pendingProps;switch(Ta(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 jt(s.type)&&uo(),_t(s),null;case 3:return h=s.stateNode,li(),Qe(Lt),Qe(St),Ua(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(r===null||r.child===null)&&(mo(s)?s.flags|=4:r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,un!==null&&(wu(un),un=null))),lu(r,s),_t(s),null;case 5:za(s);var g=_r(ts.current);if(u=s.type,r!==null&&s.stateNode!=null)Dh(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=_r(kn.current),mo(s)){h=s.stateNode,u=s.type;var y=s.memoizedProps;switch(h[vn]=s,h[Xi]=y,r=(s.mode&1)!==0,u){case"dialog":Ke("cancel",h),Ke("close",h);break;case"iframe":case"object":case"embed":Ke("load",h);break;case"video":case"audio":for(g=0;g<qi.length;g++)Ke(qi[g],h);break;case"source":Ke("error",h);break;case"img":case"image":case"link":Ke("error",h),Ke("load",h);break;case"details":Ke("toggle",h);break;case"input":H(h,y),Ke("invalid",h);break;case"select":h._wrapperState={wasMultiple:!!y.multiple},Ke("invalid",h);break;case"textarea":Un(h,y),Ke("invalid",h)}wt(u,y),g=null;for(var x in y)if(y.hasOwnProperty(x)){var T=y[x];x==="children"?typeof T=="string"?h.textContent!==T&&(y.suppressHydrationWarning!==!0&&oo(h.textContent,T,r),g=["children",T]):typeof T=="number"&&h.textContent!==""+T&&(y.suppressHydrationWarning!==!0&&oo(h.textContent,T,r),g=["children",""+T]):o.hasOwnProperty(x)&&T!=null&&x==="onScroll"&&Ke("scroll",h)}switch(u){case"input":Kt(h),Oe(h,y,!0);break;case"textarea":Kt(h),$s(h);break;case"select":case"option":break;default:typeof y.onClick=="function"&&(h.onclick=lo)}h=g,s.updateQueue=h,h!==null&&(s.flags|=4)}else{x=g.nodeType===9?g:g.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=W(u)),r==="http://www.w3.org/1999/xhtml"?u==="script"?(r=x.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof h.is=="string"?r=x.createElement(u,{is:h.is}):(r=x.createElement(u),u==="select"&&(x=r,h.multiple?x.multiple=!0:h.size&&(x.size=h.size))):r=x.createElementNS(r,u),r[vn]=s,r[Xi]=h,Mh(r,s,!1,!1),s.stateNode=r;e:{switch(x=yn(u,h),u){case"dialog":Ke("cancel",r),Ke("close",r),g=h;break;case"iframe":case"object":case"embed":Ke("load",r),g=h;break;case"video":case"audio":for(g=0;g<qi.length;g++)Ke(qi[g],r);g=h;break;case"source":Ke("error",r),g=h;break;case"img":case"image":case"link":Ke("error",r),Ke("load",r),g=h;break;case"details":Ke("toggle",r),g=h;break;case"input":H(r,h),g=U(r,h),Ke("invalid",r);break;case"option":g=h;break;case"select":r._wrapperState={wasMultiple:!!h.multiple},g=_({},h,{value:void 0}),Ke("invalid",r);break;case"textarea":Un(r,h),g=et(r,h),Ke("invalid",r);break;default:g=h}wt(u,g),T=g;for(y in T)if(T.hasOwnProperty(y)){var R=T[y];y==="style"?Vn(r,R):y==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,R!=null&&Pe(r,R)):y==="children"?typeof R=="string"?(u!=="textarea"||R!=="")&&Fe(r,R):typeof R=="number"&&Fe(r,""+R):y!=="suppressContentEditableWarning"&&y!=="suppressHydrationWarning"&&y!=="autoFocus"&&(o.hasOwnProperty(y)?R!=null&&y==="onScroll"&&Ke("scroll",r):R!=null&&A(r,y,R,x))}switch(u){case"input":Kt(r),Oe(r,h,!1);break;case"textarea":Kt(r),$s(r);break;case"option":h.value!=null&&r.setAttribute("value",""+Te(h.value));break;case"select":r.multiple=!!h.multiple,y=h.value,y!=null?st(r,!!h.multiple,y,!1):h.defaultValue!=null&&st(r,!!h.multiple,h.defaultValue,!0);break;default:typeof g.onClick=="function"&&(r.onclick=lo)}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=_r(ts.current),_r(kn.current),mo(s)){if(h=s.stateNode,u=s.memoizedProps,h[vn]=s,(y=h.nodeValue!==u)&&(r=Vt,r!==null))switch(r.tag){case 3:oo(h.nodeValue,u,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&oo(h.nodeValue,u,(r.mode&1)!==0)}y&&(s.flags|=4)}else h=(u.nodeType===9?u:u.ownerDocument).createTextNode(h),h[vn]=s,s.stateNode=h}return _t(s),null;case 13:if(Qe(Ye),h=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(Xe&&Gt!==null&&(s.mode&1)!==0&&(s.flags&128)===0)Bd(),ri(),s.flags|=98560,y=!1;else if(y=mo(s),h!==null&&h.dehydrated!==null){if(r===null){if(!y)throw Error(n(318));if(y=s.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(n(317));y[vn]=s}else ri(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;_t(s),y=!1}else un!==null&&(wu(un),un=null),y=!0;if(!y)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||(Ye.current&1)!==0?ut===0&&(ut=3):xu())),s.updateQueue!==null&&(s.flags|=4),_t(s),null);case 4:return li(),lu(r,s),r===null&&Ki(s.stateNode.containerInfo),_t(s),null;case 10:return Oa(s.type._context),_t(s),null;case 17:return jt(s.type)&&uo(),_t(s),null;case 19:if(Qe(Ye),y=s.memoizedState,y===null)return _t(s),null;if(h=(s.flags&128)!==0,x=y.rendering,x===null)if(h)os(y,!1);else{if(ut!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(x=xo(r),x!==null){for(s.flags|=128,os(y,!1),h=x.updateQueue,h!==null&&(s.updateQueue=h,s.flags|=4),s.subtreeFlags=0,h=u,u=s.child;u!==null;)y=u,r=h,y.flags&=14680066,x=y.alternate,x===null?(y.childLanes=0,y.lanes=r,y.child=null,y.subtreeFlags=0,y.memoizedProps=null,y.memoizedState=null,y.updateQueue=null,y.dependencies=null,y.stateNode=null):(y.childLanes=x.childLanes,y.lanes=x.lanes,y.child=x.child,y.subtreeFlags=0,y.deletions=null,y.memoizedProps=x.memoizedProps,y.memoizedState=x.memoizedState,y.updateQueue=x.updateQueue,y.type=x.type,r=x.dependencies,y.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),u=u.sibling;return We(Ye,Ye.current&1|2),s.child}r=r.sibling}y.tail!==null&&nt()>fi&&(s.flags|=128,h=!0,os(y,!1),s.lanes=4194304)}else{if(!h)if(r=xo(x),r!==null){if(s.flags|=128,h=!0,u=r.updateQueue,u!==null&&(s.updateQueue=u,s.flags|=4),os(y,!0),y.tail===null&&y.tailMode==="hidden"&&!x.alternate&&!Xe)return _t(s),null}else 2*nt()-y.renderingStartTime>fi&&u!==1073741824&&(s.flags|=128,h=!0,os(y,!1),s.lanes=4194304);y.isBackwards?(x.sibling=s.child,s.child=x):(u=y.last,u!==null?u.sibling=x:s.child=x,y.last=x)}return y.tail!==null?(s=y.tail,y.rendering=s,y.tail=s.sibling,y.renderingStartTime=nt(),s.sibling=null,u=Ye.current,We(Ye,h?u&1|2:u&1),s):(_t(s),null);case 22:case 23:return ku(),h=s.memoizedState!==null,r!==null&&r.memoizedState!==null!==h&&(s.flags|=8192),h&&(s.mode&1)!==0?(Wt&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 Jv(r,s){switch(Ta(s),s.tag){case 1:return jt(s.type)&&uo(),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return li(),Qe(Lt),Qe(St),Ua(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 5:return za(s),null;case 13:if(Qe(Ye),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(n(340));ri()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return Qe(Ye),null;case 4:return li(),null;case 10:return Oa(s.type._context),null;case 22:case 23:return ku(),null;case 24:return null;default:return null}}var Ao=!1,Et=!1,Zv=typeof WeakSet=="function"?WeakSet:Set,ce=null;function ui(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 au(r,s,u){try{u()}catch(h){tt(r,s,h)}}var $h=!1;function ek(r,s){if(ka=Qs,r=yd(),da(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,y=h.focusNode;h=h.focusOffset;try{u.nodeType,y.nodeType}catch{u=null;break e}var x=0,T=-1,R=-1,z=0,K=0,Y=r,q=null;t:for(;;){for(var le;Y!==u||g!==0&&Y.nodeType!==3||(T=x+g),Y!==y||h!==0&&Y.nodeType!==3||(R=x+h),Y.nodeType===3&&(x+=Y.nodeValue.length),(le=Y.firstChild)!==null;)q=Y,Y=le;for(;;){if(Y===r)break t;if(q===u&&++z===g&&(T=x),q===y&&++K===h&&(R=x),(le=Y.nextSibling)!==null)break;Y=q,q=Y.parentNode}Y=le}u=T===-1||R===-1?null:{start:T,end:R}}else u=null}u=u||{start:0,end:0}}else u=null;for(xa={focusedElem:r,selectionRange:u},Qs=!1,ce=s;ce!==null;)if(s=ce,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,ce=r;else for(;ce!==null;){s=ce;try{var fe=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(fe!==null){var he=fe.memoizedProps,rt=fe.memoizedState,D=s.stateNode,j=D.getSnapshotBeforeUpdate(s.elementType===s.type?he:cn(s.type,he),rt);D.__reactInternalSnapshotBeforeUpdate=j}break;case 3:var $=s.stateNode.containerInfo;$.nodeType===1?$.textContent="":$.nodeType===9&&$.documentElement&&$.removeChild($.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(te){tt(s,s.return,te)}if(r=s.sibling,r!==null){r.return=s.return,ce=r;break}ce=s.return}return fe=$h,$h=!1,fe}function ls(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 y=g.destroy;g.destroy=void 0,y!==void 0&&au(s,u,y)}g=g.next}while(g!==h)}}function Po(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 uu(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 zh(r){var s=r.alternate;s!==null&&(r.alternate=null,zh(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&(delete s[vn],delete s[Xi],delete s[Ea],delete s[Mv],delete s[Dv])),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 Bh(r){return r.tag===5||r.tag===3||r.tag===4}function Uh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Bh(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 cu(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=lo));else if(h!==4&&(r=r.child,r!==null))for(cu(r,s,u),r=r.sibling;r!==null;)cu(r,s,u),r=r.sibling}function fu(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(fu(r,s,u),r=r.sibling;r!==null;)fu(r,s,u),r=r.sibling}var vt=null,fn=!1;function nr(r,s,u){for(u=u.child;u!==null;)Vh(r,s,u),u=u.sibling}function Vh(r,s,u){if(wn&&typeof wn.onCommitFiberUnmount=="function")try{wn.onCommitFiberUnmount(Vs,u)}catch{}switch(u.tag){case 5:Et||ui(u,s);case 6:var h=vt,g=fn;vt=null,nr(r,s,u),vt=h,fn=g,vt!==null&&(fn?(r=vt,u=u.stateNode,r.nodeType===8?r.parentNode.removeChild(u):r.removeChild(u)):vt.removeChild(u.stateNode));break;case 18:vt!==null&&(fn?(r=vt,u=u.stateNode,r.nodeType===8?_a(r.parentNode,u):r.nodeType===1&&_a(r,u),$i(r)):_a(vt,u.stateNode));break;case 4:h=vt,g=fn,vt=u.stateNode.containerInfo,fn=!0,nr(r,s,u),vt=h,fn=g;break;case 0:case 11:case 14:case 15:if(!Et&&(h=u.updateQueue,h!==null&&(h=h.lastEffect,h!==null))){g=h=h.next;do{var y=g,x=y.destroy;y=y.tag,x!==void 0&&((y&2)!==0||(y&4)!==0)&&au(u,s,x),g=g.next}while(g!==h)}nr(r,s,u);break;case 1:if(!Et&&(ui(u,s),h=u.stateNode,typeof h.componentWillUnmount=="function"))try{h.props=u.memoizedProps,h.state=u.memoizedState,h.componentWillUnmount()}catch(T){tt(u,s,T)}nr(r,s,u);break;case 21:nr(r,s,u);break;case 22:u.mode&1?(Et=(h=Et)||u.memoizedState!==null,nr(r,s,u),Et=h):nr(r,s,u);break;default:nr(r,s,u)}}function Gh(r){var s=r.updateQueue;if(s!==null){r.updateQueue=null;var u=r.stateNode;u===null&&(u=r.stateNode=new Zv),s.forEach(function(h){var g=uk.bind(null,r,h);u.has(h)||(u.add(h),h.then(g,g))})}}function dn(r,s){var u=s.deletions;if(u!==null)for(var h=0;h<u.length;h++){var g=u[h];try{var y=r,x=s,T=x;e:for(;T!==null;){switch(T.tag){case 5:vt=T.stateNode,fn=!1;break e;case 3:vt=T.stateNode.containerInfo,fn=!0;break e;case 4:vt=T.stateNode.containerInfo,fn=!0;break e}T=T.return}if(vt===null)throw Error(n(160));Vh(y,x,g),vt=null,fn=!1;var R=g.alternate;R!==null&&(R.return=null),g.return=null}catch(z){tt(g,s,z)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)Wh(s,r),s=s.sibling}function Wh(r,s){var u=r.alternate,h=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(dn(s,r),Sn(r),h&4){try{ls(3,r,r.return),Po(3,r)}catch(he){tt(r,r.return,he)}try{ls(5,r,r.return)}catch(he){tt(r,r.return,he)}}break;case 1:dn(s,r),Sn(r),h&512&&u!==null&&ui(u,u.return);break;case 5:if(dn(s,r),Sn(r),h&512&&u!==null&&ui(u,u.return),r.flags&32){var g=r.stateNode;try{Fe(g,"")}catch(he){tt(r,r.return,he)}}if(h&4&&(g=r.stateNode,g!=null)){var y=r.memoizedProps,x=u!==null?u.memoizedProps:y,T=r.type,R=r.updateQueue;if(r.updateQueue=null,R!==null)try{T==="input"&&y.type==="radio"&&y.name!=null&&we(g,y),yn(T,x);var z=yn(T,y);for(x=0;x<R.length;x+=2){var K=R[x],Y=R[x+1];K==="style"?Vn(g,Y):K==="dangerouslySetInnerHTML"?Pe(g,Y):K==="children"?Fe(g,Y):A(g,K,Y,z)}switch(T){case"input":Ce(g,y);break;case"textarea":gr(g,y);break;case"select":var q=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!y.multiple;var le=y.value;le!=null?st(g,!!y.multiple,le,!1):q!==!!y.multiple&&(y.defaultValue!=null?st(g,!!y.multiple,y.defaultValue,!0):st(g,!!y.multiple,y.multiple?[]:"",!1))}g[Xi]=y}catch(he){tt(r,r.return,he)}}break;case 6:if(dn(s,r),Sn(r),h&4){if(r.stateNode===null)throw Error(n(162));g=r.stateNode,y=r.memoizedProps;try{g.nodeValue=y}catch(he){tt(r,r.return,he)}}break;case 3:if(dn(s,r),Sn(r),h&4&&u!==null&&u.memoizedState.isDehydrated)try{$i(s.containerInfo)}catch(he){tt(r,r.return,he)}break;case 4:dn(s,r),Sn(r);break;case 13:dn(s,r),Sn(r),g=r.child,g.flags&8192&&(y=g.memoizedState!==null,g.stateNode.isHidden=y,!y||g.alternate!==null&&g.alternate.memoizedState!==null||(pu=nt())),h&4&&Gh(r);break;case 22:if(K=u!==null&&u.memoizedState!==null,r.mode&1?(Et=(z=Et)||K,dn(s,r),Et=z):dn(s,r),Sn(r),h&8192){if(z=r.memoizedState!==null,(r.stateNode.isHidden=z)&&!K&&(r.mode&1)!==0)for(ce=r,K=r.child;K!==null;){for(Y=ce=K;ce!==null;){switch(q=ce,le=q.child,q.tag){case 0:case 11:case 14:case 15:ls(4,q,q.return);break;case 1:ui(q,q.return);var fe=q.stateNode;if(typeof fe.componentWillUnmount=="function"){h=q,u=q.return;try{s=h,fe.props=s.memoizedProps,fe.state=s.memoizedState,fe.componentWillUnmount()}catch(he){tt(h,u,he)}}break;case 5:ui(q,q.return);break;case 22:if(q.memoizedState!==null){Kh(Y);continue}}le!==null?(le.return=q,ce=le):Kh(Y)}K=K.sibling}e:for(K=null,Y=r;;){if(Y.tag===5){if(K===null){K=Y;try{g=Y.stateNode,z?(y=g.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none"):(T=Y.stateNode,R=Y.memoizedProps.style,x=R!=null&&R.hasOwnProperty("display")?R.display:null,T.style.display=Qt("display",x))}catch(he){tt(r,r.return,he)}}}else if(Y.tag===6){if(K===null)try{Y.stateNode.nodeValue=z?"":Y.memoizedProps}catch(he){tt(r,r.return,he)}}else if((Y.tag!==22&&Y.tag!==23||Y.memoizedState===null||Y===r)&&Y.child!==null){Y.child.return=Y,Y=Y.child;continue}if(Y===r)break e;for(;Y.sibling===null;){if(Y.return===null||Y.return===r)break e;K===Y&&(K=null),Y=Y.return}K===Y&&(K=null),Y.sibling.return=Y.return,Y=Y.sibling}}break;case 19:dn(s,r),Sn(r),h&4&&Gh(r);break;case 21:break;default:dn(s,r),Sn(r)}}function Sn(r){var s=r.flags;if(s&2){try{e:{for(var u=r.return;u!==null;){if(Bh(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&&(Fe(g,""),h.flags&=-33);var y=Uh(r);fu(r,y,g);break;case 3:case 4:var x=h.stateNode.containerInfo,T=Uh(r);cu(r,T,x);break;default:throw Error(n(161))}}catch(R){tt(r,r.return,R)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function tk(r,s,u){ce=r,Hh(r)}function Hh(r,s,u){for(var h=(r.mode&1)!==0;ce!==null;){var g=ce,y=g.child;if(g.tag===22&&h){var x=g.memoizedState!==null||Ao;if(!x){var T=g.alternate,R=T!==null&&T.memoizedState!==null||Et;T=Ao;var z=Et;if(Ao=x,(Et=R)&&!z)for(ce=g;ce!==null;)x=ce,R=x.child,x.tag===22&&x.memoizedState!==null?Qh(g):R!==null?(R.return=x,ce=R):Qh(g);for(;y!==null;)ce=y,Hh(y),y=y.sibling;ce=g,Ao=T,Et=z}qh(r)}else(g.subtreeFlags&8772)!==0&&y!==null?(y.return=g,ce=y):qh(r)}}function qh(r){for(;ce!==null;){var s=ce;if((s.flags&8772)!==0){var u=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:Et||Po(5,s);break;case 1:var h=s.stateNode;if(s.flags&4&&!Et)if(u===null)h.componentDidMount();else{var g=s.elementType===s.type?u.memoizedProps:cn(s.type,u.memoizedProps);h.componentDidUpdate(g,u.memoizedState,h.__reactInternalSnapshotBeforeUpdate)}var y=s.updateQueue;y!==null&&Kd(s,y,h);break;case 3:var x=s.updateQueue;if(x!==null){if(u=null,s.child!==null)switch(s.child.tag){case 5:u=s.child.stateNode;break;case 1:u=s.child.stateNode}Kd(s,x,u)}break;case 5:var T=s.stateNode;if(u===null&&s.flags&4){u=T;var R=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":R.autoFocus&&u.focus();break;case"img":R.src&&(u.src=R.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var z=s.alternate;if(z!==null){var K=z.memoizedState;if(K!==null){var Y=K.dehydrated;Y!==null&&$i(Y)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Et||s.flags&512&&uu(s)}catch(q){tt(s,s.return,q)}}if(s===r){ce=null;break}if(u=s.sibling,u!==null){u.return=s.return,ce=u;break}ce=s.return}}function Kh(r){for(;ce!==null;){var s=ce;if(s===r){ce=null;break}var u=s.sibling;if(u!==null){u.return=s.return,ce=u;break}ce=s.return}}function Qh(r){for(;ce!==null;){var s=ce;try{switch(s.tag){case 0:case 11:case 15:var u=s.return;try{Po(4,s)}catch(R){tt(s,u,R)}break;case 1:var h=s.stateNode;if(typeof h.componentDidMount=="function"){var g=s.return;try{h.componentDidMount()}catch(R){tt(s,g,R)}}var y=s.return;try{uu(s)}catch(R){tt(s,y,R)}break;case 5:var x=s.return;try{uu(s)}catch(R){tt(s,x,R)}}}catch(R){tt(s,s.return,R)}if(s===r){ce=null;break}var T=s.sibling;if(T!==null){T.return=s.return,ce=T;break}ce=s.return}}var nk=Math.ceil,Ro=B.ReactCurrentDispatcher,du=B.ReactCurrentOwner,en=B.ReactCurrentBatchConfig,$e=0,ht=null,ot=null,kt=0,Wt=0,ci=Yn(0),ut=0,as=null,br=0,Lo=0,hu=0,us=null,Mt=null,pu=0,fi=1/0,jn=null,jo=!1,mu=null,rr=null,Oo=!1,ir=null,Mo=0,cs=0,gu=null,Do=-1,Fo=0;function Pt(){return($e&6)!==0?nt():Do!==-1?Do:Do=nt()}function sr(r){return(r.mode&1)===0?1:($e&2)!==0&&kt!==0?kt&-kt:$v.transition!==null?(Fo===0&&(Fo=Uf()),Fo):(r=Ue,r!==0||(r=window.event,r=r===void 0?16:Yf(r.type)),r)}function hn(r,s,u,h){if(50<cs)throw cs=0,gu=null,Error(n(185));ji(r,u,h),(($e&2)===0||r!==ht)&&(r===ht&&(($e&2)===0&&(Lo|=u),ut===4&&or(r,kt)),Dt(r,h),u===1&&$e===0&&(s.mode&1)===0&&(fi=nt()+500,fo&&Zn()))}function Dt(r,s){var u=r.callbackNode;$w(r,s);var h=Hs(r,r===ht?kt:0);if(h===0)u!==null&&$f(u),r.callbackNode=null,r.callbackPriority=0;else if(s=h&-h,r.callbackPriority!==s){if(u!=null&&$f(u),s===1)r.tag===0?Fv(Yh.bind(null,r)):Md(Yh.bind(null,r)),jv(function(){($e&6)===0&&Zn()}),u=null;else{switch(Vf(h)){case 1:u=Ql;break;case 4:u=zf;break;case 16:u=Us;break;case 536870912:u=Bf;break;default:u=Us}u=sp(u,Xh.bind(null,r))}r.callbackPriority=s,r.callbackNode=u}}function Xh(r,s){if(Do=-1,Fo=0,($e&6)!==0)throw Error(n(327));var u=r.callbackNode;if(di()&&r.callbackNode!==u)return null;var h=Hs(r,r===ht?kt:0);if(h===0)return null;if((h&30)!==0||(h&r.expiredLanes)!==0||s)s=$o(r,h);else{s=h;var g=$e;$e|=2;var y=Zh();(ht!==r||kt!==s)&&(jn=null,fi=nt()+500,Nr(r,s));do try{sk();break}catch(T){Jh(r,T)}while(!0);ja(),Ro.current=y,$e=g,ot!==null?s=0:(ht=null,kt=0,s=ut)}if(s!==0){if(s===2&&(g=Xl(r),g!==0&&(h=g,s=yu(r,g))),s===1)throw u=as,Nr(r,0),or(r,h),Dt(r,nt()),u;if(s===6)or(r,h);else{if(g=r.current.alternate,(h&30)===0&&!rk(g)&&(s=$o(r,h),s===2&&(y=Xl(r),y!==0&&(h=y,s=yu(r,y))),s===1))throw u=as,Nr(r,0),or(r,h),Dt(r,nt()),u;switch(r.finishedWork=g,r.finishedLanes=h,s){case 0:case 1:throw Error(n(345));case 2:Tr(r,Mt,jn);break;case 3:if(or(r,h),(h&130023424)===h&&(s=pu+500-nt(),10<s)){if(Hs(r,0)!==0)break;if(g=r.suspendedLanes,(g&h)!==h){Pt(),r.pingedLanes|=r.suspendedLanes&g;break}r.timeoutHandle=Ca(Tr.bind(null,r,Mt,jn),s);break}Tr(r,Mt,jn);break;case 4:if(or(r,h),(h&4194240)===h)break;for(s=r.eventTimes,g=-1;0<h;){var x=31-ln(h);y=1<<x,x=s[x],x>g&&(g=x),h&=~y}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*nk(h/1960))-h,10<h){r.timeoutHandle=Ca(Tr.bind(null,r,Mt,jn),h);break}Tr(r,Mt,jn);break;case 5:Tr(r,Mt,jn);break;default:throw Error(n(329))}}}return Dt(r,nt()),r.callbackNode===u?Xh.bind(null,r):null}function yu(r,s){var u=us;return r.current.memoizedState.isDehydrated&&(Nr(r,s).flags|=256),r=$o(r,s),r!==2&&(s=Mt,Mt=u,s!==null&&wu(s)),r}function wu(r){Mt===null?Mt=r:Mt.push.apply(Mt,r)}function rk(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],y=g.getSnapshot;g=g.value;try{if(!an(y(),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 or(r,s){for(s&=~hu,s&=~Lo,r.suspendedLanes|=s,r.pingedLanes&=~s,r=r.expirationTimes;0<s;){var u=31-ln(s),h=1<<u;r[u]=-1,s&=~h}}function Yh(r){if(($e&6)!==0)throw Error(n(327));di();var s=Hs(r,0);if((s&1)===0)return Dt(r,nt()),null;var u=$o(r,s);if(r.tag!==0&&u===2){var h=Xl(r);h!==0&&(s=h,u=yu(r,h))}if(u===1)throw u=as,Nr(r,0),or(r,s),Dt(r,nt()),u;if(u===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=s,Tr(r,Mt,jn),Dt(r,nt()),null}function vu(r,s){var u=$e;$e|=1;try{return r(s)}finally{$e=u,$e===0&&(fi=nt()+500,fo&&Zn())}}function Ir(r){ir!==null&&ir.tag===0&&($e&6)===0&&di();var s=$e;$e|=1;var u=en.transition,h=Ue;try{if(en.transition=null,Ue=1,r)return r()}finally{Ue=h,en.transition=u,$e=s,($e&6)===0&&Zn()}}function ku(){Wt=ci.current,Qe(ci)}function Nr(r,s){r.finishedWork=null,r.finishedLanes=0;var u=r.timeoutHandle;if(u!==-1&&(r.timeoutHandle=-1,Lv(u)),ot!==null)for(u=ot.return;u!==null;){var h=u;switch(Ta(h),h.tag){case 1:h=h.type.childContextTypes,h!=null&&uo();break;case 3:li(),Qe(Lt),Qe(St),Ua();break;case 5:za(h);break;case 4:li();break;case 13:Qe(Ye);break;case 19:Qe(Ye);break;case 10:Oa(h.type._context);break;case 22:case 23:ku()}u=u.return}if(ht=r,ot=r=lr(r.current,null),kt=Wt=s,ut=0,as=null,hu=Lo=br=0,Mt=us=null,Cr!==null){for(s=0;s<Cr.length;s++)if(u=Cr[s],h=u.interleaved,h!==null){u.interleaved=null;var g=h.next,y=u.pending;if(y!==null){var x=y.next;y.next=g,h.next=x}u.pending=h}Cr=null}return r}function Jh(r,s){do{var u=ot;try{if(ja(),So.current=bo,Co){for(var h=Je.memoizedState;h!==null;){var g=h.queue;g!==null&&(g.pending=null),h=h.next}Co=!1}if(Er=0,dt=at=Je=null,ns=!1,rs=0,du.current=null,u===null||u.return===null){ut=1,as=s,ot=null;break}e:{var y=r,x=u.return,T=u,R=s;if(s=kt,T.flags|=32768,R!==null&&typeof R=="object"&&typeof R.then=="function"){var z=R,K=T,Y=K.tag;if((K.mode&1)===0&&(Y===0||Y===11||Y===15)){var q=K.alternate;q?(K.updateQueue=q.updateQueue,K.memoizedState=q.memoizedState,K.lanes=q.lanes):(K.updateQueue=null,K.memoizedState=null)}var le=Ch(x);if(le!==null){le.flags&=-257,_h(le,x,T,y,s),le.mode&1&&Sh(y,z,s),s=le,R=z;var fe=s.updateQueue;if(fe===null){var he=new Set;he.add(R),s.updateQueue=he}else fe.add(R);break e}else{if((s&1)===0){Sh(y,z,s),xu();break e}R=Error(n(426))}}else if(Xe&&T.mode&1){var rt=Ch(x);if(rt!==null){(rt.flags&65536)===0&&(rt.flags|=256),_h(rt,x,T,y,s),Ra(ai(R,T));break e}}y=R=ai(R,T),ut!==4&&(ut=2),us===null?us=[y]:us.push(y),y=x;do{switch(y.tag){case 3:y.flags|=65536,s&=-s,y.lanes|=s;var D=kh(y,R,s);qd(y,D);break e;case 1:T=R;var j=y.type,$=y.stateNode;if((y.flags&128)===0&&(typeof j.getDerivedStateFromError=="function"||$!==null&&typeof $.componentDidCatch=="function"&&(rr===null||!rr.has($)))){y.flags|=65536,s&=-s,y.lanes|=s;var te=xh(y,T,s);qd(y,te);break e}}y=y.return}while(y!==null)}tp(u)}catch(pe){s=pe,ot===u&&u!==null&&(ot=u=u.return);continue}break}while(!0)}function Zh(){var r=Ro.current;return Ro.current=bo,r===null?bo:r}function xu(){(ut===0||ut===3||ut===2)&&(ut=4),ht===null||(br&268435455)===0&&(Lo&268435455)===0||or(ht,kt)}function $o(r,s){var u=$e;$e|=2;var h=Zh();(ht!==r||kt!==s)&&(jn=null,Nr(r,s));do try{ik();break}catch(g){Jh(r,g)}while(!0);if(ja(),$e=u,Ro.current=h,ot!==null)throw Error(n(261));return ht=null,kt=0,ut}function ik(){for(;ot!==null;)ep(ot)}function sk(){for(;ot!==null&&!Aw();)ep(ot)}function ep(r){var s=ip(r.alternate,r,Wt);r.memoizedProps=r.pendingProps,s===null?tp(r):ot=s,du.current=null}function tp(r){var s=r;do{var u=s.alternate;if(r=s.return,(s.flags&32768)===0){if(u=Yv(u,s,Wt),u!==null){ot=u;return}}else{if(u=Jv(u,s),u!==null){u.flags&=32767,ot=u;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{ut=6,ot=null;return}}if(s=s.sibling,s!==null){ot=s;return}ot=s=r}while(s!==null);ut===0&&(ut=5)}function Tr(r,s,u){var h=Ue,g=en.transition;try{en.transition=null,Ue=1,ok(r,s,u,h)}finally{en.transition=g,Ue=h}return null}function ok(r,s,u,h){do di();while(ir!==null);if(($e&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 y=u.lanes|u.childLanes;if(zw(r,y),r===ht&&(ot=ht=null,kt=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||Oo||(Oo=!0,sp(Us,function(){return di(),null})),y=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||y){y=en.transition,en.transition=null;var x=Ue;Ue=1;var T=$e;$e|=4,du.current=null,ek(r,u),Wh(u,r),bv(xa),Qs=!!ka,xa=ka=null,r.current=u,tk(u),Pw(),$e=T,Ue=x,en.transition=y}else r.current=u;if(Oo&&(Oo=!1,ir=r,Mo=g),y=r.pendingLanes,y===0&&(rr=null),jw(u.stateNode),Dt(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(jo)throw jo=!1,r=mu,mu=null,r;return(Mo&1)!==0&&r.tag!==0&&di(),y=r.pendingLanes,(y&1)!==0?r===gu?cs++:(cs=0,gu=r):cs=0,Zn(),null}function di(){if(ir!==null){var r=Vf(Mo),s=en.transition,u=Ue;try{if(en.transition=null,Ue=16>r?16:r,ir===null)var h=!1;else{if(r=ir,ir=null,Mo=0,($e&6)!==0)throw Error(n(331));var g=$e;for($e|=4,ce=r.current;ce!==null;){var y=ce,x=y.child;if((ce.flags&16)!==0){var T=y.deletions;if(T!==null){for(var R=0;R<T.length;R++){var z=T[R];for(ce=z;ce!==null;){var K=ce;switch(K.tag){case 0:case 11:case 15:ls(8,K,y)}var Y=K.child;if(Y!==null)Y.return=K,ce=Y;else for(;ce!==null;){K=ce;var q=K.sibling,le=K.return;if(zh(K),K===z){ce=null;break}if(q!==null){q.return=le,ce=q;break}ce=le}}}var fe=y.alternate;if(fe!==null){var he=fe.child;if(he!==null){fe.child=null;do{var rt=he.sibling;he.sibling=null,he=rt}while(he!==null)}}ce=y}}if((y.subtreeFlags&2064)!==0&&x!==null)x.return=y,ce=x;else e:for(;ce!==null;){if(y=ce,(y.flags&2048)!==0)switch(y.tag){case 0:case 11:case 15:ls(9,y,y.return)}var D=y.sibling;if(D!==null){D.return=y.return,ce=D;break e}ce=y.return}}var j=r.current;for(ce=j;ce!==null;){x=ce;var $=x.child;if((x.subtreeFlags&2064)!==0&&$!==null)$.return=x,ce=$;else e:for(x=j;ce!==null;){if(T=ce,(T.flags&2048)!==0)try{switch(T.tag){case 0:case 11:case 15:Po(9,T)}}catch(pe){tt(T,T.return,pe)}if(T===x){ce=null;break e}var te=T.sibling;if(te!==null){te.return=T.return,ce=te;break e}ce=T.return}}if($e=g,Zn(),wn&&typeof wn.onPostCommitFiberRoot=="function")try{wn.onPostCommitFiberRoot(Vs,r)}catch{}h=!0}return h}finally{Ue=u,en.transition=s}}return!1}function np(r,s,u){s=ai(u,s),s=kh(r,s,1),r=tr(r,s,1),s=Pt(),r!==null&&(ji(r,1,s),Dt(r,s))}function tt(r,s,u){if(r.tag===3)np(r,r,u);else for(;s!==null;){if(s.tag===3){np(s,r,u);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(rr===null||!rr.has(h))){r=ai(u,r),r=xh(s,r,1),s=tr(s,r,1),r=Pt(),s!==null&&(ji(s,1,r),Dt(s,r));break}}s=s.return}}function lk(r,s,u){var h=r.pingCache;h!==null&&h.delete(s),s=Pt(),r.pingedLanes|=r.suspendedLanes&u,ht===r&&(kt&u)===u&&(ut===4||ut===3&&(kt&130023424)===kt&&500>nt()-pu?Nr(r,0):hu|=u),Dt(r,s)}function rp(r,s){s===0&&((r.mode&1)===0?s=1:(s=Ws,Ws<<=1,(Ws&130023424)===0&&(Ws=4194304)));var u=Pt();r=Pn(r,s),r!==null&&(ji(r,s,u),Dt(r,u))}function ak(r){var s=r.memoizedState,u=0;s!==null&&(u=s.retryLane),rp(r,u)}function uk(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),rp(r,u)}var ip;ip=function(r,s,u){if(r!==null)if(r.memoizedProps!==s.pendingProps||Lt.current)Ot=!0;else{if((r.lanes&u)===0&&(s.flags&128)===0)return Ot=!1,Xv(r,s,u);Ot=(r.flags&131072)!==0}else Ot=!1,Xe&&(s.flags&1048576)!==0&&Dd(s,po,s.index);switch(s.lanes=0,s.tag){case 2:var h=s.type;To(r,s),r=s.pendingProps;var g=ei(s,St.current);oi(s,u),g=Wa(null,s,h,r,g,u);var y=Ha();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,jt(h)?(y=!0,co(s)):y=!1,s.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,Fa(s),g.updater=Io,s.stateNode=g,g._reactInternals=s,Ja(s,h,r,u),s=nu(null,s,h,!0,y,u)):(s.tag=0,Xe&&y&&Na(s),At(null,s,g,u),s=s.child),s;case 16:h=s.elementType;e:{switch(To(r,s),r=s.pendingProps,g=h._init,h=g(h._payload),s.type=h,g=s.tag=fk(h),r=cn(h,r),g){case 0:s=tu(null,s,h,r,u);break e;case 1:s=Ah(null,s,h,r,u);break e;case 11:s=Eh(null,s,h,r,u);break e;case 14:s=bh(null,s,h,cn(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:cn(h,g),tu(r,s,h,g,u);case 1:return h=s.type,g=s.pendingProps,g=s.elementType===h?g:cn(h,g),Ah(r,s,h,g,u);case 3:e:{if(Ph(s),r===null)throw Error(n(387));h=s.pendingProps,y=s.memoizedState,g=y.element,Hd(r,s),ko(s,h,null,u);var x=s.memoizedState;if(h=x.element,y.isDehydrated)if(y={element:h,isDehydrated:!1,cache:x.cache,pendingSuspenseBoundaries:x.pendingSuspenseBoundaries,transitions:x.transitions},s.updateQueue.baseState=y,s.memoizedState=y,s.flags&256){g=ai(Error(n(423)),s),s=Rh(r,s,h,u,g);break e}else if(h!==g){g=ai(Error(n(424)),s),s=Rh(r,s,h,u,g);break e}else for(Gt=Xn(s.stateNode.containerInfo.firstChild),Vt=s,Xe=!0,un=null,u=Gd(s,null,h,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(ri(),h===g){s=Ln(r,s,u);break e}At(r,s,h,u)}s=s.child}return s;case 5:return Qd(s),r===null&&Pa(s),h=s.type,g=s.pendingProps,y=r!==null?r.memoizedProps:null,x=g.children,Sa(h,g)?x=null:y!==null&&Sa(h,y)&&(s.flags|=32),Th(r,s),At(r,s,x,u),s.child;case 6:return r===null&&Pa(s),null;case 13:return Lh(r,s,u);case 4:return $a(s,s.stateNode.containerInfo),h=s.pendingProps,r===null?s.child=ii(s,null,h,u):At(r,s,h,u),s.child;case 11:return h=s.type,g=s.pendingProps,g=s.elementType===h?g:cn(h,g),Eh(r,s,h,g,u);case 7:return At(r,s,s.pendingProps,u),s.child;case 8:return At(r,s,s.pendingProps.children,u),s.child;case 12:return At(r,s,s.pendingProps.children,u),s.child;case 10:e:{if(h=s.type._context,g=s.pendingProps,y=s.memoizedProps,x=g.value,We(yo,h._currentValue),h._currentValue=x,y!==null)if(an(y.value,x)){if(y.children===g.children&&!Lt.current){s=Ln(r,s,u);break e}}else for(y=s.child,y!==null&&(y.return=s);y!==null;){var T=y.dependencies;if(T!==null){x=y.child;for(var R=T.firstContext;R!==null;){if(R.context===h){if(y.tag===1){R=Rn(-1,u&-u),R.tag=2;var z=y.updateQueue;if(z!==null){z=z.shared;var K=z.pending;K===null?R.next=R:(R.next=K.next,K.next=R),z.pending=R}}y.lanes|=u,R=y.alternate,R!==null&&(R.lanes|=u),Ma(y.return,u,s),T.lanes|=u;break}R=R.next}}else if(y.tag===10)x=y.type===s.type?null:y.child;else if(y.tag===18){if(x=y.return,x===null)throw Error(n(341));x.lanes|=u,T=x.alternate,T!==null&&(T.lanes|=u),Ma(x,u,s),x=y.sibling}else x=y.child;if(x!==null)x.return=y;else for(x=y;x!==null;){if(x===s){x=null;break}if(y=x.sibling,y!==null){y.return=x.return,x=y;break}x=x.return}y=x}At(r,s,g.children,u),s=s.child}return s;case 9:return g=s.type,h=s.pendingProps.children,oi(s,u),g=Jt(g),h=h(g),s.flags|=1,At(r,s,h,u),s.child;case 14:return h=s.type,g=cn(h,s.pendingProps),g=cn(h.type,g),bh(r,s,h,g,u);case 15:return Ih(r,s,s.type,s.pendingProps,u);case 17:return h=s.type,g=s.pendingProps,g=s.elementType===h?g:cn(h,g),To(r,s),s.tag=1,jt(h)?(r=!0,co(s)):r=!1,oi(s,u),wh(s,h,g),Ja(s,h,g,u),nu(null,s,h,!0,r,u);case 19:return Oh(r,s,u);case 22:return Nh(r,s,u)}throw Error(n(156,s.tag))};function sp(r,s){return Ff(r,s)}function ck(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 tn(r,s,u,h){return new ck(r,s,u,h)}function Su(r){return r=r.prototype,!(!r||!r.isReactComponent)}function fk(r){if(typeof r=="function")return Su(r)?1:0;if(r!=null){if(r=r.$$typeof,r===re)return 11;if(r===X)return 14}return 2}function lr(r,s){var u=r.alternate;return u===null?(u=tn(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 zo(r,s,u,h,g,y){var x=2;if(h=r,typeof r=="function")Su(r)&&(x=1);else if(typeof r=="string")x=5;else e:switch(r){case ee:return Ar(u.children,g,y,s);case oe:x=8,g|=8;break;case ae:return r=tn(12,u,s,g|2),r.elementType=ae,r.lanes=y,r;case de:return r=tn(13,u,s,g),r.elementType=de,r.lanes=y,r;case ie:return r=tn(19,u,s,g),r.elementType=ie,r.lanes=y,r;case me:return Bo(u,g,y,s);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case F:x=10;break e;case ne:x=9;break e;case re:x=11;break e;case X:x=14;break e;case ge:x=16,h=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return s=tn(x,u,s,g),s.elementType=r,s.type=h,s.lanes=y,s}function Ar(r,s,u,h){return r=tn(7,r,h,s),r.lanes=u,r}function Bo(r,s,u,h){return r=tn(22,r,h,s),r.elementType=me,r.lanes=u,r.stateNode={isHidden:!1},r}function Cu(r,s,u){return r=tn(6,r,null,s),r.lanes=u,r}function _u(r,s,u){return s=tn(4,r.children!==null?r.children:[],r.key,s),s.lanes=u,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}function dk(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=Yl(0),this.expirationTimes=Yl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yl(0),this.identifierPrefix=h,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Eu(r,s,u,h,g,y,x,T,R){return r=new dk(r,s,u,T,R),s===1?(s=1,y===!0&&(s|=8)):s=0,y=tn(3,null,null,s),r.current=y,y.stateNode=r,y.memoizedState={element:h,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Fa(y),r}function hk(r,s,u){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:h==null?null:""+h,children:r,containerInfo:s,implementation:u}}function op(r){if(!r)return Jn;r=r._reactInternals;e:{if(wr(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(jt(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(jt(u))return jd(r,u,s)}return s}function lp(r,s,u,h,g,y,x,T,R){return r=Eu(u,h,!0,r,g,y,x,T,R),r.context=op(null),u=r.current,h=Pt(),g=sr(u),y=Rn(h,g),y.callback=s??null,tr(u,y,g),r.current.lanes=g,ji(r,g,h),Dt(r,h),r}function Uo(r,s,u,h){var g=s.current,y=Pt(),x=sr(g);return u=op(u),s.context===null?s.context=u:s.pendingContext=u,s=Rn(y,x),s.payload={element:r},h=h===void 0?null:h,h!==null&&(s.callback=h),r=tr(g,s,x),r!==null&&(hn(r,g,x,y),vo(r,g,x)),x}function Vo(r){return r=r.current,r.child?(r.child.tag===5,r.child.stateNode):null}function ap(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<s?u:s}}function bu(r,s){ap(r,s),(r=r.alternate)&&ap(r,s)}function pk(){return null}var up=typeof reportError=="function"?reportError:function(r){console.error(r)};function Iu(r){this._internalRoot=r}Go.prototype.render=Iu.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(n(409));Uo(r,s,null,null)},Go.prototype.unmount=Iu.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;Ir(function(){Uo(null,r,null,null)}),s[In]=null}};function Go(r){this._internalRoot=r}Go.prototype.unstable_scheduleHydration=function(r){if(r){var s=Hf();r={blockedOn:null,target:r,priority:s};for(var u=0;u<qn.length&&s!==0&&s<qn[u].priority;u++);qn.splice(u,0,r),u===0&&Qf(r)}};function Nu(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function Wo(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function cp(){}function mk(r,s,u,h,g){if(g){if(typeof h=="function"){var y=h;h=function(){var z=Vo(x);y.call(z)}}var x=lp(s,h,r,0,null,!1,!1,"",cp);return r._reactRootContainer=x,r[In]=x.current,Ki(r.nodeType===8?r.parentNode:r),Ir(),x}for(;g=r.lastChild;)r.removeChild(g);if(typeof h=="function"){var T=h;h=function(){var z=Vo(R);T.call(z)}}var R=Eu(r,0,!1,null,null,!1,!1,"",cp);return r._reactRootContainer=R,r[In]=R.current,Ki(r.nodeType===8?r.parentNode:r),Ir(function(){Uo(s,R,u,h)}),R}function Ho(r,s,u,h,g){var y=u._reactRootContainer;if(y){var x=y;if(typeof g=="function"){var T=g;g=function(){var R=Vo(x);T.call(R)}}Uo(s,x,r,g)}else x=mk(u,s,r,g,h);return Vo(x)}Gf=function(r){switch(r.tag){case 3:var s=r.stateNode;if(s.current.memoizedState.isDehydrated){var u=Li(s.pendingLanes);u!==0&&(Jl(s,u|1),Dt(s,nt()),($e&6)===0&&(fi=nt()+500,Zn()))}break;case 13:Ir(function(){var h=Pn(r,1);if(h!==null){var g=Pt();hn(h,r,1,g)}}),bu(r,1)}},Zl=function(r){if(r.tag===13){var s=Pn(r,134217728);if(s!==null){var u=Pt();hn(s,r,134217728,u)}bu(r,134217728)}},Wf=function(r){if(r.tag===13){var s=sr(r),u=Pn(r,s);if(u!==null){var h=Pt();hn(u,r,s,h)}bu(r,s)}},Hf=function(){return Ue},qf=function(r,s){var u=Ue;try{return Ue=r,s()}finally{Ue=u}},Wl=function(r,s,u){switch(s){case"input":if(Ce(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=ao(h);if(!g)throw Error(n(90));Ur(h),Ce(h,g)}}}break;case"textarea":gr(r,u);break;case"select":s=u.value,s!=null&&st(r,!!u.multiple,s,!1)}},Pf=vu,Rf=Ir;var gk={usingClientEntryPoint:!1,Events:[Yi,Jr,ao,Tf,Af,vu]},fs={findFiberByHostInstance:vr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},yk={bundleType:fs.bundleType,version:fs.version,rendererPackageName:fs.rendererPackageName,rendererConfig:fs.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=Mf(r),r===null?null:r.stateNode},findFiberByHostInstance:fs.findFiberByHostInstance||pk,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{Vs=qo.inject(yk),wn=qo}catch{}}return Ft.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=gk,Ft.createPortal=function(r,s){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Nu(s))throw Error(n(200));return hk(r,s,null,u)},Ft.createRoot=function(r,s){if(!Nu(r))throw Error(n(299));var u=!1,h="",g=up;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(h=s.identifierPrefix),s.onRecoverableError!==void 0&&(g=s.onRecoverableError)),s=Eu(r,1,!1,null,null,u,!1,h,g),r[In]=s.current,Ki(r.nodeType===8?r.parentNode:r),new Iu(s)},Ft.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=Mf(s),r=r===null?null:r.stateNode,r},Ft.flushSync=function(r){return Ir(r)},Ft.hydrate=function(r,s,u){if(!Wo(s))throw Error(n(200));return Ho(null,r,s,!0,u)},Ft.hydrateRoot=function(r,s,u){if(!Nu(r))throw Error(n(405));var h=u!=null&&u.hydratedSources||null,g=!1,y="",x=up;if(u!=null&&(u.unstable_strictMode===!0&&(g=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onRecoverableError!==void 0&&(x=u.onRecoverableError)),s=lp(s,null,r,1,u??null,g,!1,y,x),r[In]=s.current,Ki(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 Go(s)},Ft.render=function(r,s,u){if(!Wo(s))throw Error(n(200));return Ho(null,r,s,!1,u)},Ft.unmountComponentAtNode=function(r){if(!Wo(r))throw Error(n(40));return r._reactRootContainer?(Ir(function(){Ho(null,null,r,!1,function(){r._reactRootContainer=null,r[In]=null})}),!0):!1},Ft.unstable_batchedUpdates=vu,Ft.unstable_renderSubtreeIntoContainer=function(r,s,u,h){if(!Wo(u))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return Ho(r,s,u,!1,h)},Ft.version="18.3.1-next-f1338f8080-20240426",Ft}var wp;function ag(){if(wp)return Pu.exports;wp=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(),Pu.exports=_k(),Pu.exports}var vp;function Ek(){if(vp)return Ko;vp=1;var e=ag();return Ko.createRoot=e.createRoot,Ko.hydrateRoot=e.hydrateRoot,Ko}var bk=Ek();class dr extends Error{constructor(t){super(t),this.name="TargetKeyError"}}function Qo(e){return!(!e||e.length>256||e.startsWith("-")||e.startsWith(".")||/[\s\0]/.test(e)||e.includes(".."))}function kp(e){if(e==="working"||e==="staged"||e==="all")return{kind:e};if(e.startsWith("commit:")){const t=e.slice(7);if(!Qo(t))throw new dr(`invalid commit ref: ${t}`);return{kind:"commit",sha:t}}if(e.startsWith("base:")){const t=e.slice(5);if(!Qo(t))throw new dr(`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 dr(`invalid range: ${t}`);const i=t.slice(0,n),o=t.slice(n+2);if(!Qo(i)||!Qo(o))throw new dr(`invalid range refs: ${t}`);return{kind:"range",base:i,head:o}}throw new dr(`unknown target key: ${e}`)}function pl(e){if(typeof e!="string"||!e)throw new dr("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 dr(`invalid worktree target key: ${e}`);const i=n[1];if(!i.startsWith("/"))throw new dr(`worktree path must be absolute: ${i}`);return{...kp(n[2]),worktree:i}}return kp(e)}function $n(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 ug(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 Dn(e){try{return pl(e)}catch{return}}function hr(e){return e.kind==="working"||e.kind==="staged"||e.kind==="all"}function wc(e){const t=Dn(e);return!t||!hr(t)?e:t.worktree?`worktree:${t.worktree}:local`:"local"}function Ik(e){const t=Dn(e),n=t?.worktree?{worktree:t.worktree}:{};return[$n({kind:"working",...n}),$n({kind:"staged",...n}),$n({kind:"all",...n})]}const xp=e=>{let t;const n=new Set,i=(d,p)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const w=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(v=>v(t,w))}},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},Nk=(e=>e?xp(e):xp),Tk=e=>e;function Ak(e,t=Tk){const n=vs.useSyncExternalStore(e.subscribe,vs.useCallback(()=>t(e.getState()),[e,t]),vs.useCallback(()=>t(e.getInitialState()),[e,t]));return vs.useDebugValue(n),n}const Sp=e=>{const t=Nk(e),n=i=>Ak(t,i);return Object.assign(n,t),n},Pk=(e=>e?Sp(e):Sp);class qc extends Error{constructor(t,n,i){super(t),this.status=n,this.code=i,this.name="ApiError"}status;code}async function He(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 qc(l.error??`${i.status} ${i.statusText}`,i.status,l.code)}return a}const xt=encodeURIComponent,hi=e=>{const t=[];for(const[n,i]of Object.entries(e))i===void 0||i===""||i===!1||t.push(`${xt(n)}=${xt(i===!0?"1":String(i))}`);return t.length?`?${t.join("&")}`:""},ze={repo:()=>He("GET","/api/repo"),state:()=>He("GET","/api/state"),patchPrefs:e=>He("PATCH","/api/prefs",e),files:e=>He("GET",`/api/targets/${xt(e)}/files`),file:(e,t,n={})=>He("GET",`/api/targets/${xt(e)}/file${hi({path:t,old:n.oldPath,untracked:n.untracked})}`),fullFile:(e,t,n)=>He("GET",`/api/targets/${xt(e)}/file/full${hi({path:t,side:n})}`),setViewed:(e,t,n,i)=>He("PUT",`/api/targets/${xt(e)}/viewed`,{path:t,viewed:n,contentHash:i}),createComment:(e,t)=>He("POST",`/api/targets/${xt(e)}/comments`,t),updateComment:(e,t,n)=>He("PATCH",`/api/targets/${xt(e)}/comments/${xt(t)}`,n),deleteComment:(e,t)=>He("DELETE",`/api/targets/${xt(e)}/comments/${xt(t)}`),reanchor:(e,t)=>He("POST",`/api/targets/${xt(e)}/comments/reanchor`,{files:t}),exportComments:e=>He("POST","/api/comments/export",{commentIds:e}),issues:()=>He("GET","/api/issues"),createIssue:e=>He("POST","/api/issues",e),updateIssue:(e,t)=>He("PATCH",`/api/issues/${xt(e)}`,t),deleteIssue:e=>He("DELETE",`/api/issues/${xt(e)}`),exportIssue:e=>He("POST",`/api/issues/${xt(e)}/export`),todos:e=>He("GET",`/api/todos${hi({branch:e})}`),createTodo:e=>He("POST","/api/todos",e),updateTodo:(e,t)=>He("PATCH",`/api/todos/${xt(e)}`,t),deleteTodo:e=>He("DELETE",`/api/todos/${xt(e)}`),exportTodos:e=>He("POST","/api/todos/export",e),events:e=>new EventSource(`/api/events${hi({root:e})}`),commits:e=>He("GET",`/api/commits${hi(e)}`),nvimInstances:(e,t=!1)=>He("GET",`/api/nvim/instances${hi({root:e,rescan:t})}`),nvimSelect:(e,t)=>He("POST","/api/nvim/select",{root:e,socket:t}),nvimOpen:(e,t,n)=>He("POST","/api/nvim/open",{socket:e,absPath:t,line:n})};async function ju(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 Kc(e,t){return e?e.worktrees.find(n=>n.path===t)?.branch??e.branch:""}let Rk=0,Ou=null;function Xo(e){return e instanceof qc||e instanceof Error?e.message:String(e)}const G=Pk((e,t)=>{const n=l=>t().showToast(Xo(l),"error"),i=l=>{const c=t();if(l===c.targetKey)return c.files;const f=Dn(l);return!f||!hr(f)?[]:f.kind==="working"?c.unstaged:f.kind==="staged"?c.staged:c.allFiles},o=(l,c,f)=>{const d=Dn(l),p=d&&hr(d)?d.kind:null,m=w=>w.map(v=>v.path===c?{...v,...f}:v);e(w=>({...p==="working"?{unstaged:m(w.unstaged)}:{},...p==="staged"?{staged:m(w.staged)}:{},...p==="all"?{allFiles:m(w.allFiles)}:{},...l===w.targetKey?{files:m(w.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 ze.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:Xo(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",async init(){try{const[l,c]=await Promise.all([ze.repo(),ze.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:Xo(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}),ze.patchPrefs({lastTarget:l}).catch(()=>{}),await t().loadFiles()},async switchView(l,c){const f=Dn(l);if(!f||!hr(f)){await t().setTarget(l);return}const{unstaged:d,staged:p,allFiles:m}=t(),w=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:w}),ze.patchPrefs({lastTarget:l}).catch(()=>{}),f.kind==="all"&&await t().loadFiles(),w&&t().files.some(k=>k.path===w)&&await a(w)},async loadFiles(){const l=t().targetKey,c=Dn(l);e({filesLoading:!0,filesError:null});try{await ze.reanchor(l).catch(()=>{});const f=p=>t().activeFile&&p.some(m=>m.path===t().activeFile)?t().activeFile:null;if(c&&hr(c)){const[p,m]=Ik(l),[w,v,k]=await Promise.all([ze.files(p),ze.files(m),c.kind==="all"?ze.files(l):Promise.resolve(null)]);if(t().targetKey!==l)return;const E=c.kind==="working"?w.files:c.kind==="staged"?v.files:k.files,N=k??w;e({unstaged:w.files,staged:v.files,allFiles:k?.files??[],files:E,root:N.root,comments:N.comments,filesLoading:!1,activeFile:f(E)}),N.root!==t().nvim?.root&&t().scanNvim();return}const d=await ze.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:Xo(f),files:[]})}},async refresh(){if(t().refreshing){e({refreshPending:!0});return}const{activeFile:l}=t();e({refreshing:!0,restoreScroll:!0,diffs:{},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}})),ze.patchPrefs({autoRefresh:l}).catch(n)},consumeRestoreScroll(){return t().restoreScroll?(e({restoreScroll:!1}),!0):!1},async openFile(l,c=!1){e({activeFile:l,panel:"diff"});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}})),ze.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 ze.setViewed(f,l,p,d.contentHash)}catch(m){n(m),o(f,l,{viewed:!p})}},async createComment(l){try{const c=await ze.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 ze.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 ze.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 ze.exportComments(l);await ju(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 ze.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 ze.createIssue(l);return e(f=>({issues:[...f.issues,c],selectedCommentIds:[]})),t().showToast(`已创建 Issue「${c.title}」`),c}catch(c){n(c);return}},async updateIssue(l,c){try{const f=await ze.updateIssue(l,c);e(d=>({issues:d.issues.map(p=>p.id===l?f:p)}))}catch(f){n(f)}},async deleteIssue(l){try{await ze.deleteIssue(l),e(c=>({issues:c.issues.filter(f=>f.id!==l)}))}catch(c){n(c)}},async exportIssue(l){try{const c=await ze.exportIssue(l);await ju(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 ze.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 ze.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 ze.nvimOpen(p,m,c)}catch(w){n(w),w instanceof qc&&w.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 ze.todos();e({todos:l.todos})}catch(l){n(l)}},async createTodo(l){try{const c=await ze.createTodo({...l,root:l.root??t().root});return e(f=>({todos:[...f.todos,c]})),c}catch(c){n(c);return}},async updateTodo(l,c){try{const f=await ze.updateTodo(l,c);e(d=>({todos:d.todos.map(p=>p.id===l?f:p)}))}catch(f){n(f)}},async deleteTodo(l){try{await ze.deleteTodo(l),e(c=>({todos:c.todos.filter(f=>f.id!==l)}))}catch(c){n(c)}},async exportTodos(l){const c=Kc(t().repo,t().root);try{const f=await ze.exportTodos({branch:c,includeDone:l});if(f.count===0){t().showToast(`分支 ${c} 没有可导出的 Todo`);return}await ju(f.text),t().showToast(`已复制 ${f.count} 条 Todo 到剪贴板`)}catch(f){n(f)}},showToast(l,c="info"){const f=++Rk;e({toast:{id:f,message:l,kind:c}}),Ou&&clearTimeout(Ou),Ou=setTimeout(()=>{t().toast?.id===f&&e({toast:null})},c==="error"?6e3:3e3)}}});function Lk(){const e=G(l=>l.nvim),t=G(l=>l.nvimScanning),n=G(l=>l.scanNvim),i=G(l=>l.selectNvim),o=e?.instances??[];let a;if(!e)a=S.jsx("span",{className:"muted",children:"nvim: 未扫描"});else if(!e.nvimAvailable)a=S.jsx("span",{className:"muted",title:"PATH 中找不到 nvim 可执行文件",children:"nvim 不可用"});else if(o.length===0)a=S.jsx("span",{className:"muted",children:"未发现在此仓库打开的 nvim"});else if(o.length===1){const l=o[0];a=S.jsxs("span",{className:"nvim-one",title:`${l.socket}
|
|
10
|
-
cwd: ${l.cwd}`,children:["nvim",l.pid?` #${l.pid}`:""]})}else a=S.jsxs("select",{value:e.selected??"",onChange:l=>{i(l.target.value)},title:"多个 nvim 实例,请选择跳转目标",children:[!e.selected&&S.jsx("option",{value:"",children:"选择 nvim…"}),o.map(l=>S.jsxs("option",{value:l.socket,children:["nvim",l.pid?` #${l.pid}`:""," — ",l.cwd]},l.socket))]});return S.jsxs("div",{className:"nvim",children:[a,S.jsx("button",{className:"icon",onClick:()=>{n(!0)},disabled:t,title:"重新扫描 nvim 实例",children:t?"…":"⟳"})]})}function jk(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"})}const Ok=[{kind:"working",label:"Unstaged",title:"工作区未提交的改动(含未跟踪文件)"},{kind:"staged",label:"Staged",title:"已暂存的改动"},{kind:"all",label:"All",title:"工作区全部改动(对比 HEAD)"},{kind:"base",label:"Branch",title:"分支自 base 分叉以来的全部改动,已提交和未提交都算(含未跟踪文件)"},{kind:"commit",label:"Commit",title:"查看单个 commit"},{kind:"range",label:"Range",title:"对比两个 ref"}];function Mk(){return S.jsxs("svg",{className:"mark",viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("rect",{width:"16",height:"16",rx:"3",fill:"#5b47d9"}),S.jsx("rect",{x:"3.5",y:"4",width:"2",height:"8",rx:"1",fill:"#fff"}),S.jsx("path",{d:"M8 5.5h4.5M8 10.5h3",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round"})]})}function Dk(){const e=G(O=>O.repo),t=G(O=>O.targetKey),n=G(O=>O.setTarget),i=G(O=>O.switchView),o=G(O=>O.refresh),a=G(O=>O.filesLoading),l=G(O=>O.prefs.autoRefresh),c=G(O=>O.setAutoRefresh),f=G(O=>O.lastRefreshAt),d=G(O=>O.prefs.viewMode),p=G(O=>O.setViewMode),m=G(O=>O.panel),w=G(O=>O.setPanel),v=G(O=>O.issues),k=Q.useMemo(()=>pl(t),[t]),[E,N]=Q.useState(k.kind),[C,b]=Q.useState(k.worktree??""),[A,B]=Q.useState(k.kind==="commit"?k.sha:""),[P,M]=Q.useState(k.kind==="range"?k.base:"@"),[ee,oe]=Q.useState(k.kind==="range"?k.head:""),[ae,F]=Q.useState(k.kind==="base"?k.ref:""),ne=e.worktrees.find(O=>O.isMain),re=O=>(O||e.root)!==ne?.path&&ne?.branch||e.defaultBase||"main",[de,ie]=Q.useState(t);de!==t&&(ie(t),N(k.kind),b(k.worktree??""),k.kind==="commit"&&B(k.sha),k.kind==="range"&&(M(k.base),oe(k.head)),k.kind==="base"&&F(k.ref));const X=(O={})=>{const _=O.kind??E,L=O.worktree??C,V=L?{worktree:L}:{};let I;if(_==="commit"){const Se=(O.sha??A).trim();if(!Se)return;I={kind:"commit",sha:Se,...V}}else if(_==="range"){const Se=(O.base??P).trim()||"@",ye=(O.head??ee).trim();if(!ye)return;I={kind:"range",base:Se,head:ye,...V}}else _==="base"?I={kind:"base",ref:(O.ref??ae).trim()||re(L),...V}:I={kind:_,...V};const ue=$n(I);ue!==t&&(hr(I)&&wc(ue)===wc(t)?i(ue):n(ue))},ge=k.kind==="commit"||k.kind==="range"||k.kind==="base"||!!k.worktree,me=v.filter(O=>O.status==="open").length,J=e.worktrees.filter(O=>O.path!==e.root);return S.jsxs("header",{className:"topbar",children:[S.jsxs("div",{className:"brand",title:e.root,children:[S.jsx(Mk,{}),S.jsx("span",{className:"wordmark",children:"warden"})]}),S.jsxs("div",{className:"scope",children:[S.jsx("span",{className:"repo-name",children:e.root.split("/").filter(Boolean).pop()}),S.jsx("span",{className:"branch",children:e.branch}),J.length>0&&S.jsxs("select",{value:C,title:"Worktree",onChange:O=>{b(O.target.value),X({worktree:O.target.value})},children:[S.jsxs("option",{value:"",children:["主仓库 (",e.branch,")"]}),J.map(O=>S.jsxs("option",{value:O.path,children:["worktree: ",O.path.split("/").filter(Boolean).pop()," (",O.branch??O.head.slice(0,7),")"]},O.path))]})]}),S.jsxs("div",{className:"target",children:[S.jsx("div",{className:"seg",role:"group","aria-label":"审查目标",children:Ok.map(({kind:O,label:_,title:L})=>S.jsx("button",{className:E===O?"active":"","aria-pressed":E===O,title:L,onClick:()=>{N(O),(O==="working"||O==="staged"||O==="all"||O==="base")&&X({kind:O})},children:_},O))}),E==="commit"&&S.jsxs("form",{className:"inline-form",onSubmit:O=>{O.preventDefault(),X()},children:[S.jsx("input",{value:A,onChange:O=>B(O.target.value),placeholder:"sha / ref",spellCheck:!1}),S.jsx("button",{type:"submit",children:"查看"})]}),E==="range"&&S.jsxs("form",{className:"inline-form",onSubmit:O=>{O.preventDefault(),X()},children:[S.jsx("input",{value:P,onChange:O=>M(O.target.value),placeholder:"base (@ = HEAD)",spellCheck:!1}),S.jsx("span",{className:"muted",children:".."}),S.jsx("input",{value:ee,onChange:O=>oe(O.target.value),placeholder:"head",spellCheck:!1}),S.jsx("button",{type:"submit",children:"对比"})]}),E==="base"&&S.jsxs("form",{className:"inline-form",onSubmit:O=>{O.preventDefault(),X()},children:[S.jsx("span",{className:"muted",children:"vs"}),S.jsx("input",{value:ae,onChange:O=>F(O.target.value),placeholder:re(C),spellCheck:!1}),S.jsx("button",{type:"submit",children:"对比"})]}),ge&&S.jsx("span",{className:"target-label",title:t,children:ug(k)})]}),S.jsxs("div",{className:"topbar-right",children:[S.jsxs("nav",{className:"tabs","aria-label":"面板",children:[S.jsx("button",{className:`tab ${m==="commits"?"active":""}`,onClick:()=>w(m==="commits"?"diff":"commits"),title:"历史 commit",children:"Commits"}),S.jsxs("button",{className:`tab ${m==="issues"?"active":""}`,onClick:()=>w(m==="issues"?"diff":"issues"),title:"本地 Issue",children:["Issues",me>0&&S.jsx("span",{className:"tab-count",children:me})]})]}),S.jsxs("div",{className:"tools",children:[S.jsxs("div",{className:"seg",role:"group","aria-label":"diff 布局",children:[S.jsx("button",{className:d==="unified"?"active":"","aria-pressed":d==="unified",onClick:()=>p("unified"),children:"Unified"}),S.jsx("button",{className:d==="split"?"active":"","aria-pressed":d==="split",onClick:()=>p("split"),children:"Split"})]}),S.jsx(Lk,{}),S.jsx("button",{onClick:()=>{o()},disabled:a,title:f?`上次刷新 ${jk(f)}(r)`:"刷新 (r)",children:a?"刷新中…":"刷新"}),S.jsx("button",{className:"toggle","aria-pressed":l,"aria-label":"自动刷新",onClick:()=>c(!l),title:`仓库发生变化时自动刷新(当前${l?"开启":"关闭"})`,children:"自动"})]})]})]})}function cg(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=cg(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 Fk(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 cg(t,"","")}function Qc(e,t=[]){for(const n of e.children)n.kind==="dir"&&(t.push(n.path),Qc(n,t));return t}const fg={added:"A",modified:"M",deleted:"D",renamed:"R"};function dg({node:e,depth:t,view:n}){const i=G(m=>m.activeFile===e.path&&m.targetKey===n),o=G(m=>m.targetKey===n),a=G(m=>m.openFile),l=G(m=>m.switchView),c=G(m=>m.toggleViewed),f=G(m=>m.comments.filter(w=>w.filePath===e.path&&w.targetKey===n).length),d=e.entry,p=async()=>{o||await l(n,e.path),await a(e.path)};return S.jsxs("div",{className:`tree-row file ${i?"active":""} ${d.viewed?"viewed":""}`,style:{paddingLeft:8+t*14},onClick:()=>{p()},title:d.oldPath?`${d.oldPath} → ${d.path}`:d.path,children:[S.jsx("input",{type:"checkbox",className:"viewed-box",checked:d.viewed,onClick:m=>m.stopPropagation(),onChange:()=>{c(e.path,n)},title:"标记为已查看"}),S.jsx("span",{className:`status status-${d.status}`,children:fg[d.status]}),S.jsx("span",{className:"name",children:e.name}),d.changed&&S.jsx("span",{className:"changed",title:"文件自上次标记已查看后发生变化",children:"已变化"}),f>0&&S.jsx("span",{className:"cc",title:"评论数",children:f}),S.jsx("span",{className:"counts",children:d.binary?S.jsx("span",{className:"muted",children:"bin"}):S.jsxs(S.Fragment,{children:[S.jsxs("span",{className:"add",children:["+",d.additions]}),S.jsxs("span",{className:"del",children:["-",d.deletions]})]})})]})}function hg({node:e,depth:t,view:n,open:i,toggle:o}){const a=i.has(e.path);return S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"tree-row dir",style:{paddingLeft:8+t*14},onClick:()=>o(e.path),children:[S.jsx("span",{className:`chev ${a?"open":""}`,children:"▸"}),S.jsx("span",{className:"name",children:e.name}),S.jsx("span",{className:"muted count",children:e.fileCount})]}),a&&e.children.map(l=>l.kind==="dir"?S.jsx(hg,{node:l,depth:t+1,view:n,open:i,toggle:o},l.path):S.jsx(dg,{node:l,depth:t+1,view:n},l.path))]})}function $k(e,t){const[n,i]=Q.useState(new Set),o=G(c=>c.activeFile),a=G(c=>c.targetKey===t);return Q.useEffect(()=>{!o||!a||i(c=>{const f=new Set(c);for(const d of Qc(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 Mu({title:e,view:t,files:n,empty:i}){const o=Q.useMemo(()=>Fk(n),[n]),{open:a,setOpen:l,toggle:c}=$k(o,t),f=n.reduce((m,w)=>m+w.additions,0),d=n.reduce((m,w)=>m+w.deletions,0),p=n.filter(m=>m.viewed).length;return S.jsxs("section",{className:"tree-block",children:[S.jsxs("div",{className:"block-head",children:[S.jsx("span",{className:"block-title",children:e}),S.jsx("span",{className:"block-n",children:n.length}),S.jsxs("span",{className:"counts",children:[S.jsxs("span",{className:"add",children:["+",f]}),S.jsxs("span",{className:"del",children:["-",d]})]}),S.jsx("span",{className:"spacer"}),n.length>0&&S.jsxs("span",{className:"block-viewed",title:"已标记为 viewed 的文件",children:[p,"/",n.length," viewed"]}),S.jsxs("span",{className:"tree-tools",children:[S.jsx("button",{className:"link",onClick:()=>l(new Set(Qc(o))),title:"展开全部目录",children:"展开"}),S.jsx("button",{className:"link",onClick:()=>l(new Set),title:"折叠全部目录",children:"折叠"})]})]}),n.length>0&&S.jsx("div",{className:"block-progress",role:"progressbar","aria-label":`${e} 已查看`,"aria-valuemin":0,"aria-valuemax":n.length,"aria-valuenow":p,children:S.jsx("span",{style:{width:`${p/n.length*100}%`}})}),S.jsx("div",{className:"tree",children:n.length===0?S.jsx("div",{className:"muted empty",children:i}):o.children.map(m=>m.kind==="dir"?S.jsx(hg,{node:m,depth:0,view:t,open:a,toggle:c},m.path):S.jsx(dg,{node:m,depth:0,view:t},m.path))})]})}function zk(){const e=G(p=>p.files),t=G(p=>p.unstaged),n=G(p=>p.staged),i=G(p=>p.filesLoading),o=G(p=>p.filesError),a=G(p=>p.targetKey),l=Q.useMemo(()=>Dn(a),[a]),c=!!l&&hr(l),f=l?.worktree?{worktree:l.worktree}:{},d=wc(a);return o?S.jsx("aside",{className:"sidebar",children:S.jsx("div",{className:"error-box",children:o})}):c?S.jsxs("aside",{className:"sidebar dual",children:[S.jsx(Mu,{title:"Unstaged",view:$n({kind:"working",...f}),files:t,empty:i?"加载中…":"没有未暂存的改动"},`${d}:unstaged`),S.jsx(Mu,{title:"Staged",view:$n({kind:"staged",...f}),files:n,empty:i?"加载中…":"暂存区为空"},`${d}:staged`)]}):S.jsx("aside",{className:"sidebar",children:S.jsx(Mu,{title:"改动",view:a,files:e,empty:i?"加载中…":"没有改动"},d)})}var Bk=ag();function Uk(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 pi(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 Cp(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Vk=(e,t)=>Math.abs(e-t)<1.01,Gk=(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 hs;const Du=()=>{if(hs!==void 0)return hs;if(typeof navigator>"u")return hs=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return hs=!0;const e=navigator.maxTouchPoints;return hs=navigator.platform==="MacIntel"&&e!==void 0&&e>0},_p=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Wk=e=>e,Hk=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},qk=(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(_p(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(_p(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return a.observe(n,{box:"border-box"}),()=>{a.unobserve(n)}},ml={passive:!0},Kk=typeof window>"u"?!0:"onscrollend"in window,Qk=(e,t,n)=>{const i=e.scrollElement;if(!i)return;const o=e.targetWindow;if(!o)return;const a=e.options.useScrollendEvent&&Kk;let l=0;const c=a?null:Gk(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,ml),a&&i.addEventListener("scrollend",p,ml),()=>{i.removeEventListener("scroll",d),a&&i.removeEventListener("scrollend",p),c?.cancel()}},Xk=(e,t)=>Qk(e,t,n=>{const{horizontal:i,isRtl:o}=e.options;return i?n.scrollLeft*(o&&-1||1):n.scrollTop}),Yk=(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"]},Jk=(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})},Zk=Jk;class ex{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:Wk,rangeExtractor:Hk,onChange:()=>{},measureElement:Yk,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 w in n){const v=n[w];v!==void 0&&(a[w]=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 w=l.count,v=a.count,k=this.getMeasurements(),E=w>0?((i=k[0])==null?void 0:i.key)??l.getItemKey(0):null,N=w>0?((o=k[w-1])==null?void 0:o.key)??l.getItemKey(w-1):null;if(v!==w||w>0&&v>0&&(a.getItemKey(0)!==E||a.getItemKey(v-1)!==N)){d=!0;const A=w>0?this.getVirtualItemForOffset(this.getScrollOffset())??k[0]:null;A&&(c=[A.key,this.getScrollOffset()-A.start]);const B=a.followOnAppend===!0?"auto":a.followOnAppend||null;B&&v>w&&this.isAtEnd(l.scrollEndThreshold)&&(w===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[w,v]=c,k=this.getMeasurements(),{count:E,getItemKey:N}=this.options;let C=0;for(;C<E&&N(C)!==w;)C++;if(C<E){const b=k[C];if(b){const A=Math.max(0,b.start+v);A!==this.scrollOffset&&(m=A-this.scrollOffset,this.scrollOffset=A,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=pi(()=>(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,!(!Du()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};a.addEventListener("touchstart",l,ml),a.addEventListener("touchend",c,ml),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&&(Du()&&(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=pi(()=>[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=pi(()=>[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 w=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 P=new Float64Array(C);b&&w>0&&P.set(b.subarray(0,w*2)),b=P,this._flatMeasurements=b}let A;if(w===0)A=i+o;else{const P=w-1;A=b[P*2]+b[P*2+1]+d}for(let P=w;P<n;P++){const M=a(P),ee=m.get(M),oe=typeof ee=="number"?ee:this.options.estimateSize(P);b[P*2]=A,b[P*2+1]=oe,A+=oe+d}const B=Uk(n,b,a);return this.measurementsCache=B,B}const v=this.measurementsCache.slice(0,w),k=new Array(c).fill(void 0),E=new Float64Array(c);let N=0;for(let C=0;C<w;C++){const b=v[C];b&&(k[b.lane]===void 0&&N++,k[b.lane]=C,E[b.lane]=b.end)}for(let C=w;C<n;C++){const b=a(C),A=this.laneAssignments.get(C);let B,P;const M=f==="estimate"||m.has(b);if(A!==void 0&&this.options.lanes>1){B=A;const F=k[B],ne=F!==void 0?v[F]:void 0;P=ne?ne.end+d:i+o}else if(N===c){let F=0,ne=E[0],re=k[0];for(let de=1;de<c;de++){const ie=E[de];(ie<ne||ie===ne&&k[de]<re)&&(F=de,ne=ie,re=k[de])}B=F,P=ne+d,M&&this.laneAssignments.set(C,B)}else B=C%this.options.lanes,P=i+o,M&&this.laneAssignments.set(C,B);const ee=m.get(b),oe=typeof ee=="number"?ee:this.options.estimateSize(C),ae=P+oe;v[C]={index:C,start:P,size:oe,end:ae,key:b,lane:B},k[B]===void 0&&N++,k[B]=C,E[B]=ae}return this.measurementsCache=v,v},{key:!1,debug:()=>this.options.debug}),this.calculateRange=pi(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,i,o,a)=>n.length===0||i===0?(this.range=null,null):(this.range=nx(n,i,o,a,a===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=pi(()=>{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 w=this.measurementsCache[n];if(!w)return;f=w.key,c=w.start,l=w.size}const p=this.itemSizeCache.get(f)??l,m=i-p;if(m!==0){const w=this.options.anchorTo==="end"&&((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,v=w?this.getTotalSize():0,k=this.getScrollOffset()+this.scrollAdjustments,N=!this.itemSizeCache.has(f)?c<k:c+p<=k&&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;w?b=this.applyScrollAdjustment(this.getTotalSize()-v):C&&(b=this.applyScrollAdjustment(m)),this.notify(b),this._retryClampedAdjustment()}},this.getVirtualItems=pi(()=>[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=pg(0,i.length-1,a?c=>o[c*2]:c=>Cp(i[c]).start,n);return Cp(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(Du()&&(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&&Vk(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 pg=(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 tx(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 nx(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=tx(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=pg(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 Fu=typeof document<"u"?Q.useLayoutEffect:Q.useEffect;function rx({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 w=p.getTotalSize();if(w!==m.lastSize){m.lastSize=w;const v=p.options.horizontal?"width":"height";m.container.style[v]=`${w}px`}},c=p=>{const m=a.current;if(!m.enabled||!m.container)return;l(p);const w=!!p.options.horizontal,v=m.mode==="transform",k=w?"left":"top",E=p.options.scrollMargin,N=p.getVirtualItems();for(const C of N){const b=C.start-E,A=p.elementsCache.get(C.key);A&&m.lastPositions.get(A)!==b&&(m.lastPositions.set(A,b),v?A.style.transform=w?`translate3d(${b}px, 0, 0)`:`translate3d(0, ${b}px, 0)`:A.style[k]=`${b}px`)}},f={...i,onChange:(p,m)=>{var w;const v=a.current;let k=!0;if(v.enabled){c(p);const E=p.range,N=v.prevRange;k=!N||N.isScrolling!==p.isScrolling||N.startIndex!==E?.startIndex||N.endIndex!==E?.endIndex,k&&(v.prevRange=E?{startIndex:E.startIndex,endIndex:E.endIndex,isScrolling:p.isScrolling}:null)}k&&(e&&m?Bk.flushSync(o):o()),(w=i.onChange)==null||w.call(i,p,m)}},[d]=Q.useState(()=>{const p=new ex(f);return Object.assign(p,{containerRef:m=>{const w=a.current;if(w.container=m,w.lastSize=null,m&&w.enabled){const v=p.getTotalSize();w.lastSize=v;const k=p.options.horizontal?"width":"height";m.style[k]=`${v}px`}}})});return d.setOptions(f),Fu(()=>d._didMount(),[]),Fu(()=>(l(d),d._willUpdate())),Fu(()=>{c(d)}),d}function ix(e){return rx({observeElementRect:qk,observeElementOffset:Xk,scrollToFn:Zk,...e})}function sx(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 Ep(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=w=>({type:"context",newLineNo:w,oldLineNo:w+f,content:n[w-1]??""}),p=[];for(let w=e.newFrom;w<e.newFrom+l;w++)p.push(d(w));const m=[];for(let w=o-c+1;w<=o;w++)m.push(d(w));return{top:p,bottom:m,hidden:a-l-c}}function ox(e){const t=[];let n=[],i=[];const o=()=>{const a=Math.max(n.length,i.length);for(let l=0;l<a;l++)t.push({left:n[l],right:i[l]});n=[],i=[]};for(const a of e)a.type==="del"?n.push(a):a.type==="add"?i.push(a):(o(),t.push({left:a,right:a}));return o(),t}function lx({diff:e,viewMode:t,expansions:n,fullLines:i}){const o=[],l=e.status!=="deleted"&&e.status!=="added"&&!e.binary?sx(e,i?i.length:null):[],c=(d,p,m)=>{if(t==="unified")for(const w of d)o.push({key:`l:${p}:${w.oldLineNo??"-"}:${w.newLineNo??"-"}`,kind:"line",line:w,hunkIndex:p,expanded:m});else for(const w of ox(d))o.push({key:`p:${p}:${w.left?.oldLineNo??"-"}:${w.right?.newLineNo??"-"}`,kind:"pair",left:w.left,right:w.right,hunkIndex:p,expanded:m})};e.hunks.forEach((d,p)=>{const m=l[p];if(m){const{top:w,bottom:v,hidden:k}=Ep(m,n[m.index],i);w.length&&c(w,p-1,!0),(k===null||k>0)&&o.push({key:`g:${m.index}`,kind:"gap",gap:m,hidden:k}),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}=Ep(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 bp(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 ax(e){const t=[];return e.forEach((n,i)=>{n.kind==="hunk"&&t.push(i)}),t}function ux(e){let t=0;for(const n of e.hunks)t+=n.lines.length;return t}const cx="modulepreload",fx=function(e){return"/"+e},Ip={},Ae=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(w=>({status:"fulfilled",value:w}),w=>({status:"rejected",reason:w}))))};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=fx(p),p in Ip)return;Ip[p]=!0;const m=p.endsWith(".css"),w=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${w}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":cx,m||(v.as="script"),v.crossOrigin="",v.href=p,f&&v.setAttribute("nonce",f),document.head.appendChild(v),m)return new Promise((k,E)=>{v.addEventListener("load",k),v.addEventListener("error",()=>E(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 mt=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function dx(e){return Xc(e)}function Xc(e){return Array.isArray(e)?hx(e):e instanceof RegExp?e:typeof e=="object"?px(e):e}function hx(e){let t=[];for(let n=0,i=e.length;n<i;n++)t[n]=Xc(e[n]);return t}function px(e){let t={};for(let n in e)t[n]=Xc(e[n]);return t}function mg(e,...t){return t.forEach(n=>{for(let i in n)e[i]=n[i]}),e}function gg(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?gg(e.substring(0,e.length-1)):e.substr(~t+1)}var $u=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Yo=class{static hasCaptures(e){return e===null?!1:($u.lastIndex=0,$u.test(e))}static replaceCaptures(e,t,n){return e.replace($u,(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 yg(e,t){return e<t?-1:e>t?1:0}function wg(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=yg(e[o],t[o]);if(a!==0)return a}return 0}return n-i}function Np(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 vg(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var kg=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}},gl=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(yx(e),t)}static createFromParsedTheme(e,t){return vx(e,t)}_cachedMatchRoot=new kg(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=>mx(e.parent,o.parentScopes));return i?new xg(i.fontStyle,i.foreground,i.background):null}},zu=class ul{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const i of n)t=new ul(t,i);return t}static from(...t){let n=null;for(let i=0;i<t.length;i++)n=new ul(n,t[i]);return n}push(t){return new ul(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 mx(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&&!gx(e.scopeName,i);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function gx(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var xg=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function yx(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 w=0,v=m.length;w<v;w++)switch(m[w]){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"&&Np(l.settings.foreground)&&(d=l.settings.foreground);let p=null;typeof l.settings.background=="string"&&Np(l.settings.background)&&(p=l.settings.background);for(let m=0,w=c.length;m<w;m++){let k=c[m].trim().split(" "),E=k[k.length-1],N=null;k.length>1&&(N=k.slice(0,k.length-1),N.reverse()),n[i++]=new wx(E,N,o,f,d,p)}}return n}var wx=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 vx(e,t){e.sort((f,d)=>{let p=yg(f.scope,d.scope);return p!==0||(p=wg(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 kx(t),l=new xg(n,a.getId(i),a.getId(o)),c=new Sx(new vc(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 gl(a,l,c)}var kx=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)}},xx=Object.freeze([]),vc=class Sg{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,i,o,a){this.scopeDepth=t,this.parentScopes=n||xx,this.fontStyle=i,this.foreground=o,this.background=a}clone(){return new Sg(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)}},Sx=class kc{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(kc._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 kc(this._mainRule.clone(),vc.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(wg(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 vc(t,n,i,o,a))}},Ci=class nn{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=nn.getLanguageId(t),i=nn.getTokenType(t),o=nn.getFontStyle(t),a=nn.getForeground(t),l=nn.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=nn.getLanguageId(t),d=nn.getTokenType(t),p=nn.containsBalancedBrackets(t)?1:0,m=nn.getFontStyle(t),w=nn.getForeground(t),v=nn.getBackground(t);return n!==0&&(f=n),i!==8&&(d=i),o!==null&&(p=o?1:0),a!==-1&&(m=a),l!==0&&(w=l),c!==0&&(v=c),(f<<0|d<<8|p<<10|m<<11|w<<15|v<<24)>>>0}};function yl(e,t){const n=[],i=Cx(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(Tp(o)){const f=[];do f.push(o),o=i.next();while(Tp(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 Tp(e){return!!e&&!!e.match(/[\w\.:]+/)}function Cx(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 Cg(e){typeof e.dispose=="function"&&e.dispose()}var bs=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},_x=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Ex=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))}},bx=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new bs(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new Ex;for(const n of e)Ix(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof bs){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 Ix(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 bs?cl({baseGrammar:a,selfGrammar:o},i):xc(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 bs(c))}function xc(e,t,n){if(t.repository&&t.repository[e]){const i=t.repository[e];wl([i],t,n)}}function cl(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?mg({},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=_g(a);switch(l.kind){case 0:cl({...t,selfGrammar:t.baseGrammar},n);break;case 1:cl(t,n);break;case 2:xc(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?xc(l.ruleName,f,n):cl(f,n)}else l.kind===4?n.add(new _x(l.scopeName,l.ruleName)):n.add(new bs(l.scopeName));break}}}var Nx=class{kind=0},Tx=class{kind=1},Ax=class{constructor(e){this.ruleName=e}kind=2},Px=class{constructor(e){this.scopeName=e}kind=3},Rx=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function _g(e){if(e==="$base")return new Nx;if(e==="$self")return new Tx;const t=e.indexOf("#");if(t===-1)return new Px(e);if(t===0)return new Ax(e.substring(1));{const n=e.substring(0,t),i=e.substring(t+1);return new Rx(n,i)}}var Lx=/\\(\d+)/,Ap=/\\(\d+)/g,jx=-1,Eg=-2;var Ls=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,i){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Yo.hasCaptures(this._name),this._contentName=i||null,this._contentNameIsCapturing=Yo.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${gg(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:Yo.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Yo.replaceCaptures(this._contentName,e,t)}},Ox=class extends Ls{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!")}},Mx=class extends Ls{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,i,o){super(e,t,n,null),this._match=new Is(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 Ns,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Pp=class extends Ls{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 Ns,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Sc=class extends Ls{_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 Is(o,this.id),this.beginCaptures=a,this._end=new Is(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 Ns;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}},vl=class extends Ls{_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 Is(o,this.id),this.beginCaptures=a,this.whileCaptures=c,this._while=new Is(l,Eg),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 Ns;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 Ns,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},bg=class bt{static createCaptureRule(t,n,i,o,a){return t.registerRule(l=>new Ox(n,l,i,o,a))}static getCompiledRuleId(t,n,i){return t.id||n.registerRule(o=>{if(t.id=o,t.match)return new Mx(t.$vscodeTextmateLocation,t.id,t.name,t.match,bt._compileCaptures(t.captures,n,i));if(typeof t.begin>"u"){t.repository&&(i=mg({},i,t.repository));let a=t.patterns;return typeof a>"u"&&t.include&&(a=[{include:t.include}]),new Pp(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,bt._compilePatterns(a,n,i))}return t.while?new vl(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,bt._compileCaptures(t.beginCaptures||t.captures,n,i),t.while,bt._compileCaptures(t.whileCaptures||t.captures,n,i),bt._compilePatterns(t.patterns,n,i)):new Sc(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,bt._compileCaptures(t.beginCaptures||t.captures,n,i),t.end,bt._compileCaptures(t.endCaptures||t.captures,n,i),t.applyEndPatternLast,bt._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=bt.getCompiledRuleId(t[l],n,i)),o[c]=bt.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=_g(c.include);switch(d.kind){case 0:case 1:f=bt.getCompiledRuleId(i[c.include],n,i);break;case 2:let p=i[d.ruleName];p&&(f=bt.getCompiledRuleId(p,n,i));break;case 3:case 4:const m=d.scopeName,w=d.kind===4?d.ruleName:null,v=n.getExternalGrammar(m,i);if(v)if(w){let k=v.repository[w];k&&(f=bt.getCompiledRuleId(k,n,v.repository))}else f=bt.getCompiledRuleId(v.repository.$self,n,v.repository);break}}else f=bt.getCompiledRuleId(c,n,i);if(f!==-1){const d=n.getRule(f);let p=!1;if((d instanceof Pp||d instanceof Sc||d instanceof vl)&&d.hasMissingPatterns&&d.patterns.length===0&&(p=!0),p)continue;o.push(f)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}}},Is=class Ig{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=Lx.test(this.source):this.hasBackReferences=!1}clone(){return new Ig(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 Ap.lastIndex=0,this.source.replace(Ap,(o,a)=>vg(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}},Ns=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 Rp(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 Rp(e,i,this._items.map(o=>o.ruleId))}},Rp=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(`
|
|
11
|
-
`)}findNextMatchSync(e,t,n){const i=this.scanner.findNextMatchSync(e,t,n);return i?{ruleId:this.rules[i.index],captureIndices:i.captureIndices}:null}},Bu=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Dx=class Cc{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Bu(t,8),this._embeddedLanguagesMatcher=new Fx(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Cc._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Bu(0,0);_getBasicScopeAttributes=new kg(t=>{const n=this._scopeToLanguage(t),i=this._toStandardTokenType(t);return new Bu(n,i)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Cc.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/},Fx=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])=>vg(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])}},Lp=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Ng(e,t,n,i,o,a,l,c){const f=t.content.length;let d=!1,p=-1;if(l){const v=$x(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 Lp(o,!0);w()}return new Lp(o,!1);function w(){const v=zx(e,t,n,i,o,p);if(!v){a.produce(o,f),d=!0;return}const k=v.captureIndices,E=v.matchedRuleId,N=k&&k.length>0?k[0].end>i:!1;if(E===jx){const C=o.getRule(e);a.produce(o,k[0].start),o=o.withContentNameScopesList(o.nameScopesList),ks(e,t,n,o,a,C.endCaptures,k),a.produce(o,k[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(E);a.produce(o,k[0].start);const b=o,A=C.getName(t.content,k),B=o.contentNameScopesList.pushAttributed(A,e);if(o=o.push(E,i,p,k[0].end===f,null,B,B),C instanceof Sc){const P=C;ks(e,t,n,o,a,P.beginCaptures,k),a.produce(o,k[0].end),p=k[0].end;const M=P.getContentName(t.content,k),ee=B.pushAttributed(M,e);if(o=o.withContentNameScopesList(ee),P.endHasBackReferences&&(o=o.withEndRule(P.getEndWithResolvedBackReferences(t.content,k))),!N&&b.hasSameRuleAs(o)){o=o.pop(),a.produce(o,f),d=!0;return}}else if(C instanceof vl){const P=C;ks(e,t,n,o,a,P.beginCaptures,k),a.produce(o,k[0].end),p=k[0].end;const M=P.getContentName(t.content,k),ee=B.pushAttributed(M,e);if(o=o.withContentNameScopesList(ee),P.whileHasBackReferences&&(o=o.withEndRule(P.getWhileWithResolvedBackReferences(t.content,k))),!N&&b.hasSameRuleAs(o)){o=o.pop(),a.produce(o,f),d=!0;return}}else if(ks(e,t,n,o,a,C.captures,k),a.produce(o,k[0].end),o=o.pop(),!N){o=o.safePop(),a.produce(o,f),d=!0;return}}k[0].end>i&&(i=k[0].end,n=!1)}}function $x(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 vl&&c.push({rule:d,stack:f})}for(let f=c.pop();f;f=c.pop()){const{ruleScanner:d,findOptions:p}=Vx(f.rule,e,f.stack.endRule,n,i===l),m=d.findNextMatchSync(t,i,p);if(m){if(m.ruleId!==Eg){o=f.stack.pop();break}m.captureIndices&&m.captureIndices.length&&(a.produce(f.stack,m.captureIndices[0].start),ks(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 zx(e,t,n,i,o,a){const l=Bx(e,t,n,i,o,a),c=e.getInjections();if(c.length===0)return l;const f=Ux(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 Bx(e,t,n,i,o,a){const l=o.getRule(e),{ruleScanner:c,findOptions:f}=Tg(l,e,o.endRule,n,i===a),d=c.findNextMatchSync(t,i,f);return d?{captureIndices:d.captureIndices,matchedRuleId:d.ruleId}:null}function Ux(e,t,n,i,o,a,l){let c=Number.MAX_VALUE,f=null,d,p=0;const m=a.contentNameScopesList.getScopeNames();for(let w=0,v=e.length;w<v;w++){const k=e[w];if(!k.matcher(m))continue;const E=t.getRule(k.ruleId),{ruleScanner:N,findOptions:C}=Tg(E,t,null,i,o===l),b=N.findNextMatchSync(n,o,C);if(!b)continue;const A=b.captureIndices[0].start;if(!(A>=c)&&(c=A,f=b.captureIndices,d=b.ruleId,p=k.priority,c===o))break}return f?{priorityMatch:p===-1,captureIndices:f,matchedRuleId:d}:null}function Tg(e,t,n,i,o){return{ruleScanner:e.compileAG(t,n,i,o),findOptions:0}}function Vx(e,t,n,i,o){return{ruleScanner:e.compileWhileAG(t,n,i,o),findOptions:0}}function ks(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 w=a[m];if(w===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),w.retokenizeCapturedWithRuleId){const E=w.getName(c,l),N=i.contentNameScopesList.pushAttributed(E,e),C=w.getContentName(c,l),b=N.pushAttributed(C,e),A=i.push(w.retokenizeCapturedWithRuleId,v.start,-1,!1,null,N,b),B=e.createOnigString(c.substring(0,v.end));Ng(e,B,n&&v.start===0,v.start,A,o,!1,0),Cg(B);continue}const k=w.getName(c,l);if(k!==null){const N=(d.length>0?d[d.length-1].scopes:i.contentNameScopesList).pushAttributed(k,e);d.push(new Gx(N,v.end))}}for(;d.length>0;)o.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop()}var Gx=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Wx(e,t,n,i,o,a,l,c){return new qx(e,t,n,i,o,a,l,c)}function jp(e,t,n,i,o){const a=yl(t,kl),l=bg.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 kl(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(Hx(t[o],i))return n=o+1,!0;return!1})}function Hx(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 qx=class{constructor(e,t,n,i,o,a,l,c){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=c,this._basicScopeAttributesProvider=new Dx(n,i),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=l,this._grammar=Op(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const f of Object.keys(o)){const d=yl(f,kl);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)jp(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&&jp(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]=Op(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=bg.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!t||t===_c.NULL){o=!0;const d=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),m=Ci.set(0,d.languageId,d.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),w=this.getRule(this._rootId).getName(null,null);let v;w?v=xs.createRootAndLookUpScopeName(w,m,this):v=xs.createRoot("unknown",m),t=new _c(null,this._rootId,-1,-1,!1,null,v,v)}else o=!1,t.reset();e=e+`
|
|
12
|
-
`;const a=this.createOnigString(e),l=a.content.length,c=new Qx(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),f=Ng(this,a,o,0,t,c,!0,i);return Cg(a),{lineLength:l,lineTokens:c,ruleStack:f.stack,stoppedEarly:f.stoppedEarly}}};function Op(e,t){return e=dx(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 xs=class Cn{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=zu.push(o,a.scopeNames),i=new Cn(i,o,a.encodedTokenAttributes);return i}static createRoot(t,n){return new Cn(null,new zu(null,t),n)}static createRootAndLookUpScopeName(t,n,i){const o=i.getMetadataForScope(t),a=new zu(null,t),l=i.themeProvider.themeMatch(a),c=Cn.mergeAttributes(n,o,l);return new Cn(null,a,c)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Cn.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),Ci.set(t,n.languageId,n.tokenType,null,o,a,l)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return Cn._pushAttributed(this,t,n);const i=t.split(/ /g);let o=this;for(const a of i)o=Cn._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=Cn.mergeAttributes(t.tokenAttributes,o,l);return new Cn(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}},_c=class Lr{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 Lr(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:Lr._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?xs.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(){Lr._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,i,o,a,l,c){return new Lr(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 Lr(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=xs.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new Lr(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,i,xs.fromExtension(i,n.contentNameScopesList))}},Kx=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):yl(n,kl).map(i=>i.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>yl(n,kl).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}},Qx=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=Ci.set(i,0,l.type,null,-1,0,0));this.balancedBracketSelectors&&(o=this.balancedBracketSelectors.match(a))}if(o&&(i=Ci.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}},Xx=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,Wx(e,a,t,n,i,o,this,this._onigLib))}return this._grammars.get(e)}},Yx=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new Xx(gl.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(gl.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 Kx(i.balancedBracketSelectors||[],i.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,i,o,a){const l=new bx(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)}},Ec=_c.NULL;const Jx=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class js{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}js.prototype.normal={};js.prototype.property={};js.prototype.space=void 0;function Ag(e,t){const n={},i={};for(const o of e)Object.assign(n,o.property),Object.assign(i,o.normal);return new js(n,i,t)}function bc(e){return e.toLowerCase()}class zt{constructor(t,n){this.attribute=n,this.property=t}}zt.prototype.attribute="";zt.prototype.booleanish=!1;zt.prototype.boolean=!1;zt.prototype.commaOrSpaceSeparated=!1;zt.prototype.commaSeparated=!1;zt.prototype.defined=!1;zt.prototype.mustUseProperty=!1;zt.prototype.number=!1;zt.prototype.overloadedBoolean=!1;zt.prototype.property="";zt.prototype.spaceSeparated=!1;zt.prototype.space=void 0;let Zx=0;const be=Br(),lt=Br(),Ic=Br(),Z=Br(),Ve=Br(),Fr=Br(),Ht=Br();function Br(){return 2**++Zx}const Nc=Object.freeze(Object.defineProperty({__proto__:null,boolean:be,booleanish:lt,commaOrSpaceSeparated:Ht,commaSeparated:Fr,number:Z,overloadedBoolean:Ic,spaceSeparated:Ve},Symbol.toStringTag,{value:"Module"})),Uu=Object.keys(Nc);class Yc extends zt{constructor(t,n,i,o){let a=-1;if(super(t,n),Mp(this,"space",o),typeof i=="number")for(;++a<Uu.length;){const l=Uu[a];Mp(this,Uu[a],(i&Nc[l])===Nc[l])}}}Yc.prototype.defined=!0;function Mp(e,t,n){n&&(e[t]=n)}function Ei(e){const t={},n={};for(const[i,o]of Object.entries(e.properties)){const a=new Yc(i,e.transform(e.attributes||{},i),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(a.mustUseProperty=!0),t[i]=a,n[bc(i)]=i,n[bc(a.attribute)]=i}return new js(t,n,e.space)}const Pg=Ei({properties:{ariaActiveDescendant:null,ariaAtomic:lt,ariaAutoComplete:null,ariaBusy:lt,ariaChecked:lt,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:Ve,ariaCurrent:null,ariaDescribedBy:Ve,ariaDetails:null,ariaDisabled:lt,ariaDropEffect:Ve,ariaErrorMessage:null,ariaExpanded:lt,ariaFlowTo:Ve,ariaGrabbed:lt,ariaHasPopup:null,ariaHidden:lt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ve,ariaLevel:Z,ariaLive:null,ariaModal:lt,ariaMultiLine:lt,ariaMultiSelectable:lt,ariaOrientation:null,ariaOwns:Ve,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:lt,ariaReadOnly:lt,ariaRelevant:null,ariaRequired:lt,ariaRoleDescription:Ve,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:lt,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Rg(e,t){return t in e?e[t]:t}function Lg(e,t){return Rg(e,t.toLowerCase())}const e0=Ei({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Fr,acceptCharset:Ve,accessKey:Ve,action:null,allow:null,allowFullScreen:be,allowPaymentRequest:be,allowUserMedia:be,alpha:be,alt:null,as:null,async:be,autoCapitalize:null,autoComplete:Ve,autoFocus:be,autoPlay:be,blocking:Ve,capture:null,charSet:null,checked:be,cite:null,className:Ve,closedBy:null,colorSpace:null,cols:Z,colSpan:Z,command:null,commandFor:null,content:null,contentEditable:lt,controls:be,controlsList:Ve,coords:Z|Fr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:be,defer:be,dir:null,dirName:null,disabled:be,download:Ic,draggable:lt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:be,formTarget:null,headers:Ve,height:Z,hidden:Ic,high:Z,href:null,hrefLang:null,htmlFor:Ve,httpEquiv:Ve,id:null,imageSizes:null,imageSrcSet:null,inert:be,inputMode:null,integrity:null,is:null,isMap:be,itemId:null,itemProp:Ve,itemRef:Ve,itemScope:be,itemType:Ve,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:be,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:be,muted:be,name:null,nonce:null,noModule:be,noValidate:be,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:be,optimum:Z,pattern:null,ping:Ve,placeholder:null,playsInline:be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:be,referrerPolicy:null,rel:Ve,required:be,reversed:be,rows:Z,rowSpan:Z,sandbox:Ve,scope:null,scoped:be,seamless:be,selected:be,shadowRootClonable:be,shadowRootCustomElementRegistry:be,shadowRootDelegatesFocus:be,shadowRootMode:null,shadowRootSerializable:be,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:lt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:be,useMap:null,value:lt,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ve,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:be,declare:be,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:be,noHref:be,noShade:be,noWrap:be,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:lt,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:be,disablePictureInPicture:be,disableRemotePlayback:be,exportParts:Fr,part:Ve,prefix:null,property:null,results:Z,security:null,unselectable:null},space:"html",transform:Lg}),t0=Ei({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:Ht,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:Ve,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:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:be,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,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:Fr,g2:Fr,glyphName:Fr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:Ht,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,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:Z,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:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ve,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ht,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ht,rev:Ht,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ht,requiredFeatures:Ht,requiredFonts:Ht,requiredFormats:Ht,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:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:Ht,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ht,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ht,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Rg}),jg=Ei({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()}}),Og=Ei({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Lg}),Mg=Ei({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),n0={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"},r0=/[A-Z]/g,Dp=/-[a-z]/g,i0=/^data[-\w.:]+$/i;function Dg(e,t){const n=bc(t);let i=t,o=zt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&i0.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Dp,o0);i="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Dp.test(a)){let l=a.replace(r0,s0);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=Yc}return new o(i,t)}function s0(e){return"-"+e.toLowerCase()}function o0(e){return e.charAt(1).toUpperCase()}const Fg=Ag([Pg,e0,jg,Og,Mg],"html"),Os=Ag([Pg,t0,jg,Og,Mg],"svg"),Fp={}.hasOwnProperty;function l0(e,t){const n=t||{};function i(o,...a){let l=i.invalid;const c=i.handlers;if(o&&Fp.call(o,e)){const f=String(o[e]);l=Fp.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 a0=/["&'<>`]/g,u0=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c0=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,f0=/[|\\{}()[\]^$+*?.]/g,$p=new WeakMap;function d0(e,t){if(e=e.replace(t.subset?h0(t.subset):a0,i),t.subset||t.escapeOnly)return e;return e.replace(u0,n).replace(c0,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 h0(e){let t=$p.get(e);return t||(t=p0(e),$p.set(e,t)),t}function p0(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(f0,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const m0=/[\dA-Fa-f]/;function g0(e,t,n){const i="&#x"+e.toString(16).toUpperCase();return n&&t&&!m0.test(String.fromCharCode(t))?i:i+";"}const y0=/\d/;function w0(e,t,n){const i="&#"+String(e);return n&&t&&!y0.test(String.fromCharCode(t))?i:i+";"}const v0=["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"],Vu={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:"€"},k0=["cent","copy","divide","gt","lt","not","para","times"],$g={}.hasOwnProperty,Tc={};let Jo;for(Jo in Vu)$g.call(Vu,Jo)&&(Tc[Vu[Jo]]=Jo);const x0=/[^\dA-Za-z]/;function S0(e,t,n,i){const o=String.fromCharCode(e);if($g.call(Tc,o)){const a=Tc[o],l="&"+a;return n&&v0.includes(a)&&!k0.includes(a)&&(!i||t&&t!==61&&x0.test(String.fromCharCode(t)))?l:l+";"}return""}function C0(e,t,n){let i=g0(e,t,n.omitOptionalSemicolons),o;if((n.useNamedReferences||n.useShortestReferences)&&(o=S0(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!o)&&n.useShortestReferences){const a=w0(e,t,n.omitOptionalSemicolons);a.length<i.length&&(i=a)}return o&&(!n.useShortestReferences||o.length<i.length)?o:i}function Si(e,t){return d0(e,Object.assign({format:C0},t))}const _0=/^>|^->|<!--|-->|--!>|<!-$/g,E0=[">"],b0=["<",">"];function I0(e,t,n,i){return i.settings.bogusComments?"<?"+Si(e.value,Object.assign({},i.settings.characterReferences,{subset:E0}))+">":"<!--"+e.value.replace(_0,o)+"-->";function o(a){return Si(a,Object.assign({},i.settings.characterReferences,{subset:b0}))}}function N0(e,t,n,i){return"<!"+(i.settings.upperDoctype?"DOCTYPE":"doctype")+(i.settings.tightDoctype?"":" ")+"html>"}function xl(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 zg(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Bg(e){return e.join(" ").trim()}const T0=/[ \t\n\f\r]/g;function Rl(e){return typeof e=="object"?e.type==="text"?zp(e.value):!1:zp(e)}function zp(e){return e.replace(T0,"")===""}const ft=Vg(1),Ug=Vg(-1),A0=[];function Vg(e){return t;function t(n,i,o){const a=n?n.children:A0;let l=(i||0)+e,c=a[l];if(!o)for(;c&&Rl(c);)l+=e,c=a[l];return c}}const P0={}.hasOwnProperty;function Gg(e){return t;function t(n,i,o){return P0.call(e,n.tagName)&&e[n.tagName](n,i,o)}}const Jc=Gg({body:L0,caption:Gu,colgroup:Gu,dd:D0,dt:M0,head:Gu,html:R0,li:O0,optgroup:F0,option:$0,p:j0,rp:Bp,rt:Bp,tbody:B0,td:Up,tfoot:U0,th:Up,thead:z0,tr:V0});function Gu(e,t,n){const i=ft(n,t,!0);return!i||i.type!=="comment"&&!(i.type==="text"&&Rl(i.value.charAt(0)))}function R0(e,t,n){const i=ft(n,t);return!i||i.type!=="comment"}function L0(e,t,n){const i=ft(n,t);return!i||i.type!=="comment"}function j0(e,t,n){const i=ft(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 O0(e,t,n){const i=ft(n,t);return!i||i.type==="element"&&i.tagName==="li"}function M0(e,t,n){const i=ft(n,t);return!!(i&&i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd"))}function D0(e,t,n){const i=ft(n,t);return!i||i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd")}function Bp(e,t,n){const i=ft(n,t);return!i||i.type==="element"&&(i.tagName==="rp"||i.tagName==="rt")}function F0(e,t,n){const i=ft(n,t);return!i||i.type==="element"&&i.tagName==="optgroup"}function $0(e,t,n){const i=ft(n,t);return!i||i.type==="element"&&(i.tagName==="option"||i.tagName==="optgroup")}function z0(e,t,n){const i=ft(n,t);return!!(i&&i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot"))}function B0(e,t,n){const i=ft(n,t);return!i||i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot")}function U0(e,t,n){return!ft(n,t)}function V0(e,t,n){const i=ft(n,t);return!i||i.type==="element"&&i.tagName==="tr"}function Up(e,t,n){const i=ft(n,t);return!i||i.type==="element"&&(i.tagName==="td"||i.tagName==="th")}const G0=Gg({body:q0,colgroup:K0,head:H0,html:W0,tbody:Q0});function W0(e){const t=ft(e,-1);return!t||t.type!=="comment"}function H0(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 q0(e){const t=ft(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Rl(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function K0(e,t,n){const i=Ug(n,t),o=ft(e,-1,!0);return n&&i&&i.type==="element"&&i.tagName==="colgroup"&&Jc(i,n.children.indexOf(i),n)?!1:!!(o&&o.type==="element"&&o.tagName==="col")}function Q0(e,t,n){const i=Ug(n,t),o=ft(e,-1);return n&&i&&i.type==="element"&&(i.tagName==="thead"||i.tagName==="tbody")&&Jc(i,n.children.indexOf(i),n)?!1:!!(o&&o.type==="element"&&o.tagName==="tr")}const Zo={name:[[`
|
|
13
|
-
\f\r &/=>`.split(""),`
|
|
14
|
-
\f\r "&'/=>\``.split("")],[`\0
|
|
15
|
-
\f\r "&'/<=>`.split(""),`\0
|
|
16
|
-
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
17
|
-
\f\r &>`.split(""),`\0
|
|
18
|
-
\f\r "&'<=>\``.split("")],[`\0
|
|
19
|
-
\f\r "&'<=>\``.split(""),`\0
|
|
20
|
-
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function X0(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=Os);const d=Y0(i,e.properties),p=i.all(o.space==="html"&&e.tagName==="template"?e.content:e);return i.schema=o,p&&(l=!1),(d||!a||!G0(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||!Jc(e,t,n))&&c.push("</"+e.tagName+">"),c.join("")}function Y0(e,t){const n=[];let i=-1,o;if(t){for(o in t)if(t[o]!==null&&t[o]!==void 0){const a=J0(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 J0(e,t,n){const i=Dg(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=Si(i.attribute,Object.assign({},e.settings.characterReferences,{subset:Zo.name[o][a]}));return n===!0||(n=Array.isArray(n)?(i.commaSeparated?zg:Bg)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?f:(e.settings.preferUnquoted&&(c=Si(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Zo.unquoted[o][a]}))),c!==n&&(e.settings.quoteSmart&&xl(n,l)>xl(n,e.alternative)&&(l=e.alternative),c=l+Si(n,Object.assign({},e.settings.characterReferences,{subset:(l==="'"?Zo.single:Zo.double)[o][a],attribute:!0}))+l),f+(c&&"="+c))}const Z0=["<","&"];function Wg(e,t,n,i){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Si(e.value,Object.assign({},i.settings.characterReferences,{subset:Z0}))}function e1(e,t,n,i){return i.settings.allowDangerousHtml?e.value:Wg(e,t,n,i)}function t1(e,t,n,i){return i.all(e)}const n1=l0("type",{invalid:r1,unknown:i1,handlers:{comment:I0,doctype:N0,element:X0,raw:e1,root:t1,text:Wg}});function r1(e){throw new Error("Expected node, not `"+e+"`")}function i1(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const s1={},o1={},l1=[];function a1(e,t){const n=t||s1,i=n.quote||'"',o=i==='"'?"'":'"';if(i!=='"'&&i!=="'")throw new Error("Invalid quote `"+i+"`, expected `'` or `\"`");return{one:u1,all:c1,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||Jx,characterReferences:n.characterReferences||o1,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Os:Fg,quote:i,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function u1(e,t,n){return n1(e,t,n,this)}function c1(e){const t=[],n=e&&e.children||l1;let i=-1;for(;++i<n.length;)t[i]=this.one(n[i],i,e);return t.join("")}function Sl(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 pr(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function f1(e){return Array.isArray(e)?e:[e]}async function Hg(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Zc(e){return!e||["plaintext","txt","text","plain"].includes(e)}function d1(e){return e==="ansi"||Zc(e)}function ef(e){return e==="none"}function h1(e){return ef(e)}function qg(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 Ll(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 p1(e){const t=Ll(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 tf="light-dark()",m1=["color","background-color"];function g1(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 y1(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?g1(o,a):o})):e}function w1(e,t,n,i,o="css-vars"){const a={content:e.content,explanation:e.explanation,offset:e.offset},l=t.map(p=>Cl(e.variants[p])),c=new Set(l.flatMap(p=>Object.keys(p))),f={},d=(p,m)=>{const w=m==="color"?"":m==="background-color"?"-bg":`-${m}`;return n+t[p]+(m==="color"?"":w)};return l.forEach((p,m)=>{for(const w of c){const v=p[w]||"inherit";if(m===0&&i&&m1.includes(w))if(i===tf&&l.length>1){const k=t.findIndex(b=>b==="light"),E=t.findIndex(b=>b==="dark");if(k===-1||E===-1)throw new mt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const N=l[k][w]||"inherit",C=l[E][w]||"inherit";f[w]=`light-dark(${N}, ${C})`,o==="css-vars"&&(f[d(m,w)]=v)}else f[w]=v;else o==="css-vars"&&(f[d(m,w)]=v)}}),a.htmlStyle=f,a}function Cl(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 Ac(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const Kg=new WeakMap;function jl(e,t){Kg.set(e,t)}function Ts(e){return Kg.get(e)}class bi{_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 bi(Object.fromEntries(f1(n).map(i=>[i,Ec])),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 v1(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function v1(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 k1(e,t){if(!(e instanceof bi))throw new mt("Invalid grammar state");return e.getInternalStack(t)}function x1(){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 mt(`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 mt(`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 mt(`Invalid decoration position ${JSON.stringify(l)}. Line ${l.line} length: ${c.length}`);return{...l,character:f,offset:o.posToIndex(l.line,f)}}};const o=p1(n.source),a=(n.options.decorations||[]).map(l=>({...l,start:i(l.start),end:i(l.end)}));S1(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 y1(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 mt(`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,w,v){const k=o[p];let E="",N=-1,C=-1;if(m===0&&(N=0),w===0&&(C=0),w===Number.POSITIVE_INFINITY&&(C=k.children.length),N===-1||C===-1)for(let A=0;A<k.children.length;A++)E+=Qg(k.children[A]),N===-1&&E.length===m&&(N=A+1),C===-1&&E.length===w&&(C=A+1);if(N===-1)throw new mt(`Failed to find start index for decoration ${JSON.stringify(v.start)}`);if(C===-1)throw new mt(`Failed to find end index for decoration ${JSON.stringify(v.end)}`);const b=k.children.slice(N,C);if(!v.alwaysWrap&&b.length===k.children.length)c(k,v,"line");else if(!v.alwaysWrap&&b.length===1&&b[0].type==="element")c(b[0],v,"token");else{const A={type:"element",tagName:"span",properties:{},children:b};c(A,v,"wrapper"),k.children.splice(N,b.length,A)}}function l(p,m){o[p]=c(o[p],m,"line")}function c(p,m,w){const v=m.properties||{},k=m.transform||(E=>E);return p.tagName=m.tagName||"span",p.properties={...p.properties,...v,class:p.properties.class},m.properties?.class&&qg(p,m.properties.class),p=k(p,w)||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:w}=p;if(m.line===w.line)a(m.line,m.character,w.character,p);else if(m.line<w.line){a(m.line,m.character,Number.POSITIVE_INFINITY,p);for(let v=m.line+1;v<w.line;v++)f.unshift(()=>l(v,p));a(w.line,0,w.character,p)}}f.forEach(p=>p())}}}function S1(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new mt(`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 mt(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function Qg(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(Qg).join(""):""}const C1=[x1()];function _l(e){const t=_1(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...C1]}function _1(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 Mr=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Wu={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function E1(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 Vp(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 b1(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)Wu[i]&&t.push({type:"setDecoration",value:Wu[i]});else if(i<=29){const o=Wu[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:Mr[i-30]}});else if(i===38){const o=Vp(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:Mr[i-40]}});else if(i===48){const o=Vp(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:Mr[i-90+8]}}):i>=100&&i<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Mr[i-100+8]}})}return t}function I1(){let e=null,t=null,n=new Set;return{parse(i){const o=[];let a=0;do{const l=E1(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=b1(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 N1={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 T1(e=N1){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<Mr.length;d++)i.push(t(Mr[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 A1={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 P1(e,t,n){const i=Sl(e,n),o=Ll(t),a=Object.fromEntries(Mr.map(f=>{const d=`terminal.ansi${f[0].toUpperCase()}${f.substring(1)}`,p=e.colors?.[d];return[f,p||A1[f]]})),l=T1(a),c=I1();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=pr(p,i),m=pr(m,i),d.decorations.has("dim")&&(p=R1(p));let w=It.None;return d.decorations.has("bold")&&(w|=It.Bold),d.decorations.has("italic")&&(w|=It.Italic),d.decorations.has("underline")&&(w|=It.Underline),d.decorations.has("strikethrough")&&(w|=It.Strikethrough),{content:d.value,offset:f[1],color:p,bgColor:m,fontStyle:w}}))}function R1(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 nf(e,t,n={}){const{theme:i=e.getLoadedThemes()[0]}=n,o=e.resolveLangAlias(n.lang||"text");if(Zc(o)||ef(i))return Ll(t).map(f=>[{content:f[0],offset:f[1]}]);const{theme:a,colorMap:l}=e.setTheme(i);if(o==="ansi")return P1(a,t,n);const c=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==c.name)throw new mt(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${c.name}"`);if(!n.grammarState.themes.includes(a.name))throw new mt(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return j1(t,c,a,l,n)}function L1(...e){if(e.length===2)return Ts(e[1]);const[t,n,i={}]=e,{lang:o="text",theme:a=t.getLoadedThemes()[0]}=i;if(Zc(o)||ef(a))throw new mt("Plain language does not have grammar state");if(o==="ansi")throw new mt("ANSI language does not have grammar state");const{theme:l,colorMap:c}=t.setTheme(a),f=t.getLanguage(o);return new bi(rf(n,f,l,c,i).stateStack,f.name,l.name)}function j1(e,t,n,i,o){const a=rf(e,t,n,i,o),l=new bi(a.stateStack,t.name,n.name);return jl(a.tokens,l),a.tokens}function rf(e,t,n,i,o){const a=Sl(n,o),{tokenizeMaxLineLength:l=0,tokenizeTimeLimit:c=500}=o,f=Ll(e);let d=o.grammarState?k1(o.grammarState,n.name)??Ec:o.grammarContextCode!=null?rf(o.grammarContextCode,t,n,i,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:Ec,p=[];const m=[];for(let w=0,v=f.length;w<v;w++){const[k,E]=f[w];if(k===""){p=[],m.push([]);continue}if(l>0&&k.length>=l){p=[],m.push([{content:k,offset:E,color:"",fontStyle:0}]);continue}let N,C,b;o.includeExplanation&&(N=t.tokenizeLine(k,d,c),C=N.tokens,b=0);const A=t.tokenizeLine2(k,d,c),B=A.tokens.length/2;for(let P=0;P<B;P++){const M=A.tokens[2*P],ee=P+1<B?A.tokens[2*P+2]:k.length;if(M===ee)continue;const oe=A.tokens[2*P+1],ae=pr(i[Ci.getForeground(oe)],a),F=Ci.getFontStyle(oe),ne={content:k.substring(M,ee),offset:E+M,color:ae,fontStyle:F};if(o.includeExplanation){const re=[];if(o.includeExplanation!=="scopeName")for(const ie of n.settings){let X;switch(typeof ie.scope){case"string":X=ie.scope.split(/,/).map(ge=>ge.trim());break;case"object":X=ie.scope;break;default:continue}re.push({settings:ie,selectors:X.map(ge=>ge.split(/ /))})}ne.explanation=[];let de=0;for(;M+de<ee;){const ie=C[b],X=k.substring(ie.startIndex,ie.endIndex);de+=X.length,ne.explanation.push({content:X,scopes:o.includeExplanation==="scopeName"?O1(ie.scopes):M1(re,ie.scopes)}),b+=1}}p.push(ne)}m.push(p),p=[],d=A.ruleStack}return{tokens:m,stateStack:d}}function O1(e){return e.map(t=>({scopeName:t}))}function M1(e,t){const n=[];for(let i=0,o=t.length;i<o;i++){const a=t[i];n[i]={scopeName:a,themeMatches:F1(e,a,t.slice(0,i))}}return n}function Gp(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function D1(e,t,n){if(!Gp(e[e.length-1],t))return!1;let i=e.length-2,o=n.length-1;for(;i>=0&&o>=0;)Gp(e[i],n[o])&&(i-=1),o-=1;return i===-1}function F1(e,t,n){const i=[];for(const{selectors:o,settings:a}of e)for(const l of o)if(D1(l,t,n)){i.push(a);break}return i}function Xg(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=nf(e,t,{...n,theme:f.theme}),p=Ts(d),m=typeof f.theme=="string"?f.theme:f.theme.name;return{tokens:d,state:p,theme:m}}),a=$1(...o.map(f=>f.tokens)),l=a[0].map((f,d)=>f.map((p,m)=>{const w={content:p.content,variants:{},offset:p.offset};return"includeExplanation"in n&&n.includeExplanation&&(w.explanation=p.explanation),a.forEach((v,k)=>{const{content:E,explanation:N,offset:C,...b}=v[d][m];w.variants[i[k].color]=b}),w})),c=o[0].state?new bi(Object.fromEntries(o.map(f=>[f.theme,f.state?.getInternalStack(f.theme)])),o[0].state.lang):void 0;return c&&jl(l,c),l}function $1(...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 El(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,w=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(w.length===0)throw new mt("`themes` option must not be empty");const v=Xg(e,t,n);if(f=Ts(v),d&&tf!==d&&!w.find(C=>C.color===d))throw new mt(`\`themes\` option must contain the defaultColor key \`${d}\``);const k=w.map(C=>e.getTheme(C.theme)),E=w.map(C=>C.color);a=v.map(C=>C.map(b=>w1(b,E,p,d,m))),f&&jl(a,f);const N=w.map(C=>Sl(C.theme,n));o=Wp(w,k,N,p,d,"fg",m),i=Wp(w,k,N,p,d,"bg",m),l=`shiki-themes ${k.map(C=>C.name).join(" ")}`,c=d?void 0:[o,i].join(";")}else if("theme"in n){const d=Sl(n.theme,n);a=nf(e,t,n);const p=e.getTheme(n.theme);i=pr(p.bg,d),o=pr(p.fg,d),l=p.name,f=Ts(a)}else throw new mt("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:o,bg:i,themeName:l,rootStyle:c,grammarState:f}}function Wp(e,t,n,i,o,a,l){return e.map((c,f)=>{const d=pr(t[f][a],n[f])||"inherit",p=`${i+c.color}${a==="bg"?"-bg":""}:${d}`;if(f===0&&o){if(o===tf&&e.length>1){const m=e.findIndex(E=>E.color==="light"),w=e.findIndex(E=>E.color==="dark");if(m===-1||w===-1)throw new mt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const v=pr(t[m][a],n[m])||"inherit",k=pr(t[w][a],n[w])||"inherit";return`light-dark(${v}, ${k});${p}`}return d}return l==="css-vars"?p:null}).filter(c=>!!c).join(";")}function bl(e,t,n,i={meta:{},options:n,codeToHast:(o,a)=>bl(e,o,a),codeToTokens:(o,a)=>El(e,o,a)}){let o=t;for(const k of _l(n))o=k.preprocess?.call(i,o,n)||o;let{tokens:a,fg:l,bg:c,themeName:f,rootStyle:d,grammarState:p}=El(e,o,n);const{mergeWhitespaces:m=!0,mergeSameStyleTokens:w=!1}=n;m===!0?a=B1(a):m==="never"&&(a=U1(a)),w&&(a=V1(a));const v={...i,get source(){return o}};for(const k of _l(n))a=k.tokens?.call(v,a)||a;return z1(a,{...n,fg:l,bg:c,themeName:f,rootStyle:n.rootStyle===!1?!1:n.rootStyle??d},v,p)}function z1(e,t,n,i=Ts(e)){const o=_l(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[E,N]of Object.entries(t.meta||{}))E.startsWith("_")||(d[E]=N);let p={type:"element",tagName:"pre",properties:d,children:[],data:t.data},m={type:"element",tagName:"code",properties:{},children:a};const w=[],v={...n,structure:c,addClassToHast:qg,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 w}};if(e.forEach((E,N)=>{N&&(c==="inline"?l.children.push({type:"element",tagName:"br",properties:{},children:[]}):c==="classic"&&a.push({type:"text",value:`
|
|
21
|
-
`}));let C={type:"element",tagName:"span",properties:{class:"line"},children:[]},b=0;for(const A of E){let B={type:"element",tagName:"span",properties:{...A.htmlAttrs},children:[{type:"text",value:A.content}]};const P=Ac(A.htmlStyle||Cl(A));P&&(B.properties.style=P);for(const M of o)B=M?.span?.call(v,B,N+1,b,C,A)||B;c==="inline"?l.children.push(B):c==="classic"&&C.children.push(B),b+=A.content.length}if(c==="classic"){for(const A of o)C=A?.line?.call(v,C,N+1)||C;w.push(C),a.push(C)}else c==="inline"&&w.push(C)}),c==="classic"){for(const E of o)m=E?.code?.call(v,m)||m;p.children.push(m);for(const E of o)p=E?.pre?.call(v,p)||p;l.children.push(p)}else if(c==="inline"){const E=[];let N={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const A of l.children)A.type==="element"&&A.tagName==="br"?(E.push(N),N={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(A.type==="element"||A.type==="text")&&N.children.push(A);E.push(N);let b={type:"element",tagName:"code",properties:{},children:E};for(const A of o)b=A?.code?.call(v,b)||b;l.children=[];for(let A=0;A<b.children.length;A++){A>0&&l.children.push({type:"element",tagName:"br",properties:{},children:[]});const B=b.children[A];B.type==="element"&&l.children.push(...B.children)}}let k=l;for(const E of o)k=E?.root?.call(v,k)||k;return i&&jl(k,i),k}function B1(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 U1(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 V1(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=Ac(o.htmlStyle||Cl(o)),l=Ac(i.htmlStyle||Cl(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 G1=a1;function W1(e,t,n){const i={meta:{},options:n,codeToHast:(a,l)=>bl(e,a,l),codeToTokens:(a,l)=>El(e,a,l)};let o=G1(bl(e,t,n,i));for(const a of _l(n))o=a.postprocess?.call(i,o,n)||o;return o}const Hp={light:"#333333",dark:"#bbbbbb"},qp={light:"#fffffe",dark:"#1e1e1e"},Kp="__shiki_resolved";function sf(e){if(e?.[Kp])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"?Hp.light:Hp.dark),n||(n=t.type==="light"?qp.light:qp.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,Kp,{enumerable:!1,writable:!1,value:!0}),t}async function Yg(e){return Array.from(new Set((await Promise.all(e.filter(t=>!d1(t)).map(async t=>await Hg(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function Jg(e){return(await Promise.all(e.map(async n=>h1(n)?null:sf(await Hg(n))))).filter(n=>!!n)}let H1=3;function q1(e,t=3){t>H1||console.trace(`[SHIKI DEPRECATE]: ${e}`)}class xi extends Error{constructor(t){super(t),this.name="ShikiError"}}function Zg(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 xi(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class K1 extends Yx{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=sf(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=gl.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){return t=Zg(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 xi(`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 Q1{_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 ps=0;function X1(e){ps+=1,e.warnings!==!1&&ps>=10&&ps%10===0&&console.warn(`[Shiki] ${ps} 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 xi("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),i=(e.themes||[]).flat(1).map(sf),o=new Q1(e.engine,n),a=new K1(o,i,n,e.langAlias);let l;function c(A){return Zg(A,e.langAlias)}function f(A){C();const B=a.getGrammar(typeof A=="string"?A:A.name);if(!B)throw new xi(`Language \`${A}\` not found, you may need to load it first`);return B}function d(A){if(A==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};C();const B=a.getTheme(A);if(!B)throw new xi(`Theme \`${A}\` not found, you may need to load it first`);return B}function p(A){C();const B=d(A);l!==A&&(a.setTheme(B),l=A);const P=a.getColorMap();return{theme:B,colorMap:P}}function m(){return C(),a.getLoadedThemes()}function w(){return C(),a.getLoadedLanguages()}function v(...A){C(),a.loadLanguages(A.flat(1))}async function k(...A){return v(await Yg(A))}function E(...A){C();for(const B of A.flat(1))a.loadTheme(B)}async function N(...A){return C(),E(await Jg(A))}function C(){if(t)throw new xi("Shiki instance has been disposed")}function b(){t||(t=!0,a.dispose(),ps-=1)}return{setTheme:p,getTheme:d,getLanguage:f,getLoadedThemes:m,getLoadedLanguages:w,resolveLangAlias:c,loadLanguage:k,loadLanguageSync:v,loadTheme:N,loadThemeSync:E,dispose:b,[Symbol.dispose]:b}}async function Y1(e){e.engine||q1("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,i]=await Promise.all([Jg(e.themes||[]),Yg(e.langs||[]),e.engine]);return X1({...e,themes:t,langs:n,engine:i})}async function J1(e){const t=await Y1(e);return{getLastGrammarState:(...n)=>L1(t,...n),codeToTokensBase:(n,i)=>nf(t,n,i),codeToTokensWithThemes:(n,i)=>Xg(t,n,i),codeToTokens:(n,i)=>El(t,n,i),codeToHast:(n,i)=>bl(t,n,i),codeToHtml:(n,i)=>W1(t,n,i),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Ii(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function Z1(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const of=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),gt=String.raw;function Ni(e,t){if(e==null)throw new Error(t??"Value expected");return e}const ey=gt`\[\^?`,ty=`c.? | C(?:-.?)?|${gt`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${gt`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${gt`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${gt`o\{[^\}]*\}?`}|${gt`\d{1,3}`}`,lf=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,el=new RegExp(gt`
|
|
22
|
-
\\ (?:
|
|
23
|
-
${ty}
|
|
24
|
-
| [gk]<[^>]*>?
|
|
25
|
-
| [gk]'[^']*'?
|
|
26
|
-
| .
|
|
27
|
-
)
|
|
28
|
-
| \( (?:
|
|
29
|
-
\? (?:
|
|
30
|
-
[:=!>({]
|
|
31
|
-
| <[=!]
|
|
32
|
-
| <[^>]*>
|
|
33
|
-
| '[^']*'
|
|
34
|
-
| ~\|?
|
|
35
|
-
| #(?:[^)\\]|\\.?)*
|
|
36
|
-
| [^:)]*[:)]
|
|
37
|
-
)?
|
|
38
|
-
| \*[^\)]*\)?
|
|
39
|
-
)?
|
|
40
|
-
| (?:${lf.source})+
|
|
41
|
-
| ${ey}
|
|
42
|
-
| .
|
|
43
|
-
`.replace(/\s+/g,""),"gsu"),Hu=new RegExp(gt`
|
|
44
|
-
\\ (?:
|
|
45
|
-
${ty}
|
|
46
|
-
| .
|
|
47
|
-
)
|
|
48
|
-
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
49
|
-
| ${ey}
|
|
50
|
-
| &&
|
|
51
|
-
| .
|
|
52
|
-
`.replace(/\s+/g,""),"gsu");function eS(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=vS(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(el.lastIndex=0;c=el.exec(e);){const m=tS(a,e,c[0],el.lastIndex);m.tokens?l.push(...m.tokens):m.token&&l.push(m.token),m.lastIndex!==void 0&&(el.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,w)=>{m.kind="capturing",m.number=w+1});const p=d||f.length;return{tokens:l.map(m=>m.type==="EscapedNumber"?xS(m,p):m).flat(),flags:i}}function tS(e,t,n,i){const[o,a]=n;if(n==="["||n==="[^"){const l=nS(t,n,i);return{tokens:l.tokens,lastIndex:l.lastIndex}}if(o==="\\"){if("AbBGyYzZ".includes(a))return{token:Qp(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:dS(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:ry(n)}}if(a==="K")return{token:iy("keep",n)};if(a==="N"||a==="R")return{token:Dr("newline",n,{negate:a==="N"})};if(a==="O")return{token:Dr("any",n)};if(a==="X")return{token:Dr("text_segment",n)};const l=ny(n,{inCharClass:!1});return Array.isArray(l)?{tokens:l}:{token:l}}if(o==="("){if(a==="*")return{token:gS(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:mS(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:wi("group",n)};if(n==="(?>")return{token:wi("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:wi(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:wi("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:wi("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:uS(n)}}if(e.getCurrentModX()){if(n==="#"){const l=t.indexOf(`
|
|
53
|
-
`,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:Dr("dot",n)};if(n==="^"||n==="$"){const l=e.singleline?{"^":gt`\A`,$:gt`\Z`}[n]:n;return{token:Qp(l,n)}}return n==="|"?{token:iS(n)}:lf.test(n)?{tokens:SS(n)}:{token:Fn(Ii(n),n)}}function nS(e,t,n){const i=[Xp(t[1]==="^",t)];let o=1,a;for(Hu.lastIndex=n;a=Hu.exec(e);){const l=a[0];if(l[0]==="["&&l[1]!==":")o++,i.push(Xp(l[1]==="^",l));else if(l==="]"){if(i.at(-1).type==="CharacterClassOpen")i.push(Fn(93,l));else if(o--,i.push(sS(l)),!o)break}else{const c=rS(l);Array.isArray(c)?i.push(...c):i.push(c)}}return{tokens:i,lastIndex:Hu.lastIndex||e.length}}function rS(e){if(e[0]==="\\")return ny(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!of.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return Dr("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?oS(e):e==="&&"?lS(e):Fn(Ii(e),e)}function ny(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return pS(e);if("dDhHsSwW".includes(n))return yS(e);if(e.startsWith(gt`\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 wS(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 Fn(Ii(l),c)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Fn(kS(e),e);if(Yp.has(n))return Fn(Yp.get(n),e);if(/\d/.test(n))return aS(t,e);if(e==="\\")throw new Error(gt`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Fn(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function iS(e){return{type:"Alternator",raw:e}}function Qp(e,t){return{type:"Assertion",kind:e,raw:t}}function ry(e){return{type:"Backreference",raw:e}}function Fn(e,t){return{type:"Character",value:e,raw:t}}function sS(e){return{type:"CharacterClassClose",raw:e}}function oS(e){return{type:"CharacterClassHyphen",raw:e}}function lS(e){return{type:"CharacterClassIntersector",raw:e}}function Xp(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function Dr(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function iy(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Ni(n.flags),raw:t}}function aS(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function uS(e){return{type:"GroupClose",raw:e}}function wi(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function cS(e,t,n,i){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:i}}function fS(e,t,n,i){return{type:"Quantifier",kind:e,min:t,max:n,raw:i}}function dS(e){return{type:"Subroutine",raw:e}}const hS=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Yp=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function pS(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 Fn(Ii(t.toUpperCase())-64,e)}function mS(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=Zp(n),l=Zp(i),c={};if(a&&(c.enable=a),l&&(c.disable=l),e.endsWith(")"))return t.replaceCurrentModX(o),iy("flags",e,{flags:c});if(e.endsWith(":"))return t.pushModX(o),t.numOpenGroups++,wi("group",e,{...(a||l)&&{flags:c}});throw new Error(`Unexpected flag modifier "${e}"`)}function gS(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=hS.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 cS(d,i??null,o?.split(",")??null,e)}function Jp(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 fS(t,n,i,e)}function yS(e){const t=e[1].toLowerCase();return Dr({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function wS(e){const{p:t,neg:n,value:i}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return Dr("property",e,{value:i,negate:t==="P"&&!n||t==="p"&&!!n})}function Zp(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 vS(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 kS(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 xS(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[ry(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(gt`Octal encoded byte above 177 unsupported "${n}"`)}else d=Ii(f);a.push(Fn(d,(c===0?"\\":"")+f))}return a}function SS(e){const t=[],n=new RegExp(lf,"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(Jp(o.slice(0,-1)));continue}}}t.push(Jp(o))}return t}function sy(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 CS(e){return _S.has(e.type)}const _S=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function oy(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},i=eS(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),o=(w,v)=>{const k=i.tokens[a.nextIndex];switch(a.parent=w,a.nextIndex++,k.type){case"Alternator":return $r();case"Assertion":return ES(k);case"Backreference":return bS(k,a);case"Character":return Ol(k.value,{useLastValid:!!v.isCheckingRangeEnd});case"CharacterClassHyphen":return IS(k,a,v);case"CharacterClassOpen":return NS(k,a,v);case"CharacterSet":return TS(k,a);case"Directive":return OS(k.kind,{flags:k.flags});case"GroupOpen":return AS(k,a,v);case"NamedCallout":return DS(k.kind,k.tag,k.arguments);case"Quantifier":return PS(k,a);case"Subroutine":return RS(k,a);default:throw new Error(`Unexpected token type "${k.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=$S(MS(i.flags));let c=l.body[0];for(;a.nextIndex<i.tokens.length;){const w=o(c,{});w.type==="Alternative"?(l.body.push(w),c=w):c.body.push(w)}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:w}of m)if(typeof w=="number"){if(w>f.length)throw new Error("Subroutine uses a group number that's not defined");w&&(f[w-1].isSubroutined=!0)}else if(p.has(w)){if(p.get(w).length>1)throw new Error(gt`Subroutine uses a duplicate group name "\g<${w}>"`);p.get(w)[0].isSubroutined=!0}else throw new Error(gt`Subroutine uses a group name that's not defined "\g<${w}>"`);return l}function ES({kind:e}){return Pc(Ni({"^":"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===gt`\B`||e===gt`\Y`})}function bS({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,Rc(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 Rc(i)}return o(+i)}function IS(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(),jS(l,f);throw new Error("Invalid character class range")}return Ol(Ii("-"))}function NS({negate:e},t,n){const{tokens:i,walk:o}=t,a=[fl()],l=i[t.nextIndex];let c=nm(l);for(;c.type!=="CharacterClassClose";){if(c.type==="CharacterClassIntersector")a.push(fl()),t.nextIndex++;else{const d=a.at(-1);d.body.push(o(d,n))}c=nm(i[t.nextIndex],l)}const f=fl({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 TS({kind:e,negate:t,value:n},i){const{normalizeUnknownPropertyNames:o,skipPropertyNameValidation:a,unicodePropertyMap:l}=i;if(e==="property"){const c=Ml(n);if(of.has(c)&&!l?.has(c))e="posix",n=c;else return vi(n,{negate:t,normalizeUnknownPropertyNames:o,skipPropertyNameValidation:a,unicodePropertyMap:l})}return e==="posix"?FS(n,{negate:t}):Lc(e,{negate:t})}function AS(e,t,n){const{tokens:i,capturingGroups:o,namedGroupsByName:a,skipLookbehindValidation:l,walk:c}=t,f=zS(e),d=f.type==="AbsenceFunction",p=tm(f),m=p&&f.negate;if(f.type==="CapturingGroup"&&(o.push(f),f.name&&Z1(a,f.name,[]).push(f)),d&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let w=rm(i[t.nextIndex]);for(;w.type!=="GroupClose";){if(w.type==="Alternator")f.body.push($r()),t.nextIndex++;else{const v=f.body.at(-1),k=c(v,{...n,isInAbsenceFunction:n.isInAbsenceFunction||d,isInLookbehind:n.isInLookbehind||p,isInNegLookbehind:n.isInNegLookbehind||m});if(v.body.push(k),(p||n.isInLookbehind)&&!l){const E="Lookbehind includes a pattern not allowed by Oniguruma";if(m||n.isInNegLookbehind){if(em(k)||k.type==="CapturingGroup")throw new Error(E)}else if(em(k)||tm(k)&&k.negate)throw new Error(E)}}w=rm(i[t.nextIndex])}return t.nextIndex++,f}function PS({kind:e,min:t,max:n},i){const o=i.parent,a=o.body.at(-1);if(!a||!CS(a))throw new Error("Quantifier requires a repeatable token");const l=ay(e,t,n,a);return o.body.pop(),l}function RS({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=uy(o);return i.push(l),l}function LS(e,t){return{type:"AbsenceFunction",kind:e,body:Ms(t?.body)}}function $r(e){return{type:"Alternative",body:cy(e?.body)}}function Pc(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function Rc(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function ly(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!BS(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:Ms(t?.body)}}function Ol(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 fl(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:cy(e?.body)}}function jS(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Lc(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 OS(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:Ni(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function MS(e){return{type:"Flags",...e}}function pn(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:Ms(e?.body)}}function Or(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:Ms(e?.body)}}function DS(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function FS(e,t){const n=!!t?.negate;if(!of.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function ay(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 $S(e,t){return{type:"Regex",body:Ms(t?.body),flags:e}}function uy(e){return{type:"Subroutine",ref:e}}function vi(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let i=n.unicodePropertyMap?.get(Ml(e));if(!i){if(n.normalizeUnknownPropertyNames)i=US(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(gt`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:i??e,negate:n.negate}}function zS({flags:e,kind:t,name:n,negate:i,number:o}){switch(t){case"absence_repeater":return LS("repeater");case"atomic":return pn({atomic:!0});case"capturing":return ly(o,{name:n});case"group":return pn({flags:e});case"lookahead":case"lookbehind":return Or({behind:t==="lookbehind",negate:i});default:throw new Error(`Unexpected group kind "${t}"`)}}function Ms(e){if(e===void 0)e=[$r()];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 cy(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 em(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function tm(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function BS(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function US(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 Ml(e){return e.replace(/[- _]+/g,"").toLowerCase()}function nm(e,t){const n=t;return Ni(e,`Unclosed character class${n?.type==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function rm(e){return Ni(e,"Unclosed group")}function Ss(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(){tl(f).splice(Math.max(0,mi(c)+d),1),d--,p=!0},removeAllNextSiblings(){return tl(f).splice(mi(c)+1)},removeAllPrevSiblings(){const C=mi(c)+d;return d-=C,tl(f).splice(0,Math.max(0,C))},replaceWith(C,b={}){const A=!!b.traverse;f?f[Math.max(0,mi(c)+d)]=C:Ni(l,"Can't replace root node")[c]=C,A&&o(C,l,c,f),p=!0},replaceWithMultiple(C,b={}){const A=!!b.traverse;if(tl(f).splice(Math.max(0,mi(c)+d),1,...C),d+=C.length-1,A){let B=0;for(let P=0;P<C.length;P++)B+=o(C[P],l,mi(c)+P+B,f)}p=!0},skip(){p=!0}},{type:w}=a,v=t["*"],k=t[w],E=typeof v=="function"?v:v?.enter,N=typeof k=="function"?k:k?.enter;if(E?.(m,n),N?.(m,n),!p)switch(w){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 "${w}"`)}return k?.exit?.(m,n),v?.exit?.(m,n),d}return o(e),e}function tl(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function mi(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const VS=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function GS(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function WS(e,t,n,i){return e.slice(0,t)+i+e.slice(t+n.length)}const on=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function af(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===on.DEFAULT==!l)){n instanceof Function?c+=n(f,{context:l?on.CHAR_CLASS:on.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 fy(e,t,n,i){af(e,t,n,i)}function HS(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===on.DEFAULT==!a))return l;c==="["?a++:c==="]"&&a&&a--,o.lastIndex==l.index&&o.lastIndex++}return null}function nl(e,t,n){return!!HS(e,t,0,n)}function qS(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 im=new RegExp(String.raw`(?<noncapturingStart>${VS})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function KS(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 w=0,v=0,k=!1,E;for(im.lastIndex=Number.isNaN(p)?0:p+a.length;E=im.exec(e);){const{0:N,index:C,groups:{capturingStart:b,noncapturingStart:A}}=E;if(N==="[")w++;else if(w)N==="]"&&w--;else if(N===o&&!k)p=C,k=!0;else if(k&&A)v++;else if(b)k?v++:(f++,l.push(f+d));else if(N===")"&&k){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),GS(n,B),i.size){const P=new Map;i.forEach((M,ee)=>{P.set(ee>=B?ee+1:ee,M.map(oe=>oe>=B?oe+1:oe))}),i=P}break}v--}}}while(m);return n.push(...c),e=af(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:w,groups:{backrefNum:v,wrappedBackrefNum:k}})=>{if(v){const E=+v;if(E>l.length-1)throw new Error(`Backref "${w}" greater than number of captures`);return`\\${l[E]}`}return`\\${k}`},on.DEFAULT),{pattern:e,captureTransfers:i,hiddenCaptures:n}}const dy=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,qu=new RegExp(String.raw`
|
|
54
|
-
\\(?: \d+
|
|
55
|
-
| c[A-Za-z]
|
|
56
|
-
| [gk]<[^>]+>
|
|
57
|
-
| [pPu]\{[^\}]+\}
|
|
58
|
-
| u[A-Fa-f\d]{4}
|
|
59
|
-
| x[A-Fa-f\d]{2}
|
|
60
|
-
)
|
|
61
|
-
| \((?: \? (?: [:=!>]
|
|
62
|
-
| <(?:[=!]|[^>]+>)
|
|
63
|
-
| [A-Za-z\-]+:
|
|
64
|
-
| \(DEFINE\)
|
|
65
|
-
))?
|
|
66
|
-
| (?<qBase>${dy})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
67
|
-
| \\?.
|
|
68
|
-
`.replace(/\s+/g,""),"gsu");function QS(e){if(!new RegExp(`${dy}\\+`).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 w=-1;if(/^\{\d+\}$/.test(d))e=WS(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)}`;w+=4}qu.lastIndex+=w}else c[0]==="("?t.push(f):c===")"&&(n=t.length?t.pop():null);o=c}return{pattern:e}}const sn=String.raw,XS=sn`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,jc=sn`\(\?R=(?<rDepth>[^\)]+)\)|${XS}`,Dl=sn`\(\?<(?![=!])(?<captureName>[^>]+)>`,hy=sn`${Dl}|(?<unnamed>\()(?!\?)`,Pr=new RegExp(sn`${Dl}|${jc}|\(\?|\\?.`,"gsu"),Ku="Cannot use multiple overlapping recursions";function YS(e,t){const{hiddenCaptures:n,mode:i}={hiddenCaptures:[],mode:"plugin",...t};let o=t?.captureTransfers??new Map;if(!new RegExp(jc,"su").test(e))return{pattern:e,captureTransfers:o,hiddenCaptures:n};if(i==="plugin"&&nl(e,sn`\(\?\(DEFINE\)`,on.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const a=[],l=nl(e,sn`\\[1-9]`,on.DEFAULT),c=new Map,f=[];let d=!1,p=0,m=0,w;for(Pr.lastIndex=0;w=Pr.exec(e);){const{0:v,groups:{captureName:k,rDepth:E,gRNameOrNum:N,gRDepth:C}}=w;if(v==="[")p++;else if(p)v==="]"&&p--;else if(E){if(sm(E),d)throw new Error(Ku);if(l)throw new Error(`${i==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const b=e.slice(0,w.index),A=e.slice(Pr.lastIndex);if(nl(A,jc,on.DEFAULT))throw new Error(Ku);const B=+E-1;e=om(b,A,B,!1,n,a,m),o=am(o,b,B,a.length,0,m);break}else if(N){sm(C);let b=!1;for(const re of f)if(re.name===N||re.num===+N){if(b=!0,re.hasRecursedWithin)throw new Error(Ku);break}if(!b)throw new Error(sn`Recursive \g cannot be used outside the referenced group "${i==="external"?N:sn`\g<${N}&R=${C}>`}"`);const A=c.get(N),B=qS(e,A);if(l&&nl(B,sn`${Dl}|\((?!\?)`,on.DEFAULT))throw new Error(`${i==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const P=e.slice(A,w.index),M=B.slice(P.length+v.length),ee=a.length,oe=+C-1,ae=om(P,M,oe,!0,n,a,m);o=am(o,P,oe,a.length-ee,ee,m);const F=e.slice(0,A),ne=e.slice(A+B.length);e=`${F}${ae}${ne}`,Pr.lastIndex+=ae.length-v.length-P.length-M.length,f.forEach(re=>re.hasRecursedWithin=!0),d=!0}else if(k)m++,c.set(String(m),Pr.lastIndex),c.set(k,Pr.lastIndex),f.push({num:m,name:k});else if(v[0]==="("){const b=v==="(";b&&(m++,c.set(String(m),Pr.lastIndex)),f.push(b?{num:m}:{})}else v===")"&&f.pop()}return n.push(...a),{pattern:e,captureTransfers:o,hiddenCaptures:n}}function sm(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 om(e,t,n,i,o,a,l){const c=new Set;i&&fy(e+t,Dl,({groups:{captureName:d}})=>{c.add(d)},on.DEFAULT);const f=[n,i?c:null,o,a,l];return`${e}${lm(`(?:${e}`,"forward",...f)}(?:)${lm(`${t})`,"backward",...f)}${t}`}function lm(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+=af(e,sn`${hy}|\\k<(?<backref>[^>]+)>`,({0:w,groups:{captureName:v,unnamed:k,backref:E}})=>{if(E&&i&&!i.has(E))return w;const N=`_$${m}`;if(k||v){const C=l+a.length+1;return a.push(C),JS(o,C),k?w:`(?<${v}${N}>`}return sn`\k<${E}${N}>`},on.DEFAULT)}return d}function JS(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function am(e,t,n,i,o,a){if(e.size&&i){let l=0;fy(t,hy,()=>l++,on.DEFAULT);const c=a-l+o,f=new Map;return e.forEach((d,p)=>{const m=(i-l*n)/n,w=l*n,v=p>c+l?p+i:p,k=[];for(const E of d)if(E<=c)k.push(E);else if(E>c+l+m)k.push(E+i);else if(E<=c+l)for(let N=0;N<=n;N++)k.push(E+l*N);else for(let N=0;N<=n;N++)k.push(E+w+m*N);f.set(v,k)}),f}return e}var ct=String.fromCodePoint,Ne=String.raw,mn={},Fl=globalThis.RegExp;mn.flagGroups=(()=>{try{new Fl("(?i:)")}catch{return!1}return!0})();mn.unicodeSets=(()=>{try{new Fl("[[]]","v")}catch{return!1}return!0})();mn.bugFlagVLiteralHyphenIsRange=mn.unicodeSets?(()=>{try{new Fl(Ne`[\d\-a]`,"v")}catch{return!0}return!1})():!1;mn.bugNestedClassIgnoresNegation=mn.unicodeSets&&new Fl("[[^a]]","v").test("a");function Il(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function As(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Oc(e,t){return um[e]>=um[t]}function ZS(e,t){if(e==null)throw new Error(t??"Value expected");return e}var um={ES2025:2025,ES2024:2024,ES2018:2018},eC={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function py(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!eC[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=mn.flagGroups?"ES2025":mn.unicodeSets?"ES2024":"ES2018"),t}var tC="[ -\r ]",nC=new Set([ct(304),ct(305)]),On=Ne`[\p{L}\p{M}\p{N}\p{Pc}]`;function my(e){if(nC.has(e))return[e];const t=new Set,n=e.toLowerCase(),i=n.toUpperCase(),o=sC.get(n),a=rC.get(n),l=iC.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 uf=new Map(`C Other
|
|
69
|
-
Cc Control cntrl
|
|
70
|
-
Cf Format
|
|
71
|
-
Cn Unassigned
|
|
72
|
-
Co Private_Use
|
|
73
|
-
Cs Surrogate
|
|
74
|
-
L Letter
|
|
75
|
-
LC Cased_Letter
|
|
76
|
-
Ll Lowercase_Letter
|
|
77
|
-
Lm Modifier_Letter
|
|
78
|
-
Lo Other_Letter
|
|
79
|
-
Lt Titlecase_Letter
|
|
80
|
-
Lu Uppercase_Letter
|
|
81
|
-
M Mark Combining_Mark
|
|
82
|
-
Mc Spacing_Mark
|
|
83
|
-
Me Enclosing_Mark
|
|
84
|
-
Mn Nonspacing_Mark
|
|
85
|
-
N Number
|
|
86
|
-
Nd Decimal_Number digit
|
|
87
|
-
Nl Letter_Number
|
|
88
|
-
No Other_Number
|
|
89
|
-
P Punctuation punct
|
|
90
|
-
Pc Connector_Punctuation
|
|
91
|
-
Pd Dash_Punctuation
|
|
92
|
-
Pe Close_Punctuation
|
|
93
|
-
Pf Final_Punctuation
|
|
94
|
-
Pi Initial_Punctuation
|
|
95
|
-
Po Other_Punctuation
|
|
96
|
-
Ps Open_Punctuation
|
|
97
|
-
S Symbol
|
|
98
|
-
Sc Currency_Symbol
|
|
99
|
-
Sk Modifier_Symbol
|
|
100
|
-
Sm Math_Symbol
|
|
101
|
-
So Other_Symbol
|
|
102
|
-
Z Separator
|
|
103
|
-
Zl Line_Separator
|
|
104
|
-
Zp Paragraph_Separator
|
|
105
|
-
Zs Space_Separator
|
|
106
|
-
ASCII
|
|
107
|
-
ASCII_Hex_Digit AHex
|
|
108
|
-
Alphabetic Alpha
|
|
109
|
-
Any
|
|
110
|
-
Assigned
|
|
111
|
-
Bidi_Control Bidi_C
|
|
112
|
-
Bidi_Mirrored Bidi_M
|
|
113
|
-
Case_Ignorable CI
|
|
114
|
-
Cased
|
|
115
|
-
Changes_When_Casefolded CWCF
|
|
116
|
-
Changes_When_Casemapped CWCM
|
|
117
|
-
Changes_When_Lowercased CWL
|
|
118
|
-
Changes_When_NFKC_Casefolded CWKCF
|
|
119
|
-
Changes_When_Titlecased CWT
|
|
120
|
-
Changes_When_Uppercased CWU
|
|
121
|
-
Dash
|
|
122
|
-
Default_Ignorable_Code_Point DI
|
|
123
|
-
Deprecated Dep
|
|
124
|
-
Diacritic Dia
|
|
125
|
-
Emoji
|
|
126
|
-
Emoji_Component EComp
|
|
127
|
-
Emoji_Modifier EMod
|
|
128
|
-
Emoji_Modifier_Base EBase
|
|
129
|
-
Emoji_Presentation EPres
|
|
130
|
-
Extended_Pictographic ExtPict
|
|
131
|
-
Extender Ext
|
|
132
|
-
Grapheme_Base Gr_Base
|
|
133
|
-
Grapheme_Extend Gr_Ext
|
|
134
|
-
Hex_Digit Hex
|
|
135
|
-
IDS_Binary_Operator IDSB
|
|
136
|
-
IDS_Trinary_Operator IDST
|
|
137
|
-
ID_Continue IDC
|
|
138
|
-
ID_Start IDS
|
|
139
|
-
Ideographic Ideo
|
|
140
|
-
Join_Control Join_C
|
|
141
|
-
Logical_Order_Exception LOE
|
|
142
|
-
Lowercase Lower
|
|
143
|
-
Math
|
|
144
|
-
Noncharacter_Code_Point NChar
|
|
145
|
-
Pattern_Syntax Pat_Syn
|
|
146
|
-
Pattern_White_Space Pat_WS
|
|
147
|
-
Quotation_Mark QMark
|
|
148
|
-
Radical
|
|
149
|
-
Regional_Indicator RI
|
|
150
|
-
Sentence_Terminal STerm
|
|
151
|
-
Soft_Dotted SD
|
|
152
|
-
Terminal_Punctuation Term
|
|
153
|
-
Unified_Ideograph UIdeo
|
|
154
|
-
Uppercase Upper
|
|
155
|
-
Variation_Selector VS
|
|
156
|
-
White_Space space
|
|
157
|
-
XID_Continue XIDC
|
|
158
|
-
XID_Start XIDS`.split(/\s/).map(e=>[Ml(e),e])),rC=new Map([["s",ct(383)],[ct(383),"s"]]),iC=new Map([[ct(223),ct(7838)],[ct(107),ct(8490)],[ct(229),ct(8491)],[ct(969),ct(8486)]]),sC=new Map([cr(453),cr(456),cr(459),cr(498),...Qu(8072,8079),...Qu(8088,8095),...Qu(8104,8111),cr(8124),cr(8140),cr(8188)]),oC=new Map([["alnum",Ne`[\p{Alpha}\p{Nd}]`],["alpha",Ne`\p{Alpha}`],["ascii",Ne`\p{ASCII}`],["blank",Ne`[\p{Zs}\t]`],["cntrl",Ne`\p{Cc}`],["digit",Ne`\p{Nd}`],["graph",Ne`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",Ne`\p{Lower}`],["print",Ne`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",Ne`[\p{P}\p{S}]`],["space",Ne`\p{space}`],["upper",Ne`\p{Upper}`],["word",Ne`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",Ne`\p{AHex}`]]);function lC(e,t){const n=[];for(let i=e;i<=t;i++)n.push(i);return n}function cr(e){const t=ct(e);return[t.toLowerCase(),t]}function Qu(e,t){return lC(e,t).map(n=>cr(n))}var gy=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function aC(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};yy(e);const i={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Oc(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};Ss(e,uC,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};Ss(e,cC,a);const l={groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer};return Ss(e,fC,l),e._originMap=a.groupOriginByCopy,e._strategy=i.strategy,e}var uC={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:i,kind:o}=e;if(o==="repeater"){const a=pn();a.body[0].body.push(Or({negate:!0,body:i}),vi("Any"));const l=pn();l.body[0].body.push(ay("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];As(i,l,[]).push(...o)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const n=vy(t.get(e));if(n){const i=pn({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:w,wordIsAscii:v}=c;if(f==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${d?"Y":"y"}"`);if(f==="line_end")l(it(Or({body:[$r({body:[Pc("string_end")]}),$r({body:[Ol(10)]})]}),t));else if(f==="line_start")l(it(Mn(Ne`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(f==="search_start")if(w.has(e))o.flags.sticky=!0,a();else{const k=i[n-1];if(k&&yC(k))l(it(Or({negate:!0}),t));else{if(m)throw new Error(Ne`Uses "\G" in a way that requires a subclass`);l(fr(Pc("string_start"),t)),c.strategy="clip_search"}}else if(!(f==="string_end"||f==="string_start"))if(f==="string_end_newline")l(it(Mn(Ne`(?=\n?\z)`),t));else if(f==="word_boundary"){if(!v&&!p){const k=`(?:(?<=${On})(?!${On})|(?<!${On})(?=${On}))`,E=`(?:(?<=${On})(?=${On})|(?<!${On})(?!${On}))`;l(it(Mn(d?E:k),t))}}else throw new Error(`Unexpected assertion kind "${f}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Yu(n)&&(n=Xu(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:i}=e;i&&!Yu(i)&&(i=Xu(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=fl({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(fr(Lc("digit",{negate:d}),t));return}if(l&&(f==="space"||p==="space")){n(it(Ju(Mn(tC),d),t));return}if(c&&(f==="word"||p==="word")){n(fr(Lc("word",{negate:d}),t));return}if(f==="any")n(fr(vi("Any"),t));else if(f==="digit")n(fr(vi("Nd",{negate:d}),t));else if(f!=="dot")if(f==="text_segment"){if(i==="strict")throw new Error(Ne`Use of "\X" requires non-strict accuracy`);const m="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",w=Ne`\p{RI}{2}|${m}(?:\u200D${m})*`;n(it(Mn(Ne`(?>\r\n|${o?Ne`\p{RGI_Emoji}`:w}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(f==="hex")n(fr(vi("AHex",{negate:d}),t));else if(f==="newline")n(it(Mn(d?`[^
|
|
159
|
-
]`:`(?>\r
|
|
160
|
-
?|[
|
|
161
|
-
\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-${ct(m.codePointAt(0)-1)}${ct(m.codePointAt(2)+1)}-`),n(it(Mn(`[${m}]`),t))}else n(it(Ju(Mn(oC.get(p)),d),t));else if(f==="property")uf.has(Ml(p))||(e.key="sc");else if(f==="space")n(fr(vi("space",{negate:d}),t));else if(f==="word")n(it(Ju(Mn(On),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=pn({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&&sy(d,{type:"Group"})&&d.body[0].body.length===1?d.body[0]:n;if(t.parent!==m||m.body.length>1)throw new Error(Ne`Uses "\K" in a way that's unsupported`);const w=Or({behind:!0});w.body[0].body=a(),o(it(w,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(Or({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${i.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=pn();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=xy(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(Ne`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Yu(n)&&(n=Xu(n,t),e.ref=n)}},cC={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=fr(cm(e.number),t);f.set(m,c.get(e.number)),n(m);return}c.set(e.number,e),l.set(e.number,[]),e.name&&As(l,e.name,[]);const p=l.get(e.name??e.number);for(let m=0;m<p.length;m++){const w=p[m];if(d===w.node||d&&d===w.origin||e===w.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=As(a,e.name,new Map);let w=!1;if(d)w=!0;else for(const v of m.values())if(!v.hasDuplicateNameToRemove){w=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:w})}},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=Il(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?cm(0):wy(l,i.groupOriginByCopy,null);let d=f;if(!c){const p=vy(pC(l,w=>w.type==="Group"&&!!w.flags)),m=p?Il(i.globalFlags,p):i.globalFlags;dC(m,i.currentFlags)||(d=pn({flags:mC(m)}),d.body[0].body.push(f))}n(it(d,t),{traverse:!c})}},fC={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=>hC(l,e));if(!a.length)n(it(Or({negate:!0}),t));else if(a.length>1){const l=pn({atomic:!0,body:a.reverse().map(c=>$r({body:[Rc(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=ly();e.body.at(-1).body.push(o)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function yy(e){Ss(e,{"*"({node:t,parent:n}){t.parent=n}})}function dC(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function hC(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const i=ky(n.parent);for(const o of i){if(o===n)break;if(o===e||Sy(o,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function wy(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]=wy(l,t,o,n):(a==="type"&&l==="CapturingGroup"&&t.set(o,t.get(e)??e),o[a]=l);return o}function cm(e){const t=uy(e);return t.isRecursive=!0,t}function pC(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Xu(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 vy(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 mC({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 ky(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function xy(e){const t=e.find(n=>n.kind==="search_start"||wC(n,{negate:!1})||!gC(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=xy(i.body);if(!o)return null;Array.isArray(o)?n.push(...o):n.push(o)}return n}return null}function Sy(e,t){const n=ky(e)??[];for(const i of n)if(i===t||Sy(i,t))return!0;return!1}function gC({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function yC(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function wC(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&sy(e.body[0],{type:"Assertion",kind:"search_start"})}function Yu(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Mn(e,t){const i=oy(e,{...t,unicodePropertyMap:uf}).body;return i.length>1||i[0].body.length>1?pn({body:i}):i[0].body[0]}function Ju(e,t){return e.negate=t,e}function fr(e,t){return e.parent=t,e}function it(e,t){return yy(e),e.parent=t,e}function vC(e,t){const n=py(t),i=Oc(n.target,"ES2024"),o=Oc(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];Ss(e,kC,{getCurrentModI:()=>v.at(-1),popModI(){v.pop()},pushModI(k){v.push(k)},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,ZS(xC[v.type],`Unexpected node type "${v.type}"`)(v,p,m)}const w={pattern:e.body.map(m).join("|"),flags:m(e.flags),options:{...e.options}};return i||(delete w.options.force.v,w.options.disable.v=!0,w.options.unicodeSetsPlugin=null),w._captureTransfers=new Map,w._hiddenCaptures=[],p.captureMap.forEach((v,k)=>{v.hidden&&w._hiddenCaptures.push(k),v.transferTo&&As(w._captureTransfers,v.transferTo,[]).push(k)}),w}var kC={"*":{enter({node:e},t){if(dm(e)){const n=t.getCurrentModI();t.pushModI(e.flags?Il({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){dm(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){cf(ct(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),Cy(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&gy.has(e.value)&&t.setHasCasedChar()}},xC={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?Ne`\B`:Ne`\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=ct(e),i=gi(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(i!==n)return i;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&cf(n)){const o=my(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");mn.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&l.some(hm)&&(l=[Ol(45),...l.filter(d=>!hm(d))]);const c=()=>`[${o?"^":""}${l.map(n).join(i==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||mn.bugNestedClassIgnoresNegation)&&!o){const p=l.filter(m=>m.type==="CharacterClass"&&m.kind==="union"&&m.negate);if(p.length){const m=pn(),w=m.body[0];return m.parent=a,w.parent=m,l=l.filter(v=>!p.includes(v)),e.body=l,l.length?(e.parent=w,w.body.push(e)):m.body.pop(),p.forEach(v=>{const k=$r({body:[v]});v.parent=k,k.parent=m,m.body.push(k)}),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"&&!(mn.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=gi(n,o),l=gi(i,o),c=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const f=Cy(e);bC(f).forEach(p=>{c.add(Array.isArray(p)?`${gi(p[0],o)}-${gi(p[1],o)}`:gi(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?".":"[^]":Ne`[^\n]`;if(e==="digit")return t?Ne`\D`:Ne`\d`;if(e==="property"){if(o.useAppliedIgnoreCase&&o.currentFlags.ignoreCase&&gy.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Ne`\P`:Ne`\p`}{${i?`${i}=`:""}${n}}`}if(e==="word")return t?Ne`\W`:Ne`\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=Il(l,n));const c=t.map(a).join("|"),f=!o.verbose&&t.length===1&&i.type!=="Quantifier"&&!e&&(!o.useFlagMods||!n)?c:`(?${IC(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)+NC(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})`:Ne`\g<${t}&R=${i}>`}},SC=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),CC=new Set(["-","\\","]","^","["]),_C=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),fm=new Map([[9,Ne`\t`],[10,Ne`\n`],[11,Ne`\v`],[12,Ne`\f`],[13,Ne`\r`],[8232,Ne`\u2028`],[8233,Ne`\u2029`],[65279,Ne`\uFEFF`]]),EC=new RegExp("^\\p{Cased}$","u");function cf(e){return EC.test(e)}function Cy(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=ct(l);if(!cf(c))continue;const f=my(c).filter(d=>{const p=d.codePointAt(0);return p<i||p>o});if(f.length&&(a.push(...f),n))break}return a}function gi(e,{escDigit:t,inCharClass:n,useFlagV:i}){if(fm.has(e))return fm.get(e);if(e<32||e>126&&e<160||e>262143||t&&TC(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const o=n?i?_C:CC:SC,a=ct(e);return(o.has(a)?"\\":"")+a}function bC(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 IC(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 NC({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 dm({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function TC(e){return e>47&&e<58}function hm({type:e,value:t}){return e==="Character"&&t===45}var AC=class Mc 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 Mc&&(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=RC(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 Mc(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&&(PC(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=LC(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 PC(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 RC(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)As(n,a,{}).transferTo=i;return n}function LC(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 jC(e,t){const n=OC(e,t);return n.options?new AC(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function OC(e,t){const n=py(t),i=oy(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:uf}),o=aC(i,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),a=vC(o,n),l=YS(a.pattern,{captureTransfers:a._captureTransfers,hiddenCaptures:a._hiddenCaptures,mode:"external"}),c=QS(l.pattern),f=KS(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((k,E)=>k-E),m=Array.from(f.captureTransfers),w=o._strategy,v=d.pattern.length>=n.lazyCompileLength;(p.length||m.length||w||v)&&(d.options={...p.length&&{hiddenCaptures:p},...m.length&&{transfers:m},...w&&{strategy:w},...v&&{lazyCompile:v}})}return d}const pm=4294967295;class MC{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:pm,end:pm,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 DC(e,t){return jC(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function FC(e={}){const t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||=n=>DC(n,{target:t.target}),{createScanner(n){return new MC(n,t)},createString(n){return{content:n}}}}const $C="github-light",_y={typescript:()=>Ae(()=>import("./typescript-BPQ3VLAy.js"),[]),tsx:()=>Ae(()=>import("./tsx-COt5Ahok.js"),[]),javascript:()=>Ae(()=>import("./javascript-wDzz0qaB.js"),[]),jsx:()=>Ae(()=>import("./jsx-g9-lgVsj.js"),[]),json:()=>Ae(()=>import("./json-Cp-IABpG.js"),[]),jsonc:()=>Ae(()=>import("./jsonc-Des-eS-w.js"),[]),json5:()=>Ae(()=>import("./json5-C9tS-k6U.js"),[]),css:()=>Ae(()=>import("./css-DPfMkruS.js"),[]),scss:()=>Ae(()=>import("./scss-OYdSNvt2.js"),__vite__mapDeps([0,1])),less:()=>Ae(()=>import("./less-B1dDrJ26.js"),[]),html:()=>Ae(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([2,3,1])),vue:()=>Ae(()=>import("./vue-DVfSmUF7.js"),__vite__mapDeps([4,1,3,5,6,2])),svelte:()=>Ae(()=>import("./svelte-DZMnMd3x.js"),__vite__mapDeps([7,3,5,1])),markdown:()=>Ae(()=>import("./markdown-Cvjx9yec.js"),[]),mdx:()=>Ae(()=>import("./mdx-Cmh6b_Ma.js"),[]),yaml:()=>Ae(()=>import("./yaml-Buea-lGh.js"),[]),toml:()=>Ae(()=>import("./toml-vGWfd6FD.js"),[]),ini:()=>Ae(()=>import("./ini-BEwlwnbL.js"),[]),xml:()=>Ae(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([8,9])),shellscript:()=>Ae(()=>import("./shellscript-Yzrsuije.js"),[]),python:()=>Ae(()=>import("./python-B6aJPvgy.js"),[]),go:()=>Ae(()=>import("./go-CxLEBnE3.js"),[]),rust:()=>Ae(()=>import("./rust-B1yitclQ.js"),[]),java:()=>Ae(()=>import("./java-CylS5w8V.js"),[]),kotlin:()=>Ae(()=>import("./kotlin-BdnUsdx6.js"),[]),c:()=>Ae(()=>import("./c-BIGW1oBm.js"),[]),cpp:()=>Ae(()=>import("./cpp-BRuaLJcg.js"),__vite__mapDeps([10,11,12])),csharp:()=>Ae(()=>import("./csharp-COcwbKMJ.js"),[]),php:()=>Ae(()=>import("./php-Dhbhpdrm.js"),__vite__mapDeps([13,2,3,1,8,9,12,6])),ruby:()=>Ae(()=>import("./ruby-BGX7qA9Y.js"),__vite__mapDeps([14,2,3,1,8,9,12,15,5,16,17,10,11,18,19,20])),sql:()=>Ae(()=>import("./sql-BLtJtn59.js"),[]),graphql:()=>Ae(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([15,3,5,16,17])),dockerfile:()=>Ae(()=>import("./dockerfile-BcOcwvcX.js"),[]),makefile:()=>Ae(()=>import("./makefile-CHLpvVh8.js"),[]),lua:()=>Ae(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([19,11])),swift:()=>Ae(()=>import("./swift-D82vCrfD.js"),[]),dart:()=>Ae(()=>import("./dart-CF10PKvl.js"),[]),diff:()=>Ae(()=>import("./diff-D97Zzqfu.js"),[]),dotenv:()=>Ae(()=>import("./dotenv-Da5cRb03.js"),[]),prisma:()=>Ae(()=>import("./prisma-Dd19v3D-.js"),[]),nginx:()=>Ae(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([21,19,11]))},zC={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"},BC={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 UC(e){const t=(e.split("/").pop()??"").toLowerCase(),n=BC[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=zC[t.slice(i+1)];return o&&_y[o]?o:null}let Zu=null;function VC(){return Zu||(Zu=J1({themes:[Ae(()=>import("./github-light-DAi9KRSo.js"),[])],langs:[],engine:FC({forgiving:!0})})),Zu}const mm=new Set,ec=new Map;async function GC(e,t){if(mm.has(t))return!0;let n=ec.get(t);if(!n){const i=_y[t];if(!i)return!1;n=i().then(async o=>(await e.loadLanguage(...o.default),mm.add(t),!0)).catch(()=>!1).finally(()=>ec.delete(t)),ec.set(t,n)}return n}async function WC(e,t){if(t.length===0)return[];const n=await VC();if(!await GC(n,e))return null;const i=t.join(`
|
|
162
|
-
`),a=n.codeToTokensBase(i,{lang:e,theme:$C,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 rl=20,gm=new Map;function HC(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 il(e,t){return e.type==="context"||t==="new"?`new:${e.newLineNo??e.oldLineNo}`:`old:${e.oldLineNo}`}function ym({content:e,tokens:t}){return t?S.jsxs("span",{className:"code-text",children:[t.map((n,i)=>S.jsx("span",{style:n.color?{color:n.color}:void 0,children:n.content},i)),e===""&&""]}):S.jsx("span",{className:"code-text",children:e||""})}function qC(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 KC(e){switch(e.kind){case"hunk":case"gap":return 26;default:return 22}}function QC({diff:e}){const t=G(U=>U.prefs.viewMode),n=G(U=>U.targetKey),i=G(U=>U.comments),o=Q.useMemo(()=>i.filter(U=>U.filePath===e.path&&U.targetKey===n),[i,e.path,n]),a=G(U=>U.updateComment),l=G(U=>U.setEditor),c=G(U=>U.focusComment),f=G(U=>U.editor),d=G(U=>U.focusedCommentId),p=G(U=>U.openInNvim),m=G(U=>U.showToast),w=G(U=>U.reattaching),v=G(U=>U.jumpTo),[k,E]=Q.useState({}),[N,C]=Q.useState(null),b=Q.useRef(null),[A,B]=Q.useState(null),P=Q.useRef(null),M=Q.useCallback(U=>{P.current=U,B(U)},[]),[ee,oe]=Q.useState(null),ae=Q.useMemo(()=>lx({diff:e,viewMode:t,expansions:k,fullLines:N}),[e,t,k,N]),F=Q.useMemo(()=>{const U=new Map;for(const H of o){if(H.status==="orphaned")continue;const we=`${H.side}:${H.endLine}`,Ce=U.get(we)??{count:0,active:!1,ids:[]};Ce.count++,Ce.ids.push(H.id),H.status==="active"&&(Ce.active=!0),U.set(we,Ce)}return U},[o]),ne=Q.useMemo(()=>o.find(U=>U.id===d&&U.status!=="orphaned")??null,[o,d]),re=f&&f.filePath===e.path?f:null,de=Q.useMemo(()=>UC(e.path),[e.path]),ie=Q.useRef(new Map),[,X]=Q.useState(0);Q.useEffect(()=>{if(!de)return;const U=ie.current,H=new Map,we=(Ie,qe,st)=>{if(U.has(qe))return;let et=H.get(Ie);et||(et={keys:[],lines:[]},H.set(Ie,et)),!et.keys.includes(qe)&&(et.keys.push(qe),et.lines.push(st))},Ce=(Ie,qe)=>{Ie.type==="del"?we(`${qe}:old`,il(Ie,"old"),Ie.content):we(`${qe}:new`,il(Ie,"new"),Ie.content)};for(const Ie of ae)Ie.kind==="line"?Ce(Ie.line,Ie.hunkIndex):Ie.kind==="pair"&&(Ie.left&&Ce(Ie.left,Ie.hunkIndex),Ie.right&&Ie.right!==Ie.left&&Ce(Ie.right,Ie.hunkIndex));if(H.size===0)return;let Oe=!1;return(async()=>{let Ie=!1;for(const qe of H.values()){const st=await WC(de,qe.lines);if(Oe||!st)return;qe.keys.forEach((et,Un)=>{const gr=st[Un];gr&&U.set(et,gr)}),Ie=!0}Ie&&X(qe=>qe+1)})().catch(()=>{}),()=>{Oe=!0}},[ae,de]);const ge=Q.useRef(null),me=ix({count:ae.length,getScrollElement:()=>ge.current,estimateSize:U=>KC(ae[U]),overscan:12,getItemKey:U=>ae[U].key});Q.useEffect(()=>{const U=ge.current;if(!U)return;let H=0;const we=()=>{H=0;const Oe=me.getVirtualItems()[0],Ie=Oe?HC(ae[Oe.index]):void 0;Ie&&gm.set(e.path,Ie)},Ce=()=>{H||(H=requestAnimationFrame(we))};return U.addEventListener("scroll",Ce,{passive:!0}),()=>{U.removeEventListener("scroll",Ce),H&&cancelAnimationFrame(H)}},[ae,me,e.path]);const J=Q.useRef(!1);Q.useEffect(()=>{if(J.current||(J.current=!0,!G.getState().consumeRestoreScroll()))return;const U=gm.get(e.path);if(!U)return;const H=bp(ae,U.side,U.line);H>=0&&me.scrollToIndex(H,{align:"start"})},[]),Q.useEffect(()=>{if(!v||v.file!==e.path)return;const U=bp(ae,v.side,v.line);if(U<0)return;me.scrollToIndex(U,{align:"center"}),oe({side:v.side,line:v.line});const H=setTimeout(()=>oe(null),1600);return()=>clearTimeout(H)},[v]),Q.useEffect(()=>{const U=H=>{if(H.ctrlKey||H.metaKey||H.altKey)return;const we=H.target;if(we&&(we.tagName==="INPUT"&&we.type!=="checkbox"||we.tagName==="TEXTAREA"||we.tagName==="SELECT"||we.isContentEditable)||H.key!=="n"&&H.key!=="p")return;const Ce=ax(ae);if(!Ce.length)return;const Oe=ge.current,Ie=Oe?Oe.scrollTop:0,qe=Ce.map(et=>me.getOffsetForIndex(et,"start")?.[0]??0);let st;if(H.key==="n")st=Ce.find((et,Un)=>qe[Un]>Ie+4);else for(let et=Ce.length-1;et>=0;et--)if(qe[et]<Ie-4){st=Ce[et];break}st!==void 0&&(H.preventDefault(),me.scrollToIndex(st,{align:"start"}))};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[ae,me]),Q.useEffect(()=>{const U=()=>{const H=P.current;if(!H)return;M(null);const we=Math.min(H.anchor,H.head),Ce=Math.max(H.anchor,H.head),Oe=G.getState().reattaching;Oe?a(Oe,{side:H.side,startLine:we,endLine:Ce}):l({filePath:e.path,side:H.side,startLine:we,endLine:Ce})};return window.addEventListener("mouseup",U),()=>window.removeEventListener("mouseup",U)},[M,a,l,e.path]);const O=(U,H,we,Ce)=>{U.button===0&&(U.preventDefault(),U.stopPropagation(),M({side:H,hunkIndex:we,anchor:Ce,head:Ce}))},_=(U,H,we)=>{const Ce=P.current;!Ce||Ce.side!==U||Ce.hunkIndex!==H||Ce.head===we||M({...Ce,head:we})},L=(U,H)=>!A||H===void 0||A.side!==U?!1:H>=Math.min(A.anchor,A.head)&&H<=Math.max(A.anchor,A.head),V=(U,H)=>!!ee&&ee.side===U&&ee.line===H,I=(U,H,we)=>!!U&&we!==void 0&&U.side===H&&we>=U.startLine&&we<=U.endLine,ue=(U,H)=>[L(U,H)||I(re,U,H)?"selected":"",I(ne,U,H)?"focused":"",V(U,H)?"flash":""].join(" "),Se=(U,H)=>{if(H===void 0)return null;const we=F.get(`${U}:${H}`);return we?S.jsxs(S.Fragment,{children:[S.jsx("button",{className:`pill ${we.active?"":"muted"}`,title:"查看评论",onClick:()=>{c(we.ids[0]??null,!1)},children:we.count}),S.jsx("span",{className:`pin ${we.active?"":"muted"}`})]}):null},ye=Q.useCallback(async()=>N||(b.current||(b.current=ze.fullFile(n,e.path,"new").then(U=>{if(U.content===null)return null;const H=U.content.split(`
|
|
163
|
-
`);return H.length&&H[H.length-1]===""&&H.pop(),C(H),H}).catch(U=>(m(U instanceof Error?U.message:String(U),"error"),null)).finally(()=>{b.current=null})),b.current),[N,n,e.path,m]),je=async(U,H)=>{if(!await ye()){m("无法读取完整文件内容","error");return}E(Ce=>{const Oe=Ce[U.index]??{top:0,bottom:0,all:!1},Ie=H==="all"?{...Oe,all:!0}:H==="top"?{...Oe,top:Oe.top+rl}:{...Oe,bottom:Oe.bottom+rl};return{...Ce,[U.index]:Ie}})},Te=(U,H)=>{const we=e.hunks[H];p(e.path,qC(U,we))},De=U=>{const{gap:H,hidden:we}=U,Ce=H.index===0,Oe=H.index===e.hunks.length;return S.jsxs("div",{className:"row gap-row",children:[!Ce&&S.jsxs("button",{className:"link",onClick:()=>{je(H,"top")},title:"展开紧接上一个 hunk 之后的 20 行",children:["↑ 展开上方 ",rl," 行"]}),S.jsxs("button",{className:"link",onClick:()=>{je(H,"all")},children:["展开全部",we!==null?` (${we} 行)`:""]}),!Oe&&S.jsxs("button",{className:"link",onClick:()=>{je(H,"bottom")},title:"展开紧接下一个 hunk 之前的 20 行",children:["↓ 展开下方 ",rl," 行"]})]})},Ze=U=>{const H=U.line,we=H.type==="del"?"old":"new",Ce=we==="old"?H.oldLineNo:H.newLineNo,Oe=ie.current.get(il(H,we));return S.jsxs("div",{className:`row line ${H.type} ${ue(we,Ce)} ${U.expanded?"expanded":""}`,onMouseEnter:()=>Ce!==void 0&&_(we,U.hunkIndex,Ce),children:[S.jsx("span",{className:"gut",onClick:()=>Te(H,U.hunkIndex),title:"在 nvim 中打开此行",children:H.oldLineNo??""}),S.jsx("span",{className:"gut",onClick:()=>Te(H,U.hunkIndex),title:"在 nvim 中打开此行",children:H.newLineNo??""}),S.jsx("span",{className:"addc",children:!U.expanded&&Ce!==void 0&&S.jsx("button",{className:"add-btn",onMouseDown:Ie=>O(Ie,we,U.hunkIndex,Ce),title:"添加评论(可拖选多行)",children:"+"})}),S.jsx("span",{className:"marker",children:H.type==="add"?"+":H.type==="del"?"-":" "}),S.jsxs("span",{className:"code",children:[S.jsx(ym,{content:H.content,tokens:Oe}),H.noNewline&&S.jsx("span",{className:"nonl",title:"No newline at end of file",children:"⏎"})]}),Se(we,Ce)]})},Kt=(U,H,we,Ce)=>{if(!U)return S.jsx("span",{className:"cell empty"});const Oe=H==="old"?U.oldLineNo:U.newLineNo,Ie=U.type==="context"?"context":H==="old"?"del":"add",qe=ie.current.get(il(U,H));return S.jsxs("span",{className:`cell ${Ie} ${ue(H,Oe)}`,onMouseEnter:()=>Oe!==void 0&&_(H,we,Oe),children:[S.jsx("span",{className:"gut",onClick:()=>Te(U,we),title:"在 nvim 中打开此行",children:Oe??""}),S.jsx("span",{className:"addc",children:!Ce&&Oe!==void 0&&S.jsx("button",{className:"add-btn",onMouseDown:st=>O(st,H,we,Oe),title:"添加评论(可拖选多行)",children:"+"})}),S.jsx("span",{className:"code",children:S.jsx(ym,{content:U.content,tokens:qe})}),Se(H,Oe)]})},Ur=U=>{switch(U.kind){case"gap":return De(U);case"hunk":return S.jsxs("div",{className:"row hunk-head",children:["@@ -",U.hunk.oldStart,",",U.hunk.oldLines," +",U.hunk.newStart,",",U.hunk.newLines," @@ ",S.jsx("span",{className:"muted",children:U.hunk.header})]});case"line":return Ze(U);case"pair":return S.jsxs("div",{className:`row pair ${U.expanded?"expanded":""}`,children:[Kt(U.left,"old",U.hunkIndex,U.expanded),Kt(U.right,"new",U.hunkIndex,U.expanded)]})}},Bn=me.getVirtualItems();return S.jsx("div",{ref:ge,className:`diff-scroll ${A?"selecting":""} ${w?"reattaching":""}`,children:S.jsx("div",{className:`diff-list ${t}`,style:{height:me.getTotalSize(),position:"relative"},children:Bn.map(U=>S.jsx("div",{"data-index":U.index,ref:me.measureElement,className:"vrow",style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${U.start}px)`},children:Ur(ae[U.index])},U.key))})})}const XC=5e3;function YC({path:e}){const t=e.lastIndexOf("/")+1;return S.jsxs(S.Fragment,{children:[t>0&&S.jsx("span",{className:"dir",children:e.slice(0,t)}),S.jsx("span",{className:"base",children:e.slice(t)})]})}function JC({entry:e}){const t=G(o=>o.toggleViewed),n=G(o=>o.openInNvim),i=G(o=>!!o.nvim?.selected);return S.jsxs("div",{className:"file-head",children:[S.jsx("span",{className:`status status-${e.status}`,title:e.status,children:fg[e.status]}),S.jsxs("span",{className:"path",children:[e.oldPath&&S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"dir",children:e.oldPath})," ",S.jsx("span",{className:"muted",children:"→"})," "]}),S.jsx(YC,{path:e.path})]}),e.oldMode&&e.newMode&&S.jsxs("span",{className:"muted mono",children:["mode ",e.oldMode," → ",e.newMode]}),S.jsxs("span",{className:"counts",children:[S.jsxs("span",{className:"add",children:["+",e.additions]})," ",S.jsxs("span",{className:"del",children:["-",e.deletions]})]}),e.changed&&S.jsx("span",{className:"changed",children:"文件已变化,viewed 已取消"}),S.jsx("span",{className:"spacer"}),S.jsx("button",{className:"link",disabled:!i,onClick:()=>{n(e.path,1)},title:"在 nvim 中打开",children:"在 nvim 中打开"}),S.jsxs("label",{className:"check",children:[S.jsx("input",{type:"checkbox",checked:e.viewed,onChange:()=>{t(e.path)}}),"Viewed"]})]})}function ZC(){const e=G(p=>p.activeFile),t=G(p=>p.files.find(m=>m.path===p.activeFile)),n=G(p=>p.activeFile?p.diffs[p.activeFile]:void 0),i=G(p=>p.filesLoading),o=G(p=>p.files),a=G(p=>p.openFile),[l,c]=Q.useState(null),f=Q.useMemo(()=>n?.status==="ok"?ux(n.diff):0,[n]);if(!e||!t)return S.jsx("div",{className:"placeholder",children:i&&o.length===0?S.jsx("p",{children:"加载文件列表…"}):o.length===0?S.jsx("p",{children:"当前 Target 没有改动。"}):S.jsxs(S.Fragment,{children:[S.jsx("p",{children:"在左侧选择一个文件查看 diff。"}),S.jsxs("p",{className:"muted",children:["快捷键:",S.jsx("kbd",{children:"j"}),"/",S.jsx("kbd",{children:"k"})," 切换文件,",S.jsx("kbd",{children:"n"}),"/",S.jsx("kbd",{children:"p"})," 切换 hunk,",S.jsx("kbd",{children:"r"})," 刷新"]})]})});let d;return!n||n.status==="loading"?d=S.jsx("div",{className:"placeholder",children:"加载 diff…"}):n.status==="error"?d=S.jsxs("div",{className:"placeholder error-box",children:[n.message," ",S.jsx("button",{className:"link",onClick:()=>{a(e,!0)},children:"重试"})]}):n.diff.binary?d=S.jsx("div",{className:"placeholder",children:"二进制文件,不展示 diff"}):n.diff.hunks.length===0?d=S.jsx("div",{className:"placeholder",children:t.oldMode&&t.newMode?`仅文件模式变更:${t.oldMode} → ${t.newMode}`:t.status==="renamed"?"仅重命名,内容无变化":"空文件 / 无内容变化"}):f>XC&&l!==e?d=S.jsxs("div",{className:"placeholder",children:[S.jsxs("p",{children:["该文件 diff 有 ",f," 行,默认不渲染。"]}),S.jsx("button",{className:"primary",onClick:()=>c(e),children:"仍然渲染"})]}):d=S.jsx(QC,{diff:n.diff},e+":"+n.diff.contentHash),S.jsxs("div",{className:"diff-panel",children:[S.jsx(JC,{entry:t}),d]})}const wm=200,e_=3,vm={q:"",author:"",path:""},t_=(e,t)=>e.q===t.q&&e.author===t.author&&e.path===t.path;function dl(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`}function n_(e,t){const n=dl(e);if(n===dl(t))return"今天";const i=new Date(t);return i.setDate(t.getDate()-1),n===dl(i)?"昨天":e.toLocaleDateString(void 0,{...e.getFullYear()!==t.getFullYear()?{year:"numeric"}:{},month:"short",day:"numeric",weekday:"short"})}function r_(e){const t=/^(.*?)\s*\((#\d+)\)\s*$/.exec(e);return t?{text:t[1]??"",pr:t[2]??null}:{text:e,pr:null}}function i_({refs:e,head:t}){const n=t&&e[0]?.kind==="branch";if(e.length===0&&!t)return null;const i=e.slice(0,e_),o=e.length-i.length,a=e.map(l=>l.kind==="tag"?`tag: ${l.name}`:l.name).join(", ");return S.jsxs("span",{className:"refs",title:a,children:[t&&!n&&S.jsx("span",{className:"ref ref-head",children:"HEAD"}),i.map((l,c)=>S.jsx("span",{className:`ref ref-${l.kind} ${n&&c===0?"ref-head":""}`,children:l.name},`${l.kind}:${l.name}`)),o>0&&S.jsxs("span",{className:"ref ref-more",children:["+",o]})]})}function s_({active:e}){const t=G(O=>O.root),n=G(O=>O.targetKey),i=G(O=>O.setTarget),o=G(O=>O.showToast),a=G(O=>O.repo?.worktrees.find(_=>_.path===O.root)?.head??O.repo?.head??""),[l,c]=Q.useState([]),[f,d]=Q.useState(!1),[p,m]=Q.useState(!1),[w,v]=Q.useState(vm),[k,E]=Q.useState(vm),[N,C]=Q.useState(!1),b=Q.useRef(null),A=Q.useRef(0),B=Q.useRef(0),P=Q.useMemo(()=>pl(n).worktree,[n]),M=Q.useMemo(()=>{const O=pl(n);return O.kind==="commit"?O.sha:null},[n]),ee=Q.useCallback(O=>E(_=>t_(_,O)?_:O),[]);Q.useEffect(()=>{const O=setTimeout(()=>ee(w),300);return()=>clearTimeout(O)},[w,ee]);const oe=O=>{O.key==="Enter"&&ee(w)},ae=Q.useRef(a),F=Q.useCallback(async(O={})=>{const _=++B.current;m(!0);try{const L=await ze.commits({root:t,ref:ae.current||void 0,q:k.q||void 0,author:k.author||void 0,path:k.path||void 0,firstParent:N,offset:O.offset,limit:O.limit??wm});if(_!==B.current)return;c(V=>{if(!O.offset)return L.commits;const I=new Set(V.map(ue=>ue.sha));return[...V,...L.commits.filter(ue=>!I.has(ue.sha))]}),d(L.hasMore)}catch(L){_===B.current&&o(L instanceof Error?L.message:String(L),"error")}finally{_===B.current&&m(!1)}},[t,k,N,o]),ne=Q.useRef(F);ne.current=F;const re=Q.useRef(0);re.current=l.length;const de=Q.useRef(a);Q.useEffect(()=>{c([]),d(!1),A.current=0,b.current&&(b.current.scrollTop=0),de.current=a,ae.current=a,F()},[F]),Q.useEffect(()=>{de.current!==a&&(de.current=a,ae.current=a,ne.current({limit:Math.min(Math.max(re.current,wm),1e3)}))},[a]),Q.useLayoutEffect(()=>{e&&b.current&&(b.current.scrollTop=A.current)},[e]);const ie=()=>{l.length>0&&!p&&f&&F({offset:l.length})},X=()=>{const O=b.current;O&&(A.current=O.scrollTop,O.scrollTop+O.clientHeight>=O.scrollHeight-300&&ie())},ge=Q.useMemo(()=>{const O=new Date,_=[];let L="";for(const V of l){const I=new Date(V.date),ue=Number.isNaN(I.getTime())?"":dl(I);(ue!==L||_.length===0)&&(L=ue,_.push({kind:"day",key:`day:${ue}:${_.length}`,label:ue?n_(I,O):"未知日期"})),_.push({kind:"commit",c:V})}return _},[l]),me=!!(k.q||k.author||k.path||N),J=p&&l.length===0?"加载中…":f?`已加载 ${l.length} 条`:`共 ${l.length} 条`;return S.jsxs("div",{className:"commits-panel",hidden:!e,children:[S.jsxs("div",{className:"commits-tools",children:[S.jsx("input",{className:"search",value:w.q,onChange:O=>v({...w,q:O.target.value}),onKeyDown:oe,placeholder:"搜索 message 或 sha",spellCheck:!1,"aria-label":"搜索 commit message 或 sha"}),S.jsx("input",{value:w.author,onChange:O=>v({...w,author:O.target.value}),onKeyDown:oe,placeholder:"作者",spellCheck:!1,"aria-label":"按作者过滤"}),S.jsx("input",{className:"mono path",value:w.path,onChange:O=>v({...w,path:O.target.value}),onKeyDown:oe,placeholder:"路径",spellCheck:!1,"aria-label":"按路径过滤"}),S.jsx("button",{className:"toggle","aria-pressed":N,onClick:()=>C(!N),title:"只沿第一父提交走(git log --first-parent):合并进来的分支折叠成它们的 merge commit",children:"主线"}),S.jsx("span",{className:"muted commits-count",children:J})]}),S.jsxs("div",{className:"commits-list",ref:b,onScroll:X,children:[ge.map(O=>{if(O.kind==="day")return S.jsx("div",{className:"commit-day",children:O.label},O.key);const _=O.c,L=new Date(_.date),V=Number.isNaN(L.getTime())?"":L.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),{text:I,pr:ue}=r_(_.subject),Se=!!M&&(_.sha===M||_.sha.startsWith(M));return S.jsxs("div",{className:`commit-row ${Se?"active":""}`,onClick:()=>{i($n({kind:"commit",sha:_.sha,...P?{worktree:P}:{}}))},title:`${_.sha}
|
|
164
|
-
${_.author} <${_.email}>
|
|
165
|
-
${L.toLocaleString()}`,children:[S.jsx("span",{className:"mono sha",children:_.shortSha}),S.jsxs("span",{className:"subject",children:[I,ue&&S.jsx("span",{className:"pr",children:ue})]}),S.jsx(i_,{refs:_.refs,head:_.head}),_.parents.length>1&&S.jsx("span",{className:"badge",children:"merge"}),S.jsx("span",{className:"author",children:_.author}),S.jsx("span",{className:"time",children:V})]},_.sha)}),S.jsxs("div",{className:"commits-foot muted",children:[p&&l.length>0&&"加载中…",!p&&f&&S.jsx("button",{className:"link",onClick:ie,children:"加载更多"}),!p&&!f&&l.length>0&&"已到最早的 commit",!p&&l.length===0&&(me?"没有匹配的 commit":"没有 commit")]})]})]})}const o_=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,l_=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,a_={};function km(e,t){return(a_.jsx?l_:o_).test(e)}var yi={},tc,xm;function u_(){if(xm)return tc;xm=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=`
|
|
166
|
-
`,d="/",p="*",m="",w="comment",v="declaration";function k(N,C){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];C=C||{};var b=1,A=1;function B(ie){var X=ie.match(t);X&&(b+=X.length);var ge=ie.lastIndexOf(f);A=~ge?ie.length-ge:A+ie.length}function P(){var ie={line:b,column:A};return function(X){return X.position=new M(ie),ae(),X}}function M(ie){this.start=ie,this.end={line:b,column:A},this.source=C.source}M.prototype.content=N;function ee(ie){var X=new Error(C.source+":"+b+":"+A+": "+ie);if(X.reason=ie,X.filename=C.source,X.line=b,X.column=A,X.source=N,!C.silent)throw X}function oe(ie){var X=ie.exec(N);if(X){var ge=X[0];return B(ge),N=N.slice(ge.length),X}}function ae(){oe(n)}function F(ie){var X;for(ie=ie||[];X=ne();)X!==!1&&ie.push(X);return ie}function ne(){var ie=P();if(!(d!=N.charAt(0)||p!=N.charAt(1))){for(var X=2;m!=N.charAt(X)&&(p!=N.charAt(X)||d!=N.charAt(X+1));)++X;if(X+=2,m===N.charAt(X-1))return ee("End of comment missing");var ge=N.slice(2,X-2);return A+=2,B(ge),N=N.slice(X),A+=2,ie({type:w,comment:ge})}}function re(){var ie=P(),X=oe(i);if(X){if(ne(),!oe(o))return ee("property missing ':'");var ge=oe(a),me=ie({type:v,property:E(X[0].replace(e,m)),value:ge?E(ge[0].replace(e,m)):m});return oe(l),me}}function de(){var ie=[];F(ie);for(var X;X=re();)X!==!1&&(ie.push(X),F(ie));return ie}return ae(),de()}function E(N){return N?N.replace(c,m):m}return tc=k,tc}var Sm;function c_(){if(Sm)return yi;Sm=1;var e=yi&&yi.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(yi,"__esModule",{value:!0}),yi.default=n;const t=e(u_());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 yi}var ms={},Cm;function f_(){if(Cm)return ms;Cm=1,Object.defineProperty(ms,"__esModule",{value:!0}),ms.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 ms.camelCase=f,ms}var gs,_m;function d_(){if(_m)return gs;_m=1;var e=gs&&gs.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(c_()),n=f_();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,gs=i,gs}var h_=d_();const p_=Wc(h_),Ey=by("end"),ff=by("start");function by(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 m_(e){const t=ff(e),n=Ey(e);if(t&&n)return{start:t,end:n}}function Cs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Em(e.position):"start"in e||"end"in e?Em(e):"line"in e||"column"in e?Dc(e):""}function Dc(e){return bm(e&&e.line)+":"+bm(e&&e.column)}function Em(e){return Dc(e&&e.start)+"-"+Dc(e&&e.end)}function bm(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=Cs(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 df={}.hasOwnProperty,g_=new Map,y_=/[A-Z]/g,w_=new Set(["table","tbody","thead","tfoot","tr"]),v_=new Set(["td","th"]),Iy="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function k_(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=N_(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=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"?Os:Fg,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Ny(o,e,void 0);return a&&typeof a!="string"?a:o.create(e,o.Fragment,{children:a||void 0},void 0)}function Ny(e,t,n){if(t.type==="element")return x_(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return S_(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return __(e,t,n);if(t.type==="mdxjsEsm")return C_(e,t);if(t.type==="root")return E_(e,t,n);if(t.type==="text")return b_(e,t)}function x_(e,t,n){const i=e.schema;let o=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(o=Os,e.schema=o),e.ancestors.push(t);const a=Ay(e,t.tagName,!1),l=T_(e,t);let c=pf(e,t);return w_.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!Rl(f):!0})),Ty(e,l,a,t),hf(l,c),e.ancestors.pop(),e.schema=i,e.create(t,a,l,n)}function S_(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)}Ps(e,t.position)}function C_(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ps(e,t.position)}function __(e,t,n){const i=e.schema;let o=i;t.name==="svg"&&i.space==="html"&&(o=Os,e.schema=o),e.ancestors.push(t);const a=t.name===null?e.Fragment:Ay(e,t.name,!0),l=A_(e,t),c=pf(e,t);return Ty(e,l,a,t),hf(l,c),e.ancestors.pop(),e.schema=i,e.create(t,a,l,n)}function E_(e,t,n){const i={};return hf(i,pf(e,t)),e.create(t,e.Fragment,i,n)}function b_(e,t){return t.value}function Ty(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function hf(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function I_(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 N_(e,t){return n;function n(i,o,a,l){const c=Array.isArray(a.children),f=ff(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 T_(e,t){const n={};let i,o;for(o in t.properties)if(o!=="children"&&df.call(t.properties,o)){const a=P_(e,o,t.properties[o]);if(a){const[l,c]=a;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&v_.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 A_(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 Ps(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 Ps(e,t.position);else a=i.value===null?!0:i.value;n[o]=a}return n}function pf(e,t){const n=[];let i=-1;const o=e.passKeys?new Map:g_;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=Ny(e,a,l);c!==void 0&&n.push(c)}return n}function P_(e,t,n){const i=Dg(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?zg(n):Bg(n)),i.property==="style"){let o=typeof n=="object"?n:R_(e,String(n));return e.stylePropertyNameCase==="css"&&(o=L_(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&i.space?n0[i.property]||i.property:i.attribute,n]}}function R_(e,t){try{return p_(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=Iy+"#cannot-parse-style-attribute",o}}function Ay(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=km(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=km(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const o=i.value;return df.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(i);Ps(e)}function Ps(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=Iy+"#cannot-handle-mdx-estrees-without-createevaluater",n}function L_(e){const t={};let n;for(n in e)df.call(e,n)&&(t[j_(n)]=e[n]);return t}function j_(e){let t=e.replace(y_,O_);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function O_(e){return"-"+e.toLowerCase()}const nc={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"]},M_={};function mf(e,t){const n=M_,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Py(e,i,o)}function Py(e,t,n){if(D_(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 Im(e.children,t,n)}return Array.isArray(e)?Im(e,t,n):""}function Im(e,t,n){const i=[];let o=-1;for(;++o<e.length;)i[o]=Py(e[o],t,n);return i.join("")}function D_(e){return!!(e&&typeof e=="object")}const Nm=document.createElement("i");function gf(e){const t="&"+e+";";Nm.innerHTML=t;const n=Nm.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function qt(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 rn(e,t){return e.length>0?(qt(e,e.length,0,t),e):t}const Tm={}.hasOwnProperty;function Ry(e){const t={};let n=-1;for(;++n<e.length;)F_(t,e[n]);return t}function F_(e,t){let n;for(n in t){const o=(Tm.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){Tm.call(o,l)||(o[l]=[]);const c=a[l];$_(o[l],Array.isArray(c)?c:c?[c]:[])}}}function $_(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);qt(e,0,0,i)}function Ly(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 gn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Rt=mr(/[A-Za-z]/),Nt=mr(/[\dA-Za-z]/),z_=mr(/[#-'*+\--9=?A-Z^-~]/);function Nl(e){return e!==null&&(e<32||e===127)}const Fc=mr(/\d/),B_=mr(/[\dA-Fa-f]/),U_=mr(/[!-/:-@[-`{-~]/);function xe(e){return e!==null&&e<-2}function Ge(e){return e!==null&&(e<0||e===32)}function Le(e){return e===-2||e===-1||e===32}const $l=mr(new RegExp("\\p{P}|\\p{S}","u")),zr=mr(/\s/);function mr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ti(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 Me(e,t,n,i){const o=i?i-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(f){return Le(f)?(e.enter(n),c(f)):t(f)}function c(f){return Le(f)&&a++<o?(e.consume(f),c):(e.exit(n),t(f))}}const V_={tokenize:G_};function G_(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"),Me(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 xe(c)?(e.consume(c),e.exit("chunkText"),a):(e.consume(c),l)}}const W_={tokenize:H_},Am={tokenize:q_};function H_(e){const t=this,n=[];let i=0,o,a,l;return c;function c(A){if(i<n.length){const B=n[i];return t.containerState=B[1],e.attempt(B[0].continuation,f,d)(A)}return d(A)}function f(A){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&b();const B=t.events.length;let P=B,M;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){M=t.events[P][1].end;break}C(i);let ee=B;for(;ee<t.events.length;)t.events[ee][1].end={...M},ee++;return qt(t.events,P+1,0,t.events.slice(B)),t.events.length=ee,d(A)}return c(A)}function d(A){if(i===n.length){if(!o)return w(A);if(o.currentConstruct&&o.currentConstruct.concrete)return k(A);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Am,p,m)(A)}function p(A){return o&&b(),C(i),w(A)}function m(A){return t.parser.lazy[t.now().line]=i!==n.length,l=t.now().offset,k(A)}function w(A){return t.containerState={},e.attempt(Am,v,k)(A)}function v(A){return i++,n.push([t.currentConstruct,t.containerState]),w(A)}function k(A){if(A===null){o&&b(),C(0),e.consume(A);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:a}),E(A)}function E(A){if(A===null){N(e.exit("chunkFlow"),!0),C(0),e.consume(A);return}return xe(A)?(e.consume(A),N(e.exit("chunkFlow")),i=0,t.interrupt=void 0,c):(e.consume(A),E)}function N(A,B){const P=t.sliceStream(A);if(B&&P.push(null),A.previous=a,a&&(a.next=A),a=A,o.defineSkip(A.start),o.write(P),t.parser.lazy[A.start.line]){let M=o.events.length;for(;M--;)if(o.events[M][1].start.offset<l&&(!o.events[M][1].end||o.events[M][1].end.offset>l))return;const ee=t.events.length;let oe=ee,ae,F;for(;oe--;)if(t.events[oe][0]==="exit"&&t.events[oe][1].type==="chunkFlow"){if(ae){F=t.events[oe][1].end;break}ae=!0}for(C(i),M=ee;M<t.events.length;)t.events[M][1].end={...F},M++;qt(t.events,oe+1,0,t.events.slice(ee)),t.events.length=M}}function C(A){let B=n.length;for(;B-- >A;){const P=n[B];t.containerState=P[1],P[0].exit.call(t,e)}n.length=A}function b(){o.write([null]),a=void 0,o=void 0,t.containerState._closeFlow=void 0}}function q_(e,t,n){return Me(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function _i(e){if(e===null||Ge(e)||zr(e))return 1;if($l(e))return 2}function zl(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 $c={name:"attention",resolveAll:K_,tokenize:Q_};function K_(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},w={...e[n][1].start};Pm(m,-f),Pm(w,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:w},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=rn(d,[["enter",e[i][1],t],["exit",e[i][1],t]])),d=rn(d,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",a,t]]),d=rn(d,zl(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),d=rn(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=rn(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,qt(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 Q_(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,o=_i(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=_i(f),m=!p||p===2&&o||n.includes(f),w=!o||o===2&&p||n.includes(i);return d._open=!!(a===42?m:m&&(o||!w)),d._close=!!(a===42?w:w&&(p||!m)),t(f)}}function Pm(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const X_={name:"autolink",tokenize:Y_};function Y_(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 Rt(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||Nl(v)?n(v):(e.consume(v),f)}function d(v){return v===64?(e.consume(v),p):z_(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):w(v)}function w(v){if((v===45||Nt(v))&&i++<63){const k=v===45?w:m;return e.consume(v),k}return n(v)}}const Ds={partial:!0,tokenize:J_};function J_(e,t,n){return i;function i(a){return Le(a)?Me(e,o,"linePrefix")(a):o(a)}function o(a){return a===null||xe(a)?t(a):n(a)}}const jy={continuation:{tokenize:eE},exit:tE,name:"blockQuote",tokenize:Z_};function Z_(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 Le(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function eE(e,t,n){const i=this;return o;function o(l){return Le(l)?Me(e,a,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(jy,t,n)(l)}}function tE(e){e.exit("blockQuote")}const Oy={name:"characterEscape",tokenize:nE};function nE(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 U_(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const My={name:"characterReference",tokenize:rE};function rE(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=B_,p):(e.enter("characterReferenceValue"),a=7,l=Fc,p(m))}function p(m){if(m===59&&o){const w=e.exit("characterReferenceValue");return l===Nt&&!gf(i.sliceSerialize(w))?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 Rm={partial:!0,tokenize:sE},Lm={concrete:!0,name:"codeFenced",tokenize:iE};function iE(e,t,n){const i=this,o={partial:!0,tokenize:P};let a=0,l=0,c;return f;function f(M){return d(M)}function d(M){const ee=i.events[i.events.length-1];return a=ee&&ee[1].type==="linePrefix"?ee[2].sliceSerialize(ee[1],!0).length:0,c=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(M)}function p(M){return M===c?(l++,e.consume(M),p):l<3?n(M):(e.exit("codeFencedFenceSequence"),Le(M)?Me(e,m,"whitespace")(M):m(M))}function m(M){return M===null||xe(M)?(e.exit("codeFencedFence"),i.interrupt?t(M):e.check(Rm,E,B)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),w(M))}function w(M){return M===null||xe(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(M)):Le(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Me(e,v,"whitespace")(M)):M===96&&M===c?n(M):(e.consume(M),w)}function v(M){return M===null||xe(M)?m(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(M))}function k(M){return M===null||xe(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(M)):M===96&&M===c?n(M):(e.consume(M),k)}function E(M){return e.attempt(o,B,N)(M)}function N(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),C}function C(M){return a>0&&Le(M)?Me(e,b,"linePrefix",a+1)(M):b(M)}function b(M){return M===null||xe(M)?e.check(Rm,E,B)(M):(e.enter("codeFlowValue"),A(M))}function A(M){return M===null||xe(M)?(e.exit("codeFlowValue"),b(M)):(e.consume(M),A)}function B(M){return e.exit("codeFenced"),t(M)}function P(M,ee,oe){let ae=0;return F;function F(X){return M.enter("lineEnding"),M.consume(X),M.exit("lineEnding"),ne}function ne(X){return M.enter("codeFencedFence"),Le(X)?Me(M,re,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X):re(X)}function re(X){return X===c?(M.enter("codeFencedFenceSequence"),de(X)):oe(X)}function de(X){return X===c?(ae++,M.consume(X),de):ae>=l?(M.exit("codeFencedFenceSequence"),Le(X)?Me(M,ie,"whitespace")(X):ie(X)):oe(X)}function ie(X){return X===null||xe(X)?(M.exit("codeFencedFence"),ee(X)):oe(X)}}}function sE(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 rc={name:"codeIndented",tokenize:lE},oE={partial:!0,tokenize:aE};function lE(e,t,n){const i=this;return o;function o(d){return e.enter("codeIndented"),Me(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):xe(d)?e.attempt(oE,l,f)(d):(e.enter("codeFlowValue"),c(d))}function c(d){return d===null||xe(d)?(e.exit("codeFlowValue"),l(d)):(e.consume(d),c)}function f(d){return e.exit("codeIndented"),t(d)}}function aE(e,t,n){const i=this;return o;function o(l){return i.parser.lazy[i.now().line]?n(l):xe(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):Me(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):xe(l)?o(l):n(l)}}const uE={name:"codeText",previous:fE,resolve:cE,tokenize:dE};function cE(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 fE(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function dE(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)):xe(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||xe(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 hE{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&&ys(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),ys(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ys(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);ys(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ys(this.left,n.reverse())}}}function ys(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 Dy(e){const t={};let n=-1,i,o,a,l,c,f,d;const p=new hE(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,pE(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 qt(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!d}function pE(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,w=-1,v=n,k=0,E=0;const N=[E];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;++w<c.length;)c[w][0]==="exit"&&c[w-1][0]==="enter"&&c[w][1].type===c[w-1][1].type&&c[w][1].start.line!==c[w][1].end.line&&(E=w+1,N.push(E),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(),w=N.length;w--;){const C=c.slice(N[w],N[w+1]),b=a.pop();f.push([b,b+C.length-1]),e.splice(b,2,C)}for(f.reverse(),w=-1;++w<f.length;)d[k+f[w][0]]=k+f[w][1],k+=f[w][1]-f[w][0]-1;return d}const mE={resolve:yE,tokenize:wE},gE={partial:!0,tokenize:vE};function yE(e){return Dy(e),e}function wE(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):xe(c)?e.check(gE,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 vE(e,t,n){const i=this;return o;function o(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Me(e,a,"linePrefix")}function a(l){if(l===null||xe(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 Fy(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),w):C===null||C===32||C===41||Nl(C)?n(C):(e.enter(i),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),E(C))}function w(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),w(C)):C===null||C===60||xe(C)?n(C):(e.consume(C),C===92?k:v)}function k(C){return C===60||C===62||C===92?(e.consume(C),v):v(C)}function E(C){return!p&&(C===null||C===41||Ge(C))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(i),t(C)):p<d&&C===40?(e.consume(C),p++,E):C===41?(e.consume(C),p--,E):C===null||C===32||C===40||Nl(C)?n(C):(e.consume(C),C===92?N:E)}function N(C){return C===40||C===41||C===92?(e.consume(C),E):E(C)}}function $y(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):xe(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||xe(v)||c++>999?(e.exit("chunkString"),p(v)):(e.consume(v),f||(f=!Le(v)),v===92?w:m)}function w(v){return v===91||v===92||v===93?(e.consume(v),c++,m):m(v)}}function zy(e,t,n,i,o,a){let l;return c;function c(w){return w===34||w===39||w===40?(e.enter(i),e.enter(o),e.consume(w),e.exit(o),l=w===40?41:w,f):n(w)}function f(w){return w===l?(e.enter(o),e.consume(w),e.exit(o),e.exit(i),t):(e.enter(a),d(w))}function d(w){return w===l?(e.exit(a),f(l)):w===null?n(w):xe(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),Me(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===l||w===null||xe(w)?(e.exit("chunkString"),d(w)):(e.consume(w),w===92?m:p)}function m(w){return w===l||w===92?(e.consume(w),p):p(w)}}function _s(e,t){let n;return i;function i(o){return xe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):Le(o)?Me(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}const kE={name:"definition",tokenize:SE},xE={partial:!0,tokenize:CE};function SE(e,t,n){const i=this;let o;return a;function a(v){return e.enter("definition"),l(v)}function l(v){return $y.call(i,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return o=gn(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 Ge(v)?_s(e,d)(v):d(v)}function d(v){return Fy(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(xE,m,m)(v)}function m(v){return Le(v)?Me(e,w,"whitespace")(v):w(v)}function w(v){return v===null||xe(v)?(e.exit("definition"),i.parser.defined.push(o),t(v)):n(v)}}function CE(e,t,n){return i;function i(c){return Ge(c)?_s(e,o)(c):n(c)}function o(c){return zy(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function a(c){return Le(c)?Me(e,l,"whitespace")(c):l(c)}function l(c){return c===null||xe(c)?t(c):n(c)}}const _E={name:"hardBreakEscape",tokenize:EE};function EE(e,t,n){return i;function i(a){return e.enter("hardBreakEscape"),e.consume(a),o}function o(a){return xe(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const bE={name:"headingAtx",resolve:IE,tokenize:NE};function IE(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"},qt(e,i,n-i+1,[["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t]])),e}function NE(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||Ge(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),f(p)):p===null||xe(p)?(e.exit("atxHeading"),t(p)):Le(p)?Me(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||Ge(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),d)}}const TE=["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"],jm=["pre","script","style","textarea"],AE={concrete:!0,name:"htmlFlow",resolveTo:LE,tokenize:jE},PE={partial:!0,tokenize:ME},RE={partial:!0,tokenize:OE};function LE(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 jE(e,t,n){const i=this;let o,a,l,c,f;return d;function d(I){return p(I)}function p(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),m}function m(I){return I===33?(e.consume(I),w):I===47?(e.consume(I),a=!0,E):I===63?(e.consume(I),o=3,i.interrupt?t:_):Rt(I)?(e.consume(I),l=String.fromCharCode(I),N):n(I)}function w(I){return I===45?(e.consume(I),o=2,v):I===91?(e.consume(I),o=5,c=0,k):Rt(I)?(e.consume(I),o=4,i.interrupt?t:_):n(I)}function v(I){return I===45?(e.consume(I),i.interrupt?t:_):n(I)}function k(I){const ue="CDATA[";return I===ue.charCodeAt(c++)?(e.consume(I),c===ue.length?i.interrupt?t:re:k):n(I)}function E(I){return Rt(I)?(e.consume(I),l=String.fromCharCode(I),N):n(I)}function N(I){if(I===null||I===47||I===62||Ge(I)){const ue=I===47,Se=l.toLowerCase();return!ue&&!a&&jm.includes(Se)?(o=1,i.interrupt?t(I):re(I)):TE.includes(l.toLowerCase())?(o=6,ue?(e.consume(I),C):i.interrupt?t(I):re(I)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(I):a?b(I):A(I))}return I===45||Nt(I)?(e.consume(I),l+=String.fromCharCode(I),N):n(I)}function C(I){return I===62?(e.consume(I),i.interrupt?t:re):n(I)}function b(I){return Le(I)?(e.consume(I),b):F(I)}function A(I){return I===47?(e.consume(I),F):I===58||I===95||Rt(I)?(e.consume(I),B):Le(I)?(e.consume(I),A):F(I)}function B(I){return I===45||I===46||I===58||I===95||Nt(I)?(e.consume(I),B):P(I)}function P(I){return I===61?(e.consume(I),M):Le(I)?(e.consume(I),P):A(I)}function M(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),f=I,ee):Le(I)?(e.consume(I),M):oe(I)}function ee(I){return I===f?(e.consume(I),f=null,ae):I===null||xe(I)?n(I):(e.consume(I),ee)}function oe(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||Ge(I)?P(I):(e.consume(I),oe)}function ae(I){return I===47||I===62||Le(I)?A(I):n(I)}function F(I){return I===62?(e.consume(I),ne):n(I)}function ne(I){return I===null||xe(I)?re(I):Le(I)?(e.consume(I),ne):n(I)}function re(I){return I===45&&o===2?(e.consume(I),ge):I===60&&o===1?(e.consume(I),me):I===62&&o===4?(e.consume(I),L):I===63&&o===3?(e.consume(I),_):I===93&&o===5?(e.consume(I),O):xe(I)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(PE,V,de)(I)):I===null||xe(I)?(e.exit("htmlFlowData"),de(I)):(e.consume(I),re)}function de(I){return e.check(RE,ie,V)(I)}function ie(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),X}function X(I){return I===null||xe(I)?de(I):(e.enter("htmlFlowData"),re(I))}function ge(I){return I===45?(e.consume(I),_):re(I)}function me(I){return I===47?(e.consume(I),l="",J):re(I)}function J(I){if(I===62){const ue=l.toLowerCase();return jm.includes(ue)?(e.consume(I),L):re(I)}return Rt(I)&&l.length<8?(e.consume(I),l+=String.fromCharCode(I),J):re(I)}function O(I){return I===93?(e.consume(I),_):re(I)}function _(I){return I===62?(e.consume(I),L):I===45&&o===2?(e.consume(I),_):re(I)}function L(I){return I===null||xe(I)?(e.exit("htmlFlowData"),V(I)):(e.consume(I),L)}function V(I){return e.exit("htmlFlow"),t(I)}}function OE(e,t,n){const i=this;return o;function o(l){return xe(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 ME(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Ds,t,n)}}const DE={name:"htmlText",tokenize:FE};function FE(e,t,n){const i=this;let o,a,l;return c;function c(_){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(_),f}function f(_){return _===33?(e.consume(_),d):_===47?(e.consume(_),P):_===63?(e.consume(_),A):Rt(_)?(e.consume(_),oe):n(_)}function d(_){return _===45?(e.consume(_),p):_===91?(e.consume(_),a=0,k):Rt(_)?(e.consume(_),b):n(_)}function p(_){return _===45?(e.consume(_),v):n(_)}function m(_){return _===null?n(_):_===45?(e.consume(_),w):xe(_)?(l=m,me(_)):(e.consume(_),m)}function w(_){return _===45?(e.consume(_),v):m(_)}function v(_){return _===62?ge(_):_===45?w(_):m(_)}function k(_){const L="CDATA[";return _===L.charCodeAt(a++)?(e.consume(_),a===L.length?E:k):n(_)}function E(_){return _===null?n(_):_===93?(e.consume(_),N):xe(_)?(l=E,me(_)):(e.consume(_),E)}function N(_){return _===93?(e.consume(_),C):E(_)}function C(_){return _===62?ge(_):_===93?(e.consume(_),C):E(_)}function b(_){return _===null||_===62?ge(_):xe(_)?(l=b,me(_)):(e.consume(_),b)}function A(_){return _===null?n(_):_===63?(e.consume(_),B):xe(_)?(l=A,me(_)):(e.consume(_),A)}function B(_){return _===62?ge(_):A(_)}function P(_){return Rt(_)?(e.consume(_),M):n(_)}function M(_){return _===45||Nt(_)?(e.consume(_),M):ee(_)}function ee(_){return xe(_)?(l=ee,me(_)):Le(_)?(e.consume(_),ee):ge(_)}function oe(_){return _===45||Nt(_)?(e.consume(_),oe):_===47||_===62||Ge(_)?ae(_):n(_)}function ae(_){return _===47?(e.consume(_),ge):_===58||_===95||Rt(_)?(e.consume(_),F):xe(_)?(l=ae,me(_)):Le(_)?(e.consume(_),ae):ge(_)}function F(_){return _===45||_===46||_===58||_===95||Nt(_)?(e.consume(_),F):ne(_)}function ne(_){return _===61?(e.consume(_),re):xe(_)?(l=ne,me(_)):Le(_)?(e.consume(_),ne):ae(_)}function re(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),o=_,de):xe(_)?(l=re,me(_)):Le(_)?(e.consume(_),re):(e.consume(_),ie)}function de(_){return _===o?(e.consume(_),o=void 0,X):_===null?n(_):xe(_)?(l=de,me(_)):(e.consume(_),de)}function ie(_){return _===null||_===34||_===39||_===60||_===61||_===96?n(_):_===47||_===62||Ge(_)?ae(_):(e.consume(_),ie)}function X(_){return _===47||_===62||Ge(_)?ae(_):n(_)}function ge(_){return _===62?(e.consume(_),e.exit("htmlTextData"),e.exit("htmlText"),t):n(_)}function me(_){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),J}function J(_){return Le(_)?Me(e,O,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):O(_)}function O(_){return e.enter("htmlTextData"),l(_)}}const yf={name:"labelEnd",resolveAll:UE,resolveTo:VE,tokenize:GE},$E={tokenize:WE},zE={tokenize:HE},BE={tokenize:qE};function UE(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&&qt(e,0,e.length,n),e}function VE(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=rn(c,e.slice(a+1,a+i+3)),c=rn(c,[["enter",p,t]]),c=rn(c,zl(t.parser.constructs.insideSpan.null,e.slice(a+i+4,l-3),t)),c=rn(c,[["exit",p,t],e[l-2],e[l-1],["exit",d,t]]),c=rn(c,e.slice(l+1)),c=rn(c,[["exit",f,t]]),qt(e,a,e.length,c),e}function GE(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(w){return a?a._inactive?m(w):(l=i.parser.defined.includes(gn(i.sliceSerialize({start:a.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(w),e.exit("labelMarker"),e.exit("labelEnd"),f):n(w)}function f(w){return w===40?e.attempt($E,p,l?p:m)(w):w===91?e.attempt(zE,p,l?d:m)(w):l?p(w):m(w)}function d(w){return e.attempt(BE,p,m)(w)}function p(w){return t(w)}function m(w){return a._balanced=!0,n(w)}}function WE(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 Ge(m)?_s(e,a)(m):a(m)}function a(m){return m===41?p(m):Fy(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function l(m){return Ge(m)?_s(e,f)(m):p(m)}function c(m){return n(m)}function f(m){return m===34||m===39||m===40?zy(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function d(m){return Ge(m)?_s(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 HE(e,t,n){const i=this;return o;function o(c){return $y.call(i,e,a,l,"reference","referenceMarker","referenceString")(c)}function a(c){return i.parser.defined.includes(gn(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function qE(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 KE={name:"labelStartImage",resolveAll:yf.resolveAll,tokenize:QE};function QE(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 XE={name:"labelStartLink",resolveAll:yf.resolveAll,tokenize:YE};function YE(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 ic={name:"lineEnding",tokenize:JE};function JE(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),Me(e,t,"linePrefix")}}const hl={name:"thematicBreak",tokenize:ZE};function ZE(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||xe(d))?(e.exit("thematicBreak"),t(d)):n(d)}function f(d){return d===o?(e.consume(d),i++,f):(e.exit("thematicBreakSequence"),Le(d)?Me(e,c,"whitespace")(d):c(d))}}const $t={continuation:{tokenize:rb},exit:sb,name:"list",tokenize:nb},eb={partial:!0,tokenize:ob},tb={partial:!0,tokenize:ib};function nb(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 k=i.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!i.containerState.marker||v===i.containerState.marker:Fc(v)){if(i.containerState.type||(i.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(hl,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 Fc(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(Ds,i.interrupt?n:p,e.attempt(eb,w,m))}function p(v){return i.containerState.initialBlankLine=!0,a++,w(v)}function m(v){return Le(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),w):n(v)}function w(v){return i.containerState.size=a+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function rb(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(Ds,o,a);function o(c){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Me(e,t,"listItemIndent",i.containerState.size+1)(c)}function a(c){return i.containerState.furtherBlankLines||!Le(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(tb,t,l)(c))}function l(c){return i.containerState._closeFlow=!0,i.interrupt=void 0,Me(e,e.attempt($t,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function ib(e,t,n){const i=this;return Me(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 sb(e){e.exit(this.containerState.type)}function ob(e,t,n){const i=this;return Me(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!Le(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const Om={name:"setextUnderline",resolveTo:lb,tokenize:ab};function lb(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 ab(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"),Le(d)?Me(e,f,"lineSuffix")(d):f(d))}function f(d){return d===null||xe(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const ub={tokenize:cb};function cb(e){const t=this,n=e.attempt(Ds,i,e.attempt(this.parser.constructs.flowInitial,o,Me(e,e.attempt(this.parser.constructs.flow,o,e.attempt(mE,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 fb={resolveAll:Uy()},db=By("string"),hb=By("text");function By(e){return{resolveAll:Uy(e==="text"?pb: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 w=-1;if(m)for(;++w<m.length;){const v=m[w];if(!v.previous||v.previous.call(i,i.previous))return!0}return!1}}}function Uy(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 pb(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 mb={42:$t,43:$t,45:$t,48:$t,49:$t,50:$t,51:$t,52:$t,53:$t,54:$t,55:$t,56:$t,57:$t,62:jy},gb={91:kE},yb={[-2]:rc,[-1]:rc,32:rc},wb={35:bE,42:hl,45:[Om,hl],60:AE,61:Om,95:hl,96:Lm,126:Lm},vb={38:My,92:Oy},kb={[-5]:ic,[-4]:ic,[-3]:ic,33:KE,38:My,42:$c,60:[X_,DE],91:XE,92:[_E,Oy],93:yf,95:$c,96:uE},xb={null:[$c,fb]},Sb={null:[42,95]},Cb={null:[]},_b=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Sb,contentInitial:gb,disable:Cb,document:mb,flow:wb,flowInitial:yb,insideSpan:xb,string:vb,text:kb},Symbol.toStringTag,{value:"Module"}));function Eb(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:ee(P),check:ee(M),consume:b,enter:A,exit:B,interrupt:ee(M,{interrupt:!0})},d={code:null,containerState:{},defineSkip:E,events:[],now:k,parser:e,previous:null,sliceSerialize:w,sliceStream:v,write:m};let p=t.tokenize.call(d,f);return t.resolveAll&&a.push(t),d;function m(ne){return l=rn(l,ne),N(),l[l.length-1]!==null?[]:(oe(t,0),d.events=zl(a,d.events,d),d.events)}function w(ne,re){return Ib(v(ne),re)}function v(ne){return bb(l,ne)}function k(){const{_bufferIndex:ne,_index:re,line:de,column:ie,offset:X}=i;return{_bufferIndex:ne,_index:re,line:de,column:ie,offset:X}}function E(ne){o[ne.line]=ne.column,F()}function N(){let ne;for(;i._index<l.length;){const re=l[i._index];if(typeof re=="string")for(ne=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===ne&&i._bufferIndex<re.length;)C(re.charCodeAt(i._bufferIndex));else C(re)}}function C(ne){p=p(ne)}function b(ne){xe(ne)?(i.line++,i.column=1,i.offset+=ne===-3?2:1,F()):ne!==-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=ne}function A(ne,re){const de=re||{};return de.type=ne,de.start=k(),d.events.push(["enter",de,d]),c.push(de),de}function B(ne){const re=c.pop();return re.end=k(),d.events.push(["exit",re,d]),re}function P(ne,re){oe(ne,re.from)}function M(ne,re){re.restore()}function ee(ne,re){return de;function de(ie,X,ge){let me,J,O,_;return Array.isArray(ie)?V(ie):"tokenize"in ie?V([ie]):L(ie);function L(ye){return je;function je(Te){const De=Te!==null&&ye[Te],Ze=Te!==null&&ye.null,Kt=[...Array.isArray(De)?De:De?[De]:[],...Array.isArray(Ze)?Ze:Ze?[Ze]:[]];return V(Kt)(Te)}}function V(ye){return me=ye,J=0,ye.length===0?ge:I(ye[J])}function I(ye){return je;function je(Te){return _=ae(),O=ye,ye.partial||(d.currentConstruct=ye),ye.name&&d.parser.constructs.disable.null.includes(ye.name)?Se():ye.tokenize.call(re?Object.assign(Object.create(d),re):d,f,ue,Se)(Te)}}function ue(ye){return ne(O,_),X}function Se(ye){return _.restore(),++J<me.length?I(me[J]):ge}}}function oe(ne,re){ne.resolveAll&&!a.includes(ne)&&a.push(ne),ne.resolve&&qt(d.events,re,d.events.length-re,ne.resolve(d.events.slice(re),d)),ne.resolveTo&&(d.events=ne.resolveTo(d.events,d))}function ae(){const ne=k(),re=d.previous,de=d.currentConstruct,ie=d.events.length,X=Array.from(c);return{from:ie,restore:ge};function ge(){i=ne,d.previous=re,d.currentConstruct=de,d.events.length=ie,c=X,F()}}function F(){i.line in o&&i.column<2&&(i.column=o[i.line],i.offset+=o[i.line]-1)}}function bb(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 Ib(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=`
|
|
167
|
-
`;break}case-3:{l=`\r
|
|
168
|
-
`;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 Nb(e){const i={constructs:Ry([_b,...(e||{}).extensions||[]]),content:o(V_),defined:[],document:o(W_),flow:o(ub),lazy:{},string:o(db),text:o(hb)};return i;function o(a){return l;function l(c){return Eb(i,a,c)}}}function Tb(e){for(;!Dy(e););return e}const Mm=/[\0\t\n\r]/g;function Ab(){let e=1,t="",n=!0,i;return o;function o(a,l,c){const f=[];let d,p,m,w,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(Mm.lastIndex=m,d=Mm.exec(a),w=d&&d.index!==void 0?d.index:a.length,v=a.charCodeAt(w),!d){t=a.slice(m);break}if(v===10&&m===w&&i)f.push(-3),i=void 0;else switch(i&&(f.push(-5),i=void 0),m<w&&(f.push(a.slice(m,w)),e+=w-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=w+1}return c&&(i&&f.push(-5),t&&f.push(t),f.push(null)),f}}const Pb=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Rb(e){return e.replace(Pb,Lb)}function Lb(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),a=o===120||o===88;return Ly(n.slice(a?2:1),a?16:10)}return gf(n)||e}const Vy={}.hasOwnProperty;function jb(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Ob(n)(Tb(Nb(n).document().write(Ab()(e,t,!0))))}function Ob(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Ie),autolinkProtocol:ae,autolinkEmail:ae,atxHeading:a(H),blockQuote:a(Ze),characterEscape:ae,characterReference:ae,codeFenced:a(Kt),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Kt,l),codeText:a(Ur,l),codeTextData:ae,data:ae,codeFlowValue:ae,definition:a(Bn),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(U),hardBreakEscape:a(we),hardBreakTrailing:a(we),htmlFlow:a(Ce,l),htmlFlowData:ae,htmlText:a(Ce,l),htmlTextData:ae,image:a(Oe),label:l,link:a(Ie),listItem:a(st),listItemValue:w,listOrdered:a(qe,m),listUnordered:a(qe),paragraph:a(et),reference:I,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(H),strong:a(Un),thematicBreak:a($s)},exit:{atxHeading:f(),atxHeadingSequence:P,autolink:f(),autolinkEmail:De,autolinkProtocol:Te,blockQuote:f(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:Se,characterReferenceMarkerNumeric:Se,characterReferenceValue:ye,characterReference:je,codeFenced:f(N),codeFencedFence:E,codeFencedFenceInfo:v,codeFencedFenceMeta:k,codeFlowValue:F,codeIndented:f(C),codeText:f(X),codeTextData:F,data:F,definition:f(),definitionDestinationString:B,definitionLabelString:b,definitionTitleString:A,emphasis:f(),hardBreakEscape:f(re),hardBreakTrailing:f(re),htmlFlow:f(de),htmlFlowData:F,htmlText:f(ie),htmlTextData:F,image:f(me),label:O,labelText:J,lineEnding:ne,link:f(ge),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:ue,resourceDestinationString:_,resourceTitleString:L,resource:V,setextHeading:f(oe),setextHeadingLineSequence:ee,setextHeadingText:M,strong:f(),thematicBreak:f()}};Gy(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(W){let se={type:"root",children:[]};const _e={stack:[se],tokenStack:[],config:t,enter:c,exit:d,buffer:l,resume:p,data:n},Pe=[];let Fe=-1;for(;++Fe<W.length;)if(W[Fe][1].type==="listOrdered"||W[Fe][1].type==="listUnordered")if(W[Fe][0]==="enter")Pe.push(Fe);else{const yt=Pe.pop();Fe=o(W,yt,Fe)}for(Fe=-1;++Fe<W.length;){const yt=t[W[Fe][0]];Vy.call(yt,W[Fe][1].type)&&yt[W[Fe][1].type].call(Object.assign({sliceSerialize:W[Fe][2].sliceSerialize},_e),W[Fe][1])}if(_e.tokenStack.length>0){const yt=_e.tokenStack[_e.tokenStack.length-1];(yt[1]||Dm).call(_e,void 0,yt[0])}for(se.position={start:ur(W.length>0?W[0][1].start:{line:1,column:1,offset:0}),end:ur(W.length>0?W[W.length-2][1].end:{line:1,column:1,offset:0})},Fe=-1;++Fe<t.transforms.length;)se=t.transforms[Fe](se)||se;return se}function o(W,se,_e){let Pe=se-1,Fe=-1,yt=!1,bn,Qt,Vn,yr;for(;++Pe<=_e;){const wt=W[Pe];switch(wt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{wt[0]==="enter"?Fe++:Fe--,yr=void 0;break}case"lineEndingBlank":{wt[0]==="enter"&&(bn&&!yr&&!Fe&&!Vn&&(Vn=Pe),yr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:yr=void 0}if(!Fe&&wt[0]==="enter"&&wt[1].type==="listItemPrefix"||Fe===-1&&wt[0]==="exit"&&(wt[1].type==="listUnordered"||wt[1].type==="listOrdered")){if(bn){let yn=Pe;for(Qt=void 0;yn--;){const Bt=W[yn];if(Bt[1].type==="lineEnding"||Bt[1].type==="lineEndingBlank"){if(Bt[0]==="exit")continue;Qt&&(W[Qt][1].type="lineEndingBlank",yt=!0),Bt[1].type="lineEnding",Qt=yn}else if(!(Bt[1].type==="linePrefix"||Bt[1].type==="blockQuotePrefix"||Bt[1].type==="blockQuotePrefixWhitespace"||Bt[1].type==="blockQuoteMarker"||Bt[1].type==="listItemIndent"))break}Vn&&(!Qt||Vn<Qt)&&(bn._spread=!0),bn.end=Object.assign({},Qt?W[Qt][1].start:wt[1].end),W.splice(Qt||Pe,0,["exit",bn,wt[2]]),Pe++,_e++}if(wt[1].type==="listItemPrefix"){const yn={type:"listItem",_spread:!1,start:Object.assign({},wt[1].start),end:void 0};bn=yn,W.splice(Pe,0,["enter",yn,wt[2]]),Pe++,_e++,Vn=void 0,yr=!0}}}return W[se][1]._spread=yt,_e}function a(W,se){return _e;function _e(Pe){c.call(this,W(Pe),Pe),se&&se.call(this,Pe)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(W,se,_e){this.stack[this.stack.length-1].children.push(W),this.stack.push(W),this.tokenStack.push([se,_e||void 0]),W.position={start:ur(se.start),end:void 0}}function f(W){return se;function se(_e){W&&W.call(this,_e),d.call(this,_e)}}function d(W,se){const _e=this.stack.pop(),Pe=this.tokenStack.pop();if(Pe)Pe[0].type!==W.type&&(se?se.call(this,W,Pe[0]):(Pe[1]||Dm).call(this,W,Pe[0]));else throw new Error("Cannot close `"+W.type+"` ("+Cs({start:W.start,end:W.end})+"): it’s not open");_e.position.end=ur(W.end)}function p(){return mf(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function w(W){if(this.data.expectingFirstListItemValue){const se=this.stack[this.stack.length-2];se.start=Number.parseInt(this.sliceSerialize(W),10),this.data.expectingFirstListItemValue=void 0}}function v(){const W=this.resume(),se=this.stack[this.stack.length-1];se.lang=W}function k(){const W=this.resume(),se=this.stack[this.stack.length-1];se.meta=W}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const W=this.resume(),se=this.stack[this.stack.length-1];se.value=W.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const W=this.resume(),se=this.stack[this.stack.length-1];se.value=W.replace(/(\r?\n|\r)$/g,"")}function b(W){const se=this.resume(),_e=this.stack[this.stack.length-1];_e.label=se,_e.identifier=gn(this.sliceSerialize(W)).toLowerCase()}function A(){const W=this.resume(),se=this.stack[this.stack.length-1];se.title=W}function B(){const W=this.resume(),se=this.stack[this.stack.length-1];se.url=W}function P(W){const se=this.stack[this.stack.length-1];if(!se.depth){const _e=this.sliceSerialize(W).length;se.depth=_e}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function ee(W){const se=this.stack[this.stack.length-1];se.depth=this.sliceSerialize(W).codePointAt(0)===61?1:2}function oe(){this.data.setextHeadingSlurpLineEnding=void 0}function ae(W){const _e=this.stack[this.stack.length-1].children;let Pe=_e[_e.length-1];(!Pe||Pe.type!=="text")&&(Pe=gr(),Pe.position={start:ur(W.start),end:void 0},_e.push(Pe)),this.stack.push(Pe)}function F(W){const se=this.stack.pop();se.value+=this.sliceSerialize(W),se.position.end=ur(W.end)}function ne(W){const se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const _e=se.children[se.children.length-1];_e.position.end=ur(W.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(se.type)&&(ae.call(this,W),F.call(this,W))}function re(){this.data.atHardBreak=!0}function de(){const W=this.resume(),se=this.stack[this.stack.length-1];se.value=W}function ie(){const W=this.resume(),se=this.stack[this.stack.length-1];se.value=W}function X(){const W=this.resume(),se=this.stack[this.stack.length-1];se.value=W}function ge(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=se,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function me(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=se,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function J(W){const se=this.sliceSerialize(W),_e=this.stack[this.stack.length-2];_e.label=Rb(se),_e.identifier=gn(se).toLowerCase()}function O(){const W=this.stack[this.stack.length-1],se=this.resume(),_e=this.stack[this.stack.length-1];if(this.data.inReference=!0,_e.type==="link"){const Pe=W.children;_e.children=Pe}else _e.alt=se}function _(){const W=this.resume(),se=this.stack[this.stack.length-1];se.url=W}function L(){const W=this.resume(),se=this.stack[this.stack.length-1];se.title=W}function V(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function ue(W){const se=this.resume(),_e=this.stack[this.stack.length-1];_e.label=se,_e.identifier=gn(this.sliceSerialize(W)).toLowerCase(),this.data.referenceType="full"}function Se(W){this.data.characterReferenceType=W.type}function ye(W){const se=this.sliceSerialize(W),_e=this.data.characterReferenceType;let Pe;_e?(Pe=Ly(se,_e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Pe=gf(se);const Fe=this.stack[this.stack.length-1];Fe.value+=Pe}function je(W){const se=this.stack.pop();se.position.end=ur(W.end)}function Te(W){F.call(this,W);const se=this.stack[this.stack.length-1];se.url=this.sliceSerialize(W)}function De(W){F.call(this,W);const se=this.stack[this.stack.length-1];se.url="mailto:"+this.sliceSerialize(W)}function Ze(){return{type:"blockquote",children:[]}}function Kt(){return{type:"code",lang:null,meta:null,value:""}}function Ur(){return{type:"inlineCode",value:""}}function Bn(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function U(){return{type:"emphasis",children:[]}}function H(){return{type:"heading",depth:0,children:[]}}function we(){return{type:"break"}}function Ce(){return{type:"html",value:""}}function Oe(){return{type:"image",title:null,url:"",alt:null}}function Ie(){return{type:"link",title:null,url:"",children:[]}}function qe(W){return{type:"list",ordered:W.type==="listOrdered",start:null,spread:W._spread,children:[]}}function st(W){return{type:"listItem",spread:W._spread,checked:null,children:[]}}function et(){return{type:"paragraph",children:[]}}function Un(){return{type:"strong",children:[]}}function gr(){return{type:"text",value:""}}function $s(){return{type:"thematicBreak"}}}function ur(e){return{line:e.line,column:e.column,offset:e.offset}}function Gy(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?Gy(e,i):Mb(e,i)}}function Mb(e,t){let n;for(n in t)if(Vy.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 Dm(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Cs({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Cs({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Cs({start:t.start,end:t.end})+") is still open")}function Db(e){const t=this;t.parser=n;function n(i){return jb(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Fb(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 $b(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
169
|
-
`}]}function zb(e,t){const n=t.value?t.value+`
|
|
170
|
-
`:"",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 Bb(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ub(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Vb(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),o=Ti(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 Gb(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 Wb(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Wy(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 Hb(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return Wy(e,t);const o={src:Ti(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 qb(e,t){const n={src:Ti(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 Kb(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 Qb(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return Wy(e,t);const o={href:Ti(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 Xb(e,t){const n={href:Ti(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 Yb(e,t,n){const i=e.all(t),o=n?Jb(n):Hy(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:`
|
|
171
|
-
`}),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:`
|
|
172
|
-
`});const d={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,d),e.applyData(t,d)}function Jb(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=Hy(n[i])}return t}function Hy(e){const t=e.spread;return t??e.children.length>1}function Zb(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 eI(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tI(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function nI(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rI(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=ff(t.children[1]),f=Ey(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 iI(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],w={},v=l?l[f]:void 0;v&&(w.align=v);let k={type:"element",tagName:a,properties:w,children:[]};m&&(k.children=e.all(m),e.patch(m,k),k=e.applyData(m,k)),d.push(k)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,p),e.applyData(t,p)}function sI(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Fm=9,$m=32;function oI(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),o=0;const a=[];for(;i;)a.push(zm(t.slice(o,i.index),o>0,!0),i[0]),o=i.index+i[0].length,i=n.exec(t);return a.push(zm(t.slice(o),o>0,!1)),a.join("")}function zm(e,t,n){let i=0,o=e.length;if(t){let a=e.codePointAt(i);for(;a===Fm||a===$m;)i++,a=e.codePointAt(i)}if(n){let a=e.codePointAt(o-1);for(;a===Fm||a===$m;)o--,a=e.codePointAt(o-1)}return o>i?e.slice(i,o):""}function lI(e,t){const n={type:"text",value:oI(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function aI(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const uI={blockquote:Fb,break:$b,code:zb,delete:Bb,emphasis:Ub,footnoteReference:Vb,heading:Gb,html:Wb,imageReference:Hb,image:qb,inlineCode:Kb,linkReference:Qb,link:Xb,listItem:Yb,list:Zb,paragraph:eI,root:tI,strong:nI,table:rI,tableCell:sI,tableRow:iI,text:lI,thematicBreak:aI,toml:sl,yaml:sl,definition:sl,footnoteDefinition:sl};function sl(){}const qy=-1,Bl=0,Es=1,Tl=2,wf=3,vf=4,kf=5,xf=6,Ky=7,Qy=8,{defineProperty:cI}=Object,Xy=typeof self=="object"?self:globalThis,Bm=(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 Xy[e](t)},fI=(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 Bl:case qy:return n(l,o);case Es:{const c=n([],o);for(const f of l)c.push(i(f));return c}case Tl:{const c=n({},o);for(const[f,d]of l){const p=i(f),m=i(d);p==="__proto__"?cI(c,p,{value:m,configurable:!0,enumerable:!0,writable:!0}):c[p]=m}return c}case wf:return n(new Date(l),o);case vf:{const{source:c,flags:f}=l;return n(new RegExp(c,f),o)}case kf:{const c=n(new Map,o);for(const[f,d]of l)c.set(i(f),i(d));return c}case xf:{const c=n(new Set,o);for(const f of l)c.add(i(f));return c}case Ky:{const{name:c,message:f}=l;return n(typeof Xy[c]=="function"?Bm(c,f):new Error(f),o)}case Qy: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(Bm(a,l),o)};return i},Um=e=>fI(new Map,e)(0),jr="",{toString:dI}={},{keys:hI,is:pI}=Object,ws=e=>{const t=typeof e;if(t!=="object"||!e)return[Bl,t];const n=dI.call(e).slice(8,-1);switch(n){case"Array":return[Es,jr];case"Object":return[Tl,jr];case"Date":return[wf,jr];case"RegExp":return[vf,jr];case"Map":return[kf,jr];case"Set":return[xf,jr];case"DataView":return[Es,n]}return n.includes("Array")?[Es,n]:e instanceof Error?[Ky,e.name||"Error"]:[Tl,n]},ol=([e,t])=>e===Bl&&(t==="function"||t==="symbol"),mI=(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]=ws(l);switch(c){case Bl:{let p=l;switch(f){case"bigint":c=Qy,p=l.toString();break;case"number":if(!l&&pI(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([qy],l)}return o([c,p],l)}case Es:{if(f){let w=l;return f==="DataView"?w=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(w=new Uint8Array(l)),o([f,[...w]],l)}const p=[],m=o([c,p],l);for(const w of l)p.push(a(w));return m}case Tl:{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 w of hI(l))(e||!ol(ws(l[w])))&&p.push([a(w),a(l[w])]);return m}case wf:return o([c,isNaN(l.getTime())?jr:l.toISOString()],l);case vf:{const{source:p,flags:m}=l;return o([c,{source:p,flags:m}],l)}case kf:{const p=[],m=o([c,p],l);for(const[w,v]of l)(e||!(ol(ws(w))||ol(ws(v))))&&p.push([a(w),a(v)]);return m}case xf:{const p=[],m=o([c,p],l);for(const w of l)(e||!ol(ws(w)))&&p.push(a(w));return m}}const{message:d}=l;return o([c,{name:f,message:d}],l)};return a},Vm=(e,{json:t,lossy:n}={})=>{const i=[];return mI(!(t||n),!!t,new Map,i)(e),i},Al=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Um(Vm(e,t)):structuredClone(e):(e,t)=>Um(Vm(e,t));function gI(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 yI(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function wI(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||gI,i=e.options.footnoteBackLabel||yI,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(),w=Ti(m.toLowerCase());let v=0;const k=[],E=e.footnoteCounts.get(m);for(;E!==void 0&&++v<=E;){k.length>0&&k.push({type:"text",value:" "});let b=typeof n=="string"?n:n(f,v);typeof b=="string"&&(b={type:"text",value:b}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+w+(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(...k)}else p.push(...k);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+w},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:{...Al(l),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
173
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
174
|
-
`}]}}const Ul=(function(e){if(e==null)return SI;if(typeof e=="function")return Vl(e);if(typeof e=="object")return Array.isArray(e)?vI(e):kI(e);if(typeof e=="string")return xI(e);throw new Error("Expected function, string, or object as test")});function vI(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ul(e[n]);return Vl(i);function i(...o){let a=-1;for(;++a<t.length;)if(t[a].apply(this,o))return!0;return!1}}function kI(e){const t=e;return Vl(n);function n(i){const o=i;let a;for(a in e)if(o[a]!==t[a])return!1;return!0}}function xI(e){return Vl(t);function t(n){return n&&n.type===e}}function Vl(e){return t;function t(n,i,o){return!!(CI(n)&&e.call(this,n,typeof i=="number"?i:void 0,o||void 0))}}function SI(){return!0}function CI(e){return e!==null&&typeof e=="object"&&"type"in e}const Yy=[],_I=!0,zc=!1,EI="skip";function Jy(e,t,n,i){let o;typeof t=="function"&&typeof n!="function"?(i=n,n=t):o=t;const a=Ul(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(w,"name",{value:"node ("+(f.type+(v?"<"+v+">":""))+")"})}return w;function w(){let v=Yy,k,E,N;if((!t||a(f,d,p[p.length-1]||void 0))&&(v=bI(n(f,p)),v[0]===zc))return v;if("children"in f&&f.children){const C=f;if(C.children&&v[0]!==EI)for(E=(i?C.children.length:-1)+l,N=p.concat(C);E>-1&&E<C.children.length;){const b=C.children[E];if(k=c(b,E,N)(),k[0]===zc)return k;E=typeof k[1]=="number"?k[1]:E+l}}return v}}}function bI(e){return Array.isArray(e)?e:typeof e=="number"?[_I,e]:e==null?Yy:[e]}function Sf(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),Jy(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 Bc={}.hasOwnProperty,II={};function NI(e,t){const n=t||II,i=new Map,o=new Map,a=new Map,l={...uI,...n.handlers},c={all:d,applyData:AI,definitionById:i,footnoteById:o,footnoteCounts:a,footnoteOrder:[],handlers:l,one:f,options:n,patch:TI,wrap:RI};return Sf(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?i:o,w=String(p.identifier).toUpperCase();m.has(w)||m.set(w,p)}}),c;function f(p,m){const w=p.type,v=c.handlers[w];if(Bc.call(c.handlers,w)&&v)return v(c,p,m);if(c.options.passThrough&&c.options.passThrough.includes(w)){if("children"in p){const{children:E,...N}=p,C=Al(N);return C.children=c.all(p),C}return Al(p)}return(c.options.unknownHandler||PI)(c,p,m)}function d(p){const m=[];if("children"in p){const w=p.children;let v=-1;for(;++v<w.length;){const k=c.one(w[v],p);if(k){if(v&&w[v-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=Gm(k.value)),!Array.isArray(k)&&k.type==="element")){const E=k.children[0];E&&E.type==="text"&&(E.value=Gm(E.value))}Array.isArray(k)?m.push(...k):m.push(k)}}}return m}}function TI(e,t){e.position&&(t.position=m_(e))}function AI(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,Al(a)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function PI(e,t){const n=t.data||{},i="value"in t&&!(Bc.call(n,"hProperties")||Bc.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 RI(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:`
|
|
175
|
-
`});++i<e.length;)i&&n.push({type:"text",value:`
|
|
176
|
-
`}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
177
|
-
`}),n}function Gm(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Wm(e,t){const n=NI(e,t),i=n.one(e,void 0),o=wI(n),a=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return o&&a.children.push({type:"text",value:`
|
|
178
|
-
`},o),a}function LI(e,t){return e&&"run"in e?async function(n,i){const o=Wm(n,{file:i,...t});await e.run(o,i)}:function(n,i){return Wm(n,{file:i,...e||t})}}function Hm(e){if(e)throw e}var sc,qm;function jI(){if(qm)return sc;qm=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 w;for(w in d);return typeof w>"u"||e.call(d,w)},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 sc=function f(){var d,p,m,w,v,k,E=arguments[0],N=1,C=arguments.length,b=!1;for(typeof E=="boolean"&&(b=E,E=arguments[1]||{},N=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});N<C;++N)if(d=arguments[N],d!=null)for(p in d)m=c(E,p),w=c(d,p),E!==w&&(b&&w&&(a(w)||(v=o(w)))?(v?(v=!1,k=m&&o(m)?m:[]):k=m&&a(m)?m:{},l(E,{name:p,newValue:f(b,k,w)})):typeof w<"u"&&l(E,{name:p,newValue:w}));return E},sc}var OI=jI();const oc=Wc(OI);function Uc(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 MI(){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?DI(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 DI(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 _n={basename:FI,dirname:$I,extname:zI,join:BI,sep:"/"};function FI(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Fs(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 $I(e){if(Fs(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 zI(e){Fs(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 BI(...e){let t=-1,n;for(;++t<e.length;)Fs(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":UI(n)}function UI(e){Fs(e);const t=e.codePointAt(0)===47;let n=VI(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function VI(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 Fs(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const GI={cwd:WI};function WI(){return"/"}function Vc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function HI(e){if(typeof e=="string")e=new URL(e);else if(!Vc(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 qI(e)}function qI(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 lc=["history","path","basename","stem","extname","dirname"];class Zy{constructor(t){let n;t?Vc(t)?n={path:t}:typeof t=="string"||KI(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":GI.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<lc.length;){const a=lc[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)lc.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?_n.basename(this.path):void 0}set basename(t){uc(t,"basename"),ac(t,"basename"),this.path=_n.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?_n.dirname(this.path):void 0}set dirname(t){Km(this.basename,"dirname"),this.path=_n.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?_n.extname(this.path):void 0}set extname(t){if(ac(t,"extname"),Km(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=_n.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Vc(t)&&(t=HI(t)),uc(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?_n.basename(this.path,this.extname):void 0}set stem(t){uc(t,"stem"),ac(t,"stem"),this.path=_n.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 ac(e,t){if(e&&e.includes(_n.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+_n.sep+"`")}function uc(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Km(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function KI(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const QI=(function(e){const i=this.constructor.prototype,o=i[e],a=function(){return o.apply(a,arguments)};return Object.setPrototypeOf(a,i),a}),XI={}.hasOwnProperty;class Cf extends QI{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=MI()}copy(){const t=new Cf;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(oc(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(dc("data",this.frozen),this.namespace[t]=n,this):XI.call(this.namespace,t)&&this.namespace[t]||void 0:t?(dc("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=ll(t),i=this.parser||this.Parser;return cc("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),cc("process",this.parser||this.Parser),fc("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(a,l){const c=ll(t),f=i.parse(c);i.run(f,c,function(p,m,w){if(p||!m||!w)return d(p);const v=m,k=i.stringify(v,w);ZI(k)?w.value=k:w.result=k,d(p,w)});function d(p,m){p||!m?l(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,i;return this.freeze(),cc("processSync",this.parser||this.Parser),fc("processSync",this.compiler||this.Compiler),this.process(t,o),Xm("processSync","process",n),i;function o(a,l){n=!0,Hm(a),i=l}}run(t,n,i){Qm(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=ll(n);o.run(t,f,d);function d(p,m,w){const v=m||t;p?c(p):l?l(v):i(void 0,v,w)}}}runSync(t,n){let i=!1,o;return this.run(t,n,a),Xm("runSync","run",i),o;function a(l,c){Hm(l),o=c,i=!0}}stringify(t,n){this.freeze();const i=ll(n),o=this.compiler||this.Compiler;return fc("stringify",o),Qm(t),o(t,i)}use(t,...n){const i=this.attachers,o=this.namespace;if(dc("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=oc(!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,w=-1;for(;++m<i.length;)if(i[m][0]===d){w=m;break}if(w===-1)i.push([d,...p]);else if(p.length>0){let[v,...k]=p;const E=i[w][1];Uc(E)&&Uc(v)&&(v=oc(!0,E,v)),i[w]=[d,v,...k]}}}}const YI=new Cf().freeze();function cc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function fc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function dc(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 Qm(e){if(!Uc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Xm(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ll(e){return JI(e)?e:new Zy(e)}function JI(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ZI(e){return typeof e=="string"||eN(e)}function eN(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const tN="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ym=[],Jm={allowDangerousHtml:!0},nN=/^(https?|ircs?|mailto|xmpp)$/i,rN=[{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 iN(e){const t=sN(e),n=oN(e);return lN(t.runSync(t.parse(n),n),e)}function sN(e){const t=e.rehypePlugins||Ym,n=e.remarkPlugins||Ym,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Jm}:Jm;return YI().use(Db).use(n).use(LI,i).use(t)}function oN(e){const t=e.children||"",n=new Zy;return typeof t=="string"&&(n.value=t),n}function lN(e,t){const n=t.allowedElements,i=t.allowElement,o=t.components,a=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,f=t.urlTransform||aN;for(const p of rN)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+tN+p.id,void 0);return Sf(e,d),k_(e,{Fragment:S.Fragment,components:o,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function d(p,m,w){if(p.type==="raw"&&w&&typeof m=="number")return l?w.children.splice(m,1):w.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let v;for(v in nc)if(Object.hasOwn(nc,v)&&Object.hasOwn(p.properties,v)){const k=p.properties[v],E=nc[v];(E===null||E.includes(p.tagName))&&(p.properties[v]=f(String(k||""),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,w)),v&&w&&typeof m=="number")return c&&p.children?w.children.splice(m,1,...p.children):w.children.splice(m,1),m}}}function aN(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||nN.test(e.slice(0,t))?e:""}function uN(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function cN(e,t,n){const o=Ul((n||{}).ignore||[]),a=fN(t);let l=-1;for(;++l<a.length;)Jy(e,"text",c);function c(d,p){let m=-1,w;for(;++m<p.length;){const v=p[m],k=w?w.children:void 0;if(o(v,k?k.indexOf(v):void 0,w))return;w=v}if(w)return f(d,p)}function f(d,p){const m=p[p.length-1],w=a[l][0],v=a[l][1];let k=0;const N=m.children.indexOf(d);let C=!1,b=[];w.lastIndex=0;let A=w.exec(d.value);for(;A;){const B=A.index,P={index:A.index,input:A.input,stack:[...p,d]};let M=v(...A,P);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?w.lastIndex=B+1:(k!==B&&b.push({type:"text",value:d.value.slice(k,B)}),Array.isArray(M)?b.push(...M):M&&b.push(M),k=B+A[0].length,C=!0),!w.global)break;A=w.exec(d.value)}return C?(k<d.value.length&&b.push({type:"text",value:d.value.slice(k)}),m.children.splice(N,1,...b)):b=[d],N+b.length}}function fN(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([dN(o[0]),hN(o[1])])}return t}function dN(e){return typeof e=="string"?new RegExp(uN(e),"g"):e}function hN(e){return typeof e=="function"?e:function(){return e}}const hc="phrasing",pc=["autolink","link","image","label"];function pN(){return{transforms:[xN],enter:{literalAutolink:gN,literalAutolinkEmail:mc,literalAutolinkHttp:mc,literalAutolinkWww:mc},exit:{literalAutolink:kN,literalAutolinkEmail:vN,literalAutolinkHttp:yN,literalAutolinkWww:wN}}}function mN(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:hc,notInConstruct:pc},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:hc,notInConstruct:pc},{character:":",before:"[ps]",after:"\\/",inConstruct:hc,notInConstruct:pc}]}}function gN(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function mc(e){this.config.enter.autolinkProtocol.call(this,e)}function yN(e){this.config.exit.autolinkProtocol.call(this,e)}function wN(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 vN(e){this.config.exit.autolinkEmail.call(this,e)}function kN(e){this.exit(e)}function xN(e){cN(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,SN],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),CN]],{ignore:["link","linkReference"]})}function SN(e,t,n,i,o){let a="";if(!ew(o)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!_N(n)))return!1;const l=EN(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 CN(e,t,n,i){return!ew(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function _N(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 EN(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=xl(e,"(");let a=xl(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 ew(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||zr(n)||$l(n))&&(!t||n!==47)}tw.peek=jN;function bN(){this.buffer()}function IN(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function NN(){this.buffer()}function TN(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function AN(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=gn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function PN(e){this.exit(e)}function RN(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=gn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function LN(e){this.exit(e)}function jN(){return"["}function tw(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 ON(){return{enter:{gfmFootnoteCallString:bN,gfmFootnoteCall:IN,gfmFootnoteDefinitionLabelString:NN,gfmFootnoteDefinition:TN},exit:{gfmFootnoteCallString:AN,gfmFootnoteCall:PN,gfmFootnoteDefinitionLabelString:RN,gfmFootnoteDefinition:LN}}}function MN(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:tw},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?`
|
|
179
|
-
`:" ")+a.indentLines(a.containerFlow(i,c.current()),t?nw:DN))),d(),f}}function DN(e,t,n){return t===0?e:nw(e,t,n)}function nw(e,t,n){return(n?"":" ")+e}const FN=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];rw.peek=VN;function $N(){return{canContainEols:["delete"],enter:{strikethrough:BN},exit:{strikethrough:UN}}}function zN(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:FN}],handlers:{delete:rw}}}function BN(e){this.enter({type:"delete",children:[]},e)}function UN(e){this.exit(e)}function rw(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 VN(){return"~"}function GN(e){return e.length}function WN(e,t){const n=t||{},i=(n.align||[]).concat(),o=n.stringLength||GN,a=[],l=[],c=[],f=[];let d=0,p=-1;for(;++p<e.length;){const E=[],N=[];let C=-1;for(e[p].length>d&&(d=e[p].length);++C<e[p].length;){const b=HN(e[p][C]);if(n.alignDelimiters!==!1){const A=o(b);N[C]=A,(f[C]===void 0||A>f[C])&&(f[C]=A)}E.push(b)}l[p]=E,c[p]=N}let m=-1;if(typeof i=="object"&&"length"in i)for(;++m<d;)a[m]=Zm(i[m]);else{const E=Zm(i);for(;++m<d;)a[m]=E}m=-1;const w=[],v=[];for(;++m<d;){const E=a[m];let N="",C="";E===99?(N=":",C=":"):E===108?N=":":E===114&&(C=":");let b=n.alignDelimiters===!1?1:Math.max(1,f[m]-N.length-C.length);const A=N+"-".repeat(b)+C;n.alignDelimiters!==!1&&(b=N.length+b+C.length,b>f[m]&&(f[m]=b),v[m]=b),w[m]=A}l.splice(1,0,w),c.splice(1,0,v),p=-1;const k=[];for(;++p<l.length;){const E=l[p],N=c[p];m=-1;const C=[];for(;++m<d;){const b=E[m]||"";let A="",B="";if(n.alignDelimiters!==!1){const P=f[m]-(N[m]||0),M=a[m];M===114?A=" ".repeat(P):M===99?P%2?(A=" ".repeat(P/2+.5),B=" ".repeat(P/2-.5)):(A=" ".repeat(P/2),B=A):B=" ".repeat(P)}n.delimiterStart!==!1&&!m&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&b==="")&&(n.delimiterStart!==!1||m)&&C.push(" "),n.alignDelimiters!==!1&&C.push(A),C.push(b),n.alignDelimiters!==!1&&C.push(B),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||m!==d-1)&&C.push("|")}k.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return k.join(`
|
|
180
|
-
`)}function HN(e){return e==null?"":String(e)}function Zm(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 qN(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()),KN);return o(),l}function KN(e,t,n){return">"+(n?"":" ")+e}function QN(e,t){return eg(e,t.inConstruct,!0)&&!eg(e,t.notInConstruct,!1)}function eg(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 tg(e,t,n,i){let o=-1;for(;++o<n.unsafe.length;)if(n.unsafe[o].character===`
|
|
181
|
-
`&&QN(n.stack,n.unsafe[o]))return/[ \t]/.test(i.before)?"":" ";return`\\
|
|
182
|
-
`}function XN(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 YN(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 JN(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 ZN(e,t,n,i){const o=JN(n),a=e.value||"",l=o==="`"?"GraveAccent":"Tilde";if(YN(e,n)){const m=n.enter("codeIndented"),w=n.indentLines(a,eT);return m(),w}const c=n.createTracker(i),f=o.repeat(Math.max(XN(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:`
|
|
183
|
-
`,encode:["`"],...c.current()})),m()}return p+=c.move(`
|
|
184
|
-
`),a&&(p+=c.move(a+`
|
|
185
|
-
`)),p+=c.move(f),d(),p}function eT(e,t,n){return(n?"":" ")+e}function _f(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 tT(e,t,n,i){const o=_f(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?" ":`
|
|
186
|
-
`,...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 nT(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 Rs(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Pl(e,t,n){const i=_i(e),o=_i(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}}iw.peek=rT;function iw(e,t,n,i){const o=nT(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=Pl(i.before.charCodeAt(i.before.length-1),d,o);p.inside&&(f=Rs(d)+f.slice(1));const m=f.charCodeAt(f.length-1),w=Pl(i.after.charCodeAt(0),m,o);w.inside&&(f=f.slice(0,-1)+Rs(m));const v=l.move(o);return a(),n.attentionEncodeSurroundingInfo={after:w.outside,before:p.outside},c+f+v}function rT(e,t,n){return n.options.emphasis||"*"}function iT(e,t){let n=!1;return Sf(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,zc}),!!((!e.depth||e.depth<3)&&mf(e)&&(t.options.setext||n))}function sT(e,t,n,i){const o=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(i);if(iT(e,n)){const p=n.enter("headingSetext"),m=n.enter("phrasing"),w=n.containerPhrasing(e,{...a.current(),before:`
|
|
187
|
-
`,after:`
|
|
188
|
-
`});return m(),p(),w+`
|
|
189
|
-
`+(o===1?"=":"-").repeat(w.length-(Math.max(w.lastIndexOf("\r"),w.lastIndexOf(`
|
|
190
|
-
`))+1))}const l="#".repeat(o),c=n.enter("headingAtx"),f=n.enter("phrasing");a.move(l+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
|
|
191
|
-
`,...a.current()});return/^[\t ]/.test(d)&&(d=Rs(d.charCodeAt(0))+d.slice(1)),d=d?l+" "+d:l,n.options.closeAtx&&(d+=" "+l),f(),c(),d}sw.peek=oT;function sw(e){return e.value||""}function oT(){return"<"}ow.peek=lT;function ow(e,t,n,i){const o=_f(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 lT(){return"!"}lw.peek=aT;function lw(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 aT(){return"!"}aw.peek=uT;function aw(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 uT(){return"`"}function uw(e,t){const n=mf(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))}cw.peek=cT;function cw(e,t,n,i){const o=_f(n),a=o==='"'?"Quote":"Apostrophe",l=n.createTracker(i);let c,f;if(uw(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 cT(e,t,n){return uw(e,n)?"<":"["}fw.peek=fT;function fw(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 fT(){return"["}function Ef(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 dT(e){const t=Ef(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 hT(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 dw(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 pT(e,t,n,i){const o=n.enter("list"),a=n.bulletCurrent;let l=e.ordered?hT(n):Ef(n);const c=e.ordered?l==="."?")":".":dT(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),dw(n)===l&&p){let m=-1;for(;++m<e.children.length;){const w=e.children[m];if(w&&w.type==="listItem"&&w.children&&w.children[0]&&w.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 mT(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 gT(e,t,n,i){const o=mT(n);let a=n.bulletCurrent||Ef(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,w,v){return w?(v?"":" ".repeat(l))+m:(v?a:a+" ".repeat(l-a.length))+m}}function yT(e,t,n,i){const o=n.enter("paragraph"),a=n.enter("phrasing"),l=n.containerPhrasing(e,i);return a(),o(),l}const wT=Ul(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function vT(e,t,n,i){return(e.children.some(function(l){return wT(l)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function kT(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}hw.peek=xT;function hw(e,t,n,i){const o=kT(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=Pl(i.before.charCodeAt(i.before.length-1),d,o);p.inside&&(f=Rs(d)+f.slice(1));const m=f.charCodeAt(f.length-1),w=Pl(i.after.charCodeAt(0),m,o);w.inside&&(f=f.slice(0,-1)+Rs(m));const v=l.move(o+o);return a(),n.attentionEncodeSurroundingInfo={after:w.outside,before:p.outside},c+f+v}function xT(e,t,n){return n.options.strong||"*"}function ST(e,t,n,i){return n.safe(e.value,i)}function CT(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 _T(e,t,n){const i=(dw(n)+(n.options.ruleSpaces?" ":"")).repeat(CT(n));return n.options.ruleSpaces?i.slice(0,-1):i}const pw={blockquote:qN,break:tg,code:ZN,definition:tT,emphasis:iw,hardBreak:tg,heading:sT,html:sw,image:ow,imageReference:lw,inlineCode:aw,link:cw,linkReference:fw,list:pT,listItem:gT,paragraph:yT,root:vT,strong:hw,text:ST,thematicBreak:_T};function ET(){return{enter:{table:bT,tableData:ng,tableHeader:ng,tableRow:NT},exit:{codeText:TT,table:IT,tableData:gc,tableHeader:gc,tableRow:gc}}}function bT(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 IT(e){this.exit(e),this.data.inTable=void 0}function NT(e){this.enter({type:"tableRow",children:[]},e)}function gc(e){this.exit(e)}function ng(e){this.enter({type:"tableCell",children:[]},e)}function TT(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,AT));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function AT(e,t){return t==="|"?t:e}function PT(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,o=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
192
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:w,table:l,tableCell:f,tableRow:c}};function l(v,k,E,N){return d(p(v,E,N),v.align)}function c(v,k,E,N){const C=m(v,E,N),b=d([C]);return b.slice(0,b.indexOf(`
|
|
193
|
-
`))}function f(v,k,E,N){const C=E.enter("tableCell"),b=E.enter("phrasing"),A=E.containerPhrasing(v,{...N,before:a,after:a});return b(),C(),A}function d(v,k){return WN(v,{align:k,alignDelimiters:i,padding:n,stringLength:o})}function p(v,k,E){const N=v.children;let C=-1;const b=[],A=k.enter("table");for(;++C<N.length;)b[C]=m(N[C],k,E);return A(),b}function m(v,k,E){const N=v.children;let C=-1;const b=[],A=k.enter("tableRow");for(;++C<N.length;)b[C]=f(N[C],v,k,E);return A(),b}function w(v,k,E){let N=pw.inlineCode(v,k,E);return E.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function RT(){return{exit:{taskListCheckValueChecked:rg,taskListCheckValueUnchecked:rg,paragraph:jT}}}function LT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:OT}}}function rg(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function jT(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 OT(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=pw.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 MT(){return[pN(),ON(),$N(),ET(),RT()]}function DT(e){return{extensions:[mN(),MN(e),zN(),PT(e),LT()]}}const FT={tokenize:GT,partial:!0},mw={tokenize:WT,partial:!0},gw={tokenize:HT,partial:!0},yw={tokenize:qT,partial:!0},$T={tokenize:KT,partial:!0},ww={name:"wwwAutolink",tokenize:UT,previous:kw},vw={name:"protocolAutolink",tokenize:VT,previous:xw},zn={name:"emailAutolink",tokenize:BT,previous:Sw},En={};function zT(){return{text:En}}let Rr=48;for(;Rr<123;)En[Rr]=zn,Rr++,Rr===58?Rr=65:Rr===91&&(Rr=97);En[43]=zn;En[45]=zn;En[46]=zn;En[95]=zn;En[72]=[zn,vw];En[104]=[zn,vw];En[87]=[zn,ww];En[119]=[zn,ww];function BT(e,t,n){const i=this;let o,a;return l;function l(m){return!Gc(m)||!Sw.call(i,i.previous)||bf(i.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(m))}function c(m){return Gc(m)?(e.consume(m),c):m===64?(e.consume(m),f):n(m)}function f(m){return m===46?e.check($T,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&&Rt(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function UT(e,t,n){const i=this;return o;function o(l){return l!==87&&l!==119||!kw.call(i,i.previous)||bf(i.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(FT,e.attempt(mw,e.attempt(gw,a),n),n)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function VT(e,t,n){const i=this;let o="",a=!1;return l;function l(m){return(m===72||m===104)&&xw.call(i,i.previous)&&!bf(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(m),e.consume(m),c):n(m)}function c(m){if(Rt(m)&&o.length<5)return o+=String.fromCodePoint(m),e.consume(m),c;if(m===58){const w=o.toLowerCase();if(w==="http"||w==="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||Nl(m)||Ge(m)||zr(m)||$l(m)?n(m):e.attempt(mw,e.attempt(gw,p),n)(m)}function p(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function GT(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 WT(e,t,n){let i,o,a;return l;function l(d){return d===46||d===95?e.check(yw,f,c)(d):d===null||Ge(d)||zr(d)||d!==45&&$l(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 HT(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(yw,t,a)(l):l===null||Ge(l)||zr(l)?t(l):(e.consume(l),o)}function a(l){return l===41&&i++,e.consume(l),o}}function qT(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||Ge(c)||zr(c)?t(c):n(c)}function o(c){return c===null||c===40||c===91||Ge(c)||zr(c)?t(c):i(c)}function a(c){return Rt(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),i):Rt(c)?(e.consume(c),l):n(c)}}function KT(e,t,n){return i;function i(a){return e.consume(a),o}function o(a){return Nt(a)?n(a):t(a)}}function kw(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ge(e)}function xw(e){return!Rt(e)}function Sw(e){return!(e===47||Gc(e))}function Gc(e){return e===43||e===45||e===46||e===95||Nt(e)}function bf(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 QT={tokenize:rA,partial:!0};function XT(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:eA,continuation:{tokenize:tA},exit:nA}},text:{91:{name:"gfmFootnoteCall",tokenize:ZT},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:YT,resolveTo:JT}}}}function YT(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=gn(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 JT(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 ZT(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||Ge(m))return n(m);if(m===93){e.exit("chunkString");const w=e.exit("gfmFootnoteCallString");return o.includes(gn(i.sliceSerialize(w)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return Ge(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 eA(e,t,n){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a,l=0,c;return f;function f(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(k)}function p(k){if(l>999||k===93&&!c||k===null||k===91||Ge(k))return n(k);if(k===93){e.exit("chunkString");const E=e.exit("gfmFootnoteDefinitionLabelString");return a=gn(i.sliceSerialize(E)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),w}return Ge(k)||(c=!0),l++,e.consume(k),k===92?m:p}function m(k){return k===91||k===92||k===93?(e.consume(k),l++,p):p(k)}function w(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),o.includes(a)||o.push(a),Me(e,v,"gfmFootnoteDefinitionWhitespace")):n(k)}function v(k){return t(k)}}function tA(e,t,n){return e.check(Ds,t,e.attempt(QT,t,n))}function nA(e){e.exit("gfmFootnoteDefinition")}function rA(e,t,n){const i=this;return Me(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 iA(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)},w=[["enter",p,c],["enter",l[d][1],c],["exit",l[d][1],c],["enter",m,c]],v=c.parser.constructs.insideSpan.null;v&&qt(w,w.length,0,zl(v,l.slice(d+1,f),c)),qt(w,w.length,0,[["exit",m,c],["enter",l[f][1],c],["exit",l[f][1],c],["exit",p,c]]),qt(l,d-1,f-d+3,w),f=d+w.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 w;function w(k){return d===126&&p[p.length-1][1].type!=="characterEscape"?f(k):(l.enter("strikethroughSequenceTemporary"),v(k))}function v(k){const E=_i(d);if(k===126)return m>1?f(k):(l.consume(k),m++,v);if(m<2&&!n)return f(k);const N=l.exit("strikethroughSequenceTemporary"),C=_i(k);return N._open=!C||C===2&&!!E,N._close=!E||E===2&&!!C,c(k)}}}class sA{constructor(){this.map=[]}add(t,n,i){oA(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 oA(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 lA(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 aA(){return{flow:{null:{name:"table",tokenize:uA,resolveAll:cA}}}}function uA(e,t,n){const i=this;let o=0,a=0,l;return c;function c(F){let ne=i.events.length-1;for(;ne>-1;){const ie=i.events[ne][1].type;if(ie==="lineEnding"||ie==="linePrefix")ne--;else break}const re=ne>-1?i.events[ne][1].type:null,de=re==="tableHead"||re==="tableRow"?M:f;return de===M&&i.parser.lazy[i.now().line]?n(F):de(F)}function f(F){return e.enter("tableHead"),e.enter("tableRow"),d(F)}function d(F){return F===124||(l=!0,a+=1),p(F)}function p(F){return F===null?n(F):xe(F)?a>1?(a=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),v):n(F):Le(F)?Me(e,p,"whitespace")(F):(a+=1,l&&(l=!1,o+=1),F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),l=!0,p):(e.enter("data"),m(F)))}function m(F){return F===null||F===124||Ge(F)?(e.exit("data"),p(F)):(e.consume(F),F===92?w:m)}function w(F){return F===92||F===124?(e.consume(F),m):m(F)}function v(F){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(F):(e.enter("tableDelimiterRow"),l=!1,Le(F)?Me(e,k,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):k(F))}function k(F){return F===45||F===58?N(F):F===124?(l=!0,e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),E):P(F)}function E(F){return Le(F)?Me(e,N,"whitespace")(F):N(F)}function N(F){return F===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),C):F===45?(a+=1,C(F)):F===null||xe(F)?B(F):P(F)}function C(F){return F===45?(e.enter("tableDelimiterFiller"),b(F)):P(F)}function b(F){return F===45?(e.consume(F),b):F===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),A):(e.exit("tableDelimiterFiller"),A(F))}function A(F){return Le(F)?Me(e,B,"whitespace")(F):B(F)}function B(F){return F===124?k(F):F===null||xe(F)?!l||o!==a?P(F):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(F)):P(F)}function P(F){return n(F)}function M(F){return e.enter("tableRow"),ee(F)}function ee(F){return F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),ee):F===null||xe(F)?(e.exit("tableRow"),t(F)):Le(F)?Me(e,ee,"whitespace")(F):(e.enter("data"),oe(F))}function oe(F){return F===null||F===124||Ge(F)?(e.exit("data"),ee(F)):(e.consume(F),F===92?ae:oe)}function ae(F){return F===92||F===124?(e.consume(F),oe):oe(F)}}function cA(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 w=new sA;for(;++n<e.length;){const v=e[n],k=v[1];v[0]==="enter"?k.type==="tableHead"?(c=!1,f!==0&&(ig(w,t,f,d,p),p=void 0,f=0),d={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},w.add(n,0,[["enter",d,t]])):k.type==="tableRow"||k.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({},k.start),end:Object.assign({},k.end)},w.add(n,0,[["enter",p,t]])),o=k.type==="tableDelimiterRow"?2:p?3:1):o&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(i=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],m=al(w,t,a,o,void 0,m),a=[0,0,0,0]),l[2]=n)):k.type==="tableCellDivider"&&(i?i=!1:(a[1]!==0&&(l[0]=l[1],m=al(w,t,a,o,void 0,m)),a=l,l=[a[1],n,0,0])):k.type==="tableHead"?(c=!0,f=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(f=n,a[1]!==0?(l[0]=l[1],m=al(w,t,a,o,n,m)):l[1]!==0&&(m=al(w,t,l,o,n,m)),o=0):o&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&ig(w,t,f,d,p),w.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=lA(t.events,n))}return e}function al(e,t,n,i,o,a){const l=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(a.end=Object.assign({},ki(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const f=ki(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=ki(t.events,n[2]),p=ki(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 w=t.events[n[2]],v=t.events[n[3]];if(w[1].end=Object.assign({},v[1].end),w[1].type="chunkText",w[1].contentType="text",n[3]>n[2]+1){const k=n[2]+1,E=n[3]-n[2]-1;e.add(k,E,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return o!==void 0&&(a.end=Object.assign({},ki(t.events,o)),e.add(o,0,[["exit",a,t]]),a=void 0),a}function ig(e,t,n,i,o){const a=[],l=ki(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 ki(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const fA={name:"tasklistCheck",tokenize:hA};function dA(){return{text:{91:fA}}}function hA(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 Ge(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 xe(f)?t(f):Le(f)?e.check({tokenize:pA},t,n)(f):n(f)}}function pA(e,t,n){return Me(e,i,"whitespace");function i(o){return o===null?n(o):t(o)}}function mA(e){return Ry([zT(),XT(),iA(e),aA(),dA()])}const gA={};function yA(e){const t=this,n=e||gA,i=t.data(),o=i.micromarkExtensions||(i.micromarkExtensions=[]),a=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),l=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);o.push(mA(n)),a.push(MT()),l.push(DT(n))}function If({text:e}){return S.jsx("div",{className:"md",children:S.jsx(iN,{remarkPlugins:[yA],children:e})})}function wA({comment:e,onUnlink:t}){const n=G(o=>o.jumpToComment),i=e.startLine===e.endLine?`${e.startLine}`:`${e.startLine}-${e.endLine}`;return S.jsxs("div",{className:`linked-comment status-${e.status}`,children:[S.jsxs("div",{className:"linked-head",children:[S.jsxs("span",{className:"mono",children:[e.filePath,":",i," (",e.side,")"]}),S.jsx("span",{className:`badge badge-${e.status}`,children:e.status}),S.jsx("span",{className:"muted mono small",title:e.targetKey,children:e.targetKey.length>28?e.targetKey.slice(0,28)+"…":e.targetKey}),S.jsx("span",{className:"spacer"}),e.status!=="orphaned"&&S.jsx("button",{className:"link",onClick:()=>{n(e)},children:"跳转"}),S.jsx("button",{className:"link danger",onClick:t,children:"解除关联"})]}),S.jsx("div",{className:"linked-body",children:e.body})]})}function vA({issue:e,onBack:t}){const n=G(C=>C.allComments),i=G(C=>C.comments),o=G(C=>C.updateIssue),a=G(C=>C.deleteIssue),l=G(C=>C.exportIssue),c=G(C=>C.selectedCommentIds),f=G(C=>C.clearSelectedComments),[d,p]=Q.useState(!1),[m,w]=Q.useState(e.title),[v,k]=Q.useState(e.body),E=Q.useMemo(()=>{const C=new Map;for(const b of n)C.set(b.id,b);for(const b of i)C.set(b.id,b);return C},[n,i]),N=c.filter(C=>!e.commentIds.includes(C));return S.jsxs("div",{className:"issue-detail",children:[S.jsxs("div",{className:"issue-detail-head",children:[S.jsx("button",{className:"link",onClick:t,children:"← 返回列表"}),S.jsx("span",{className:"spacer"}),S.jsx("button",{className:"link",onClick:()=>{l(e.id)},children:"复制 Issue"}),S.jsx("button",{className:"link",onClick:()=>{o(e.id,{status:e.status==="open"?"closed":"open"})},children:e.status==="open"?"关闭":"重新打开"}),S.jsx("button",{className:"link danger",onClick:()=>{window.confirm(`删除 Issue「${e.title}」?`)&&(a(e.id),t())},children:"删除"})]}),d?S.jsxs("div",{className:"issue-form",children:[S.jsx("input",{value:m,onChange:C=>w(C.target.value),placeholder:"标题"}),S.jsx("textarea",{value:v,onChange:C=>k(C.target.value),rows:6,placeholder:"描述(Markdown)"}),S.jsxs("div",{className:"row-actions",children:[S.jsx("button",{className:"primary",disabled:!m.trim(),onClick:async()=>{await o(e.id,{title:m,body:v}),p(!1)},children:"保存"}),S.jsx("button",{onClick:()=>p(!1),children:"取消"})]})]}):S.jsxs(S.Fragment,{children:[S.jsxs("h3",{children:[S.jsx("span",{className:`badge badge-${e.status}`,children:e.status})," ",e.title,S.jsx("button",{className:"link",onClick:()=>p(!0),children:"编辑"})]}),e.body?S.jsx(If,{text:e.body}):S.jsx("p",{className:"muted",children:"(无描述)"})]}),S.jsxs("div",{className:"issue-comments",children:[S.jsxs("div",{className:"section-title",children:["关联评论 (",e.commentIds.length,")",N.length>0&&S.jsxs("button",{className:"link",onClick:async()=>{await o(e.id,{commentIds:[...e.commentIds,...N]}),f()},children:["+ 添加选中的 ",N.length," 条评论"]})]}),e.commentIds.map(C=>{const b=E.get(C),A=()=>{o(e.id,{commentIds:e.commentIds.filter(B=>B!==C)})};return b?S.jsx(wA,{comment:b,onUnlink:A},C):S.jsxs("div",{className:"linked-comment muted",children:["评论 ",C.slice(0,8)," 已不存在"," ",S.jsx("button",{className:"link",onClick:A,children:"移除"})]},C)})]})]})}function kA(){const e=G(b=>b.issues),t=G(b=>b.loadIssues),n=G(b=>b.createIssue),i=G(b=>b.selectedCommentIds),o=G(b=>b.clearSelectedComments),a=G(b=>b.setPanel),[l,c]=Q.useState("open"),[f,d]=Q.useState(null),[p,m]=Q.useState(!1),[w,v]=Q.useState(""),[k,E]=Q.useState("");Q.useEffect(()=>{t()},[t]),Q.useEffect(()=>{i.length>0&&!f&&m(!0)},[i.length,f]);const N=e.filter(b=>l==="all"||b.status===l),C=f?e.find(b=>b.id===f):void 0;return S.jsxs("aside",{className:"issues-drawer",children:[S.jsxs("div",{className:"drawer-head",children:[S.jsx("span",{className:"drawer-title",children:"Issues"}),S.jsx("div",{className:"tabs small",role:"group","aria-label":"Issue 筛选",children:["open","closed","all"].map(b=>S.jsx("button",{className:`tab ${l===b?"active":""}`,onClick:()=>c(b),children:b},b))}),S.jsx("span",{className:"spacer"}),S.jsx("button",{onClick:()=>m(!0),children:"新建"}),S.jsx("button",{className:"icon",onClick:()=>a("diff"),title:"关闭 (Esc)",children:"✕"})]}),C?S.jsx(vA,{issue:C,onBack:()=>d(null)}):S.jsxs(S.Fragment,{children:[p&&S.jsxs("div",{className:"issue-form",children:[S.jsx("input",{value:w,onChange:b=>v(b.target.value),placeholder:"标题",autoFocus:!0}),S.jsx("textarea",{value:k,onChange:b=>E(b.target.value),rows:4,placeholder:"描述(Markdown,可选)"}),i.length>0&&S.jsxs("div",{className:"muted",children:["将关联 ",i.length," 条选中的评论"]}),S.jsxs("div",{className:"row-actions",children:[S.jsx("button",{className:"primary",disabled:!w.trim(),onClick:async()=>{const b=await n({title:w,body:k,commentIds:i});b&&(v(""),E(""),m(!1),d(b.id))},children:"创建 Issue"}),S.jsx("button",{onClick:()=>{m(!1),o()},children:"取消"})]})]}),S.jsxs("div",{className:"issue-list",children:[N.length===0&&S.jsxs("div",{className:"muted empty",children:["没有 ",l==="all"?"":l," Issue"]}),N.map(b=>S.jsxs("div",{className:"issue-row",onClick:()=>d(b.id),children:[S.jsx("span",{className:`badge badge-${b.status}`,children:b.status}),S.jsx("span",{className:"title",children:b.title}),S.jsxs("span",{className:"muted",children:[b.commentIds.length," 评论"]})]},b.id))]})]})]})}function Cw({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 S.jsxs("div",{className:"comment-editor",onMouseDown:m=>m.stopPropagation(),children:[S.jsx("div",{className:"comment-editor-head",children:e}),S.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()}}),S.jsxs("div",{className:"comment-editor-actions",children:[S.jsx("button",{className:"primary",onClick:()=>{p()},disabled:!a.trim()||c,children:n}),S.jsx("button",{onClick:o,children:"取消"})]})]})}function sg(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function xA(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 SA(e){const t=Dn(e);return t?t.kind==="working"?"Unstaged":t.kind==="staged"?"Staged":t.kind==="all"?"All":ug(t):e}function og({comment:e,showSnippet:t=!1,showFile:n=!1}){const i=G(C=>C.updateComment),o=G(C=>C.deleteComment),a=G(C=>C.exportComments),l=G(C=>C.selectedCommentIds.includes(e.id)),c=G(C=>C.toggleSelectComment),f=G(C=>C.setReattaching),d=G(C=>C.reattaching===e.id),p=G(C=>C.focusedCommentId===e.id),m=G(C=>C.focusComment),w=G(C=>C.targetKey),[v,k]=Q.useState(!1),E=e.startLine===e.endLine?`${e.startLine}`:`${e.startLine}-${e.endLine}`,N=e.status!=="orphaned"&&e.targetKey!==w?SA(e.targetKey):null;return S.jsxs("div",{className:`comment-card status-${e.status} ${l?"selected":""} ${p?"focused":""} ${d?"reattaching":""}`,onClick:()=>{p||m(e.id)},children:[S.jsxs("div",{className:"comment-head",children:[n&&S.jsx("span",{className:"mono file",title:e.filePath,children:e.filePath.split("/").pop()}),S.jsx("label",{className:"check",title:"选中以创建 / 关联 Issue",onClick:C=>C.stopPropagation(),children:S.jsx("input",{type:"checkbox",checked:l,onChange:()=>c(e.id)})}),S.jsxs("span",{className:"mono",children:[e.side," ",E]}),S.jsx("span",{className:`badge badge-${e.status}`,children:e.status}),N&&S.jsx("span",{className:"badge",title:`这条评论现在位于 ${e.targetKey},点击卡片可跳转`,children:N}),S.jsx("span",{className:"muted time",title:`created ${sg(e.createdAt)}${e.exportedAt?`
|
|
194
|
-
exported ${sg(e.exportedAt)}`:""}`,children:xA(e.updatedAt)}),S.jsxs("span",{className:"card-actions",children:[e.status==="orphaned"&&S.jsx("button",{className:`link ${d?"active":""}`,onClick:C=>{C.stopPropagation(),f(d?null:e.id)},children:d?"取消重附着":"重新附着"}),S.jsx("button",{className:"link",onClick:C=>{C.stopPropagation(),a([e.id])},title:"复制此条评论",children:"复制"}),S.jsx("button",{className:"link",onClick:C=>{C.stopPropagation(),k(!0)},children:"编辑"}),S.jsx("button",{className:"link danger",onClick:C=>{C.stopPropagation(),window.confirm("删除这条评论?")&&o(e.id)},children:"删除"})]})]}),(t||e.status==="orphaned")&&e.codeSnippet.length>0&&S.jsx("pre",{className:"snippet",children:e.codeSnippet.map((C,b)=>S.jsxs("div",{children:[S.jsx("span",{className:"ln",children:e.startLine+b}),C]},b))}),v?S.jsx(Cw,{title:"编辑评论",initial:e.body,onSave:async C=>{await i(e.id,{body:C}),k(!1)},onCancel:()=>k(!1)}):S.jsx(If,{text:e.body})]})}function lg(e){return[e.filePath,e.side==="old"?0:1,e.endLine]}function yc(e,t){const[n,i,o]=lg(e),[a,l,c]=lg(t);return n!==a?n<a?-1:1:o!==c?o-c:i-l}function CA(){const e=G(P=>P.comments),t=G(P=>P.activeFile),n=G(P=>P.railFilter),i=G(P=>P.setRailFilter),o=G(P=>P.editor),a=G(P=>P.setEditor),l=G(P=>P.createComment),c=G(P=>P.copyAllComments),f=G(P=>P.includeExported),d=G(P=>P.setIncludeExported),p=G(P=>P.selectedCommentIds),m=G(P=>P.setPanel),w=G(P=>P.reattaching),v=G(P=>P.setReattaching),k=Q.useMemo(()=>({file:e.filter(P=>P.filePath===t).length,all:e.length,unexported:e.filter(P=>P.status==="active").length,orphaned:e.filter(P=>P.status==="orphaned").length}),[e,t]),E=Q.useMemo(()=>{let P=e;n==="file"?P=P.filter(oe=>oe.filePath===t):n==="unexported"&&(P=P.filter(oe=>oe.status==="active"));const M=P.filter(oe=>oe.status==="orphaned").sort(yc),ee=P.filter(oe=>oe.status!=="orphaned").sort(yc);return{orphaned:M,attached:ee}},[e,n,t]),N=Q.useMemo(()=>{if(!o||n==="file"&&o.filePath!==t)return-1;const P={filePath:o.filePath,side:o.side,endLine:o.endLine};let M=0;for(;M<E.attached.length&&yc(E.attached[M],P)<=0;)M++;return M},[o,E.attached,n,t]),C=k.unexported+(f?e.filter(P=>P.status==="exported").length:0),b=n!=="file",A=[["file","此文件",k.file],["all","全部",k.all],["unexported","未导出",k.unexported]],B=o&&S.jsx(Cw,{title:`新评论 · ${o.filePath.split("/").pop()} ${o.side} ${o.startLine===o.endLine?o.startLine:`${o.startLine}-${o.endLine}`}`,onSave:async P=>{await l({filePath:o.filePath,side:o.side,startLine:o.startLine,endLine:o.endLine,body:P})},onCancel:()=>a(null)},`${o.filePath}:${o.side}:${o.startLine}:${o.endLine}`);return S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"rail-tools",children:[S.jsx("div",{className:"seg small",role:"group","aria-label":"评论筛选",children:A.map(([P,M,ee])=>S.jsxs("button",{className:n===P?"active":"","aria-pressed":n===P,onClick:()=>i(P),children:[M,S.jsx("span",{className:"tab-count",children:ee})]},P))}),S.jsx("span",{className:"spacer"}),k.orphaned>0&&S.jsxs("span",{className:"badge badge-orphaned",children:[k.orphaned," orphaned"]})]}),w&&S.jsxs("div",{className:"rail-notice",children:["在 diff 中点击或拖选行,把评论附着到该位置。",S.jsx("button",{className:"link",onClick:()=>v(null),children:"取消"})]}),S.jsxs("div",{className:"rail-list",children:[E.orphaned.map(P=>S.jsx(og,{comment:P,showFile:b},P.id)),E.attached.map((P,M)=>S.jsxs("div",{className:"rail-slot",children:[N===M&&B,S.jsx(og,{comment:P,showFile:b})]},P.id)),o&&N===E.attached.length&&B,o&&N===-1&&B,k.all===0&&!o&&S.jsxs("div",{className:"muted empty",children:["还没有评论。在 diff 行旁点击 ",S.jsx("span",{className:"add-btn static",children:"+"})," 或拖选多行开始。"]}),k.all>0&&E.orphaned.length+E.attached.length===0&&!o&&S.jsx("div",{className:"muted empty",children:"没有符合筛选的评论"})]}),S.jsxs("div",{className:"rail-foot",children:[S.jsxs("div",{className:"rail-foot-row",children:[S.jsxs("button",{className:"send",onClick:()=>{c()},disabled:C===0,title:"把评论复制为 agent 可读的提示词",children:["复制评论",k.unexported>0&&S.jsxs("span",{className:"send-n",children:[k.unexported," 未导出"]})]}),S.jsxs("label",{className:"check",children:[S.jsx("input",{type:"checkbox",checked:f,onChange:P=>d(P.target.checked)}),"含已导出"]})]}),p.length>0&&S.jsxs("button",{className:"accent",onClick:()=>m("issues"),children:["从 ",p.length," 条选中评论创建 Issue"]})]})]})}function _A(e){const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toDateString()===new Date().toDateString()?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):t.toLocaleDateString()}function EA({todo:e,showBranch:t}){const n=G(k=>k.updateTodo),i=G(k=>k.deleteTodo),[o,a]=Q.useState(!1),[l,c]=Q.useState(!1),[f,d]=Q.useState(e.title),[p,m]=Q.useState(e.body),w=e.status==="done",v=()=>{d(e.title),m(e.body),c(!0),a(!0)};return S.jsxs("div",{className:`todo-card status-${e.status}`,children:[S.jsxs("div",{className:"todo-head",onClick:()=>a(k=>!k),children:[S.jsx("input",{type:"checkbox",checked:w,onClick:k=>k.stopPropagation(),onChange:()=>{n(e.id,{status:w?"open":"done"})},title:w?"标记为未完成":"标记为完成"}),S.jsx("span",{className:"title",children:e.title}),t&&S.jsx("span",{className:"badge",children:e.branch}),S.jsx("span",{className:"time",title:e.updatedAt,children:_A(e.updatedAt)}),S.jsxs("span",{className:"card-actions",children:[S.jsx("button",{className:"link",onClick:k=>{k.stopPropagation(),v()},children:"编辑"}),S.jsx("button",{className:"link danger",onClick:k=>{k.stopPropagation(),window.confirm(`删除 Todo「${e.title}」?`)&&i(e.id)},children:"删除"})]})]}),o&&(l?S.jsxs("div",{className:"todo-edit",children:[S.jsx("input",{value:f,onChange:k=>d(k.target.value),placeholder:"标题",autoFocus:!0}),S.jsx("textarea",{value:p,onChange:k=>m(k.target.value),rows:4,placeholder:"描述(Markdown,可选)"}),S.jsxs("div",{className:"row-actions",children:[S.jsx("button",{className:"primary",disabled:!f.trim(),onClick:async()=>{await n(e.id,{title:f,body:p}),c(!1)},children:"保存"}),S.jsx("button",{onClick:()=>c(!1),children:"取消"})]})]}):S.jsx("div",{className:"todo-body",children:e.body?S.jsx(If,{text:e.body}):S.jsx("p",{className:"muted",children:"没有描述"})}))]})}function bA(){const e=G(P=>P.todos),t=G(P=>P.loadTodos),n=G(P=>P.createTodo),i=G(P=>P.exportTodos),o=G(P=>P.repo),a=G(P=>P.root),l=Kc(o,a),[c,f]=Q.useState("open"),[d,p]=Q.useState(!1),[m,w]=Q.useState(!1),[v,k]=Q.useState("");Q.useEffect(()=>{t()},[t]);const E=Q.useMemo(()=>d?e:e.filter(P=>P.branch===l),[e,d,l]),N=Q.useMemo(()=>E.filter(P=>c==="all"||P.status===c).slice().sort((P,M)=>P.createdAt<M.createdAt?-1:P.createdAt>M.createdAt?1:0),[E,c]),C=[["open","open",E.filter(P=>P.status==="open").length],["done","done",E.filter(P=>P.status==="done").length],["all","all",E.length]],b=e.filter(P=>P.branch===l&&(m||P.status==="open")).length,A=c==="done"?"没有已完成的 Todo":c==="open"&&E.length>0?"全部完成了":"还没有 Todo,在上面写第一条。",B=async()=>{const P=v.trim();if(!P)return;await n({title:P,body:""})&&k("")};return S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"rail-tools",children:[S.jsx("div",{className:"seg small",role:"group","aria-label":"Todo 筛选",children:C.map(([P,M,ee])=>S.jsxs("button",{className:c===P?"active":"","aria-pressed":c===P,onClick:()=>f(P),children:[M,S.jsx("span",{className:"tab-count",children:ee})]},P))}),S.jsx("span",{className:"spacer"}),S.jsxs("label",{className:"check",children:[S.jsx("input",{type:"checkbox",checked:d,onChange:P=>p(P.target.checked)}),"所有分支"]})]}),S.jsxs("div",{className:"rail-list",children:[S.jsx("form",{className:"todo-add",onSubmit:P=>{P.preventDefault(),B()},children:S.jsx("input",{value:v,onChange:P=>k(P.target.value),placeholder:`给 ${l} 添加 Todo,回车创建`,"aria-label":"新 Todo"})}),N.length===0&&S.jsx("div",{className:"muted empty",children:A}),N.map(P=>S.jsx(EA,{todo:P,showBranch:d},P.id))]}),S.jsx("div",{className:"rail-foot",children:S.jsxs("div",{className:"rail-foot-row",children:[S.jsxs("button",{className:"send",onClick:()=>{i(m)},disabled:b===0,title:`把 ${l} 的 Todo 复制为编号清单`,children:["复制 Todo",b>0&&S.jsx("span",{className:"send-n",children:b})]}),S.jsxs("label",{className:"check",children:[S.jsx("input",{type:"checkbox",checked:m,onChange:P=>w(P.target.checked)}),"含已完成"]})]})})]})}function IA(){const e=G(c=>c.railTab),t=G(c=>c.setRailTab),n=G(c=>c.comments.length),i=G(c=>c.repo),o=G(c=>c.root),a=Kc(i,o),l=G(c=>c.todos.filter(f=>f.branch===a&&f.status==="open").length);return S.jsxs("aside",{className:"rail",children:[S.jsx("div",{className:"rail-head",children:S.jsxs("div",{className:"tabs",role:"group","aria-label":"右栏",children:[S.jsxs("button",{className:`tab ${e==="comments"?"active":""}`,"aria-pressed":e==="comments",onClick:()=>t("comments"),children:["评论",n>0&&S.jsx("span",{className:"tab-count",children:n})]}),S.jsxs("button",{className:`tab ${e==="todos"?"active":""}`,"aria-pressed":e==="todos",onClick:()=>t("todos"),title:`${a} 分支的 Todo`,children:["Todo",l>0&&S.jsx("span",{className:"tab-count",children:l})]})]})}),e==="comments"?S.jsx(CA,{}):S.jsx(bA,{})]})}function NA(){const e=G(t=>t.toast);return e?S.jsx("div",{className:`toast toast-${e.kind}`,role:"status",children:e.message}):null}function TA(e){if(!(e instanceof HTMLElement))return!1;const t=e.tagName;return t==="INPUT"?e.type!=="checkbox":t==="TEXTAREA"||t==="SELECT"||e.isContentEditable}function AA(e){const t=Dn(e.targetKey);if(!t||!hr(t))return e.files.map(a=>({view:e.targetKey,path:a.path}));const n=t.worktree?{worktree:t.worktree}:{},i=$n({kind:"working",...n}),o=$n({kind:"staged",...n});return[...e.unstaged.map(a=>({view:i,path:a.path})),...e.staged.map(a=>({view:o,path:a.path}))]}function PA(){const e=G(c=>c.init),t=G(c=>c.initError),n=G(c=>c.repo),i=G(c=>c.panel),o=G(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=ze.events(o);let f=!1;const d=p=>{try{G.getState().onRepoChanged(JSON.parse(p.data))}catch{}};return c.addEventListener("changed",d),c.onopen=()=>{f&&(f=!1,G.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||TA(f.target))return;const d=G.getState();if(f.key==="r")f.preventDefault(),d.refresh();else if(f.key==="j"||f.key==="k"){if(d.panel!=="diff")return;const p=AA(d);if(p.length===0)return;f.preventDefault();let m=p.findIndex(k=>k.path===d.activeFile&&k.view===d.targetKey);m<0&&(m=p.findIndex(k=>k.path===d.activeFile));const w=f.key==="j"?Math.min(p.length-1,m+1):Math.max(0,m-1),v=p[w];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.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?S.jsxs("div",{className:"fatal",children:[S.jsx("h1",{children:"warden"}),S.jsxs("p",{children:["无法连接服务端:",t]}),S.jsx("button",{onClick:()=>{e()},children:"重试"})]}):n?S.jsxs("div",{className:"app",children:[S.jsx(Dk,{}),S.jsxs("div",{className:"body",children:[S.jsx(zk,{}),S.jsxs("main",{className:"main",children:[a&&S.jsx(s_,{active:i==="commits"}),i!=="commits"&&S.jsx(ZC,{})]}),i==="issues"?S.jsx(kA,{}):i==="diff"?S.jsx(IA,{}):null]}),S.jsx(NA,{})]}):S.jsx("div",{className:"loading-screen",children:"加载中…"})}const _w=document.getElementById("root");if(!_w)throw new Error("#root missing");bk.createRoot(_w).render(S.jsx(vs.StrictMode,{children:S.jsx(PA,{})}));
|