comprehende 0.5.4 → 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 +1 -1
- package/dist/api/agent-md.js +10 -9
- package/dist/api/live.js +16 -2
- package/dist/cli/args.js +1 -1
- package/dist/cli/commands.js +5 -2
- package/dist/cli/main.js +5 -6
- package/dist/git/exec.js +22 -0
- package/dist/git/lfs.js +2 -6
- package/dist/git/repo.js +9 -3
- package/dist/review/pins.js +30 -0
- package/dist/schema/parse.js +206 -20
- package/dist/schema/skill-sync.js +3 -1
- package/dist/schema/source.js +89 -0
- package/dist/schema/types.js +8 -0
- package/dist/ui/assets/bricolage-grotesque-latin-ext-opsz-normal-IcJDqblK.woff2 +0 -0
- package/dist/ui/assets/bricolage-grotesque-latin-opsz-normal-Cre6nC2_.woff2 +0 -0
- package/dist/ui/assets/bricolage-grotesque-vietnamese-opsz-normal-D9N6E8K1.woff2 +0 -0
- package/dist/ui/assets/index-C1EoRByu.css +1 -0
- package/dist/ui/assets/index-su33x8uU.js +1713 -0
- package/dist/ui/index.html +2 -2
- package/package.json +3 -3
- package/skills/comprehende/SKILL.md +33 -15
- package/skills/comprehende/references/example.md +10 -5
- package/skills/comprehende/references/review.schema.json +95 -27
- package/dist/ui/assets/index-BQTydqt9.css +0 -1
- package/dist/ui/assets/index-COQ0_ea8.js +0 -1713
- package/dist/ui/assets/source-serif-4-cyrillic-400-normal-B8Z6Jvzv.woff +0 -0
- package/dist/ui/assets/source-serif-4-cyrillic-400-normal-C44pakCn.woff2 +0 -0
- package/dist/ui/assets/source-serif-4-cyrillic-600-normal-BDP5YDHD.woff2 +0 -0
- package/dist/ui/assets/source-serif-4-cyrillic-600-normal-DFnC3vAY.woff +0 -0
- package/dist/ui/assets/source-serif-4-cyrillic-ext-400-normal-CWV284fw.woff2 +0 -0
- package/dist/ui/assets/source-serif-4-cyrillic-ext-400-normal-DLkyKLvH.woff +0 -0
- package/dist/ui/assets/source-serif-4-cyrillic-ext-600-normal-D_E8FDgP.woff2 +0 -0
- package/dist/ui/assets/source-serif-4-cyrillic-ext-600-normal-DiT2IGQm.woff +0 -0
- package/dist/ui/assets/source-serif-4-greek-400-normal-BccYJ-vZ.woff +0 -0
- package/dist/ui/assets/source-serif-4-greek-400-normal-Cw5-AHNN.woff2 +0 -0
- package/dist/ui/assets/source-serif-4-greek-600-normal-DdRkKr-1.woff2 +0 -0
- package/dist/ui/assets/source-serif-4-greek-600-normal-DhXQw1Kl.woff +0 -0
- package/dist/ui/assets/source-serif-4-latin-400-normal-DJ5YJwmz.woff2 +0 -0
- package/dist/ui/assets/source-serif-4-latin-400-normal-Dn3IlU-Z.woff +0 -0
- package/dist/ui/assets/source-serif-4-latin-600-normal-DMD1h6_f.woff +0 -0
- package/dist/ui/assets/source-serif-4-latin-600-normal-DouSKlru.woff2 +0 -0
- package/dist/ui/assets/source-serif-4-latin-ext-400-normal-CEpydyUl.woff +0 -0
- package/dist/ui/assets/source-serif-4-latin-ext-400-normal-Cp7z-ARB.woff2 +0 -0
- package/dist/ui/assets/source-serif-4-latin-ext-600-normal-0sIUyHMO.woff2 +0 -0
- package/dist/ui/assets/source-serif-4-latin-ext-600-normal-C6NNqpJh.woff +0 -0
- package/dist/ui/assets/source-serif-4-vietnamese-400-normal-BbG3LG1A.woff2 +0 -0
- package/dist/ui/assets/source-serif-4-vietnamese-400-normal-DR1UuFon.woff +0 -0
- package/dist/ui/assets/source-serif-4-vietnamese-600-normal-B0WJbuqT.woff +0 -0
- package/dist/ui/assets/source-serif-4-vietnamese-600-normal-CznyfUKR.woff2 +0 -0
|
@@ -0,0 +1,1713 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./angular-html-DA-rfuFy.js","./html-pp8916En.js","./javascript-wDzz0qaB.js","./css-CLj8gQPS.js","./angular-ts-BrjP3tb8.js","./scss-D5BDwBP9.js","./apl-CORt7UWP.js","./xml-sdJ4AIDG.js","./java-CylS5w8V.js","./json-Cp-IABpG.js","./astro-HNnZUWAn.js","./typescript-BPQ3VLAy.js","./postcss-CXtECtnM.js","./tsx-COt5Ahok.js","./blade-2xfisSek.js","./html-derivative-DlHx6ybY.js","./sql-CRqJ_cUM.js","./bsl-DlhNcFeZ.js","./sdbl-DVxCFoDh.js","./cairo-KRGpt6FW.js","./python-B6aJPvgy.js","./chapel-DTp_pixX.js","./c-BIGW1oBm.js","./cobol-nBiQ_Alo.js","./coffee-Ch7k5sss.js","./cpp-BMRokrvK.js","./regexp-CDVJQ6XC.js","./glsl-DplSGwfg.js","./crystal-DGywbUpC.js","./shellscript-Yzrsuije.js","./edge-FbVlp4U3.js","./elixir-CkH2-t6x.js","./elm-DbKCFpqz.js","./erb-DXfck5VN.js","./ruby-C0TQ7zu5.js","./haml-D5jkg6IW.js","./graphql-ChdNCCLP.js","./jsx-g9-lgVsj.js","./lua-BaeVxFsk.js","./yaml-Buea-lGh.js","./erlang-DsQrWhSR.js","./markdown-Cvjx9yec.js","./fortran-fixed-form-CkoXwp7k.js","./fortran-free-form-BxgE0vQu.js","./fsharp-CXgrBDvD.js","./gdresource-TyuKm33G.js","./gdshader-DkwncUOv.js","./gdscript-DqcFQ5yU.js","./git-commit-F4YmCXRG.js","./diff-D97Zzqfu.js","./git-rebase-r7XF79zn.js","./glimmer-js-ByusRIyA.js","./glimmer-ts-BfAWNZQY.js","./hack-BWmVpMyf.js","./handlebars-BpdQsYii.js","./http-jrhK8wxY.js","./hurl-irOxFIW8.js","./csv-fuZLfV_i.js","./hxml-2-FPmUDs.js","./haxe-CfZj7gIn.js","./jinja-f2NsQr07.js","./jison-wvAkD_A8.js","./julia-5Bft2YPA.js","./r-Cf5RLm7j.js","./just-Cwhn7H3k.js","./perl-B9cMNwum.js","./latex-D5pSuvFb.js","./tex-D96PA37w.js","./liquid-C0sCDyMI.js","./marko-DjSrsDqO.js","./less-B1dDrJ26.js","./mdc-D1_yUvq7.js","./nextflow-C-mBbutL.js","./nextflow-groovy-vE_lwT2v.js","./nginx-BpAMiNFr.js","./nim-BIad80T-.js","./org-DM6o9KBp.js","./ini-BEwlwnbL.js","./make-CHLpvVh8.js","./php-Csjmro_R.js","./vb-Cu-pLBUe.js","./clojure-P80f7IUj.js","./objective-c-DXmwc3jG.js","./docker-BcOcwvcX.js","./go-C27-OAKa.js","./groovy-gcz8RCvz.js","./raku-DXvB9xmW.js","./rust-B1yitclQ.js","./scala-CqE71os6.js","./csharp-DSvCPggb.js","./dart-bE4Kk8sk.js","./ocaml-C0hk2d4L.js","./zig-VOosw3JB.js","./xsl-CtQFsRM5.js","./pug-DKIMFp6K.js","./qml-3beO22l8.js","./razor-BjBPvh-w.js","./rst-bs7f0vWN.js","./cmake-D1j8_8rp.js","./sas-DEy46yEz.js","./shaderlab-Dg9Lc6iA.js","./hlsl-D3lLCCz7.js","./shellsession-BADoaaVG.js","./soy-8wufbnw4.js","./sparql-rVzFXLq3.js","./turtle-BsS91CYL.js","./stata-DI20mbqo.js","./surrealql-Cjom0U5J.js","./svelte-Cy7k_4gC.js","./templ-DhtptRzy.js","./ts-tags-D351s5mN.js","./twig-27uCiNez.js","./typst-BUadGCkm.js","./bat-CickPsom.js","./bibtex-CHM0blh-.js","./jsonc-Des-eS-w.js","./log-2UxHyX5q.js","./powershell-BmBUJMz7.js","./swift-C2oV4EkX.js","./verilog-nZwndyjY.js","./system-verilog-0hqHdDBg.js","./vue-BqiEGhQt.js","./vue-html-AaS7Mt5G.js","./vue-vine-BoDAl6tE.js","./stylus-BEDo0Tqx.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
function xO(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&&!Array.isArray(i)){for(const o in i)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(i,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>i[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(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 s of o)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function Vd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dp={exports:{}},Ks={};var Zx;function SO(){if(Zx)return Ks;Zx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,o,s){var l=null;if(s!==void 0&&(l=""+s),o.key!==void 0&&(l=""+o.key),"key"in o){s={};for(var c in o)c!=="key"&&(s[c]=o[c])}else s=o;return o=s.ref,{$$typeof:e,type:i,key:l,ref:o!==void 0?o:null,props:s}}return Ks.Fragment=t,Ks.jsx=n,Ks.jsxs=n,Ks}var Jx;function _O(){return Jx||(Jx=1,Dp.exports=SO()),Dp.exports}var k=_O(),Mp={exports:{}},Te={};var eS;function CO(){if(eS)return Te;eS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),g=Symbol.iterator;function v(H){return H===null||typeof H!="object"?null:(H=g&&H[g]||H["@@iterator"],typeof H=="function"?H:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,w={};function _(H,Y,N){this.props=H,this.context=Y,this.refs=w,this.updater=N||x}_.prototype.isReactComponent={},_.prototype.setState=function(H,Y){if(typeof H!="object"&&typeof H!="function"&&H!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,H,Y,"setState")},_.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function C(){}C.prototype=_.prototype;function T(H,Y,N){this.props=H,this.context=Y,this.refs=w,this.updater=N||x}var D=T.prototype=new C;D.constructor=T,S(D,_.prototype),D.isPureReactComponent=!0;var I=Array.isArray;function O(){}var P={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function F(H,Y,N){var se=N.ref;return{$$typeof:e,type:H,key:Y,ref:se!==void 0?se:null,props:N}}function Q(H,Y){return F(H.type,Y,H.props)}function G(H){return typeof H=="object"&&H!==null&&H.$$typeof===e}function B(H){var Y={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(N){return Y[N]})}var ee=/\/+/g;function Z(H,Y){return typeof H=="object"&&H!==null&&H.key!=null?B(""+H.key):Y.toString(36)}function W(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status=="string"?H.then(O,O):(H.status="pending",H.then(function(Y){H.status==="pending"&&(H.status="fulfilled",H.value=Y)},function(Y){H.status==="pending"&&(H.status="rejected",H.reason=Y)})),H.status){case"fulfilled":return H.value;case"rejected":throw H.reason}}throw H}function z(H,Y,N,se,de){var le=typeof H;(le==="undefined"||le==="boolean")&&(H=null);var be=!1;if(H===null)be=!0;else switch(le){case"bigint":case"string":case"number":be=!0;break;case"object":switch(H.$$typeof){case e:case t:be=!0;break;case p:return be=H._init,z(be(H._payload),Y,N,se,de)}}if(be)return de=de(H),be=se===""?"."+Z(H,0):se,I(de)?(N="",be!=null&&(N=be.replace(ee,"$&/")+"/"),z(de,Y,N,"",function(We){return We})):de!=null&&(G(de)&&(de=Q(de,N+(de.key==null||H&&H.key===de.key?"":(""+de.key).replace(ee,"$&/")+"/")+be)),Y.push(de)),1;be=0;var Ee=se===""?".":se+":";if(I(H))for(var ge=0;ge<H.length;ge++)se=H[ge],le=Ee+Z(se,ge),be+=z(se,Y,N,le,de);else if(ge=v(H),typeof ge=="function")for(H=ge.call(H),ge=0;!(se=H.next()).done;)se=se.value,le=Ee+Z(se,ge++),be+=z(se,Y,N,le,de);else if(le==="object"){if(typeof H.then=="function")return z(W(H),Y,N,se,de);throw Y=String(H),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(H).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return be}function q(H,Y,N){if(H==null)return H;var se=[],de=0;return z(H,se,"","",function(le){return Y.call(N,le,de++)}),se}function te(H){if(H._status===-1){var Y=H._result;Y=Y(),Y.then(function(N){(H._status===0||H._status===-1)&&(H._status=1,H._result=N)},function(N){(H._status===0||H._status===-1)&&(H._status=2,H._result=N)}),H._status===-1&&(H._status=0,H._result=Y)}if(H._status===1)return H._result.default;throw H._result}var ce=typeof reportError=="function"?reportError:function(H){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof H=="object"&&H!==null&&typeof H.message=="string"?String(H.message):String(H),error:H});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",H);return}console.error(H)},R={map:q,forEach:function(H,Y,N){q(H,function(){Y.apply(this,arguments)},N)},count:function(H){var Y=0;return q(H,function(){Y++}),Y},toArray:function(H){return q(H,function(Y){return Y})||[]},only:function(H){if(!G(H))throw Error("React.Children.only expected to receive a single React element child.");return H}};return Te.Activity=m,Te.Children=R,Te.Component=_,Te.Fragment=n,Te.Profiler=o,Te.PureComponent=T,Te.StrictMode=i,Te.Suspense=d,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,Te.__COMPILER_RUNTIME={__proto__:null,c:function(H){return P.H.useMemoCache(H)}},Te.cache=function(H){return function(){return H.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(H,Y,N){if(H==null)throw Error("The argument must be a React element, but you passed "+H+".");var se=S({},H.props),de=H.key;if(Y!=null)for(le in Y.key!==void 0&&(de=""+Y.key),Y)!j.call(Y,le)||le==="key"||le==="__self"||le==="__source"||le==="ref"&&Y.ref===void 0||(se[le]=Y[le]);var le=arguments.length-2;if(le===1)se.children=N;else if(1<le){for(var be=Array(le),Ee=0;Ee<le;Ee++)be[Ee]=arguments[Ee+2];se.children=be}return F(H.type,de,se)},Te.createContext=function(H){return H={$$typeof:l,_currentValue:H,_currentValue2:H,_threadCount:0,Provider:null,Consumer:null},H.Provider=H,H.Consumer={$$typeof:s,_context:H},H},Te.createElement=function(H,Y,N){var se,de={},le=null;if(Y!=null)for(se in Y.key!==void 0&&(le=""+Y.key),Y)j.call(Y,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(de[se]=Y[se]);var be=arguments.length-2;if(be===1)de.children=N;else if(1<be){for(var Ee=Array(be),ge=0;ge<be;ge++)Ee[ge]=arguments[ge+2];de.children=Ee}if(H&&H.defaultProps)for(se in be=H.defaultProps,be)de[se]===void 0&&(de[se]=be[se]);return F(H,le,de)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(H){return{$$typeof:c,render:H}},Te.isValidElement=G,Te.lazy=function(H){return{$$typeof:p,_payload:{_status:-1,_result:H},_init:te}},Te.memo=function(H,Y){return{$$typeof:f,type:H,compare:Y===void 0?null:Y}},Te.startTransition=function(H){var Y=P.T,N={};P.T=N;try{var se=H(),de=P.S;de!==null&&de(N,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(O,ce)}catch(le){ce(le)}finally{Y!==null&&N.types!==null&&(Y.types=N.types),P.T=Y}},Te.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},Te.use=function(H){return P.H.use(H)},Te.useActionState=function(H,Y,N){return P.H.useActionState(H,Y,N)},Te.useCallback=function(H,Y){return P.H.useCallback(H,Y)},Te.useContext=function(H){return P.H.useContext(H)},Te.useDebugValue=function(){},Te.useDeferredValue=function(H,Y){return P.H.useDeferredValue(H,Y)},Te.useEffect=function(H,Y){return P.H.useEffect(H,Y)},Te.useEffectEvent=function(H){return P.H.useEffectEvent(H)},Te.useId=function(){return P.H.useId()},Te.useImperativeHandle=function(H,Y,N){return P.H.useImperativeHandle(H,Y,N)},Te.useInsertionEffect=function(H,Y){return P.H.useInsertionEffect(H,Y)},Te.useLayoutEffect=function(H,Y){return P.H.useLayoutEffect(H,Y)},Te.useMemo=function(H,Y){return P.H.useMemo(H,Y)},Te.useOptimistic=function(H,Y){return P.H.useOptimistic(H,Y)},Te.useReducer=function(H,Y,N){return P.H.useReducer(H,Y,N)},Te.useRef=function(H){return P.H.useRef(H)},Te.useState=function(H){return P.H.useState(H)},Te.useSyncExternalStore=function(H,Y,N){return P.H.useSyncExternalStore(H,Y,N)},Te.useTransition=function(){return P.H.useTransition()},Te.version="19.2.8",Te}var tS;function Kg(){return tS||(tS=1,Mp.exports=CO()),Mp.exports}var M=Kg();const wO=Vd(M),zl=xO({__proto__:null,default:wO},[M]);var Ip={exports:{}},Qs={},Np={exports:{}},zp={};var nS;function EO(){return nS||(nS=1,(function(e){function t(z,q){var te=z.length;z.push(q);e:for(;0<te;){var ce=te-1>>>1,R=z[ce];if(0<o(R,q))z[ce]=q,z[te]=R,te=ce;else break e}}function n(z){return z.length===0?null:z[0]}function i(z){if(z.length===0)return null;var q=z[0],te=z.pop();if(te!==q){z[0]=te;e:for(var ce=0,R=z.length,H=R>>>1;ce<H;){var Y=2*(ce+1)-1,N=z[Y],se=Y+1,de=z[se];if(0>o(N,te))se<R&&0>o(de,N)?(z[ce]=de,z[se]=te,ce=se):(z[ce]=N,z[Y]=te,ce=Y);else if(se<R&&0>o(de,te))z[ce]=de,z[se]=te,ce=se;else break e}}return q}function o(z,q){var te=z.sortIndex-q.sortIndex;return te!==0?te:z.id-q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var d=[],f=[],p=1,m=null,g=3,v=!1,x=!1,S=!1,w=!1,_=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function D(z){for(var q=n(f);q!==null;){if(q.callback===null)i(f);else if(q.startTime<=z)i(f),q.sortIndex=q.expirationTime,t(d,q);else break;q=n(f)}}function I(z){if(S=!1,D(z),!x)if(n(d)!==null)x=!0,O||(O=!0,B());else{var q=n(f);q!==null&&W(I,q.startTime-z)}}var O=!1,P=-1,j=5,F=-1;function Q(){return w?!0:!(e.unstable_now()-F<j)}function G(){if(w=!1,O){var z=e.unstable_now();F=z;var q=!0;try{e:{x=!1,S&&(S=!1,C(P),P=-1),v=!0;var te=g;try{t:{for(D(z),m=n(d);m!==null&&!(m.expirationTime>z&&Q());){var ce=m.callback;if(typeof ce=="function"){m.callback=null,g=m.priorityLevel;var R=ce(m.expirationTime<=z);if(z=e.unstable_now(),typeof R=="function"){m.callback=R,D(z),q=!0;break t}m===n(d)&&i(d),D(z)}else i(d);m=n(d)}if(m!==null)q=!0;else{var H=n(f);H!==null&&W(I,H.startTime-z),q=!1}}break e}finally{m=null,g=te,v=!1}q=void 0}}finally{q?B():O=!1}}}var B;if(typeof T=="function")B=function(){T(G)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,Z=ee.port2;ee.port1.onmessage=G,B=function(){Z.postMessage(null)}}else B=function(){_(G,0)};function W(z,q){P=_(function(){z(e.unstable_now())},q)}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(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(z){switch(g){case 1:case 2:case 3:var q=3;break;default:q=g}var te=g;g=q;try{return z()}finally{g=te}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(z,q){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var te=g;g=z;try{return q()}finally{g=te}},e.unstable_scheduleCallback=function(z,q,te){var ce=e.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?ce+te:ce):te=ce,z){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=te+R,z={id:p++,callback:q,priorityLevel:z,startTime:te,expirationTime:R,sortIndex:-1},te>ce?(z.sortIndex=te,t(f,z),n(d)===null&&z===n(f)&&(S?(C(P),P=-1):S=!0,W(I,te-ce))):(z.sortIndex=R,t(d,z),x||v||(x=!0,O||(O=!0,B()))),z},e.unstable_shouldYield=Q,e.unstable_wrapCallback=function(z){var q=g;return function(){var te=g;g=q;try{return z.apply(this,arguments)}finally{g=te}}}})(zp)),zp}var iS;function kO(){return iS||(iS=1,Np.exports=EO()),Np.exports}var Pp={exports:{}},Gt={};var rS;function TO(){if(rS)return Gt;rS=1;var e=Kg();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function s(d,f,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:m==null?null:""+m,children:d,containerInfo:f,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Gt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Gt.createPortal=function(d,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return s(d,f,null,p)},Gt.flushSync=function(d){var f=l.T,p=i.p;try{if(l.T=null,i.p=2,d)return d()}finally{l.T=f,i.p=p,i.d.f()}},Gt.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,i.d.C(d,f))},Gt.prefetchDNS=function(d){typeof d=="string"&&i.d.D(d)},Gt.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var p=f.as,m=c(p,f.crossOrigin),g=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?i.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:g,fetchPriority:v}):p==="script"&&i.d.X(d,{crossOrigin:m,integrity:g,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Gt.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=c(f.as,f.crossOrigin);i.d.M(d,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&i.d.M(d)},Gt.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,m=c(p,f.crossOrigin);i.d.L(d,p,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Gt.preloadModule=function(d,f){if(typeof d=="string")if(f){var p=c(f.as,f.crossOrigin);i.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else i.d.m(d)},Gt.requestFormReset=function(d){i.d.r(d)},Gt.unstable_batchedUpdates=function(d,f){return d(f)},Gt.useFormState=function(d,f,p){return l.H.useFormState(d,f,p)},Gt.useFormStatus=function(){return l.H.useHostTransitionStatus()},Gt.version="19.2.8",Gt}var oS;function Mw(){if(oS)return Pp.exports;oS=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(),Pp.exports=TO(),Pp.exports}var aS;function AO(){if(aS)return Qs;aS=1;var e=kO(),t=Kg(),n=Mw();function i(r){var a="https://react.dev/errors/"+r;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)a+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+r+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function s(r){var a=r,u=r;if(r.alternate)for(;a.return;)a=a.return;else{r=a;do a=r,(a.flags&4098)!==0&&(u=a.return),r=a.return;while(r)}return a.tag===3?u:null}function l(r){if(r.tag===13){var a=r.memoizedState;if(a===null&&(r=r.alternate,r!==null&&(a=r.memoizedState)),a!==null)return a.dehydrated}return null}function c(r){if(r.tag===31){var a=r.memoizedState;if(a===null&&(r=r.alternate,r!==null&&(a=r.memoizedState)),a!==null)return a.dehydrated}return null}function d(r){if(s(r)!==r)throw Error(i(188))}function f(r){var a=r.alternate;if(!a){if(a=s(r),a===null)throw Error(i(188));return a!==r?null:r}for(var u=r,h=a;;){var y=u.return;if(y===null)break;var b=y.alternate;if(b===null){if(h=y.return,h!==null){u=h;continue}break}if(y.child===b.child){for(b=y.child;b;){if(b===u)return d(y),r;if(b===h)return d(y),a;b=b.sibling}throw Error(i(188))}if(u.return!==h.return)u=y,h=b;else{for(var E=!1,L=y.child;L;){if(L===u){E=!0,u=y,h=b;break}if(L===h){E=!0,h=y,u=b;break}L=L.sibling}if(!E){for(L=b.child;L;){if(L===u){E=!0,u=b,h=y;break}if(L===h){E=!0,h=b,u=y;break}L=L.sibling}if(!E)throw Error(i(189))}}if(u.alternate!==h)throw Error(i(190))}if(u.tag!==3)throw Error(i(188));return u.stateNode.current===u?r:a}function p(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r;for(r=r.child;r!==null;){if(a=p(r),a!==null)return a;r=r.sibling}return null}var m=Object.assign,g=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),T=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),Q=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function B(r){return r===null||typeof r!="object"?null:(r=G&&r[G]||r["@@iterator"],typeof r=="function"?r:null)}var ee=Symbol.for("react.client.reference");function Z(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===ee?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case S:return"Fragment";case _:return"Profiler";case w:return"StrictMode";case I:return"Suspense";case O:return"SuspenseList";case F:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case x:return"Portal";case T:return r.displayName||"Context";case C:return(r._context.displayName||"Context")+".Consumer";case D:var a=r.render;return r=r.displayName,r||(r=a.displayName||a.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case P:return a=r.displayName||null,a!==null?a:Z(r.type)||"Memo";case j:a=r._payload,r=r._init;try{return Z(r(a))}catch{}}return null}var W=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},ce=[],R=-1;function H(r){return{current:r}}function Y(r){0>R||(r.current=ce[R],ce[R]=null,R--)}function N(r,a){R++,ce[R]=r.current,r.current=a}var se=H(null),de=H(null),le=H(null),be=H(null);function Ee(r,a){switch(N(le,a),N(de,r),N(se,null),a.nodeType){case 9:case 11:r=(r=a.documentElement)&&(r=r.namespaceURI)?Sx(r):0;break;default:if(r=a.tagName,a=a.namespaceURI)a=Sx(a),r=_x(a,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}Y(se),N(se,r)}function ge(){Y(se),Y(de),Y(le)}function We(r){r.memoizedState!==null&&N(be,r);var a=se.current,u=_x(a,r.type);a!==u&&(N(de,r),N(se,u))}function Ge(r){de.current===r&&(Y(se),Y(de)),be.current===r&&(Y(be),qs._currentValue=te)}var ot,je;function pe(r){if(ot===void 0)try{throw Error()}catch(u){var a=u.stack.trim().match(/\n( *(at )?)/);ot=a&&a[1]||"",je=-1<u.stack.indexOf(`
|
|
3
|
+
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
+
`+ot+r+je}var he=!1;function lt(r,a){if(!r||he)return"";he=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(a){var ae=function(){throw Error()};if(Object.defineProperty(ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ae,[])}catch(ne){var J=ne}Reflect.construct(r,[],ae)}else{try{ae.call()}catch(ne){J=ne}r.call(ae.prototype)}}else{try{throw Error()}catch(ne){J=ne}(ae=r())&&typeof ae.catch=="function"&&ae.catch(function(){})}}catch(ne){if(ne&&J&&typeof ne.stack=="string")return[ne.stack,J.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=h.DetermineComponentFrameRoot(),E=b[0],L=b[1];if(E&&L){var U=E.split(`
|
|
5
|
+
`),K=L.split(`
|
|
6
|
+
`);for(y=h=0;h<U.length&&!U[h].includes("DetermineComponentFrameRoot");)h++;for(;y<K.length&&!K[y].includes("DetermineComponentFrameRoot");)y++;if(h===U.length||y===K.length)for(h=U.length-1,y=K.length-1;1<=h&&0<=y&&U[h]!==K[y];)y--;for(;1<=h&&0<=y;h--,y--)if(U[h]!==K[y]){if(h!==1||y!==1)do if(h--,y--,0>y||U[h]!==K[y]){var ie=`
|
|
7
|
+
`+U[h].replace(" at new "," at ");return r.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",r.displayName)),ie}while(1<=h&&0<=y);break}}}finally{he=!1,Error.prepareStackTrace=u}return(u=r?r.displayName||r.name:"")?pe(u):""}function Ue(r,a){switch(r.tag){case 26:case 27:case 5:return pe(r.type);case 16:return pe("Lazy");case 13:return r.child!==a&&a!==null?pe("Suspense Fallback"):pe("Suspense");case 19:return pe("SuspenseList");case 0:case 15:return lt(r.type,!1);case 11:return lt(r.type.render,!1);case 1:return lt(r.type,!0);case 31:return pe("Activity");default:return""}}function Qe(r){try{var a="",u=null;do a+=Ue(r,u),u=r,r=r.return;while(r);return a}catch(h){return`
|
|
8
|
+
Error generating stack: `+h.message+`
|
|
9
|
+
`+h.stack}}var ft=Object.prototype.hasOwnProperty,mt=e.unstable_scheduleCallback,ii=e.unstable_cancelCallback,yf=e.unstable_shouldYield,vf=e.unstable_requestPaint,Xt=e.unstable_now,bf=e.unstable_getCurrentPriorityLevel,re=e.unstable_ImmediatePriority,fe=e.unstable_UserBlockingPriority,Ce=e.unstable_NormalPriority,Ie=e.unstable_LowPriority,Ye=e.unstable_IdlePriority,bn=e.log,ki=e.unstable_setDisableYieldValue,Kt=null,kt=null;function an(r){if(typeof bn=="function"&&ki(r),kt&&typeof kt.setStrictMode=="function")try{kt.setStrictMode(Kt,r)}catch{}}var nt=Math.clz32?Math.clz32:aL,ur=Math.log,qn=Math.LN2;function aL(r){return r>>>=0,r===0?32:31-(ur(r)/qn|0)|0}var Yl=256,Xl=262144,Kl=4194304;function Kr(r){var a=r&42;if(a!==0)return a;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Ql(r,a,u){var h=r.pendingLanes;if(h===0)return 0;var y=0,b=r.suspendedLanes,E=r.pingedLanes;r=r.warmLanes;var L=h&134217727;return L!==0?(h=L&~b,h!==0?y=Kr(h):(E&=L,E!==0?y=Kr(E):u||(u=L&~r,u!==0&&(y=Kr(u))))):(L=h&~b,L!==0?y=Kr(L):E!==0?y=Kr(E):u||(u=h&~r,u!==0&&(y=Kr(u)))),y===0?0:a!==0&&a!==y&&(a&b)===0&&(b=y&-y,u=a&-a,b>=u||b===32&&(u&4194048)!==0)?a:y}function os(r,a){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&a)===0}function sL(r,a){switch(r){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function n0(){var r=Kl;return Kl<<=1,(Kl&62914560)===0&&(Kl=4194304),r}function xf(r){for(var a=[],u=0;31>u;u++)a.push(r);return a}function as(r,a){r.pendingLanes|=a,a!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function lL(r,a,u,h,y,b){var E=r.pendingLanes;r.pendingLanes=u,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=u,r.entangledLanes&=u,r.errorRecoveryDisabledLanes&=u,r.shellSuspendCounter=0;var L=r.entanglements,U=r.expirationTimes,K=r.hiddenUpdates;for(u=E&~u;0<u;){var ie=31-nt(u),ae=1<<ie;L[ie]=0,U[ie]=-1;var J=K[ie];if(J!==null)for(K[ie]=null,ie=0;ie<J.length;ie++){var ne=J[ie];ne!==null&&(ne.lane&=-536870913)}u&=~ae}h!==0&&i0(r,h,0),b!==0&&y===0&&r.tag!==0&&(r.suspendedLanes|=b&~(E&~a))}function i0(r,a,u){r.pendingLanes|=a,r.suspendedLanes&=~a;var h=31-nt(a);r.entangledLanes|=a,r.entanglements[h]=r.entanglements[h]|1073741824|u&261930}function r0(r,a){var u=r.entangledLanes|=a;for(r=r.entanglements;u;){var h=31-nt(u),y=1<<h;y&a|r[h]&a&&(r[h]|=a),u&=~y}}function o0(r,a){var u=a&-a;return u=(u&42)!==0?1:Sf(u),(u&(r.suspendedLanes|a))!==0?0:u}function Sf(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function _f(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function a0(){var r=q.p;return r!==0?r:(r=window.event,r===void 0?32:$x(r.type))}function s0(r,a){var u=q.p;try{return q.p=r,a()}finally{q.p=u}}var cr=Math.random().toString(36).slice(2),jt="__reactFiber$"+cr,sn="__reactProps$"+cr,qo="__reactContainer$"+cr,Cf="__reactEvents$"+cr,uL="__reactListeners$"+cr,cL="__reactHandles$"+cr,l0="__reactResources$"+cr,ss="__reactMarker$"+cr;function wf(r){delete r[jt],delete r[sn],delete r[Cf],delete r[uL],delete r[cL]}function Wo(r){var a=r[jt];if(a)return a;for(var u=r.parentNode;u;){if(a=u[qo]||u[jt]){if(u=a.alternate,a.child!==null||u!==null&&u.child!==null)for(r=Lx(r);r!==null;){if(u=r[jt])return u;r=Lx(r)}return a}r=u,u=r.parentNode}return null}function Yo(r){if(r=r[jt]||r[qo]){var a=r.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return r}return null}function ls(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r.stateNode;throw Error(i(33))}function Xo(r){var a=r[l0];return a||(a=r[l0]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Mt(r){r[ss]=!0}var u0=new Set,c0={};function Qr(r,a){Ko(r,a),Ko(r+"Capture",a)}function Ko(r,a){for(c0[r]=a,r=0;r<a.length;r++)u0.add(a[r])}var dL=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),d0={},f0={};function fL(r){return ft.call(f0,r)?!0:ft.call(d0,r)?!1:dL.test(r)?f0[r]=!0:(d0[r]=!0,!1)}function Zl(r,a,u){if(fL(a))if(u===null)r.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":r.removeAttribute(a);return;case"boolean":var h=a.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){r.removeAttribute(a);return}}r.setAttribute(a,""+u)}}function Jl(r,a,u){if(u===null)r.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(a);return}r.setAttribute(a,""+u)}}function Ti(r,a,u,h){if(h===null)r.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(u);return}r.setAttributeNS(a,u,""+h)}}function On(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function h0(r){var a=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function hL(r,a,u){var h=Object.getOwnPropertyDescriptor(r.constructor.prototype,a);if(!r.hasOwnProperty(a)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var y=h.get,b=h.set;return Object.defineProperty(r,a,{configurable:!0,get:function(){return y.call(this)},set:function(E){u=""+E,b.call(this,E)}}),Object.defineProperty(r,a,{enumerable:h.enumerable}),{getValue:function(){return u},setValue:function(E){u=""+E},stopTracking:function(){r._valueTracker=null,delete r[a]}}}}function Ef(r){if(!r._valueTracker){var a=h0(r)?"checked":"value";r._valueTracker=hL(r,a,""+r[a])}}function p0(r){if(!r)return!1;var a=r._valueTracker;if(!a)return!0;var u=a.getValue(),h="";return r&&(h=h0(r)?r.checked?"true":"false":r.value),r=h,r!==u?(a.setValue(r),!0):!1}function eu(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}}var pL=/[\n"\\]/g;function Dn(r){return r.replace(pL,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function kf(r,a,u,h,y,b,E,L){r.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?r.type=E:r.removeAttribute("type"),a!=null?E==="number"?(a===0&&r.value===""||r.value!=a)&&(r.value=""+On(a)):r.value!==""+On(a)&&(r.value=""+On(a)):E!=="submit"&&E!=="reset"||r.removeAttribute("value"),a!=null?Tf(r,E,On(a)):u!=null?Tf(r,E,On(u)):h!=null&&r.removeAttribute("value"),y==null&&b!=null&&(r.defaultChecked=!!b),y!=null&&(r.checked=y&&typeof y!="function"&&typeof y!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?r.name=""+On(L):r.removeAttribute("name")}function m0(r,a,u,h,y,b,E,L){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(r.type=b),a!=null||u!=null){if(!(b!=="submit"&&b!=="reset"||a!=null)){Ef(r);return}u=u!=null?""+On(u):"",a=a!=null?""+On(a):u,L||a===r.value||(r.value=a),r.defaultValue=a}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,r.checked=L?r.checked:!!h,r.defaultChecked=!!h,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(r.name=E),Ef(r)}function Tf(r,a,u){a==="number"&&eu(r.ownerDocument)===r||r.defaultValue===""+u||(r.defaultValue=""+u)}function Qo(r,a,u,h){if(r=r.options,a){a={};for(var y=0;y<u.length;y++)a["$"+u[y]]=!0;for(u=0;u<r.length;u++)y=a.hasOwnProperty("$"+r[u].value),r[u].selected!==y&&(r[u].selected=y),y&&h&&(r[u].defaultSelected=!0)}else{for(u=""+On(u),a=null,y=0;y<r.length;y++){if(r[y].value===u){r[y].selected=!0,h&&(r[y].defaultSelected=!0);return}a!==null||r[y].disabled||(a=r[y])}a!==null&&(a.selected=!0)}}function g0(r,a,u){if(a!=null&&(a=""+On(a),a!==r.value&&(r.value=a),u==null)){r.defaultValue!==a&&(r.defaultValue=a);return}r.defaultValue=u!=null?""+On(u):""}function y0(r,a,u,h){if(a==null){if(h!=null){if(u!=null)throw Error(i(92));if(W(h)){if(1<h.length)throw Error(i(93));h=h[0]}u=h}u==null&&(u=""),a=u}u=On(a),r.defaultValue=u,h=r.textContent,h===u&&h!==""&&h!==null&&(r.value=h),Ef(r)}function Zo(r,a){if(a){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=a;return}}r.textContent=a}var mL=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function v0(r,a,u){var h=a.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?r.setProperty(a,""):a==="float"?r.cssFloat="":r[a]="":h?r.setProperty(a,u):typeof u!="number"||u===0||mL.has(a)?a==="float"?r.cssFloat=u:r[a]=(""+u).trim():r[a]=u+"px"}function b0(r,a,u){if(a!=null&&typeof a!="object")throw Error(i(62));if(r=r.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||a!=null&&a.hasOwnProperty(h)||(h.indexOf("--")===0?r.setProperty(h,""):h==="float"?r.cssFloat="":r[h]="");for(var y in a)h=a[y],a.hasOwnProperty(y)&&u[y]!==h&&v0(r,y,h)}else for(var b in a)a.hasOwnProperty(b)&&v0(r,b,a[b])}function Af(r){if(r.indexOf("-")===-1)return!1;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 gL=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),yL=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function tu(r){return yL.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Ai(){}var Lf=null;function Rf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Jo=null,ea=null;function x0(r){var a=Yo(r);if(a&&(r=a.stateNode)){var u=r[sn]||null;e:switch(r=a.stateNode,a.type){case"input":if(kf(r,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),a=u.name,u.type==="radio"&&a!=null){for(u=r;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Dn(""+a)+'"][type="radio"]'),a=0;a<u.length;a++){var h=u[a];if(h!==r&&h.form===r.form){var y=h[sn]||null;if(!y)throw Error(i(90));kf(h,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(a=0;a<u.length;a++)h=u[a],h.form===r.form&&p0(h)}break e;case"textarea":g0(r,u.value,u.defaultValue);break e;case"select":a=u.value,a!=null&&Qo(r,!!u.multiple,a,!1)}}}var Of=!1;function S0(r,a,u){if(Of)return r(a,u);Of=!0;try{var h=r(a);return h}finally{if(Of=!1,(Jo!==null||ea!==null)&&(Vu(),Jo&&(a=Jo,r=ea,ea=Jo=null,x0(a),r)))for(a=0;a<r.length;a++)x0(r[a])}}function us(r,a){var u=r.stateNode;if(u===null)return null;var h=u[sn]||null;if(h===null)return null;u=h[a];e:switch(a){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(i(231,a,typeof u));return u}var Li=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Df=!1;if(Li)try{var cs={};Object.defineProperty(cs,"passive",{get:function(){Df=!0}}),window.addEventListener("test",cs,cs),window.removeEventListener("test",cs,cs)}catch{Df=!1}var dr=null,Mf=null,nu=null;function _0(){if(nu)return nu;var r,a=Mf,u=a.length,h,y="value"in dr?dr.value:dr.textContent,b=y.length;for(r=0;r<u&&a[r]===y[r];r++);var E=u-r;for(h=1;h<=E&&a[u-h]===y[b-h];h++);return nu=y.slice(r,1<h?1-h:void 0)}function iu(r){var a=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&a===13&&(r=13)):r=a,r===10&&(r=13),32<=r||r===13?r:0}function ru(){return!0}function C0(){return!1}function ln(r){function a(u,h,y,b,E){this._reactName=u,this._targetInst=y,this.type=h,this.nativeEvent=b,this.target=E,this.currentTarget=null;for(var L in r)r.hasOwnProperty(L)&&(u=r[L],this[L]=u?u(b):b[L]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?ru:C0,this.isPropagationStopped=C0,this}return m(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=ru)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=ru)},persist:function(){},isPersistent:ru}),a}var Zr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ou=ln(Zr),ds=m({},Zr,{view:0,detail:0}),vL=ln(ds),If,Nf,fs,au=m({},ds,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pf,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!==fs&&(fs&&r.type==="mousemove"?(If=r.screenX-fs.screenX,Nf=r.screenY-fs.screenY):Nf=If=0,fs=r),If)},movementY:function(r){return"movementY"in r?r.movementY:Nf}}),w0=ln(au),bL=m({},au,{dataTransfer:0}),xL=ln(bL),SL=m({},ds,{relatedTarget:0}),zf=ln(SL),_L=m({},Zr,{animationName:0,elapsedTime:0,pseudoElement:0}),CL=ln(_L),wL=m({},Zr,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),EL=ln(wL),kL=m({},Zr,{data:0}),E0=ln(kL),TL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},AL={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"},LL={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function RL(r){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(r):(r=LL[r])?!!a[r]:!1}function Pf(){return RL}var OL=m({},ds,{key:function(r){if(r.key){var a=TL[r.key]||r.key;if(a!=="Unidentified")return a}return r.type==="keypress"?(r=iu(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?AL[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pf,charCode:function(r){return r.type==="keypress"?iu(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?iu(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),DL=ln(OL),ML=m({},au,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),k0=ln(ML),IL=m({},ds,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pf}),NL=ln(IL),zL=m({},Zr,{propertyName:0,elapsedTime:0,pseudoElement:0}),PL=ln(zL),HL=m({},au,{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}),jL=ln(HL),BL=m({},Zr,{newState:0,oldState:0}),UL=ln(BL),VL=[9,13,27,32],Hf=Li&&"CompositionEvent"in window,hs=null;Li&&"documentMode"in document&&(hs=document.documentMode);var FL=Li&&"TextEvent"in window&&!hs,T0=Li&&(!Hf||hs&&8<hs&&11>=hs),A0=" ",L0=!1;function R0(r,a){switch(r){case"keyup":return VL.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function O0(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var ta=!1;function GL(r,a){switch(r){case"compositionend":return O0(a);case"keypress":return a.which!==32?null:(L0=!0,A0);case"textInput":return r=a.data,r===A0&&L0?null:r;default:return null}}function $L(r,a){if(ta)return r==="compositionend"||!Hf&&R0(r,a)?(r=_0(),nu=Mf=dr=null,ta=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return T0&&a.locale!=="ko"?null:a.data;default:return null}}var qL={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 D0(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a==="input"?!!qL[r.type]:a==="textarea"}function M0(r,a,u,h){Jo?ea?ea.push(h):ea=[h]:Jo=h,a=Xu(a,"onChange"),0<a.length&&(u=new ou("onChange","change",null,u,h),r.push({event:u,listeners:a}))}var ps=null,ms=null;function WL(r){mx(r,0)}function su(r){var a=ls(r);if(p0(a))return r}function I0(r,a){if(r==="change")return a}var N0=!1;if(Li){var jf;if(Li){var Bf="oninput"in document;if(!Bf){var z0=document.createElement("div");z0.setAttribute("oninput","return;"),Bf=typeof z0.oninput=="function"}jf=Bf}else jf=!1;N0=jf&&(!document.documentMode||9<document.documentMode)}function P0(){ps&&(ps.detachEvent("onpropertychange",H0),ms=ps=null)}function H0(r){if(r.propertyName==="value"&&su(ms)){var a=[];M0(a,ms,r,Rf(r)),S0(WL,a)}}function YL(r,a,u){r==="focusin"?(P0(),ps=a,ms=u,ps.attachEvent("onpropertychange",H0)):r==="focusout"&&P0()}function XL(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return su(ms)}function KL(r,a){if(r==="click")return su(a)}function QL(r,a){if(r==="input"||r==="change")return su(a)}function ZL(r,a){return r===a&&(r!==0||1/r===1/a)||r!==r&&a!==a}var xn=typeof Object.is=="function"?Object.is:ZL;function gs(r,a){if(xn(r,a))return!0;if(typeof r!="object"||r===null||typeof a!="object"||a===null)return!1;var u=Object.keys(r),h=Object.keys(a);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var y=u[h];if(!ft.call(a,y)||!xn(r[y],a[y]))return!1}return!0}function j0(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function B0(r,a){var u=j0(r);r=0;for(var h;u;){if(u.nodeType===3){if(h=r+u.textContent.length,r<=a&&h>=a)return{node:u,offset:a-r};r=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=j0(u)}}function U0(r,a){return r&&a?r===a?!0:r&&r.nodeType===3?!1:a&&a.nodeType===3?U0(r,a.parentNode):"contains"in r?r.contains(a):r.compareDocumentPosition?!!(r.compareDocumentPosition(a)&16):!1:!1}function V0(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var a=eu(r.document);a instanceof r.HTMLIFrameElement;){try{var u=typeof a.contentWindow.location.href=="string"}catch{u=!1}if(u)r=a.contentWindow;else break;a=eu(r.document)}return a}function Uf(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a&&(a==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||a==="textarea"||r.contentEditable==="true")}var JL=Li&&"documentMode"in document&&11>=document.documentMode,na=null,Vf=null,ys=null,Ff=!1;function F0(r,a,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Ff||na==null||na!==eu(h)||(h=na,"selectionStart"in h&&Uf(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}),ys&&gs(ys,h)||(ys=h,h=Xu(Vf,"onSelect"),0<h.length&&(a=new ou("onSelect","select",null,a,u),r.push({event:a,listeners:h}),a.target=na)))}function Jr(r,a){var u={};return u[r.toLowerCase()]=a.toLowerCase(),u["Webkit"+r]="webkit"+a,u["Moz"+r]="moz"+a,u}var ia={animationend:Jr("Animation","AnimationEnd"),animationiteration:Jr("Animation","AnimationIteration"),animationstart:Jr("Animation","AnimationStart"),transitionrun:Jr("Transition","TransitionRun"),transitionstart:Jr("Transition","TransitionStart"),transitioncancel:Jr("Transition","TransitionCancel"),transitionend:Jr("Transition","TransitionEnd")},Gf={},G0={};Li&&(G0=document.createElement("div").style,"AnimationEvent"in window||(delete ia.animationend.animation,delete ia.animationiteration.animation,delete ia.animationstart.animation),"TransitionEvent"in window||delete ia.transitionend.transition);function eo(r){if(Gf[r])return Gf[r];if(!ia[r])return r;var a=ia[r],u;for(u in a)if(a.hasOwnProperty(u)&&u in G0)return Gf[r]=a[u];return r}var $0=eo("animationend"),q0=eo("animationiteration"),W0=eo("animationstart"),eR=eo("transitionrun"),tR=eo("transitionstart"),nR=eo("transitioncancel"),Y0=eo("transitionend"),X0=new Map,$f="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");$f.push("scrollEnd");function Wn(r,a){X0.set(r,a),Qr(a,[r])}var lu=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Mn=[],ra=0,qf=0;function uu(){for(var r=ra,a=qf=ra=0;a<r;){var u=Mn[a];Mn[a++]=null;var h=Mn[a];Mn[a++]=null;var y=Mn[a];Mn[a++]=null;var b=Mn[a];if(Mn[a++]=null,h!==null&&y!==null){var E=h.pending;E===null?y.next=y:(y.next=E.next,E.next=y),h.pending=y}b!==0&&K0(u,y,b)}}function cu(r,a,u,h){Mn[ra++]=r,Mn[ra++]=a,Mn[ra++]=u,Mn[ra++]=h,qf|=h,r.lanes|=h,r=r.alternate,r!==null&&(r.lanes|=h)}function Wf(r,a,u,h){return cu(r,a,u,h),du(r)}function to(r,a){return cu(r,null,null,a),du(r)}function K0(r,a,u){r.lanes|=u;var h=r.alternate;h!==null&&(h.lanes|=u);for(var y=!1,b=r.return;b!==null;)b.childLanes|=u,h=b.alternate,h!==null&&(h.childLanes|=u),b.tag===22&&(r=b.stateNode,r===null||r._visibility&1||(y=!0)),r=b,b=b.return;return r.tag===3?(b=r.stateNode,y&&a!==null&&(y=31-nt(u),r=b.hiddenUpdates,h=r[y],h===null?r[y]=[a]:h.push(a),a.lane=u|536870912),b):null}function du(r){if(50<js)throw js=0,np=null,Error(i(185));for(var a=r.return;a!==null;)r=a,a=r.return;return r.tag===3?r.stateNode:null}var oa={};function iR(r,a,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.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Sn(r,a,u,h){return new iR(r,a,u,h)}function Yf(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Ri(r,a){var u=r.alternate;return u===null?(u=Sn(r.tag,a,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u.alternate=r,r.alternate=u):(u.pendingProps=a,u.type=r.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=r.flags&65011712,u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue,a=r.dependencies,u.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u.refCleanup=r.refCleanup,u}function Q0(r,a){r.flags&=65011714;var u=r.alternate;return u===null?(r.childLanes=0,r.lanes=a,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=u.childLanes,r.lanes=u.lanes,r.child=u.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=u.memoizedProps,r.memoizedState=u.memoizedState,r.updateQueue=u.updateQueue,r.type=u.type,a=u.dependencies,r.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),r}function fu(r,a,u,h,y,b){var E=0;if(h=r,typeof r=="function")Yf(r)&&(E=1);else if(typeof r=="string")E=lO(r,u,se.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case F:return r=Sn(31,u,a,y),r.elementType=F,r.lanes=b,r;case S:return no(u.children,y,b,a);case w:E=8,y|=24;break;case _:return r=Sn(12,u,a,y|2),r.elementType=_,r.lanes=b,r;case I:return r=Sn(13,u,a,y),r.elementType=I,r.lanes=b,r;case O:return r=Sn(19,u,a,y),r.elementType=O,r.lanes=b,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case T:E=10;break e;case C:E=9;break e;case D:E=11;break e;case P:E=14;break e;case j:E=16,h=null;break e}E=29,u=Error(i(130,r===null?"null":typeof r,"")),h=null}return a=Sn(E,u,a,y),a.elementType=r,a.type=h,a.lanes=b,a}function no(r,a,u,h){return r=Sn(7,r,h,a),r.lanes=u,r}function Xf(r,a,u){return r=Sn(6,r,null,a),r.lanes=u,r}function Z0(r){var a=Sn(18,null,null,0);return a.stateNode=r,a}function Kf(r,a,u){return a=Sn(4,r.children!==null?r.children:[],r.key,a),a.lanes=u,a.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},a}var J0=new WeakMap;function In(r,a){if(typeof r=="object"&&r!==null){var u=J0.get(r);return u!==void 0?u:(a={value:r,source:a,stack:Qe(a)},J0.set(r,a),a)}return{value:r,source:a,stack:Qe(a)}}var aa=[],sa=0,hu=null,vs=0,Nn=[],zn=0,fr=null,ri=1,oi="";function Oi(r,a){aa[sa++]=vs,aa[sa++]=hu,hu=r,vs=a}function ev(r,a,u){Nn[zn++]=ri,Nn[zn++]=oi,Nn[zn++]=fr,fr=r;var h=ri;r=oi;var y=32-nt(h)-1;h&=~(1<<y),u+=1;var b=32-nt(a)+y;if(30<b){var E=y-y%5;b=(h&(1<<E)-1).toString(32),h>>=E,y-=E,ri=1<<32-nt(a)+y|u<<y|h,oi=b+r}else ri=1<<b|u<<y|h,oi=r}function Qf(r){r.return!==null&&(Oi(r,1),ev(r,1,0))}function Zf(r){for(;r===hu;)hu=aa[--sa],aa[sa]=null,vs=aa[--sa],aa[sa]=null;for(;r===fr;)fr=Nn[--zn],Nn[zn]=null,oi=Nn[--zn],Nn[zn]=null,ri=Nn[--zn],Nn[zn]=null}function tv(r,a){Nn[zn++]=ri,Nn[zn++]=oi,Nn[zn++]=fr,ri=a.id,oi=a.overflow,fr=r}var Bt=null,ut=null,Be=!1,hr=null,Pn=!1,Jf=Error(i(519));function pr(r){var a=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw bs(In(a,r)),Jf}function nv(r){var a=r.stateNode,u=r.type,h=r.memoizedProps;switch(a[jt]=r,a[sn]=h,u){case"dialog":ze("cancel",a),ze("close",a);break;case"iframe":case"object":case"embed":ze("load",a);break;case"video":case"audio":for(u=0;u<Us.length;u++)ze(Us[u],a);break;case"source":ze("error",a);break;case"img":case"image":case"link":ze("error",a),ze("load",a);break;case"details":ze("toggle",a);break;case"input":ze("invalid",a),m0(a,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":ze("invalid",a);break;case"textarea":ze("invalid",a),y0(a,h.value,h.defaultValue,h.children)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||a.textContent===""+u||h.suppressHydrationWarning===!0||bx(a.textContent,u)?(h.popover!=null&&(ze("beforetoggle",a),ze("toggle",a)),h.onScroll!=null&&ze("scroll",a),h.onScrollEnd!=null&&ze("scrollend",a),h.onClick!=null&&(a.onclick=Ai),a=!0):a=!1,a||pr(r,!0)}function iv(r){for(Bt=r.return;Bt;)switch(Bt.tag){case 5:case 31:case 13:Pn=!1;return;case 27:case 3:Pn=!0;return;default:Bt=Bt.return}}function la(r){if(r!==Bt)return!1;if(!Be)return iv(r),Be=!0,!1;var a=r.tag,u;if((u=a!==3&&a!==27)&&((u=a===5)&&(u=r.type,u=!(u!=="form"&&u!=="button")||yp(r.type,r.memoizedProps)),u=!u),u&&ut&&pr(r),iv(r),a===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));ut=Ax(r)}else if(a===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));ut=Ax(r)}else a===27?(a=ut,Ar(r.type)?(r=_p,_p=null,ut=r):ut=a):ut=Bt?jn(r.stateNode.nextSibling):null;return!0}function io(){ut=Bt=null,Be=!1}function eh(){var r=hr;return r!==null&&(fn===null?fn=r:fn.push.apply(fn,r),hr=null),r}function bs(r){hr===null?hr=[r]:hr.push(r)}var th=H(null),ro=null,Di=null;function mr(r,a,u){N(th,a._currentValue),a._currentValue=u}function Mi(r){r._currentValue=th.current,Y(th)}function nh(r,a,u){for(;r!==null;){var h=r.alternate;if((r.childLanes&a)!==a?(r.childLanes|=a,h!==null&&(h.childLanes|=a)):h!==null&&(h.childLanes&a)!==a&&(h.childLanes|=a),r===u)break;r=r.return}}function ih(r,a,u,h){var y=r.child;for(y!==null&&(y.return=r);y!==null;){var b=y.dependencies;if(b!==null){var E=y.child;b=b.firstContext;e:for(;b!==null;){var L=b;b=y;for(var U=0;U<a.length;U++)if(L.context===a[U]){b.lanes|=u,L=b.alternate,L!==null&&(L.lanes|=u),nh(b.return,u,r),h||(E=null);break e}b=L.next}}else if(y.tag===18){if(E=y.return,E===null)throw Error(i(341));E.lanes|=u,b=E.alternate,b!==null&&(b.lanes|=u),nh(E,u,r),E=null}else E=y.child;if(E!==null)E.return=y;else for(E=y;E!==null;){if(E===r){E=null;break}if(y=E.sibling,y!==null){y.return=E.return,E=y;break}E=E.return}y=E}}function ua(r,a,u,h){r=null;for(var y=a,b=!1;y!==null;){if(!b){if((y.flags&524288)!==0)b=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var E=y.alternate;if(E===null)throw Error(i(387));if(E=E.memoizedProps,E!==null){var L=y.type;xn(y.pendingProps.value,E.value)||(r!==null?r.push(L):r=[L])}}else if(y===be.current){if(E=y.alternate,E===null)throw Error(i(387));E.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(r!==null?r.push(qs):r=[qs])}y=y.return}r!==null&&ih(a,r,u,h),a.flags|=262144}function pu(r){for(r=r.firstContext;r!==null;){if(!xn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function oo(r){ro=r,Di=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Ut(r){return rv(ro,r)}function mu(r,a){return ro===null&&oo(r),rv(r,a)}function rv(r,a){var u=a._currentValue;if(a={context:a,memoizedValue:u,next:null},Di===null){if(r===null)throw Error(i(308));Di=a,r.dependencies={lanes:0,firstContext:a},r.flags|=524288}else Di=Di.next=a;return u}var rR=typeof AbortController<"u"?AbortController:function(){var r=[],a=this.signal={aborted:!1,addEventListener:function(u,h){r.push(h)}};this.abort=function(){a.aborted=!0,r.forEach(function(u){return u()})}},oR=e.unstable_scheduleCallback,aR=e.unstable_NormalPriority,xt={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function rh(){return{controller:new rR,data:new Map,refCount:0}}function xs(r){r.refCount--,r.refCount===0&&oR(aR,function(){r.controller.abort()})}var Ss=null,oh=0,ca=0,da=null;function sR(r,a){if(Ss===null){var u=Ss=[];oh=0,ca=lp(),da={status:"pending",value:void 0,then:function(h){u.push(h)}}}return oh++,a.then(ov,ov),a}function ov(){if(--oh===0&&Ss!==null){da!==null&&(da.status="fulfilled");var r=Ss;Ss=null,ca=0,da=null;for(var a=0;a<r.length;a++)(0,r[a])()}}function lR(r,a){var u=[],h={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return r.then(function(){h.status="fulfilled",h.value=a;for(var y=0;y<u.length;y++)(0,u[y])(a)},function(y){for(h.status="rejected",h.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),h}var av=z.S;z.S=function(r,a){Fb=Xt(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&sR(r,a),av!==null&&av(r,a)};var ao=H(null);function ah(){var r=ao.current;return r!==null?r:it.pooledCache}function gu(r,a){a===null?N(ao,ao.current):N(ao,a.pool)}function sv(){var r=ah();return r===null?null:{parent:xt._currentValue,pool:r}}var fa=Error(i(460)),sh=Error(i(474)),yu=Error(i(542)),vu={then:function(){}};function lv(r){return r=r.status,r==="fulfilled"||r==="rejected"}function uv(r,a,u){switch(u=r[u],u===void 0?r.push(a):u!==a&&(a.then(Ai,Ai),a=u),a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,dv(r),r;default:if(typeof a.status=="string")a.then(Ai,Ai);else{if(r=it,r!==null&&100<r.shellSuspendCounter)throw Error(i(482));r=a,r.status="pending",r.then(function(h){if(a.status==="pending"){var y=a;y.status="fulfilled",y.value=h}},function(h){if(a.status==="pending"){var y=a;y.status="rejected",y.reason=h}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,dv(r),r}throw lo=a,fa}}function so(r){try{var a=r._init;return a(r._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(lo=u,fa):u}}var lo=null;function cv(){if(lo===null)throw Error(i(459));var r=lo;return lo=null,r}function dv(r){if(r===fa||r===yu)throw Error(i(483))}var ha=null,_s=0;function bu(r){var a=_s;return _s+=1,ha===null&&(ha=[]),uv(ha,r,a)}function Cs(r,a){a=a.props.ref,r.ref=a!==void 0?a:null}function xu(r,a){throw a.$$typeof===g?Error(i(525)):(r=Object.prototype.toString.call(a),Error(i(31,r==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":r)))}function fv(r){function a($,V){if(r){var X=$.deletions;X===null?($.deletions=[V],$.flags|=16):X.push(V)}}function u($,V){if(!r)return null;for(;V!==null;)a($,V),V=V.sibling;return null}function h($){for(var V=new Map;$!==null;)$.key!==null?V.set($.key,$):V.set($.index,$),$=$.sibling;return V}function y($,V){return $=Ri($,V),$.index=0,$.sibling=null,$}function b($,V,X){return $.index=X,r?(X=$.alternate,X!==null?(X=X.index,X<V?($.flags|=67108866,V):X):($.flags|=67108866,V)):($.flags|=1048576,V)}function E($){return r&&$.alternate===null&&($.flags|=67108866),$}function L($,V,X,oe){return V===null||V.tag!==6?(V=Xf(X,$.mode,oe),V.return=$,V):(V=y(V,X),V.return=$,V)}function U($,V,X,oe){var Se=X.type;return Se===S?ie($,V,X.props.children,oe,X.key):V!==null&&(V.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===j&&so(Se)===V.type)?(V=y(V,X.props),Cs(V,X),V.return=$,V):(V=fu(X.type,X.key,X.props,null,$.mode,oe),Cs(V,X),V.return=$,V)}function K($,V,X,oe){return V===null||V.tag!==4||V.stateNode.containerInfo!==X.containerInfo||V.stateNode.implementation!==X.implementation?(V=Kf(X,$.mode,oe),V.return=$,V):(V=y(V,X.children||[]),V.return=$,V)}function ie($,V,X,oe,Se){return V===null||V.tag!==7?(V=no(X,$.mode,oe,Se),V.return=$,V):(V=y(V,X),V.return=$,V)}function ae($,V,X){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return V=Xf(""+V,$.mode,X),V.return=$,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case v:return X=fu(V.type,V.key,V.props,null,$.mode,X),Cs(X,V),X.return=$,X;case x:return V=Kf(V,$.mode,X),V.return=$,V;case j:return V=so(V),ae($,V,X)}if(W(V)||B(V))return V=no(V,$.mode,X,null),V.return=$,V;if(typeof V.then=="function")return ae($,bu(V),X);if(V.$$typeof===T)return ae($,mu($,V),X);xu($,V)}return null}function J($,V,X,oe){var Se=V!==null?V.key:null;if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return Se!==null?null:L($,V,""+X,oe);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case v:return X.key===Se?U($,V,X,oe):null;case x:return X.key===Se?K($,V,X,oe):null;case j:return X=so(X),J($,V,X,oe)}if(W(X)||B(X))return Se!==null?null:ie($,V,X,oe,null);if(typeof X.then=="function")return J($,V,bu(X),oe);if(X.$$typeof===T)return J($,V,mu($,X),oe);xu($,X)}return null}function ne($,V,X,oe,Se){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return $=$.get(X)||null,L(V,$,""+oe,Se);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case v:return $=$.get(oe.key===null?X:oe.key)||null,U(V,$,oe,Se);case x:return $=$.get(oe.key===null?X:oe.key)||null,K(V,$,oe,Se);case j:return oe=so(oe),ne($,V,X,oe,Se)}if(W(oe)||B(oe))return $=$.get(X)||null,ie(V,$,oe,Se,null);if(typeof oe.then=="function")return ne($,V,X,bu(oe),Se);if(oe.$$typeof===T)return ne($,V,X,mu(V,oe),Se);xu(V,oe)}return null}function ve($,V,X,oe){for(var Se=null,Ve=null,xe=V,Oe=V=0,He=null;xe!==null&&Oe<X.length;Oe++){xe.index>Oe?(He=xe,xe=null):He=xe.sibling;var Fe=J($,xe,X[Oe],oe);if(Fe===null){xe===null&&(xe=He);break}r&&xe&&Fe.alternate===null&&a($,xe),V=b(Fe,V,Oe),Ve===null?Se=Fe:Ve.sibling=Fe,Ve=Fe,xe=He}if(Oe===X.length)return u($,xe),Be&&Oi($,Oe),Se;if(xe===null){for(;Oe<X.length;Oe++)xe=ae($,X[Oe],oe),xe!==null&&(V=b(xe,V,Oe),Ve===null?Se=xe:Ve.sibling=xe,Ve=xe);return Be&&Oi($,Oe),Se}for(xe=h(xe);Oe<X.length;Oe++)He=ne(xe,$,Oe,X[Oe],oe),He!==null&&(r&&He.alternate!==null&&xe.delete(He.key===null?Oe:He.key),V=b(He,V,Oe),Ve===null?Se=He:Ve.sibling=He,Ve=He);return r&&xe.forEach(function(Mr){return a($,Mr)}),Be&&Oi($,Oe),Se}function _e($,V,X,oe){if(X==null)throw Error(i(151));for(var Se=null,Ve=null,xe=V,Oe=V=0,He=null,Fe=X.next();xe!==null&&!Fe.done;Oe++,Fe=X.next()){xe.index>Oe?(He=xe,xe=null):He=xe.sibling;var Mr=J($,xe,Fe.value,oe);if(Mr===null){xe===null&&(xe=He);break}r&&xe&&Mr.alternate===null&&a($,xe),V=b(Mr,V,Oe),Ve===null?Se=Mr:Ve.sibling=Mr,Ve=Mr,xe=He}if(Fe.done)return u($,xe),Be&&Oi($,Oe),Se;if(xe===null){for(;!Fe.done;Oe++,Fe=X.next())Fe=ae($,Fe.value,oe),Fe!==null&&(V=b(Fe,V,Oe),Ve===null?Se=Fe:Ve.sibling=Fe,Ve=Fe);return Be&&Oi($,Oe),Se}for(xe=h(xe);!Fe.done;Oe++,Fe=X.next())Fe=ne(xe,$,Oe,Fe.value,oe),Fe!==null&&(r&&Fe.alternate!==null&&xe.delete(Fe.key===null?Oe:Fe.key),V=b(Fe,V,Oe),Ve===null?Se=Fe:Ve.sibling=Fe,Ve=Fe);return r&&xe.forEach(function(bO){return a($,bO)}),Be&&Oi($,Oe),Se}function et($,V,X,oe){if(typeof X=="object"&&X!==null&&X.type===S&&X.key===null&&(X=X.props.children),typeof X=="object"&&X!==null){switch(X.$$typeof){case v:e:{for(var Se=X.key;V!==null;){if(V.key===Se){if(Se=X.type,Se===S){if(V.tag===7){u($,V.sibling),oe=y(V,X.props.children),oe.return=$,$=oe;break e}}else if(V.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===j&&so(Se)===V.type){u($,V.sibling),oe=y(V,X.props),Cs(oe,X),oe.return=$,$=oe;break e}u($,V);break}else a($,V);V=V.sibling}X.type===S?(oe=no(X.props.children,$.mode,oe,X.key),oe.return=$,$=oe):(oe=fu(X.type,X.key,X.props,null,$.mode,oe),Cs(oe,X),oe.return=$,$=oe)}return E($);case x:e:{for(Se=X.key;V!==null;){if(V.key===Se)if(V.tag===4&&V.stateNode.containerInfo===X.containerInfo&&V.stateNode.implementation===X.implementation){u($,V.sibling),oe=y(V,X.children||[]),oe.return=$,$=oe;break e}else{u($,V);break}else a($,V);V=V.sibling}oe=Kf(X,$.mode,oe),oe.return=$,$=oe}return E($);case j:return X=so(X),et($,V,X,oe)}if(W(X))return ve($,V,X,oe);if(B(X)){if(Se=B(X),typeof Se!="function")throw Error(i(150));return X=Se.call(X),_e($,V,X,oe)}if(typeof X.then=="function")return et($,V,bu(X),oe);if(X.$$typeof===T)return et($,V,mu($,X),oe);xu($,X)}return typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint"?(X=""+X,V!==null&&V.tag===6?(u($,V.sibling),oe=y(V,X),oe.return=$,$=oe):(u($,V),oe=Xf(X,$.mode,oe),oe.return=$,$=oe),E($)):u($,V)}return function($,V,X,oe){try{_s=0;var Se=et($,V,X,oe);return ha=null,Se}catch(xe){if(xe===fa||xe===yu)throw xe;var Ve=Sn(29,xe,null,$.mode);return Ve.lanes=oe,Ve.return=$,Ve}}}var uo=fv(!0),hv=fv(!1),gr=!1;function lh(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function uh(r,a){r=r.updateQueue,a.updateQueue===r&&(a.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function yr(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function vr(r,a,u){var h=r.updateQueue;if(h===null)return null;if(h=h.shared,($e&2)!==0){var y=h.pending;return y===null?a.next=a:(a.next=y.next,y.next=a),h.pending=a,a=du(r),K0(r,null,u),a}return cu(r,h,a,u),du(r)}function ws(r,a,u){if(a=a.updateQueue,a!==null&&(a=a.shared,(u&4194048)!==0)){var h=a.lanes;h&=r.pendingLanes,u|=h,a.lanes=u,r0(r,u)}}function ch(r,a){var u=r.updateQueue,h=r.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var y=null,b=null;if(u=u.firstBaseUpdate,u!==null){do{var E={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};b===null?y=b=E:b=b.next=E,u=u.next}while(u!==null);b===null?y=b=a:b=b.next=a}else y=b=a;u={baseState:h.baseState,firstBaseUpdate:y,lastBaseUpdate:b,shared:h.shared,callbacks:h.callbacks},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=a:r.next=a,u.lastBaseUpdate=a}var dh=!1;function Es(){if(dh){var r=da;if(r!==null)throw r}}function ks(r,a,u,h){dh=!1;var y=r.updateQueue;gr=!1;var b=y.firstBaseUpdate,E=y.lastBaseUpdate,L=y.shared.pending;if(L!==null){y.shared.pending=null;var U=L,K=U.next;U.next=null,E===null?b=K:E.next=K,E=U;var ie=r.alternate;ie!==null&&(ie=ie.updateQueue,L=ie.lastBaseUpdate,L!==E&&(L===null?ie.firstBaseUpdate=K:L.next=K,ie.lastBaseUpdate=U))}if(b!==null){var ae=y.baseState;E=0,ie=K=U=null,L=b;do{var J=L.lane&-536870913,ne=J!==L.lane;if(ne?(Pe&J)===J:(h&J)===J){J!==0&&J===ca&&(dh=!0),ie!==null&&(ie=ie.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var ve=r,_e=L;J=a;var et=u;switch(_e.tag){case 1:if(ve=_e.payload,typeof ve=="function"){ae=ve.call(et,ae,J);break e}ae=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=_e.payload,J=typeof ve=="function"?ve.call(et,ae,J):ve,J==null)break e;ae=m({},ae,J);break e;case 2:gr=!0}}J=L.callback,J!==null&&(r.flags|=64,ne&&(r.flags|=8192),ne=y.callbacks,ne===null?y.callbacks=[J]:ne.push(J))}else ne={lane:J,tag:L.tag,payload:L.payload,callback:L.callback,next:null},ie===null?(K=ie=ne,U=ae):ie=ie.next=ne,E|=J;if(L=L.next,L===null){if(L=y.shared.pending,L===null)break;ne=L,L=ne.next,ne.next=null,y.lastBaseUpdate=ne,y.shared.pending=null}}while(!0);ie===null&&(U=ae),y.baseState=U,y.firstBaseUpdate=K,y.lastBaseUpdate=ie,b===null&&(y.shared.lanes=0),Cr|=E,r.lanes=E,r.memoizedState=ae}}function pv(r,a){if(typeof r!="function")throw Error(i(191,r));r.call(a)}function mv(r,a){var u=r.callbacks;if(u!==null)for(r.callbacks=null,r=0;r<u.length;r++)pv(u[r],a)}var pa=H(null),Su=H(0);function gv(r,a){r=Vi,N(Su,r),N(pa,a),Vi=r|a.baseLanes}function fh(){N(Su,Vi),N(pa,pa.current)}function hh(){Vi=Su.current,Y(pa),Y(Su)}var _n=H(null),Hn=null;function br(r){var a=r.alternate;N(gt,gt.current&1),N(_n,r),Hn===null&&(a===null||pa.current!==null||a.memoizedState!==null)&&(Hn=r)}function ph(r){N(gt,gt.current),N(_n,r),Hn===null&&(Hn=r)}function yv(r){r.tag===22?(N(gt,gt.current),N(_n,r),Hn===null&&(Hn=r)):xr()}function xr(){N(gt,gt.current),N(_n,_n.current)}function Cn(r){Y(_n),Hn===r&&(Hn=null),Y(gt)}var gt=H(0);function _u(r){for(var a=r;a!==null;){if(a.tag===13){var u=a.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||xp(u)||Sp(u)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Ii=0,Re=null,Ze=null,St=null,Cu=!1,ma=!1,co=!1,wu=0,Ts=0,ga=null,uR=0;function ht(){throw Error(i(321))}function mh(r,a){if(a===null)return!1;for(var u=0;u<a.length&&u<r.length;u++)if(!xn(r[u],a[u]))return!1;return!0}function gh(r,a,u,h,y,b){return Ii=b,Re=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,z.H=r===null||r.memoizedState===null?eb:Oh,co=!1,b=u(h,y),co=!1,ma&&(b=bv(a,u,h,y)),vv(r),b}function vv(r){z.H=Rs;var a=Ze!==null&&Ze.next!==null;if(Ii=0,St=Ze=Re=null,Cu=!1,Ts=0,ga=null,a)throw Error(i(300));r===null||_t||(r=r.dependencies,r!==null&&pu(r)&&(_t=!0))}function bv(r,a,u,h){Re=r;var y=0;do{if(ma&&(ga=null),Ts=0,ma=!1,25<=y)throw Error(i(301));if(y+=1,St=Ze=null,r.updateQueue!=null){var b=r.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}z.H=tb,b=a(u,h)}while(ma);return b}function cR(){var r=z.H,a=r.useState()[0];return a=typeof a.then=="function"?As(a):a,r=r.useState()[0],(Ze!==null?Ze.memoizedState:null)!==r&&(Re.flags|=1024),a}function yh(){var r=wu!==0;return wu=0,r}function vh(r,a,u){a.updateQueue=r.updateQueue,a.flags&=-2053,r.lanes&=~u}function bh(r){if(Cu){for(r=r.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}Cu=!1}Ii=0,St=Ze=Re=null,ma=!1,Ts=wu=0,ga=null}function Qt(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return St===null?Re.memoizedState=St=r:St=St.next=r,St}function yt(){if(Ze===null){var r=Re.alternate;r=r!==null?r.memoizedState:null}else r=Ze.next;var a=St===null?Re.memoizedState:St.next;if(a!==null)St=a,Ze=r;else{if(r===null)throw Re.alternate===null?Error(i(467)):Error(i(310));Ze=r,r={memoizedState:Ze.memoizedState,baseState:Ze.baseState,baseQueue:Ze.baseQueue,queue:Ze.queue,next:null},St===null?Re.memoizedState=St=r:St=St.next=r}return St}function Eu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function As(r){var a=Ts;return Ts+=1,ga===null&&(ga=[]),r=uv(ga,r,a),a=Re,(St===null?a.memoizedState:St.next)===null&&(a=a.alternate,z.H=a===null||a.memoizedState===null?eb:Oh),r}function ku(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return As(r);if(r.$$typeof===T)return Ut(r)}throw Error(i(438,String(r)))}function xh(r){var a=null,u=Re.updateQueue;if(u!==null&&(a=u.memoCache),a==null){var h=Re.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(a={data:h.data.map(function(y){return y.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),u===null&&(u=Eu(),Re.updateQueue=u),u.memoCache=a,u=a.data[a.index],u===void 0)for(u=a.data[a.index]=Array(r),h=0;h<r;h++)u[h]=Q;return a.index++,u}function Ni(r,a){return typeof a=="function"?a(r):a}function Tu(r){var a=yt();return Sh(a,Ze,r)}function Sh(r,a,u){var h=r.queue;if(h===null)throw Error(i(311));h.lastRenderedReducer=u;var y=r.baseQueue,b=h.pending;if(b!==null){if(y!==null){var E=y.next;y.next=b.next,b.next=E}a.baseQueue=y=b,h.pending=null}if(b=r.baseState,y===null)r.memoizedState=b;else{a=y.next;var L=E=null,U=null,K=a,ie=!1;do{var ae=K.lane&-536870913;if(ae!==K.lane?(Pe&ae)===ae:(Ii&ae)===ae){var J=K.revertLane;if(J===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),ae===ca&&(ie=!0);else if((Ii&J)===J){K=K.next,J===ca&&(ie=!0);continue}else ae={lane:0,revertLane:K.revertLane,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},U===null?(L=U=ae,E=b):U=U.next=ae,Re.lanes|=J,Cr|=J;ae=K.action,co&&u(b,ae),b=K.hasEagerState?K.eagerState:u(b,ae)}else J={lane:ae,revertLane:K.revertLane,gesture:K.gesture,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},U===null?(L=U=J,E=b):U=U.next=J,Re.lanes|=ae,Cr|=ae;K=K.next}while(K!==null&&K!==a);if(U===null?E=b:U.next=L,!xn(b,r.memoizedState)&&(_t=!0,ie&&(u=da,u!==null)))throw u;r.memoizedState=b,r.baseState=E,r.baseQueue=U,h.lastRenderedState=b}return y===null&&(h.lanes=0),[r.memoizedState,h.dispatch]}function _h(r){var a=yt(),u=a.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=r;var h=u.dispatch,y=u.pending,b=a.memoizedState;if(y!==null){u.pending=null;var E=y=y.next;do b=r(b,E.action),E=E.next;while(E!==y);xn(b,a.memoizedState)||(_t=!0),a.memoizedState=b,a.baseQueue===null&&(a.baseState=b),u.lastRenderedState=b}return[b,h]}function xv(r,a,u){var h=Re,y=yt(),b=Be;if(b){if(u===void 0)throw Error(i(407));u=u()}else u=a();var E=!xn((Ze||y).memoizedState,u);if(E&&(y.memoizedState=u,_t=!0),y=y.queue,Eh(Cv.bind(null,h,y,r),[r]),y.getSnapshot!==a||E||St!==null&&St.memoizedState.tag&1){if(h.flags|=2048,ya(9,{destroy:void 0},_v.bind(null,h,y,u,a),null),it===null)throw Error(i(349));b||(Ii&127)!==0||Sv(h,a,u)}return u}function Sv(r,a,u){r.flags|=16384,r={getSnapshot:a,value:u},a=Re.updateQueue,a===null?(a=Eu(),Re.updateQueue=a,a.stores=[r]):(u=a.stores,u===null?a.stores=[r]:u.push(r))}function _v(r,a,u,h){a.value=u,a.getSnapshot=h,wv(a)&&Ev(r)}function Cv(r,a,u){return u(function(){wv(a)&&Ev(r)})}function wv(r){var a=r.getSnapshot;r=r.value;try{var u=a();return!xn(r,u)}catch{return!0}}function Ev(r){var a=to(r,2);a!==null&&hn(a,r,2)}function Ch(r){var a=Qt();if(typeof r=="function"){var u=r;if(r=u(),co){an(!0);try{u()}finally{an(!1)}}}return a.memoizedState=a.baseState=r,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ni,lastRenderedState:r},a}function kv(r,a,u,h){return r.baseState=u,Sh(r,Ze,typeof h=="function"?h:Ni)}function dR(r,a,u,h,y){if(Ru(r))throw Error(i(485));if(r=a.action,r!==null){var b={payload:y,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){b.listeners.push(E)}};z.T!==null?u(!0):b.isTransition=!1,h(b),u=a.pending,u===null?(b.next=a.pending=b,Tv(a,b)):(b.next=u.next,a.pending=u.next=b)}}function Tv(r,a){var u=a.action,h=a.payload,y=r.state;if(a.isTransition){var b=z.T,E={};z.T=E;try{var L=u(y,h),U=z.S;U!==null&&U(E,L),Av(r,a,L)}catch(K){wh(r,a,K)}finally{b!==null&&E.types!==null&&(b.types=E.types),z.T=b}}else try{b=u(y,h),Av(r,a,b)}catch(K){wh(r,a,K)}}function Av(r,a,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){Lv(r,a,h)},function(h){return wh(r,a,h)}):Lv(r,a,u)}function Lv(r,a,u){a.status="fulfilled",a.value=u,Rv(a),r.state=u,a=r.pending,a!==null&&(u=a.next,u===a?r.pending=null:(u=u.next,a.next=u,Tv(r,u)))}function wh(r,a,u){var h=r.pending;if(r.pending=null,h!==null){h=h.next;do a.status="rejected",a.reason=u,Rv(a),a=a.next;while(a!==h)}r.action=null}function Rv(r){r=r.listeners;for(var a=0;a<r.length;a++)(0,r[a])()}function Ov(r,a){return a}function Dv(r,a){if(Be){var u=it.formState;if(u!==null){e:{var h=Re;if(Be){if(ut){t:{for(var y=ut,b=Pn;y.nodeType!==8;){if(!b){y=null;break t}if(y=jn(y.nextSibling),y===null){y=null;break t}}b=y.data,y=b==="F!"||b==="F"?y:null}if(y){ut=jn(y.nextSibling),h=y.data==="F!";break e}}pr(h)}h=!1}h&&(a=u[0])}}return u=Qt(),u.memoizedState=u.baseState=a,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ov,lastRenderedState:a},u.queue=h,u=Qv.bind(null,Re,h),h.dispatch=u,h=Ch(!1),b=Rh.bind(null,Re,!1,h.queue),h=Qt(),y={state:a,dispatch:null,action:r,pending:null},h.queue=y,u=dR.bind(null,Re,y,b,u),y.dispatch=u,h.memoizedState=r,[a,u,!1]}function Mv(r){var a=yt();return Iv(a,Ze,r)}function Iv(r,a,u){if(a=Sh(r,a,Ov)[0],r=Tu(Ni)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var h=As(a)}catch(E){throw E===fa?yu:E}else h=a;a=yt();var y=a.queue,b=y.dispatch;return u!==a.memoizedState&&(Re.flags|=2048,ya(9,{destroy:void 0},fR.bind(null,y,u),null)),[h,b,r]}function fR(r,a){r.action=a}function Nv(r){var a=yt(),u=Ze;if(u!==null)return Iv(a,u,r);yt(),a=a.memoizedState,u=yt();var h=u.queue.dispatch;return u.memoizedState=r,[a,h,!1]}function ya(r,a,u,h){return r={tag:r,create:u,deps:h,inst:a,next:null},a=Re.updateQueue,a===null&&(a=Eu(),Re.updateQueue=a),u=a.lastEffect,u===null?a.lastEffect=r.next=r:(h=u.next,u.next=r,r.next=h,a.lastEffect=r),r}function zv(){return yt().memoizedState}function Au(r,a,u,h){var y=Qt();Re.flags|=r,y.memoizedState=ya(1|a,{destroy:void 0},u,h===void 0?null:h)}function Lu(r,a,u,h){var y=yt();h=h===void 0?null:h;var b=y.memoizedState.inst;Ze!==null&&h!==null&&mh(h,Ze.memoizedState.deps)?y.memoizedState=ya(a,b,u,h):(Re.flags|=r,y.memoizedState=ya(1|a,b,u,h))}function Pv(r,a){Au(8390656,8,r,a)}function Eh(r,a){Lu(2048,8,r,a)}function hR(r){Re.flags|=4;var a=Re.updateQueue;if(a===null)a=Eu(),Re.updateQueue=a,a.events=[r];else{var u=a.events;u===null?a.events=[r]:u.push(r)}}function Hv(r){var a=yt().memoizedState;return hR({ref:a,nextImpl:r}),function(){if(($e&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}function jv(r,a){return Lu(4,2,r,a)}function Bv(r,a){return Lu(4,4,r,a)}function Uv(r,a){if(typeof a=="function"){r=r();var u=a(r);return function(){typeof u=="function"?u():a(null)}}if(a!=null)return r=r(),a.current=r,function(){a.current=null}}function Vv(r,a,u){u=u!=null?u.concat([r]):null,Lu(4,4,Uv.bind(null,a,r),u)}function kh(){}function Fv(r,a){var u=yt();a=a===void 0?null:a;var h=u.memoizedState;return a!==null&&mh(a,h[1])?h[0]:(u.memoizedState=[r,a],r)}function Gv(r,a){var u=yt();a=a===void 0?null:a;var h=u.memoizedState;if(a!==null&&mh(a,h[1]))return h[0];if(h=r(),co){an(!0);try{r()}finally{an(!1)}}return u.memoizedState=[h,a],h}function Th(r,a,u){return u===void 0||(Ii&1073741824)!==0&&(Pe&261930)===0?r.memoizedState=a:(r.memoizedState=u,r=$b(),Re.lanes|=r,Cr|=r,u)}function $v(r,a,u,h){return xn(u,a)?u:pa.current!==null?(r=Th(r,u,h),xn(r,a)||(_t=!0),r):(Ii&42)===0||(Ii&1073741824)!==0&&(Pe&261930)===0?(_t=!0,r.memoizedState=u):(r=$b(),Re.lanes|=r,Cr|=r,a)}function qv(r,a,u,h,y){var b=q.p;q.p=b!==0&&8>b?b:8;var E=z.T,L={};z.T=L,Rh(r,!1,a,u);try{var U=y(),K=z.S;if(K!==null&&K(L,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var ie=lR(U,h);Ls(r,a,ie,kn(r))}else Ls(r,a,h,kn(r))}catch(ae){Ls(r,a,{then:function(){},status:"rejected",reason:ae},kn())}finally{q.p=b,E!==null&&L.types!==null&&(E.types=L.types),z.T=E}}function pR(){}function Ah(r,a,u,h){if(r.tag!==5)throw Error(i(476));var y=Wv(r).queue;qv(r,y,a,te,u===null?pR:function(){return Yv(r),u(h)})}function Wv(r){var a=r.memoizedState;if(a!==null)return a;a={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ni,lastRenderedState:te},next:null};var u={};return a.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ni,lastRenderedState:u},next:null},r.memoizedState=a,r=r.alternate,r!==null&&(r.memoizedState=a),a}function Yv(r){var a=Wv(r);a.next===null&&(a=r.alternate.memoizedState),Ls(r,a.next.queue,{},kn())}function Lh(){return Ut(qs)}function Xv(){return yt().memoizedState}function Kv(){return yt().memoizedState}function mR(r){for(var a=r.return;a!==null;){switch(a.tag){case 24:case 3:var u=kn();r=yr(u);var h=vr(a,r,u);h!==null&&(hn(h,a,u),ws(h,a,u)),a={cache:rh()},r.payload=a;return}a=a.return}}function gR(r,a,u){var h=kn();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Ru(r)?Zv(a,u):(u=Wf(r,a,u,h),u!==null&&(hn(u,r,h),Jv(u,a,h)))}function Qv(r,a,u){var h=kn();Ls(r,a,u,h)}function Ls(r,a,u,h){var y={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Ru(r))Zv(a,y);else{var b=r.alternate;if(r.lanes===0&&(b===null||b.lanes===0)&&(b=a.lastRenderedReducer,b!==null))try{var E=a.lastRenderedState,L=b(E,u);if(y.hasEagerState=!0,y.eagerState=L,xn(L,E))return cu(r,a,y,0),it===null&&uu(),!1}catch{}if(u=Wf(r,a,y,h),u!==null)return hn(u,r,h),Jv(u,a,h),!0}return!1}function Rh(r,a,u,h){if(h={lane:2,revertLane:lp(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Ru(r)){if(a)throw Error(i(479))}else a=Wf(r,u,h,2),a!==null&&hn(a,r,2)}function Ru(r){var a=r.alternate;return r===Re||a!==null&&a===Re}function Zv(r,a){ma=Cu=!0;var u=r.pending;u===null?a.next=a:(a.next=u.next,u.next=a),r.pending=a}function Jv(r,a,u){if((u&4194048)!==0){var h=a.lanes;h&=r.pendingLanes,u|=h,a.lanes=u,r0(r,u)}}var Rs={readContext:Ut,use:ku,useCallback:ht,useContext:ht,useEffect:ht,useImperativeHandle:ht,useLayoutEffect:ht,useInsertionEffect:ht,useMemo:ht,useReducer:ht,useRef:ht,useState:ht,useDebugValue:ht,useDeferredValue:ht,useTransition:ht,useSyncExternalStore:ht,useId:ht,useHostTransitionStatus:ht,useFormState:ht,useActionState:ht,useOptimistic:ht,useMemoCache:ht,useCacheRefresh:ht};Rs.useEffectEvent=ht;var eb={readContext:Ut,use:ku,useCallback:function(r,a){return Qt().memoizedState=[r,a===void 0?null:a],r},useContext:Ut,useEffect:Pv,useImperativeHandle:function(r,a,u){u=u!=null?u.concat([r]):null,Au(4194308,4,Uv.bind(null,a,r),u)},useLayoutEffect:function(r,a){return Au(4194308,4,r,a)},useInsertionEffect:function(r,a){Au(4,2,r,a)},useMemo:function(r,a){var u=Qt();a=a===void 0?null:a;var h=r();if(co){an(!0);try{r()}finally{an(!1)}}return u.memoizedState=[h,a],h},useReducer:function(r,a,u){var h=Qt();if(u!==void 0){var y=u(a);if(co){an(!0);try{u(a)}finally{an(!1)}}}else y=a;return h.memoizedState=h.baseState=y,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:y},h.queue=r,r=r.dispatch=gR.bind(null,Re,r),[h.memoizedState,r]},useRef:function(r){var a=Qt();return r={current:r},a.memoizedState=r},useState:function(r){r=Ch(r);var a=r.queue,u=Qv.bind(null,Re,a);return a.dispatch=u,[r.memoizedState,u]},useDebugValue:kh,useDeferredValue:function(r,a){var u=Qt();return Th(u,r,a)},useTransition:function(){var r=Ch(!1);return r=qv.bind(null,Re,r.queue,!0,!1),Qt().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,a,u){var h=Re,y=Qt();if(Be){if(u===void 0)throw Error(i(407));u=u()}else{if(u=a(),it===null)throw Error(i(349));(Pe&127)!==0||Sv(h,a,u)}y.memoizedState=u;var b={value:u,getSnapshot:a};return y.queue=b,Pv(Cv.bind(null,h,b,r),[r]),h.flags|=2048,ya(9,{destroy:void 0},_v.bind(null,h,b,u,a),null),u},useId:function(){var r=Qt(),a=it.identifierPrefix;if(Be){var u=oi,h=ri;u=(h&~(1<<32-nt(h)-1)).toString(32)+u,a="_"+a+"R_"+u,u=wu++,0<u&&(a+="H"+u.toString(32)),a+="_"}else u=uR++,a="_"+a+"r_"+u.toString(32)+"_";return r.memoizedState=a},useHostTransitionStatus:Lh,useFormState:Dv,useActionState:Dv,useOptimistic:function(r){var a=Qt();a.memoizedState=a.baseState=r;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=u,a=Rh.bind(null,Re,!0,u),u.dispatch=a,[r,a]},useMemoCache:xh,useCacheRefresh:function(){return Qt().memoizedState=mR.bind(null,Re)},useEffectEvent:function(r){var a=Qt(),u={impl:r};return a.memoizedState=u,function(){if(($e&2)!==0)throw Error(i(440));return u.impl.apply(void 0,arguments)}}},Oh={readContext:Ut,use:ku,useCallback:Fv,useContext:Ut,useEffect:Eh,useImperativeHandle:Vv,useInsertionEffect:jv,useLayoutEffect:Bv,useMemo:Gv,useReducer:Tu,useRef:zv,useState:function(){return Tu(Ni)},useDebugValue:kh,useDeferredValue:function(r,a){var u=yt();return $v(u,Ze.memoizedState,r,a)},useTransition:function(){var r=Tu(Ni)[0],a=yt().memoizedState;return[typeof r=="boolean"?r:As(r),a]},useSyncExternalStore:xv,useId:Xv,useHostTransitionStatus:Lh,useFormState:Mv,useActionState:Mv,useOptimistic:function(r,a){var u=yt();return kv(u,Ze,r,a)},useMemoCache:xh,useCacheRefresh:Kv};Oh.useEffectEvent=Hv;var tb={readContext:Ut,use:ku,useCallback:Fv,useContext:Ut,useEffect:Eh,useImperativeHandle:Vv,useInsertionEffect:jv,useLayoutEffect:Bv,useMemo:Gv,useReducer:_h,useRef:zv,useState:function(){return _h(Ni)},useDebugValue:kh,useDeferredValue:function(r,a){var u=yt();return Ze===null?Th(u,r,a):$v(u,Ze.memoizedState,r,a)},useTransition:function(){var r=_h(Ni)[0],a=yt().memoizedState;return[typeof r=="boolean"?r:As(r),a]},useSyncExternalStore:xv,useId:Xv,useHostTransitionStatus:Lh,useFormState:Nv,useActionState:Nv,useOptimistic:function(r,a){var u=yt();return Ze!==null?kv(u,Ze,r,a):(u.baseState=r,[r,u.queue.dispatch])},useMemoCache:xh,useCacheRefresh:Kv};tb.useEffectEvent=Hv;function Dh(r,a,u,h){a=r.memoizedState,u=u(h,a),u=u==null?a:m({},a,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var Mh={enqueueSetState:function(r,a,u){r=r._reactInternals;var h=kn(),y=yr(h);y.payload=a,u!=null&&(y.callback=u),a=vr(r,y,h),a!==null&&(hn(a,r,h),ws(a,r,h))},enqueueReplaceState:function(r,a,u){r=r._reactInternals;var h=kn(),y=yr(h);y.tag=1,y.payload=a,u!=null&&(y.callback=u),a=vr(r,y,h),a!==null&&(hn(a,r,h),ws(a,r,h))},enqueueForceUpdate:function(r,a){r=r._reactInternals;var u=kn(),h=yr(u);h.tag=2,a!=null&&(h.callback=a),a=vr(r,h,u),a!==null&&(hn(a,r,u),ws(a,r,u))}};function nb(r,a,u,h,y,b,E){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(h,b,E):a.prototype&&a.prototype.isPureReactComponent?!gs(u,h)||!gs(y,b):!0}function ib(r,a,u,h){r=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(u,h),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(u,h),a.state!==r&&Mh.enqueueReplaceState(a,a.state,null)}function fo(r,a){var u=a;if("ref"in a){u={};for(var h in a)h!=="ref"&&(u[h]=a[h])}if(r=r.defaultProps){u===a&&(u=m({},u));for(var y in r)u[y]===void 0&&(u[y]=r[y])}return u}function rb(r){lu(r)}function ob(r){console.error(r)}function ab(r){lu(r)}function Ou(r,a){try{var u=r.onUncaughtError;u(a.value,{componentStack:a.stack})}catch(h){setTimeout(function(){throw h})}}function sb(r,a,u){try{var h=r.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Ih(r,a,u){return u=yr(u),u.tag=3,u.payload={element:null},u.callback=function(){Ou(r,a)},u}function lb(r){return r=yr(r),r.tag=3,r}function ub(r,a,u,h){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var b=h.value;r.payload=function(){return y(b)},r.callback=function(){sb(a,u,h)}}var E=u.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(r.callback=function(){sb(a,u,h),typeof y!="function"&&(wr===null?wr=new Set([this]):wr.add(this));var L=h.stack;this.componentDidCatch(h.value,{componentStack:L!==null?L:""})})}function yR(r,a,u,h,y){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(a=u.alternate,a!==null&&ua(a,u,y,!0),u=_n.current,u!==null){switch(u.tag){case 31:case 13:return Hn===null?Fu():u.alternate===null&&pt===0&&(pt=3),u.flags&=-257,u.flags|=65536,u.lanes=y,h===vu?u.flags|=16384:(a=u.updateQueue,a===null?u.updateQueue=new Set([h]):a.add(h),op(r,h,y)),!1;case 22:return u.flags|=65536,h===vu?u.flags|=16384:(a=u.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=a):(u=a.retryQueue,u===null?a.retryQueue=new Set([h]):u.add(h)),op(r,h,y)),!1}throw Error(i(435,u.tag))}return op(r,h,y),Fu(),!1}if(Be)return a=_n.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=y,h!==Jf&&(r=Error(i(422),{cause:h}),bs(In(r,u)))):(h!==Jf&&(a=Error(i(423),{cause:h}),bs(In(a,u))),r=r.current.alternate,r.flags|=65536,y&=-y,r.lanes|=y,h=In(h,u),y=Ih(r.stateNode,h,y),ch(r,y),pt!==4&&(pt=2)),!1;var b=Error(i(520),{cause:h});if(b=In(b,u),Hs===null?Hs=[b]:Hs.push(b),pt!==4&&(pt=2),a===null)return!0;h=In(h,u),u=a;do{switch(u.tag){case 3:return u.flags|=65536,r=y&-y,u.lanes|=r,r=Ih(u.stateNode,h,r),ch(u,r),!1;case 1:if(a=u.type,b=u.stateNode,(u.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(wr===null||!wr.has(b))))return u.flags|=65536,y&=-y,u.lanes|=y,y=lb(y),ub(y,r,u,h),ch(u,y),!1}u=u.return}while(u!==null);return!1}var Nh=Error(i(461)),_t=!1;function Vt(r,a,u,h){a.child=r===null?hv(a,null,u,h):uo(a,r.child,u,h)}function cb(r,a,u,h,y){u=u.render;var b=a.ref;if("ref"in h){var E={};for(var L in h)L!=="ref"&&(E[L]=h[L])}else E=h;return oo(a),h=gh(r,a,u,E,b,y),L=yh(),r!==null&&!_t?(vh(r,a,y),zi(r,a,y)):(Be&&L&&Qf(a),a.flags|=1,Vt(r,a,h,y),a.child)}function db(r,a,u,h,y){if(r===null){var b=u.type;return typeof b=="function"&&!Yf(b)&&b.defaultProps===void 0&&u.compare===null?(a.tag=15,a.type=b,fb(r,a,b,h,y)):(r=fu(u.type,null,h,a,a.mode,y),r.ref=a.ref,r.return=a,a.child=r)}if(b=r.child,!Fh(r,y)){var E=b.memoizedProps;if(u=u.compare,u=u!==null?u:gs,u(E,h)&&r.ref===a.ref)return zi(r,a,y)}return a.flags|=1,r=Ri(b,h),r.ref=a.ref,r.return=a,a.child=r}function fb(r,a,u,h,y){if(r!==null){var b=r.memoizedProps;if(gs(b,h)&&r.ref===a.ref)if(_t=!1,a.pendingProps=h=b,Fh(r,y))(r.flags&131072)!==0&&(_t=!0);else return a.lanes=r.lanes,zi(r,a,y)}return zh(r,a,u,h,y)}function hb(r,a,u,h){var y=h.children,b=r!==null?r.memoizedState:null;if(r===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((a.flags&128)!==0){if(b=b!==null?b.baseLanes|u:u,r!==null){for(h=a.child=r.child,y=0;h!==null;)y=y|h.lanes|h.childLanes,h=h.sibling;h=y&~b}else h=0,a.child=null;return pb(r,a,b,u,h)}if((u&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},r!==null&&gu(a,b!==null?b.cachePool:null),b!==null?gv(a,b):fh(),yv(a);else return h=a.lanes=536870912,pb(r,a,b!==null?b.baseLanes|u:u,u,h)}else b!==null?(gu(a,b.cachePool),gv(a,b),xr(),a.memoizedState=null):(r!==null&&gu(a,null),fh(),xr());return Vt(r,a,y,u),a.child}function Os(r,a){return r!==null&&r.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function pb(r,a,u,h,y){var b=ah();return b=b===null?null:{parent:xt._currentValue,pool:b},a.memoizedState={baseLanes:u,cachePool:b},r!==null&&gu(a,null),fh(),yv(a),r!==null&&ua(r,a,h,!0),a.childLanes=y,null}function Du(r,a){return a=Iu({mode:a.mode,children:a.children},r.mode),a.ref=r.ref,r.child=a,a.return=r,a}function mb(r,a,u){return uo(a,r.child,null,u),r=Du(a,a.pendingProps),r.flags|=2,Cn(a),a.memoizedState=null,r}function vR(r,a,u){var h=a.pendingProps,y=(a.flags&128)!==0;if(a.flags&=-129,r===null){if(Be){if(h.mode==="hidden")return r=Du(a,h),a.lanes=536870912,Os(null,r);if(ph(a),(r=ut)?(r=Tx(r,Pn),r=r!==null&&r.data==="&"?r:null,r!==null&&(a.memoizedState={dehydrated:r,treeContext:fr!==null?{id:ri,overflow:oi}:null,retryLane:536870912,hydrationErrors:null},u=Z0(r),u.return=a,a.child=u,Bt=a,ut=null)):r=null,r===null)throw pr(a);return a.lanes=536870912,null}return Du(a,h)}var b=r.memoizedState;if(b!==null){var E=b.dehydrated;if(ph(a),y)if(a.flags&256)a.flags&=-257,a=mb(r,a,u);else if(a.memoizedState!==null)a.child=r.child,a.flags|=128,a=null;else throw Error(i(558));else if(_t||ua(r,a,u,!1),y=(u&r.childLanes)!==0,_t||y){if(h=it,h!==null&&(E=o0(h,u),E!==0&&E!==b.retryLane))throw b.retryLane=E,to(r,E),hn(h,r,E),Nh;Fu(),a=mb(r,a,u)}else r=b.treeContext,ut=jn(E.nextSibling),Bt=a,Be=!0,hr=null,Pn=!1,r!==null&&tv(a,r),a=Du(a,h),a.flags|=4096;return a}return r=Ri(r.child,{mode:h.mode,children:h.children}),r.ref=a.ref,a.child=r,r.return=a,r}function Mu(r,a){var u=a.ref;if(u===null)r!==null&&r.ref!==null&&(a.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(i(284));(r===null||r.ref!==u)&&(a.flags|=4194816)}}function zh(r,a,u,h,y){return oo(a),u=gh(r,a,u,h,void 0,y),h=yh(),r!==null&&!_t?(vh(r,a,y),zi(r,a,y)):(Be&&h&&Qf(a),a.flags|=1,Vt(r,a,u,y),a.child)}function gb(r,a,u,h,y,b){return oo(a),a.updateQueue=null,u=bv(a,h,u,y),vv(r),h=yh(),r!==null&&!_t?(vh(r,a,b),zi(r,a,b)):(Be&&h&&Qf(a),a.flags|=1,Vt(r,a,u,b),a.child)}function yb(r,a,u,h,y){if(oo(a),a.stateNode===null){var b=oa,E=u.contextType;typeof E=="object"&&E!==null&&(b=Ut(E)),b=new u(h,b),a.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=Mh,a.stateNode=b,b._reactInternals=a,b=a.stateNode,b.props=h,b.state=a.memoizedState,b.refs={},lh(a),E=u.contextType,b.context=typeof E=="object"&&E!==null?Ut(E):oa,b.state=a.memoizedState,E=u.getDerivedStateFromProps,typeof E=="function"&&(Dh(a,u,E,h),b.state=a.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(E=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),E!==b.state&&Mh.enqueueReplaceState(b,b.state,null),ks(a,h,b,y),Es(),b.state=a.memoizedState),typeof b.componentDidMount=="function"&&(a.flags|=4194308),h=!0}else if(r===null){b=a.stateNode;var L=a.memoizedProps,U=fo(u,L);b.props=U;var K=b.context,ie=u.contextType;E=oa,typeof ie=="object"&&ie!==null&&(E=Ut(ie));var ae=u.getDerivedStateFromProps;ie=typeof ae=="function"||typeof b.getSnapshotBeforeUpdate=="function",L=a.pendingProps!==L,ie||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(L||K!==E)&&ib(a,b,h,E),gr=!1;var J=a.memoizedState;b.state=J,ks(a,h,b,y),Es(),K=a.memoizedState,L||J!==K||gr?(typeof ae=="function"&&(Dh(a,u,ae,h),K=a.memoizedState),(U=gr||nb(a,u,U,h,J,K,E))?(ie||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(a.flags|=4194308)):(typeof b.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=h,a.memoizedState=K),b.props=h,b.state=K,b.context=E,h=U):(typeof b.componentDidMount=="function"&&(a.flags|=4194308),h=!1)}else{b=a.stateNode,uh(r,a),E=a.memoizedProps,ie=fo(u,E),b.props=ie,ae=a.pendingProps,J=b.context,K=u.contextType,U=oa,typeof K=="object"&&K!==null&&(U=Ut(K)),L=u.getDerivedStateFromProps,(K=typeof L=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(E!==ae||J!==U)&&ib(a,b,h,U),gr=!1,J=a.memoizedState,b.state=J,ks(a,h,b,y),Es();var ne=a.memoizedState;E!==ae||J!==ne||gr||r!==null&&r.dependencies!==null&&pu(r.dependencies)?(typeof L=="function"&&(Dh(a,u,L,h),ne=a.memoizedState),(ie=gr||nb(a,u,ie,h,J,ne,U)||r!==null&&r.dependencies!==null&&pu(r.dependencies))?(K||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(h,ne,U),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(h,ne,U)),typeof b.componentDidUpdate=="function"&&(a.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof b.componentDidUpdate!="function"||E===r.memoizedProps&&J===r.memoizedState||(a.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&J===r.memoizedState||(a.flags|=1024),a.memoizedProps=h,a.memoizedState=ne),b.props=h,b.state=ne,b.context=U,h=ie):(typeof b.componentDidUpdate!="function"||E===r.memoizedProps&&J===r.memoizedState||(a.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&J===r.memoizedState||(a.flags|=1024),h=!1)}return b=h,Mu(r,a),h=(a.flags&128)!==0,b||h?(b=a.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:b.render(),a.flags|=1,r!==null&&h?(a.child=uo(a,r.child,null,y),a.child=uo(a,null,u,y)):Vt(r,a,u,y),a.memoizedState=b.state,r=a.child):r=zi(r,a,y),r}function vb(r,a,u,h){return io(),a.flags|=256,Vt(r,a,u,h),a.child}var Ph={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hh(r){return{baseLanes:r,cachePool:sv()}}function jh(r,a,u){return r=r!==null?r.childLanes&~u:0,a&&(r|=En),r}function bb(r,a,u){var h=a.pendingProps,y=!1,b=(a.flags&128)!==0,E;if((E=b)||(E=r!==null&&r.memoizedState===null?!1:(gt.current&2)!==0),E&&(y=!0,a.flags&=-129),E=(a.flags&32)!==0,a.flags&=-33,r===null){if(Be){if(y?br(a):xr(),(r=ut)?(r=Tx(r,Pn),r=r!==null&&r.data!=="&"?r:null,r!==null&&(a.memoizedState={dehydrated:r,treeContext:fr!==null?{id:ri,overflow:oi}:null,retryLane:536870912,hydrationErrors:null},u=Z0(r),u.return=a,a.child=u,Bt=a,ut=null)):r=null,r===null)throw pr(a);return Sp(r)?a.lanes=32:a.lanes=536870912,null}var L=h.children;return h=h.fallback,y?(xr(),y=a.mode,L=Iu({mode:"hidden",children:L},y),h=no(h,y,u,null),L.return=a,h.return=a,L.sibling=h,a.child=L,h=a.child,h.memoizedState=Hh(u),h.childLanes=jh(r,E,u),a.memoizedState=Ph,Os(null,h)):(br(a),Bh(a,L))}var U=r.memoizedState;if(U!==null&&(L=U.dehydrated,L!==null)){if(b)a.flags&256?(br(a),a.flags&=-257,a=Uh(r,a,u)):a.memoizedState!==null?(xr(),a.child=r.child,a.flags|=128,a=null):(xr(),L=h.fallback,y=a.mode,h=Iu({mode:"visible",children:h.children},y),L=no(L,y,u,null),L.flags|=2,h.return=a,L.return=a,h.sibling=L,a.child=h,uo(a,r.child,null,u),h=a.child,h.memoizedState=Hh(u),h.childLanes=jh(r,E,u),a.memoizedState=Ph,a=Os(null,h));else if(br(a),Sp(L)){if(E=L.nextSibling&&L.nextSibling.dataset,E)var K=E.dgst;E=K,h=Error(i(419)),h.stack="",h.digest=E,bs({value:h,source:null,stack:null}),a=Uh(r,a,u)}else if(_t||ua(r,a,u,!1),E=(u&r.childLanes)!==0,_t||E){if(E=it,E!==null&&(h=o0(E,u),h!==0&&h!==U.retryLane))throw U.retryLane=h,to(r,h),hn(E,r,h),Nh;xp(L)||Fu(),a=Uh(r,a,u)}else xp(L)?(a.flags|=192,a.child=r.child,a=null):(r=U.treeContext,ut=jn(L.nextSibling),Bt=a,Be=!0,hr=null,Pn=!1,r!==null&&tv(a,r),a=Bh(a,h.children),a.flags|=4096);return a}return y?(xr(),L=h.fallback,y=a.mode,U=r.child,K=U.sibling,h=Ri(U,{mode:"hidden",children:h.children}),h.subtreeFlags=U.subtreeFlags&65011712,K!==null?L=Ri(K,L):(L=no(L,y,u,null),L.flags|=2),L.return=a,h.return=a,h.sibling=L,a.child=h,Os(null,h),h=a.child,L=r.child.memoizedState,L===null?L=Hh(u):(y=L.cachePool,y!==null?(U=xt._currentValue,y=y.parent!==U?{parent:U,pool:U}:y):y=sv(),L={baseLanes:L.baseLanes|u,cachePool:y}),h.memoizedState=L,h.childLanes=jh(r,E,u),a.memoizedState=Ph,Os(r.child,h)):(br(a),u=r.child,r=u.sibling,u=Ri(u,{mode:"visible",children:h.children}),u.return=a,u.sibling=null,r!==null&&(E=a.deletions,E===null?(a.deletions=[r],a.flags|=16):E.push(r)),a.child=u,a.memoizedState=null,u)}function Bh(r,a){return a=Iu({mode:"visible",children:a},r.mode),a.return=r,r.child=a}function Iu(r,a){return r=Sn(22,r,null,a),r.lanes=0,r}function Uh(r,a,u){return uo(a,r.child,null,u),r=Bh(a,a.pendingProps.children),r.flags|=2,a.memoizedState=null,r}function xb(r,a,u){r.lanes|=a;var h=r.alternate;h!==null&&(h.lanes|=a),nh(r.return,a,u)}function Vh(r,a,u,h,y,b){var E=r.memoizedState;E===null?r.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:y,treeForkCount:b}:(E.isBackwards=a,E.rendering=null,E.renderingStartTime=0,E.last=h,E.tail=u,E.tailMode=y,E.treeForkCount=b)}function Sb(r,a,u){var h=a.pendingProps,y=h.revealOrder,b=h.tail;h=h.children;var E=gt.current,L=(E&2)!==0;if(L?(E=E&1|2,a.flags|=128):E&=1,N(gt,E),Vt(r,a,h,u),h=Be?vs:0,!L&&r!==null&&(r.flags&128)!==0)e:for(r=a.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&xb(r,u,a);else if(r.tag===19)xb(r,u,a);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(y){case"forwards":for(u=a.child,y=null;u!==null;)r=u.alternate,r!==null&&_u(r)===null&&(y=u),u=u.sibling;u=y,u===null?(y=a.child,a.child=null):(y=u.sibling,u.sibling=null),Vh(a,!1,y,u,b,h);break;case"backwards":case"unstable_legacy-backwards":for(u=null,y=a.child,a.child=null;y!==null;){if(r=y.alternate,r!==null&&_u(r)===null){a.child=y;break}r=y.sibling,y.sibling=u,u=y,y=r}Vh(a,!0,u,null,b,h);break;case"together":Vh(a,!1,null,null,void 0,h);break;default:a.memoizedState=null}return a.child}function zi(r,a,u){if(r!==null&&(a.dependencies=r.dependencies),Cr|=a.lanes,(u&a.childLanes)===0)if(r!==null){if(ua(r,a,u,!1),(u&a.childLanes)===0)return null}else return null;if(r!==null&&a.child!==r.child)throw Error(i(153));if(a.child!==null){for(r=a.child,u=Ri(r,r.pendingProps),a.child=u,u.return=a;r.sibling!==null;)r=r.sibling,u=u.sibling=Ri(r,r.pendingProps),u.return=a;u.sibling=null}return a.child}function Fh(r,a){return(r.lanes&a)!==0?!0:(r=r.dependencies,!!(r!==null&&pu(r)))}function bR(r,a,u){switch(a.tag){case 3:Ee(a,a.stateNode.containerInfo),mr(a,xt,r.memoizedState.cache),io();break;case 27:case 5:We(a);break;case 4:Ee(a,a.stateNode.containerInfo);break;case 10:mr(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,ph(a),null;break;case 13:var h=a.memoizedState;if(h!==null)return h.dehydrated!==null?(br(a),a.flags|=128,null):(u&a.child.childLanes)!==0?bb(r,a,u):(br(a),r=zi(r,a,u),r!==null?r.sibling:null);br(a);break;case 19:var y=(r.flags&128)!==0;if(h=(u&a.childLanes)!==0,h||(ua(r,a,u,!1),h=(u&a.childLanes)!==0),y){if(h)return Sb(r,a,u);a.flags|=128}if(y=a.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),N(gt,gt.current),h)break;return null;case 22:return a.lanes=0,hb(r,a,u,a.pendingProps);case 24:mr(a,xt,r.memoizedState.cache)}return zi(r,a,u)}function _b(r,a,u){if(r!==null)if(r.memoizedProps!==a.pendingProps)_t=!0;else{if(!Fh(r,u)&&(a.flags&128)===0)return _t=!1,bR(r,a,u);_t=(r.flags&131072)!==0}else _t=!1,Be&&(a.flags&1048576)!==0&&ev(a,vs,a.index);switch(a.lanes=0,a.tag){case 16:e:{var h=a.pendingProps;if(r=so(a.elementType),a.type=r,typeof r=="function")Yf(r)?(h=fo(r,h),a.tag=1,a=yb(null,a,r,h,u)):(a.tag=0,a=zh(null,a,r,h,u));else{if(r!=null){var y=r.$$typeof;if(y===D){a.tag=11,a=cb(null,a,r,h,u);break e}else if(y===P){a.tag=14,a=db(null,a,r,h,u);break e}}throw a=Z(r)||r,Error(i(306,a,""))}}return a;case 0:return zh(r,a,a.type,a.pendingProps,u);case 1:return h=a.type,y=fo(h,a.pendingProps),yb(r,a,h,y,u);case 3:e:{if(Ee(a,a.stateNode.containerInfo),r===null)throw Error(i(387));h=a.pendingProps;var b=a.memoizedState;y=b.element,uh(r,a),ks(a,h,null,u);var E=a.memoizedState;if(h=E.cache,mr(a,xt,h),h!==b.cache&&ih(a,[xt],u,!0),Es(),h=E.element,b.isDehydrated)if(b={element:h,isDehydrated:!1,cache:E.cache},a.updateQueue.baseState=b,a.memoizedState=b,a.flags&256){a=vb(r,a,h,u);break e}else if(h!==y){y=In(Error(i(424)),a),bs(y),a=vb(r,a,h,u);break e}else for(r=a.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,ut=jn(r.firstChild),Bt=a,Be=!0,hr=null,Pn=!0,u=hv(a,null,h,u),a.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(io(),h===y){a=zi(r,a,u);break e}Vt(r,a,h,u)}a=a.child}return a;case 26:return Mu(r,a),r===null?(u=Mx(a.type,null,a.pendingProps,null))?a.memoizedState=u:Be||(u=a.type,r=a.pendingProps,h=Ku(le.current).createElement(u),h[jt]=a,h[sn]=r,Ft(h,u,r),Mt(h),a.stateNode=h):a.memoizedState=Mx(a.type,r.memoizedProps,a.pendingProps,r.memoizedState),null;case 27:return We(a),r===null&&Be&&(h=a.stateNode=Rx(a.type,a.pendingProps,le.current),Bt=a,Pn=!0,y=ut,Ar(a.type)?(_p=y,ut=jn(h.firstChild)):ut=y),Vt(r,a,a.pendingProps.children,u),Mu(r,a),r===null&&(a.flags|=4194304),a.child;case 5:return r===null&&Be&&((y=h=ut)&&(h=XR(h,a.type,a.pendingProps,Pn),h!==null?(a.stateNode=h,Bt=a,ut=jn(h.firstChild),Pn=!1,y=!0):y=!1),y||pr(a)),We(a),y=a.type,b=a.pendingProps,E=r!==null?r.memoizedProps:null,h=b.children,yp(y,b)?h=null:E!==null&&yp(y,E)&&(a.flags|=32),a.memoizedState!==null&&(y=gh(r,a,cR,null,null,u),qs._currentValue=y),Mu(r,a),Vt(r,a,h,u),a.child;case 6:return r===null&&Be&&((r=u=ut)&&(u=KR(u,a.pendingProps,Pn),u!==null?(a.stateNode=u,Bt=a,ut=null,r=!0):r=!1),r||pr(a)),null;case 13:return bb(r,a,u);case 4:return Ee(a,a.stateNode.containerInfo),h=a.pendingProps,r===null?a.child=uo(a,null,h,u):Vt(r,a,h,u),a.child;case 11:return cb(r,a,a.type,a.pendingProps,u);case 7:return Vt(r,a,a.pendingProps,u),a.child;case 8:return Vt(r,a,a.pendingProps.children,u),a.child;case 12:return Vt(r,a,a.pendingProps.children,u),a.child;case 10:return h=a.pendingProps,mr(a,a.type,h.value),Vt(r,a,h.children,u),a.child;case 9:return y=a.type._context,h=a.pendingProps.children,oo(a),y=Ut(y),h=h(y),a.flags|=1,Vt(r,a,h,u),a.child;case 14:return db(r,a,a.type,a.pendingProps,u);case 15:return fb(r,a,a.type,a.pendingProps,u);case 19:return Sb(r,a,u);case 31:return vR(r,a,u);case 22:return hb(r,a,u,a.pendingProps);case 24:return oo(a),h=Ut(xt),r===null?(y=ah(),y===null&&(y=it,b=rh(),y.pooledCache=b,b.refCount++,b!==null&&(y.pooledCacheLanes|=u),y=b),a.memoizedState={parent:h,cache:y},lh(a),mr(a,xt,y)):((r.lanes&u)!==0&&(uh(r,a),ks(a,null,null,u),Es()),y=r.memoizedState,b=a.memoizedState,y.parent!==h?(y={parent:h,cache:h},a.memoizedState=y,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=y),mr(a,xt,h)):(h=b.cache,mr(a,xt,h),h!==y.cache&&ih(a,[xt],u,!0))),Vt(r,a,a.pendingProps.children,u),a.child;case 29:throw a.pendingProps}throw Error(i(156,a.tag))}function Pi(r){r.flags|=4}function Gh(r,a,u,h,y){if((a=(r.mode&32)!==0)&&(a=!1),a){if(r.flags|=16777216,(y&335544128)===y)if(r.stateNode.complete)r.flags|=8192;else if(Xb())r.flags|=8192;else throw lo=vu,sh}else r.flags&=-16777217}function Cb(r,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Hx(a))if(Xb())r.flags|=8192;else throw lo=vu,sh}function Nu(r,a){a!==null&&(r.flags|=4),r.flags&16384&&(a=r.tag!==22?n0():536870912,r.lanes|=a,Sa|=a)}function Ds(r,a){if(!Be)switch(r.tailMode){case"hidden":a=r.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.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?a||r.tail===null?r.tail=null:r.tail.sibling=null:h.sibling=null}}function ct(r){var a=r.alternate!==null&&r.alternate.child===r.child,u=0,h=0;if(a)for(var y=r.child;y!==null;)u|=y.lanes|y.childLanes,h|=y.subtreeFlags&65011712,h|=y.flags&65011712,y.return=r,y=y.sibling;else for(y=r.child;y!==null;)u|=y.lanes|y.childLanes,h|=y.subtreeFlags,h|=y.flags,y.return=r,y=y.sibling;return r.subtreeFlags|=h,r.childLanes=u,a}function xR(r,a,u){var h=a.pendingProps;switch(Zf(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ct(a),null;case 1:return ct(a),null;case 3:return u=a.stateNode,h=null,r!==null&&(h=r.memoizedState.cache),a.memoizedState.cache!==h&&(a.flags|=2048),Mi(xt),ge(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(r===null||r.child===null)&&(la(a)?Pi(a):r===null||r.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,eh())),ct(a),null;case 26:var y=a.type,b=a.memoizedState;return r===null?(Pi(a),b!==null?(ct(a),Cb(a,b)):(ct(a),Gh(a,y,null,h,u))):b?b!==r.memoizedState?(Pi(a),ct(a),Cb(a,b)):(ct(a),a.flags&=-16777217):(r=r.memoizedProps,r!==h&&Pi(a),ct(a),Gh(a,y,r,h,u)),null;case 27:if(Ge(a),u=le.current,y=a.type,r!==null&&a.stateNode!=null)r.memoizedProps!==h&&Pi(a);else{if(!h){if(a.stateNode===null)throw Error(i(166));return ct(a),null}r=se.current,la(a)?nv(a):(r=Rx(y,h,u),a.stateNode=r,Pi(a))}return ct(a),null;case 5:if(Ge(a),y=a.type,r!==null&&a.stateNode!=null)r.memoizedProps!==h&&Pi(a);else{if(!h){if(a.stateNode===null)throw Error(i(166));return ct(a),null}if(b=se.current,la(a))nv(a);else{var E=Ku(le.current);switch(b){case 1:b=E.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:b=E.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":b=E.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":b=E.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":b=E.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof h.is=="string"?E.createElement("select",{is:h.is}):E.createElement("select"),h.multiple?b.multiple=!0:h.size&&(b.size=h.size);break;default:b=typeof h.is=="string"?E.createElement(y,{is:h.is}):E.createElement(y)}}b[jt]=a,b[sn]=h;e:for(E=a.child;E!==null;){if(E.tag===5||E.tag===6)b.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===a)break e;for(;E.sibling===null;){if(E.return===null||E.return===a)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}a.stateNode=b;e:switch(Ft(b,y,h),y){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&Pi(a)}}return ct(a),Gh(a,a.type,r===null?null:r.memoizedProps,a.pendingProps,u),null;case 6:if(r&&a.stateNode!=null)r.memoizedProps!==h&&Pi(a);else{if(typeof h!="string"&&a.stateNode===null)throw Error(i(166));if(r=le.current,la(a)){if(r=a.stateNode,u=a.memoizedProps,h=null,y=Bt,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}r[jt]=a,r=!!(r.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||bx(r.nodeValue,u)),r||pr(a,!0)}else r=Ku(r).createTextNode(h),r[jt]=a,a.stateNode=r}return ct(a),null;case 31:if(u=a.memoizedState,r===null||r.memoizedState!==null){if(h=la(a),u!==null){if(r===null){if(!h)throw Error(i(318));if(r=a.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(557));r[jt]=a}else io(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;ct(a),r=!1}else u=eh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=u),r=!0;if(!r)return a.flags&256?(Cn(a),a):(Cn(a),null);if((a.flags&128)!==0)throw Error(i(558))}return ct(a),null;case 13:if(h=a.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(y=la(a),h!==null&&h.dehydrated!==null){if(r===null){if(!y)throw Error(i(318));if(y=a.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(i(317));y[jt]=a}else io(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;ct(a),y=!1}else y=eh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=y),y=!0;if(!y)return a.flags&256?(Cn(a),a):(Cn(a),null)}return Cn(a),(a.flags&128)!==0?(a.lanes=u,a):(u=h!==null,r=r!==null&&r.memoizedState!==null,u&&(h=a.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool),b=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(b=h.memoizedState.cachePool.pool),b!==y&&(h.flags|=2048)),u!==r&&u&&(a.child.flags|=8192),Nu(a,a.updateQueue),ct(a),null);case 4:return ge(),r===null&&fp(a.stateNode.containerInfo),ct(a),null;case 10:return Mi(a.type),ct(a),null;case 19:if(Y(gt),h=a.memoizedState,h===null)return ct(a),null;if(y=(a.flags&128)!==0,b=h.rendering,b===null)if(y)Ds(h,!1);else{if(pt!==0||r!==null&&(r.flags&128)!==0)for(r=a.child;r!==null;){if(b=_u(r),b!==null){for(a.flags|=128,Ds(h,!1),r=b.updateQueue,a.updateQueue=r,Nu(a,r),a.subtreeFlags=0,r=u,u=a.child;u!==null;)Q0(u,r),u=u.sibling;return N(gt,gt.current&1|2),Be&&Oi(a,h.treeForkCount),a.child}r=r.sibling}h.tail!==null&&Xt()>Bu&&(a.flags|=128,y=!0,Ds(h,!1),a.lanes=4194304)}else{if(!y)if(r=_u(b),r!==null){if(a.flags|=128,y=!0,r=r.updateQueue,a.updateQueue=r,Nu(a,r),Ds(h,!0),h.tail===null&&h.tailMode==="hidden"&&!b.alternate&&!Be)return ct(a),null}else 2*Xt()-h.renderingStartTime>Bu&&u!==536870912&&(a.flags|=128,y=!0,Ds(h,!1),a.lanes=4194304);h.isBackwards?(b.sibling=a.child,a.child=b):(r=h.last,r!==null?r.sibling=b:a.child=b,h.last=b)}return h.tail!==null?(r=h.tail,h.rendering=r,h.tail=r.sibling,h.renderingStartTime=Xt(),r.sibling=null,u=gt.current,N(gt,y?u&1|2:u&1),Be&&Oi(a,h.treeForkCount),r):(ct(a),null);case 22:case 23:return Cn(a),hh(),h=a.memoizedState!==null,r!==null?r.memoizedState!==null!==h&&(a.flags|=8192):h&&(a.flags|=8192),h?(u&536870912)!==0&&(a.flags&128)===0&&(ct(a),a.subtreeFlags&6&&(a.flags|=8192)):ct(a),u=a.updateQueue,u!==null&&Nu(a,u.retryQueue),u=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),h=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),h!==u&&(a.flags|=2048),r!==null&&Y(ao),null;case 24:return u=null,r!==null&&(u=r.memoizedState.cache),a.memoizedState.cache!==u&&(a.flags|=2048),Mi(xt),ct(a),null;case 25:return null;case 30:return null}throw Error(i(156,a.tag))}function SR(r,a){switch(Zf(a),a.tag){case 1:return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 3:return Mi(xt),ge(),r=a.flags,(r&65536)!==0&&(r&128)===0?(a.flags=r&-65537|128,a):null;case 26:case 27:case 5:return Ge(a),null;case 31:if(a.memoizedState!==null){if(Cn(a),a.alternate===null)throw Error(i(340));io()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 13:if(Cn(a),r=a.memoizedState,r!==null&&r.dehydrated!==null){if(a.alternate===null)throw Error(i(340));io()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 19:return Y(gt),null;case 4:return ge(),null;case 10:return Mi(a.type),null;case 22:case 23:return Cn(a),hh(),r!==null&&Y(ao),r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 24:return Mi(xt),null;case 25:return null;default:return null}}function wb(r,a){switch(Zf(a),a.tag){case 3:Mi(xt),ge();break;case 26:case 27:case 5:Ge(a);break;case 4:ge();break;case 31:a.memoizedState!==null&&Cn(a);break;case 13:Cn(a);break;case 19:Y(gt);break;case 10:Mi(a.type);break;case 22:case 23:Cn(a),hh(),r!==null&&Y(ao);break;case 24:Mi(xt)}}function Ms(r,a){try{var u=a.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var y=h.next;u=y;do{if((u.tag&r)===r){h=void 0;var b=u.create,E=u.inst;h=b(),E.destroy=h}u=u.next}while(u!==y)}}catch(L){Ke(a,a.return,L)}}function Sr(r,a,u){try{var h=a.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var b=y.next;h=b;do{if((h.tag&r)===r){var E=h.inst,L=E.destroy;if(L!==void 0){E.destroy=void 0,y=a;var U=u,K=L;try{K()}catch(ie){Ke(y,U,ie)}}}h=h.next}while(h!==b)}}catch(ie){Ke(a,a.return,ie)}}function Eb(r){var a=r.updateQueue;if(a!==null){var u=r.stateNode;try{mv(a,u)}catch(h){Ke(r,r.return,h)}}}function kb(r,a,u){u.props=fo(r.type,r.memoizedProps),u.state=r.memoizedState;try{u.componentWillUnmount()}catch(h){Ke(r,a,h)}}function Is(r,a){try{var u=r.ref;if(u!==null){switch(r.tag){case 26:case 27:case 5:var h=r.stateNode;break;case 30:h=r.stateNode;break;default:h=r.stateNode}typeof u=="function"?r.refCleanup=u(h):u.current=h}}catch(y){Ke(r,a,y)}}function ai(r,a){var u=r.ref,h=r.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(y){Ke(r,a,y)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){Ke(r,a,y)}else u.current=null}function Tb(r){var a=r.type,u=r.memoizedProps,h=r.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(y){Ke(r,r.return,y)}}function $h(r,a,u){try{var h=r.stateNode;FR(h,r.type,u,a),h[sn]=a}catch(y){Ke(r,r.return,y)}}function Ab(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Ar(r.type)||r.tag===4}function qh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Ab(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.tag===27&&Ar(r.type)||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 Wh(r,a,u){var h=r.tag;if(h===5||h===6)r=r.stateNode,a?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(r,a):(a=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,a.appendChild(r),u=u._reactRootContainer,u!=null||a.onclick!==null||(a.onclick=Ai));else if(h!==4&&(h===27&&Ar(r.type)&&(u=r.stateNode,a=null),r=r.child,r!==null))for(Wh(r,a,u),r=r.sibling;r!==null;)Wh(r,a,u),r=r.sibling}function zu(r,a,u){var h=r.tag;if(h===5||h===6)r=r.stateNode,a?u.insertBefore(r,a):u.appendChild(r);else if(h!==4&&(h===27&&Ar(r.type)&&(u=r.stateNode),r=r.child,r!==null))for(zu(r,a,u),r=r.sibling;r!==null;)zu(r,a,u),r=r.sibling}function Lb(r){var a=r.stateNode,u=r.memoizedProps;try{for(var h=r.type,y=a.attributes;y.length;)a.removeAttributeNode(y[0]);Ft(a,h,u),a[jt]=r,a[sn]=u}catch(b){Ke(r,r.return,b)}}var Hi=!1,Ct=!1,Yh=!1,Rb=typeof WeakSet=="function"?WeakSet:Set,It=null;function _R(r,a){if(r=r.containerInfo,mp=ic,r=V0(r),Uf(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 y=h.anchorOffset,b=h.focusNode;h=h.focusOffset;try{u.nodeType,b.nodeType}catch{u=null;break e}var E=0,L=-1,U=-1,K=0,ie=0,ae=r,J=null;t:for(;;){for(var ne;ae!==u||y!==0&&ae.nodeType!==3||(L=E+y),ae!==b||h!==0&&ae.nodeType!==3||(U=E+h),ae.nodeType===3&&(E+=ae.nodeValue.length),(ne=ae.firstChild)!==null;)J=ae,ae=ne;for(;;){if(ae===r)break t;if(J===u&&++K===y&&(L=E),J===b&&++ie===h&&(U=E),(ne=ae.nextSibling)!==null)break;ae=J,J=ae.parentNode}ae=ne}u=L===-1||U===-1?null:{start:L,end:U}}else u=null}u=u||{start:0,end:0}}else u=null;for(gp={focusedElem:r,selectionRange:u},ic=!1,It=a;It!==null;)if(a=It,r=a.child,(a.subtreeFlags&1028)!==0&&r!==null)r.return=a,It=r;else for(;It!==null;){switch(a=It,b=a.alternate,r=a.flags,a.tag){case 0:if((r&4)!==0&&(r=a.updateQueue,r=r!==null?r.events:null,r!==null))for(u=0;u<r.length;u++)y=r[u],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&b!==null){r=void 0,u=a,y=b.memoizedProps,b=b.memoizedState,h=u.stateNode;try{var ve=fo(u.type,y);r=h.getSnapshotBeforeUpdate(ve,b),h.__reactInternalSnapshotBeforeUpdate=r}catch(_e){Ke(u,u.return,_e)}}break;case 3:if((r&1024)!==0){if(r=a.stateNode.containerInfo,u=r.nodeType,u===9)bp(r);else if(u===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":bp(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(i(163))}if(r=a.sibling,r!==null){r.return=a.return,It=r;break}It=a.return}}function Ob(r,a,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:Bi(r,u),h&4&&Ms(5,u);break;case 1:if(Bi(r,u),h&4)if(r=u.stateNode,a===null)try{r.componentDidMount()}catch(E){Ke(u,u.return,E)}else{var y=fo(u.type,a.memoizedProps);a=a.memoizedState;try{r.componentDidUpdate(y,a,r.__reactInternalSnapshotBeforeUpdate)}catch(E){Ke(u,u.return,E)}}h&64&&Eb(u),h&512&&Is(u,u.return);break;case 3:if(Bi(r,u),h&64&&(r=u.updateQueue,r!==null)){if(a=null,u.child!==null)switch(u.child.tag){case 27:case 5:a=u.child.stateNode;break;case 1:a=u.child.stateNode}try{mv(r,a)}catch(E){Ke(u,u.return,E)}}break;case 27:a===null&&h&4&&Lb(u);case 26:case 5:Bi(r,u),a===null&&h&4&&Tb(u),h&512&&Is(u,u.return);break;case 12:Bi(r,u);break;case 31:Bi(r,u),h&4&&Ib(r,u);break;case 13:Bi(r,u),h&4&&Nb(r,u),h&64&&(r=u.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(u=OR.bind(null,u),QR(r,u))));break;case 22:if(h=u.memoizedState!==null||Hi,!h){a=a!==null&&a.memoizedState!==null||Ct,y=Hi;var b=Ct;Hi=h,(Ct=a)&&!b?Ui(r,u,(u.subtreeFlags&8772)!==0):Bi(r,u),Hi=y,Ct=b}break;case 30:break;default:Bi(r,u)}}function Db(r){var a=r.alternate;a!==null&&(r.alternate=null,Db(a)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(a=r.stateNode,a!==null&&wf(a)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var dt=null,un=!1;function ji(r,a,u){for(u=u.child;u!==null;)Mb(r,a,u),u=u.sibling}function Mb(r,a,u){if(kt&&typeof kt.onCommitFiberUnmount=="function")try{kt.onCommitFiberUnmount(Kt,u)}catch{}switch(u.tag){case 26:Ct||ai(u,a),ji(r,a,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Ct||ai(u,a);var h=dt,y=un;Ar(u.type)&&(dt=u.stateNode,un=!1),ji(r,a,u),Fs(u.stateNode),dt=h,un=y;break;case 5:Ct||ai(u,a);case 6:if(h=dt,y=un,dt=null,ji(r,a,u),dt=h,un=y,dt!==null)if(un)try{(dt.nodeType===9?dt.body:dt.nodeName==="HTML"?dt.ownerDocument.body:dt).removeChild(u.stateNode)}catch(b){Ke(u,a,b)}else try{dt.removeChild(u.stateNode)}catch(b){Ke(u,a,b)}break;case 18:dt!==null&&(un?(r=dt,Ex(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,u.stateNode),La(r)):Ex(dt,u.stateNode));break;case 4:h=dt,y=un,dt=u.stateNode.containerInfo,un=!0,ji(r,a,u),dt=h,un=y;break;case 0:case 11:case 14:case 15:Sr(2,u,a),Ct||Sr(4,u,a),ji(r,a,u);break;case 1:Ct||(ai(u,a),h=u.stateNode,typeof h.componentWillUnmount=="function"&&kb(u,a,h)),ji(r,a,u);break;case 21:ji(r,a,u);break;case 22:Ct=(h=Ct)||u.memoizedState!==null,ji(r,a,u),Ct=h;break;default:ji(r,a,u)}}function Ib(r,a){if(a.memoizedState===null&&(r=a.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{La(r)}catch(u){Ke(a,a.return,u)}}}function Nb(r,a){if(a.memoizedState===null&&(r=a.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{La(r)}catch(u){Ke(a,a.return,u)}}function CR(r){switch(r.tag){case 31:case 13:case 19:var a=r.stateNode;return a===null&&(a=r.stateNode=new Rb),a;case 22:return r=r.stateNode,a=r._retryCache,a===null&&(a=r._retryCache=new Rb),a;default:throw Error(i(435,r.tag))}}function Pu(r,a){var u=CR(r);a.forEach(function(h){if(!u.has(h)){u.add(h);var y=DR.bind(null,r,h);h.then(y,y)}})}function cn(r,a){var u=a.deletions;if(u!==null)for(var h=0;h<u.length;h++){var y=u[h],b=r,E=a,L=E;e:for(;L!==null;){switch(L.tag){case 27:if(Ar(L.type)){dt=L.stateNode,un=!1;break e}break;case 5:dt=L.stateNode,un=!1;break e;case 3:case 4:dt=L.stateNode.containerInfo,un=!0;break e}L=L.return}if(dt===null)throw Error(i(160));Mb(b,E,y),dt=null,un=!1,b=y.alternate,b!==null&&(b.return=null),y.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)zb(a,r),a=a.sibling}var Yn=null;function zb(r,a){var u=r.alternate,h=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:cn(a,r),dn(r),h&4&&(Sr(3,r,r.return),Ms(3,r),Sr(5,r,r.return));break;case 1:cn(a,r),dn(r),h&512&&(Ct||u===null||ai(u,u.return)),h&64&&Hi&&(r=r.updateQueue,r!==null&&(h=r.callbacks,h!==null&&(u=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var y=Yn;if(cn(a,r),dn(r),h&512&&(Ct||u===null||ai(u,u.return)),h&4){var b=u!==null?u.memoizedState:null;if(h=r.memoizedState,u===null)if(h===null)if(r.stateNode===null){e:{h=r.type,u=r.memoizedProps,y=y.ownerDocument||y;t:switch(h){case"title":b=y.getElementsByTagName("title")[0],(!b||b[ss]||b[jt]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=y.createElement(h),y.head.insertBefore(b,y.querySelector("head > title"))),Ft(b,h,u),b[jt]=r,Mt(b),h=b;break e;case"link":var E=zx("link","href",y).get(h+(u.href||""));if(E){for(var L=0;L<E.length;L++)if(b=E[L],b.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&b.getAttribute("rel")===(u.rel==null?null:u.rel)&&b.getAttribute("title")===(u.title==null?null:u.title)&&b.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){E.splice(L,1);break t}}b=y.createElement(h),Ft(b,h,u),y.head.appendChild(b);break;case"meta":if(E=zx("meta","content",y).get(h+(u.content||""))){for(L=0;L<E.length;L++)if(b=E[L],b.getAttribute("content")===(u.content==null?null:""+u.content)&&b.getAttribute("name")===(u.name==null?null:u.name)&&b.getAttribute("property")===(u.property==null?null:u.property)&&b.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&b.getAttribute("charset")===(u.charSet==null?null:u.charSet)){E.splice(L,1);break t}}b=y.createElement(h),Ft(b,h,u),y.head.appendChild(b);break;default:throw Error(i(468,h))}b[jt]=r,Mt(b),h=b}r.stateNode=h}else Px(y,r.type,r.stateNode);else r.stateNode=Nx(y,h,r.memoizedProps);else b!==h?(b===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):b.count--,h===null?Px(y,r.type,r.stateNode):Nx(y,h,r.memoizedProps)):h===null&&r.stateNode!==null&&$h(r,r.memoizedProps,u.memoizedProps)}break;case 27:cn(a,r),dn(r),h&512&&(Ct||u===null||ai(u,u.return)),u!==null&&h&4&&$h(r,r.memoizedProps,u.memoizedProps);break;case 5:if(cn(a,r),dn(r),h&512&&(Ct||u===null||ai(u,u.return)),r.flags&32){y=r.stateNode;try{Zo(y,"")}catch(ve){Ke(r,r.return,ve)}}h&4&&r.stateNode!=null&&(y=r.memoizedProps,$h(r,y,u!==null?u.memoizedProps:y)),h&1024&&(Yh=!0);break;case 6:if(cn(a,r),dn(r),h&4){if(r.stateNode===null)throw Error(i(162));h=r.memoizedProps,u=r.stateNode;try{u.nodeValue=h}catch(ve){Ke(r,r.return,ve)}}break;case 3:if(Ju=null,y=Yn,Yn=Qu(a.containerInfo),cn(a,r),Yn=y,dn(r),h&4&&u!==null&&u.memoizedState.isDehydrated)try{La(a.containerInfo)}catch(ve){Ke(r,r.return,ve)}Yh&&(Yh=!1,Pb(r));break;case 4:h=Yn,Yn=Qu(r.stateNode.containerInfo),cn(a,r),dn(r),Yn=h;break;case 12:cn(a,r),dn(r);break;case 31:cn(a,r),dn(r),h&4&&(h=r.updateQueue,h!==null&&(r.updateQueue=null,Pu(r,h)));break;case 13:cn(a,r),dn(r),r.child.flags&8192&&r.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(ju=Xt()),h&4&&(h=r.updateQueue,h!==null&&(r.updateQueue=null,Pu(r,h)));break;case 22:y=r.memoizedState!==null;var U=u!==null&&u.memoizedState!==null,K=Hi,ie=Ct;if(Hi=K||y,Ct=ie||U,cn(a,r),Ct=ie,Hi=K,dn(r),h&8192)e:for(a=r.stateNode,a._visibility=y?a._visibility&-2:a._visibility|1,y&&(u===null||U||Hi||Ct||ho(r)),u=null,a=r;;){if(a.tag===5||a.tag===26){if(u===null){U=u=a;try{if(b=U.stateNode,y)E=b.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{L=U.stateNode;var ae=U.memoizedProps.style,J=ae!=null&&ae.hasOwnProperty("display")?ae.display:null;L.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(ve){Ke(U,U.return,ve)}}}else if(a.tag===6){if(u===null){U=a;try{U.stateNode.nodeValue=y?"":U.memoizedProps}catch(ve){Ke(U,U.return,ve)}}}else if(a.tag===18){if(u===null){U=a;try{var ne=U.stateNode;y?kx(ne,!0):kx(U.stateNode,!1)}catch(ve){Ke(U,U.return,ve)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===r)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break e;for(;a.sibling===null;){if(a.return===null||a.return===r)break e;u===a&&(u=null),a=a.return}u===a&&(u=null),a.sibling.return=a.return,a=a.sibling}h&4&&(h=r.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,Pu(r,u))));break;case 19:cn(a,r),dn(r),h&4&&(h=r.updateQueue,h!==null&&(r.updateQueue=null,Pu(r,h)));break;case 30:break;case 21:break;default:cn(a,r),dn(r)}}function dn(r){var a=r.flags;if(a&2){try{for(var u,h=r.return;h!==null;){if(Ab(h)){u=h;break}h=h.return}if(u==null)throw Error(i(160));switch(u.tag){case 27:var y=u.stateNode,b=qh(r);zu(r,b,y);break;case 5:var E=u.stateNode;u.flags&32&&(Zo(E,""),u.flags&=-33);var L=qh(r);zu(r,L,E);break;case 3:case 4:var U=u.stateNode.containerInfo,K=qh(r);Wh(r,K,U);break;default:throw Error(i(161))}}catch(ie){Ke(r,r.return,ie)}r.flags&=-3}a&4096&&(r.flags&=-4097)}function Pb(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var a=r;Pb(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),r=r.sibling}}function Bi(r,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)Ob(r,a.alternate,a),a=a.sibling}function ho(r){for(r=r.child;r!==null;){var a=r;switch(a.tag){case 0:case 11:case 14:case 15:Sr(4,a,a.return),ho(a);break;case 1:ai(a,a.return);var u=a.stateNode;typeof u.componentWillUnmount=="function"&&kb(a,a.return,u),ho(a);break;case 27:Fs(a.stateNode);case 26:case 5:ai(a,a.return),ho(a);break;case 22:a.memoizedState===null&&ho(a);break;case 30:ho(a);break;default:ho(a)}r=r.sibling}}function Ui(r,a,u){for(u=u&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var h=a.alternate,y=r,b=a,E=b.flags;switch(b.tag){case 0:case 11:case 15:Ui(y,b,u),Ms(4,b);break;case 1:if(Ui(y,b,u),h=b,y=h.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(K){Ke(h,h.return,K)}if(h=b,y=h.updateQueue,y!==null){var L=h.stateNode;try{var U=y.shared.hiddenCallbacks;if(U!==null)for(y.shared.hiddenCallbacks=null,y=0;y<U.length;y++)pv(U[y],L)}catch(K){Ke(h,h.return,K)}}u&&E&64&&Eb(b),Is(b,b.return);break;case 27:Lb(b);case 26:case 5:Ui(y,b,u),u&&h===null&&E&4&&Tb(b),Is(b,b.return);break;case 12:Ui(y,b,u);break;case 31:Ui(y,b,u),u&&E&4&&Ib(y,b);break;case 13:Ui(y,b,u),u&&E&4&&Nb(y,b);break;case 22:b.memoizedState===null&&Ui(y,b,u),Is(b,b.return);break;case 30:break;default:Ui(y,b,u)}a=a.sibling}}function Xh(r,a){var u=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==u&&(r!=null&&r.refCount++,u!=null&&xs(u))}function Kh(r,a){r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&xs(r))}function Xn(r,a,u,h){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Hb(r,a,u,h),a=a.sibling}function Hb(r,a,u,h){var y=a.flags;switch(a.tag){case 0:case 11:case 15:Xn(r,a,u,h),y&2048&&Ms(9,a);break;case 1:Xn(r,a,u,h);break;case 3:Xn(r,a,u,h),y&2048&&(r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&xs(r)));break;case 12:if(y&2048){Xn(r,a,u,h),r=a.stateNode;try{var b=a.memoizedProps,E=b.id,L=b.onPostCommit;typeof L=="function"&&L(E,a.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(U){Ke(a,a.return,U)}}else Xn(r,a,u,h);break;case 31:Xn(r,a,u,h);break;case 13:Xn(r,a,u,h);break;case 23:break;case 22:b=a.stateNode,E=a.alternate,a.memoizedState!==null?b._visibility&2?Xn(r,a,u,h):Ns(r,a):b._visibility&2?Xn(r,a,u,h):(b._visibility|=2,va(r,a,u,h,(a.subtreeFlags&10256)!==0||!1)),y&2048&&Xh(E,a);break;case 24:Xn(r,a,u,h),y&2048&&Kh(a.alternate,a);break;default:Xn(r,a,u,h)}}function va(r,a,u,h,y){for(y=y&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var b=r,E=a,L=u,U=h,K=E.flags;switch(E.tag){case 0:case 11:case 15:va(b,E,L,U,y),Ms(8,E);break;case 23:break;case 22:var ie=E.stateNode;E.memoizedState!==null?ie._visibility&2?va(b,E,L,U,y):Ns(b,E):(ie._visibility|=2,va(b,E,L,U,y)),y&&K&2048&&Xh(E.alternate,E);break;case 24:va(b,E,L,U,y),y&&K&2048&&Kh(E.alternate,E);break;default:va(b,E,L,U,y)}a=a.sibling}}function Ns(r,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var u=r,h=a,y=h.flags;switch(h.tag){case 22:Ns(u,h),y&2048&&Xh(h.alternate,h);break;case 24:Ns(u,h),y&2048&&Kh(h.alternate,h);break;default:Ns(u,h)}a=a.sibling}}var zs=8192;function ba(r,a,u){if(r.subtreeFlags&zs)for(r=r.child;r!==null;)jb(r,a,u),r=r.sibling}function jb(r,a,u){switch(r.tag){case 26:ba(r,a,u),r.flags&zs&&r.memoizedState!==null&&uO(u,Yn,r.memoizedState,r.memoizedProps);break;case 5:ba(r,a,u);break;case 3:case 4:var h=Yn;Yn=Qu(r.stateNode.containerInfo),ba(r,a,u),Yn=h;break;case 22:r.memoizedState===null&&(h=r.alternate,h!==null&&h.memoizedState!==null?(h=zs,zs=16777216,ba(r,a,u),zs=h):ba(r,a,u));break;default:ba(r,a,u)}}function Bb(r){var a=r.alternate;if(a!==null&&(r=a.child,r!==null)){a.child=null;do a=r.sibling,r.sibling=null,r=a;while(r!==null)}}function Ps(r){var a=r.deletions;if((r.flags&16)!==0){if(a!==null)for(var u=0;u<a.length;u++){var h=a[u];It=h,Vb(h,r)}Bb(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Ub(r),r=r.sibling}function Ub(r){switch(r.tag){case 0:case 11:case 15:Ps(r),r.flags&2048&&Sr(9,r,r.return);break;case 3:Ps(r);break;case 12:Ps(r);break;case 22:var a=r.stateNode;r.memoizedState!==null&&a._visibility&2&&(r.return===null||r.return.tag!==13)?(a._visibility&=-3,Hu(r)):Ps(r);break;default:Ps(r)}}function Hu(r){var a=r.deletions;if((r.flags&16)!==0){if(a!==null)for(var u=0;u<a.length;u++){var h=a[u];It=h,Vb(h,r)}Bb(r)}for(r=r.child;r!==null;){switch(a=r,a.tag){case 0:case 11:case 15:Sr(8,a,a.return),Hu(a);break;case 22:u=a.stateNode,u._visibility&2&&(u._visibility&=-3,Hu(a));break;default:Hu(a)}r=r.sibling}}function Vb(r,a){for(;It!==null;){var u=It;switch(u.tag){case 0:case 11:case 15:Sr(8,u,a);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:xs(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,It=h;else e:for(u=r;It!==null;){h=It;var y=h.sibling,b=h.return;if(Db(h),h===u){It=null;break e}if(y!==null){y.return=b,It=y;break e}It=b}}}var wR={getCacheForType:function(r){var a=Ut(xt),u=a.data.get(r);return u===void 0&&(u=r(),a.data.set(r,u)),u},cacheSignal:function(){return Ut(xt).controller.signal}},ER=typeof WeakMap=="function"?WeakMap:Map,$e=0,it=null,Ne=null,Pe=0,Xe=0,wn=null,_r=!1,xa=!1,Qh=!1,Vi=0,pt=0,Cr=0,po=0,Zh=0,En=0,Sa=0,Hs=null,fn=null,Jh=!1,ju=0,Fb=0,Bu=1/0,Uu=null,wr=null,Tt=0,Er=null,_a=null,Fi=0,ep=0,tp=null,Gb=null,js=0,np=null;function kn(){return($e&2)!==0&&Pe!==0?Pe&-Pe:z.T!==null?lp():a0()}function $b(){if(En===0)if((Pe&536870912)===0||Be){var r=Xl;Xl<<=1,(Xl&3932160)===0&&(Xl=262144),En=r}else En=536870912;return r=_n.current,r!==null&&(r.flags|=32),En}function hn(r,a,u){(r===it&&(Xe===2||Xe===9)||r.cancelPendingCommit!==null)&&(Ca(r,0),kr(r,Pe,En,!1)),as(r,u),(($e&2)===0||r!==it)&&(r===it&&(($e&2)===0&&(po|=u),pt===4&&kr(r,Pe,En,!1)),si(r))}function qb(r,a,u){if(($e&6)!==0)throw Error(i(327));var h=!u&&(a&127)===0&&(a&r.expiredLanes)===0||os(r,a),y=h?AR(r,a):rp(r,a,!0),b=h;do{if(y===0){xa&&!h&&kr(r,a,0,!1);break}else{if(u=r.current.alternate,b&&!kR(u)){y=rp(r,a,!1),b=!1;continue}if(y===2){if(b=a,r.errorRecoveryDisabledLanes&b)var E=0;else E=r.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){a=E;e:{var L=r;y=Hs;var U=L.current.memoizedState.isDehydrated;if(U&&(Ca(L,E).flags|=256),E=rp(L,E,!1),E!==2){if(Qh&&!U){L.errorRecoveryDisabledLanes|=b,po|=b,y=4;break e}b=fn,fn=y,b!==null&&(fn===null?fn=b:fn.push.apply(fn,b))}y=E}if(b=!1,y!==2)continue}}if(y===1){Ca(r,0),kr(r,a,0,!0);break}e:{switch(h=r,b=y,b){case 0:case 1:throw Error(i(345));case 4:if((a&4194048)!==a)break;case 6:kr(h,a,En,!_r);break e;case 2:fn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((a&62914560)===a&&(y=ju+300-Xt(),10<y)){if(kr(h,a,En,!_r),Ql(h,0,!0)!==0)break e;Fi=a,h.timeoutHandle=Cx(Wb.bind(null,h,u,fn,Uu,Jh,a,En,po,Sa,_r,b,"Throttled",-0,0),y);break e}Wb(h,u,fn,Uu,Jh,a,En,po,Sa,_r,b,null,-0,0)}}break}while(!0);si(r)}function Wb(r,a,u,h,y,b,E,L,U,K,ie,ae,J,ne){if(r.timeoutHandle=-1,ae=a.subtreeFlags,ae&8192||(ae&16785408)===16785408){ae={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ai},jb(a,b,ae);var ve=(b&62914560)===b?ju-Xt():(b&4194048)===b?Fb-Xt():0;if(ve=cO(ae,ve),ve!==null){Fi=b,r.cancelPendingCommit=ve(tx.bind(null,r,a,b,u,h,y,E,L,U,ie,ae,null,J,ne)),kr(r,b,E,!K);return}}tx(r,a,b,u,h,y,E,L,U)}function kR(r){for(var a=r;;){var u=a.tag;if((u===0||u===11||u===15)&&a.flags&16384&&(u=a.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var h=0;h<u.length;h++){var y=u[h],b=y.getSnapshot;y=y.value;try{if(!xn(b(),y))return!1}catch{return!1}}if(u=a.child,a.subtreeFlags&16384&&u!==null)u.return=a,a=u;else{if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function kr(r,a,u,h){a&=~Zh,a&=~po,r.suspendedLanes|=a,r.pingedLanes&=~a,h&&(r.warmLanes|=a),h=r.expirationTimes;for(var y=a;0<y;){var b=31-nt(y),E=1<<b;h[b]=-1,y&=~E}u!==0&&i0(r,u,a)}function Vu(){return($e&6)===0?(Bs(0),!1):!0}function ip(){if(Ne!==null){if(Xe===0)var r=Ne.return;else r=Ne,Di=ro=null,bh(r),ha=null,_s=0,r=Ne;for(;r!==null;)wb(r.alternate,r),r=r.return;Ne=null}}function Ca(r,a){var u=r.timeoutHandle;u!==-1&&(r.timeoutHandle=-1,qR(u)),u=r.cancelPendingCommit,u!==null&&(r.cancelPendingCommit=null,u()),Fi=0,ip(),it=r,Ne=u=Ri(r.current,null),Pe=a,Xe=0,wn=null,_r=!1,xa=os(r,a),Qh=!1,Sa=En=Zh=po=Cr=pt=0,fn=Hs=null,Jh=!1,(a&8)!==0&&(a|=a&32);var h=r.entangledLanes;if(h!==0)for(r=r.entanglements,h&=a;0<h;){var y=31-nt(h),b=1<<y;a|=r[y],h&=~b}return Vi=a,uu(),u}function Yb(r,a){Re=null,z.H=Rs,a===fa||a===yu?(a=cv(),Xe=3):a===sh?(a=cv(),Xe=4):Xe=a===Nh?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,wn=a,Ne===null&&(pt=1,Ou(r,In(a,r.current)))}function Xb(){var r=_n.current;return r===null?!0:(Pe&4194048)===Pe?Hn===null:(Pe&62914560)===Pe||(Pe&536870912)!==0?r===Hn:!1}function Kb(){var r=z.H;return z.H=Rs,r===null?Rs:r}function Qb(){var r=z.A;return z.A=wR,r}function Fu(){pt=4,_r||(Pe&4194048)!==Pe&&_n.current!==null||(xa=!0),(Cr&134217727)===0&&(po&134217727)===0||it===null||kr(it,Pe,En,!1)}function rp(r,a,u){var h=$e;$e|=2;var y=Kb(),b=Qb();(it!==r||Pe!==a)&&(Uu=null,Ca(r,a)),a=!1;var E=pt;e:do try{if(Xe!==0&&Ne!==null){var L=Ne,U=wn;switch(Xe){case 8:ip(),E=6;break e;case 3:case 2:case 9:case 6:_n.current===null&&(a=!0);var K=Xe;if(Xe=0,wn=null,wa(r,L,U,K),u&&xa){E=0;break e}break;default:K=Xe,Xe=0,wn=null,wa(r,L,U,K)}}TR(),E=pt;break}catch(ie){Yb(r,ie)}while(!0);return a&&r.shellSuspendCounter++,Di=ro=null,$e=h,z.H=y,z.A=b,Ne===null&&(it=null,Pe=0,uu()),E}function TR(){for(;Ne!==null;)Zb(Ne)}function AR(r,a){var u=$e;$e|=2;var h=Kb(),y=Qb();it!==r||Pe!==a?(Uu=null,Bu=Xt()+500,Ca(r,a)):xa=os(r,a);e:do try{if(Xe!==0&&Ne!==null){a=Ne;var b=wn;t:switch(Xe){case 1:Xe=0,wn=null,wa(r,a,b,1);break;case 2:case 9:if(lv(b)){Xe=0,wn=null,Jb(a);break}a=function(){Xe!==2&&Xe!==9||it!==r||(Xe=7),si(r)},b.then(a,a);break e;case 3:Xe=7;break e;case 4:Xe=5;break e;case 7:lv(b)?(Xe=0,wn=null,Jb(a)):(Xe=0,wn=null,wa(r,a,b,7));break;case 5:var E=null;switch(Ne.tag){case 26:E=Ne.memoizedState;case 5:case 27:var L=Ne;if(E?Hx(E):L.stateNode.complete){Xe=0,wn=null;var U=L.sibling;if(U!==null)Ne=U;else{var K=L.return;K!==null?(Ne=K,Gu(K)):Ne=null}break t}}Xe=0,wn=null,wa(r,a,b,5);break;case 6:Xe=0,wn=null,wa(r,a,b,6);break;case 8:ip(),pt=6;break e;default:throw Error(i(462))}}LR();break}catch(ie){Yb(r,ie)}while(!0);return Di=ro=null,z.H=h,z.A=y,$e=u,Ne!==null?0:(it=null,Pe=0,uu(),pt)}function LR(){for(;Ne!==null&&!yf();)Zb(Ne)}function Zb(r){var a=_b(r.alternate,r,Vi);r.memoizedProps=r.pendingProps,a===null?Gu(r):Ne=a}function Jb(r){var a=r,u=a.alternate;switch(a.tag){case 15:case 0:a=gb(u,a,a.pendingProps,a.type,void 0,Pe);break;case 11:a=gb(u,a,a.pendingProps,a.type.render,a.ref,Pe);break;case 5:bh(a);default:wb(u,a),a=Ne=Q0(a,Vi),a=_b(u,a,Vi)}r.memoizedProps=r.pendingProps,a===null?Gu(r):Ne=a}function wa(r,a,u,h){Di=ro=null,bh(a),ha=null,_s=0;var y=a.return;try{if(yR(r,y,a,u,Pe)){pt=1,Ou(r,In(u,r.current)),Ne=null;return}}catch(b){if(y!==null)throw Ne=y,b;pt=1,Ou(r,In(u,r.current)),Ne=null;return}a.flags&32768?(Be||h===1?r=!0:xa||(Pe&536870912)!==0?r=!1:(_r=r=!0,(h===2||h===9||h===3||h===6)&&(h=_n.current,h!==null&&h.tag===13&&(h.flags|=16384))),ex(a,r)):Gu(a)}function Gu(r){var a=r;do{if((a.flags&32768)!==0){ex(a,_r);return}r=a.return;var u=xR(a.alternate,a,Vi);if(u!==null){Ne=u;return}if(a=a.sibling,a!==null){Ne=a;return}Ne=a=r}while(a!==null);pt===0&&(pt=5)}function ex(r,a){do{var u=SR(r.alternate,r);if(u!==null){u.flags&=32767,Ne=u;return}if(u=r.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!a&&(r=r.sibling,r!==null)){Ne=r;return}Ne=r=u}while(r!==null);pt=6,Ne=null}function tx(r,a,u,h,y,b,E,L,U){r.cancelPendingCommit=null;do $u();while(Tt!==0);if(($e&6)!==0)throw Error(i(327));if(a!==null){if(a===r.current)throw Error(i(177));if(b=a.lanes|a.childLanes,b|=qf,lL(r,u,b,E,L,U),r===it&&(Ne=it=null,Pe=0),_a=a,Er=r,Fi=u,ep=b,tp=y,Gb=h,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,MR(Ce,function(){return ax(),null})):(r.callbackNode=null,r.callbackPriority=0),h=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||h){h=z.T,z.T=null,y=q.p,q.p=2,E=$e,$e|=4;try{_R(r,a,u)}finally{$e=E,q.p=y,z.T=h}}Tt=1,nx(),ix(),rx()}}function nx(){if(Tt===1){Tt=0;var r=Er,a=_a,u=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||u){u=z.T,z.T=null;var h=q.p;q.p=2;var y=$e;$e|=4;try{zb(a,r);var b=gp,E=V0(r.containerInfo),L=b.focusedElem,U=b.selectionRange;if(E!==L&&L&&L.ownerDocument&&U0(L.ownerDocument.documentElement,L)){if(U!==null&&Uf(L)){var K=U.start,ie=U.end;if(ie===void 0&&(ie=K),"selectionStart"in L)L.selectionStart=K,L.selectionEnd=Math.min(ie,L.value.length);else{var ae=L.ownerDocument||document,J=ae&&ae.defaultView||window;if(J.getSelection){var ne=J.getSelection(),ve=L.textContent.length,_e=Math.min(U.start,ve),et=U.end===void 0?_e:Math.min(U.end,ve);!ne.extend&&_e>et&&(E=et,et=_e,_e=E);var $=B0(L,_e),V=B0(L,et);if($&&V&&(ne.rangeCount!==1||ne.anchorNode!==$.node||ne.anchorOffset!==$.offset||ne.focusNode!==V.node||ne.focusOffset!==V.offset)){var X=ae.createRange();X.setStart($.node,$.offset),ne.removeAllRanges(),_e>et?(ne.addRange(X),ne.extend(V.node,V.offset)):(X.setEnd(V.node,V.offset),ne.addRange(X))}}}}for(ae=[],ne=L;ne=ne.parentNode;)ne.nodeType===1&&ae.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<ae.length;L++){var oe=ae[L];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}ic=!!mp,gp=mp=null}finally{$e=y,q.p=h,z.T=u}}r.current=a,Tt=2}}function ix(){if(Tt===2){Tt=0;var r=Er,a=_a,u=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||u){u=z.T,z.T=null;var h=q.p;q.p=2;var y=$e;$e|=4;try{Ob(r,a.alternate,a)}finally{$e=y,q.p=h,z.T=u}}Tt=3}}function rx(){if(Tt===4||Tt===3){Tt=0,vf();var r=Er,a=_a,u=Fi,h=Gb;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?Tt=5:(Tt=0,_a=Er=null,ox(r,r.pendingLanes));var y=r.pendingLanes;if(y===0&&(wr=null),_f(u),a=a.stateNode,kt&&typeof kt.onCommitFiberRoot=="function")try{kt.onCommitFiberRoot(Kt,a,void 0,(a.current.flags&128)===128)}catch{}if(h!==null){a=z.T,y=q.p,q.p=2,z.T=null;try{for(var b=r.onRecoverableError,E=0;E<h.length;E++){var L=h[E];b(L.value,{componentStack:L.stack})}}finally{z.T=a,q.p=y}}(Fi&3)!==0&&$u(),si(r),y=r.pendingLanes,(u&261930)!==0&&(y&42)!==0?r===np?js++:(js=0,np=r):js=0,Bs(0)}}function ox(r,a){(r.pooledCacheLanes&=a)===0&&(a=r.pooledCache,a!=null&&(r.pooledCache=null,xs(a)))}function $u(){return nx(),ix(),rx(),ax()}function ax(){if(Tt!==5)return!1;var r=Er,a=ep;ep=0;var u=_f(Fi),h=z.T,y=q.p;try{q.p=32>u?32:u,z.T=null,u=tp,tp=null;var b=Er,E=Fi;if(Tt=0,_a=Er=null,Fi=0,($e&6)!==0)throw Error(i(331));var L=$e;if($e|=4,Ub(b.current),Hb(b,b.current,E,u),$e=L,Bs(0,!1),kt&&typeof kt.onPostCommitFiberRoot=="function")try{kt.onPostCommitFiberRoot(Kt,b)}catch{}return!0}finally{q.p=y,z.T=h,ox(r,a)}}function sx(r,a,u){a=In(u,a),a=Ih(r.stateNode,a,2),r=vr(r,a,2),r!==null&&(as(r,2),si(r))}function Ke(r,a,u){if(r.tag===3)sx(r,r,u);else for(;a!==null;){if(a.tag===3){sx(a,r,u);break}else if(a.tag===1){var h=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(wr===null||!wr.has(h))){r=In(u,r),u=lb(2),h=vr(a,u,2),h!==null&&(ub(u,h,a,r),as(h,2),si(h));break}}a=a.return}}function op(r,a,u){var h=r.pingCache;if(h===null){h=r.pingCache=new ER;var y=new Set;h.set(a,y)}else y=h.get(a),y===void 0&&(y=new Set,h.set(a,y));y.has(u)||(Qh=!0,y.add(u),r=RR.bind(null,r,a,u),a.then(r,r))}function RR(r,a,u){var h=r.pingCache;h!==null&&h.delete(a),r.pingedLanes|=r.suspendedLanes&u,r.warmLanes&=~u,it===r&&(Pe&u)===u&&(pt===4||pt===3&&(Pe&62914560)===Pe&&300>Xt()-ju?($e&2)===0&&Ca(r,0):Zh|=u,Sa===Pe&&(Sa=0)),si(r)}function lx(r,a){a===0&&(a=n0()),r=to(r,a),r!==null&&(as(r,a),si(r))}function OR(r){var a=r.memoizedState,u=0;a!==null&&(u=a.retryLane),lx(r,u)}function DR(r,a){var u=0;switch(r.tag){case 31:case 13:var h=r.stateNode,y=r.memoizedState;y!==null&&(u=y.retryLane);break;case 19:h=r.stateNode;break;case 22:h=r.stateNode._retryCache;break;default:throw Error(i(314))}h!==null&&h.delete(a),lx(r,u)}function MR(r,a){return mt(r,a)}var qu=null,Ea=null,ap=!1,Wu=!1,sp=!1,Tr=0;function si(r){r!==Ea&&r.next===null&&(Ea===null?qu=Ea=r:Ea=Ea.next=r),Wu=!0,ap||(ap=!0,NR())}function Bs(r,a){if(!sp&&Wu){sp=!0;do for(var u=!1,h=qu;h!==null;){if(r!==0){var y=h.pendingLanes;if(y===0)var b=0;else{var E=h.suspendedLanes,L=h.pingedLanes;b=(1<<31-nt(42|r)+1)-1,b&=y&~(E&~L),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(u=!0,fx(h,b))}else b=Pe,b=Ql(h,h===it?b:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(b&3)===0||os(h,b)||(u=!0,fx(h,b));h=h.next}while(u);sp=!1}}function IR(){ux()}function ux(){Wu=ap=!1;var r=0;Tr!==0&&$R()&&(r=Tr);for(var a=Xt(),u=null,h=qu;h!==null;){var y=h.next,b=cx(h,a);b===0?(h.next=null,u===null?qu=y:u.next=y,y===null&&(Ea=u)):(u=h,(r!==0||(b&3)!==0)&&(Wu=!0)),h=y}Tt!==0&&Tt!==5||Bs(r),Tr!==0&&(Tr=0)}function cx(r,a){for(var u=r.suspendedLanes,h=r.pingedLanes,y=r.expirationTimes,b=r.pendingLanes&-62914561;0<b;){var E=31-nt(b),L=1<<E,U=y[E];U===-1?((L&u)===0||(L&h)!==0)&&(y[E]=sL(L,a)):U<=a&&(r.expiredLanes|=L),b&=~L}if(a=it,u=Pe,u=Ql(r,r===a?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),h=r.callbackNode,u===0||r===a&&(Xe===2||Xe===9)||r.cancelPendingCommit!==null)return h!==null&&h!==null&&ii(h),r.callbackNode=null,r.callbackPriority=0;if((u&3)===0||os(r,u)){if(a=u&-u,a===r.callbackPriority)return a;switch(h!==null&&ii(h),_f(u)){case 2:case 8:u=fe;break;case 32:u=Ce;break;case 268435456:u=Ye;break;default:u=Ce}return h=dx.bind(null,r),u=mt(u,h),r.callbackPriority=a,r.callbackNode=u,a}return h!==null&&h!==null&&ii(h),r.callbackPriority=2,r.callbackNode=null,2}function dx(r,a){if(Tt!==0&&Tt!==5)return r.callbackNode=null,r.callbackPriority=0,null;var u=r.callbackNode;if($u()&&r.callbackNode!==u)return null;var h=Pe;return h=Ql(r,r===it?h:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),h===0?null:(qb(r,h,a),cx(r,Xt()),r.callbackNode!=null&&r.callbackNode===u?dx.bind(null,r):null)}function fx(r,a){if($u())return null;qb(r,a,!0)}function NR(){WR(function(){($e&6)!==0?mt(re,IR):ux()})}function lp(){if(Tr===0){var r=ca;r===0&&(r=Yl,Yl<<=1,(Yl&261888)===0&&(Yl=256)),Tr=r}return Tr}function hx(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:tu(""+r)}function px(r,a){var u=a.ownerDocument.createElement("input");return u.name=a.name,u.value=a.value,r.id&&u.setAttribute("form",r.id),a.parentNode.insertBefore(u,a),r=new FormData(r),u.parentNode.removeChild(u),r}function zR(r,a,u,h,y){if(a==="submit"&&u&&u.stateNode===y){var b=hx((y[sn]||null).action),E=h.submitter;E&&(a=(a=E[sn]||null)?hx(a.formAction):E.getAttribute("formAction"),a!==null&&(b=a,E=null));var L=new ou("action","action",null,h,y);r.push({event:L,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(Tr!==0){var U=E?px(y,E):new FormData(y);Ah(u,{pending:!0,data:U,method:y.method,action:b},null,U)}}else typeof b=="function"&&(L.preventDefault(),U=E?px(y,E):new FormData(y),Ah(u,{pending:!0,data:U,method:y.method,action:b},b,U))},currentTarget:y}]})}}for(var up=0;up<$f.length;up++){var cp=$f[up],PR=cp.toLowerCase(),HR=cp[0].toUpperCase()+cp.slice(1);Wn(PR,"on"+HR)}Wn($0,"onAnimationEnd"),Wn(q0,"onAnimationIteration"),Wn(W0,"onAnimationStart"),Wn("dblclick","onDoubleClick"),Wn("focusin","onFocus"),Wn("focusout","onBlur"),Wn(eR,"onTransitionRun"),Wn(tR,"onTransitionStart"),Wn(nR,"onTransitionCancel"),Wn(Y0,"onTransitionEnd"),Ko("onMouseEnter",["mouseout","mouseover"]),Ko("onMouseLeave",["mouseout","mouseover"]),Ko("onPointerEnter",["pointerout","pointerover"]),Ko("onPointerLeave",["pointerout","pointerover"]),Qr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Qr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Qr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Qr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Qr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Qr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Us="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(" "),jR=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Us));function mx(r,a){a=(a&4)!==0;for(var u=0;u<r.length;u++){var h=r[u],y=h.event;h=h.listeners;e:{var b=void 0;if(a)for(var E=h.length-1;0<=E;E--){var L=h[E],U=L.instance,K=L.currentTarget;if(L=L.listener,U!==b&&y.isPropagationStopped())break e;b=L,y.currentTarget=K;try{b(y)}catch(ie){lu(ie)}y.currentTarget=null,b=U}else for(E=0;E<h.length;E++){if(L=h[E],U=L.instance,K=L.currentTarget,L=L.listener,U!==b&&y.isPropagationStopped())break e;b=L,y.currentTarget=K;try{b(y)}catch(ie){lu(ie)}y.currentTarget=null,b=U}}}}function ze(r,a){var u=a[Cf];u===void 0&&(u=a[Cf]=new Set);var h=r+"__bubble";u.has(h)||(gx(a,r,2,!1),u.add(h))}function dp(r,a,u){var h=0;a&&(h|=4),gx(u,r,h,a)}var Yu="_reactListening"+Math.random().toString(36).slice(2);function fp(r){if(!r[Yu]){r[Yu]=!0,u0.forEach(function(u){u!=="selectionchange"&&(jR.has(u)||dp(u,!1,r),dp(u,!0,r))});var a=r.nodeType===9?r:r.ownerDocument;a===null||a[Yu]||(a[Yu]=!0,dp("selectionchange",!1,a))}}function gx(r,a,u,h){switch($x(a)){case 2:var y=hO;break;case 8:y=pO;break;default:y=Tp}u=y.bind(null,a,u,r),y=void 0,!Df||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(y=!0),h?y!==void 0?r.addEventListener(a,u,{capture:!0,passive:y}):r.addEventListener(a,u,!0):y!==void 0?r.addEventListener(a,u,{passive:y}):r.addEventListener(a,u,!1)}function hp(r,a,u,h,y){var b=h;if((a&1)===0&&(a&2)===0&&h!==null)e:for(;;){if(h===null)return;var E=h.tag;if(E===3||E===4){var L=h.stateNode.containerInfo;if(L===y)break;if(E===4)for(E=h.return;E!==null;){var U=E.tag;if((U===3||U===4)&&E.stateNode.containerInfo===y)return;E=E.return}for(;L!==null;){if(E=Wo(L),E===null)return;if(U=E.tag,U===5||U===6||U===26||U===27){h=b=E;continue e}L=L.parentNode}}h=h.return}S0(function(){var K=b,ie=Rf(u),ae=[];e:{var J=X0.get(r);if(J!==void 0){var ne=ou,ve=r;switch(r){case"keypress":if(iu(u)===0)break e;case"keydown":case"keyup":ne=DL;break;case"focusin":ve="focus",ne=zf;break;case"focusout":ve="blur",ne=zf;break;case"beforeblur":case"afterblur":ne=zf;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":ne=w0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=xL;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=NL;break;case $0:case q0:case W0:ne=CL;break;case Y0:ne=PL;break;case"scroll":case"scrollend":ne=vL;break;case"wheel":ne=jL;break;case"copy":case"cut":case"paste":ne=EL;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=k0;break;case"toggle":case"beforetoggle":ne=UL}var _e=(a&4)!==0,et=!_e&&(r==="scroll"||r==="scrollend"),$=_e?J!==null?J+"Capture":null:J;_e=[];for(var V=K,X;V!==null;){var oe=V;if(X=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||X===null||$===null||(oe=us(V,$),oe!=null&&_e.push(Vs(V,oe,X))),et)break;V=V.return}0<_e.length&&(J=new ne(J,ve,null,u,ie),ae.push({event:J,listeners:_e}))}}if((a&7)===0){e:{if(J=r==="mouseover"||r==="pointerover",ne=r==="mouseout"||r==="pointerout",J&&u!==Lf&&(ve=u.relatedTarget||u.fromElement)&&(Wo(ve)||ve[qo]))break e;if((ne||J)&&(J=ie.window===ie?ie:(J=ie.ownerDocument)?J.defaultView||J.parentWindow:window,ne?(ve=u.relatedTarget||u.toElement,ne=K,ve=ve?Wo(ve):null,ve!==null&&(et=s(ve),_e=ve.tag,ve!==et||_e!==5&&_e!==27&&_e!==6)&&(ve=null)):(ne=null,ve=K),ne!==ve)){if(_e=w0,oe="onMouseLeave",$="onMouseEnter",V="mouse",(r==="pointerout"||r==="pointerover")&&(_e=k0,oe="onPointerLeave",$="onPointerEnter",V="pointer"),et=ne==null?J:ls(ne),X=ve==null?J:ls(ve),J=new _e(oe,V+"leave",ne,u,ie),J.target=et,J.relatedTarget=X,oe=null,Wo(ie)===K&&(_e=new _e($,V+"enter",ve,u,ie),_e.target=X,_e.relatedTarget=et,oe=_e),et=oe,ne&&ve)t:{for(_e=BR,$=ne,V=ve,X=0,oe=$;oe;oe=_e(oe))X++;oe=0;for(var Se=V;Se;Se=_e(Se))oe++;for(;0<X-oe;)$=_e($),X--;for(;0<oe-X;)V=_e(V),oe--;for(;X--;){if($===V||V!==null&&$===V.alternate){_e=$;break t}$=_e($),V=_e(V)}_e=null}else _e=null;ne!==null&&yx(ae,J,ne,_e,!1),ve!==null&&et!==null&&yx(ae,et,ve,_e,!0)}}e:{if(J=K?ls(K):window,ne=J.nodeName&&J.nodeName.toLowerCase(),ne==="select"||ne==="input"&&J.type==="file")var Ve=I0;else if(D0(J))if(N0)Ve=QL;else{Ve=XL;var xe=YL}else ne=J.nodeName,!ne||ne.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?K&&Af(K.elementType)&&(Ve=I0):Ve=KL;if(Ve&&(Ve=Ve(r,K))){M0(ae,Ve,u,ie);break e}xe&&xe(r,J,K),r==="focusout"&&K&&J.type==="number"&&K.memoizedProps.value!=null&&Tf(J,"number",J.value)}switch(xe=K?ls(K):window,r){case"focusin":(D0(xe)||xe.contentEditable==="true")&&(na=xe,Vf=K,ys=null);break;case"focusout":ys=Vf=na=null;break;case"mousedown":Ff=!0;break;case"contextmenu":case"mouseup":case"dragend":Ff=!1,F0(ae,u,ie);break;case"selectionchange":if(JL)break;case"keydown":case"keyup":F0(ae,u,ie)}var Oe;if(Hf)e:{switch(r){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else ta?R0(r,u)&&(He="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(He="onCompositionStart");He&&(T0&&u.locale!=="ko"&&(ta||He!=="onCompositionStart"?He==="onCompositionEnd"&&ta&&(Oe=_0()):(dr=ie,Mf="value"in dr?dr.value:dr.textContent,ta=!0)),xe=Xu(K,He),0<xe.length&&(He=new E0(He,r,null,u,ie),ae.push({event:He,listeners:xe}),Oe?He.data=Oe:(Oe=O0(u),Oe!==null&&(He.data=Oe)))),(Oe=FL?GL(r,u):$L(r,u))&&(He=Xu(K,"onBeforeInput"),0<He.length&&(xe=new E0("onBeforeInput","beforeinput",null,u,ie),ae.push({event:xe,listeners:He}),xe.data=Oe)),zR(ae,r,K,u,ie)}mx(ae,a)})}function Vs(r,a,u){return{instance:r,listener:a,currentTarget:u}}function Xu(r,a){for(var u=a+"Capture",h=[];r!==null;){var y=r,b=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||b===null||(y=us(r,u),y!=null&&h.unshift(Vs(r,y,b)),y=us(r,a),y!=null&&h.push(Vs(r,y,b))),r.tag===3)return h;r=r.return}return[]}function BR(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function yx(r,a,u,h,y){for(var b=a._reactName,E=[];u!==null&&u!==h;){var L=u,U=L.alternate,K=L.stateNode;if(L=L.tag,U!==null&&U===h)break;L!==5&&L!==26&&L!==27||K===null||(U=K,y?(K=us(u,b),K!=null&&E.unshift(Vs(u,K,U))):y||(K=us(u,b),K!=null&&E.push(Vs(u,K,U)))),u=u.return}E.length!==0&&r.push({event:a,listeners:E})}var UR=/\r\n?/g,VR=/\u0000|\uFFFD/g;function vx(r){return(typeof r=="string"?r:""+r).replace(UR,`
|
|
10
|
+
`).replace(VR,"")}function bx(r,a){return a=vx(a),vx(r)===a}function Je(r,a,u,h,y,b){switch(u){case"children":typeof h=="string"?a==="body"||a==="textarea"&&h===""||Zo(r,h):(typeof h=="number"||typeof h=="bigint")&&a!=="body"&&Zo(r,""+h);break;case"className":Jl(r,"class",h);break;case"tabIndex":Jl(r,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":Jl(r,u,h);break;case"style":b0(r,h,b);break;case"data":if(a!=="object"){Jl(r,"data",h);break}case"src":case"href":if(h===""&&(a!=="a"||u!=="href")){r.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){r.removeAttribute(u);break}h=tu(""+h),r.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){r.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof b=="function"&&(u==="formAction"?(a!=="input"&&Je(r,a,"name",y.name,y,null),Je(r,a,"formEncType",y.formEncType,y,null),Je(r,a,"formMethod",y.formMethod,y,null),Je(r,a,"formTarget",y.formTarget,y,null)):(Je(r,a,"encType",y.encType,y,null),Je(r,a,"method",y.method,y,null),Je(r,a,"target",y.target,y,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){r.removeAttribute(u);break}h=tu(""+h),r.setAttribute(u,h);break;case"onClick":h!=null&&(r.onclick=Ai);break;case"onScroll":h!=null&&ze("scroll",r);break;case"onScrollEnd":h!=null&&ze("scrollend",r);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(u=h.__html,u!=null){if(y.children!=null)throw Error(i(60));r.innerHTML=u}}break;case"multiple":r.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":r.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){r.removeAttribute("xlink:href");break}u=tu(""+h),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?r.setAttribute(u,""+h):r.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?r.setAttribute(u,""):r.removeAttribute(u);break;case"capture":case"download":h===!0?r.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?r.setAttribute(u,h):r.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?r.setAttribute(u,h):r.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?r.removeAttribute(u):r.setAttribute(u,h);break;case"popover":ze("beforetoggle",r),ze("toggle",r),Zl(r,"popover",h);break;case"xlinkActuate":Ti(r,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":Ti(r,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":Ti(r,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":Ti(r,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":Ti(r,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":Ti(r,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":Ti(r,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":Ti(r,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":Ti(r,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":Zl(r,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=gL.get(u)||u,Zl(r,u,h))}}function pp(r,a,u,h,y,b){switch(u){case"style":b0(r,h,b);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(u=h.__html,u!=null){if(y.children!=null)throw Error(i(60));r.innerHTML=u}}break;case"children":typeof h=="string"?Zo(r,h):(typeof h=="number"||typeof h=="bigint")&&Zo(r,""+h);break;case"onScroll":h!=null&&ze("scroll",r);break;case"onScrollEnd":h!=null&&ze("scrollend",r);break;case"onClick":h!=null&&(r.onclick=Ai);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!c0.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),a=u.slice(2,y?u.length-7:void 0),b=r[sn]||null,b=b!=null?b[u]:null,typeof b=="function"&&r.removeEventListener(a,b,y),typeof h=="function")){typeof b!="function"&&b!==null&&(u in r?r[u]=null:r.hasAttribute(u)&&r.removeAttribute(u)),r.addEventListener(a,h,y);break e}u in r?r[u]=h:h===!0?r.setAttribute(u,""):Zl(r,u,h)}}}function Ft(r,a,u){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ze("error",r),ze("load",r);var h=!1,y=!1,b;for(b in u)if(u.hasOwnProperty(b)){var E=u[b];if(E!=null)switch(b){case"src":h=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:Je(r,a,b,E,u,null)}}y&&Je(r,a,"srcSet",u.srcSet,u,null),h&&Je(r,a,"src",u.src,u,null);return;case"input":ze("invalid",r);var L=b=E=y=null,U=null,K=null;for(h in u)if(u.hasOwnProperty(h)){var ie=u[h];if(ie!=null)switch(h){case"name":y=ie;break;case"type":E=ie;break;case"checked":U=ie;break;case"defaultChecked":K=ie;break;case"value":b=ie;break;case"defaultValue":L=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(i(137,a));break;default:Je(r,a,h,ie,u,null)}}m0(r,b,L,U,K,E,y,!1);return;case"select":ze("invalid",r),h=E=b=null;for(y in u)if(u.hasOwnProperty(y)&&(L=u[y],L!=null))switch(y){case"value":b=L;break;case"defaultValue":E=L;break;case"multiple":h=L;default:Je(r,a,y,L,u,null)}a=b,u=E,r.multiple=!!h,a!=null?Qo(r,!!h,a,!1):u!=null&&Qo(r,!!h,u,!0);return;case"textarea":ze("invalid",r),b=y=h=null;for(E in u)if(u.hasOwnProperty(E)&&(L=u[E],L!=null))switch(E){case"value":h=L;break;case"defaultValue":y=L;break;case"children":b=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(i(91));break;default:Je(r,a,E,L,u,null)}y0(r,h,y,b);return;case"option":for(U in u)u.hasOwnProperty(U)&&(h=u[U],h!=null)&&(U==="selected"?r.selected=h&&typeof h!="function"&&typeof h!="symbol":Je(r,a,U,h,u,null));return;case"dialog":ze("beforetoggle",r),ze("toggle",r),ze("cancel",r),ze("close",r);break;case"iframe":case"object":ze("load",r);break;case"video":case"audio":for(h=0;h<Us.length;h++)ze(Us[h],r);break;case"image":ze("error",r),ze("load",r);break;case"details":ze("toggle",r);break;case"embed":case"source":case"link":ze("error",r),ze("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(K in u)if(u.hasOwnProperty(K)&&(h=u[K],h!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:Je(r,a,K,h,u,null)}return;default:if(Af(a)){for(ie in u)u.hasOwnProperty(ie)&&(h=u[ie],h!==void 0&&pp(r,a,ie,h,u,void 0));return}}for(L in u)u.hasOwnProperty(L)&&(h=u[L],h!=null&&Je(r,a,L,h,u,null))}function FR(r,a,u,h){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,b=null,E=null,L=null,U=null,K=null,ie=null;for(ne in u){var ae=u[ne];if(u.hasOwnProperty(ne)&&ae!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":U=ae;default:h.hasOwnProperty(ne)||Je(r,a,ne,null,h,ae)}}for(var J in h){var ne=h[J];if(ae=u[J],h.hasOwnProperty(J)&&(ne!=null||ae!=null))switch(J){case"type":b=ne;break;case"name":y=ne;break;case"checked":K=ne;break;case"defaultChecked":ie=ne;break;case"value":E=ne;break;case"defaultValue":L=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(i(137,a));break;default:ne!==ae&&Je(r,a,J,ne,h,ae)}}kf(r,E,L,U,K,ie,b,y);return;case"select":ne=E=L=J=null;for(b in u)if(U=u[b],u.hasOwnProperty(b)&&U!=null)switch(b){case"value":break;case"multiple":ne=U;default:h.hasOwnProperty(b)||Je(r,a,b,null,h,U)}for(y in h)if(b=h[y],U=u[y],h.hasOwnProperty(y)&&(b!=null||U!=null))switch(y){case"value":J=b;break;case"defaultValue":L=b;break;case"multiple":E=b;default:b!==U&&Je(r,a,y,b,h,U)}a=L,u=E,h=ne,J!=null?Qo(r,!!u,J,!1):!!h!=!!u&&(a!=null?Qo(r,!!u,a,!0):Qo(r,!!u,u?[]:"",!1));return;case"textarea":ne=J=null;for(L in u)if(y=u[L],u.hasOwnProperty(L)&&y!=null&&!h.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:Je(r,a,L,null,h,y)}for(E in h)if(y=h[E],b=u[E],h.hasOwnProperty(E)&&(y!=null||b!=null))switch(E){case"value":J=y;break;case"defaultValue":ne=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(i(91));break;default:y!==b&&Je(r,a,E,y,h,b)}g0(r,J,ne);return;case"option":for(var ve in u)J=u[ve],u.hasOwnProperty(ve)&&J!=null&&!h.hasOwnProperty(ve)&&(ve==="selected"?r.selected=!1:Je(r,a,ve,null,h,J));for(U in h)J=h[U],ne=u[U],h.hasOwnProperty(U)&&J!==ne&&(J!=null||ne!=null)&&(U==="selected"?r.selected=J&&typeof J!="function"&&typeof J!="symbol":Je(r,a,U,J,h,ne));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var _e in u)J=u[_e],u.hasOwnProperty(_e)&&J!=null&&!h.hasOwnProperty(_e)&&Je(r,a,_e,null,h,J);for(K in h)if(J=h[K],ne=u[K],h.hasOwnProperty(K)&&J!==ne&&(J!=null||ne!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(i(137,a));break;default:Je(r,a,K,J,h,ne)}return;default:if(Af(a)){for(var et in u)J=u[et],u.hasOwnProperty(et)&&J!==void 0&&!h.hasOwnProperty(et)&&pp(r,a,et,void 0,h,J);for(ie in h)J=h[ie],ne=u[ie],!h.hasOwnProperty(ie)||J===ne||J===void 0&&ne===void 0||pp(r,a,ie,J,h,ne);return}}for(var $ in u)J=u[$],u.hasOwnProperty($)&&J!=null&&!h.hasOwnProperty($)&&Je(r,a,$,null,h,J);for(ae in h)J=h[ae],ne=u[ae],!h.hasOwnProperty(ae)||J===ne||J==null&&ne==null||Je(r,a,ae,J,h,ne)}function xx(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function GR(){if(typeof performance.getEntriesByType=="function"){for(var r=0,a=0,u=performance.getEntriesByType("resource"),h=0;h<u.length;h++){var y=u[h],b=y.transferSize,E=y.initiatorType,L=y.duration;if(b&&L&&xx(E)){for(E=0,L=y.responseEnd,h+=1;h<u.length;h++){var U=u[h],K=U.startTime;if(K>L)break;var ie=U.transferSize,ae=U.initiatorType;ie&&xx(ae)&&(U=U.responseEnd,E+=ie*(U<L?1:(L-K)/(U-K)))}if(--h,a+=8*(b+E)/(y.duration/1e3),r++,10<r)break}}if(0<r)return a/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var mp=null,gp=null;function Ku(r){return r.nodeType===9?r:r.ownerDocument}function Sx(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function _x(r,a){if(r===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&a==="foreignObject"?0:r}function yp(r,a){return r==="textarea"||r==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var vp=null;function $R(){var r=window.event;return r&&r.type==="popstate"?r===vp?!1:(vp=r,!0):(vp=null,!1)}var Cx=typeof setTimeout=="function"?setTimeout:void 0,qR=typeof clearTimeout=="function"?clearTimeout:void 0,wx=typeof Promise=="function"?Promise:void 0,WR=typeof queueMicrotask=="function"?queueMicrotask:typeof wx<"u"?function(r){return wx.resolve(null).then(r).catch(YR)}:Cx;function YR(r){setTimeout(function(){throw r})}function Ar(r){return r==="head"}function Ex(r,a){var u=a,h=0;do{var y=u.nextSibling;if(r.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"||u==="/&"){if(h===0){r.removeChild(y),La(a);return}h--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")h++;else if(u==="html")Fs(r.ownerDocument.documentElement);else if(u==="head"){u=r.ownerDocument.head,Fs(u);for(var b=u.firstChild;b;){var E=b.nextSibling,L=b.nodeName;b[ss]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&b.rel.toLowerCase()==="stylesheet"||u.removeChild(b),b=E}}else u==="body"&&Fs(r.ownerDocument.body);u=y}while(u);La(a)}function kx(r,a){var u=r;r=0;do{var h=u.nextSibling;if(u.nodeType===1?a?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(a?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),h&&h.nodeType===8)if(u=h.data,u==="/$"){if(r===0)break;r--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||r++;u=h}while(u)}function bp(r){var a=r.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var u=a;switch(a=a.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":bp(u),wf(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}r.removeChild(u)}}function XR(r,a,u,h){for(;r.nodeType===1;){var y=u;if(r.nodeName.toLowerCase()!==a.toLowerCase()){if(!h&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(h){if(!r[ss])switch(a){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(b=r.getAttribute("rel"),b==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(b!==y.rel||r.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||r.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||r.getAttribute("title")!==(y.title==null?null:y.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(b=r.getAttribute("src"),(b!==(y.src==null?null:y.src)||r.getAttribute("type")!==(y.type==null?null:y.type)||r.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&b&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(a==="input"&&r.type==="hidden"){var b=y.name==null?null:""+y.name;if(y.type==="hidden"&&r.getAttribute("name")===b)return r}else return r;if(r=jn(r.nextSibling),r===null)break}return null}function KR(r,a,u){if(a==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!u||(r=jn(r.nextSibling),r===null))return null;return r}function Tx(r,a){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!a||(r=jn(r.nextSibling),r===null))return null;return r}function xp(r){return r.data==="$?"||r.data==="$~"}function Sp(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function QR(r,a){var u=r.ownerDocument;if(r.data==="$~")r._reactRetry=a;else if(r.data!=="$?"||u.readyState!=="loading")a();else{var h=function(){a(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),r._reactRetry=h}}function jn(r){for(;r!=null;r=r.nextSibling){var a=r.nodeType;if(a===1||a===3)break;if(a===8){if(a=r.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return r}var _p=null;function Ax(r){r=r.nextSibling;for(var a=0;r;){if(r.nodeType===8){var u=r.data;if(u==="/$"||u==="/&"){if(a===0)return jn(r.nextSibling);a--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||a++}r=r.nextSibling}return null}function Lx(r){r=r.previousSibling;for(var a=0;r;){if(r.nodeType===8){var u=r.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(a===0)return r;a--}else u!=="/$"&&u!=="/&"||a++}r=r.previousSibling}return null}function Rx(r,a,u){switch(a=Ku(u),r){case"html":if(r=a.documentElement,!r)throw Error(i(452));return r;case"head":if(r=a.head,!r)throw Error(i(453));return r;case"body":if(r=a.body,!r)throw Error(i(454));return r;default:throw Error(i(451))}}function Fs(r){for(var a=r.attributes;a.length;)r.removeAttributeNode(a[0]);wf(r)}var Bn=new Map,Ox=new Set;function Qu(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Gi=q.d;q.d={f:ZR,r:JR,D:eO,C:tO,L:nO,m:iO,X:oO,S:rO,M:aO};function ZR(){var r=Gi.f(),a=Vu();return r||a}function JR(r){var a=Yo(r);a!==null&&a.tag===5&&a.type==="form"?Yv(a):Gi.r(r)}var ka=typeof document>"u"?null:document;function Dx(r,a,u){var h=ka;if(h&&typeof a=="string"&&a){var y=Dn(a);y='link[rel="'+r+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),Ox.has(y)||(Ox.add(y),r={rel:r,crossOrigin:u,href:a},h.querySelector(y)===null&&(a=h.createElement("link"),Ft(a,"link",r),Mt(a),h.head.appendChild(a)))}}function eO(r){Gi.D(r),Dx("dns-prefetch",r,null)}function tO(r,a){Gi.C(r,a),Dx("preconnect",r,a)}function nO(r,a,u){Gi.L(r,a,u);var h=ka;if(h&&r&&a){var y='link[rel="preload"][as="'+Dn(a)+'"]';a==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+Dn(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+Dn(u.imageSizes)+'"]')):y+='[href="'+Dn(r)+'"]';var b=y;switch(a){case"style":b=Ta(r);break;case"script":b=Aa(r)}Bn.has(b)||(r=m({rel:"preload",href:a==="image"&&u&&u.imageSrcSet?void 0:r,as:a},u),Bn.set(b,r),h.querySelector(y)!==null||a==="style"&&h.querySelector(Gs(b))||a==="script"&&h.querySelector($s(b))||(a=h.createElement("link"),Ft(a,"link",r),Mt(a),h.head.appendChild(a)))}}function iO(r,a){Gi.m(r,a);var u=ka;if(u&&r){var h=a&&typeof a.as=="string"?a.as:"script",y='link[rel="modulepreload"][as="'+Dn(h)+'"][href="'+Dn(r)+'"]',b=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=Aa(r)}if(!Bn.has(b)&&(r=m({rel:"modulepreload",href:r},a),Bn.set(b,r),u.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector($s(b)))return}h=u.createElement("link"),Ft(h,"link",r),Mt(h),u.head.appendChild(h)}}}function rO(r,a,u){Gi.S(r,a,u);var h=ka;if(h&&r){var y=Xo(h).hoistableStyles,b=Ta(r);a=a||"default";var E=y.get(b);if(!E){var L={loading:0,preload:null};if(E=h.querySelector(Gs(b)))L.loading=5;else{r=m({rel:"stylesheet",href:r,"data-precedence":a},u),(u=Bn.get(b))&&Cp(r,u);var U=E=h.createElement("link");Mt(U),Ft(U,"link",r),U._p=new Promise(function(K,ie){U.onload=K,U.onerror=ie}),U.addEventListener("load",function(){L.loading|=1}),U.addEventListener("error",function(){L.loading|=2}),L.loading|=4,Zu(E,a,h)}E={type:"stylesheet",instance:E,count:1,state:L},y.set(b,E)}}}function oO(r,a){Gi.X(r,a);var u=ka;if(u&&r){var h=Xo(u).hoistableScripts,y=Aa(r),b=h.get(y);b||(b=u.querySelector($s(y)),b||(r=m({src:r,async:!0},a),(a=Bn.get(y))&&wp(r,a),b=u.createElement("script"),Mt(b),Ft(b,"link",r),u.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},h.set(y,b))}}function aO(r,a){Gi.M(r,a);var u=ka;if(u&&r){var h=Xo(u).hoistableScripts,y=Aa(r),b=h.get(y);b||(b=u.querySelector($s(y)),b||(r=m({src:r,async:!0,type:"module"},a),(a=Bn.get(y))&&wp(r,a),b=u.createElement("script"),Mt(b),Ft(b,"link",r),u.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},h.set(y,b))}}function Mx(r,a,u,h){var y=(y=le.current)?Qu(y):null;if(!y)throw Error(i(446));switch(r){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(a=Ta(u.href),u=Xo(y).hoistableStyles,h=u.get(a),h||(h={type:"style",instance:null,count:0,state:null},u.set(a,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){r=Ta(u.href);var b=Xo(y).hoistableStyles,E=b.get(r);if(E||(y=y.ownerDocument||y,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(r,E),(b=y.querySelector(Gs(r)))&&!b._p&&(E.instance=b,E.state.loading=5),Bn.has(r)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Bn.set(r,u),b||sO(y,r,u,E.state))),a&&h===null)throw Error(i(528,""));return E}if(a&&h!==null)throw Error(i(529,""));return null;case"script":return a=u.async,u=u.src,typeof u=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Aa(u),u=Xo(y).hoistableScripts,h=u.get(a),h||(h={type:"script",instance:null,count:0,state:null},u.set(a,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,r))}}function Ta(r){return'href="'+Dn(r)+'"'}function Gs(r){return'link[rel="stylesheet"]['+r+"]"}function Ix(r){return m({},r,{"data-precedence":r.precedence,precedence:null})}function sO(r,a,u,h){r.querySelector('link[rel="preload"][as="style"]['+a+"]")?h.loading=1:(a=r.createElement("link"),h.preload=a,a.addEventListener("load",function(){return h.loading|=1}),a.addEventListener("error",function(){return h.loading|=2}),Ft(a,"link",u),Mt(a),r.head.appendChild(a))}function Aa(r){return'[src="'+Dn(r)+'"]'}function $s(r){return"script[async]"+r}function Nx(r,a,u){if(a.count++,a.instance===null)switch(a.type){case"style":var h=r.querySelector('style[data-href~="'+Dn(u.href)+'"]');if(h)return a.instance=h,Mt(h),h;var y=m({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(r.ownerDocument||r).createElement("style"),Mt(h),Ft(h,"style",y),Zu(h,u.precedence,r),a.instance=h;case"stylesheet":y=Ta(u.href);var b=r.querySelector(Gs(y));if(b)return a.state.loading|=4,a.instance=b,Mt(b),b;h=Ix(u),(y=Bn.get(y))&&Cp(h,y),b=(r.ownerDocument||r).createElement("link"),Mt(b);var E=b;return E._p=new Promise(function(L,U){E.onload=L,E.onerror=U}),Ft(b,"link",h),a.state.loading|=4,Zu(b,u.precedence,r),a.instance=b;case"script":return b=Aa(u.src),(y=r.querySelector($s(b)))?(a.instance=y,Mt(y),y):(h=u,(y=Bn.get(b))&&(h=m({},u),wp(h,y)),r=r.ownerDocument||r,y=r.createElement("script"),Mt(y),Ft(y,"link",h),r.head.appendChild(y),a.instance=y);case"void":return null;default:throw Error(i(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(h=a.instance,a.state.loading|=4,Zu(h,u.precedence,r));return a.instance}function Zu(r,a,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,b=y,E=0;E<h.length;E++){var L=h[E];if(L.dataset.precedence===a)b=L;else if(b!==y)break}b?b.parentNode.insertBefore(r,b.nextSibling):(a=u.nodeType===9?u.head:u,a.insertBefore(r,a.firstChild))}function Cp(r,a){r.crossOrigin==null&&(r.crossOrigin=a.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=a.referrerPolicy),r.title==null&&(r.title=a.title)}function wp(r,a){r.crossOrigin==null&&(r.crossOrigin=a.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=a.referrerPolicy),r.integrity==null&&(r.integrity=a.integrity)}var Ju=null;function zx(r,a,u){if(Ju===null){var h=new Map,y=Ju=new Map;y.set(u,h)}else y=Ju,h=y.get(u),h||(h=new Map,y.set(u,h));if(h.has(r))return h;for(h.set(r,null),u=u.getElementsByTagName(r),y=0;y<u.length;y++){var b=u[y];if(!(b[ss]||b[jt]||r==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var E=b.getAttribute(a)||"";E=r+E;var L=h.get(E);L?L.push(b):h.set(E,[b])}}return h}function Px(r,a,u){r=r.ownerDocument||r,r.head.insertBefore(u,a==="title"?r.querySelector("head > title"):null)}function lO(r,a,u){if(u===1||a.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(r=a.disabled,typeof a.precedence=="string"&&r==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function Hx(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function uO(r,a,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=Ta(h.href),b=a.querySelector(Gs(y));if(b){a=b._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(r.count++,r=ec.bind(r),a.then(r,r)),u.state.loading|=4,u.instance=b,Mt(b);return}b=a.ownerDocument||a,h=Ix(h),(y=Bn.get(y))&&Cp(h,y),b=b.createElement("link"),Mt(b);var E=b;E._p=new Promise(function(L,U){E.onload=L,E.onerror=U}),Ft(b,"link",h),u.instance=b}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(u,a),(a=u.state.preload)&&(u.state.loading&3)===0&&(r.count++,u=ec.bind(r),a.addEventListener("load",u),a.addEventListener("error",u))}}var Ep=0;function cO(r,a){return r.stylesheets&&r.count===0&&nc(r,r.stylesheets),0<r.count||0<r.imgCount?function(u){var h=setTimeout(function(){if(r.stylesheets&&nc(r,r.stylesheets),r.unsuspend){var b=r.unsuspend;r.unsuspend=null,b()}},6e4+a);0<r.imgBytes&&Ep===0&&(Ep=62500*GR());var y=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&nc(r,r.stylesheets),r.unsuspend)){var b=r.unsuspend;r.unsuspend=null,b()}},(r.imgBytes>Ep?50:800)+a);return r.unsuspend=u,function(){r.unsuspend=null,clearTimeout(h),clearTimeout(y)}}:null}function ec(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)nc(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var tc=null;function nc(r,a){r.stylesheets=null,r.unsuspend!==null&&(r.count++,tc=new Map,a.forEach(dO,r),tc=null,ec.call(r))}function dO(r,a){if(!(a.state.loading&4)){var u=tc.get(r);if(u)var h=u.get(null);else{u=new Map,tc.set(r,u);for(var y=r.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<y.length;b++){var E=y[b];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(u.set(E.dataset.precedence,E),h=E)}h&&u.set(null,h)}y=a.instance,E=y.getAttribute("data-precedence"),b=u.get(E)||h,b===h&&u.set(null,y),u.set(E,y),this.count++,h=ec.bind(this),y.addEventListener("load",h),y.addEventListener("error",h),b?b.parentNode.insertBefore(y,b.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(y,r.firstChild)),a.state.loading|=4}}var qs={$$typeof:T,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function fO(r,a,u,h,y,b,E,L,U){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=xf(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xf(0),this.hiddenUpdates=xf(null),this.identifierPrefix=h,this.onUncaughtError=y,this.onCaughtError=b,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.incompleteTransitions=new Map}function jx(r,a,u,h,y,b,E,L,U,K,ie,ae){return r=new fO(r,a,u,E,U,K,ie,ae,L),a=1,b===!0&&(a|=24),b=Sn(3,null,null,a),r.current=b,b.stateNode=r,a=rh(),a.refCount++,r.pooledCache=a,a.refCount++,b.memoizedState={element:h,isDehydrated:u,cache:a},lh(b),r}function Bx(r){return r?(r=oa,r):oa}function Ux(r,a,u,h,y,b){y=Bx(y),h.context===null?h.context=y:h.pendingContext=y,h=yr(a),h.payload={element:u},b=b===void 0?null:b,b!==null&&(h.callback=b),u=vr(r,h,a),u!==null&&(hn(u,r,a),ws(u,r,a))}function Vx(r,a){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<a?u:a}}function kp(r,a){Vx(r,a),(r=r.alternate)&&Vx(r,a)}function Fx(r){if(r.tag===13||r.tag===31){var a=to(r,67108864);a!==null&&hn(a,r,67108864),kp(r,67108864)}}function Gx(r){if(r.tag===13||r.tag===31){var a=kn();a=Sf(a);var u=to(r,a);u!==null&&hn(u,r,a),kp(r,a)}}var ic=!0;function hO(r,a,u,h){var y=z.T;z.T=null;var b=q.p;try{q.p=2,Tp(r,a,u,h)}finally{q.p=b,z.T=y}}function pO(r,a,u,h){var y=z.T;z.T=null;var b=q.p;try{q.p=8,Tp(r,a,u,h)}finally{q.p=b,z.T=y}}function Tp(r,a,u,h){if(ic){var y=Ap(h);if(y===null)hp(r,a,h,rc,u),qx(r,h);else if(gO(y,r,a,u,h))h.stopPropagation();else if(qx(r,h),a&4&&-1<mO.indexOf(r)){for(;y!==null;){var b=Yo(y);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var E=Kr(b.pendingLanes);if(E!==0){var L=b;for(L.pendingLanes|=2,L.entangledLanes|=2;E;){var U=1<<31-nt(E);L.entanglements[1]|=U,E&=~U}si(b),($e&6)===0&&(Bu=Xt()+500,Bs(0))}}break;case 31:case 13:L=to(b,2),L!==null&&hn(L,b,2),Vu(),kp(b,2)}if(b=Ap(h),b===null&&hp(r,a,h,rc,u),b===y)break;y=b}y!==null&&h.stopPropagation()}else hp(r,a,h,null,u)}}function Ap(r){return r=Rf(r),Lp(r)}var rc=null;function Lp(r){if(rc=null,r=Wo(r),r!==null){var a=s(r);if(a===null)r=null;else{var u=a.tag;if(u===13){if(r=l(a),r!==null)return r;r=null}else if(u===31){if(r=c(a),r!==null)return r;r=null}else if(u===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;r=null}else a!==r&&(r=null)}}return rc=r,null}function $x(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(bf()){case re:return 2;case fe:return 8;case Ce:case Ie:return 32;case Ye:return 268435456;default:return 32}default:return 32}}var Rp=!1,Lr=null,Rr=null,Or=null,Ws=new Map,Ys=new Map,Dr=[],mO="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function qx(r,a){switch(r){case"focusin":case"focusout":Lr=null;break;case"dragenter":case"dragleave":Rr=null;break;case"mouseover":case"mouseout":Or=null;break;case"pointerover":case"pointerout":Ws.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ys.delete(a.pointerId)}}function Xs(r,a,u,h,y,b){return r===null||r.nativeEvent!==b?(r={blockedOn:a,domEventName:u,eventSystemFlags:h,nativeEvent:b,targetContainers:[y]},a!==null&&(a=Yo(a),a!==null&&Fx(a)),r):(r.eventSystemFlags|=h,a=r.targetContainers,y!==null&&a.indexOf(y)===-1&&a.push(y),r)}function gO(r,a,u,h,y){switch(a){case"focusin":return Lr=Xs(Lr,r,a,u,h,y),!0;case"dragenter":return Rr=Xs(Rr,r,a,u,h,y),!0;case"mouseover":return Or=Xs(Or,r,a,u,h,y),!0;case"pointerover":var b=y.pointerId;return Ws.set(b,Xs(Ws.get(b)||null,r,a,u,h,y)),!0;case"gotpointercapture":return b=y.pointerId,Ys.set(b,Xs(Ys.get(b)||null,r,a,u,h,y)),!0}return!1}function Wx(r){var a=Wo(r.target);if(a!==null){var u=s(a);if(u!==null){if(a=u.tag,a===13){if(a=l(u),a!==null){r.blockedOn=a,s0(r.priority,function(){Gx(u)});return}}else if(a===31){if(a=c(u),a!==null){r.blockedOn=a,s0(r.priority,function(){Gx(u)});return}}else if(a===3&&u.stateNode.current.memoizedState.isDehydrated){r.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}r.blockedOn=null}function oc(r){if(r.blockedOn!==null)return!1;for(var a=r.targetContainers;0<a.length;){var u=Ap(r.nativeEvent);if(u===null){u=r.nativeEvent;var h=new u.constructor(u.type,u);Lf=h,u.target.dispatchEvent(h),Lf=null}else return a=Yo(u),a!==null&&Fx(a),r.blockedOn=u,!1;a.shift()}return!0}function Yx(r,a,u){oc(r)&&u.delete(a)}function yO(){Rp=!1,Lr!==null&&oc(Lr)&&(Lr=null),Rr!==null&&oc(Rr)&&(Rr=null),Or!==null&&oc(Or)&&(Or=null),Ws.forEach(Yx),Ys.forEach(Yx)}function ac(r,a){r.blockedOn===a&&(r.blockedOn=null,Rp||(Rp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,yO)))}var sc=null;function Xx(r){sc!==r&&(sc=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){sc===r&&(sc=null);for(var a=0;a<r.length;a+=3){var u=r[a],h=r[a+1],y=r[a+2];if(typeof h!="function"){if(Lp(h||u)===null)continue;break}var b=Yo(u);b!==null&&(r.splice(a,3),a-=3,Ah(b,{pending:!0,data:y,method:u.method,action:h},h,y))}}))}function La(r){function a(U){return ac(U,r)}Lr!==null&&ac(Lr,r),Rr!==null&&ac(Rr,r),Or!==null&&ac(Or,r),Ws.forEach(a),Ys.forEach(a);for(var u=0;u<Dr.length;u++){var h=Dr[u];h.blockedOn===r&&(h.blockedOn=null)}for(;0<Dr.length&&(u=Dr[0],u.blockedOn===null);)Wx(u),u.blockedOn===null&&Dr.shift();if(u=(r.ownerDocument||r).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var y=u[h],b=u[h+1],E=y[sn]||null;if(typeof b=="function")E||Xx(u);else if(E){var L=null;if(b&&b.hasAttribute("formAction")){if(y=b,E=b[sn]||null)L=E.formAction;else if(Lp(y)!==null)continue}else L=E.action;typeof L=="function"?u[h+1]=L:(u.splice(h,3),h-=3),Xx(u)}}}function Kx(){function r(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(E){return y=E})},focusReset:"manual",scroll:"manual"})}function a(){y!==null&&(y(),y=null),h||setTimeout(u,20)}function u(){if(!h&&!navigation.transition){var b=navigation.currentEntry;b&&b.url!=null&&navigation.navigate(b.url,{state:b.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,y=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(u,100),function(){h=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),y!==null&&(y(),y=null)}}}function Op(r){this._internalRoot=r}lc.prototype.render=Op.prototype.render=function(r){var a=this._internalRoot;if(a===null)throw Error(i(409));var u=a.current,h=kn();Ux(u,h,r,a,null,null)},lc.prototype.unmount=Op.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var a=r.containerInfo;Ux(r.current,2,null,r,null,null),Vu(),a[qo]=null}};function lc(r){this._internalRoot=r}lc.prototype.unstable_scheduleHydration=function(r){if(r){var a=a0();r={blockedOn:null,target:r,priority:a};for(var u=0;u<Dr.length&&a!==0&&a<Dr[u].priority;u++);Dr.splice(u,0,r),u===0&&Wx(r)}};var Qx=t.version;if(Qx!=="19.2.8")throw Error(i(527,Qx,"19.2.8"));q.findDOMNode=function(r){var a=r._reactInternals;if(a===void 0)throw typeof r.render=="function"?Error(i(188)):(r=Object.keys(r).join(","),Error(i(268,r)));return r=f(a),r=r!==null?p(r):null,r=r===null?null:r.stateNode,r};var vO={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var uc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!uc.isDisabled&&uc.supportsFiber)try{Kt=uc.inject(vO),kt=uc}catch{}}return Qs.createRoot=function(r,a){if(!o(r))throw Error(i(299));var u=!1,h="",y=rb,b=ob,E=ab;return a!=null&&(a.unstable_strictMode===!0&&(u=!0),a.identifierPrefix!==void 0&&(h=a.identifierPrefix),a.onUncaughtError!==void 0&&(y=a.onUncaughtError),a.onCaughtError!==void 0&&(b=a.onCaughtError),a.onRecoverableError!==void 0&&(E=a.onRecoverableError)),a=jx(r,1,!1,null,null,u,h,null,y,b,E,Kx),r[qo]=a.current,fp(r),new Op(a)},Qs.hydrateRoot=function(r,a,u){if(!o(r))throw Error(i(299));var h=!1,y="",b=rb,E=ob,L=ab,U=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(b=u.onUncaughtError),u.onCaughtError!==void 0&&(E=u.onCaughtError),u.onRecoverableError!==void 0&&(L=u.onRecoverableError),u.formState!==void 0&&(U=u.formState)),a=jx(r,1,!0,a,u??null,h,y,U,b,E,L,Kx),a.context=Bx(null),u=a.current,h=kn(),h=Sf(h),y=yr(h),y.callback=null,vr(u,y,h),u=h,a.current.lanes=u,as(a,u),si(a),r[qo]=a.current,fp(r),new lc(a)},Qs.version="19.2.8",Qs}var sS;function LO(){if(sS)return Ip.exports;sS=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(),Ip.exports=AO(),Ip.exports}var RO=LO();function OO(e,t){const n=getComputedStyle(e),i=parseFloat(n.fontSize);return t*i}function DO(e,t){const n=getComputedStyle(e.ownerDocument.documentElement),i=parseFloat(n.fontSize);return t*i}function MO(e){return e/100*window.innerHeight}function IO(e){return e/100*window.innerWidth}function NO(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function al({groupSize:e,panelElement:t,styleProp:n}){let i;const[o,s]=NO(n);switch(s){case"%":{i=o/100*e;break}case"px":{i=o;break}case"rem":{i=DO(t,o);break}case"em":{i=OO(t,o);break}case"vh":{i=MO(o);break}case"vw":{i=IO(o);break}}return i}function tn(e){return parseFloat(e.toFixed(3))}function Ka({group:e}){const{orientation:t,panels:n}=e;return n.reduce((i,o)=>(i+=t==="horizontal"?o.element.offsetWidth:o.element.offsetHeight,i),0)}function Um(e){const{panels:t}=e,n=Ka({group:e});return n===0?t.map(i=>({groupResizeBehavior:i.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:i.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:i.panelConstraints.disabled,minSize:0,maxSize:100,panelId:i.id})):t.map(i=>{const{element:o,panelConstraints:s}=i;let l=0;if(s.collapsedSize!==void 0){const p=al({groupSize:n,panelElement:o,styleProp:s.collapsedSize});l=tn(p/n*100)}let c;if(s.defaultSize!==void 0){const p=al({groupSize:n,panelElement:o,styleProp:s.defaultSize});c=tn(p/n*100)}let d=0;if(s.minSize!==void 0){const p=al({groupSize:n,panelElement:o,styleProp:s.minSize});d=tn(p/n*100)}let f=100;if(s.maxSize!==void 0){const p=al({groupSize:n,panelElement:o,styleProp:s.maxSize});f=tn(p/n*100)}return{groupResizeBehavior:s.groupResizeBehavior,collapsedSize:l,collapsible:s.collapsible===!0,defaultSize:c,disabled:s.disabled,minSize:d,maxSize:f,panelId:i.id}})}function tt(e,t="Assertion error"){if(!e)throw Error(t)}function Vm(e,t){return Array.from(t).sort(e==="horizontal"?zO:PO)}function zO(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function PO(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function Iw(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Nw(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function HO({orientation:e,rects:t,targetRect:n}){const i={x:n.x+n.width/2,y:n.y+n.height/2};let o,s=Number.MAX_VALUE;for(const l of t){const{x:c,y:d}=Nw(i,l),f=e==="horizontal"?c:d;f<s&&(s=f,o=l)}return tt(o,"No rect found"),o}let cc;function jO(){return cc===void 0&&(typeof matchMedia=="function"?cc=!!matchMedia("(pointer:coarse)").matches:cc=!1),cc}function zw(e){const{element:t,orientation:n,panels:i,separators:o}=e,s=Vm(n,Array.from(t.children).filter(Iw).map(x=>({element:x}))).map(({element:x})=>x),l=[];let c=!1,d=!1,f=-1,p=-1,m=0,g,v=[];{let x=-1;for(const S of s)S.hasAttribute("data-panel")&&(x++,S.hasAttribute("data-disabled")||(m++,f===-1&&(f=x),p=x))}if(m>1){let x=-1;for(const S of s)if(S.hasAttribute("data-panel")){x++;const w=i.find(_=>_.element===S);if(w){if(g){const _=g.element.getBoundingClientRect(),C=S.getBoundingClientRect();let T;if(d){const D=n==="horizontal"?new DOMRect(_.right,_.top,0,_.height):new DOMRect(_.left,_.bottom,_.width,0),I=n==="horizontal"?new DOMRect(C.left,C.top,0,C.height):new DOMRect(C.left,C.top,C.width,0);switch(v.length){case 0:{T=[D,I];break}case 1:{const O=v[0],P=HO({orientation:n,rects:[_,C],targetRect:O.element.getBoundingClientRect()});T=[O,P===_?I:D];break}default:{T=v;break}}}else v.length?T=v:T=[n==="horizontal"?new DOMRect(_.right,C.top,C.left-_.right,C.height):new DOMRect(C.left,_.bottom,C.width,C.top-_.bottom)];for(const D of T){let I="width"in D?D:D.element.getBoundingClientRect();const O=jO()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(I.width<O){const j=O-I.width;I=new DOMRect(I.x-j/2,I.y,I.width+j,I.height)}if(I.height<O){const j=O-I.height;I=new DOMRect(I.x,I.y-j/2,I.width,I.height+j)}const P=x<=f||x>p;!c&&!P&&l.push({group:e,groupSize:Ka({group:e}),panels:[g,w],separator:"width"in D?void 0:D,rect:I}),c=!1}}d=!1,g=w,v=[]}}else if(S.hasAttribute("data-separator")){S.ariaDisabled!==null&&(c=!0);const w=o.find(_=>_.element===S);w?v.push(w):(g=void 0,v=[])}else d=!0}return l}class Pw{#e={};addListener(t,n){const i=this.#e[t];return i===void 0?this.#e[t]=[n]:i.includes(n)||i.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const i=this.#e[t];if(i!==void 0)if(i.length===1)i[0].call(null,n);else{let o=!1,s=null;const l=Array.from(i);for(let c=0;c<l.length;c++){const d=l[c];try{d.call(null,n)}catch(f){s===null&&(o=!0,s=f)}}if(o)throw s}}removeAllListeners(){this.#e={}}removeListener(t,n){const i=this.#e[t];if(i!==void 0){const o=i.indexOf(n);o>=0&&i.splice(o,1)}}}let Ua={cursorFlags:0,state:"inactive"};const Qg=new Pw;function Ro(){return Ua}function BO(e){return Qg.addListener("change",e)}function UO(e){const t=Ua,n={...Ua};n.cursorFlags=e,Ua=n,Qg.emit("change",{prev:t,next:n})}function Va(e){const t=Ua;Ua=e,Qg.emit("change",{prev:t,next:e})}const VO=e=>e,Hp=()=>{},Hw=1,jw=2,Bw=4,Uw=8,lS=3,uS=12;let dc;function cS(){return dc===void 0&&(dc=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(dc=!0)),dc}function FO({cursorFlags:e,groups:t,state:n}){let i=0,o=0;switch(n){case"active":case"hover":t.forEach(s=>{if(!s.mutableState.disableCursor)switch(s.orientation){case"horizontal":{i++;break}case"vertical":{o++;break}}})}if(!(i===0&&o===0)){switch(n){case"active":{if(e&&cS()){const s=(e&Hw)!==0,l=(e&jw)!==0,c=(e&Bw)!==0,d=(e&Uw)!==0;if(s)return c?"se-resize":d?"ne-resize":"e-resize";if(l)return c?"sw-resize":d?"nw-resize":"w-resize";if(c)return"s-resize";if(d)return"n-resize"}break}}return cS()?i>0&&o>0?"move":i>0?"ew-resize":"ns-resize":i>0&&o>0?"grab":i>0?"col-resize":"row-resize"}}const dS=new WeakMap;function Zg(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=dS.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));const i=Ro();switch(i.state){case"active":case"hover":{const o=FO({cursorFlags:i.cursorFlags,groups:i.hitRegions.map(l=>l.group),state:i.state}),s=`*, *:hover {cursor: ${o} !important; }`;if(t===s)return;t=s,o?n.cssRules.length===0?n.insertRule(s):n.replaceSync(s):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}dS.set(e,{prevStyle:t,styleSheet:n})}let bi=new Map;const Vw=new Pw;function GO(e){bi=new Map(bi),bi.delete(e)}function fS(e,t){for(const[n]of bi)if(n.id===e)return n}function Ur(e,t){for(const[n,i]of bi)if(n.id===e)return i;if(t)throw Error(`Could not find data for Group with id ${e}`)}function Bo(){return bi}function Jg(e,t){return Vw.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function nr(e,t,n){const i=bi.get(e);bi=new Map(bi),bi.set(e,t),Vw.emit("groupChange",{group:e,isUserInteraction:n?.isUserInteraction===!0,prev:i,next:t})}function Fw(e){const t=Ro();let n=!1;return t.state==="active"&&(Va({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(Zg(e),n=!0,t.hitRegions.forEach(i=>{const o=Ur(i.group.id,!0);nr(i.group,o,{isUserInteraction:!0})}))),n}function hS(e){e.defaultPrevented||Fw(e.currentTarget)}function $O(e,t,n){let i,o={x:1/0,y:1/0};for(const s of t){const l=Nw(n,s.rect);switch(e){case"horizontal":{l.x<=o.x&&(i=s,o=l);break}case"vertical":{l.y<=o.y&&(i=s,o=l);break}}}return i?{distance:o,hitRegion:i}:void 0}function qO(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function WO(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:gS(e),b:gS(t)};let i;for(;n.a.at(-1)===n.b.at(-1);)i=n.a.pop(),n.b.pop();tt(i,"Stacking order can only be calculated for elements with a common ancestor");const o={a:mS(pS(n.a)),b:mS(pS(n.b))};if(o.a===o.b){const s=i.childNodes,l={a:n.a.at(-1),b:n.b.at(-1)};let c=s.length;for(;c--;){const d=s[c];if(d===l.a)return 1;if(d===l.b)return-1}}return Math.sign(o.a-o.b)}const YO=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function XO(e){const t=getComputedStyle(Gw(e)??e).display;return t==="flex"||t==="inline-flex"}function KO(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||XO(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||YO.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function pS(e){let t=e.length;for(;t--;){const n=e[t];if(tt(n,"Missing node"),KO(n))return n}return null}function mS(e){return e&&Number(getComputedStyle(e).zIndex)||0}function gS(e){const t=[];for(;e;)t.push(e),e=Gw(e);return t}function Gw(e){const{parentNode:t}=e;return qO(t)?t.host:t}function QO(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function ZO({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!Iw(n)||n.contains(e)||e.contains(n))return!0;if(WO(n,e)>0){let i=n;for(;i;){if(i.contains(e))return!0;if(QO(i.getBoundingClientRect(),t))return!1;i=i.parentElement}}return!0}function ey(e,t){const n=[];return t.forEach((i,o)=>{if(o.disabled)return;const s=zw(o),l=$O(o.orientation,s,{x:e.clientX,y:e.clientY});l&&l.distance.x<=0&&l.distance.y<=0&&ZO({groupElement:o.element,hitRegion:l.hitRegion.rect,pointerEventTarget:e.target})&&n.push(l.hitRegion)}),n}function JO(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function qt(e,t,n=0){return Math.abs(tn(e)-tn(t))<=n}function hi(e,t){return qt(e,t)?0:e>t?1:-1}function Ha({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:i}){const{collapsedSize:o=0,collapsible:s,disabled:l,maxSize:c=100,minSize:d=0}=t;if(l&&!e)return n;if(hi(i,d)<0)if(s){const f=(o+d)/2;hi(i,f)<0?i=o:i=d}else i=d;return i=Math.min(c,i),i=tn(i),i}function Sl({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:i,prevLayout:o,trigger:s}){if(qt(e,0))return t;const l=s==="imperative-api",c=Object.values(t),d=Object.values(o),f=[...c],[p,m]=i;tt(p!=null,"Invalid first pivot index"),tt(m!=null,"Invalid second pivot index");let g=0;switch(s){case"keyboard":{{const S=e<0?m:p,w=n[S];tt(w,`Panel constraints not found for index ${S}`);const{collapsedSize:_=0,collapsible:C,minSize:T=0}=w;if(C){const D=c[S];if(tt(D!=null,`Previous layout not found for panel index ${S}`),qt(D,_)){const I=T-D;hi(I,Math.abs(e))>0&&(e=e<0?0-I:I)}}}{const S=e<0?p:m,w=n[S];tt(w,`No panel constraints found for index ${S}`);const{collapsedSize:_=0,collapsible:C,minSize:T=0}=w;if(C){const D=c[S];if(tt(D!=null,`Previous layout not found for panel index ${S}`),qt(D,T)){const I=D-_;hi(I,Math.abs(e))>0&&(e=e<0?0-I:I)}}}break}default:{const S=e<0?m:p,w=n[S];tt(w,`Panel constraints not found for index ${S}`);const _=c[S],{collapsible:C,collapsedSize:T,minSize:D}=w;if(C&&hi(_,D)<0)if(e>0){const I=D-T,O=I/2,P=_+e;hi(P,D)<0&&(e=hi(e,O)<=0?0:I)}else{const I=D-T,O=100-I/2,P=_-e;hi(P,D)<0&&(e=hi(100+e,O)>0?0:-I)}break}}{const S=e<0?1:-1;let w=e<0?m:p,_=0;for(;;){const T=c[w];tt(T!=null,`Previous layout not found for panel index ${w}`);const D=Ha({overrideDisabledPanels:l,panelConstraints:n[w],prevSize:T,size:100})-T;if(_+=D,w+=S,w<0||w>=n.length)break}const C=Math.min(Math.abs(e),Math.abs(_));e=e<0?0-C:C}{let S=e<0?p:m;for(;S>=0&&S<n.length;){const w=Math.abs(e)-Math.abs(g),_=c[S];tt(_!=null,`Previous layout not found for panel index ${S}`);const C=_-w,T=Ha({overrideDisabledPanels:l,panelConstraints:n[S],prevSize:_,size:C});if(!qt(_,T)&&(g+=_-T,f[S]=T,g.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?S--:S++}}if(JO(d,f))return o;{const S=e<0?m:p,w=c[S];tt(w!=null,`Previous layout not found for panel index ${S}`);const _=w+g,C=Ha({overrideDisabledPanels:l,panelConstraints:n[S],prevSize:w,size:_});if(f[S]=C,!qt(C,_)){let T=_-C,D=e<0?m:p;for(;D>=0&&D<n.length;){const I=f[D];tt(I!=null,`Previous layout not found for panel index ${D}`);const O=I+T,P=Ha({overrideDisabledPanels:l,panelConstraints:n[D],prevSize:I,size:O});if(qt(I,P)||(T-=P-I,f[D]=P),qt(T,0))break;e>0?D--:D++}}}const v=Object.values(f).reduce((S,w)=>w+S,0);if(!qt(v,100,.1))return o;const x=Object.keys(o);return f.reduce((S,w,_)=>(S[x[_]]=w,S),{})}function Oo(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||hi(e[n],t[n])!==0)return!1;return!0}function Do({layout:e,panelConstraints:t}){const n=Object.values(e),i=[...n],o=i.reduce((c,d)=>c+d,0);if(i.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${i.map(c=>`${c}%`).join(", ")}`);if(!qt(o,100)&&i.length>0)for(let c=0;c<t.length;c++){const d=i[c];tt(d!=null,`No layout data found for index ${c}`);const f=100/o*d;i[c]=f}let s=0;for(let c=0;c<t.length;c++){const d=n[c];tt(d!=null,`No layout data found for index ${c}`);const f=i[c];tt(f!=null,`No layout data found for index ${c}`);const p=Ha({overrideDisabledPanels:!0,panelConstraints:t[c],prevSize:d,size:f});f!=p&&(s+=f-p,i[c]=p)}if(!qt(s,0))for(let c=0;c<t.length;c++){const d=i[c];tt(d!=null,`No layout data found for index ${c}`);const f=d+s,p=Ha({overrideDisabledPanels:!0,panelConstraints:t[c],prevSize:d,size:f});if(d!==p&&(s-=p-d,i[c]=p,qt(s,0)))break}const l=Object.keys(e);return i.reduce((c,d,f)=>(c[l[f]]=d,c),{})}function $w({groupId:e,panelId:t}){const n=()=>{const d=Bo();for(const[f,{defaultLayoutDeferred:p,derivedPanelConstraints:m,layout:g,groupSize:v,separatorToPanels:x}]of d)if(f.id===e)return{defaultLayoutDeferred:p,derivedPanelConstraints:m,group:f,groupSize:v,layout:g,separatorToPanels:x};throw Error(`Group ${e} not found`)},i=()=>{const d=n().derivedPanelConstraints.find(f=>f.panelId===t);if(d!==void 0)return d;throw Error(`Panel constraints not found for Panel ${t}`)},o=()=>{const d=n().group.panels.find(f=>f.id===t);if(d!==void 0)return d;throw Error(`Layout not found for Panel ${t}`)},s=()=>{const d=n().layout[t];if(d!==void 0)return d;throw Error(`Layout not found for Panel ${t}`)},l=({nextSize:d,panels:f,prevLayout:p,derivedPanelConstraints:m})=>{const g=s(),v=f.findIndex(w=>w.id===t),x=v===0,S=v===f.length-1;if(S&&d<g&&(x||f.slice(0,v).every((w,_)=>{const C=m[_];return C?.collapsible&&qt(C.collapsedSize,p[C.panelId])}))){const w=f.slice(0,v).reduce((_,C)=>_+p[C.id],0);return{...p,[t]:tn(100-w)}}return Sl({delta:S?g-d:d-g,initialLayout:p,panelConstraints:m,pivotIndices:S?[v-1,v]:[v,v+1],prevLayout:p,trigger:"imperative-api"})},c=d=>{const f=s();if(d===f)return;const{defaultLayoutDeferred:p,derivedPanelConstraints:m,group:g,groupSize:v,layout:x,separatorToPanels:S}=n(),w=l({nextSize:d,panels:g.panels,prevLayout:x,derivedPanelConstraints:m}),_=Do({layout:w,panelConstraints:m});Oo(x,_)||nr(g,{defaultLayoutDeferred:p,derivedPanelConstraints:m,groupSize:v,layout:_,separatorToPanels:S})};return{collapse:()=>{const{collapsible:d,collapsedSize:f}=i(),{mutableValues:p}=o(),m=s();d&&m!==f&&(p.expandToSize=m,c(f))},expand:()=>{const{collapsible:d,collapsedSize:f,minSize:p}=i(),{mutableValues:m}=o(),g=s();if(d&&g===f){let v=m.expandToSize??p;v===0&&(v=1),c(v)}},getSize:()=>{const{group:d}=n(),f=s(),{element:p}=o(),m=d.orientation==="horizontal"?p.offsetWidth:p.offsetHeight;return{asPercentage:f,inPixels:m}},isCollapsed:()=>{const{collapsible:d,collapsedSize:f}=i(),p=s();return d&&qt(f,p)},resize:d=>{const{group:f}=n(),{element:p}=o(),m=Ka({group:f}),g=al({groupSize:m,panelElement:p,styleProp:d}),v=tn(g/m*100);c(v)}}}function yS(e){if(e.defaultPrevented)return;const t=Bo();ey(e,t).forEach(n=>{if(n.separator&&!n.separator.disableDoubleClick){const i=n.panels.find(o=>o.panelConstraints.defaultSize!==void 0);if(i){const o=i.panelConstraints.defaultSize,s=$w({groupId:n.group.id,panelId:i.id});s&&o!==void 0&&(s.resize(o),e.preventDefault())}}})}function Xc(e){const t=Bo();for(const[n]of t)if(n.separators.some(i=>i.element===e))return n;throw Error("Could not find parent Group for separator element")}function qw({groupId:e}){const t=()=>{const n=Bo();for(const[i,o]of n)if(i.id===e)return{group:i,...o};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:i}=t();return n?{}:i},setLayout(n){const{defaultLayoutDeferred:i,derivedPanelConstraints:o,group:s,groupSize:l,layout:c,separatorToPanels:d}=t(),f=Do({layout:n,panelConstraints:o});return i?c:(Oo(c,f)||nr(s,{defaultLayoutDeferred:i,derivedPanelConstraints:o,groupSize:l,layout:f,separatorToPanels:d}),f)}}}function mo(e,t){const n=Xc(e),i=Ur(n.id,!0),o=n.separators.find(p=>p.element===e);tt(o,"Matching separator not found");const s=i.separatorToPanels.get(o);tt(s,"Matching panels not found");const l=s.map(p=>n.panels.indexOf(p)),c=qw({groupId:n.id}).getLayout(),d=Sl({delta:t,initialLayout:c,panelConstraints:i.derivedPanelConstraints,pivotIndices:l,prevLayout:c,trigger:"keyboard"}),f=Do({layout:d,panelConstraints:i.derivedPanelConstraints});Oo(c,f)||nr(n,{defaultLayoutDeferred:i.defaultLayoutDeferred,derivedPanelConstraints:i.derivedPanelConstraints,groupSize:i.groupSize,layout:f,separatorToPanels:i.separatorToPanels},{isUserInteraction:!0})}function vS(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=Xc(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&mo(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&mo(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&mo(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&mo(t,-5);break}case"End":{e.preventDefault(),mo(t,100);break}case"Enter":{e.preventDefault();const i=Xc(t),o=Ur(i.id,!0),{derivedPanelConstraints:s,layout:l,separatorToPanels:c}=o,d=i.separators.find(g=>g.element===t);tt(d,"Matching separator not found");const f=c.get(d);tt(f,"Matching panels not found");const p=f[0],m=s.find(g=>g.panelId===p.id);if(tt(m,"Panel metadata not found"),m.collapsible){const g=l[p.id],v=m.collapsedSize===g?i.mutableState.expandedPanelSizes[p.id]??m.minSize:m.collapsedSize;mo(t,v-g)}break}case"F6":{e.preventDefault();const i=Xc(t).separators.map(l=>l.element),o=Array.from(i).findIndex(l=>l===e.currentTarget);tt(o!==null,"Index not found");const s=e.shiftKey?o>0?o-1:i.length-1:o+1<i.length?o+1:0;i[s].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),mo(t,-100);break}}}function bS(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=Bo(),n=ey(e,t),i=new Map;let o=!1;n.forEach(s=>{s.separator&&(o||(o=!0,s.separator.element.focus({focusVisible:!1,preventScroll:!0})));const l=t.get(s.group);l&&i.set(s.group,l.layout)}),Va({cursorFlags:0,hitRegions:n,initialLayoutMap:i,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}function Ww({document:e,event:t,hitRegions:n,initialLayoutMap:i,mountedGroups:o,pointerDownAtPoint:s,prevCursorFlags:l}){let c=0;n.forEach(f=>{const{group:p,groupSize:m}=f,{orientation:g,panels:v}=p,{disableCursor:x}=p.mutableState;let S=0;s?g==="horizontal"?S=(t.clientX-s.x)/m*100:S=(t.clientY-s.y)/m*100:g==="horizontal"?S=t.clientX<0?-100:100:S=t.clientY<0?-100:100;const w=i.get(p),_=o.get(p);if(!w||!_)return;const{defaultLayoutDeferred:C,derivedPanelConstraints:T,groupSize:D,layout:I,separatorToPanels:O}=_;if(T&&I&&O){const P=Sl({delta:S,initialLayout:w,panelConstraints:T,pivotIndices:f.panels.map(j=>v.indexOf(j)),prevLayout:I,trigger:"mouse-or-touch"});if(Oo(P,I)){if(S!==0&&!x)switch(g){case"horizontal":{c|=S<0?Hw:jw;break}case"vertical":{c|=S<0?Bw:Uw;break}}}else nr(f.group,{defaultLayoutDeferred:C,derivedPanelConstraints:T,groupSize:D,layout:P,separatorToPanels:O})}});let d=0;t.movementX===0?d|=l&lS:d|=c&lS,t.movementY===0?d|=l&uS:d|=c&uS,UO(d),Zg(e)}function xS(e){const t=Bo(),n=Ro();n.state==="active"&&Ww({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}function SS(e){if(e.defaultPrevented)return;const t=Ro(),n=Bo();switch(t.state){case"active":{if(e.buttons===0){Va({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(i=>{const o=Ur(i.group.id,!0);nr(i.group,o,{isUserInteraction:!0})});return}for(const i of t.hitRegions)if(i.separator){const{element:o}=i.separator;o.hasPointerCapture?.(e.pointerId)||o.setPointerCapture?.(e.pointerId)}Ww({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const i=ey(e,n);i.length===0?t.state!=="inactive"&&Va({cursorFlags:0,state:"inactive"}):Va({cursorFlags:0,hitRegions:i,state:"hover"}),Zg(e.currentTarget);break}}}function _S(e){e.relatedTarget instanceof HTMLIFrameElement&&Ro().state==="hover"&&Va({cursorFlags:0,state:"inactive"})}function CS(e){e.defaultPrevented||e.pointerType==="mouse"&&e.button>0||Fw(e.currentTarget)&&e.preventDefault()}function wS(e){let t=0,n=0;const i={};for(const s of e)if(s.defaultSize!==void 0){t++;const l=tn(s.defaultSize);n+=l,i[s.panelId]=l}else i[s.panelId]=void 0;const o=e.length-t;if(o!==0){const s=tn((100-n)/o);for(const l of e)l.defaultSize===void 0&&(i[l.panelId]=s)}return i}function eD(e,t,n){if(!n[0])return;const i=e.panels.find(d=>d.element===t);if(!i||!i.onResize)return;const o=Ka({group:e}),s=e.orientation==="horizontal"?i.element.offsetWidth:i.element.offsetHeight,l=i.mutableValues.prevSize,c={asPercentage:tn(s/o*100),inPixels:s};i.mutableValues.prevSize=c,i.onResize(c,i.id,l)}function tD(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function nD({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:i}){if(n<=0||t<=0||n===t)return i;let o=0,s=0,l=!1;const c=new Map,d=[];for(const m of e.panels){const g=i[m.id]??0;if(m.panelConstraints.groupResizeBehavior==="preserve-pixel-size"){l=!0;const v=g/100*n,x=tn(v/t*100);c.set(m.id,x),o+=x}else d.push(m.id),s+=g}if(!l||d.length===0)return i;const f=100-o,p={...i};if(c.forEach((m,g)=>{p[g]=m}),s>0)for(const m of d){const g=i[m]??0;p[m]=tn(g/s*f)}else{const m=tn(f/d.length);for(const g of d)p[g]=m}return p}function iD(e,t){const n=e.map(o=>o.id),i=Object.keys(t);if(n.length!==i.length)return!1;for(const o of n)if(!i.includes(o))return!1;return!0}const Ra=new Map;function rD(e){let t=!0;tt(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,i=new Set,o=new Set,s=new n(x=>{for(const S of x){const{borderBoxSize:w,target:_}=S;if(_===e.element){if(t){const C=Ka({group:e});if(C===0)return;const T=Ur(e.id);if(!T)return;const D=Um(e),I=T.defaultLayoutDeferred?wS(D):T.layout,O=nD({group:e,nextGroupSize:C,prevGroupSize:T.groupSize,prevLayout:I}),P=Do({layout:O,panelConstraints:D});if(!T.defaultLayoutDeferred&&Oo(T.layout,P)&&tD(T.derivedPanelConstraints,D)&&T.groupSize===C)return;nr(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:D,groupSize:C,layout:P,separatorToPanels:T.separatorToPanels})}}else eD(e,_,w)}});s.observe(e.element),e.panels.forEach(x=>{tt(!i.has(x.id),`Panel ids must be unique; id "${x.id}" was used more than once`),i.add(x.id),x.onResize&&s.observe(x.element)});const l=Ka({group:e}),c=Um(e),d=e.panels.map(({id:x})=>x).join(",");let f=e.mutableState.defaultLayout;f&&(iD(e.panels,f)||(f=void 0));const p=e.mutableState.layouts[d]??f??wS(c),m=Do({layout:p,panelConstraints:c}),g=e.element.ownerDocument;Ra.set(g,(Ra.get(g)??0)+1);const v=new Map;return zw(e).forEach(x=>{x.separator&&v.set(x.separator,x.panels)}),nr(e,{defaultLayoutDeferred:l===0,derivedPanelConstraints:c,groupSize:l,layout:m,separatorToPanels:v}),e.separators.forEach(x=>{tt(!o.has(x.id),`Separator ids must be unique; id "${x.id}" was used more than once`),o.add(x.id),x.element.addEventListener("keydown",vS)}),Ra.get(g)===1&&(g.addEventListener("contextmenu",hS,!0),g.addEventListener("dblclick",yS,!0),g.addEventListener("pointerdown",bS,!0),g.addEventListener("pointerleave",xS),g.addEventListener("pointermove",SS),g.addEventListener("pointerout",_S),g.addEventListener("pointerup",CS,!0)),function(){t=!1,Ra.set(g,Math.max(0,(Ra.get(g)??0)-1)),GO(e),e.separators.forEach(x=>{x.element.removeEventListener("keydown",vS)}),Ra.get(g)||(g.removeEventListener("contextmenu",hS,!0),g.removeEventListener("dblclick",yS,!0),g.removeEventListener("pointerdown",bS,!0),g.removeEventListener("pointerleave",xS),g.removeEventListener("pointermove",SS),g.removeEventListener("pointerout",_S),g.removeEventListener("pointerup",CS,!0)),s.disconnect()}}function oD(){const[e,t]=M.useState({}),n=M.useCallback(()=>t({}),[]);return[e,n]}function ty(e){const t=M.useId();return`${e??t}`}const Uo=typeof window<"u"?M.useLayoutEffect:M.useEffect;function fl(e){const t=M.useRef(e);return Uo(()=>{t.current=e},[e]),M.useCallback((...n)=>t.current?.(...n),[t])}function ny(...e){return fl(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function iy(e){const t=M.useRef({...e});return Uo(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const Yw=M.createContext(null);function aD(e,t){const n=M.useRef({getLayout:()=>({}),setLayout:VO});M.useImperativeHandle(t,()=>n.current,[]),Uo(()=>{Object.assign(n.current,qw({groupId:e}))})}function Xw({children:e,className:t,defaultLayout:n,disableCursor:i,disabled:o,elementRef:s,groupRef:l,id:c,onLayoutChange:d,onLayoutChanged:f,orientation:p="horizontal",resizeTargetMinimumSize:m={coarse:20,fine:10},style:g,...v}){const x=M.useRef({onLayoutChange:{},onLayoutChanged:{}}),S=fl(G=>{Oo(x.current.onLayoutChange,G)||(x.current.onLayoutChange=G,d?.(G))}),w=fl((G,B)=>{Oo(x.current.onLayoutChanged,G)||(x.current.onLayoutChanged=G,f?.(G,{isUserInteraction:B}))}),_=ty(c),C=M.useRef(null),[T,D]=oD(),I=M.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:m,separators:[]}),O=ny(C,s);aD(_,l);const P=fl((G,B)=>{const ee=Ro(),Z=fS(G),W=Ur(G);if(W){let z=!1;return ee.state==="active"&&(z=ee.hitRegions.some(q=>q.group===Z)),{flexGrow:W.layout[B]??1,pointerEvents:z?"none":void 0}}if(n?.[B])return{flexGrow:n?.[B]}}),j=iy({defaultLayout:n,disableCursor:i}),F=M.useMemo(()=>({get disableCursor(){return!!j.disableCursor},getPanelStyles:P,id:_,orientation:p,registerPanel:G=>{const B=I.current;return B.panels=Vm(p,[...B.panels,G]),D(),()=>{B.panels=B.panels.filter(ee=>ee!==G),D()}},registerSeparator:G=>{const B=I.current;return B.separators=Vm(p,[...B.separators,G]),D(),()=>{B.separators=B.separators.filter(ee=>ee!==G),D()}},updatePanelProps:(G,{disabled:B})=>{const ee=I.current.panels.find(z=>z.id===G);ee&&(ee.panelConstraints.disabled=B);const Z=fS(_),W=Ur(_);Z&&W&&nr(Z,{...W,derivedPanelConstraints:Um(Z)})},updateSeparatorProps:(G,{disabled:B,disableDoubleClick:ee})=>{const Z=I.current.separators.find(W=>W.id===G);Z&&(Z.disabled=B,Z.disableDoubleClick=ee)}}),[P,_,D,p,j]),Q=M.useRef(null);return Uo(()=>{const G=C.current;if(G===null)return;const B=I.current;let ee;if(j.defaultLayout!==void 0&&Object.keys(j.defaultLayout).length===B.panels.length){ee={};for(const R of B.panels){const H=j.defaultLayout[R.id];H!==void 0&&(ee[R.id]=H)}}const Z={disabled:!!o,element:G,id:_,mutableState:{defaultLayout:ee,disableCursor:!!j.disableCursor,expandedPanelSizes:I.current.lastExpandedPanelSizes,layouts:I.current.layouts},orientation:p,panels:B.panels,resizeTargetMinimumSize:B.resizeTargetMinimumSize,separators:B.separators};Q.current=Z;const W=rD(Z),{defaultLayoutDeferred:z,derivedPanelConstraints:q,layout:te}=Ur(Z.id,!0);!z&&q.length>0&&(S(te),w(te,!1));const ce=Jg(_,R=>{const{defaultLayoutDeferred:H,derivedPanelConstraints:Y,layout:N}=R.next;if(H||Y.length===0)return;const se=Z.panels.map(({id:le})=>le).join(",");Z.mutableState.layouts[se]=N,Y.forEach(le=>{if(le.collapsible){const{layout:be}=R.prev??{};if(be){const Ee=qt(le.collapsedSize,N[le.panelId]),ge=qt(le.collapsedSize,be[le.panelId]);Ee&&!ge&&(Z.mutableState.expandedPanelSizes[le.panelId]=be[le.panelId])}}});const de=Ro().state!=="active";S(N),de&&w(N,R.isUserInteraction)});return()=>{Q.current=null,W(),ce()}},[o,_,w,S,p,T,j]),M.useEffect(()=>{const G=Q.current;G&&(G.mutableState.defaultLayout=n,G.mutableState.disableCursor=!!i)}),k.jsx(Yw.Provider,{value:F,children:k.jsx("div",{...v,className:t,"data-group":!0,"data-testid":_,id:_,ref:O,style:{height:"100%",width:"100%",overflow:"hidden",...g,display:"flex",flexDirection:p==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:p==="horizontal"?"pan-y":"pan-x"},children:e})})}Xw.displayName="Group";function Kc(e,t){return`react-resizable-panels:${[e,...t].join(":")}`}function sD({id:e,panelIds:t,storage:n}){const i=Kc(e,[]),o=n.getItem(i);if(o)try{const s=JSON.parse(o);if(t){const l=t.join(","),c=s[l];if(c&&Array.isArray(c.layout)&&t.length===c.layout.length){const d={};for(let f=0;f<t.length;f++)d[t[f]]=c.layout[f];return d}}else{const l=Object.keys(s);if(l.length===1){const c=s[l[0]];if(c&&Array.isArray(c.layout)){const d=l[0].split(",");if(d.length===c.layout.length){const f={};for(let p=0;p<d.length;p++)f[d[p]]=c.layout[p];return f}}}}}catch{}}function lD({debounceSaveMs:e=100,onlySaveAfterUserInteractions:t,panelIds:n,storage:i=localStorage,...o}){const s=n!==void 0,l="id"in o?o.id:o.groupId,c=Kc(l,n??[]),d=M.useSyncExternalStore(uD,()=>i.getItem(c),()=>i.getItem(c)),f=M.useMemo(()=>{if(d){const w=JSON.parse(d),_=Object.values(w);if(Array.from(_).every(C=>typeof C=="number"))return w}},[d]),p=M.useMemo(()=>{if(!f)return sD({id:l,panelIds:n,storage:i})},[f,l,n,i]),m=f??p,g=M.useRef(null),v=M.useCallback(()=>{const w=g.current;w&&(g.current=null,clearTimeout(w))},[]);M.useLayoutEffect(()=>()=>{v()},[v]);const x=M.useCallback((w,_)=>{if(!_.isUserInteraction)return;v();let C;s?C=Kc(l,Object.keys(w)):C=Kc(l,[]);try{i.setItem(C,JSON.stringify(w))}catch(T){console.error(T)}},[v,s,l,t,i]),S=M.useCallback(w=>{v(),e===0?x(w,{isUserInteraction:!1}):g.current=setTimeout(()=>{x(w,{isUserInteraction:!1})},e)},[v,e,x]);return{defaultLayout:m,onLayoutChange:S,onLayoutChanged:x}}function uD(){return function(){}}function ry(){const e=M.useContext(Yw);return tt(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function cD(e,t){const{id:n}=ry(),i=M.useRef({collapse:Hp,expand:Hp,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Hp});M.useImperativeHandle(t,()=>i.current,[]),Uo(()=>{Object.assign(i.current,$w({groupId:n,panelId:e}))})}function Kw({children:e,className:t,collapsedSize:n="0%",collapsible:i=!1,defaultSize:o,disabled:s,elementRef:l,groupResizeBehavior:c="preserve-relative-size",id:d,maxSize:f="100%",minSize:p="0%",onResize:m,panelRef:g,style:v,...x}){const S=!!d,w=ty(d),_=iy({disabled:s}),C=M.useRef(null),T=ny(C,l),{getPanelStyles:D,id:I,orientation:O,registerPanel:P,updatePanelProps:j}=ry(),F=m!==null,Q=fl((Z,W,z)=>{m?.(Z,d,z)});Uo(()=>{const Z=C.current;if(Z!==null){const W={element:Z,id:w,idIsStable:S,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:F?Q:void 0,panelConstraints:{groupResizeBehavior:c,collapsedSize:n,collapsible:i,defaultSize:o,disabled:_.disabled,maxSize:f,minSize:p}};return P(W)}},[c,n,i,o,F,w,S,f,p,Q,P,_]),M.useEffect(()=>{j(w,{disabled:s})},[s,w,j]),cD(w,g);const G=()=>{const Z=D(I,w);if(Z)return JSON.stringify(Z)},B=M.useSyncExternalStore(Z=>Jg(I,Z),G,G);let ee;return B?ee=JSON.parse(B):o!==void 0?ee={flexGrow:void 0,flexShrink:void 0,flexBasis:o}:ee={flexGrow:1},k.jsx("div",{...x,"data-disabled":s||void 0,"data-panel":!0,"data-testid":w,id:w,ref:T,style:{...dD,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...ee},children:k.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...v,touchAction:O==="horizontal"?"pan-y":"pan-x"},children:e})})}Kw.displayName="Panel";const dD={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function fD({layout:e,panelConstraints:t,panelId:n,panelIndex:i}){let o,s;const l=e[n],c=t.find(d=>d.panelId===n);if(c){const d=c.maxSize,f=c.collapsible?c.collapsedSize:c.minSize,p=[i,i+1];s=Do({layout:Sl({delta:f-l,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e}),panelConstraints:t})[n],o=Do({layout:Sl({delta:d-l,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:o,valueMin:s,valueNow:l}}function Qw({children:e,className:t,disabled:n,disableDoubleClick:i,elementRef:o,id:s,style:l,...c}){const d=ty(s),f=iy({disabled:n,disableDoubleClick:i}),[p,m]=M.useState({}),[g,v]=M.useState("inactive"),[x,S]=M.useState(!1),w=M.useRef(null),_=ny(w,o),{disableCursor:C,id:T,orientation:D,registerSeparator:I,updateSeparatorProps:O}=ry(),P=D==="horizontal"?"vertical":"horizontal";Uo(()=>{const Q=w.current;if(Q!==null){const G={disabled:f.disabled,disableDoubleClick:f.disableDoubleClick,element:Q,id:d},B=I(G),ee=BO(W=>{v(W.next.state!=="inactive"&&W.next.hitRegions.some(z=>z.separator===G)?W.next.state:"inactive")}),Z=Jg(T,W=>{const{derivedPanelConstraints:z,layout:q,separatorToPanels:te}=W.next,ce=te.get(G);if(ce){const R=ce[0],H=ce.indexOf(R);m(fD({layout:q,panelConstraints:z,panelId:R.id,panelIndex:H}))}});return()=>{ee(),Z(),B()}}},[T,d,I,f]),M.useEffect(()=>{O(d,{disabled:n,disableDoubleClick:i})},[n,i,d,O]);let j;n&&!C&&(j="not-allowed");let F;return n?F="disabled":g==="active"?F="active":x?F="focus":F=g,k.jsx("div",{...c,"aria-controls":p.valueControls,"aria-disabled":n||void 0,"aria-orientation":P,"aria-valuemax":p.valueMax,"aria-valuemin":p.valueMin,"aria-valuenow":p.valueNow,children:e,className:t,"data-separator":F,"data-testid":d,id:d,onBlur:()=>S(!1),onFocus:()=>S(!0),ref:_,role:"separator",style:{flexBasis:"auto",cursor:j,...l,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}Qw.displayName="Separator";function Zw(e){switch(e.kind){case"review":return"api/review.json";case"agent-md":return hD(e);case"hunks":return`api/hunks/${encodeURIComponent(e.group)}.json`;case"file":return`api/files/${e.side}/${fc(e.path)}.json`;case"blame":return`api/blame/${e.side}/${fc(e.path)}.json`;case"image":return`api/images/${e.side}/${fc(e.path)}`;case"patch":return`api/patches/${fc(e.path)}.json`}}function fc(e){return e.split("/").map(encodeURIComponent).join("/")}function hD(e){return e.target==="overview"?"api/agent/overview.md":`api/agent/groups/${encodeURIComponent(e.group)}.md`}function ud(e){return new URL(Zw(e),new URL("./",document.baseURI)).href}async function Pl(e){const t=new URL(Zw(e),new URL("./",document.baseURI)).href,n=await fetch(t),i=await n.text();if(!n.ok){let o=i;try{const s=JSON.parse(i);s.error!==void 0&&(o=s.error)}catch{}throw new Error(o)}return JSON.parse(i)}function pD(){return Pl({kind:"review"})}function mD(e){return Pl({kind:"hunks",group:e})}function gD(e){return Pl({kind:"patch",path:e})}function Jw(e,t){return Pl({kind:"file",path:e,side:t})}function yD(e,t){return Pl({kind:"blame",path:e,side:t})}function vD(e){return e.slice(0,7)}function e1(e,t){return e.findIndex(n=>n.id===t)+1}function hl(e){return String(e).padStart(2,"0")}function t1(e){return e.replace("-"," ")}const n1=180,Mo={review:"Reading the review.",group:"Reading git.",file:"Reading this file.",blame:"Reading blame.",lockfile:"Reading the lockfile."};function bD(e,t,n=n1){return e&&t>=n}var xD=Object.defineProperty,oy=(e,t)=>xD(e,"name",{value:t,configurable:!0});function Fm(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}oy(Fm,"setRef");function i1(...e){return t=>{let n=!1;const i=e.map(o=>{const s=Fm(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<i.length;o++){const s=i[o];typeof s=="function"?s():Fm(e[o],null)}}}}oy(i1,"composeRefs");function Vo(...e){return M.useCallback(i1(...e),e)}oy(Vo,"useComposedRefs");var SD=Object.defineProperty,ni=(e,t)=>SD(e,"name",{value:t,configurable:!0});function ay(e){const t=M.forwardRef((n,i)=>{let{children:o,...s}=n,l=null,c=!1;const d=[];Gm(o)&&typeof hc=="function"&&(o=hc(o._payload)),M.Children.forEach(o,g=>{if(u1(g)){c=!0;const v=g;let x="child"in v.props?v.props.child:v.props.children;Gm(x)&&typeof hc=="function"&&(x=hc(x._payload)),l=_D(v,x),d.push(l?.props?.children)}else d.push(g)}),l?l=M.cloneElement(l,void 0,d):!c&&M.Children.count(o)===1&&M.isValidElement(o)&&(l=o);const f=l?l1(l):void 0,p=Vo(i,f);if(!l){if(o||o===0)throw new Error(c?ED(e):wD(e));return o}const m=s1(s,l.props??{});return l.type!==M.Fragment&&(m.ref=i?p:f),M.cloneElement(l,m)});return t.displayName=`${e}.Slot`,t}ni(ay,"createSlot");var r1=ay("Slot"),o1=Symbol.for("radix.slottable");function a1(e){const t=ni(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=o1,t}ni(a1,"createSlottable");var _D=ni((e,t)=>{if("child"in e.props){const n=e.props.child;return M.isValidElement(n)?M.cloneElement(n,void 0,e.props.children(n.props.children)):null}return M.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function s1(e,t){const n={...t};for(const i in t){const o=e[i],s=t[i];/^on[A-Z]/.test(i)?o&&s?n[i]=(...c)=>{const d=s(...c);return o(...c),d}:o&&(n[i]=o):i==="style"?n[i]={...o,...s}:i==="className"&&(n[i]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}ni(s1,"mergeProps");function l1(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}ni(l1,"getElementRef");function u1(e){return M.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===o1}ni(u1,"isSlottable");var CD=Symbol.for("react.lazy");function Gm(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===CD&&"_payload"in e&&c1(e._payload)}ni(Gm,"isLazyComponent");function c1(e){return typeof e=="object"&&e!==null&&"then"in e}ni(c1,"isPromiseLike");var wD=ni(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),ED=ni(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),hc=zl[" use ".trim().toString()];function d1(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=d1(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function f1(){for(var e,t,n=0,i="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=d1(e))&&(i&&(i+=" "),i+=t);return i}const ES=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,kS=f1,h1=(e,t)=>n=>{var i;if(t?.variants==null)return kS(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,l=Object.keys(o).map(f=>{const p=n?.[f],m=s?.[f];if(p===null)return null;const g=ES(p)||ES(m);return o[f][g]}),c=n&&Object.entries(n).reduce((f,p)=>{let[m,g]=p;return g===void 0||(f[m]=g),f},{}),d=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((f,p)=>{let{class:m,className:g,...v}=p;return Object.entries(v).every(x=>{let[S,w]=x;return Array.isArray(w)?w.includes({...s,...c}[S]):{...s,...c}[S]===w})?[...f,m,g]:f},[]);return kS(e,l,d,n?.class,n?.className)},kD=(e,t)=>{const n=new Array(e.length+t.length);for(let i=0;i<e.length;i++)n[i]=e[i];for(let i=0;i<t.length;i++)n[e.length+i]=t[i];return n},TD=(e,t)=>({classGroupId:e,validator:t}),p1=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),cd="-",TS=[],AD="arbitrary..",LD=e=>{const t=OD(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return RD(l);const c=l.split(cd),d=c[0]===""&&c.length>1?1:0;return m1(c,d,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const d=i[l],f=n[l];return d?f?kD(f,d):d:f||TS}return n[l]||TS}}},m1=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const f=m1(e,t+1,s);if(f)return f}const l=n.validators;if(l===null)return;const c=t===0?e.join(cd):e.slice(t).join(cd),d=l.length;for(let f=0;f<d;f++){const p=l[f];if(p.validator(c))return p.classGroupId}},RD=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),i=t.slice(0,n);return i?AD+i:void 0})(),OD=e=>{const{theme:t,classGroups:n}=e;return DD(n,t)},DD=(e,t)=>{const n=p1();for(const i in e){const o=e[i];sy(o,n,i,t)}return n},sy=(e,t,n,i)=>{const o=e.length;for(let s=0;s<o;s++){const l=e[s];MD(l,t,n,i)}},MD=(e,t,n,i)=>{if(typeof e=="string"){ID(e,t,n);return}if(typeof e=="function"){ND(e,t,n,i);return}zD(e,t,n,i)},ID=(e,t,n)=>{const i=e===""?t:g1(t,e);i.classGroupId=n},ND=(e,t,n,i)=>{if(PD(e)){sy(e(i),t,n,i);return}t.validators===null&&(t.validators=[]),t.validators.push(TD(n,e))},zD=(e,t,n,i)=>{const o=Object.entries(e),s=o.length;for(let l=0;l<s;l++){const[c,d]=o[l];sy(d,g1(t,c),n,i)}},g1=(e,t)=>{let n=e;const i=t.split(cd),o=i.length;for(let s=0;s<o;s++){const l=i[s];let c=n.nextPart.get(l);c||(c=p1(),n.nextPart.set(l,c)),n=c}return n},PD=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,HD=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),i=Object.create(null);const o=(s,l)=>{n[s]=l,t++,t>e&&(t=0,i=n,n=Object.create(null))};return{get(s){let l=n[s];if(l!==void 0)return l;if((l=i[s])!==void 0)return o(s,l),l},set(s,l){s in n?n[s]=l:o(s,l)}}},$m="!",AS=":",jD=[],LS=(e,t,n,i,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:i,isExternal:o}),BD=e=>{const{prefix:t,experimentalParseClassName:n}=e;let i=o=>{const s=[];let l=0,c=0,d=0,f;const p=o.length;for(let S=0;S<p;S++){const w=o[S];if(l===0&&c===0){if(w===AS){s.push(o.slice(d,S)),d=S+1;continue}if(w==="/"){f=S;continue}}w==="["?l++:w==="]"?l--:w==="("?c++:w===")"&&c--}const m=s.length===0?o:o.slice(d);let g=m,v=!1;m.endsWith($m)?(g=m.slice(0,-1),v=!0):m.startsWith($m)&&(g=m.slice(1),v=!0);const x=f&&f>d?f-d:void 0;return LS(s,v,g,x)};if(t){const o=t+AS,s=i;i=l=>l.startsWith(o)?s(l.slice(o.length)):LS(jD,!1,l,void 0,!0)}if(n){const o=i;i=s=>n({className:s,parseClassName:o})}return i},UD=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,i)=>{t.set(n,1e6+i)}),n=>{const i=[];let o=[];for(let s=0;s<n.length;s++){const l=n[s],c=l[0]==="[",d=t.has(l);c||d?(o.length>0&&(o.sort(),i.push(...o),o=[]),i.push(l)):o.push(l)}return o.length>0&&(o.sort(),i.push(...o)),i}},VD=e=>({cache:HD(e.cacheSize),parseClassName:BD(e),sortModifiers:UD(e),postfixLookupClassGroupIds:FD(e),...LD(e)}),FD=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let i=0;i<n.length;i++)t[n[i]]=!0;return t},GD=/\s+/,$D=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:l}=t,c=[],d=e.trim().split(GD);let f="";for(let p=d.length-1;p>=0;p-=1){const m=d[p],{isExternal:g,modifiers:v,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:w}=n(m);if(g){f=m+(f.length>0?" "+f:f);continue}let _=!!w,C;if(_){const P=S.substring(0,w);C=i(P);const j=C&&l[C]?i(S):void 0;j&&j!==C&&(C=j,_=!1)}else C=i(S);if(!C){if(!_){f=m+(f.length>0?" "+f:f);continue}if(C=i(S),!C){f=m+(f.length>0?" "+f:f);continue}_=!1}const T=v.length===0?"":v.length===1?v[0]:s(v).join(":"),D=x?T+$m:T,I=D+C;if(c.indexOf(I)>-1)continue;c.push(I);const O=o(C,_);for(let P=0;P<O.length;++P){const j=O[P];c.push(D+j)}f=m+(f.length>0?" "+f:f)}return f},qD=(...e)=>{let t=0,n,i,o="";for(;t<e.length;)(n=e[t++])&&(i=y1(n))&&(o&&(o+=" "),o+=i);return o},y1=e=>{if(typeof e=="string")return e;let t,n="";for(let i=0;i<e.length;i++)e[i]&&(t=y1(e[i]))&&(n&&(n+=" "),n+=t);return n},WD=(e,...t)=>{let n,i,o,s;const l=d=>{const f=t.reduce((p,m)=>m(p),e());return n=VD(f),i=n.cache.get,o=n.cache.set,s=c,c(d)},c=d=>{const f=i(d);if(f)return f;const p=$D(d,n);return o(d,p),p};return s=l,(...d)=>s(qD(...d))},YD=[],At=e=>{const t=n=>n[e]||YD;return t.isThemeGetter=!0,t},v1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,b1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,XD=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,KD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,QD=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ZD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,JD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,e2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ir=e=>XD.test(e),De=e=>!!e&&!Number.isNaN(Number(e)),li=e=>!!e&&Number.isInteger(Number(e)),jp=e=>e.endsWith("%")&&De(e.slice(0,-1)),$i=e=>KD.test(e),x1=()=>!0,t2=e=>QD.test(e)&&!ZD.test(e),ly=()=>!1,n2=e=>JD.test(e),i2=e=>e2.test(e),r2=e=>!me(e)&&!ye(e),o2=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),a2=e=>Wr(e,C1,ly),me=e=>v1.test(e),go=e=>Wr(e,w1,t2),RS=e=>Wr(e,p2,De),s2=e=>Wr(e,k1,x1),l2=e=>Wr(e,E1,ly),OS=e=>Wr(e,S1,ly),u2=e=>Wr(e,_1,i2),pc=e=>Wr(e,T1,n2),ye=e=>b1.test(e),Zs=e=>Fo(e,w1),c2=e=>Fo(e,E1),DS=e=>Fo(e,S1),d2=e=>Fo(e,C1),f2=e=>Fo(e,_1),mc=e=>Fo(e,T1,!0),h2=e=>Fo(e,k1,!0),Wr=(e,t,n)=>{const i=v1.exec(e);return i?i[1]?t(i[1]):n(i[2]):!1},Fo=(e,t,n=!1)=>{const i=b1.exec(e);return i?i[1]?t(i[1]):n:!1},S1=e=>e==="position"||e==="percentage",_1=e=>e==="image"||e==="url",C1=e=>e==="length"||e==="size"||e==="bg-size",w1=e=>e==="length",p2=e=>e==="number",E1=e=>e==="family-name",k1=e=>e==="number"||e==="weight",T1=e=>e==="shadow",m2=()=>{const e=At("color"),t=At("font"),n=At("text"),i=At("font-weight"),o=At("tracking"),s=At("leading"),l=At("breakpoint"),c=At("container"),d=At("spacing"),f=At("radius"),p=At("shadow"),m=At("inset-shadow"),g=At("text-shadow"),v=At("drop-shadow"),x=At("blur"),S=At("perspective"),w=At("aspect"),_=At("ease"),C=At("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],I=()=>[...D(),ye,me],O=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],j=()=>[ye,me,d],F=()=>[Ir,"full","auto",...j()],Q=()=>[li,"none","subgrid",ye,me],G=()=>["auto",{span:["full",li,ye,me]},li,ye,me],B=()=>[li,"auto",ye,me],ee=()=>["auto","min","max","fr",ye,me],Z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...j()],q=()=>[Ir,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],te=()=>[Ir,"screen","full","dvw","lvw","svw","min","max","fit",...j()],ce=()=>[Ir,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],R=()=>[e,ye,me],H=()=>[...D(),DS,OS,{position:[ye,me]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],N=()=>["auto","cover","contain",d2,a2,{size:[ye,me]}],se=()=>[jp,Zs,go],de=()=>["","none","full",f,ye,me],le=()=>["",De,Zs,go],be=()=>["solid","dashed","dotted","double"],Ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ge=()=>[De,jp,DS,OS],We=()=>["","none",x,ye,me],Ge=()=>["none",De,ye,me],ot=()=>["none",De,ye,me],je=()=>[De,ye,me],pe=()=>[Ir,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$i],breakpoint:[$i],color:[x1],container:[$i],"drop-shadow":[$i],ease:["in","out","in-out"],font:[r2],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$i],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$i],shadow:[$i],spacing:["px",De],text:[$i],"text-shadow":[$i],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ir,me,ye,w]}],container:["container"],"container-type":[{"@container":["","normal","size",ye,me]}],"container-named":[o2],columns:[{columns:[De,me,ye,c]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:I()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{"inset-s":F(),start:F()}],end:[{"inset-e":F(),end:F()}],"inset-bs":[{"inset-bs":F()}],"inset-be":[{"inset-be":F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[li,"auto",ye,me]}],basis:[{basis:[Ir,"full","auto",c,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[De,Ir,"auto","initial","none",me]}],grow:[{grow:["",De,ye,me]}],shrink:[{shrink:["",De,ye,me]}],order:[{order:[li,"first","last","none",ye,me]}],"grid-cols":[{"grid-cols":Q()}],"col-start-end":[{col:G()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":Q()}],"row-start-end":[{row:G()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...Z(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...Z()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":Z()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mbs:[{mbs:z()}],mbe:[{mbe:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],"inline-size":[{inline:["auto",...te()]}],"min-inline-size":[{"min-inline":["auto",...te()]}],"max-inline-size":[{"max-inline":["none",...te()]}],"block-size":[{block:["auto",...ce()]}],"min-block-size":[{"min-block":["auto",...ce()]}],"max-block-size":[{"max-block":["none",...ce()]}],w:[{w:[c,"screen",...q()]}],"min-w":[{"min-w":[c,"screen","none",...q()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",n,Zs,go]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,h2,s2]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",jp,me]}],"font-family":[{font:[c2,l2,t]}],"font-features":[{"font-features":[me]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,ye,me]}],"line-clamp":[{"line-clamp":[De,"none",ye,RS]}],leading:[{leading:[s,...j()]}],"list-image":[{"list-image":["none",ye,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ye,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...be(),"wavy"]}],"text-decoration-thickness":[{decoration:[De,"from-font","auto",ye,go]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[De,"auto",ye,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"tab-size":[{tab:[li,ye,me]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ye,me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ye,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:H()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:N()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},li,ye,me],radial:["",ye,me],conic:[li,ye,me]},f2,u2]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:se()}],"gradient-via-pos":[{via:se()}],"gradient-to-pos":[{to:se()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:de()}],"rounded-s":[{"rounded-s":de()}],"rounded-e":[{"rounded-e":de()}],"rounded-t":[{"rounded-t":de()}],"rounded-r":[{"rounded-r":de()}],"rounded-b":[{"rounded-b":de()}],"rounded-l":[{"rounded-l":de()}],"rounded-ss":[{"rounded-ss":de()}],"rounded-se":[{"rounded-se":de()}],"rounded-ee":[{"rounded-ee":de()}],"rounded-es":[{"rounded-es":de()}],"rounded-tl":[{"rounded-tl":de()}],"rounded-tr":[{"rounded-tr":de()}],"rounded-br":[{"rounded-br":de()}],"rounded-bl":[{"rounded-bl":de()}],"border-w":[{border:le()}],"border-w-x":[{"border-x":le()}],"border-w-y":[{"border-y":le()}],"border-w-s":[{"border-s":le()}],"border-w-e":[{"border-e":le()}],"border-w-bs":[{"border-bs":le()}],"border-w-be":[{"border-be":le()}],"border-w-t":[{"border-t":le()}],"border-w-r":[{"border-r":le()}],"border-w-b":[{"border-b":le()}],"border-w-l":[{"border-l":le()}],"divide-x":[{"divide-x":le()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":le()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...be(),"hidden","none"]}],"divide-style":[{divide:[...be(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-bs":[{"border-bs":R()}],"border-color-be":[{"border-be":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...be(),"none","hidden"]}],"outline-offset":[{"outline-offset":[De,ye,me]}],"outline-w":[{outline:["",De,Zs,go]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",p,mc,pc]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",m,mc,pc]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[De,go]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":le()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",g,mc,pc]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[De,ye,me]}],"mix-blend":[{"mix-blend":[...Ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ee()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[De]}],"mask-image-linear-from-pos":[{"mask-linear-from":ge()}],"mask-image-linear-to-pos":[{"mask-linear-to":ge()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":ge()}],"mask-image-t-to-pos":[{"mask-t-to":ge()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":ge()}],"mask-image-r-to-pos":[{"mask-r-to":ge()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":ge()}],"mask-image-b-to-pos":[{"mask-b-to":ge()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":ge()}],"mask-image-l-to-pos":[{"mask-l-to":ge()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":ge()}],"mask-image-x-to-pos":[{"mask-x-to":ge()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":ge()}],"mask-image-y-to-pos":[{"mask-y-to":ge()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[ye,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":ge()}],"mask-image-radial-to-pos":[{"mask-radial-to":ge()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":D()}],"mask-image-conic-pos":[{"mask-conic":[De]}],"mask-image-conic-from-pos":[{"mask-conic-from":ge()}],"mask-image-conic-to-pos":[{"mask-conic-to":ge()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:H()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:N()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ye,me]}],filter:[{filter:["","none",ye,me]}],blur:[{blur:We()}],brightness:[{brightness:[De,ye,me]}],contrast:[{contrast:[De,ye,me]}],"drop-shadow":[{"drop-shadow":["","none",v,mc,pc]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",De,ye,me]}],"hue-rotate":[{"hue-rotate":[De,ye,me]}],invert:[{invert:["",De,ye,me]}],saturate:[{saturate:[De,ye,me]}],sepia:[{sepia:["",De,ye,me]}],"backdrop-filter":[{"backdrop-filter":["","none",ye,me]}],"backdrop-blur":[{"backdrop-blur":We()}],"backdrop-brightness":[{"backdrop-brightness":[De,ye,me]}],"backdrop-contrast":[{"backdrop-contrast":[De,ye,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",De,ye,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[De,ye,me]}],"backdrop-invert":[{"backdrop-invert":["",De,ye,me]}],"backdrop-opacity":[{"backdrop-opacity":[De,ye,me]}],"backdrop-saturate":[{"backdrop-saturate":[De,ye,me]}],"backdrop-sepia":[{"backdrop-sepia":["",De,ye,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ye,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[De,"initial",ye,me]}],ease:[{ease:["linear","initial",_,ye,me]}],delay:[{delay:[De,ye,me]}],animate:[{animate:["none",C,ye,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,ye,me]}],"perspective-origin":[{"perspective-origin":I()}],rotate:[{rotate:Ge()}],"rotate-x":[{"rotate-x":Ge()}],"rotate-y":[{"rotate-y":Ge()}],"rotate-z":[{"rotate-z":Ge()}],scale:[{scale:ot()}],"scale-x":[{"scale-x":ot()}],"scale-y":[{"scale-y":ot()}],"scale-z":[{"scale-z":ot()}],"scale-3d":["scale-3d"],skew:[{skew:je()}],"skew-x":[{"skew-x":je()}],"skew-y":[{"skew-y":je()}],transform:[{transform:[ye,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:I()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:pe()}],"translate-x":[{"translate-x":pe()}],"translate-y":[{"translate-y":pe()}],"translate-z":[{"translate-z":pe()}],"translate-none":["translate-none"],zoom:[{zoom:[li,ye,me]}],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ye,me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":R()}],"scrollbar-track-color":[{"scrollbar-track":R()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ye,me]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[De,Zs,go,RS]}],stroke:[{stroke:["none",...R()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},g2=WD(m2);function Me(...e){return g2(f1(e))}const y2=h1("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,background-color,border-color,box-shadow,opacity] duration-[var(--motion)] ease-[var(--motion-ease)] outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90",outline:"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 text-xs has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8"}},defaultVariants:{variant:"default",size:"default"}});function Et({className:e,variant:t="default",size:n="default",asChild:i=!1,...o}){const s=i?r1:"button";return k.jsx(s,{"data-slot":"button",className:Me(y2({variant:t,size:n}),e),...o})}const MS=/\]\(\s*source:([^)\s]+)(?:\s+"[^"]*")?\s*\)/g;function uy(e){return e.kind==="pr-comment"&&e.path!==void 0&&e.side!==void 0&&e.line!==void 0}function v2(e){const t=[];MS.lastIndex=0;for(const n of e.matchAll(MS)){const i=n[1];i!==void 0&&i!==""&&t.push(i)}return t}function b2(e){if(e===void 0||!e.startsWith("source:"))return;const t=e.slice(7);return t===""?void 0:t}function IS(e){return(e??[]).filter(uy)}function x2(e,t){if(!uy(t))return;const n=e.groups.filter(s=>(s.sources??[]).includes(t.id)),i=e.groups.filter(s=>s.hunkRefs.some(l=>l.path===t.path||l.oldPath===t.path));return(i.filter(s=>n.some(l=>l.id===s.id))[0]??i[0]??n[0])?.id}function S2(e){const t=e.sources??[],n=[e.why,e.summary,...e.lookFor??[]].flatMap(v2);return[...new Set([...t,...n])]}function _2(e){return`Answer the following questions by using ${e}`}function A1(e){const t=e==="overview"?{kind:"agent-md",target:"overview"}:{kind:"agent-md",target:"group",group:e.group};return _2(ud(t))}const L1=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim();const C2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const w2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,i)=>i?i.toUpperCase():n.toLowerCase());const NS=e=>{const t=w2(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Bp={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const E2=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},k2=M.createContext({}),T2=()=>M.useContext(k2),A2=M.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:i,className:o="",children:s,iconNode:l,...c},d)=>{const{size:f=24,strokeWidth:p=2,absoluteStrokeWidth:m=!1,color:g="currentColor",className:v=""}=T2()??{},x=i??m?Number(n??p)*24/Number(t??f):n??p;return M.createElement("svg",{ref:d,...Bp,width:t??f??Bp.width,height:t??f??Bp.height,stroke:e??g,strokeWidth:x,className:L1("lucide",v,o),...!s&&!E2(c)&&{"aria-hidden":"true"},...c},[...l.map(([S,w])=>M.createElement(S,w)),...Array.isArray(s)?s:[s]])});const on=(e,t)=>{const n=M.forwardRef(({className:i,...o},s)=>M.createElement(A2,{ref:s,iconNode:t,className:L1(`lucide-${C2(NS(e))}`,`lucide-${e}`,i),...o}));return n.displayName=NS(e),n};const L2=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],R1=on("arrow-up-right",L2);const R2=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],O2=on("bot",R2);const D2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],M2=on("check",D2);const I2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],N2=on("chevron-down",I2);const z2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],zS=on("chevron-right",z2);const P2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],H2=on("circle-dot",P2);const j2=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],B2=on("file",j2);const U2=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],V2=on("git-commit-horizontal",U2);const F2=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]],G2=on("git-pull-request",F2);const $2=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],O1=on("grip-vertical",$2);const q2=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],W2=on("message-square",q2);const Y2=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],X2=on("monitor",Y2);const K2=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Q2=on("moon",K2);const Z2=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}]],J2=on("sparkle",Z2);const eM=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],tM=on("sun",eM);var nM=Object.defineProperty,Qa=(e,t)=>nM(e,"name",{value:t,configurable:!0}),D1=!!(typeof window<"u"&&window.document&&window.document.createElement);function pi(e,t,{checkForDefaultPrevented:n=!0}={}){return Qa(function(o){if(e?.(o),n===!1||!o||!o.defaultPrevented)return t?.(o)},"handleEvent")}Qa(pi,"composeEventHandlers");function iM(e){if(!D1)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}Qa(iM,"getOwnerWindow");function qm(e){if(!D1)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}Qa(qm,"getOwnerDocument");function M1(e,t=!1){const{activeElement:n}=qm(e);if(!n?.nodeName)return null;if(I1(n)&&n.contentDocument)return M1(n.contentDocument.body,t);if(t){const i=n.getAttribute("aria-activedescendant");if(i){const o=qm(n).getElementById(i);if(o)return o}}return n}Qa(M1,"getActiveElement");function I1(e){return e.tagName==="IFRAME"}Qa(I1,"isFrame");var rM=Object.defineProperty,Fn=(e,t)=>rM(e,"name",{value:t,configurable:!0});function oM(e,t){const n=M.createContext(t);n.displayName=e+"Context";const i=Fn(s=>{const{children:l,...c}=s,d=M.useMemo(()=>c,Object.values(c));return k.jsx(n.Provider,{value:d,children:l})},"Provider");i.displayName=e+"Provider";function o(s,l={}){const{optional:c=!1}=l,d=M.useContext(n);if(d)return d;if(t!==void 0)return t;if(!c)throw new Error(`\`${s}\` must be used within \`${e}\``)}return Fn(o,"useContext"),[i,o]}Fn(oM,"createContext");function cy(e,t=[]){let n=[];function i(s,l){const c=M.createContext(l);c.displayName=s+"Context";const d=n.length;n=[...n,l];const f=Fn(m=>{const{scope:g,children:v,...x}=m,S=g?.[e]?.[d]||c,w=M.useMemo(()=>x,Object.values(x));return k.jsx(S.Provider,{value:w,children:v})},"Provider");f.displayName=s+"Provider";function p(m,g,v={}){const{optional:x=!1}=v,S=g?.[e]?.[d]||c,w=M.useContext(S);if(w)return w;if(l!==void 0)return l;if(!x)throw new Error(`\`${m}\` must be used within \`${s}\``)}return Fn(p,"useContext"),[f,p]}Fn(i,"createContext");const o=Fn(()=>{const s=n.map(l=>M.createContext(l));return Fn(function(c){const d=c?.[e]||s;return M.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])},"useScope")},"createScope");return o.scopeName=e,[i,N1(o,...t)]}Fn(cy,"createContextScope");function N1(...e){const t=e[0];if(e.length===1)return t;const n=Fn(()=>{const i=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return Fn(function(s){const l=i.reduce((c,{useScope:d,scopeName:f})=>{const m=d(s)[`__scope${f}`];return{...c,...m}},{});return M.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}Fn(N1,"composeContextScopes");var Fd=Mw(),aM=Object.defineProperty,sM=(e,t)=>aM(e,"name",{value:t,configurable:!0}),lM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Go=lM.reduce((e,t)=>{const n=ay(`Primitive.${t}`),i=M.forwardRef((o,s)=>{const{asChild:l,...c}=o,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),k.jsx(d,{...c,ref:s})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function z1(e,t){e&&Fd.flushSync(()=>e.dispatchEvent(t))}sM(z1,"dispatchDiscreteCustomEvent");var uM=Object.defineProperty,cM=(e,t)=>uM(e,"name",{value:t,configurable:!0});function Hl(e){const t=M.useRef(e);return M.useEffect(()=>{t.current=e}),M.useMemo(()=>((...n)=>t.current?.(...n)),[])}cM(Hl,"useCallbackRef");var dM=Object.defineProperty,zt=(e,t)=>dM(e,"name",{value:t,configurable:!0}),Wm="dismissableLayer.update",fM="dismissableLayer.pointerDownOutside",hM="dismissableLayer.focusOutside",PS,P1=M.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),pM=M.forwardRef(zt(function(t,n){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,onDismiss:f,...p}=t,m=M.useContext(P1),[g,v]=M.useState(null),x=g?.ownerDocument??globalThis?.document,[,S]=M.useState({}),w=Vo(n,v),_=Array.from(m.layers),[C]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),T=C?_.indexOf(C):-1,D=g?_.indexOf(g):-1,I=m.layersWithOutsidePointerEventsDisabled.size>0,O=D>=T,P=M.useRef(!1),j=H1(B=>{l?.(B),d?.(B),B.defaultPrevented||f?.()},{ownerDocument:x,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:P,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:M.useCallback(B=>{if(!(B instanceof Node))return!1;const ee=[...m.branches].some(Z=>Z.contains(B));return O&&!ee},[m.branches,O])}),F=j1(B=>{if(o&&P.current)return;const ee=B.target;[...m.branches].some(W=>W.contains(ee))||(c?.(B),d?.(B),B.defaultPrevented||f?.())},x),Q=g?D===_.length-1:!1,G=Hl(B=>{B.key==="Escape"&&(s?.(B),!B.defaultPrevented&&f&&(B.preventDefault(),f()))});return M.useEffect(()=>{if(Q)return x.addEventListener("keydown",G,{capture:!0}),()=>x.removeEventListener("keydown",G,{capture:!0})},[x,Q,G]),M.useEffect(()=>{if(g)return i&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(PS=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(g)),m.layers.add(g),Ym(),()=>{i&&(m.layersWithOutsidePointerEventsDisabled.delete(g),m.layersWithOutsidePointerEventsDisabled.size===0&&(x.body.style.pointerEvents=PS))}},[g,x,i,m]),M.useEffect(()=>()=>{g&&(m.layers.delete(g),m.layersWithOutsidePointerEventsDisabled.delete(g),Ym())},[g,m]),M.useEffect(()=>{const B=zt(()=>S({}),"handleUpdate");return document.addEventListener(Wm,B),()=>document.removeEventListener(Wm,B)},[]),k.jsx(Go.div,{...p,ref:w,style:{pointerEvents:I?O?"auto":"none":void 0,...t.style},onFocusCapture:pi(t.onFocusCapture,F.onFocusCapture),onBlurCapture:pi(t.onBlurCapture,F.onBlurCapture),onPointerDownCapture:pi(t.onPointerDownCapture,j.onPointerDownCapture)})},"DismissableLayer"));function mM(){const e=M.useContext(P1),[t,n]=M.useState(null);return M.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}zt(mM,"useDismissableLayerSurface");var gM=zt(()=>!0,"IS_TRUE");function H1(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:s,shouldHandlePointerDownOutside:l=gM}=t,c=Hl(e),d=M.useRef(!1),f=M.useRef(!1),p=M.useRef(new Map),m=M.useRef(()=>{});return M.useEffect(()=>{function g(){f.current=!1,o.current=!1,p.current.clear()}zt(g,"resetOutsideInteraction");function v(){return Array.from(p.current.values()).some(Boolean)}zt(v,"isOutsideInteractionIntercepted");function x(T){if(!f.current)return;const D=T.target;D instanceof Node&&[...s].some(O=>O.contains(D))||p.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{f.current&&m.current()},0)}zt(x,"handleInteractionCapture");function S(T){f.current&&p.current.set(T.type,!1)}zt(S,"handleInteractionBubble");const w=zt(T=>{if(T.target&&!d.current){let D=function(){n.removeEventListener("click",m.current);const O=v();g(),O||dy(fM,c,I,{discrete:!0})};if(zt(D,"handleAndDispatchPointerDownOutsideEvent"),!l(T.target)){n.removeEventListener("click",m.current),g(),d.current=!1;return}const I={originalEvent:T};f.current=!0,o.current=i&&T.button===0,p.current.clear(),!i||T.button!==0?D():(n.removeEventListener("click",m.current),m.current=D,n.addEventListener("click",m.current,{once:!0}))}else n.removeEventListener("click",m.current),g();d.current=!1},"handlePointerDown"),_=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const T of _)n.addEventListener(T,x,!0),n.addEventListener(T,S);const C=window.setTimeout(()=>{n.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(C),n.removeEventListener("pointerdown",w),n.removeEventListener("click",m.current);for(const T of _)n.removeEventListener(T,x,!0),n.removeEventListener(T,S)}},[n,c,i,o,s,l]),{onPointerDownCapture:zt(()=>d.current=!0,"onPointerDownCapture")}}zt(H1,"usePointerDownOutside");function j1(e,t=globalThis?.document){const n=Hl(e),i=M.useRef(!1);return M.useEffect(()=>{const o=zt(s=>{s.target&&!i.current&&dy(hM,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:zt(()=>i.current=!0,"onFocusCapture"),onBlurCapture:zt(()=>i.current=!1,"onBlurCapture")}}zt(j1,"useFocusOutside");function Ym(){const e=new CustomEvent(Wm);document.dispatchEvent(e)}zt(Ym,"dispatchUpdate");function dy(e,t,n,{discrete:i}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),i?z1(o,s):o.dispatchEvent(s)}zt(dy,"handleAndDispatchCustomEvent");var Zn=globalThis?.document?M.useLayoutEffect:()=>{},yM=Object.defineProperty,vM=(e,t)=>yM(e,"name",{value:t,configurable:!0}),bM=zl[" useId ".trim().toString()]||(()=>{}),xM=0;function B1(e){const[t,n]=M.useState(bM());return Zn(()=>{e||n(i=>i??String(xM++))},[e]),e||(t?`radix-${t}`:"")}vM(B1,"useId");const SM=["top","right","bottom","left"],Gr=Math.min,er=Math.max,dd=Math.round,gc=Math.floor,tr=e=>({x:e,y:e}),_M={left:"right",right:"left",bottom:"top",top:"bottom"};function U1(e,t,n){return er(e,Gr(t,n))}function ir(e,t){return typeof e=="function"?e(t):e}function $r(e){return e.split("-")[0]}function Za(e){return e.split("-")[1]}function fy(e){return e==="x"?"y":"x"}function hy(e){return e==="y"?"height":"width"}function xi(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function py(e){return fy(xi(e))}function CM(e,t,n){n===void 0&&(n=!1);const i=Za(e),o=py(e),s=hy(o);let l=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(l=fd(l)),[l,fd(l)]}function wM(e){const t=fd(e);return[Xm(e),t,Xm(t)]}function Xm(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const HS=["left","right"],jS=["right","left"],EM=["top","bottom"],kM=["bottom","top"];function TM(e,t,n){switch(e){case"top":case"bottom":return n?t?jS:HS:t?HS:jS;case"left":case"right":return t?EM:kM;default:return[]}}function AM(e,t,n,i){const o=Za(e);let s=TM($r(e),n==="start",i);return o&&(s=s.map(l=>l+"-"+o),t&&(s=s.concat(s.map(Xm)))),s}function fd(e){const t=$r(e);return _M[t]+e.slice(t.length)}function LM(e){var t,n,i,o;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(i=e.bottom)!=null?i:0,left:(o=e.left)!=null?o:0}}function V1(e){return typeof e!="number"?LM(e):{top:e,right:e,bottom:e,left:e}}function hd(e){const{x:t,y:n,width:i,height:o}=e;return{width:i,height:o,top:n,left:t,right:t+i,bottom:n+o,x:t,y:n}}function BS(e,t,n){let{reference:i,floating:o}=e;const s=xi(t),l=py(t),c=hy(l),d=$r(t),f=s==="y",p=i.x+i.width/2-o.width/2,m=i.y+i.height/2-o.height/2,g=i[c]/2-o[c]/2;let v;switch(d){case"top":v={x:p,y:i.y-o.height};break;case"bottom":v={x:p,y:i.y+i.height};break;case"right":v={x:i.x+i.width,y:m};break;case"left":v={x:i.x-o.width,y:m};break;default:v={x:i.x,y:i.y}}const x=Za(t);return x&&(v[l]+=g*(x==="end"?1:-1)*(n&&f?-1:1)),v}async function RM(e,t){var n;t===void 0&&(t={});const{x:i,y:o,platform:s,rects:l,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:g=!1,padding:v=0}=ir(t,e),x=V1(v),w=c[g?m==="floating"?"reference":"floating":m],_=hd(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:f,rootBoundary:p,strategy:d})),C=m==="floating"?{x:i,y:o,width:l.floating.width,height:l.floating.height}:l.reference,T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),D=await(s.isElement==null?void 0:s.isElement(T))&&await(s.getScale==null?void 0:s.getScale(T))||{x:1,y:1},I=hd(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:C,offsetParent:T,strategy:d}):C);return{top:(_.top-I.top+x.top)/D.y,bottom:(I.bottom-_.bottom+x.bottom)/D.y,left:(_.left-I.left+x.left)/D.x,right:(I.right-_.right+x.right)/D.x}}const OM=50,DM=async(e,t,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:s=[],platform:l}=n,c=l.detectOverflow?l:{...l,detectOverflow:RM},d=await(l.isRTL==null?void 0:l.isRTL(t));let f=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:p,y:m}=BS(f,i,d),g=i,v=0;const x={};for(let S=0;S<s.length;S++){const w=s[S];if(!w)continue;const{name:_,fn:C}=w,{x:T,y:D,data:I,reset:O}=await C({x:p,y:m,initialPlacement:i,placement:g,strategy:o,middlewareData:x,rects:f,platform:c,elements:{reference:e,floating:t}});p=T??p,m=D??m,x[_]={...x[_],...I},O&&v<OM&&(v++,typeof O=="object"&&(O.placement&&(g=O.placement),O.rects&&(f=O.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:o}):O.rects),{x:p,y:m}=BS(f,g,d)),S=-1)}return{x:p,y:m,placement:g,strategy:o,middlewareData:x}},MM=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:i,placement:o,rects:s,platform:l,elements:c,middlewareData:d}=t,{element:f,padding:p=0}=ir(e,t)||{};if(f==null)return{};const m=V1(p),g={x:n,y:i},v=py(o),x=hy(v),S=await l.getDimensions(f),w=v==="y",_=w?"top":"left",C=w?"bottom":"right",T=w?"clientHeight":"clientWidth",D=s.reference[x]+s.reference[v]-g[v]-s.floating[x],I=g[v]-s.reference[v],O=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f));let P=O?O[T]:0;(!P||!await(l.isElement==null?void 0:l.isElement(O)))&&(P=c.floating[T]||s.floating[x]);const j=D/2-I/2,F=P/2-S[x]/2-1,Q=Gr(m[_],F),G=Gr(m[C],F),B=P-S[x]-G,ee=P/2-S[x]/2+j,Z=U1(Q,ee,B),W=!d.arrow&&Za(o)!=null&&ee!==Z&&s.reference[x]/2-(ee<Q?Q:G)-S[x]/2<0,z=W?ee<Q?ee-Q:ee-B:0;return{[v]:g[v]+z,data:{[v]:Z,centerOffset:ee-Z-z,...W&&{alignmentOffset:z}},reset:W}}}),IM=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,i;const{placement:o,middlewareData:s,rects:l,initialPlacement:c,platform:d,elements:f}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:S=!0,...w}=ir(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const _=$r(o),C=xi(c),T=$r(c)===c,D=await(d.isRTL==null?void 0:d.isRTL(f.floating)),I=g||(T||!S?[fd(c)]:wM(c)),O=x!=="none";!g&&O&&I.push(...AM(c,S,x,D));const P=[c,...I],j=await d.detectOverflow(t,w),F=[];let Q=((i=s.flip)==null?void 0:i.overflows)||[];if(p&&F.push(j[_]),m){const Z=CM(o,l,D);F.push(j[Z[0]],j[Z[1]])}if(Q=[...Q,{placement:o,overflows:F}],!F.every(Z=>Z<=0)){var G,B;const Z=(((G=s.flip)==null?void 0:G.index)||0)+1,W=P[Z];if(W&&(!(m==="alignment"?C!==xi(W):!1)||Q.every(te=>xi(te.placement)===C?te.overflows[0]>0:!0)))return{data:{index:Z,overflows:Q},reset:{placement:W}};let z=(B=Q.filter(q=>q.overflows[0]<=0).sort((q,te)=>q.overflows[1]-te.overflows[1])[0])==null?void 0:B.placement;if(!z)switch(v){case"bestFit":{var ee;const q=(ee=Q.filter(te=>{if(O){const ce=xi(te.placement);return ce===C||ce==="y"}return!0}).map(te=>[te.placement,te.overflows.filter(ce=>ce>0).reduce((ce,R)=>ce+R,0)]).sort((te,ce)=>te[1]-ce[1])[0])==null?void 0:ee[0];q&&(z=q);break}case"initialPlacement":z=c;break}if(o!==z)return{reset:{placement:z}}}return{}}}};function US(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function VS(e){return SM.some(t=>e[t]>=0)}const NM=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:i}=t,{strategy:o="referenceHidden",...s}=ir(e,t);switch(o){case"referenceHidden":{const l=await i.detectOverflow(t,{...s,elementContext:"reference"}),c=US(l,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:VS(c)}}}case"escaped":{const l=await i.detectOverflow(t,{...s,altBoundary:!0}),c=US(l,n.floating);return{data:{escapedOffsets:c,escaped:VS(c)}}}default:return{}}}}},F1=new Set(["left","top"]);async function zM(e,t){const{placement:n,platform:i,elements:o}=e,s=await(i.isRTL==null?void 0:i.isRTL(o.floating)),l=$r(n),c=Za(n),d=xi(n)==="y",f=F1.has(l)?-1:1,p=s&&d?-1:1,m=ir(t,e);let{mainAxis:g,crossAxis:v,alignmentAxis:x}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof x=="number"&&(v=c==="end"?x*-1:x),d?{x:v*p,y:g*f}:{x:g*f,y:v*p}}const PM=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:o,y:s,placement:l,middlewareData:c}=t,d=await zM(t,e);return l===((n=c.offset)==null?void 0:n.placement)&&(i=c.arrow)!=null&&i.alignmentOffset?{}:{x:o+d.x,y:s+d.y,data:{...d,placement:l}}}}},HM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:o,platform:s}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:d={fn:C=>{let{x:T,y:D}=C;return{x:T,y:D}}},...f}=ir(e,t),p={x:n,y:i},m=await s.detectOverflow(t,f),g=xi(o),v=fy(g);let x=p[v],S=p[g];const w=(C,T)=>U1(T+m[C==="y"?"top":"left"],T,T-m[C==="y"?"bottom":"right"]);l&&(x=w(v,x)),c&&(S=w(g,S));const _=d.fn({...t,[v]:x,[g]:S});return{..._,data:{x:_.x-n,y:_.y-i,enabled:{[v]:l,[g]:c}}}}}},jM=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,i;const{x:o,y:s,placement:l,rects:c,middlewareData:d}=t,{offset:f=0,mainAxis:p=!0,crossAxis:m=!0}=ir(e,t),g={x:o,y:s},v=xi(l),x=fy(v);let S=g[x],w=g[v];const _=ir(f,t),C=typeof _=="number"?{mainAxis:_,crossAxis:0}:{mainAxis:(n=_.mainAxis)!=null?n:0,crossAxis:(i=_.crossAxis)!=null?i:0};if(p){const I=x==="y"?"height":"width",O=c.reference[x]-c.floating[I]+C.mainAxis,P=c.reference[x]+c.reference[I]-C.mainAxis;S<O?S=O:S>P&&(S=P)}if(m){var T,D;const I=x==="y"?"width":"height",O=F1.has($r(l)),P=c.reference[v]-c.floating[I]+(O&&((T=d.offset)==null?void 0:T[v])||0)+(O?0:C.crossAxis),j=c.reference[v]+c.reference[I]+(O?0:((D=d.offset)==null?void 0:D[v])||0)-(O?C.crossAxis:0);w<P?w=P:w>j&&(w=j)}return{[x]:S,[v]:w}}}},BM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:i,platform:o,elements:s}=t,{apply:l=()=>{},...c}=ir(e,t),d=await o.detectOverflow(t,c),f=$r(n),p=Za(n),m=xi(n)==="y",{width:g,height:v}=i.floating;let x,S;f==="top"||f==="bottom"?(x=f,S=p===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(S=f,x=p==="end"?"top":"bottom");const w=v-d.top-d.bottom,_=g-d.left-d.right,C=Gr(v-d[x],w),T=Gr(g-d[S],_),D=t.middlewareData.shift,I=!D;let O=C,P=T;D!=null&&D.enabled.x&&(P=_),D!=null&&D.enabled.y&&(O=w),I&&!p&&(m?P=g-2*er(d.left,d.right):O=v-2*er(d.top,d.bottom)),await l({...t,availableWidth:P,availableHeight:O});const j=await o.getDimensions(s.floating);return g!==j.width||v!==j.height?{reset:{rects:!0}}:{}}}};function Gd(){return typeof window<"u"}function Ja(e){return G1(e)?(e.nodeName||"").toLowerCase():"#document"}function mn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function lr(e){var t;return(t=(G1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function G1(e){return Gd()?e instanceof Node||e instanceof mn(e).Node:!1}function _i(e){return Gd()?e instanceof Element||e instanceof mn(e).Element:!1}function Yr(e){return Gd()?e instanceof HTMLElement||e instanceof mn(e).HTMLElement:!1}function FS(e){return!Gd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof mn(e).ShadowRoot}function $d(e){const{overflow:t,overflowX:n,overflowY:i,display:o}=Ci(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&o!=="inline"&&o!=="contents"}function UM(e){return/^(table|td|th)$/.test(Ja(e))}function qd(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const VM=/transform|translate|scale|rotate|perspective|filter/,FM=/paint|layout|strict|content/,yo=e=>!!e&&e!=="none";let Up;function my(e){const t=_i(e)?Ci(e):e;return yo(t.transform)||yo(t.translate)||yo(t.scale)||yo(t.rotate)||yo(t.perspective)||!gy()&&(yo(t.backdropFilter)||yo(t.filter))||VM.test(t.willChange||"")||FM.test(t.contain||"")}function GM(e){let t=Io(e);for(;Yr(t)&&!_l(t);){if(my(t))return t;if(qd(t))return null;t=Io(t)}return null}function gy(){return Up==null&&(Up=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Up}function _l(e){return/^(html|body|#document)$/.test(Ja(e))}function Ci(e){return mn(e).getComputedStyle(e)}function Wd(e){return _i(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Io(e){if(Ja(e)==="html")return e;const t=e.assignedSlot||e.parentNode||FS(e)&&e.host||lr(e);return FS(t)?t.host:t}function $1(e){const t=Io(e);return _l(t)?(e.ownerDocument||e).body:Yr(t)&&$d(t)?t:$1(t)}function Cl(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=$1(e),s=o===((i=e.ownerDocument)==null?void 0:i.body),l=mn(o);if(s){const c=Km(l);return t.concat(l,l.visualViewport||[],$d(o)?o:[],c&&n?Cl(c):[])}else return t.concat(o,Cl(o,[],n))}function Km(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function q1(e){const t=Ci(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const o=Yr(e),s=o?e.offsetWidth:n,l=o?e.offsetHeight:i,c=dd(n)!==s||dd(i)!==l;return c&&(n=s,i=l),{width:n,height:i,$:c}}function yy(e){return _i(e)?e:e.contextElement}function Fa(e){const t=yy(e);if(!Yr(t))return tr(1);const n=t.getBoundingClientRect(),{width:i,height:o,$:s}=q1(t);let l=(s?dd(n.width):n.width)/i,c=(s?dd(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const $M=tr(0);function W1(e){const t=mn(e);return!gy()||!t.visualViewport?$M:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qM(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===mn(e)}function No(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=yy(e);let l=tr(1);t&&(i?_i(i)&&(l=Fa(i)):l=Fa(e));const c=qM(s,n,i)?W1(s):tr(0);let d=(o.left+c.x)/l.x,f=(o.top+c.y)/l.y,p=o.width/l.x,m=o.height/l.y;if(s&&i){const g=mn(s),v=_i(i)?mn(i):i;let x=g,S=Km(x);for(;S&&v!==x;){const w=Fa(S),_=S.getBoundingClientRect(),C=Ci(S),T=_.left+(S.clientLeft+parseFloat(C.paddingLeft))*w.x,D=_.top+(S.clientTop+parseFloat(C.paddingTop))*w.y;d*=w.x,f*=w.y,p*=w.x,m*=w.y,d+=T,f+=D,x=mn(S),S=Km(x)}}return hd({width:p,height:m,x:d,y:f})}function Yd(e,t){const n=Wd(e).scrollLeft;return t?t.left+n:No(lr(e)).left+n}function Y1(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-Yd(e,n),o=n.top+t.scrollTop;return{x:i,y:o}}function WM(e){let{elements:t,rect:n,offsetParent:i,strategy:o}=e;const s=o==="fixed",l=lr(i),c=t?qd(t.floating):!1;if(i===l||c&&s)return n;let d={scrollLeft:0,scrollTop:0},f=tr(1);const p=tr(0),m=Yr(i);if((m||!s)&&((Ja(i)!=="body"||$d(l))&&(d=Wd(i)),m)){const v=No(i);f=Fa(i),p.x=v.x+i.clientLeft,p.y=v.y+i.clientTop}const g=l&&!m&&!s?Y1(l,d):tr(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+p.x+g.x,y:n.y*f.y-d.scrollTop*f.y+p.y+g.y}}function YM(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function XM(e){const t=Wd(e),n=e.ownerDocument.body,i=er(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=er(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+Yd(e);const l=-t.scrollTop;return Ci(n).direction==="rtl"&&(s+=er(e.clientWidth,n.clientWidth)-i),{width:i,height:o,x:s,y:l}}const KM=25;function QM(e,t,n){n===void 0&&(n="viewport");const i=n==="layoutViewport",o=mn(e),s=lr(e),l=o.visualViewport;let c=s.clientWidth,d=s.clientHeight,f=0,p=0;if(l){const g=!gy()||t==="fixed";i?g||(f=-l.offsetLeft,p=-l.offsetTop):(c=l.width,d=l.height,g&&(f=l.offsetLeft,p=l.offsetTop))}if(Yd(s)<=0){const g=s.ownerDocument,v=g.body,x=getComputedStyle(v),S=g.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,w=Math.abs(s.clientWidth-v.clientWidth-S),_=getComputedStyle(s).scrollbarGutter==="stable both-edges"?w/2:w;_<=KM&&(c-=_)}return{width:c,height:d,x:f,y:p}}function ZM(e,t){const n=No(e,!0,t==="fixed"),i=n.top+e.clientTop,o=n.left+e.clientLeft,s=Fa(e),l=e.clientWidth*s.x,c=e.clientHeight*s.y,d=o*s.x,f=i*s.y;return{width:l,height:c,x:d,y:f}}function GS(e,t,n){let i;if(t==="viewport"||t==="layoutViewport")i=QM(e,n,t);else if(t==="document")i=XM(lr(e));else if(_i(t))i=ZM(t,n);else{const o=W1(e);i={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return hd(i)}function JM(e,t){const n=t.get(e);if(n)return n;let i=Cl(e,[],!1).filter(c=>_i(c)&&Ja(c)!=="body"),o=null;const s=Ci(e).position==="fixed";let l=s?Io(e):e;for(;_i(l)&&!_l(l);){const c=Ci(l),d=my(l),f=o?o.position:s?"fixed":"";!d&&(f==="fixed"||f==="absolute"&&c.position==="static")?i=i.filter(m=>m!==l):o=c,l=Io(l)}return t.set(e,i),i}function eI(e){let{element:t,boundary:n,rootBoundary:i,strategy:o}=e;const l=[...n==="clippingAncestors"?qd(t)?[]:JM(t,this._c):[].concat(n),i],c=GS(t,l[0],o);let d=c.top,f=c.right,p=c.bottom,m=c.left;for(let g=1;g<l.length;g++){const v=GS(t,l[g],o);d=er(v.top,d),f=Gr(v.right,f),p=Gr(v.bottom,p),m=er(v.left,m)}return{width:f-m,height:p-d,x:m,y:d}}function tI(e){const{width:t,height:n}=q1(e);return{width:t,height:n}}function nI(e,t,n){const i=Yr(t),o=lr(t),s=n==="fixed",l=No(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const d=tr(0);if((i||!s)&&((Ja(t)!=="body"||$d(o))&&(c=Wd(t)),i)){const g=No(t,!0,s,t);d.x=g.x+t.clientLeft,d.y=g.y+t.clientTop}!i&&o&&(d.x=Yd(o));const f=o&&!i&&!s?Y1(o,c):tr(0),p=l.left+c.scrollLeft-d.x-f.x,m=l.top+c.scrollTop-d.y-f.y;return{x:p,y:m,width:l.width,height:l.height}}function Vp(e){return Ci(e).position==="static"}function $S(e,t){if(!Yr(e)||Ci(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return lr(e)===n&&(n=n.ownerDocument.body),n}function X1(e,t){const n=mn(e);if(qd(e))return n;if(!Yr(e)){let o=Io(e);for(;o&&!_l(o);){if(_i(o)&&!Vp(o))return o;o=Io(o)}return n}let i=$S(e,t);for(;i&&UM(i)&&Vp(i);)i=$S(i,t);return i&&_l(i)&&Vp(i)&&!my(i)?n:i||GM(e)||n}const iI=async function(e){const t=this.getOffsetParent||X1,n=this.getDimensions,i=await n(e.floating);return{reference:nI(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function rI(e){return Ci(e).direction==="rtl"}const oI={convertOffsetParentRelativeRectToViewportRelativeRect:WM,getDocumentElement:lr,getClippingRect:eI,getOffsetParent:X1,getElementRects:iI,getClientRects:YM,getDimensions:tI,getScale:Fa,isElement:_i,isRTL:rI};function K1(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function aI(e,t,n){let i=null,o;const s=lr(e);function l(){var p;clearTimeout(o),(p=i)==null||p.disconnect(),i=null}function c(p,m){p===void 0&&(p=!1),m===void 0&&(m=1),l();const g=e.getBoundingClientRect(),{left:v,top:x,width:S,height:w}=g;if(p||t(),!S||!w)return;const _=gc(x),C=gc(s.clientWidth-(v+S)),T=gc(s.clientHeight-(x+w)),D=gc(v),O={rootMargin:-_+"px "+-C+"px "+-T+"px "+-D+"px",threshold:er(0,Gr(1,m))||1};let P=!0;function j(F){const Q=F[0].intersectionRatio;if(!K1(g,e.getBoundingClientRect()))return c();if(Q!==m){if(!P)return c();Q?c(!1,Q):o=setTimeout(()=>{c(!1,1e-7)},1e3)}P=!1}try{i=new IntersectionObserver(j,{...O,root:s.ownerDocument})}catch{i=new IntersectionObserver(j,O)}i.observe(e)}const d=mn(e),f=()=>c(n);return d.addEventListener("resize",f),c(!0),()=>{d.removeEventListener("resize",f),l()}}function sI(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=i,f=yy(e),p=o||s?[...f?Cl(f):[],...t?Cl(t):[]]:[];p.forEach(_=>{o&&_.addEventListener("scroll",n),s&&_.addEventListener("resize",n)});const m=f&&c?aI(f,n,s):null;let g=-1,v=null;l&&(v=new ResizeObserver(_=>{let[C]=_;C&&C.target===f&&v&&t&&(v.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var T;(T=v)==null||T.observe(t)})),n()}),f&&!d&&v.observe(f),t&&v.observe(t));let x,S=d?No(e):null;d&&w();function w(){const _=No(e);S&&!K1(S,_)&&n(),S=_,x=requestAnimationFrame(w)}return n(),()=>{var _;p.forEach(C=>{o&&C.removeEventListener("scroll",n),s&&C.removeEventListener("resize",n)}),m?.(),(_=v)==null||_.disconnect(),v=null,d&&cancelAnimationFrame(x)}}const lI=PM,uI=HM,cI=IM,dI=BM,fI=NM,qS=MM,hI=jM,pI=(e,t,n)=>{const i=new Map,o=n??{},s={...oI,...o.platform,_c:i};return DM(e,t,{...o,platform:s})};var mI=typeof document<"u",gI=function(){},Qc=mI?M.useLayoutEffect:gI;function pd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,i,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(i=n;i--!==0;)if(!pd(e[i],t[i]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(t,o[i]))return!1;for(i=n;i--!==0;){const s=o[i];if(!(s==="_owner"&&e.$$typeof)&&!pd(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Q1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function WS(e,t){const n=Q1(e);return Math.round(t*n)/n}function Fp(e){const t=M.useRef(e);return Qc(()=>{t.current=e}),t}function yI(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:o,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:d,open:f}=e,[p,m]=M.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,v]=M.useState(i);pd(g,i)||v(i);const[x,S]=M.useState(null),[w,_]=M.useState(null),C=M.useCallback(te=>{te!==O.current&&(O.current=te,S(te))},[]),T=M.useCallback(te=>{te!==P.current&&(P.current=te,_(te))},[]),D=s||x,I=l||w,O=M.useRef(null),P=M.useRef(null),j=M.useRef(p),F=d!=null,Q=Fp(d),G=Fp(o),B=Fp(f),ee=M.useCallback(()=>{if(!O.current||!P.current)return;const te={placement:t,strategy:n,middleware:g};G.current&&(te.platform=G.current),pI(O.current,P.current,te).then(ce=>{const R={...ce,isPositioned:B.current!==!1};Z.current&&!pd(j.current,R)&&(j.current=R,Fd.flushSync(()=>{m(R)}))})},[g,t,n,G,B]);Qc(()=>{f===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,m(te=>({...te,isPositioned:!1})))},[f]);const Z=M.useRef(!1);Qc(()=>(Z.current=!0,()=>{Z.current=!1}),[]),Qc(()=>{if(D&&(O.current=D),I&&(P.current=I),D&&I){if(Q.current)return Q.current(D,I,ee);ee()}},[D,I,ee,Q,F]);const W=M.useMemo(()=>({reference:O,floating:P,setReference:C,setFloating:T}),[C,T]),z=M.useMemo(()=>({reference:D,floating:I}),[D,I]),q=M.useMemo(()=>{const te={position:n,left:0,top:0};if(!z.floating)return te;const ce=WS(z.floating,p.x),R=WS(z.floating,p.y);return c?{...te,transform:"translate("+ce+"px, "+R+"px)",...Q1(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ce,top:R}},[n,c,z.floating,p.x,p.y]);return M.useMemo(()=>({...p,update:ee,refs:W,elements:z,floatingStyles:q}),[p,ee,W,z,q])}const vI=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:i,padding:o}=typeof e=="function"?e(n):e;return i&&t(i)?i.current!=null?qS({element:i.current,padding:o}).fn(n):{}:i?qS({element:i,padding:o}).fn(n):{}}}},bI=(e,t)=>{const n=lI(e);return{name:n.name,fn:n.fn,options:[e,t]}},xI=(e,t)=>{const n=uI(e);return{name:n.name,fn:n.fn,options:[e,t]}},SI=(e,t)=>({fn:hI(e).fn,options:[e,t]}),_I=(e,t)=>{const n=cI(e);return{name:n.name,fn:n.fn,options:[e,t]}},CI=(e,t)=>{const n=dI(e);return{name:n.name,fn:n.fn,options:[e,t]}},wI=(e,t)=>{const n=fI(e);return{name:n.name,fn:n.fn,options:[e,t]}},EI=(e,t)=>{const n=vI(e);return{name:n.name,fn:n.fn,options:[e,t]}};var kI=Object.defineProperty,TI=(e,t)=>kI(e,"name",{value:t,configurable:!0});function Z1(e){const[t,n]=M.useState(void 0);return Zn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let l,c;if("borderBoxSize"in s){const d=s.borderBoxSize,f=Array.isArray(d)?d[0]:d;l=f.inlineSize,c=f.blockSize}else l=e.offsetWidth,c=e.offsetHeight;n({width:l,height:c})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else n(void 0)},[e]),t}TI(Z1,"useSize");var AI=Object.defineProperty,Vr=(e,t)=>AI(e,"name",{value:t,configurable:!0}),J1="Popper",[eE,tE]=cy(J1),[LI,nE]=eE(J1),RI=Vr(e=>{const{__scopePopper:t,children:n}=e,[i,o]=M.useState(null),[s,l]=M.useState(void 0);return k.jsx(LI,{scope:t,anchor:i,onAnchorChange:o,placementState:s,setPlacementState:l,children:n})},"Popper"),OI="PopperAnchor",DI=M.forwardRef(Vr(function(t,n){const{__scopePopper:i,virtualRef:o,...s}=t,l=nE(OI,i),c=M.useRef(null),d=l.onAnchorChange,f=M.useCallback(S=>{c.current=S,S&&d(S)},[d]),p=Vo(n,f),m=M.useRef(null);M.useEffect(()=>{if(!o)return;const S=m.current;m.current=o.current,S!==m.current&&d(m.current)});const g=l.placementState&&Xd(l.placementState),v=g?.[0],x=g?.[1];return o?null:k.jsx(Go.div,{"data-radix-popper-side":v,"data-radix-popper-align":x,...s,ref:p})},"PopperAnchor")),iE="PopperContent",[MI,c$]=eE(iE),II=M.forwardRef(Vr(function(t,n){const{__scopePopper:i,side:o="bottom",sideOffset:s=0,align:l="center",alignOffset:c=0,arrowPadding:d=0,avoidCollisions:f=!0,collisionBoundary:p=[],collisionPadding:m=0,sticky:g="partial",hideWhenDetached:v=!1,updatePositionStrategy:x="optimized",onPlaced:S,...w}=t,_=nE(iE,i),[C,T]=M.useState(null),D=Vo(n,T),[I,O]=M.useState(null),P=Z1(I),j=P?.width??0,F=P?.height??0,Q=o+(l!=="center"?"-"+l:""),G=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},B=Array.isArray(p)?p:[p],ee=B.length>0,Z={padding:G,boundary:B.filter(rE),altBoundary:ee},{refs:W,floatingStyles:z,placement:q,isPositioned:te,middlewareData:ce}=yI({strategy:"fixed",placement:Q,whileElementsMounted:Vr((...ge)=>sI(...ge,{animationFrame:x==="always"}),"whileElementsMounted"),elements:{reference:_.anchor},middleware:[bI({mainAxis:s+F,alignmentAxis:c}),f&&xI({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?SI():void 0,...Z}),f&&_I({...Z}),CI({...Z,apply:Vr(({elements:ge,rects:We,availableWidth:Ge,availableHeight:ot})=>{const{width:je,height:pe}=We.reference,he=ge.floating.style;he.setProperty("--radix-popper-available-width",`${Ge}px`),he.setProperty("--radix-popper-available-height",`${ot}px`),he.setProperty("--radix-popper-anchor-width",`${je}px`),he.setProperty("--radix-popper-anchor-height",`${pe}px`)},"apply")}),I&&EI({element:I,padding:d}),NI({arrowWidth:j,arrowHeight:F}),v&&wI({strategy:"referenceHidden",...Z,boundary:ee?Z.boundary:void 0})]}),R=_.setPlacementState;Zn(()=>(R(q),()=>{R(void 0)}),[q,R]);const[H,Y]=Xd(q),N=Hl(S);Zn(()=>{te&&N?.()},[te,N]);const se=ce.arrow?.x,de=ce.arrow?.y,le=ce.arrow?.centerOffset!==0,[be,Ee]=M.useState();return Zn(()=>{C&&Ee(window.getComputedStyle(C).zIndex)},[C]),k.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:te?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[ce.transformOrigin?.x,ce.transformOrigin?.y].join(" "),...ce.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:k.jsx(MI,{scope:i,placedSide:H,placedAlign:Y,onArrowChange:O,arrowX:se,arrowY:de,shouldHideArrow:le,children:k.jsx(Go.div,{"data-side":H,"data-align":Y,...w,ref:D,style:{...w.style,animation:te?w.style?.animation:"none"}})})})},"PopperContent"));function rE(e){return e!==null}Vr(rE,"isNotNull");var NI=Vr(e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:i,middlewareData:o}=t,l=o.arrow?.centerOffset!==0,c=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[f,p]=Xd(n),m={start:"0%",center:"50%",end:"100%"}[p],g=(o.arrow?.x??0)+c/2,v=(o.arrow?.y??0)+d/2;let x="",S="";return f==="bottom"?(x=l?m:`${g}px`,S=`${-d}px`):f==="top"?(x=l?m:`${g}px`,S=`${i.floating.height+d}px`):f==="right"?(x=`${-d}px`,S=l?m:`${v}px`):f==="left"&&(x=`${i.floating.width+d}px`,S=l?m:`${v}px`),{data:{x,y:S}}}}),"transformOrigin");function Xd(e){const[t,n="center"]=e.split("-");return[t,n]}Vr(Xd,"getSideAndAlignFromPlacement");var zI=RI,PI=DI,HI=II,jI=Object.defineProperty,BI=(e,t)=>jI(e,"name",{value:t,configurable:!0}),UI=M.forwardRef(BI(function(t,n){const{container:i,...o}=t,[s,l]=M.useState(!1);Zn(()=>l(!0),[]);const c=i||s&&globalThis?.document?.body;return c?Fd.createPortal(k.jsx(Go.div,{...o,ref:n}),c):null},"Portal")),VI=Object.defineProperty,rr=(e,t)=>VI(e,"name",{value:t,configurable:!0});function oE(e,t){return M.useReducer((n,i)=>t[n][i]??n,e)}rr(oE,"useStateMachine");var aE=rr(e=>{const{present:t,children:n}=e,i=sE(t),o=typeof n=="function"?n({present:i.isPresent}):M.Children.only(n),s=lE(i.ref,uE(o));return typeof n=="function"||i.isPresent?M.cloneElement(o,{ref:s}):null},"Presence");function sE(e){const[t,n]=M.useState(),i=M.useRef(null),o=M.useRef(e),s=M.useRef("none"),l=M.useRef(void 0),c=e?"mounted":"unmounted",[d,f]=oE(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return M.useEffect(()=>{d==="mounted"?(s.current=l.current??Na(i.current),l.current=void 0):s.current="none"},[d]),Zn(()=>{const p=i.current,m=o.current;if(m!==e){const v=s.current,x=Na(p);e?(l.current=x,f("MOUNT")):x==="none"||p?.display==="none"?f("UNMOUNT"):f(m&&v!==x?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,f]),Zn(()=>{if(t){let p;const m=t.ownerDocument.defaultView??window,g=rr(x=>{const w=Na(i.current).includes(CSS.escape(x.animationName));if(x.target===t&&w&&(f("ANIMATION_END"),!o.current)){const _=t.style.animationFillMode;t.style.animationFillMode="forwards",p=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=_)})}},"handleAnimationEnd"),v=rr(x=>{x.target===t&&(s.current=Na(i.current))},"handleAnimationStart");return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{m.clearTimeout(p),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:M.useCallback(p=>{if(p){const m=getComputedStyle(p);i.current=m,l.current=Na(m)}else i.current=null;n(p)},[])}}rr(sE,"usePresence");function Qm(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}rr(Qm,"setRef");function lE(...e){const t=M.useRef(e);return t.current=e,M.useCallback(n=>{const i=t.current;let o=!1;const s=i.map(l=>{const c=Qm(l,n);return!o&&typeof c=="function"&&(o=!0),c});if(o)return()=>{for(let l=0;l<s.length;l++){const c=s[l];typeof c=="function"?c():Qm(i[l],null)}}},[])}rr(lE,"useStableComposedRefs");function Na(e){return e?.animationName||"none"}rr(Na,"getAnimationName");function uE(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}rr(uE,"getElementRef");var FI=Object.defineProperty,GI=(e,t)=>FI(e,"name",{value:t,configurable:!0}),YS=zl[" useEffectEvent ".trim().toString()],XS=zl[" useInsertionEffect ".trim().toString()];function cE(e){if(typeof YS=="function")return YS(e);const t=M.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof XS=="function"?XS(()=>{t.current=e}):Zn(()=>{t.current=e}),M.useMemo(()=>((...n)=>t.current?.(...n)),[])}GI(cE,"useEffectEvent");var $I=Object.defineProperty,jl=(e,t)=>$I(e,"name",{value:t,configurable:!0}),qI=zl[" useInsertionEffect ".trim().toString()]||Zn;function dE({prop:e,defaultProp:t,onChange:n=jl(()=>{},"onChange"),caller:i}){const[o,s,l]=fE({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:o,f=M.useCallback(p=>{if(c){const m=hE(p)?p(e):p;m!==e&&l.current?.(m)}else s(p)},[c,e,s,l]);return[d,f]}jl(dE,"useControllableState");function fE({defaultProp:e,onChange:t}){const[n,i]=M.useState(e),o=M.useRef(n),s=M.useRef(t);return qI(()=>{s.current=t},[t]),M.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,i,s]}jl(fE,"useUncontrolledState");function hE(e){return typeof e=="function"}jl(hE,"isFunction");var KS=Symbol("RADIX:SYNC_STATE");function WI(e,t,n,i){const{prop:o,defaultProp:s,onChange:l,caller:c}=t,d=o!==void 0,f=cE(l),p=[{...n,state:s}];i&&p.push(i);const[m,g]=M.useReducer((w,_)=>{if(_.type===KS)return{...w,state:_.state};const C=e(w,_);return d&&!Object.is(C.state,w.state)&&f(C.state),C},...p),v=m.state,x=M.useRef(v);M.useEffect(()=>{x.current!==v&&(x.current=v,d||f(v))},[v,x,d]);const S=M.useMemo(()=>o!==void 0?{...m,state:o}:m,[m,o]);return M.useEffect(()=>{d&&!Object.is(o,m.state)&&g({type:KS,state:o})},[o,m.state,d]),[S,g]}jl(WI,"useControllableStateReducer");var YI=Object.defineProperty,XI=(e,t)=>YI(e,"name",{value:t,configurable:!0}),KI=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),QI=M.forwardRef(XI(function(t,n){return k.jsx(Go.span,{...t,ref:n,style:{...KI,...t.style}})},"VisuallyHidden")),ZI=QI,JI=Object.defineProperty,Ht=(e,t)=>JI(e,"name",{value:t,configurable:!0}),[vy,d$]=cy("Tooltip",[tE]),by=tE(),eN="TooltipProvider",tN=700,Zm="tooltip.open",[nN,xy]=vy(eN),iN=Ht(e=>{const{__scopeTooltip:t,delayDuration:n=tN,skipDelayDuration:i=300,disableHoverableContent:o=!1,children:s}=e,l=M.useRef(!0),c=M.useRef(!1),d=M.useRef(0);return M.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),k.jsx(nN,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:M.useCallback(()=>{i<=0||(window.clearTimeout(d.current),l.current=!1)},[i]),onClose:M.useCallback(()=>{i<=0||(window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,i))},[i]),isPointerInTransitRef:c,onPointerInTransitChange:M.useCallback(f=>{c.current=f},[]),disableHoverableContent:o,children:s})},"TooltipProvider"),Jm="Tooltip",[rN,Bl]=vy(Jm),oN=Ht(e=>{const{__scopeTooltip:t,children:n,open:i,defaultOpen:o,onOpenChange:s,disableHoverableContent:l,delayDuration:c}=e,d=xy(Jm,e.__scopeTooltip),f=by(t),[p,m]=M.useState(null),[g,v]=M.useState(void 0),x=B1(),S=M.useRef(0),w=l??d.disableHoverableContent,_=c??d.delayDuration,C=M.useRef(!1),[T,D]=dE({prop:i,defaultProp:o??!1,onChange:Ht(Q=>{Q?(d.onOpen(),document.dispatchEvent(new CustomEvent(Zm))):d.onClose(),s?.(Q)},"onChange"),caller:Jm}),I=M.useMemo(()=>T?C.current?"delayed-open":"instant-open":"closed",[T]),O=M.useCallback(()=>{window.clearTimeout(S.current),S.current=0,C.current=!1,D(!0)},[D]),P=M.useCallback(()=>{window.clearTimeout(S.current),S.current=0,D(!1)},[D]),j=M.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{C.current=!0,D(!0),S.current=0},_)},[_,D]);M.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]);const F=g??x;return k.jsx(zI,{...f,children:k.jsx(rN,{scope:t,contentId:F,setContentId:v,open:T,stateAttribute:I,trigger:p,onTriggerChange:m,onTriggerEnter:M.useCallback(()=>{d.isOpenDelayedRef.current?j():O()},[d.isOpenDelayedRef,j,O]),onTriggerLeave:M.useCallback(()=>{w?P():(window.clearTimeout(S.current),S.current=0)},[P,w]),onOpen:O,onClose:P,disableHoverableContent:w,children:n})})},"Tooltip"),QS="TooltipTrigger",aN=M.forwardRef(Ht(function(t,n){const{__scopeTooltip:i,...o}=t,s=Bl(QS,i),l=xy(QS,i),c=by(i),d=M.useRef(null),f=Vo(n,d,s.onTriggerChange),p=M.useRef(!1),m=M.useRef(!1),g=M.useCallback(()=>p.current=!1,[]);return M.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),k.jsx(PI,{asChild:!0,...c,children:k.jsx(Go.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:f,onPointerMove:pi(t.onPointerMove,v=>{v.pointerType!=="touch"&&!m.current&&!l.isPointerInTransitRef.current&&(s.onTriggerEnter(),m.current=!0)}),onPointerLeave:pi(t.onPointerLeave,()=>{s.onTriggerLeave(),m.current=!1}),onPointerDown:pi(t.onPointerDown,()=>{s.open&&s.onClose(),p.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:pi(t.onFocus,()=>{p.current||s.onOpen()}),onBlur:pi(t.onBlur,s.onClose),onClick:pi(t.onClick,s.onClose)})})},"TooltipTrigger")),pE="TooltipPortal",[sN,lN]=vy(pE,{forceMount:void 0}),uN=Ht(e=>{const{__scopeTooltip:t,forceMount:n,children:i,container:o}=e,s=Bl(pE,t);return k.jsx(sN,{scope:t,forceMount:n,children:k.jsx(aE,{present:n||s.open,children:k.jsx(UI,{asChild:!0,container:o,children:i})})})},"TooltipPortal"),wl="TooltipContent",cN=M.forwardRef(Ht(function(t,n){const i=lN(wl,t.__scopeTooltip),{forceMount:o=i.forceMount,side:s="top",...l}=t,c=Bl(wl,t.__scopeTooltip);return k.jsx(aE,{present:o||c.open,children:c.disableHoverableContent?k.jsx(mE,{side:s,...l,ref:n}):k.jsx(dN,{side:s,...l,ref:n})})},"TooltipContent")),dN=M.forwardRef(Ht(function(t,n){const i=Bl(wl,t.__scopeTooltip),o=xy(wl,t.__scopeTooltip),s=M.useRef(null),l=Vo(n,s),[c,d]=M.useState(null),{trigger:f,onClose:p}=i,m=s.current,{onPointerInTransitChange:g}=o,v=M.useCallback(()=>{d(null),g(!1)},[g]),x=M.useCallback((S,w)=>{const _=S.currentTarget,C={x:S.clientX,y:S.clientY},T=gE(C,_.getBoundingClientRect()),D=yE(C,T),I=vE(w.getBoundingClientRect()),O=xE([...D,...I]);d(O),g(!0)},[g]);return M.useEffect(()=>()=>v(),[v]),M.useEffect(()=>{if(f&&m){const S=Ht(_=>x(_,m),"handleTriggerLeave"),w=Ht(_=>x(_,f),"handleContentLeave");return f.addEventListener("pointerleave",S),m.addEventListener("pointerleave",w),()=>{f.removeEventListener("pointerleave",S),m.removeEventListener("pointerleave",w)}}},[f,m,x,v]),M.useEffect(()=>{if(c){const S=Ht(w=>{const _=w.target,C={x:w.clientX,y:w.clientY},T=f?.contains(_)||m?.contains(_),D=!bE(C,c);T?v():D&&(v(),p())},"handleTrackPointerGrace");return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[f,m,c,p,v]),k.jsx(mE,{...t,ref:l})},"TooltipContentHoverable")),fN=a1("TooltipContent"),mE=M.forwardRef(Ht(function(t,n){const{__scopeTooltip:i,children:o,"aria-label":s,id:l,onEscapeKeyDown:c,onPointerDownOutside:d,...f}=t,p=Bl(wl,i),m=by(i),{onClose:g}=p;M.useEffect(()=>(document.addEventListener(Zm,g),()=>document.removeEventListener(Zm,g)),[g]),M.useEffect(()=>{if(p.trigger){const x=Ht(S=>{S.target instanceof Node&&S.target.contains(p.trigger)&&g()},"handleScroll");return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[p.trigger,g]);const{setContentId:v}=p;return Zn(()=>(v(l),()=>{v(void 0)}),[l,v]),k.jsx(pM,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:x=>x.preventDefault(),onDismiss:g,children:k.jsxs(HI,{"data-state":p.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:p.contentId,...m,...f,ref:n,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[k.jsx(fN,{children:o}),s?k.jsx(ZI,{id:p.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function gE(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,i,o,s)){case s:return"left";case o:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}Ht(gE,"getExitSideFromRect");function yE(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}Ht(yE,"getPaddedExitPoints");function vE(e){const{top:t,right:n,bottom:i,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:i},{x:o,y:i}]}Ht(vE,"getPointsFromRect");function bE(e,t){const{x:n,y:i}=e;let o=!1;for(let s=0,l=t.length-1;s<t.length;l=s++){const c=t[s],d=t[l],f=c.x,p=c.y,m=d.x,g=d.y;p>i!=g>i&&n<(m-f)*(i-p)/(g-p)+f&&(o=!o)}return o}Ht(bE,"isPointInPolygon");function xE(e){const t=e.slice();return t.sort((n,i)=>n.x<i.x?-1:n.x>i.x?1:n.y<i.y?-1:n.y>i.y?1:0),SE(t)}Ht(xE,"getHull");function SE(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i<e.length;i++){const o=e[i];for(;t.length>=2;){const s=t[t.length-1],l=t[t.length-2];if((s.x-l.x)*(o.y-l.y)>=(s.y-l.y)*(o.x-l.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const o=e[i];for(;n.length>=2;){const s=n[n.length-1],l=n[n.length-2];if((s.x-l.x)*(o.y-l.y)>=(s.y-l.y)*(o.x-l.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Ht(SE,"getHullPresorted");var hN=iN,pN=oN,mN=aN,gN=uN,yN=cN;function vN({delayDuration:e=400,...t}){return k.jsx(hN,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Zt({...e}){return k.jsx(pN,{"data-slot":"tooltip",...e})}function Jt({...e}){return k.jsx(mN,{"data-slot":"tooltip-trigger",...e})}function en({className:e,sideOffset:t=6,children:n,...i}){return k.jsx(gN,{children:k.jsx(yN,{"data-slot":"tooltip-content",sideOffset:t,className:Me("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background duration-150 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=instant-open]:animate-in data-[state=instant-open]:fade-in-0",e),...i,children:n})})}async function bN(e){try{await navigator.clipboard.writeText(e)}catch{xN(e)}}function xN(e){const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.left="-9999px",document.body.append(t),t.select();const n=document.execCommand("copy");if(t.remove(),!n)throw new Error("copy failed")}const yc={label:"Ask AI about this",copied:"Copied",hint:"Copy a prompt for your coding agent"},SN=1600;function _E(e){const[t,n]=M.useState(!1),i=`${yc.hint}. ${e.scope==="group"?"This group.":"This review."}`;M.useEffect(()=>{n(!1)},[e.prompt]),M.useEffect(()=>{if(!t)return;const s=window.setTimeout(()=>n(!1),SN);return()=>window.clearTimeout(s)},[t]);const o=t?yc.copied:yc.label;return k.jsxs(Zt,{children:[k.jsx(Jt,{asChild:!0,children:k.jsxs(Et,{type:"button",size:"sm",variant:"outline",className:"shrink-0","aria-label":i,"aria-live":"polite","data-cta":"ask",onClick:()=>{n(!0),bN(e.prompt).catch(()=>n(!1))},children:[k.jsx(J2,{"aria-hidden":!0,className:"size-3.5"}),o]})}),k.jsx(en,{children:t?yc.copied:i})]})}function CE(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const _N=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,CN=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wN={};function ZS(e,t){return(wN.jsx?CN:_N).test(e)}const EN=/[ \t\n\f\r]/g;function Kd(e){return typeof e=="object"?e.type==="text"?JS(e.value):!1:JS(e)}function JS(e){return e.replace(EN,"")===""}class Ul{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}Ul.prototype.normal={};Ul.prototype.property={};Ul.prototype.space=void 0;function wE(e,t){const n={},i={};for(const o of e)Object.assign(n,o.property),Object.assign(i,o.normal);return new Ul(n,i,t)}function eg(e){return e.toLowerCase()}class vn{constructor(t,n){this.attribute=n,this.property=t}}vn.prototype.attribute="";vn.prototype.booleanish=!1;vn.prototype.boolean=!1;vn.prototype.commaOrSpaceSeparated=!1;vn.prototype.commaSeparated=!1;vn.prototype.defined=!1;vn.prototype.mustUseProperty=!1;vn.prototype.number=!1;vn.prototype.overloadedBoolean=!1;vn.prototype.property="";vn.prototype.spaceSeparated=!1;vn.prototype.space=void 0;let kN=0;const ke=$o(),wt=$o(),tg=$o(),ue=$o(),rt=$o(),To=$o(),Tn=$o();function $o(){return 2**++kN}const ng=Object.freeze(Object.defineProperty({__proto__:null,boolean:ke,booleanish:wt,commaOrSpaceSeparated:Tn,commaSeparated:To,number:ue,overloadedBoolean:tg,spaceSeparated:rt},Symbol.toStringTag,{value:"Module"})),Gp=Object.keys(ng);class Sy extends vn{constructor(t,n,i,o){let s=-1;if(super(t,n),e_(this,"space",o),typeof i=="number")for(;++s<Gp.length;){const l=Gp[s];e_(this,Gp[s],(i&ng[l])===ng[l])}}}Sy.prototype.defined=!0;function e_(e,t,n){n&&(e[t]=n)}function es(e){const t={},n={};for(const[i,o]of Object.entries(e.properties)){const s=new Sy(i,e.transform(e.attributes||{},i),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),t[i]=s,n[eg(i)]=i,n[eg(s.attribute)]=i}return new Ul(t,n,e.space)}const EE=es({properties:{ariaActiveDescendant:null,ariaAtomic:wt,ariaAutoComplete:null,ariaBusy:wt,ariaChecked:wt,ariaColCount:ue,ariaColIndex:ue,ariaColSpan:ue,ariaControls:rt,ariaCurrent:null,ariaDescribedBy:rt,ariaDetails:null,ariaDisabled:wt,ariaDropEffect:rt,ariaErrorMessage:null,ariaExpanded:wt,ariaFlowTo:rt,ariaGrabbed:wt,ariaHasPopup:null,ariaHidden:wt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:rt,ariaLevel:ue,ariaLive:null,ariaModal:wt,ariaMultiLine:wt,ariaMultiSelectable:wt,ariaOrientation:null,ariaOwns:rt,ariaPlaceholder:null,ariaPosInSet:ue,ariaPressed:wt,ariaReadOnly:wt,ariaRelevant:null,ariaRequired:wt,ariaRoleDescription:rt,ariaRowCount:ue,ariaRowIndex:ue,ariaRowSpan:ue,ariaSelected:wt,ariaSetSize:ue,ariaSort:null,ariaValueMax:ue,ariaValueMin:ue,ariaValueNow:ue,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function kE(e,t){return t in e?e[t]:t}function TE(e,t){return kE(e,t.toLowerCase())}const TN=es({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:To,acceptCharset:rt,accessKey:rt,action:null,allow:null,allowFullScreen:ke,allowPaymentRequest:ke,allowUserMedia:ke,alpha:ke,alt:null,as:null,async:ke,autoCapitalize:null,autoComplete:rt,autoFocus:ke,autoPlay:ke,blocking:rt,capture:null,charSet:null,checked:ke,cite:null,className:rt,closedBy:null,colorSpace:null,cols:ue,colSpan:ue,command:null,commandFor:null,content:null,contentEditable:wt,controls:ke,controlsList:rt,coords:ue|To,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ke,defer:ke,dir:null,dirName:null,disabled:ke,download:tg,draggable:wt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ke,formTarget:null,headers:rt,height:ue,hidden:tg,high:ue,href:null,hrefLang:null,htmlFor:rt,httpEquiv:rt,id:null,imageSizes:null,imageSrcSet:null,inert:ke,inputMode:null,integrity:null,is:null,isMap:ke,itemId:null,itemProp:rt,itemRef:rt,itemScope:ke,itemType:rt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ke,low:ue,manifest:null,max:null,maxLength:ue,media:null,method:null,min:null,minLength:ue,multiple:ke,muted:ke,name:null,nonce:null,noModule:ke,noValidate:ke,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:ke,optimum:ue,pattern:null,ping:rt,placeholder:null,playsInline:ke,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ke,referrerPolicy:null,rel:rt,required:ke,reversed:ke,rows:ue,rowSpan:ue,sandbox:rt,scope:null,scoped:ke,seamless:ke,selected:ke,shadowRootClonable:ke,shadowRootCustomElementRegistry:ke,shadowRootDelegatesFocus:ke,shadowRootMode:null,shadowRootSerializable:ke,shape:null,size:ue,sizes:null,slot:null,span:ue,spellCheck:wt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ue,step:null,style:null,tabIndex:ue,target:null,title:null,translate:null,type:null,typeMustMatch:ke,useMap:null,value:wt,width:ue,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:rt,axis:null,background:null,bgColor:null,border:ue,borderColor:null,bottomMargin:ue,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ke,declare:ke,event:null,face:null,frame:null,frameBorder:null,hSpace:ue,leftMargin:ue,link:null,longDesc:null,lowSrc:null,marginHeight:ue,marginWidth:ue,noResize:ke,noHref:ke,noShade:ke,noWrap:ke,object:null,profile:null,prompt:null,rev:null,rightMargin:ue,rules:null,scheme:null,scrolling:wt,standby:null,summary:null,text:null,topMargin:ue,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ue,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ke,disablePictureInPicture:ke,disableRemotePlayback:ke,exportParts:To,part:rt,prefix:null,property:null,results:ue,security:null,unselectable:null},space:"html",transform:TE}),AN=es({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:Tn,accentHeight:ue,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ue,amplitude:ue,arabicForm:null,ascent:ue,attributeName:null,attributeType:null,azimuth:ue,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ue,by:null,calcMode:null,capHeight:ue,className:rt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ue,diffuseConstant:ue,direction:null,display:null,dur:null,divisor:ue,dominantBaseline:null,download:ke,dx:null,dy:null,edgeMode:null,editable:null,elevation:ue,enableBackground:null,end:null,event:null,exponent:ue,externalResourcesRequired:null,fill:null,fillOpacity:ue,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:To,g2:To,glyphName:To,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ue,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ue,horizOriginX:ue,horizOriginY:ue,id:null,ideographic:ue,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ue,k:ue,k1:ue,k2:ue,k3:ue,k4:ue,kernelMatrix:Tn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ue,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:ue,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:ue,overlineThickness:ue,paintOrder:null,panose1:null,path:null,pathLength:ue,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:rt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ue,pointsAtY:ue,pointsAtZ:ue,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Tn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Tn,rev:Tn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Tn,requiredFeatures:Tn,requiredFonts:Tn,requiredFormats:Tn,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:ue,specularExponent:ue,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ue,strikethroughThickness:ue,string:null,stroke:null,strokeDashArray:Tn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ue,strokeOpacity:ue,strokeWidth:null,style:null,surfaceScale:ue,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Tn,tabIndex:ue,tableValues:null,target:null,targetX:ue,targetY:ue,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Tn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ue,underlineThickness:ue,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ue,values:null,vAlphabetic:ue,vMathematical:ue,vectorEffect:null,vHanging:ue,vIdeographic:ue,version:null,vertAdvY:ue,vertOriginX:ue,vertOriginY:ue,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ue,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:kE}),AE=es({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()}}),LE=es({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:TE}),RE=es({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),LN={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"},RN=/[A-Z]/g,t_=/-[a-z]/g,ON=/^data[-\w.:]+$/i;function OE(e,t){const n=eg(t);let i=t,o=vn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&ON.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(t_,MN);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!t_.test(s)){let l=s.replace(RN,DN);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=Sy}return new o(i,t)}function DN(e){return"-"+e.toLowerCase()}function MN(e){return e.charAt(1).toUpperCase()}const DE=wE([EE,TN,AE,LE,RE],"html"),Vl=wE([EE,AN,AE,LE,RE],"svg");function ME(e){return e.join(" ").trim()}var Oa={},$p,n_;function IN(){if(n_)return $p;n_=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
|
|
11
|
+
`,f="/",p="*",m="",g="comment",v="declaration";function x(w,_){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];_=_||{};var C=1,T=1;function D(Z){var W=Z.match(t);W&&(C+=W.length);var z=Z.lastIndexOf(d);T=~z?Z.length-z:T+Z.length}function I(){var Z={line:C,column:T};return function(W){return W.position=new O(Z),F(),W}}function O(Z){this.start=Z,this.end={line:C,column:T},this.source=_.source}O.prototype.content=w;function P(Z){var W=new Error(_.source+":"+C+":"+T+": "+Z);if(W.reason=Z,W.filename=_.source,W.line=C,W.column=T,W.source=w,!_.silent)throw W}function j(Z){var W=Z.exec(w);if(W){var z=W[0];return D(z),w=w.slice(z.length),W}}function F(){j(n)}function Q(Z){var W;for(Z=Z||[];W=G();)W!==!1&&Z.push(W);return Z}function G(){var Z=I();if(!(f!=w.charAt(0)||p!=w.charAt(1))){for(var W=2;m!=w.charAt(W)&&(p!=w.charAt(W)||f!=w.charAt(W+1));)++W;if(W+=2,m===w.charAt(W-1))return P("End of comment missing");var z=w.slice(2,W-2);return T+=2,D(z),w=w.slice(W),T+=2,Z({type:g,comment:z})}}function B(){var Z=I(),W=j(i);if(W){if(G(),!j(o))return P("property missing ':'");var z=j(s),q=Z({type:v,property:S(W[0].replace(e,m)),value:z?S(z[0].replace(e,m)):m});return j(l),q}}function ee(){var Z=[];Q(Z);for(var W;W=B();)W!==!1&&(Z.push(W),Q(Z));return Z}return F(),ee()}function S(w){return w?w.replace(c,m):m}return $p=x,$p}var i_;function NN(){if(i_)return Oa;i_=1;var e=Oa&&Oa.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Oa,"__esModule",{value:!0}),Oa.default=n;const t=e(IN());function n(i,o){let s=null;if(!i||typeof i!="string")return s;const l=(0,t.default)(i),c=typeof o=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:p}=d;c?o(f,p,d):p&&(s=s||{},s[f]=p)}),s}return Oa}var Js={},r_;function zN(){if(r_)return Js;r_=1,Object.defineProperty(Js,"__esModule",{value:!0}),Js.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,s=function(f){return!f||n.test(f)||e.test(f)},l=function(f,p){return p.toUpperCase()},c=function(f,p){return"".concat(p,"-")},d=function(f,p){return p===void 0&&(p={}),s(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(o,c):f=f.replace(i,c),f.replace(t,l))};return Js.camelCase=d,Js}var el,o_;function PN(){if(o_)return el;o_=1;var e=el&&el.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(NN()),n=zN();function i(o,s){var l={};return!o||typeof o!="string"||(0,t.default)(o,function(c,d){c&&d&&(l[(0,n.camelCase)(c,s)]=d)}),l}return i.default=i,el=i,el}var HN=PN();const jN=Vd(HN),IE=NE("end"),_y=NE("start");function NE(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 BN(e){const t=_y(e),n=IE(e);if(t&&n)return{start:t,end:n}}function pl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?a_(e.position):"start"in e||"end"in e?a_(e):"line"in e||"column"in e?ig(e):""}function ig(e){return s_(e&&e.line)+":"+s_(e&&e.column)}function a_(e){return ig(e&&e.start)+"-"+ig(e&&e.end)}function s_(e){return e&&typeof e=="number"?e:1}class Yt extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let o="",s={},l=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?o=t:!s.cause&&t&&(l=!0,o=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof i=="string"){const d=i.indexOf(":");d===-1?s.ruleId=i:(s.source=i.slice(0,d),s.ruleId=i.slice(d+1))}if(!s.place&&s.ancestors&&s.ancestors){const d=s.ancestors[s.ancestors.length-1];d&&(s.place=d.position)}const c=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.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=pl(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=l&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Yt.prototype.file="";Yt.prototype.name="";Yt.prototype.reason="";Yt.prototype.message="";Yt.prototype.stack="";Yt.prototype.column=void 0;Yt.prototype.line=void 0;Yt.prototype.ancestors=void 0;Yt.prototype.cause=void 0;Yt.prototype.fatal=void 0;Yt.prototype.place=void 0;Yt.prototype.ruleId=void 0;Yt.prototype.source=void 0;const Cy={}.hasOwnProperty,UN=new Map,VN=/[A-Z]/g,FN=new Set(["table","tbody","thead","tfoot","tr"]),GN=new Set(["td","th"]),zE="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $N(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=JN(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=ZN(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"?Vl:DE,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=PE(o,e,void 0);return s&&typeof s!="string"?s:o.create(e,o.Fragment,{children:s||void 0},void 0)}function PE(e,t,n){if(t.type==="element")return qN(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return WN(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return XN(e,t,n);if(t.type==="mdxjsEsm")return YN(e,t);if(t.type==="root")return KN(e,t,n);if(t.type==="text")return QN(e,t)}function qN(e,t,n){const i=e.schema;let o=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(o=Vl,e.schema=o),e.ancestors.push(t);const s=jE(e,t.tagName,!1),l=ez(e,t);let c=Ey(e,t);return FN.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!Kd(d):!0})),HE(e,l,s,t),wy(l,c),e.ancestors.pop(),e.schema=i,e.create(t,s,l,n)}function WN(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)}El(e,t.position)}function YN(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);El(e,t.position)}function XN(e,t,n){const i=e.schema;let o=i;t.name==="svg"&&i.space==="html"&&(o=Vl,e.schema=o),e.ancestors.push(t);const s=t.name===null?e.Fragment:jE(e,t.name,!0),l=tz(e,t),c=Ey(e,t);return HE(e,l,s,t),wy(l,c),e.ancestors.pop(),e.schema=i,e.create(t,s,l,n)}function KN(e,t,n){const i={};return wy(i,Ey(e,t)),e.create(t,e.Fragment,i,n)}function QN(e,t){return t.value}function HE(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function wy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function ZN(e,t,n){return i;function i(o,s,l,c){const f=Array.isArray(l.children)?n:t;return c?f(s,l,c):f(s,l)}}function JN(e,t){return n;function n(i,o,s,l){const c=Array.isArray(s.children),d=_y(i);return t(o,s,l,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function ez(e,t){const n={};let i,o;for(o in t.properties)if(o!=="children"&&Cy.call(t.properties,o)){const s=nz(e,o,t.properties[o]);if(s){const[l,c]=s;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&GN.has(t.tagName)?i=c:n[l]=c}}if(i){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function tz(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const s=i.data.estree.body[0];s.type;const l=s.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else El(e,t.position);else{const o=i.name;let s;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,s=e.evaluater.evaluateExpression(c.expression)}else El(e,t.position);else s=i.value===null?!0:i.value;n[o]=s}return n}function Ey(e,t){const n=[];let i=-1;const o=e.passKeys?new Map:UN;for(;++i<t.children.length;){const s=t.children[i];let l;if(e.passKeys){const d=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(d){const f=o.get(d)||0;l=d+"-"+f,o.set(d,f+1)}}const c=PE(e,s,l);c!==void 0&&n.push(c)}return n}function nz(e,t,n){const i=OE(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?CE(n):ME(n)),i.property==="style"){let o=typeof n=="object"?n:iz(e,String(n));return e.stylePropertyNameCase==="css"&&(o=rz(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&i.space?LN[i.property]||i.property:i.attribute,n]}}function iz(e,t){try{return jN(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,o=new Yt("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=zE+"#cannot-parse-style-attribute",o}}function jE(e,t,n){let i;if(!n)i={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let s=-1,l;for(;++s<o.length;){const c=ZS(o[s])?{type:"Identifier",name:o[s]}:{type:"Literal",value:o[s]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(s&&c.type==="Literal"),optional:!1}:c}i=l}else i=ZS(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const o=i.value;return Cy.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(i);El(e)}function El(e,t){const n=new Yt("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=zE+"#cannot-handle-mdx-estrees-without-createevaluater",n}function rz(e){const t={};let n;for(n in e)Cy.call(e,n)&&(t[oz(n)]=e[n]);return t}function oz(e){let t=e.replace(VN,az);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function az(e){return"-"+e.toLowerCase()}const qp={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"]},sz={};function lz(e,t){const n=sz,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return BE(e,i,o)}function BE(e,t,n){if(uz(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 l_(e.children,t,n)}return Array.isArray(e)?l_(e,t,n):""}function l_(e,t,n){const i=[];let o=-1;for(;++o<e.length;)i[o]=BE(e[o],t,n);return i.join("")}function uz(e){return!!(e&&typeof e=="object")}const u_=document.createElement("i");function ky(e){const t="&"+e+";";u_.innerHTML=t;const n=u_.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function wi(e,t,n,i){const o=e.length;let s=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);s<i.length;)l=i.slice(s,s+1e4),l.unshift(t,0),e.splice(...l),s+=1e4,t+=1e4}function Vn(e,t){return e.length>0?(wi(e,e.length,0,t),e):t}const c_={}.hasOwnProperty;function cz(e){const t={};let n=-1;for(;++n<e.length;)dz(t,e[n]);return t}function dz(e,t){let n;for(n in t){const o=(c_.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let l;if(s)for(l in s){c_.call(o,l)||(o[l]=[]);const c=s[l];fz(o[l],Array.isArray(c)?c:c?[c]:[])}}}function fz(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);wi(e,0,0,i)}function UE(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 Ga(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const yi=Xr(/[A-Za-z]/),Rn=Xr(/[\dA-Za-z]/),hz=Xr(/[#-'*+\--9=?A-Z^-~]/);function rg(e){return e!==null&&(e<32||e===127)}const og=Xr(/\d/),pz=Xr(/[\dA-Fa-f]/),mz=Xr(/[!-/:-@[-`{-~]/);function we(e){return e!==null&&e<-2}function gn(e){return e!==null&&(e<0||e===32)}function qe(e){return e===-2||e===-1||e===32}const gz=Xr(new RegExp("\\p{P}|\\p{S}","u")),yz=Xr(/\s/);function Xr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ts(e){const t=[];let n=-1,i=0,o=0;for(;++n<e.length;){const s=e.charCodeAt(n);let l="";if(s===37&&Rn(e.charCodeAt(n+1))&&Rn(e.charCodeAt(n+2)))o=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(l=String.fromCharCode(s));else if(s>55295&&s<57344){const c=e.charCodeAt(n+1);s<56320&&c>56319&&c<57344?(l=String.fromCharCode(s,c),o=1):l="�"}else l=String.fromCharCode(s);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 st(e,t,n,i){const o=i?i-1:Number.POSITIVE_INFINITY;let s=0;return l;function l(d){return qe(d)?(e.enter(n),c(d)):t(d)}function c(d){return qe(d)&&s++<o?(e.consume(d),c):(e.exit(n),t(d))}}const vz={tokenize:bz};function bz(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"),st(e,t,"linePrefix")}function o(c){return e.enter("paragraph"),s(c)}function s(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return we(c)?(e.consume(c),e.exit("chunkText"),s):(e.consume(c),l)}}const xz={tokenize:Sz},d_={tokenize:_z};function Sz(e){const t=this,n=[];let i=0,o,s,l;return c;function c(T){if(i<n.length){const D=n[i];return t.containerState=D[1],e.attempt(D[0].continuation,d,f)(T)}return f(T)}function d(T){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&C();const D=t.events.length;let I=D,O;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){O=t.events[I][1].end;break}_(i);let P=D;for(;P<t.events.length;)t.events[P][1].end={...O},P++;return wi(t.events,I+1,0,t.events.slice(D)),t.events.length=P,f(T)}return c(T)}function f(T){if(i===n.length){if(!o)return g(T);if(o.currentConstruct&&o.currentConstruct.concrete)return x(T);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(d_,p,m)(T)}function p(T){return o&&C(),_(i),g(T)}function m(T){return t.parser.lazy[t.now().line]=i!==n.length,l=t.now().offset,x(T)}function g(T){return t.containerState={},e.attempt(d_,v,x)(T)}function v(T){return i++,n.push([t.currentConstruct,t.containerState]),g(T)}function x(T){if(T===null){o&&C(),_(0),e.consume(T);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:s}),S(T)}function S(T){if(T===null){w(e.exit("chunkFlow"),!0),_(0),e.consume(T);return}return we(T)?(e.consume(T),w(e.exit("chunkFlow")),i=0,t.interrupt=void 0,c):(e.consume(T),S)}function w(T,D){const I=t.sliceStream(T);if(D&&I.push(null),T.previous=s,s&&(s.next=T),s=T,o.defineSkip(T.start),o.write(I),t.parser.lazy[T.start.line]){let O=o.events.length;for(;O--;)if(o.events[O][1].start.offset<l&&(!o.events[O][1].end||o.events[O][1].end.offset>l))return;const P=t.events.length;let j=P,F,Q;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){if(F){Q=t.events[j][1].end;break}F=!0}for(_(i),O=P;O<t.events.length;)t.events[O][1].end={...Q},O++;wi(t.events,j+1,0,t.events.slice(P)),t.events.length=O}}function _(T){let D=n.length;for(;D-- >T;){const I=n[D];t.containerState=I[1],I[0].exit.call(t,e)}n.length=T}function C(){o.write([null]),s=void 0,o=void 0,t.containerState._closeFlow=void 0}}function _z(e,t,n){return st(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function f_(e){if(e===null||gn(e)||yz(e))return 1;if(gz(e))return 2}function Ty(e,t,n){const i=[];let o=-1;for(;++o<e.length;){const s=e[o].resolveAll;s&&!i.includes(s)&&(t=s(t,n),i.push(s))}return t}const ag={name:"attention",resolveAll:Cz,tokenize:wz};function Cz(e,t){let n=-1,i,o,s,l,c,d,f,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;d=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},g={...e[n][1].start};h_(m,-d),h_(g,d),l={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[i][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},s={type:d>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},o={type:d>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[i][1].end={...l.start},e[n][1].start={...c.end},f=[],e[i][1].end.offset-e[i][1].start.offset&&(f=Vn(f,[["enter",e[i][1],t],["exit",e[i][1],t]])),f=Vn(f,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",s,t]]),f=Vn(f,Ty(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),f=Vn(f,[["exit",s,t],["enter",c,t],["exit",c,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=Vn(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,wi(e,i-1,n-i+3,f),n=i+f.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function wz(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,o=f_(i);let s;return l;function l(d){return s=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===s)return e.consume(d),c;const f=e.exit("attentionSequence"),p=f_(d),m=!p||p===2&&o||n.includes(d),g=!o||o===2&&p||n.includes(i);return f._open=!!(s===42?m:m&&(o||!g)),f._close=!!(s===42?g:g&&(p||!m)),t(d)}}function h_(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Ez={name:"autolink",tokenize:kz};function kz(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"),s}function s(v){return yi(v)?(e.consume(v),l):v===64?n(v):f(v)}function l(v){return v===43||v===45||v===46||Rn(v)?(i=1,c(v)):f(v)}function c(v){return v===58?(e.consume(v),i=0,d):(v===43||v===45||v===46||Rn(v))&&i++<32?(e.consume(v),c):(i=0,f(v))}function d(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||rg(v)?n(v):(e.consume(v),d)}function f(v){return v===64?(e.consume(v),p):hz(v)?(e.consume(v),f):n(v)}function p(v){return Rn(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):g(v)}function g(v){if((v===45||Rn(v))&&i++<63){const x=v===45?g:m;return e.consume(v),x}return n(v)}}const Qd={partial:!0,tokenize:Tz};function Tz(e,t,n){return i;function i(s){return qe(s)?st(e,o,"linePrefix")(s):o(s)}function o(s){return s===null||we(s)?t(s):n(s)}}const VE={continuation:{tokenize:Lz},exit:Rz,name:"blockQuote",tokenize:Az};function Az(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"),s}return n(l)}function s(l){return qe(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function Lz(e,t,n){const i=this;return o;function o(l){return qe(l)?st(e,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):s(l)}function s(l){return e.attempt(VE,t,n)(l)}}function Rz(e){e.exit("blockQuote")}const FE={name:"characterEscape",tokenize:Oz};function Oz(e,t,n){return i;function i(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),o}function o(s){return mz(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const GE={name:"characterReference",tokenize:Dz};function Dz(e,t,n){const i=this;let o=0,s,l;return c;function c(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),d}function d(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),s=31,l=Rn,p(m))}function f(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,l=pz,p):(e.enter("characterReferenceValue"),s=7,l=og,p(m))}function p(m){if(m===59&&o){const g=e.exit("characterReferenceValue");return l===Rn&&!ky(i.sliceSerialize(g))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(m)&&o++<s?(e.consume(m),p):n(m)}}const p_={partial:!0,tokenize:Iz},m_={concrete:!0,name:"codeFenced",tokenize:Mz};function Mz(e,t,n){const i=this,o={partial:!0,tokenize:I};let s=0,l=0,c;return d;function d(O){return f(O)}function f(O){const P=i.events[i.events.length-1];return s=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,c=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(O)}function p(O){return O===c?(l++,e.consume(O),p):l<3?n(O):(e.exit("codeFencedFenceSequence"),qe(O)?st(e,m,"whitespace")(O):m(O))}function m(O){return O===null||we(O)?(e.exit("codeFencedFence"),i.interrupt?t(O):e.check(p_,S,D)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(O))}function g(O){return O===null||we(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(O)):qe(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),st(e,v,"whitespace")(O)):O===96&&O===c?n(O):(e.consume(O),g)}function v(O){return O===null||we(O)?m(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(O))}function x(O){return O===null||we(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(O)):O===96&&O===c?n(O):(e.consume(O),x)}function S(O){return e.attempt(o,D,w)(O)}function w(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),_}function _(O){return s>0&&qe(O)?st(e,C,"linePrefix",s+1)(O):C(O)}function C(O){return O===null||we(O)?e.check(p_,S,D)(O):(e.enter("codeFlowValue"),T(O))}function T(O){return O===null||we(O)?(e.exit("codeFlowValue"),C(O)):(e.consume(O),T)}function D(O){return e.exit("codeFenced"),t(O)}function I(O,P,j){let F=0;return Q;function Q(W){return O.enter("lineEnding"),O.consume(W),O.exit("lineEnding"),G}function G(W){return O.enter("codeFencedFence"),qe(W)?st(O,B,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):B(W)}function B(W){return W===c?(O.enter("codeFencedFenceSequence"),ee(W)):j(W)}function ee(W){return W===c?(F++,O.consume(W),ee):F>=l?(O.exit("codeFencedFenceSequence"),qe(W)?st(O,Z,"whitespace")(W):Z(W)):j(W)}function Z(W){return W===null||we(W)?(O.exit("codeFencedFence"),P(W)):j(W)}}}function Iz(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"),s)}function s(l){return i.parser.lazy[i.now().line]?n(l):t(l)}}const Wp={name:"codeIndented",tokenize:zz},Nz={partial:!0,tokenize:Pz};function zz(e,t,n){const i=this;return o;function o(f){return e.enter("codeIndented"),st(e,s,"linePrefix",5)(f)}function s(f){const p=i.events[i.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(f):n(f)}function l(f){return f===null?d(f):we(f)?e.attempt(Nz,l,d)(f):(e.enter("codeFlowValue"),c(f))}function c(f){return f===null||we(f)?(e.exit("codeFlowValue"),l(f)):(e.consume(f),c)}function d(f){return e.exit("codeIndented"),t(f)}}function Pz(e,t,n){const i=this;return o;function o(l){return i.parser.lazy[i.now().line]?n(l):we(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):st(e,s,"linePrefix",5)(l)}function s(l){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):we(l)?o(l):n(l)}}const Hz={name:"codeText",previous:Bz,resolve:jz,tokenize:Uz};function jz(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 Bz(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Uz(e,t,n){let i=0,o,s;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"),d(m))}function d(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),d):m===96?(s=e.enter("codeTextSequence"),o=0,p(m)):we(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(m))}function f(m){return m===null||m===32||m===96||we(m)?(e.exit("codeTextData"),d(m)):(e.consume(m),f)}function p(m){return m===96?(e.consume(m),o++,p):o===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(s.type="codeTextData",f(m))}}class Vz{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 s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&tl(this.left,i),s.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),tl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),tl(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);tl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);tl(this.left,n.reverse())}}}function tl(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 $E(e){const t={};let n=-1,i,o,s,l,c,d,f;const p=new Vz(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"&&(d=i[1]._tokenizer.events,s=0,s<d.length&&d[s][1].type==="lineEndingBlank"&&(s+=2),s<d.length&&d[s][1].type==="content"))for(;++s<d.length&&d[s][1].type!=="content";)d[s][1].type==="chunkText"&&(d[s][1]._isInFirstContentOfListItem=!0,s++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,Fz(p,n)),n=t[n],f=!0);else if(i[1]._container){for(s=n,o=void 0;s--;)if(l=p.get(s),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(o&&(p.get(o)[1].type="lineEndingBlank"),l[1].type="lineEnding",o=s);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 wi(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function Fz(e,t){const n=e.get(t)[1],i=e.get(t)[2];let o=t-1;const s=[];let l=n._tokenizer;l||(l=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,d=[],f={};let p,m,g=-1,v=n,x=0,S=0;const w=[S];for(;v;){for(;e.get(++o)[1]!==v;);s.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;++g<c.length;)c[g][0]==="exit"&&c[g-1][0]==="enter"&&c[g][1].type===c[g-1][1].type&&c[g][1].start.line!==c[g][1].end.line&&(S=g+1,w.push(S),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(l.events=[],v?(v._tokenizer=void 0,v.previous=void 0):w.pop(),g=w.length;g--;){const _=c.slice(w[g],w[g+1]),C=s.pop();d.push([C,C+_.length-1]),e.splice(C,2,_)}for(d.reverse(),g=-1;++g<d.length;)f[x+d[g][0]]=x+d[g][1],x+=d[g][1]-d[g][0]-1;return f}const Gz={resolve:qz,tokenize:Wz},$z={partial:!0,tokenize:Yz};function qz(e){return $E(e),e}function Wz(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?s(c):we(c)?e.check($z,l,s)(c):(e.consume(c),o)}function s(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 Yz(e,t,n){const i=this;return o;function o(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),st(e,s,"linePrefix")}function s(l){if(l===null||we(l))return n(l);const c=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(i.parser.constructs.flow,n,t)(l)}}function qE(e,t,n,i,o,s,l,c,d){const f=d||Number.POSITIVE_INFINITY;let p=0;return m;function m(_){return _===60?(e.enter(i),e.enter(o),e.enter(s),e.consume(_),e.exit(s),g):_===null||_===32||_===41||rg(_)?n(_):(e.enter(i),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),S(_))}function g(_){return _===62?(e.enter(s),e.consume(_),e.exit(s),e.exit(o),e.exit(i),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),v(_))}function v(_){return _===62?(e.exit("chunkString"),e.exit(c),g(_)):_===null||_===60||we(_)?n(_):(e.consume(_),_===92?x:v)}function x(_){return _===60||_===62||_===92?(e.consume(_),v):v(_)}function S(_){return!p&&(_===null||_===41||gn(_))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(i),t(_)):p<f&&_===40?(e.consume(_),p++,S):_===41?(e.consume(_),p--,S):_===null||_===32||_===40||rg(_)?n(_):(e.consume(_),_===92?w:S)}function w(_){return _===40||_===41||_===92?(e.consume(_),S):S(_)}}function WE(e,t,n,i,o,s){const l=this;let c=0,d;return f;function f(v){return e.enter(i),e.enter(o),e.consume(v),e.exit(o),e.enter(s),p}function p(v){return c>999||v===null||v===91||v===93&&!d||v===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(v):v===93?(e.exit(s),e.enter(o),e.consume(v),e.exit(o),e.exit(i),t):we(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===null||v===91||v===93||we(v)||c++>999?(e.exit("chunkString"),p(v)):(e.consume(v),d||(d=!qe(v)),v===92?g:m)}function g(v){return v===91||v===92||v===93?(e.consume(v),c++,m):m(v)}}function YE(e,t,n,i,o,s){let l;return c;function c(g){return g===34||g===39||g===40?(e.enter(i),e.enter(o),e.consume(g),e.exit(o),l=g===40?41:g,d):n(g)}function d(g){return g===l?(e.enter(o),e.consume(g),e.exit(o),e.exit(i),t):(e.enter(s),f(g))}function f(g){return g===l?(e.exit(s),d(l)):g===null?n(g):we(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),st(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===l||g===null||we(g)?(e.exit("chunkString"),f(g)):(e.consume(g),g===92?m:p)}function m(g){return g===l||g===92?(e.consume(g),p):p(g)}}function ml(e,t){let n;return i;function i(o){return we(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):qe(o)?st(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}const Xz={name:"definition",tokenize:Qz},Kz={partial:!0,tokenize:Zz};function Qz(e,t,n){const i=this;let o;return s;function s(v){return e.enter("definition"),l(v)}function l(v){return WE.call(i,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return o=Ga(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),d):n(v)}function d(v){return gn(v)?ml(e,f)(v):f(v)}function f(v){return qE(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(Kz,m,m)(v)}function m(v){return qe(v)?st(e,g,"whitespace")(v):g(v)}function g(v){return v===null||we(v)?(e.exit("definition"),i.parser.defined.push(o),t(v)):n(v)}}function Zz(e,t,n){return i;function i(c){return gn(c)?ml(e,o)(c):n(c)}function o(c){return YE(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function s(c){return qe(c)?st(e,l,"whitespace")(c):l(c)}function l(c){return c===null||we(c)?t(c):n(c)}}const Jz={name:"hardBreakEscape",tokenize:eP};function eP(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return we(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const tP={name:"headingAtx",resolve:nP,tokenize:iP};function nP(e,t){let n=e.length-2,i=3,o,s;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},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},wi(e,i,n-i+1,[["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t]])),e}function iP(e,t,n){let i=0;return o;function o(p){return e.enter("atxHeading"),s(p)}function s(p){return e.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&i++<6?(e.consume(p),l):p===null||gn(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||we(p)?(e.exit("atxHeading"),t(p)):qe(p)?st(e,c,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),c(p))}function f(p){return p===null||p===35||gn(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),f)}}const rP=["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"],g_=["pre","script","style","textarea"],oP={concrete:!0,name:"htmlFlow",resolveTo:lP,tokenize:uP},aP={partial:!0,tokenize:dP},sP={partial:!0,tokenize:cP};function lP(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 uP(e,t,n){const i=this;let o,s,l,c,d;return f;function f(N){return p(N)}function p(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),m}function m(N){return N===33?(e.consume(N),g):N===47?(e.consume(N),s=!0,S):N===63?(e.consume(N),o=3,i.interrupt?t:R):yi(N)?(e.consume(N),l=String.fromCharCode(N),w):n(N)}function g(N){return N===45?(e.consume(N),o=2,v):N===91?(e.consume(N),o=5,c=0,x):yi(N)?(e.consume(N),o=4,i.interrupt?t:R):n(N)}function v(N){return N===45?(e.consume(N),i.interrupt?t:R):n(N)}function x(N){const se="CDATA[";return N===se.charCodeAt(c++)?(e.consume(N),c===se.length?i.interrupt?t:B:x):n(N)}function S(N){return yi(N)?(e.consume(N),l=String.fromCharCode(N),w):n(N)}function w(N){if(N===null||N===47||N===62||gn(N)){const se=N===47,de=l.toLowerCase();return!se&&!s&&g_.includes(de)?(o=1,i.interrupt?t(N):B(N)):rP.includes(l.toLowerCase())?(o=6,se?(e.consume(N),_):i.interrupt?t(N):B(N)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(N):s?C(N):T(N))}return N===45||Rn(N)?(e.consume(N),l+=String.fromCharCode(N),w):n(N)}function _(N){return N===62?(e.consume(N),i.interrupt?t:B):n(N)}function C(N){return qe(N)?(e.consume(N),C):Q(N)}function T(N){return N===47?(e.consume(N),Q):N===58||N===95||yi(N)?(e.consume(N),D):qe(N)?(e.consume(N),T):Q(N)}function D(N){return N===45||N===46||N===58||N===95||Rn(N)?(e.consume(N),D):I(N)}function I(N){return N===61?(e.consume(N),O):qe(N)?(e.consume(N),I):T(N)}function O(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),d=N,P):qe(N)?(e.consume(N),O):j(N)}function P(N){return N===d?(e.consume(N),d=null,F):N===null||we(N)?n(N):(e.consume(N),P)}function j(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||gn(N)?I(N):(e.consume(N),j)}function F(N){return N===47||N===62||qe(N)?T(N):n(N)}function Q(N){return N===62?(e.consume(N),G):n(N)}function G(N){return N===null||we(N)?B(N):qe(N)?(e.consume(N),G):n(N)}function B(N){return N===45&&o===2?(e.consume(N),z):N===60&&o===1?(e.consume(N),q):N===62&&o===4?(e.consume(N),H):N===63&&o===3?(e.consume(N),R):N===93&&o===5?(e.consume(N),ce):we(N)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(aP,Y,ee)(N)):N===null||we(N)?(e.exit("htmlFlowData"),ee(N)):(e.consume(N),B)}function ee(N){return e.check(sP,Z,Y)(N)}function Z(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),W}function W(N){return N===null||we(N)?ee(N):(e.enter("htmlFlowData"),B(N))}function z(N){return N===45?(e.consume(N),R):B(N)}function q(N){return N===47?(e.consume(N),l="",te):B(N)}function te(N){if(N===62){const se=l.toLowerCase();return g_.includes(se)?(e.consume(N),H):B(N)}return yi(N)&&l.length<8?(e.consume(N),l+=String.fromCharCode(N),te):B(N)}function ce(N){return N===93?(e.consume(N),R):B(N)}function R(N){return N===62?(e.consume(N),H):N===45&&o===2?(e.consume(N),R):B(N)}function H(N){return N===null||we(N)?(e.exit("htmlFlowData"),Y(N)):(e.consume(N),H)}function Y(N){return e.exit("htmlFlow"),t(N)}}function cP(e,t,n){const i=this;return o;function o(l){return we(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):n(l)}function s(l){return i.parser.lazy[i.now().line]?n(l):t(l)}}function dP(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Qd,t,n)}}const fP={name:"htmlText",tokenize:hP};function hP(e,t,n){const i=this;let o,s,l;return c;function c(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),d}function d(R){return R===33?(e.consume(R),f):R===47?(e.consume(R),I):R===63?(e.consume(R),T):yi(R)?(e.consume(R),j):n(R)}function f(R){return R===45?(e.consume(R),p):R===91?(e.consume(R),s=0,x):yi(R)?(e.consume(R),C):n(R)}function p(R){return R===45?(e.consume(R),v):n(R)}function m(R){return R===null?n(R):R===45?(e.consume(R),g):we(R)?(l=m,q(R)):(e.consume(R),m)}function g(R){return R===45?(e.consume(R),v):m(R)}function v(R){return R===62?z(R):R===45?g(R):m(R)}function x(R){const H="CDATA[";return R===H.charCodeAt(s++)?(e.consume(R),s===H.length?S:x):n(R)}function S(R){return R===null?n(R):R===93?(e.consume(R),w):we(R)?(l=S,q(R)):(e.consume(R),S)}function w(R){return R===93?(e.consume(R),_):S(R)}function _(R){return R===62?z(R):R===93?(e.consume(R),_):S(R)}function C(R){return R===null||R===62?z(R):we(R)?(l=C,q(R)):(e.consume(R),C)}function T(R){return R===null?n(R):R===63?(e.consume(R),D):we(R)?(l=T,q(R)):(e.consume(R),T)}function D(R){return R===62?z(R):T(R)}function I(R){return yi(R)?(e.consume(R),O):n(R)}function O(R){return R===45||Rn(R)?(e.consume(R),O):P(R)}function P(R){return we(R)?(l=P,q(R)):qe(R)?(e.consume(R),P):z(R)}function j(R){return R===45||Rn(R)?(e.consume(R),j):R===47||R===62||gn(R)?F(R):n(R)}function F(R){return R===47?(e.consume(R),z):R===58||R===95||yi(R)?(e.consume(R),Q):we(R)?(l=F,q(R)):qe(R)?(e.consume(R),F):z(R)}function Q(R){return R===45||R===46||R===58||R===95||Rn(R)?(e.consume(R),Q):G(R)}function G(R){return R===61?(e.consume(R),B):we(R)?(l=G,q(R)):qe(R)?(e.consume(R),G):F(R)}function B(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),o=R,ee):we(R)?(l=B,q(R)):qe(R)?(e.consume(R),B):(e.consume(R),Z)}function ee(R){return R===o?(e.consume(R),o=void 0,W):R===null?n(R):we(R)?(l=ee,q(R)):(e.consume(R),ee)}function Z(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||gn(R)?F(R):(e.consume(R),Z)}function W(R){return R===47||R===62||gn(R)?F(R):n(R)}function z(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}function q(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),te}function te(R){return qe(R)?st(e,ce,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):ce(R)}function ce(R){return e.enter("htmlTextData"),l(R)}}const Ay={name:"labelEnd",resolveAll:yP,resolveTo:vP,tokenize:bP},pP={tokenize:xP},mP={tokenize:SP},gP={tokenize:_P};function yP(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&&wi(e,0,e.length,n),e}function vP(e,t){let n=e.length,i=0,o,s,l,c;for(;n--;)if(o=e[n][1],s){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&&(s=n,o.type!=="labelLink")){i=2;break}}else o.type==="labelEnd"&&(l=n);const d={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[s][1].start},end:{...e[l][1].end}},p={type:"labelText",start:{...e[s+i+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",d,t],["enter",f,t]],c=Vn(c,e.slice(s+1,s+i+3)),c=Vn(c,[["enter",p,t]]),c=Vn(c,Ty(t.parser.constructs.insideSpan.null,e.slice(s+i+4,l-3),t)),c=Vn(c,[["exit",p,t],e[l-2],e[l-1],["exit",f,t]]),c=Vn(c,e.slice(l+1)),c=Vn(c,[["exit",d,t]]),wi(e,s,e.length,c),e}function bP(e,t,n){const i=this;let o=i.events.length,s,l;for(;o--;)if((i.events[o][1].type==="labelImage"||i.events[o][1].type==="labelLink")&&!i.events[o][1]._balanced){s=i.events[o][1];break}return c;function c(g){return s?s._inactive?m(g):(l=i.parser.defined.includes(Ga(i.sliceSerialize({start:s.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),d):n(g)}function d(g){return g===40?e.attempt(pP,p,l?p:m)(g):g===91?e.attempt(mP,p,l?f:m)(g):l?p(g):m(g)}function f(g){return e.attempt(gP,p,m)(g)}function p(g){return t(g)}function m(g){return s._balanced=!0,n(g)}}function xP(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 gn(m)?ml(e,s)(m):s(m)}function s(m){return m===41?p(m):qE(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function l(m){return gn(m)?ml(e,d)(m):p(m)}function c(m){return n(m)}function d(m){return m===34||m===39||m===40?YE(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function f(m){return gn(m)?ml(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 SP(e,t,n){const i=this;return o;function o(c){return WE.call(i,e,s,l,"reference","referenceMarker","referenceString")(c)}function s(c){return i.parser.defined.includes(Ga(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function _P(e,t,n){return i;function i(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),o}function o(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const CP={name:"labelStartImage",resolveAll:Ay.resolveAll,tokenize:wP};function wP(e,t,n){const i=this;return o;function o(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),s}function s(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 EP={name:"labelStartLink",resolveAll:Ay.resolveAll,tokenize:kP};function kP(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"),s}function s(l){return l===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(l):t(l)}}const Yp={name:"lineEnding",tokenize:TP};function TP(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),st(e,t,"linePrefix")}}const Zc={name:"thematicBreak",tokenize:AP};function AP(e,t,n){let i=0,o;return s;function s(f){return e.enter("thematicBreak"),l(f)}function l(f){return o=f,c(f)}function c(f){return f===o?(e.enter("thematicBreakSequence"),d(f)):i>=3&&(f===null||we(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===o?(e.consume(f),i++,d):(e.exit("thematicBreakSequence"),qe(f)?st(e,c,"whitespace")(f):c(f))}}const pn={continuation:{tokenize:DP},exit:IP,name:"list",tokenize:OP},LP={partial:!0,tokenize:NP},RP={partial:!0,tokenize:MP};function OP(e,t,n){const i=this,o=i.events[i.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,l=0;return c;function c(v){const x=i.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!i.containerState.marker||v===i.containerState.marker:og(v)){if(i.containerState.type||(i.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Zc,n,f)(v):f(v);if(!i.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(v)}return n(v)}function d(v){return og(v)&&++l<10?(e.consume(v),d):(!i.interrupt||l<2)&&(i.containerState.marker?v===i.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),f(v)):n(v)}function f(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||v,e.check(Qd,i.interrupt?n:p,e.attempt(LP,g,m))}function p(v){return i.containerState.initialBlankLine=!0,s++,g(v)}function m(v){return qe(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),g):n(v)}function g(v){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function DP(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(Qd,o,s);function o(c){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,st(e,t,"listItemIndent",i.containerState.size+1)(c)}function s(c){return i.containerState.furtherBlankLines||!qe(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(RP,t,l)(c))}function l(c){return i.containerState._closeFlow=!0,i.interrupt=void 0,st(e,e.attempt(pn,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function MP(e,t,n){const i=this;return st(e,o,"listItemIndent",i.containerState.size+1);function o(s){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(s):n(s)}}function IP(e){e.exit(this.containerState.type)}function NP(e,t,n){const i=this;return st(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const l=i.events[i.events.length-1];return!qe(s)&&l&&l[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const y_={name:"setextUnderline",resolveTo:zP,tokenize:PP};function zP(e,t){let n=e.length,i,o,s;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),!s&&e[n][1].type==="definition"&&(s=n);const l={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",l,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=l,e.push(["exit",l,t]),e}function PP(e,t,n){const i=this;let o;return s;function s(f){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=f,l(f)):n(f)}function l(f){return e.enter("setextHeadingLineSequence"),c(f)}function c(f){return f===o?(e.consume(f),c):(e.exit("setextHeadingLineSequence"),qe(f)?st(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||we(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const HP={tokenize:jP};function jP(e){const t=this,n=e.attempt(Qd,i,e.attempt(this.parser.constructs.flowInitial,o,st(e,e.attempt(this.parser.constructs.flow,o,e.attempt(Gz,o)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const BP={resolveAll:KE()},UP=XE("string"),VP=XE("text");function XE(e){return{resolveAll:KE(e==="text"?FP:void 0),tokenize:t};function t(n){const i=this,o=this.parser.constructs[e],s=n.attempt(o,l,c);return l;function l(p){return f(p)?s(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return f(p)?(n.exit("data"),s(p)):(n.consume(p),d)}function f(p){if(p===null)return!0;const m=o[p];let g=-1;if(m)for(;++g<m.length;){const v=m[g];if(!v.previous||v.previous.call(i,i.previous))return!0}return!1}}}function KE(e){return t;function t(n,i){let o=-1,s;for(;++o<=n.length;)s===void 0?n[o]&&n[o][1].type==="data"&&(s=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==s+2&&(n[s][1].end=n[o-1][1].end,n.splice(s+2,o-s-2),o=s+2),s=void 0);return e?e(n,i):n}}function FP(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 s=o.length,l=-1,c=0,d;for(;s--;){const f=o[s];if(typeof f=="string"){for(l=f.length;f.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(f===-2)d=!0,c++;else if(f!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const f={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?l:i.start._bufferIndex+l,_index:i.start._index+s,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...f.start},i.start.offset===i.end.offset?Object.assign(i,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const GP={42:pn,43:pn,45:pn,48:pn,49:pn,50:pn,51:pn,52:pn,53:pn,54:pn,55:pn,56:pn,57:pn,62:VE},$P={91:Xz},qP={[-2]:Wp,[-1]:Wp,32:Wp},WP={35:tP,42:Zc,45:[y_,Zc],60:oP,61:y_,95:Zc,96:m_,126:m_},YP={38:GE,92:FE},XP={[-5]:Yp,[-4]:Yp,[-3]:Yp,33:CP,38:GE,42:ag,60:[Ez,fP],91:EP,92:[Jz,FE],93:Ay,95:ag,96:Hz},KP={null:[ag,BP]},QP={null:[42,95]},ZP={null:[]},JP=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:QP,contentInitial:$P,disable:ZP,document:GP,flow:WP,flowInitial:qP,insideSpan:KP,string:YP,text:XP},Symbol.toStringTag,{value:"Module"}));function eH(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={},s=[];let l=[],c=[];const d={attempt:P(I),check:P(O),consume:C,enter:T,exit:D,interrupt:P(O,{interrupt:!0})},f={code:null,containerState:{},defineSkip:S,events:[],now:x,parser:e,previous:null,sliceSerialize:g,sliceStream:v,write:m};let p=t.tokenize.call(f,d);return t.resolveAll&&s.push(t),f;function m(G){return l=Vn(l,G),w(),l[l.length-1]!==null?[]:(j(t,0),f.events=Ty(s,f.events,f),f.events)}function g(G,B){return nH(v(G),B)}function v(G){return tH(l,G)}function x(){const{_bufferIndex:G,_index:B,line:ee,column:Z,offset:W}=i;return{_bufferIndex:G,_index:B,line:ee,column:Z,offset:W}}function S(G){o[G.line]=G.column,Q()}function w(){let G;for(;i._index<l.length;){const B=l[i._index];if(typeof B=="string")for(G=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===G&&i._bufferIndex<B.length;)_(B.charCodeAt(i._bufferIndex));else _(B)}}function _(G){p=p(G)}function C(G){we(G)?(i.line++,i.column=1,i.offset+=G===-3?2:1,Q()):G!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===l[i._index].length&&(i._bufferIndex=-1,i._index++)),f.previous=G}function T(G,B){const ee=B||{};return ee.type=G,ee.start=x(),f.events.push(["enter",ee,f]),c.push(ee),ee}function D(G){const B=c.pop();return B.end=x(),f.events.push(["exit",B,f]),B}function I(G,B){j(G,B.from)}function O(G,B){B.restore()}function P(G,B){return ee;function ee(Z,W,z){let q,te,ce,R;return Array.isArray(Z)?Y(Z):"tokenize"in Z?Y([Z]):H(Z);function H(le){return be;function be(Ee){const ge=Ee!==null&&le[Ee],We=Ee!==null&&le.null,Ge=[...Array.isArray(ge)?ge:ge?[ge]:[],...Array.isArray(We)?We:We?[We]:[]];return Y(Ge)(Ee)}}function Y(le){return q=le,te=0,le.length===0?z:N(le[te])}function N(le){return be;function be(Ee){return R=F(),ce=le,le.partial||(f.currentConstruct=le),le.name&&f.parser.constructs.disable.null.includes(le.name)?de():le.tokenize.call(B?Object.assign(Object.create(f),B):f,d,se,de)(Ee)}}function se(le){return G(ce,R),W}function de(le){return R.restore(),++te<q.length?N(q[te]):z}}}function j(G,B){G.resolveAll&&!s.includes(G)&&s.push(G),G.resolve&&wi(f.events,B,f.events.length-B,G.resolve(f.events.slice(B),f)),G.resolveTo&&(f.events=G.resolveTo(f.events,f))}function F(){const G=x(),B=f.previous,ee=f.currentConstruct,Z=f.events.length,W=Array.from(c);return{from:Z,restore:z};function z(){i=G,f.previous=B,f.currentConstruct=ee,f.events.length=Z,c=W,Q()}}function Q(){i.line in o&&i.column<2&&(i.column=o[i.line],i.offset+=o[i.line]-1)}}function tH(e,t){const n=t.start._index,i=t.start._bufferIndex,o=t.end._index,s=t.end._bufferIndex;let l;if(n===o)l=[e[n].slice(i,s)];else{if(l=e.slice(n,o),i>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(i):l.shift()}s>0&&l.push(e[o].slice(0,s))}return l}function nH(e,t){let n=-1;const i=[];let o;for(;++n<e.length;){const s=e[n];let l;if(typeof s=="string")l=s;else switch(s){case-5:{l="\r";break}case-4:{l=`
|
|
12
|
+
`;break}case-3:{l=`\r
|
|
13
|
+
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&o)continue;l=" ";break}default:l=String.fromCharCode(s)}o=s===-2,i.push(l)}return i.join("")}function iH(e){const i={constructs:cz([JP,...(e||{}).extensions||[]]),content:o(vz),defined:[],document:o(xz),flow:o(HP),lazy:{},string:o(UP),text:o(VP)};return i;function o(s){return l;function l(c){return eH(i,s,c)}}}function rH(e){for(;!$E(e););return e}const v_=/[\0\t\n\r]/g;function oH(){let e=1,t="",n=!0,i;return o;function o(s,l,c){const d=[];let f,p,m,g,v;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(l||void 0).decode(s)),m=0,t="",n&&(s.charCodeAt(0)===65279&&m++,n=void 0);m<s.length;){if(v_.lastIndex=m,f=v_.exec(s),g=f&&f.index!==void 0?f.index:s.length,v=s.charCodeAt(g),!f){t=s.slice(m);break}if(v===10&&m===g&&i)d.push(-3),i=void 0;else switch(i&&(d.push(-5),i=void 0),m<g&&(d.push(s.slice(m,g)),e+=g-m),v){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:i=!0,e=1}m=g+1}return c&&(i&&d.push(-5),t&&d.push(t),d.push(null)),d}}const aH=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function sH(e){return e.replace(aH,lH)}function lH(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),s=o===120||o===88;return UE(n.slice(s?2:1),s?16:10)}return ky(n)||e}const QE={}.hasOwnProperty;function uH(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),cH(n)(rH(iH(n).document().write(oH()(e,t,!0))))}function cH(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(ft),autolinkProtocol:F,autolinkEmail:F,atxHeading:s(he),blockQuote:s(We),characterEscape:F,characterReference:F,codeFenced:s(Ge),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(Ge,l),codeText:s(ot,l),codeTextData:F,data:F,codeFlowValue:F,definition:s(je),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s(pe),hardBreakEscape:s(lt),hardBreakTrailing:s(lt),htmlFlow:s(Ue,l),htmlFlowData:F,htmlText:s(Ue,l),htmlTextData:F,image:s(Qe),label:l,link:s(ft),listItem:s(ii),listItemValue:g,listOrdered:s(mt,m),listUnordered:s(mt),paragraph:s(yf),reference:N,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(he),strong:s(vf),thematicBreak:s(bf)},exit:{atxHeading:d(),atxHeadingSequence:I,autolink:d(),autolinkEmail:ge,autolinkProtocol:Ee,blockQuote:d(),characterEscapeValue:Q,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:le,characterReference:be,codeFenced:d(w),codeFencedFence:S,codeFencedFenceInfo:v,codeFencedFenceMeta:x,codeFlowValue:Q,codeIndented:d(_),codeText:d(W),codeTextData:Q,data:Q,definition:d(),definitionDestinationString:D,definitionLabelString:C,definitionTitleString:T,emphasis:d(),hardBreakEscape:d(B),hardBreakTrailing:d(B),htmlFlow:d(ee),htmlFlowData:Q,htmlText:d(Z),htmlTextData:Q,image:d(q),label:ce,labelText:te,lineEnding:G,link:d(z),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:se,resourceDestinationString:R,resourceTitleString:H,resource:Y,setextHeading:d(j),setextHeadingLineSequence:P,setextHeadingText:O,strong:d(),thematicBreak:d()}};ZE(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(re){let fe={type:"root",children:[]};const Ce={stack:[fe],tokenStack:[],config:t,enter:c,exit:f,buffer:l,resume:p,data:n},Ie=[];let Ye=-1;for(;++Ye<re.length;)if(re[Ye][1].type==="listOrdered"||re[Ye][1].type==="listUnordered")if(re[Ye][0]==="enter")Ie.push(Ye);else{const bn=Ie.pop();Ye=o(re,bn,Ye)}for(Ye=-1;++Ye<re.length;){const bn=t[re[Ye][0]];QE.call(bn,re[Ye][1].type)&&bn[re[Ye][1].type].call(Object.assign({sliceSerialize:re[Ye][2].sliceSerialize},Ce),re[Ye][1])}if(Ce.tokenStack.length>0){const bn=Ce.tokenStack[Ce.tokenStack.length-1];(bn[1]||b_).call(Ce,void 0,bn[0])}for(fe.position={start:Nr(re.length>0?re[0][1].start:{line:1,column:1,offset:0}),end:Nr(re.length>0?re[re.length-2][1].end:{line:1,column:1,offset:0})},Ye=-1;++Ye<t.transforms.length;)fe=t.transforms[Ye](fe)||fe;return fe}function o(re,fe,Ce){let Ie=fe-1,Ye=-1,bn=!1,ki,Kt,kt,an;for(;++Ie<=Ce;){const nt=re[Ie];switch(nt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{nt[0]==="enter"?Ye++:Ye--,an=void 0;break}case"lineEndingBlank":{nt[0]==="enter"&&(ki&&!an&&!Ye&&!kt&&(kt=Ie),an=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:an=void 0}if(!Ye&&nt[0]==="enter"&&nt[1].type==="listItemPrefix"||Ye===-1&&nt[0]==="exit"&&(nt[1].type==="listUnordered"||nt[1].type==="listOrdered")){if(ki){let ur=Ie;for(Kt=void 0;ur--;){const qn=re[ur];if(qn[1].type==="lineEnding"||qn[1].type==="lineEndingBlank"){if(qn[0]==="exit")continue;Kt&&(re[Kt][1].type="lineEndingBlank",bn=!0),qn[1].type="lineEnding",Kt=ur}else if(!(qn[1].type==="linePrefix"||qn[1].type==="blockQuotePrefix"||qn[1].type==="blockQuotePrefixWhitespace"||qn[1].type==="blockQuoteMarker"||qn[1].type==="listItemIndent"))break}kt&&(!Kt||kt<Kt)&&(ki._spread=!0),ki.end=Object.assign({},Kt?re[Kt][1].start:nt[1].end),re.splice(Kt||Ie,0,["exit",ki,nt[2]]),Ie++,Ce++}if(nt[1].type==="listItemPrefix"){const ur={type:"listItem",_spread:!1,start:Object.assign({},nt[1].start),end:void 0};ki=ur,re.splice(Ie,0,["enter",ur,nt[2]]),Ie++,Ce++,kt=void 0,an=!0}}}return re[fe][1]._spread=bn,Ce}function s(re,fe){return Ce;function Ce(Ie){c.call(this,re(Ie),Ie),fe&&fe.call(this,Ie)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(re,fe,Ce){this.stack[this.stack.length-1].children.push(re),this.stack.push(re),this.tokenStack.push([fe,Ce||void 0]),re.position={start:Nr(fe.start),end:void 0}}function d(re){return fe;function fe(Ce){re&&re.call(this,Ce),f.call(this,Ce)}}function f(re,fe){const Ce=this.stack.pop(),Ie=this.tokenStack.pop();if(Ie)Ie[0].type!==re.type&&(fe?fe.call(this,re,Ie[0]):(Ie[1]||b_).call(this,re,Ie[0]));else throw new Error("Cannot close `"+re.type+"` ("+pl({start:re.start,end:re.end})+"): it’s not open");Ce.position.end=Nr(re.end)}function p(){return lz(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function g(re){if(this.data.expectingFirstListItemValue){const fe=this.stack[this.stack.length-2];fe.start=Number.parseInt(this.sliceSerialize(re),10),this.data.expectingFirstListItemValue=void 0}}function v(){const re=this.resume(),fe=this.stack[this.stack.length-1];fe.lang=re}function x(){const re=this.resume(),fe=this.stack[this.stack.length-1];fe.meta=re}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const re=this.resume(),fe=this.stack[this.stack.length-1];fe.value=re.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const re=this.resume(),fe=this.stack[this.stack.length-1];fe.value=re.replace(/(\r?\n|\r)$/g,"")}function C(re){const fe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.label=fe,Ce.identifier=Ga(this.sliceSerialize(re)).toLowerCase()}function T(){const re=this.resume(),fe=this.stack[this.stack.length-1];fe.title=re}function D(){const re=this.resume(),fe=this.stack[this.stack.length-1];fe.url=re}function I(re){const fe=this.stack[this.stack.length-1];if(!fe.depth){const Ce=this.sliceSerialize(re).length;fe.depth=Ce}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function P(re){const fe=this.stack[this.stack.length-1];fe.depth=this.sliceSerialize(re).codePointAt(0)===61?1:2}function j(){this.data.setextHeadingSlurpLineEnding=void 0}function F(re){const Ce=this.stack[this.stack.length-1].children;let Ie=Ce[Ce.length-1];(!Ie||Ie.type!=="text")&&(Ie=Xt(),Ie.position={start:Nr(re.start),end:void 0},Ce.push(Ie)),this.stack.push(Ie)}function Q(re){const fe=this.stack.pop();fe.value+=this.sliceSerialize(re),fe.position.end=Nr(re.end)}function G(re){const fe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ce=fe.children[fe.children.length-1];Ce.position.end=Nr(re.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(fe.type)&&(F.call(this,re),Q.call(this,re))}function B(){this.data.atHardBreak=!0}function ee(){const re=this.resume(),fe=this.stack[this.stack.length-1];fe.value=re}function Z(){const re=this.resume(),fe=this.stack[this.stack.length-1];fe.value=re}function W(){const re=this.resume(),fe=this.stack[this.stack.length-1];fe.value=re}function z(){const re=this.stack[this.stack.length-1];if(this.data.inReference){const fe=this.data.referenceType||"shortcut";re.type+="Reference",re.referenceType=fe,delete re.url,delete re.title}else delete re.identifier,delete re.label;this.data.referenceType=void 0}function q(){const re=this.stack[this.stack.length-1];if(this.data.inReference){const fe=this.data.referenceType||"shortcut";re.type+="Reference",re.referenceType=fe,delete re.url,delete re.title}else delete re.identifier,delete re.label;this.data.referenceType=void 0}function te(re){const fe=this.sliceSerialize(re),Ce=this.stack[this.stack.length-2];Ce.label=sH(fe),Ce.identifier=Ga(fe).toLowerCase()}function ce(){const re=this.stack[this.stack.length-1],fe=this.resume(),Ce=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ce.type==="link"){const Ie=re.children;Ce.children=Ie}else Ce.alt=fe}function R(){const re=this.resume(),fe=this.stack[this.stack.length-1];fe.url=re}function H(){const re=this.resume(),fe=this.stack[this.stack.length-1];fe.title=re}function Y(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function se(re){const fe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.label=fe,Ce.identifier=Ga(this.sliceSerialize(re)).toLowerCase(),this.data.referenceType="full"}function de(re){this.data.characterReferenceType=re.type}function le(re){const fe=this.sliceSerialize(re),Ce=this.data.characterReferenceType;let Ie;Ce?(Ie=UE(fe,Ce==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ie=ky(fe);const Ye=this.stack[this.stack.length-1];Ye.value+=Ie}function be(re){const fe=this.stack.pop();fe.position.end=Nr(re.end)}function Ee(re){Q.call(this,re);const fe=this.stack[this.stack.length-1];fe.url=this.sliceSerialize(re)}function ge(re){Q.call(this,re);const fe=this.stack[this.stack.length-1];fe.url="mailto:"+this.sliceSerialize(re)}function We(){return{type:"blockquote",children:[]}}function Ge(){return{type:"code",lang:null,meta:null,value:""}}function ot(){return{type:"inlineCode",value:""}}function je(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function pe(){return{type:"emphasis",children:[]}}function he(){return{type:"heading",depth:0,children:[]}}function lt(){return{type:"break"}}function Ue(){return{type:"html",value:""}}function Qe(){return{type:"image",title:null,url:"",alt:null}}function ft(){return{type:"link",title:null,url:"",children:[]}}function mt(re){return{type:"list",ordered:re.type==="listOrdered",start:null,spread:re._spread,children:[]}}function ii(re){return{type:"listItem",spread:re._spread,checked:null,children:[]}}function yf(){return{type:"paragraph",children:[]}}function vf(){return{type:"strong",children:[]}}function Xt(){return{type:"text",value:""}}function bf(){return{type:"thematicBreak"}}}function Nr(e){return{line:e.line,column:e.column,offset:e.offset}}function ZE(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?ZE(e,i):dH(e,i)}}function dH(e,t){let n;for(n in t)if(QE.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 b_(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+pl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+pl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+pl({start:t.start,end:t.end})+") is still open")}function fH(e){const t=this;t.parser=n;function n(i){return uH(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function hH(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 pH(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
14
|
+
`}]}function mH(e,t){const n=t.value?t.value+`
|
|
15
|
+
`:"",i={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(i.className=["language-"+o[0]]);let s={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function gH(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yH(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vH(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),o=ts(i.toLowerCase()),s=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=s+1,c+=1,e.footnoteCounts.set(i,c);const d={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,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function bH(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 xH(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function JE(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),s=o[0];s&&s.type==="text"?s.value="["+s.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 SH(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return JE(e,t);const o={src:ts(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(o.title=i.title);const s={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,s),e.applyData(t,s)}function _H(e,t){const n={src:ts(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 CH(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 wH(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return JE(e,t);const o={href:ts(i.url||"")};i.title!==null&&i.title!==void 0&&(o.title=i.title);const s={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function EH(e,t){const n={href:ts(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 kH(e,t,n){const i=e.all(t),o=n?TH(n):ek(t),s={},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:[]}),s.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:`
|
|
16
|
+
`}),p.type==="element"&&p.tagName==="p"&&!o?l.push(...p.children):l.push(p)}const d=i[i.length-1];d&&(o||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
|
|
17
|
+
`});const f={type:"element",tagName:"li",properties:s,children:l};return e.patch(t,f),e.applyData(t,f)}function TH(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=ek(n[i])}return t}function ek(e){const t=e.spread;return t??e.children.length>1}function AH(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 s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function LH(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function RH(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function OH(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DH(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=_y(t.children[1]),d=IE(t.children[t.children.length-1]);c&&d&&(l.position={start:c,end:d}),o.push(l)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,s),e.applyData(t,s)}function MH(e,t,n){const i=n?n.children:void 0,s=(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 d=-1;const f=[];for(;++d<c;){const m=t.children[d],g={},v=l?l[d]:void 0;v&&(g.align=v);let x={type:"element",tagName:s,properties:g,children:[]};m&&(x.children=e.all(m),e.patch(m,x),x=e.applyData(m,x)),f.push(x)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function IH(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const x_=9,S_=32;function NH(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),o=0;const s=[];for(;i;)s.push(__(t.slice(o,i.index),o>0,!0),i[0]),o=i.index+i[0].length,i=n.exec(t);return s.push(__(t.slice(o),o>0,!1)),s.join("")}function __(e,t,n){let i=0,o=e.length;if(t){let s=e.codePointAt(i);for(;s===x_||s===S_;)i++,s=e.codePointAt(i)}if(n){let s=e.codePointAt(o-1);for(;s===x_||s===S_;)o--,s=e.codePointAt(o-1)}return o>i?e.slice(i,o):""}function zH(e,t){const n={type:"text",value:NH(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function PH(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const HH={blockquote:hH,break:pH,code:mH,delete:gH,emphasis:yH,footnoteReference:vH,heading:bH,html:xH,imageReference:SH,image:_H,inlineCode:CH,linkReference:wH,link:EH,listItem:kH,list:AH,paragraph:LH,root:RH,strong:OH,table:DH,tableCell:IH,tableRow:MH,text:zH,thematicBreak:PH,toml:vc,yaml:vc,definition:vc,footnoteDefinition:vc};function vc(){}const tk=-1,Zd=0,gl=1,md=2,Ly=3,Ry=4,Oy=5,Dy=6,nk=7,ik=8,rk=typeof self=="object"?self:globalThis,C_=(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 rk[e](t)},jH=(e,t)=>{const n=(o,s)=>(e.set(s,o),o),i=o=>{if(e.has(o))return e.get(o);const[s,l]=t[o];switch(s){case Zd:case tk:return n(l,o);case gl:{const c=n([],o);for(const d of l)c.push(i(d));return c}case md:{const c=n({},o);for(const[d,f]of l)c[i(d)]=i(f);return c}case Ly:return n(new Date(l),o);case Ry:{const{source:c,flags:d}=l;return n(new RegExp(c,d),o)}case Oy:{const c=n(new Map,o);for(const[d,f]of l)c.set(i(d),i(f));return c}case Dy:{const c=n(new Set,o);for(const d of l)c.add(i(d));return c}case nk:{const{name:c,message:d}=l;return n(typeof rk[c]=="function"?C_(c,d):new Error(d),o)}case ik: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)}}return n(C_(s,l),o)};return i},w_=e=>jH(new Map,e)(0),bo="",{toString:BH}={},{keys:UH}=Object,nl=e=>{const t=typeof e;if(t!=="object"||!e)return[Zd,t];const n=BH.call(e).slice(8,-1);switch(n){case"Array":return[gl,bo];case"Object":return[md,bo];case"Date":return[Ly,bo];case"RegExp":return[Ry,bo];case"Map":return[Oy,bo];case"Set":return[Dy,bo];case"DataView":return[gl,n]}return n.includes("Array")?[gl,n]:e instanceof Error?[nk,e.name||"Error"]:[md,n]},bc=([e,t])=>e===Zd&&(t==="function"||t==="symbol"),VH=(e,t,n,i)=>{const o=(l,c)=>{const d=i.push(l)-1;return n.set(c,d),d},s=l=>{if(n.has(l))return n.get(l);let[c,d]=nl(l);switch(c){case Zd:{let p=l;switch(d){case"bigint":c=ik,p=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return o([tk],l)}return o([c,p],l)}case gl:{if(d){let g=l;return d==="DataView"?g=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(g=new Uint8Array(l)),o([d,[...g]],l)}const p=[],m=o([c,p],l);for(const g of l)p.push(s(g));return m}case md:{if(d)switch(d){case"BigInt":return o([d,l.toString()],l);case"Boolean":case"Number":case"String":return o([d,l.valueOf()],l)}if(t&&"toJSON"in l)return s(l.toJSON());const p=[],m=o([c,p],l);for(const g of UH(l))(e||!bc(nl(l[g])))&&p.push([s(g),s(l[g])]);return m}case Ly:return o([c,isNaN(l.getTime())?bo:l.toISOString()],l);case Ry:{const{source:p,flags:m}=l;return o([c,{source:p,flags:m}],l)}case Oy:{const p=[],m=o([c,p],l);for(const[g,v]of l)(e||!(bc(nl(g))||bc(nl(v))))&&p.push([s(g),s(v)]);return m}case Dy:{const p=[],m=o([c,p],l);for(const g of l)(e||!bc(nl(g)))&&p.push(s(g));return m}}const{message:f}=l;return o([c,{name:d,message:f}],l)};return s},E_=(e,{json:t,lossy:n}={})=>{const i=[];return VH(!(t||n),!!t,new Map,i)(e),i},gd=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?w_(E_(e,t)):structuredClone(e):(e,t)=>w_(E_(e,t));function FH(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 GH(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function $H(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||FH,i=e.options.footnoteBackLabel||GH,o=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[d]);if(!f)continue;const p=e.all(f),m=String(f.identifier).toUpperCase(),g=ts(m.toLowerCase());let v=0;const x=[],S=e.footnoteCounts.get(m);for(;S!==void 0&&++v<=S;){x.length>0&&x.push({type:"text",value:" "});let C=typeof n=="string"?n:n(d,v);typeof C=="string"&&(C={type:"text",value:C}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+g+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(d,v),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const w=p[p.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const C=w.children[w.children.length-1];C&&C.type==="text"?C.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...x)}else p.push(...x);const _={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(p,!0)};e.patch(f,_),c.push(_)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...gd(l),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
18
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
19
|
+
`}]}}const ok=(function(e){if(e==null)return XH;if(typeof e=="function")return Jd(e);if(typeof e=="object")return Array.isArray(e)?qH(e):WH(e);if(typeof e=="string")return YH(e);throw new Error("Expected function, string, or object as test")});function qH(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ok(e[n]);return Jd(i);function i(...o){let s=-1;for(;++s<t.length;)if(t[s].apply(this,o))return!0;return!1}}function WH(e){const t=e;return Jd(n);function n(i){const o=i;let s;for(s in e)if(o[s]!==t[s])return!1;return!0}}function YH(e){return Jd(t);function t(n){return n&&n.type===e}}function Jd(e){return t;function t(n,i,o){return!!(KH(n)&&e.call(this,n,typeof i=="number"?i:void 0,o||void 0))}}function XH(){return!0}function KH(e){return e!==null&&typeof e=="object"&&"type"in e}const ak=[],QH=!0,k_=!1,ZH="skip";function JH(e,t,n,i){let o;typeof t=="function"&&typeof n!="function"?(i=n,n=t):o=t;const s=ok(o),l=i?-1:1;c(e,void 0,[])();function c(d,f,p){const m=d&&typeof d=="object"?d:{};if(typeof m.type=="string"){const v=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(d.type+(v?"<"+v+">":""))+")"})}return g;function g(){let v=ak,x,S,w;if((!t||s(d,f,p[p.length-1]||void 0))&&(v=e8(n(d,p)),v[0]===k_))return v;if("children"in d&&d.children){const _=d;if(_.children&&v[0]!==ZH)for(S=(i?_.children.length:-1)+l,w=p.concat(_);S>-1&&S<_.children.length;){const C=_.children[S];if(x=c(C,S,w)(),x[0]===k_)return x;S=typeof x[1]=="number"?x[1]:S+l}}return v}}}function e8(e){return Array.isArray(e)?e:typeof e=="number"?[QH,e]:e==null?ak:[e]}function sk(e,t,n,i){let o,s,l;typeof t=="function"&&typeof n!="function"?(s=void 0,l=t,o=n):(s=t,l=n,o=i),JH(e,s,c,o);function c(d,f){const p=f[f.length-1],m=p?p.children.indexOf(d):void 0;return l(d,m,p)}}const sg={}.hasOwnProperty,t8={};function n8(e,t){const n=t||t8,i=new Map,o=new Map,s=new Map,l={...HH,...n.handlers},c={all:f,applyData:r8,definitionById:i,footnoteById:o,footnoteCounts:s,footnoteOrder:[],handlers:l,one:d,options:n,patch:i8,wrap:a8};return sk(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?i:o,g=String(p.identifier).toUpperCase();m.has(g)||m.set(g,p)}}),c;function d(p,m){const g=p.type,v=c.handlers[g];if(sg.call(c.handlers,g)&&v)return v(c,p,m);if(c.options.passThrough&&c.options.passThrough.includes(g)){if("children"in p){const{children:S,...w}=p,_=gd(w);return _.children=c.all(p),_}return gd(p)}return(c.options.unknownHandler||o8)(c,p,m)}function f(p){const m=[];if("children"in p){const g=p.children;let v=-1;for(;++v<g.length;){const x=c.one(g[v],p);if(x){if(v&&g[v-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=T_(x.value)),!Array.isArray(x)&&x.type==="element")){const S=x.children[0];S&&S.type==="text"&&(S.value=T_(S.value))}Array.isArray(x)?m.push(...x):m.push(x)}}}return m}}function i8(e,t){e.position&&(t.position=BN(e))}function r8(e,t){let n=t;if(e&&e.data){const i=e.data.hName,o=e.data.hChildren,s=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"&&s&&Object.assign(n.properties,gd(s)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function o8(e,t){const n=t.data||{},i="value"in t&&!(sg.call(n,"hProperties")||sg.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 a8(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:`
|
|
20
|
+
`});++i<e.length;)i&&n.push({type:"text",value:`
|
|
21
|
+
`}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
22
|
+
`}),n}function T_(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function A_(e,t){const n=n8(e,t),i=n.one(e,void 0),o=$H(n),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return o&&s.children.push({type:"text",value:`
|
|
23
|
+
`},o),s}function s8(e,t){return e&&"run"in e?async function(n,i){const o=A_(n,{file:i,...t});await e.run(o,i)}:function(n,i){return A_(n,{file:i,...e||t})}}function L_(e){if(e)throw e}var Xp,R_;function l8(){if(R_)return Xp;R_=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},s=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),m=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!m)return!1;var g;for(g in f);return typeof g>"u"||e.call(f,g)},l=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},c=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(i)return i(f,p).value}else return;return f[p]};return Xp=function d(){var f,p,m,g,v,x,S=arguments[0],w=1,_=arguments.length,C=!1;for(typeof S=="boolean"&&(C=S,S=arguments[1]||{},w=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});w<_;++w)if(f=arguments[w],f!=null)for(p in f)m=c(S,p),g=c(f,p),S!==g&&(C&&g&&(s(g)||(v=o(g)))?(v?(v=!1,x=m&&o(m)?m:[]):x=m&&s(m)?m:{},l(S,{name:p,newValue:d(C,x,g)})):typeof g<"u"&&l(S,{name:p,newValue:g}));return S},Xp}var u8=l8();const Kp=Vd(u8);function lg(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 c8(){const e=[],t={run:n,use:i};return t;function n(...o){let s=-1;const l=o.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...o);function c(d,...f){const p=e[++s];let m=-1;if(d){l(d);return}for(;++m<o.length;)(f[m]===null||f[m]===void 0)&&(f[m]=o[m]);o=f,p?d8(p,c)(...f):l(null,...f)}}function i(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function d8(e,t){let n;return i;function i(...l){const c=e.length>l.length;let d;c&&l.push(o);try{d=e.apply(this,l)}catch(f){const p=f;if(c&&n)throw p;return o(p)}c||(d&&d.then&&typeof d.then=="function"?d.then(s,o):d instanceof Error?o(d):s(d))}function o(l,...c){n||(n=!0,t(l,...c))}function s(l){o(null,l)}}const fi={basename:f8,dirname:h8,extname:p8,join:m8,sep:"/"};function f8(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Fl(e);let n=0,i=-1,o=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(s){n=o+1;break}}else i<0&&(s=!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(s){n=o+1;break}}else l<0&&(s=!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 h8(e){if(Fl(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 p8(e){Fl(e);let t=e.length,n=-1,i=0,o=-1,s=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:s!==1&&(s=1):o>-1&&(s=-1)}return o<0||n<0||s===0||s===1&&o===n-1&&o===i+1?"":e.slice(o,n)}function m8(...e){let t=-1,n;for(;++t<e.length;)Fl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":g8(n)}function g8(e){Fl(e);const t=e.codePointAt(0)===47;let n=y8(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function y8(e,t){let n="",i=0,o=-1,s=0,l=-1,c,d;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||s===1))if(o!==l-1&&s===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",i=0):(n=n.slice(0,d),i=n.length-1-n.lastIndexOf("/")),o=l,s=0;continue}}else if(n.length>0){n="",i=0,o=l,s=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,s=0}else c===46&&s>-1?s++:s=-1}return n}function Fl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const v8={cwd:b8};function b8(){return"/"}function ug(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function x8(e){if(typeof e=="string")e=new URL(e);else if(!ug(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 S8(e)}function S8(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 Qp=["history","path","basename","stem","extname","dirname"];class lk{constructor(t){let n;t?ug(t)?n={path:t}:typeof t=="string"||_8(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":v8.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<Qp.length;){const s=Qp[i];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let o;for(o in n)Qp.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?fi.basename(this.path):void 0}set basename(t){Jp(t,"basename"),Zp(t,"basename"),this.path=fi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?fi.dirname(this.path):void 0}set dirname(t){O_(this.basename,"dirname"),this.path=fi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?fi.extname(this.path):void 0}set extname(t){if(Zp(t,"extname"),O_(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=fi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ug(t)&&(t=x8(t)),Jp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?fi.basename(this.path,this.extname):void 0}set stem(t){Jp(t,"stem"),Zp(t,"stem"),this.path=fi.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 Yt(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 Zp(e,t){if(e&&e.includes(fi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+fi.sep+"`")}function Jp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function O_(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function _8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const C8=(function(e){const i=this.constructor.prototype,o=i[e],s=function(){return o.apply(s,arguments)};return Object.setPrototypeOf(s,i),s}),w8={}.hasOwnProperty;class My extends C8{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=c8()}copy(){const t=new My;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(Kp(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(nm("data",this.frozen),this.namespace[t]=n,this):w8.call(this.namespace,t)&&this.namespace[t]||void 0:t?(nm("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=xc(t),i=this.parser||this.Parser;return em("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),em("process",this.parser||this.Parser),tm("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(s,l){const c=xc(t),d=i.parse(c);i.run(d,c,function(p,m,g){if(p||!m||!g)return f(p);const v=m,x=i.stringify(v,g);T8(x)?g.value=x:g.result=x,f(p,g)});function f(p,m){p||!m?l(p):s?s(m):n(void 0,m)}}}processSync(t){let n=!1,i;return this.freeze(),em("processSync",this.parser||this.Parser),tm("processSync",this.compiler||this.Compiler),this.process(t,o),M_("processSync","process",n),i;function o(s,l){n=!0,L_(s),i=l}}run(t,n,i){D_(t),this.freeze();const o=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?s(void 0,i):new Promise(s);function s(l,c){const d=xc(n);o.run(t,d,f);function f(p,m,g){const v=m||t;p?c(p):l?l(v):i(void 0,v,g)}}}runSync(t,n){let i=!1,o;return this.run(t,n,s),M_("runSync","run",i),o;function s(l,c){L_(l),o=c,i=!0}}stringify(t,n){this.freeze();const i=xc(n),o=this.compiler||this.Compiler;return tm("stringify",o),D_(t),o(t,i)}use(t,...n){const i=this.attachers,o=this.namespace;if(nm("use",this.frozen),t!=null)if(typeof t=="function")d(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 s(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...m]=f;d(p,m)}else l(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function l(f){if(!("plugins"in f)&&!("settings"in f))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(f.plugins),f.settings&&(o.settings=Kp(!0,o.settings,f.settings))}function c(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const m=f[p];s(m)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,p){let m=-1,g=-1;for(;++m<i.length;)if(i[m][0]===f){g=m;break}if(g===-1)i.push([f,...p]);else if(p.length>0){let[v,...x]=p;const S=i[g][1];lg(S)&&lg(v)&&(v=Kp(!0,S,v)),i[g]=[f,v,...x]}}}}const E8=new My().freeze();function em(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function tm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function nm(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 D_(e){if(!lg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function M_(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function xc(e){return k8(e)?e:new lk(e)}function k8(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function T8(e){return typeof e=="string"||A8(e)}function A8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const L8="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",I_=[],N_={allowDangerousHtml:!0},R8=/^(https?|ircs?|mailto|xmpp)$/i,O8=[{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 D8(e){const t=M8(e),n=I8(e);return N8(t.runSync(t.parse(n),n),e)}function M8(e){const t=e.rehypePlugins||I_,n=e.remarkPlugins||I_,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...N_}:N_;return E8().use(fH).use(n).use(s8,i).use(t)}function I8(e){const t=e.children||"",n=new lk;return typeof t=="string"&&(n.value=t),n}function N8(e,t){const n=t.allowedElements,i=t.allowElement,o=t.components,s=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||uk;for(const p of O8)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+L8+p.id,void 0);return sk(e,f),$N(e,{Fragment:k.Fragment,components:o,ignoreInvalidStyle:!0,jsx:k.jsx,jsxs:k.jsxs,passKeys:!0,passNode:!0});function f(p,m,g){if(p.type==="raw"&&g&&typeof m=="number")return l?g.children.splice(m,1):g.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let v;for(v in qp)if(Object.hasOwn(qp,v)&&Object.hasOwn(p.properties,v)){const x=p.properties[v],S=qp[v];(S===null||S.includes(p.tagName))&&(p.properties[v]=d(String(x||""),v,p))}}if(p.type==="element"){let v=n?!n.includes(p.tagName):s?s.includes(p.tagName):!1;if(!v&&i&&typeof m=="number"&&(v=!i(p,m,g)),v&&g&&typeof m=="number")return c&&p.children?g.children.splice(m,1,...p.children):g.children.splice(m,1),m}}}function uk(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||R8.test(e.slice(0,t))?e:""}const z8=["code","em","strong","a"];function P8(e){return e.replace(/\s+/g," ").trim()}const ck=M.createContext(null);function H8(e){return k.jsx(ck.Provider,{value:e.value,children:e.children})}function j8(){return M.useContext(ck)}const B8={ticket:"Ticket",pr:"Pull request","pr-comment":"Comment",commit:"Commit",transcript:"Transcript"},U8={ticket:H2,pr:G2,"pr-comment":W2,commit:V2,transcript:O2};function V8(e){return e==="old"?"deletions":"additions"}function F8(e){const t=new Map;for(const n of e){const i=`${n.side}:${n.line}`,o=t.get(i)??[];o.push(n),t.set(i,o)}return t}function G8(e){const{source:t,stale:n=!1,onCite:i,children:o}=e,s=U8[t.kind],l=t.path!==void 0&&t.side!==void 0&&t.line!==void 0,c=Me("cursor-pointer font-medium text-primary underline-offset-2 hover:underline",n&&"text-warn"),d=f=>{if(f.preventDefault(),f.stopPropagation(),l){i?.(t);return}t.url!==void 0&&window.open(t.url,"_blank","noopener,noreferrer")};return k.jsxs(Zt,{children:[k.jsx(Jt,{asChild:!0,children:k.jsxs("span",{role:"link",tabIndex:0,className:c,onClick:d,children:[k.jsx(s,{"aria-hidden":!0,className:"mr-[0.18em] inline size-[0.8em] align-[-0.12em]"}),o]})}),k.jsxs(en,{className:"max-w-sm space-y-1 border border-border bg-popover px-3 py-2 text-popover-foreground shadow-card",children:[k.jsx("p",{className:"font-mono text-[10px] tracking-[0.14em] uppercase text-muted-foreground",children:B8[t.kind]}),k.jsx("p",{className:"font-medium text-foreground",children:t.label}),t.gist!==void 0?k.jsx("p",{className:"text-muted-foreground",children:t.gist}):null,n?k.jsx("p",{className:"text-warn",children:"This source id is missing from the review document."}):null,t.url!==void 0?k.jsxs("a",{className:"inline-flex items-center gap-0.5 text-primary hover:underline",href:t.url,target:"_blank",rel:"noreferrer",children:["Open",k.jsx(R1,{className:"size-3"})]}):null]})]})}function $8(e){return k.jsxs(Zt,{children:[k.jsx(Jt,{asChild:!0,children:k.jsx("span",{className:"text-warn",children:e.children})}),k.jsx(en,{children:"Unknown source. The id is not in the review document."})]})}const q8="mx-[0.08em] box-decoration-clone rounded-[0.22em] bg-[color-mix(in_srgb,var(--foreground)_8%,transparent)] px-[0.32em] py-[0.12em] font-mono text-[0.86em] font-medium not-italic";function W8(e){return e.startsWith("source:")?e:uk(e)}function $a(e){const t=P8(e.text),n=j8();if(t==="")return null;const i={code:({children:o})=>M.createElement("code",{className:q8},o),strong:({children:o})=>M.createElement("strong",{className:"font-semibold"},o),a:({href:o,children:s})=>{const l=b2(o);if(l===void 0)return o===void 0||o===""?M.createElement("span",null,s):M.createElement("a",{href:o,className:"text-primary hover:underline",target:"_blank",rel:"noreferrer"},s);const c=n?.byId.get(l);return c===void 0?M.createElement($8,{children:s}):M.createElement(G8,{source:c,onCite:n?.onCite,children:s})}};return M.createElement(D8,{skipHtml:!0,unwrapDisallowed:!0,allowedElements:[...z8],urlTransform:W8,components:i,children:t})}function qr(e){return k.jsx("p",{id:e.id,className:Me("font-mono text-[11px] tracking-[0.14em] uppercase text-muted-foreground",e.className),children:e.children})}const dk=6;function Y8(e){const t=new Map(e.map(s=>[s.id,s.suggestedOrder]));if(!e.some(s=>s.part!==void 0))return[{colorIndex:0,groupIds:z_(e.map(s=>s.id),t)}];const i=new Map;for(const s of e){const l=s.part??`\0${s.id}`,c=i.get(l)??[];c.push(s.id),i.set(l,c)}const o=[...i.entries()].map(([s,l])=>{const c=z_(l,t);return{title:s.startsWith("\0")?void 0:s,groupIds:c,minOrder:t.get(c[0]??"")??0,sortKey:c[0]??""}});return o.sort((s,l)=>s.minOrder-l.minOrder||(s.title??s.sortKey).localeCompare(l.title??l.sortKey)),o.map((s,l)=>({colorIndex:l%dk,groupIds:s.groupIds,...s.title!==void 0?{title:s.title}:{}}))}function fk(e){const t=new Map;for(const n of e)for(const i of n.groupIds)t.set(i,n.colorIndex);return t}function ef(e){return`var(--strand-${e%dk})`}function Iy(e){return e.length>1}function z_(e,t){return[...e].sort((n,i)=>(t.get(n)??0)-(t.get(i)??0)||n.localeCompare(i))}function hk(e){const{ids:t,sources:n,mixed:i=!1,parts:o=[],className:s}=e;if(t.length===0)return null;const l=new Map(n.map(d=>[d.id,d])),c=t.flatMap(d=>{const f=l.get(d);return f===void 0?[]:[f]});return c.length===0?null:k.jsxs("div",{className:Me("mb-5",s),children:[k.jsx(qr,{className:"mb-2",children:"Sources"}),k.jsx("ul",{className:"space-y-1 font-mono text-[11px] tracking-wide text-muted-foreground",children:c.map(d=>{const f=i?o.find(m=>m.title===d.part):void 0,p="shrink-0 text-foreground";return k.jsxs("li",{className:"flex min-w-0 items-baseline gap-2",children:[f!==void 0?k.jsx("span",{"aria-hidden":!0,className:"mt-[0.3em] size-2 shrink-0 rounded-full",style:{backgroundColor:ef(f.colorIndex)}}):null,d.url!==void 0?k.jsx("a",{className:Me(p,"hover:text-primary hover:underline"),href:d.url,target:"_blank",rel:"noreferrer",children:d.label}):k.jsx("span",{className:p,children:d.label}),d.gist!==void 0?k.jsx("span",{className:"min-w-0 truncate font-sans text-xs tracking-normal",children:d.gist}):d.title!==void 0?k.jsx("span",{className:"min-w-0 truncate font-sans text-xs tracking-normal",children:d.title}):null]},d.id)})})]})}function yd(e){return k.jsxs("div",{className:e.className,children:[e.kicker!==void 0?e.kickerExtra!==void 0?k.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[k.jsx(qr,{children:e.kicker}),e.kickerExtra]}):k.jsx(qr,{className:"mb-2",children:e.kicker}):null,k.jsx("h1",{className:"mb-3 font-display text-[2.5rem] leading-[1.15] tracking-[-0.015em] text-balance text-foreground",children:e.title}),e.children]})}function X8(e){const{group:t,index:n,groups:i,document:o,partTitle:s,onOpenGroup:l}=e,c=o.groups.find(f=>f.id===t.id),d=c!==void 0?S2(c):t.sources;return k.jsx(yd,{kicker:s!==void 0?`${s} · ${hl(n)}`:hl(n),title:t.title,kickerExtra:k.jsx(_E,{prompt:A1({group:t.id}),scope:"group"}),children:k.jsxs("div",{children:[k.jsx(qr,{className:"mb-2",children:"Why"}),k.jsx("p",{className:"mb-6 font-display text-xl leading-relaxed text-pretty text-foreground",children:k.jsx($a,{text:t.why})}),k.jsx(qr,{className:"mb-2",children:"What"}),k.jsx("p",{className:"mb-5 leading-relaxed text-pretty text-foreground",children:k.jsx($a,{text:t.summary})}),k.jsx(hk,{ids:d,sources:o.sources??[]}),t.dependsOn.length>0?k.jsxs("p",{className:"mb-5 text-muted-foreground",children:["Depends on"," ",t.dependsOn.map((f,p)=>{const m=i.find(v=>v.id===f),g=m!==void 0?`${hl(e1(i,f))} ${m.title}`:f;return k.jsxs("span",{children:[p>0?", ":"",k.jsx(Et,{type:"button",variant:"link",className:"h-auto p-0",onClick:()=>l(f),children:g})]},f)})]}):null,t.lookFor.length>0?k.jsx("ul",{className:"mb-2 list-disc space-y-2 pl-5 leading-relaxed",children:t.lookFor.map((f,p)=>k.jsx("li",{children:k.jsx($a,{text:f})},p))}):null,t.staleCount>0?k.jsxs("p",{className:"mt-4 text-warn",children:[t.staleCount," hunk ref",t.staleCount===1?"":"s"," no longer match live git. Git wins; the pointer is flagged, not replaced."]}):null]})})}const pk="comprehende:rail-collapsed";function K8(){try{return localStorage.getItem(pk)==="1"}catch{return!1}}function Q8(e){try{localStorage.setItem(pk,e?"1":"0")}catch{}}function mk(e){const t=e.lastIndexOf("/");return t===-1?e:e.slice(t+1)}function P_(e){const t=e.lastIndexOf("/");return t===-1?"":e.slice(0,t)}function Z8(e){return/^(@@ -\d+(?:,\d+)? \+\d+(?:,\d+)? @@)/.exec(e)?.[1]??e}function J8(e){const t=[],n=/^(?:export\s+)?(?:async\s+)?(?:function|class|type|interface|enum)\s+([A-Za-z_][\w]*)/;for(const i of e){const s=n.exec(i.trim())?.[1];s!==void 0&&!t.includes(s)&&t.push(s)}return t}function e5(e){let t=0,n=0;for(const i of e)i.kind==="add"?t+=1:i.kind==="del"&&(n+=1);return{added:t,removed:n}}function Sc(e){let t=0;return e.map(n=>{const i=e5(n.hunks.flatMap(s=>s.lines)),o={path:n.path,kind:n.kind??"text",status:n.status??"modified",patch:n.patch,added:n.added??i.added,removed:n.removed??i.removed,hunkCount:Math.max(n.hunks.length,1),firstIndex:t,complete:n.complete!==!1,hunks:n.hunks};return n.oldPath!==void 0&&(o.oldPath=n.oldPath),t+=o.hunkCount,o})}function Jc(e,t){return e.findIndex(n=>t>=n.firstIndex&&t<n.firstIndex+n.hunkCount)}function t5(e){const{file:t}=e;return t.kind==="image"?k.jsx("span",{className:"font-mono text-[11px] text-muted-foreground",children:t.status}):k.jsxs("span",{className:"font-mono text-[11px] tabular-nums",children:[k.jsxs("span",{className:"text-del",children:["−",t.removed]})," ",k.jsxs("span",{className:"text-add",children:["+",t.added]})]})}function n5(e){const{files:t,activeHunk:n,viewedPaths:i}=e,o=Math.max(0,Jc(t,n)),s=M.useRef(null),[l,c]=M.useState(()=>{try{const f=new URLSearchParams(window.location.search).get("rail");if(f==="collapsed")return!0;if(f==="open")return!1}catch{}try{return K8()}catch{return!1}}),d=()=>{const f=!l;c(f);try{Q8(f)}catch{}try{const p=new URL(window.location.href);f?p.searchParams.set("rail","collapsed"):p.searchParams.delete("rail"),window.history.replaceState(null,"",p)}catch{}};return M.useEffect(()=>{s.current?.querySelector(`[data-rail="${o}"]`)?.scrollIntoView({block:"nearest",behavior:"instant"})},[o]),l?k.jsxs("div",{className:"mt-4 flex min-h-0 gap-0 max-sm:flex-col",children:[k.jsx("div",{className:"min-w-0 flex-1 space-y-8",children:e.children}),k.jsxs("div",{className:"sticky top-4 flex h-[calc(100vh-8rem)] shrink-0 self-start flex-col items-center gap-3 border-l border-border bg-card py-3",style:{width:"44px"},children:[k.jsx(Et,{size:"icon-sm",variant:"ghost",className:"size-7","aria-label":"Expand file list",onClick:d,children:k.jsx(zS,{className:"size-4 rotate-180"})}),k.jsxs("div",{className:"font-mono text-[10px] leading-none text-muted-foreground [writing-mode:vertical-lr]",children:[t.length," files"]})]})]}):k.jsxs("div",{className:"mt-4 flex min-h-0 gap-6 max-sm:flex-col",children:[k.jsx("div",{className:"min-w-0 flex-1 space-y-8",children:e.children}),k.jsxs("nav",{ref:s,"aria-label":"Files in group",className:"flex h-[calc(100vh-7rem)] w-[300px] shrink-0 flex-col overflow-hidden rounded-lg border border-border bg-card shadow-card sticky top-4 self-start max-lg:w-[240px] max-sm:w-full max-sm:h-auto max-sm:max-h-[40vh]",children:[k.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[k.jsxs("p",{className:"flex-1 font-mono text-[11px] tabular-nums text-muted-foreground",children:[t.filter(f=>i.has(f.path)).length," of ",t.length," viewed"]}),k.jsx(Et,{size:"icon-sm",variant:"ghost",className:"size-7 shrink-0","aria-label":"Collapse file list",onClick:d,children:k.jsx(zS,{className:"size-4"})})]}),k.jsx("div",{className:"flex-1 overflow-auto py-2",children:k.jsx("ul",{className:"space-y-0.5 px-2",children:t.map((f,p)=>{const m=i.has(f.path),g=p===o;return k.jsx("li",{children:k.jsxs("button",{"data-rail":p,onClick:()=>e.onSelect(f.firstIndex),className:Me("flex w-full items-start gap-2.5 rounded-md px-2.5 py-2 text-left transition-colors",g?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:[k.jsx(B2,{className:"mt-0.5 size-3.5 shrink-0"}),k.jsxs("span",{className:"min-w-0 flex-1",children:[k.jsx("span",{className:Me("block truncate font-mono text-xs leading-tight",m&&"opacity-60"),children:mk(f.path)}),P_(f.path)?k.jsx("span",{className:"block truncate font-mono text-[10px] leading-tight opacity-50",children:P_(f.path)}):null,k.jsxs("span",{className:"mt-0.5 flex items-center gap-1.5",children:[k.jsx(t5,{file:f}),f.hunkCount>1?k.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground",children:[f.hunkCount," hunks"]}):null]})]}),k.jsx("span",{role:"checkbox","aria-checked":m,tabIndex:0,onClick:v=>{v.stopPropagation(),e.onViewed(f.path,!m)},onKeyDown:v=>{(v.key===" "||v.key==="Enter")&&(v.preventDefault(),v.stopPropagation(),e.onViewed(f.path,!m))},className:Me("mt-0.5 flex size-4 shrink-0 items-center justify-center rounded border transition-colors",m?"border-primary bg-primary text-primary-foreground":"border-input bg-background"),"aria-label":m?"Mark as not viewed":"Mark as viewed",children:m?k.jsx(M2,{className:"size-2.5"}):null})]})},f.path)})})})]})]})}const Ny="diffs-container";(()=>{try{return!1}catch{return!1}})();const i5=/(?=^From [a-f0-9]+ .+$)/m,gk=/(?=^diff --git)/gm,r5=new RegExp("(?<=\\n)"),o5=/^(---|\+\+\+)\s+([^\t\r\n]+)/,a5=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,s5=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,l5=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,zy="header-prefix",Py="header-filename-suffix",Hy="header-metadata",Gl="header-custom",bt={dark:"pierre-dark",light:"pierre-light"},u5="data-theme-css",c5="data-unsafe-css",d5="data-diffs-scrollbar-measure",yk="--diffs-scrollbar-gutter-measured",f5=1e5,jy={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...jy});const h5=Object.freeze({fromStart:0,fromEnd:0}),vd={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},vk={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},qa=new Set;let Wa=null;function bk(e){qa.add(e),Wa??=requestAnimationFrame(xk)}function cg(e){qa.delete(e)&&qa.size===0&&Wa!=null&&(cancelAnimationFrame(Wa),Wa=null)}function xk(e){const t=new Set(qa);qa.clear();for(const n of t)try{n(e)}catch(i){console.error(i)}qa.size>0?Wa=requestAnimationFrame(xk):Wa=null}function bd(e,t,n){if(e===t||e==null||t==null)return e===t;const i=new Set(n),o=Object.keys(e),s=new Set(Object.keys(t));for(const l of o)if(s.delete(l),!i.has(l)&&(!(l in t)||e[l]!==t[l]))return!1;for(const l of Array.from(s))if(!i.has(l))return!1;return!0}function ns(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function tf(e,t){const n=e?.theme??bt,i=t?.theme??bt,o=H_(e),s=H_(t);return ns(n,i)&&bd(e,t,["theme","parseDiffOptions"])&&bd(o,s)}function H_(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function dg(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function or(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}const p5=new TextEncoder,m5=new TextDecoder("utf-8",{ignoreBOM:!0}),g5=/[\uD800-\uDFFF]/,fg=1024;let ja=new Uint8Array(fg);function Sk(){ja.length!==fg&&(ja=new Uint8Array(fg))}function Lt(e){if(e.length===0)return e;if(g5.test(e))return JSON.parse(JSON.stringify(e));const t=e.length*3;ja.length<t&&(ja=new Uint8Array(t));const{written:n}=p5.encodeInto(e,ja);return m5.decode(ja.subarray(0,n))}function Ei(e,t){return e-(t===0?0:1)}function yn(e,t){return Ei(e,t)+t}const y5=4096,v5=.5;function b5(e){for(const t of e.hunks){for(let n=0;n<t.hunkContent.length;n++){const i=t.hunkContent[n];if(i.type!=="change")continue;const o=S5(e,i);o!=null&&(t.hunkContent.splice(n,1,...o),n+=o.length-1)}x5(t,e)}}function x5(e,t){const{hunkContent:n}=e;for(let i=1;i<n.length;i++){const o=n[i],s=n[i-1];if(o.type!=="change"||o.additions>0&&o.deletions>0||s.type!=="context")continue;const l=o.additions>0,c=l?t.additionLines:t.deletionLines,d=l?o.additionLineIndex:o.deletionLineIndex,f=l?o.additions:o.deletions,p=c[d]??"";if(p.trim()!=="")continue;let m=!0;for(let w=1;w<f;w++)if(c[d+w]!==p){m=!1;break}if(!m)continue;let g=0;for(;g<s.lines&&t.additionLines[s.additionLineIndex+s.lines-1-g]===p;)g++;if(g===0||i===1&&g===s.lines)continue;o.additionLineIndex-=g,o.deletionLineIndex-=g;const v=o.additionLineIndex+o.additions,x=o.deletionLineIndex+o.deletions,S=n[i+1];S?.type==="context"?(S.lines+=g,S.additionLineIndex=v,S.deletionLineIndex=x):n.splice(i+1,0,{type:"context",lines:g,additionLineIndex:v,deletionLineIndex:x}),s.lines-=g,s.lines===0&&(n.splice(i-1,1),i--)}}function S5(e,t){const{deletions:n,additions:i,deletionLineIndex:o,additionLineIndex:s}=t,l=Math.min(n,i),c=Math.abs(i-n);if(l===0||c===0||l*(c+1)>y5)return null;const d=[];for(let S=0;S<n;S++)d.push(j_(e.deletionLines[o+S]??""));const f=[];for(let S=0;S<i;S++)f.push(j_(e.additionLines[s+S]??""));const p=i>n;let m=0,g=-1;for(let S=0;S<=c;S++){let w=0;for(let _=0;_<l;_++)w+=C5(d[_+(p?0:S)],f[_+(p?S:0)]);S===0?g=w+l*v5:w>g&&(g=w,m=S)}if(m===0)return null;const v=[],x=(S,w,_,C)=>{(S>0||w>0)&&v.push({type:"change",deletions:S,additions:w,deletionLineIndex:_,additionLineIndex:C})};return p?(x(0,m,o,s),x(l,l,o,s+m),x(0,i-l-m,o+l,s+m+l)):(x(m,0,o,s),x(l,l,o+m,s),x(n-l-m,0,o+m+l,s+l)),v}const _5=/\s+/g;function j_(e){return e.replace(_5,"")}function C5(e,t){if(e===t)return 1;const n=Math.max(e.length,t.length),i=Math.min(e.length,t.length);if(i===0)return 0;let o=0;for(;o<i&&e[o]===t[o];)o++;let s=0;for(;s<i-o&&e[e.length-1-s]===t[t.length-1-s];)s++;return(o+s)/n}function w5(e,t,n){try{return E5(e,t,n)}finally{Sk()}}function E5(e,t,n=!1){const i=N5(e),o=i?L5(e):R5(e);let s;const l=[];for(const c of o){if(i&&!gk.test(c)){if(s==null)s=Lt(c);else{if(n)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",c)}continue}else if(!i&&!O5(c)){if(s==null)s=Lt(c);else{if(n)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",c)}continue}const d=_k(c,{cacheKey:t!=null?`${t}-${l.length}`:void 0,isGitDiff:i,throwOnError:n});d!=null&&l.push(d)}return{patchMetadata:s,files:l}}function k5(e,t){try{return _k(e,t)}finally{Sk()}}function _k(e,{cacheKey:t,isGitDiff:n=gk.test(e),oldFile:i,newFile:o,throwOnError:s=!1}={}){let l=0;const c=kk(e,"@@ ");let d;const f=i==null||o==null;let p=0,m=0;for(const g of c){const v=Ck(g),x=v[0];if(x==null){if(s)throw Error("parsePatchContent: invalid hunk");console.error("parsePatchContent: invalid hunk",g);continue}const S=Ek(x);let w=0,_=0;if(S==null||d==null){if(d!=null){if(s)throw Error("parsePatchContent: Invalid hunk");console.error("parsePatchContent: Invalid hunk",g);continue}d={name:"",type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:f,additionLines:!f&&i!=null&&o!=null?B_(o.contents):[],deletionLines:!f&&i!=null&&o!=null?B_(i.contents):[],cacheKey:F_(t)},d.additionLines.length===1&&o?.contents===""&&(d.additionLines.length=0),d.deletionLines.length===1&&i?.contents===""&&(d.deletionLines.length=0);for(const F of v){if(F.startsWith("diff --git")){const G=F.trim().match(s5),B=G?.[1]??G?.[2],ee=G?.[3]??G?.[4];if(B==null||ee==null){if(s)throw Error("parsePatchContent: invalid git diff header");console.error("parsePatchContent: invalid git diff header",F);continue}d.name=Lt(ee.trim()),B!==ee&&(d.prevName=Lt(B.trim()));continue}const Q=F.startsWith("---")||F.startsWith("+++")?F.match(n?a5:o5):null;if(Q!=null){const[,G,B]=Q;if(G==="---"&&B!=="/dev/null"){const ee=Lt(B.trim());d.prevName=ee,d.name=ee}else G==="+++"&&B!=="/dev/null"&&(d.name=Lt(B.trim()))}else if(n){if(F.startsWith("new mode ")&&(d.mode=Lt(F.slice(8).trim())),F.startsWith("old mode ")&&(d.prevMode=Lt(F.slice(8).trim())),F.startsWith("new file mode")&&(d.type="new",d.mode=Lt(F.slice(13).trim())),F.startsWith("deleted file mode")&&(d.type="deleted",d.mode=Lt(F.slice(17).trim())),F.startsWith("similarity index")&&(F.startsWith("similarity index 100%")?d.type="rename-pure":d.type="rename-changed"),F.startsWith("index ")){const[,G,B,ee]=F.trim().match(l5)??[];G!=null&&(d.prevObjectId=Lt(G)),B!=null&&(d.newObjectId=Lt(B)),ee!=null&&(d.mode=Lt(ee))}F.startsWith("rename from ")&&(d.prevName=Lt(F.slice(12).trim())),F.startsWith("rename to ")&&(d.name=Lt(F.slice(10).trim()))}}continue}let C,T;for(;v.length>0&&(v[v.length-1]===`
|
|
24
|
+
`||v[v.length-1]==="\r"||v[v.length-1]===`\r
|
|
25
|
+
`||v[v.length-1]==="");)v.pop();const{additionStart:D,deletionStart:I}=S;p=f?p:I-1,m=f?m:D-1;const O={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:S.additionCount,additionStart:D,additionLines:w,deletionCount:S.deletionCount,deletionStart:I,deletionLines:_,deletionLineIndex:p,additionLineIndex:m,hunkContent:[],hunkContext:F_(S.hunkContext),hunkSpecs:Lt(x),noEOFCRAdditions:!1,noEOFCRDeletions:!1};let P=0,j=0;for(let F=1;F<v.length;F++){const Q=v[F];if(P>=O.additionCount&&j>=O.deletionCount&&!Q.startsWith("\\")){if(s&&D5(Q)&&!M5(Q))throw Error("parsePatchContent: hunk has more lines than expected");break}const G=Q[0];if(G!=="+"&&G!=="-"&&G!==" "&&G!=="\\"){if(s)throw Error("parsePatchContent: invalid hunk line");console.error(`parseLineType: Invalid firstChar: "${G}", full line: "${Q}"`),console.error("processFile: invalid rawLine:",Q);continue}const B=z5(G);if(B==="addition"){if(s&&P>=O.additionCount)throw Error("parsePatchContent: hunk has too many addition lines");const ee=im(Q);(C==null||C.type!=="change")&&(C=rm("change",p,m),O.hunkContent.push(C)),m++,P++,f&&d.additionLines.push(ee),C.additions++,w++,T="addition"}else if(B==="deletion"){if(s&&j>=O.deletionCount)throw Error("parsePatchContent: hunk has too many deletion lines");const ee=im(Q);(C==null||C.type!=="change")&&(C=rm("change",p,m),O.hunkContent.push(C)),p++,j++,f&&d.deletionLines.push(ee),C.deletions++,_++,T="deletion"}else if(B==="context"){if(s&&(j>=O.deletionCount||P>=O.additionCount))throw Error("parsePatchContent: hunk has too many context lines");const ee=im(Q);(C==null||C.type!=="context")&&(C=rm("context",p,m),O.hunkContent.push(C)),m++,p++,P++,j++,f&&(d.deletionLines.push(ee),d.additionLines.push(ee)),C.lines++,T="context"}else if(B==="metadata"&&C!=null){if(C.type==="context"?(O.noEOFCRAdditions=!0,O.noEOFCRDeletions=!0):T==="deletion"?O.noEOFCRDeletions=!0:T==="addition"&&(O.noEOFCRAdditions=!0),f&&(T==="addition"||T==="context")){const ee=d.additionLines.length-1;ee>=0&&(d.additionLines[ee]=or(d.additionLines[ee]))}if(f&&(T==="deletion"||T==="context")){const ee=d.deletionLines.length-1;ee>=0&&(d.deletionLines[ee]=or(d.deletionLines[ee]))}}}if(s&&(P!==O.additionCount||j!==O.deletionCount))throw Error("parsePatchContent: hunk line count mismatch");O.additionLines=w,O.deletionLines=_,O.collapsedBefore=Math.max(Ei(O.additionStart,O.additionCount)-l,0),d.hunks.push(O),l=yn(O.additionStart,O.additionCount);for(const F of O.hunkContent)F.type==="context"?(O.splitLineCount+=F.lines,O.unifiedLineCount+=F.lines):(O.splitLineCount+=Math.max(F.additions,F.deletions),O.unifiedLineCount+=F.deletions+F.additions);O.splitLineStart=d.splitLineCount+O.collapsedBefore,O.unifiedLineStart=d.unifiedLineCount+O.collapsedBefore,d.splitLineCount+=O.collapsedBefore+O.splitLineCount,d.unifiedLineCount+=O.collapsedBefore+O.unifiedLineCount}if(d!=null){if(s&&f&&!n&&d.hunks.length===0)throw Error("parsePatchContent: unified file has no hunks");if(d.hunks.length>0&&!f&&d.additionLines.length>0&&d.deletionLines.length>0){const g=d.hunks[d.hunks.length-1],v=yn(g.additionStart,g.additionCount),x=d.additionLines.length,S=Math.max(x-v,0);d.splitLineCount+=S,d.unifiedLineCount+=S}return n||(d.prevName!=null&&d.name!==d.prevName?d.hunks.length>0?d.type="rename-changed":d.type="rename-pure":(i==null||i.contents==="")&&o!=null&&o.contents!==""?d.type="new":i!=null&&i.contents!==""&&(o==null||o.contents==="")&&(d.type="deleted")),d.type!=="rename-pure"&&d.type!=="rename-changed"&&(d.prevName=void 0),b5(d),d}}function T5(e,t,n=!1){const i=[],o=A5(e)?e.split(i5):[e];for(const s of o)try{i.push(w5(s,t!=null?`${t}-${i.length}`:void 0,n))}catch(l){if(n)throw l;console.error(l)}return i}function A5(e){return e.startsWith("From ")||e.includes(`
|
|
26
|
+
From `)}function B_(e){const t=Ck(e);for(let n=0;n<t.length;n++)t[n]=Lt(t[n]);return t}function Ck(e){if(e.length===0)return[""];const t=[];let n=0;for(;;){const i=e.indexOf(`
|
|
27
|
+
`,n);if(i===-1)break;t.push(e.slice(n,i+1)),n=i+1}return n<e.length&&t.push(e.slice(n)),t}function L5(e){return kk(e,"diff --git")}function R5(e){if(e.length===0)return[""];const t=[];let n=0,i=0,o=0,s=0,l=!1;for(;i<e.length;){const c=hg(e,i);if(o<=0&&s<=0){if(wk(e,i)){i>n&&t.push(e.slice(n,i)),n=i,l=!0,i=hg(e,c);continue}if(l&&e.startsWith("@@ -",i)){const f=Ek(e.slice(i,c));f!=null&&(o=f.deletionCount,s=f.additionCount)}i=c;continue}const d=e[i];if(d==="\\"){i=c;continue}d===" "?(o=Math.max(o-1,0),s=Math.max(s-1,0)):d==="-"?o=Math.max(o-1,0):d==="+"&&(s=Math.max(s-1,0)),i=c}return t.push(e.slice(n)),t}function O5(e){return wk(e,0)}function wk(e,t){const n=hg(e,t);return U_(e,t,"---")&&U_(e,n,"+++")}function U_(e,t,n){if(!e.startsWith(n,t))return!1;const i=e[t+n.length];if(i!==" "&&i!==" ")return!1;for(let o=t+n.length+1;o<e.length;o++){const s=e[o];if(s===`
|
|
28
|
+
`||s==="\r")break;if(s!==" "&&s!==" ")return!0}return!1}function hg(e,t){const n=e.indexOf(`
|
|
29
|
+
`,t);return n===-1?e.length:n+1}function D5(e){const t=e[0];return t==="+"||t==="-"||t===" "}function M5(e){if(!e.startsWith("--"))return!1;for(let t=2;t<e.length;t++){const n=e[t];if(n!==" "&&n!==" "&&n!==`
|
|
30
|
+
`&&n!=="\r")return!1}return!0}function Ek(e){if(!e.startsWith("@@ -"))return;let t=4;const n=_c(e,t);if(n==null)return;const i=n.value;t=n.endIndex;let o=1;if(e[t]===","){const p=_c(e,t+1);if(p==null)return;o=p.value,t=p.endIndex}if(e[t]!==" "||e[t+1]!=="+")return;t+=2;const s=_c(e,t);if(s==null)return;const l=s.value;t=s.endIndex;let c=1;if(e[t]===","){const p=_c(e,t+1);if(p==null)return;c=p.value,t=p.endIndex}if(e[t]!==" "||e[t+1]!=="@"||e[t+2]!=="@")return;let d;const f=t+3;return e[f]===" "&&(d=I5(e.slice(f+1))),{additionCount:c,additionStart:l,deletionCount:o,deletionStart:i,hunkContext:d}}function _c(e,t){let n=t,i=0;for(;n<e.length;n++){const o=e.charCodeAt(n)-48;if(o<0||o>9)break;i=i*10+o}if(n!==t)return{value:i,endIndex:n}}function I5(e){return e.endsWith(`\r
|
|
31
|
+
`)?e.slice(0,-2):e.endsWith(`
|
|
32
|
+
`)?e.slice(0,-1):e}function N5(e){return e.startsWith("diff --git")||e.includes(`
|
|
33
|
+
diff --git`)}function kk(e,t){if(e.length===0)return[""];const n=`
|
|
34
|
+
${t}`,i=e.startsWith(t)?0:V_(e,n,0);if(i===-1)return[e];const o=[];i>0&&o.push(e.slice(0,i));let s=i;for(;;){const l=V_(e,n,s+1);if(l===-1)break;o.push(e.slice(s,l)),s=l}return o.push(e.slice(s)),o}function V_(e,t,n){const i=e.indexOf(t,n);return i===-1?-1:i+1}function F_(e){return e==null?e:Lt(e)}function z5(e){return e===" "?"context":e==="\\"?"metadata":e==="+"?"addition":"deletion"}function im(e){const t=e.slice(1);return Lt(t===""?`
|
|
35
|
+
`:t)}function rm(e,t,n){return e==="change"?{type:"change",additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:"context",lines:0,additionLineIndex:n,deletionLineIndex:t}}class By{diff(t,n,i={}){let o;typeof i=="function"?(o=i,i={}):"callback"in i&&(o=i.callback);const s=this.castInput(t,i),l=this.castInput(n,i),c=this.removeEmpty(this.tokenize(s,i)),d=this.removeEmpty(this.tokenize(l,i));return this.diffWithOptionsObj(c,d,i,o)}diffWithOptionsObj(t,n,i,o){var s;const l=C=>{if(C=this.postProcess(C,i),o){setTimeout(function(){o(C)},0);return}else return C},c=n.length,d=t.length;let f=1,p=c+d;i.maxEditLength!=null&&(p=Math.min(p,i.maxEditLength));const m=(s=i.timeout)!==null&&s!==void 0?s:1/0,g=Date.now()+m,v=[{oldPos:-1,lastComponent:void 0}];let x=this.extractCommon(v[0],n,t,0,i);if(v[0].oldPos+1>=d&&x+1>=c)return l(this.buildValues(v[0].lastComponent,n,t));let S=-1/0,w=1/0;const _=()=>{for(let C=Math.max(S,-f);C<=Math.min(w,f);C+=2){let T;const D=v[C-1],I=v[C+1];D&&(v[C-1]=void 0);let O=!1;if(I){const j=I.oldPos-C;O=I&&0<=j&&j<c}const P=D&&D.oldPos+1<d;if(!O&&!P){v[C]=void 0;continue}if(!P||O&&D.oldPos<I.oldPos?T=this.addToPath(I,!0,!1,0,i):T=this.addToPath(D,!1,!0,1,i),x=this.extractCommon(T,n,t,C,i),T.oldPos+1>=d&&x+1>=c)return l(this.buildValues(T.lastComponent,n,t))||!0;v[C]=T,T.oldPos+1>=d&&(w=Math.min(w,C-1)),x+1>=c&&(S=Math.max(S,C+1))}f++};if(o)(function C(){setTimeout(function(){if(f>p||Date.now()>g)return o(void 0);_()||C()},0)})();else for(;f<=p&&Date.now()<=g;){const C=_();if(C)return C}}addToPath(t,n,i,o,s){const l=t.lastComponent;return l&&!s.oneChangePerToken&&l.added===n&&l.removed===i?{oldPos:t.oldPos+o,lastComponent:{count:l.count+1,added:n,removed:i,previousComponent:l.previousComponent}}:{oldPos:t.oldPos+o,lastComponent:{count:1,added:n,removed:i,previousComponent:l}}}extractCommon(t,n,i,o,s){const l=n.length,c=i.length;let d=t.oldPos,f=d-o,p=0;for(;f+1<l&&d+1<c&&this.equals(i[d+1],n[f+1],s);)f++,d++,p++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return p&&!s.oneChangePerToken&&(t.lastComponent={count:p,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=d,f}equals(t,n,i){return i.comparator?i.comparator(t,n):t===n||!!i.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let i=0;i<t.length;i++)t[i]&&n.push(t[i]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,i){const o=[];let s;for(;t;)o.push(t),s=t.previousComponent,delete t.previousComponent,t=s;o.reverse();const l=o.length;let c=0,d=0,f=0;for(;c<l;c++){const p=o[c];if(p.removed)p.value=this.join(i.slice(f,f+p.count)),f+=p.count;else{if(!p.added&&this.useLongestToken){let m=n.slice(d,d+p.count);m=m.map(function(g,v){const x=i[f+v];return x.length>g.length?x:g}),p.value=this.join(m)}else p.value=this.join(n.slice(d,d+p.count));d+=p.count,p.added||(f+=p.count)}}return o}}class P5 extends By{}const H5=new P5;function j5(e,t,n){return H5.diff(e,t,n)}const G_="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class B5 extends By{tokenize(t){const n=new RegExp(`(\\r?\\n)|[${G_}]+|[^\\S\\n\\r]+|[^${G_}]`,"ug");return t.match(n)||[]}}const U5=new B5;function V5(e,t,n){return U5.diff(e,t,n)}class F5 extends By{constructor(){super(...arguments),this.tokenize=$5}equals(t,n,i){return i.ignoreWhitespace?((!i.newlineIsToken||!t.includes(`
|
|
36
|
+
`))&&(t=t.trim()),(!i.newlineIsToken||!n.includes(`
|
|
37
|
+
`))&&(n=n.trim())):i.ignoreNewlineAtEof&&!i.newlineIsToken&&(t.endsWith(`
|
|
38
|
+
`)&&(t=t.slice(0,-1)),n.endsWith(`
|
|
39
|
+
`)&&(n=n.slice(0,-1))),super.equals(t,n,i)}}const G5=new F5;function $_(e,t,n){return G5.diff(e,t,n)}function $5(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
40
|
+
`));const n=[],i=e.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(let o=0;o<i.length;o++){const s=i[o];o%2&&!t.newlineIsToken?n[n.length-1]+=s:n.push(s)}return n}function q5(e){for(let t=0;t<e.length;t++)if(e[t]<" "||e[t]>"~"||e[t]==='"'||e[t]==="\\")return!0;return!1}function zr(e){if(!q5(e))return e;let t='"';const n=new TextEncoder().encode(e);let i=0;for(;i<n.length;){const o=n[i];o===7?t+="\\a":o===8?t+="\\b":o===9?t+="\\t":o===10?t+="\\n":o===11?t+="\\v":o===12?t+="\\f":o===13?t+="\\r":o===34?t+='\\"':o===92?t+="\\\\":o>=32&&o<=126?t+=String.fromCharCode(o):t+="\\"+o.toString(8).padStart(3,"0"),i++}return t+='"',t}const q_={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function W_(e,t,n,i,o,s,l){let c;l?typeof l=="function"?c={callback:l}:c=l:c={},typeof c.context>"u"&&(c.context=4);const d=c.context;if(c.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(c.callback){const{callback:p}=c;$_(n,i,Object.assign(Object.assign({},c),{callback:m=>{const g=f(m);p(g)}}))}else return f($_(n,i,c));function f(p){if(!p)return;p.push({value:"",lines:[]});function m(C){return C.map(function(T){return" "+T})}const g=[];let v=0,x=0,S=[],w=1,_=1;for(let C=0;C<p.length;C++){const T=p[C],D=T.lines||Y5(T.value);if(T.lines=D,T.added||T.removed){if(!v){const I=p[C-1];v=w,x=_,I&&(S=d>0?m(I.lines.slice(-d)):[],v-=S.length,x-=S.length)}for(const I of D)S.push((T.added?"+":"-")+I);T.added?_+=D.length:w+=D.length}else{if(v)if(D.length<=d*2&&C<p.length-2)for(const I of m(D))S.push(I);else{const I=Math.min(D.length,d);for(const P of m(D.slice(0,I)))S.push(P);const O={oldStart:v,oldLines:w-v+I,newStart:x,newLines:_-x+I,lines:S};g.push(O),v=0,x=0,S=[]}w+=D.length,_+=D.length}}for(const C of g)for(let T=0;T<C.lines.length;T++)C.lines[T].endsWith(`
|
|
41
|
+
`)?C.lines[T]=C.lines[T].slice(0,-1):(C.lines.splice(T+1,0,"\"),T++);return{oldFileName:e,newFileName:t,oldHeader:o,newHeader:s,hunks:g}}}function pg(e,t){var n,i,o,s,l,c;if(t||(t=q_),Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders&&!e.every(p=>p.isGit))throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return e.map(p=>pg(p,t)).join(`
|
|
42
|
+
`)}const d=[];if(e.isGit){if(t=q_,!e.oldFileName)throw new Error("oldFileName must be specified for Git patches");if(!e.newFileName)throw new Error("newFileName must be specified for Git patches");let p=e.oldFileName,m=e.newFileName;e.isCreate&&p==="/dev/null"?p=m.replace(/^b\//,"a/"):e.isDelete&&m==="/dev/null"&&(m=p.replace(/^a\//,"b/")),d.push("diff --git "+zr(p)+" "+zr(m)),e.isDelete&&d.push("deleted file mode "+((n=e.oldMode)!==null&&n!==void 0?n:"100644")),e.isCreate&&d.push("new file mode "+((i=e.newMode)!==null&&i!==void 0?i:"100644")),e.oldMode&&e.newMode&&!e.isDelete&&!e.isCreate&&(d.push("old mode "+e.oldMode),d.push("new mode "+e.newMode)),e.isRename&&(d.push("rename from "+zr(((o=e.oldFileName)!==null&&o!==void 0?o:"").replace(/^a\//,""))),d.push("rename to "+zr(((s=e.newFileName)!==null&&s!==void 0?s:"").replace(/^b\//,"")))),e.isCopy&&(d.push("copy from "+zr(((l=e.oldFileName)!==null&&l!==void 0?l:"").replace(/^a\//,""))),d.push("copy to "+zr(((c=e.newFileName)!==null&&c!==void 0?c:"").replace(/^b\//,""))))}else t.includeIndex&&e.oldFileName==e.newFileName&&e.oldFileName!==void 0&&d.push("Index: "+e.oldFileName),t.includeUnderline&&d.push("===================================================================");const f=e.hunks.length>0;t.includeFileHeaders&&e.oldFileName!==void 0&&e.newFileName!==void 0&&(!e.isGit||f)&&(d.push("--- "+zr(e.oldFileName)+(e.oldHeader?" "+e.oldHeader:"")),d.push("+++ "+zr(e.newFileName)+(e.newHeader?" "+e.newHeader:"")));for(let p=0;p<e.hunks.length;p++){const m=e.hunks[p],g=m.oldLines===0?m.oldStart-1:m.oldStart,v=m.newLines===0?m.newStart-1:m.newStart;d.push("@@ -"+g+","+m.oldLines+" +"+v+","+m.newLines+" @@");for(const x of m.lines)d.push(x)}return d.join(`
|
|
43
|
+
`)+`
|
|
44
|
+
`}function W5(e,t,n,i,o,s,l){if(typeof l=="function"&&(l={callback:l}),l?.callback){const{callback:c}=l;W_(e,t,n,i,o,s,Object.assign(Object.assign({},l),{callback:d=>{c(d?pg(d,l.headerOptions):void 0)}}))}else{const c=W_(e,t,n,i,o,s,l);return c?pg(c,l?.headerOptions):void 0}}function Y5(e){const t=e.endsWith(`
|
|
45
|
+
`),n=e.split(`
|
|
46
|
+
`).map(i=>i+`
|
|
47
|
+
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}const X5="/dev/null";function zo(e,t,n,i=!1){if(e===null&&t===null)throw new Error("parseDiffFromFile: You must pass oldFile, newFile, or both");const o=e??Y_(),s=t??Y_(),l=k5(W5(o.name,s.name,o.contents,s.contents,o.header,s.header,n),{cacheKey:(()=>{const d=e?.cacheKey??e?.name,f=t?.cacheKey??t?.name;return d!=null&&f!=null?d+":"+f:d??f})(),oldFile:o,newFile:s,throwOnError:i});if(l==null)throw new Error("parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?");e===null?(l.type="new",l.prevName=void 0):t===null&&(l.type="deleted",l.prevName=void 0);const c=t?.lang??(t===null?e?.lang:void 0);return c!=null&&(l.lang=c),l}function Y_(){return{name:X5,contents:""}}function Kn(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function Si(e){return{type:"text",value:e}}function Le({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function xd({name:e,width:t=16,height:n=16,properties:i}){return Le({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...i},children:[Le({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function K5(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t;"children"in t?t=t.children[0]:t=null}}function Ba(e){return Le({tagName:"div",properties:{"data-gutter":""},children:e})}function Tk(e,t,n,i={}){return Le({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...i},children:t!=null?[Le({tagName:"span",properties:{"data-line-number-content":""},children:[Si(`${t}`)]})]:void 0})}function An(e,t,n){return Le({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function Q5(){return Le({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[xd({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}function Z5(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function Cc(e){for(const t of e)if(t instanceof HTMLElement&&(t.hasAttribute("data-utility-button")||t.hasAttribute("data-gutter-utility-slot")||t.getAttribute("slot")==="gutter-utility-slot"||t.getAttribute("name")==="gutter-utility-slot"))return!0;return!1}const J5=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],X_={}.hasOwnProperty;function ej(e,t){const n=t||{};function i(o,...s){let l=i.invalid;const c=i.handlers;if(o&&X_.call(o,e)){const d=String(o[e]);l=X_.call(c,d)?c[d]:i.unknown}if(l)return l.call(this,o,...s)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}const tj=/["&'<>`]/g,nj=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ij=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,rj=/[|\\{}()[\]^$+*?.]/g,K_=new WeakMap;function oj(e,t){if(e=e.replace(t.subset?aj(t.subset):tj,i),t.subset||t.escapeOnly)return e;return e.replace(nj,n).replace(ij,i);function n(o,s,l){return t.format((o.charCodeAt(0)-55296)*1024+o.charCodeAt(1)-56320+65536,l.charCodeAt(s+2),t)}function i(o,s,l){return t.format(o.charCodeAt(0),l.charCodeAt(s+1),t)}}function aj(e){let t=K_.get(e);return t||(t=sj(e),K_.set(e,t)),t}function sj(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(rj,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const lj=/[\dA-Fa-f]/;function uj(e,t,n){const i="&#x"+e.toString(16).toUpperCase();return n&&t&&!lj.test(String.fromCharCode(t))?i:i+";"}const cj=/\d/;function dj(e,t,n){const i="&#"+String(e);return n&&t&&!cj.test(String.fromCharCode(t))?i:i+";"}const fj=["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"],om={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:"€"},hj=["cent","copy","divide","gt","lt","not","para","times"],Ak={}.hasOwnProperty,mg={};let wc;for(wc in om)Ak.call(om,wc)&&(mg[om[wc]]=wc);const pj=/[^\dA-Za-z]/;function mj(e,t,n,i){const o=String.fromCharCode(e);if(Ak.call(mg,o)){const s=mg[o],l="&"+s;return n&&fj.includes(s)&&!hj.includes(s)&&(!i||t&&t!==61&&pj.test(String.fromCharCode(t)))?l:l+";"}return""}function gj(e,t,n){let i=uj(e,t,n.omitOptionalSemicolons),o;if((n.useNamedReferences||n.useShortestReferences)&&(o=mj(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!o)&&n.useShortestReferences){const s=dj(e,t,n.omitOptionalSemicolons);s.length<i.length&&(i=s)}return o&&(!n.useShortestReferences||o.length<i.length)?o:i}function Ya(e,t){return oj(e,Object.assign({format:gj},t))}const yj=/^>|^->|<!--|-->|--!>|<!-$/g,vj=[">"],bj=["<",">"];function xj(e,t,n,i){return i.settings.bogusComments?"<?"+Ya(e.value,Object.assign({},i.settings.characterReferences,{subset:vj}))+">":"<!--"+e.value.replace(yj,o)+"-->";function o(s){return Ya(s,Object.assign({},i.settings.characterReferences,{subset:bj}))}}function Sj(e,t,n,i){return"<!"+(i.settings.upperDoctype?"DOCTYPE":"doctype")+(i.settings.tightDoctype?"":" ")+"html>"}function Q_(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}const Dt=Rk(1),Lk=Rk(-1),_j=[];function Rk(e){return t;function t(n,i,o){const s=n?n.children:_j;let l=(i||0)+e,c=s[l];if(!o)for(;c&&Kd(c);)l+=e,c=s[l];return c}}const Cj={}.hasOwnProperty;function Ok(e){return t;function t(n,i,o){return Cj.call(e,n.tagName)&&e[n.tagName](n,i,o)}}const Uy=Ok({body:Ej,caption:am,colgroup:am,dd:Lj,dt:Aj,head:am,html:wj,li:Tj,optgroup:Rj,option:Oj,p:kj,rp:Z_,rt:Z_,tbody:Mj,td:J_,tfoot:Ij,th:J_,thead:Dj,tr:Nj});function am(e,t,n){const i=Dt(n,t,!0);return!i||i.type!=="comment"&&!(i.type==="text"&&Kd(i.value.charAt(0)))}function wj(e,t,n){const i=Dt(n,t);return!i||i.type!=="comment"}function Ej(e,t,n){const i=Dt(n,t);return!i||i.type!=="comment"}function kj(e,t,n){const i=Dt(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 Tj(e,t,n){const i=Dt(n,t);return!i||i.type==="element"&&i.tagName==="li"}function Aj(e,t,n){const i=Dt(n,t);return!!(i&&i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd"))}function Lj(e,t,n){const i=Dt(n,t);return!i||i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd")}function Z_(e,t,n){const i=Dt(n,t);return!i||i.type==="element"&&(i.tagName==="rp"||i.tagName==="rt")}function Rj(e,t,n){const i=Dt(n,t);return!i||i.type==="element"&&i.tagName==="optgroup"}function Oj(e,t,n){const i=Dt(n,t);return!i||i.type==="element"&&(i.tagName==="option"||i.tagName==="optgroup")}function Dj(e,t,n){const i=Dt(n,t);return!!(i&&i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot"))}function Mj(e,t,n){const i=Dt(n,t);return!i||i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot")}function Ij(e,t,n){return!Dt(n,t)}function Nj(e,t,n){const i=Dt(n,t);return!i||i.type==="element"&&i.tagName==="tr"}function J_(e,t,n){const i=Dt(n,t);return!i||i.type==="element"&&(i.tagName==="td"||i.tagName==="th")}const zj=Ok({body:jj,colgroup:Bj,head:Hj,html:Pj,tbody:Uj});function Pj(e){const t=Dt(e,-1);return!t||t.type!=="comment"}function Hj(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 jj(e){const t=Dt(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Kd(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Bj(e,t,n){const i=Lk(n,t),o=Dt(e,-1,!0);return n&&i&&i.type==="element"&&i.tagName==="colgroup"&&Uy(i,n.children.indexOf(i),n)?!1:!!(o&&o.type==="element"&&o.tagName==="col")}function Uj(e,t,n){const i=Lk(n,t),o=Dt(e,-1);return n&&i&&i.type==="element"&&(i.tagName==="thead"||i.tagName==="tbody")&&Uy(i,n.children.indexOf(i),n)?!1:!!(o&&o.type==="element"&&o.tagName==="tr")}const Ec={name:[[`
|
|
48
|
+
\f\r &/=>`.split(""),`
|
|
49
|
+
\f\r "&'/=>\``.split("")],[`\0
|
|
50
|
+
\f\r "&'/<=>`.split(""),`\0
|
|
51
|
+
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
52
|
+
\f\r &>`.split(""),`\0
|
|
53
|
+
\f\r "&'<=>\``.split("")],[`\0
|
|
54
|
+
\f\r "&'<=>\``.split(""),`\0
|
|
55
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Vj(e,t,n,i){const o=i.schema,s=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 d;o.space==="html"&&e.tagName==="svg"&&(i.schema=Vl);const f=Fj(i,e.properties),p=i.all(o.space==="html"&&e.tagName==="template"?e.content:e);return i.schema=o,p&&(l=!1),(f||!s||!zj(e,t,n))&&(c.push("<",e.tagName,f?" "+f:""),l&&(o.space==="svg"||i.settings.closeSelfClosing)&&(d=f.charAt(f.length-1),(!i.settings.tightSelfClosing||d==="/"||d&&d!=='"'&&d!=="'")&&c.push(" "),c.push("/")),c.push(">")),c.push(p),!l&&(!s||!Uy(e,t,n))&&c.push("</"+e.tagName+">"),c.join("")}function Fj(e,t){const n=[];let i=-1,o;if(t){for(o in t)if(t[o]!==null&&t[o]!==void 0){const s=Gj(e,o,t[o]);s&&n.push(s)}}for(;++i<n.length;){const s=e.settings.tightAttributes?n[i].charAt(n[i].length-1):void 0;i!==n.length-1&&s!=='"'&&s!=="'"&&(n[i]+=" ")}return n.join("")}function Gj(e,t,n){const i=OE(e.schema,t),o=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,s=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 d=Ya(i.attribute,Object.assign({},e.settings.characterReferences,{subset:Ec.name[o][s]}));return n===!0||(n=Array.isArray(n)?(i.commaSeparated?CE:ME)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?d:(e.settings.preferUnquoted&&(c=Ya(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Ec.unquoted[o][s]}))),c!==n&&(e.settings.quoteSmart&&Q_(n,l)>Q_(n,e.alternative)&&(l=e.alternative),c=l+Ya(n,Object.assign({},e.settings.characterReferences,{subset:(l==="'"?Ec.single:Ec.double)[o][s],attribute:!0}))+l),d+(c&&"="+c))}const $j=["<","&"];function Dk(e,t,n,i){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Ya(e.value,Object.assign({},i.settings.characterReferences,{subset:$j}))}function qj(e,t,n,i){return i.settings.allowDangerousHtml?e.value:Dk(e,t,n,i)}function Wj(e,t,n,i){return i.all(e)}const Yj=ej("type",{invalid:Xj,unknown:Kj,handlers:{comment:xj,doctype:Sj,element:Vj,raw:qj,root:Wj,text:Dk}});function Xj(e){throw new Error("Expected node, not `"+e+"`")}function Kj(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const Qj={},Zj={},Jj=[];function nn(e,t){const n=t||Qj,i=n.quote||'"',o=i==='"'?"'":'"';if(i!=='"'&&i!=="'")throw new Error("Invalid quote `"+i+"`, expected `'` or `\"`");return{one:e6,all:t6,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||J5,characterReferences:n.characterReferences||Zj,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Vl:DE,quote:i,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function e6(e,t,n){return Yj(e,t,n,this)}function t6(e){const t=[],n=e&&e.children||Jj;let i=-1;for(;++i<n.length;)t[i]=this.one(n[i],i,e);return t.join("")}var Mk=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;pointerSession={mode:"idle"};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener("click",this.handlePointerClick),this.pre?.removeEventListener("pointerdown",this.handlePointerDown),this.pre?.removeEventListener("pointermove",this.handlePointerMove),this.pre?.removeEventListener("pointerleave",this.handlePointerLeave),this.pre?.removeAttribute("data-interactive-lines"),this.pre?.removeAttribute("data-interactive-line-numbers"),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),cg(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();const{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode==="gutterSelecting"&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){const n=!(e===this.selectedRange||dg(e??void 0,this.selectedRange??void 0)),i=t?.lineNumberOnly??!1,o=t?.activeLineSide!==this.selectedRangeHighlightSide||i!==this.selectedRangeLineNumberOnly;!this.isSelectionDirty()&&!n&&!o||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=i,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){const i=e!==this.editorActiveLine,o=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;!this.isSelectionDirty()&&!i&&!o||(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{const e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode==="diff"&&e.type==="diff-line")return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode==="file"&&e.type==="line")return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{const{onHunkExpand:t,onLineClick:n,onLineNumberClick:i,onTokenClick:o,onMergeConflictActionClick:s}=this.options;t==null&&n==null&&i==null&&s==null&&o==null||this.options.onGutterUtilityClick!=null&&Cc(e.composedPath())||(qi(this.options.__debugPointerEvents,"click","FileDiff.DEBUG.handlePointerClick:",e),this.handlePointerEvent({eventType:"click",event:e}))};handlePointerMove=e=>{if(e.pointerType!=="mouse")return;const{lineHoverHighlight:t="disabled",onLineEnter:n,onLineLeave:i,onTokenEnter:o,onTokenLeave:s,enableGutterUtility:l=!1}=this.options;t==="disabled"&&!l&&n==null&&i==null&&o==null&&s==null||(qi(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{const{__debugPointerEvents:t}=this.options;if(qi(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null&&this.hoveredToken==null){qi(t,"move","FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token");return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){const{__debugPointerEvents:n}=this.options,i=t.composedPath();qi(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:i});const o=this.resolvePointerTarget(i);qi(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",o);const{onLineClick:s,onLineNumberClick:l,onLineEnter:c,onLineLeave:d,onTokenClick:f,onTokenEnter:p,onTokenLeave:m,onHunkExpand:g,onMergeConflictActionClick:v}=this.options;switch(e){case"move":{const x=sm(o)&&this.hoveredLine?.lineElement===o.lineElement;ed(o)&&this.hoveredToken?.tokenElement===o.tokenElement||(this.hoveredToken!=null&&(m?.(this.hoveredToken,t),this.clearHoveredToken()),ed(o)&&(this.setHoveredToken(this.toTokenEventBaseProps(o)),p?.(this.hoveredToken,t))),x||(this.hoveredLine!=null&&(d?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),sm(o)?(this.setHoveredLine(this.toEventBaseProps(o)),this.placeUtility(),c?.({...this.hoveredLine,event:t})):this.placeUtility());break}case"click":{if(o==null)break;if(r6(o)&&v!=null){v(o);break}if(i6(o)&&g!=null){g(o.hunkIndex,o.all||t.shiftKey?"both":o.direction,o.all||t.shiftKey?Number.POSITIVE_INFINITY:void 0);break}if(!sm(o))break;ed(o)&&f!=null&&f(this.toTokenEventBaseProps(o),t);const x=this.toEventBaseProps(o);l!=null&&o.numberColumn?l({...x,event:t}):s?.({...x,event:t});break}}}syncPointerListeners(e){const{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:i,onLineNumberClick:o,onLineEnter:s,onLineLeave:l,onTokenClick:c,onTokenEnter:d,onTokenLeave:f,onHunkExpand:p,onMergeConflictActionClick:m,enableGutterUtility:g=!1,enableLineSelection:v=!1,onGutterUtilityClick:x}=this.options,S=x!=null,w=n!=="disabled"||i!=null||o!=null||s!=null||l!=null||c!=null||d!=null||f!=null||p!=null||m!=null||g||v||S;w&&!this.hasPointerListeners?(e.addEventListener("click",this.handlePointerClick),e.addEventListener("pointerdown",this.handlePointerDown),e.addEventListener("pointermove",this.handlePointerMove),e.addEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!0,qi(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const T=[];return(t==="both"||t==="click")&&(i!=null&&T.push("onLineClick"),o!=null&&T.push("onLineNumberClick"),p!=null&&T.push("expandable hunk separators"),m!=null&&T.push("merge conflict actions")),T})()),qi(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),qi(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")):!w&&this.hasPointerListeners&&(e.removeEventListener("click",this.handlePointerClick),e.removeEventListener("pointerdown",this.handlePointerDown),e.removeEventListener("pointermove",this.handlePointerMove),e.removeEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!1);const _=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",C=this.pointerSession.mode==="gutterSelecting";(!v&&_||!S&&C)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;const{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,i=e!=null,o=t!=null||n;i&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!i&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),o&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!o&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute("data-interactive-line-numbers"),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType==="mouse"&&e.button!==0||this.pre==null||this.pointerSession.mode!=="idle")return;const t=e.composedPath();Cc(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!=="mouse"&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){const{enableLineSelection:t=!1}=this.options;if(!t)return;const n=this.resolveSelectionInfo(e,{source:"event-path",requireNumberColumn:!0});if(n==null)return;const{pre:i}=this;if(i==null)return;const{lineNumber:o,eventSide:s,lineIndex:l}=n;if(e.shiftKey&&this.selectedRange!=null){const c=this.getIndexesFromSelection(this.selectedRange,i.getAttribute("data-diff-type")==="split");if(c==null)return;const d=c.start<=c.end?l>=c.start:l<=c.end;this.selectionAnchor={lineNumber:d?this.selectedRange.start:this.selectedRange.end,side:d?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(o,s,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===o&&this.selectedRange?.end===o){const c={lineNumber:o,side:s};this.selectionAnchor=c,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:c,pending:c},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:o,side:s},this.updateSelection(o,s,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){const{onGutterUtilityClick:t}=this.options;if(t==null)return;const n=this.currentSelectionEnds(),i=n?.bottom??this.resolveSelectionPoint(e,{source:"event-path",excludeUtility:!1}),o=n?.top??i;i==null||o==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:o,current:i},this.selectionAnchor={lineNumber:o.lineNumber,side:o.side},this.updateSelection(i.lineNumber,i.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const t=this.resolveSelectionPoint(e,{source:"coordinates-first"});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case"selecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const t=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case"pendingSingleLineUnselect":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const t=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;const n={lineNumber:t.lineNumber,side:t.eventSide};if(Z5(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:"selecting",pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{const{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{const{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();const i=this.resolveSelectionPoint(e,{source:"coordinates-first"});i!=null&&(n.current=i,this.updateSelection(i.lineNumber,i.side));const o=this.buildSelectedLineRange(n.anchor,n.current);t?.({...o}),this.selectionAnchor=void 0,this.notifySelectionEnd(o),this.notifySelectionCommitted(o),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case"pendingSingleLineUnselect":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case"selecting":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":case"selecting":case"pendingSingleLineUnselect":if("pointerId"in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute("data-hovered"),this.hoveredLine.numberElement.removeAttribute("data-hovered"),this.hoveredLine=void 0)}setHoveredLine(e){const{lineHoverHighlight:t="disabled"}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!=="disabled"&&((t==="both"||t==="line")&&this.hoveredLine.lineElement.setAttribute("data-hovered",""),(t==="both"||t==="number")&&this.hoveredLine.numberElement.setAttribute("data-hovered",""))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer==null&&(this.gutterUtilityContainer=document.createElement("div"),this.gutterUtilityContainer.setAttribute("data-gutter-utility-slot","")),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot==null&&(this.gutterUtilitySlot=document.createElement("slot"),this.gutterUtilitySlot.name="gutter-utility-slot"),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){const t=document.createElement("div");t.innerHTML=nn(Q5());const n=t.firstElementChild;if(!(n instanceof HTMLButtonElement))throw new Error("InteractionManager.ensureGutterUtilityNode: Node element should be a button");n.remove(),this.gutterUtilityButton=n}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;const t=this.resolvePointerTarget(e);sl(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){const e=this.currentSelectionEnds();if(e==null)return!1;const t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){const e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){const t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},i=this.selectionPointRowIndex(t),o=this.selectionPointRowIndex(n);if(!(i==null||o==null))return i>o?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){const t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;const t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;const n=this.mode==="diff"?`${t[0]},${t[1]}`:`${t[0]}`,i=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(const o of i){if(!(o instanceof HTMLElement))continue;const s=this.resolvePointerTarget(kc(o));if(sl(s)&&!(this.mode==="diff"&&e.side!=null&&s.side!==e.side))return s}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||(document.addEventListener("pointermove",this.handleDocumentPointerMove),document.addEventListener("pointerup",this.handleDocumentPointerUp),document.addEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&(document.removeEventListener("pointermove",this.handleDocumentPointerMove),document.removeEventListener("pointerup",this.handleDocumentPointerUp),document.removeEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!1)}clearPointerSession(){this.pointerSession={mode:"idle"}}clearPendingSingleLineState(){this.pointerSession.mode==="pendingSingleLineUnselect"&&(this.pointerSession={mode:"idle"})}selectionInfoFromPath(e,t){const n=this.resolvePointerTarget(e);if(sl(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode==="diff"?n.side:void 0}}resolveSelectionInfo(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionInfoFromPath(n,t.requireNumberColumn):void 0}selectionPointFromPath(e){const t=this.resolvePointerTarget(e);if(sl(t))return{lineNumber:t.lineNumber,side:this.mode==="diff"?t.side:void 0}}resolveSelectionPoint(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionPointFromPath(n):void 0}resolveSelectionPath(e,t){const n=t.excludeUtility!==!1;switch(t.source){case"event-path":return this.pathFromEventPath(e.composedPath(),n);case"coordinates-first":{const i=this.pathFromCoordinates(e,n);return i!==void 0?i??void 0:this.pathFromEventPath(e.composedPath(),n)}}}pathFromCoordinates(e,t){const n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&Cc(e))){for(const n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){const n=kc(e);if(t&&Cc(n))return;const i=a6(e);return i!=null?kc(i):this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){const t=l6(s6(e));if(t==null)return;const n=this.targetForSelectionPoint(t);return n!=null?kc(n.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;const t=this.pre?.getRootNode(),n=tC(t)?t:tC(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){const{getLineIndex:n}=this.options;return n!=null?n(e,t):[e-1,e-1]}getCurrentSelectionRange(){return this.proposedSelectedRange!==void 0?this.proposedSelectedRange:this.selectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){const i=this.getCurrentSelectionRange();let o;if(e==null)o=null;else{const s=this.selectionAnchor?.side??t,l=this.selectionAnchor?.lineNumber??e;o=this.buildSelectionRange(l,e,s,t)}dg(i??void 0,o??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=o:(this.selectedRange=o,bk(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;const n=this.getLineIndex(e.start,e.side),i=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&i!=null?{start:t?n[1]:n[0],end:t?i[1]:i[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;const i=this.getIndexesFromSelection(e.range,t);if(i==null)throw console.error({rowRange:i,range:e.range}),new Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return i}getLineRenderColumns(e,t,n,i){if(this.pre==null||t==null&&i==null)return[];const{children:o}=this.pre;if(o.length>2)throw console.error(o),new Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");const s=[];for(const l of o){const c=l.hasAttribute("data-deletions")?"deletions":l.hasAttribute("data-additions")?"additions":void 0,d=e!=null&&t!=null&&(e.highlightSide==null||c==null||e.highlightSide===c),f=n!=null&&i!=null&&(n.highlightSide==null||c==null||n.highlightSide===c);if(!d&&!f)continue;const[p,m]=l.children;if(!(p instanceof HTMLElement)||!(m instanceof HTMLElement))throw new Error("InteractionManager.renderSelection: missing gutter or content element");if(m.children.length!==p.children.length)throw new Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");s.push({content:m,gutter:p,renderEditorActiveLine:f,renderSelectedLines:d})}return s}renderSelection=()=>{cg(this.renderSelection);const e=this.getSelectionRenderState();if(this.pre==null)return;const{editorActiveLine:t,selectedLines:n}=e,i=!nC(this.renderedSelectedLinesState,n),o=!nC(this.renderedEditorActiveLineState,t);if(!i&&!o)return;i&&(this.renderedSelectedLinesState=void 0),o&&(this.renderedEditorActiveLineState=void 0);const s=this.pre.getAttribute("data-diff-type")==="split",l=i?this.resolveLineRenderRange(n,s,"selected-lines"):void 0,c=o?this.resolveLineRenderRange(t,s,"editor-active-line"):void 0,d=this.getLineRenderColumns(i?n:void 0,l,o?t:void 0,c),f=n.range==null||d.some(S=>S.renderSelectedLines),p=t.range==null||d.some(S=>S.renderEditorActiveLine);if(i)for(const S of this.pre.querySelectorAll("[data-selected-line]"))S.removeAttribute("data-selected-line");if(o)for(const S of this.pre.querySelectorAll("[data-editor-active-line]"))S.removeAttribute("data-editor-active-line");const m=l==null?void 0:Math.min(l.start,l.end),g=l==null?void 0:Math.max(l.start,l.end),v=m===g,x=c?.start;for(const S of d){const{content:w,gutter:_,renderEditorActiveLine:C,renderSelectedLines:T}=S,D=Math.max(T?g??-1/0:-1/0,C?x??-1/0:-1/0),I=w.children.length;for(let O=0;O<I;O++){const P=w.children[O],j=_.children[O];if(!(P instanceof HTMLElement)||!(j instanceof HTMLElement))continue;const F=this.parseLineIndex(P,s);if((F??0)>D)break;if(F!=null){if(T&&m!=null&&g!=null&&F>=m&&F<=g){let Q=v?"single":F===m?"first":F===g?"last":"";j.setAttribute("data-selected-line",Q),n.lineNumberOnly||(P.setAttribute("data-selected-line",Q),j.nextSibling instanceof HTMLElement&&P.nextSibling instanceof HTMLElement&&(P.nextSibling.hasAttribute("data-line-annotation")||P.nextSibling.hasAttribute("data-merge-conflict-actions"))&&(v?(Q="last",P.setAttribute("data-selected-line","first")):F===m?Q="":F===g&&P.setAttribute("data-selected-line",""),P.nextSibling.setAttribute("data-selected-line",Q),j.nextSibling.setAttribute("data-selected-line",Q)))}C&&F===x&&(j.setAttribute("data-editor-active-line",""),t.lineNumberOnly||P.setAttribute("data-editor-active-line",""))}}}i&&f&&(this.renderedSelectedLinesState=n),o&&p&&(this.renderedEditorActiveLineState=t)};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode==="file"?{type:"line",lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:"diff-line",annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:i,tokenElement:o,tokenText:s}){return this.mode==="file"?{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:o,tokenText:s}:{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,side:i,tokenElement:o,tokenText:s}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,i){return{start:e,end:t,...n!=null?{side:n}:{},...n!==i&&i!=null?{endSide:i}:{}}}resolvePointerTarget(e){let t=!1,n,i,o,s,l,c,d,f,p,m;for(const v of e){if(!(v instanceof HTMLElement))continue;if(m==null&&v.hasAttribute("data-merge-conflict-action")){const _=v.getAttribute("data-merge-conflict-action")??void 0,C=v.getAttribute("data-merge-conflict-conflict-index")??void 0,T=C!=null?Number.parseInt(C,10):NaN;o6(_)&&Number.isFinite(T)&&(m={kind:"merge-conflict-action",resolution:_,conflictIndex:T})}if(c==null&&v.hasAttribute("data-char")){c=v;const _=v.getAttribute("data-char");if(_!=null){const C=Number.parseInt(_,10);if(!Number.isNaN(C)){const T=v.textContent??"",D=C+T.length;(T.trim()!==""||this.options.enableTokenInteractionsOnWhitespace===!0)&&(d={tokenElement:c,lineCharStart:C,lineCharEnd:D,tokenText:T});continue}}}const x=l==null?v.getAttribute("data-column-number")??void 0:void 0;if(x!=null){l=v,p=Number.parseInt(x,10),t=!0,n=rC(v),s=v.getAttribute("data-line-index")??void 0;continue}const S=o==null?v.getAttribute("data-line")??void 0:void 0;if(S!=null){o=v,p=Number.parseInt(S,10),n=rC(v),s=v.getAttribute("data-line-index")??void 0;continue}if(f==null&&(v.hasAttribute("data-expand-button")||v.hasAttribute("data-unmodified-lines"))){f={hunkIndex:void 0,direction:v.hasAttribute("data-expand-up")?"up":v.hasAttribute("data-expand-down")?"down":"both",all:v.hasAttribute("data-expand-all-button")};continue}const w=f!=null?v.getAttribute("data-expand-index")??void 0:void 0;if(f!=null&&w!=null){const _=Number.parseInt(w,10);Number.isNaN(_)||(f.hunkIndex=_);continue}if(i==null&&v.hasAttribute("data-code")){i=v;break}}if(m!=null)return m;if(f?.hunkIndex!=null)return{type:"line-info",hunkIndex:f.hunkIndex,direction:f.direction,all:f.all};if(o??=s!=null?eC(i,`[data-line][data-line-index="${s}"]`):void 0,l??=s!=null?eC(i,`[data-column-number][data-line-index="${s}"]`):void 0,i==null||o==null||l==null||n==null||p==null||Number.isNaN(p))return;const g=this.parseLineIndex(o,this.isSplitDiff());return d!=null?this.mode==="file"?{kind:"token",lineType:n,lineElement:o,lineNumber:p,numberColumn:t,numberElement:l,side:void 0,splitLineIndex:g,...d}:{kind:"token",lineType:n,lineElement:o,lineNumber:p,numberColumn:t,numberElement:l,side:iC(n,i),splitLineIndex:g,...d}:this.mode==="file"?{kind:"line",lineType:n,lineElement:o,lineNumber:p,numberColumn:t,numberElement:l,side:void 0,splitLineIndex:g}:{kind:"line",lineType:n,lineElement:o,lineNumber:p,numberColumn:t,numberElement:l,side:iC(n,i),splitLineIndex:g}}isSplitDiff(){return this.pre?.getAttribute("data-diff-type")==="split"}parseLineIndex(e,t){const n=(e.getAttribute("data-line-index")??"").split(",").map(i=>Number.parseInt(i,10)).filter(i=>!Number.isNaN(i));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function Sd({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:i,onLineClick:o,onLineEnter:s,onLineLeave:l,onLineNumberClick:c,onTokenClick:d,onTokenEnter:f,onTokenLeave:p,renderGutterUtility:m,__debugPointerEvents:g,enableLineSelection:v,controlledSelection:x,onLineSelected:S,onLineSelectionStart:w,onLineSelectionChange:_,onLineSelectionEnd:C},T,D,I){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:n6({enableGutterUtility:t,renderGutterUtility:m,onGutterUtilityClick:i}),usesCustomGutterUtility:m!=null,lineHoverHighlight:n,onGutterUtilityClick:i,onHunkExpand:T,onMergeConflictActionClick:I,onLineClick:o,onLineEnter:s,onLineLeave:l,onLineNumberClick:c,onTokenClick:d,onTokenEnter:f,onTokenLeave:p,__debugPointerEvents:g,enableLineSelection:v,controlledSelection:x,onLineSelected:S,onLineSelectionStart:w,onLineSelectionChange:_,onLineSelectionEnd:C,getLineIndex:D}}function n6({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw new Error("Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.");return e??!1}function sl(e){return e!=null&&"kind"in e&&e.kind==="line"}function ed(e){return e!=null&&"kind"in e&&e.kind==="token"}function sm(e){return sl(e)||ed(e)}function i6(e){return"type"in e&&e.type==="line-info"}function r6(e){return"kind"in e&&e.kind==="merge-conflict-action"}function o6(e){return e==="current"||e==="incoming"||e==="both"}function eC(e,t){const n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function kc(e){const t=[];let n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function a6(e){const t=e.closest("[data-line], [data-column-number]");if(t instanceof HTMLElement)return t;const n=e.closest('[data-line-annotation], [data-gutter-buffer="annotation"]');if(!(n instanceof HTMLElement))return;const i=n.previousElementSibling;return i instanceof HTMLElement&&(i.hasAttribute("data-line")||i.hasAttribute("data-column-number"))?i:void 0}function s6(e){const t=e.closest('[slot^="annotation-"]');if(t instanceof HTMLElement)return t.getAttribute("slot")??void 0;if(e instanceof HTMLElement){const n=e.getAttribute("name")??void 0;return n!=null&&n.startsWith("annotation-")?n:void 0}}function l6(e){if(e==null)return;const t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;const n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function tC(e){return e!=null&&typeof e.elementFromPoint=="function"}function u6(e,t){return e===t||dg(e??void 0,t??void 0)}function nC(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&u6(e?.range??null,t.range)}function iC(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function rC(e){const t=e.getAttribute("data-line-type");if(t!=null)switch(t){case"change-deletion":case"change-addition":case"context":case"context-expanded":return t;default:return}}function qi(e="none",t,...n){switch(e){case"none":return;case"both":break;case"click":if(t!=="click")return;break;case"move":if(t!=="move")return;break}console.log(...n)}var Ik=class Ki{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){const t=Ki.resizeObserver??new ResizeObserver(Ki.handleSharedResizeEntries);return Ki.resizeObserver=t,t}static handleSharedResizeEntries(t){const n=new Map;for(const i of t){const o=Ki.managersByElement.get(i.target);if(o==null)continue;const s=n.get(o);s==null?n.set(o,[i]):s.push(i)}for(const[i,o]of n)i.handleResizeEntries(o)}observedNodes=new Map;setup(t,{disableAnnotations:n,columnVariables:i="apply"}){const o=new Set,s=i==="apply";let l=0;const c=new Map(this.observedNodes);this.observedNodes.clear();for(const d of t.children){if(l===2)break;const f=(()=>{if(d instanceof HTMLElement&&d.tagName==="CODE")return d})();if(f==null)continue;l++;let p=c.get(f);if(p!=null&&p.type!=="code")throw new Error("ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible");let m=f.firstElementChild;m instanceof HTMLElement||(m=null),p!=null?(this.observedNodes.set(f,p),c.delete(f),p.numberElement!==m?(p.numberElement!=null&&(this.unobserve(p.numberElement),c.delete(p.numberElement)),m!=null&&(this.observe(m),c.delete(m),this.observedNodes.set(m,p)),p.numberElement=m,p.numberWidth=0):p.numberElement!=null?(c.delete(p.numberElement),this.observedNodes.set(p.numberElement,p)):p.numberWidth=0,f6(p,s)):(p={type:"code",codeElement:f,numberElement:m,codeWidth:"auto",numberWidth:0,applyColumnVariables:s},this.observedNodes.set(f,p),this.observe(f),m!=null&&(this.observedNodes.set(m,p),this.observe(m)))}if(l>1&&!n){const d=t.querySelectorAll('[data-line-annotation*=","]'),f=new Map;for(const p of d){if(!(p instanceof HTMLElement))continue;const m=p.getAttribute("data-line-annotation")??"";if(!/^-?\d+,-?\d+$/.test(m)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:m,element:p});continue}let g=f.get(m);g==null&&(g=[],f.set(m,g)),g.push(p)}for(const[p,m]of f){if(m.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",p,m);continue}const[g,v]=m,x=g.firstElementChild,S=v.firstElementChild;if(!(g instanceof HTMLElement)||!(v instanceof HTMLElement)||!(x instanceof HTMLElement)||!(S instanceof HTMLElement))continue;let w=c.get(x);if(w!=null){this.observedNodes.set(x,w),this.observedNodes.set(S,w),c.delete(x),c.delete(S);continue}const _=x.getBoundingClientRect().height,C=S.getBoundingClientRect().height;w={type:"annotations",column1:{container:g,child:x,childHeight:_},column2:{container:v,child:S,childHeight:C},currentHeight:"auto"},o.add({child1:x,child2:S,item:w,newHeight:Math.max(_,C)})}for(const p of o)this.applyNewHeight(p.item,p.newHeight),this.observedNodes.set(p.child1,p.item),this.observedNodes.set(p.child2,p.item),this.observe(p.child1),this.observe(p.child2);o.clear()}for(const[d,f]of c)this.unobserve(d),f.type==="code"?h6(f):p6(f);c.clear()}cleanUp(){for(const t of this.observedNodes.keys())this.unobserve(t);this.observedNodes.clear()}observe(t){const{managersByElement:n}=Ki,i=n.get(t);if(i!==this){if(i!=null&&i!==this)throw new Error("ResizeManager.observe: element is already owned by another ResizeManager");n.set(t,this),Ki.getResizeObserver().observe(t)}}unobserve(t){const{managersByElement:n,resizeObserver:i}=Ki,o=n.get(t);if(o!=null){if(o!==this)throw new Error("ResizeManager.unobserve: element is owned by another ResizeManager");n.delete(t),i?.unobserve(t),i!=null&&n.size===0&&(i.disconnect(),Ki.resizeObserver=void 0)}}handleResizeEntries(t){const n=new Map,i=new Set;for(const o of t){const{target:s,borderBoxSize:l,contentBoxSize:c}=o;if(!(s instanceof HTMLElement)){console.error("ResizeManager.handleResizeEntries: Invalid element for ResizeObserver",o);continue}const d=this.observedNodes.get(s);if(d==null){console.error("ResizeManager.handleResizeEntries: Not a valid observed node",o);continue}if(d.type==="annotations"){const f=(()=>{if(s===d.column1.child)return d.column1;if(s===d.column2.child)return d.column2})();if(f==null){console.error("ResizeManager.handleResizeEntries: Couldn't find a column for",{item:d,target:s});continue}f.childHeight=l[0].blockSize,i.add(d)}else if(d.type==="code"){const f=n.get(d)??{},p=c[0].inlineSize;s===d.codeElement?f.codeInlineSize=p:s===d.numberElement&&(f.numberInlineSize=p),n.set(d,f)}}this.applyAnnotationUpdates(i),i.clear(),this.applyColumnUpdates(n),n.clear()}applyAnnotationUpdates(t){for(const n of t)this.applyNewHeight(n,Math.max(n.column1.childHeight,n.column2.childHeight))}applyColumnUpdates=t=>{for(const[n,i]of t){const o=i.codeInlineSize!=null?c6(i.codeInlineSize):n.codeWidth,s=i.numberInlineSize!=null?d6(i.numberInlineSize):n.numberWidth,l=o!==n.codeWidth,c=s!==n.numberWidth;!l&&!c||(n.codeWidth=o,n.numberWidth=s,n.applyColumnVariables&&Nk(n,{codeWidthChanged:l,numberWidthChanged:c}))}};applyNewHeight(t,n){n!==t.currentHeight&&(t.currentHeight=Math.max(n,0),t.column1.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`),t.column2.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`))}};function c6(e){const t=Math.max(Math.floor(e),0);return t===0?"auto":t}function d6(e){return Math.max(Math.ceil(e),0)}function f6(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?Nk(e,{codeWidthChanged:!0,numberWidthChanged:!0}):zk(e))}function Nk(e,{codeWidthChanged:t,numberWidthChanged:n}){const{codeElement:i,codeWidth:o,numberWidth:s}=e;if(t&&i.style.setProperty("--diffs-column-width",`${typeof o=="number"?`${o}px`:"auto"}`),n&&i.style.setProperty("--diffs-column-number-width",`${s===0?"auto":`${s}px`}`),t||n&&o!=="auto"){const l=typeof o=="number"?Math.max(o-s,0):0;i.style.setProperty("--diffs-column-content-width",`${l>0?`${l}px`:"auto"}`)}}function zk(e){e.codeElement.style.removeProperty("--diffs-column-content-width"),e.codeElement.style.removeProperty("--diffs-column-number-width"),e.codeElement.style.removeProperty("--diffs-column-width")}function h6(e){e.codeElement.isConnected&&zk(e)}function p6(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty("--diffs-annotation-min-height"),e.column2.container.isConnected&&e.column2.container.style.removeProperty("--diffs-annotation-min-height")}const Po=new Map,lm=new Map,m6=new Map,gg=new Set;function _d(e){for(const t of Array.isArray(e)?e:[e])if(!(t==="text"||t==="ansi")&&!gg.has(t))return!1;return!0}function oC(e,t){e=Array.isArray(e)?e:[e];for(const n of e){if(gg.has(n.name))continue;let i=Po.get(n.name);i==null&&(i=n,Po.set(n.name,i)),gg.add(i.name),t.loadLanguageSync(i.data)}}function Pk(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}var yg=Object.defineProperty,g6=Object.getOwnPropertyDescriptor,y6=Object.getOwnPropertyNames,v6=Object.prototype.hasOwnProperty,b6=(e,t)=>{let n={};for(var i in e)yg(n,i,{get:e[i],enumerable:!0});return yg(n,Symbol.toStringTag,{value:"Module"}),n},x6=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=y6(t),s=0,l=o.length,c;s<l;s++)c=o[s],!v6.call(e,c)&&c!==n&&yg(e,c,{get:(d=>t[d]).bind(null,c),enumerable:!(i=g6(t,c))||i.enumerable});return e},S6=(e,t,n)=>(x6(e,t,"default"),n);const _6="modulepreload",C6=function(e,t){return new URL(e,t).href},aC={},A=function(t,n,i){let o=Promise.resolve();if(n&&n.length>0){let f=function(p){return Promise.all(p.map(m=>Promise.resolve(m).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};const l=document.getElementsByTagName("link"),c=document.querySelector("meta[property=csp-nonce]"),d=c?.nonce||c?.getAttribute("nonce");o=f(n.map(p=>{if(p=C6(p,i),p in aC)return;aC[p]=!0;const m=p.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(i)for(let x=l.length-1;x>=0;x--){const S=l[x];if(S.href===p&&(!m||S.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${p}"]${g}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":_6,m||(v.as="script"),v.crossOrigin="",v.href=p,d&&v.setAttribute("nonce",d),document.head.appendChild(v),m)return new Promise((x,S)=>{v.addEventListener("load",x),v.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${p}`)))})}))}function s(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return o.then(l=>{for(const c of l||[])c.status==="rejected"&&s(c.reason);return t().catch(s)})},Hk=[{id:"abap",name:"ABAP",import:(()=>A(()=>import("./abap-BdImnpbu.js"),[],import.meta.url))},{id:"actionscript-3",name:"ActionScript",aliases:["actionscript","as3"],import:(()=>A(()=>import("./actionscript-3-B3316cI-.js"),[],import.meta.url))},{id:"ada",name:"Ada",import:(()=>A(()=>import("./ada-bCR0ucgS.js"),[],import.meta.url))},{id:"ahk",name:"AutoHotkey",aliases:["ahk1"],import:(()=>A(()=>import("./ahk-CsyLZFj1.js"),[],import.meta.url))},{id:"ahk2",name:"AutoHotkey2",import:(()=>A(()=>import("./ahk2-8Zs4aa1G.js"),[],import.meta.url))},{id:"angular-html",name:"Angular HTML",import:(()=>A(()=>import("./angular-html-DA-rfuFy.js").then(e=>e.f),__vite__mapDeps([0,1,2,3]),import.meta.url))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>A(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5]),import.meta.url))},{id:"apache",name:"Apache Conf",import:(()=>A(()=>import("./apache-Pmp26Uib.js"),[],import.meta.url))},{id:"apex",name:"Apex",import:(()=>A(()=>import("./apex-DhZFqWV2.js"),[],import.meta.url))},{id:"apl",name:"APL",import:(()=>A(()=>import("./apl-CORt7UWP.js"),__vite__mapDeps([6,1,2,3,7,8,9]),import.meta.url))},{id:"applescript",name:"AppleScript",import:(()=>A(()=>import("./applescript-Co6uUVPk.js"),[],import.meta.url))},{id:"ara",name:"Ara",import:(()=>A(()=>import("./ara-BRHolxvo.js"),[],import.meta.url))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>A(()=>import("./asciidoc-CSVQ5wI8.js"),[],import.meta.url))},{id:"asm",name:"Assembly",import:(()=>A(()=>import("./asm-D_Q5rh1f.js"),[],import.meta.url))},{id:"astro",name:"Astro",import:(()=>A(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([10,9,2,11,3,12,13]),import.meta.url))},{id:"awk",name:"AWK",import:(()=>A(()=>import("./awk-DMzUqQB5.js"),[],import.meta.url))},{id:"ballerina",name:"Ballerina",import:(()=>A(()=>import("./ballerina-BFfxhgS-.js"),[],import.meta.url))},{id:"bat",name:"Batch File",aliases:["batch","cmd"],import:(()=>A(()=>import("./bat-CickPsom.js"),[],import.meta.url))},{id:"beancount",name:"Beancount",import:(()=>A(()=>import("./beancount-k_qm7-4y.js"),[],import.meta.url))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>A(()=>import("./berry-uYugtg8r.js"),[],import.meta.url))},{id:"bibtex",name:"BibTeX",import:(()=>A(()=>import("./bibtex-CHM0blh-.js"),[],import.meta.url))},{id:"bicep",name:"Bicep",import:(()=>A(()=>import("./bicep-Bmn6On1c.js"),[],import.meta.url))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>A(()=>import("./bird2-Bx8U0n9b.js"),[],import.meta.url))},{id:"blade",name:"Blade",import:(()=>A(()=>import("./blade-2xfisSek.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9]),import.meta.url))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>A(()=>import("./bsl-DlhNcFeZ.js"),__vite__mapDeps([17,18]),import.meta.url))},{id:"c",name:"C",import:(()=>A(()=>import("./c-BIGW1oBm.js"),[],import.meta.url))},{id:"c3",name:"C3",import:(()=>A(()=>import("./c3-Dp5svz6Z.js"),[],import.meta.url))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>A(()=>import("./cadence-Bv_4Rxtq.js"),[],import.meta.url))},{id:"cairo",name:"Cairo",import:(()=>A(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20]),import.meta.url))},{id:"chapel",name:"Chapel",aliases:["chpl"],import:(()=>A(()=>import("./chapel-DTp_pixX.js"),__vite__mapDeps([21,22]),import.meta.url))},{id:"clarity",name:"Clarity",import:(()=>A(()=>import("./clarity-Dn5IMItf.js"),[],import.meta.url))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>A(()=>import("./clojure-P80f7IUj.js"),[],import.meta.url))},{id:"cmake",name:"CMake",import:(()=>A(()=>import("./cmake-D1j8_8rp.js"),[],import.meta.url))},{id:"cobol",name:"COBOL",import:(()=>A(()=>import("./cobol-nBiQ_Alo.js"),__vite__mapDeps([23,1,2,3,8]),import.meta.url))},{id:"codeowners",name:"CODEOWNERS",import:(()=>A(()=>import("./codeowners-Bp6g37R7.js"),[],import.meta.url))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>A(()=>import("./codeql-DsOJ9woJ.js"),[],import.meta.url))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>A(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([24,2]),import.meta.url))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>A(()=>import("./common-lisp-Cg-RD9OK.js"),[],import.meta.url))},{id:"coq",name:"Rocq",import:(()=>A(()=>import("./coq-C7JzOVbR.js"),[],import.meta.url))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>A(()=>import("./cpp-BMRokrvK.js"),__vite__mapDeps([25,26,27,22]),import.meta.url))},{id:"crystal",name:"Crystal",import:(()=>A(()=>import("./crystal-DGywbUpC.js"),__vite__mapDeps([28,1,2,3,16,22,29]),import.meta.url))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>A(()=>import("./csharp-DSvCPggb.js"),[],import.meta.url))},{id:"css",name:"CSS",import:(()=>A(()=>import("./css-CLj8gQPS.js"),[],import.meta.url))},{id:"csv",name:"CSV",import:(()=>A(()=>import("./csv-fuZLfV_i.js"),[],import.meta.url))},{id:"cue",name:"CUE",import:(()=>A(()=>import("./cue-D82EKSYY.js"),[],import.meta.url))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>A(()=>import("./cypher-COkxafJQ.js"),[],import.meta.url))},{id:"d",name:"D",import:(()=>A(()=>import("./d-85-TOEBH.js"),[],import.meta.url))},{id:"dart",name:"Dart",import:(()=>A(()=>import("./dart-bE4Kk8sk.js"),[],import.meta.url))},{id:"dax",name:"DAX",import:(()=>A(()=>import("./dax-CEL-wOlO.js"),[],import.meta.url))},{id:"desktop",name:"Desktop",import:(()=>A(()=>import("./desktop-BmXAJ9_W.js"),[],import.meta.url))},{id:"diff",name:"Diff",import:(()=>A(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>A(()=>import("./docker-BcOcwvcX.js"),[],import.meta.url))},{id:"dotenv",name:"dotEnv",import:(()=>A(()=>import("./dotenv-Da5cRb03.js"),[],import.meta.url))},{id:"dream-maker",name:"Dream Maker",import:(()=>A(()=>import("./dream-maker-BtqSS_iP.js"),[],import.meta.url))},{id:"edge",name:"Edge",import:(()=>A(()=>import("./edge-FbVlp4U3.js"),__vite__mapDeps([30,11,1,2,3,15]),import.meta.url))},{id:"elixir",name:"Elixir",import:(()=>A(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([31,1,2,3]),import.meta.url))},{id:"elm",name:"Elm",import:(()=>A(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([32,27,22]),import.meta.url))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>A(()=>import("./emacs-lisp-C_m_b--Z.js"),[],import.meta.url))},{id:"erb",name:"ERB",import:(()=>A(()=>import("./erb-DXfck5VN.js"),__vite__mapDeps([33,1,2,3,34,35,7,8,16,36,11,37,13,25,26,27,22,29,38,39]),import.meta.url))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>A(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([40,41]),import.meta.url))},{id:"fennel",name:"Fennel",import:(()=>A(()=>import("./fennel-BYunw83y.js"),[],import.meta.url))},{id:"fish",name:"Fish",import:(()=>A(()=>import("./fish-BvzEVeQv.js"),[],import.meta.url))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>A(()=>import("./fluent-C4IJs8-o.js"),[],import.meta.url))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>A(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([42,43]),import.meta.url))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>A(()=>import("./fortran-free-form-BxgE0vQu.js"),[],import.meta.url))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>A(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([44,41]),import.meta.url))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>A(()=>import("./gdresource-TyuKm33G.js"),__vite__mapDeps([45,46,47]),import.meta.url))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>A(()=>import("./gdscript-DqcFQ5yU.js"),[],import.meta.url))},{id:"gdshader",name:"GDShader",import:(()=>A(()=>import("./gdshader-DkwncUOv.js"),[],import.meta.url))},{id:"genie",name:"Genie",import:(()=>A(()=>import("./genie-D0YGMca9.js"),[],import.meta.url))},{id:"gherkin",name:"Gherkin",import:(()=>A(()=>import("./gherkin-DyxjwDmM.js"),[],import.meta.url))},{id:"git-commit",name:"Git Commit Message",import:(()=>A(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([48,49]),import.meta.url))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>A(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([50,29]),import.meta.url))},{id:"gleam",name:"Gleam",import:(()=>A(()=>import("./gleam-BspZqrRM.js"),[],import.meta.url))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>A(()=>import("./glimmer-js-ByusRIyA.js"),__vite__mapDeps([51,2,11,3,1]),import.meta.url))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>A(()=>import("./glimmer-ts-BfAWNZQY.js"),__vite__mapDeps([52,11,3,2,1]),import.meta.url))},{id:"glsl",name:"GLSL",import:(()=>A(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([27,22]),import.meta.url))},{id:"gn",name:"GN",import:(()=>A(()=>import("./gn-n2N0HUVH.js"),[],import.meta.url))},{id:"gnuplot",name:"Gnuplot",import:(()=>A(()=>import("./gnuplot-DdkO51Og.js"),[],import.meta.url))},{id:"go",name:"Go",import:(()=>A(()=>import("./go-C27-OAKa.js"),[],import.meta.url))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>A(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([36,2,11,37,13]),import.meta.url))},{id:"groovy",name:"Groovy",import:(()=>A(()=>import("./groovy-gcz8RCvz.js"),[],import.meta.url))},{id:"hack",name:"Hack",import:(()=>A(()=>import("./hack-BWmVpMyf.js"),__vite__mapDeps([53,1,2,3,16]),import.meta.url))},{id:"haml",name:"Ruby Haml",import:(()=>A(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([35,2,3]),import.meta.url))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>A(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([54,1,2,3,39]),import.meta.url))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>A(()=>import("./haskell-Df6bDoY_.js"),[],import.meta.url))},{id:"haxe",name:"Haxe",import:(()=>A(()=>import("./haxe-CfZj7gIn.js"),[],import.meta.url))},{id:"hcl",name:"HashiCorp HCL",import:(()=>A(()=>import("./hcl-BWvSN4gD.js"),[],import.meta.url))},{id:"hjson",name:"Hjson",import:(()=>A(()=>import("./hjson-D5-asLiD.js"),[],import.meta.url))},{id:"hlsl",name:"HLSL",import:(()=>A(()=>import("./hlsl-D3lLCCz7.js"),[],import.meta.url))},{id:"html",name:"HTML",import:(()=>A(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3]),import.meta.url))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>A(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([15,1,2,3]),import.meta.url))},{id:"http",name:"HTTP",import:(()=>A(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([55,29,9,7,8,36,2,11,37,13]),import.meta.url))},{id:"hurl",name:"Hurl",import:(()=>A(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([56,36,2,11,37,13,7,8,57]),import.meta.url))},{id:"hxml",name:"HXML",import:(()=>A(()=>import("./hxml-2-FPmUDs.js"),__vite__mapDeps([58,59]),import.meta.url))},{id:"hy",name:"Hy",import:(()=>A(()=>import("./hy-DFXneXwc.js"),[],import.meta.url))},{id:"imba",name:"Imba",import:(()=>A(()=>import("./imba-DGztddWO.js"),[],import.meta.url))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>A(()=>import("./ini-BEwlwnbL.js"),[],import.meta.url))},{id:"java",name:"Java",import:(()=>A(()=>import("./java-CylS5w8V.js"),[],import.meta.url))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>A(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url))},{id:"jinja",name:"Jinja",import:(()=>A(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([60,1,2,3]),import.meta.url))},{id:"jison",name:"Jison",import:(()=>A(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([61,2]),import.meta.url))},{id:"json",name:"JSON",import:(()=>A(()=>import("./json-Cp-IABpG.js"),[],import.meta.url))},{id:"json5",name:"JSON5",import:(()=>A(()=>import("./json5-C9tS-k6U.js"),[],import.meta.url))},{id:"jsonc",name:"JSON with Comments",import:(()=>A(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url))},{id:"jsonl",name:"JSON Lines",import:(()=>A(()=>import("./jsonl-DcaNXYhu.js"),[],import.meta.url))},{id:"jsonnet",name:"Jsonnet",import:(()=>A(()=>import("./jsonnet-DFQXde-d.js"),[],import.meta.url))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>A(()=>import("./jssm-C2t-YnRu.js"),[],import.meta.url))},{id:"jsx",name:"JSX",import:(()=>A(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>A(()=>import("./julia-5Bft2YPA.js"),__vite__mapDeps([62,25,26,27,22,20,2,63,16]),import.meta.url))},{id:"just",name:"Just",aliases:["justfile"],import:(()=>A(()=>import("./just-Cwhn7H3k.js"),__vite__mapDeps([64,29,2,11,65,1,3,7,8,16,20,34,35,36,37,13,25,26,27,22,38,39]),import.meta.url))},{id:"kdl",name:"KDL",import:(()=>A(()=>import("./kdl-DV7GczEv.js"),[],import.meta.url))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>A(()=>import("./kotlin-BdnUsdx6.js"),[],import.meta.url))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>A(()=>import("./kusto-wEQ09or8.js"),[],import.meta.url))},{id:"latex",name:"LaTeX",import:(()=>A(()=>import("./latex-D5pSuvFb.js"),__vite__mapDeps([66,67,63]),import.meta.url))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>A(()=>import("./lean-BZvkOJ9d.js"),[],import.meta.url))},{id:"less",name:"Less",import:(()=>A(()=>import("./less-B1dDrJ26.js"),[],import.meta.url))},{id:"liquid",name:"Liquid",import:(()=>A(()=>import("./liquid-C0sCDyMI.js"),__vite__mapDeps([68,1,2,3,9]),import.meta.url))},{id:"llvm",name:"LLVM IR",import:(()=>A(()=>import("./llvm-BZoOZj88.js"),[],import.meta.url))},{id:"log",name:"Log file",import:(()=>A(()=>import("./log-2UxHyX5q.js"),[],import.meta.url))},{id:"logo",name:"Logo",import:(()=>A(()=>import("./logo-BtOb2qkB.js"),[],import.meta.url))},{id:"lua",name:"Lua",import:(()=>A(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([38,22]),import.meta.url))},{id:"luau",name:"Luau",import:(()=>A(()=>import("./luau-BnpPk5vE.js"),[],import.meta.url))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>A(()=>import("./make-CHLpvVh8.js"),[],import.meta.url))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>A(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url))},{id:"marko",name:"Marko",import:(()=>A(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([69,3,70,5,11]),import.meta.url))},{id:"matlab",name:"MATLAB",import:(()=>A(()=>import("./matlab-D7o27uSR.js"),[],import.meta.url))},{id:"mdc",name:"MDC",import:(()=>A(()=>import("./mdc-D1_yUvq7.js"),__vite__mapDeps([71,41,39,15,1,2,3]),import.meta.url))},{id:"mdx",name:"MDX",import:(()=>A(()=>import("./mdx-Cmh6b_Ma.js"),[],import.meta.url))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>A(()=>import("./mermaid-CQcHuHx7.js"),[],import.meta.url))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>A(()=>import("./mipsasm-CKIfxQSi.js"),[],import.meta.url))},{id:"mojo",name:"Mojo",import:(()=>A(()=>import("./mojo-DJz3ZmWd.js"),[],import.meta.url))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>A(()=>import("./moonbit-CHtswR0a.js"),[],import.meta.url))},{id:"move",name:"Move",import:(()=>A(()=>import("./move-el3G9tDJ.js"),[],import.meta.url))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>A(()=>import("./narrat-DRg8JJMk.js"),[],import.meta.url))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>A(()=>import("./nextflow-C-mBbutL.js"),__vite__mapDeps([72,73]),import.meta.url))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>A(()=>import("./nextflow-groovy-vE_lwT2v.js"),[],import.meta.url))},{id:"nginx",name:"Nginx",import:(()=>A(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([74,38,22]),import.meta.url))},{id:"nim",name:"Nim",import:(()=>A(()=>import("./nim-BIad80T-.js"),__vite__mapDeps([75,22,1,2,3,7,8,27,41]),import.meta.url))},{id:"nix",name:"Nix",import:(()=>A(()=>import("./nix-CwoSXNpI.js"),[],import.meta.url))},{id:"nsis",name:"NSIS",import:(()=>A(()=>import("./nsis-BlV79W_Q.js"),[],import.meta.url))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>A(()=>import("./nushell-D3jzshHO.js"),[],import.meta.url))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>A(()=>import("./objective-c-DXmwc3jG.js"),[],import.meta.url))},{id:"objective-cpp",name:"Objective-C++",import:(()=>A(()=>import("./objective-cpp-CLxacb5B.js"),[],import.meta.url))},{id:"ocaml",name:"OCaml",import:(()=>A(()=>import("./ocaml-C0hk2d4L.js"),[],import.meta.url))},{id:"odin",name:"Odin",import:(()=>A(()=>import("./odin-BBf5iR-q.js"),[],import.meta.url))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>A(()=>import("./openscad-C4EeE6gA.js"),[],import.meta.url))},{id:"org",name:"Org Markup",import:(()=>A(()=>import("./org-DM6o9KBp.js"),__vite__mapDeps([76,2,11,13,8,20,26,3,38,22,77,78,65,1,7,16,63,34,35,36,37,25,27,29,39,79,9,80,81,24,82,49,83,84,85,70,5,86,87,88,89,90,75,41,31,40,91,92,93,48,50,66,67]),import.meta.url))},{id:"pascal",name:"Pascal",import:(()=>A(()=>import("./pascal-D93ZcfNL.js"),[],import.meta.url))},{id:"perl",name:"Perl",import:(()=>A(()=>import("./perl-B9cMNwum.js"),__vite__mapDeps([65,1,2,3,7,8,16]),import.meta.url))},{id:"php",name:"PHP",import:(()=>A(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([79,1,2,3,7,8,16,9]),import.meta.url))},{id:"pkl",name:"Pkl",import:(()=>A(()=>import("./pkl-u5AG7uiY.js"),[],import.meta.url))},{id:"plsql",name:"PL/SQL",import:(()=>A(()=>import("./plsql-ChMvpjG-.js"),[],import.meta.url))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>A(()=>import("./po-BTJTHyun.js"),[],import.meta.url))},{id:"polar",name:"Polar",import:(()=>A(()=>import("./polar-C0HS_06l.js"),[],import.meta.url))},{id:"postcss",name:"PostCSS",import:(()=>A(()=>import("./postcss-CXtECtnM.js"),[],import.meta.url))},{id:"powerquery",name:"PowerQuery",import:(()=>A(()=>import("./powerquery-CEu0bR-o.js"),[],import.meta.url))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1","pwsh"],import:(()=>A(()=>import("./powershell-BmBUJMz7.js"),[],import.meta.url))},{id:"prisma",name:"Prisma",import:(()=>A(()=>import("./prisma-Vru482bI.js"),[],import.meta.url))},{id:"prolog",name:"Prolog",import:(()=>A(()=>import("./prolog-CbFg5uaA.js"),[],import.meta.url))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>A(()=>import("./proto-C7zT0LnQ.js"),[],import.meta.url))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>A(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([94,2,3,1]),import.meta.url))},{id:"puppet",name:"Puppet",import:(()=>A(()=>import("./puppet-BMWR74SV.js"),[],import.meta.url))},{id:"purescript",name:"PureScript",import:(()=>A(()=>import("./purescript-CklMAg4u.js"),[],import.meta.url))},{id:"python",name:"Python",aliases:["py"],import:(()=>A(()=>import("./python-B6aJPvgy.js"),[],import.meta.url))},{id:"qml",name:"QML",import:(()=>A(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([95,2]),import.meta.url))},{id:"qmldir",name:"QML Directory",import:(()=>A(()=>import("./qmldir-C8lEn-DE.js"),[],import.meta.url))},{id:"qss",name:"Qt Style Sheets",import:(()=>A(()=>import("./qss-IeuSbFQv.js"),[],import.meta.url))},{id:"r",name:"R",import:(()=>A(()=>import("./r-Cf5RLm7j.js"),[],import.meta.url))},{id:"racket",name:"Racket",import:(()=>A(()=>import("./racket-BqYA7rlc.js"),[],import.meta.url))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>A(()=>import("./raku-DXvB9xmW.js"),[],import.meta.url))},{id:"razor",name:"ASP.NET Razor",import:(()=>A(()=>import("./razor-BjBPvh-w.js"),__vite__mapDeps([96,1,2,3,89]),import.meta.url))},{id:"rbs",name:"RBS",aliases:["ruby-signature"],import:(()=>A(()=>import("./rbs-CpoqiR4B.js"),[],import.meta.url))},{id:"reg",name:"Windows Registry Script",import:(()=>A(()=>import("./reg-C-SQnVFl.js"),[],import.meta.url))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>A(()=>import("./regexp-CDVJQ6XC.js"),[],import.meta.url))},{id:"rel",name:"Rel",import:(()=>A(()=>import("./rel-C3B-1QV4.js"),[],import.meta.url))},{id:"riscv",name:"RISC-V",import:(()=>A(()=>import("./riscv-BM1_JUlF.js"),[],import.meta.url))},{id:"ron",name:"RON",import:(()=>A(()=>import("./ron-D8l8udqQ.js"),[],import.meta.url))},{id:"rosmsg",name:"ROS Interface",import:(()=>A(()=>import("./rosmsg-BJDFO7_C.js"),[],import.meta.url))},{id:"rst",name:"reStructuredText",import:(()=>A(()=>import("./rst-bs7f0vWN.js"),__vite__mapDeps([97,15,1,2,3,25,26,27,22,20,29,39,98,34,35,7,8,16,36,11,37,13,38]),import.meta.url))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>A(()=>import("./ruby-C0TQ7zu5.js"),__vite__mapDeps([34,1,2,3,35,7,8,16,36,11,37,13,25,26,27,22,29,38,39]),import.meta.url))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>A(()=>import("./rust-B1yitclQ.js"),[],import.meta.url))},{id:"sas",name:"SAS",import:(()=>A(()=>import("./sas-DEy46yEz.js"),__vite__mapDeps([99,16]),import.meta.url))},{id:"sass",name:"Sass",import:(()=>A(()=>import("./sass-Cj5Yp3dK.js"),[],import.meta.url))},{id:"scala",name:"Scala",import:(()=>A(()=>import("./scala-CqE71os6.js"),[],import.meta.url))},{id:"scheme",name:"Scheme",import:(()=>A(()=>import("./scheme-C98Dy4si.js"),[],import.meta.url))},{id:"scss",name:"SCSS",import:(()=>A(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3]),import.meta.url))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>A(()=>import("./sdbl-DVxCFoDh.js"),[],import.meta.url))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>A(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([100,101]),import.meta.url))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>A(()=>import("./shellscript-Yzrsuije.js"),[],import.meta.url))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>A(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([102,29]),import.meta.url))},{id:"smalltalk",name:"GNU Smalltalk",import:(()=>A(()=>import("./smalltalk-BOQMe2GC.js"),[],import.meta.url))},{id:"smithy",name:"Smithy",import:(()=>A(()=>import("./smithy-cds9vsN8.js"),[],import.meta.url))},{id:"solidity",name:"Solidity",import:(()=>A(()=>import("./solidity-DijEV5ha.js"),[],import.meta.url))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>A(()=>import("./soy-8wufbnw4.js"),__vite__mapDeps([103,1,2,3]),import.meta.url))},{id:"sparql",name:"SPARQL",import:(()=>A(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([104,105]),import.meta.url))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>A(()=>import("./splunk-BtCnVYZw.js"),[],import.meta.url))},{id:"sql",name:"SQL",import:(()=>A(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url))},{id:"ssh-config",name:"SSH Config",import:(()=>A(()=>import("./ssh-config-_ykCGR6B.js"),[],import.meta.url))},{id:"stata",name:"Stata",import:(()=>A(()=>import("./stata-DI20mbqo.js"),__vite__mapDeps([106,16]),import.meta.url))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>A(()=>import("./stylus-BEDo0Tqx.js"),[],import.meta.url))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>A(()=>import("./surrealql-Cjom0U5J.js"),__vite__mapDeps([107,2]),import.meta.url))},{id:"svelte",name:"Svelte",import:(()=>A(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([108,2,11,3,12]),import.meta.url))},{id:"swift",name:"Swift",import:(()=>A(()=>import("./swift-C2oV4EkX.js"),[],import.meta.url))},{id:"system-verilog",name:"SystemVerilog",import:(()=>A(()=>import("./system-verilog-0hqHdDBg.js"),[],import.meta.url))},{id:"systemd",name:"Systemd Units",import:(()=>A(()=>import("./systemd-4A_iFExJ.js"),[],import.meta.url))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>A(()=>import("./talonscript-CkByrt1z.js"),[],import.meta.url))},{id:"tasl",name:"Tasl",import:(()=>A(()=>import("./tasl-QIJgUcNo.js"),[],import.meta.url))},{id:"tcl",name:"Tcl",import:(()=>A(()=>import("./tcl-dwOrl1Do.js"),[],import.meta.url))},{id:"templ",name:"Templ",import:(()=>A(()=>import("./templ-DhtptRzy.js"),__vite__mapDeps([109,84,2,3]),import.meta.url))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>A(()=>import("./terraform-BETggiCN.js"),[],import.meta.url))},{id:"tex",name:"TeX",import:(()=>A(()=>import("./tex-D96PA37w.js"),__vite__mapDeps([67,63]),import.meta.url))},{id:"toml",name:"TOML",import:(()=>A(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>A(()=>import("./ts-tags-D351s5mN.js"),__vite__mapDeps([110,11,3,2,27,22,1,16,7,8]),import.meta.url))},{id:"tsv",name:"TSV",import:(()=>A(()=>import("./tsv-B_m7g4N7.js"),[],import.meta.url))},{id:"tsx",name:"TSX",import:(()=>A(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url))},{id:"turtle",name:"Turtle",import:(()=>A(()=>import("./turtle-BsS91CYL.js"),[],import.meta.url))},{id:"twig",name:"Twig",import:(()=>A(()=>import("./twig-27uCiNez.js"),__vite__mapDeps([111,3,2,5,79,1,7,8,16,9,20,34,35,36,11,37,13,25,26,27,22,29,38,39]),import.meta.url))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>A(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>A(()=>import("./typespec-CAFt9gP4.js"),[],import.meta.url))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>A(()=>import("./typst-BUadGCkm.js"),__vite__mapDeps([112,113,114,22,81,24,2,25,26,27,3,89,90,49,83,31,1,40,41,44,48,50,29,84,85,54,39,77,8,115,9,62,20,63,16,66,67,70,116,38,78,82,65,7,86,79,117,94,34,35,36,11,37,13,5,118,93,87,88,111,119,120,80]),import.meta.url))},{id:"v",name:"V",import:(()=>A(()=>import("./v-BGw2Nkan.js"),[],import.meta.url))},{id:"vala",name:"Vala",import:(()=>A(()=>import("./vala-CsfeWuGM.js"),[],import.meta.url))},{id:"vb",name:"Visual Basic",import:(()=>A(()=>import("./vb-Cu-pLBUe.js"),[],import.meta.url))},{id:"verilog",name:"Verilog",import:(()=>A(()=>import("./verilog-nZwndyjY.js"),[],import.meta.url))},{id:"vhdl",name:"VHDL",import:(()=>A(()=>import("./vhdl-CeAyd5Ju.js"),[],import.meta.url))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>A(()=>import("./viml-CJc9bBzg.js"),[],import.meta.url))},{id:"vue",name:"Vue",import:(()=>A(()=>import("./vue-BqiEGhQt.js"),__vite__mapDeps([121,3,2,11,9,1,15]),import.meta.url))},{id:"vue-html",name:"Vue HTML",import:(()=>A(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([122,2]),import.meta.url))},{id:"vue-vine",name:"Vue Vine",import:(()=>A(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([123,3,5,70,124,12,2]),import.meta.url))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>A(()=>import("./vyper-CDx5xZoG.js"),[],import.meta.url))},{id:"wasm",name:"WebAssembly",import:(()=>A(()=>import("./wasm-MzD3tlZU.js"),[],import.meta.url))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>A(()=>import("./wenyan-BV7otONQ.js"),[],import.meta.url))},{id:"wgsl",name:"WGSL",import:(()=>A(()=>import("./wgsl-Dx-B1_4e.js"),[],import.meta.url))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>A(()=>import("./wikitext-BhOHFoWU.js"),[],import.meta.url))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>A(()=>import("./wit-5i3qLPDT.js"),[],import.meta.url))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>A(()=>import("./wolfram-lXgVvXCa.js"),[],import.meta.url))},{id:"xml",name:"XML",import:(()=>A(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8]),import.meta.url))},{id:"xsl",name:"XSL",import:(()=>A(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([93,7,8]),import.meta.url))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>A(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url))},{id:"zenscript",name:"ZenScript",import:(()=>A(()=>import("./zenscript-DVFEvuxE.js"),[],import.meta.url))},{id:"zig",name:"Zig",import:(()=>A(()=>import("./zig-VOosw3JB.js"),[],import.meta.url))}],w6=Object.fromEntries(Hk.map(e=>[e.id,e.import])),E6=Object.fromEntries(Hk.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),vg={...w6,...E6},k6=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>A(()=>import("./andromeeda-C4gqWexZ.js"),[],import.meta.url))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>A(()=>import("./aurora-x-D-2ljcwZ.js"),[],import.meta.url))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>A(()=>import("./ayu-dark-DYE7WIF3.js"),[],import.meta.url))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>A(()=>import("./ayu-light-BA47KaF1.js"),[],import.meta.url))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>A(()=>import("./ayu-mirage-32ctXXKs.js"),[],import.meta.url))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>A(()=>import("./catppuccin-frappe-CZL1YF0i.js"),[],import.meta.url))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>A(()=>import("./catppuccin-latte-DH-8KZSZ.js"),[],import.meta.url))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>A(()=>import("./catppuccin-macchiato-B7yYVSCf.js"),[],import.meta.url))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>A(()=>import("./catppuccin-mocha-Ct7hS0mc.js"),[],import.meta.url))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>A(()=>import("./dark-plus-C3mMm8J8.js"),[],import.meta.url))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>A(()=>import("./dracula-BzJJZx-M.js"),[],import.meta.url))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>A(()=>import("./dracula-soft-BXkSAIEj.js"),[],import.meta.url))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>A(()=>import("./everforest-dark-BgDCqdQA.js"),[],import.meta.url))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>A(()=>import("./everforest-light-C8M2exoo.js"),[],import.meta.url))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>A(()=>import("./github-dark-DHJKELXO.js"),[],import.meta.url))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>A(()=>import("./github-dark-default-Cuk6v7N8.js"),[],import.meta.url))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>A(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[],import.meta.url))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>A(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[],import.meta.url))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>A(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>A(()=>import("./github-light-default-D7oLnXFd.js"),[],import.meta.url))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>A(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[],import.meta.url))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>A(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[],import.meta.url))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>A(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[],import.meta.url))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>A(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[],import.meta.url))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>A(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[],import.meta.url))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>A(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[],import.meta.url))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>A(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[],import.meta.url))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>A(()=>import("./horizon-BUw7H-hv.js"),[],import.meta.url))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>A(()=>import("./horizon-bright-CUuTKBJd.js"),[],import.meta.url))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>A(()=>import("./houston-DnULxvSX.js"),[],import.meta.url))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>A(()=>import("./kanagawa-dragon-BuwD2xS4.js"),[],import.meta.url))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>A(()=>import("./kanagawa-lotus-C3DzagqV.js"),[],import.meta.url))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>A(()=>import("./kanagawa-wave-DFGoQZhC.js"),[],import.meta.url))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>A(()=>import("./laserwave-DUszq2jm.js"),[],import.meta.url))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>A(()=>import("./light-plus-B7mTdjB0.js"),[],import.meta.url))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>A(()=>import("./material-theme-D5KoaKCx.js"),[],import.meta.url))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>A(()=>import("./material-theme-darker-BfHTSMKl.js"),[],import.meta.url))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>A(()=>import("./material-theme-lighter-B0m2ddpp.js"),[],import.meta.url))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>A(()=>import("./material-theme-ocean-CyktbL80.js"),[],import.meta.url))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>A(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[],import.meta.url))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>A(()=>import("./min-dark-CafNBF8u.js"),[],import.meta.url))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>A(()=>import("./min-light-CTRr51gU.js"),[],import.meta.url))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>A(()=>import("./monokai-BRVnQi9A.js"),[],import.meta.url))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>A(()=>import("./night-owl-C39BiMTA.js"),[],import.meta.url))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>A(()=>import("./night-owl-light-CMTm3GFP.js"),[],import.meta.url))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>A(()=>import("./nord-Ddv68eIx.js"),[],import.meta.url))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>A(()=>import("./one-dark-pro-DVMEJ2y_.js"),[],import.meta.url))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>A(()=>import("./one-light-C3Wv6jpd.js"),[],import.meta.url))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>A(()=>import("./plastic-3e1v2bzS.js"),[],import.meta.url))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>A(()=>import("./poimandres-CS3Unz2-.js"),[],import.meta.url))},{id:"red",displayName:"Red",type:"dark",import:(()=>A(()=>import("./red-hvxz__6c.js"),[],import.meta.url))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>A(()=>import("./rose-pine-5qJOZa0Y.js"),[],import.meta.url))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>A(()=>import("./rose-pine-dawn-zx0QlTCp.js"),[],import.meta.url))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>A(()=>import("./rose-pine-moon-C9pEdX9L.js"),[],import.meta.url))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>A(()=>import("./slack-dark-BthQWCQV.js"),[],import.meta.url))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>A(()=>import("./slack-ochin-DqwNpetd.js"),[],import.meta.url))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>A(()=>import("./snazzy-light-Bw305WKR.js"),[],import.meta.url))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>A(()=>import("./solarized-dark-CpvCGNkr.js"),[],import.meta.url))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>A(()=>import("./solarized-light-Dlz6yCKv.js"),[],import.meta.url))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>A(()=>import("./synthwave-84-CbfX1IO0.js"),[],import.meta.url))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>A(()=>import("./tokyo-night-hegEt444.js"),[],import.meta.url))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>A(()=>import("./vesper-DRje8inN.js"),[],import.meta.url))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>A(()=>import("./vitesse-black-Bkuqu6BP.js"),[],import.meta.url))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>A(()=>import("./vitesse-dark-D0r3Knsf.js"),[],import.meta.url))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>A(()=>import("./vitesse-light-CVO1_9PV.js"),[],import.meta.url))}],T6=Object.fromEntries(k6.map(e=>[e.id,e.import]));var Vy=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function A6(){return 2147483648}function L6(){return typeof performance<"u"?performance.now():Date.now()}const R6=(e,t)=>e+(t-e%t)%t;async function O6(e){let t,n;const i={};function o(v){n=v,i.HEAPU8=new Uint8Array(v),i.HEAPU32=new Uint32Array(v)}function s(v,x,S){i.HEAPU8.copyWithin(v,x,x+S)}function l(v){try{return t.grow(v-n.byteLength+65535>>>16),o(t.buffer),1}catch{}}function c(v){const x=i.HEAPU8.length;v=v>>>0;const S=A6();if(v>S)return!1;for(let w=1;w<=4;w*=2){let _=x*(1+.2/w);_=Math.min(_,v+100663296);const C=Math.min(S,R6(Math.max(v,_),65536));if(l(C))return!0}return!1}const d=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function f(v,x,S=1024){const w=x+S;let _=x;for(;v[_]&&!(_>=w);)++_;if(_-x>16&&v.buffer&&d)return d.decode(v.subarray(x,_));let C="";for(;x<_;){let T=v[x++];if(!(T&128)){C+=String.fromCharCode(T);continue}const D=v[x++]&63;if((T&224)===192){C+=String.fromCharCode((T&31)<<6|D);continue}const I=v[x++]&63;if((T&240)===224?T=(T&15)<<12|D<<6|I:T=(T&7)<<18|D<<12|I<<6|v[x++]&63,T<65536)C+=String.fromCharCode(T);else{const O=T-65536;C+=String.fromCharCode(55296|O>>10,56320|O&1023)}}return C}function p(v,x){return v?f(i.HEAPU8,v,x):""}const m={emscripten_get_now:L6,emscripten_memcpy_big:s,emscripten_resize_heap:c,fd_write:()=>0};async function g(){const x=await e({env:m,wasi_snapshot_preview1:m});t=x.memory,o(t.buffer),Object.assign(i,x),i.UTF8ToString=p}return await g(),i}var D6=Object.defineProperty,M6=(e,t,n)=>t in e?D6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rt=(e,t,n)=>M6(e,typeof t!="symbol"?t+"":t,n);let Nt=null;function I6(e){throw new Vy(e.UTF8ToString(e.getLastOnigError()))}class nf{constructor(t){Rt(this,"utf16Length"),Rt(this,"utf8Length"),Rt(this,"utf16Value"),Rt(this,"utf8Value"),Rt(this,"utf16OffsetToUtf8"),Rt(this,"utf8OffsetToUtf16");const n=t.length,i=nf._utf8ByteLength(t),o=i!==n,s=o?new Uint32Array(n+1):null;o&&(s[n]=i);const l=o?new Uint32Array(i+1):null;o&&(l[i]=n);const c=new Uint8Array(i);let d=0;for(let f=0;f<n;f++){const p=t.charCodeAt(f);let m=p,g=!1;if(p>=55296&&p<=56319&&f+1<n){const v=t.charCodeAt(f+1);v>=56320&&v<=57343&&(m=(p-55296<<10)+65536|v-56320,g=!0)}o&&(s[f]=d,g&&(s[f+1]=d),m<=127?l[d+0]=f:m<=2047?(l[d+0]=f,l[d+1]=f):m<=65535?(l[d+0]=f,l[d+1]=f,l[d+2]=f):(l[d+0]=f,l[d+1]=f,l[d+2]=f,l[d+3]=f)),m<=127?c[d++]=m:m<=2047?(c[d++]=192|(m&1984)>>>6,c[d++]=128|(m&63)>>>0):m<=65535?(c[d++]=224|(m&61440)>>>12,c[d++]=128|(m&4032)>>>6,c[d++]=128|(m&63)>>>0):(c[d++]=240|(m&1835008)>>>18,c[d++]=128|(m&258048)>>>12,c[d++]=128|(m&4032)>>>6,c[d++]=128|(m&63)>>>0),g&&f++}this.utf16Length=n,this.utf8Length=i,this.utf16Value=t,this.utf8Value=c,this.utf16OffsetToUtf8=s,this.utf8OffsetToUtf16=l}static _utf8ByteLength(t){let n=0;for(let i=0,o=t.length;i<o;i++){const s=t.charCodeAt(i);let l=s,c=!1;if(s>=55296&&s<=56319&&i+1<o){const d=t.charCodeAt(i+1);d>=56320&&d<=57343&&(l=(s-55296<<10)+65536|d-56320,c=!0)}l<=127?n+=1:l<=2047?n+=2:l<=65535?n+=3:n+=4,c&&i++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const rf=class ci{constructor(t){if(Rt(this,"id",++ci.LAST_ID),Rt(this,"_onigBinding"),Rt(this,"content"),Rt(this,"utf16Length"),Rt(this,"utf8Length"),Rt(this,"utf16OffsetToUtf8"),Rt(this,"utf8OffsetToUtf16"),Rt(this,"ptr"),!Nt)throw new Vy("Must invoke loadWasm first.");this._onigBinding=Nt,this.content=t;const n=new nf(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!ci._sharedPtrInUse?(ci._sharedPtr||(ci._sharedPtr=Nt.omalloc(1e4)),ci._sharedPtrInUse=!0,Nt.HEAPU8.set(n.utf8Value,ci._sharedPtr),this.ptr=ci._sharedPtr):this.ptr=n.createString(Nt)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===ci._sharedPtr?ci._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Rt(rf,"LAST_ID",0);Rt(rf,"_sharedPtr",0);Rt(rf,"_sharedPtrInUse",!1);let jk=rf;class N6{constructor(t){if(Rt(this,"_onigBinding"),Rt(this,"_ptr"),!Nt)throw new Vy("Must invoke loadWasm first.");const n=[],i=[];for(let c=0,d=t.length;c<d;c++){const f=new nf(t[c]);n[c]=f.createString(Nt),i[c]=f.utf8Length}const o=Nt.omalloc(4*t.length);Nt.HEAPU32.set(n,o/4);const s=Nt.omalloc(4*t.length);Nt.HEAPU32.set(i,s/4);const l=Nt.createOnigScanner(o,s,t.length);for(let c=0,d=t.length;c<d;c++)Nt.ofree(n[c]);Nt.ofree(s),Nt.ofree(o),l===0&&I6(Nt),this._onigBinding=Nt,this._ptr=l}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,i){let o=0;if(typeof i=="number"&&(o=i),typeof t=="string"){t=new jk(t);const s=this._findNextMatchSync(t,n,!1,o);return t.dispose(),s}return this._findNextMatchSync(t,n,!1,o)}_findNextMatchSync(t,n,i,o){const s=this._onigBinding,l=s.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),o);if(l===0)return null;const c=s.HEAPU32;let d=l/4;const f=c[d++],p=c[d++],m=[];for(let g=0;g<p;g++){const v=t.convertUtf8OffsetToUtf16(c[d++]),x=t.convertUtf8OffsetToUtf16(c[d++]);m[g]={start:v,end:x,length:x-v}}return{index:f,captureIndices:m}}}function z6(e){return typeof e.instantiator=="function"}function P6(e){return typeof e.default=="function"}function H6(e){return typeof e.data<"u"}function j6(e){return typeof Response<"u"&&e instanceof Response}function B6(e){return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let Tc;function Bk(e){if(Tc)return Tc;async function t(){Nt=await O6(async n=>{let i=e;return i=await i,typeof i=="function"&&(i=await i(n)),typeof i=="function"&&(i=await i(n)),z6(i)?i=await i.instantiator(n):P6(i)?i=await i.default(n):(H6(i)&&(i=i.data),j6(i)?typeof WebAssembly.instantiateStreaming=="function"?i=await U6(i)(n):i=await V6(i)(n):B6(i)?i=await um(i)(n):i instanceof WebAssembly.Module?i=await um(i)(n):"default"in i&&i.default instanceof WebAssembly.Module&&(i=await um(i.default)(n))),"instance"in i&&(i=i.instance),"exports"in i&&(i=i.exports),i})}return Tc=t(),Tc}function um(e){return t=>WebAssembly.instantiate(e,t)}function U6(e){return t=>WebAssembly.instantiateStreaming(e,t)}function V6(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let Uk;function F6(e){Uk=e}function G6(){return Uk}async function Vk(e){return e&&await Bk(e),{createScanner(t){return new N6(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new jk(t)}}}const $6=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:Vk,getDefaultWasmLoader:G6,loadWasm:Bk,setDefaultWasmLoader:F6},Symbol.toStringTag,{value:"Module"}));var Fk=b6({});S6(Fk,$6);var at=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function q6(e){return Fy(e)}function Fy(e){return Array.isArray(e)?W6(e):e instanceof RegExp?e:typeof e=="object"?Y6(e):e}function W6(e){let t=[];for(let n=0,i=e.length;n<i;n++)t[n]=Fy(e[n]);return t}function Y6(e){let t={};for(let n in e)t[n]=Fy(e[n]);return t}function Gk(e,...t){return t.forEach(n=>{for(let i in n)e[i]=n[i]}),e}function $k(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?$k(e.substring(0,e.length-1)):e.substr(~t+1)}var cm=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Ac=class{static hasCaptures(e){return e===null?!1:(cm.lastIndex=0,cm.test(e))}static replaceCaptures(e,t,n){return e.replace(cm,(i,o,s,l)=>{let c=n[parseInt(o||s,10)];if(c){let d=t.substring(c.start,c.end);for(;d[0]===".";)d=d.substring(1);switch(l){case"downcase":return d.toLowerCase();case"upcase":return d.toUpperCase();default:return d}}else return i})}};function qk(e,t){return e<t?-1:e>t?1:0}function Wk(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 s=qk(e[o],t[o]);if(s!==0)return s}return 0}return n-i}function sC(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 Yk(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Xk=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}},Cd=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Q6(e),t)}static createFromParsedTheme(e,t){return J6(e,t)}_cachedMatchRoot=new Xk(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=>X6(e.parent,o.parentScopes));return i?new Kk(i.fontStyle,i.foreground,i.background):null}},dm=class td{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const i of n)t=new td(t,i);return t}static from(...t){let n=null;for(let i=0;i<t.length;i++)n=new td(n,t[i]);return n}push(t){return new td(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 X6(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&&!K6(e.scopeName,i);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function K6(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Kk=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Q6(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],i=0;for(let o=0,s=t.length;o<s;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 d=-1;if(typeof l.settings.fontStyle=="string"){d=0;let m=l.settings.fontStyle.split(" ");for(let g=0,v=m.length;g<v;g++)switch(m[g]){case"italic":d=d|1;break;case"bold":d=d|2;break;case"underline":d=d|4;break;case"strikethrough":d=d|8;break}}let f=null;typeof l.settings.foreground=="string"&&sC(l.settings.foreground)&&(f=l.settings.foreground);let p=null;typeof l.settings.background=="string"&&sC(l.settings.background)&&(p=l.settings.background);for(let m=0,g=c.length;m<g;m++){let x=c[m].trim().split(" "),S=x[x.length-1],w=null;x.length>1&&(w=x.slice(0,x.length-1),w.reverse()),n[i++]=new Z6(S,w,o,d,f,p)}}return n}var Z6=class{constructor(e,t,n,i,o,s){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=i,this.foreground=o,this.background=s}},Wt=(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))(Wt||{});function J6(e,t){e.sort((d,f)=>{let p=qk(d.scope,f.scope);return p!==0||(p=Wk(d.parentScopes,f.parentScopes),p!==0)?p:d.index-f.index});let n=0,i="#000000",o="#ffffff";for(;e.length>=1&&e[0].scope==="";){let d=e.shift();d.fontStyle!==-1&&(n=d.fontStyle),d.foreground!==null&&(i=d.foreground),d.background!==null&&(o=d.background)}let s=new e3(t),l=new Kk(n,s.getId(i),s.getId(o)),c=new n3(new bg(0,null,-1,0,0),[]);for(let d=0,f=e.length;d<f;d++){let p=e[d];c.insert(0,p.scope,p.parentScopes,p.fontStyle,s.getId(p.foreground),s.getId(p.background))}return new Cd(s,l,c)}var e3=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)}},t3=Object.freeze([]),bg=class Qk{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,i,o,s){this.scopeDepth=t,this.parentScopes=n||t3,this.fontStyle=i,this.foreground=o,this.background=s}clone(){return new Qk(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)}},n3=class xg{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 s=n.parentScopes[o].length-t.parentScopes[i].length;if(s!==0)return s;i++,o++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let i=t.indexOf("."),o,s;if(i===-1?(o=t,s=""):(o=t.substring(0,i),s=t.substring(i+1)),this._children.hasOwnProperty(o))return this._children[o].match(s)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(xg._cmpBySpecificity),n}insert(t,n,i,o,s,l){if(n===""){this._doInsertHere(t,i,o,s,l);return}let c=n.indexOf("."),d,f;c===-1?(d=n,f=""):(d=n.substring(0,c),f=n.substring(c+1));let p;this._children.hasOwnProperty(d)?p=this._children[d]:(p=new xg(this._mainRule.clone(),bg.cloneArr(this._rulesWithParentScopes)),this._children[d]=p),p.insert(t+1,f,i,o,s,l)}_doInsertHere(t,n,i,o,s){if(n===null){this._mainRule.acceptOverwrite(t,i,o,s);return}for(let l=0,c=this._rulesWithParentScopes.length;l<c;l++){let d=this._rulesWithParentScopes[l];if(Wk(d.parentScopes,n)===0){d.acceptOverwrite(t,i,o,s);return}}i===-1&&(i=this._mainRule.fontStyle),o===0&&(o=this._mainRule.foreground),s===0&&(s=this._mainRule.background),this._rulesWithParentScopes.push(new bg(t,n,i,o,s))}},Ao=class Un{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=Un.getLanguageId(t),i=Un.getTokenType(t),o=Un.getFontStyle(t),s=Un.getForeground(t),l=Un.getBackground(t);console.log({languageId:n,tokenType:i,fontStyle:o,foreground:s,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,s,l,c){let d=Un.getLanguageId(t),f=Un.getTokenType(t),p=Un.containsBalancedBrackets(t)?1:0,m=Un.getFontStyle(t),g=Un.getForeground(t),v=Un.getBackground(t);return n!==0&&(d=n),i!==8&&(f=i),o!==null&&(p=o?1:0),s!==-1&&(m=s),l!==0&&(g=l),c!==0&&(v=c),(d<<0|f<<8|p<<10|m<<11|g<<15|v<<24)>>>0}};function wd(e,t){const n=[],i=i3(e);let o=i.next();for(;o!==null;){let d=0;if(o.length===2&&o.charAt(1)===":"){switch(o.charAt(0)){case"R":d=1;break;case"L":d=-1;break;default:console.log(`Unknown priority ${o} in scope selector`)}o=i.next()}let f=l();if(n.push({matcher:f,priority:d}),o!==",")break;o=i.next()}return n;function s(){if(o==="-"){o=i.next();const d=s();return f=>!!d&&!d(f)}if(o==="("){o=i.next();const d=c();return o===")"&&(o=i.next()),d}if(lC(o)){const d=[];do d.push(o),o=i.next();while(lC(o));return f=>t(d,f)}return null}function l(){const d=[];let f=s();for(;f;)d.push(f),f=s();return p=>d.every(m=>m(p))}function c(){const d=[];let f=l();for(;f&&(d.push(f),o==="|"||o===",");){do o=i.next();while(o==="|"||o===",");f=l()}return p=>d.some(m=>m(p))}}function lC(e){return!!e&&!!e.match(/[\w\.:]+/)}function i3(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 Zk(e){typeof e.dispose=="function"&&e.dispose()}var kl=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},r3=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},o3=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))}},a3=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new kl(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new o3;for(const n of e)s3(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof kl){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 s3(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 s=n.lookup(t);e instanceof kl?nd({baseGrammar:s,selfGrammar:o},i):Sg(e.ruleName,{baseGrammar:s,selfGrammar:o,repository:o.repository},i);const l=n.injections(e.scopeName);if(l)for(const c of l)i.add(new kl(c))}function Sg(e,t,n){if(t.repository&&t.repository[e]){const i=t.repository[e];Ed([i],t,n)}}function nd(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Ed(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Ed(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Ed(e,t,n){for(const i of e){if(n.visitedRule.has(i))continue;n.visitedRule.add(i);const o=i.repository?Gk({},t.repository,i.repository):t.repository;Array.isArray(i.patterns)&&Ed(i.patterns,{...t,repository:o},n);const s=i.include;if(!s)continue;const l=Jk(s);switch(l.kind){case 0:nd({...t,selfGrammar:t.baseGrammar},n);break;case 1:nd(t,n);break;case 2:Sg(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 d={baseGrammar:t.baseGrammar,selfGrammar:c,repository:o};l.kind===4?Sg(l.ruleName,d,n):nd(d,n)}else l.kind===4?n.add(new r3(l.scopeName,l.ruleName)):n.add(new kl(l.scopeName));break}}}var l3=class{kind=0},u3=class{kind=1},c3=class{constructor(e){this.ruleName=e}kind=2},d3=class{constructor(e){this.scopeName=e}kind=3},f3=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Jk(e){if(e==="$base")return new l3;if(e==="$self")return new u3;const t=e.indexOf("#");if(t===-1)return new d3(e);if(t===0)return new c3(e.substring(1));{const n=e.substring(0,t),i=e.substring(t+1);return new f3(n,i)}}var h3=/\\(\d+)/,uC=/\\(\d+)/g,p3=-1,eT=-2;var $l=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,i){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Ac.hasCaptures(this._name),this._contentName=i||null,this._contentNameIsCapturing=Ac.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${$k(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:Ac.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Ac.replaceCaptures(this._contentName,e,t)}},m3=class extends $l{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!")}},g3=class extends $l{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,i,o){super(e,t,n,null),this._match=new Tl(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 Al,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},cC=class extends $l{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 Al,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},_g=class extends $l{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,o,s,l,c,d,f){super(e,t,n,i),this._begin=new Tl(o,this.id),this.beginCaptures=s,this._end=new Tl(l||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=c,this.applyEndPatternLast=d||!1,this.patterns=f.patterns,this.hasMissingPatterns=f.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 Al;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}},kd=class extends $l{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,i,o,s,l,c,d){super(e,t,n,i),this._begin=new Tl(o,this.id),this.beginCaptures=s,this.whileCaptures=c,this._while=new Tl(l,eT),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=d.patterns,this.hasMissingPatterns=d.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 Al;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 Al,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},tT=class $t{static createCaptureRule(t,n,i,o,s){return t.registerRule(l=>new m3(n,l,i,o,s))}static getCompiledRuleId(t,n,i){return t.id||n.registerRule(o=>{if(t.id=o,t.match)return new g3(t.$vscodeTextmateLocation,t.id,t.name,t.match,$t._compileCaptures(t.captures,n,i));if(typeof t.begin>"u"){t.repository&&(i=Gk({},i,t.repository));let s=t.patterns;return typeof s>"u"&&t.include&&(s=[{include:t.include}]),new cC(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,$t._compilePatterns(s,n,i))}return t.while?new kd(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,$t._compileCaptures(t.beginCaptures||t.captures,n,i),t.while,$t._compileCaptures(t.whileCaptures||t.captures,n,i),$t._compilePatterns(t.patterns,n,i)):new _g(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,$t._compileCaptures(t.beginCaptures||t.captures,n,i),t.end,$t._compileCaptures(t.endCaptures||t.captures,n,i),t.applyEndPatternLast,$t._compilePatterns(t.patterns,n,i))}),t.id}static _compileCaptures(t,n,i){let o=[];if(t){let s=0;for(const l in t){if(l==="$vscodeTextmateLocation")continue;const c=parseInt(l,10);c>s&&(s=c)}for(let l=0;l<=s;l++)o[l]=null;for(const l in t){if(l==="$vscodeTextmateLocation")continue;const c=parseInt(l,10);let d=0;t[l].patterns&&(d=$t.getCompiledRuleId(t[l],n,i)),o[c]=$t.createCaptureRule(n,t[l].$vscodeTextmateLocation,t[l].name,t[l].contentName,d)}}return o}static _compilePatterns(t,n,i){let o=[];if(t)for(let s=0,l=t.length;s<l;s++){const c=t[s];let d=-1;if(c.include){const f=Jk(c.include);switch(f.kind){case 0:case 1:d=$t.getCompiledRuleId(i[c.include],n,i);break;case 2:let p=i[f.ruleName];p&&(d=$t.getCompiledRuleId(p,n,i));break;case 3:case 4:const m=f.scopeName,g=f.kind===4?f.ruleName:null,v=n.getExternalGrammar(m,i);if(v)if(g){let x=v.repository[g];x&&(d=$t.getCompiledRuleId(x,n,v.repository))}else d=$t.getCompiledRuleId(v.repository.$self,n,v.repository);break}}else d=$t.getCompiledRuleId(c,n,i);if(d!==-1){const f=n.getRule(d);let p=!1;if((f instanceof cC||f instanceof _g||f instanceof kd)&&f.hasMissingPatterns&&f.patterns.length===0&&(p=!0),p)continue;o.push(d)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}}},Tl=class nT{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const i=t.length;let o=0,s=[],l=!1;for(let c=0;c<i;c++)if(t.charAt(c)==="\\"&&c+1<i){const f=t.charAt(c+1);f==="z"?(s.push(t.substring(o,c)),s.push("$(?!\\n)(?<!\\n)"),o=c+2):(f==="A"||f==="G")&&(l=!0),c++}this.hasAnchor=l,o===0?this.source=t:(s.push(t.substring(o,i)),this.source=s.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=h3.test(this.source):this.hasBackReferences=!1}clone(){return new nT(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 uC.lastIndex=0,this.source.replace(uC,(o,s)=>Yk(i[parseInt(s,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=[],s,l,c,d;for(s=0,l=this.source.length;s<l;s++)c=this.source.charAt(s),t[s]=c,n[s]=c,i[s]=c,o[s]=c,c==="\\"&&s+1<l&&(d=this.source.charAt(s+1),d==="A"?(t[s+1]="",n[s+1]="",i[s+1]="A",o[s+1]="A"):d==="G"?(t[s+1]="",n[s+1]="G",i[s+1]="",o[s+1]="G"):(t[s+1]=d,n[s+1]=d,i[s+1]=d,o[s+1]=d),s++);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}},Al=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 dC(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 dC(e,i,this._items.map(o=>o.ruleId))}},dC=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(`
|
|
56
|
+
`)}findNextMatchSync(e,t,n){const i=this.scanner.findNextMatchSync(e,t,n);return i?{ruleId:this.rules[i.index],captureIndices:i.captureIndices}:null}},fm=class{constructor(e,t){this.languageId=e,this.tokenType=t}},y3=class Cg{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new fm(t,8),this._embeddedLanguagesMatcher=new v3(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Cg._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new fm(0,0);_getBasicScopeAttributes=new Xk(t=>{const n=this._scopeToLanguage(t),i=this._toStandardTokenType(t);return new fm(n,i)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Cg.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/},v3=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])=>Yk(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])}},fC=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function iT(e,t,n,i,o,s,l,c){const d=t.content.length;let f=!1,p=-1;if(l){const v=b3(e,t,n,i,o,s);o=v.stack,i=v.linePos,n=v.isFirstLine,p=v.anchorPosition}const m=Date.now();for(;!f;){if(c!==0&&Date.now()-m>c)return new fC(o,!0);g()}return new fC(o,!1);function g(){const v=x3(e,t,n,i,o,p);if(!v){s.produce(o,d),f=!0;return}const x=v.captureIndices,S=v.matchedRuleId,w=x&&x.length>0?x[0].end>i:!1;if(S===p3){const _=o.getRule(e);s.produce(o,x[0].start),o=o.withContentNameScopesList(o.nameScopesList),ll(e,t,n,o,s,_.endCaptures,x),s.produce(o,x[0].end);const C=o;if(o=o.parent,p=C.getAnchorPos(),!w&&C.getEnterPos()===i){o=C,s.produce(o,d),f=!0;return}}else{const _=e.getRule(S);s.produce(o,x[0].start);const C=o,T=_.getName(t.content,x),D=o.contentNameScopesList.pushAttributed(T,e);if(o=o.push(S,i,p,x[0].end===d,null,D,D),_ instanceof _g){const I=_;ll(e,t,n,o,s,I.beginCaptures,x),s.produce(o,x[0].end),p=x[0].end;const O=I.getContentName(t.content,x),P=D.pushAttributed(O,e);if(o=o.withContentNameScopesList(P),I.endHasBackReferences&&(o=o.withEndRule(I.getEndWithResolvedBackReferences(t.content,x))),!w&&C.hasSameRuleAs(o)){o=o.pop(),s.produce(o,d),f=!0;return}}else if(_ instanceof kd){const I=_;ll(e,t,n,o,s,I.beginCaptures,x),s.produce(o,x[0].end),p=x[0].end;const O=I.getContentName(t.content,x),P=D.pushAttributed(O,e);if(o=o.withContentNameScopesList(P),I.whileHasBackReferences&&(o=o.withEndRule(I.getWhileWithResolvedBackReferences(t.content,x))),!w&&C.hasSameRuleAs(o)){o=o.pop(),s.produce(o,d),f=!0;return}}else if(ll(e,t,n,o,s,_.captures,x),s.produce(o,x[0].end),o=o.pop(),!w){o=o.safePop(),s.produce(o,d),f=!0;return}}x[0].end>i&&(i=x[0].end,n=!1)}}function b3(e,t,n,i,o,s){let l=o.beginRuleCapturedEOL?0:-1;const c=[];for(let d=o;d;d=d.pop()){const f=d.getRule(e);f instanceof kd&&c.push({rule:f,stack:d})}for(let d=c.pop();d;d=c.pop()){const{ruleScanner:f,findOptions:p}=C3(d.rule,e,d.stack.endRule,n,i===l),m=f.findNextMatchSync(t,i,p);if(m){if(m.ruleId!==eT){o=d.stack.pop();break}m.captureIndices&&m.captureIndices.length&&(s.produce(d.stack,m.captureIndices[0].start),ll(e,t,n,d.stack,s,d.rule.whileCaptures,m.captureIndices),s.produce(d.stack,m.captureIndices[0].end),l=m.captureIndices[0].end,m.captureIndices[0].end>i&&(i=m.captureIndices[0].end,n=!1))}else{o=d.stack.pop();break}}return{stack:o,linePos:i,anchorPosition:l,isFirstLine:n}}function x3(e,t,n,i,o,s){const l=S3(e,t,n,i,o,s),c=e.getInjections();if(c.length===0)return l;const d=_3(c,e,t,n,i,o,s);if(!d)return l;if(!l)return d;const f=l.captureIndices[0].start,p=d.captureIndices[0].start;return p<f||d.priorityMatch&&p===f?d:l}function S3(e,t,n,i,o,s){const l=o.getRule(e),{ruleScanner:c,findOptions:d}=rT(l,e,o.endRule,n,i===s),f=c.findNextMatchSync(t,i,d);return f?{captureIndices:f.captureIndices,matchedRuleId:f.ruleId}:null}function _3(e,t,n,i,o,s,l){let c=Number.MAX_VALUE,d=null,f,p=0;const m=s.contentNameScopesList.getScopeNames();for(let g=0,v=e.length;g<v;g++){const x=e[g];if(!x.matcher(m))continue;const S=t.getRule(x.ruleId),{ruleScanner:w,findOptions:_}=rT(S,t,null,i,o===l),C=w.findNextMatchSync(n,o,_);if(!C)continue;const T=C.captureIndices[0].start;if(!(T>=c)&&(c=T,d=C.captureIndices,f=C.ruleId,p=x.priority,c===o))break}return d?{priorityMatch:p===-1,captureIndices:d,matchedRuleId:f}:null}function rT(e,t,n,i,o){return{ruleScanner:e.compileAG(t,n,i,o),findOptions:0}}function C3(e,t,n,i,o){return{ruleScanner:e.compileWhileAG(t,n,i,o),findOptions:0}}function ll(e,t,n,i,o,s,l){if(s.length===0)return;const c=t.content,d=Math.min(s.length,l.length),f=[],p=l[0].end;for(let m=0;m<d;m++){const g=s[m];if(g===null)continue;const v=l[m];if(v.length===0)continue;if(v.start>p)break;for(;f.length>0&&f[f.length-1].endPos<=v.start;)o.produceFromScopes(f[f.length-1].scopes,f[f.length-1].endPos),f.pop();if(f.length>0?o.produceFromScopes(f[f.length-1].scopes,v.start):o.produce(i,v.start),g.retokenizeCapturedWithRuleId){const S=g.getName(c,l),w=i.contentNameScopesList.pushAttributed(S,e),_=g.getContentName(c,l),C=w.pushAttributed(_,e),T=i.push(g.retokenizeCapturedWithRuleId,v.start,-1,!1,null,w,C),D=e.createOnigString(c.substring(0,v.end));iT(e,D,n&&v.start===0,v.start,T,o,!1,0),Zk(D);continue}const x=g.getName(c,l);if(x!==null){const w=(f.length>0?f[f.length-1].scopes:i.contentNameScopesList).pushAttributed(x,e);f.push(new w3(w,v.end))}}for(;f.length>0;)o.produceFromScopes(f[f.length-1].scopes,f[f.length-1].endPos),f.pop()}var w3=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function E3(e,t,n,i,o,s,l,c){return new T3(e,t,n,i,o,s,l,c)}function hC(e,t,n,i,o){const s=wd(t,Td),l=tT.getCompiledRuleId(n,i,o.repository);for(const c of s)e.push({debugSelector:t,matcher:c.matcher,ruleId:l,grammar:o,priority:c.priority})}function Td(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(k3(t[o],i))return n=o+1,!0;return!1})}function k3(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 T3=class{constructor(e,t,n,i,o,s,l,c){if(this._rootScopeName=e,this.balancedBracketSelectors=s,this._onigLib=c,this._basicScopeAttributesProvider=new y3(n,i),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=l,this._grammar=pC(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const d of Object.keys(o)){const f=wd(d,Td);for(const p of f)this._tokenTypeMatchers.push({matcher:p.matcher,type:o[d]})}}_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)hC(t,l,o[l],this,i);const s=this._grammarRepository.injections(n);s&&s.forEach(l=>{const c=this.getExternalGrammar(l);if(c){const d=c.injectionSelector;d&&hC(t,d,c,this,c)}})}return t.sort((o,s)=>o.priority-s.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]=pC(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=tT.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!t||t===wg.NULL){o=!0;const f=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),m=Ao.set(0,f.languageId,f.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),g=this.getRule(this._rootId).getName(null,null);let v;g?v=yl.createRootAndLookUpScopeName(g,m,this):v=yl.createRoot("unknown",m),t=new wg(null,this._rootId,-1,-1,!1,null,v,v)}else o=!1,t.reset();e=e+`
|
|
57
|
+
`;const s=this.createOnigString(e),l=s.content.length,c=new L3(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),d=iT(this,s,o,0,t,c,!0,i);return Zk(s),{lineLength:l,lineTokens:c,ruleStack:d.stack,stoppedEarly:d.stoppedEarly}}};function pC(e,t){return e=q6(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 yl=class di{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 s of n)o=dm.push(o,s.scopeNames),i=new di(i,o,s.encodedTokenAttributes);return i}static createRoot(t,n){return new di(null,new dm(null,t),n)}static createRootAndLookUpScopeName(t,n,i){const o=i.getMetadataForScope(t),s=new dm(null,t),l=i.themeProvider.themeMatch(s),c=di.mergeAttributes(n,o,l);return new di(null,s,c)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return di.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,s=0,l=0;return i!==null&&(o=i.fontStyle,s=i.foregroundId,l=i.backgroundId),Ao.set(t,n.languageId,n.tokenType,null,o,s,l)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return di._pushAttributed(this,t,n);const i=t.split(/ /g);let o=this;for(const s of i)o=di._pushAttributed(o,s,n);return o}static _pushAttributed(t,n,i){const o=i.getMetadataForScope(n),s=t.scopePath.push(n),l=i.themeProvider.themeMatch(s),c=di.mergeAttributes(t.tokenAttributes,o,l);return new di(t,s,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}},wg=class xo{constructor(t,n,i,o,s,l,c,d){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=s,this.endRule=l,this.nameScopesList=c,this.contentNameScopesList=d,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=i,this._anchorPos=o}_stackElementBrand=void 0;static NULL=new xo(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:xo._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?yl.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(){xo._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,i,o,s,l,c){return new xo(this,t,n,i,o,s,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 xo(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=yl.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new xo(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,i,yl.fromExtension(i,n.contentNameScopesList))}},A3=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):wd(n,Td).map(i=>i.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>wd(n,Td).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}},L3=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 s=e?.getScopeNames()??[];for(const l of this._tokenTypeOverrides)l.matcher(s)&&(i=Ao.set(i,0,l.type,null,-1,0,0));this.balancedBracketSelectors&&(o=this.balancedBracketSelectors.match(s))}if(o&&(i=Ao.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}},R3=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 s=this._rawGrammars.get(e);if(!s)return null;this._grammars.set(e,E3(e,s,t,n,i,o,this,this._onigLib))}return this._grammars.get(e)}},O3=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new R3(Cd.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(Cd.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 A3(i.balancedBracketSelectors||[],i.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,i,o,s){const l=new a3(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,s)}_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,s=null){return this._syncRegistry.grammarForScopeName(t,n,i,o,s)}},Eg=wg.NULL;function Ad(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},i=typeof e=="string"?e:e.name;for(const[o,s]of Object.entries(t?.colorReplacements||{}))typeof s=="string"?n[o]=s:o===i&&Object.assign(n,s);return n}function Fr(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function D3(e){return Array.isArray(e)?e:[e]}async function oT(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function of(e){return!e||["plaintext","txt","text","plain"].includes(e)}function aT(e){return e==="ansi"||of(e)}function af(e){return e==="none"}function sT(e){return af(e)}const M3=/(\r?\n)/g;function sf(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(M3);let i=0;const o=[];for(let s=0;s<n.length;s+=2){const l=t?n[s]+(n[s+1]||""):n[s];o.push([l,i]),i+=n[s].length,i+=n[s+1]?.length||0}return o}const mC={light:"#333333",dark:"#bbbbbb"},gC={light:"#fffffe",dark:"#1e1e1e"},yC="__shiki_resolved";function lf(e){if(e?.[yC])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(d=>!d.name&&!d.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"?mC.light:mC.dark),n||(n=t.type==="light"?gC.light:gC.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 s=new Map;function l(c){if(s.has(c))return s.get(c);o+=1;const d=`#${o.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${d}`]?l(c):(s.set(c,d),d)}t.settings=t.settings.map(c=>{const d=c.settings?.foreground&&!c.settings.foreground.startsWith("#"),f=c.settings?.background&&!c.settings.background.startsWith("#");if(!d&&!f)return c;const p={...c,settings:{...c.settings}};if(d){const m=l(c.settings.foreground);t.colorReplacements[m]=c.settings.foreground,p.settings.foreground=m}if(f){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 d=l(t.colors[c]);t.colorReplacements[d]=t.colors[c],t.colors[c]=d}return Object.defineProperty(t,yC,{enumerable:!1,writable:!1,value:!0}),t}async function lT(e){return[...new Set((await Promise.all(e.filter(t=>!aT(t)).map(async t=>await oT(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function uT(e){return(await Promise.all(e.map(async t=>sT(t)?null:lf(await oT(t))))).filter(t=>!!t)}function cT(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 at(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var I3=class extends O3{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,i={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=i,this._themes.map(o=>this.loadTheme(o)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=lf(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Cd.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=cT(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(o=>o.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const i=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(i.name=e.name,this._resolvedGrammars.set(e.name,i),e.aliases&&e.aliases.forEach(o=>{this._alias[o]=e.name}),this._loadedLanguagesCache=null,t.size)for(const o of t)this._resolvedGrammars.delete(o.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(o.scopeName),this._syncRegistry?._grammars?.delete(o.scopeName),this.loadLanguage(this._langMap.get(o.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const i of e)this.resolveEmbeddedLanguages(i);const t=[...this._langGraph.entries()],n=t.filter(([i,o])=>!o);if(n.length){const i=t.filter(([o,s])=>s?(s.embeddedLanguages||s.embeddedLangs)?.some(l=>n.map(([c])=>c).includes(l)):!1).filter(o=>!n.includes(o));throw new at(`Missing languages ${n.map(([o])=>`\`${o}\``).join(", ")}, required by ${i.map(([o])=>`\`${o}\``).join(", ")}`)}for(const[i,o]of t)this._resolver.addLanguage(o);for(const[i,o]of t)this.loadLanguage(o)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);const t=e.embeddedLanguages??e.embeddedLangs;if(t)for(const n of t)this._langGraph.set(n,this._langMap.get(n))}},N3=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},t.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let i=1;i<=t.length;i++){const o=t.slice(0,i).join(".");n=[...n,...this._injections.get(o)||[]]}return n}};let il=0;function z3(e){il+=1,e.warnings!==!1&&il>=10&&il%10===0&&console.warn(`[Shiki] ${il} 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 at("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),i=(e.themes||[]).flat(1).map(lf),o=new I3(new N3(e.engine,n),i,n,e.langAlias);let s;function l(C){return cT(C,e.langAlias)}function c(C){w();const T=o.getGrammar(typeof C=="string"?C:C.name);if(!T)throw new at(`Language \`${C}\` not found, you may need to load it first`);return T}function d(C){if(C==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};w();const T=o.getTheme(C);if(!T)throw new at(`Theme \`${C}\` not found, you may need to load it first`);return T}function f(C){w();const T=d(C);return s!==C&&(o.setTheme(T),s=C),{theme:T,colorMap:o.getColorMap()}}function p(){return w(),o.getLoadedThemes()}function m(){return w(),o.getLoadedLanguages()}function g(...C){w(),o.loadLanguages(C.flat(1))}async function v(...C){return g(await lT(C))}function x(...C){w();for(const T of C.flat(1))o.loadTheme(T)}async function S(...C){return w(),x(await uT(C))}function w(){if(t)throw new at("Shiki instance has been disposed")}function _(){t||(t=!0,o.dispose(),il-=1)}return{setTheme:f,getTheme:d,getLanguage:c,getLoadedThemes:p,getLoadedLanguages:m,resolveLangAlias:l,loadLanguage:v,loadLanguageSync:g,loadTheme:S,loadThemeSync:x,dispose:_,[Symbol.dispose]:_}}async function P3(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,i]=await Promise.all([uT(e.themes||[]),lT(e.langs||[]),e.engine]);return z3({...e,themes:t,langs:n,engine:i})}const dT=new WeakMap;function uf(e,t){dT.set(e,t)}function Ll(e){return dT.get(e)}var cf=class fT{_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 fT(Object.fromEntries(D3(n).map(i=>[i,Eg])),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 H3(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function H3(e){const t=[],n=new Set;function i(o){if(n.has(o))return;n.add(o);const s=o?.nameScopesList?.scopeName;s&&t.push(s),o.parent&&i(o.parent)}return i(e),t}function j3(e,t){if(!(e instanceof cf))throw new at("Invalid grammar state");return e.getInternalStack(t)}const B3=/,/,U3=/ /;function hT(e,t,n={}){const{theme:i=e.getLoadedThemes()[0]}=n;if(of(e.resolveLangAlias(n.lang||"text"))||af(i))return sf(t).map(c=>[{content:c[0],offset:c[1]}]);const{theme:o,colorMap:s}=e.setTheme(i),l=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==l.name)throw new at(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${l.name}"`);if(!n.grammarState.themes.includes(o.name))throw new at(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${o.name}"`)}return F3(t,l,o,s,n)}function V3(...e){if(e.length===2)return Ll(e[1]);const[t,n,i={}]=e,{lang:o="text",theme:s=t.getLoadedThemes()[0]}=i;if(of(o)||af(s))throw new at("Plain language does not have grammar state");if(o==="ansi")throw new at("ANSI language does not have grammar state");const{theme:l,colorMap:c}=t.setTheme(s),d=t.getLanguage(o);return new cf(Gy(n,d,l,c,i).stateStack,d.name,l.name)}function F3(e,t,n,i,o){const s=Gy(e,t,n,i,o),l=new cf(s.stateStack,t.name,n.name);return uf(s.tokens,l),s.tokens}function Gy(e,t,n,i,o){const s=Ad(n,o),{tokenizeMaxLineLength:l=0,tokenizeTimeLimit:c=500,includeExplanation:d=!1}=o,f=sf(e);let p=o.grammarState?j3(o.grammarState,n.name)??Eg:o.grammarContextCode!=null?Gy(o.grammarContextCode,t,n,i,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:Eg,m=[];const g=[];for(let v=0,x=f.length;v<x;v++){const[S,w]=f[v];if(S===""){m=[],g.push([]);continue}if(l>0&&S.length>=l){m=[],g.push([{content:S,offset:w,color:"",fontStyle:0}]);continue}let _,C,T;d&&d!=="tokenType"&&(_=t.tokenizeLine(S,p,c),C=_.tokens,T=0);const D=t.tokenizeLine2(S,p,c),I=D.tokens.length/2;for(let O=0;O<I;O++){const P=D.tokens[2*O],j=O+1<I?D.tokens[2*O+2]:S.length;if(P===j)continue;const F=D.tokens[2*O+1],Q=Fr(i[Ao.getForeground(F)],s),G=Ao.getFontStyle(F),B={content:S.substring(P,j),offset:w+P,color:Q,fontStyle:G};if(d==="tokenType")B.type=Ao.getTokenType(F);else if(d){const ee=[];if(d!=="scopeName")for(const W of n.settings){let z;switch(typeof W.scope){case"string":z=W.scope.split(B3).map(q=>q.trim());break;case"object":z=W.scope;break;default:continue}ee.push({settings:W,selectors:z.map(q=>q.split(U3))})}B.explanation=[];let Z=0;for(;P+Z<j;){const W=C[T],z=S.substring(W.startIndex,W.endIndex);Z+=z.length,B.explanation.push({content:z,scopes:d==="scopeName"?G3(W.scopes):$3(ee,W.scopes)}),T+=1}}m.push(B)}g.push(m),m=[],p=D.ruleStack}return{tokens:g,stateStack:p}}function G3(e){return e.map(t=>({scopeName:t}))}function $3(e,t){const n=[];for(let i=0,o=t.length;i<o;i++){const s=t[i];n[i]={scopeName:s,themeMatches:W3(e,s,t.slice(0,i))}}return n}function vC(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function q3(e,t,n){if(!vC(e.at(-1),t))return!1;let i=e.length-2,o=n.length-1;for(;i>=0&&o>=0;)vC(e[i],n[o])&&(i-=1),o-=1;return i===-1}function W3(e,t,n){const i=[];for(const{selectors:o,settings:s}of e)for(const l of o)if(q3(l,t,n)){i.push(s);break}return i}function pT(e,t,n,i=hT){const o=Object.entries(n.themes).filter(f=>f[1]).map(f=>({color:f[0],theme:f[1]})),s=o.map(f=>{const p=i(e,t,{...n,theme:f.theme});return{tokens:p,state:Ll(p),theme:typeof f.theme=="string"?f.theme:f.theme.name}}),l=Y3(...s.map(f=>f.tokens)),c=l[0].map((f,p)=>f.map((m,g)=>{const v={content:m.content,variants:{},offset:m.offset};return"includeExplanation"in n&&n.includeExplanation&&(v.explanation=m.explanation),l.forEach((x,S)=>{const{content:w,explanation:_,offset:C,...T}=x[p][g];v.variants[o[S].color]=T}),v})),d=s[0].state?new cf(Object.fromEntries(s.map(f=>[f.theme,f.state?.getInternalStack(f.theme)])),s[0].state.lang):void 0;return d&&uf(c,d),c}function Y3(...e){const t=e.map(()=>[]),n=e.length;for(let i=0;i<e[0].length;i++){const o=e.map(d=>d[i]),s=t.map(()=>[]);t.forEach((d,f)=>d.push(s[f]));const l=o.map(()=>0),c=o.map(d=>d[0]);for(;c.every(d=>d);){const d=Math.min(...c.map(f=>f.content.length));for(let f=0;f<n;f++){const p=c[f];p.content.length===d?(s[f].push(p),l[f]+=1,c[f]=o[f][l[f]]):(s[f].push({...p,content:p.content.slice(0,d)}),c[f]={...p,content:p.content.slice(d),offset:p.offset+d})}}}return t}const bC=/\s+/g;function mT(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(bC)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(bC);for(const i of n)i&&!e.properties.class.includes(i)&&e.properties.class.push(i);return e}function X3(e){const t=sf(e,!0).map(([o])=>o);function n(o){if(o===e.length)return{line:t.length-1,character:t.at(-1).length};let s=o,l=0;for(const c of t){if(s<c.length)break;s-=c.length,l++}return{line:l,character:s}}function i(o,s){let l=0;for(let c=0;c<o;c++)l+=t[c].length;return l+=s,l}return{lines:t,indexToPos:n,posToIndex:i}}const K3=["color","background-color"];function Q3(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 Z3(e,t){let n=0,i=e.length;for(;n<i;){const o=n+(i-n>>1);e[o]<=t?n=o+1:i=o}return n}function J3(e,t){const n=[...t instanceof Set?t:new Set(t)].sort((i,o)=>i-o);return n.length?e.map(i=>i.flatMap(o=>{const s=o.offset+o.content.length,l=Z3(n,o.offset);let c=l;for(;c<n.length&&n[c]<s;)c++;if(l===c)return o;const d=n.slice(l,c);for(let f=0;f<d.length;f++)d[f]-=o.offset;return Q3(o,d)})):e}function e4(e,t,n,i,o="css-vars"){const s={content:e.content,explanation:e.explanation,offset:e.offset},l=t.map(p=>Ld(e.variants[p])),c=new Set(l.flatMap(p=>Object.keys(p))),d={},f=(p,m)=>{const g=m==="color"?"":m==="background-color"?"-bg":`-${m}`;return n+t[p]+(m==="color"?"":g)};return l.forEach((p,m)=>{for(const g of c){const v=p[g]||"inherit";if(m===0&&i&&K3.includes(g))if(i==="light-dark()"&&l.length>1){const x=t.findIndex(C=>C==="light"),S=t.findIndex(C=>C==="dark");if(x===-1||S===-1)throw new at('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const w=l[x][g]||"inherit",_=l[S][g]||"inherit";d[g]=`light-dark(${w}, ${_})`,o==="css-vars"&&(d[f(m,g)]=v)}else d[g]=v;else o==="css-vars"&&(d[f(m,g)]=v)}}),s.htmlStyle=d,s}function Ld(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Wt.Italic&&(t["font-style"]="italic"),e.fontStyle&Wt.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Wt.Underline&&n.push("underline"),e.fontStyle&Wt.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function kg(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function t4(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let o=function(l){if(typeof l=="number"){if(l<0||l>n.source.length)throw new at(`Invalid decoration offset: ${l}. Code length: ${n.source.length}`);return{...i.indexToPos(l),offset:l}}else{const c=i.lines[l.line];if(c===void 0)throw new at(`Invalid decoration position ${JSON.stringify(l)}. Lines length: ${i.lines.length}`);let d=l.character;if(d<0&&(d=c.length+d),d<0||d>c.length)throw new at(`Invalid decoration position ${JSON.stringify(l)}. Line ${l.line} length: ${c.length}`);return{...l,character:d,offset:i.posToIndex(l.line,d)}}};const i=X3(n.source),s=(n.options.decorations||[]).map(l=>({...l,start:o(l.start),end:o(l.end)}));n4(s),e.set(n.meta,{decorations:s,converter:i,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(this.options.decorations?.length)return J3(n,t(this).decorations.flatMap(i=>[i.start.offset,i.end.offset]))},code(n){if(!this.options.decorations?.length)return;const i=t(this),o=[...n.children].filter(p=>p.type==="element"&&p.tagName==="span");if(o.length!==i.converter.lines.length)throw new at(`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 s(p,m,g,v){const x=o[p];let S="",w=-1,_=-1;if(m===0&&(w=0),g===0&&(_=0),g===Number.POSITIVE_INFINITY&&(_=x.children.length),w===-1||_===-1)for(let T=0;T<x.children.length;T++)S+=gT(x.children[T]),w===-1&&S.length===m&&(w=T+1),_===-1&&S.length===g&&(_=T+1);if(w===-1)throw new at(`Failed to find start index for decoration ${JSON.stringify(v.start)}`);if(_===-1)throw new at(`Failed to find end index for decoration ${JSON.stringify(v.end)}`);const C=x.children.slice(w,_);if(!v.alwaysWrap&&C.length===x.children.length)c(x,v,"line");else if(!v.alwaysWrap&&C.length===1&&C[0].type==="element")c(C[0],v,"token");else{const T={type:"element",tagName:"span",properties:{},children:C};c(T,v,"wrapper"),x.children.splice(w,C.length,T)}}function l(p,m){o[p]=c(o[p],m,"line")}function c(p,m,g){const v=m.properties||{},x=m.transform||(S=>S);return p.tagName=m.tagName||"span",p.properties={...p.properties,...v,class:p.properties.class},m.properties?.class&&mT(p,m.properties.class),p=x(p,g)||p,p}const d=[],f=i.decorations.sort((p,m)=>m.start.offset-p.start.offset||p.end.offset-m.end.offset);for(const p of f){const{start:m,end:g}=p;if(m.line===g.line)s(m.line,m.character,g.character,p);else if(m.line<g.line){s(m.line,m.character,Number.POSITIVE_INFINITY,p);for(let v=m.line+1;v<g.line;v++)d.unshift(()=>l(v,p));s(g.line,0,g.character,p)}}d.forEach(p=>p())}}}function n4(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new at(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let i=t+1;i<e.length;i++){const o=e[i],s=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,d=o.start.offset<n.end.offset&&n.end.offset<=o.end.offset;if(s||l||c||d){if(s&&l||c&&d||c&&n.start.offset===n.end.offset||l&&o.start.offset===o.end.offset)continue;throw new at(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function gT(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(gT).join(""):""}const i4=[t4()];function Rd(e){const t=r4(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...i4]}function r4(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 wo=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],hm={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function o4(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 xC(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 a4(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)hm[i]&&t.push({type:"setDecoration",value:hm[i]});else if(i<=29){const o=hm[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:wo[i-30]}});else if(i===38){const o=xC(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:wo[i-40]}});else if(i===48){const o=xC(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:wo[i-90+8]}}):i>=100&&i<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:wo[i-100+8]}})}return t}function s4(){let e=null,t=null,n=new Set;return{parse(i){const o=[];let s=0;do{const l=o4(i,s),c=l.sequence?i.substring(s,l.startPosition):i.substring(s);if(c.length>0&&o.push({value:c,foreground:e,background:t,decorations:new Set(n)}),l.sequence){const d=a4(l.sequence);for(const f of d)f.type==="resetAll"?(e=null,t=null,n.clear()):f.type==="resetForegroundColor"?e=null:f.type==="resetBackgroundColor"?t=null:f.type==="resetDecoration"&&n.delete(f.value);for(const f of d)f.type==="setForegroundColor"?e=f.value:f.type==="setBackgroundColor"?t=f.value:f.type==="setDecoration"&&n.add(f.value)}s=l.position}while(s<i.length);return o}}}var l4={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 u4(e=l4){function t(c){return e[c]}function n(c){return`#${c.map(d=>Math.max(0,Math.min(d,255)).toString(16).padStart(2,"0")).join("")}`}let i;function o(){if(i)return i;i=[];for(let f=0;f<wo.length;f++)i.push(t(wo[f]));let c=[0,95,135,175,215,255];for(let f=0;f<6;f++)for(let p=0;p<6;p++)for(let m=0;m<6;m++)i.push(n([c[f],c[p],c[m]]));let d=8;for(let f=0;f<24;f++,d+=10)i.push(n([d,d,d]));return i}function s(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 s(c.index)}}return{value:l}}const c4=/#([0-9a-f]{3,8})/i,d4=/var\((--[\w-]+-ansi-[\w-]+)\)/,f4={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 h4(e,t,n){const i=Ad(e,n),o=sf(t),s=u4(Object.fromEntries(wo.map(c=>{const d=`terminal.ansi${c[0].toUpperCase()}${c.substring(1)}`;return[c,e.colors?.[d]||f4[c]]}))),l=s4();return o.map(c=>l.parse(c[0]).map(d=>{let f,p;d.decorations.has("reverse")?(f=d.background?s.value(d.background):e.bg,p=d.foreground?s.value(d.foreground):e.fg):(f=d.foreground?s.value(d.foreground):e.fg,p=d.background?s.value(d.background):void 0),f=Fr(f,i),p=Fr(p,i),d.decorations.has("dim")&&(f=p4(f));let m=Wt.None;return d.decorations.has("bold")&&(m|=Wt.Bold),d.decorations.has("italic")&&(m|=Wt.Italic),d.decorations.has("underline")&&(m|=Wt.Underline),d.decorations.has("strikethrough")&&(m|=Wt.Strikethrough),{content:d.value,offset:c[1],color:f,bgColor:p,fontStyle:m}}))}function p4(e){const t=e.match(c4);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],s=i[1],l=i[2],c=i[3];return`#${o}${o}${s}${s}${l}${l}${Math.round(Number.parseInt(`${c}${c}`,16)/2).toString(16).padStart(2,"0")}`}else if(i.length===3){const o=i[0],s=i[1],l=i[2];return`#${o}${o}${s}${s}${l}${l}80`}}}const n=e.match(d4);return n?`var(${n[1]}-dim)`:e}function Tg(e,t,n={}){const i=e.resolveLangAlias(n.lang||"text"),{theme:o=e.getLoadedThemes()[0]}=n;if(!of(i)&&!af(o)&&i==="ansi"){const{theme:s}=e.setTheme(o);return h4(s,t,n)}return hT(e,t,n)}function Od(e,t,n){let i,o,s,l,c,d;if("themes"in n){const{defaultColor:f="light",cssVariablePrefix:p="--shiki-",colorsRendering:m="css-vars"}=n,g=Object.entries(n.themes).filter(_=>_[1]).map(_=>({color:_[0],theme:_[1]})).sort((_,C)=>_.color===f?-1:C.color===f?1:0);if(g.length===0)throw new at("`themes` option must not be empty");const v=pT(e,t,n,Tg);if(d=Ll(v),f&&f!=="light-dark()"&&!g.some(_=>_.color===f))throw new at(`\`themes\` option must contain the defaultColor key \`${f}\``);const x=g.map(_=>e.getTheme(_.theme)),S=g.map(_=>_.color);s=v.map(_=>_.map(C=>e4(C,S,p,f,m))),d&&uf(s,d);const w=g.map(_=>Ad(_.theme,n));o=SC(g,x,w,p,f,"fg",m),i=SC(g,x,w,p,f,"bg",m),l=`shiki-themes ${x.map(_=>_.name).join(" ")}`,c=f?void 0:[o,i].join(";")}else if("theme"in n){const f=Ad(n.theme,n);s=Tg(e,t,n);const p=e.getTheme(n.theme);i=Fr(p.bg,f),o=Fr(p.fg,f),l=p.name,d=Ll(s)}else throw new at("Invalid options, either `theme` or `themes` must be provided");return{tokens:s,fg:o,bg:i,themeName:l,rootStyle:c,grammarState:d}}function SC(e,t,n,i,o,s,l){return e.map((c,d)=>{const f=Fr(t[d][s],n[d])||"inherit",p=`${i+c.color}${s==="bg"?"-bg":""}:${f}`;if(d===0&&o){if(o==="light-dark()"&&e.length>1){const m=e.findIndex(v=>v.color==="light"),g=e.findIndex(v=>v.color==="dark");if(m===-1||g===-1)throw new at('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${Fr(t[m][s],n[m])||"inherit"}, ${Fr(t[g][s],n[g])||"inherit"});${p}`}return f}return l==="css-vars"?p:null}).filter(c=>!!c).join(";")}const yT=/^\s+$/,m4=/^(\s*)(.*?)(\s*)$/;function Dd(e,t,n,i={meta:{},options:n,codeToHast:(o,s)=>Dd(e,o,s),codeToTokens:(o,s)=>Od(e,o,s)}){let o=t;for(const x of Rd(n))o=x.preprocess?.call(i,o,n)||o;let{tokens:s,fg:l,bg:c,themeName:d,rootStyle:f,grammarState:p}=Od(e,o,n);const{mergeWhitespaces:m=!0,mergeSameStyleTokens:g=!1}=n;m===!0?s=y4(s):m==="never"&&(s=v4(s)),g&&(s=b4(s));const v={...i,get source(){return o}};for(const x of Rd(n))s=x.tokens?.call(v,s)||s;return g4(s,{...n,fg:l,bg:c,themeName:d,rootStyle:n.rootStyle===!1?!1:n.rootStyle??f},v,p)}function g4(e,t,n,i=Ll(e)){const o=Rd(t),s=[],l={type:"root",children:[]},{structure:c="classic",tabindex:d="0"}=t,f={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?f.style=t.rootStyle:f.style=`background-color:${t.bg};color:${t.fg}`),d!==!1&&d!=null&&(f.tabindex=d.toString());for(const[S,w]of Object.entries(t.meta||{}))S.startsWith("_")||(f[S]=w);let p={type:"element",tagName:"pre",properties:f,children:[],data:t.data},m={type:"element",tagName:"code",properties:{},children:s};const g=[],v={...n,structure:c,addClassToHast:mT,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 g}};if(e.forEach((S,w)=>{w&&(c==="inline"?l.children.push({type:"element",tagName:"br",properties:{},children:[]}):c==="classic"&&s.push({type:"text",value:`
|
|
58
|
+
`}));let _={type:"element",tagName:"span",properties:{class:"line"},children:[]},C=0;for(const T of S){let D={type:"element",tagName:"span",properties:{...T.htmlAttrs},children:[{type:"text",value:T.content}]};const I=kg(T.htmlStyle||Ld(T));I&&(D.properties.style=I);for(const O of o)D=O?.span?.call(v,D,w+1,C,_,T)||D;c==="inline"?l.children.push(D):c==="classic"&&_.children.push(D),C+=T.content.length}if(c==="classic"){for(const T of o)_=T?.line?.call(v,_,w+1)||_;g.push(_),s.push(_)}else c==="inline"&&g.push(_)}),c==="classic"){for(const S of o)m=S?.code?.call(v,m)||m;p.children.push(m);for(const S of o)p=S?.pre?.call(v,p)||p;l.children.push(p)}else if(c==="inline"){const S=[];let w={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const C of l.children)C.type==="element"&&C.tagName==="br"?(S.push(w),w={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(C.type==="element"||C.type==="text")&&w.children.push(C);S.push(w);let _={type:"element",tagName:"code",properties:{},children:S};for(const C of o)_=C?.code?.call(v,_)||_;l.children=[];for(let C=0;C<_.children.length;C++){C>0&&l.children.push({type:"element",tagName:"br",properties:{},children:[]});const T=_.children[C];T.type==="element"&&l.children.push(...T.children)}}let x=l;for(const S of o)x=S?.root?.call(v,x)||x;return i&&uf(x,i),x}function y4(e){return e.map(t=>{const n=[];let i="",o;return t.forEach((s,l)=>{const c=!(s.fontStyle&&(s.fontStyle&Wt.Underline||s.fontStyle&Wt.Strikethrough));c&&yT.test(s.content)&&t[l+1]?(o===void 0&&(o=s.offset),i+=s.content):i?(c?n.push({...s,offset:o,content:i+s.content}):n.push({content:i,offset:o},s),o=void 0,i=""):n.push(s)}),n})}function v4(e){return e.map(t=>t.flatMap(n=>{if(yT.test(n.content))return n;const i=n.content.match(m4);if(!i)return n;const[,o,s,l]=i;if(!o&&!l)return n;const c=[{...n,offset:n.offset+o.length,content:s}];return o&&c.unshift({content:o,offset:n.offset}),l&&c.push({content:l,offset:n.offset+o.length+s.length}),c}))}function b4(e){return e.map(t=>{const n=[];for(const i of t){if(n.length===0){n.push({...i});continue}const o=n.at(-1),s=kg(o.htmlStyle||Ld(o)),l=kg(i.htmlStyle||Ld(i)),c=o.fontStyle&&(o.fontStyle&Wt.Underline||o.fontStyle&Wt.Strikethrough),d=i.fontStyle&&(i.fontStyle&Wt.Underline||i.fontStyle&Wt.Strikethrough);!c&&!d&&s===l?o.content+=i.content:n.push({...i})}return n})}const x4=nn;function S4(e,t,n){const i={meta:{},options:n,codeToHast:(s,l)=>Dd(e,s,l),codeToTokens:(s,l)=>Od(e,s,l)};let o=x4(Dd(e,t,n,i));for(const s of Rd(n))o=s.postprocess?.call(i,o,n)||o;return o}async function _4(e){const t=await P3(e);return{getLastGrammarState:(...n)=>V3(t,...n),codeToTokensBase:(n,i)=>Tg(t,n,i),codeToTokensWithThemes:(n,i)=>pT(t,n,i),codeToTokens:(n,i)=>Od(t,n,i),codeToHast:(n,i)=>Dd(t,n,i),codeToHtml:(n,i)=>S4(t,n,i),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function C4(e){const t=e.langs,n=e.themes,i=e.engine;async function o(s){function l(m){if(typeof m=="string"){if(m=s.langAlias?.[m]||m,aT(m))return[];const g=t[m];if(!g)throw new at(`Language \`${m}\` is not included in this bundle. You may want to load it from external source.`);return g}return m}function c(m){if(sT(m))return"none";if(typeof m=="string"){const g=n[m];if(!g)throw new at(`Theme \`${m}\` is not included in this bundle. You may want to load it from external source.`);return g}return m}const d=(s.themes??[]).map(m=>c(m)),f=(s.langs??[]).map(m=>l(m)),p=await _4({engine:s.engine??i(),...s,themes:d,langs:f});return{...p,loadLanguage(...m){return p.loadLanguage(...m.map(l))},loadTheme(...m){return p.loadTheme(...m.map(c))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return o}const w4=C4({langs:vg,themes:T6,engine:()=>(0,Fk.createOnigurumaEngine)(A(()=>import("./wasm-CG6Dc4jp.js"),[],import.meta.url))}),_C=4294967295;var E4=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;const{forgiving:n=!1,cache:i,regexConstructor:o}=t;if(!o)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(s=>{if(typeof s!="string")return s;const l=i?.get(s);if(l){if(l instanceof RegExp)return l;if(n)return null;throw l}try{const c=o(s);return i?.set(s,c),c}catch(c){if(i?.set(s,c),n)return null;throw c}})}findNextMatchSync(e,t,n){const i=typeof e=="string"?e:e.content,o=[];function s(l,c,d=0){return{index:l,captureIndices:c.indices.map(f=>f==null?{start:_C,end:_C,length:0}:{start:f[0]+d,end:f[1]+d,length:f[1]-f[0]})}}for(let l=0;l<this.regexps.length;l++){const c=this.regexps[l];if(c)try{c.lastIndex=t;const d=c.exec(i);if(!d)continue;if(d.index===t)return s(l,d,0);o.push([l,d,0])}catch(d){if(this.options.forgiving)continue;throw d}}if(o.length){const l=Math.min(...o.map(c=>c[1].index));for(const[c,d,f]of o)if(d.index===l)return s(c,d,f)}return null}};function is(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function k4(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const $y=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),Pt=String.raw;function rs(e,t){if(e==null)throw new Error(t??"Value expected");return e}const vT=Pt`\[\^?`,bT=`c.? | C(?:-.?)?|${Pt`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${Pt`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${Pt`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${Pt`o\{[^\}]*\}?`}|${Pt`\d{1,3}`}`,qy=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Lc=new RegExp(Pt`
|
|
59
|
+
\\ (?:
|
|
60
|
+
${bT}
|
|
61
|
+
| [gk]<[^>]*>?
|
|
62
|
+
| [gk]'[^']*'?
|
|
63
|
+
| .
|
|
64
|
+
)
|
|
65
|
+
| \( (?:
|
|
66
|
+
\? (?:
|
|
67
|
+
[:=!>({]
|
|
68
|
+
| <[=!]
|
|
69
|
+
| <[^>]*>
|
|
70
|
+
| '[^']*'
|
|
71
|
+
| ~\|?
|
|
72
|
+
| #(?:[^)\\]|\\.?)*
|
|
73
|
+
| [^:)]*[:)]
|
|
74
|
+
)?
|
|
75
|
+
| \*[^\)]*\)?
|
|
76
|
+
)?
|
|
77
|
+
| (?:${qy.source})+
|
|
78
|
+
| ${vT}
|
|
79
|
+
| .
|
|
80
|
+
`.replace(/\s+/g,""),"gsu"),pm=new RegExp(Pt`
|
|
81
|
+
\\ (?:
|
|
82
|
+
${bT}
|
|
83
|
+
| .
|
|
84
|
+
)
|
|
85
|
+
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
86
|
+
| ${vT}
|
|
87
|
+
| &&
|
|
88
|
+
| .
|
|
89
|
+
`.replace(/\s+/g,""),"gsu");function T4(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=q4(n.flags),o=[i.extended],s={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(Lc.lastIndex=0;c=Lc.exec(e);){const m=A4(s,e,c[0],Lc.lastIndex);m.tokens?l.push(...m.tokens):m.token&&l.push(m.token),m.lastIndex!==void 0&&(Lc.lastIndex=m.lastIndex)}const d=[];let f=0;l.filter(m=>m.type==="GroupOpen").forEach(m=>{m.kind==="capturing"?m.number=++f:m.raw==="("&&d.push(m)}),f||d.forEach((m,g)=>{m.kind="capturing",m.number=g+1});const p=f||d.length;return{tokens:l.map(m=>m.type==="EscapedNumber"?Y4(m,p):m).flat(),flags:i}}function A4(e,t,n,i){const[o,s]=n;if(n==="["||n==="[^"){const l=L4(t,n,i);return{tokens:l.tokens,lastIndex:l.lastIndex}}if(o==="\\"){if("AbBGyYzZ".includes(s))return{token:CC(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:j4(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:ST(n)}}if(s==="K")return{token:_T("keep",n)};if(s==="N"||s==="R")return{token:Eo("newline",n,{negate:s==="N"})};if(s==="O")return{token:Eo("any",n)};if(s==="X")return{token:Eo("text_segment",n)};const l=xT(n,{inCharClass:!1});return Array.isArray(l)?{tokens:l}:{token:l}}if(o==="("){if(s==="*")return{token:F4(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:V4(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:za("group",n)};if(n==="(?>")return{token:za("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:za(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:za("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:za("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:z4(n)}}if(e.getCurrentModX()){if(n==="#"){const l=t.indexOf(`
|
|
90
|
+
`,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:Eo("dot",n)};if(n==="^"||n==="$"){const l=e.singleline?{"^":Pt`\A`,$:Pt`\Z`}[n]:n;return{token:CC(l,n)}}return n==="|"?{token:O4(n)}:qy.test(n)?{tokens:X4(n)}:{token:Ji(is(n),n)}}function L4(e,t,n){const i=[wC(t[1]==="^",t)];let o=1,s;for(pm.lastIndex=n;s=pm.exec(e);){const l=s[0];if(l[0]==="["&&l[1]!==":")o++,i.push(wC(l[1]==="^",l));else if(l==="]"){if(i.at(-1).type==="CharacterClassOpen")i.push(Ji(93,l));else if(o--,i.push(D4(l)),!o)break}else{const c=R4(l);Array.isArray(c)?i.push(...c):i.push(c)}}return{tokens:i,lastIndex:pm.lastIndex||e.length}}function R4(e){if(e[0]==="\\")return xT(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!$y.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return Eo("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?M4(e):e==="&&"?I4(e):Ji(is(e),e)}function xT(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return U4(e);if("dDhHsSwW".includes(n))return G4(e);if(e.startsWith(Pt`\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 $4(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)),s=new TextEncoder;return[...o].map(l=>{const c=[...s.encode(l)].map(d=>`\\x${d.toString(16)}`).join("");return Ji(is(l),c)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Ji(W4(e),e);if(EC.has(n))return Ji(EC.get(n),e);if(/\d/.test(n))return N4(t,e);if(e==="\\")throw new Error(Pt`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Ji(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function O4(e){return{type:"Alternator",raw:e}}function CC(e,t){return{type:"Assertion",kind:e,raw:t}}function ST(e){return{type:"Backreference",raw:e}}function Ji(e,t){return{type:"Character",value:e,raw:t}}function D4(e){return{type:"CharacterClassClose",raw:e}}function M4(e){return{type:"CharacterClassHyphen",raw:e}}function I4(e){return{type:"CharacterClassIntersector",raw:e}}function wC(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function Eo(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function _T(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:rs(n.flags),raw:t}}function N4(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function z4(e){return{type:"GroupClose",raw:e}}function za(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function P4(e,t,n,i){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:i}}function H4(e,t,n,i){return{type:"Quantifier",kind:e,min:t,max:n,raw:i}}function j4(e){return{type:"Subroutine",raw:e}}const B4=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),EC=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function U4(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 Ji(is(t.toUpperCase())-64,e)}function V4(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"),s=TC(n),l=TC(i),c={};if(s&&(c.enable=s),l&&(c.disable=l),e.endsWith(")"))return t.replaceCurrentModX(o),_T("flags",e,{flags:c});if(e.endsWith(":"))return t.pushModX(o),t.numOpenGroups++,za("group",e,{...(s||l)&&{flags:c}});throw new Error(`Unexpected flag modifier "${e}"`)}function F4(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 s=o?o.split(",").filter(p=>p!=="").map(p=>/^[+-]?\d+$/.test(p)?+p:p):[],[l,c,d]=s,f=B4.has(n)?n.toLowerCase():"custom";switch(f){case"fail":case"mismatch":case"skip":if(s.length>0)throw new Error(`Named callout arguments not allowed "${s}"`);break;case"error":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(typeof l=="string")throw new Error(`Named callout argument must be a number "${l}"`);break;case"max":if(!s.length||s.length>2)throw new Error(`Named callout must have one or two arguments "${s}"`);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(s.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(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(s.length===1&&(typeof l=="number"||!/^[<>X]$/.test(l)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${l}"`);break;case"cmp":if(s.length!==3)throw new Error(`Named callout must have three arguments "${s}"`);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 d=="string"&&!/^[A-Za-z_]\w*$/.test(d))throw new Error(`Named callout argument three must be a tag or number "${d}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${f}"`)}return P4(f,i??null,o?.split(",")??null,e)}function kC(e){let t=null,n,i;if(e[0]==="{"){const{minStr:o,maxStr:s}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,l=1e5;if(+o>l||s&&+s>l)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+o,i=s===void 0?+o:s===""?1/0:+s,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 H4(t,n,i,e)}function G4(e){const t=e[1].toLowerCase();return Eo({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function $4(e){const{p:t,neg:n,value:i}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return Eo("property",e,{value:i,negate:t==="P"&&!n||t==="p"&&!!n})}function TC(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 q4(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 W4(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 Y4(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[ST(n)];const s=[],l=o.match(/^[0-7]+|\d/g);for(let c=0;c<l.length;c++){const d=l[c];let f;if(c===0&&d!=="8"&&d!=="9"){if(f=parseInt(d,8),f>127)throw new Error(Pt`Octal encoded byte above 177 unsupported "${n}"`)}else f=is(d);s.push(Ji(f,(c===0?"\\":"")+d))}return s}function X4(e){const t=[],n=new RegExp(qy,"gy");let i;for(;i=n.exec(e);){const o=i[0];if(o[0]==="{"){const s=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(o);if(s){const{min:l,max:c}=s.groups;if(+l>+c&&o.endsWith("?")){n.lastIndex--,t.push(kC(o.slice(0,-1)));continue}}}t.push(kC(o))}return t}function CT(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 K4(e){return Q4.has(e.type)}const Q4=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function wT(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},i=T4(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),o=(g,v)=>{const x=i.tokens[s.nextIndex];switch(s.parent=g,s.nextIndex++,x.type){case"Alternator":return Ho();case"Assertion":return Z4(x);case"Backreference":return J4(x,s);case"Character":return df(x.value,{useLastValid:!!v.isCheckingRangeEnd});case"CharacterClassHyphen":return eB(x,s,v);case"CharacterClassOpen":return tB(x,s,v);case"CharacterSet":return nB(x,s);case"Directive":return lB(x.kind,{flags:x.flags});case"GroupOpen":return iB(x,s,v);case"NamedCallout":return cB(x.kind,x.tag,x.arguments);case"Quantifier":return rB(x,s);case"Subroutine":return oB(x,s);default:throw new Error(`Unexpected token type "${x.type}"`)}},s={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=fB(uB(i.flags));let c=l.body[0];for(;s.nextIndex<i.tokens.length;){const g=o(c,{});g.type==="Alternative"?(l.body.push(g),c=g):c.body.push(g)}const{capturingGroups:d,hasNumberedRef:f,namedGroupsByName:p,subroutines:m}=s;if(f&&p.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:g}of m)if(typeof g=="number"){if(g>d.length)throw new Error("Subroutine uses a group number that's not defined");g&&(d[g-1].isSubroutined=!0)}else if(p.has(g)){if(p.get(g).length>1)throw new Error(Pt`Subroutine uses a duplicate group name "\g<${g}>"`);p.get(g)[0].isSubroutined=!0}else throw new Error(Pt`Subroutine uses a group name that's not defined "\g<${g}>"`);return l}function Z4({kind:e}){return Ag(rs({"^":"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===Pt`\B`||e===Pt`\Y`})}function J4({raw:e},t){const n=/^\\k[<']/.test(e),i=n?e.slice(3,-1):e.slice(1),o=(s,l=!1)=>{const c=t.capturingGroups.length;let d=!1;if(s>c)if(t.skipBackrefValidation)d=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Lg(l?c+1-s:s,{orphan:d})};if(n){const s=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(i);if(s)return o(+s.groups.num,!!s.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 Lg(i)}return o(+i)}function eB(e,t,n){const{tokens:i,walk:o}=t,s=t.parent,l=s.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 d=o(s,{...n,isCheckingRangeEnd:!0});if(l.type==="Character"&&d.type==="Character")return s.body.pop(),sB(l,d);throw new Error("Invalid character class range")}return df(is("-"))}function tB({negate:e},t,n){const{tokens:i,walk:o}=t,s=[id()],l=i[t.nextIndex];let c=RC(l);for(;c.type!=="CharacterClassClose";){if(c.type==="CharacterClassIntersector")s.push(id()),t.nextIndex++;else{const f=s.at(-1);f.body.push(o(f,n))}c=RC(i[t.nextIndex],l)}const d=id({negate:e});return s.length===1?d.body=s[0].body:(d.kind="intersection",d.body=s.map(f=>f.body.length===1?f.body[0]:f)),t.nextIndex++,d}function nB({kind:e,negate:t,value:n},i){const{normalizeUnknownPropertyNames:o,skipPropertyNameValidation:s,unicodePropertyMap:l}=i;if(e==="property"){const c=ff(n);if($y.has(c)&&!l?.has(c))e="posix",n=c;else return Pa(n,{negate:t,normalizeUnknownPropertyNames:o,skipPropertyNameValidation:s,unicodePropertyMap:l})}return e==="posix"?dB(n,{negate:t}):Rg(e,{negate:t})}function iB(e,t,n){const{tokens:i,capturingGroups:o,namedGroupsByName:s,skipLookbehindValidation:l,walk:c}=t,d=hB(e),f=d.type==="AbsenceFunction",p=LC(d),m=p&&d.negate;if(d.type==="CapturingGroup"&&(o.push(d),d.name&&k4(s,d.name,[]).push(d)),f&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let g=OC(i[t.nextIndex]);for(;g.type!=="GroupClose";){if(g.type==="Alternator")d.body.push(Ho()),t.nextIndex++;else{const v=d.body.at(-1),x=c(v,{...n,isInAbsenceFunction:n.isInAbsenceFunction||f,isInLookbehind:n.isInLookbehind||p,isInNegLookbehind:n.isInNegLookbehind||m});if(v.body.push(x),(p||n.isInLookbehind)&&!l){const S="Lookbehind includes a pattern not allowed by Oniguruma";if(m||n.isInNegLookbehind){if(AC(x)||x.type==="CapturingGroup")throw new Error(S)}else if(AC(x)||LC(x)&&x.negate)throw new Error(S)}}g=OC(i[t.nextIndex])}return t.nextIndex++,d}function rB({kind:e,min:t,max:n},i){const o=i.parent,s=o.body.at(-1);if(!s||!K4(s))throw new Error("Quantifier requires a repeatable token");const l=kT(e,t,n,s);return o.body.pop(),l}function oB({raw:e},t){const{capturingGroups:n,subroutines:i}=t;let o=e.slice(3,-1);const s=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(o);if(s){const c=+s.groups.num,d=n.length;if(t.hasNumberedRef=!0,o={"":c,"+":d+c,"-":d+1-c}[s.groups.sign],o<1)throw new Error("Invalid subroutine number")}else o==="0"&&(o=0);const l=TT(o);return i.push(l),l}function aB(e,t){return{type:"AbsenceFunction",kind:e,body:ql(t?.body)}}function Ho(e){return{type:"Alternative",body:AT(e?.body)}}function Ag(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function Lg(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function ET(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!pB(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:ql(t?.body)}}function df(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 id(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:AT(e?.body)}}function sB(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Rg(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 lB(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:rs(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function uB(e){return{type:"Flags",...e}}function Qn(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:ql(e?.body)}}function _o(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:ql(e?.body)}}function cB(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function dB(e,t){const n=!!t?.negate;if(!$y.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function kT(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 fB(e,t){return{type:"Regex",body:ql(t?.body),flags:e}}function TT(e){return{type:"Subroutine",ref:e}}function Pa(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let i=n.unicodePropertyMap?.get(ff(e));if(!i){if(n.normalizeUnknownPropertyNames)i=mB(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(Pt`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:i??e,negate:n.negate}}function hB({flags:e,kind:t,name:n,negate:i,number:o}){switch(t){case"absence_repeater":return aB("repeater");case"atomic":return Qn({atomic:!0});case"capturing":return ET(o,{name:n});case"group":return Qn({flags:e});case"lookahead":case"lookbehind":return _o({behind:t==="lookbehind",negate:i});default:throw new Error(`Unexpected group kind "${t}"`)}}function ql(e){if(e===void 0)e=[Ho()];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 AT(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 AC(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function LC(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function pB(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function mB(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 ff(e){return e.replace(/[- _]+/g,"").toLowerCase()}function RC(e,t){const n=t;return rs(e,`Unclosed character class${n?.type==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function OC(e){return rs(e,"Unclosed group")}function vl(e,t,n=null){function i(s,l){for(let c=0;c<s.length;c++){const d=o(s[c],l,c,s);c=Math.max(-1,c+d)}}function o(s,l=null,c=null,d=null){let f=0,p=!1;const m={node:s,parent:l,key:c,container:d,root:e,remove(){Rc(d).splice(Math.max(0,Da(c)+f),1),f--,p=!0},removeAllNextSiblings(){return Rc(d).splice(Da(c)+1)},removeAllPrevSiblings(){const _=Da(c)+f;return f-=_,Rc(d).splice(0,Math.max(0,_))},replaceWith(_,C={}){const T=!!C.traverse;d?d[Math.max(0,Da(c)+f)]=_:rs(l,"Can't replace root node")[c]=_,T&&o(_,l,c,d),p=!0},replaceWithMultiple(_,C={}){const T=!!C.traverse;if(Rc(d).splice(Math.max(0,Da(c)+f),1,..._),f+=_.length-1,T){let D=0;for(let I=0;I<_.length;I++)D+=o(_[I],l,Da(c)+I+D,d)}p=!0},skip(){p=!0}},{type:g}=s,v=t["*"],x=t[g],S=typeof v=="function"?v:v?.enter,w=typeof x=="function"?x:x?.enter;if(S?.(m,n),w?.(m,n),!p)switch(g){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":i(s.body,s);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":o(s.min,s,"min"),o(s.max,s,"max");break;case"Quantifier":o(s.body,s,"body");break;case"Regex":i(s.body,s),o(s.flags,s,"flags");break;default:throw new Error(`Unexpected node type "${g}"`)}return x?.exit?.(m,n),v?.exit?.(m,n),f}return o(e),e}function Rc(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function Da(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const gB=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function yB(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function vB(e,t,n,i){return e.slice(0,t)+i+e.slice(t+n.length)}const $n=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function Wy(e,t,n,i){const o=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),s=[!1];let l=0,c="";for(const d of e.matchAll(o)){const{0:f,groups:{$skip:p}}=d;if(!p&&(!i||i===$n.DEFAULT==!l)){n instanceof Function?c+=n(d,{context:l?$n.CHAR_CLASS:$n.DEFAULT,negated:s[s.length-1]}):c+=n;continue}f[0]==="["?(l++,s.push(f[1]==="^")):f==="]"&&l&&(l--,s.pop()),c+=f}return c}function LT(e,t,n,i){Wy(e,t,n,i)}function bB(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 s=0,l;for(;l=o.exec(e);){const{0:c,groups:{$skip:d}}=l;if(!d&&(!i||i===$n.DEFAULT==!s))return l;c==="["?s++:c==="]"&&s&&s--,o.lastIndex==l.index&&o.lastIndex++}return null}function Oc(e,t,n){return!!bB(e,t,0,n)}function xB(e,t){const n=/\\?./gsu;n.lastIndex=t;let i=e.length,o=0,s=1,l;for(;l=n.exec(e);){const[c]=l;if(c==="[")o++;else if(o)c==="]"&&o--;else if(c==="(")s++;else if(c===")"&&(s--,!s)){i=l.index;break}}return e.slice(t,i)}const DC=new RegExp(String.raw`(?<noncapturingStart>${gB})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function SB(e,t){const n=t?.hiddenCaptures??[];let i=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};const o="(?>",s="(?:(?=(",l=[0],c=[];let d=0,f=0,p=NaN,m;do{m=!1;let g=0,v=0,x=!1,S;for(DC.lastIndex=Number.isNaN(p)?0:p+s.length;S=DC.exec(e);){const{0:w,index:_,groups:{capturingStart:C,noncapturingStart:T}}=S;if(w==="[")g++;else if(g)w==="]"&&g--;else if(w===o&&!x)p=_,x=!0;else if(x&&T)v++;else if(C)x?v++:(d++,l.push(d+f));else if(w===")"&&x){if(!v){f++;const D=d+f;if(e=`${e.slice(0,p)}${s}${e.slice(p+o.length,_)}))<$$${D}>)${e.slice(_+1)}`,m=!0,c.push(D),yB(n,D),i.size){const I=new Map;i.forEach((O,P)=>{I.set(P>=D?P+1:P,O.map(j=>j>=D?j+1:j))}),i=I}break}v--}}}while(m);return n.push(...c),e=Wy(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:g,groups:{backrefNum:v,wrappedBackrefNum:x}})=>{if(v){const S=+v;if(S>l.length-1)throw new Error(`Backref "${g}" greater than number of captures`);return`\\${l[S]}`}return`\\${x}`},$n.DEFAULT),{pattern:e,captureTransfers:i,hiddenCaptures:n}}const RT=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,mm=new RegExp(String.raw`
|
|
91
|
+
\\(?: \d+
|
|
92
|
+
| c[A-Za-z]
|
|
93
|
+
| [gk]<[^>]+>
|
|
94
|
+
| [pPu]\{[^\}]+\}
|
|
95
|
+
| u[A-Fa-f\d]{4}
|
|
96
|
+
| x[A-Fa-f\d]{2}
|
|
97
|
+
)
|
|
98
|
+
| \((?: \? (?: [:=!>]
|
|
99
|
+
| <(?:[=!]|[^>]+>)
|
|
100
|
+
| [A-Za-z\-]+:
|
|
101
|
+
| \(DEFINE\)
|
|
102
|
+
))?
|
|
103
|
+
| (?<qBase>${RT})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
104
|
+
| \\?.
|
|
105
|
+
`.replace(/\s+/g,""),"gsu");function _B(e){if(!new RegExp(`${RT}\\+`).test(e))return{pattern:e};const t=[];let n=null,i=null,o="",s=0,l;for(mm.lastIndex=0;l=mm.exec(e);){const{0:c,index:d,groups:{qBase:f,qMod:p,invalidQ:m}}=l;if(c==="[")s||(i=d),s++;else if(c==="]")s?s--:i=null;else if(!s)if(p==="+"&&o&&!o.startsWith("(")){if(m)throw new Error(`Invalid quantifier "${c}"`);let g=-1;if(/^\{\d+\}$/.test(f))e=vB(e,d+f.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,d)}${f})${e.slice(d+c.length)}`}else e=`${e.slice(0,d-o.length)}(?>${o}${f})${e.slice(d+c.length)}`;g+=4}mm.lastIndex+=g}else c[0]==="("?t.push(d):c===")"&&(n=t.length?t.pop():null);o=c}return{pattern:e}}const Gn=String.raw,CB=Gn`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Og=Gn`\(\?R=(?<rDepth>[^\)]+)\)|${CB}`,hf=Gn`\(\?<(?![=!])(?<captureName>[^>]+)>`,OT=Gn`${hf}|(?<unnamed>\()(?!\?)`,vo=new RegExp(Gn`${hf}|${Og}|\(\?|\\?.`,"gsu"),gm="Cannot use multiple overlapping recursions";function wB(e,t){const{hiddenCaptures:n,mode:i}={hiddenCaptures:[],mode:"plugin",...t};let o=t?.captureTransfers??new Map;if(!new RegExp(Og,"su").test(e))return{pattern:e,captureTransfers:o,hiddenCaptures:n};if(i==="plugin"&&Oc(e,Gn`\(\?\(DEFINE\)`,$n.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const s=[],l=Oc(e,Gn`\\[1-9]`,$n.DEFAULT),c=new Map,d=[];let f=!1,p=0,m=0,g;for(vo.lastIndex=0;g=vo.exec(e);){const{0:v,groups:{captureName:x,rDepth:S,gRNameOrNum:w,gRDepth:_}}=g;if(v==="[")p++;else if(p)v==="]"&&p--;else if(S){if(MC(S),f)throw new Error(gm);if(l)throw new Error(`${i==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const C=e.slice(0,g.index),T=e.slice(vo.lastIndex);if(Oc(T,Og,$n.DEFAULT))throw new Error(gm);const D=+S-1;e=IC(C,T,D,!1,n,s,m),o=zC(o,C,D,s.length,0,m);break}else if(w){MC(_);let C=!1;for(const B of d)if(B.name===w||B.num===+w){if(C=!0,B.hasRecursedWithin)throw new Error(gm);break}if(!C)throw new Error(Gn`Recursive \g cannot be used outside the referenced group "${i==="external"?w:Gn`\g<${w}&R=${_}>`}"`);const T=c.get(w),D=xB(e,T);if(l&&Oc(D,Gn`${hf}|\((?!\?)`,$n.DEFAULT))throw new Error(`${i==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const I=e.slice(T,g.index),O=D.slice(I.length+v.length),P=s.length,j=+_-1,F=IC(I,O,j,!0,n,s,m);o=zC(o,I,j,s.length-P,P,m);const Q=e.slice(0,T),G=e.slice(T+D.length);e=`${Q}${F}${G}`,vo.lastIndex+=F.length-v.length-I.length-O.length,d.forEach(B=>B.hasRecursedWithin=!0),f=!0}else if(x)m++,c.set(String(m),vo.lastIndex),c.set(x,vo.lastIndex),d.push({num:m,name:x});else if(v[0]==="("){const C=v==="(";C&&(m++,c.set(String(m),vo.lastIndex)),d.push(C?{num:m}:{})}else v===")"&&d.pop()}return n.push(...s),{pattern:e,captureTransfers:o,hiddenCaptures:n}}function MC(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 IC(e,t,n,i,o,s,l){const c=new Set;i&<(e+t,hf,({groups:{captureName:f}})=>{c.add(f)},$n.DEFAULT);const d=[n,i?c:null,o,s,l];return`${e}${NC(`(?:${e}`,"forward",...d)}(?:)${NC(`${t})`,"backward",...d)}${t}`}function NC(e,t,n,i,o,s,l){const d=p=>t==="forward"?p+2:n-p+2-1;let f="";for(let p=0;p<n;p++){const m=d(p);f+=Wy(e,Gn`${OT}|\\k<(?<backref>[^>]+)>`,({0:g,groups:{captureName:v,unnamed:x,backref:S}})=>{if(S&&i&&!i.has(S))return g;const w=`_$${m}`;if(x||v){const _=l+s.length+1;return s.push(_),EB(o,_),x?g:`(?<${v}${w}>`}return Gn`\k<${S}${w}>`},$n.DEFAULT)}return f}function EB(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function zC(e,t,n,i,o,s){if(e.size&&i){let l=0;LT(t,OT,()=>l++,$n.DEFAULT);const c=s-l+o,d=new Map;return e.forEach((f,p)=>{const m=(i-l*n)/n,g=l*n,v=p>c+l?p+i:p,x=[];for(const S of f)if(S<=c)x.push(S);else if(S>c+l+m)x.push(S+i);else if(S<=c+l)for(let w=0;w<=n;w++)x.push(S+l*w);else for(let w=0;w<=n;w++)x.push(S+g+m*w);d.set(v,x)}),d}return e}var Ot=String.fromCodePoint,Ae=String.raw,Jn={},pf=globalThis.RegExp;Jn.flagGroups=(()=>{try{new pf("(?i:)")}catch{return!1}return!0})();Jn.unicodeSets=(()=>{try{new pf("[[]]","v")}catch{return!1}return!0})();Jn.bugFlagVLiteralHyphenIsRange=Jn.unicodeSets?(()=>{try{new pf(Ae`[\d\-a]`,"v")}catch{return!0}return!1})():!1;Jn.bugNestedClassIgnoresNegation=Jn.unicodeSets&&new pf("[[^a]]","v").test("a");function Md(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function Rl(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Dg(e,t){return PC[e]>=PC[t]}function kB(e,t){if(e==null)throw new Error(t??"Value expected");return e}var PC={ES2025:2025,ES2024:2024,ES2018:2018},TB={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function DT(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!TB[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=Jn.flagGroups?"ES2025":Jn.unicodeSets?"ES2024":"ES2018"),t}var AB="[ -\r ]",LB=new Set([Ot(304),Ot(305)]),Wi=Ae`[\p{L}\p{M}\p{N}\p{Pc}]`;function MT(e){if(LB.has(e))return[e];const t=new Set,n=e.toLowerCase(),i=n.toUpperCase(),o=DB.get(n),s=RB.get(n),l=OB.get(n);return[...i].length===1&&t.add(i),l&&t.add(l),o&&t.add(o),t.add(n),s&&t.add(s),[...t]}var Yy=new Map(`C Other
|
|
106
|
+
Cc Control cntrl
|
|
107
|
+
Cf Format
|
|
108
|
+
Cn Unassigned
|
|
109
|
+
Co Private_Use
|
|
110
|
+
Cs Surrogate
|
|
111
|
+
L Letter
|
|
112
|
+
LC Cased_Letter
|
|
113
|
+
Ll Lowercase_Letter
|
|
114
|
+
Lm Modifier_Letter
|
|
115
|
+
Lo Other_Letter
|
|
116
|
+
Lt Titlecase_Letter
|
|
117
|
+
Lu Uppercase_Letter
|
|
118
|
+
M Mark Combining_Mark
|
|
119
|
+
Mc Spacing_Mark
|
|
120
|
+
Me Enclosing_Mark
|
|
121
|
+
Mn Nonspacing_Mark
|
|
122
|
+
N Number
|
|
123
|
+
Nd Decimal_Number digit
|
|
124
|
+
Nl Letter_Number
|
|
125
|
+
No Other_Number
|
|
126
|
+
P Punctuation punct
|
|
127
|
+
Pc Connector_Punctuation
|
|
128
|
+
Pd Dash_Punctuation
|
|
129
|
+
Pe Close_Punctuation
|
|
130
|
+
Pf Final_Punctuation
|
|
131
|
+
Pi Initial_Punctuation
|
|
132
|
+
Po Other_Punctuation
|
|
133
|
+
Ps Open_Punctuation
|
|
134
|
+
S Symbol
|
|
135
|
+
Sc Currency_Symbol
|
|
136
|
+
Sk Modifier_Symbol
|
|
137
|
+
Sm Math_Symbol
|
|
138
|
+
So Other_Symbol
|
|
139
|
+
Z Separator
|
|
140
|
+
Zl Line_Separator
|
|
141
|
+
Zp Paragraph_Separator
|
|
142
|
+
Zs Space_Separator
|
|
143
|
+
ASCII
|
|
144
|
+
ASCII_Hex_Digit AHex
|
|
145
|
+
Alphabetic Alpha
|
|
146
|
+
Any
|
|
147
|
+
Assigned
|
|
148
|
+
Bidi_Control Bidi_C
|
|
149
|
+
Bidi_Mirrored Bidi_M
|
|
150
|
+
Case_Ignorable CI
|
|
151
|
+
Cased
|
|
152
|
+
Changes_When_Casefolded CWCF
|
|
153
|
+
Changes_When_Casemapped CWCM
|
|
154
|
+
Changes_When_Lowercased CWL
|
|
155
|
+
Changes_When_NFKC_Casefolded CWKCF
|
|
156
|
+
Changes_When_Titlecased CWT
|
|
157
|
+
Changes_When_Uppercased CWU
|
|
158
|
+
Dash
|
|
159
|
+
Default_Ignorable_Code_Point DI
|
|
160
|
+
Deprecated Dep
|
|
161
|
+
Diacritic Dia
|
|
162
|
+
Emoji
|
|
163
|
+
Emoji_Component EComp
|
|
164
|
+
Emoji_Modifier EMod
|
|
165
|
+
Emoji_Modifier_Base EBase
|
|
166
|
+
Emoji_Presentation EPres
|
|
167
|
+
Extended_Pictographic ExtPict
|
|
168
|
+
Extender Ext
|
|
169
|
+
Grapheme_Base Gr_Base
|
|
170
|
+
Grapheme_Extend Gr_Ext
|
|
171
|
+
Hex_Digit Hex
|
|
172
|
+
IDS_Binary_Operator IDSB
|
|
173
|
+
IDS_Trinary_Operator IDST
|
|
174
|
+
ID_Continue IDC
|
|
175
|
+
ID_Start IDS
|
|
176
|
+
Ideographic Ideo
|
|
177
|
+
Join_Control Join_C
|
|
178
|
+
Logical_Order_Exception LOE
|
|
179
|
+
Lowercase Lower
|
|
180
|
+
Math
|
|
181
|
+
Noncharacter_Code_Point NChar
|
|
182
|
+
Pattern_Syntax Pat_Syn
|
|
183
|
+
Pattern_White_Space Pat_WS
|
|
184
|
+
Quotation_Mark QMark
|
|
185
|
+
Radical
|
|
186
|
+
Regional_Indicator RI
|
|
187
|
+
Sentence_Terminal STerm
|
|
188
|
+
Soft_Dotted SD
|
|
189
|
+
Terminal_Punctuation Term
|
|
190
|
+
Unified_Ideograph UIdeo
|
|
191
|
+
Uppercase Upper
|
|
192
|
+
Variation_Selector VS
|
|
193
|
+
White_Space space
|
|
194
|
+
XID_Continue XIDC
|
|
195
|
+
XID_Start XIDS`.split(/\s/).map(e=>[ff(e),e])),RB=new Map([["s",Ot(383)],[Ot(383),"s"]]),OB=new Map([[Ot(223),Ot(7838)],[Ot(107),Ot(8490)],[Ot(229),Ot(8491)],[Ot(969),Ot(8486)]]),DB=new Map([jr(453),jr(456),jr(459),jr(498),...ym(8072,8079),...ym(8088,8095),...ym(8104,8111),jr(8124),jr(8140),jr(8188)]),MB=new Map([["alnum",Ae`[\p{Alpha}\p{Nd}]`],["alpha",Ae`\p{Alpha}`],["ascii",Ae`\p{ASCII}`],["blank",Ae`[\p{Zs}\t]`],["cntrl",Ae`\p{Cc}`],["digit",Ae`\p{Nd}`],["graph",Ae`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",Ae`\p{Lower}`],["print",Ae`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",Ae`[\p{P}\p{S}]`],["space",Ae`\p{space}`],["upper",Ae`\p{Upper}`],["word",Ae`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",Ae`\p{AHex}`]]);function IB(e,t){const n=[];for(let i=e;i<=t;i++)n.push(i);return n}function jr(e){const t=Ot(e);return[t.toLowerCase(),t]}function ym(e,t){return IB(e,t).map(n=>jr(n))}var IT=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function NB(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};NT(e);const i={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Dg(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};vl(e,zB,i);const o={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},s={currentFlags:o,prevFlags:null,globalFlags:o,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:i.subroutineRefMap};vl(e,PB,s);const l={groupsByName:s.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:s.reffedNodesByReferencer};return vl(e,HB,l),e._originMap=s.groupOriginByCopy,e._strategy=i.strategy,e}var zB={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:i,kind:o}=e;if(o==="repeater"){const s=Qn();s.body[0].body.push(_o({negate:!0,body:i}),Pa("Any"));const l=Qn();l.body[0].body.push(kT("greedy",0,1/0,s)),n(vt(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(s=>s.kind==="flags");for(let s=n+1;s<t.body.length;s++){const l=t.body[s];Rl(i,l,[]).push(...o)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const n=PT(t.get(e));if(n){const i=Qn({flags:n});i.body[0].body=e.body,e.body=[vt(i,e)]}}}},Assertion({node:e,parent:t,key:n,container:i,root:o,remove:s,replaceWith:l},c){const{kind:d,negate:f}=e,{asciiWordBoundaries:p,avoidSubclass:m,supportedGNodes:g,wordIsAscii:v}=c;if(d==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${f?"Y":"y"}"`);if(d==="line_end")l(vt(_o({body:[Ho({body:[Ag("string_end")]}),Ho({body:[df(10)]})]}),t));else if(d==="line_start")l(vt(Yi(Ae`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(d==="search_start")if(g.has(e))o.flags.sticky=!0,s();else{const x=i[n-1];if(x&&GB(x))l(vt(_o({negate:!0}),t));else{if(m)throw new Error(Ae`Uses "\G" in a way that requires a subclass`);l(Br(Ag("string_start"),t)),c.strategy="clip_search"}}else if(!(d==="string_end"||d==="string_start"))if(d==="string_end_newline")l(vt(Yi(Ae`(?=\n?\z)`),t));else if(d==="word_boundary"){if(!v&&!p){const x=`(?:(?<=${Wi})(?!${Wi})|(?<!${Wi})(?=${Wi}))`,S=`(?:(?<=${Wi})(?=${Wi})|(?<!${Wi})(?!${Wi}))`;l(vt(Yi(f?S:x),t))}}else throw new Error(`Unexpected assertion kind "${d}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!bm(n)&&(n=vm(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:i}=e;i&&!bm(i)&&(i=vm(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=id({body:[e]});n(vt(i,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:i,minTargetEs2024:o,digitIsAscii:s,spaceIsAscii:l,wordIsAscii:c}){const{kind:d,negate:f,value:p}=e;if(s&&(d==="digit"||p==="digit")){n(Br(Rg("digit",{negate:f}),t));return}if(l&&(d==="space"||p==="space")){n(vt(xm(Yi(AB),f),t));return}if(c&&(d==="word"||p==="word")){n(Br(Rg("word",{negate:f}),t));return}if(d==="any")n(Br(Pa("Any"),t));else if(d==="digit")n(Br(Pa("Nd",{negate:f}),t));else if(d!=="dot")if(d==="text_segment"){if(i==="strict")throw new Error(Ae`Use of "\X" requires non-strict accuracy`);const m="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",g=Ae`\p{RI}{2}|${m}(?:\u200D${m})*`;n(vt(Yi(Ae`(?>\r\n|${o?Ae`\p{RGI_Emoji}`:g}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(d==="hex")n(Br(Pa("AHex",{negate:f}),t));else if(d==="newline")n(vt(Yi(f?`[^
|
|
196
|
+
]`:`(?>\r
|
|
197
|
+
?|[
|
|
198
|
+
\v\f
\u2028\u2029])`),t));else if(d==="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];f&&(m=`\0-${Ot(m.codePointAt(0)-1)}${Ot(m.codePointAt(2)+1)}-`),n(vt(Yi(`[${m}]`),t))}else n(vt(xm(Yi(MB.get(p)),f),t));else if(d==="property")Yy.has(ff(p))||(e.key="sc");else if(d==="space")n(Br(Pa("space",{negate:f}),t));else if(d==="word")n(vt(xm(Yi(Wi),f),t));else throw new Error(`Unexpected character set kind "${d}"`)},Directive({node:e,parent:t,root:n,remove:i,replaceWith:o,removeAllPrevSiblings:s,removeAllNextSiblings:l}){const{kind:c,flags:d}=e;if(c==="flags")if(!d.enable&&!d.disable)i();else{const f=Qn({flags:d});f.body[0].body=l(),o(vt(f,t),{traverse:!0})}else if(c==="keep"){const f=n.body[0],m=n.body.length===1&&CT(f,{type:"Group"})&&f.body[0].body.length===1?f.body[0]:n;if(t.parent!==m||m.body.length>1)throw new Error(Ae`Uses "\K" in a way that's unsupported`);const g=_o({behind:!0});g.body[0].body=s(),o(vt(g,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(vt(_o({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${i.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=Qn();t.body[0].body.push(e.body),e.body=vt(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let i=!1,o=!1;for(const s of e.body)if(s.body.length===1&&s.body[0].kind==="search_start")s.body.pop();else{const l=jT(s.body);l?(i=!0,Array.isArray(l)?n.push(...l):n.push(l)):o=!0}i&&!o&&n.forEach(s=>t.add(s))},exit(e,{accuracy:t,passedLookbehind:n,strategy:i}){if(t==="strict"&&n&&i)throw new Error(Ae`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!bm(n)&&(n=vm(n,t),e.ref=n)}},PB={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:i,ref:o}=e;i||n.set(e,[...t.get(o).map(({node:s})=>s)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:i},{groupOriginByCopy:o,groupsByName:s,multiplexCapturesToLeftByRef:l,openRefs:c,reffedNodesByReferencer:d}){const f=o.get(e);if(f&&c.has(e.number)){const m=Br(HC(e.number),t);d.set(m,c.get(e.number)),n(m);return}c.set(e.number,e),l.set(e.number,[]),e.name&&Rl(l,e.name,[]);const p=l.get(e.name??e.number);for(let m=0;m<p.length;m++){const g=p[m];if(f===g.node||f&&f===g.origin||e===g.origin){p.splice(m,1);break}}if(l.get(e.number).push({node:e,origin:f}),e.name&&l.get(e.name).push({node:e,origin:f}),e.name){const m=Rl(s,e.name,new Map);let g=!1;if(f)g=!0;else for(const v of m.values())if(!v.hasDuplicateNameToRemove){g=!0;break}s.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:g})}},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=Md(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},i){const{isRecursive:o,ref:s}=e;if(o){let p=t;for(;(p=p.parent)&&!(p.type==="CapturingGroup"&&(p.name===s||p.number===s)););i.reffedNodesByReferencer.set(e,p);return}const l=i.subroutineRefMap.get(s),c=s===0,d=c?HC(0):zT(l,i.groupOriginByCopy,null);let f=d;if(!c){const p=PT(UB(l,g=>g.type==="Group"&&!!g.flags)),m=p?Md(i.globalFlags,p):i.globalFlags;jB(m,i.currentFlags)||(f=Qn({flags:VB(m)}),f.body[0].body.push(d))}n(vt(f,t),{traverse:!c})}},HB={Backreference({node:e,parent:t,replaceWith:n},i){if(e.orphan){i.highestOrphanBackref=Math.max(i.highestOrphanBackref,e.ref);return}const s=i.reffedNodesByReferencer.get(e).filter(l=>BB(l,e));if(!s.length)n(vt(_o({negate:!0}),t));else if(s.length>1){const l=Qn({atomic:!0,body:s.reverse().map(c=>Ho({body:[Lg(c.number)]}))});n(vt(l,t))}else e.ref=s[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=ET();e.body.at(-1).body.push(o)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function NT(e){vl(e,{"*"({node:t,parent:n}){t.parent=n}})}function jB(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function BB(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const i=HT(n.parent);for(const o of i){if(o===n)break;if(o===e||BT(o,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function zT(e,t,n,i){const o=Array.isArray(e)?[]:{};for(const[s,l]of Object.entries(e))s==="parent"?o.parent=Array.isArray(n)?i:n:l&&typeof l=="object"?o[s]=zT(l,t,o,n):(s==="type"&&l==="CapturingGroup"&&t.set(o,t.get(e)??e),o[s]=l);return o}function HC(e){const t=TT(e);return t.isRecursive=!0,t}function UB(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function vm(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 PT(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 VB({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 HT(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function jT(e){const t=e.find(n=>n.kind==="search_start"||$B(n,{negate:!1})||!FB(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=jT(i.body);if(!o)return null;Array.isArray(o)?n.push(...o):n.push(o)}return n}return null}function BT(e,t){const n=HT(e)??[];for(const i of n)if(i===t||BT(i,t))return!0;return!1}function FB({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function GB(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function $B(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&CT(e.body[0],{type:"Assertion",kind:"search_start"})}function bm(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Yi(e,t){const i=wT(e,{...t,unicodePropertyMap:Yy}).body;return i.length>1||i[0].body.length>1?Qn({body:i}):i[0].body[0]}function xm(e,t){return e.negate=t,e}function Br(e,t){return e.parent=t,e}function vt(e,t){return NT(e),e.parent=t,e}function qB(e,t){const n=DT(t),i=Dg(n.target,"ES2024"),o=Dg(n.target,"ES2025"),s=n.rules.recursionLimit;if(!Number.isInteger(s)||s<2||s>20)throw new Error("Invalid recursionLimit; use 2-20");let l=null,c=null;if(!o){const v=[e.flags.ignoreCase];vl(e,WB,{getCurrentModI:()=>v.at(-1),popModI(){v.pop()},pushModI(x){v.push(x)},setHasCasedChar(){v.at(-1)?l=!0:c=!0}})}const d={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||l)&&!c)};let f=e;const p={accuracy:n.accuracy,appliedGlobalFlags:d,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:f,originMap:e._originMap,recursionLimit:s,useAppliedIgnoreCase:!!(!o&&l&&c),useFlagMods:o,useFlagV:i,verbose:n.verbose};function m(v){return p.lastNode=f,f=v,kB(YB[v.type],`Unexpected node type "${v.type}"`)(v,p,m)}const g={pattern:e.body.map(m).join("|"),flags:m(e.flags),options:{...e.options}};return i||(delete g.options.force.v,g.options.disable.v=!0,g.options.unicodeSetsPlugin=null),g._captureTransfers=new Map,g._hiddenCaptures=[],p.captureMap.forEach((v,x)=>{v.hidden&&g._hiddenCaptures.push(x),v.transferTo&&Rl(g._captureTransfers,v.transferTo,[]).push(x)}),g}var WB={"*":{enter({node:e},t){if(BC(e)){const n=t.getCurrentModI();t.pushModI(e.flags?Md({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){BC(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Xy(Ot(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),UT(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&IT.has(e.value)&&t.setHasCasedChar()}},YB={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?Ae`\B`:Ae`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){const{body:i,name:o,number:s}=e,l={ignoreCase:t.currentFlags.ignoreCase},c=t.originMap.get(e);return c&&(l.hidden=!0,s>c.number&&(l.transferTo=c.number)),t.captureMap.set(s,l),`(${o?`?<${o}>`:""}${i.map(n).join("|")})`},Character({value:e},t){const n=Ot(e),i=Ma(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(i!==n)return i;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Xy(n)){const o=MT(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:s}=e;let{body:l}=e;if(i==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");Jn.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&l.some(UC)&&(l=[df(45),...l.filter(f=>!UC(f))]);const c=()=>`[${o?"^":""}${l.map(n).join(i==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||Jn.bugNestedClassIgnoresNegation)&&!o){const p=l.filter(m=>m.type==="CharacterClass"&&m.kind==="union"&&m.negate);if(p.length){const m=Qn(),g=m.body[0];return m.parent=s,g.parent=m,l=l.filter(v=>!p.includes(v)),e.body=l,l.length?(e.parent=g,g.body.push(e)):m.body.pop(),p.forEach(v=>{const x=Ho({body:[v]});v.parent=x,x.parent=m,m.body.push(x)}),n(m)}}t.inCharClass=!0;const f=c();return t.inCharClass=!1,f}const d=l[0];if(i==="union"&&!o&&d&&((!t.useFlagV||!t.verbose)&&s.kind==="union"&&!(Jn.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&s.kind==="intersection"&&l.length===1&&d.type!=="CharacterClassRange"))return l.map(n).join("");if(!t.useFlagV&&s.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},s=Ma(n,o),l=Ma(i,o),c=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const d=UT(e);JB(d).forEach(p=>{c.add(Array.isArray(p)?`${Ma(p[0],o)}-${Ma(p[1],o)}`:Ma(p,o))})}return`${s}-${l}${[...c].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:i},o){if(e==="dot")return o.currentFlags.dotAll?o.appliedGlobalFlags.dotAll||o.useFlagMods?".":"[^]":Ae`[^\n]`;if(e==="digit")return t?Ae`\D`:Ae`\d`;if(e==="property"){if(o.useAppliedIgnoreCase&&o.currentFlags.ignoreCase&&IT.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Ae`\P`:Ae`\p`}{${i?`${i}=`:""}${n}}`}if(e==="word")return t?Ae`\W`:Ae`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:i},o,s){const l=o.currentFlags;n&&(o.currentFlags=Md(l,n));const c=t.map(s).join("|"),d=!o.verbose&&t.length===1&&i.type!=="Quantifier"&&!e&&(!o.useFlagMods||!n)?c:`(?${eU(e,n,o.useFlagMods)}${c})`;return o.currentFlags=l,d},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)+tU(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const i=n.recursionLimit;return t===0?`(?R=${i})`:Ae`\g<${t}&R=${i}>`}},XB=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),KB=new Set(["-","\\","]","^","["]),QB=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),jC=new Map([[9,Ae`\t`],[10,Ae`\n`],[11,Ae`\v`],[12,Ae`\f`],[13,Ae`\r`],[8232,Ae`\u2028`],[8233,Ae`\u2029`],[65279,Ae`\uFEFF`]]),ZB=new RegExp("^\\p{Cased}$","u");function Xy(e){return ZB.test(e)}function UT(e,t){const n=!!t?.firstOnly,i=e.min.value,o=e.max.value,s=[];if(i<65&&(o===65535||o>=131071)||i===65536&&o>=131071)return s;for(let l=i;l<=o;l++){const c=Ot(l);if(!Xy(c))continue;const d=MT(c).filter(f=>{const p=f.codePointAt(0);return p<i||p>o});if(d.length&&(s.push(...d),n))break}return s}function Ma(e,{escDigit:t,inCharClass:n,useFlagV:i}){if(jC.has(e))return jC.get(e);if(e<32||e>126&&e<160||e>262143||t&&nU(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const o=n?i?QB:KB:XB,s=Ot(e);return(o.has(s)?"\\":"")+s}function JB(e){const t=e.map(o=>o.codePointAt(0)).sort((o,s)=>o-s),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 eU(e,t,n){if(e)return">";let i="";if(t&&n){const{enable:o,disable:s}=t;i=(o?.ignoreCase?"i":"")+(o?.dotAll?"s":"")+(s?"-":"")+(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")}return`${i}:`}function tU({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 BC({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function nU(e){return e>47&&e<58}function UC({type:e,value:t}){return e==="Character"&&t===45}var iU=class Mg extends RegExp{#e=new Map;#t=null;#i;#n=null;#r=null;rawOptions={};get source(){return this.#i||"(?:)"}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 s=t;super(s,n),this.#i=s.source,s instanceof Mg&&(this.#e=s.#e,this.#n=s.#n,this.#r=s.#r,this.rawOptions=s.rawOptions)}else{const s={hiddenCaptures:[],strategy:null,transfers:[],...i};super(o?"":t,n),this.#i=t,this.#e=oU(s.hiddenCaptures,s.transfers),this.#r=s.strategy,this.rawOptions=i??{}}o||(this.#t=this)}exec(t){if(!this.#t){const{lazyCompile:o,...s}=this.rawOptions;this.#t=new Mg(this.#i,this.flags,s)}const n=this.global||this.sticky,i=this.lastIndex;if(this.#r==="clip_search"&&n&&i){this.lastIndex=0;const o=this.#o(t.slice(i));return o&&(rU(o,i,t,this.hasIndices),this.lastIndex+=i),o}return this.#o(t)}#o(t){this.#t.lastIndex=this.lastIndex;const n=super.exec.call(this.#t,t);if(this.lastIndex=this.#t.lastIndex,!n||!this.#e.size)return n;const i=[...n];n.length=1;let o;this.hasIndices&&(o=[...n.indices],n.indices.length=1);const s=[0];for(let l=1;l<i.length;l++){const{hidden:c,transferTo:d}=this.#e.get(l)??{};if(c?s.push(null):(s.push(n.length),n.push(i[l]),this.hasIndices&&n.indices.push(o[l])),d&&i[l]!==void 0){const f=s[d];if(!f)throw new Error(`Invalid capture transfer to "${f}"`);if(n[f]=i[l],this.hasIndices&&(n.indices[f]=o[l]),n.groups){this.#n||(this.#n=aU(this.source));const p=this.#n.get(d);p&&(n.groups[p]=i[l],this.hasIndices&&(n.indices.groups[p]=o[l]))}}}return n}};function rU(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 s=o.groups;s&&Object.keys(s).forEach(l=>{const c=s[l];c&&(s[l]=[c[0]+t,c[1]+t])})}}function oU(e,t){const n=new Map;for(const i of e)n.set(i,{hidden:!0});for(const[i,o]of t)for(const s of o)Rl(n,s,{}).transferTo=i;return n}function aU(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let i=0,o=0,s;for(;s=t.exec(e);){const{0:l,groups:{capture:c,name:d}}=s;l==="["?i++:i?l==="]"&&i--:c&&(o++,d&&n.set(o,d))}return n}function sU(e,t){const n=lU(e,t);return n.options?new iU(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function lU(e,t){const n=DT(t),i=wT(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Yy}),o=NB(i,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),s=qB(o,n),l=wB(s.pattern,{captureTransfers:s._captureTransfers,hiddenCaptures:s._hiddenCaptures,mode:"external"}),c=_B(l.pattern),d=SB(c.pattern,{captureTransfers:l.captureTransfers,hiddenCaptures:l.hiddenCaptures}),f={pattern:d.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${s.flags}${s.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const p=d.hiddenCaptures.sort((x,S)=>x-S),m=Array.from(d.captureTransfers),g=o._strategy,v=f.pattern.length>=n.lazyCompileLength;(p.length||m.length||g||v)&&(f.options={...p.length&&{hiddenCaptures:p},...m.length&&{transfers:m},...g&&{strategy:g},...v&&{lazyCompile:v}})}return f}function uU(e,t){return sU(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function cU(e={}){const t={target:"auto",cache:new Map,...e};return t.regexConstructor||=n=>uU(n,{target:t.target}),{createScanner(n){return new E4(n,t)},createString(n){return{content:n}}}}async function VT(e){if(Pk())throw new Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=lm.get(e);if(t!=null)return t;try{let n=m6.get(e);if(n==null&&Object.prototype.hasOwnProperty.call(vg,e)&&(n=vg[e]),n==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const i=n().then(({default:o})=>{const s={name:e,data:o};return Po.has(e)||Po.set(e,s),s});return lm.set(e,i),await i}finally{lm.delete(e)}}function FT(e){return Po.get(e)??VT(e)}const Ig=new Set;function Ol(e){const t=[],n=new Set;for(const m of dU(e.themes)){const g=GT(m)?m.getThemes():[m];for(const v of g){if(n.has(v.name))throw new Error(`Theme collection already contains theme "${v.name}"`);n.add(v.name),t.push(v)}}const i=Object.freeze([...t]),o=Object.freeze(i.filter(m=>m.colorScheme==="light")),s=Object.freeze(i.filter(m=>m.colorScheme==="dark")),l=new Map(i.map(m=>[m.name,m])),c=Object.freeze(i.map(m=>m.name)),d=Object.freeze(o.map(m=>m.name)),f=Object.freeze(s.map(m=>m.name));function p(m){if(m==null)return i;const{colorScheme:g,collection:v}=m;return v==null?g==="light"?o:g==="dark"?s:i:i.filter(x=>x.collection!==v?!1:g==null||x.colorScheme===g)}return{getTheme(m){return l.get(m)},getThemes(m){return p(m)},getThemeNames(m){return m?.collection==null?m?.colorScheme==="light"?d:m?.colorScheme==="dark"?f:c:p(m).map(g=>g.name)},hasTheme(m){return l.has(m)},orderBy(m){return Ol({themes:i.map((g,v)=>({descriptor:g,index:v})).sort((g,v)=>{const x=m(g.descriptor,v.descriptor);return x!==0?x:g.index-v.index}).map(g=>g.descriptor)})},pick(m){const g=[],v=new Set;for(const x of m){if(v.has(x))throw new Error(`Theme collection pick already includes theme "${x}"`);v.add(x);const S=l.get(x);if(S==null)throw new Error(`Theme collection does not contain theme "${x}"`);g.push(S)}return Ol({themes:g})},registerInto(m){for(const g of i)m.registerThemeIfAbsent(g.name,g.load)}}}function dU(e){return fU(e)?[e]:e}function fU(e){return GT(e)||hU(e)}function hU(e){return typeof e.name=="string"&&typeof e.load=="function"}function GT(e){return typeof e.getThemes=="function"}function $T(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var pU=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},mU=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},gU=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function yU(){const e=new Map,t=new Map,n=new Map;let i=0;function o(_,C){if(e.has(_))throw new pU(_);e.set(_,C)}function s(_,C){return e.has(_)?!1:(e.set(_,C),!0)}function l(_){return e.has(_)}function c(_){const C=t.get(_);if(C!==void 0)return Promise.resolve(C);const T=n.get(_);if(T!==void 0)return T;const D=e.get(_);if(D===void 0)return Promise.reject(new mU(_));const I=i,O=D().then(P=>{const j=$T(P);return I===i&&t.set(_,j),n.get(_)===O&&n.delete(_),j}).catch(P=>{throw n.get(_)===O&&n.delete(_),P});return n.set(_,O),O}function d(_){return Promise.all(_.map(C=>c(C)))}function f(_,C){t.set(_,C)}function p(_){for(const[C,T]of _)f(C,T)}function m(_){return t.get(_)}function g(_){const C=[];for(const T of _){const D=t.get(T);if(D===void 0)throw new gU(T);C.push(D)}return C}function v(_){return t.has(_)}function x(_){for(const C of _)if(!t.has(C))return!1;return!0}function S(_){const C=t.get(_);return C!==void 0?C:c(_)}function w(){i++,t.clear(),n.clear()}return{clearResolvedThemes:w,getResolvedOrResolveTheme:S,getResolvedTheme:m,getResolvedThemes:g,hasRegisteredTheme:l,hasResolvedTheme:v,hasResolvedThemes:x,registerTheme:o,registerThemeIfAbsent:s,resolveTheme:c,resolveThemes:d,seedResolvedTheme:f,seedResolvedThemes:p}}const ei=yU();function Ng(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let i;if(typeof n=="string"){if(i=ei.getResolvedTheme(n),i==null)throw new Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else i=n,n=n.name,ei.getResolvedTheme(n)==null&&ei.seedResolvedTheme(n,i);Ig.has(n)||(Ig.add(n),t.loadThemeSync(i))}}function qT({name:e,load:t,colorScheme:n,collection:i,displayName:o}){return{name:e,colorScheme:n,collection:i,displayName:o,load:vU(t)}}function vU(e){return async()=>lf($T(await e()))}const bU="pierre",xU=["pierre-dark","pierre-dark-soft","pierre-dark-vibrant","pierre-dark-protanopia-deuteranopia","pierre-dark-tritanopia"],WT=["pierre-light","pierre-light-soft","pierre-light-vibrant","pierre-light-protanopia-deuteranopia","pierre-light-tritanopia"],SU=[...WT,...xU],_U=new Set(WT);function CU(e){return _U.has(e)?"light":"dark"}const wU={"pierre-dark":"Pierre Dark","pierre-dark-soft":"Pierre Dark Soft","pierre-dark-vibrant":"Pierre Dark Vibrant","pierre-dark-protanopia-deuteranopia":"Pierre Dark Protanopia & Deuteranopia","pierre-dark-tritanopia":"Pierre Dark Tritanopia","pierre-light":"Pierre Light","pierre-light-soft":"Pierre Light Soft","pierre-light-vibrant":"Pierre Light Vibrant","pierre-light-protanopia-deuteranopia":"Pierre Light Protanopia & Deuteranopia","pierre-light-tritanopia":"Pierre Light Tritanopia"},EU={"pierre-dark":()=>A(()=>import("./pierre-dark-CyvmCCZW.js"),[],import.meta.url),"pierre-dark-soft":()=>A(()=>import("./pierre-dark-soft-BHGpRqa4.js"),[],import.meta.url),"pierre-dark-vibrant":()=>A(()=>import("./pierre-dark-vibrant-BWBVywrn.js"),[],import.meta.url),"pierre-dark-protanopia-deuteranopia":()=>A(()=>import("./pierre-dark-protanopia-deuteranopia-Rgc0TwpF.js"),[],import.meta.url),"pierre-dark-tritanopia":()=>A(()=>import("./pierre-dark-tritanopia-Beq2gCRQ.js"),[],import.meta.url),"pierre-light":()=>A(()=>import("./pierre-light-480U9XYS.js"),[],import.meta.url),"pierre-light-soft":()=>A(()=>import("./pierre-light-soft-CVdyfjmI.js"),[],import.meta.url),"pierre-light-vibrant":()=>A(()=>import("./pierre-light-vibrant-DdTDNdfJ.js"),[],import.meta.url),"pierre-light-protanopia-deuteranopia":()=>A(()=>import("./pierre-light-protanopia-deuteranopia-CaVOBURG.js"),[],import.meta.url),"pierre-light-tritanopia":()=>A(()=>import("./pierre-light-tritanopia-B4_gpKOM.js"),[],import.meta.url)};function kU(e){return qT({name:e,collection:bU,colorScheme:CU(e),displayName:wU[e],load:EU[e]})}const YT=Ol({themes:SU.map(e=>kU(e))}),TU="shiki",XT=["ayu-light","catppuccin-latte","everforest-light","github-light","github-light-default","github-light-high-contrast","gruvbox-light-hard","gruvbox-light-medium","gruvbox-light-soft","horizon-bright","kanagawa-lotus","light-plus","material-theme-lighter","min-light","night-owl-light","one-light","rose-pine-dawn","slack-ochin","snazzy-light","solarized-light","vitesse-light"],AU=["andromeeda","aurora-x","ayu-dark","ayu-mirage","catppuccin-frappe","catppuccin-macchiato","catppuccin-mocha","dark-plus","dracula","dracula-soft","everforest-dark","github-dark","github-dark-default","github-dark-dimmed","github-dark-high-contrast","gruvbox-dark-hard","gruvbox-dark-medium","gruvbox-dark-soft","horizon","houston","kanagawa-dragon","kanagawa-wave","laserwave","material-theme","material-theme-darker","material-theme-ocean","material-theme-palenight","min-dark","monokai","night-owl","nord","one-dark-pro","plastic","poimandres","red","rose-pine","rose-pine-moon","slack-dark","solarized-dark","synthwave-84","tokyo-night","vesper","vitesse-black","vitesse-dark"],LU=new Set(XT);function RU(e){return LU.has(e)?"light":"dark"}const OU={andromeeda:()=>A(()=>import("./andromeeda-C4gqWexZ.js"),[],import.meta.url),"aurora-x":()=>A(()=>import("./aurora-x-D-2ljcwZ.js"),[],import.meta.url),"ayu-dark":()=>A(()=>import("./ayu-dark-DYE7WIF3.js"),[],import.meta.url),"ayu-light":()=>A(()=>import("./ayu-light-BA47KaF1.js"),[],import.meta.url),"ayu-mirage":()=>A(()=>import("./ayu-mirage-32ctXXKs.js"),[],import.meta.url),"catppuccin-frappe":()=>A(()=>import("./catppuccin-frappe-CZL1YF0i.js"),[],import.meta.url),"catppuccin-latte":()=>A(()=>import("./catppuccin-latte-DH-8KZSZ.js"),[],import.meta.url),"catppuccin-macchiato":()=>A(()=>import("./catppuccin-macchiato-B7yYVSCf.js"),[],import.meta.url),"catppuccin-mocha":()=>A(()=>import("./catppuccin-mocha-Ct7hS0mc.js"),[],import.meta.url),"dark-plus":()=>A(()=>import("./dark-plus-C3mMm8J8.js"),[],import.meta.url),dracula:()=>A(()=>import("./dracula-BzJJZx-M.js"),[],import.meta.url),"dracula-soft":()=>A(()=>import("./dracula-soft-BXkSAIEj.js"),[],import.meta.url),"everforest-dark":()=>A(()=>import("./everforest-dark-BgDCqdQA.js"),[],import.meta.url),"everforest-light":()=>A(()=>import("./everforest-light-C8M2exoo.js"),[],import.meta.url),"github-dark":()=>A(()=>import("./github-dark-DHJKELXO.js"),[],import.meta.url),"github-dark-default":()=>A(()=>import("./github-dark-default-Cuk6v7N8.js"),[],import.meta.url),"github-dark-dimmed":()=>A(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[],import.meta.url),"github-dark-high-contrast":()=>A(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[],import.meta.url),"github-light":()=>A(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url),"github-light-default":()=>A(()=>import("./github-light-default-D7oLnXFd.js"),[],import.meta.url),"github-light-high-contrast":()=>A(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[],import.meta.url),"gruvbox-dark-hard":()=>A(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[],import.meta.url),"gruvbox-dark-medium":()=>A(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[],import.meta.url),"gruvbox-dark-soft":()=>A(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[],import.meta.url),"gruvbox-light-hard":()=>A(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[],import.meta.url),"gruvbox-light-medium":()=>A(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[],import.meta.url),"gruvbox-light-soft":()=>A(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[],import.meta.url),horizon:()=>A(()=>import("./horizon-BUw7H-hv.js"),[],import.meta.url),"horizon-bright":()=>A(()=>import("./horizon-bright-CUuTKBJd.js"),[],import.meta.url),houston:()=>A(()=>import("./houston-DnULxvSX.js"),[],import.meta.url),"kanagawa-dragon":()=>A(()=>import("./kanagawa-dragon-BuwD2xS4.js"),[],import.meta.url),"kanagawa-lotus":()=>A(()=>import("./kanagawa-lotus-C3DzagqV.js"),[],import.meta.url),"kanagawa-wave":()=>A(()=>import("./kanagawa-wave-DFGoQZhC.js"),[],import.meta.url),laserwave:()=>A(()=>import("./laserwave-DUszq2jm.js"),[],import.meta.url),"light-plus":()=>A(()=>import("./light-plus-B7mTdjB0.js"),[],import.meta.url),"material-theme":()=>A(()=>import("./material-theme-D5KoaKCx.js"),[],import.meta.url),"material-theme-darker":()=>A(()=>import("./material-theme-darker-BfHTSMKl.js"),[],import.meta.url),"material-theme-lighter":()=>A(()=>import("./material-theme-lighter-B0m2ddpp.js"),[],import.meta.url),"material-theme-ocean":()=>A(()=>import("./material-theme-ocean-CyktbL80.js"),[],import.meta.url),"material-theme-palenight":()=>A(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[],import.meta.url),"min-dark":()=>A(()=>import("./min-dark-CafNBF8u.js"),[],import.meta.url),"min-light":()=>A(()=>import("./min-light-CTRr51gU.js"),[],import.meta.url),monokai:()=>A(()=>import("./monokai-BRVnQi9A.js"),[],import.meta.url),"night-owl":()=>A(()=>import("./night-owl-C39BiMTA.js"),[],import.meta.url),"night-owl-light":()=>A(()=>import("./night-owl-light-CMTm3GFP.js"),[],import.meta.url),nord:()=>A(()=>import("./nord-Ddv68eIx.js"),[],import.meta.url),"one-dark-pro":()=>A(()=>import("./one-dark-pro-DVMEJ2y_.js"),[],import.meta.url),"one-light":()=>A(()=>import("./one-light-C3Wv6jpd.js"),[],import.meta.url),plastic:()=>A(()=>import("./plastic-3e1v2bzS.js"),[],import.meta.url),poimandres:()=>A(()=>import("./poimandres-CS3Unz2-.js"),[],import.meta.url),red:()=>A(()=>import("./red-hvxz__6c.js"),[],import.meta.url),"rose-pine":()=>A(()=>import("./rose-pine-5qJOZa0Y.js"),[],import.meta.url),"rose-pine-dawn":()=>A(()=>import("./rose-pine-dawn-zx0QlTCp.js"),[],import.meta.url),"rose-pine-moon":()=>A(()=>import("./rose-pine-moon-C9pEdX9L.js"),[],import.meta.url),"slack-dark":()=>A(()=>import("./slack-dark-BthQWCQV.js"),[],import.meta.url),"slack-ochin":()=>A(()=>import("./slack-ochin-DqwNpetd.js"),[],import.meta.url),"snazzy-light":()=>A(()=>import("./snazzy-light-Bw305WKR.js"),[],import.meta.url),"solarized-dark":()=>A(()=>import("./solarized-dark-CpvCGNkr.js"),[],import.meta.url),"solarized-light":()=>A(()=>import("./solarized-light-Dlz6yCKv.js"),[],import.meta.url),"synthwave-84":()=>A(()=>import("./synthwave-84-CbfX1IO0.js"),[],import.meta.url),"tokyo-night":()=>A(()=>import("./tokyo-night-hegEt444.js"),[],import.meta.url),vesper:()=>A(()=>import("./vesper-DRje8inN.js"),[],import.meta.url),"vitesse-black":()=>A(()=>import("./vitesse-black-Bkuqu6BP.js"),[],import.meta.url),"vitesse-dark":()=>A(()=>import("./vitesse-dark-D0r3Knsf.js"),[],import.meta.url),"vitesse-light":()=>A(()=>import("./vitesse-light-CVO1_9PV.js"),[],import.meta.url)};function VC(e){return qT({name:e,collection:TU,colorScheme:RU(e),load:OU[e]})}const KT=Ol({themes:Object.freeze([...XT.map(e=>VC(e)),...AU.map(e=>VC(e))])});Ol({themes:[YT,KT]});function QT(e){if(Pk())throw new Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(ei.hasRegisteredTheme(e))return;const t=KT.getTheme(e);if(t!=null){ei.registerThemeIfAbsent(t.name,t.load);return}throw new Error(`No valid theme loader registered for "${e}"`)}function ZT(e,t){if(t.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function DU(e){QT(e);const t=await ei.resolveTheme(e);return ZT(e,t),t}function MU(e){return ei.getResolvedTheme(e)??DU(e)}let mi;async function Id({themes:e,langs:t,preferredHighlighter:n="shiki-js"}){mi??=w4({themes:[],langs:["text"],engine:n==="shiki-wasm"?Vk(A(()=>import("./wasm-CG6Dc4jp.js"),[],import.meta.url)):cU()});const i=IU(mi)?await mi:mi;mi=i;const o=[];for(const l of t){if(l==="text"||l==="ansi")continue;const c=FT(l);"then"in c?o.push(c):oC(c,i)}const s=[];for(const l of e){const c=MU(l);"then"in c?s.push(c):Ng(c,mi)}return(o.length>0||s.length>0)&&await Promise.all([Promise.all(o).then(l=>{oC(l,i)}),Promise.all(s).then(l=>{Ng(l,i)})]),i}function JT(){if(mi!=null&&!("then"in mi))return mi}function IU(e=mi){return e!=null&&"then"in e}for(const e of YT.getThemes())ei.registerThemeIfAbsent(e.name,e.load);function Dl(e=bt){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}function bl(e){for(const t of Dl(e))if(!Ig.has(t))return!1;return!0}function zg(e){return ei.hasResolvedThemes(e)}function Zi(e,t){return ns(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function mf(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function Pg(e){return Le({tagName:"div",children:[Le({tagName:"div",children:e.annotations?.map(t=>Le({tagName:"slot",properties:{name:t}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function NU(e){switch(e){case"file":return"diffs-icon-file-code";case"change":return"diffs-icon-symbol-modified";case"new":return"diffs-icon-symbol-added";case"deleted":return"diffs-icon-symbol-deleted";case"rename-pure":case"rename-changed":return"diffs-icon-symbol-moved"}}function eA({fileOrDiff:e,mode:t,stickyHeader:n}){const i="type"in e?e:void 0,o={"data-diffs-header":t,"data-change-type":i?.type,"data-sticky":n?"":void 0};return Le({tagName:"div",children:[t==="custom"?Le({tagName:"slot",properties:{name:Gl}}):zU({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:i?.type??"file"}),...t==="custom"?[]:[PU(i)]],properties:o})}function zU({name:e,prevName:t,iconType:n}){const i=[Le({tagName:"slot",properties:{name:zy}}),xd({name:NU(n),properties:{"data-change-icon":n}})];return t!=null&&(i.push(Le({tagName:"div",children:[Le({tagName:"bdi",children:[Si(t)]})],properties:{"data-prev-name":""}})),i.push(xd({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),i.push(Le({tagName:"div",children:[Le({tagName:"bdi",children:[Si(e)]})],properties:{"data-title":""}})),i.push(Le({tagName:"slot",properties:{name:Py}})),Le({tagName:"div",children:i,properties:{"data-header-content":""}})}function PU(e){const t=[];if(e!=null){let n=0,i=0;for(const o of e.hunks)n+=o.additionLines,i+=o.deletionLines;(i>0||n===0)&&t.push(Le({tagName:"span",children:[Si(`-${i}`)],properties:{"data-deletions-count":""}})),(n>0||i===0)&&t.push(Le({tagName:"span",children:[Si(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push(Le({tagName:"slot",properties:{name:Hy}})),Le({tagName:"div",children:t,properties:{"data-metadata":""}})}function tA(e){return Le({tagName:"pre",properties:HU(e)})}function HU({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:i,split:o,totalLines:s,type:l,customProperties:c}){return{...c,"data-diff":l==="diff"?"":void 0,"data-file":l==="file"?"":void 0,"data-diff-type":l==="diff"?o?"split":"single":void 0,"data-overflow":i,"data-disable-line-numbers":n?"":void 0,"data-background":t?void 0:"","data-indicators":e==="bars"||e==="classic"?e:void 0,style:`--diffs-min-number-column-width-default:${`${s}`.length}ch;`}}const So=new Map;let jU=0;const rl={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",jbuilder:"ruby",builder:"ruby",rabl:"ruby",arb:"ruby",ru:"ruby",podspec:"ruby",Gemfile:"ruby",Rakefile:"ruby",Guardfile:"ruby",Capfile:"ruby",Berksfile:"ruby",Brewfile:"ruby",Vagrantfile:"ruby",Thorfile:"ruby",Appraisals:"ruby",Dangerfile:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",mts:"typescript",cts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function rn(e){if(So.has(e))return So.get(e)??"text";if(rl[e]!=null)return rl[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(So.has(t[1]))return So.get(t[1])??"text";if(rl[t[1]]!=null)return rl[t[1]]??"text"}const n=e.match(/\.([^.]+)$/)?.[1]??"";return So.has(n)?So.get(n)??"text":rl[n]??"text"}function BU(){return jU}function UU(){return Object.fromEntries(So)}function nA(e,{theme:t,preferredHighlighter:n="shiki-js"}){return{langs:[e??"text"],themes:Dl(t),preferredHighlighter:n}}function ti(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}function VU(e,t,n){const i=typeof n.lineInfo=="function"?n.lineInfo(t):n.lineInfo[t-1];if(i==null){const o=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(o,{node:e,line:t,state:n}),new Error(o)}return e.tagName="div",e.properties["data-line"]=i.lineNumber,e.properties["data-alt-line"]=i.altLineNumber,e.properties["data-line-type"]=i.type,e.properties["data-line-index"]=i.lineIndex,e.children.length===0&&e.children.push(Si(`
|
|
199
|
+
`)),e}const Dc=Symbol("no-token"),Sm=Symbol("multiple-tokens");function iA(e){const t=FU(e);if(t!=null)return t;let n=Dc;const i=[];let o=[],s;const l=()=>{if(o.length===0||s==null){o=[],s=void 0;return}if(o.length===1){const d=o[0];if(d?.type==="element"){GU(d,s);for(const f of d.children)rd(f)}else rd(d);i.push(d),o=[],s=void 0;return}for(const d of o)rd(d);i.push(Le({tagName:"span",properties:{"data-char":s},children:o})),o=[],s=void 0},c=d=>{if(d!==Dc){if(d===Sm){n=Sm;return}if(n===Dc){n=d;return}n!==d&&(n=Sm)}};for(const d of e.children){const f=d.type==="element"?iA(d):Dc;if(c(f),typeof f!="number"){l(),i.push(d);continue}s!=null&&s!==f&&l(),s??=f,o.push(d)}return l(),e.children=i,n}function FU(e){const t=e.properties["data-char"];if(typeof t=="number")return t}function rd(e){if(e.type==="element"){e.properties["data-char"]=void 0;for(const t of e.children)rd(t)}}function GU(e,t){e.properties["data-char"]=t}function $U(e={}){const{classPrefix:t="__shiki_",classSuffix:n="",classReplacer:i=c=>c}=e,o=new Map;function s(c){return Object.entries(c).map(([d,f])=>`${d}:${f}`).join(";")}function l(c){const d=typeof c=="string"?c:s(c);let f=t+qU(d)+n;return f=i(f),o.has(f)||o.set(f,typeof c=="string"?c:{...c}),f}return{name:"@shikijs/transformers:style-to-class",pre(c){if(!c.properties.style)return;const d=l(c.properties.style);delete c.properties.style,this.addClassToHast(c,d)},tokens(c){for(const d of c)for(const f of d){if(!f.htmlStyle)continue;const p=l(f.htmlStyle);f.htmlStyle={},f.htmlAttrs||={},f.htmlAttrs.class?f.htmlAttrs.class+=` ${p}`:f.htmlAttrs.class=p}},getClassRegistry(){return o},getCSS(){let c="";for(const[d,f]of o.entries())c+=`.${d}{${typeof f=="string"?f:s(f)}}`;return c},clearRegistry(){o.clear()}}}function qU(e,t=0){let n=3735928559^t,i=1103547991^t;for(let o=0,s;o<e.length;o++)s=e.charCodeAt(o),n=Math.imul(n^s,2654435761),i=Math.imul(i^s,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507),i^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&i)+(n>>>0)).toString(36).slice(0,6)}function rA(e=!1,t=!1){const n={lineInfo:[]},i=[{line(o){return delete o.properties.class,o},pre(o){const s=K5(o),l=[];if(s!=null){let c=1;for(const d of s.children)d.type==="element"&&(e&&iA(d),l.push(VU(d,c,n)),c++);s.children=l}return o},...e?{tokens(o){for(const s of o){let l=0;for(const c of s){const d=c;d.__lineChar??=l,l+=c.content.length}}},preprocess(o,s){s.mergeWhitespaces="never"},span(o,s,l,c,d){if(d?.offset!=null&&d.content!=null){const f=d.__lineChar;return f!=null&&(o.properties["data-char"]=f),o}return o}}:null}];return t&&i.push(WU,FC),e&&i.push({line:o=>(o.type==="element"&&o.children.length===0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]}),o)}),{state:n,transformers:i,toClass:FC}}const FC=$U({classPrefix:"hl-"}),WU={name:"token-style-normalizer",tokens(e){for(const t of e)for(const n of t){if(n.htmlStyle!=null)continue;const i={};n.color!=null&&(i.color=n.color),n.bgColor!=null&&(i["background-color"]=n.bgColor),n.fontStyle!=null&&n.fontStyle!==0&&((n.fontStyle&1)!==0&&(i["font-style"]="italic"),(n.fontStyle&2)!==0&&(i["font-weight"]="bold"),(n.fontStyle&4)!==0&&(i["text-decoration"]="underline")),Object.keys(i).length>0&&(n.htmlStyle=i)}}};function Ln(e){return`--${e==="token"?"diffs-token":"diffs"}-`}const YU=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,XU=/^0(?:\.0+)?%?$/;function KU(e){const t=e.indexOf("(");if(t<=0||!e.endsWith(")"))return;const n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;const i=e.slice(t+1,-1).trim();if(i.length===0)return;const o=i.lastIndexOf("/");if(o!==-1)return i.slice(o+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){const s=i.split(",");if(s.length===4)return s[3]?.trim()}}function QU(e){const t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;const n=t[1];let i,o=1;return n.length===3?i=n.split("").map(s=>s+s).join(""):n.length===6?i=n:(i=n.slice(0,6),o=parseInt(n.slice(6,8),16)/255),[parseInt(i.slice(0,2),16),parseInt(i.slice(2,4),16),parseInt(i.slice(4,6),16),o]}function _m(e){if(e==null)return null;const t=QU(e);if(t==null)return null;const n=t[0]/255,i=t[1]/255,o=t[2]/255,s=l=>l<=.03928?l/12.92:((l+.055)/1.055)**2.4;return .2126*s(n)+.7152*s(i)+.0722*s(o)}function GC(e){if(e==null)return!1;const t=e.trim().toLowerCase();if(t==="transparent"||YU.test(t))return!0;const n=KU(t);return n!=null&&XU.test(n)}function ZU(e,t,n){if(t==null||n==null)return!1;const i=_m(e),o=_m(t),s=_m(n);return i==null||o==null||s==null?!1:Math.abs(i-s)<Math.abs(i-o)}const $C=new WeakMap;function Cm(e){const t=$C.get(e);if(t!=null)return t;const n=e.colors??{},i={...n},o=n["editor.background"]??e.bg,s=n["editor.foreground"]??e.fg,l=n["sideBar.background"]??o,c=n["sideBar.foreground"]??s;ui(i,"editor.background",o),ui(i,"editor.foreground",s),ui(i,"sideBar.background",l),ui(i,"sideBar.foreground",c),ui(i,"input.background",n["input.background"]??l),ui(i,"sideBarSectionHeader.foreground",n["sideBarSectionHeader.foreground"]??c),ui(i,"list.activeSelectionForeground",n["list.activeSelectionForeground"]??c),ui(i,"gitDecoration.addedResourceForeground",wm(n["gitDecoration.addedResourceForeground"],n["terminal.ansiGreen"],n["editorGutter.addedBackground"])),ui(i,"gitDecoration.modifiedResourceForeground",wm(n["gitDecoration.modifiedResourceForeground"],n["terminal.ansiBlue"],n["editorGutter.modifiedBackground"])),ui(i,"gitDecoration.deletedResourceForeground",wm(n["gitDecoration.deletedResourceForeground"],n["terminal.ansiRed"],n["editorGutter.deletedBackground"]));const d=(GC(n["list.focusOutline"])?void 0:n["list.focusOutline"])??(GC(n.focusBorder)?void 0:n.focusBorder);d!=null?i["list.focusOutline"]=d:delete i["list.focusOutline"];const f=n["list.hoverBackground"];f!=null&&(JU(f,l)||ZU(f,l,c))&&delete i["list.hoverBackground"];const p=Object.freeze({...e,colors:Object.freeze(i)});return $C.set(e,p),p}function ui(e,t,n){n!=null&&n!==""&&(e[t]=n)}function wm(...e){for(const t of e)if(t!=null&&t!=="")return t}function JU(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function oA({theme:e=bt,highlighter:t,prefix:n}){let i="";if(typeof e=="string"){const o=t.getTheme(e),s=Cm(o);i+=`color:${s.fg};`,i+=`background-color:${s.bg};`,i+=`${Ln("global")}fg:${s.fg};`,i+=`${Ln("global")}bg:${s.bg};`,i+=Em(o,n)}else{let o=t.getTheme(e.dark),s=Cm(o);i+=`${Ln("global")}dark:${s.fg};`,i+=`${Ln("global")}dark-bg:${s.bg};`,i+=Em(o,"dark"),o=t.getTheme(e.light),s=Cm(o),i+=`${Ln("global")}light:${s.fg};`,i+=`${Ln("global")}light-bg:${s.bg};`,i+=Em(o,"light")}return i}function Em(e,t){t=t!=null?`${t}-`:"";let n="";const i=e.colors?.["gitDecoration.addedResourceForeground"]??e.colors?.["terminal.ansiGreen"];i!=null&&(n+=`${Ln("global")}${t}addition-color:${i};`);const o=e.colors?.["gitDecoration.deletedResourceForeground"]??e.colors?.["terminal.ansiRed"];o!=null&&(n+=`${Ln("global")}${t}deletion-color:${o};`);const s=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];return s!=null&&(n+=`${Ln("global")}${t}modified-color:${s};`),n}function Hg(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t.children;"children"in t?t=t.children[0]:t=null}throw console.error(e),new Error("getLineNodes: Unable to find children")}const qC=10,WC=13,eV=4,tV=40;function nV(e){const t=[0];let n=e.indexOf("\r"),i=e.indexOf(`
|
|
200
|
+
`),o=0,s=0;for(;n!==-1||i!==-1;){let l;if(n!==-1&&(i===-1||n<i)?i===n+1?(l=i+1,n=e.indexOf("\r",l),i=e.indexOf(`
|
|
201
|
+
`,l)):(l=n+1,n=e.indexOf("\r",l)):(l=i+1,i=e.indexOf(`
|
|
202
|
+
`,l)),t.push(l),++s===eV){if(l-o<=tV){for(let c=l;c<e.length;c++){const d=e.charCodeAt(c);(d===qC||d===WC)&&(d===WC&&c+1<e.length&&e.charCodeAt(c+1)===qC&&c++,t.push(c+1))}return t}o=l,s=0}}return t}function od(e){const t=nV(e);return Array.from({length:t.length},(n,i)=>{const o=t[i],s=t[i+1]??e.length;return e.slice(o,s)})}const iV={forcePlainText:!1};function aA(e,t,{theme:n=bt,tokenizeMaxLineLength:i,useTokenTransformer:o},{forcePlainText:s,startingLine:l,totalLines:c,lines:d}=iV){s?(l??=0,c??=1/0):(l=0,c=1/0);const f=l>0||c<1/0,{state:p,transformers:m}=rA(o),g=s?"text":e.lang??rn(e.name),v=typeof n=="string"?t.getTheme(n).type:void 0,x=oA({theme:n,highlighter:t});p.lineInfo=C=>({type:"context",lineIndex:C-1+l,lineNumber:C+l});const S=typeof n=="string"?{lang:g,theme:n,transformers:m,defaultColor:!1,cssVariablePrefix:Ln("token"),tokenizeMaxLineLength:i,tokenizeTimeLimit:0}:{lang:g,themes:n,transformers:m,defaultColor:!1,cssVariablePrefix:Ln("token"),tokenizeMaxLineLength:i,tokenizeTimeLimit:0},w=Hg(t.codeToHast(f?rV(d??od(e.contents),l,c):e.contents,S)),_=f?new Array(l):w;return f&&_.push(...w),{code:_,themeStyles:x,baseThemeType:v}}function rV(e,t,n){if(e.length===0)return"";const i=Math.min(t+n,e.length);return e.slice(t,i).join("")}const sA="-1,-1";function jg(e){return e?.some(t=>t.lineNumber===0)??!1}function Bg(e){const t=e[0];return t!=null&&t.length>0?t:void 0}function gf(e){return e.startingLine===0&&e.totalLines>0}function lA(e,t){return e.endsWith(`\r
|
|
203
|
+
`)?t+`\r
|
|
204
|
+
`:e.endsWith("\r")?t+"\r":e.endsWith(`
|
|
205
|
+
`)?t+`
|
|
206
|
+
`:t}function uA(e,t){return Le({tagName:"div",children:e,properties:{"data-content":"",style:`grid-row: span ${t}`}})}function Ml(e){return(e.lang??rn(e.name))==="text"}function Mc(e,t){return t.cacheKey==null?e.file===t&&e.sourceContents===t.contents:e.cacheKey===t.cacheKey}let oV=-1;var aV=class{options;onRenderUpdate;workerManager;__id=`file-renderer:${++oV}`;highlighter;renderCache;computedLang="text";lineAnnotations={};lineCache;pendingStructuralRows;textDocumentCache=new WeakMap;editSessionActive=!1;constructor(e={theme:bt},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=bl(e.theme??bt)?JT():void 0)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setLineAnnotations(e){this.lineAnnotations={};for(const t of e){const n=this.lineAnnotations[t.lineNumber]??[];this.lineAnnotations[t.lineNumber]=n,n.push(t)}}cleanUp(){this.recycle(),this.workerManager=void 0,this.onRenderUpdate=void 0}beginEditSession(){this.editSessionActive=!0}endEditSession(){this.editSessionActive=!1}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}recycle(){this.clearRenderCache(),this.highlighter=void 0,this.workerManager?.cleanUpTasks(this),this.lineCache=void 0,this.endEditSession(),this.textDocumentCache=new WeakMap}syncEditedContentsToFile(){const{renderCache:e,lineCache:t}=this;e?.isDirty!==!0||t==null||!Mc(t,e.file)||(e.file.contents=t.lines.join(""))}hasUnkeyedFileContentsChanged(e){const{lineCache:t}=this;return e.cacheKey==null&&t!=null&&t.file===e&&t.sourceContents!==e.contents}invalidateChangedUnkeyedFile(e){this.hasUnkeyedFileContentsChanged(e)&&(this.workerManager?.cleanUpTasks(this),this.clearRenderCache(),this.lineCache=void 0,this.textDocumentCache=new WeakMap)}clearRenderCache(){this.syncEditedContentsToFile(),this.pendingStructuralRows=void 0;const e=this.renderCache;this.renderCache=void 0,e!=null&&e.isDirty===!0&&e.file.cacheKey!=null&&this.workerManager?.evictFileFromCache(e.file.cacheKey)}hydrate(e){const{options:t}=this.getRenderOptions(e),n=km(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());let i=this.workerManager?.getFileResultCache(e);i!=null&&!Zi(t,i.options)&&(i=void 0),this.renderCache??={file:e,options:t,highlighted:!n&&!Ml(e),result:n?void 0:i?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightFileAST(this,e):this.highlighter==null&&(this.computedLang=e.lang??rn(e.name),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getFileRenderOptions().theme??this.options.theme??bt}getEffectiveCodeOptions(){const e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getFileRenderOptions():void 0;return{theme:this.getLocalHighlightTheme(),tokenizeMaxLineLength:e?.tokenizeMaxLineLength??this.options.tokenizeMaxLineLength}}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0){const o=this.workerManager.getFileRenderOptions();return this.editSessionActive&&o.useTokenTransformer!==!0?{...o,useTokenTransformer:!0}:o}const{tokenizeMaxLineLength:i=1e3}=this.options;return{theme:this.getLocalHighlightTheme(),useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:i}})(),{renderCache:n}=this;return n?.result==null?{options:t,forceHighlight:!0}:!Kn(e,n.file)||!Zi(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getOrCreateLineCache(e){this.invalidateChangedUnkeyedFile(e);let{lineCache:t}=this;return(t==null||!Mc(t,e))&&(t={cacheKey:e.cacheKey,file:e,sourceContents:e.contents,lines:od(e.contents)}),this.lineCache=t,t.lines}getLineCount(e){const t=this.getOrCreateLineCache(e);return this.textDocumentCache.get(e)?.lineCount??t.length}updateRenderCache(e,t,n=!1){if(this.pendingStructuralRows=void 0,this.renderCache==null)return;const{file:i,result:o}=this.renderCache;if(o==null)return;const s=n?new Map:void 0;this.pendingStructuralRows=s;const l=this.lineCache!=null&&Mc(this.lineCache,i)?this.lineCache:void 0;for(const[c,d]of e){if(s===void 0&&l!=null&&c<l.lines.length){const p=d.map(m=>m[2]).join("");l.lines[c]=lA(l.lines[c]??"",p)}const f={type:"element",tagName:"div",properties:{"data-line":c+1,"data-line-type":"context","data-line-index":c},children:d.map(([p,m,g])=>p===0&&m===""?g===""?{type:"element",tagName:"br",properties:{},children:[]}:{type:"text",value:g}:{type:"element",tagName:"span",properties:{"data-char":p,style:`color:${m};`},children:[{type:"text",value:g}]})};s!==void 0?s.set(c,f):o.code[c]=f}o.baseThemeType=t,this.renderCache.isDirty=!0}applyDocumentChange(e){const t=this.pendingStructuralRows;if(this.pendingStructuralRows=void 0,this.renderCache==null)return;const{file:n,result:i}=this.renderCache;if(i==null)return;const o=this.lineCache!=null&&Mc(this.lineCache,n)?this.lineCache.lines:od(n.contents),s=od(e.getText());if(o.length!==s.length){const l=Math.min(o.length,s.length);let c=0;for(;c<l&&o[c]===s[c];)c++;let d=0;for(;d<l-c&&o[o.length-1-d]===s[s.length-1-d];)d++;const f=i.code;i.code=new Array(s.length);for(let p=0;p<c;p++)i.code[p]=f[p];for(let p=0;p<d;p++)i.code[s.length-1-p]=f[o.length-1-p];if(t!==void 0)for(const[p,m]of t)p<s.length&&(i.code[p]=m);for(let p=c;p<s.length-d;p++)i.code[p]??={type:"element",tagName:"div",properties:{"data-line":p+1,"data-line-type":"context","data-line-index":p},children:[{type:"element",tagName:"span",properties:{"data-char":0},children:[{type:"text",value:e.getLineText(p)}]}]};for(let p=0;p<i.code.length;p++){const m=i.code[p];m?.type==="element"&&(m.properties["data-line"]=p+1,m.properties["data-line-index"]=p)}this.renderCache.isDirty=!0}this.lineCache={cacheKey:n.cacheKey,file:n,sourceContents:n.contents,lines:s},this.textDocumentCache.set(n,e)}renderFile(e=this.renderCache?.file,t=vd){if(e==null)return;this.invalidateChangedUnkeyedFile(e),this.renderCache?.isDirty===!0&&!Kn(e,this.renderCache.file)&&(this.clearRenderCache(),this.lineCache=void 0,this.textDocumentCache=new WeakMap);let{options:n,forceHighlight:i}=this.getRenderOptions(e);this.renderCache?.isDirty===!0&&!Zi(n,this.renderCache.options)&&this.clearRenderCache();const o=this.getMatchingWorkerResultCache(e,n);o!=null&&!this.hasHighlightedRenderCache(e,n)&&(this.renderCache={file:e,highlighted:!0,renderRange:void 0,...o},i=!1),this.renderCache??={file:e,highlighted:!1,options:n,result:void 0,renderRange:void 0};const s=this.getOrCreateLineCache(e),l=e.contents.length>0,c=!l||Ml(e)||km(s.length,this.getTokenizeMaxLength()),d=!Kn(e,this.renderCache.file),f=!mf(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0)(c||this.renderCache.result==null||!this.renderCache.highlighted&&(d||f))&&(this.renderCache.file=e,this.renderCache.options=n,this.renderCache.highlighted=!1,(this.renderCache.result==null||d||f||i)&&(this.renderCache.result=this.workerManager.getPlainFileAST(e,t.startingLine,t.totalLines,s)),this.renderCache.renderRange=t),!c&&l&&(!this.renderCache.highlighted||i)&&this.workerManager.highlightFileAST(this,e);else{this.computedLang=e.lang??rn(e.name);const p=this.highlighter!=null&&bl(n.theme),m=this.highlighter!=null&&_d(this.computedLang),g=!c&&m;if(this.highlighter!=null&&p&&(i||c||!this.renderCache.highlighted&&g||this.renderCache.result==null)){const{result:v,options:x}=this.renderFileWithHighlighter(e,this.highlighter,c||!m);this.renderCache={file:e,options:x,highlighted:g,result:v,renderRange:void 0}}(!p||!c&&!m)&&this.asyncHighlight(e).then(({result:v,options:x})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.applyHighlightResult(e,v,x,!c)})}return this.renderCache.result!=null?this.processFileResult(this.renderCache.file,t,this.renderCache.result):void 0}async asyncRender(e,t=vd){const{result:n}=await this.asyncHighlight(e);return this.processFileResult(e,t,n)}async asyncHighlight(e){const t=km(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??rn(e.name);const n=this.highlighter!=null&&zg(Dl(this.getLocalHighlightTheme())),i=t||this.highlighter!=null&&_d(this.computedLang);return(this.highlighter==null||!n||!i)&&(this.highlighter=await this.initializeHighlighter()),this.renderFileWithHighlighter(e,this.highlighter,t)}renderFileWithHighlighter(e,t,n=!1){const{options:i}=this.getRenderOptions(e);return{result:aA(e,t,i,{forcePlainText:n}),options:i}}processFileResult(e,t,{code:n,themeStyles:i,baseThemeType:o}){const s=this.getLineCount(e),{disableFileHeader:l=!1}=this.options,c=[],d=Ba(),f=Math.min(t.startingLine+t.totalLines,s);let p=0;const m=gf(t)?Bg(this.lineAnnotations):void 0;m!=null&&(d.children.push(An("context","annotation",1)),c.push(Pg({hunkIndex:-1,lineIndex:-1,annotations:m.map(g=>ti(g))})),p++);for(let g=t.startingLine;g<f;g++){const v=g+1,x=n[g];if(x==null){const w="FileRenderer.processFileResult: Line doesnt exist";throw console.error(w,{name:e.name,lineIndex:g,lineNumber:v}),new Error(w)}d.children.push(Tk("context",v,`${g}`)),c.push(x),p++;const S=this.lineAnnotations[v];S!=null&&(d.children.push(An("context","annotation",1)),c.push(Pg({hunkIndex:0,lineIndex:v,annotations:S.map(w=>ti(w))})),p++)}return d.properties.style=`grid-row: span ${p}`,{gutterAST:d.children??[],contentAST:c,preAST:this.createPreElement(s),headerAST:l?void 0:this.renderHeader(e),totalLines:s,rowCount:p,themeStyles:i,baseThemeType:o,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderHeader(e){const{headerRenderMode:t="default",stickyHeader:n=!1}=this.options;return eA({fileOrDiff:e,mode:t,stickyHeader:n})}renderFullHTML(e){return nn(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push(Le({tagName:"code",children:this.renderCodeAST(e),properties:{"data-code":""}})),{...e.preAST,children:t}}renderCodeAST(e){const t=Ba();return t.children=e.gutterAST,t.properties.style=`grid-row: span ${e.rowCount}`,[t,uA(e.contentAST,e.rowCount)]}renderPartialHTML(e,t=!1){return nn(t?Le({tagName:"code",children:e,properties:{"data-code":""}}):e)}async initializeHighlighter(){return this.highlighter=await Id(nA(this.computedLang,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}onHighlightSuccess(e,t,n,i=!0){this.editSessionActive||this.applyHighlightResult(e,t,n,i)}applyHighlightResult(e,t,n,i=!0){if(this.renderCache==null)return;const o=!Kn(e,this.renderCache.file)||!this.renderCache.highlighted||!Zi(n,this.renderCache.options);this.renderCache={file:e,options:n,highlighted:i,result:t,renderRange:void 0},o&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;const n=this.workerManager?.getFileResultCache(e);if(!(n==null||!Zi(t,n.options)))return n}hasHighlightedRenderCache(e,t){const{renderCache:n}=this;return n?.result!=null&&n.highlighted&&Kn(e,n.file)&&Zi(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}createPreElement(e){const{disableLineNumbers:t=!1,overflow:n="scroll"}=this.options;return tA({type:"file",diffIndicators:"none",disableBackground:!0,disableLineNumbers:t,overflow:n,split:!1,totalLines:e})}};function km(e,t){return e>t}const cA=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
207
|
+
<symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
|
|
208
|
+
<path d="M8.47 4.22a.75.75 0 0 0 0 1.06l1.97 1.97H3.75a.75.75 0 0 0 0 1.5h6.69l-1.97 1.97a.75.75 0 1 0 1.06 1.06l3.25-3.25a.75.75 0 0 0 0-1.06L9.53 4.22a.75.75 0 0 0-1.06 0"/>
|
|
209
|
+
</symbol>
|
|
210
|
+
<symbol id="diffs-icon-brand-github" viewBox="0 0 16 16">
|
|
211
|
+
<path d="M8 0c4.42 0 8 3.58 8 8a8.01 8.01 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27s-1.36.09-2 .27c-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8"/>
|
|
212
|
+
</symbol>
|
|
213
|
+
<symbol id="diffs-icon-chevron" viewBox="0 0 16 16">
|
|
214
|
+
<path d="M1.47 4.47a.75.75 0 0 1 1.06 0L8 9.94l5.47-5.47a.75.75 0 1 1 1.06 1.06l-6 6a.75.75 0 0 1-1.06 0l-6-6a.75.75 0 0 1 0-1.06"/>
|
|
215
|
+
</symbol>
|
|
216
|
+
<symbol id="diffs-icon-chevrons-narrow" viewBox="0 0 10 16">
|
|
217
|
+
<path d="M4.47 2.22a.75.75 0 0 1 1.06 0l3.25 3.25a.75.75 0 0 1-1.06 1.06L5 3.81 2.28 6.53a.75.75 0 0 1-1.06-1.06zM1.22 9.47a.75.75 0 0 1 1.06 0L5 12.19l2.72-2.72a.75.75 0 0 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0l-3.25-3.25a.75.75 0 0 1 0-1.06"/>
|
|
218
|
+
</symbol>
|
|
219
|
+
<symbol id="diffs-icon-diff-split" viewBox="0 0 16 16">
|
|
220
|
+
<path d="M14 0H8.5v16H14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2m-1.5 6.5v1h1a.5.5 0 0 1 0 1h-1v1a.5.5 0 0 1-1 0v-1h-1a.5.5 0 0 1 0-1h1v-1a.5.5 0 0 1 1 0"/><path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h5.5V0zm.5 7.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1" opacity=".3"/>
|
|
221
|
+
</symbol>
|
|
222
|
+
<symbol id="diffs-icon-diff-unified" viewBox="0 0 16 16">
|
|
223
|
+
<path fill-rule="evenodd" d="M16 14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V8.5h16zm-8-4a.5.5 0 0 0-.5.5v1h-1a.5.5 0 0 0 0 1h1v1a.5.5 0 0 0 1 0v-1h1a.5.5 0 0 0 0-1h-1v-1A.5.5 0 0 0 8 10" clip-rule="evenodd"/><path fill-rule="evenodd" d="M14 0a2 2 0 0 1 2 2v5.5H0V2a2 2 0 0 1 2-2zM6.5 3.5a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1z" clip-rule="evenodd" opacity=".4"/>
|
|
224
|
+
</symbol>
|
|
225
|
+
<symbol id="diffs-icon-expand" viewBox="0 0 16 16">
|
|
226
|
+
<path d="M3.47 5.47a.75.75 0 0 1 1.06 0L8 8.94l3.47-3.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06"/>
|
|
227
|
+
</symbol>
|
|
228
|
+
<symbol id="diffs-icon-expand-all" viewBox="0 0 16 16">
|
|
229
|
+
<path d="M11.47 9.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 1 1 1.06-1.06L8 12.94zM7.526 1.418a.75.75 0 0 1 1.004.052l4 4a.75.75 0 1 1-1.06 1.06L8 3.06 4.53 6.53a.75.75 0 1 1-1.06-1.06l4-4z"/>
|
|
230
|
+
</symbol>
|
|
231
|
+
<symbol id="diffs-icon-file-code" viewBox="0 0 16 16">
|
|
232
|
+
<path d="M10.75 0c.199 0 .39.08.53.22l3.5 3.5c.14.14.22.331.22.53v9A2.75 2.75 0 0 1 12.25 16h-8.5A2.75 2.75 0 0 1 1 13.25V2.75A2.75 2.75 0 0 1 3.75 0zm-7 1.5c-.69 0-1.25.56-1.25 1.25v10.5c0 .69.56 1.25 1.25 1.25h8.5c.69 0 1.25-.56 1.25-1.25V5h-1.25A2.25 2.25 0 0 1 10 2.75V1.5z"/><path d="M7.248 6.19a.75.75 0 0 1 .063 1.058L5.753 9l1.558 1.752a.75.75 0 0 1-1.122.996l-2-2.25a.75.75 0 0 1 0-.996l2-2.25a.75.75 0 0 1 1.06-.063M8.69 7.248a.75.75 0 1 1 1.12-.996l2 2.25a.75.75 0 0 1 0 .996l-2 2.25a.75.75 0 1 1-1.12-.996L10.245 9z"/>
|
|
233
|
+
</symbol>
|
|
234
|
+
<symbol id="diffs-icon-plus" viewBox="0 0 16 16">
|
|
235
|
+
<path d="M8 3a.75.75 0 0 1 .75.75v3.5h3.5a.75.75 0 0 1 0 1.5h-3.5v3.5a.75.75 0 0 1-1.5 0v-3.5h-3.5a.75.75 0 0 1 0-1.5h3.5v-3.5A.75.75 0 0 1 8 3"/>
|
|
236
|
+
</symbol>
|
|
237
|
+
<symbol id="diffs-icon-symbol-added" viewBox="0 0 16 16">
|
|
238
|
+
<path d="M8 4a.75.75 0 0 1 .75.75v2.5h2.5a.75.75 0 0 1 0 1.5h-2.5v2.5a.75.75 0 0 1-1.5 0v-2.5h-2.5a.75.75 0 0 1 0-1.5h2.5v-2.5A.75.75 0 0 1 8 4"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
|
|
239
|
+
</symbol>
|
|
240
|
+
<symbol id="diffs-icon-symbol-deleted" viewBox="0 0 16 16">
|
|
241
|
+
<path d="M4 8a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5A.75.75 0 0 1 4 8"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
|
|
242
|
+
</symbol>
|
|
243
|
+
<symbol id="diffs-icon-symbol-diffstat" viewBox="0 0 16 16">
|
|
244
|
+
<path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.75 4.296a.75.75 0 0 0-1.5 0V6.25h-2a.75.75 0 0 0 0 1.5h2v1.5h1.5v-1.5h2a.75.75 0 0 0 0-1.5h-2zM5.25 10a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5z"/>
|
|
245
|
+
</symbol>
|
|
246
|
+
<symbol id="diffs-icon-symbol-ignored" viewBox="0 0 16 16">
|
|
247
|
+
<path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m11.53-2.47a.75.75 0 0 0-1.06-1.06l-6 6a.75.75 0 1 0 1.06 1.06z"/>
|
|
248
|
+
</symbol>
|
|
249
|
+
<symbol id="diffs-icon-symbol-modified" viewBox="0 0 16 16">
|
|
250
|
+
<path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m8 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6"/>
|
|
251
|
+
</symbol>
|
|
252
|
+
<symbol id="diffs-icon-symbol-moved" viewBox="0 0 16 16">
|
|
253
|
+
<path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.495 4.695a.75.75 0 0 0-.05 1.06L10.486 8l-2.041 2.246a.75.75 0 0 0 1.11 1.008l2.5-2.75a.75.75 0 0 0 0-1.008l-2.5-2.75a.75.75 0 0 0-1.06-.051m-4 0a.75.75 0 0 0-.05 1.06l2.044 2.248-1.796 1.995a.75.75 0 0 0 1.114 1.004l2.25-2.5a.75.75 0 0 0-.002-1.007l-2.5-2.75a.75.75 0 0 0-1.06-.05"/>
|
|
254
|
+
</symbol>
|
|
255
|
+
<symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
|
|
256
|
+
<path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706.286.286.71.54 1.41.73V1.86c-.7.19-1.124.444-1.41.73-.324.325-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8m4 6.397c.697.07 1.522.103 2.5.103 1.613 0 2.806-.088 3.704-.288.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5c-.978 0-1.803.033-2.5.103zM0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m7-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z"/>
|
|
257
|
+
</symbol>
|
|
258
|
+
</svg>`;function sV(e,t){return e.lineNumber===t.lineNumber&&e.metadata===t.metadata}function dA(e,t){return e==null||t==null?e===t:lV(e.customProperties,t.customProperties)&&e.type===t.type&&e.diffIndicators===t.diffIndicators&&e.disableBackground===t.disableBackground&&e.disableLineNumbers===t.disableLineNumbers&&e.overflow===t.overflow&&e.split===t.split&&e.totalLines===t.totalLines}const YC={};function lV(e=YC,t=YC){if(e===t)return!0;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const o of n)if(e[o]!==t[o])return!1;return!0}function fA(e){const t=document.createElement("div");return t.dataset.annotationSlot="",t.slot=e,t.style.whiteSpace="normal",t}function hA(){const e=document.createElement("div");return e.slot="gutter-utility-slot",e.style.position="absolute",e.style.top="0",e.style.bottom="0",e.style.textAlign="center",e.style.whiteSpace="normal",e.style.touchAction="none",e}function pA(){const e=document.createElement("style");return e.setAttribute(c5,""),e}var uV=`@layer base {
|
|
259
|
+
:host {
|
|
260
|
+
--diffs-font-fallback: "SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono",
|
|
261
|
+
"Courier New", monospace;
|
|
262
|
+
--diffs-header-font-fallback: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
|
|
263
|
+
"Noto Sans", "Liberation Sans", Arial, sans-serif;
|
|
264
|
+
--diffs-mixer: light-dark(#000, #fff);
|
|
265
|
+
--diffs-gap-fallback: 8px;
|
|
266
|
+
--diffs-scrollbar-gutter-fallback: 6px;
|
|
267
|
+
--diffs-scrollbar-gutter: var(--diffs-scrollbar-gutter-override, var(--diffs-scrollbar-gutter-measured, var(--diffs-scrollbar-gutter-fallback)));
|
|
268
|
+
--diffs-added-light: #0dbe4e;
|
|
269
|
+
--diffs-added-dark: #5ecc71;
|
|
270
|
+
--diffs-modified-light: #009fff;
|
|
271
|
+
--diffs-modified-dark: #69b1ff;
|
|
272
|
+
--diffs-deleted-light: #ff2e3f;
|
|
273
|
+
--diffs-deleted-dark: #ff6762;
|
|
274
|
+
--diffs-warning-light: #d5a910;
|
|
275
|
+
--diffs-warning-dark: #ffd452;
|
|
276
|
+
color-scheme: light dark;
|
|
277
|
+
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
278
|
+
font-size: var(--diffs-font-size, 13px);
|
|
279
|
+
line-height: var(--diffs-line-height, 20px);
|
|
280
|
+
font-feature-settings: var(--diffs-font-features);
|
|
281
|
+
--diffs-bg: light-dark(var(--diffs-light-bg, #fff), var(--diffs-dark-bg, #000));
|
|
282
|
+
--diffs-bg-buffer: var(--diffs-bg-buffer-override, light-dark(color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer))));
|
|
283
|
+
--diffs-bg-context: var(--diffs-bg-context-override, light-dark(color-mix(in lab, var(--diffs-bg) 98.5%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92.5%, var(--diffs-mixer))));
|
|
284
|
+
--diffs-bg-context-gutter: var(--diffs-bg-context-gutter-override, light-dark(color-mix(in lab, var(--diffs-bg-context) 90%, var(--diffs-bg)), color-mix(in lab, var(--diffs-bg-context) 45%, var(--diffs-bg))));
|
|
285
|
+
--diffs-bg-separator: var(--diffs-bg-separator-override, light-dark(color-mix(in lab, var(--diffs-bg) 96%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-mixer))));
|
|
286
|
+
--diffs-fg: light-dark(var(--diffs-light, #000), var(--diffs-dark, #fff));
|
|
287
|
+
--diffs-fg-number: var(--diffs-fg-number-override, light-dark(color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)), color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg))));
|
|
288
|
+
--diffs-fg-conflict-marker: var(--diffs-fg-conflict-marker-override, var(--diffs-fg-number));
|
|
289
|
+
--diffs-deletion-base: var(--diffs-deletion-color-override, light-dark(var(--diffs-light-deletion-color, var(--diffs-deletion-color, var(--diffs-deleted-light))), var(--diffs-dark-deletion-color, var(--diffs-deletion-color, var(--diffs-deleted-dark)))));
|
|
290
|
+
--diffs-addition-base: var(--diffs-addition-color-override, light-dark(var(--diffs-light-addition-color, var(--diffs-addition-color, var(--diffs-added-light))), var(--diffs-dark-addition-color, var(--diffs-addition-color, var(--diffs-added-dark)))));
|
|
291
|
+
--diffs-modified-base: var(--diffs-modified-color-override, light-dark(var(--diffs-light-modified-color, var(--diffs-modified-color, var(--diffs-modified-light))), var(--diffs-dark-modified-color, var(--diffs-modified-color, var(--diffs-modified-dark)))));
|
|
292
|
+
--diffs-bg-deletion: var(--diffs-bg-deletion-override, light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-deletion-base)), color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base))));
|
|
293
|
+
--diffs-bg-deletion-emphasis: var(--diffs-bg-deletion-emphasis-override, light-dark(rgb(from var(--diffs-deletion-base) r g b / .15), rgb(from var(--diffs-deletion-base) r g b / .2)));
|
|
294
|
+
--diffs-bg-addition: var(--diffs-bg-addition-override, light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-addition-base)), color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base))));
|
|
295
|
+
--diffs-bg-addition-emphasis: var(--diffs-bg-addition-emphasis-override, light-dark(rgb(from var(--diffs-addition-base) r g b / .15), rgb(from var(--diffs-addition-base) r g b / .2)));
|
|
296
|
+
--diffs-selection-base: var(--diffs-modified-base);
|
|
297
|
+
--diffs-selection-number-fg: light-dark(color-mix(in lab, var(--diffs-selection-base) 65%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-selection-base) 75%, var(--diffs-mixer)));
|
|
298
|
+
background-color: var(--diffs-bg);
|
|
299
|
+
color: var(--diffs-fg);
|
|
300
|
+
display: block;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
pre, code, [data-error-wrapper] {
|
|
304
|
+
isolation: isolate;
|
|
305
|
+
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
306
|
+
outline: none;
|
|
307
|
+
margin: 0;
|
|
308
|
+
padding: 0;
|
|
309
|
+
display: block;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
pre, code {
|
|
313
|
+
background-color: var(--diffs-bg);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
code {
|
|
317
|
+
contain: content;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
input, button {
|
|
321
|
+
font-family: inherit;
|
|
322
|
+
font-size: inherit;
|
|
323
|
+
line-height: inherit;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
*, :before, :after {
|
|
327
|
+
box-sizing: border-box;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
[data-icon-sprite] {
|
|
331
|
+
display: none;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
[data-diffs-header], [data-separator] {
|
|
335
|
+
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
[data-diffs-header][data-sticky] {
|
|
339
|
+
z-index: 1;
|
|
340
|
+
background-color: var(--diffs-bg);
|
|
341
|
+
position: sticky;
|
|
342
|
+
top: 0;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
[data-file-info] {
|
|
346
|
+
color: var(--fg);
|
|
347
|
+
background-color: color-mix(in lab, var(--bg) 98%, var(--fg));
|
|
348
|
+
border-block: 1px solid color-mix(in lab, var(--bg) 95%, var(--fg));
|
|
349
|
+
padding: 10px;
|
|
350
|
+
font-weight: 700;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
[data-diff], [data-file] {
|
|
354
|
+
--diffs-grid-number-column-width: minmax(min-content, max-content);
|
|
355
|
+
--diffs-code-grid: var(--diffs-grid-number-column-width) 1fr;
|
|
356
|
+
|
|
357
|
+
&[data-dehydrated] {
|
|
358
|
+
--diffs-code-grid: var(--diffs-grid-number-column-width) minmax(0, 1fr);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
&:hover [data-code]::-webkit-scrollbar-thumb {
|
|
362
|
+
background-color: var(--diffs-bg-context);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
@supports (-webkit-touch-callout: none) {
|
|
367
|
+
:host {
|
|
368
|
+
--diffs-scrollbar-gutter-fallback: 0px;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
[data-line] span {
|
|
373
|
+
color: light-dark(var(--diffs-token-light, var(--diffs-light)), var(--diffs-token-dark, var(--diffs-dark)));
|
|
374
|
+
background-color: light-dark(var(--diffs-token-light-bg, inherit), var(--diffs-token-dark-bg, inherit));
|
|
375
|
+
font-weight: light-dark(var(--diffs-token-light-font-weight, inherit), var(--diffs-token-dark-font-weight, inherit));
|
|
376
|
+
font-style: light-dark(var(--diffs-token-light-font-style, inherit), var(--diffs-token-dark-font-style, inherit));
|
|
377
|
+
text-decoration: light-dark(var(--diffs-token-light-text-decoration, inherit), var(--diffs-token-dark-text-decoration, inherit));
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
[data-line], [data-gutter-buffer], [data-column-number], [data-line-annotation], [data-no-newline], [data-merge-conflict], [data-merge-conflict-actions], [data-editor-overlay] {
|
|
381
|
+
--diffs-computed-decoration-bg: var(--diffs-bg);
|
|
382
|
+
--diffs-computed-diff-line-bg: var(--diffs-computed-decoration-bg);
|
|
383
|
+
--diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg);
|
|
384
|
+
--diffs-computed-editor-active-line-bg: var(--diffs-computed-selected-line-bg);
|
|
385
|
+
--diffs-computed-hovered-line-bg: var(--diffs-computed-editor-active-line-bg);
|
|
386
|
+
--diffs-hover-mix-target: var(--diffs-bg-hover-override, var(--diffs-mixer));
|
|
387
|
+
--diffs-line-bg: var(--diffs-computed-hovered-line-bg);
|
|
388
|
+
color: var(--diffs-fg);
|
|
389
|
+
background-color: var(--diffs-line-bg, var(--diffs-bg));
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
[data-line], [data-no-newline] {
|
|
393
|
+
&[data-decoration-bg] {
|
|
394
|
+
--mix-deco-light: 92%;
|
|
395
|
+
--mix-deco-dark: 85%;
|
|
396
|
+
|
|
397
|
+
&[data-decoration-bg-depth="2"] {
|
|
398
|
+
--mix-deco-light: 88%;
|
|
399
|
+
--mix-deco-dark: 80%;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
&[data-decoration-bg-depth="3"] {
|
|
403
|
+
--mix-deco-light: 85%;
|
|
404
|
+
--mix-deco-dark: 78%;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
--diffs-hover-mix-target: var(--diffs-decoration-bg);
|
|
408
|
+
--diffs-computed-decoration-bg: light-dark(color-mix(in lab,
|
|
409
|
+
var(--diffs-bg) var(--mix-deco-light),
|
|
410
|
+
var(--diffs-decoration-bg)), color-mix(in lab,
|
|
411
|
+
var(--diffs-bg) var(--mix-deco-dark),
|
|
412
|
+
var(--diffs-decoration-bg)));
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
[data-line-annotation], [data-gutter-buffer="annotation"] {
|
|
417
|
+
--diffs-annotation-bg: var(--diffs-bg-context);
|
|
418
|
+
--diffs-computed-decoration-bg: var(--diffs-annotation-bg);
|
|
419
|
+
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
[data-merge-conflict-actions], [data-gutter-buffer="merge-conflict-action"], [data-gutter-buffer="merge-conflict-marker-base"], [data-gutter-buffer="merge-conflict-marker-separator"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"] {
|
|
423
|
+
--diffs-computed-decoration-bg: var(--diffs-bg-context);
|
|
424
|
+
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
[data-gutter-buffer="merge-conflict-marker-start"], [data-merge-conflict="marker-start"] {
|
|
428
|
+
--diffs-computed-decoration-bg: light-dark(color-mix(in lab,
|
|
429
|
+
var(--diffs-bg) 78%,
|
|
430
|
+
var(--conflict-bg-current-header-override, var(--diffs-addition-base))), color-mix(in lab,
|
|
431
|
+
var(--diffs-bg) 68%,
|
|
432
|
+
var(--conflict-bg-current-header-override, var(--diffs-addition-base))));
|
|
433
|
+
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
[data-gutter-buffer="merge-conflict-marker-end"], [data-merge-conflict="marker-end"] {
|
|
437
|
+
--diffs-computed-decoration-bg: light-dark(color-mix(in lab,
|
|
438
|
+
var(--diffs-bg) 78%,
|
|
439
|
+
var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))), color-mix(in lab,
|
|
440
|
+
var(--diffs-bg) 68%,
|
|
441
|
+
var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))));
|
|
442
|
+
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
[data-has-merge-conflict] [data-line-annotation], [data-has-merge-conflict] [data-gutter-buffer="annotation"] {
|
|
446
|
+
--diffs-computed-decoration-bg: var(--diffs-bg);
|
|
447
|
+
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
:where([data-background]) {
|
|
451
|
+
& [data-gutter-buffer], & [data-column-number] {
|
|
452
|
+
--mix-light: 91%;
|
|
453
|
+
--mix-dark: 85%;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
& [data-line], & [data-no-newline] {
|
|
457
|
+
--mix-light: 88%;
|
|
458
|
+
--mix-dark: 80%;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
& [data-gutter-buffer], & [data-column-number], & [data-line], & [data-no-newline] {
|
|
462
|
+
--diffs-diff-line-mix-target: var(--diffs-bg);
|
|
463
|
+
|
|
464
|
+
&[data-line-type="change-deletion"] {
|
|
465
|
+
--diffs-diff-line-mix-target: var(--diffs-bg-deletion-override, var(--diffs-deletion-base));
|
|
466
|
+
--diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
|
|
467
|
+
|
|
468
|
+
&:where([data-gutter-buffer], [data-column-number]) {
|
|
469
|
+
color: var(--diffs-fg-number-deletion-override, var(--diffs-deletion-base));
|
|
470
|
+
--diffs-diff-line-mix-target: var(--diffs-bg-deletion-number-override, var(--diffs-deletion-base));
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
474
|
+
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
475
|
+
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
476
|
+
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
477
|
+
var(--diffs-diff-line-mix-target)));
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
&[data-line-type="change-addition"] {
|
|
481
|
+
--diffs-diff-line-mix-target: var(--diffs-bg-addition-override, var(--diffs-addition-base));
|
|
482
|
+
--diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
|
|
483
|
+
|
|
484
|
+
&:where([data-gutter-buffer], [data-column-number]) {
|
|
485
|
+
color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
|
|
486
|
+
--diffs-diff-line-mix-target: var(--diffs-bg-addition-number-override, var(--diffs-addition-base));
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
490
|
+
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
491
|
+
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
492
|
+
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
493
|
+
var(--diffs-diff-line-mix-target)));
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
&[data-merge-conflict="current"] {
|
|
497
|
+
--diffs-diff-line-mix-target: var(--conflict-bg-current-override, var(--diffs-addition-base));
|
|
498
|
+
--diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
|
|
499
|
+
|
|
500
|
+
&:where([data-gutter-buffer], [data-column-number]) {
|
|
501
|
+
color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
|
|
502
|
+
--diffs-diff-line-mix-target: var(--conflict-bg-current-number-override, var(--diffs-addition-base));
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
506
|
+
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
507
|
+
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
508
|
+
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
509
|
+
var(--diffs-diff-line-mix-target)));
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
&[data-merge-conflict="incoming"] {
|
|
513
|
+
--diffs-diff-line-mix-target: var(--conflict-bg-incoming-override, var(--diffs-modified-base));
|
|
514
|
+
--diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
|
|
515
|
+
|
|
516
|
+
&:where([data-gutter-buffer], [data-column-number]) {
|
|
517
|
+
color: var(--diffs-modified-base);
|
|
518
|
+
--diffs-diff-line-mix-target: var(--conflict-bg-incoming-number-override, var(--diffs-modified-base));
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
522
|
+
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
523
|
+
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
524
|
+
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
525
|
+
var(--diffs-diff-line-mix-target)));
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
[data-gutter-buffer], [data-column-number], [data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline], [data-editor-overlay] {
|
|
531
|
+
--diffs-selection-mix-target: var(--diffs-bg-selection-override, var(--diffs-selection-base));
|
|
532
|
+
--diffs-selection-emphasis-mix-target: var(--diffs-selection-mix-target);
|
|
533
|
+
|
|
534
|
+
&:where([data-editor-overlay]), &:where([data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline])[data-selected-line] {
|
|
535
|
+
--mix-selection-light: 82%;
|
|
536
|
+
--mix-selection-dark: 75%;
|
|
537
|
+
--diffs-hover-mix-target: var(--diffs-selection-mix-target);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
&:where([data-gutter-buffer][data-selected-line], [data-column-number]:is([data-selected-line], [data-editor-active-line])) {
|
|
541
|
+
--mix-selection-light: 75%;
|
|
542
|
+
--mix-selection-dark: 60%;
|
|
543
|
+
--diffs-selection-mix-target: var(--diffs-bg-selection-number-override, var(--diffs-selection-base));
|
|
544
|
+
--diffs-hover-mix-target: var(--diffs-selection-mix-target);
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
&:where([data-line][data-selected-line]):is([data-line-type="change-addition"], [data-line-type="change-deletion"]) {
|
|
548
|
+
--diffs-selection-emphasis-mix-target: light-dark(color-mix(in lab,
|
|
549
|
+
var(--diffs-diff-line-mix-target, var(--diffs-selection-mix-target))
|
|
550
|
+
var(--mix-selection-light),
|
|
551
|
+
var(--diffs-selection-mix-target)), var(--diffs-selection-mix-target));
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
&:where([data-editor-overlay]), &[data-selected-line] {
|
|
555
|
+
--diffs-computed-selected-line-bg: light-dark(color-mix(in lab,
|
|
556
|
+
var(--diffs-computed-diff-line-bg) var(--mix-selection-light),
|
|
557
|
+
var(--diffs-selection-mix-target)), color-mix(in lab,
|
|
558
|
+
var(--diffs-computed-diff-line-bg) var(--mix-selection-dark),
|
|
559
|
+
var(--diffs-selection-mix-target)));
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
[data-line][data-editor-active-line], [data-column-number][data-editor-active-line] {
|
|
564
|
+
--diffs-computed-editor-active-line-bg: color-mix(in lab,
|
|
565
|
+
var(--diffs-computed-selected-line-bg)
|
|
566
|
+
var(--diffs-editor-active-line-source-mix, 100%),
|
|
567
|
+
var(--diffs-selection-emphasis-mix-target));
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
@media (pointer: fine) {
|
|
571
|
+
[data-line][data-hovered], [data-gutter-buffer][data-hovered], [data-column-number][data-hovered], [data-line-annotation][data-hovered], [data-no-newline][data-hovered], [data-merge-conflict][data-hovered], [data-merge-conflict-actions][data-hovered], [data-editor-overlay][data-hovered] {
|
|
572
|
+
--diffs-computed-hovered-line-bg: light-dark(color-mix(in lab,
|
|
573
|
+
var(--diffs-computed-editor-active-line-bg) 97%,
|
|
574
|
+
var(--diffs-hover-mix-target)), color-mix(in lab,
|
|
575
|
+
var(--diffs-computed-editor-active-line-bg) 91%,
|
|
576
|
+
var(--diffs-hover-mix-target)));
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
[data-gutter-buffer][data-selected-line], [data-column-number]:is([data-selected-line], [data-editor-active-line]) {
|
|
581
|
+
color: var(--diffs-selection-number-fg);
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
[data-no-newline] {
|
|
585
|
+
user-select: none;
|
|
586
|
+
|
|
587
|
+
& span {
|
|
588
|
+
opacity: .6;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
[data-diff-type="split"][data-overflow="scroll"] {
|
|
593
|
+
grid-template-columns: 1fr 1fr;
|
|
594
|
+
display: grid;
|
|
595
|
+
|
|
596
|
+
& [data-additions] {
|
|
597
|
+
border-left: 1px solid var(--diffs-bg);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
& [data-deletions] {
|
|
601
|
+
border-right: 1px solid var(--diffs-bg);
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
[data-code] {
|
|
606
|
+
grid-auto-flow: dense;
|
|
607
|
+
grid-template-columns: var(--diffs-code-grid);
|
|
608
|
+
overflow: var(--diffs-overflow-override, scroll) clip;
|
|
609
|
+
overscroll-behavior-x: none;
|
|
610
|
+
tab-size: var(--diffs-tab-size, 2);
|
|
611
|
+
padding-top: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
612
|
+
padding-bottom: max(0px,
|
|
613
|
+
calc(var(--diffs-gap-block, var(--diffs-gap-fallback)) -
|
|
614
|
+
var(--diffs-scrollbar-gutter)));
|
|
615
|
+
scrollbar-gutter: stable;
|
|
616
|
+
align-self: flex-start;
|
|
617
|
+
display: grid;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
[data-diffs-scrollbar-measure] {
|
|
621
|
+
opacity: 0;
|
|
622
|
+
pointer-events: none;
|
|
623
|
+
scrollbar-gutter: auto;
|
|
624
|
+
grid-template-columns: none;
|
|
625
|
+
width: 100px;
|
|
626
|
+
height: 100px;
|
|
627
|
+
padding: 0;
|
|
628
|
+
position: absolute;
|
|
629
|
+
top: -200px;
|
|
630
|
+
left: -200px;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
[data-container-size] {
|
|
634
|
+
container-type: inline-size;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
[data-code]::-webkit-scrollbar {
|
|
638
|
+
width: 0;
|
|
639
|
+
height: var(--diffs-scrollbar-gutter);
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
[data-code]::-webkit-scrollbar-track {
|
|
643
|
+
background: none;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
[data-code]::-webkit-scrollbar-thumb {
|
|
647
|
+
background-color: #0000;
|
|
648
|
+
background-clip: content-box;
|
|
649
|
+
border: 1px solid #0000;
|
|
650
|
+
border-radius: 3px;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
[data-code]::-webkit-scrollbar-corner {
|
|
654
|
+
background-color: #0000;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
@supports ((-moz-appearance: none)) {
|
|
658
|
+
[data-code] {
|
|
659
|
+
scrollbar-width: thin;
|
|
660
|
+
scrollbar-color: var(--diffs-bg-context) transparent;
|
|
661
|
+
padding-bottom: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
[data-diffs-header] ~ [data-diff], [data-diffs-header] ~ [data-file] {
|
|
666
|
+
& [data-code], &[data-overflow="wrap"], &[data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {
|
|
667
|
+
padding-top: 0;
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
[data-gutter] {
|
|
672
|
+
grid-template-rows: subgrid;
|
|
673
|
+
grid-template-columns: subgrid;
|
|
674
|
+
z-index: 3;
|
|
675
|
+
background-color: var(--diffs-bg);
|
|
676
|
+
grid-column: 1;
|
|
677
|
+
display: grid;
|
|
678
|
+
position: relative;
|
|
679
|
+
|
|
680
|
+
& [data-gutter-buffer], & [data-column-number] {
|
|
681
|
+
border-right: var(--diffs-gap-style, 2px solid var(--diffs-bg));
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
[data-content] {
|
|
686
|
+
grid-template-rows: subgrid;
|
|
687
|
+
grid-template-columns: subgrid;
|
|
688
|
+
background-color: var(--diffs-bg);
|
|
689
|
+
grid-column: 2;
|
|
690
|
+
min-width: 0;
|
|
691
|
+
display: grid;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
[data-diff-type="split"][data-overflow="wrap"], [data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {
|
|
695
|
+
grid-auto-flow: dense;
|
|
696
|
+
grid-template-columns: repeat(2, var(--diffs-code-grid));
|
|
697
|
+
padding-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
698
|
+
display: grid;
|
|
699
|
+
|
|
700
|
+
& [data-code] {
|
|
701
|
+
display: contents;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
& [data-deletions] {
|
|
705
|
+
& [data-gutter] {
|
|
706
|
+
grid-column: 1;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
& [data-content] {
|
|
710
|
+
border-right: 1px solid var(--diffs-bg);
|
|
711
|
+
grid-column: 2;
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
& [data-additions] {
|
|
716
|
+
& [data-gutter] {
|
|
717
|
+
border-left: 1px solid var(--diffs-bg);
|
|
718
|
+
grid-column: 3;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
& [data-content] {
|
|
722
|
+
grid-column: 4;
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
[data-dehydrated][data-diff-type="split"][data-overflow="scroll"] [data-content] {
|
|
728
|
+
overflow: clip;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
[data-overflow="scroll"] [data-gutter] {
|
|
732
|
+
position: sticky;
|
|
733
|
+
left: 0;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
[data-interactive-lines] [data-line] {
|
|
737
|
+
cursor: pointer;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
[data-interactive-line-numbers] [data-column-number] {
|
|
741
|
+
cursor: pointer;
|
|
742
|
+
touch-action: none;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
[data-content-buffer], [data-gutter-buffer] {
|
|
746
|
+
user-select: none;
|
|
747
|
+
min-height: 1lh;
|
|
748
|
+
position: relative;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
[data-gutter-buffer] {
|
|
752
|
+
padding-left: 2ch;
|
|
753
|
+
padding-right: 1ch;
|
|
754
|
+
|
|
755
|
+
&:before {
|
|
756
|
+
content: "";
|
|
757
|
+
min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
|
|
758
|
+
display: block;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
[data-gutter-buffer="annotation"] {
|
|
763
|
+
--diffs-annotation-bg: var(--diffs-bg-context-gutter);
|
|
764
|
+
min-height: 0;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
[data-gutter-buffer="buffer"] {
|
|
768
|
+
--diffs-line-bg: var(--diffs-bg-context-gutter);
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
[data-content-buffer] {
|
|
772
|
+
background-position: 5px 0;
|
|
773
|
+
background-size: 8px 8px;
|
|
774
|
+
background-origin: border-box;
|
|
775
|
+
background-image: repeating-linear-gradient(-45deg,
|
|
776
|
+
transparent,
|
|
777
|
+
transparent calc(3px * 1.414),
|
|
778
|
+
var(--diffs-bg-buffer) calc(3px * 1.414),
|
|
779
|
+
var(--diffs-bg-buffer) calc(4px * 1.414));
|
|
780
|
+
grid-column: 1;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
[data-separator] {
|
|
784
|
+
box-sizing: content-box;
|
|
785
|
+
background-color: var(--diffs-bg);
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
[data-separator="simple"] {
|
|
789
|
+
min-height: 4px;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
[data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"], [data-separator="simple"] {
|
|
793
|
+
background-color: var(--diffs-bg-separator);
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
[data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"] {
|
|
797
|
+
height: 32px;
|
|
798
|
+
position: relative;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
[data-separator-wrapper] {
|
|
802
|
+
user-select: none;
|
|
803
|
+
fill: currentColor;
|
|
804
|
+
background-color: var(--diffs-bg);
|
|
805
|
+
align-items: center;
|
|
806
|
+
height: 100%;
|
|
807
|
+
display: flex;
|
|
808
|
+
position: absolute;
|
|
809
|
+
inset-inline: 0;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
[data-content] [data-separator-wrapper] {
|
|
813
|
+
display: none;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
[data-separator="metadata"] [data-separator-wrapper] {
|
|
817
|
+
background-color: var(--diffs-bg-separator);
|
|
818
|
+
height: 100%;
|
|
819
|
+
color: var(--diffs-fg-number);
|
|
820
|
+
white-space: nowrap;
|
|
821
|
+
text-overflow: ellipsis;
|
|
822
|
+
min-width: min-content;
|
|
823
|
+
padding-inline: 1ch;
|
|
824
|
+
inset-inline: 100% auto;
|
|
825
|
+
overflow: hidden;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
[data-separator="line-info"] {
|
|
829
|
+
margin-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
830
|
+
|
|
831
|
+
& [data-separator-wrapper] {
|
|
832
|
+
min-width: 16px;
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
[data-separator="line-info-basic"], [data-separator="metadata"] {
|
|
837
|
+
margin-block: 0;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
[data-separator="line-info"][data-separator-first] {
|
|
841
|
+
margin-top: 0;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
[data-separator="line-info"][data-separator-last] {
|
|
845
|
+
margin-bottom: 0;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
[data-expand-index] [data-separator-wrapper] {
|
|
849
|
+
grid-template-columns: 32px auto;
|
|
850
|
+
display: grid;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
[data-expand-index] [data-separator-wrapper][data-separator-multi-button] {
|
|
854
|
+
grid-template-columns: 32px 32px auto;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
[data-expand-button], [data-separator-content] {
|
|
858
|
+
background-color: var(--diffs-bg-separator);
|
|
859
|
+
flex: none;
|
|
860
|
+
align-items: center;
|
|
861
|
+
display: flex;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
[data-expand-index] [data-separator-content]:hover {
|
|
865
|
+
cursor: pointer;
|
|
866
|
+
text-decoration: underline;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
[data-expand-button] {
|
|
870
|
+
cursor: pointer;
|
|
871
|
+
min-width: 32px;
|
|
872
|
+
color: var(--diffs-fg-number);
|
|
873
|
+
border-right: 2px solid var(--diffs-bg);
|
|
874
|
+
flex-shrink: 0;
|
|
875
|
+
justify-content: center;
|
|
876
|
+
align-self: stretch;
|
|
877
|
+
|
|
878
|
+
&:hover {
|
|
879
|
+
color: var(--diffs-fg);
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
&[data-expand-all-button] {
|
|
883
|
+
display: none;
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
[data-expand-down] [data-icon] {
|
|
888
|
+
transform: scaleY(-1);
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
[data-separator-content] {
|
|
892
|
+
height: 100%;
|
|
893
|
+
color: var(--diffs-fg-number);
|
|
894
|
+
flex: auto;
|
|
895
|
+
justify-content: flex-start;
|
|
896
|
+
padding: 0 1ch;
|
|
897
|
+
overflow: hidden;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
[data-separator="line-info"], [data-separator="line-info-basic"] {
|
|
901
|
+
& [data-separator-content] {
|
|
902
|
+
user-select: none;
|
|
903
|
+
height: 100%;
|
|
904
|
+
overflow: clip;
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
[data-unmodified-lines] {
|
|
909
|
+
text-overflow: ellipsis;
|
|
910
|
+
white-space: nowrap;
|
|
911
|
+
flex: 0 auto;
|
|
912
|
+
min-width: 0;
|
|
913
|
+
display: block;
|
|
914
|
+
overflow: hidden;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
@supports (width: 1cqi) {
|
|
918
|
+
[data-unified] {
|
|
919
|
+
& [data-separator="line-info"] [data-separator-wrapper] {
|
|
920
|
+
padding-inline: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
921
|
+
width: 100cqi;
|
|
922
|
+
|
|
923
|
+
& [data-separator-content] {
|
|
924
|
+
border-radius: 6px;
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
& [data-separator="line-info"][data-expand-index] [data-separator-wrapper] [data-separator-content] {
|
|
929
|
+
border-top-left-radius: unset;
|
|
930
|
+
border-bottom-left-radius: unset;
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
[data-gutter] {
|
|
935
|
+
& [data-separator="line-info"] [data-separator-wrapper] {
|
|
936
|
+
padding-left: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
& [data-separator="line-info"] [data-separator-content] {
|
|
940
|
+
border-top-left-radius: 6px;
|
|
941
|
+
border-bottom-left-radius: 6px;
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
& [data-separator="line-info"][data-expand-index] [data-separator-content] {
|
|
945
|
+
border-top-left-radius: unset;
|
|
946
|
+
border-bottom-left-radius: unset;
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
[data-additions] {
|
|
951
|
+
& [data-content] [data-separator="line-info"] {
|
|
952
|
+
background-color: var(--diffs-bg);
|
|
953
|
+
|
|
954
|
+
& [data-separator-wrapper] {
|
|
955
|
+
display: none;
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
& [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
|
|
960
|
+
background-color: var(--diffs-bg-separator);
|
|
961
|
+
border-top-right-radius: 6px;
|
|
962
|
+
border-bottom-right-radius: 6px;
|
|
963
|
+
height: 100%;
|
|
964
|
+
display: block;
|
|
965
|
+
|
|
966
|
+
& [data-separator-content], & [data-expand-button] {
|
|
967
|
+
display: none;
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
[data-overflow="scroll"] [data-additions] [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
|
|
973
|
+
width: calc(100cqi - var(--diffs-gap-inline, var(--diffs-gap-fallback)));
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
[data-overflow="wrap"] [data-additions] [data-content] [data-separator="line-info"] [data-separator-wrapper] {
|
|
977
|
+
background-color: var(--diffs-bg-separator);
|
|
978
|
+
height: 100%;
|
|
979
|
+
margin-right: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
980
|
+
border-top-right-radius: 6px;
|
|
981
|
+
border-bottom-right-radius: 6px;
|
|
982
|
+
display: block;
|
|
983
|
+
|
|
984
|
+
& [data-separator-content], & [data-expand-button] {
|
|
985
|
+
display: none;
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
[data-separator="line-info"] [data-separator-wrapper] {
|
|
990
|
+
& [data-expand-both], & [data-expand-down], & [data-expand-up] {
|
|
991
|
+
border-top-left-radius: 6px;
|
|
992
|
+
border-bottom-left-radius: 6px;
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
@media (pointer: fine) {
|
|
997
|
+
[data-separator="line-info"] [data-separator-wrapper] {
|
|
998
|
+
&[data-separator-multi-button] {
|
|
999
|
+
& [data-expand-up] {
|
|
1000
|
+
border-top-left-radius: 6px;
|
|
1001
|
+
border-bottom-left-radius: unset;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
& [data-expand-down] {
|
|
1005
|
+
border-bottom-left-radius: 6px;
|
|
1006
|
+
border-top-left-radius: unset;
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
@media (pointer: coarse) {
|
|
1014
|
+
[data-separator="line-info-basic"] [data-separator-wrapper][data-separator-multi-button] {
|
|
1015
|
+
grid-template-columns: 34px 34px auto;
|
|
1016
|
+
|
|
1017
|
+
& [data-separator-content] {
|
|
1018
|
+
grid-column: unset;
|
|
1019
|
+
grid-row: unset;
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
@supports (width: 1cqi) {
|
|
1024
|
+
[data-separator="line-info"] [data-separator-wrapper] {
|
|
1025
|
+
& [data-expand-both], & [data-expand-down], & [data-expand-up] {
|
|
1026
|
+
border-top-left-radius: 6px;
|
|
1027
|
+
border-bottom-left-radius: 6px;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
&[data-separator-multi-button] {
|
|
1031
|
+
& [data-expand-up] {
|
|
1032
|
+
border-top-left-radius: 6px;
|
|
1033
|
+
border-bottom-left-radius: 6px;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
& [data-expand-down] {
|
|
1037
|
+
border-bottom-left-radius: unset;
|
|
1038
|
+
border-top-left-radius: unset;
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
@media (pointer: fine) {
|
|
1046
|
+
[data-separator-wrapper][data-separator-multi-button] {
|
|
1047
|
+
grid-template-rows: 50% 50%;
|
|
1048
|
+
display: grid;
|
|
1049
|
+
|
|
1050
|
+
& [data-separator-content] {
|
|
1051
|
+
grid-area: 1 / 2 / -1;
|
|
1052
|
+
min-width: min-content;
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
& [data-expand-button] {
|
|
1056
|
+
grid-column: 1;
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
[data-separator="line-info"] [data-separator-wrapper], [data-separator="line-info"] [data-separator-wrapper][data-separator-multi-button] {
|
|
1061
|
+
grid-template-columns: 34px auto;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
[data-separator="line-info-basic"][data-expand-index] [data-separator-wrapper] {
|
|
1065
|
+
grid-template-columns: 100% auto;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
[data-separator="line-info"], [data-separator="line-info-basic"] {
|
|
1069
|
+
& [data-separator-multi-button] {
|
|
1070
|
+
& [data-expand-up] {
|
|
1071
|
+
border-bottom: 1px solid var(--diffs-bg);
|
|
1072
|
+
border-right: 2px solid var(--diffs-bg);
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
& [data-expand-down] {
|
|
1076
|
+
border-top: 1px solid var(--diffs-bg);
|
|
1077
|
+
border-right: 2px solid var(--diffs-bg);
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
[data-additions] [data-gutter] [data-separator-wrapper], [data-additions] [data-separator="line-info-basic"] [data-separator-wrapper], [data-content] [data-separator-wrapper] {
|
|
1084
|
+
display: none;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
[data-line-annotation] {
|
|
1088
|
+
min-height: var(--diffs-annotation-min-height, 0);
|
|
1089
|
+
z-index: 2;
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
[data-merge-conflict-actions] {
|
|
1093
|
+
z-index: 2;
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
[data-separator="custom"] {
|
|
1097
|
+
grid-template-columns: subgrid;
|
|
1098
|
+
display: grid;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
[data-line], [data-column-number], [data-no-newline] {
|
|
1102
|
+
padding-inline: 1ch;
|
|
1103
|
+
position: relative;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
[data-indicators="classic"] [data-line] {
|
|
1107
|
+
padding-inline-start: 2ch;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
[data-indicators="classic"] {
|
|
1111
|
+
& [data-line-type="change-addition"], & [data-line-type="change-deletion"] {
|
|
1112
|
+
&[data-no-newline], &[data-line] {
|
|
1113
|
+
&:before {
|
|
1114
|
+
user-select: none;
|
|
1115
|
+
width: 1ch;
|
|
1116
|
+
height: 1lh;
|
|
1117
|
+
display: inline-block;
|
|
1118
|
+
position: absolute;
|
|
1119
|
+
top: 0;
|
|
1120
|
+
left: 0;
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
& [data-line-type="change-addition"] {
|
|
1126
|
+
&[data-line], &[data-no-newline] {
|
|
1127
|
+
&:before {
|
|
1128
|
+
content: "+";
|
|
1129
|
+
color: var(--diffs-addition-base);
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
& [data-line-type="change-deletion"] {
|
|
1135
|
+
&[data-line], &[data-no-newline] {
|
|
1136
|
+
&:before {
|
|
1137
|
+
content: "-";
|
|
1138
|
+
color: var(--diffs-deletion-base);
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
[data-indicators="bars"] {
|
|
1145
|
+
& [data-line-type="change-deletion"], & [data-line-type="change-addition"] {
|
|
1146
|
+
&[data-column-number] {
|
|
1147
|
+
&:before {
|
|
1148
|
+
content: "";
|
|
1149
|
+
user-select: none;
|
|
1150
|
+
contain: strict;
|
|
1151
|
+
width: 4px;
|
|
1152
|
+
height: 100%;
|
|
1153
|
+
display: block;
|
|
1154
|
+
position: absolute;
|
|
1155
|
+
top: 0;
|
|
1156
|
+
left: 0;
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
& [data-line-type="change-deletion"] {
|
|
1162
|
+
&[data-column-number] {
|
|
1163
|
+
&:before {
|
|
1164
|
+
background-image: linear-gradient(0deg,
|
|
1165
|
+
var(--diffs-bg-deletion) 50%,
|
|
1166
|
+
var(--diffs-deletion-base) 50%);
|
|
1167
|
+
background-repeat: repeat;
|
|
1168
|
+
background-size: 2px 2px;
|
|
1169
|
+
background-size: calc(1lh / round(1lh / 2px))
|
|
1170
|
+
calc(1lh / round(1lh / 2px));
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
& [data-line-type="change-addition"] {
|
|
1176
|
+
&[data-column-number] {
|
|
1177
|
+
&:before {
|
|
1178
|
+
background-color: var(--diffs-addition-base);
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
[data-overflow="wrap"] {
|
|
1185
|
+
& [data-line] {
|
|
1186
|
+
white-space: pre-wrap;
|
|
1187
|
+
word-break: break-word;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
& [data-annotation-content] {
|
|
1191
|
+
word-break: break-word;
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
[data-overflow="scroll"] [data-line] {
|
|
1196
|
+
white-space: pre;
|
|
1197
|
+
min-height: 1lh;
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
[data-column-number] {
|
|
1201
|
+
box-sizing: content-box;
|
|
1202
|
+
text-align: right;
|
|
1203
|
+
user-select: none;
|
|
1204
|
+
color: var(--diffs-fg-number);
|
|
1205
|
+
padding-left: 2ch;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
[data-line-number-content] {
|
|
1209
|
+
min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
|
|
1210
|
+
z-index: 1;
|
|
1211
|
+
display: inline-block;
|
|
1212
|
+
position: relative;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
[data-disable-line-numbers] {
|
|
1216
|
+
& [data-gutter-buffer], & [data-column-number] {
|
|
1217
|
+
min-width: 4px;
|
|
1218
|
+
padding: 0;
|
|
1219
|
+
|
|
1220
|
+
&:before {
|
|
1221
|
+
min-width: 0;
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
& [data-line-number-content] {
|
|
1226
|
+
display: none;
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
& [data-gutter-utility-slot] {
|
|
1230
|
+
right: unset;
|
|
1231
|
+
justify-content: flex-start;
|
|
1232
|
+
left: 0;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
&[data-indicators="bars"] [data-gutter-utility-slot] {
|
|
1236
|
+
left: 6px;
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
[data-file][data-disable-line-numbers] {
|
|
1241
|
+
& [data-gutter-buffer], & [data-column-number] {
|
|
1242
|
+
border-right: 0;
|
|
1243
|
+
min-width: 0;
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
[data-diff-span] {
|
|
1248
|
+
box-decoration-break: clone;
|
|
1249
|
+
border-radius: 3px;
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
[data-line-type="change-addition"] [data-diff-span] {
|
|
1253
|
+
background-color: var(--diffs-bg-addition-emphasis);
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
[data-line-type="change-deletion"] [data-diff-span] {
|
|
1257
|
+
background-color: var(--diffs-bg-deletion-emphasis);
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
[data-merge-conflict="marker-start"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"], [data-merge-conflict="marker-end"] {
|
|
1261
|
+
color: var(--diffs-fg);
|
|
1262
|
+
padding-left: 1ch;
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
[data-merge-conflict="marker-start"], [data-merge-conflict="marker-end"] {
|
|
1266
|
+
align-items: center;
|
|
1267
|
+
display: flex;
|
|
1268
|
+
|
|
1269
|
+
&:after {
|
|
1270
|
+
color: var(--diffs-fg-conflict-marker);
|
|
1271
|
+
font-size: .75rem;
|
|
1272
|
+
font-style: normal;
|
|
1273
|
+
line-height: 1.25rem;
|
|
1274
|
+
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
1275
|
+
padding-left: 1ch;
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
[data-merge-conflict="marker-start"]:after {
|
|
1280
|
+
content: "(Current Change)";
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
[data-merge-conflict="marker-end"]:after {
|
|
1284
|
+
content: "(Incoming Change)";
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
[data-merge-conflict-actions-content] {
|
|
1288
|
+
min-height: 1.75rem;
|
|
1289
|
+
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
1290
|
+
color: var(--diffs-fg);
|
|
1291
|
+
align-items: center;
|
|
1292
|
+
gap: .25rem;
|
|
1293
|
+
padding-inline: .5rem;
|
|
1294
|
+
font-size: .75rem;
|
|
1295
|
+
line-height: 1.2;
|
|
1296
|
+
display: flex;
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
[data-merge-conflict-action] {
|
|
1300
|
+
appearance: none;
|
|
1301
|
+
color: var(--diffs-fg-number);
|
|
1302
|
+
font: inherit;
|
|
1303
|
+
cursor: pointer;
|
|
1304
|
+
background: none;
|
|
1305
|
+
border: 0;
|
|
1306
|
+
padding: 0;
|
|
1307
|
+
font-style: normal;
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
[data-merge-conflict-action]:hover {
|
|
1311
|
+
color: var(--diffs-fg);
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
[data-merge-conflict-action="current"]:hover {
|
|
1315
|
+
color: var(--diffs-addition-base);
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
[data-merge-conflict-action="incoming"]:hover {
|
|
1319
|
+
color: var(--diffs-modified-base);
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
[data-merge-conflict-action-separator] {
|
|
1323
|
+
color: var(--diffs-fg-number);
|
|
1324
|
+
opacity: .6;
|
|
1325
|
+
user-select: none;
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
[data-diffs-header="default"] {
|
|
1329
|
+
background-color: var(--diffs-bg);
|
|
1330
|
+
justify-content: space-between;
|
|
1331
|
+
align-items: center;
|
|
1332
|
+
gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1333
|
+
min-height: calc(1lh + (var(--diffs-gap-block, var(--diffs-gap-fallback)) * 3));
|
|
1334
|
+
z-index: 2;
|
|
1335
|
+
flex-direction: row;
|
|
1336
|
+
padding-inline: 16px;
|
|
1337
|
+
display: flex;
|
|
1338
|
+
position: relative;
|
|
1339
|
+
top: 0;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
[data-header-content] {
|
|
1343
|
+
align-items: center;
|
|
1344
|
+
gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1345
|
+
white-space: nowrap;
|
|
1346
|
+
flex-direction: row;
|
|
1347
|
+
min-width: 0;
|
|
1348
|
+
display: flex;
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
[data-header-content] [data-prev-name], [data-header-content] [data-title] {
|
|
1352
|
+
text-overflow: ellipsis;
|
|
1353
|
+
white-space: nowrap;
|
|
1354
|
+
direction: rtl;
|
|
1355
|
+
min-width: 0;
|
|
1356
|
+
overflow: hidden;
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
[data-prev-name] {
|
|
1360
|
+
opacity: .7;
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
[data-rename-icon] {
|
|
1364
|
+
fill: currentColor;
|
|
1365
|
+
flex-grow: 0;
|
|
1366
|
+
flex-shrink: 0;
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
[data-diffs-header="default"] [data-metadata] {
|
|
1370
|
+
white-space: nowrap;
|
|
1371
|
+
align-items: center;
|
|
1372
|
+
gap: 1ch;
|
|
1373
|
+
display: flex;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
[data-diffs-header="default"] [data-additions-count] {
|
|
1377
|
+
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
1378
|
+
color: var(--diffs-addition-base);
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
[data-diffs-header="default"] [data-deletions-count] {
|
|
1382
|
+
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
1383
|
+
color: var(--diffs-deletion-base);
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
[data-change-icon] {
|
|
1387
|
+
fill: currentColor;
|
|
1388
|
+
flex-shrink: 0;
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
[data-change-icon="change"], [data-change-icon="rename-pure"], [data-change-icon="rename-changed"] {
|
|
1392
|
+
color: var(--diffs-modified-base);
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
[data-change-icon="new"] {
|
|
1396
|
+
color: var(--diffs-addition-base);
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
[data-change-icon="deleted"] {
|
|
1400
|
+
color: var(--diffs-deletion-base);
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
[data-change-icon="file"] {
|
|
1404
|
+
opacity: .6;
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
[data-annotation-content] {
|
|
1408
|
+
z-index: 2;
|
|
1409
|
+
isolation: isolate;
|
|
1410
|
+
white-space: normal;
|
|
1411
|
+
align-self: flex-start;
|
|
1412
|
+
min-width: 0;
|
|
1413
|
+
display: flow-root;
|
|
1414
|
+
position: relative;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
[data-overflow="scroll"] [data-annotation-content], [data-overflow="scroll"] [data-merge-conflict-actions-content] {
|
|
1418
|
+
width: var(--diffs-column-content-width, auto);
|
|
1419
|
+
left: var(--diffs-column-number-width, 0);
|
|
1420
|
+
position: sticky;
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
[data-annotation-slot] {
|
|
1424
|
+
text-wrap-mode: wrap;
|
|
1425
|
+
word-break: normal;
|
|
1426
|
+
white-space-collapse: collapse;
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
[data-gutter-utility-slot] {
|
|
1430
|
+
touch-action: none;
|
|
1431
|
+
justify-content: flex-end;
|
|
1432
|
+
display: flex;
|
|
1433
|
+
position: absolute;
|
|
1434
|
+
top: 0;
|
|
1435
|
+
bottom: 0;
|
|
1436
|
+
right: 0;
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
[data-utility-button] {
|
|
1440
|
+
appearance: none;
|
|
1441
|
+
cursor: pointer;
|
|
1442
|
+
width: 1lh;
|
|
1443
|
+
height: 1lh;
|
|
1444
|
+
font-size: var(--diffs-font-size, 13px);
|
|
1445
|
+
line-height: var(--diffs-line-height, 20px);
|
|
1446
|
+
background-color: var(--diffs-modified-base);
|
|
1447
|
+
color: var(--diffs-bg);
|
|
1448
|
+
fill: currentColor;
|
|
1449
|
+
z-index: 4;
|
|
1450
|
+
touch-action: none;
|
|
1451
|
+
border: none;
|
|
1452
|
+
border-radius: 4px;
|
|
1453
|
+
justify-content: center;
|
|
1454
|
+
align-items: center;
|
|
1455
|
+
margin-right: calc(-1lh + 1ch);
|
|
1456
|
+
padding: 0;
|
|
1457
|
+
display: flex;
|
|
1458
|
+
position: relative;
|
|
1459
|
+
|
|
1460
|
+
&:before {
|
|
1461
|
+
content: "";
|
|
1462
|
+
display: block;
|
|
1463
|
+
position: absolute;
|
|
1464
|
+
inset: 0 0 0 -4px;
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
[data-decoration-bar-stack] {
|
|
1469
|
+
pointer-events: none;
|
|
1470
|
+
isolation: isolate;
|
|
1471
|
+
z-index: 1;
|
|
1472
|
+
background-color: var(--diffs-decoration-bar-color, transparent);
|
|
1473
|
+
box-sizing: content-box;
|
|
1474
|
+
border-left: 2px solid var(--diffs-bg);
|
|
1475
|
+
border-right: 2px solid var(--diffs-bg);
|
|
1476
|
+
width: 6px;
|
|
1477
|
+
position: absolute;
|
|
1478
|
+
top: 0;
|
|
1479
|
+
bottom: 0;
|
|
1480
|
+
right: -2px;
|
|
1481
|
+
|
|
1482
|
+
[data-decoration-bar-depth="1"] & {
|
|
1483
|
+
background-color: color-mix(in lab,
|
|
1484
|
+
var(--diffs-bg) 20%,
|
|
1485
|
+
var(--diffs-decoration-bar-color, transparent));
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
[data-decoration-bar-depth="2"] & {
|
|
1489
|
+
background-color: color-mix(in lab,
|
|
1490
|
+
var(--diffs-bg) 45%,
|
|
1491
|
+
var(--diffs-decoration-bar-color, transparent));
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
[data-decoration-bar-depth="3"] & {
|
|
1495
|
+
background-color: color-mix(in lab,
|
|
1496
|
+
var(--diffs-bg) 65%,
|
|
1497
|
+
var(--diffs-decoration-bar-color, transparent));
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
[data-decoration-bar-start] & {
|
|
1501
|
+
border-top-left-radius: 5px;
|
|
1502
|
+
border-top-right-radius: 5px;
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
[data-decoration-bar-end] & {
|
|
1506
|
+
z-index: 3;
|
|
1507
|
+
border-bottom-right-radius: 5px;
|
|
1508
|
+
border-bottom-left-radius: 5px;
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
[data-placeholder] {
|
|
1513
|
+
contain: strict;
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
[data-error-wrapper] {
|
|
1517
|
+
padding: var(--diffs-gap-block, var(--diffs-gap-fallback))
|
|
1518
|
+
var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1519
|
+
scrollbar-width: none;
|
|
1520
|
+
max-height: 400px;
|
|
1521
|
+
overflow: auto;
|
|
1522
|
+
|
|
1523
|
+
& [data-error-message] {
|
|
1524
|
+
color: var(--diffs-deletion-base);
|
|
1525
|
+
font-size: 18px;
|
|
1526
|
+
font-weight: bold;
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
& [data-error-stack] {
|
|
1530
|
+
color: var(--diffs-fg-number);
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
@layer theme, rendered, unsafe;
|
|
1536
|
+
`;let Ic;function Il(e){if(Ic!=null)return Ic;const t=e.host;if(typeof HTMLElement<"u"&&t instanceof HTMLElement&&!t.isConnected)return;const n=document.createElement("div");n.setAttribute("data-code",""),n.setAttribute(d5,"true");const i=document.createElement("div");return i.style.position="relative",i.style.width="200%",i.style.height="200%",n.appendChild(i),e.appendChild(n),Ic=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),Ic}function mA(e){return`${yk}: ${e==null?"var(--diffs-scrollbar-gutter-fallback)":`${e}px`};`}const gA="@layer base, theme, rendered, unsafe;",cV=new RegExp(`${dV(yk)}\\s*:\\s*[^;]+;`);function yA(e){return`${gA}
|
|
1537
|
+
@layer unsafe {
|
|
1538
|
+
${e}
|
|
1539
|
+
}`}function vA(e,t="system",n){return`${gA}
|
|
1540
|
+
@layer rendered {
|
|
1541
|
+
:host {${t==="system"?"":`
|
|
1542
|
+
color-scheme: ${t};`}
|
|
1543
|
+
${mA(n)}
|
|
1544
|
+
${e}
|
|
1545
|
+
}
|
|
1546
|
+
}`}function bA(e,t){const n=mA(t);return e.replace(cV,n)}function dV(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ad({code:e,pre:t,columnType:n,rowSpan:i,containerSize:o=!1}={}){return e==null&&(e=document.createElement("code"),e.setAttribute("data-code",""),n!=null&&e.setAttribute(`data-${n}`,""),t?.appendChild(e)),i!=null?e.style.setProperty("grid-row",`span ${i}`):e.style.removeProperty("grid-row"),o?e.setAttribute("data-container-size",""):e.removeAttribute("data-container-size"),e}function xA(e,t){if(t==null)return;const n=e.shadowRoot??e.attachShadow({mode:"open"});n.innerHTML===""&&(n.innerHTML=t)}function SA(e,{type:t,diffIndicators:n,disableBackground:i,disableLineNumbers:o,overflow:s,split:l,totalLines:c,customProperties:d}){if(d!=null)for(const f in d){const p=d[f];p!=null&&e.setAttribute(f,`${p}`)}switch(t==="diff"?(e.setAttribute("data-diff",""),e.removeAttribute("data-file")):(e.setAttribute("data-file",""),e.removeAttribute("data-diff")),n){case"bars":case"classic":e.setAttribute("data-indicators",n);break;case"none":e.removeAttribute("data-indicators");break}return o?e.setAttribute("data-disable-line-numbers",""):e.removeAttribute("data-disable-line-numbers"),i?e.removeAttribute("data-background"):e.setAttribute("data-background",""),t==="diff"?e.setAttribute("data-diff-type",l?"split":"single"):e.removeAttribute("data-diff-type"),e.setAttribute("data-overflow",s),e.style.setProperty("--diffs-min-number-column-width-default",`${`${c}`.length}ch`),e}function Nd(e){if(typeof HTMLStyleElement<"u"&&e instanceof HTMLStyleElement)return!0;const t=e.tagName??e.nodeName;return typeof t=="string"&&t.toLowerCase()==="style"}function _A(e){return e?.useTokenTransformer===!0||e?.onTokenClick!=null||e?.onTokenEnter!=null||e?.onTokenLeave!=null}function XC(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,themeType:e?.themeType,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:_A(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,unsafeCSS:e?.unsafeCSS,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}function Ug(e,t){const n=e?.offsetHeight??0;if(e==null||n===0){t();return}e.style.minHeight=`${n}px`;try{t(),e.offsetHeight}finally{e.style.minHeight=""}}function CA({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===""){t?.remove();return}return t??=fV(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function fV(){const e=document.createElement("style");return e.setAttribute(u5,""),e}let hV;function wA(){return hV??="safari"in window&&"pushNotification"in window.safari||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}if(typeof HTMLElement<"u"&&customElements.get("diffs-container")==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;const i=this.attachShadow({mode:"open"});e==null&&(e=new CSSStyleSheet,e.replaceSync(uV)),i.adoptedStyleSheets=[e]}connectedCallback(){Il(this.shadowRoot??this.attachShadow({mode:"open"}))}}customElements.define(Ny,t)}const pV=[""];let mV=-1;var EA=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file:${++mV}`;type="file";fileContainer;spriteSVG;pre;code;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;errorWrapper;placeHolder;lastRenderedHeaderHTML;cachedHeaderHTML;appliedPreAttributes;lastRowCount;mounted=!1;headerElement;headerCustom;headerPrefix;headerFilenameSuffix;headerMetadata;fileRenderer;resizeManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;file;renderRange;enabled=!0;editor;constructor(t={theme:bt},n,i=!1){this.options=t,this.workerManager=n,this.isContainerManaged=i,this.fileRenderer=new aV(t,this.handleHighlightRender,this.workerManager),this.resizeManager=new Ik,this.interactionManager=new Mk("file",Sd(t)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};rerender(){!this.enabled||this.file==null||this.render({file:this.file,forceRender:!0,renderRange:this.renderRange})}__getCurrentFile(){return this.file}onThemeChange(){this.fileRenderer.clearRenderCache(),this.rerender()}setOptions(t){t!=null&&(this.options=t,this.cachedHeaderHTML=void 0,this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(Sd(this.options))}mergeOptions(t){this.options={...this.options,...t}}setThemeType(t){(this.options.themeType??"system")!==t&&(this.mergeOptions({themeType:t}),this.applyCachedThemeState(t))}applyCachedThemeState(t){if(typeof this.options.theme=="string"||this.fileContainer==null||this.appliedThemeCSS==null)return!1;const n=this.appliedThemeCSS.baseThemeType??t;return this.appliedThemeCSS.themeType===n?!1:(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,t,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!ns(this.appliedThemeCSS.theme,this.options.theme??bt)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(t){this.lineAnnotations=t}setSelectedLines(t,n){this.interactionManager.setSelection(t,n)}setEditorActiveLine(t,n){this.interactionManager.setEditorActiveLine(t,{lineNumberOnly:n?.lineNumberOnly,side:n?.side??"additions"})}getCodeScrollLeft(){return this.code?.scrollLeft??0}setCodeScrollLeft(t){this.code!=null&&(this.code.scrollLeft=t)}__getEffectiveCodeOptions(){return{...this.options,...this.fileRenderer.getEffectiveCodeOptions()}}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}const{overflow:t="scroll"}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:t==="wrap",columnVariables:this.shouldApplyColumnVariables(t)?"apply":"measure"}),this.managersDirty=!1}shouldApplyColumnVariables(t){return t==="scroll"&&this.lineAnnotations.length>0}cleanUp(t=!1){this.emitPostRender(!0),this.editor?.cleanUp(t),this.editor=void 0,this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,t||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.pre=void 0,this.code=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.lastRenderedHeaderHTML=void 0,t||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,t?this.fileRenderer.recycle():(this.fileRenderer.cleanUp(),this.workerManager=void 0,this.file=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(t){const{fileContainer:n,prerenderedHTML:i,preventEmit:o=!1,file:s,lineAnnotations:l}=t;if(!this.enabled)throw new Error("File.hydrate: attempting to call hydrate after cleaned up");if(this.fileContainer!=null)throw new Error("File.hydrate: hydrate can only be called before the instance has rendered or hydrated");this.hydrateElements(n,i),gV(this.pre,s,this.options.collapsed)||yV(this.headerElement,s,this.options.disableFileHeader)?this.render({...t,preventEmit:!0}):this.hydrationSetup({file:s,lineAnnotations:l}),o||this.emitPostRender()}hydrateElements(t,n){this.fileContainer!==t&&this.emitPostRender(!0),xA(t,n);for(const i of Array.from(t.shadowRoot?.children??[])){if(i instanceof SVGElement){this.spriteSVG=i;continue}if(i instanceof HTMLElement){if(i instanceof HTMLPreElement){this.pre=i,this.appliedPreAttributes=void 0;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute("data-theme-css")){this.themeCSSStyle=i;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute("data-unsafe-css")){this.unsafeCSSStyle=i,this.appliedUnsafeCSS=i.textContent;continue}if("diffsHeader"in i.dataset){this.headerElement=i,this.lastRenderedHeaderHTML=void 0;continue}}}this.pre!=null&&(this.syncCodeNodeFromPre(this.pre),this.pre.removeAttribute("data-dehydrated")),this.fileContainer=t,this.hydrateMeasuredScrollbar()}hydrationSetup({file:t,lineAnnotations:n}){this.lineAnnotations=n??this.lineAnnotations,this.file=t,this.fileRenderer.setOptions(XC(this.options)),this.syncInteractionOptions(),this.pre!=null&&(this.fileRenderer.hydrate(t),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}getOrCreateLineCache(t=this.file){return t!=null?this.fileRenderer.getOrCreateLineCache(t):pV}updateBuffers(t){this.pre!=null&&this.applyBuffers(this.pre,t)}syncRenderViewToEditor(){const t=this.editor,n=this.fileContainer,i=this.file,o=this.lineAnnotations,s=this.renderRange;t!=null&&n!=null&&i!=null&&this.fileRenderer.initializeHighlighter().then(l=>{!this.enabled||this.editor!==t||this.fileContainer!==n||this.file!==i||t.__syncRenderView(l,n,i,o,s)})}attachEditor(t){this.editor?.cleanUp(),this.editor=t,this.fileRenderer.beginEditSession();const n=this.file==null?void 0:t.__prepareFile?.(this.file);return n!==void 0&&n!==this.file?this.renderPreparedFile({file:n,forceRender:!0,preventEmit:!0,renderRange:this.renderRange}):this.fileRenderer.editorRenderReady()?this.syncRenderViewToEditor():this.rerender(),()=>{this.editor=void 0,this.fileRenderer.endEditSession()}}applyDocumentChange(t,n){this.fileRenderer.applyDocumentChange(t),n!=null&&n!==this.lineAnnotations&&this.file!=null&&(this.setLineAnnotations(n),this.fileRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations())}updateRenderCache(t,n,i){this.fileRenderer.updateRenderCache(t,n,i?.lineCountChangeInFlight)}render(t){if(!this.enabled)throw new Error("File.render: attempting to call render after cleaned up");const n=this.editor?.__prepareFile?.(t.file)??t.file;return this.renderPreparedFile(n===t.file?t:{...t,file:n})}renderPreparedFile({file:t,fileContainer:n,forceRender:i=!1,preventEmit:o=!1,containerWrapper:s,deferManagers:l=!1,lineAnnotations:c,renderRange:d}){this.editor?.__postponeBgTokenizeToNextFrame();const{collapsed:f=!1,themeType:p="system"}=this.options,m=f?void 0:d,g=this.renderRange,v=this.hasThemeChanged(),x=c!=null&&(c.length>0||this.lineAnnotations.length>0)?c!==this.lineAnnotations:!1,S=!Kn(this.file,t)||this.fileRenderer.hasUnkeyedFileContentsChanged(t);if(!f&&!i&&mf(m,this.renderRange)&&!S&&!x&&!v)return this.applyCachedThemeState(p);this.renderRange=m,S&&(this.cachedHeaderHTML=void 0),this.file=t,this.fileRenderer.setOptions(XC(this.options)),this.syncInteractionOptions(),c!=null&&this.setLineAnnotations(c),this.fileRenderer.setLineAnnotations(this.lineAnnotations);const{disableErrorHandling:w=!1,disableFileHeader:_=!1}=this.options;if(_&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),n=this.getOrCreateFileContainerNode(n,s),this.applyCachedThemeState(p),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const C=this.fileRenderer.renderFile(t,vk);C!=null&&this.applyThemeState(n,C.themeStyles,p,C.baseThemeType),C?.headerAST!=null&&this.applyHeaderToDOM(C.headerAST,n),this.injectUnsafeCSS()}catch(C){if(w)throw C;console.error(C),C instanceof Error&&this.applyErrorToDOM(C,n)}return o||this.emitPostRender(),!0}try{const C=this.getOrCreatePreNode(n);if(!this.canPartiallyRender(i,x,S||v)||!this.applyPartialRender(g,m)){const T=this.fileRenderer.renderFile(t,m);if(T==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(n,T.themeStyles,p,T.baseThemeType),T.headerAST!=null&&this.applyHeaderToDOM(T.headerAST,n),this.applyFullRender(T,C)}this.applyBuffers(C,m),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,l||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(C){if(w)throw C;console.error(C),C instanceof Error&&this.applyErrorToDOM(C,n)}return o||this.emitPostRender(),!0}emitPostRender(t=!1){const{fileContainer:n,options:{onPostRender:i}}=this;if(t){if(!this.mounted||(this.mounted=!1,n==null))return;i?.(n,this,"unmount");return}if(n==null)return;const o=this.mounted?"update":"mount";this.mounted=!0,i?.(n,this,o)}removeRenderedCode(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.code?.remove(),this.code=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(const{element:t}of this.annotationCache.values())t.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}canPartiallyRender(t,n,i){return!(t||n||i)}renderPlaceholder(t){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){const n=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:"open"});this.placeHolder=document.createElement("div"),this.placeHolder.dataset.placeholder="",n.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty("height",`${t}px`),!0}async primeHighlightCache(t=this.file){const{workerManager:n}=this;if(t==null||n==null||!n.isWorkingPool()||t.cacheKey==null||Ml(t))return;const i=this.options.tokenizeMaxLength??1e5;this.fileRenderer.getOrCreateLineCache(t).length>i||await n.primeFileHighlightCache(t).catch(o=>{console.error(o)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.code?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.code=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(const{element:i}of this.annotationCache.values())i.remove();this.annotationCache.clear();return}const t=new Map(this.annotationCache),{renderAnnotation:n}=this.options;if(n!=null&&this.lineAnnotations.length>0)for(const[i,o]of this.lineAnnotations.entries()){const s=`${i}-${ti(o)}`;let l=this.annotationCache.get(s);if(l==null||!sV(o,l.annotation)){l?.element.remove();const c=n(o);if(c==null)continue;l={element:fA(ti(o)),annotation:o},l.element.appendChild(c),this.fileContainer.appendChild(l.element),this.annotationCache.set(s,l)}t.delete(s)}for(const[i,{element:o}]of t.entries())this.annotationCache.delete(i),o.remove()}renderGutterUtility(){const{renderGutterUtility:t}=this.options;if(this.fileContainer==null||t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const n=t(this.interactionManager.getHoveredLine);if(n!=null&&this.gutterUtilityContent!=null)return;if(n==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const i=hA();i.appendChild(n),this.fileContainer.appendChild(i),this.gutterUtilityContent=i}injectUnsafeCSS(){const{unsafeCSS:t}=this.options,n=this.fileContainer?.shadowRoot;if(n!=null){if(t==null||t===""){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}this.unsafeCSSStyle?.parentNode===n&&this.appliedUnsafeCSS===t||(this.unsafeCSSStyle??=pA(),this.unsafeCSSStyle.parentNode!==n&&n.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=yA(t),this.appliedUnsafeCSS=t)}}applyThemeState(t,n,i,o){const s=t.shadowRoot??t.attachShadow({mode:"open"}),l=o??i,c=this.options.theme??bt,d=typeof c=="string"?c:{...c},f=Il(s);if(this.themeCSSStyle?.parentNode===s&&this.appliedThemeCSS?.themeStyles===n&&this.appliedThemeCSS.themeType===l&&this.appliedThemeCSS.scrollbarGutter===f){this.appliedThemeCSS.theme=d;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===s){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:d,themeStyles:n,themeType:l,baseThemeType:o,scrollbarGutter:f};return}this.themeCSSStyle=CA({shadowRoot:s,currentNode:this.themeCSSStyle,themeCSS:vA(n,l,f)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:d,themeStyles:n,themeType:l,baseThemeType:o,scrollbarGutter:f}:void 0}hydrateMeasuredScrollbar(){const t=this.fileContainer?.shadowRoot;t==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=bA(this.themeCSSStyle.textContent??"",Il(t)))}shouldGuardRebuildScroll(){return this.editor!=null&&wA()}applyFullRender(t,n){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(n,t);const i=this.code=ad({code:this.code}),o=this.fileRenderer.renderCodeAST(t);this.editor?.__captureFocusForDOMReplacement();const s=()=>{if(i.childElementCount>=2)for(let l=0;l<2;l++){const c=i.children[l],d=o[l];c.innerHTML=nn(d.children),c.style.cssText=d.properties.style}else i.innerHTML=nn(o);n.contains(i)||n.replaceChildren(i)};this.shouldGuardRebuildScroll()?Ug(n,s):s(),this.lastRowCount=t.rowCount}applyPartialRender(t,n){if(t==null||n==null)return!1;const{file:i,code:o}=this,s=o!=null?this.getColumns(o):void 0;if(i==null||o==null||s==null)return!1;const l=t.startingLine,c=n.startingLine,d=t.totalLines===1/0?Number.POSITIVE_INFINITY:l+t.totalLines,f=n.totalLines===1/0?Number.POSITIVE_INFINITY:c+n.totalLines,p=Math.max(l,c),m=Math.min(d,f);if(m<=p)return!1;if(!this.trimDOMToOverlap(s.gutter,p,m)||!this.trimDOMToOverlap(s.content,p,m))throw new Error("File.applyPartialRender: failed to trim to overlap");let{length:g}=s.content.children;const v=(_,C)=>{if(!(C<=0))return this.fileRenderer.renderFile(i,{startingLine:_,totalLines:C,bufferBefore:0,bufferAfter:0})},x=c<p?v(c,p-c):void 0;if(x===void 0&&c<p)return!1;const S=f===Number.POSITIVE_INFINITY?Number.POSITIVE_INFINITY:Math.max(0,f-m),w=f>m?v(m,S):void 0;return w===void 0&&f>m?!1:(this.cleanupErrorWrapper(),x!=null&&(s.gutter.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(x.gutterAST)),s.content.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(x.contentAST)),g+=x.rowCount),w!=null&&(s.gutter.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(w.gutterAST)),s.content.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(w.contentAST)),g+=w.rowCount),this.lastRowCount!==g&&(s.gutter.style.setProperty("grid-row",`span ${g}`),s.content.style.setProperty("grid-row",`span ${g}`),this.lastRowCount=g),!0)}getColumns(t){const n=t.children[0],i=t.children[1];if(!(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||n.dataset.gutter==null||i.dataset.content==null))return{gutter:n,content:i}}trimDOMToOverlap(t,n,i){const o=this.getDOMBoundaryIndices(t,[n,i]),s=o.get(n)??t.children.length,l=o.get(i)??t.children.length;if(s>l)return!1;for(let c=t.children.length-1;c>=l;c-=1)t.children[c]?.remove();for(let c=s-1;c>=0;c-=1)t.children[c]?.remove();return!0}getDOMBoundaryIndices(t,n){const i=[...new Set(n)].sort((d,f)=>d-f),o=new Map;if(i.length===0)return o;let s=0,l=i[s];const{children:c}=t;l===0&&(o.set(0,0),s+=1,l=i[s]);for(let d=0;d<c.length;d+=1){const f=c[d];if(!(f instanceof HTMLElement))continue;const p=this.getLineIndexFromDOMNode(f);if(p!=null){for(;l!=null&&p>=l;)o.set(l,d),s+=1,l=i[s];if(s>=i.length)break}}for(const d of i)o.has(d)||o.set(d,c.length);return o}getLineIndexFromDOMNode(t){const n=t.dataset.lineIndex;if(n==null)return;const i=Number(n);return Number.isNaN(i)?void 0:i}applyBuffers(t,n){if(n==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}n.bufferBefore>0?(this.bufferBefore==null&&(this.bufferBefore=document.createElement("div"),this.bufferBefore.dataset.virtualizerBuffer="before",t.before(this.bufferBefore)),this.bufferBefore.style.setProperty("height",`${n.bufferBefore}px`),this.bufferBefore.style.setProperty("contain","strict")):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),n.bufferAfter>0?(this.bufferAfter==null&&(this.bufferAfter=document.createElement("div"),this.bufferAfter.dataset.virtualizerBuffer="after",t.after(this.bufferAfter)),this.bufferAfter.style.setProperty("height",`${n.bufferAfter}px`),this.bufferAfter.style.setProperty("contain","strict")):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyHeaderToDOM(t,n){const{file:i}=this;if(i==null)return;this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;const o=this.cachedHeaderHTML??nn(t);if(this.cachedHeaderHTML=o,o!==this.lastRenderedHeaderHTML){const f=document.createElement("div");f.innerHTML=o;const p=f.firstElementChild;if(!(p instanceof HTMLElement))return;this.headerElement!=null?n.shadowRoot?.replaceChild(p,this.headerElement):n.shadowRoot?.prepend(p),this.headerElement=p,this.lastRenderedHeaderHTML=o}if(this.isContainerManaged)return;const{renderHeaderPrefix:s,renderHeaderFilenameSuffix:l,renderCustomHeader:c,renderHeaderMetadata:d}=this.options;if(c!=null){const f=c(i)??void 0;this.headerCustom=this.upsertHeaderSlotElement(n,this.headerCustom,Gl,f),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0}else{const f=s?.(i)??void 0,p=l?.(i)??void 0,m=d?.(i)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(n,this.headerPrefix,zy,f),this.headerFilenameSuffix=this.upsertHeaderSlotElement(n,this.headerFilenameSuffix,Py,p),this.headerMetadata=this.upsertHeaderSlotElement(n,this.headerMetadata,Hy,m),this.headerCustom?.remove(),this.headerCustom=void 0}}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(t,n,i,o){if(o==null){n?.remove();return}const s=n??this.createHeaderSlotElement(i);return n==null&&t.appendChild(s),this.replaceHeaderSlotContent(s,o),s}replaceHeaderSlotContent(t,n){t.replaceChildren(),n instanceof Element?t.appendChild(n):t.innerText=`${n}`}createHeaderSlotElement(t){const n=document.createElement("div");return n.slot=t,n}getOrCreateFileContainerNode(t,n){const{fileContainer:i}=this,o=t??i??document.createElement("diffs-container"),s=i!==o;return i!=null&&s&&this.editor?.__captureFocusForDOMReplacement(),s&&this.emitPostRender(!0),this.fileContainer=o,i!=null&&s&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),n!=null&&this.fileContainer.parentNode!==n&&n.appendChild(this.fileContainer),s&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(t){const{shadowRoot:n}=t;if(n!=null)for(const i of n.children)i instanceof SVGElement?this.spriteSVG??=i:Nd(i)&&i.hasAttribute("data-theme-css")?(this.themeCSSStyle??=i,this.hasAdoptedThemeCSS=!0):Nd(i)&&i.hasAttribute("data-unsafe-css")&&(this.unsafeCSSStyle??=i,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(t){const n=t.shadowRoot??t.attachShadow({mode:"open"});if(this.spriteSVG==null){const i=document.createElement("div");i.innerHTML=cA;const o=i.firstChild;o instanceof SVGElement&&(this.spriteSVG=o)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==n&&n.appendChild(this.spriteSVG)}getOrCreatePreNode(t){const n=t.shadowRoot??t.attachShadow({mode:"open"});return this.pre==null?(this.pre=document.createElement("pre"),this.appliedPreAttributes=void 0,this.code=void 0,n.appendChild(this.pre)):this.pre.parentNode!==n&&(this.editor?.__captureFocusForDOMReplacement(),t.shadowRoot?.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodeFromPre(t){this.code=void 0;for(const n of Array.from(t.children))if(n instanceof HTMLElement&&n.hasAttribute("data-code")){this.code=n;return}}applyPreNodeAttributes(t,{totalLines:n}){const{overflow:i="scroll",disableLineNumbers:o=!1}=this.options,s={type:"file",split:!1,overflow:i,disableLineNumbers:o,diffIndicators:"none",disableBackground:!0,totalLines:n};dA(s,this.appliedPreAttributes)||(SA(t,s),this.appliedPreAttributes=s)}applyErrorToDOM(t,n){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;const i=n.shadowRoot??n.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",i.appendChild(this.errorWrapper);const o=document.createElement("div");o.dataset.errorMessage="",o.innerText=t.message,this.errorWrapper.appendChild(o);const s=document.createElement("pre");s.dataset.errorStack="",s.innerText=t.stack??"No Error Stack",this.errorWrapper.appendChild(s)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function gV(e,t,n=!1){return!n&&e==null&&t!=null}function yV(e,t,n=!1){return e==null&&t!=null&&!n}function sd(e){return{...jy,...e}}function vi(e,t){const n=vV(e,t);return t?n:e.diffHeaderHeight+n}function vV(e,t){return e.paddingTop??(t?e.spacing:0)}function zd(e){return e.paddingBottom??e.spacing}function bV(e){switch(e){case"simple":return 4;case"metadata":case"line-info":case"line-info-basic":case"custom":return 32}}const xV=5e3;let SV=-1;function _V(e,t){return(e.overflow??"scroll")!==(t.overflow??"scroll")||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||e.unsafeCSS!==t.unsafeCSS}var CV=class extends EA{virtualizer;metrics;__id=`virtualized-file:${++SV}`;top;height=0;cache={heights:new Map,checkpoints:[],fileAnnotationHeight:0};isVisible=!1;isSetup=!1;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n=jy,i,o=!1){super(e,i,o),this.virtualizer=t,this.metrics=n}setMetrics(e,t=!1){const n=sd(e);!t&&bd(this.metrics,n)||(this.metrics=n,this.resetLayoutCache())}setLineAnnotations(e){this.syncLineAnnotations(e)&&this.resetLayoutCache()}syncLineAnnotations(e){return e==null||e===this.lineAnnotations||e.length===0&&this.lineAnnotations.length===0?!1:(super.setLineAnnotations(e),!0)}hasLineAnnotations(){return this.lineAnnotations.some(e=>e.lineNumber>0)}getLineHeight(e,t=!1){const n=this.cache.heights.get(e);if(n!=null)return n;const i=t?2:1;return this.metrics.lineHeight*i}setOptions(e){if(this.isAdvancedMode())throw new Error("VirtualizedFile.setOptions cannot be used inside CodeView. Update CodeView options instead.");if(e==null)return;const{options:t}=this,n=!tf(t,e),i=_V(t,e);super.setOptions(e),i&&this.resetLayoutCache(!0),n&&(this.forceRenderOverride=!0),n&&this.virtualizer.instanceChanged(this,i)}setThemeType(e){if(this.isAdvancedMode())throw new Error("VirtualizedFile.setThemeType cannot be used inside CodeView. Update CodeView options instead.");super.setThemeType(e)}resetLayoutCache(e=!1,t=!0){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heights.size>0&&this.cache.heights.clear(),this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.renderRange!=null&&t&&(this.renderRange=void 0),e&&this.isSimpleMode()&&this.computeApproximateSize()}reconcileHeights(){let e=!1;if(this.fileContainer==null||this.file==null)return this.height!==0&&(e=!0),this.height=0,e;const{overflow:t="scroll"}=this.options;if(this.top=this.getVirtualizedTop(),t==="scroll"&&this.lineAnnotations.length===0&&!this.isResizeDebuggingEnabled()||this.code==null)return e;const n=this.code.children[1];if(!(n instanceof HTMLElement))return e;const i=jg(this.lineAnnotations);if(this.renderRange!=null&&i&&gf(this.renderRange)){const o=wV(n)??0;o!==this.cache.fileAnnotationHeight&&(this.cache.fileAnnotationHeight=o,e=!0)}else!i&&this.cache.fileAnnotationHeight!==0&&(this.cache.fileAnnotationHeight=0,e=!0);for(const o of n.children){if(!(o instanceof HTMLElement))continue;const s=o.dataset.lineIndex;if(s==null)continue;const l=Number(s);let c=o.getBoundingClientRect().height,d=!1;o.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in o.nextElementSibling.dataset||"noNewline"in o.nextElementSibling.dataset)&&("noNewline"in o.nextElementSibling.dataset&&(d=!0),c+=o.nextElementSibling.getBoundingClientRect().height);const f=this.getLineHeight(l,d);c!==f&&(e=!0,c===this.metrics.lineHeight*(d?2:1)?this.cache.heights.delete(l):this.cache.heights.set(l,c))}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer==null||this.file==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render({file:this.file}));prepareCodeViewItem(e,t,n,i){const o=this.syncLineAnnotations(i),s=!Kn(this.file,e)||this.fileRenderer.hasUnkeyedFileContentsChanged(e);let l=n?.resetFileLayoutCache===!0||s||o;n?.metrics!=null&&(this.metrics=n.metrics,l=!0);const{collapsed:c=!1}=this.options;return this.currentCollapsed!==c&&(this.currentCollapsed=c,l=!0),l&&this.resetLayoutCache(),this.file!==e&&(this.layoutDirty=!0),this.file=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e){if(this.file==null||e<1)return;const{disableFileHeader:t=!1,collapsed:n=!1}=this.options,i=this.fileRenderer.getLineCount(this.file)-1;let o=vi(this.metrics,t);if(n||i<0)return{top:o,height:0};const s=Math.min(Math.max(e-1,0),i),{overflow:l="scroll"}=this.options,{lineHeight:c}=this.metrics;if(o+=this.cache.fileAnnotationHeight,l==="scroll"&&!this.hasLineAnnotations())return{top:o+s*c,height:c};const d=this.getLayoutCheckpointBeforeLineIndex(s);o=d?.top??o;for(let f=d?.lineIndex??0;f<s;f++)o+=this.getLineHeight(f,!1);return{top:o,height:this.getLineHeight(s,!1)}}getEditorViewport(){return this.virtualizer.type==="simple"?this.virtualizer.getRoot():this.virtualizer.getContainerElement()}getNumericScrollAnchor(e){if(this.file==null||this.renderRange==null)return;const{disableFileHeader:t=!1,collapsed:n=!1,overflow:i="scroll"}=this.options;if(n||this.renderRange.totalLines<=0)return;const o=this.fileRenderer.getLineCount(this.file)-1;if(o<0)return;const s=vi(this.metrics,t),l=Math.min(this.renderRange.startingLine,o),c=Math.min(l+this.renderRange.totalLines-1,o);if(c<l)return;const{fileAnnotationHeight:d}=this.cache;if(i==="scroll"&&!this.hasLineAnnotations()){const{lineHeight:p}=this.metrics,m=s+(l===0?d:this.renderRange.bufferBefore),g=l+Math.max(Math.ceil((e-m)/p),0);return g>c?void 0:{lineNumber:g+1,top:s+d+g*p}}let f=s+(l===0?d:this.renderRange.bufferBefore);for(let p=l;p<=c;p++){if(f>=e)return{lineNumber:p+1,top:f};f+=this.getLineHeight(p)}}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){if(this.top==null||this.file==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};const t=e!=null?this.computeRenderRangeFromWindow(this.file,this.top,e):this.renderRange;if(t==null)return;const{bufferBefore:n,bufferAfter:i,totalLines:o}=t;let s=0;if(o===0){const l=e??this.virtualizer.getWindowSpecs();this.top<l.top&&(s=i)}return{topOffset:this.top+n+s,height:this.height-(n+i)}}cleanUp(e=!1){this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||this.resetLayoutCache(),this.isSetup=!1,super.cleanUp(e)}computeApproximateSize(e=!1,t=this.file){const n=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!n)return;const i=this.height===0;if(this.height=0,this.cache.checkpoints=[],t==null){this.layoutDirty=!1;return}const{disableFileHeader:o=!1,collapsed:s=!1,overflow:l="scroll"}=this.options,{lineHeight:c}=this.metrics,d=this.fileRenderer.getLineCount(t),f=vi(this.metrics,o),p=zd(this.metrics);if(this.height+=f,s){this.layoutDirty=!1;return}if(this.height+=this.cache.fileAnnotationHeight,l==="scroll"&&!this.hasLineAnnotations())this.height+=d*c;else for(let m=0;m<d;m++)this.addLayoutCheckpoint(m,this.height),this.height+=this.getLineHeight(m,!1);if(d>0&&(this.height+=p),this.fileContainer!=null&&n&&!i){const m=this.fileContainer.getBoundingClientRect();m.height!==this.height?console.log("VirtualizedFile.computeApproximateSize: computed height doesnt match",{name:t.name,elementHeight:m.height,computedHeight:this.height}):console.log("VirtualizedFile.computeApproximateSize: computed height IS CORRECT")}this.layoutDirty=!1}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){!this.enabled||this.file==null||(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}applyDocumentChange(e,t,n=!1){const{renderRange:i}=this;if(this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache(this.isSimpleMode(),!1),!this.isSimpleMode())this.computeApproximateSize(!0);else if(n&&i!==void 0&&this.file!==void 0){const o=this.virtualizer.getWindowSpecs(),s=this.computeRenderRangeFromWindow(this.file,this.top??0,o);s.bufferAfter!==i.bufferAfter&&this.updateBuffers(s)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}renderPreparedFile({fileContainer:e,file:t,forceRender:n=!1,lineAnnotations:i,...o}){const s=this.file==null||!Kn(this.file,t)||this.fileRenderer.hasUnkeyedFileContentsChanged(t),{forceRenderOverride:l,isSetup:c}=this;this.forceRenderOverride=void 0;const d=this.syncLineAnnotations(i);if(d&&this.resetLayoutCache(),e=this.getOrCreateFileContainerNode(e),t==null)return console.error("VirtualizedFile.render: attempting to virtually render when we dont have file"),!1;if(c)this.top??=this.getVirtualizedTop(),s&&this.isSimpleMode()&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache(!1),this.computeApproximateSize(!1,t));else{this.computeApproximateSize(!1,t);const v=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(v==null)throw new Error("VirtualizedFile.render: simple virtualizer is not available");v.connect(e,this),this.isVisible=v.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!s||!c))return this.file=t,s&&(this.cachedHeaderHTML=void 0),this.renderPlaceholder(this.height);const f=this.virtualizer.getWindowSpecs(),p=this.top??0,m=this.computeRenderRangeFromWindow(t,p,f),g=super.renderPreparedFile({file:t,fileContainer:e,renderRange:m,lineAnnotations:i,forceRender:(l??n)||d||s,...o});return this.isSimpleMode()&&g&&this.getSimpleVirtualizer()?.requestHeightReconcile(this),g}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}shouldGuardRebuildScroll(){return!1}isSimpleMode(){return this.virtualizer.type==="simple"}isAdvancedMode(){return this.virtualizer.type==="advanced"}addLayoutCheckpoint(e,t){e%xV===0&&this.cache.checkpoints.push({lineIndex:e,top:t})}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,i;for(;t<=n;){const o=t+n>>1,s=this.cache.checkpoints[o];if(s==null)throw new Error("VirtualizedFile: invalid checkpoint index");s.lineIndex<=e?(i=s,t=o+1):n=o-1}return i}getLayoutCheckpointBeforeTop(e,t){let n=0,i=this.cache.checkpoints.length-1,o=-1;for(;n<=i;){const s=n+i>>1,l=this.cache.checkpoints[s];if(l==null)throw new Error("VirtualizedFile: invalid checkpoint index");l.top<=e?(o=s,n=s+1):i=s-1}if(t==null)return o>=0?this.cache.checkpoints[o]:void 0;for(let s=o;s>=0;s--){const l=this.cache.checkpoints[s];if(l==null)throw new Error("VirtualizedFile: invalid checkpoint index");if(l.lineIndex%t===0)return l}}getVirtualizedTop(){return this.virtualizer.type==="advanced"?this.virtualizer.getLocalTopForInstance(this):this.fileContainer!=null?this.virtualizer.getOffsetInScrollContainer(this.fileContainer):0}getSimpleVirtualizer(){return this.virtualizer.type==="simple"?this.virtualizer:void 0}getAdvancedVirtualizer(){return this.virtualizer.type==="advanced"?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}computeRenderRangeFromWindow(e,t,{top:n,bottom:i}){const{disableFileHeader:o=!1,overflow:s="scroll"}=this.options,{hunkLineCount:l,lineHeight:c}=this.metrics,d=this.fileRenderer.getLineCount(e),f=this.height,p=vi(this.metrics,o),m=d>0?zd(this.metrics):0,{fileAnnotationHeight:g}=this.cache,v=p+g,x=Math.max(0,f-p-g-m),S=jg(this.lineAnnotations),w=t+p,_=g>0&&S&&w<i&&w+g>n;if(t<n-f||t>i)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-p-m};if(d<=l)return{startingLine:0,totalLines:l,bufferBefore:0,bufferAfter:0};const C=Math.ceil(Math.max(i-n,0)/c),T=Math.ceil(C/l)*l+l,D=T/l,I=(n+i)/2;if(s==="scroll"&&!this.hasLineAnnotations()){const se=t+v,de=se+x;if(!_&&!(se<i&&de>n))return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-p-m};const le=Math.floor(_&&I<t+v?0:(I-(t+v))/c),be=Math.floor(le/l)-Math.floor(D/2),Ee=Math.ceil(d/l),ge=Math.max(0,Math.min(be,Ee))*l,We=be<0?T+be*l:T,Ge=ge===0?0:g+ge*c,ot=Math.min(We,d-ge);return{startingLine:ge,totalLines:We,bufferBefore:Ge,bufferAfter:Math.max(0,(d-ge-ot)*c)}}const O=D,P=[],j=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-T*c*2),l);let F=t+(j?.top??v),Q=j?.lineIndex??0,G,B,ee;const Z=j?.lineIndex??0;for(let se=Z;se<d;se++){const de=Q%l===0,le=Math.floor(Q/l);if(de&&(P[le]=F-(t+v),ee!=null)){if(ee<=0)break;ee--}const be=this.getLineHeight(se,!1);F>n-be&&F<i&&(G??=le),F+be>I&&(B??=le),ee==null&&F>=i&&de&&(ee=O),Q++,F+=be}if(G==null)if(_)G=0,B=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-p-m};B??=G;const W=Math.round(B-D/2),z=Math.max(0,Math.ceil(d/l)-D),q=Math.max(0,Math.min(W,z)),te=q*l,ce=W<0?T+W*l:T,R=P[q]??0,H=te===0?0:g+R,Y=q+ce/l,N=Y<P.length?x-P[Y]:x-(F-t-v);return{startingLine:te,totalLines:ce,bufferBefore:H,bufferAfter:Math.max(0,N)}}};function wV(e){let t;for(const n of e.children)n instanceof HTMLElement&&n.dataset.lineAnnotation===sA&&(t=Math.max(t??0,n.getBoundingClientRect().height));return t}function ko(e,t){return e===t||e?.cacheKey!=null&&e.cacheKey===t?.cacheKey}function EV(e){return{...e,hunks:e.hunks.map(t=>({...t,hunkContent:t.hunkContent.map(n=>({...n}))})),deletionLines:[...e.deletionLines],additionLines:[...e.additionLines]}}function Vg(e){return e!==""?e.split(r5):[]}function Pd(e,t,n){const i=e==="clone"?EV(t):t;if(!i.isPartial)throw new Error("hydratePartialDiff: fileDiff must be partial");switch(i.type){case"change":case"rename-changed":return kV(i,AV(i,n),KC(i,n));case"rename-pure":{const o=KC(i,n);LV(i,n);const s=Vg(o.contents);return i.isPartial=!1,i.deletionLines=s,i.additionLines=s,kA(i,null,o),i}}throw new Error(`hydratePartialDiff: ${i.type} diffs cannot be hydrated from loaded files`)}function kV(e,t,n){const i=Vg(t.contents),o=Vg(n.contents),{hunks:s,splitLineCount:l,unifiedLineCount:c}=TV(e.hunks,o.length);return e.hunks=s,e.splitLineCount=l,e.unifiedLineCount=c,e.isPartial=!1,e.deletionLines=i,e.additionLines=o,kA(e,t,n),e}function TV(e,t){let n=0,i=0,o=0;const s=[];for(const l of e){const c=Math.max(l.additionStart-1,0),d=Math.max(l.deletionStart-1,0);let f=c,p=d,m=0,g=0,v=0,x=0;const S=[];for(const _ of l.hunkContent){if(_.type==="context"){S.push({..._,additionLineIndex:f,deletionLineIndex:p}),f+=_.lines,p+=_.lines,v+=_.lines,x+=_.lines;continue}S.push({..._,additionLineIndex:f,deletionLineIndex:p}),f+=_.additions,p+=_.deletions,m+=_.additions,g+=_.deletions,v+=Math.max(_.additions,_.deletions),x+=_.additions+_.deletions}const w=Math.max(Ei(l.additionStart,l.additionCount)-o,0);s.push({...l,collapsedBefore:w,additionLineIndex:c,deletionLineIndex:d,additionLines:m,deletionLines:g,hunkContent:S,splitLineStart:n+w,unifiedLineStart:i+w,splitLineCount:v,unifiedLineCount:x}),n+=w+v,i+=w+x,o=yn(l.additionStart,l.additionCount)}if(s.length>0){const l=s[s.length-1],c=yn(l.additionStart,l.additionCount),d=Math.max(t-c,0);n+=d,i+=d}return{hunks:s,splitLineCount:n,unifiedLineCount:i}}function AV(e,t){if(t.oldFile==null)throw new Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile`);return t.oldFile}function KC(e,t){if(t.newFile==null)throw new Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires newFile`);return t.newFile}function LV(e,t){if(t.oldFile!==null)throw new Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile to be null`)}function RV(e,t,n){return e.cacheKey!=null?`${e.cacheKey}:hydrated`:OV(t,n)}function kA(e,t,n){const i=RV(e,t,n);if(i==null){delete e.cacheKey;return}e.cacheKey=i}function OV(e,t){return e!=null&&t!=null?e.cacheKey!=null&&t.cacheKey!=null?`${e.cacheKey}:${t.cacheKey}`:void 0:e?.cacheKey??t?.cacheKey}var DV=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,this.enabled=!1)}setup(e,t,n){if(t==null||n==null)for(const i of e.children??[])i instanceof HTMLElement&&("deletions"in i.dataset?t=i:"additions"in i.dataset&&(n=i));if(n==null||t==null){this.cleanUp();return}this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener("scroll",this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==n&&(this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),this.codeAdditions=n,n.addEventListener("scroll",this.handleAdditionsScroll,{passive:!0})),this.enabled=!0}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function gi(e,t){return ns(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function Nc(e){return Le({tagName:"div",properties:{"data-content-buffer":"","data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function zc(e){return Le({tagName:"div",children:[Le({tagName:"span",children:[Si("No newline at end of file")]})],properties:{"data-no-newline":"","data-line-type":e,"data-column-content":""}})}function Tm(e){return Le({tagName:"div",children:[xd({name:e==="both"?"diffs-icon-expand-all":"diffs-icon-expand",properties:{"data-icon":""}})],properties:{role:"button","data-expand-button":"","data-expand-both":e==="both"?"":void 0,"data-expand-up":e==="up"?"":void 0,"data-expand-down":e==="down"?"":void 0}})}function Ia({type:e,content:t,expandIndex:n,chunked:i=!1,slotName:o,isFirstHunk:s,isLastHunk:l}){let c=0;const d=[];if(e==="metadata"&&t!=null&&d.push(Le({tagName:"div",children:[Si(t)],properties:{"data-separator-wrapper":""}})),(e==="line-info"||e==="line-info-basic")&&t!=null){const f=[];n!=null&&(i?(s||(f.push(Tm("up")),c++),l||(f.push(Tm("down")),c++)):(f.push(Tm(!s&&!l?"both":s?"down":"up")),c++)),f.push(Le({tagName:"div",children:[Le({tagName:"span",children:[Si(t)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),i&&n!=null&&f.push(Le({tagName:"div",children:[Si("Expand all")],properties:{role:"button","data-expand-button":"","data-expand-all-button":""}})),d.push(Le({tagName:"div",children:f,properties:{"data-separator-wrapper":"","data-separator-multi-button":c>1?"":void 0}}))}return e==="custom"&&o!=null&&d.push(Le({tagName:"slot",properties:{name:o}})),Le({tagName:"div",children:d,properties:{"data-separator":d.length===0?"simple":e,"data-expand-index":n,"data-separator-first":s?"":void 0,"data-separator-last":l?"":void 0}})}function MV(e,t){return`hunk-separator-${e}-${t}`}function IV(e){const t=e.at(-1);return t==null?0:Math.max(yn(t.additionStart,t.additionCount),yn(t.deletionStart,t.deletionCount))}function Fg(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function QC({line:e,spanStart:t,spanLength:n}){return{start:{line:e,character:t},end:{line:e,character:t+n},properties:{"data-diff-span":""},alwaysWrap:!0}}function Pc({item:e,arr:t,enableJoin:n,isNeutral:i=!1,isLastItem:o=!1}){const s=t[t.length-1];if(s==null||o||!n){t.push([i?0:1,e.value]);return}const l=s[0]===0;if(i===l||i&&e.value.length===1&&!l){s[1]+=e.value;return}t.push([i?0:1,e.value])}function Nl(e){return[Ei(e.additionStart,e.additionCount)+1,yn(e.additionStart,e.additionCount)+1]}function ar({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:i,collapsedContextThreshold:o}){const s=Math.max(t,0);if(s===0||e)return{fromStart:0,fromEnd:0,rangeSize:s,collapsedLines:s,renderAll:!1};if(n===!0||s<=o)return{fromStart:s,fromEnd:0,rangeSize:s,collapsedLines:0,renderAll:!0};const l=n?.get(i),c=Math.min(Math.max(l?.fromStart??0,0),s),d=Math.min(Math.max(l?.fromEnd??0,0),s),f=c+d,p=f>=s;return{fromStart:p?s:c,fromEnd:p?0:d,rangeSize:s,collapsedLines:Math.max(s-f,0),renderAll:p}}function NV(e){const t=e.hunks[e.hunks.length-1];if(t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return!1;const n=e.additionLines.length-yn(t.additionStart,t.additionCount),i=e.deletionLines.length-yn(t.deletionStart,t.deletionCount);return n<=0&&i<=0?!1:n!==i}function TA({fileDiff:e,errorPrefix:t}){const n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;const i=e.additionLines.length-yn(n.additionStart,n.additionCount),o=e.deletionLines.length-yn(n.deletionStart,n.deletionCount);if(i<=0&&o<=0)return 0;if(i!==o)throw new Error(`${t}: trailing context mismatch (additions=${i}, deletions=${o}) for ${e.name}`);return Math.min(i,o)}function sr({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:i,errorPrefix:o}){if(t!==e.hunks.length-1)return;const s=TA({fileDiff:e,errorPrefix:o});if(s<=0)return;if(n===!0||s<=i)return{fromStart:s,fromEnd:0,rangeSize:s,collapsedLines:0,renderAll:!0};const l=n?.get(e.hunks.length),c=Math.min(Math.max(l?.fromStart??0,0),s);return{fromStart:c,fromEnd:0,rangeSize:s,collapsedLines:s-c,renderAll:c>=s}}function AA({fileDiff:e,lineNumber:t,expandedHunks:n,collapsedContextThreshold:i}){if(n===!0||e.isPartial)return!0;for(const[c,d]of e.hunks.entries()){const[f,p]=Nl(d);if(t<f){const m=ar({isPartial:e.isPartial,rangeSize:d.collapsedBefore,expandedHunks:n,hunkIndex:c,collapsedContextThreshold:i}),g=f-m.rangeSize;return m.renderAll||t<g+m.fromStart||t>=f-m.fromEnd}if(t<p)return!0}const o=sr({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:n,collapsedContextThreshold:i,errorPrefix:"isAdditionLineRenderable"});if(o==null||o.renderAll)return!0;const s=e.hunks[e.hunks.length-1],[,l]=Nl(s);return t<l+o.fromStart||t>=l+o.rangeSize}function zV({fileDiff:e,lineNumber:t,direction:n,expandedHunks:i,collapsedContextThreshold:o}){if(i===!0||e.isPartial)return t;const s=[];let l=1;for(const[d,f]of e.hunks.entries()){const[p,m]=Nl(f),g=ar({isPartial:e.isPartial,rangeSize:f.collapsedBefore,expandedHunks:i,hunkIndex:d,collapsedContextThreshold:o}),v=p-g.rangeSize;g.renderAll?s.push([v,p]):(g.fromStart>0&&s.push([v,v+g.fromStart]),g.fromEnd>0&&s.push([p-g.fromEnd,p])),s.push([p,m]),l=m}const c=sr({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:i,collapsedContextThreshold:o,errorPrefix:"getNearestRenderableAdditionLine"});if(c!=null){const d=l;l=d+c.rangeSize,c.renderAll?s.push([d,l]):c.fromStart>0&&s.push([d,d+c.fromStart])}if(t>=l)return t;if(n==="down"){for(const[d,f]of s)if(f>t)return Math.max(d,t);return}for(let d=s.length-1;d>=0;d--){const[f,p]=s[d];if(f<=t)return Math.min(p-1,t)}}function LA({type:e,metrics:t}){return t.hunkSeparatorHeight??bV(e)}function RA({type:e,metrics:t}){return e==="simple"||e==="metadata"||e==="line-info-basic"?0:t.spacing}function PV({type:e,hunkIndex:t,hunkSpecs:n}){switch(e){case"simple":return t>0;case"metadata":return n!=null;case"line-info":case"line-info-basic":case"custom":return!0}}function HV(e){return e!=="simple"&&e!=="metadata"}function ul({type:e,metrics:t,hunkIndex:n,hunkSpecs:i}){if(!PV({type:e,hunkIndex:n,hunkSpecs:i}))return;const o=LA({type:e,metrics:t}),s=RA({type:e,metrics:t}),l=n>0?s:0,c=s;return{height:o,gapBefore:l,gapAfter:c,totalHeight:l+o+c}}function Co({type:e,metrics:t}){if(!HV(e))return;const n=LA({type:e,metrics:t}),i=RA({type:e,metrics:t});return{height:n,gapBefore:i,gapAfter:0,totalHeight:i+n}}function Lo({diff:e,diffStyle:t,startingLine:n=0,totalLines:i=1/0,expandedHunks:o,collapsedContextThreshold:s=1,callback:l}){const c=jV({diff:e,diffStyle:t,startingLine:n,expandedHunks:o,collapsedContextThreshold:s}),d={viewportStart:n,viewportEnd:n+i,isWindowedHighlight:n>0||i<1/0,splitCount:c.splitCount,unifiedCount:c.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!d.isWindowedHighlight)return!1;const f=d.unifiedCount>=n+i,p=d.splitCount>=n+i;return t==="unified"?f:(t==="split"||f)&&p},shouldSkip(f,p){if(!d.isWindowedHighlight)return!1;const m=f>0&&d.unifiedCount+f<=n,g=p>0&&d.splitCount+p<=n;return t==="unified"?m:(t==="split"||m)&&g},incrementCounts(f,p){(t==="unified"||t==="both")&&(d.unifiedCount+=f),(t==="split"||t==="both")&&(d.splitCount+=p)},isInWindow(f,p){if(!d.isWindowedHighlight)return!0;const m=d.isInUnifiedWindow(f),g=d.isInSplitWindow(p);return t==="unified"?m:t==="split"?g:m||g},isInUnifiedWindow(f){return!d.isWindowedHighlight||d.unifiedCount>=n-f&&d.unifiedCount<n+i},isInSplitWindow(f){return!d.isWindowedHighlight||d.splitCount>=n-f&&d.splitCount<n+i},emit(f,p=!1){return p||(t==="unified"?d.incrementCounts(1,0):t==="split"?d.incrementCounts(0,1):d.incrementCounts(1,1)),l(f)??!1}};e:for(let f=c.hunkIndex;f<e.hunks.length;f++){let C=function(B,ee){return w==null||w.collapsedLines<=0||w.fromStart+w.fromEnd>0?0:t==="unified"?B===p.unifiedLineStart+p.unifiedLineCount-1?w.collapsedLines:0:ee===p.splitLineStart+p.splitLineCount-1?w.collapsedLines:0},D=function(){return T?0:(T=!0,S.collapsedLines)};const p=e.hunks[f];if(p==null)throw new Error("iterateOverDiff: invalid hunk index");if(d.shouldBreak())break;const m=Ei(p.deletionStart,p.deletionCount),g=Ei(p.additionStart,p.additionCount),v=!e.isPartial&&p.deletionCount===0?m:p.deletionLineIndex,x=!e.isPartial&&p.additionCount===0?g:p.additionLineIndex,S=ar({isPartial:e.isPartial,rangeSize:p.collapsedBefore,expandedHunks:o,hunkIndex:f,collapsedContextThreshold:s}),w=f===d.finalHunkIndex?sr({fileDiff:e,hunkIndex:f,expandedHunks:o,collapsedContextThreshold:s,errorPrefix:"iterateOverDiff"}):void 0,_=S.fromStart+S.fromEnd;let T=S.collapsedLines===0;if(d.shouldSkip(_,_))d.incrementCounts(_,_),D();else{let B=p.unifiedLineStart-S.rangeSize,ee=p.splitLineStart-S.rangeSize,Z=v-S.rangeSize,W=x-S.rangeSize,z=m+1-S.rangeSize,q=g+1-S.rangeSize;if(Hc(d,S.fromStart,t,te=>d.emit({hunkIndex:f,hunk:p,collapsedBefore:0,collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:z+te,lineIndex:Z+te,noEOFCR:!1,unifiedLineIndex:B+te,splitLineIndex:ee+te},additionLine:{unifiedLineIndex:B+te,splitLineIndex:ee+te,lineIndex:W+te,lineNumber:q+te,noEOFCR:!1}}))||(B=p.unifiedLineStart-S.fromEnd,ee=p.splitLineStart-S.fromEnd,Z=v-S.fromEnd,W=x-S.fromEnd,z=m+1-S.fromEnd,q=g+1-S.fromEnd,Hc(d,S.fromEnd,t,te=>d.emit({hunkIndex:f,hunk:p,collapsedBefore:D(),collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:z+te,lineIndex:Z+te,noEOFCR:!1,unifiedLineIndex:B+te,splitLineIndex:ee+te},additionLine:{unifiedLineIndex:B+te,splitLineIndex:ee+te,lineIndex:W+te,lineNumber:q+te,noEOFCR:!1}}),()=>{D()})))break e}let I=p.unifiedLineStart,O=p.splitLineStart,P=v,j=x,F=m+1,Q=g+1;const G=p.hunkContent.at(-1);for(const B of p.hunkContent){if(d.shouldBreak())break e;const ee=B===G;if(B.type==="context"){if(d.shouldSkip(B.lines,B.lines))d.incrementCounts(B.lines,B.lines),D();else if(Hc(d,B.lines,t,Z=>{const W=ee&&Z===B.lines-1,z=I+Z,q=O+Z;return d.emit({hunkIndex:f,hunk:p,collapsedBefore:D(),collapsedAfter:C(z,q),type:"context",deletionLine:{lineNumber:F+Z,lineIndex:P+Z,noEOFCR:W&&p.noEOFCRDeletions,unifiedLineIndex:z,splitLineIndex:q},additionLine:{unifiedLineIndex:z,splitLineIndex:q,lineIndex:j+Z,lineNumber:Q+Z,noEOFCR:W&&p.noEOFCRAdditions}})},()=>{D()}))break e;I+=B.lines,O+=B.lines,P+=B.lines,j+=B.lines,F+=B.lines,Q+=B.lines}else{const Z=Math.max(B.deletions,B.additions),W=B.deletions+B.additions;if(!d.shouldSkip(W,Z)){const z=VV(d,B,t);(z[0]?.[0]??0)>0&&D();for(const[q,te]of z)for(let ce=q;ce<te;ce++){const R=C(I+ce,t==="unified"?O+(ce<B.deletions?ce:ce-B.deletions):O+ce);if(d.emit(FV({hunkIndex:f,hunk:p,collapsedBefore:D(),collapsedAfter:R,diffStyle:t,index:ce,unifiedLineIndex:I,splitLineIndex:O,additionLineIndex:j,deletionLineIndex:P,additionLineNumber:Q,deletionLineNumber:F,content:B,isLastContent:ee,unifiedCount:W,splitCount:Z}),!0))break e}}D(),d.incrementCounts(W,Z),I+=W,O+=Z,P+=B.deletions,j+=B.additions,F+=B.deletions,Q+=B.additions}}if(w!=null){const{collapsedLines:B,fromStart:ee,fromEnd:Z}=w,W=ee+Z;if(Hc(d,W,t,z=>{const q=z===W-1;return d.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:q?B:0,type:"context-expanded",deletionLine:{lineNumber:F+z,lineIndex:P+z,noEOFCR:!1,unifiedLineIndex:I+z,splitLineIndex:O+z},additionLine:{unifiedLineIndex:I+z,splitLineIndex:O+z,lineIndex:j+z,lineNumber:Q+z,noEOFCR:!1}})},void 0,()=>d.shouldBreak()))break e}}}function jV({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:o}){if(n<=0||t==="both")return{hunkIndex:0,splitCount:0,unifiedCount:0};const s=BV({diff:e,expandedHunks:i,collapsedContextThreshold:o});let l=0,c=e.hunks.length-1,d=e.hunks.length;for(;l<=c;){const p=l+c>>1,m=s[p+1];if(m==null)throw new Error("iterateOverDiff: invalid hunk prefix index");(t==="unified"?m.unifiedCount:m.splitCount)>n?(d=p,c=p-1):l=p+1}if(d>=e.hunks.length){const p=s[e.hunks.length];if(p==null)throw new Error("iterateOverDiff: invalid terminal hunk prefix index");return{hunkIndex:e.hunks.length,splitCount:p.splitCount,unifiedCount:p.unifiedCount}}const f=s[d];if(f==null)throw new Error("iterateOverDiff: invalid selected hunk prefix index");return{hunkIndex:d,splitCount:f.splitCount,unifiedCount:f.unifiedCount}}function BV({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let i=0,o=0;const s=e.hunks.length-1,l=[{splitCount:0,unifiedCount:0}];for(let c=0;c<e.hunks.length;c++){const d=e.hunks[c];if(d==null)throw new Error("iterateOverDiff: invalid hunk summary index");const f=ar({isPartial:e.isPartial,rangeSize:d.collapsedBefore,expandedHunks:t,hunkIndex:c,collapsedContextThreshold:n}),p=f.fromStart+f.fromEnd;i+=p+d.splitLineCount,o+=p+d.unifiedLineCount;const m=c===s?sr({fileDiff:e,hunkIndex:c,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:"iterateOverDiff"}):void 0;if(m!=null){const g=m.fromStart+m.fromEnd;i+=g,o+=g}l.push({splitCount:i,unifiedCount:o})}return l}function UV(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];const i=[];function o(c){const d=Math.max(0,e.viewportStart-c),f=Math.min(t,e.viewportEnd-c);f>d&&i.push([d,f])}if(n!=="split"&&o(e.unifiedCount),n!=="unified"&&o(e.splitCount),i.length===0)return[0,0];let s=i[0][0],l=i[0][1];for(let c=1;c<i.length;c++){const d=i[c];s=Math.min(s,d[0]),l=Math.max(l,d[1])}return[s,l]}function Hc(e,t,n,i,o,s){const[l,c]=UV(e,t,n);l>0&&(e.incrementCounts(l,l),o?.());let d=l;for(;d<t;){if(s?.()===!0)return!0;if(d>=c){e.incrementCounts(t-d,t-d);break}if(e.isInWindow(0,0)){if(i(d)===!0)return!0}else e.incrementCounts(1,1);d++}return!1}function VV(e,t,n){if(!e.isWindowedHighlight)return[[0,n==="unified"?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];const i=n!=="split",o=n!=="unified",s=n==="unified"?"unified":"split",l=[];function c(m,g){if(m+g<=e.viewportStart||m>=e.viewportEnd)return;const v=Math.max(0,e.viewportStart-m),x=Math.min(g,e.viewportEnd-m);return x>v?[v,x]:void 0}function d(m,g){return s==="split"?m:g==="additions"?[m[0]+t.deletions,m[1]+t.deletions]:m}function f(m,g){if(m==null)return;const[v,x]=d(m,g);x>v&&l.push([v,x])}if(i&&(f(c(e.unifiedCount,t.deletions),"deletions"),f(c(e.unifiedCount+t.deletions,t.additions),"additions")),o&&(f(c(e.splitCount,t.deletions),"deletions"),f(c(e.splitCount,t.additions),"additions")),l.length===0)return l;l.sort((m,g)=>m[0]-g[0]);const p=[l[0]];for(const[m,g]of l.slice(1)){const v=p[p.length-1];m<=v[1]?v[1]=Math.max(v[1],g):p.push([m,g])}return p}function FV({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,diffStyle:o,index:s,unifiedLineIndex:l,splitLineIndex:c,additionLineIndex:d,deletionLineIndex:f,additionLineNumber:p,deletionLineNumber:m,content:g,isLastContent:v,unifiedCount:x,splitCount:S}){const w=s<g.deletions?l+s:void 0,_=o==="unified"?s>=g.deletions?l+s:void 0:s<g.additions?l+g.deletions+s:void 0,C=o==="unified"?c+(s<g.deletions?s:s-g.deletions):c+s,T=s<g.deletions?f+s:void 0,D=s<g.deletions?m+s:void 0,I=o==="unified"?s>=g.deletions?d+(s-g.deletions):void 0:s<g.additions?d+s:void 0,O=o==="unified"?s>=g.deletions?p+(s-g.deletions):void 0:s<g.additions?p+s:void 0,P=o==="unified"?v&&s===g.deletions-1&&t.noEOFCRDeletions:v&&s===S-1&&t.noEOFCRDeletions,j=o==="unified"?v&&s===x-1&&t.noEOFCRAdditions:v&&s===S-1&&t.noEOFCRAdditions,F=T!=null&&D!=null&&w!=null?{lineNumber:D,lineIndex:T,noEOFCR:P,unifiedLineIndex:w,splitLineIndex:C}:void 0,Q=I!=null&&O!=null&&_!=null?{unifiedLineIndex:_,splitLineIndex:C,lineIndex:I,lineNumber:O,noEOFCR:j}:void 0;if(F==null&&Q!=null)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,deletionLine:void 0,additionLine:Q};if(F!=null&&Q==null)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,deletionLine:F,additionLine:void 0};if(F==null||Q==null)throw new Error("iterateOverDiff: missing change line data");return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,deletionLine:F,additionLine:Q}}const GV={forcePlainText:!1};function OA(e,t,n,{forcePlainText:i,startingLine:o,totalLines:s,expandedHunks:l,collapsedContextThreshold:c=1}=GV){i?(o??=0,s??=1/0):(o=0,s=1/0);const d=o>0||s<1/0,f=typeof n.theme=="string"?t.getTheme(n.theme).type:void 0,p=oA({theme:n.theme,highlighter:t}),m=i&&!d&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?"none":n.lineDiffType,g={deletionLines:[],additionLines:[]},{maxLineDiffLength:v}=n,x=!i&&!e.isPartial,S=i?l:void 0,w=new Map;function _(T){const D=x?0:T,I=w.get(D)??qV();return w.set(D,I),I}function C(T,D,I,O){if(d){let P=I.at(-1);(P==null||P.targetIndex+P.count!==D)&&(P={targetIndex:D,originalOffset:O.length,count:0},I.push(P)),P.count++}O.push(T)}Lo({diff:e,diffStyle:"both",startingLine:o,totalLines:s,expandedHunks:d?S:!0,collapsedContextThreshold:c,callback:({hunkIndex:T,additionLine:D,deletionLine:I,type:O})=>{const P=_(T),j=D!=null?D.splitLineIndex:I.splitLineIndex;O==="change"&&D!=null&&I!=null&&$V({additionLine:e.additionLines[D.lineIndex],deletionLine:e.deletionLines[I.lineIndex],deletionLineIndex:P.deletionContent.length,additionLineIndex:P.additionContent.length,deletionDecorations:P.deletionDecorations,additionDecorations:P.additionDecorations,lineDiffType:m,maxLineDiffLength:v}),I!=null&&(C(e.deletionLines[I.lineIndex],I.lineIndex,P.deletionSegments,P.deletionContent),P.deletionInfo.push({type:O==="change"?"change-deletion":O,lineNumber:I.lineNumber,altLineNumber:O==="change"?void 0:D.lineNumber??void 0,lineIndex:`${I.unifiedLineIndex},${j}`})),D!=null&&(C(e.additionLines[D.lineIndex],D.lineIndex,P.additionSegments,P.additionContent),P.additionInfo.push({type:O==="change"?"change-addition":O,lineNumber:D.lineNumber,altLineNumber:O==="change"?void 0:I.lineNumber??void 0,lineIndex:`${D.unifiedLineIndex},${j}`}))}});for(const T of w.values()){if(T.deletionContent.length===0&&T.additionContent.length===0)continue;const D={name:e.prevName??e.name,contents:T.deletionContent.value},I={name:e.name,contents:T.additionContent.value},{deletionLines:O,additionLines:P}=WV({deletionFile:D,deletionInfo:T.deletionInfo,deletionDecorations:T.deletionDecorations,additionFile:I,additionInfo:T.additionInfo,additionDecorations:T.additionDecorations,highlighter:t,options:n,languageOverride:i?"text":e.lang});if(x){g.deletionLines=O,g.additionLines=P;continue}if(T.deletionSegments.length>0)for(const j of T.deletionSegments)for(let F=0;F<j.count;F++)g.deletionLines[j.targetIndex+F]=O[j.originalOffset+F];else g.deletionLines.push(...O);if(T.additionSegments.length>0)for(const j of T.additionSegments)for(let F=0;F<j.count;F++)g.additionLines[j.targetIndex+F]=P[j.originalOffset+F];else g.additionLines.push(...P)}return{code:g,themeStyles:p,baseThemeType:f}}function $V({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:i,deletionDecorations:o,additionDecorations:s,lineDiffType:l,maxLineDiffLength:c}){if(e==null||t==null||l==="none"||(e=or(e),t=or(t),e.length>c||t.length>c))return;const d=l==="char"?j5(e,t):V5(e,t),f=[],p=[],m=l==="word-alt",g=d.at(-1);for(const x of d){const S=x===g;!x.added&&!x.removed?(Pc({item:x,arr:f,enableJoin:m,isNeutral:!0,isLastItem:S}),Pc({item:x,arr:p,enableJoin:m,isNeutral:!0,isLastItem:S})):x.removed?Pc({item:x,arr:f,enableJoin:m,isLastItem:S}):Pc({item:x,arr:p,enableJoin:m,isLastItem:S})}let v=0;for(const x of f)x[0]===1&&o.push(QC({line:n,spanStart:v,spanLength:x[1].length})),v+=x[1].length;v=0;for(const x of p)x[0]===1&&s.push(QC({line:i,spanStart:v,spanLength:x[1].length})),v+=x[1].length}function qV(){return{deletionContent:{push(e){this.value+=e,this.length++},value:"",length:0},additionContent:{push(e){this.value+=e,this.length++},value:"",length:0},deletionInfo:[],additionInfo:[],deletionDecorations:[],additionDecorations:[],deletionSegments:[],additionSegments:[]}}function WV({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:i,highlighter:o,deletionDecorations:s,additionDecorations:l,languageOverride:c,options:{theme:d=bt,...f}}){const p=c??rn(e.name),m=c??rn(t.name),{state:g,transformers:v}=rA(f.useTokenTransformer),x=typeof d=="string"?{...f,lang:"text",theme:d,transformers:v,decorations:void 0,defaultColor:!1,cssVariablePrefix:Ln("token"),tokenizeTimeLimit:0}:{...f,lang:"text",themes:d,transformers:v,decorations:void 0,defaultColor:!1,cssVariablePrefix:Ln("token"),tokenizeTimeLimit:0};return{deletionLines:e.contents===""?[]:(x.lang=p,g.lineInfo=n,x.decorations=s,Hg(o.codeToHast(or(e.contents),x))),additionLines:t.contents===""?[]:(x.lang=m,x.decorations=l,g.lineInfo=i,Hg(o.codeToHast(or(t.contents),x)))}}function Qi(e,t){const n=zo({name:e.prevName??e.name,contents:e.deletionLines.join("")},{name:e.name,contents:e.additionLines.join(""),lang:e.lang},t);return{hunks:n.hunks,splitLineCount:n.splitLineCount,unifiedLineCount:n.unifiedLineCount,additionLines:n.additionLines,deletionLines:n.deletionLines,type:n.type}}function YV(e,t){const n=Math.max(e,1);let i=Array.from({length:n},(o,s)=>`${" ".repeat(s+1)}
|
|
1547
|
+
`).join("");return i===t&&(i=Array.from({length:n},(o,s)=>`\0${" ".repeat(s)}
|
|
1548
|
+
`).join("")),i}function XV(e){for(const t of e)if(t.trim().length>0)return!1;return!0}function Gg(e,t){return t.length>0&&t.length<e.deletionLines.length&&XV(t)}function Hd(e,t,n){const i=e.deletionLines.join(""),o=YV(t.length,i),s=zo({name:e.prevName??e.name,contents:i},{name:e.name,contents:o,lang:e.lang},n);return{hunks:s.hunks,splitLineCount:s.splitLineCount,unifiedLineCount:s.unifiedLineCount,additionLines:t,deletionLines:s.deletionLines,type:s.type}}function ld(e,t){return Hd(e,[""],t)}function DA(e,t){if(e.additionLines.length===0)return ld(e,t);if(Gg(e,e.additionLines))return Hd(e,e.additionLines,t);const n=e.additionLines,i=Qi(e,t);return MA(i,n),i}function KV(e){return e.length>1&&e.at(-1)===""}function MA(e,t){if(!KV(t))return;const n=t.length-e.additionLines.length;if(n<=0)return;const i=e.additionLines.length,o=e.hunks.at(-1);if(o!=null&&yn(o.additionStart,o.additionCount)===i){for(const s of o.hunkContent)if(s.type==="change"&&s.additions<s.deletions&&s.additionLineIndex+s.additions===i){e.additionLines=t,s.additions+=n,o.additionCount+=n,o.additionLines+=n,Qy(e);return}}}function QV(e,t,n){if(e.isPartial||e.deletionLines.length!==e.additionLines.length)return Xi(e,Qi(e,n));const i=Array.from(t);if(i.length===0)return Xi(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type});for(const s of i){const l=e.additionLines[s],c=e.deletionLines[s];if(l==null||c==null||or(l)===or(c))return Xi(e,Qi(e,n))}const o=ZV(e,i);if(o.size===0)return Xi(e,Qi(e,n));for(const s of o)if(!eF(e,s,n))return Xi(e,Qi(e,n));return Qy(e),NV(e)?Xi(e,Qi(e,n)):Xi(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}function Xi(e,t){return Object.assign(e,t),t}function ZV(e,t){const n=new Set;for(const i of t){const o=JV(e,i);if(o==null)return new Set;n.add(o)}return n}function JV(e,t){for(const[n,i]of e.hunks.entries()){const o=i.additionLineIndex+i.additionCount;if(t>=i.additionLineIndex&&t<o)return n}}function eF(e,t,n){const i=e.hunks[t];if(i==null)return!1;const o=e.deletionLines.slice(i.deletionLineIndex,i.deletionLineIndex+i.deletionCount),s=e.additionLines.slice(i.additionLineIndex,i.additionLineIndex+i.additionCount),l=zo({name:e.prevName??e.name,contents:o.join("")},{name:e.name,contents:s.join(""),lang:e.lang},{...n,context:0}),c=l.hunks[0];return c==null||l.hunks.length!==1?!1:(tF(i,c),IA(e,t),!0)}function IA(e,t){const n=e.hunks[t];if(n==null)return;if(t!==e.hunks.length-1){n.noEOFCRAdditions=!1,n.noEOFCRDeletions=!1;return}const i=e.additionLines.at(-1),o=e.deletionLines.at(-1);n.noEOFCRAdditions=i!=null&&i!==""&&!i.endsWith(`
|
|
1549
|
+
`),n.noEOFCRDeletions=o!=null&&o!==""&&!o.endsWith(`
|
|
1550
|
+
`)}function tF(e,t){const n=e.additionLineIndex,i=e.deletionLineIndex;e.hunkContent=t.hunkContent.map(o=>NA(o,n,i)),e.additionLineIndex=n+t.additionLineIndex,e.additionStart=e.additionStart+t.additionLineIndex,e.additionCount=t.additionCount,e.additionLines=t.additionLines,t.deletionLineIndex>=0&&(e.deletionLineIndex=i+t.deletionLineIndex,e.deletionStart=e.deletionStart+t.deletionLineIndex),e.deletionCount=t.deletionCount,e.deletionLines=t.deletionLines,e.noEOFCRAdditions=t.noEOFCRAdditions,e.noEOFCRDeletions=t.noEOFCRDeletions,Ky(e)}function NA(e,t,n){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+n}}function Ky(e){let t=0,n=0;for(const i of e.hunkContent)i.type==="context"?(t+=i.lines,n+=i.lines):(t+=Math.max(i.additions,i.deletions),n+=i.additions+i.deletions);e.splitLineCount=t,e.unifiedLineCount=n}function Qy(e){let t=0,n=0,i=0;for(const o of e.hunks)o.collapsedBefore=Math.max(Ei(o.additionStart,o.additionCount)-i,0),o.splitLineStart=t+o.collapsedBefore,o.unifiedLineStart=n+o.collapsedBefore,Ky(o),t+=o.collapsedBefore+o.splitLineCount,n+=o.collapsedBefore+o.unifiedLineCount,i=yn(o.additionStart,o.additionCount);if(e.hunks.length>0){const o=e.hunks[e.hunks.length-1],s=Math.max(e.additionLines.length-yn(o.additionStart,o.additionCount),0);t+=s,n+=s}e.splitLineCount=t,e.unifiedLineCount=n}const ZC=new WeakMap;function nF(e){return e.length>1&&e[e.length-1]===""?e.slice(0,-1):e}function iF(e,t){const n=Math.min(e.length,t.length);let i=0;for(;i<n&&e[i]===t[i];)i++;let o=e.length,s=t.length;for(;o>i&&s>i&&e[o-1]===t[s-1];)o--,s--;if(!(i===o&&i===s))return{start:i,deletionEnd:o,additionEnd:s}}function $g(e,t){const n=e.hunks,i=e.additionLines,o=nF(i),s=o===i?e:{...e,additionLines:o},l=fF(n,dF(s,t),e.deletionLines.length),c=mF(s,l);if(e.additionLines=o,e.hunks=c,e.editSessionDirty=!0,bF(e),MA(e,i),!!yF(n,e.hunks))return{regions:l.map(d=>d.previousSpan)}}function rF(e,t,n,i){const o=Array.from(new Set(t)).filter(d=>d>=0&&d<e.additionLines.length).sort((d,f)=>d-f);if(o.length===0)return;const{hunks:s}=e;let l,c=0;for(const d of o){for(;c<s.length;){const m=s[c];if(d<jd(m)+m.additionCount)break;c++}const f=s[c],p=f==null?void 0:jd(f);if(p==null||d<p||l!=null&&l!==c)return $g(e,n);l=c}if(l!=null){if(oF(e,o,l,i,n)){e.editSessionDirty=!0;return}return $g(e,n)}}function oF(e,t,n,i,o){if(i==null||o?.ignoreWhitespace===!0||o?.stripTrailingCr===!0)return!1;const s=aF(e),l=e.hunks[n];if(l.hunkContent.some(sF))return!1;for(const c of t){const d=i.get(c),f=e.additionLines[c];if(d==null||f==null||s.has(d)||s.has(f))return!1;let p=!1;for(const m of l.hunkContent)if(m.type==="change"&&m.additions===m.deletions&&c>=m.additionLineIndex&&c<m.additionLineIndex+m.additions){p=!0;break}if(!p)return!1}return!0}function aF(e){const t=ZC.get(e);if(t?.lines===e.deletionLines)return t.set;const n=new Set(e.deletionLines);return ZC.set(e,{lines:e.deletionLines,set:n}),n}function sF(e){return e?.type==="change"&&(e.additions===0||e.deletions===0)}function lF(e,t){const n=new Map,{regions:i}=t;for(let o=0;o<=i.length;o++){const s=i[o-1],l=i[o],c=o===0?e.get(0):s==null?void 0:e.get(s.lastIndex+1),d=l==null?void 0:e.get(l.firstIndex),f=c?.fromStart??0,p=d?.fromEnd??0;(f>0||p>0)&&n.set(o,{fromStart:f,fromEnd:p})}return n}function uF(e,t,n){const i=[];if(e.isPartial)return i;for(const[s,l]of e.hunks.entries()){const c=ar({isPartial:e.isPartial,rangeSize:l.collapsedBefore,expandedHunks:t,hunkIndex:s,collapsedContextThreshold:n});if(c.rangeSize<=n)continue;const d=jo(l),f=d-c.rangeSize;c.fromStart>0&&i.push([f,f+c.fromStart]),c.fromEnd>0&&i.push([d-c.fromEnd,d])}const o=sr({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:"captureExpansionAnchors"});if(o!=null&&o.fromStart>0&&o.rangeSize>n){const s=e.hunks[e.hunks.length-1],l=jo(s)+s.deletionCount;i.push([l,l+o.fromStart])}return i}function cF(e,t){const n=new Map;if(t.length===0)return n;const i=(s,l,c)=>{if(c<=l)return;let d=0,f=0;for(const[p,m]of t)m<=l||p>=c||(p<=l&&(d=Math.max(d,Math.min(m,c)-l)),m>=c&&(f=Math.max(f,c-Math.max(p,l))));(d>0||f>0)&&n.set(s,{fromStart:d,fromEnd:f})};for(const[s,l]of e.hunks.entries()){const c=jo(l);i(s,c-Math.max(l.collapsedBefore,0),c)}const o=e.hunks[e.hunks.length-1];return o!=null&&!e.isPartial&&e.deletionLines.length>0&&i(e.hunks.length,jo(o)+o.deletionCount,e.deletionLines.length),n}function JC(e,t){return e.editSessionDirty!==!0?!1:(e.editSessionDirty=void 0,Object.assign(e,e.additionLines.length<=1&&e.additionLines.join("")===""?Qi(e,t):DA(e,t)),!0)}function dF(e,t){if(iF(e.deletionLines,e.additionLines)==null)return[];const n=zo({name:e.prevName??e.name,contents:e.deletionLines.join("")},{name:e.name,contents:e.additionLines.join(""),lang:e.lang},t),i=[];let o=0,s=0;for(const l of n.hunks){const c=l.additionCount>0?l.additionLineIndex-o:l.deletionLineIndex-s;o+=c,s+=c;for(const d of l.hunkContent){if(d.type==="context"){o+=d.lines,s+=d.lines;continue}const f=NA(d,0,0);f.additions===0&&(f.additionLineIndex=o),f.deletions===0&&(f.deletionLineIndex=s),i.push(f),o+=f.additions,s+=f.deletions}}return i}function fF(e,t,n){const i=e.map((l,c)=>{const d=jo(l);return{deletionStart:d,deletionEnd:d+l.deletionCount,blocks:[],previousSpan:{firstIndex:c,lastIndex:c}}}),o=[];let s=0;for(const l of t){const c=l.deletionLineIndex,d=c+l.deletions;for(;s<i.length&&i[s].deletionEnd<c;)o.push(i[s]),s++;let f=o.length>0&&hF(c,d,o[o.length-1])?o.pop():void 0;for(;s<i.length&&i[s].deletionStart<=d;)f=pF(f,i[s]),s++;if(f==null){let p=c,m=d;if((l.deletions===0||l.additions===0)&&n>l.deletions){const g=o[o.length-1]?.deletionEnd??0,v=i[s]?.deletionStart??n;c>g?p--:d<v&&m++}f={deletionStart:p,deletionEnd:m,blocks:[],previousSpan:void 0}}f.deletionStart=Math.min(f.deletionStart,c),f.deletionEnd=Math.max(f.deletionEnd,d),f.blocks.push(l),o.push(f)}for(;s<i.length;)o.push(i[s]),s++;return o}function hF(e,t,n){return e<=n.deletionEnd&&t>=n.deletionStart}function pF(e,t){return e==null?t:(e.deletionStart=Math.min(e.deletionStart,t.deletionStart),e.deletionEnd=Math.max(e.deletionEnd,t.deletionEnd),e.blocks.push(...t.blocks),t.previousSpan!=null&&(e.previousSpan??={...t.previousSpan},e.previousSpan.firstIndex=Math.min(e.previousSpan.firstIndex,t.previousSpan.firstIndex),e.previousSpan.lastIndex=Math.max(e.previousSpan.lastIndex,t.previousSpan.lastIndex)),e)}function mF(e,t){const n=[];let i=0,o=0;for(const s of t){const l=s.deletionStart-i;if(l<0)throw new Error("buildRegionHunks: overlapping old-side regions");i+=l,o+=l;const c=o,d=[];for(const p of s.blocks){const m=p.deletionLineIndex-i,g=p.additionLineIndex-o;if(m<0||m!==g)throw new Error("buildRegionHunks: canonical block context mismatch");ew(d,m,o,i),i+=m,o+=g,d.push({...p}),i+=p.deletions,o+=p.additions}const f=s.deletionEnd-i;if(f<0)throw new Error("buildRegionHunks: block exceeds its old-side region");ew(d,f,o,i),i+=f,o+=f,n.push(gF(e,{additionStart:c,additionEnd:o,deletionStart:s.deletionStart,deletionEnd:s.deletionEnd},d))}if(e.deletionLines.length-i!==e.additionLines.length-o)throw new Error("buildRegionHunks: trailing context mismatch");return n}function gF(e,t,n){const i=t.additionEnd-t.additionStart,o=t.deletionEnd-t.deletionStart;let s=0,l=0;for(const d of n)d.type==="change"&&(s+=d.additions,l+=d.deletions);const c={collapsedBefore:0,additionStart:jc(t.additionStart,i),additionCount:i,additionLines:s,additionLineIndex:nw(t.additionStart,i),deletionStart:jc(t.deletionStart,o),deletionCount:o,deletionLines:l,deletionLineIndex:nw(t.deletionStart,o),hunkContent:n,hunkSpecs:`@@ -${jc(t.deletionStart,o)},${o} +${jc(t.additionStart,i)},${i} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return Ky(c),c}function ew(e,t,n,i){t>0&&e.push({type:"context",lines:t,additionLineIndex:n,deletionLineIndex:i})}function yF(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++){const i=e[n],o=t[n];if(jo(i)!==jo(o)||i.deletionCount!==o.deletionCount||jd(i)!==jd(o)||i.additionCount!==o.additionCount||i.splitLineCount!==o.splitLineCount||!vF(i,o))return!0}return!1}function vF(e,t){const n=tw(e),i=tw(t);for(;;){const o=n.next(),s=i.next();if(o.done===!0||s.done===!0)return o.done===s.done;if(o.value[0]!==s.value[0]||o.value[1]!==s.value[1])return!1}}function*tw(e){for(const t of e.hunkContent){if(t.type==="context"){for(let i=0;i<t.lines;i++)yield[t.deletionLineIndex+i,t.additionLineIndex+i];continue}const n=Math.max(t.deletions,t.additions);for(let i=0;i<n;i++)yield[i<t.deletions?t.deletionLineIndex+i:void 0,i<t.additions?t.additionLineIndex+i:void 0]}}function jd(e){return Ei(e.additionStart,e.additionCount)}function jo(e){return Ei(e.deletionStart,e.deletionCount)}function jc(e,t){return t===0?e:e+1}function nw(e,t){return t===0?e-1:e}function bF(e){Qy(e);for(let t=0;t<e.hunks.length;t++)IA(e,t)}function Xa(e){const t=e.lang??rn(e.name),n=e.lang??(e.prevName!=null?rn(e.prevName):"text");return t==="text"&&n==="text"}let xF=-1;var SF=class{options;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++xF}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang="text";renderCache;editSessionActive=!1;constructor(e={theme:bt},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=bl(e.theme??bt)?JT():void 0)}cleanUp(){this.recycle(),this.expandedHunks.clear(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.clearRenderCache(),this.additionAnnotations={},this.deletionAnnotations={},this.workerManager?.cleanUpTasks(this),this.endEditSession()}beginEditSession(){this.editSessionActive=!0;const e=this.diffCache;e!=null&&!e.isPartial&&e.additionLines.length===0&&(Object.assign(e,ld(e,this.options.parseDiffOptions)),this.markEditSessionPass(e),this.clearRenderCache())}endEditSession(){this.editSessionActive=!1}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}refreshHighlightedResult(){const{renderCache:e}=this;if(e==null||Xa(e.diff)||Vc(e.diff,this.getTokenizeMaxLength()))return Promise.resolve();const{diff:t}=e,{workerManager:n}=this;return!this.editSessionActive&&n?.isWorkingPool()===!0&&t.cacheKey!=null?(n.evictDiffFromCache(t.cacheKey),n.primeDiffHighlightCache(t).then(()=>{this.applyRefreshedResult(t,n.getDiffResultCache(t))}).catch(i=>this.onHighlightError(i))):this.asyncHighlight(t).then(i=>this.applyRefreshedResult(t,i)).catch(i=>this.onHighlightError(i))}applyRefreshedResult(e,t){if(t==null||this.renderCache==null||this.renderCache.diff!==e||this.editSessionActive)return;const{options:n}=this.getRenderOptions(e);gi(n,t.options)&&(this.renderCache={diff:e,options:t.options,highlighted:!0,result:t.result,renderRange:void 0},this.onRenderUpdate?.())}get diffCache(){return this.renderCache?.diff??this.diff}clearRenderCache(){const e=this.renderCache;this.renderCache=void 0,e!=null&&e.isDirty===!0&&e.diff.cacheKey!=null&&this.workerManager?.evictDiffFromCache(e.diff.cacheKey)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){const i={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t==="up"||t==="both")&&(i.fromStart+=n),(t==="down"||t==="both")&&(i.fromEnd+=n),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,i)}getExpandedHunk(e){return this.expandedHunks.get(e)??h5}getExpandedHunksMap(){return this.expandedHunks}setExpandedHunksMap(e){this.expandedHunks=e}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(const t of e){const n=(()=>{switch(t.side){case"deletions":return this.deletionAnnotations;case"additions":return this.additionAnnotations}})(),i=n[t.lineNumber]??[];n[t.lineNumber]=i,i.push(t)}}updateRenderCache(e,t,n=!1){if(this.renderCache==null)return!1;const{result:i,diff:o}=this.renderCache;if(i==null)return!1;if(o.isPartial)throw new Error("Could not update render cache for partial diff");const s=i.code.additionLines,l=[],c=new Map;for(const[f,p]of e){const m=s[f]?.properties??{},g=p.map(w=>w[2]).join(""),v=f<o.additionLines.length,x=v?o.additionLines[f]??"":"",S=or(x);v&&(o.additionLines[f]=lA(x,g),S!==g&&(l.push(f),c.set(f,x))),s[f]={type:"element",tagName:"div",properties:{"data-line":m["data-line"]??f+1,"data-line-index":m["data-line-index"]??f,"data-line-type":m["data-line-type"]??"context"},children:p.map(([w,_,C])=>w===0&&_===""?C===""?{type:"element",tagName:"br",properties:{},children:[]}:{type:"text",value:C}:{type:"element",tagName:"span",properties:{"data-char":w,style:`color:${_};`},children:[{type:"text",value:C}]})}}let d=!1;if(l.length>0)if(this.editSessionActive&&!o.isPartial){if(!n)if(o.additionLines.length<=1&&o.additionLines.join("")==="")Object.assign(o,ld(o,this.options.parseDiffOptions)),this.markEditSessionPass(o),d=!0;else if(Gg(o,o.additionLines))Object.assign(o,Hd(o,o.additionLines,this.options.parseDiffOptions)),this.markEditSessionPass(o),d=!0;else{const f=rF(o,l,this.options.parseDiffOptions,c);this.applyExpansionRemap(f),d=f!=null}}else Object.assign(o,QV(o,l,this.options.parseDiffOptions));return i.baseThemeType=t,this.renderCache.isDirty=!0,d}applyExpansionRemap(e){e!=null&&(this.expandedHunks=lF(this.expandedHunks,e))}applyDocumentChange(e){if(this.renderCache==null)return;const{diff:t,result:n}=this.renderCache;if(n==null)return;if(t.isPartial)throw new Error("Could not apply document change for partial diff");const{additionLines:i}=t;t.additionLines=EF(e,i),n.code.additionLines=wF(i,t.additionLines,n.code.additionLines,e),t.additionLines.length<=1&&t.additionLines.join("")===""?(Object.assign(t,ld(t,this.options.parseDiffOptions)),n.code.additionLines[0]=qg(0,e.getLineText(0)),this.markEditSessionPass(t)):this.editSessionActive?this.applySessionDocumentChange(t):Object.assign(t,DA(t,this.options.parseDiffOptions)),this.renderCache.isDirty=!0}applySessionDocumentChange(e){const{parseDiffOptions:t}=this.options,n=e.additionLines;if(Gg(e,n)){Object.assign(e,Hd(e,n,t)),this.markEditSessionPass(e);return}this.applyExpansionRemap($g(e,t))}markEditSessionPass(e){this.editSessionActive&&(e.editSessionDirty=!0)}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e,contentProperties:{"data-line-type":e}}}getSplitLineDecoration({side:e,type:t}){const n=t==="change"?e==="deletions"?"change-deletion":"change-addition":t;return{gutterLineType:n,contentProperties:{"data-line-type":n}}}createAnnotationElement=e=>Pg(e);getOptionsWithDefaults(){const{diffIndicators:e="bars",diffStyle:t="split",disableBackground:n=!1,disableFileHeader:i=!1,disableLineNumbers:o=!1,disableVirtualizationBuffers:s=!1,collapsed:l=!1,expandUnchanged:c=!1,collapsedContextThreshold:d=1,expansionLineCount:f=100,hunkSeparators:p="line-info",lineDiffType:m="word-alt",maxLineDiffLength:g=1e3,overflow:v="scroll",stickyHeader:x=!1,theme:S=bt,headerRenderMode:w="default",tokenizeMaxLineLength:_=1e3,tokenizeMaxLength:C=f5,useTokenTransformer:T=!1,useCSSClasses:D=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:i,disableLineNumbers:o,disableVirtualizationBuffers:s,collapsed:l,expandUnchanged:c,collapsedContextThreshold:d,expansionLineCount:f,hunkSeparators:p,lineDiffType:m,maxLineDiffLength:g,overflow:v,stickyHeader:x,theme:this.workerManager?.getDiffRenderOptions().theme??S,headerRenderMode:w,tokenizeMaxLineLength:_,tokenizeMaxLength:C,useTokenTransformer:T,useCSSClasses:D}}async initializeHighlighter(){return this.highlighter=await Id(nA(this.computedLang,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;const{options:t}=this.getRenderOptions(e),n=Vc(e,this.getTokenizeMaxLength());let i=this.workerManager?.getDiffResultCache(e);i!=null&&!gi(t,i.options)&&(i=void 0),this.renderCache??={diff:e,highlighted:!n&&!Xa(e),options:t,result:n?void 0:i?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter==null&&(this.computedLang=e.lang??rn(e.name),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??bt}getEffectiveCodeOptions(){const e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getDiffRenderOptions():void 0;return{theme:this.getLocalHighlightTheme(),tokenizeMaxLineLength:e?.tokenizeMaxLineLength??this.options.tokenizeMaxLineLength}}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0){const c=this.workerManager.getDiffRenderOptions();return this.editSessionActive&&c.useTokenTransformer!==!0?{...c,useTokenTransformer:!0}:c}const{theme:i,tokenizeMaxLineLength:o,lineDiffType:s,maxLineDiffLength:l}=this.getOptionsWithDefaults();return{theme:i,useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:o,lineDiffType:s,maxLineDiffLength:l}})();this.getOptionsWithDefaults();const{renderCache:n}=this;return n?.result==null?{options:t,forceHighlight:!0}:!ko(e,n.diff)||!gi(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}renderDiff(e=this.renderCache?.diff,t=vd){if(e==null)return;const{expandUnchanged:n,collapsedContextThreshold:i}=this.getOptionsWithDefaults();let{options:o,forceHighlight:s}=this.getRenderOptions(e);const l=this.getMatchingWorkerResultCache(e,o);l!=null&&!this.hasHighlightedRenderCache(e,o)&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...l},s=!1),this.renderCache??={diff:e,highlighted:!1,options:o,result:void 0,renderRange:void 0};const c=e.additionLines.length>0||e.deletionLines.length>0,d=!c||Xa(e)||Vc(e,this.getTokenizeMaxLength()),f=!ko(e,this.renderCache.diff),p=!mf(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){const m=this.renderCache.result==null&&this.renderCache.highlighted&&!d&&!f&&Fg(t);m&&(this.renderCache.highlightPending=!0),!m&&(d||this.renderCache.result==null||!this.renderCache.highlighted&&(f||p))&&(this.renderCache.diff=e,this.renderCache.options=o,this.renderCache.highlighted=!1,(this.renderCache.result==null||f||p||s)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,Fg(t)||n?!0:this.expandedHunks,i)),this.renderCache.renderRange=t),!d&&c&&(!this.renderCache.highlighted||s)&&this.workerManager.highlightDiffAST(this,e)}else{this.computedLang=e.lang??rn(e.name);const m=this.highlighter!=null&&bl(o.theme),g=this.highlighter!=null&&_d(this.computedLang),v=!d&&g;if(this.highlighter!=null&&m&&(s||d||!this.renderCache.highlighted&&v||this.renderCache.result==null)){const{result:x,options:S}=this.renderDiffWithHighlighter(e,this.highlighter,d||!g);this.renderCache={diff:e,options:S,highlighted:v,result:x,renderRange:void 0}}(!m||!d&&!g)&&this.asyncHighlight(e).then(({result:x,options:S})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.applyHighlightResult(e,x,S,!d)})}return this.renderCache.result!=null?this.processDiffResult(this.renderCache.diff,t,this.renderCache.result):void 0}async asyncRender(e,t=vd){const{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){const{diffIndicators:i,disableBackground:o,disableLineNumbers:s,overflow:l}=this.getOptionsWithDefaults();return tA({type:"diff",diffIndicators:i,disableBackground:o,disableLineNumbers:s,overflow:l,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){const t=Vc(e,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??rn(e.name);const n=this.highlighter!=null&&bl(this.getLocalHighlightTheme()),i=t||this.highlighter!=null&&_d(this.computedLang);return(this.highlighter==null||!n||!i)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){const{options:i}=this.getRenderOptions(e),{collapsedContextThreshold:o}=this.getOptionsWithDefaults(),s=OA(e,t,i,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:o});if(this.editSessionActive&&e.additionLines.length===1&&e.additionLines[0]===""&&s.code.additionLines[0]==null){let l;if(Lo({diff:e,diffStyle:"both",expandedHunks:n?!0:void 0,collapsedContextThreshold:o,callback:({additionLine:c})=>{if(c?.lineIndex===0)return l=c,!0}}),l==null)throw new Error("DiffHunksRenderer: missing empty addition line");s.code.additionLines[0]=qg(0,"",l.unifiedLineIndex,l.splitLineIndex)}return{result:s,options:i}}onHighlightSuccess(e,t,n,i=!0){this.editSessionActive||this.applyHighlightResult(e,t,n,i)}applyHighlightResult(e,t,n,i=!0){if(this.renderCache==null)return;const o=this.renderCache.highlightPending===!0||!this.renderCache.highlighted||!gi(this.renderCache.options,n)||!ko(this.renderCache.diff,e);this.renderCache={diff:e,options:n,highlighted:i,result:t,renderRange:void 0},o&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;const n=this.workerManager?.getDiffResultCache(e);if(!(n==null||!gi(t,n.options)))return n}hasHighlightedRenderCache(e,t){const{renderCache:n}=this;return n?.result!=null&&n.highlighted&&ko(e,n.diff)&&gi(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:i,baseThemeType:o}){const{diffStyle:s,disableFileHeader:l,expandUnchanged:c,expansionLineCount:d,collapsedContextThreshold:f,hunkSeparators:p}=this.getOptionsWithDefaults(),m=this.renderCache?.isDirty??!1;this.diff=e;const g=s==="unified",v=AF(e,this.options.loadDiffFiles!=null),x=!e.isPartial||v;let S=[],w=[],_=[];const C=[],{additionLines:T,deletionLines:D}=n,I={rowCount:0,hunkSeparators:p,additionsContentAST:S,deletionsContentAST:w,unifiedContentAST:_,unifiedGutterAST:Ba(),deletionsGutterAST:Ba(),additionsGutterAST:Ba(),expansionLineCount:d,hunkData:C,incrementRowCount(z=1){I.rowCount+=z},pushToGutter(z,q){switch(z){case"unified":I.unifiedGutterAST.children.push(q);break;case"deletions":I.deletionsGutterAST.children.push(q);break;case"additions":I.additionsGutterAST.children.push(q);break}}},O=TA({fileDiff:e,errorPrefix:"DiffHunksRenderer.processDiffResult"}),P={size:0,side:void 0,increment(){this.size+=1},flush(){if(s!=="unified"){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side==="additions"?(I.pushToGutter("additions",An(void 0,"buffer",this.size)),S?.push(Nc(this.size))):(I.pushToGutter("deletions",An(void 0,"buffer",this.size)),w?.push(Nc(this.size))),this.size=0,this.side=void 0}}},j=(z,q,te,ce,R)=>{I.pushToGutter(z,Tk(q,te,ce,R))};function F(z){P.flush(),s==="unified"?Am("unified",z,I):(Am("deletions",z,I),Am("additions",z,I))}this.pushFileLevelAnnotations(e,s,t,I),Lo({diff:e,diffStyle:s,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:c?!0:this.expandedHunks,collapsedContextThreshold:f,callback:({hunkIndex:z,hunk:q,collapsedBefore:te,collapsedAfter:ce,additionLine:R,deletionLine:H,type:Y})=>{const N=H!=null?H.splitLineIndex:R.splitLineIndex,se=R!=null?R.unifiedLineIndex:H.unifiedLineIndex;s==="split"&&Y!=="change"&&P.flush(),te>0&&F({hunkIndex:z,collapsedLines:te,rangeSize:Math.max(q?.collapsedBefore??0,0),hunkSpecs:q?.hunkSpecs,isFirstHunk:z===0,isLastHunk:!1,isExpandable:x});const de=s==="unified"?se:N,le={type:Y,hunkIndex:z,lineIndex:de,unifiedLineIndex:se,splitLineIndex:N,deletionLine:H,additionLine:R};if(s==="unified"){const je=this.getUnifiedInjectedRowsForLine?.(le);je?.before!=null&&rw(je.before,I);let pe=H!=null?D[H.lineIndex]:void 0,he=R!=null?T[R.lineIndex]:void 0;if(pe==null&&he==null){const Qe="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(Qe,{file:e.name}),new Error(Qe)}const lt=Y==="change"?R!=null?"change-addition":"change-deletion":Y,Ue=this.getUnifiedLineDecoration({type:Y,lineType:lt,additionLineIndex:R?.lineIndex,deletionLineIndex:H?.lineIndex});j("unified",Ue.gutterLineType,R!=null?R.lineNumber:H.lineNumber,`${se},${N}`,Ue.gutterProperties),he!=null?he=Uc(he,Ue.contentProperties,m&&R!=null?{"data-line":R.lineNumber,"data-line-index":`${se},${N}`}:void 0):pe!=null&&(pe=Uc(pe,Ue.contentProperties,m&&H!=null?{"data-line":H.lineNumber,"data-line-index":`${se},${N}`}:void 0)),Bc({diffStyle:"unified",type:Y,deletionLine:pe,additionLine:he,unifiedSpan:this.getAnnotations("unified",H?.lineNumber,R?.lineNumber,z,de),createAnnotationElement:Qe=>this.createAnnotationElement(Qe),context:I}),je?.after!=null&&rw(je.after,I)}else{const je=this.getSplitInjectedRowsForLine?.(le);je?.before!=null&&ow(je.before,I,P);let pe=H!=null?D[H.lineIndex]:void 0,he=R!=null?T[R.lineIndex]:void 0;const lt=this.getSplitLineDecoration({side:"deletions",type:Y,lineIndex:H?.lineIndex}),Ue=this.getSplitLineDecoration({side:"additions",type:Y,lineIndex:R?.lineIndex});if(pe==null&&he==null){const mt="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(mt,{file:e.name}),new Error(mt)}const Qe=(()=>{if(Y==="change"){if(he==null)return"additions";if(pe==null)return"deletions"}})();Qe!=null?(P.side!=null&&P.side!==Qe&&P.flush(),P.side=Qe,P.increment()):Y==="change"&&P.flush();const ft=this.getAnnotations("split",H?.lineNumber,R?.lineNumber,z,de);if(ft!=null&&P.size>0&&P.flush(),H!=null){const mt=Uc(pe,lt.contentProperties,m?{"data-line":H.lineNumber,"data-line-index":`${H.unifiedLineIndex},${N}`}:void 0);j("deletions",lt.gutterLineType,H.lineNumber,`${H.unifiedLineIndex},${N}`,lt.gutterProperties),mt!=null&&(pe=mt)}if(R!=null){const mt=Uc(he,Ue.contentProperties,m?{"data-line":R.lineNumber,"data-line-index":`${R.unifiedLineIndex},${N}`}:void 0);j("additions",Ue.gutterLineType,R.lineNumber,`${R.unifiedLineIndex},${N}`,Ue.gutterProperties),mt!=null&&(he=mt)}Bc({diffStyle:"split",type:Y,additionLine:he,deletionLine:pe,...ft,createAnnotationElement:mt=>this.createAnnotationElement(mt),context:I}),je?.after!=null&&ow(je.after,I,P)}const be=s==="split"&&q!=null&&N===q.splitLineStart+q.splitLineCount-1,Ee=z===e.hunks.length-1&&q!=null&&(s==="split"?N===q.splitLineStart+q.splitLineCount-1:se===q.unifiedLineStart+q.unifiedLineCount-1),ge=be?q.noEOFCRDeletions:!1,We=be?q.noEOFCRAdditions:!1,Ge=(H?.noEOFCR??!1)||ge,ot=(R?.noEOFCR??!1)||We;if(ot||Ge){if(s==="split"&&P.flush(),Ge){const je=Y==="context"||Y==="context-expanded"?Y:"change-deletion";s==="unified"?(I.unifiedContentAST.push(zc(je)),I.pushToGutter("unified",An(je,"metadata",1))):(I.deletionsContentAST.push(zc(je)),I.pushToGutter("deletions",An(je,"metadata",1)),ot||(I.pushToGutter("additions",An(void 0,"buffer",1)),I.additionsContentAST.push(Nc(1))))}if(ot){const je=Y==="context"||Y==="context-expanded"?Y:"change-addition";s==="unified"?(I.unifiedContentAST.push(zc(je)),I.pushToGutter("unified",An(je,"metadata",1))):(I.additionsContentAST.push(zc(je)),I.pushToGutter("additions",An(je,"metadata",1)),Ge||(I.pushToGutter("deletions",An(void 0,"buffer",1)),I.deletionsContentAST.push(Nc(1))))}I.incrementRowCount(1)}p!=="simple"&&p!=="metadata"&&(ce>0||Ee&&v)&&F({hunkIndex:Y==="context-expanded"?z:z+1,collapsedLines:Ee&&v?"unknown":ce,rangeSize:O,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:x}),I.incrementRowCount(1)}}),s==="split"&&P.flush();const Q=Math.max(IV(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),G=t.bufferBefore>0||t.bufferAfter>0,B=!g&&e.type!=="deleted",ee=!g&&e.type!=="new",Z=I.rowCount>0||G;S=B&&Z?S:void 0,w=ee&&Z?w:void 0,_=g&&Z?_:void 0;const W=this.createPreElement(w!=null&&S!=null,Q);return{unifiedGutterAST:g&&Z?I.unifiedGutterAST.children:void 0,unifiedContentAST:_,deletionsGutterAST:ee&&Z?I.deletionsGutterAST.children:void 0,deletionsContentAST:w,additionsGutterAST:B&&Z?I.additionsGutterAST.children:void 0,additionsContentAST:S,hunkData:C,preNode:W,themeStyles:i,baseThemeType:o,headerElement:l?void 0:this.renderHeader(this.diff),totalLines:Q,rowCount:I.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderCodeAST(e,t){const n=e==="unified"?t.unifiedGutterAST:e==="deletions"?t.deletionsGutterAST:t.additionsGutterAST,i=e==="unified"?t.unifiedContentAST:e==="deletions"?t.deletionsContentAST:t.additionsContentAST;if(n==null||i==null)return;const o=Ba(n);return o.properties.style=`grid-row: span ${t.rowCount}`,[o,uA(i,t.rowCount)]}renderFullAST(e,t=[]){const n=this.getOptionsWithDefaults().hunkSeparators==="line-info",i=this.renderCodeAST("unified",e);if(i!=null)return t.push(Le({tagName:"code",children:i,properties:{"data-code":"","data-container-size":n?"":void 0,"data-unified":""}})),{...e.preNode,children:t};const o=this.renderCodeAST("deletions",e);o!=null&&t.push(Le({tagName:"code",children:o,properties:{"data-code":"","data-container-size":n?"":void 0,"data-deletions":""}}));const s=this.renderCodeAST("additions",e);return s!=null&&t.push(Le({tagName:"code",children:s,properties:{"data-code":"","data-container-size":n?"":void 0,"data-additions":""}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return nn(this.renderFullAST(e,t))}renderPartialHTML(e,t){return t==null?nn(e):nn(Le({tagName:"code",children:e,properties:{"data-code":"","data-container-size":this.getOptionsWithDefaults().hunkSeparators==="line-info"?"":void 0,[`data-${t}`]:""}}))}pushFileLevelAnnotations(e,t,n,i){if(!gf(n))return;const o=e.type!=="new"?iw(Bg(this.deletionAnnotations)):[],s=e.type!=="deleted"?iw(Bg(this.additionAnnotations)):[];if(o.length===0&&s.length===0)return;const l=-1,c=-1,{createAnnotationElement:d}=this;if(t==="unified"){Bc({diffStyle:t,type:"context",unifiedSpan:{type:"annotation",hunkIndex:l,lineIndex:c,annotations:o.concat(s)},createAnnotationElement:d,context:i});return}Bc({diffStyle:t,type:"context",deletionSpan:{type:"annotation",hunkIndex:l,lineIndex:c,annotations:o},additionSpan:{type:"annotation",hunkIndex:l,lineIndex:c,annotations:s},createAnnotationElement:d,context:i})}getAnnotations(e,t,n,i,o){const s={type:"annotation",hunkIndex:i,lineIndex:o,annotations:[]};if(t!=null)for(const c of this.deletionAnnotations[t]??[])s.annotations.push(ti(c));const l={type:"annotation",hunkIndex:i,lineIndex:o,annotations:[]};if(n!=null)for(const c of this.additionAnnotations[n]??[])(e==="unified"?s:l).annotations.push(ti(c));if(e==="unified")return s.annotations.length>0?s:void 0;if(!(l.annotations.length===0&&s.annotations.length===0))return{deletionSpan:s,additionSpan:l}}renderHeader(e){const{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return eA({fileOrDiff:e,mode:t,stickyHeader:n})}};function iw(e){return e?.map(t=>ti(t))??[]}const _F=new Intl.PluralRules("en-US");function CF(e){return`${e} unmodified line${_F.select(e)==="one"?"":"s"}`}function rw(e,t){for(const n of e)t.unifiedContentAST.push(n.content),t.pushToGutter("unified",n.gutter),t.incrementRowCount(1)}function ow(e,t,n){for(const{deletion:i,addition:o}of e){if(i==null&&o==null)continue;const s=i!=null&&o!=null?void 0:i==null?"deletions":"additions";(s==null||n.side!==s)&&n.flush(),i!=null&&(t.deletionsContentAST.push(i.content),t.pushToGutter("deletions",i.gutter)),o!=null&&(t.additionsContentAST.push(o.content),t.pushToGutter("additions",o.gutter)),s!=null&&(n.side=s,n.increment()),t.incrementRowCount(1)}}function Bc({diffStyle:e,type:t,deletionLine:n,additionLine:i,unifiedSpan:o,deletionSpan:s,additionSpan:l,createAnnotationElement:c,context:d}){let f=!1;if(e==="unified"){if(i!=null?d.unifiedContentAST.push(i):n!=null&&d.unifiedContentAST.push(n),o!=null){const p=t==="change"?n!=null?"change-deletion":"change-addition":t;d.unifiedContentAST.push(c(o)),d.pushToGutter("unified",An(p,"annotation",1)),f=!0}}else if(e==="split"){if(n!=null&&d.deletionsContentAST.push(n),i!=null&&d.additionsContentAST.push(i),s!=null){const p=t==="change"?n!=null?"change-deletion":"context":t;d.deletionsContentAST.push(c(s)),d.pushToGutter("deletions",An(p,"annotation",1)),f=!0}if(l!=null){const p=t==="change"?i!=null?"change-addition":"context":t;d.additionsContentAST.push(c(l)),d.pushToGutter("additions",An(p,"annotation",1)),f=!0}}f&&d.incrementRowCount(1)}function Am(e,{hunkIndex:t,collapsedLines:n,rangeSize:i,hunkSpecs:o,isFirstHunk:s,isLastHunk:l,isExpandable:c},d){if(typeof n=="number"&&n<=0)return;const f=e==="unified"?d.unifiedContentAST:e==="deletions"?d.deletionsContentAST:d.additionsContentAST;if(d.hunkSeparators==="metadata"){o!=null&&(d.pushToGutter(e,Ia({type:"metadata",content:o,isFirstHunk:s,isLastHunk:l})),f.push(Ia({type:"metadata",content:o,isFirstHunk:s,isLastHunk:l})),e!=="additions"&&d.incrementRowCount(1));return}if(d.hunkSeparators==="simple"){t>0&&(d.pushToGutter(e,Ia({type:"simple",isFirstHunk:s,isLastHunk:!1})),f.push(Ia({type:"simple",isFirstHunk:s,isLastHunk:!1})),e!=="additions"&&d.incrementRowCount(1));return}const p=MV(e,t),m=i>d.expansionLineCount,g=c?t:void 0,v=typeof n=="number"?CF(n):"More unchanged context may be available";d.pushToGutter(e,Ia({type:d.hunkSeparators,content:v,expandIndex:g,chunked:m,slotName:p,isFirstHunk:s,isLastHunk:l})),f.push(Ia({type:d.hunkSeparators,content:v,expandIndex:g,chunked:m,slotName:p,isFirstHunk:s,isLastHunk:l})),e!=="additions"&&d.incrementRowCount(1),d.hunkData.push({slotName:p,hunkIndex:t,lines:typeof n=="number"?n:0,lineCountKnown:typeof n=="number",type:e,expandable:c?{up:!s,down:!l,chunked:m}:void 0})}function Uc(e,t,n){return e==null||e.type!=="element"||t==null&&n==null?e:{...e,properties:{...e.properties,...t,...n}}}function aw(e){return e.length>0&&e[e.length-1]===""?e.length-1:e.length}function wF(e,t,n,i){const o=aw(e),s=aw(t),l=Math.min(o,s);let c=0;for(;c<l&&e[c]===t[c];)c++;let d=0;for(;d<l-c&&e[o-1-d]===t[s-1-d];)d++;const f=new Array(t.length);for(let p=0;p<c;p++)f[p]=n[p];for(let p=0;p<d;p++)f[s-1-p]=n[o-1-p];o<e.length&&s<t.length&&(f[t.length-1]=n[e.length-1]);for(let p=e.length;p<t.length;p++)f[p]??=n[p];for(let p=c;p<t.length;p++)f[p]??=qg(p,i.getLineText(p));return f}function qg(e,t,n=e,i=e){return{type:"element",tagName:"div",properties:{"data-line":e+1,"data-line-index":`${n},${i}`,"data-line-type":"context"},children:[{type:"element",tagName:"span",properties:{"data-char":0},children:[{type:"text",value:t}]}]}}function EF(e,t){const n=[],i=TF(t);for(let o=0;o<e.lineCount;o++){const s=e.getLineText(o,!0);n.push(o<e.lineCount-1&&!kF(s)?s+i:s)}return n}function kF(e){return e.endsWith(`
|
|
1551
|
+
`)||e.endsWith("\r")}function TF(e){for(const t of e){if(t.endsWith(`\r
|
|
1552
|
+
`))return`\r
|
|
1553
|
+
`;if(t.endsWith(`
|
|
1554
|
+
`))return`
|
|
1555
|
+
`;if(t.endsWith("\r"))return"\r"}return`
|
|
1556
|
+
`}function Vc(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function AF(e,t){return e.isPartial&&t&&(e.type==="change"||e.type==="rename-changed")}function LF(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function RF(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.lineCountKnown===t.lineCountKnown&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}async function Wg(e,t=300){let n;try{await Promise.race([e(),new Promise(i=>{n=setTimeout(i,t)})])}finally{n!=null&&clearTimeout(n)}}function Yg({oldFile:e,newFile:t},n){if(!(e===void 0&&t===void 0)){if(e===void 0||t===void 0)throw new Error(`${n}: Pass null for an intentionally missing oldFile or newFile side`);if(e===null){if(t===null)throw new Error(`${n}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}return t===null?{oldFile:e,newFile:t}:{oldFile:e,newFile:t}}}function OF(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:_A(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators=="function"?"custom":e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,loadDiffFiles:e?.loadDiffFiles,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}function DF(e){return e.isPartial&&(e.type==="change"||e.type==="rename-changed"||e.type==="rename-pure")}let MF=-1;var zA=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++MF}`;type="file-diff";fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerFilenameSuffix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;pendingFiles;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;lineStateRefreshPending=!1;deferredSelectedLines;deferredEditorActiveLine;constructor(t={theme:bt},n,i=!1){this.options=t,this.workerManager=n,this.isContainerManaged=i,this.hunksRenderer=this.createHunksRenderer(t),this.resizeManager=new Ik,this.scrollSyncManager=new DV,this.interactionManager=new Mk("diff",Sd(t,typeof t.hunkSeparators=="function"||(t.hunkSeparators??"line-info")==="line-info"||t.hunkSeparators==="line-info-basic"?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(t){return OF(t)}createHunksRenderer(t){return new SF(this.getHunksRendererOptions(t),this.handleHighlightRender,this.workerManager)}getLineIndex=(t,n="additions")=>{const i=this.fileDiffCache;if(i==null)return;const o=i.hunks.at(-1);let s,l;e:for(const c of i.hunks){const d=n==="deletions"?c.deletionStart:c.additionStart,f=n==="deletions"?c.deletionCount:c.additionCount;let p=Ei(d,f)+1,m=c.splitLineStart,g=c.unifiedLineStart;if(t<p){const v=p-t;s=Math.max(g-v,0),l=Math.max(m-v,0);break e}if(t>=p+f){if(c===o){const v=t-(p+f);s=g+c.unifiedLineCount+v,l=m+c.splitLineCount+v;break e}continue}for(const v of c.hunkContent)if(v.type==="context")if(t<p+v.lines){const x=t-p;l=m+x,s=g+x;break e}else p+=v.lines,m+=v.lines,g+=v.lines;else{const x=n==="deletions"?v.deletions:v.additions;if(t<p+x){const S=t-p;s=g+(n==="additions"?v.deletions:0)+S,l=m+S;break e}else p+=x,m+=Math.max(v.deletions,v.additions),g+=v.deletions+v.additions}break e}if(!(s==null||l==null))return[s,l]};setOptions(t){t!=null&&(this.options=t,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(t)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(Sd(this.options,typeof this.options.hunkSeparators=="function"||(this.options.hunkSeparators??"line-info")==="line-info"||this.options.hunkSeparators==="line-info-basic"?this.handleExpandHunk:void 0,this.getLineIndex))}mergeOptions(t){this.options={...this.options,...t}}setThemeType(t){(this.options.themeType??"system")!==t&&(this.mergeOptions({themeType:t}),this.applyCachedThemeState(t))}applyCachedThemeState(t){if(typeof this.options.theme=="string"||this.fileContainer==null||this.appliedThemeCSS==null)return!1;const n=this.appliedThemeCSS.baseThemeType??t;return this.appliedThemeCSS.themeType===n?!1:(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,t,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!ns(this.appliedThemeCSS.theme,this.options.theme??bt)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(t){this.lineAnnotations=t}canPartiallyRender(t,n,i){return!(t||n||i||typeof this.options.hunkSeparators=="function")}setSelectedLines(t,n){this.lineStateRefreshPending?this.deferredSelectedLines=[t,n]:this.interactionManager.setSelection(t,n)}setEditorActiveLine(t,n){this.lineStateRefreshPending?this.deferredEditorActiveLine=[t,n]:this.interactionManager.setEditorActiveLine(t,{lineNumberOnly:n?.lineNumberOnly,side:n?.side??"additions"})}flushDeferredLineState(){const{deferredEditorActiveLine:t,deferredSelectedLines:n}=this;this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,t!=null&&this.setEditorActiveLine(...t),n!=null&&this.interactionManager.setSelection(...n)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}const{diffStyle:t="split",overflow:n="scroll"}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:n==="wrap",columnVariables:this.shouldApplyColumnVariables(n)?"apply":"measure"}),n==="scroll"&&t==="split"?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}shouldApplyColumnVariables(t){return typeof this.options.hunkSeparators=="function"?!0:t==="scroll"&&(this.lineAnnotations.length>0||this.pre?.hasAttribute("data-has-merge-conflict")===!0)}getCodeScrollLeft(){return Math.max(this.codeUnified?.scrollLeft??0,this.codeDeletions?.scrollLeft??0,this.codeAdditions?.scrollLeft??0)}setCodeScrollLeft(t){this.codeUnified!=null&&(this.codeUnified.scrollLeft=t),this.codeAdditions!=null&&(this.codeAdditions.scrollLeft=t),this.codeDeletions!=null&&(this.codeDeletions.scrollLeft=t)}__getEffectiveCodeOptions(){return{...this.options,...this.hunksRenderer.getEffectiveCodeOptions()}}cleanUp(t=!1){cg(this.handleEditSessionRender),this.emitPostRender(!0),this.editor?.cleanUp(t),this.editor=void 0,this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.pendingFiles=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,t||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,t||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,t?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate({fileContainer:t,prerenderedHTML:n,preventEmit:i=!1,lineAnnotations:o,fileDiff:s,...l}){if(!this.enabled)throw new Error("FileDiff.hydrate: attempting to call hydrate after cleaned up");if(this.fileContainer!=null)throw new Error("FileDiff.hydrate: hydrate can only be called before the instance has rendered or hydrated");const c=Yg(l,"FileDiff.hydrate"),d=c?.oldFile,f=c?.newFile;this.hydrateElements(t,n),zF(this.pre,IF({fileDiff:s,oldFile:d,newFile:f}),this.options.collapsed)||PF(this.headerElement,NF({fileDiff:s,oldFile:d,newFile:f}),this.options.disableFileHeader)?this.render({...l,fileContainer:t,lineAnnotations:o,fileDiff:s,preventEmit:!0}):this.hydrationSetup({fileDiff:s,lineAnnotations:o,...c}),i||this.emitPostRender()}hydrateElements(t,n){this.fileContainer!==t&&this.emitPostRender(!0),xA(t,n);for(const i of t.shadowRoot?.children??[]){if(i instanceof SVGElement){this.spriteSVG=i;continue}if(i instanceof HTMLElement){if(i instanceof HTMLPreElement){this.pre=i;for(const o of i.children)!(o instanceof HTMLElement)||o.tagName.toLowerCase()!=="code"||("deletions"in o.dataset&&(this.codeDeletions=o),"additions"in o.dataset&&(this.codeAdditions=o),"unified"in o.dataset&&(this.codeUnified=o));continue}if("diffsHeader"in i.dataset){this.headerElement=i;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute("data-theme-css")){this.themeCSSStyle=i;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute("data-unsafe-css")){this.unsafeCSSStyle=i,this.appliedUnsafeCSS=i.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute("data-dehydrated")),this.fileContainer=t,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:t,oldFile:n,newFile:i,lineAnnotations:o}){this.lineAnnotations=o??this.lineAnnotations,this.additionFile=i,this.deletionFile=n,this.fileDiff=t??(n!==void 0&&i!==void 0?zo(n,i,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(t,n,i)=>{this.expandHunk(t,n,i)};expandHunk=(t,n,i)=>{this.hunksRenderer.expandHunk(t,n,i),this.loadFilesIfNecessary(),this.rerender()};loadFilesIfNecessary(){const{fileDiff:t,options:{loadDiffFiles:n}}=this;t==null||n==null||!DF(t)||this.pendingFiles?.fileDiff===t||(this.pendingFiles={fileDiff:t,promise:this.loadFilesForDiff(t,n)})}async loadFilesForDiff(t,n){try{const i=await n(t);if(!this.enabled||this.fileDiff!==t)return;await this.handleFilesLoaded(t,i)}catch(i){if(this.options.disableErrorHandling===!0)throw i;console.error(i)}finally{this.pendingFiles?.fileDiff===t&&(this.pendingFiles=void 0)}}async handleFilesLoaded(t,n){this.fileDiff!==t||!t.isPartial||(Pd("merge",t,n),this.setHydratedState(n),await Wg(()=>this.primeHighlightCache(t)),!(!this.enabled||this.fileDiff!==t)&&this.rerender())}setHydratedState(t){this.deletionFile=t.oldFile,this.additionFile=t.newFile,this.workerManager?.cleanUpTasks(this.hunksRenderer),this.hunksRenderer.clearRenderCache()}render({fileDiff:t,deferManagers:n=!1,forceRender:i=!1,preventEmit:o=!1,lineAnnotations:s,fileContainer:l,containerWrapper:c,renderRange:d,...f}){const p=Yg(f,"FileDiff.render"),m=p?.oldFile,g=p?.newFile;if(!this.enabled)throw new Error("FileDiff.render: attempting to call render after cleaned up");t!=null&&t.cacheKey===void 0&&(t.cacheKey=t.prevName!=null?t.prevName+":"+t.name:t.name),this.editor?.__postponeBgTokenizeToNextFrame();const{collapsed:v=!1,themeType:x="system",expandUnchanged:S=!1}=this.options,w=v?void 0:d,_=this.hasThemeChanged(),C=p!=null,T=C&&(!sw(m,this.deletionFile)||!sw(g,this.additionFile));let D=t!=null&&t!==this.fileDiff;const I=s!=null&&(s.length>0||this.lineAnnotations.length>0)?s!==this.lineAnnotations:!1;if(!v&&mf(w,this.renderRange)&&!i&&!I&&!_&&(t!=null&&t===this.fileDiff||t==null&&!T))return this.applyCachedThemeState(x);let O;t==null&&C&&(T||this.fileDiff==null)&&(O=zo(p.oldFile,p.newFile,this.options.parseDiffOptions));const{renderRange:P}=this;if(this.renderRange=w,C?(this.deletionFile=m,this.additionFile=g):t!=null&&(this.deletionFile=void 0,this.additionFile=void 0),t!=null?this.fileDiff=t:O!=null&&(D=!0,this.fileDiff=O),D&&(this.cachedHeaderHTML=void 0),s!=null&&this.setLineAnnotations(s),this.fileDiff==null)return!1;this.fileDiff.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(JC(this.fileDiff,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),S&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);const{disableErrorHandling:j=!1,disableFileHeader:F=!1}=this.options;if(F&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),l=this.getOrCreateFileContainer(l,c),this.applyCachedThemeState(x),v){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const Q=this.hunksRenderer.renderDiff(this.fileDiff,vk);Q!=null&&this.applyThemeState(l,Q.themeStyles,x,Q.baseThemeType),Q?.headerElement!=null&&this.applyHeaderToDOM(Q.headerElement,l),this.renderSeparators([]),this.injectUnsafeCSS()}catch(Q){if(j)throw Q;console.error(Q),Q instanceof Error&&this.applyErrorToDOM(Q,l)}return o||this.emitPostRender(),!0}try{const Q=this.getOrCreatePreNode(l);if(!(this.canPartiallyRender(i,I,T||D||_)&&this.applyPartialRender({previousRenderRange:P,renderRange:w}))){const G=this.hunksRenderer.renderDiff(this.fileDiff,w);if(G==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(l,G.themeStyles,x,G.baseThemeType),G.headerElement!=null&&this.applyHeaderToDOM(G.headerElement,l),G.additionsContentAST!=null||G.deletionsContentAST!=null||G.unifiedContentAST!=null?this.applyHunksToDOM(Q,G):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(G.hunkData)}this.applyBuffers(Q,w),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,n||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(Q){if(j)throw Q;console.error(Q),Q instanceof Error&&this.applyErrorToDOM(Q,l)}return o||this.emitPostRender(),!0}emitPostRender(t=!1){const{fileContainer:n,options:{onPostRender:i}}=this;if(t){if(!this.mounted||(this.mounted=!1,n==null))return;this.options.onPostRender?.(n,this,"unmount");return}if(n==null)return;const o=this.mounted?"update":"mount";this.mounted=!0,i?.(n,this,o)}get fileDiffCache(){return this.hunksRenderer.diffCache??this.fileDiff}syncRenderViewToEditor(){const t=this.editor,n=this.fileContainer,i=this.fileDiffCache,o=this.lineAnnotations,s=this.computeEditorRenderRange(this.renderRange);t!=null&&n!=null&&i!=null&&!i.isPartial&&this.hunksRenderer.initializeHighlighter().then(l=>{!this.enabled||this.editor!==t||this.fileContainer!==n||this.fileDiffCache!==i||t.__syncRenderView(l,n,i,o,s)})}computeEditorRenderRange(t){const n=this.fileDiffCache;if(t==null||n==null||Fg(t))return t;const{diffStyle:i="split",expandUnchanged:o=!1,collapsedContextThreshold:s=1}=this.options;let l,c;return Lo({diff:n,diffStyle:i,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:o?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s,callback:({additionLine:d})=>{d!=null&&(l??=d.lineNumber,c=d.lineNumber)}}),l==null||c==null?{...t,startingLine:0,totalLines:0}:{...t,startingLine:l-1,totalLines:c-l+1}}attachEditor(t){if(this.type!=="file-diff")throw new Error(`FileDiff.attachEditor: cannot attach an editor to a "${this.type}" diff`);return this.editor?.cleanUp(),this.editor=t,this.hunksRenderer.beginEditSession(),this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary(),this.hunksRenderer.editorRenderReady()?this.syncRenderViewToEditor():this.rerender(),n=>{this.editor=void 0,n!==!0&&this.finishEditSession()}}finishEditSession(){this.hunksRenderer.endEditSession(),this.completeEditSession()}completeEditSession(){const t=this.fileDiffCache;if(t==null||t.editSessionDirty!==!0)return!1;const{collapsedContextThreshold:n=1}=this.options,i=uF(t,this.hunksRenderer.getExpandedHunksMap(),n);return JC(t,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(cF(t,i)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(t,n){this.hunksRenderer.applyDocumentChange(t);const i=this.hunksRenderer.diffCache;if(i!=null){const o=this.fileDiff?.cacheKey;o!=null&&i.cacheKey==null&&(i.cacheKey=o),this.fileDiff=i}n!==void 0&&n!==this.lineAnnotations&&(this.setLineAnnotations(n),this.hunksRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations()),this.rerender(),this.interactionManager.setSelectionDirty()}updateRenderCache(t,n,i={}){const{shouldRefreshDiffsView:o,lineCountChangeInFlight:s}=i;if(this.hunksRenderer.updateRenderCache(t,n,s)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}o===!0&&(this.refreshViewTimeout!=null&&clearTimeout(this.refreshViewTimeout),this.lineStateRefreshPending=!0,this.refreshViewTimeout=setTimeout(()=>{this.refreshViewTimeout=void 0,this.options.diffStyle==="split"?this.refreshSplitDiffView():this.refreshUnifiedDiffView(),this.flushDeferredLineState()},150))}isLineRenderable(t){const n=this.fileDiffCache;if(n==null)return!0;const{expandUnchanged:i=!1,collapsedContextThreshold:o=1}=this.options;return AA({fileDiff:n,lineNumber:t,expandedHunks:i?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o})}getNearestRenderableLine(t,n){const i=this.fileDiffCache;if(i==null)return t;const{expandUnchanged:o=!1,collapsedContextThreshold:s=1}=this.options;return zV({fileDiff:i,lineNumber:t,direction:n,expandedHunks:o?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s})}revealLine(t){const n=this.fileDiffCache,{expandUnchanged:i=!1,collapsedContextThreshold:o=1,expansionLineCount:s=100}=this.options;if(n==null||n.isPartial||i)return!1;const l=this.hunksRenderer.getExpandedHunksMap();for(const[p,m]of n.hunks.entries()){const[g,v]=Nl(m);if(t<g){const x=ar({isPartial:n.isPartial,rangeSize:m.collapsedBefore,expandedHunks:l,hunkIndex:p,collapsedContextThreshold:o}),S=g-x.rangeSize;if(x.renderAll||t<S+x.fromStart||t>=g-x.fromEnd)return!1;const w=t-(S+x.fromStart)+1,_=g-x.fromEnd-t;return w<=_?this.expandHunk(p,"up",w+s):this.expandHunk(p,"down",_+s),!0}if(t<v)return!1}const c=sr({fileDiff:n,hunkIndex:n.hunks.length-1,expandedHunks:l,collapsedContextThreshold:o,errorPrefix:"FileDiff.revealLine"});if(c==null||c.renderAll)return!1;const d=n.hunks[n.hunks.length-1],[,f]=Nl(d);return t<f+c.fromStart||t>=f+c.rangeSize?!1:(this.expandHunk(n.hunks.length,"up",t-(f+c.fromStart)+1+s),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){bk(this.handleEditSessionRender)}handleEditSessionRender=()=>{this.rerender(),this.flushDeferredLineState()};removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(const{element:t}of this.separatorCache.values())t.remove();this.separatorCache.clear();for(const{element:t}of this.annotationCache.values())t.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(t){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){const n=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:"open"});this.placeHolder=document.createElement("div"),this.placeHolder.dataset.placeholder="",n.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty("height",`${t}px`),!0}async primeHighlightCache(t=this.fileDiff){const{workerManager:n}=this;if(t==null||n==null||!n.isWorkingPool()||t.cacheKey==null||Xa(t))return;const i=this.options.tokenizeMaxLength??1e5;Math.max(t.additionLines.length,t.deletionLines.length)>i||await n.primeDiffHighlightCache(t).catch(o=>{console.error(o)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(t){const{hunkSeparators:n}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof n!="function"){for(const{element:o}of this.separatorCache.values())o.remove();this.separatorCache.clear();return}const i=new Map(this.separatorCache);for(const o of t){const s=o.slotName;let l=this.separatorCache.get(s);if(l==null||!RF(o,l.hunkData)){l?.element.remove();const c=document.createElement("div");c.style.display="contents",c.slot=o.slotName;const d=n(o,this);d!=null&&c.appendChild(d),this.fileContainer.appendChild(c),l={element:c,hunkData:o},this.separatorCache.set(s,l)}i.delete(s)}for(const[o,{element:s}]of i.entries())this.separatorCache.delete(o),s.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(const{element:i}of this.annotationCache.values())i.remove();this.annotationCache.clear();return}const t=new Map(this.annotationCache),{renderAnnotation:n}=this.options;if(n!=null&&this.lineAnnotations.length>0)for(const[i,o]of this.lineAnnotations.entries()){const s=`${i}-${ti(o)}`;let l=this.annotationCache.get(s);if(l==null||!LF(o,l.annotation)){l?.element.remove();const c=n(o);if(c==null)continue;l={element:fA(ti(o)),annotation:o},l.element.appendChild(c),this.fileContainer.appendChild(l.element),this.annotationCache.set(s,l)}t.delete(s)}for(const[i,{element:o}]of t.entries())this.annotationCache.delete(i),o.remove()}renderGutterUtility(){const{renderGutterUtility:t}=this.options;if(this.fileContainer==null||t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const n=t(this.interactionManager.getHoveredLine);if(n!=null&&this.gutterUtilityContent!=null)return;if(n==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const i=hA();i.appendChild(n),this.fileContainer.appendChild(i),this.gutterUtilityContent=i}getOrCreateFileContainer(t,n){const{fileContainer:i}=this,o=t??i??document.createElement("diffs-container"),s=i!==o;return i!=null&&s&&this.editor?.__captureFocusForDOMReplacement(),s&&this.emitPostRender(!0),this.fileContainer=o,i!=null&&s&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),n!=null&&this.fileContainer.parentNode!==n&&n.appendChild(this.fileContainer),s&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(t){const{shadowRoot:n}=t;if(n!=null)for(const i of n.children)i instanceof SVGElement?this.spriteSVG??=i:Nd(i)&&i.hasAttribute("data-theme-css")?(this.themeCSSStyle??=i,this.hasAdoptedThemeCSS=!0):Nd(i)&&i.hasAttribute("data-unsafe-css")&&(this.unsafeCSSStyle??=i,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(t){const n=t.shadowRoot??t.attachShadow({mode:"open"});if(this.spriteSVG==null){const i=document.createElement("div");i.innerHTML=cA;const o=i.firstChild;o instanceof SVGElement&&(this.spriteSVG=o)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==n&&n.appendChild(this.spriteSVG)}getOrCreatePreNode(t){const n=t.shadowRoot??t.attachShadow({mode:"open"});return this.pre==null?(this.pre=document.createElement("pre"),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,n.appendChild(this.pre)):this.pre.parentNode!==n&&(this.editor?.__captureFocusForDOMReplacement(),n.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(t){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(const n of Array.from(t.children))n instanceof HTMLElement&&(n.hasAttribute("data-unified")?this.codeUnified=n:n.hasAttribute("data-deletions")?this.codeDeletions=n:n.hasAttribute("data-additions")&&(this.codeAdditions=n))}applyHeaderToDOM(t,n){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;const{fileDiff:i}=this,o=this.cachedHeaderHTML??nn(t);if(this.cachedHeaderHTML=o,o!==this.lastRenderedHeaderHTML){const g=document.createElement("div");g.innerHTML=o;const v=g.firstElementChild;if(!(v instanceof HTMLElement))return;this.headerElement!=null?n.shadowRoot?.replaceChild(v,this.headerElement):n.shadowRoot?.prepend(v),this.headerElement=v,this.lastRenderedHeaderHTML=o}if(this.isContainerManaged||i==null)return;const{renderCustomHeader:s,renderHeaderPrefix:l,renderHeaderFilenameSuffix:c,renderHeaderMetadata:d}=this.options;if(s!=null){const g=s(i)??void 0;this.headerCustom=this.upsertHeaderSlotElement(n,this.headerCustom,Gl,g),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}const f=l?.(i)??void 0,p=c?.(i)??void 0,m=d?.(i)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(n,this.headerPrefix,zy,f),this.headerFilenameSuffix=this.upsertHeaderSlotElement(n,this.headerFilenameSuffix,Py,p),this.headerMetadata=this.upsertHeaderSlotElement(n,this.headerMetadata,Hy,m),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(t,n,i,o){if(o==null){n?.remove();return}const s=n??this.createHeaderSlotElement(i);return n==null&&t.appendChild(s),this.replaceHeaderSlotContent(s,o),s}replaceHeaderSlotContent(t,n){t.replaceChildren(),n instanceof Element?t.appendChild(n):t.innerText=`${n}`}createHeaderSlotElement(t){const n=document.createElement("div");return n.slot=t,n}injectUnsafeCSS(){const{unsafeCSS:t}=this.options,n=this.fileContainer?.shadowRoot;if(n!=null){if(t==null||t===""){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}this.unsafeCSSStyle?.parentNode===n&&this.appliedUnsafeCSS===t||(this.unsafeCSSStyle??=pA(),this.unsafeCSSStyle.parentNode!==n&&n.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=yA(t),this.appliedUnsafeCSS=t)}}applyThemeState(t,n,i,o){const s=t.shadowRoot??t.attachShadow({mode:"open"}),l=o??i,c=this.options.theme??bt,d=typeof c=="string"?c:{...c},f=Il(s);if(this.themeCSSStyle?.parentNode===s&&this.appliedThemeCSS?.themeStyles===n&&this.appliedThemeCSS.themeType===l&&this.appliedThemeCSS.scrollbarGutter===f){this.appliedThemeCSS.theme=d;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===s){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:d,themeStyles:n,themeType:l,baseThemeType:o,scrollbarGutter:f};return}this.themeCSSStyle=CA({shadowRoot:s,currentNode:this.themeCSSStyle,themeCSS:vA(n,l,f)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:d,themeStyles:n,themeType:l,baseThemeType:o,scrollbarGutter:f}:void 0}hydrateMeasuredScrollbar(){const t=this.fileContainer?.shadowRoot;t==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=bA(this.themeCSSStyle.textContent??"",Il(t)))}shouldGuardRebuildScroll(){return this.editor!=null&&wA()}applyHunksToDOM(t,n){this.shouldGuardRebuildScroll()?Ug(t,()=>this.replaceCodeColumns(t,n)):this.replaceCodeColumns(t,n)}applyCodeColumnsInPlace(t,n,i){const o=this.getColumnPair(t);if(o==null)return!1;const s=Pr(n[0]),l=Pr(n[1]);return s==null||l==null?!1:(o.gutter.innerHTML=nn(s),o.content.innerHTML=nn(l),i!==this.lastRowCount&&(o.gutter.style.setProperty("grid-row",`span ${i}`),o.content.style.setProperty("grid-row",`span ${i}`)),!0)}replaceCodeColumns(t,n){const{overflow:i="scroll"}=this.options,o=(this.options.hunkSeparators??"line-info")==="line-info",s=i==="wrap"?n.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(t,n);let l=!1;const c=[],d=this.hunksRenderer.renderCodeAST("unified",n),f=this.hunksRenderer.renderCodeAST("deletions",n),p=this.hunksRenderer.renderCodeAST("additions",n);this.editor?.__captureFocusForDOMReplacement(),d!=null?(l=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=ad({code:this.codeUnified,columnType:"unified",rowSpan:s,containerSize:o}),this.applyCodeColumnsInPlace(this.codeUnified,d,n.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(d)),c.push(this.codeUnified)):f!=null||p!=null?(f!=null?(l=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=ad({code:this.codeDeletions,columnType:"deletions",rowSpan:s,containerSize:o}),this.applyCodeColumnsInPlace(this.codeDeletions,f,n.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(f)),c.push(this.codeDeletions)):(this.codeDeletions?.remove(),this.codeDeletions=void 0),p!=null?(l=l||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=ad({code:this.codeAdditions,columnType:"additions",rowSpan:s,containerSize:o}),this.applyCodeColumnsInPlace(this.codeAdditions,p,n.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(p)),c.push(this.codeAdditions)):(this.codeAdditions?.remove(),this.codeAdditions=void 0)):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0),c.length===0?t.textContent="":l&&t.replaceChildren(...c),this.lastRowCount=n.rowCount}applyPartialRender({previousRenderRange:t,renderRange:n}){const{pre:i,codeUnified:o,codeAdditions:s,codeDeletions:l,options:{diffStyle:c="split"}}=this;if(i==null||t==null||n==null||!Number.isFinite(t.totalLines)||!Number.isFinite(n.totalLines)||this.lastRowCount==null)return!1;const d=this.getCodeColumns(c,o,l,s);if(d==null)return!1;const f=t.startingLine,p=n.startingLine,m=f+t.totalLines,g=p+n.totalLines,v=Math.max(f,p),x=Math.min(m,g);if(x<=v)return!1;const S=Math.max(0,v-f),w=Math.max(0,m-x),_=this.trimColumns({columns:d,trimStart:S,trimEnd:w,previousStart:f,overlapStart:v,overlapEnd:x,diffStyle:c});if(_<0)throw new Error("FileDiff.applyPartialRender: failed to trim to overlap");if(this.lastRowCount<_)throw new Error("FileDiff.applyPartialRender: trimmed beyond DOM row count");let C=this.lastRowCount-_;const T=(P,j)=>{if(!(j<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:P,totalLines:j,bufferBefore:0,bufferAfter:0})},D=T(p,Math.max(v-p,0));if(D==null&&p<v)return!1;const I=T(x,Math.max(g-x,0));if(I==null&&g>x)return!1;const O=(P,j)=>{if(P!=null){if(c==="unified"&&!Array.isArray(d))this.insertPartialHTML(c,d,P,j);else if(c==="split"&&Array.isArray(d))this.insertPartialHTML(c,d,P,j);else throw new Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");C+=P.rowCount}};return this.cleanupErrorWrapper(),O(D,"afterbegin"),O(I,"beforeend"),this.lastRowCount!==C&&(this.applyRowSpan(c,d,C),this.lastRowCount=C),!0}insertPartialHTML(t,n,i,o){if(t==="unified"&&!Array.isArray(n)){const s=this.hunksRenderer.renderCodeAST("unified",i);this.renderPartialColumn(n,s,o)}else if(t==="split"&&Array.isArray(n)){const s=this.hunksRenderer.renderCodeAST("deletions",i),l=this.hunksRenderer.renderCodeAST("additions",i);this.renderPartialColumn(n[0],s,o),this.renderPartialColumn(n[1],l,o)}else throw new Error("FileDiff.insertPartialHTML: Invalid argument composition")}refreshSplitDiffView(){if(this.options.diffStyle!=="split")return;const t=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(t==null)return;const n=this.getCodeColumns("split",this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(n))return;const i=(o,s)=>{if(s==null)return;const l=this.hunksRenderer.renderCodeAST(o,t),c=Pr(l?.[0]),d=Pr(l?.[1]);for(const[f,p]of[[s.gutter,c],[s.content,d]])if(p!=null&&f.childElementCount===p.length)for(let m=0;m<p.length;m++){const g=f.children[m],v=p[m].properties["data-line-type"];v!=null&&g.dataset.lineType!==v&&(g.dataset.lineType=v)}};i("deletions",n[0]),i("additions",n[1])}refreshUnifiedDiffView(){if(this.options.diffStyle!=="unified")return;const t=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(t==null)return;const n=this.getCodeColumns("unified",this.codeUnified,this.codeDeletions,this.codeAdditions);if(n==null||Array.isArray(n))return;const i=this.hunksRenderer.renderCodeAST("unified",t),o=Pr(i?.[0]),s=Pr(i?.[1]),l=()=>{for(const[c,d]of[[n.gutter,o],[n.content,s]])d!=null&&(c.innerHTML=nn(d));t.rowCount!==this.lastRowCount&&(this.applyRowSpan("unified",n,t.rowCount),this.lastRowCount=t.rowCount)};this.shouldGuardRebuildScroll()?Ug(this.pre,l):l(),this.renderSeparators(t.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(t,n,i){if(t==null||n==null)return;const o=Pr(n[0]),s=Pr(n[1]);if(o==null||s==null)throw new Error("FileDiff.insertPartialHTML: Unexpected AST structure");const l=s.at(0);i==="beforeend"&&l?.type==="element"&&typeof l.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(l.properties["data-buffer-size"],t.content.children[t.content.children.length-1],t.gutter.children[t.gutter.children.length-1],o,s,!0);const c=s.at(-1);i==="afterbegin"&&c?.type==="element"&&typeof c.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(c.properties["data-buffer-size"],t.content.children[0],t.gutter.children[0],o,s,!1),t.gutter.insertAdjacentHTML(i,this.hunksRenderer.renderPartialHTML(o)),t.content.insertAdjacentHTML(i,this.hunksRenderer.renderPartialHTML(s))}mergeBuffersIfNecessary(t,n,i,o,s,l){if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement))return;const c=this.getBufferSize(n.dataset);c!=null&&(l?(o.shift(),s.shift()):(o.pop(),s.pop()),this.updateBufferSize(n,c+t),this.updateBufferSize(i,c+t))}applyRowSpan(t,n,i){const o=s=>{s!=null&&(s.gutter.style.setProperty("grid-row",`span ${i}`),s.content.style.setProperty("grid-row",`span ${i}`))};if(t==="unified"&&!Array.isArray(n))o(n);else if(t==="split"&&Array.isArray(n))o(n[0]),o(n[1]);else throw new Error("dun fuuuuked up")}trimColumnRows(t,n,i){let o=0,s=0,l=0,c=!1;const d=i>=0;if(t==null)return 0;const f=Array.from(t.content.children),p=Array.from(t.gutter.children);if(f.length!==p.length)throw new Error("FileDiff.trimColumnRows: columns do not match");for(;l<f.length&&!(n<=0&&!d&&!c);){const m=p[l],g=f[l];if(l++,!(m instanceof HTMLElement)||!(g instanceof HTMLElement))throw console.error({gutterElement:m,contentElement:g}),new Error("FileDiff.trimColumnRows: invalid row elements");if(c&&(c=!1,m.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in g.dataset||m.dataset.gutterBuffer==="metadata"&&"noNewline"in g.dataset)){m.remove(),g.remove(),s++;continue}if("lineIndex"in m.dataset&&"lineIndex"in g.dataset){(n>0||d&&o>=i)&&(m.remove(),g.remove(),n>0&&(n--,n===0&&(c=!0)),s++),o++;continue}if("separator"in m.dataset&&"separator"in g.dataset){(n>0||d&&o>=i)&&(m.remove(),g.remove(),s++);continue}if(m.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in g.dataset){(n>0||d&&o>=i)&&(m.remove(),g.remove(),s++);continue}if(m.dataset.gutterBuffer==="metadata"&&"noNewline"in g.dataset){(n>0||d&&o>=i)&&(m.remove(),g.remove(),s++);continue}if(m.dataset.gutterBuffer==="buffer"&&"contentBuffer"in g.dataset){const v=this.getBufferSize(g.dataset);if(v==null)throw new Error("FileDiff.trimColumnRows: invalid element");if(n>0){const x=Math.min(n,v),S=v-x;S>0?(this.updateBufferSize(m,S),this.updateBufferSize(g,S),s+=x):(m.remove(),g.remove(),s+=v),n-=x,n===0&&S===0&&(c=!0)}else if(d){const x=o,S=o+v-1;if(i<=x)m.remove(),g.remove(),s+=v;else if(i<=S){const w=S-i+1,_=v-w;this.updateBufferSize(m,_),this.updateBufferSize(g,_),s+=w}}o+=v;continue}throw console.error({gutterElement:m,contentElement:g}),new Error("FileDiff.trimColumnRows: unknown row elements")}return s}trimColumns({columns:t,diffStyle:n,overlapEnd:i,overlapStart:o,previousStart:s,trimEnd:l,trimStart:c}){const d=Math.max(0,o-s),f=i-s;if(f<0)throw new Error("FileDiff.trimColumns: overlap ends before previous");const p=c>0,m=l>0;if(!p&&!m)return 0;const g=p?d:0,v=m?f:-1;if(n==="unified"&&!Array.isArray(t))return this.trimColumnRows(t,g,v);if(n==="split"&&Array.isArray(t)){const x=this.trimColumnRows(t[0],g,v),S=this.trimColumnRows(t[1],g,v);if(t[0]!=null&&t[1]!=null&&x!==S)throw new Error("FileDiff.trimColumns: split columns out of sync");return t[0]!=null?x:S}else throw console.error({diffStyle:n,columns:t}),new Error("FileDiff.trimColumns: Invalid columns for diffType")}getBufferSize(t){const n=Number.parseInt(t?.bufferSize??"",10);return Number.isNaN(n)?void 0:n}updateBufferSize(t,n){t.dataset.bufferSize=`${n}`,t.style.setProperty("grid-row",`span ${n}`),t.style.setProperty("min-height",`calc(${n} * 1lh)`)}getColumnPair(t){if(t==null)return;const n=t.children[0],i=t.children[1];if(!(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||n.dataset.gutter==null||i.dataset.content==null))return{gutter:n,content:i}}getCodeColumns(t,n,i,o){if(t==="unified")return this.getColumnPair(n);{const s=this.getColumnPair(i),l=this.getColumnPair(o);return s!=null||l!=null?[s,l]:void 0}}updateBuffers(t){this.pre!=null&&this.applyBuffers(this.pre,t)}applyBuffers(t,n){if(n==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}n.bufferBefore>0?(this.bufferBefore==null&&(this.bufferBefore=document.createElement("div"),this.bufferBefore.dataset.virtualizerBuffer="before",t.before(this.bufferBefore)),this.bufferBefore.style.setProperty("height",`${n.bufferBefore}px`),this.bufferBefore.style.setProperty("contain","strict")):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),n.bufferAfter>0?(this.bufferAfter==null&&(this.bufferAfter=document.createElement("div"),this.bufferAfter.dataset.virtualizerBuffer="after",t.after(this.bufferAfter)),this.bufferAfter.style.setProperty("height",`${n.bufferAfter}px`),this.bufferAfter.style.setProperty("contain","strict")):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(t,{additionsContentAST:n,deletionsContentAST:i,totalLines:o},s){const{diffIndicators:l="bars",disableBackground:c=!1,disableLineNumbers:d=!1,overflow:f="scroll",diffStyle:p="split"}=this.options,m={type:"diff",diffIndicators:l,disableBackground:c,disableLineNumbers:d,overflow:f,split:p==="unified"?!1:n!=null&&i!=null,totalLines:o,customProperties:s};dA(m,this.appliedPreAttributes)||(SA(t,m),this.appliedPreAttributes=m)}applyErrorToDOM(t,n){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;const i=n.shadowRoot??n.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",i.appendChild(this.errorWrapper);const o=document.createElement("div");o.dataset.errorMessage="",o.innerText=t.message,this.errorWrapper.appendChild(o);const s=document.createElement("pre");s.dataset.errorStack="",s.innerText=t.stack??"No Error Stack",this.errorWrapper.appendChild(s)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function sw(e,t){return e==null||t==null?e==null&&t==null:Kn(e,t)}function IF({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function NF({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function zF(e,t,n=!1){return!n&&e==null&&t}function PF(e,t,n=!1){return e==null&&t&&!n}function Pr(e){if(!(e==null||e.type!=="element"))return e.children??[]}function HF({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:i,expandUnchanged:o,expandedHunks:s,collapsedContextThreshold:l,canHydratePartialDiff:c}){let d=vi(t,n),f=d;const p=o?!0:s,m=e.hunks.length-1;for(let g=0;g<e.hunks.length;g++){const v=e.hunks[g];if(v==null)throw new Error("computeEstimatedDiffHeights: invalid hunk index");const x=ar({isPartial:e.isPartial,rangeSize:v.collapsedBefore,expandedHunks:p,hunkIndex:g,collapsedContextThreshold:l}),S=(x.fromStart+x.fromEnd)*t.lineHeight;if(d+=S,f+=S,x.collapsedLines>0){const C=ul({type:i,metrics:t,hunkIndex:g,hunkSpecs:v.hunkSpecs})?.totalHeight??0;d+=C,f+=C}d+=v.splitLineCount*t.lineHeight,f+=v.unifiedLineCount*t.lineHeight;const w=jF(v);d+=w.split*t.lineHeight,f+=w.unified*t.lineHeight;const _=g===m?sr({fileDiff:e,hunkIndex:g,expandedHunks:p,collapsedContextThreshold:l,errorPrefix:"computeEstimatedDiffHeights"}):void 0;if(_!=null){const C=(_.fromStart+_.fromEnd)*t.lineHeight;if(d+=C,f+=C,_.collapsedLines>0){const T=Co({type:i,metrics:t})?.totalHeight??0;d+=T,f+=T}}else if(g===m&&e.isPartial&&c){const C=Co({type:i,metrics:t})?.totalHeight??0;d+=C,f+=C}}if(e.hunks.length>0){const g=zd(t);d+=g,f+=g}return{splitHeight:d,unifiedHeight:f}}function jF(e){if(!e.noEOFCRAdditions&&!e.noEOFCRDeletions)return{split:0,unified:0};const t=e.hunkContent.at(-1);if(t==null)return{split:0,unified:0};if(t.type==="context"){const n=t.lines>0?1:0;return{split:n,unified:n}}return BF(e,t)}function BF(e,t){const n=(t.deletions>0&&e.noEOFCRDeletions?1:0)+(t.additions>0&&e.noEOFCRAdditions?1:0),i=t.deletions>0&&e.noEOFCRDeletions,o=t.additions>0&&e.noEOFCRAdditions;return{split:i||o?1:0,unified:n}}const Xg=3e3;let UF=-1;var VF=class extends zA{__id=`little-virtualized-file-diff:${++UF}`;top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;forceRenderOverride;currentCollapsed;currentExpandUnchanged;pendingHydratedDiff;pendingExpansions;constructor(e,t,n,i,o=!1){super(e,i,o),this.virtualizer=t,this.metrics=sd(n)}setMetrics(e,t=!1){const n=sd(e);!t&&bd(this.metrics,n)||(this.metrics=n,this.resetLayoutCache({includeEstimatedHeights:!0}))}setLineAnnotations(e){this.syncLineAnnotations(e)&&this.resetLayoutCache({includeEstimatedHeights:!1})}syncLineAnnotations(e){return e==null||e===this.lineAnnotations||e.length===0&&this.lineAnnotations.length===0?!1:(super.setLineAnnotations(e),!0)}setFileAnnotationHeight(e){const t=this.cache.fileAnnotationHeight;return e===t?!1:(this.cache.fileAnnotationHeight=e,this.cache.measuredHeightDeltaTotal+=e-t,!0)}hasFileAnnotations(e=this.fileDiff){return e==null||!jg(this.lineAnnotations)?!1:this.lineAnnotations.some(t=>t.lineNumber!==0?!1:e.type==="new"?t.side==="additions":e.type==="deleted"?t.side==="deletions":!0)}getLineHeight(e,t=!1){return this.getEstimatedLineHeight(t)+(this.cache.heightDeltas.get(e)??0)}getEstimatedLineHeight(e=!1){const t=e?2:1;return this.metrics.lineHeight*t}setOptions(e){if(this.isAdvancedMode())throw new Error("VirtualizedFileDiff.setOptions cannot be used inside CodeView. Update CodeView options instead.");if(e==null)return;const{options:t}=this,n=!tf(t,e),i=n&&YF(t,e);super.setOptions(e),i&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:XF(t,e)}),n&&(this.forceRenderOverride=!0),n&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,i)}setThemeType(e){if(this.isAdvancedMode())throw new Error("VirtualizedFileDiff.setThemeType cannot be used inside CodeView. Update CodeView options instead.");super.setThemeType(e)}resetLayoutCache({forceSimpleRecompute:e=!1,includeEstimatedHeights:t=!1,resetRenderRange:n=!0}={}){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heightDeltas.size>0&&this.cache.heightDeltas.clear(),this.cache.measuredHeightDeltaTotal!==0&&(this.cache.measuredHeightDeltaTotal=0),this.invalidateDerivedLayoutCache(t,n),e&&this.isSimpleMode()&&this.computeApproximateSize()}invalidateDerivedLayoutCache(e,t=!0){this.layoutDirty=!0,this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.totalLines!==0&&(this.cache.totalLines=0),e&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),this.renderRange!=null&&t&&(this.renderRange=void 0)}reconcileHeights(){let e=!1;const{overflow:t="scroll"}=this.options;if(this.fileContainer==null||this.fileDiff==null)return this.height!==0&&(e=!0),this.height=0,e;if(this.top=this.getVirtualizedTop(),t==="scroll"&&this.lineAnnotations.length===0&&!this.isResizeDebuggingEnabled())return e;const n=this.getDiffStyle(),i=n==="split"?[this.codeDeletions,this.codeAdditions]:[this.codeUnified],o=this.hasFileAnnotations(this.fileDiff);if(this.renderRange!=null&&o&&gf(this.renderRange)){const s=FF(i)??0;this.setFileAnnotationHeight(s)&&(e=!0)}else!o&&this.setFileAnnotationHeight(0)&&(e=!0);for(const s of i){if(s==null)continue;const l=s.children[1];if(l instanceof HTMLElement)for(const c of l.children){if(!(c instanceof HTMLElement))continue;const d=c.dataset.lineIndex;if(d==null)continue;const f=QF(d,n);let p=c.getBoundingClientRect().height,m=!1;c.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in c.nextElementSibling.dataset||"noNewline"in c.nextElementSibling.dataset)&&("noNewline"in c.nextElementSibling.dataset&&(m=!0),p+=c.nextElementSibling.getBoundingClientRect().height);const g=this.getEstimatedLineHeight(m),v=this.cache.heightDeltas.get(f)??0,x=p-g;x!==v&&(e=!0,this.cache.measuredHeightDeltaTotal+=x-v,x===0?this.cache.heightDeltas.delete(f):this.cache.heightDeltas.set(f,x))}}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render());flushManagers(){super.flushManagers(),this.lineStateRefreshPending&&this.flushDeferredLineState()}prepareCodeViewItem(e,t,n,i){const o=!ko(this.fileDiff,e),s=this.syncLineAnnotations(i);let l=n?.resetDiffLayoutCache===!0||o||s,c=o||n?.resetDiffLayoutCache===!0&&n.includeEstimatedDiffHeights;n?.metrics!=null&&(this.metrics=sd(n.metrics),l=!0,c=!0);const{collapsed:d=!1,expandUnchanged:f=!1}=this.options;return this.currentCollapsed!==d&&(this.currentCollapsed=d,l=!0),this.currentExpandUnchanged!==f&&(this.currentExpandUnchanged=f,l=!0,c=!0),l&&this.resetLayoutCache({includeEstimatedHeights:c}),this.fileDiff=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e,t="additions"){if(this.fileDiff==null||e<1)return;const n=this.getLineIndex(e,t);if(n==null)return;const{disableFileHeader:i=!1,expandUnchanged:o=!1,collapsed:s=!1,collapsedContextThreshold:l=1}=this.options,c=this.getDiffStyle(),d=this.getHunkSeparatorType(),f=c==="split"?n[1]:n[0];this.approximateLayoutCheckpoints();const p=vi(this.metrics,i),m=this.getLayoutCheckpointBeforeLineIndex(f);let g=m?.top??p+this.cache.fileAnnotationHeight;if(s)return{top:p,height:0};let v;return Lo({diff:this.fileDiff,diffStyle:c,startingLine:m?.renderedLineIndex??0,expandedHunks:o?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:l,callback:({hunkIndex:x,hunk:S,collapsedBefore:w,collapsedAfter:_,deletionLine:C,additionLine:T})=>{const D=c==="split"?T?.splitLineIndex??C?.splitLineIndex:T?.unifiedLineIndex??C?.unifiedLineIndex;if(D==null)throw new Error("VirtualizedFileDiff.getLinePosition: missing line index data");if(w>0){const O=ul({type:d,metrics:this.metrics,hunkIndex:x,hunkSpecs:S?.hunkSpecs});if(O!=null){if(g+=O.gapBefore,f>=D-w&&f<D)return v={top:g,height:O.height},!0;g+=O.height+O.gapAfter}}const I=this.getLineHeight(D,(T?.noEOFCR??!1)||(C?.noEOFCR??!1));if(D===f)return v={top:g,height:I},!0;if(g+=I,_>0){const O=Co({type:d,metrics:this.metrics});if(O!=null){if(f>D&&f<=D+_)return v={top:g+O.gapBefore,height:O.height},!0;g+=O.totalHeight}}return!1}}),v}getEditorViewport(){return this.virtualizer.type==="simple"?this.virtualizer.getRoot():this.virtualizer.getContainerElement()}getNumericScrollAnchor(e){if(this.fileDiff==null)return;const{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsed:i=!1,collapsedContextThreshold:o=1}=this.options;if(i)return;const s=this.getDiffStyle(),l=this.getHunkSeparatorType();this.approximateLayoutCheckpoints();const c=this.getLayoutCheckpointBeforeTop(e);let d=c?.top??vi(this.metrics,t)+this.cache.fileAnnotationHeight,f;return Lo({diff:this.fileDiff,diffStyle:s,startingLine:c?.renderedLineIndex??0,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:p,hunk:m,collapsedBefore:g,collapsedAfter:v,deletionLine:x,additionLine:S})=>{const w=s==="split"?S?.splitLineIndex??x?.splitLineIndex:S?.unifiedLineIndex??x?.unifiedLineIndex;if(w==null)throw new Error("VirtualizedFileDiff.getNumericScrollAnchor: missing line index data");if(g>0){const C=ul({type:l,metrics:this.metrics,hunkIndex:p,hunkSpecs:m?.hunkSpecs});C!=null&&(d+=C.totalHeight)}if(d>=e&&(x!=null?f={lineNumber:x.lineNumber,side:"deletions",top:d}:S!=null&&(f={lineNumber:S.lineNumber,side:"additions",top:d}),f!=null))return!0;const _=this.getLineHeight(w,(S?.noEOFCR??!1)||(x?.noEOFCR??!1));if(d+=_,v>0){const C=Co({type:l,metrics:this.metrics});C!=null&&(d+=C.totalHeight)}return!1}}),f}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){if(this.top==null||this.fileDiff==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};const t=e!=null?this.computeRenderRangeFromWindow(this.fileDiff,this.top,e):this.renderRange;if(t==null)return;const{bufferBefore:n,bufferAfter:i,totalLines:o}=t;let s=0;if(o===0){const l=e??this.virtualizer.getWindowSpecs();this.top<l.top&&(s=i)}return{topOffset:this.top+n+s,height:this.height-(n+i)}}cleanUp(e=!1){this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||(this.resetLayoutCache({includeEstimatedHeights:!0}),this.pendingExpansions=void 0,this.pendingHydratedDiff=void 0),this.isSetup=!1,super.cleanUp(e)}expandHunk=(e,t,n)=>{this.fileDiff!=null&&(this.isAdvancedMode()?(this.pendingExpansions??=[],this.pendingExpansions.push({hunkIndex:e,direction:t,expansionLineCountOverride:n})):(this.hunksRenderer.expandHunk(e,t,n),this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()),this.loadFilesIfNecessary(),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))};async handleFilesLoaded(e,t){if(!(this.fileDiff!==e||!e.isPartial)){if(this.isAdvancedMode()){const n=Pd("clone",e,t);if(await Wg(()=>this.primeHighlightCache(n)),!this.enabled||this.fileDiff!==e)return;this.pendingHydratedDiff={expectedDiff:e,nextDiff:n,files:t}}else{if(Pd("merge",e,t),this.setHydratedState(t),await Wg(()=>this.primeHighlightCache(e)),!this.enabled||this.fileDiff!==e)return;this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}}consumeCodeViewLayoutChanges(e){let t=!1,n;const{pendingExpansions:i,pendingHydratedDiff:o}=this;if(i!=null){this.pendingExpansions=void 0;for(const s of i)this.hunksRenderer.expandHunk(s.hunkIndex,s.direction,s.expansionLineCountOverride),t=!0}return o!=null&&(this.pendingHydratedDiff=void 0,o.expectedDiff===e&&(this.setHydratedState(o.files),n=o.nextDiff)),n!=null?(this.forceRenderOverride=!0,this.resetLayoutCache({includeEstimatedHeights:!0})):t&&(this.forceRenderOverride=!0,this.invalidateDerivedLayoutCache(!0)),n}loadFilesIfNecessary(){if(this.pendingHydratedDiff!=null){if(this.pendingHydratedDiff.expectedDiff===this.fileDiff)return;this.pendingHydratedDiff=void 0}super.loadFilesIfNecessary()}isLineRenderable(e){if(super.isLineRenderable(e))return!0;const{pendingExpansions:t}=this,n=this.fileDiffCache;if(t==null||t.length===0||n==null)return!1;const{expansionLineCount:i=100,collapsedContextThreshold:o=1}=this.options,s=new Map(this.hunksRenderer.getExpandedHunksMap());for(const l of t){const c={...s.get(l.hunkIndex)??{fromStart:0,fromEnd:0}},d=l.expansionLineCountOverride??i;(l.direction==="up"||l.direction==="both")&&(c.fromStart+=d),(l.direction==="down"||l.direction==="both")&&(c.fromEnd+=d),s.set(l.hunkIndex,c)}return AA({fileDiff:n,lineNumber:e,expandedHunks:s,collapsedContextThreshold:o})}invalidateEditSessionLayout(){this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),this.isSimpleMode()||this.computeApproximateSize(!0),this.getSimpleVirtualizer()?.requestHeightReconcile(this)}escalateEditSessionRender(){this.invalidateEditSessionLayout(),!(!this.enabled||this.fileDiff==null)&&(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))}shouldSelfHealEditSession(){return!this.isAdvancedMode()&&super.shouldSelfHealEditSession()}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}applyDocumentChange(e,t,n=!1){const{renderRange:i}=this;if(this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),!this.isSimpleMode())this.computeApproximateSize(!0);else if(n&&i!==void 0&&this.fileDiff!==void 0){const o=this.virtualizer.getWindowSpecs(),s=this.computeRenderRangeFromWindow(this.fileDiff,this.top??0,o);s.bufferAfter!==i.bufferAfter&&this.updateBuffers(s)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}computeApproximateSize(e=!1,t=this.fileDiff){const n=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!n)return;const i=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,t==null){this.layoutDirty=!1;return}const{disableFileHeader:o=!1,collapsed:s=!1}=this.options,l=vi(this.metrics,o);if(this.height+=l,s){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight(t)+this.cache.measuredHeightDeltaTotal,n&&!i&&this.validateComputedHeight(t),this.layoutDirty=!1}getActiveEstimatedHeight(e=this.fileDiff){this.ensureEstimatedDiffHeights(e);const t=this.getDiffStyle()==="split"?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(t==null)throw new Error("VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height");return t}ensureEstimatedDiffHeights(e=this.fileDiff){if(e==null){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(this.cache.estimatedSplitHeight!=null&&this.cache.estimatedUnifiedHeight!=null)return;const{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:i=1}=this.options,{splitHeight:o,unifiedHeight:s}=HF({fileDiff:e,metrics:this.metrics,disableFileHeader:t,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:n,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,canHydratePartialDiff:Lm(e,this.options.loadDiffFiles!=null)});this.cache.estimatedSplitHeight=o,this.cache.estimatedUnifiedHeight=s}validateComputedHeight(e=this.fileDiff){if(this.fileContainer==null||e==null)return;const t=this.fileContainer.getBoundingClientRect();t.height!==this.height?console.log("VirtualizedFileDiff.computeApproximateSize: computed height doesnt match",{name:e.name,elementHeight:t.height,computedHeight:this.height}):console.log("VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT")}render({fileContainer:e,fileDiff:t,forceRender:n=!1,lineAnnotations:i,...o}={}){const s=Yg(o,"VirtualizedFileDiff.render"),l=s!=null,c=s?.oldFile,d=s?.newFile,f=l&&(!cw(c,this.deletionFile)||!cw(d,this.additionFile));let p=t??this.fileDiff;t==null&&l&&(f||this.fileDiff==null)&&(p=zo(s.oldFile,s.newFile,this.options.parseDiffOptions));const{forceRenderOverride:m,isSetup:g}=this;this.forceRenderOverride=void 0;const v=this.syncLineAnnotations(i);v&&this.resetLayoutCache({includeEstimatedHeights:!1});const x=t!=null&&t!==this.fileDiff,S=p!=null&&!ko(this.fileDiff,p),w=x||f;if(S&&this.resetLayoutCache({includeEstimatedHeights:!0}),e=this.getOrCreateFileContainer(e),p==null)return console.error("VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data"),!1;if(g)this.top??=this.getVirtualizedTop(),S&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.computeApproximateSize(!1,p));else{this.computeApproximateSize(!1,p);const I=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(I==null)throw new Error("VirtualizedFileDiff.render: simple virtualizer is not available");I.connect(e,this),this.isVisible=I.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!w||!g))return this.fileDiff=p,s!=null&&(this.deletionFile=c,this.additionFile=d),S&&(this.cachedHeaderHTML=void 0),this.renderPlaceholder(this.height);const _=this.virtualizer.getWindowSpecs(),C=this.top??0,T=this.computeRenderRangeFromWindow(p,C,_),D=super.render({fileDiff:p,fileContainer:e,renderRange:T,lineAnnotations:i,forceRender:(m??n)||v||S,...s,...o});return this.isSimpleMode()&&D&&this.getSimpleVirtualizer()?.requestHeightReconcile(this),D}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}shouldGuardRebuildScroll(){return!1}isSimpleMode(){return this.virtualizer.type==="simple"}isAdvancedMode(){return this.virtualizer.type==="advanced"}getVirtualizedTop(){return this.virtualizer.type==="advanced"?this.virtualizer.getLocalTopForInstance(this):this.fileContainer!=null?this.virtualizer.getOffsetInScrollContainer(this.fileContainer):0}getSimpleVirtualizer(){return this.virtualizer.type==="simple"?this.virtualizer:void 0}getAdvancedVirtualizer(){return this.virtualizer.type==="advanced"?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}getDiffStyle(){return this.options.diffStyle??"split"}getHunkSeparatorType(){return KF(this.options.hunkSeparators)}approximateLayoutCheckpoints(e=this.fileDiff){if(!this.layoutDirty&&this.cache.checkpoints.length>0||e==null||e.hunks.length===0||this.options.collapsed===!0)return;const{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:i=1}=this.options,o=e.hunks.length-1,s=Lm(e,this.options.loadDiffFiles!=null),l=this.getDiffStyle(),c=this.getHunkSeparatorType(),d=n?!0:this.hunksRenderer.getExpandedHunksMap(),f=GF(this.cache.heightDeltas);let p=vi(this.metrics,t)+this.cache.fileAnnotationHeight,m=0;const g=({rowCount:v,startLineIndex:x,preSeparatorHeight:S=0,postSeparatorHeight:w=0,metadataOffsets:_=[]})=>{if(v<=0)return;const C=m,T=m+v;let D=$F(C);for(;D<T;){const I=D-C,O=p+(I>0?S:0)+I*this.metrics.lineHeight+qF(_,I)*this.metrics.lineHeight+lw(f,x,x+I);this.cache.checkpoints.push({renderedLineIndex:D,lineIndex:x+I,top:O}),D+=Xg}p+=S+v*this.metrics.lineHeight+_.length*this.metrics.lineHeight+lw(f,x,x+v)+w,m=T};for(let v=0;v<e.hunks.length;v++){const x=e.hunks[v];if(x==null)throw new Error("VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index");const S=ar({isPartial:e.isPartial,rangeSize:x.collapsedBefore,expandedHunks:d,hunkIndex:v,collapsedContextThreshold:i}),w=S.collapsedLines>0?ul({type:c,metrics:this.metrics,hunkIndex:v,hunkSpecs:x.hunkSpecs})?.totalHeight??0:0;g({rowCount:S.fromStart,startLineIndex:(l==="split"?x.splitLineStart:x.unifiedLineStart)-S.rangeSize});let _=w;g({rowCount:S.fromEnd,startLineIndex:(l==="split"?x.splitLineStart:x.unifiedLineStart)-S.fromEnd,preSeparatorHeight:_}),S.fromEnd>0&&(_=0);const C=v===o?sr({fileDiff:e,hunkIndex:v,expandedHunks:d,collapsedContextThreshold:i,errorPrefix:"VirtualizedFileDiff"}):void 0,T=C!=null&&C.collapsedLines>0?Co({type:c,metrics:this.metrics})?.totalHeight??0:v===o&&s?Co({type:c,metrics:this.metrics})?.totalHeight??0:0,D=C!=null?C.fromStart+C.fromEnd:0,I=l==="split"?x.splitLineCount:x.unifiedLineCount,O=l==="split"?x.splitLineStart:x.unifiedLineStart;g({rowCount:I,startLineIndex:O,preSeparatorHeight:_,postSeparatorHeight:D===0?T:0,metadataOffsets:WF({diffStyle:l,hunk:x,rowCount:I})}),C!=null&&D>0&&g({rowCount:D,startLineIndex:O+I,postSeparatorHeight:T})}this.cache.totalLines=m}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,i;for(;t<=n;){const o=t+n>>1,s=this.cache.checkpoints[o];if(s==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");s.lineIndex<=e?(i=s,t=o+1):n=o-1}return i}getLayoutCheckpointBeforeTop(e,t){let n=0,i=this.cache.checkpoints.length-1,o=-1;for(;n<=i;){const s=n+i>>1,l=this.cache.checkpoints[s];if(l==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");l.top<=e?(o=s,n=s+1):i=s-1}if(t==null)return o>=0?this.cache.checkpoints[o]:void 0;for(let s=o;s>=0;s--){const l=this.cache.checkpoints[s];if(l==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");if(l.renderedLineIndex%t===0)return l}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(const c of e.hunks)n+=t==="split"?c.splitLineCount:c.unifiedLineCount;return n}const{expandUnchanged:i=!1,collapsedContextThreshold:o=1}=this.options,s=i?!0:this.hunksRenderer.getExpandedHunksMap();for(const[c,d]of e.hunks.entries()){const f=t==="split"?d.splitLineCount:d.unifiedLineCount;n+=f;const p=Math.max(d.collapsedBefore,0),{fromStart:m,fromEnd:g,renderAll:v}=ar({isPartial:e.isPartial,rangeSize:p,expandedHunks:s,hunkIndex:c,collapsedContextThreshold:o});p>0&&(n+=v?p:m+g)}const l=sr({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:s,collapsedContextThreshold:o,errorPrefix:"VirtualizedFileDiff"});return l!=null&&(n+=l.fromStart+l.fromEnd),n}getLayoutLineCount(e,t){const n=this.getExpandedLineCount(e,t),i=t==="split"?e.splitLineCount:e.unifiedLineCount;return Math.max(n,i,e.additionLines.length,e.deletionLines.length,this.cache.totalLines)}computeRenderRangeFromWindow(e,t,{top:n,bottom:i}){const{disableFileHeader:o=!1,expandUnchanged:s=!1,collapsedContextThreshold:l=1}=this.options,{hunkLineCount:c,lineHeight:d}=this.metrics,f=this.getDiffStyle(),p=this.getHunkSeparatorType(),m=Lm(e,this.options.loadDiffFiles!=null),g=this.height;let v=this.getLayoutLineCount(e,f);const x=vi(this.metrics,o),S=e.hunks.length>0?zd(this.metrics):0,{fileAnnotationHeight:w}=this.cache,_=x+w,C=Math.max(0,g-x-w-S),T=this.hasFileAnnotations(e),D=t+x,I=w>0&&T&&D<i&&D+w>n;if(t<n-g||t>i)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:g-x-S};if(v<=c||e.hunks.length===0)return{startingLine:0,totalLines:c,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(e),v=this.getLayoutLineCount(e,f);const O=Math.ceil(Math.max(i-n,0)/d),P=Math.ceil(O/c)*c+c,j=P/c,F=j,Q=[],G=(n+i)/2,B=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-P*d*2),c);let ee=t+(B?.top??_),Z=B?.renderedLineIndex??0,W,z,q;if(Lo({diff:e,diffStyle:f,startingLine:B?.renderedLineIndex??0,expandedHunks:s?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:l,callback:({hunkIndex:be,hunk:Ee,collapsedBefore:ge,collapsedAfter:We,deletionLine:Ge,additionLine:ot})=>{const je=ot!=null?ot.splitLineIndex:Ge.splitLineIndex,pe=ot!=null?ot.unifiedLineIndex:Ge.unifiedLineIndex,he=(ot?.noEOFCR??!1)||(Ge?.noEOFCR??!1),lt=be===e.hunks.length-1&&Ee!=null&&(f==="split"?je===Ee.splitLineStart+Ee.splitLineCount-1:pe===Ee.unifiedLineStart+Ee.unifiedLineCount-1),Ue=(ge>0?ul({type:p,metrics:this.metrics,hunkIndex:be,hunkSpecs:Ee?.hunkSpecs}):void 0)?.totalHeight??0;ee+=Ue;const Qe=Z%c===0,ft=Math.floor(Z/c);if(Qe&&(Q[ft]=ee-(t+_+Ue),q!=null)){if(q<=0)return!0;q--}const mt=this.getLineHeight(f==="split"?je:pe,he);if(ee>n-mt&&ee<i&&(W??=ft),z==null&&ee+mt>G&&(z=ft),q==null&&ee>=i&&Qe&&(q=F),Z++,ee+=mt,We>0||lt&&m){const ii=Co({type:p,metrics:this.metrics});ii!=null&&(ee<i&&ee+ii.totalHeight>n&&(W??=ft),z==null&&ee+ii.totalHeight>G&&(z=ft),ee+=ii.totalHeight)}return!1}}),W==null)if(I)W=0,z=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:g-x-S};z??=W;const te=Math.round(z-j/2),ce=Math.max(0,Math.ceil(v/c)-j),R=Math.max(0,Math.min(te,ce)),H=R*c,Y=te<0?P+te*c:P,N=Q[R]??0,se=H===0?0:w+N,de=R+Y/c,le=de<Q.length?C-Q[de]:C-(ee-t-_);return{startingLine:H,totalLines:Y,bufferBefore:se,bufferAfter:Math.max(0,le)}}};function FF(e){let t;for(const n of e){if(n==null)continue;const i=n.children[1];if(i instanceof HTMLElement)for(const o of i.children)o instanceof HTMLElement&&o.dataset.lineAnnotation===sA&&(t=Math.max(t??0,o.getBoundingClientRect().height))}return t}function GF(e){const t=Array.from(e).sort((s,l)=>s[0]-l[0]),n=[],i=[0];let o=0;for(const[s,l]of t)n.push(s),o+=l,i.push(o);return{lineIndexes:n,prefixTotals:i}}function lw({lineIndexes:e,prefixTotals:t},n,i){if(n>=i||e.length===0)return 0;const o=uw(e,n);return(t[uw(e,i)]??0)-(t[o]??0)}function uw(e,t){let n=0,i=e.length;for(;n<i;){const o=n+i>>1,s=e[o];if(s==null)throw new Error("VirtualizedFileDiff: invalid prefix index");s<t?n=o+1:i=o}return n}function $F(e){return Math.ceil(e/Xg)*Xg}function qF(e,t){let n=0;for(const i of e)i<t&&n++;return n}function WF({diffStyle:e,hunk:t,rowCount:n}){if(n<=0||!t.noEOFCRAdditions&&!t.noEOFCRDeletions)return[];const i=t.hunkContent.at(-1);if(i==null)return[];if(i.type==="context")return[n-1];const o=Math.max(i.deletions,i.additions),s=i.deletions+i.additions;if(e==="split")return o>0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[n-1]:[];const l=[],c=n-s;return i.deletions>0&&t.noEOFCRDeletions&&l.push(c+i.deletions-1),i.additions>0&&t.noEOFCRAdditions&&l.push(n-1),l}function YF(e,t){return(e.diffStyle??"split")!==(t.diffStyle??"split")||(e.overflow??"scroll")!==(t.overflow??"scroll")||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.diffIndicators??"bars")!==(t.diffIndicators??"bars")||(e.hunkSeparators??"line-info")!==(t.hunkSeparators??"line-info")||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)||e.unsafeCSS!==t.unsafeCSS}function XF(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??"line-info")!==(t.hunkSeparators??"line-info")||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function Lm(e,t){return e.isPartial&&t&&(e.type==="change"||e.type==="rename-changed")}function KF(e){return typeof e=="function"?"custom":e??"line-info"}function cw(e,t){return e==null||t==null?e==null&&t==null:Kn(e,t)}function QF(e,t){const[n,i]=e.split(",").map(Number);return t==="split"?i:n}function ZF({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function JF(e,t){const n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:e7(n,e.startContentIndex)}}function e7(e,t){let n=e.unifiedLineStart;for(let i=0;i<t;i++){const o=e.hunkContent[i];n+=o.type==="context"?o.lines:o.deletions+o.additions}return n}function dw(e){const t=[];for(const n of e){const i=Po.get(n);if(i==null)throw new Error(`getResolvedLanguages: ${n} is not resolved. Please resolve languages before calling getResolvedLanguages`);t.push(i)}return t}function fw(e){for(const t of Array.isArray(e)?e:[e])if(!Po.has(t))return!1;return!0}async function hw(e){const t=[],n=[];for(const i of e){if(i==="text"||i==="ansi")continue;const o=FT(i)??VT(i);"then"in o?n.push(o):t.push(o)}return n.length>0&&await Promise.all(n).then(i=>{for(const o of i){if(o==null)throw new Error("resolvedLanguages: unable to resolve language");t.push(o)}}),t}function pw(e){return ei.getResolvedThemes(e)}async function mw(e){for(const n of e)QT(n);const t=await ei.resolveThemes(e);for(let n=0;n<e.length;n++)ZT(e[n],t[n]);return t}function PA(e){const t=M.useRef(e);return M.useInsertionEffect(()=>{t.current=e}),M.useCallback((...n)=>t.current(...n),[])}const t7=M.createContext(void 0);function HA(){return M.useContext(t7)}const jA={position:"absolute",top:0,bottom:0,textAlign:"center",whiteSpace:"normal",touchAction:"none"},n7={display:"contents"};function Bd(){return null}function i7({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:i,renderHeaderFilenameSuffix:o,renderHeaderMetadata:s,renderAnnotation:l,renderGutterUtility:c,renderMergeConflictUtility:d,lineAnnotations:f,getHoveredLine:p,getInstance:m}){const g=n?.(e),v=i?.(e),x=o?.(e),S=s?.(e);return k.jsxs(k.Fragment,{children:[g!=null?k.jsx("div",{slot:Gl,children:g}):k.jsxs(k.Fragment,{children:[v!=null&&k.jsx("div",{slot:"header-prefix",children:v}),x!=null&&k.jsx("div",{slot:"header-filename-suffix",children:x}),S!=null&&k.jsx("div",{slot:"header-metadata",children:S})]}),l!=null&&f?.map((w,_)=>k.jsx("div",{slot:ti(w),children:l(w)},_)),t!=null&&d!=null&&m!=null&&t.map(w=>{if(w==null)return;const _=r7(w,e);return k.jsx("div",{slot:_,style:n7,children:d(w,m)},_)}),c!=null&&k.jsx("div",{slot:"gutter-utility-slot",style:jA,children:c(p)})]})}function r7(e,t){const n=JF(e,t);return n!=null?ZF({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex}):void 0}function o7({file:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:i,renderHeaderMetadata:o,renderAnnotation:s,lineAnnotations:l,renderGutterUtility:c,getHoveredLine:d}){const f=t?.(e),p=n?.(e),m=i?.(e),g=o?.(e);return k.jsxs(k.Fragment,{children:[f!=null?k.jsx("div",{slot:Gl,children:f}):k.jsxs(k.Fragment,{children:[p!=null&&k.jsx("div",{slot:"header-prefix",children:p}),m!=null&&k.jsx("div",{slot:"header-filename-suffix",children:m}),g!=null&&k.jsx("div",{slot:"header-metadata",children:g})]}),s!=null&&l?.map((v,x)=>k.jsx("div",{slot:ti(v),children:s(v)},x)),c!=null&&k.jsx("div",{slot:"gutter-utility-slot",style:jA,children:c(d)})]})}var cl={exports:{}},a7=cl.exports,gw;function s7(){return gw||(gw=1,(function(e,t){(function(n,i){i(t)})(a7,function(n){const i=Symbol("newer"),o=Symbol("older");class s{constructor(m,g){typeof m!="number"&&(g=m,m=0),this.size=0,this.limit=m,this.oldest=this.newest=void 0,this._keymap=new Map,g&&(this.assign(g),m<1&&(this.limit=this.size))}_markEntryAsUsed(m){m!==this.newest&&(m[i]&&(m===this.oldest&&(this.oldest=m[i]),m[i][o]=m[o]),m[o]&&(m[o][i]=m[i]),m[i]=void 0,m[o]=this.newest,this.newest&&(this.newest[i]=m),this.newest=m)}assign(m){let g,v=this.limit||Number.MAX_VALUE;this._keymap.clear();let x=m[Symbol.iterator]();for(let S=x.next();!S.done;S=x.next()){let w=new l(S.value[0],S.value[1]);if(this._keymap.set(w.key,w),g?(g[i]=w,w[o]=g):this.oldest=w,g=w,v--==0)throw new Error("overflow")}this.newest=g,this.size=this._keymap.size}get(m){var g=this._keymap.get(m);return g?(this._markEntryAsUsed(g),g.value):void 0}set(m,g){var v=this._keymap.get(m);return v?(v.value=g,this._markEntryAsUsed(v),this):(this._keymap.set(m,v=new l(m,g)),this.newest?(this.newest[i]=v,v[o]=this.newest):this.oldest=v,this.newest=v,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var m=this.oldest;if(m)return this.oldest[i]?(this.oldest=this.oldest[i],this.oldest[o]=void 0):(this.oldest=void 0,this.newest=void 0),m[i]=m[o]=void 0,this._keymap.delete(m.key),--this.size,[m.key,m.value]}find(m){let g=this._keymap.get(m);return g?g.value:void 0}has(m){return this._keymap.has(m)}delete(m){var g=this._keymap.get(m);return g?(this._keymap.delete(g.key),g[i]&&g[o]?(g[o][i]=g[i],g[i][o]=g[o]):g[i]?(g[i][o]=void 0,this.oldest=g[i]):g[o]?(g[o][i]=void 0,this.newest=g[o]):this.oldest=this.newest=void 0,this.size--,g.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new d(this.oldest)}values(){return new f(this.oldest)}entries(){return this}[Symbol.iterator](){return new c(this.oldest)}forEach(m,g){typeof g!="object"&&(g=this);let v=this.oldest;for(;v;)m.call(g,v.value,v.key,this),v=v[i]}toJSON(){for(var m=new Array(this.size),g=0,v=this.oldest;v;)m[g++]={key:v.key,value:v.value},v=v[i];return m}toString(){for(var m="",g=this.oldest;g;)m+=String(g.key)+":"+g.value,g=g[i],g&&(m+=" < ");return m}}n.LRUMap=s;function l(p,m){this.key=p,this.value=m,this[i]=void 0,this[o]=void 0}function c(p){this.entry=p}c.prototype[Symbol.iterator]=function(){return this},c.prototype.next=function(){let p=this.entry;return p?(this.entry=p[i],{done:!1,value:[p.key,p.value]}):{done:!0,value:void 0}};function d(p){this.entry=p}d.prototype[Symbol.iterator]=function(){return this},d.prototype.next=function(){let p=this.entry;return p?(this.entry=p[i],{done:!1,value:p.key}):{done:!0,value:void 0}};function f(p){this.entry=p}f.prototype[Symbol.iterator]=function(){return this},f.prototype.next=function(){let p=this.entry;return p?(this.entry=p[i],{done:!1,value:p.value}):{done:!0,value:void 0}}})})(cl,cl.exports)),cl.exports}var l7=s7();const yw=Vd(l7),Fc=Symbol("IGNORE_RESPONSE");var Gc=class extends Error{constructor(){super("WorkerPoolManager: operation canceled because the pool terminated")}},Rm=class extends Error{constructor(){super("WorkerPoolManager: operation canceled before the task completed")}},u7=class{options;highlighter;preferredHighlighter;renderOptions;renderOptionsRequestVersion=0;renderOptionsVersion=0;initialized=!1;workers=[];queuedTasks=[];queuedTaskByInstance=new Map;taskByHighlightKey=new Map;activeTaskById=new Map;activeRequestByInstance=new Map;nextRequestId=0;themeSubscribers=new Set;workersFailed=!1;statSubscribers=new Set;fileCache;diffCache;_queuedBroadcast;lifecycleGeneration=0;constructor(e,{langs:t,theme:n=bt,useTokenTransformer:i=!1,lineDiffType:o="word-alt",maxLineDiffLength:s=1e3,tokenizeMaxLineLength:l=1e3,preferredHighlighter:c="shiki-js"}){this.options=e,this.preferredHighlighter=c,this.renderOptions={theme:n,useTokenTransformer:i,lineDiffType:o,maxLineDiffLength:s,tokenizeMaxLineLength:l},this.fileCache=new yw.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new yw.LRUMap(e.totalASTLRUCacheSize??100),this.queueInitialization(t)}isWorkingPool(){return!this.workersFailed}getFileResultCache(e){return e.cacheKey!=null?this.fileCache.get(e.cacheKey):void 0}getDiffResultCache(e){return e.cacheKey!=null?this.diffCache.get(e.cacheKey):void 0}inspectCaches(){const{fileCache:e,diffCache:t}=this;return{fileCache:e,diffCache:t}}evictFileFromCache(e){try{return this.fileCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}evictDiffFromCache(e){try{return this.diffCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}async setRenderOptions({theme:e=this.renderOptions.theme??bt,useTokenTransformer:t=this.renderOptions.useTokenTransformer??!1,lineDiffType:n=this.renderOptions.lineDiffType??"word-alt",maxLineDiffLength:i=this.renderOptions.maxLineDiffLength??1e3,tokenizeMaxLineLength:o=this.renderOptions.tokenizeMaxLineLength??1e3}){const{lifecycleGeneration:s}=this,l=++this.renderOptionsRequestVersion,c=()=>this.isCurrentLifecycle(s)&&this.renderOptionsRequestVersion===l;try{const d={theme:e,useTokenTransformer:t,lineDiffType:n,maxLineDiffLength:i,tokenizeMaxLineLength:o};if(this.isInitialized()||await this.initialize(),!c()||gi(d,this.renderOptions))return;const f=Dl(e);let p=[];if(ns(d.theme,this.renderOptions.theme)||(zg(f)?p=pw(f):p=await mw(f)),!c())return;if(this.highlighter!=null)Ng(p,this.highlighter);else{const g=await Id({themes:f,langs:["text"],preferredHighlighter:this.preferredHighlighter});if(!c())return;this.highlighter=g}const m=this.setRenderOptionsOnWorkers(d,p);this.renderOptions=d,this.renderOptionsVersion++,this.diffCache.clear(),this.fileCache.clear(),this.invalidateRenderTasks();for(const g of this.themeSubscribers)g.onThemeChange();await m}catch(d){if(d instanceof Gc||!c())return;throw d}}getPreferredHighlighter(){return this.preferredHighlighter}getFileRenderOptions(){const{tokenizeMaxLineLength:e,theme:t,useTokenTransformer:n}=this.renderOptions;return{theme:t,useTokenTransformer:n,tokenizeMaxLineLength:e}}getDiffRenderOptions(){return{...this.renderOptions}}async setRenderOptionsOnWorkers(e,t){if(this.workersFailed)return;this.isInitialized()||await this.initialize();const n=[];for(const i of this.workers){if(!i.initialized)throw console.log({managedWorker:i}),new Error("setRenderOptionsOnWorkers: Somehow we have an uninitialized worker");n.push(new Promise((o,s)=>{const l=this.generateRequestId(),c={type:"set-render-options",id:l,request:{type:"set-render-options",id:l,renderOptions:e,resolvedThemes:t},resolve:o,reject:s,requestStart:Date.now()};this.activeTaskById.set(l,c),i.pendingSetupRequestId=l,i.worker.postMessage(c.request)}))}await Promise.all(n)}subscribeToThemeChanges(e){return this.themeSubscribers.add(e),this.queueBroadcastStateChanges(),()=>{this.unsubscribeToThemeChanges(e),this.queueBroadcastStateChanges()}}unsubscribeToThemeChanges(e){this.themeSubscribers.delete(e),this.queueBroadcastStateChanges()}subscribeToStatChanges(e){return this.statSubscribers.add(e),e(this.getStats()),()=>{this.statSubscribers.delete(e)}}queueBroadcastStateChanges(){this._queuedBroadcast==null&&(this._queuedBroadcast=requestAnimationFrame(this._broadcastStateChanges))}_broadcastStateChanges=()=>{this._queuedBroadcast!=null&&(cancelAnimationFrame(this._queuedBroadcast),this._queuedBroadcast=void 0);const e=this.getStats();for(const t of this.statSubscribers)t(e)};cleanUpTasks(e){this.detachInstanceFromQueuedTasks(e);const t=this.activeRequestByInstance.get(e);if(t!=null){const n=this.activeTaskById.get(t);Hr(n)?(this.detachInstanceFromRenderTask(n,e),!n.primeCache&&n.instances.size===0&&this.removeActiveTask(n)):this.activeTaskById.delete(t)}this.activeRequestByInstance.delete(e),this.queueBroadcastStateChanges()}isInitialized(){return this.initialized===!0}async initialize(e=[]){if(this.initialized!==!0)if(this.initialized===!1){const{lifecycleGeneration:t}=this;this.initialized=new Promise((n,i)=>{(async()=>{try{const o=Dl(this.renderOptions.theme);let s=[];if(zg(o)?s=pw(o):s=await mw(o),!this.isCurrentLifecycle(t)){n();return}let l=[];if(fw(e)?l=dw(e):l=await hw(e),!this.isCurrentLifecycle(t)){n();return}const[c]=await Promise.all([Id({themes:o,langs:["text",...e],preferredHighlighter:this.preferredHighlighter}),this.initializeWorkers(s,l)]);if(!this.isCurrentLifecycle(t)){this.terminateWorkers(),n();return}this.highlighter=c,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),this.queueBroadcastStateChanges(),n()}catch(o){if(o instanceof Gc||!this.isCurrentLifecycle(t)){n();return}this.initialized=!1,this.workersFailed=!0;for(const s of this.queuedTasks)this.rejectRenderTaskCallbacks(s,Om(o));this.queueBroadcastStateChanges(),i(o)}})()}),this.queueBroadcastStateChanges()}else return this.initialized}async initializeWorkers(e,t){this.workersFailed=!1;const n=[],i=void 0;this.workers.length>0&&this.terminateWorkers();for(let o=0;o<(this.options.poolSize??8);o++){const s=this.options.workerFactory(),l={worker:s,requestId:void 0,pendingSetupRequestId:void 0,initialized:!1,langs:new Set(["text",...t.map(({name:c})=>c)]),customExtensionsVersion:0};s.addEventListener("message",c=>{this.handleWorkerMessage(l,c.data)}),s.addEventListener("error",c=>console.error("Worker error:",c,l)),this.workers.push(l),n.push(new Promise((c,d)=>{const f=this.generateRequestId(),p={type:"initialize",id:f,request:{type:"initialize",id:f,renderOptions:this.renderOptions,preferredHighlighter:this.preferredHighlighter,resolvedThemes:e,resolvedLanguages:t,customExtensionsVersion:void 0,customExtensionMap:i},resolve(){l.initialized=!0,c()},reject:d,requestStart:Date.now()};this.activeTaskById.set(f,p),this.executeTask(l,p)}))}await Promise.all(n)}drainQueue=()=>{if(this._queuedDrain=void 0,!(this.initialized!==!0||this.queuedTasks.length===0)){for(let e=0;e<this.queuedTasks.length;){const t=this.queuedTasks[e];if(this.hasActiveRequest(t)){e++;continue}const n=vw(t),i=this.getAvailableWorker(n);if(i==null)break;this.queuedTasks.splice(e,1),this.assignWorkerToTask(t,i),this.resolveLanguagesAndExecuteTask(i,t,n)}this.queueBroadcastStateChanges()}};highlightFileAST(e,t){const n=this.getFileResultCache(t);Ml(t)||n!=null&&Zi(n.options,this.getFileRenderOptions())||this.hasMatchingFileInstanceTask(e,t)||this.submitTask(e,{type:"file",file:t})}primeFileHighlightCache(e){if(!this.isWorkingPool())return Promise.reject(new Error("WorkerPoolManager.primeFileHighlightCache: worker pool is not working"));const t=this.getOrCreateFileHighlightCacheTask(e);return t!=null?this.createRenderTaskCallbacks(t):Promise.resolve()}getOrCreateFileHighlightCacheTask(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeFileHighlightCache: priming highlight cache requires file.cacheKey; skipping "${e.name}".`);return}const t=this.getFileResultCache(e),n=this.getFileHighlightKey(e);if(n==null||Ml(e)||t!=null&&Zi(t.options,this.getFileRenderOptions()))return;const i=this.getTaskByHighlightKey(n);if(i!=null)return i.primeCache=!0,i.type==="file"?i:void 0;{const o=this.submitCacheTask({type:"file",file:e},n);return o.type==="file"?o:void 0}}getPlainFileAST(e,t,n,i){if(this.highlighter==null){this.queueInitialization();return}return aA(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,lines:i})}highlightDiffAST(e,t){const n=this.getDiffResultCache(t);Xa(t)||n!=null&&gi(n.options,this.getDiffRenderOptions())||this.hasMatchingDiffInstanceTask(e,t)||this.submitTask(e,{type:"diff",diff:t})}primeDiffHighlightCache(e){if(!this.isWorkingPool())return Promise.reject(new Error("WorkerPoolManager.primeDiffHighlightCache: worker pool is not working"));const t=this.getOrCreateDiffHighlightCacheTask(e);return t!=null?this.createRenderTaskCallbacks(t):Promise.resolve()}getOrCreateDiffHighlightCacheTask(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeDiffHighlightCache: priming highlight cache requires diff.cacheKey; skipping "${e.prevName??e.name}" -> "${e.name}".`);return}const t=this.getDiffResultCache(e),n=this.getDiffHighlightKey(e);if(n==null||Xa(e)||t!=null&&gi(t.options,this.getDiffRenderOptions()))return;const i=this.getTaskByHighlightKey(n);if(i!=null)return i.primeCache=!0,i.type==="diff"?i:void 0;{const o=this.submitCacheTask({type:"diff",diff:e},n);return o.type==="diff"?o:void 0}}getPlainDiffAST(e,t,n,i,o){return this.highlighter!=null?OA(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,expandedHunks:i,collapsedContextThreshold:o}):void 0}terminate(){this.lifecycleGeneration++,this.cancelActiveWorkerTasks(),this.terminateWorkers();const e=new Gc;for(const t of this.queuedTasks)this.rejectRenderTaskCallbacks(t,e);this.fileCache.clear(),this.diffCache.clear(),this.activeRequestByInstance.clear(),this.queuedTasks.length=0,this.queuedTaskByInstance.clear(),this.taskByHighlightKey.clear(),this.activeTaskById.clear(),this.highlighter=void 0,this.initialized=!1,this.workersFailed=!1,this.queueBroadcastStateChanges()}isCurrentLifecycle(e){return this.lifecycleGeneration===e}queueInitialization(e){this.initialize(e).catch(t=>{console.error(t)})}cancelActiveWorkerTasks(){const e=new Gc;for(const t of this.activeTaskById.values())"reject"in t?t.reject(e):Hr(t)&&this.rejectRenderTaskCallbacks(t,e)}terminateWorkers(){for(const e of this.workers)e.worker.terminate();this.workers.length=0}getStats(){return{managerState:this.initialized===!1?"waiting":this.initialized!==!0?"initializing":"initialized",totalWorkers:this.workers.length,workersFailed:this.workersFailed,busyWorkers:this.workers.filter(e=>e.requestId!=null||e.pendingSetupRequestId!=null).length,queuedTasks:this.queuedTasks.length,activeTasks:this.activeTaskById.size,themeSubscribers:this.themeSubscribers.size,fileCacheSize:this.fileCache.size,diffCacheSize:this.diffCache.size}}submitTask(e,t){this.initialized===!1&&this.queueInitialization();const n=this.getHighlightKeyForRequest(t),i=n!=null?this.getTaskByHighlightKey(n):void 0;if(i!=null){this.detachInstanceFromQueuedTasks(e,i),this.addInstanceToTask(i,e),this.queueBroadcastStateChanges();return}this.detachInstanceFromQueuedTasks(e);const o=this.generateRequestId(),s=Date.now(),{renderOptionsVersion:l}=this,c=(()=>{switch(t.type){case"file":return{type:"file",id:o,request:{...t,id:o},instances:new Set([e]),primeCache:!1,highlightKey:n,callbacks:new Set,renderOptionsVersion:l,requestStart:s};case"diff":return{type:"diff",id:o,request:{...t,id:o},instances:new Set([e]),primeCache:!1,highlightKey:n,callbacks:new Set,renderOptionsVersion:l,requestStart:s}}})();this.enqueueRenderTask(c,e)}submitCacheTask(e,t){this.initialized===!1&&this.queueInitialization();const n=this.generateRequestId(),i=Date.now(),{renderOptionsVersion:o}=this,s=(()=>{switch(e.type){case"file":return{type:"file",id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,callbacks:new Set,renderOptionsVersion:o,requestStart:i};case"diff":return{type:"diff",id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,callbacks:new Set,renderOptionsVersion:o,requestStart:i}}})();return this.enqueueRenderTask(s),s}enqueueRenderTask(e,t){this.queuedTasks.push(e),t!=null&&this.queuedTaskByInstance.set(t,e),e.highlightKey!=null&&this.taskByHighlightKey.set(e.highlightKey,e),this.queueDrain()}async resolveLanguagesAndExecuteTask(e,t,n){try{const i=n.filter(o=>!e.langs.has(o));if(i.length>0&&(fw(i)?t.request.resolvedLanguages=dw(i):t.request.resolvedLanguages=await hw(i)),!this.activeTaskById.has(t.id)){e.requestId===t.id&&(this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain());return}this.executeTask(e,t)}catch(i){this.rejectRenderTaskCallbacks(t,Om(i)),this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}}handleWorkerMessage(e,t){const n=this.activeTaskById.get(t.id);try{if(n==null)throw Fc;if(t.type==="error"){const i=new Error(t.error);if(t.stack&&(i.stack=t.stack),"reject"in n)n.reject(i);else if(Hr(n))this.notifyHighlightError(n,i),this.rejectRenderTaskCallbacks(n,i);else throw new Error("handleWorkerMessage: unknown task type");throw i}else switch(t.requestType){case"initialize":if(n.type!=="initialize")throw new Error("handleWorkerMessage: task/response dont match");this.syncCustomExtensionVersion(e,n.request),n.resolve();break;case"set-render-options":if(n.type!=="set-render-options")throw new Error("handleWorkerMessage: task/response dont match");n.resolve();break;case"file":{if(n.type!=="file")throw new Error("handleWorkerMessage: task/response dont match");const{result:i,options:o}=t;if(!this.isCurrentRenderTask(n)||!Zi(o,this.getFileRenderOptions()))throw Fc;const{request:s}=n;this.syncCustomExtensionVersion(e,s),n.cacheKeyAtDispatch!=null&&this.fileCache.set(n.cacheKeyAtDispatch,{result:i,options:o}),this.resolveRenderTaskCallbacks(n),this.notifyFileInstances(n,i,o);break}case"diff":{if(n.type!=="diff")throw new Error("handleWorkerMessage: task/response dont match");const{result:i,options:o}=t;if(!this.isCurrentRenderTask(n)||!gi(o,this.getDiffRenderOptions()))throw Fc;const{request:s}=n;this.syncCustomExtensionVersion(e,s),n.cacheKeyAtDispatch!=null&&this.diffCache.set(n.cacheKeyAtDispatch,{result:i,options:o}),this.resolveRenderTaskCallbacks(n),this.notifyDiffInstances(n,i,o);break}}}catch(i){i!==Fc&&console.error(i,n,t)}this.cleanWorkerAndTask(e,n,t.id),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}_queuedDrain;queueDrain(){this._queuedDrain==null&&(this._queuedDrain=Promise.resolve().then(this.drainQueue),this.queueBroadcastStateChanges())}assignWorkerToTask(e,t){t.requestId=e.id,Hr(e)&&(this.clearQueuedInstanceRequests(e),this.trackInstanceRequests(e)),this.activeTaskById.set(e.id,e)}cleanWorkerAndTask(e,t,n=t?.id){e.requestId===n&&(e.requestId=void 0),e.pendingSetupRequestId===n&&(e.pendingSetupRequestId=void 0),t!=null&&(Hr(t)&&(this.rejectRenderTaskCallbacks(t,new Rm),this.clearInstanceRequests(t),this.clearHighlightKey(t)),this.activeTaskById.delete(t.id))}executeTask(e,t){c7(t.request)&&this.maybeAttachCustomExtensions(e,t.request),this.activeTaskById.has(t.id)||this.assignWorkerToTask(t,e);for(const n of vw(t))e.langs.add(n);try{t.type==="file"?t.cacheKeyAtDispatch=t.request.file.cacheKey:t.type==="diff"&&(t.cacheKeyAtDispatch=t.request.diff.cacheKey),e.worker.postMessage(t.request)}catch(n){console.error("Failed to post message to worker:",n),Hr(t)?(this.notifyHighlightError(t,n),this.rejectRenderTaskCallbacks(t,Om(n))):"reject"in t&&t.reject(n),this.cleanWorkerAndTask(e,t),this.queuedTasks.length>0&&this.queueDrain()}this.queueBroadcastStateChanges()}maybeAttachCustomExtensions(e,t){if(t.customExtensionsVersion!=null)return;const n=BU();e.customExtensionsVersion>=n||(t.customExtensionsVersion=n,t.customExtensionMap=UU())}syncCustomExtensionVersion(e,t){t.customExtensionsVersion!=null&&(e.customExtensionsVersion=t.customExtensionsVersion)}getAvailableWorker(e){let t;for(const n of this.workers){if(n.requestId!=null||n.pendingSetupRequestId!=null||!n.initialized)continue;if(t=n,e.length===0)break;let i=!0;for(const o of e)if(!n.langs.has(o)){i=!1;break}if(i)break}return t}getFileHighlightKey(e){if(e.cacheKey!=null)return`file:${e.cacheKey}:${this.renderOptionsVersion}`}getDiffHighlightKey(e){if(e.cacheKey!=null)return`diff:${e.cacheKey}:${this.renderOptionsVersion}`}getHighlightKeyForRequest(e){switch(e.type){case"file":return this.getFileHighlightKey(e.file);case"diff":return this.getDiffHighlightKey(e.diff)}}hasActiveRequest(e){for(const t of ol(e))if(this.activeRequestByInstance.has(t))return!0;return!1}addInstanceToTask(e,t){e.type,e.instances.add(t),this.activeTaskById.has(e.id)?this.activeRequestByInstance.set(t,e.id):this.queuedTaskByInstance.set(t,e)}detachInstanceFromQueuedTasks(e,t){const n=this.queuedTaskByInstance.get(e);n==null||n===t||(this.queuedTaskByInstance.delete(e),this.detachInstanceFromRenderTask(n,e),!n.primeCache&&n.instances.size===0&&this.removeQueuedTask(n))}detachInstanceFromRenderTask(e,t){e.type,e.instances.delete(t)}removeQueuedTask(e){const t=this.queuedTasks.indexOf(e);t!==-1&&this.queuedTasks.splice(t,1),this.rejectRenderTaskCallbacks(e,new Rm),this.clearQueuedInstanceRequests(e),this.clearHighlightKey(e)}removeActiveTask(e){this.rejectRenderTaskCallbacks(e,new Rm),this.clearInstanceRequests(e),this.clearHighlightKey(e),this.activeTaskById.delete(e.id)}createRenderTaskCallbacks(e){return new Promise((t,n)=>{e.callbacks.add({resolve:t,reject:n})})}resolveRenderTaskCallbacks(e){for(const t of e.callbacks)t.resolve();e.callbacks.clear()}rejectRenderTaskCallbacks(e,t){for(const n of e.callbacks)n.reject(t);e.callbacks.clear()}invalidateRenderTasks(){for(let e=this.queuedTasks.length-1;e>=0;e--){const t=this.queuedTasks[e];t.renderOptionsVersion!==this.renderOptionsVersion&&this.removeQueuedTask(t)}for(const e of Array.from(this.activeTaskById.values()))Hr(e)&&e.renderOptionsVersion!==this.renderOptionsVersion&&this.removeActiveTask(e)}clearQueuedInstanceRequests(e){for(const t of ol(e))this.queuedTaskByInstance.get(t)===e&&this.queuedTaskByInstance.delete(t)}clearHighlightKey(e){e.highlightKey!=null&&this.taskByHighlightKey.get(e.highlightKey)===e&&this.taskByHighlightKey.delete(e.highlightKey)}trackInstanceRequests(e){for(const t of ol(e))this.activeRequestByInstance.set(t,e.id)}clearInstanceRequests(e){for(const t of ol(e))this.activeRequestByInstance.get(t)===e.id&&this.activeRequestByInstance.delete(t)}notifyFileInstances(e,t,n){for(const i of e.instances)this.activeRequestByInstance.get(i)===e.id&&i.onHighlightSuccess(e.request.file,t,n)}notifyDiffInstances(e,t,n){for(const i of e.instances)this.activeRequestByInstance.get(i)===e.id&&i.onHighlightSuccess(e.request.diff,t,n)}notifyHighlightError(e,t){for(const n of ol(e))this.activeRequestByInstance.get(n)===e.id&&n.onHighlightError(t)}hasMatchingFileInstanceTask(e,t){for(const n of this.iterateRenderTasks())if(n.type==="file"&&this.isCurrentRenderTask(n)&&n.instances.has(e)&&Kn(t,n.request.file))return!0;return!1}hasMatchingDiffInstanceTask(e,t){for(const n of this.iterateRenderTasks())if(n.type==="diff"&&this.isCurrentRenderTask(n)&&n.instances.has(e)&&ko(n.request.diff,t))return!0;return!1}getTaskByHighlightKey(e){const t=this.taskByHighlightKey.get(e);return t!=null&&this.isCurrentRenderTask(t)?t:void 0}isCurrentRenderTask(e){return e.renderOptionsVersion===this.renderOptionsVersion}*iterateRenderTasks(){for(const e of this.queuedTasks)yield e;for(const e of this.activeTaskById.values())Hr(e)&&(yield e)}generateRequestId(){return`req_${++this.nextRequestId}`}};function c7(e){return e.type==="initialize"||e.type==="file"||e.type==="diff"}function vw(e){const t=new Set;if(e.type==="initialize"||e.type==="set-render-options")return[];switch(e.type){case"file":t.add(e.request.file.lang??rn(e.request.file.name));break;case"diff":t.add(e.request.diff.lang??rn(e.request.diff.name)),t.add(e.request.diff.lang??rn(e.request.diff.prevName??"-"));break}return t.delete("text"),Array.from(t)}function Hr(e){return e?.type==="file"||e?.type==="diff"}function ol(e){return e.instances}function Om(e){return e instanceof Error?e:new Error(String(e))}let xl;function d7({poolOptions:e,highlighterOptions:t}){return xl??=new u7(e,t),xl}function f7(){xl!=null&&(xl.terminate(),xl=void 0)}const Zy=M.createContext(void 0);let Dm=0;function h7({children:e,poolOptions:t,highlighterOptions:n}){const[i]=M.useState(()=>{if(!(typeof window>"u"))return d7({poolOptions:t,highlighterOptions:n})});return M.useInsertionEffect(()=>{if(i!=null)return Dm++,()=>{Dm--}},[i]),M.useEffect(()=>()=>{Dm===0&&f7()},[]),k.jsx(Zy.Provider,{value:i,children:e})}function BA(e,t){return typeof window>"u"&&t!=null?k.jsxs(k.Fragment,{children:[k.jsx("template",{shadowrootmode:"open",dangerouslySetInnerHTML:{__html:t}}),e]}):k.jsx(k.Fragment,{children:e})}const p7=M.createContext(void 0);function UA(){return M.useContext(p7)}const bw=typeof window>"u"?M.useEffect:M.useLayoutEffect;function m7({file:e,options:t,editorOptions:n,lineAnnotations:i,selectedLines:o,prerenderedHTML:s,metrics:l,hasGutterRenderUtility:c,hasCustomHeader:d,disableWorkerPool:f,edit:p}){const m=UA(),g=o!==void 0,v=M.useContext(Zy),x=HA(),S=M.useRef(null),w=PA(_=>{if(_!=null){if(S.current!=null)throw new Error("File: An instance should not already exist when a node is created");m!=null?S.current=new CV(Mm({controlledSelection:g,hasCustomHeader:d,hasGutterRenderUtility:c,options:t}),m,l,f?void 0:v,!0):S.current=new EA(Mm({controlledSelection:g,hasCustomHeader:d,hasGutterRenderUtility:c,options:t}),f?void 0:v,!0),S.current.hydrate({file:e,fileContainer:_,lineAnnotations:i,prerenderedHTML:s})}else{if(S.current==null)throw new Error("File: A File instance should exist when unmounting");S.current.cleanUp(),S.current=null}});return bw(()=>{if(S.current==null)return;const _=Mm({controlledSelection:g,hasCustomHeader:d,hasGutterRenderUtility:c,options:t}),C=_!==void 0&&!tf(S.current.options,_);S.current.setOptions(_),S.current.render({file:e,lineAnnotations:i,forceRender:C}),o!==void 0&&S.current.setSelectedLines(o)}),bw(()=>{if(p&&S.current!=null){if(x===void 0)throw new Error("File: EditContext is not attached");const _=x(n??{});if(_==null)throw new Error("File: EditProvider.createEditor must return an editor instance");try{return _.edit(S.current)}catch(C){throw _.cleanUp(),C}}},[p]),{ref:w,getHoveredLine:M.useCallback(()=>S.current?.getHoveredLine(),[])}}function Mm({options:e,controlledSelection:t,hasCustomHeader:n,hasGutterRenderUtility:i}){return t||i||n?{...e,controlledSelection:t,renderCustomHeader:n?Bd:e?.renderCustomHeader,renderGutterUtility:i?Bd:e?.renderGutterUtility}:e}function g7({file:e,lineAnnotations:t,selectedLines:n,options:i,editorOptions:o,metrics:s,className:l,style:c,renderAnnotation:d,renderCustomHeader:f,renderHeaderPrefix:p,renderHeaderFilenameSuffix:m,renderHeaderMetadata:g,prerenderedHTML:v,renderGutterUtility:x,disableWorkerPool:S=!1,edit:w=!1}){const{ref:_,getHoveredLine:C}=m7({file:e,options:i,editorOptions:o,metrics:s,lineAnnotations:t,selectedLines:n,prerenderedHTML:v,hasGutterRenderUtility:x!=null,hasCustomHeader:f!=null,disableWorkerPool:S,edit:w});return k.jsx(Ny,{ref:_,className:l,style:c,children:BA(o7({file:e,renderAnnotation:d,renderCustomHeader:f,renderHeaderPrefix:p,renderHeaderFilenameSuffix:m,renderHeaderMetadata:g,renderGutterUtility:x,lineAnnotations:t,getHoveredLine:C}),v)})}const xw=typeof window>"u"?M.useEffect:M.useLayoutEffect;function y7({fileDiff:e,options:t,editorOptions:n,lineAnnotations:i,selectedLines:o,prerenderedHTML:s,metrics:l,hasGutterRenderUtility:c,hasCustomHeader:d,disableWorkerPool:f,edit:p}){const m=UA(),g=o!==void 0,v=M.useContext(Zy),x=HA(),S=M.useRef(null),w=PA(_=>{if(_!=null){if(S.current!=null)throw new Error("useFileDiffInstance: An instance should not already exist when a node is created");m!=null?S.current=new VF(Im({controlledSelection:g,hasCustomHeader:d,hasGutterRenderUtility:c,options:t}),m,l,f?void 0:v,!0):S.current=new zA(Im({controlledSelection:g,hasCustomHeader:d,hasGutterRenderUtility:c,options:t}),f?void 0:v,!0),S.current.hydrate({fileDiff:e,fileContainer:_,lineAnnotations:i,prerenderedHTML:s})}else{if(S.current==null)throw new Error("useFileDiffInstance: A FileDiff instance should exist when unmounting");S.current.cleanUp(),S.current=null}});return xw(()=>{const{current:_}=S;if(_==null)return;const C=Im({controlledSelection:g,hasCustomHeader:d,hasGutterRenderUtility:c,options:t}),T=C!==void 0&&!tf(_.options,C);_.setOptions(C),_.render({forceRender:T,fileDiff:e,lineAnnotations:i}),o!==void 0&&_.setSelectedLines(o)}),xw(()=>{if(p&&S.current!=null){if(x===void 0)throw new Error("FileDiff: EditContext is not attached");const _=x(n??{});if(_==null)throw new Error("FileDiff: EditProvider.createEditor must return an editor instance");try{return _.edit(S.current)}catch(C){throw _.cleanUp(),C}}},[p]),{ref:w,getHoveredLine:M.useCallback(()=>S.current?.getHoveredLine(),[])}}function Im({options:e,controlledSelection:t,hasCustomHeader:n,hasGutterRenderUtility:i}){return t||i||n?{...e,controlledSelection:t,renderCustomHeader:n?Bd:e?.renderCustomHeader,renderGutterUtility:i?Bd:e?.renderGutterUtility}:e}function v7({fileDiff:e,options:t,editorOptions:n,metrics:i,lineAnnotations:o,selectedLines:s,className:l,style:c,prerenderedHTML:d,renderAnnotation:f,renderCustomHeader:p,renderHeaderPrefix:m,renderHeaderFilenameSuffix:g,renderHeaderMetadata:v,renderGutterUtility:x,disableWorkerPool:S=!1,edit:w=!1}){const{ref:_,getHoveredLine:C}=y7({fileDiff:e,options:t,editorOptions:n,metrics:i,lineAnnotations:o,selectedLines:s,prerenderedHTML:d,hasGutterRenderUtility:x!=null,hasCustomHeader:p!=null,disableWorkerPool:S,edit:w});return k.jsx(Ny,{ref:_,className:l,style:c,children:BA(i7({fileDiff:e,renderCustomHeader:p,renderHeaderPrefix:m,renderHeaderFilenameSuffix:g,renderHeaderMetadata:v,renderAnnotation:f,renderGutterUtility:x,lineAnnotations:o,getHoveredLine:C}),d)})}function b7(e){return new Worker(""+new URL("worker-DsKBD11i.js",import.meta.url).href,{type:"module",name:e?.name})}const x7=10,S7="line-info-basic",_7=`
|
|
1557
|
+
[data-expand-button]:focus-visible {
|
|
1558
|
+
outline: 2px solid var(--diffs-modified-base);
|
|
1559
|
+
outline-offset: -2px;
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
[data-separator="line-info-basic"] {
|
|
1563
|
+
height: 24px;
|
|
1564
|
+
background: var(--diffs-bg-separator);
|
|
1565
|
+
position: relative;
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
[data-diff-type="single"] [data-gutter],
|
|
1569
|
+
[data-diff-type="split"] [data-deletions] [data-gutter] {
|
|
1570
|
+
[data-separator-wrapper] {
|
|
1571
|
+
position: absolute;
|
|
1572
|
+
left: 100%;
|
|
1573
|
+
display: flex;
|
|
1574
|
+
align-items: center;
|
|
1575
|
+
gap: 0;
|
|
1576
|
+
width: max-content;
|
|
1577
|
+
background: transparent;
|
|
1578
|
+
color: var(--diffs-fg-number);
|
|
1579
|
+
font-size: 0.75rem;
|
|
1580
|
+
margin-left: calc(-2ch - 2px);
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
[data-separator-wrapper][data-separator-multi-button] {
|
|
1584
|
+
margin-left: calc(-3ch - 2px);
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
[data-expand-button],
|
|
1588
|
+
[data-separator-content] {
|
|
1589
|
+
display: flex;
|
|
1590
|
+
align-items: center;
|
|
1591
|
+
min-width: unset;
|
|
1592
|
+
min-height: unset;
|
|
1593
|
+
padding: 0;
|
|
1594
|
+
flex-shrink: 0;
|
|
1595
|
+
border: none;
|
|
1596
|
+
width: auto;
|
|
1597
|
+
height: 100%;
|
|
1598
|
+
background-color: transparent;
|
|
1599
|
+
color: inherit;
|
|
1600
|
+
font: inherit;
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
[data-expand-button]:not([data-expand-all-button]) {
|
|
1604
|
+
min-width: 1.4rem;
|
|
1605
|
+
justify-content: center;
|
|
1606
|
+
|
|
1607
|
+
&[data-expand-down]::before {
|
|
1608
|
+
content: "↓";
|
|
1609
|
+
}
|
|
1610
|
+
&[data-expand-up]::before {
|
|
1611
|
+
content: "↑";
|
|
1612
|
+
}
|
|
1613
|
+
&[data-expand-both]::before {
|
|
1614
|
+
content: "↕";
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
svg {
|
|
1618
|
+
display: none;
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
[data-separator-content] {
|
|
1623
|
+
margin-left: 0.4ch;
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
[data-expand-all-button] {
|
|
1627
|
+
display: flex;
|
|
1628
|
+
position: relative;
|
|
1629
|
+
margin-left: 0.9rem;
|
|
1630
|
+
text-transform: lowercase;
|
|
1631
|
+
|
|
1632
|
+
&:hover {
|
|
1633
|
+
color: var(--diffs-fg);
|
|
1634
|
+
text-decoration: underline;
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
[data-expand-all-button]::before {
|
|
1639
|
+
content: "";
|
|
1640
|
+
display: block;
|
|
1641
|
+
position: absolute;
|
|
1642
|
+
top: 50%;
|
|
1643
|
+
left: -0.55rem;
|
|
1644
|
+
width: 3px;
|
|
1645
|
+
height: 3px;
|
|
1646
|
+
margin-top: -1px;
|
|
1647
|
+
border-radius: 2px;
|
|
1648
|
+
background-color: var(--diffs-fg-number);
|
|
1649
|
+
pointer-events: none;
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
[data-separator-content]:hover,
|
|
1653
|
+
[data-expand-button]:hover {
|
|
1654
|
+
color: var(--diffs-fg);
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
`;function C7(e){return e.isPartial&&(e.type==="change"||e.type==="rename-changed"||e.type==="rename-pure")}function w7(e){return e!=="new"&&e!=="deleted"}function Nm(e){return{name:e.path,contents:e.content,cacheKey:`${e.side}:${e.ref}:${e.path}`}}async function E7(e,t){if(e.type==="rename-pure"){const o=await t(e.name,"new");return{oldFile:null,newFile:Nm(o)}}const[n,i]=await Promise.all([t(e.name,"old"),t(e.name,"new")]);return{oldFile:Nm(n),newFile:Nm(i)}}const VA=2e3,k7=2,T7=2;function A7(e){for(const t of e){if(!FA(t))continue;const n=t.closest("[data-expand-index]");if(GA(n))return n}}function L7(e,t){if(t)return!1;for(const n of e)if(FA(n)){if(n.closest("[data-expand-all-button]"))return!1;if(n.closest("[data-expand-down]"))return!0}return!1}function R7(e){const t=e.closest("main");return t instanceof HTMLElement?t:void 0}function Sw(e,t){if(t===0)return;const{style:n}=e,i=n.scrollBehavior;n.scrollBehavior="auto",e.scrollTop+=t,n.scrollBehavior=i}function O7(e,t){if(Date.now()-e.createdAt>VA)return"done";const n=t.shadowRoot;if(n==null)return"wait";const i=M7(n,e.index);if(i===void 0)return Sw(e.scroller,e.scroller.scrollHeight-e.scrollHeight),"done";const o=i.getBoundingClientRect().top-e.top;return Math.abs(o)<k7?"ok":(Sw(e.scroller,o),"wait")}function D7(e,t,n,i,o=requestAnimationFrame){let s=0,l=!1;const c=()=>{if(!n()||Date.now()-e.createdAt>VA)return;const d=O7(e,t);if(d!=="done"){if(d==="wait")l=!0,s=0;else if(s+=1,l&&s>=T7)return;o(c)}};o(c)}function M7(e,t){if(!/^\d+$/.test(t))return;const n=e.querySelector(`[data-expand-index="${t}"]`);return GA(n)?n:void 0}function FA(e){return typeof e.closest=="function"}function GA(e){return e!=null&&typeof e.getBoundingClientRect=="function"}const $A="comprehende.theme",Jy={dark:"github-dark",light:"github-light"};function I7(e){return e==="light"||e==="dark"||e==="auto"?e:"auto"}function N7(e,t){return e==="auto"?t?"dark":"light":e}function z7(e){document.documentElement.classList.toggle("dark",e==="dark"),document.documentElement.style.colorScheme=e}function P7(){try{return I7(localStorage.getItem($A))}catch{return"auto"}}function H7(e){try{localStorage.setItem($A,e)}catch{}}function j7(){return window.matchMedia("(prefers-color-scheme: dark)").matches}const qA=M.createContext(null);function B7(e){const[t,n]=M.useState(P7),[i,o]=M.useState(j7),s=N7(t,i),l=M.useCallback(f=>{H7(f),n(f)},[]),c=M.useCallback(()=>{l(t==="auto"?"light":t==="light"?"dark":"auto")},[t,l]);M.useEffect(()=>{z7(s)},[s]),M.useEffect(()=>{const f=window.matchMedia("(prefers-color-scheme: dark)"),p=()=>o(f.matches);return f.addEventListener("change",p),()=>f.removeEventListener("change",p)},[]);const d=M.useMemo(()=>({preference:t,resolved:s,setPreference:l,toggleTheme:c}),[t,s,l,c]);return k.jsx(qA.Provider,{value:d,children:e.children})}function e0(){const e=M.useContext(qA);if(e===null)throw new Error("useTheme must be used within ThemeProvider");return e}function U7(e){return k.jsx("div",{className:"flex flex-col gap-2 px-2 py-1.5 font-sans",children:e.comments.map(t=>k.jsxs("article",{"data-source-id":t.id,className:Me("rounded-md border border-border bg-card px-2.5 py-2 text-xs leading-relaxed text-foreground",t.stale&&"border-warn",e.focusId===t.id&&"ring-2 ring-ring/60"),children:[k.jsxs("header",{className:"mb-1 flex items-baseline gap-2 text-muted-foreground",children:[k.jsx("span",{className:"font-medium text-foreground",children:t.author}),t.stale?k.jsx("span",{className:"text-warn",children:"Pin does not match live git."}):null,t.url!==void 0?k.jsx("a",{className:"ml-auto inline-flex items-center gap-0.5 text-primary hover:underline",href:t.url,target:"_blank",rel:"noreferrer","aria-label":"Open comment",children:k.jsx(R1,{className:"size-3"})}):null]}),k.jsx("p",{className:"whitespace-pre-wrap",children:t.body})]},t.id))})}const WA=`
|
|
1658
|
+
[data-diffs-header],
|
|
1659
|
+
[data-diff],
|
|
1660
|
+
[data-file],
|
|
1661
|
+
[data-error-wrapper],
|
|
1662
|
+
[data-virtualizer-buffer] {
|
|
1663
|
+
--diffs-header-font-family: var(--font-sans) !important;
|
|
1664
|
+
--diffs-font-family: var(--font-mono) !important;
|
|
1665
|
+
--diffs-bg: var(--diff-canvas) !important;
|
|
1666
|
+
--diffs-light-bg: var(--diff-canvas) !important;
|
|
1667
|
+
--diffs-dark-bg: var(--diff-canvas) !important;
|
|
1668
|
+
--diffs-token-light-bg: transparent;
|
|
1669
|
+
--diffs-token-dark-bg: transparent;
|
|
1670
|
+
--diffs-bg-context-override: var(--diff-canvas);
|
|
1671
|
+
--diffs-bg-hover-override: var(--diff-hover);
|
|
1672
|
+
--diffs-bg-separator-override: var(--diff-hunk);
|
|
1673
|
+
--diffs-bg-buffer-override: var(--diff-hunk);
|
|
1674
|
+
--diffs-bg-addition-override: var(--diff-add-line);
|
|
1675
|
+
--diffs-bg-addition-number-override: var(--diff-add-num);
|
|
1676
|
+
--diffs-bg-addition-hover-override: var(--diff-add-line);
|
|
1677
|
+
--diffs-bg-addition-emphasis-override: var(--diff-add-word);
|
|
1678
|
+
--diffs-bg-deletion-override: var(--diff-del-line);
|
|
1679
|
+
--diffs-bg-deletion-number-override: var(--diff-del-num);
|
|
1680
|
+
--diffs-bg-deletion-hover-override: var(--diff-del-line);
|
|
1681
|
+
--diffs-bg-deletion-emphasis-override: var(--diff-del-word);
|
|
1682
|
+
background-color: var(--diff-canvas) !important;
|
|
1683
|
+
color: var(--diff-fg) !important;
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
[data-line-type="change-addition"] {
|
|
1687
|
+
background-color: var(--diff-add-line) !important;
|
|
1688
|
+
}
|
|
1689
|
+
[data-line-type="change-addition"][data-column-number] {
|
|
1690
|
+
background-color: var(--diff-add-num) !important;
|
|
1691
|
+
}
|
|
1692
|
+
[data-line-type="change-deletion"] {
|
|
1693
|
+
background-color: var(--diff-del-line) !important;
|
|
1694
|
+
}
|
|
1695
|
+
[data-line-type="change-deletion"][data-column-number] {
|
|
1696
|
+
background-color: var(--diff-del-num) !important;
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
[data-diff-type="split"][data-overflow="scroll"] {
|
|
1700
|
+
grid-template-columns: minmax(0, var(--comprehende-split-left, 1fr)) minmax(0, var(--comprehende-split-right, 1fr)) !important;
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
[data-diff-type="split"][data-overflow="wrap"],
|
|
1704
|
+
[data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {
|
|
1705
|
+
grid-template-columns:
|
|
1706
|
+
var(--diffs-grid-number-column-width)
|
|
1707
|
+
minmax(0, var(--comprehende-split-left, 1fr))
|
|
1708
|
+
var(--diffs-grid-number-column-width)
|
|
1709
|
+
minmax(0, var(--comprehende-split-right, 1fr)) !important;
|
|
1710
|
+
}
|
|
1711
|
+
`,YA=.2,XA=.8;function zm(e){return Math.min(XA,Math.max(YA,e))}function V7(e){const t=M.useMemo(()=>{const i=typeof navigator>"u"?4:Math.max(1,navigator.hardwareConcurrency||4);return{workerFactory:()=>new b7,poolSize:Math.max(2,Math.min(6,Math.floor(i/2)))}},[]),n=M.useMemo(()=>({theme:Jy,tokenizeMaxLineLength:1e3,useTokenTransformer:!0,lineDiffType:"none"}),[]);return k.jsx(h7,{poolOptions:t,highlighterOptions:n,children:e.children})}function F7(e,t){if(e.trim()!=="")try{return T5(e,`comprehende:${t}:${G7(e)}`)[0]?.files[0]}catch{return}}function G7(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return`${e.length.toString(16)}:${(t>>>0).toString(16)}`}function KA(e){return E7(e,Jw)}const $7=M.memo(function(t){const n=M.useRef(t.onPostRender);n.current=t.onPostRender;const i=M.useMemo(()=>({theme:Jy,themeType:t.themeType,diffStyle:t.split?"split":"unified",overflow:t.wrap?"wrap":"scroll",disableFileHeader:!0,stickyHeader:!1,lineDiffType:"none",expansionLineCount:x7,hunkSeparators:S7,...t.loadFiles?{loadDiffFiles:KA}:{},unsafeCSS:`${WA}
|
|
1712
|
+
${_7}`,onPostRender:(o,s,l)=>{l!=="unmount"&&n.current?.(o)}}),[t.loadFiles,t.split,t.themeType,t.wrap]);return k.jsx(v7,{className:"block w-full",fileDiff:t.fileDiff,options:i,lineAnnotations:t.annotations,renderAnnotation:t.annotations===void 0?void 0:Y7})}),q7=M.memo(function(t){const n=M.useMemo(()=>({name:t.path,contents:t.contents,cacheKey:`${t.path}:${t.contents.length}:${t.contents.slice(0,32)}:${t.annotations?.length??0}`}),[t.annotations?.length,t.contents,t.path]),i=M.useMemo(()=>({theme:Jy,themeType:t.themeType,overflow:t.wrap?"wrap":"scroll",disableFileHeader:!0,stickyHeader:!1,unsafeCSS:WA}),[t.themeType,t.wrap]);return k.jsx(g7,{className:"block w-full",file:n,options:i,lineAnnotations:t.annotations,renderAnnotation:t.annotations===void 0?void 0:X7})});function W7(e,t){return[...F8(e).values()].flatMap(n=>{const i=n[0];return i===void 0?[]:[{side:V8(i.side),lineNumber:i.line,metadata:{comments:n,focusId:t}}]})}function Y7(e){return k.jsx(U7,{comments:e.metadata.comments,focusId:e.metadata.focusId})}function X7(e){const t=e.metadata,n=new Date(t.timestamp*1e3).toISOString().slice(0,10);return k.jsxs("div",{className:"flex min-w-0 items-baseline gap-2 px-2 py-1 font-sans text-[11px] text-muted-foreground",children:[k.jsx("code",{className:"text-primary",children:t.sha.slice(0,7)}),k.jsx("span",{className:"min-w-0 truncate",children:t.author}),k.jsx("span",{className:"shrink-0 tabular-nums",children:n}),t.lines>1?k.jsxs("span",{className:"shrink-0 tabular-nums",children:[t.lines," lines"]}):null]})}function _w(e){const{resolved:t}=e0();return k.jsx("div",{className:"min-h-0 min-w-0",children:k.jsx(q7,{path:e.path,contents:e.contents,wrap:e.wrap,themeType:t,annotations:e.annotations})})}function K7(e){const{path:t,patch:n,split:i,wrap:o,splitRatio:s,onSplitRatio:l,hydrate:c=!0,comments:d,focusCommentId:f}=e,{resolved:p}=e0(),m=M.useMemo(()=>F7(n,t),[n,t]),[g,v]=M.useState(m),x=M.useRef(null),S=M.useRef(null),w=M.useRef(0);M.useEffect(()=>{v(m)},[m]),M.useEffect(()=>{if(m===void 0||!c||!C7(m))return;let D=!1;return KA(m).then(I=>{if(!(D||!m.isPartial))try{v(Pd("clone",m,I))}catch{}}).catch(()=>{}),()=>{D=!0}},[m,c]),M.useEffect(()=>{const D=x.current;if(D===null)return;const I=O=>{const P=O.composedPath();if(L7(P,O.shiftKey))return;const j=A7(P),F=j?.getAttribute("data-expand-index"),Q=R7(D);j===void 0||F==null||Q===void 0||(w.current+=1,S.current={scroller:Q,top:j.getBoundingClientRect().top,index:F,scrollHeight:Q.scrollHeight,createdAt:Date.now()})};return D.addEventListener("click",I,!0),()=>D.removeEventListener("click",I,!0)},[g!==void 0]);const _=D=>{const I=S.current;if(I===null)return;const O=w.current;S.current=null,D7(I,D,()=>w.current===O)},C=M.useMemo(()=>d===void 0||d.length===0?void 0:W7(d,f),[d,f]);if(g===void 0)return k.jsx("p",{className:"px-3 py-2 text-xs text-warn",children:"Could not render this git patch."});const T=i&&w7(g.type);return k.jsxs("div",{ref:x,className:"relative min-w-0",style:{"--comprehende-split-left":`${s}fr`,"--comprehende-split-right":`${1-s}fr`},children:[k.jsx($7,{fileDiff:g,split:T,wrap:o,themeType:p,loadFiles:c,annotations:C,onPostRender:_}),T?k.jsx(Q7,{ratio:s,onRatio:l}):null]})}function Q7(e){const t=M.useRef(null),n=s=>{const l=s.currentTarget.parentElement;l!==null&&(s.preventDefault(),s.currentTarget.setPointerCapture(s.pointerId),t.current={startX:s.clientX,start:e.ratio,width:l.getBoundingClientRect().width})},i=s=>{const l=t.current;l===null||l.width===0||e.onRatio(zm(l.start+(s.clientX-l.startX)/l.width))},o=()=>{t.current=null};return k.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize split diff","aria-valuemin":Math.round(YA*100),"aria-valuemax":Math.round(XA*100),"aria-valuenow":Math.round(e.ratio*100),tabIndex:0,className:Me("absolute inset-y-0 z-10 flex w-3 -translate-x-1/2 cursor-col-resize touch-none items-center justify-center select-none","after:absolute after:inset-y-0 after:w-px after:bg-border hover:after:bg-primary/70 motion-safe:after:transition-colors"),style:{left:`${e.ratio*100}%`},onPointerDown:n,onPointerMove:i,onPointerUp:o,onPointerCancel:o,onDoubleClick:()=>e.onRatio(.5),onKeyDown:s=>{s.key==="ArrowLeft"?(s.preventDefault(),e.onRatio(zm(e.ratio-.05))):s.key==="ArrowRight"?(s.preventDefault(),e.onRatio(zm(e.ratio+.05))):(s.key==="Home"||s.key==="Enter")&&(s.preventDefault(),e.onRatio(.5))},children:k.jsx("div",{className:"z-10 flex h-8 w-3 items-center justify-center rounded-sm border border-border bg-card",children:k.jsx(O1,{className:"size-2.5 text-muted-foreground"})})})}const Z7=.35,J7=8;function eG(e,t,n,i,o=J7){const s=n*i,l=new Uint8ClampedArray(s*4);let c=0;for(let d=0;d<s;d+=1){const f=d*4,p=e[f+3]??0,m=t[f+3]??0,g=p===0&&m===0,v=Math.abs((e[f]??0)-(t[f]??0)),x=Math.abs((e[f+1]??0)-(t[f+1]??0)),S=Math.abs((e[f+2]??0)-(t[f+2]??0)),w=Math.abs(p-m),_=Math.max(v,x,S,w);if(g||_<=o){const C=tG(t[f]??0,t[f+1]??0,t[f+2]??0),T=Math.round(C*Z7);l[f]=T,l[f+1]=T,l[f+2]=T,l[f+3]=255;continue}if(c+=1,p===0&&m>0){l[f]=26,l[f+1]=127,l[f+2]=55,l[f+3]=255;continue}if(m===0&&p>0){l[f]=207,l[f+1]=34,l[f+2]=46,l[f+3]=255;continue}l[f]=200,l[f+1]=40,l[f+2]=160,l[f+3]=255}return{pixels:l,changed:c,total:s}}function tG(e,t,n){return Math.round(.2126*e+.7152*t+.0722*n)}function QA(e,t,n,i){if(e<=0||t<=0||n<=0||i<=0)return{width:0,height:0,scale:1};const o=Math.min(1,n/e,i/t);return{width:Math.max(1,Math.round(e*o)),height:Math.max(1,Math.round(t*o)),scale:o}}function nG(e,t,n,i){return QA(e,t,Math.floor(Math.max(0,n-1)/2),i)}function iG(e,t,n){const i=`${e} × ${t}`;return n>=.995?i:`${i} at ${Math.round(n*100)}%`}function rG(e){return`${e}%`}const oG="_stage_2307v_2",aG={stage:oG};function sG(e){const{path:t,status:n}=e,i=n!=="added",o=n!=="deleted",s=i?ud({kind:"image",path:t,side:"old"}):void 0,l=o?ud({kind:"image",path:t,side:"new"}):void 0,c=s!==void 0&&l!==void 0,d=Cw(s),f=Cw(l),p=cG(),[m,g]=M.useState("side-by-side"),[v,x]=M.useState(50),S=Math.max(d.naturalWidth,f.naturalWidth),w=Math.max(d.naturalHeight,f.naturalHeight),C=m==="side-by-side"||!c?nG(S,w,p.width,p.maxHeight):QA(S,w,p.width,p.maxHeight),T=C.width>0&&(d.ok||f.ok),D=d.error&&f.error?"These images are not in this clone. Fetch Git LFS objects, then refresh.":d.error?"The old image is not in this clone. Fetch Git LFS objects, then refresh.":f.error?"The new image is not in this clone. Fetch Git LFS objects, then refresh.":null;return k.jsxs("div",{ref:p.ref,className:"min-w-0",children:[k.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 border-b border-border px-3 py-2",children:[c?k.jsxs("div",{className:"flex overflow-hidden rounded-md border border-input",children:[k.jsx(Pm,{active:m==="side-by-side",onClick:()=>g("side-by-side"),hint:"Old and new at the same size",children:"Side by side"}),k.jsx(Pm,{active:m==="slider",onClick:()=>g("slider"),hint:"Drag to reveal new over old",children:"Slider"}),k.jsx(Pm,{active:m==="diff",onClick:()=>g("diff"),hint:"Pixels that differ",children:"Diff"})]}):k.jsx("span",{className:"font-mono text-[11px] text-muted-foreground",children:n==="added"?"Added":"Deleted"}),T?k.jsx("span",{className:"ml-auto font-mono text-[11px] tabular-nums text-muted-foreground",children:iG(S,w,C.scale)}):null]}),D!==null?k.jsx("p",{className:"px-3 py-2 text-sm text-warn",children:D}):null,!T&&D===null?k.jsx("p",{className:"px-3 py-2 text-sm text-muted-foreground",children:"Reading image…"}):null,k.jsxs("div",{className:"flex w-full justify-center",children:[T&&(m==="side-by-side"||!c)?k.jsxs("div",{className:"flex",children:[i?k.jsx($c,{label:"Old",width:C.width,height:C.height,rule:o,children:s!==void 0&&!d.error?k.jsx(Ud,{src:s,alt:"Old",width:C.width,height:C.height}):k.jsx(qc,{})}):k.jsx($c,{label:"Old",width:C.width,height:C.height,children:k.jsx(qc,{text:"Added — no old image"})}),o?k.jsx($c,{label:"New",width:C.width,height:C.height,children:l!==void 0&&!f.error?k.jsx(Ud,{src:l,alt:"New",width:C.width,height:C.height}):k.jsx(qc,{})}):k.jsx($c,{label:"New",width:C.width,height:C.height,children:k.jsx(qc,{text:"Deleted — no new image"})})]}):null,T&&m==="slider"&&c&&s!==void 0&&l!==void 0?k.jsx(lG,{oldUrl:s,newUrl:l,width:C.width,height:C.height,wipe:v,onWipe:x}):null,T&&m==="diff"&&c&&d.element!==null&&f.element!==null?k.jsx(uG,{oldImage:d.element,newImage:f.element,naturalWidth:S,naturalHeight:w,width:C.width,height:C.height}):null]})]})}function Pm(e){return k.jsxs(Zt,{children:[k.jsx(Jt,{asChild:!0,children:k.jsx(Et,{type:"button",size:"sm",variant:e.active?"secondary":"ghost",className:"rounded-none border-0","aria-pressed":e.active,onClick:e.onClick,children:e.children})}),k.jsx(en,{children:e.hint})]})}function $c(e){return k.jsxs("figure",{className:Me("w-fit shrink-0",e.rule===!0&&"border-r border-border"),children:[k.jsx("figcaption",{className:"border-b border-border px-3 py-1 font-mono text-[11px] text-muted-foreground",children:e.label}),k.jsx(t0,{width:e.width,height:e.height,children:e.children})]})}function t0(e){return k.jsx("div",{ref:e.ref,className:Me(aG.stage,"relative shrink-0 overflow-hidden",e.className),style:{width:e.width,height:e.height},onPointerDown:e.onPointerDown,onPointerMove:e.onPointerMove,children:e.children})}function Ud(e){return k.jsx("img",{src:e.src,alt:e.alt,width:e.width,height:e.height,className:"absolute top-0 left-0 max-w-none",style:{width:e.width,height:e.height,objectFit:"contain",objectPosition:"left top"}})}function qc(e){return k.jsx("p",{className:"flex h-full items-center px-3 text-sm text-muted-foreground",children:e.text??"Image missing"})}function lG(e){const{oldUrl:t,newUrl:n,width:i,height:o,wipe:s,onWipe:l}=e,c=M.useId(),d=M.useRef(null),f=g=>{const v=d.current;if(v===null)return;const x=v.getBoundingClientRect();x.width!==0&&l(Math.min(100,Math.max(0,(g-x.left)/x.width*100)))},p=g=>{g.preventDefault(),g.currentTarget.setPointerCapture(g.pointerId),f(g.clientX)},m=g=>{g.buttons!==0&&f(g.clientX)};return k.jsxs("figure",{className:"mx-auto w-fit shrink-0",children:[k.jsxs(t0,{ref:d,width:i,height:o,className:"cursor-col-resize touch-none",onPointerDown:p,onPointerMove:m,children:[k.jsx(Ud,{src:t,alt:"Old",width:i,height:o}),k.jsx("div",{className:"absolute inset-y-0 left-0 overflow-hidden",style:{width:rG(s)},children:k.jsx(Ud,{src:n,alt:"New",width:i,height:o})}),k.jsxs("div",{className:"pointer-events-none absolute inset-y-0",style:{left:`${s}%`},"aria-hidden":!0,children:[k.jsx("span",{className:"absolute inset-y-0 left-0 w-px -translate-x-1/2 bg-primary"}),k.jsx("span",{className:"absolute top-1/2 left-0 size-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full border border-primary bg-card"})]})]}),k.jsxs("label",{className:"flex w-full items-center gap-3 px-3 py-2 font-mono text-[11px] text-muted-foreground",htmlFor:c,children:["Old",k.jsx("input",{id:c,type:"range",min:0,max:100,value:s,"aria-label":"Wipe between old and new",className:"min-w-0 flex-1 accent-primary",onChange:g=>l(Number(g.target.value))}),"New"]})]})}function uG(e){const t=M.useRef(null),[n,i]=M.useState(null);return M.useEffect(()=>{const o=t.current;if(o===null)return;const s=e.naturalWidth,l=e.naturalHeight;o.width=s,o.height=l;const c=o.getContext("2d");if(c===null)return;const d=ww(e.oldImage,s,l),f=ww(e.newImage,s,l),p=eG(d,f,s,l),m=c.createImageData(s,l);m.data.set(p.pixels),c.putImageData(m,0,0),i({changed:p.changed,total:p.total})},[e.naturalHeight,e.naturalWidth,e.newImage,e.oldImage]),k.jsxs("figure",{className:"mx-auto w-fit shrink-0",children:[k.jsx(t0,{width:e.width,height:e.height,children:k.jsx("canvas",{ref:t,className:"block size-full"})}),n!==null?k.jsxs("figcaption",{className:"px-3 py-2 font-mono text-[11px] tabular-nums text-muted-foreground",children:[n.changed.toLocaleString()," of ",n.total.toLocaleString()," pixels differ"]}):null]})}function Cw(e){const[t,n]=M.useState({ok:!1,error:!1,element:null,naturalWidth:0,naturalHeight:0});return M.useEffect(()=>{if(e===void 0){n({ok:!1,error:!1,element:null,naturalWidth:0,naturalHeight:0});return}let i=!1;return n({ok:!1,error:!1,element:null,naturalWidth:0,naturalHeight:0}),dG(e).then(o=>{i||n({ok:!0,error:!1,element:o,naturalWidth:o.naturalWidth,naturalHeight:o.naturalHeight})}).catch(()=>{i||n({ok:!1,error:!0,element:null,naturalWidth:0,naturalHeight:0})}),()=>{i=!0}},[e]),t}function cG(){const e=M.useRef(null),[t,n]=M.useState({width:0,maxHeight:0});return M.useLayoutEffect(()=>{const i=e.current;if(i===null)return;const o=()=>{const l=Math.floor(i.clientWidth),c=Math.max(120,Math.round(window.innerHeight*.7));n(d=>d.width===l&&d.maxHeight===c?d:{width:l,maxHeight:c})};o();const s=new ResizeObserver(o);return s.observe(i),window.addEventListener("resize",o),()=>{s.disconnect(),window.removeEventListener("resize",o)}},[]),{ref:e,width:t.width,maxHeight:t.maxHeight}}function dG(e){return new Promise((t,n)=>{const i=new Image;i.onload=()=>t(i),i.onerror=()=>n(new Error("image load failed")),i.src=e})}function ww(e,t,n){const i=document.createElement("canvas");i.width=t,i.height=n;const o=i.getContext("2d");return o===null?new Uint8ClampedArray(t*n*4):(o.clearRect(0,0,t,n),o.drawImage(e,0,0),o.getImageData(0,0,t,n).data)}function fG(e,t){const[n,i]=M.useState(t<=0?t:0);return M.useEffect(()=>{if(t<=0){i(0);return}i(0);const o=window.setTimeout(()=>i(t),t);return()=>window.clearTimeout(o)},[e,t]),bD(e,n,t)}const hG="_walker_1s58a_11",pG={walker:hG};function Wl(e){const t=e.layout??"well",n=e.delayMs??(t==="page"?0:n1);if(!fG(!0,n))return null;const o=t==="inline"?"span":"div",s=t==="inline";return k.jsxs(o,{className:Me("flex items-center gap-3",t==="well"&&"px-3 py-5",s&&"shrink-0 gap-0",e.className),role:s?void 0:"status","aria-live":s?void 0:"polite",children:[k.jsxs("span",{className:Me("flex shrink-0 gap-[0.28rem]",s?"h-[1.1rem]":"h-7"),"aria-hidden":!0,children:[k.jsx(Ew,{kind:"del",inline:s}),k.jsx(Ew,{kind:"add",inline:s})]}),s?k.jsx("span",{className:"sr-only",children:e.label}):k.jsx("p",{className:"m-0 font-mono text-[11px] tracking-wide text-muted-foreground",children:e.label})]})}function Ew(e){return k.jsx("span",{className:Me("relative h-full overflow-hidden rounded-[1px]",e.inline?"w-0.5":"w-[3px]",e.kind==="del"?"bg-del/38":"bg-add/38"),children:k.jsx("span",{className:Me("absolute inset-x-0 top-[28%] h-[44%] rounded-[inherit]",pG.walker,e.kind==="del"?"bg-del":"bg-add")})})}const mG=h1("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-md border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,background-color,border-color,box-shadow,opacity] duration-[var(--motion)] ease-[var(--motion-ease)] focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground",secondary:"bg-secondary text-secondary-foreground",destructive:"bg-destructive/20 text-destructive",outline:"border-border text-foreground",ghost:"text-muted-foreground"}},defaultVariants:{variant:"default"}});function gG({className:e,variant:t="default",asChild:n=!1,...i}){const o=n?r1:"span";return k.jsx(o,{"data-slot":"badge",className:Me(mG({variant:t}),e),...i})}const Hm="duration-[var(--motion)] ease-[var(--motion-ease)]";function yG(e){const{file:t,active:n,index:i,split:o,splitRatio:s,wrap:l,viewed:c,onSplitRatio:d,onOpen:f,onViewed:p,comments:m,focusCommentId:g}=e,v=t.kind==="lockfile",[x,S]=M.useState(c||v),[w,_]=M.useState(t.patch),[C,T]=M.useState(null),D=t.hunks[0],I=J8(t.hunks.flatMap(G=>G.lines.filter(B=>B.kind==="add").map(B=>B.text))),O=t.oldPath!==void 0?`${t.oldPath} → ${t.path}`:t.path,P=M.useId(),j=M.useMemo(()=>(m??[]).filter(G=>G.path===t.path||G.path===t.oldPath),[m,t.oldPath,t.path]),F=g!==void 0&&j.some(G=>G.id===g);M.useEffect(()=>{S(c||v)},[v,c]),M.useEffect(()=>{F&&S(!1)},[F]),M.useEffect(()=>{if(x||!v||w!==""||C!==null)return;let G=!1;return gD(t.path).then(B=>{G||_(B.patch)}).catch(B=>{G||T(B instanceof Error?B.message:String(B))}),()=>{G=!0}},[x,v,t.path,w,C]);const Q=G=>{G.target instanceof Element&&G.target.closest("button, input, label, a")!==null||S(B=>!B)};return k.jsxs("article",{className:Me("overflow-hidden rounded-lg border bg-card shadow-card transition-[border-color]",Hm,n?"border-primary":"border-border"),"data-hunk":i,children:[k.jsxs("header",{className:Me("sticky top-0 z-10 flex cursor-pointer flex-wrap items-center gap-x-3 gap-y-1 bg-card px-3 py-2",x?null:"border-b border-border"),onClick:Q,children:[k.jsx(Et,{type:"button",variant:"ghost",size:"icon-sm",className:"size-6","aria-expanded":!x,"aria-controls":P,"aria-label":x?"Expand file":"Collapse file",onClick:()=>S(G=>!G),children:k.jsx(N2,{className:Me("size-4 transition-transform",Hm,x&&"-rotate-90")})}),k.jsxs(Zt,{children:[k.jsx(Jt,{asChild:!0,children:k.jsx(Et,{type:"button",variant:"link",className:Me("h-auto p-0 font-mono text-sm transition-colors",Hm,c&&"text-muted-foreground"),onClick:()=>f(t.path),children:O})}),k.jsx(en,{children:"Open file"})]}),k.jsx("code",{className:"font-mono text-xs text-muted-foreground",children:t.kind==="image"?"image":t.kind==="lockfile"?"lockfile":t.hunkCount===1&&D!==void 0?Z8(D.header):`${t.hunkCount} hunks`}),t.kind==="image"?k.jsx("span",{className:"font-mono text-[11px] text-muted-foreground",children:t.status}):k.jsxs("span",{className:"font-mono text-[11px] tabular-nums",children:[k.jsxs("span",{className:"text-del",children:["−",t.removed]})," ",k.jsxs("span",{className:"text-add",children:["+",t.added]})]}),I.length>0?I.map(G=>k.jsx(gG,{variant:"outline",className:"font-mono font-normal",children:G},G)):null,k.jsxs(Zt,{children:[k.jsx(Jt,{asChild:!0,children:k.jsxs("label",{className:"ml-auto flex shrink-0 cursor-pointer items-center gap-1.5 text-xs text-muted-foreground select-none",children:[k.jsx("input",{type:"checkbox",className:"size-3.5 accent-primary",checked:c,onChange:G=>p(t.path,G.target.checked)}),"Viewed"]})}),k.jsxs(en,{children:[c?"Mark as not viewed":"Mark as viewed"," (v)"]})]})]}),k.jsx("div",{id:P,hidden:x,children:x?null:t.kind==="image"?k.jsx(sG,{path:t.path,status:t.status}):C!==null?k.jsx("p",{className:"px-3 py-2 text-sm text-warn",children:C}):v&&w===""?k.jsx(Wl,{label:Mo.lockfile}):k.jsx(K7,{path:t.path,patch:w,split:o,wrap:l,splitRatio:s,onSplitRatio:d,hydrate:t.complete,comments:j,focusCommentId:g})})]})}function vG(e){const{group:t,bucket:n,groups:i,mixed:o,strandColor:s,loading:l,hunkError:c,files:d,activeHunk:f,split:p,splitRatio:m,wrap:g,viewedPaths:v}=e,x=n==="lockfiles",S=s??(x?"var(--muted-foreground)":n==="unassigned"?"var(--warn)":"var(--primary)"),w=d.filter(C=>v.has(C.path)).length;M.useEffect(()=>{const C=e.focusCommentId;if(C===void 0||l)return;let T=0;const D=()=>{const I=document.querySelector(`[data-source-id="${CSS.escape(C)}"]`);if(I instanceof HTMLElement){I.scrollIntoView({block:"center",behavior:"smooth"});return}T+=1,T<90&&requestAnimationFrame(D)};requestAnimationFrame(D)},[l,e.focusCommentId,d]);const _=(C,T,D)=>k.jsx(yG,{file:C,active:D,index:C.firstIndex,split:p,splitRatio:m,wrap:g,viewed:v.has(C.path),onSplitRatio:e.onSplitRatio,onOpen:e.onOpenFile,onViewed:e.onViewed,comments:e.comments,focusCommentId:e.focusCommentId},C.path);return k.jsxs(k.Fragment,{children:[k.jsxs("div",{className:"mb-8 flex items-stretch gap-4",children:[k.jsx("span",{className:"w-[3px] flex-none rounded-px [[data-motion=group]_&]:[view-transition-name:review-strand]",style:{backgroundColor:S},"aria-hidden":!0}),k.jsx("div",{className:"min-w-0 flex-1 [[data-motion=group]_&]:[view-transition-name:review-copy]",children:t!==null?k.jsx(X8,{group:t,index:e1(i,t.id),groups:i,document:e.document,partTitle:o?t.part:void 0,onOpenGroup:e.onOpenGroup}):x?k.jsx(yd,{kicker:"Lockfiles",title:"Generated lockfiles"}):k.jsx(yd,{kicker:"Unassigned",title:"Not in any group",children:k.jsx("p",{className:"font-display text-xl leading-relaxed text-foreground",children:"These hunks are in git and in no group. Fix the review document. Never the diff."})})})]}),c!==null?k.jsx("p",{className:"mt-4 text-warn",children:c}):null,l?k.jsx("article",{className:"mt-8 overflow-hidden rounded-lg border border-border bg-card shadow-card",children:k.jsx(Wl,{label:Mo.group})}):null,!l&&d.length===0&&c===null?k.jsx("p",{className:"mt-8 text-muted-foreground",children:"No hunks in this group."}):null,!l&&d.length>0?k.jsxs("p",{className:"mt-8 font-mono text-xs tabular-nums text-muted-foreground",children:[w," of ",d.length," files viewed",k.jsx("span",{className:"hidden sm:inline",children:" · j/k to move, v to toggle"})]}):null,!l&&d.length>0?k.jsx(n5,{files:d,activeHunk:f,viewedPaths:v,onSelect:e.onScrollToHunk,onViewed:e.onViewed,children:d.map(C=>_(C,C.firstIndex,f>=C.firstIndex&&f<C.firstIndex+C.hunkCount))}):null]})}const bG=/^[0-9a-f]{7,40}$/i;function xG(e){return bG.test(e)}function kw(e,t){const n=!xG(e)&&e!==t;return{display:n?e:vD(t),copy:t,tooltip:n?`${e} · ${t}`:t}}function dl(e){return k.jsx("kbd",{className:Me("font-mono text-[10px] font-normal text-muted-foreground",e.className),children:e.children})}function ZA(e){return k.jsxs("span",{className:Me("shrink-0 font-display text-xl leading-none text-foreground",e.className),children:["Comprehende",k.jsx("span",{className:"text-primary","aria-hidden":"true",children:"?"})]})}function SG(e){const{meta:t,wrap:n,split:i,onWrap:o,onUnified:s,onSplit:l,onRefresh:c,busy:d=!1,comments:f,onComments:p}=e;return k.jsxs("header",{className:"flex flex-col gap-2 border-b border-border bg-card px-5 py-3 min-[800px]:flex-row min-[800px]:flex-wrap min-[800px]:items-center min-[800px]:justify-between",children:[k.jsxs("div",{className:"flex min-w-0 items-center gap-4",children:[k.jsx(ZA,{}),k.jsx(_G,{resolved:t.resolved}),k.jsx(wG,{meta:t})]}),k.jsxs("div",{className:"flex flex-wrap items-center gap-2 min-[800px]:justify-end",children:[k.jsxs(Zt,{children:[k.jsx(Jt,{asChild:!0,children:k.jsxs(Et,{size:"sm",variant:n?"secondary":"outline","aria-pressed":n,"aria-label":"Wrap lines",onClick:o,children:["Wrap",k.jsx(dl,{className:"max-sm:hidden",children:"w"})]})}),k.jsx(en,{children:"Wrap long lines"})]}),p!==void 0?k.jsxs(Zt,{children:[k.jsx(Jt,{asChild:!0,children:k.jsxs(Et,{size:"sm",variant:f===!0?"secondary":"outline","aria-pressed":f===!0,"aria-label":"Show comments",onClick:p,children:["Comments",k.jsx(dl,{className:"max-sm:hidden",children:"c"})]})}),k.jsx(en,{children:"Show comments on the diffs"})]}):null,k.jsxs("div",{className:"flex items-center gap-1.5",children:[k.jsxs("div",{className:"flex overflow-hidden rounded-md border border-input",children:[k.jsxs(Zt,{children:[k.jsx(Jt,{asChild:!0,children:k.jsx(Et,{size:"sm",variant:i?"ghost":"secondary",className:"rounded-none border-0",onClick:s,"aria-pressed":!i,children:"Unified"})}),k.jsx(en,{children:"Unified diff"})]}),k.jsxs(Zt,{children:[k.jsx(Jt,{asChild:!0,children:k.jsx(Et,{size:"sm",variant:i?"secondary":"ghost",className:"rounded-none border-0",onClick:l,"aria-pressed":i,children:"Split"})}),k.jsx(en,{children:"Side-by-side diff"})]})]}),k.jsx(dl,{className:"max-sm:hidden",children:"s"})]}),k.jsx(CG,{}),d?k.jsx(Wl,{layout:"inline",label:Mo.review}):null,k.jsxs(Zt,{children:[k.jsx(Jt,{asChild:!0,children:k.jsxs(Et,{size:"sm",variant:"outline",onClick:c,"aria-busy":d,children:["Refresh",k.jsx(dl,{className:"max-sm:hidden",children:"r"})]})}),k.jsx(en,{children:d?Mo.review:"Reload review"})]})]})]})}function _G(e){const t=kw(e.resolved.baseRef,e.resolved.baseSha),n=kw(e.resolved.headRef,e.resolved.headSha);return k.jsxs("div",{className:"flex min-w-0 items-baseline gap-1.5 text-sm",children:[k.jsx(Tw,{...t}),k.jsx("span",{className:"shrink-0 text-muted-foreground",children:"..."}),k.jsx(Tw,{...n})]})}function Tw(e){const[t,n]=M.useState(!1);return M.useEffect(()=>{if(!t)return;const i=window.setTimeout(()=>n(!1),1600);return()=>window.clearTimeout(i)},[t]),k.jsxs(Zt,{children:[k.jsx(Jt,{asChild:!0,children:k.jsx("button",{type:"button",className:"max-w-[10rem] cursor-pointer truncate rounded-sm px-0.5 font-mono text-primary hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:outline-none","aria-label":`Copy ${e.copy}`,"aria-live":"polite",onClick:()=>{n(!0),navigator.clipboard.writeText(e.copy).catch(()=>{n(!1)})},children:t?"Copied":e.display})}),k.jsx(en,{className:"max-w-[min(24rem,calc(100vw-2rem))] font-mono",children:e.tooltip})]})}function CG(){const{preference:e,toggleTheme:t}=e0(),n=e==="auto"?"light":e==="light"?"dark":"auto",i=n==="auto"?"Use auto theme":`Use ${n} theme`,o=n==="auto"?"Follow system":`Use ${n} theme`;return k.jsxs(Zt,{children:[k.jsx(Jt,{asChild:!0,children:k.jsx(Et,{size:"icon-sm",variant:"outline","aria-label":i,onClick:t,children:e==="light"?k.jsx(tM,{}):e==="dark"?k.jsx(Q2,{}):k.jsx(X2,{})})}),k.jsx(en,{children:o})]})}function wG(e){const{meta:t}=e,n=t.coverage.unassignedCount>0||t.coverage.staleCount>0||t.coverage.staleSourceCount>0,i=[`${t.coverage.assignedHunks} of ${t.coverage.totalHunks} hunks grouped`,t.coverage.unassignedCount>0?`${t.coverage.unassignedCount} unassigned`:null,t.coverage.staleCount>0?`${t.coverage.staleCount} stale`:null,t.coverage.staleSourceCount>0?`${t.coverage.staleSourceCount} stale comment pins`:null].filter(o=>o!==null).join(" · ");return k.jsxs(Zt,{children:[k.jsx(Jt,{asChild:!0,children:k.jsxs("span",{className:Me("shrink-0 font-mono text-xs tabular-nums",n?"text-warn":"text-muted-foreground"),children:[t.coverage.assignedHunks,"/",t.coverage.totalHunks]})}),k.jsx(en,{children:i})]})}const EG=["png","jpg","jpeg","gif","webp","bmp","avif","ico"],kG=new Set(EG);function TG(e){const t=e.split("/").pop()??e,n=t.lastIndexOf(".");if(n<=0)return;const i=t.slice(n+1).toLowerCase();return kG.has(i)?i:void 0}function AG(e){return TG(e)!==void 0}function LG(e){const t=[];for(const n of e){const i=t[t.length-1];if(i!==void 0&&i.sha===n.sha&&i.author===n.author){i.lines+=1;continue}t.push({lineNumber:n.line,sha:n.sha,author:n.author,timestamp:n.timestamp,lines:1})}return t}var RG=Object.defineProperty,JA=(e,t)=>RG(e,"name",{value:t,configurable:!0}),Aw="horizontal",OG=["horizontal","vertical"],DG=M.forwardRef(JA(function(t,n){const{decorative:i,orientation:o=Aw,...s}=t,l=eL(o)?o:Aw,d=i?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return k.jsx(Go.div,{"data-orientation":l,...d,...s,ref:n})},"Separator"));function eL(e){return OG.includes(e)}JA(eL,"isValidOrientation");var MG=DG;function IG({className:e,orientation:t="horizontal",decorative:n=!0,...i}){return k.jsx(MG,{"data-slot":"separator",decorative:n,orientation:t,className:Me("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...i})}function NG(e){const{inspector:t,wrap:n,setInspector:i,onClose:o}=e,s=AG(t.path),[l,c]=M.useState(""),[d,f]=M.useState(null),[p,m]=M.useState(null),[g,v]=M.useState(!0),x=M.useMemo(()=>d===null?"":d.map(w=>w.text).join(`
|
|
1713
|
+
`),[d]),S=M.useMemo(()=>{if(d!==null)return LG(d).map(w=>({lineNumber:w.lineNumber,metadata:{sha:w.sha,author:w.author,timestamp:w.timestamp,lines:w.lines}}))},[d]);return M.useEffect(()=>{let w=!1;if(m(null),v(!0),c(""),f(null),s){v(!1);return}return t.mode==="file"?Jw(t.path,t.side).then(_=>{w||(c(_.content),v(!1))}).catch(_=>{w||(m(_ instanceof Error?_.message:String(_)),v(!1))}):yD(t.path,t.side).then(_=>{w||(f(_.lines),v(!1))}).catch(_=>{w||(m(_ instanceof Error?_.message:String(_)),v(!1))}),()=>{w=!0}},[s,t]),k.jsxs("div",{className:"review-inspector flex h-full min-h-0 flex-col","aria-busy":g,children:[k.jsxs("div",{className:"flex flex-wrap items-center gap-3 px-8 pt-6 pb-4",children:[k.jsxs(Zt,{children:[k.jsx(Jt,{asChild:!0,children:k.jsxs(Et,{type:"button",size:"sm",variant:"outline",onClick:o,children:["Back",k.jsx(dl,{children:"esc"})]})}),k.jsx(en,{children:"Back to the diff"})]}),k.jsx("strong",{className:"min-w-0 truncate font-mono text-sm font-medium",children:t.path}),k.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[k.jsx(Et,{type:"button",size:"sm",variant:t.mode==="file"?"secondary":"ghost",onClick:()=>i({...t,mode:"file"}),children:"File"}),s?null:k.jsx(Et,{type:"button",size:"sm",variant:t.mode==="blame"?"secondary":"ghost",onClick:()=>i({...t,mode:"blame"}),children:"Blame"}),k.jsx(IG,{orientation:"vertical",className:"mx-1 h-6"}),k.jsx(Et,{type:"button",size:"sm",variant:t.side==="old"?"secondary":"ghost",onClick:()=>i({...t,side:"old"}),children:"Old"}),k.jsx(Et,{type:"button",size:"sm",variant:t.side==="new"?"secondary":"ghost",onClick:()=>i({...t,side:"new"}),children:"New"})]})]}),p!==null?k.jsx("p",{className:"px-8 text-warn",children:p}):null,g&&p===null&&!s?k.jsx("div",{className:"px-8 pt-2",children:k.jsx(Wl,{label:t.mode==="file"?Mo.file:Mo.blame})}):null,s?k.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-8 pb-8",children:k.jsx("img",{src:ud({kind:"image",path:t.path,side:t.side}),alt:`${t.side} ${t.path}`,className:"h-auto max-w-full bg-[var(--diff-canvas)]"})}):null,!s&&t.mode==="file"&&p===null&&!g?k.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-4 pb-8",children:k.jsx(_w,{path:t.path,contents:l,wrap:n})}):null,!s&&t.mode==="blame"&&p===null&&!g&&d!==null?k.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-4 pb-8",children:k.jsx(_w,{path:t.path,contents:x,wrap:n,annotations:S})}):null]})}function zG(e){const{meta:t,parts:n,onOpenGroup:i}=e,o=Iy(n),s=new Map(t.groups.map(d=>[d.id,d])),l=t.document.why,c=t.document.sources??[];return k.jsxs("div",{className:"mb-8 [[data-motion=group]_&]:[view-transition-name:review-overview]",children:[k.jsxs(yd,{kicker:`${t1(t.document.size)} · ${t.files.length} files`,title:t.document.title,kickerExtra:k.jsx(_E,{prompt:A1("overview"),scope:"overview"}),children:[l!==void 0?k.jsxs(k.Fragment,{children:[k.jsx(qr,{id:"review-why",className:"mb-2",children:"Why"}),k.jsx("p",{className:"mb-6 font-display text-xl leading-relaxed text-pretty text-foreground",children:k.jsx($a,{text:l})})]}):null,k.jsx(qr,{id:"review-what",className:"mb-2",children:"What"}),k.jsx("p",{className:"mb-5 leading-relaxed text-pretty text-foreground",children:k.jsx($a,{text:t.document.summary})}),k.jsx(hk,{ids:c.map(d=>d.id),sources:c,mixed:o,parts:n})]}),k.jsx("div",{className:o?"mt-6 grid grid-flow-col auto-cols-[minmax(16rem,1fr)] items-start gap-4 overflow-x-auto pb-1":"mt-6",children:n.map(d=>k.jsx(PG,{part:d,mixed:o,groups:t.groups,byId:s,onOpenGroup:i},d.groupIds.join("\0")))})]})}function PG(e){const{part:t,mixed:n,groups:i,byId:o,onOpenGroup:s}=e,l=ef(t.colorIndex);return k.jsxs("section",{className:Me("min-w-0",n&&"rounded-md border border-border py-2"),style:n?HG(l):void 0,"aria-label":t.title,children:[n&&t.title!==void 0?k.jsxs(qr,{className:"mb-1 flex items-center gap-2 px-4 pt-2",children:[k.jsx("span",{"aria-hidden":!0,className:"size-2 shrink-0 rounded-full",style:{backgroundColor:l}}),t.title]}):null,k.jsx("ol",{className:Me("m-0 list-none p-0",!n&&"divide-y divide-border"),children:t.groupIds.map(c=>{const d=o.get(c);if(d===void 0)return null;const f=i.findIndex(p=>p.id===c)+1;return k.jsx("li",{className:n?"mb-2 last:mb-0":void 0,children:k.jsxs(Et,{type:"button",variant:"ghost",className:Me("h-auto w-full min-w-0 items-start justify-start rounded-md px-4 text-left font-normal whitespace-normal",n?"gap-4 py-4":"gap-6 rounded-none py-5"),onClick:()=>s(d.id),children:[k.jsx("span",{className:Me("shrink-0 tabular-nums text-muted-foreground",n?"mt-0.5 font-mono text-[11px]":"font-display text-2xl leading-none opacity-60"),children:hl(f)}),k.jsxs("span",{className:"min-w-0 flex-1",children:[k.jsx("strong",{className:Me("block text-foreground",n?"font-medium":"font-display text-xl leading-snug font-normal"),children:d.title}),k.jsx("span",{className:"mt-1 block leading-relaxed text-muted-foreground",children:k.jsx($a,{text:d.summary})})]})]})},d.id)})})]})}function HG(e){return{"--strand":e,borderLeftWidth:3,borderLeftColor:e,backgroundColor:`color-mix(in srgb, ${e} 8%, var(--card))`}}const jG=3;function BG(e,t=jG){return e.length<=t+1?{shown:[...e],rest:0}:{shown:e.slice(0,t),rest:e.length-t}}function UG(e){if(e.paths.length===0)return null;const{shown:t,rest:n}=BG(e.paths);return k.jsxs("span",{className:"mt-1 flex min-w-0 items-baseline gap-1 font-mono text-[11px] leading-snug text-muted-foreground","aria-hidden":!0,children:[k.jsx("span",{className:"min-w-0 truncate",children:t.map(mk).join(" · ")}),n>0?k.jsxs("span",{className:"shrink-0 opacity-70",children:["+",n]}):null]})}const VG="_itemActive_xc7sz_1",FG="_selection_xc7sz_5",tL={itemActive:VG,selection:FG};function GG(e){const{meta:t,selection:n,parts:i,onSelect:o}=e,l=Iy(i)?fk(i):new Map;return k.jsx("nav",{className:"h-full overflow-auto bg-card py-6",children:k.jsxs("div",{className:"relative",children:[k.jsx("span",{className:tL.selection,"aria-hidden":!0}),k.jsx("ul",{className:"mb-6 list-none p-0",children:k.jsx("li",{children:k.jsx(Wc,{active:n?.kind==="overview",onClick:()=>o({kind:"overview"}),title:"Overview",count:t1(t.document.size)})})}),k.jsxs("ul",{className:"mb-6 list-none p-0",children:[t.groups.map((c,d)=>k.jsx("li",{children:k.jsx(Wc,{active:n?.kind==="group"&&n.id===c.id,onClick:()=>o({kind:"group",id:c.id}),index:hl(d+1),title:c.title,files:c.files,count:c.staleCount>0?`${c.staleCount} stale`:void 0,colorIndex:l.get(c.id)})},c.id)),t.unassigned.hunkCount>0?k.jsx("li",{children:k.jsx(Wc,{active:n?.kind==="unassigned",onClick:()=>o({kind:"unassigned"}),title:"Unassigned",files:t.unassigned.files,count:String(t.unassigned.hunkCount),warn:!0})}):null,t.lockfiles.fileCount>0?k.jsx("li",{children:k.jsx(Wc,{active:n?.kind==="lockfiles",onClick:()=>o({kind:"lockfiles"}),title:"Lockfiles",files:t.lockfiles.files,count:String(t.lockfiles.fileCount),muted:!0})}):null]})]})})}function Wc(e){const t=e.colorIndex,n=e.files??[],i=t!==void 0||e.active,o=t!==void 0?ef(t):e.muted?"var(--muted-foreground)":void 0,s=n.length>0?`${e.title}, ${n.length} files${e.count!==void 0?`, ${e.count}`:""}`:void 0;return k.jsxs(Et,{type:"button",variant:"ghost",onClick:e.onClick,"aria-label":s,style:o!==void 0?{"--strand":o}:void 0,className:Me("relative z-1 mx-3 mb-1 h-auto w-[calc(100%-24px)] min-w-0 items-start justify-start gap-2.5 rounded-md px-3 py-2 text-left font-normal whitespace-normal hover:bg-transparent",!e.active&&"hover:bg-accent",e.active&&Me(tL.itemActive,"text-foreground"),e.warn&&"text-warn hover:text-warn"),children:[i?k.jsx("span",{className:Me("pointer-events-none absolute inset-y-1.5 left-0 z-1 w-0.5 rounded-full bg-[var(--strand,var(--primary))] transition-opacity duration-[var(--motion)] ease-[var(--motion-ease)]",t!==void 0&&!e.active&&"opacity-45"),"aria-hidden":!0}):null,e.index!==void 0?k.jsx("span",{className:"mt-px w-5 shrink-0 font-mono text-[11px] text-muted-foreground tabular-nums",children:e.index}):null,k.jsxs("span",{className:"min-w-0 flex-1 text-left leading-snug",children:[k.jsxs("span",{className:"flex min-w-0 items-start gap-2.5",children:[k.jsx("span",{className:"min-w-0 flex-1",children:e.title}),e.count!==void 0?k.jsx("span",{className:Me("mt-px shrink-0 text-[11px] tabular-nums text-muted-foreground",e.warn&&"text-warn"),children:e.count}):null]}),k.jsx(UG,{paths:n})]})]})}let jm=0;function $G(){return typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches}function qG(e){const t=$G(),n=typeof document>"u"?void 0:document.startViewTransition;return!t&&typeof n=="function"}function Bm(e,t){if(!qG()){e();return}const n=document.startViewTransition;if(typeof n!="function"){e();return}const i=document.documentElement,o=++jm;i.dataset.motion=t;try{n.call(document,()=>{Fd.flushSync(e)}).finished.finally(()=>{o===jm&&delete i.dataset.motion})}catch{o===jm&&delete i.dataset.motion,e()}}function Yc(e){return e.groups.length>0?{kind:"overview"}:{kind:"unassigned"}}function nL(e,t){return`comprehende.group.${e}.${t}`}function WG(e){if(e===null||e==="")return null;try{const t=JSON.parse(e);return typeof t!="object"||t===null||!("kind"in t)?null:t.kind==="overview"?{kind:"overview"}:t.kind==="unassigned"?{kind:"unassigned"}:t.kind==="lockfiles"?{kind:"lockfiles"}:t.kind==="group"&&"id"in t&&typeof t.id=="string"&&t.id!==""?{kind:"group",id:t.id}:null}catch{return null}}function YG(e){return JSON.stringify(e)}function XG(e,t){return t===null||t.kind==="group"&&!e.groups.some(n=>n.id===t.id)||t.kind==="unassigned"&&e.unassigned.hunkCount===0&&e.groups.length>0||t.kind==="lockfiles"&&(e.lockfiles?.fileCount??0)===0?Yc(e):t}function KG(e){return XG(e,ZG(e.resolved.baseSha,e.resolved.headSha))}function QG(e,t){JG(e.resolved.baseSha,e.resolved.headSha,t)}function ZG(e,t){try{return WG(sessionStorage.getItem(nL(e,t)))}catch{return null}}function JG(e,t,n){try{sessionStorage.setItem(nL(e,t),YG(n))}catch{}}function e$(e){const t=[{kind:"overview"},...e.groups.map(n=>({kind:"group",id:n.id}))];return e.unassigned.hunkCount>0&&t.push({kind:"unassigned"}),(e.lockfiles?.fileCount??0)>0&&t.push({kind:"lockfiles"}),t}function Lw(e,t,n,i){if(e===null)return;const o=e$(e),s=o.findIndex(c=>iL(c,t)),l=o[(s+i+o.length)%o.length];l!==void 0&&n(l)}function iL(e,t){return t===null?!1:e.kind==="overview"?t.kind==="overview":e.kind==="unassigned"?t.kind==="unassigned":e.kind==="lockfiles"?t.kind==="lockfiles":t.kind==="group"&&t.id===e.id}function t$(e,t){return`comprehende.viewed.${e}.${t}`}function n$(e){if(e===null||e==="")return new Set;try{const t=JSON.parse(e);return!Array.isArray(t)||t.some(n=>typeof n!="string")?new Set:new Set(t)}catch{return new Set}}function i$(e){return JSON.stringify([...e].sort())}function r$(e,t,n){const i=new Set(e);return n?i.add(t):i.delete(t),i}function Rw(e){try{return rL(e),n$(sessionStorage.getItem(e))}catch{return new Set}}function o$(e,t){try{rL(e),sessionStorage.setItem(e,i$(t))}catch{}}function rL(e){try{localStorage.removeItem(e)}catch{}}function a$(e,t){const n=e!==void 0&&t!==void 0?t$(e,t):null,[i,o]=M.useState(()=>n===null?new Set:Rw(n));M.useEffect(()=>{o(n===null?new Set:Rw(n))},[n]);const s=M.useCallback((l,c)=>{n!==null&&o(d=>{const f=r$(d,l,c);return o$(n,f),f})},[n]);return{viewedPaths:i,setFileViewed:s}}function s$({className:e,...t}){return k.jsx(Xw,{"data-slot":"resizable-panel-group",className:Me("flex h-full w-full aria-[orientation=vertical]:flex-col",e),...t})}function Ow({...e}){return k.jsx(Kw,{"data-slot":"resizable-panel",...e})}function l$({withHandle:e=!1,className:t,...n}){return k.jsx(Qw,{"data-slot":"resizable-handle",className:Me("relative flex w-2 items-center justify-center bg-transparent after:absolute after:inset-y-0 after:left-1/2 after:w-px after:-translate-x-1/2 after:bg-border after:transition-[background-color] after:duration-[var(--motion)] after:ease-[var(--motion-ease)] hover:after:bg-primary/60 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-2 aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-px aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2",t),...n,children:e?k.jsx("div",{className:"bg-border z-10 flex h-8 w-3 items-center justify-center rounded-sm border border-border",children:k.jsx(O1,{className:"size-2.5 text-muted-foreground"})}):null})}function u$(){const[e,t]=M.useState(null),[n,i]=M.useState(null),[o,s]=M.useState(null),[l,c]=M.useState([]),[d,f]=M.useState(null),[p,m]=M.useState(null),[g,v]=M.useState(!1),[x,S]=M.useState(!1),[w,_]=M.useState(.5),[C,T]=M.useState(!0),[D,I]=M.useState(null),[O,P]=M.useState(0),[j,F]=M.useState(null),[Q,G]=M.useState(!0),B=M.useRef(null),{defaultLayout:ee,onLayoutChanged:Z}=lD({id:"comprehende-shell-overlay",panelIds:["stack","main"],onlySaveAfterUserInteractions:!0}),W=M.useCallback(async()=>{G(!0),i(null);try{const pe=await pD();t(pe),s(he=>he??KG(pe))}catch(pe){i(pe instanceof Error?pe.message:String(pe))}finally{G(!1)}},[]);M.useEffect(()=>{W()},[W]),M.useEffect(()=>{e===null||o===null||QG(e,o)},[e,o]);const z=o?.kind==="group"?o.id:o?.kind==="unassigned"?"unassigned":o?.kind==="lockfiles"?"lockfiles":null;M.useEffect(()=>{if(z===null){c([]),f(null);return}let pe=!1;return m(null),mD(z).then(he=>{pe||(c(he.files),f(z),P(0))}).catch(he=>{pe||(c([]),f(z),m(he instanceof Error?he.message:String(he)))}),()=>{pe=!0}},[z]);const q=z!==null&&z!==d,te=M.useCallback(pe=>{if(iL(pe,o)&&j===null)return;Bm(()=>{s(pe),F(null)},j!==null?"scene":"group")},[j,o]),ce=M.useCallback(pe=>{Bm(()=>{F({path:pe,mode:"file",side:"new"})},"scene")},[]),R=M.useCallback(()=>{j!==null&&Bm(()=>F(null),"scene")},[j]),{viewedPaths:H,setFileViewed:Y}=a$(e?.resolved.baseSha,e?.resolved.headSha),N=M.useCallback(pe=>{P(pe),requestAnimationFrame(()=>{requestAnimationFrame(()=>{const he=B.current,lt=(he??document).querySelector(`[data-hunk="${pe}"]`);if(lt===null||he===null){lt?.scrollIntoView({block:"start",behavior:"instant"});return}const Ue=he.getBoundingClientRect(),ft=lt.getBoundingClientRect().top-Ue.top+he.scrollTop-8;he.scrollTo({top:ft,behavior:"instant"})})})},[]);M.useEffect(()=>{const pe=he=>{if(he.metaKey||he.ctrlKey||he.altKey)return;const lt=he.target;if(!(lt instanceof HTMLElement&&(lt.isContentEditable||lt.closest("input, textarea, select")!==null)))if(he.key==="w")v(Ue=>!Ue);else if(he.key==="c")IS(e?.document.sources).length>0&&T(Qe=>!Qe);else if(he.key==="s")S(Ue=>(Ue||_(.5),!Ue));else if(he.key==="r")W();else if(he.key==="o")te({kind:"overview"});else if(he.key==="u")te({kind:"unassigned"});else if(he.key==="Escape")R();else if(he.key==="[")Lw(e,o,te,-1);else if(he.key==="]")Lw(e,o,te,1);else{if(j!==null)return;if(he.key==="j"){const Ue=Sc(l),Qe=Jc(Ue,O),ft=Ue[Math.min(Ue.length-1,Math.max(Qe,0)+1)];ft!==void 0&&N(ft.firstIndex)}else if(he.key==="k"){const Ue=Sc(l),Qe=Jc(Ue,O),ft=Ue[Math.max(0,(Qe===-1?0:Qe)-1)];ft!==void 0&&N(ft.firstIndex)}else if(he.key==="v"){const Ue=Sc(l),Qe=Ue[Math.max(0,Jc(Ue,O))];Qe!==void 0&&Y(Qe.path,!H.has(Qe.path))}}};return window.addEventListener("keydown",pe),()=>window.removeEventListener("keydown",pe)},[O,R,j,l,W,e,N,te,o,Y,H]),M.useEffect(()=>{B.current?.scrollTo({top:0})},[o]);const se=M.useMemo(()=>e===null||o?.kind!=="group"?null:e.groups.find(pe=>pe.id===o.id)??null,[e,o]),de=M.useMemo(()=>Sc(l),[l]),le=M.useMemo(()=>Y8(e?.groups??[]),[e]),be=M.useMemo(()=>fk(le),[le]),Ee=Iy(le),ge=Ee&&se!==null?be.get(se.id):void 0,We=M.useMemo(()=>new Set((e?.staleSources??[]).map(pe=>pe.id)),[e]),Ge=M.useMemo(()=>IS(e?.document.sources),[e]),ot=M.useMemo(()=>(C?Ge:Ge.filter(he=>he.id===D)).map(he=>({...he,stale:We.has(he.id)})),[D,Ge,C,We]),je=M.useMemo(()=>({byId:new Map((e?.document.sources??[]).map(he=>[he.id,he])),staleIds:We,onCite:he=>{if(e===null||!uy(he))return;const lt=x2(e.document,he);lt!==void 0&&(I(he.id),te({kind:"group",id:lt}))}}),[e,te,We]);return Q&&e===null?k.jsxs(Dw,{children:[k.jsx("p",{className:"mb-5",children:k.jsx(ZA,{})}),k.jsx(Wl,{layout:"page",label:Mo.review})]}):n!==null&&e===null?k.jsx(Dw,{className:"text-warn",children:n}):e===null?null:k.jsx(vN,{children:k.jsx(H8,{value:je,children:k.jsxs("div",{className:"flex h-full min-h-0 flex-col","aria-busy":Q||q,children:[k.jsx(SG,{meta:e,wrap:g,split:x,onWrap:()=>v(pe=>!pe),onUnified:()=>S(!1),onSplit:()=>{S(!0),x||_(.5)},onRefresh:()=>{W()},busy:Q,comments:C,onComments:Ge.length>0?()=>T(pe=>!pe):void 0}),k.jsxs(s$,{className:"min-h-0 flex-1",defaultLayout:ee,onLayoutChanged:Z,children:[k.jsx(Ow,{id:"stack",defaultSize:"20",minSize:"14%",className:"min-h-0 min-w-0",children:k.jsx(GG,{meta:e,selection:o,parts:le,onSelect:te})}),k.jsx(l$,{withHandle:!0}),k.jsx(Ow,{id:"main",defaultSize:"80",minSize:"40%",className:"min-h-0 min-w-0",children:k.jsx("div",{className:"h-full min-h-0 [[data-motion=scene]_&]:[view-transition-name:review-scene]",children:j!==null?k.jsx(NG,{inspector:j,wrap:g,setInspector:F,onClose:R}):k.jsx("main",{ref:B,className:"h-full overflow-auto px-10 py-8","aria-busy":q,children:o?.kind==="overview"?k.jsx(zG,{meta:e,parts:le,onOpenGroup:pe=>te({kind:"group",id:pe})}):k.jsx(vG,{group:se,bucket:o?.kind==="lockfiles"?"lockfiles":o?.kind==="unassigned"?"unassigned":void 0,groups:e.groups,mixed:Ee,strandColor:ge!==void 0?ef(ge):void 0,loading:q,hunkError:p,files:q?[]:de,activeHunk:O,split:x,splitRatio:w,wrap:g,viewedPaths:H,onScrollToHunk:N,onOpenGroup:pe=>te({kind:"group",id:pe}),onOpenFile:ce,onSplitRatio:_,onViewed:Y,document:e.document,comments:ot,focusCommentId:D??void 0})})})})]})]})})})}function Dw(e){return k.jsx("div",{className:Me("px-10 py-8 text-muted-foreground",e.className),children:e.children})}const oL=document.getElementById("root");if(oL===null)throw new Error("missing #root");RO.createRoot(oL).render(k.jsx(M.StrictMode,{children:k.jsx(B7,{children:k.jsx(V7,{children:k.jsx(u$,{})})})}));
|