comprehende 0.1.0 → 0.3.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 +20 -49
- package/dist/api/error.js +8 -0
- package/dist/api/live.js +249 -0
- package/dist/api/paths.js +96 -0
- package/dist/api/snapshot.js +45 -0
- package/dist/api/types.js +1 -0
- package/dist/cli/args.js +7 -1
- package/dist/cli/commands.js +6 -0
- package/dist/cli/main.js +22 -10
- package/dist/git/blob.js +21 -0
- package/dist/git/diff.js +44 -2
- package/dist/git/exec.js +29 -3
- package/dist/git/lfs.js +39 -0
- package/dist/schema/cli-pin.js +18 -0
- package/dist/schema/image-diff.js +51 -0
- package/dist/schema/image.js +35 -0
- package/dist/schema/parse.js +5 -1
- package/dist/schema/skill-sync.js +90 -0
- package/dist/server/http.js +83 -197
- package/dist/ui/assets/index-BxIxxAYx.css +1 -0
- package/dist/ui/assets/index-D4bY-beP.js +1598 -0
- package/dist/ui/index.html +16 -2
- package/package.json +15 -11
- package/skills/comprehende/SKILL.md +44 -29
- package/skills/comprehende/references/example.md +21 -0
- package/skills/comprehende/references/review.schema.json +6 -1
- package/dist/cli/args.d.ts +0 -20
- package/dist/cli/args.js.map +0 -1
- package/dist/cli/commands.d.ts +0 -12
- package/dist/cli/commands.js.map +0 -1
- package/dist/cli/main.d.ts +0 -2
- package/dist/cli/main.js.map +0 -1
- package/dist/git/blame.d.ts +0 -8
- package/dist/git/blame.js.map +0 -1
- package/dist/git/diff.d.ts +0 -13
- package/dist/git/diff.js.map +0 -1
- package/dist/git/exec.d.ts +0 -10
- package/dist/git/exec.js.map +0 -1
- package/dist/git/log.d.ts +0 -8
- package/dist/git/log.js.map +0 -1
- package/dist/git/repo.d.ts +0 -7
- package/dist/git/repo.js.map +0 -1
- package/dist/git/show.d.ts +0 -2
- package/dist/git/show.js.map +0 -1
- package/dist/package-root.d.ts +0 -2
- package/dist/package-root.js.map +0 -1
- package/dist/review/coverage.d.ts +0 -20
- package/dist/review/coverage.js.map +0 -1
- package/dist/review/effort.d.ts +0 -1
- package/dist/review/effort.js +0 -17
- package/dist/review/effort.js.map +0 -1
- package/dist/review/generate.d.ts +0 -20
- package/dist/review/generate.js +0 -290
- package/dist/review/generate.js.map +0 -1
- package/dist/schema/blame-runs.d.ts +0 -14
- package/dist/schema/blame-runs.js.map +0 -1
- package/dist/schema/hunk-meta.d.ts +0 -26
- package/dist/schema/hunk-meta.js.map +0 -1
- package/dist/schema/hunk-patch.d.ts +0 -2
- package/dist/schema/hunk-patch.js +0 -49
- package/dist/schema/hunk-patch.js.map +0 -1
- package/dist/schema/identity.d.ts +0 -3
- package/dist/schema/identity.js.map +0 -1
- package/dist/schema/parse.d.ts +0 -13
- package/dist/schema/parse.js.map +0 -1
- package/dist/schema/skill-paths.d.ts +0 -7
- package/dist/schema/skill-paths.js.map +0 -1
- package/dist/schema/types.d.ts +0 -73
- package/dist/schema/types.js.map +0 -1
- package/dist/server/http.d.ts +0 -12
- package/dist/server/http.js.map +0 -1
- package/dist/ui/assets/index-BCZwzr3E.js +0 -1585
- package/dist/ui/assets/index-DsGDgUsX.css +0 -1
|
@@ -0,0 +1,1598 @@
|
|
|
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 _T(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const s=Object.getOwnPropertyDescriptor(r,a);s&&Object.defineProperty(e,a,s.get?s:{enumerable:!0,get:()=>r[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const s of a)if(s.type==="childList")for(const u of s.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function n(a){const s={};return a.integrity&&(s.integrity=a.integrity),a.referrerPolicy&&(s.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?s.credentials="include":a.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(a){if(a.ep)return;a.ep=!0;const s=n(a);fetch(a.href,s)}})();function vC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var kh={exports:{}},_s={};var xb;function CT(){if(xb)return _s;xb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,s){var u=null;if(s!==void 0&&(u=""+s),a.key!==void 0&&(u=""+a.key),"key"in a){s={};for(var d in a)d!=="key"&&(s[d]=a[d])}else s=a;return a=s.ref,{$$typeof:e,type:r,key:u,ref:a!==void 0?a:null,props:s}}return _s.Fragment=t,_s.jsx=n,_s.jsxs=n,_s}var Eb;function xT(){return Eb||(Eb=1,kh.exports=CT()),kh.exports}var A=xT(),Lh={exports:{}},Se={};var wb;function ET(){if(wb)return Se;wb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),y=Symbol.iterator;function b(M){return M===null||typeof M!="object"?null:(M=y&&M[y]||M["@@iterator"],typeof M=="function"?M:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,w={};function x(M,q,oe){this.props=M,this.context=q,this.refs=w,this.updater=oe||S}x.prototype.isReactComponent={},x.prototype.setState=function(M,q){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,q,"setState")},x.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function E(){}E.prototype=x.prototype;function L(M,q,oe){this.props=M,this.context=q,this.refs=w,this.updater=oe||S}var R=L.prototype=new E;R.constructor=L,_(R,x.prototype),R.isPureReactComponent=!0;var D=Array.isArray;function N(){}var H={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function W(M,q,oe){var le=oe.ref;return{$$typeof:e,type:M,key:q,ref:le!==void 0?le:null,props:oe}}function ee(M,q){return W(M.type,q,M.props)}function te(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function V(M){var q={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(oe){return q[oe]})}var Z=/\/+/g;function ie(M,q){return typeof M=="object"&&M!==null&&M.key!=null?V(""+M.key):q.toString(36)}function se(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(N,N):(M.status="pending",M.then(function(q){M.status==="pending"&&(M.status="fulfilled",M.value=q)},function(q){M.status==="pending"&&(M.status="rejected",M.reason=q)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function I(M,q,oe,le,de){var re=typeof M;(re==="undefined"||re==="boolean")&&(M=null);var ce=!1;if(M===null)ce=!0;else switch(re){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(M.$$typeof){case e:case t:ce=!0;break;case p:return ce=M._init,I(ce(M._payload),q,oe,le,de)}}if(ce)return de=de(M),ce=le===""?"."+ie(M,0):le,D(de)?(oe="",ce!=null&&(oe=ce.replace(Z,"$&/")+"/"),I(de,q,oe,"",function(Fe){return Fe})):de!=null&&(te(de)&&(de=ee(de,oe+(de.key==null||M&&M.key===de.key?"":(""+de.key).replace(Z,"$&/")+"/")+ce)),q.push(de)),1;ce=0;var ke=le===""?".":le+":";if(D(M))for(var fe=0;fe<M.length;fe++)le=M[fe],re=ke+ie(le,fe),ce+=I(le,q,oe,re,de);else if(fe=b(M),typeof fe=="function")for(M=fe.call(M),fe=0;!(le=M.next()).done;)le=le.value,re=ke+ie(le,fe++),ce+=I(le,q,oe,re,de);else if(re==="object"){if(typeof M.then=="function")return I(se(M),q,oe,le,de);throw q=String(M),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return ce}function G(M,q,oe){if(M==null)return M;var le=[],de=0;return I(M,le,"","",function(re){return q.call(oe,re,de++)}),le}function X(M){if(M._status===-1){var q=M._result;q=q(),q.then(function(oe){(M._status===0||M._status===-1)&&(M._status=1,M._result=oe)},function(oe){(M._status===0||M._status===-1)&&(M._status=2,M._result=oe)}),M._status===-1&&(M._status=0,M._result=q)}if(M._status===1)return M._result.default;throw M._result}var ue=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},Y={map:G,forEach:function(M,q,oe){G(M,function(){q.apply(this,arguments)},oe)},count:function(M){var q=0;return G(M,function(){q++}),q},toArray:function(M){return G(M,function(q){return q})||[]},only:function(M){if(!te(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return Se.Activity=m,Se.Children=Y,Se.Component=x,Se.Fragment=n,Se.Profiler=a,Se.PureComponent=L,Se.StrictMode=r,Se.Suspense=f,Se.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,Se.__COMPILER_RUNTIME={__proto__:null,c:function(M){return H.H.useMemoCache(M)}},Se.cache=function(M){return function(){return M.apply(null,arguments)}},Se.cacheSignal=function(){return null},Se.cloneElement=function(M,q,oe){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var le=_({},M.props),de=M.key;if(q!=null)for(re in q.key!==void 0&&(de=""+q.key),q)!U.call(q,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&q.ref===void 0||(le[re]=q[re]);var re=arguments.length-2;if(re===1)le.children=oe;else if(1<re){for(var ce=Array(re),ke=0;ke<re;ke++)ce[ke]=arguments[ke+2];le.children=ce}return W(M.type,de,le)},Se.createContext=function(M){return M={$$typeof:u,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:s,_context:M},M},Se.createElement=function(M,q,oe){var le,de={},re=null;if(q!=null)for(le in q.key!==void 0&&(re=""+q.key),q)U.call(q,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(de[le]=q[le]);var ce=arguments.length-2;if(ce===1)de.children=oe;else if(1<ce){for(var ke=Array(ce),fe=0;fe<ce;fe++)ke[fe]=arguments[fe+2];de.children=ke}if(M&&M.defaultProps)for(le in ce=M.defaultProps,ce)de[le]===void 0&&(de[le]=ce[le]);return W(M,re,de)},Se.createRef=function(){return{current:null}},Se.forwardRef=function(M){return{$$typeof:d,render:M}},Se.isValidElement=te,Se.lazy=function(M){return{$$typeof:p,_payload:{_status:-1,_result:M},_init:X}},Se.memo=function(M,q){return{$$typeof:h,type:M,compare:q===void 0?null:q}},Se.startTransition=function(M){var q=H.T,oe={};H.T=oe;try{var le=M(),de=H.S;de!==null&&de(oe,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(N,ue)}catch(re){ue(re)}finally{q!==null&&oe.types!==null&&(q.types=oe.types),H.T=q}},Se.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},Se.use=function(M){return H.H.use(M)},Se.useActionState=function(M,q,oe){return H.H.useActionState(M,q,oe)},Se.useCallback=function(M,q){return H.H.useCallback(M,q)},Se.useContext=function(M){return H.H.useContext(M)},Se.useDebugValue=function(){},Se.useDeferredValue=function(M,q){return H.H.useDeferredValue(M,q)},Se.useEffect=function(M,q){return H.H.useEffect(M,q)},Se.useEffectEvent=function(M){return H.H.useEffectEvent(M)},Se.useId=function(){return H.H.useId()},Se.useImperativeHandle=function(M,q,oe){return H.H.useImperativeHandle(M,q,oe)},Se.useInsertionEffect=function(M,q){return H.H.useInsertionEffect(M,q)},Se.useLayoutEffect=function(M,q){return H.H.useLayoutEffect(M,q)},Se.useMemo=function(M,q){return H.H.useMemo(M,q)},Se.useOptimistic=function(M,q){return H.H.useOptimistic(M,q)},Se.useReducer=function(M,q,oe){return H.H.useReducer(M,q,oe)},Se.useRef=function(M){return H.H.useRef(M)},Se.useState=function(M){return H.H.useState(M)},Se.useSyncExternalStore=function(M,q,oe){return H.H.useSyncExternalStore(M,q,oe)},Se.useTransition=function(){return H.H.useTransition()},Se.version="19.2.8",Se}var kb;function Am(){return kb||(kb=1,Lh.exports=ET()),Lh.exports}var O=Am();const wT=vC(O),Zs=_T({__proto__:null,default:wT},[O]);var Th={exports:{}},Cs={},Ah={exports:{}},Rh={};var Lb;function kT(){return Lb||(Lb=1,(function(e){function t(I,G){var X=I.length;I.push(G);e:for(;0<X;){var ue=X-1>>>1,Y=I[ue];if(0<a(Y,G))I[ue]=G,I[X]=Y,X=ue;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var G=I[0],X=I.pop();if(X!==G){I[0]=X;e:for(var ue=0,Y=I.length,M=Y>>>1;ue<M;){var q=2*(ue+1)-1,oe=I[q],le=q+1,de=I[le];if(0>a(oe,X))le<Y&&0>a(de,oe)?(I[ue]=de,I[le]=X,ue=le):(I[ue]=oe,I[q]=X,ue=q);else if(le<Y&&0>a(de,X))I[ue]=de,I[le]=X,ue=le;else break e}}return G}function a(I,G){var X=I.sortIndex-G.sortIndex;return X!==0?X:I.id-G.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 u=Date,d=u.now();e.unstable_now=function(){return u.now()-d}}var f=[],h=[],p=1,m=null,y=3,b=!1,S=!1,_=!1,w=!1,x=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function R(I){for(var G=n(h);G!==null;){if(G.callback===null)r(h);else if(G.startTime<=I)r(h),G.sortIndex=G.expirationTime,t(f,G);else break;G=n(h)}}function D(I){if(_=!1,R(I),!S)if(n(f)!==null)S=!0,N||(N=!0,V());else{var G=n(h);G!==null&&se(D,G.startTime-I)}}var N=!1,H=-1,U=5,W=-1;function ee(){return w?!0:!(e.unstable_now()-W<U)}function te(){if(w=!1,N){var I=e.unstable_now();W=I;var G=!0;try{e:{S=!1,_&&(_=!1,E(H),H=-1),b=!0;var X=y;try{t:{for(R(I),m=n(f);m!==null&&!(m.expirationTime>I&&ee());){var ue=m.callback;if(typeof ue=="function"){m.callback=null,y=m.priorityLevel;var Y=ue(m.expirationTime<=I);if(I=e.unstable_now(),typeof Y=="function"){m.callback=Y,R(I),G=!0;break t}m===n(f)&&r(f),R(I)}else r(f);m=n(f)}if(m!==null)G=!0;else{var M=n(h);M!==null&&se(D,M.startTime-I),G=!1}}break e}finally{m=null,y=X,b=!1}G=void 0}}finally{G?V():N=!1}}}var V;if(typeof L=="function")V=function(){L(te)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,ie=Z.port2;Z.port1.onmessage=te,V=function(){ie.postMessage(null)}}else V=function(){x(te,0)};function se(I,G){H=x(function(){I(e.unstable_now())},G)}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(I){I.callback=null},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(I){switch(y){case 1:case 2:case 3:var G=3;break;default:G=y}var X=y;y=G;try{return I()}finally{y=X}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(I,G){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var X=y;y=I;try{return G()}finally{y=X}},e.unstable_scheduleCallback=function(I,G,X){var ue=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?ue+X:ue):X=ue,I){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=X+Y,I={id:p++,callback:G,priorityLevel:I,startTime:X,expirationTime:Y,sortIndex:-1},X>ue?(I.sortIndex=X,t(h,I),n(f)===null&&I===n(h)&&(_?(E(H),H=-1):_=!0,se(D,X-ue))):(I.sortIndex=Y,t(f,I),S||b||(S=!0,N||(N=!0,V()))),I},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(I){var G=y;return function(){var X=y;y=G;try{return I.apply(this,arguments)}finally{y=X}}}})(Rh)),Rh}var Tb;function LT(){return Tb||(Tb=1,Ah.exports=kT()),Ah.exports}var Oh={exports:{}},At={};var Ab;function TT(){if(Ab)return At;Ab=1;var e=Am();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={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},a=Symbol.for("react.portal");function s(f,h,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:m==null?null:""+m,children:f,containerInfo:h,implementation:p}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return At.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,At.createPortal=function(f,h){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return s(f,h,null,p)},At.flushSync=function(f){var h=u.T,p=r.p;try{if(u.T=null,r.p=2,f)return f()}finally{u.T=h,r.p=p,r.d.f()}},At.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(f,h))},At.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},At.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var p=h.as,m=d(p,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?r.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:m,integrity:y,fetchPriority:b}):p==="script"&&r.d.X(f,{crossOrigin:m,integrity:y,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},At.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=d(h.as,h.crossOrigin);r.d.M(f,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(f)},At.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,m=d(p,h.crossOrigin);r.d.L(f,p,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},At.preloadModule=function(f,h){if(typeof f=="string")if(h){var p=d(h.as,h.crossOrigin);r.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(f)},At.requestFormReset=function(f){r.d.r(f)},At.unstable_batchedUpdates=function(f,h){return f(h)},At.useFormState=function(f,h,p){return u.H.useFormState(f,h,p)},At.useFormStatus=function(){return u.H.useHostTransitionStatus()},At.version="19.2.8",At}var Rb;function yC(){if(Rb)return Oh.exports;Rb=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(),Oh.exports=TT(),Oh.exports}var Ob;function AT(){if(Ob)return Cs;Ob=1;var e=LT(),t=Am(),n=yC();function r(i){var o="https://react.dev/errors/"+i;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)o+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+i+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function s(i){var o=i,l=i;if(i.alternate)for(;o.return;)o=o.return;else{i=o;do o=i,(o.flags&4098)!==0&&(l=o.return),i=o.return;while(i)}return o.tag===3?l:null}function u(i){if(i.tag===13){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function d(i){if(i.tag===31){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function f(i){if(s(i)!==i)throw Error(r(188))}function h(i){var o=i.alternate;if(!o){if(o=s(i),o===null)throw Error(r(188));return o!==i?null:i}for(var l=i,c=o;;){var g=l.return;if(g===null)break;var v=g.alternate;if(v===null){if(c=g.return,c!==null){l=c;continue}break}if(g.child===v.child){for(v=g.child;v;){if(v===l)return f(g),i;if(v===c)return f(g),o;v=v.sibling}throw Error(r(188))}if(l.return!==c.return)l=g,c=v;else{for(var C=!1,T=g.child;T;){if(T===l){C=!0,l=g,c=v;break}if(T===c){C=!0,c=g,l=v;break}T=T.sibling}if(!C){for(T=v.child;T;){if(T===l){C=!0,l=v,c=g;break}if(T===c){C=!0,c=v,l=g;break}T=T.sibling}if(!C)throw Error(r(189))}}if(l.alternate!==c)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?i:o}function p(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i;for(i=i.child;i!==null;){if(o=p(i),o!==null)return o;i=i.sibling}return null}var m=Object.assign,y=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),L=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),ee=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function V(i){return i===null||typeof i!="object"?null:(i=te&&i[te]||i["@@iterator"],typeof i=="function"?i:null)}var Z=Symbol.for("react.client.reference");function ie(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===Z?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case _:return"Fragment";case x:return"Profiler";case w:return"StrictMode";case D:return"Suspense";case N:return"SuspenseList";case W:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case S:return"Portal";case L:return i.displayName||"Context";case E:return(i._context.displayName||"Context")+".Consumer";case R:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case H:return o=i.displayName||null,o!==null?o:ie(i.type)||"Memo";case U:o=i._payload,i=i._init;try{return ie(i(o))}catch{}}return null}var se=Array.isArray,I=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},ue=[],Y=-1;function M(i){return{current:i}}function q(i){0>Y||(i.current=ue[Y],ue[Y]=null,Y--)}function oe(i,o){Y++,ue[Y]=i.current,i.current=o}var le=M(null),de=M(null),re=M(null),ce=M(null);function ke(i,o){switch(oe(re,o),oe(de,i),oe(le,null),o.nodeType){case 9:case 11:i=(i=o.documentElement)&&(i=i.namespaceURI)?qy(i):0;break;default:if(i=o.tagName,o=o.namespaceURI)o=qy(o),i=Wy(o,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}q(le),oe(le,i)}function fe(){q(le),q(de),q(re)}function Fe(i){i.memoizedState!==null&&oe(ce,i);var o=le.current,l=Wy(o,i.type);o!==l&&(oe(de,i),oe(le,l))}function Ge(i){de.current===i&&(q(le),q(de)),ce.current===i&&(q(ce),vs._currentValue=X)}var Ze,Ne;function ze(i){if(Ze===void 0)try{throw Error()}catch(l){var o=l.stack.trim().match(/\n( *(at )?)/);Ze=o&&o[1]||"",Ne=-1<l.stack.indexOf(`
|
|
3
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
+
`+Ze+i+Ne}var Je=!1;function wn(i,o){if(!i||Je)return"";Je=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(o){var ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(K){var $=K}Reflect.construct(i,[],ne)}else{try{ne.call()}catch(K){$=K}i.call(ne.prototype)}}else{try{throw Error()}catch(K){$=K}(ne=i())&&typeof ne.catch=="function"&&ne.catch(function(){})}}catch(K){if(K&&$&&typeof K.stack=="string")return[K.stack,$.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=c.DetermineComponentFrameRoot(),C=v[0],T=v[1];if(C&&T){var z=C.split(`
|
|
5
|
+
`),F=T.split(`
|
|
6
|
+
`);for(g=c=0;c<z.length&&!z[c].includes("DetermineComponentFrameRoot");)c++;for(;g<F.length&&!F[g].includes("DetermineComponentFrameRoot");)g++;if(c===z.length||g===F.length)for(c=z.length-1,g=F.length-1;1<=c&&0<=g&&z[c]!==F[g];)g--;for(;1<=c&&0<=g;c--,g--)if(z[c]!==F[g]){if(c!==1||g!==1)do if(c--,g--,0>g||z[c]!==F[g]){var Q=`
|
|
7
|
+
`+z[c].replace(" at new "," at ");return i.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",i.displayName)),Q}while(1<=c&&0<=g);break}}}finally{Je=!1,Error.prepareStackTrace=l}return(l=i?i.displayName||i.name:"")?ze(l):""}function Kt(i,o){switch(i.tag){case 26:case 27:case 5:return ze(i.type);case 16:return ze("Lazy");case 13:return i.child!==o&&o!==null?ze("Suspense Fallback"):ze("Suspense");case 19:return ze("SuspenseList");case 0:case 15:return wn(i.type,!1);case 11:return wn(i.type.render,!1);case 1:return wn(i.type,!0);case 31:return ze("Activity");default:return""}}function Pt(i){try{var o="",l=null;do o+=Kt(i,l),l=i,i=i.return;while(i);return o}catch(c){return`
|
|
8
|
+
Error generating stack: `+c.message+`
|
|
9
|
+
`+c.stack}}var cn=Object.prototype.hasOwnProperty,vt=e.unstable_scheduleCallback,ji=e.unstable_cancelCallback,J1=e.unstable_shouldYield,ek=e.unstable_requestPaint,Xt=e.unstable_now,tk=e.unstable_getCurrentPriorityLevel,Eg=e.unstable_ImmediatePriority,wg=e.unstable_UserBlockingPriority,al=e.unstable_NormalPriority,nk=e.unstable_LowPriority,kg=e.unstable_IdlePriority,ik=e.log,rk=e.unstable_setDisableYieldValue,Aa=null,Qt=null;function Vi(i){if(typeof ik=="function"&&rk(i),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode(Aa,i)}catch{}}var Zt=Math.clz32?Math.clz32:sk,ok=Math.log,ak=Math.LN2;function sk(i){return i>>>=0,i===0?32:31-(ok(i)/ak|0)|0}var sl=256,ll=262144,ul=4194304;function wr(i){var o=i&42;if(o!==0)return o;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function cl(i,o,l){var c=i.pendingLanes;if(c===0)return 0;var g=0,v=i.suspendedLanes,C=i.pingedLanes;i=i.warmLanes;var T=c&134217727;return T!==0?(c=T&~v,c!==0?g=wr(c):(C&=T,C!==0?g=wr(C):l||(l=T&~i,l!==0&&(g=wr(l))))):(T=c&~v,T!==0?g=wr(T):C!==0?g=wr(C):l||(l=c&~i,l!==0&&(g=wr(l)))),g===0?0:o!==0&&o!==g&&(o&v)===0&&(v=g&-g,l=o&-o,v>=l||v===32&&(l&4194048)!==0)?o:g}function Ra(i,o){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&o)===0}function lk(i,o){switch(i){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 Lg(){var i=ul;return ul<<=1,(ul&62914560)===0&&(ul=4194304),i}function hd(i){for(var o=[],l=0;31>l;l++)o.push(i);return o}function Oa(i,o){i.pendingLanes|=o,o!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function uk(i,o,l,c,g,v){var C=i.pendingLanes;i.pendingLanes=l,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=l,i.entangledLanes&=l,i.errorRecoveryDisabledLanes&=l,i.shellSuspendCounter=0;var T=i.entanglements,z=i.expirationTimes,F=i.hiddenUpdates;for(l=C&~l;0<l;){var Q=31-Zt(l),ne=1<<Q;T[Q]=0,z[Q]=-1;var $=F[Q];if($!==null)for(F[Q]=null,Q=0;Q<$.length;Q++){var K=$[Q];K!==null&&(K.lane&=-536870913)}l&=~ne}c!==0&&Tg(i,c,0),v!==0&&g===0&&i.tag!==0&&(i.suspendedLanes|=v&~(C&~o))}function Tg(i,o,l){i.pendingLanes|=o,i.suspendedLanes&=~o;var c=31-Zt(o);i.entangledLanes|=o,i.entanglements[c]=i.entanglements[c]|1073741824|l&261930}function Ag(i,o){var l=i.entangledLanes|=o;for(i=i.entanglements;l;){var c=31-Zt(l),g=1<<c;g&o|i[c]&o&&(i[c]|=o),l&=~g}}function Rg(i,o){var l=o&-o;return l=(l&42)!==0?1:pd(l),(l&(i.suspendedLanes|o))!==0?0:l}function pd(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function md(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Og(){var i=G.p;return i!==0?i:(i=window.event,i===void 0?32:gb(i.type))}function Dg(i,o){var l=G.p;try{return G.p=i,o()}finally{G.p=l}}var Bi=Math.random().toString(36).slice(2),Et="__reactFiber$"+Bi,Ut="__reactProps$"+Bi,bo="__reactContainer$"+Bi,gd="__reactEvents$"+Bi,ck="__reactListeners$"+Bi,dk="__reactHandles$"+Bi,Mg="__reactResources$"+Bi,Da="__reactMarker$"+Bi;function vd(i){delete i[Et],delete i[Ut],delete i[gd],delete i[ck],delete i[dk]}function So(i){var o=i[Et];if(o)return o;for(var l=i.parentNode;l;){if(o=l[bo]||l[Et]){if(l=o.alternate,o.child!==null||l!==null&&l.child!==null)for(i=eb(i);i!==null;){if(l=i[Et])return l;i=eb(i)}return o}i=l,l=i.parentNode}return null}function _o(i){if(i=i[Et]||i[bo]){var o=i.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return i}return null}function Ma(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i.stateNode;throw Error(r(33))}function Co(i){var o=i[Mg];return o||(o=i[Mg]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function yt(i){i[Da]=!0}var Ng=new Set,Ig={};function kr(i,o){xo(i,o),xo(i+"Capture",o)}function xo(i,o){for(Ig[i]=o,i=0;i<o.length;i++)Ng.add(o[i])}var fk=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]*$"),zg={},Hg={};function hk(i){return cn.call(Hg,i)?!0:cn.call(zg,i)?!1:fk.test(i)?Hg[i]=!0:(zg[i]=!0,!1)}function dl(i,o,l){if(hk(o))if(l===null)i.removeAttribute(o);else{switch(typeof l){case"undefined":case"function":case"symbol":i.removeAttribute(o);return;case"boolean":var c=o.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){i.removeAttribute(o);return}}i.setAttribute(o,""+l)}}function fl(i,o,l){if(l===null)i.removeAttribute(o);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttribute(o,""+l)}}function ri(i,o,l,c){if(c===null)i.removeAttribute(l);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(l);return}i.setAttributeNS(o,l,""+c)}}function dn(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Pg(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function pk(i,o,l){var c=Object.getOwnPropertyDescriptor(i.constructor.prototype,o);if(!i.hasOwnProperty(o)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var g=c.get,v=c.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return g.call(this)},set:function(C){l=""+C,v.call(this,C)}}),Object.defineProperty(i,o,{enumerable:c.enumerable}),{getValue:function(){return l},setValue:function(C){l=""+C},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function yd(i){if(!i._valueTracker){var o=Pg(i)?"checked":"value";i._valueTracker=pk(i,o,""+i[o])}}function Ug(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var l=o.getValue(),c="";return i&&(c=Pg(i)?i.checked?"true":"false":i.value),i=c,i!==l?(o.setValue(i),!0):!1}function hl(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var mk=/[\n"\\]/g;function fn(i){return i.replace(mk,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function bd(i,o,l,c,g,v,C,T){i.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?i.type=C:i.removeAttribute("type"),o!=null?C==="number"?(o===0&&i.value===""||i.value!=o)&&(i.value=""+dn(o)):i.value!==""+dn(o)&&(i.value=""+dn(o)):C!=="submit"&&C!=="reset"||i.removeAttribute("value"),o!=null?Sd(i,C,dn(o)):l!=null?Sd(i,C,dn(l)):c!=null&&i.removeAttribute("value"),g==null&&v!=null&&(i.defaultChecked=!!v),g!=null&&(i.checked=g&&typeof g!="function"&&typeof g!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?i.name=""+dn(T):i.removeAttribute("name")}function jg(i,o,l,c,g,v,C,T){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(i.type=v),o!=null||l!=null){if(!(v!=="submit"&&v!=="reset"||o!=null)){yd(i);return}l=l!=null?""+dn(l):"",o=o!=null?""+dn(o):l,T||o===i.value||(i.value=o),i.defaultValue=o}c=c??g,c=typeof c!="function"&&typeof c!="symbol"&&!!c,i.checked=T?i.checked:!!c,i.defaultChecked=!!c,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(i.name=C),yd(i)}function Sd(i,o,l){o==="number"&&hl(i.ownerDocument)===i||i.defaultValue===""+l||(i.defaultValue=""+l)}function Eo(i,o,l,c){if(i=i.options,o){o={};for(var g=0;g<l.length;g++)o["$"+l[g]]=!0;for(l=0;l<i.length;l++)g=o.hasOwnProperty("$"+i[l].value),i[l].selected!==g&&(i[l].selected=g),g&&c&&(i[l].defaultSelected=!0)}else{for(l=""+dn(l),o=null,g=0;g<i.length;g++){if(i[g].value===l){i[g].selected=!0,c&&(i[g].defaultSelected=!0);return}o!==null||i[g].disabled||(o=i[g])}o!==null&&(o.selected=!0)}}function Vg(i,o,l){if(o!=null&&(o=""+dn(o),o!==i.value&&(i.value=o),l==null)){i.defaultValue!==o&&(i.defaultValue=o);return}i.defaultValue=l!=null?""+dn(l):""}function Bg(i,o,l,c){if(o==null){if(c!=null){if(l!=null)throw Error(r(92));if(se(c)){if(1<c.length)throw Error(r(93));c=c[0]}l=c}l==null&&(l=""),o=l}l=dn(o),i.defaultValue=l,c=i.textContent,c===l&&c!==""&&c!==null&&(i.value=c),yd(i)}function wo(i,o){if(o){var l=i.firstChild;if(l&&l===i.lastChild&&l.nodeType===3){l.nodeValue=o;return}}i.textContent=o}var gk=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 Fg(i,o,l){var c=o.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?c?i.setProperty(o,""):o==="float"?i.cssFloat="":i[o]="":c?i.setProperty(o,l):typeof l!="number"||l===0||gk.has(o)?o==="float"?i.cssFloat=l:i[o]=(""+l).trim():i[o]=l+"px"}function Gg(i,o,l){if(o!=null&&typeof o!="object")throw Error(r(62));if(i=i.style,l!=null){for(var c in l)!l.hasOwnProperty(c)||o!=null&&o.hasOwnProperty(c)||(c.indexOf("--")===0?i.setProperty(c,""):c==="float"?i.cssFloat="":i[c]="");for(var g in o)c=o[g],o.hasOwnProperty(g)&&l[g]!==c&&Fg(i,g,c)}else for(var v in o)o.hasOwnProperty(v)&&Fg(i,v,o[v])}function _d(i){if(i.indexOf("-")===-1)return!1;switch(i){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 vk=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"]]),yk=/^[\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 pl(i){return yk.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function oi(){}var Cd=null;function xd(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var ko=null,Lo=null;function $g(i){var o=_o(i);if(o&&(i=o.stateNode)){var l=i[Ut]||null;e:switch(i=o.stateNode,o.type){case"input":if(bd(i,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),o=l.name,l.type==="radio"&&o!=null){for(l=i;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+fn(""+o)+'"][type="radio"]'),o=0;o<l.length;o++){var c=l[o];if(c!==i&&c.form===i.form){var g=c[Ut]||null;if(!g)throw Error(r(90));bd(c,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(o=0;o<l.length;o++)c=l[o],c.form===i.form&&Ug(c)}break e;case"textarea":Vg(i,l.value,l.defaultValue);break e;case"select":o=l.value,o!=null&&Eo(i,!!l.multiple,o,!1)}}}var Ed=!1;function qg(i,o,l){if(Ed)return i(o,l);Ed=!0;try{var c=i(o);return c}finally{if(Ed=!1,(ko!==null||Lo!==null)&&(tu(),ko&&(o=ko,i=Lo,Lo=ko=null,$g(o),i)))for(o=0;o<i.length;o++)$g(i[o])}}function Na(i,o){var l=i.stateNode;if(l===null)return null;var c=l[Ut]||null;if(c===null)return null;l=c[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(i=i.type,c=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!c;break e;default:i=!1}if(i)return null;if(l&&typeof l!="function")throw Error(r(231,o,typeof l));return l}var ai=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wd=!1;if(ai)try{var Ia={};Object.defineProperty(Ia,"passive",{get:function(){wd=!0}}),window.addEventListener("test",Ia,Ia),window.removeEventListener("test",Ia,Ia)}catch{wd=!1}var Fi=null,kd=null,ml=null;function Wg(){if(ml)return ml;var i,o=kd,l=o.length,c,g="value"in Fi?Fi.value:Fi.textContent,v=g.length;for(i=0;i<l&&o[i]===g[i];i++);var C=l-i;for(c=1;c<=C&&o[l-c]===g[v-c];c++);return ml=g.slice(i,1<c?1-c:void 0)}function gl(i){var o=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&o===13&&(i=13)):i=o,i===10&&(i=13),32<=i||i===13?i:0}function vl(){return!0}function Yg(){return!1}function jt(i){function o(l,c,g,v,C){this._reactName=l,this._targetInst=g,this.type=c,this.nativeEvent=v,this.target=C,this.currentTarget=null;for(var T in i)i.hasOwnProperty(T)&&(l=i[T],this[T]=l?l(v):v[T]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?vl:Yg,this.isPropagationStopped=Yg,this}return m(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=vl)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=vl)},persist:function(){},isPersistent:vl}),o}var Lr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yl=jt(Lr),za=m({},Lr,{view:0,detail:0}),bk=jt(za),Ld,Td,Ha,bl=m({},za,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rd,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Ha&&(Ha&&i.type==="mousemove"?(Ld=i.screenX-Ha.screenX,Td=i.screenY-Ha.screenY):Td=Ld=0,Ha=i),Ld)},movementY:function(i){return"movementY"in i?i.movementY:Td}}),Kg=jt(bl),Sk=m({},bl,{dataTransfer:0}),_k=jt(Sk),Ck=m({},za,{relatedTarget:0}),Ad=jt(Ck),xk=m({},Lr,{animationName:0,elapsedTime:0,pseudoElement:0}),Ek=jt(xk),wk=m({},Lr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),kk=jt(wk),Lk=m({},Lr,{data:0}),Xg=jt(Lk),Tk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ak={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"},Rk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ok(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=Rk[i])?!!o[i]:!1}function Rd(){return Ok}var Dk=m({},za,{key:function(i){if(i.key){var o=Tk[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=gl(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?Ak[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rd,charCode:function(i){return i.type==="keypress"?gl(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?gl(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),Mk=jt(Dk),Nk=m({},bl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Qg=jt(Nk),Ik=m({},za,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rd}),zk=jt(Ik),Hk=m({},Lr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Pk=jt(Hk),Uk=m({},bl,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),jk=jt(Uk),Vk=m({},Lr,{newState:0,oldState:0}),Bk=jt(Vk),Fk=[9,13,27,32],Od=ai&&"CompositionEvent"in window,Pa=null;ai&&"documentMode"in document&&(Pa=document.documentMode);var Gk=ai&&"TextEvent"in window&&!Pa,Zg=ai&&(!Od||Pa&&8<Pa&&11>=Pa),Jg=" ",ev=!1;function tv(i,o){switch(i){case"keyup":return Fk.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nv(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var To=!1;function $k(i,o){switch(i){case"compositionend":return nv(o);case"keypress":return o.which!==32?null:(ev=!0,Jg);case"textInput":return i=o.data,i===Jg&&ev?null:i;default:return null}}function qk(i,o){if(To)return i==="compositionend"||!Od&&tv(i,o)?(i=Wg(),ml=kd=Fi=null,To=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Zg&&o.locale!=="ko"?null:o.data;default:return null}}var Wk={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 iv(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!Wk[i.type]:o==="textarea"}function rv(i,o,l,c){ko?Lo?Lo.push(c):Lo=[c]:ko=c,o=lu(o,"onChange"),0<o.length&&(l=new yl("onChange","change",null,l,c),i.push({event:l,listeners:o}))}var Ua=null,ja=null;function Yk(i){jy(i,0)}function Sl(i){var o=Ma(i);if(Ug(o))return i}function ov(i,o){if(i==="change")return o}var av=!1;if(ai){var Dd;if(ai){var Md="oninput"in document;if(!Md){var sv=document.createElement("div");sv.setAttribute("oninput","return;"),Md=typeof sv.oninput=="function"}Dd=Md}else Dd=!1;av=Dd&&(!document.documentMode||9<document.documentMode)}function lv(){Ua&&(Ua.detachEvent("onpropertychange",uv),ja=Ua=null)}function uv(i){if(i.propertyName==="value"&&Sl(ja)){var o=[];rv(o,ja,i,xd(i)),qg(Yk,o)}}function Kk(i,o,l){i==="focusin"?(lv(),Ua=o,ja=l,Ua.attachEvent("onpropertychange",uv)):i==="focusout"&&lv()}function Xk(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Sl(ja)}function Qk(i,o){if(i==="click")return Sl(o)}function Zk(i,o){if(i==="input"||i==="change")return Sl(o)}function Jk(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var Jt=typeof Object.is=="function"?Object.is:Jk;function Va(i,o){if(Jt(i,o))return!0;if(typeof i!="object"||i===null||typeof o!="object"||o===null)return!1;var l=Object.keys(i),c=Object.keys(o);if(l.length!==c.length)return!1;for(c=0;c<l.length;c++){var g=l[c];if(!cn.call(o,g)||!Jt(i[g],o[g]))return!1}return!0}function cv(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function dv(i,o){var l=cv(i);i=0;for(var c;l;){if(l.nodeType===3){if(c=i+l.textContent.length,i<=o&&c>=o)return{node:l,offset:o-i};i=c}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=cv(l)}}function fv(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?fv(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function hv(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var o=hl(i.document);o instanceof i.HTMLIFrameElement;){try{var l=typeof o.contentWindow.location.href=="string"}catch{l=!1}if(l)i=o.contentWindow;else break;o=hl(i.document)}return o}function Nd(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}var eL=ai&&"documentMode"in document&&11>=document.documentMode,Ao=null,Id=null,Ba=null,zd=!1;function pv(i,o,l){var c=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;zd||Ao==null||Ao!==hl(c)||(c=Ao,"selectionStart"in c&&Nd(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Ba&&Va(Ba,c)||(Ba=c,c=lu(Id,"onSelect"),0<c.length&&(o=new yl("onSelect","select",null,o,l),i.push({event:o,listeners:c}),o.target=Ao)))}function Tr(i,o){var l={};return l[i.toLowerCase()]=o.toLowerCase(),l["Webkit"+i]="webkit"+o,l["Moz"+i]="moz"+o,l}var Ro={animationend:Tr("Animation","AnimationEnd"),animationiteration:Tr("Animation","AnimationIteration"),animationstart:Tr("Animation","AnimationStart"),transitionrun:Tr("Transition","TransitionRun"),transitionstart:Tr("Transition","TransitionStart"),transitioncancel:Tr("Transition","TransitionCancel"),transitionend:Tr("Transition","TransitionEnd")},Hd={},mv={};ai&&(mv=document.createElement("div").style,"AnimationEvent"in window||(delete Ro.animationend.animation,delete Ro.animationiteration.animation,delete Ro.animationstart.animation),"TransitionEvent"in window||delete Ro.transitionend.transition);function Ar(i){if(Hd[i])return Hd[i];if(!Ro[i])return i;var o=Ro[i],l;for(l in o)if(o.hasOwnProperty(l)&&l in mv)return Hd[i]=o[l];return i}var gv=Ar("animationend"),vv=Ar("animationiteration"),yv=Ar("animationstart"),tL=Ar("transitionrun"),nL=Ar("transitionstart"),iL=Ar("transitioncancel"),bv=Ar("transitionend"),Sv=new Map,Pd="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(" ");Pd.push("scrollEnd");function kn(i,o){Sv.set(i,o),kr(o,[i])}var _l=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},hn=[],Oo=0,Ud=0;function Cl(){for(var i=Oo,o=Ud=Oo=0;o<i;){var l=hn[o];hn[o++]=null;var c=hn[o];hn[o++]=null;var g=hn[o];hn[o++]=null;var v=hn[o];if(hn[o++]=null,c!==null&&g!==null){var C=c.pending;C===null?g.next=g:(g.next=C.next,C.next=g),c.pending=g}v!==0&&_v(l,g,v)}}function xl(i,o,l,c){hn[Oo++]=i,hn[Oo++]=o,hn[Oo++]=l,hn[Oo++]=c,Ud|=c,i.lanes|=c,i=i.alternate,i!==null&&(i.lanes|=c)}function jd(i,o,l,c){return xl(i,o,l,c),El(i)}function Rr(i,o){return xl(i,null,null,o),El(i)}function _v(i,o,l){i.lanes|=l;var c=i.alternate;c!==null&&(c.lanes|=l);for(var g=!1,v=i.return;v!==null;)v.childLanes|=l,c=v.alternate,c!==null&&(c.childLanes|=l),v.tag===22&&(i=v.stateNode,i===null||i._visibility&1||(g=!0)),i=v,v=v.return;return i.tag===3?(v=i.stateNode,g&&o!==null&&(g=31-Zt(l),i=v.hiddenUpdates,c=i[g],c===null?i[g]=[o]:c.push(o),o.lane=l|536870912),v):null}function El(i){if(50<cs)throw cs=0,Xf=null,Error(r(185));for(var o=i.return;o!==null;)i=o,o=i.return;return i.tag===3?i.stateNode:null}var Do={};function rL(i,o,l,c){this.tag=i,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function en(i,o,l,c){return new rL(i,o,l,c)}function Vd(i){return i=i.prototype,!(!i||!i.isReactComponent)}function si(i,o){var l=i.alternate;return l===null?(l=en(i.tag,o,i.key,i.mode),l.elementType=i.elementType,l.type=i.type,l.stateNode=i.stateNode,l.alternate=i,i.alternate=l):(l.pendingProps=o,l.type=i.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=i.flags&65011712,l.childLanes=i.childLanes,l.lanes=i.lanes,l.child=i.child,l.memoizedProps=i.memoizedProps,l.memoizedState=i.memoizedState,l.updateQueue=i.updateQueue,o=i.dependencies,l.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},l.sibling=i.sibling,l.index=i.index,l.ref=i.ref,l.refCleanup=i.refCleanup,l}function Cv(i,o){i.flags&=65011714;var l=i.alternate;return l===null?(i.childLanes=0,i.lanes=o,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=l.childLanes,i.lanes=l.lanes,i.child=l.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=l.memoizedProps,i.memoizedState=l.memoizedState,i.updateQueue=l.updateQueue,i.type=l.type,o=l.dependencies,i.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),i}function wl(i,o,l,c,g,v){var C=0;if(c=i,typeof i=="function")Vd(i)&&(C=1);else if(typeof i=="string")C=uT(i,l,le.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case W:return i=en(31,l,o,g),i.elementType=W,i.lanes=v,i;case _:return Or(l.children,g,v,o);case w:C=8,g|=24;break;case x:return i=en(12,l,o,g|2),i.elementType=x,i.lanes=v,i;case D:return i=en(13,l,o,g),i.elementType=D,i.lanes=v,i;case N:return i=en(19,l,o,g),i.elementType=N,i.lanes=v,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case L:C=10;break e;case E:C=9;break e;case R:C=11;break e;case H:C=14;break e;case U:C=16,c=null;break e}C=29,l=Error(r(130,i===null?"null":typeof i,"")),c=null}return o=en(C,l,o,g),o.elementType=i,o.type=c,o.lanes=v,o}function Or(i,o,l,c){return i=en(7,i,c,o),i.lanes=l,i}function Bd(i,o,l){return i=en(6,i,null,o),i.lanes=l,i}function xv(i){var o=en(18,null,null,0);return o.stateNode=i,o}function Fd(i,o,l){return o=en(4,i.children!==null?i.children:[],i.key,o),o.lanes=l,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}var Ev=new WeakMap;function pn(i,o){if(typeof i=="object"&&i!==null){var l=Ev.get(i);return l!==void 0?l:(o={value:i,source:o,stack:Pt(o)},Ev.set(i,o),o)}return{value:i,source:o,stack:Pt(o)}}var Mo=[],No=0,kl=null,Fa=0,mn=[],gn=0,Gi=null,zn=1,Hn="";function li(i,o){Mo[No++]=Fa,Mo[No++]=kl,kl=i,Fa=o}function wv(i,o,l){mn[gn++]=zn,mn[gn++]=Hn,mn[gn++]=Gi,Gi=i;var c=zn;i=Hn;var g=32-Zt(c)-1;c&=~(1<<g),l+=1;var v=32-Zt(o)+g;if(30<v){var C=g-g%5;v=(c&(1<<C)-1).toString(32),c>>=C,g-=C,zn=1<<32-Zt(o)+g|l<<g|c,Hn=v+i}else zn=1<<v|l<<g|c,Hn=i}function Gd(i){i.return!==null&&(li(i,1),wv(i,1,0))}function $d(i){for(;i===kl;)kl=Mo[--No],Mo[No]=null,Fa=Mo[--No],Mo[No]=null;for(;i===Gi;)Gi=mn[--gn],mn[gn]=null,Hn=mn[--gn],mn[gn]=null,zn=mn[--gn],mn[gn]=null}function kv(i,o){mn[gn++]=zn,mn[gn++]=Hn,mn[gn++]=Gi,zn=o.id,Hn=o.overflow,Gi=i}var wt=null,Ye=null,Oe=!1,$i=null,vn=!1,qd=Error(r(519));function qi(i){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ga(pn(o,i)),qd}function Lv(i){var o=i.stateNode,l=i.type,c=i.memoizedProps;switch(o[Et]=i,o[Ut]=c,l){case"dialog":Te("cancel",o),Te("close",o);break;case"iframe":case"object":case"embed":Te("load",o);break;case"video":case"audio":for(l=0;l<fs.length;l++)Te(fs[l],o);break;case"source":Te("error",o);break;case"img":case"image":case"link":Te("error",o),Te("load",o);break;case"details":Te("toggle",o);break;case"input":Te("invalid",o),jg(o,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Te("invalid",o);break;case"textarea":Te("invalid",o),Bg(o,c.value,c.defaultValue,c.children)}l=c.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||o.textContent===""+l||c.suppressHydrationWarning===!0||Gy(o.textContent,l)?(c.popover!=null&&(Te("beforetoggle",o),Te("toggle",o)),c.onScroll!=null&&Te("scroll",o),c.onScrollEnd!=null&&Te("scrollend",o),c.onClick!=null&&(o.onclick=oi),o=!0):o=!1,o||qi(i,!0)}function Tv(i){for(wt=i.return;wt;)switch(wt.tag){case 5:case 31:case 13:vn=!1;return;case 27:case 3:vn=!0;return;default:wt=wt.return}}function Io(i){if(i!==wt)return!1;if(!Oe)return Tv(i),Oe=!0,!1;var o=i.tag,l;if((l=o!==3&&o!==27)&&((l=o===5)&&(l=i.type,l=!(l!=="form"&&l!=="button")||dh(i.type,i.memoizedProps)),l=!l),l&&Ye&&qi(i),Tv(i),o===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Ye=Jy(i)}else if(o===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Ye=Jy(i)}else o===27?(o=Ye,ar(i.type)?(i=gh,gh=null,Ye=i):Ye=o):Ye=wt?bn(i.stateNode.nextSibling):null;return!0}function Dr(){Ye=wt=null,Oe=!1}function Wd(){var i=$i;return i!==null&&(Gt===null?Gt=i:Gt.push.apply(Gt,i),$i=null),i}function Ga(i){$i===null?$i=[i]:$i.push(i)}var Yd=M(null),Mr=null,ui=null;function Wi(i,o,l){oe(Yd,o._currentValue),o._currentValue=l}function ci(i){i._currentValue=Yd.current,q(Yd)}function Kd(i,o,l){for(;i!==null;){var c=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,c!==null&&(c.childLanes|=o)):c!==null&&(c.childLanes&o)!==o&&(c.childLanes|=o),i===l)break;i=i.return}}function Xd(i,o,l,c){var g=i.child;for(g!==null&&(g.return=i);g!==null;){var v=g.dependencies;if(v!==null){var C=g.child;v=v.firstContext;e:for(;v!==null;){var T=v;v=g;for(var z=0;z<o.length;z++)if(T.context===o[z]){v.lanes|=l,T=v.alternate,T!==null&&(T.lanes|=l),Kd(v.return,l,i),c||(C=null);break e}v=T.next}}else if(g.tag===18){if(C=g.return,C===null)throw Error(r(341));C.lanes|=l,v=C.alternate,v!==null&&(v.lanes|=l),Kd(C,l,i),C=null}else C=g.child;if(C!==null)C.return=g;else for(C=g;C!==null;){if(C===i){C=null;break}if(g=C.sibling,g!==null){g.return=C.return,C=g;break}C=C.return}g=C}}function zo(i,o,l,c){i=null;for(var g=o,v=!1;g!==null;){if(!v){if((g.flags&524288)!==0)v=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var C=g.alternate;if(C===null)throw Error(r(387));if(C=C.memoizedProps,C!==null){var T=g.type;Jt(g.pendingProps.value,C.value)||(i!==null?i.push(T):i=[T])}}else if(g===ce.current){if(C=g.alternate,C===null)throw Error(r(387));C.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(i!==null?i.push(vs):i=[vs])}g=g.return}i!==null&&Xd(o,i,l,c),o.flags|=262144}function Ll(i){for(i=i.firstContext;i!==null;){if(!Jt(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Nr(i){Mr=i,ui=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function kt(i){return Av(Mr,i)}function Tl(i,o){return Mr===null&&Nr(i),Av(i,o)}function Av(i,o){var l=o._currentValue;if(o={context:o,memoizedValue:l,next:null},ui===null){if(i===null)throw Error(r(308));ui=o,i.dependencies={lanes:0,firstContext:o},i.flags|=524288}else ui=ui.next=o;return l}var oL=typeof AbortController<"u"?AbortController:function(){var i=[],o=this.signal={aborted:!1,addEventListener:function(l,c){i.push(c)}};this.abort=function(){o.aborted=!0,i.forEach(function(l){return l()})}},aL=e.unstable_scheduleCallback,sL=e.unstable_NormalPriority,at={$$typeof:L,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qd(){return{controller:new oL,data:new Map,refCount:0}}function $a(i){i.refCount--,i.refCount===0&&aL(sL,function(){i.controller.abort()})}var qa=null,Zd=0,Ho=0,Po=null;function lL(i,o){if(qa===null){var l=qa=[];Zd=0,Ho=nh(),Po={status:"pending",value:void 0,then:function(c){l.push(c)}}}return Zd++,o.then(Rv,Rv),o}function Rv(){if(--Zd===0&&qa!==null){Po!==null&&(Po.status="fulfilled");var i=qa;qa=null,Ho=0,Po=null;for(var o=0;o<i.length;o++)(0,i[o])()}}function uL(i,o){var l=[],c={status:"pending",value:null,reason:null,then:function(g){l.push(g)}};return i.then(function(){c.status="fulfilled",c.value=o;for(var g=0;g<l.length;g++)(0,l[g])(o)},function(g){for(c.status="rejected",c.reason=g,g=0;g<l.length;g++)(0,l[g])(void 0)}),c}var Ov=I.S;I.S=function(i,o){py=Xt(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&lL(i,o),Ov!==null&&Ov(i,o)};var Ir=M(null);function Jd(){var i=Ir.current;return i!==null?i:$e.pooledCache}function Al(i,o){o===null?oe(Ir,Ir.current):oe(Ir,o.pool)}function Dv(){var i=Jd();return i===null?null:{parent:at._currentValue,pool:i}}var Uo=Error(r(460)),ef=Error(r(474)),Rl=Error(r(542)),Ol={then:function(){}};function Mv(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Nv(i,o,l){switch(l=i[l],l===void 0?i.push(o):l!==o&&(o.then(oi,oi),o=l),o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,zv(i),i;default:if(typeof o.status=="string")o.then(oi,oi);else{if(i=$e,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=o,i.status="pending",i.then(function(c){if(o.status==="pending"){var g=o;g.status="fulfilled",g.value=c}},function(c){if(o.status==="pending"){var g=o;g.status="rejected",g.reason=c}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,zv(i),i}throw Hr=o,Uo}}function zr(i){try{var o=i._init;return o(i._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Hr=l,Uo):l}}var Hr=null;function Iv(){if(Hr===null)throw Error(r(459));var i=Hr;return Hr=null,i}function zv(i){if(i===Uo||i===Rl)throw Error(r(483))}var jo=null,Wa=0;function Dl(i){var o=Wa;return Wa+=1,jo===null&&(jo=[]),Nv(jo,i,o)}function Ya(i,o){o=o.props.ref,i.ref=o!==void 0?o:null}function Ml(i,o){throw o.$$typeof===y?Error(r(525)):(i=Object.prototype.toString.call(o),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":i)))}function Hv(i){function o(j,P){if(i){var B=j.deletions;B===null?(j.deletions=[P],j.flags|=16):B.push(P)}}function l(j,P){if(!i)return null;for(;P!==null;)o(j,P),P=P.sibling;return null}function c(j){for(var P=new Map;j!==null;)j.key!==null?P.set(j.key,j):P.set(j.index,j),j=j.sibling;return P}function g(j,P){return j=si(j,P),j.index=0,j.sibling=null,j}function v(j,P,B){return j.index=B,i?(B=j.alternate,B!==null?(B=B.index,B<P?(j.flags|=67108866,P):B):(j.flags|=67108866,P)):(j.flags|=1048576,P)}function C(j){return i&&j.alternate===null&&(j.flags|=67108866),j}function T(j,P,B,J){return P===null||P.tag!==6?(P=Bd(B,j.mode,J),P.return=j,P):(P=g(P,B),P.return=j,P)}function z(j,P,B,J){var ve=B.type;return ve===_?Q(j,P,B.props.children,J,B.key):P!==null&&(P.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===U&&zr(ve)===P.type)?(P=g(P,B.props),Ya(P,B),P.return=j,P):(P=wl(B.type,B.key,B.props,null,j.mode,J),Ya(P,B),P.return=j,P)}function F(j,P,B,J){return P===null||P.tag!==4||P.stateNode.containerInfo!==B.containerInfo||P.stateNode.implementation!==B.implementation?(P=Fd(B,j.mode,J),P.return=j,P):(P=g(P,B.children||[]),P.return=j,P)}function Q(j,P,B,J,ve){return P===null||P.tag!==7?(P=Or(B,j.mode,J,ve),P.return=j,P):(P=g(P,B),P.return=j,P)}function ne(j,P,B){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return P=Bd(""+P,j.mode,B),P.return=j,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case b:return B=wl(P.type,P.key,P.props,null,j.mode,B),Ya(B,P),B.return=j,B;case S:return P=Fd(P,j.mode,B),P.return=j,P;case U:return P=zr(P),ne(j,P,B)}if(se(P)||V(P))return P=Or(P,j.mode,B,null),P.return=j,P;if(typeof P.then=="function")return ne(j,Dl(P),B);if(P.$$typeof===L)return ne(j,Tl(j,P),B);Ml(j,P)}return null}function $(j,P,B,J){var ve=P!==null?P.key:null;if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return ve!==null?null:T(j,P,""+B,J);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case b:return B.key===ve?z(j,P,B,J):null;case S:return B.key===ve?F(j,P,B,J):null;case U:return B=zr(B),$(j,P,B,J)}if(se(B)||V(B))return ve!==null?null:Q(j,P,B,J,null);if(typeof B.then=="function")return $(j,P,Dl(B),J);if(B.$$typeof===L)return $(j,P,Tl(j,B),J);Ml(j,B)}return null}function K(j,P,B,J,ve){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return j=j.get(B)||null,T(P,j,""+J,ve);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case b:return j=j.get(J.key===null?B:J.key)||null,z(P,j,J,ve);case S:return j=j.get(J.key===null?B:J.key)||null,F(P,j,J,ve);case U:return J=zr(J),K(j,P,B,J,ve)}if(se(J)||V(J))return j=j.get(B)||null,Q(P,j,J,ve,null);if(typeof J.then=="function")return K(j,P,B,Dl(J),ve);if(J.$$typeof===L)return K(j,P,B,Tl(P,J),ve);Ml(P,J)}return null}function me(j,P,B,J){for(var ve=null,De=null,ge=P,Ee=P=0,Re=null;ge!==null&&Ee<B.length;Ee++){ge.index>Ee?(Re=ge,ge=null):Re=ge.sibling;var Me=$(j,ge,B[Ee],J);if(Me===null){ge===null&&(ge=Re);break}i&&ge&&Me.alternate===null&&o(j,ge),P=v(Me,P,Ee),De===null?ve=Me:De.sibling=Me,De=Me,ge=Re}if(Ee===B.length)return l(j,ge),Oe&&li(j,Ee),ve;if(ge===null){for(;Ee<B.length;Ee++)ge=ne(j,B[Ee],J),ge!==null&&(P=v(ge,P,Ee),De===null?ve=ge:De.sibling=ge,De=ge);return Oe&&li(j,Ee),ve}for(ge=c(ge);Ee<B.length;Ee++)Re=K(ge,j,Ee,B[Ee],J),Re!==null&&(i&&Re.alternate!==null&&ge.delete(Re.key===null?Ee:Re.key),P=v(Re,P,Ee),De===null?ve=Re:De.sibling=Re,De=Re);return i&&ge.forEach(function(dr){return o(j,dr)}),Oe&&li(j,Ee),ve}function ye(j,P,B,J){if(B==null)throw Error(r(151));for(var ve=null,De=null,ge=P,Ee=P=0,Re=null,Me=B.next();ge!==null&&!Me.done;Ee++,Me=B.next()){ge.index>Ee?(Re=ge,ge=null):Re=ge.sibling;var dr=$(j,ge,Me.value,J);if(dr===null){ge===null&&(ge=Re);break}i&&ge&&dr.alternate===null&&o(j,ge),P=v(dr,P,Ee),De===null?ve=dr:De.sibling=dr,De=dr,ge=Re}if(Me.done)return l(j,ge),Oe&&li(j,Ee),ve;if(ge===null){for(;!Me.done;Ee++,Me=B.next())Me=ne(j,Me.value,J),Me!==null&&(P=v(Me,P,Ee),De===null?ve=Me:De.sibling=Me,De=Me);return Oe&&li(j,Ee),ve}for(ge=c(ge);!Me.done;Ee++,Me=B.next())Me=K(ge,j,Ee,Me.value,J),Me!==null&&(i&&Me.alternate!==null&&ge.delete(Me.key===null?Ee:Me.key),P=v(Me,P,Ee),De===null?ve=Me:De.sibling=Me,De=Me);return i&&ge.forEach(function(ST){return o(j,ST)}),Oe&&li(j,Ee),ve}function Ve(j,P,B,J){if(typeof B=="object"&&B!==null&&B.type===_&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case b:e:{for(var ve=B.key;P!==null;){if(P.key===ve){if(ve=B.type,ve===_){if(P.tag===7){l(j,P.sibling),J=g(P,B.props.children),J.return=j,j=J;break e}}else if(P.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===U&&zr(ve)===P.type){l(j,P.sibling),J=g(P,B.props),Ya(J,B),J.return=j,j=J;break e}l(j,P);break}else o(j,P);P=P.sibling}B.type===_?(J=Or(B.props.children,j.mode,J,B.key),J.return=j,j=J):(J=wl(B.type,B.key,B.props,null,j.mode,J),Ya(J,B),J.return=j,j=J)}return C(j);case S:e:{for(ve=B.key;P!==null;){if(P.key===ve)if(P.tag===4&&P.stateNode.containerInfo===B.containerInfo&&P.stateNode.implementation===B.implementation){l(j,P.sibling),J=g(P,B.children||[]),J.return=j,j=J;break e}else{l(j,P);break}else o(j,P);P=P.sibling}J=Fd(B,j.mode,J),J.return=j,j=J}return C(j);case U:return B=zr(B),Ve(j,P,B,J)}if(se(B))return me(j,P,B,J);if(V(B)){if(ve=V(B),typeof ve!="function")throw Error(r(150));return B=ve.call(B),ye(j,P,B,J)}if(typeof B.then=="function")return Ve(j,P,Dl(B),J);if(B.$$typeof===L)return Ve(j,P,Tl(j,B),J);Ml(j,B)}return typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint"?(B=""+B,P!==null&&P.tag===6?(l(j,P.sibling),J=g(P,B),J.return=j,j=J):(l(j,P),J=Bd(B,j.mode,J),J.return=j,j=J),C(j)):l(j,P)}return function(j,P,B,J){try{Wa=0;var ve=Ve(j,P,B,J);return jo=null,ve}catch(ge){if(ge===Uo||ge===Rl)throw ge;var De=en(29,ge,null,j.mode);return De.lanes=J,De.return=j,De}}}var Pr=Hv(!0),Pv=Hv(!1),Yi=!1;function tf(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function nf(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Ki(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Xi(i,o,l){var c=i.updateQueue;if(c===null)return null;if(c=c.shared,(Ie&2)!==0){var g=c.pending;return g===null?o.next=o:(o.next=g.next,g.next=o),c.pending=o,o=El(i),_v(i,null,l),o}return xl(i,c,o,l),El(i)}function Ka(i,o,l){if(o=o.updateQueue,o!==null&&(o=o.shared,(l&4194048)!==0)){var c=o.lanes;c&=i.pendingLanes,l|=c,o.lanes=l,Ag(i,l)}}function rf(i,o){var l=i.updateQueue,c=i.alternate;if(c!==null&&(c=c.updateQueue,l===c)){var g=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var C={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};v===null?g=v=C:v=v.next=C,l=l.next}while(l!==null);v===null?g=v=o:v=v.next=o}else g=v=o;l={baseState:c.baseState,firstBaseUpdate:g,lastBaseUpdate:v,shared:c.shared,callbacks:c.callbacks},i.updateQueue=l;return}i=l.lastBaseUpdate,i===null?l.firstBaseUpdate=o:i.next=o,l.lastBaseUpdate=o}var of=!1;function Xa(){if(of){var i=Po;if(i!==null)throw i}}function Qa(i,o,l,c){of=!1;var g=i.updateQueue;Yi=!1;var v=g.firstBaseUpdate,C=g.lastBaseUpdate,T=g.shared.pending;if(T!==null){g.shared.pending=null;var z=T,F=z.next;z.next=null,C===null?v=F:C.next=F,C=z;var Q=i.alternate;Q!==null&&(Q=Q.updateQueue,T=Q.lastBaseUpdate,T!==C&&(T===null?Q.firstBaseUpdate=F:T.next=F,Q.lastBaseUpdate=z))}if(v!==null){var ne=g.baseState;C=0,Q=F=z=null,T=v;do{var $=T.lane&-536870913,K=$!==T.lane;if(K?(Ae&$)===$:(c&$)===$){$!==0&&$===Ho&&(of=!0),Q!==null&&(Q=Q.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var me=i,ye=T;$=o;var Ve=l;switch(ye.tag){case 1:if(me=ye.payload,typeof me=="function"){ne=me.call(Ve,ne,$);break e}ne=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=ye.payload,$=typeof me=="function"?me.call(Ve,ne,$):me,$==null)break e;ne=m({},ne,$);break e;case 2:Yi=!0}}$=T.callback,$!==null&&(i.flags|=64,K&&(i.flags|=8192),K=g.callbacks,K===null?g.callbacks=[$]:K.push($))}else K={lane:$,tag:T.tag,payload:T.payload,callback:T.callback,next:null},Q===null?(F=Q=K,z=ne):Q=Q.next=K,C|=$;if(T=T.next,T===null){if(T=g.shared.pending,T===null)break;K=T,T=K.next,K.next=null,g.lastBaseUpdate=K,g.shared.pending=null}}while(!0);Q===null&&(z=ne),g.baseState=z,g.firstBaseUpdate=F,g.lastBaseUpdate=Q,v===null&&(g.shared.lanes=0),tr|=C,i.lanes=C,i.memoizedState=ne}}function Uv(i,o){if(typeof i!="function")throw Error(r(191,i));i.call(o)}function jv(i,o){var l=i.callbacks;if(l!==null)for(i.callbacks=null,i=0;i<l.length;i++)Uv(l[i],o)}var Vo=M(null),Nl=M(0);function Vv(i,o){i=bi,oe(Nl,i),oe(Vo,o),bi=i|o.baseLanes}function af(){oe(Nl,bi),oe(Vo,Vo.current)}function sf(){bi=Nl.current,q(Vo),q(Nl)}var tn=M(null),yn=null;function Qi(i){var o=i.alternate;oe(nt,nt.current&1),oe(tn,i),yn===null&&(o===null||Vo.current!==null||o.memoizedState!==null)&&(yn=i)}function lf(i){oe(nt,nt.current),oe(tn,i),yn===null&&(yn=i)}function Bv(i){i.tag===22?(oe(nt,nt.current),oe(tn,i),yn===null&&(yn=i)):Zi()}function Zi(){oe(nt,nt.current),oe(tn,tn.current)}function nn(i){q(tn),yn===i&&(yn=null),q(nt)}var nt=M(0);function Il(i){for(var o=i;o!==null;){if(o.tag===13){var l=o.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||ph(l)||mh(l)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var di=0,xe=null,Ue=null,st=null,zl=!1,Bo=!1,Ur=!1,Hl=0,Za=0,Fo=null,cL=0;function et(){throw Error(r(321))}function uf(i,o){if(o===null)return!1;for(var l=0;l<o.length&&l<i.length;l++)if(!Jt(i[l],o[l]))return!1;return!0}function cf(i,o,l,c,g,v){return di=v,xe=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,I.H=i===null||i.memoizedState===null?w0:wf,Ur=!1,v=l(c,g),Ur=!1,Bo&&(v=Gv(o,l,c,g)),Fv(i),v}function Fv(i){I.H=ts;var o=Ue!==null&&Ue.next!==null;if(di=0,st=Ue=xe=null,zl=!1,Za=0,Fo=null,o)throw Error(r(300));i===null||lt||(i=i.dependencies,i!==null&&Ll(i)&&(lt=!0))}function Gv(i,o,l,c){xe=i;var g=0;do{if(Bo&&(Fo=null),Za=0,Bo=!1,25<=g)throw Error(r(301));if(g+=1,st=Ue=null,i.updateQueue!=null){var v=i.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}I.H=k0,v=o(l,c)}while(Bo);return v}function dL(){var i=I.H,o=i.useState()[0];return o=typeof o.then=="function"?Ja(o):o,i=i.useState()[0],(Ue!==null?Ue.memoizedState:null)!==i&&(xe.flags|=1024),o}function df(){var i=Hl!==0;return Hl=0,i}function ff(i,o,l){o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~l}function hf(i){if(zl){for(i=i.memoizedState;i!==null;){var o=i.queue;o!==null&&(o.pending=null),i=i.next}zl=!1}di=0,st=Ue=xe=null,Bo=!1,Za=Hl=0,Fo=null}function Nt(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return st===null?xe.memoizedState=st=i:st=st.next=i,st}function it(){if(Ue===null){var i=xe.alternate;i=i!==null?i.memoizedState:null}else i=Ue.next;var o=st===null?xe.memoizedState:st.next;if(o!==null)st=o,Ue=i;else{if(i===null)throw xe.alternate===null?Error(r(467)):Error(r(310));Ue=i,i={memoizedState:Ue.memoizedState,baseState:Ue.baseState,baseQueue:Ue.baseQueue,queue:Ue.queue,next:null},st===null?xe.memoizedState=st=i:st=st.next=i}return st}function Pl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ja(i){var o=Za;return Za+=1,Fo===null&&(Fo=[]),i=Nv(Fo,i,o),o=xe,(st===null?o.memoizedState:st.next)===null&&(o=o.alternate,I.H=o===null||o.memoizedState===null?w0:wf),i}function Ul(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Ja(i);if(i.$$typeof===L)return kt(i)}throw Error(r(438,String(i)))}function pf(i){var o=null,l=xe.updateQueue;if(l!==null&&(o=l.memoCache),o==null){var c=xe.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(o={data:c.data.map(function(g){return g.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),l===null&&(l=Pl(),xe.updateQueue=l),l.memoCache=o,l=o.data[o.index],l===void 0)for(l=o.data[o.index]=Array(i),c=0;c<i;c++)l[c]=ee;return o.index++,l}function fi(i,o){return typeof o=="function"?o(i):o}function jl(i){var o=it();return mf(o,Ue,i)}function mf(i,o,l){var c=i.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=l;var g=i.baseQueue,v=c.pending;if(v!==null){if(g!==null){var C=g.next;g.next=v.next,v.next=C}o.baseQueue=g=v,c.pending=null}if(v=i.baseState,g===null)i.memoizedState=v;else{o=g.next;var T=C=null,z=null,F=o,Q=!1;do{var ne=F.lane&-536870913;if(ne!==F.lane?(Ae&ne)===ne:(di&ne)===ne){var $=F.revertLane;if($===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),ne===Ho&&(Q=!0);else if((di&$)===$){F=F.next,$===Ho&&(Q=!0);continue}else ne={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},z===null?(T=z=ne,C=v):z=z.next=ne,xe.lanes|=$,tr|=$;ne=F.action,Ur&&l(v,ne),v=F.hasEagerState?F.eagerState:l(v,ne)}else $={lane:ne,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},z===null?(T=z=$,C=v):z=z.next=$,xe.lanes|=ne,tr|=ne;F=F.next}while(F!==null&&F!==o);if(z===null?C=v:z.next=T,!Jt(v,i.memoizedState)&&(lt=!0,Q&&(l=Po,l!==null)))throw l;i.memoizedState=v,i.baseState=C,i.baseQueue=z,c.lastRenderedState=v}return g===null&&(c.lanes=0),[i.memoizedState,c.dispatch]}function gf(i){var o=it(),l=o.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=i;var c=l.dispatch,g=l.pending,v=o.memoizedState;if(g!==null){l.pending=null;var C=g=g.next;do v=i(v,C.action),C=C.next;while(C!==g);Jt(v,o.memoizedState)||(lt=!0),o.memoizedState=v,o.baseQueue===null&&(o.baseState=v),l.lastRenderedState=v}return[v,c]}function $v(i,o,l){var c=xe,g=it(),v=Oe;if(v){if(l===void 0)throw Error(r(407));l=l()}else l=o();var C=!Jt((Ue||g).memoizedState,l);if(C&&(g.memoizedState=l,lt=!0),g=g.queue,bf(Yv.bind(null,c,g,i),[i]),g.getSnapshot!==o||C||st!==null&&st.memoizedState.tag&1){if(c.flags|=2048,Go(9,{destroy:void 0},Wv.bind(null,c,g,l,o),null),$e===null)throw Error(r(349));v||(di&127)!==0||qv(c,o,l)}return l}function qv(i,o,l){i.flags|=16384,i={getSnapshot:o,value:l},o=xe.updateQueue,o===null?(o=Pl(),xe.updateQueue=o,o.stores=[i]):(l=o.stores,l===null?o.stores=[i]:l.push(i))}function Wv(i,o,l,c){o.value=l,o.getSnapshot=c,Kv(o)&&Xv(i)}function Yv(i,o,l){return l(function(){Kv(o)&&Xv(i)})}function Kv(i){var o=i.getSnapshot;i=i.value;try{var l=o();return!Jt(i,l)}catch{return!0}}function Xv(i){var o=Rr(i,2);o!==null&&$t(o,i,2)}function vf(i){var o=Nt();if(typeof i=="function"){var l=i;if(i=l(),Ur){Vi(!0);try{l()}finally{Vi(!1)}}}return o.memoizedState=o.baseState=i,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fi,lastRenderedState:i},o}function Qv(i,o,l,c){return i.baseState=l,mf(i,Ue,typeof c=="function"?c:fi)}function fL(i,o,l,c,g){if(Fl(i))throw Error(r(485));if(i=o.action,i!==null){var v={payload:g,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){v.listeners.push(C)}};I.T!==null?l(!0):v.isTransition=!1,c(v),l=o.pending,l===null?(v.next=o.pending=v,Zv(o,v)):(v.next=l.next,o.pending=l.next=v)}}function Zv(i,o){var l=o.action,c=o.payload,g=i.state;if(o.isTransition){var v=I.T,C={};I.T=C;try{var T=l(g,c),z=I.S;z!==null&&z(C,T),Jv(i,o,T)}catch(F){yf(i,o,F)}finally{v!==null&&C.types!==null&&(v.types=C.types),I.T=v}}else try{v=l(g,c),Jv(i,o,v)}catch(F){yf(i,o,F)}}function Jv(i,o,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(c){e0(i,o,c)},function(c){return yf(i,o,c)}):e0(i,o,l)}function e0(i,o,l){o.status="fulfilled",o.value=l,t0(o),i.state=l,o=i.pending,o!==null&&(l=o.next,l===o?i.pending=null:(l=l.next,o.next=l,Zv(i,l)))}function yf(i,o,l){var c=i.pending;if(i.pending=null,c!==null){c=c.next;do o.status="rejected",o.reason=l,t0(o),o=o.next;while(o!==c)}i.action=null}function t0(i){i=i.listeners;for(var o=0;o<i.length;o++)(0,i[o])()}function n0(i,o){return o}function i0(i,o){if(Oe){var l=$e.formState;if(l!==null){e:{var c=xe;if(Oe){if(Ye){t:{for(var g=Ye,v=vn;g.nodeType!==8;){if(!v){g=null;break t}if(g=bn(g.nextSibling),g===null){g=null;break t}}v=g.data,g=v==="F!"||v==="F"?g:null}if(g){Ye=bn(g.nextSibling),c=g.data==="F!";break e}}qi(c)}c=!1}c&&(o=l[0])}}return l=Nt(),l.memoizedState=l.baseState=o,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n0,lastRenderedState:o},l.queue=c,l=C0.bind(null,xe,c),c.dispatch=l,c=vf(!1),v=Ef.bind(null,xe,!1,c.queue),c=Nt(),g={state:o,dispatch:null,action:i,pending:null},c.queue=g,l=fL.bind(null,xe,g,v,l),g.dispatch=l,c.memoizedState=i,[o,l,!1]}function r0(i){var o=it();return o0(o,Ue,i)}function o0(i,o,l){if(o=mf(i,o,n0)[0],i=jl(fi)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var c=Ja(o)}catch(C){throw C===Uo?Rl:C}else c=o;o=it();var g=o.queue,v=g.dispatch;return l!==o.memoizedState&&(xe.flags|=2048,Go(9,{destroy:void 0},hL.bind(null,g,l),null)),[c,v,i]}function hL(i,o){i.action=o}function a0(i){var o=it(),l=Ue;if(l!==null)return o0(o,l,i);it(),o=o.memoizedState,l=it();var c=l.queue.dispatch;return l.memoizedState=i,[o,c,!1]}function Go(i,o,l,c){return i={tag:i,create:l,deps:c,inst:o,next:null},o=xe.updateQueue,o===null&&(o=Pl(),xe.updateQueue=o),l=o.lastEffect,l===null?o.lastEffect=i.next=i:(c=l.next,l.next=i,i.next=c,o.lastEffect=i),i}function s0(){return it().memoizedState}function Vl(i,o,l,c){var g=Nt();xe.flags|=i,g.memoizedState=Go(1|o,{destroy:void 0},l,c===void 0?null:c)}function Bl(i,o,l,c){var g=it();c=c===void 0?null:c;var v=g.memoizedState.inst;Ue!==null&&c!==null&&uf(c,Ue.memoizedState.deps)?g.memoizedState=Go(o,v,l,c):(xe.flags|=i,g.memoizedState=Go(1|o,v,l,c))}function l0(i,o){Vl(8390656,8,i,o)}function bf(i,o){Bl(2048,8,i,o)}function pL(i){xe.flags|=4;var o=xe.updateQueue;if(o===null)o=Pl(),xe.updateQueue=o,o.events=[i];else{var l=o.events;l===null?o.events=[i]:l.push(i)}}function u0(i){var o=it().memoizedState;return pL({ref:o,nextImpl:i}),function(){if((Ie&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function c0(i,o){return Bl(4,2,i,o)}function d0(i,o){return Bl(4,4,i,o)}function f0(i,o){if(typeof o=="function"){i=i();var l=o(i);return function(){typeof l=="function"?l():o(null)}}if(o!=null)return i=i(),o.current=i,function(){o.current=null}}function h0(i,o,l){l=l!=null?l.concat([i]):null,Bl(4,4,f0.bind(null,o,i),l)}function Sf(){}function p0(i,o){var l=it();o=o===void 0?null:o;var c=l.memoizedState;return o!==null&&uf(o,c[1])?c[0]:(l.memoizedState=[i,o],i)}function m0(i,o){var l=it();o=o===void 0?null:o;var c=l.memoizedState;if(o!==null&&uf(o,c[1]))return c[0];if(c=i(),Ur){Vi(!0);try{i()}finally{Vi(!1)}}return l.memoizedState=[c,o],c}function _f(i,o,l){return l===void 0||(di&1073741824)!==0&&(Ae&261930)===0?i.memoizedState=o:(i.memoizedState=l,i=gy(),xe.lanes|=i,tr|=i,l)}function g0(i,o,l,c){return Jt(l,o)?l:Vo.current!==null?(i=_f(i,l,c),Jt(i,o)||(lt=!0),i):(di&42)===0||(di&1073741824)!==0&&(Ae&261930)===0?(lt=!0,i.memoizedState=l):(i=gy(),xe.lanes|=i,tr|=i,o)}function v0(i,o,l,c,g){var v=G.p;G.p=v!==0&&8>v?v:8;var C=I.T,T={};I.T=T,Ef(i,!1,o,l);try{var z=g(),F=I.S;if(F!==null&&F(T,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var Q=uL(z,c);es(i,o,Q,an(i))}else es(i,o,c,an(i))}catch(ne){es(i,o,{then:function(){},status:"rejected",reason:ne},an())}finally{G.p=v,C!==null&&T.types!==null&&(C.types=T.types),I.T=C}}function mL(){}function Cf(i,o,l,c){if(i.tag!==5)throw Error(r(476));var g=y0(i).queue;v0(i,g,o,X,l===null?mL:function(){return b0(i),l(c)})}function y0(i){var o=i.memoizedState;if(o!==null)return o;o={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fi,lastRenderedState:X},next:null};var l={};return o.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fi,lastRenderedState:l},next:null},i.memoizedState=o,i=i.alternate,i!==null&&(i.memoizedState=o),o}function b0(i){var o=y0(i);o.next===null&&(o=i.alternate.memoizedState),es(i,o.next.queue,{},an())}function xf(){return kt(vs)}function S0(){return it().memoizedState}function _0(){return it().memoizedState}function gL(i){for(var o=i.return;o!==null;){switch(o.tag){case 24:case 3:var l=an();i=Ki(l);var c=Xi(o,i,l);c!==null&&($t(c,o,l),Ka(c,o,l)),o={cache:Qd()},i.payload=o;return}o=o.return}}function vL(i,o,l){var c=an();l={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Fl(i)?x0(o,l):(l=jd(i,o,l,c),l!==null&&($t(l,i,c),E0(l,o,c)))}function C0(i,o,l){var c=an();es(i,o,l,c)}function es(i,o,l,c){var g={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Fl(i))x0(o,g);else{var v=i.alternate;if(i.lanes===0&&(v===null||v.lanes===0)&&(v=o.lastRenderedReducer,v!==null))try{var C=o.lastRenderedState,T=v(C,l);if(g.hasEagerState=!0,g.eagerState=T,Jt(T,C))return xl(i,o,g,0),$e===null&&Cl(),!1}catch{}if(l=jd(i,o,g,c),l!==null)return $t(l,i,c),E0(l,o,c),!0}return!1}function Ef(i,o,l,c){if(c={lane:2,revertLane:nh(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Fl(i)){if(o)throw Error(r(479))}else o=jd(i,l,c,2),o!==null&&$t(o,i,2)}function Fl(i){var o=i.alternate;return i===xe||o!==null&&o===xe}function x0(i,o){Bo=zl=!0;var l=i.pending;l===null?o.next=o:(o.next=l.next,l.next=o),i.pending=o}function E0(i,o,l){if((l&4194048)!==0){var c=o.lanes;c&=i.pendingLanes,l|=c,o.lanes=l,Ag(i,l)}}var ts={readContext:kt,use:Ul,useCallback:et,useContext:et,useEffect:et,useImperativeHandle:et,useLayoutEffect:et,useInsertionEffect:et,useMemo:et,useReducer:et,useRef:et,useState:et,useDebugValue:et,useDeferredValue:et,useTransition:et,useSyncExternalStore:et,useId:et,useHostTransitionStatus:et,useFormState:et,useActionState:et,useOptimistic:et,useMemoCache:et,useCacheRefresh:et};ts.useEffectEvent=et;var w0={readContext:kt,use:Ul,useCallback:function(i,o){return Nt().memoizedState=[i,o===void 0?null:o],i},useContext:kt,useEffect:l0,useImperativeHandle:function(i,o,l){l=l!=null?l.concat([i]):null,Vl(4194308,4,f0.bind(null,o,i),l)},useLayoutEffect:function(i,o){return Vl(4194308,4,i,o)},useInsertionEffect:function(i,o){Vl(4,2,i,o)},useMemo:function(i,o){var l=Nt();o=o===void 0?null:o;var c=i();if(Ur){Vi(!0);try{i()}finally{Vi(!1)}}return l.memoizedState=[c,o],c},useReducer:function(i,o,l){var c=Nt();if(l!==void 0){var g=l(o);if(Ur){Vi(!0);try{l(o)}finally{Vi(!1)}}}else g=o;return c.memoizedState=c.baseState=g,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:g},c.queue=i,i=i.dispatch=vL.bind(null,xe,i),[c.memoizedState,i]},useRef:function(i){var o=Nt();return i={current:i},o.memoizedState=i},useState:function(i){i=vf(i);var o=i.queue,l=C0.bind(null,xe,o);return o.dispatch=l,[i.memoizedState,l]},useDebugValue:Sf,useDeferredValue:function(i,o){var l=Nt();return _f(l,i,o)},useTransition:function(){var i=vf(!1);return i=v0.bind(null,xe,i.queue,!0,!1),Nt().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,o,l){var c=xe,g=Nt();if(Oe){if(l===void 0)throw Error(r(407));l=l()}else{if(l=o(),$e===null)throw Error(r(349));(Ae&127)!==0||qv(c,o,l)}g.memoizedState=l;var v={value:l,getSnapshot:o};return g.queue=v,l0(Yv.bind(null,c,v,i),[i]),c.flags|=2048,Go(9,{destroy:void 0},Wv.bind(null,c,v,l,o),null),l},useId:function(){var i=Nt(),o=$e.identifierPrefix;if(Oe){var l=Hn,c=zn;l=(c&~(1<<32-Zt(c)-1)).toString(32)+l,o="_"+o+"R_"+l,l=Hl++,0<l&&(o+="H"+l.toString(32)),o+="_"}else l=cL++,o="_"+o+"r_"+l.toString(32)+"_";return i.memoizedState=o},useHostTransitionStatus:xf,useFormState:i0,useActionState:i0,useOptimistic:function(i){var o=Nt();o.memoizedState=o.baseState=i;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=l,o=Ef.bind(null,xe,!0,l),l.dispatch=o,[i,o]},useMemoCache:pf,useCacheRefresh:function(){return Nt().memoizedState=gL.bind(null,xe)},useEffectEvent:function(i){var o=Nt(),l={impl:i};return o.memoizedState=l,function(){if((Ie&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},wf={readContext:kt,use:Ul,useCallback:p0,useContext:kt,useEffect:bf,useImperativeHandle:h0,useInsertionEffect:c0,useLayoutEffect:d0,useMemo:m0,useReducer:jl,useRef:s0,useState:function(){return jl(fi)},useDebugValue:Sf,useDeferredValue:function(i,o){var l=it();return g0(l,Ue.memoizedState,i,o)},useTransition:function(){var i=jl(fi)[0],o=it().memoizedState;return[typeof i=="boolean"?i:Ja(i),o]},useSyncExternalStore:$v,useId:S0,useHostTransitionStatus:xf,useFormState:r0,useActionState:r0,useOptimistic:function(i,o){var l=it();return Qv(l,Ue,i,o)},useMemoCache:pf,useCacheRefresh:_0};wf.useEffectEvent=u0;var k0={readContext:kt,use:Ul,useCallback:p0,useContext:kt,useEffect:bf,useImperativeHandle:h0,useInsertionEffect:c0,useLayoutEffect:d0,useMemo:m0,useReducer:gf,useRef:s0,useState:function(){return gf(fi)},useDebugValue:Sf,useDeferredValue:function(i,o){var l=it();return Ue===null?_f(l,i,o):g0(l,Ue.memoizedState,i,o)},useTransition:function(){var i=gf(fi)[0],o=it().memoizedState;return[typeof i=="boolean"?i:Ja(i),o]},useSyncExternalStore:$v,useId:S0,useHostTransitionStatus:xf,useFormState:a0,useActionState:a0,useOptimistic:function(i,o){var l=it();return Ue!==null?Qv(l,Ue,i,o):(l.baseState=i,[i,l.queue.dispatch])},useMemoCache:pf,useCacheRefresh:_0};k0.useEffectEvent=u0;function kf(i,o,l,c){o=i.memoizedState,l=l(c,o),l=l==null?o:m({},o,l),i.memoizedState=l,i.lanes===0&&(i.updateQueue.baseState=l)}var Lf={enqueueSetState:function(i,o,l){i=i._reactInternals;var c=an(),g=Ki(c);g.payload=o,l!=null&&(g.callback=l),o=Xi(i,g,c),o!==null&&($t(o,i,c),Ka(o,i,c))},enqueueReplaceState:function(i,o,l){i=i._reactInternals;var c=an(),g=Ki(c);g.tag=1,g.payload=o,l!=null&&(g.callback=l),o=Xi(i,g,c),o!==null&&($t(o,i,c),Ka(o,i,c))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var l=an(),c=Ki(l);c.tag=2,o!=null&&(c.callback=o),o=Xi(i,c,l),o!==null&&($t(o,i,l),Ka(o,i,l))}};function L0(i,o,l,c,g,v,C){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(c,v,C):o.prototype&&o.prototype.isPureReactComponent?!Va(l,c)||!Va(g,v):!0}function T0(i,o,l,c){i=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(l,c),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(l,c),o.state!==i&&Lf.enqueueReplaceState(o,o.state,null)}function jr(i,o){var l=o;if("ref"in o){l={};for(var c in o)c!=="ref"&&(l[c]=o[c])}if(i=i.defaultProps){l===o&&(l=m({},l));for(var g in i)l[g]===void 0&&(l[g]=i[g])}return l}function A0(i){_l(i)}function R0(i){console.error(i)}function O0(i){_l(i)}function Gl(i,o){try{var l=i.onUncaughtError;l(o.value,{componentStack:o.stack})}catch(c){setTimeout(function(){throw c})}}function D0(i,o,l){try{var c=i.onCaughtError;c(l.value,{componentStack:l.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function Tf(i,o,l){return l=Ki(l),l.tag=3,l.payload={element:null},l.callback=function(){Gl(i,o)},l}function M0(i){return i=Ki(i),i.tag=3,i}function N0(i,o,l,c){var g=l.type.getDerivedStateFromError;if(typeof g=="function"){var v=c.value;i.payload=function(){return g(v)},i.callback=function(){D0(o,l,c)}}var C=l.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(i.callback=function(){D0(o,l,c),typeof g!="function"&&(nr===null?nr=new Set([this]):nr.add(this));var T=c.stack;this.componentDidCatch(c.value,{componentStack:T!==null?T:""})})}function yL(i,o,l,c,g){if(l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(o=l.alternate,o!==null&&zo(o,l,g,!0),l=tn.current,l!==null){switch(l.tag){case 31:case 13:return yn===null?nu():l.alternate===null&&tt===0&&(tt=3),l.flags&=-257,l.flags|=65536,l.lanes=g,c===Ol?l.flags|=16384:(o=l.updateQueue,o===null?l.updateQueue=new Set([c]):o.add(c),Jf(i,c,g)),!1;case 22:return l.flags|=65536,c===Ol?l.flags|=16384:(o=l.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([c])},l.updateQueue=o):(l=o.retryQueue,l===null?o.retryQueue=new Set([c]):l.add(c)),Jf(i,c,g)),!1}throw Error(r(435,l.tag))}return Jf(i,c,g),nu(),!1}if(Oe)return o=tn.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=g,c!==qd&&(i=Error(r(422),{cause:c}),Ga(pn(i,l)))):(c!==qd&&(o=Error(r(423),{cause:c}),Ga(pn(o,l))),i=i.current.alternate,i.flags|=65536,g&=-g,i.lanes|=g,c=pn(c,l),g=Tf(i.stateNode,c,g),rf(i,g),tt!==4&&(tt=2)),!1;var v=Error(r(520),{cause:c});if(v=pn(v,l),us===null?us=[v]:us.push(v),tt!==4&&(tt=2),o===null)return!0;c=pn(c,l),l=o;do{switch(l.tag){case 3:return l.flags|=65536,i=g&-g,l.lanes|=i,i=Tf(l.stateNode,c,i),rf(l,i),!1;case 1:if(o=l.type,v=l.stateNode,(l.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(nr===null||!nr.has(v))))return l.flags|=65536,g&=-g,l.lanes|=g,g=M0(g),N0(g,i,l,c),rf(l,g),!1}l=l.return}while(l!==null);return!1}var Af=Error(r(461)),lt=!1;function Lt(i,o,l,c){o.child=i===null?Pv(o,null,l,c):Pr(o,i.child,l,c)}function I0(i,o,l,c,g){l=l.render;var v=o.ref;if("ref"in c){var C={};for(var T in c)T!=="ref"&&(C[T]=c[T])}else C=c;return Nr(o),c=cf(i,o,l,C,v,g),T=df(),i!==null&&!lt?(ff(i,o,g),hi(i,o,g)):(Oe&&T&&Gd(o),o.flags|=1,Lt(i,o,c,g),o.child)}function z0(i,o,l,c,g){if(i===null){var v=l.type;return typeof v=="function"&&!Vd(v)&&v.defaultProps===void 0&&l.compare===null?(o.tag=15,o.type=v,H0(i,o,v,c,g)):(i=wl(l.type,null,c,o,o.mode,g),i.ref=o.ref,i.return=o,o.child=i)}if(v=i.child,!Hf(i,g)){var C=v.memoizedProps;if(l=l.compare,l=l!==null?l:Va,l(C,c)&&i.ref===o.ref)return hi(i,o,g)}return o.flags|=1,i=si(v,c),i.ref=o.ref,i.return=o,o.child=i}function H0(i,o,l,c,g){if(i!==null){var v=i.memoizedProps;if(Va(v,c)&&i.ref===o.ref)if(lt=!1,o.pendingProps=c=v,Hf(i,g))(i.flags&131072)!==0&&(lt=!0);else return o.lanes=i.lanes,hi(i,o,g)}return Rf(i,o,l,c,g)}function P0(i,o,l,c){var g=c.children,v=i!==null?i.memoizedState:null;if(i===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((o.flags&128)!==0){if(v=v!==null?v.baseLanes|l:l,i!==null){for(c=o.child=i.child,g=0;c!==null;)g=g|c.lanes|c.childLanes,c=c.sibling;c=g&~v}else c=0,o.child=null;return U0(i,o,v,l,c)}if((l&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},i!==null&&Al(o,v!==null?v.cachePool:null),v!==null?Vv(o,v):af(),Bv(o);else return c=o.lanes=536870912,U0(i,o,v!==null?v.baseLanes|l:l,l,c)}else v!==null?(Al(o,v.cachePool),Vv(o,v),Zi(),o.memoizedState=null):(i!==null&&Al(o,null),af(),Zi());return Lt(i,o,g,l),o.child}function ns(i,o){return i!==null&&i.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function U0(i,o,l,c,g){var v=Jd();return v=v===null?null:{parent:at._currentValue,pool:v},o.memoizedState={baseLanes:l,cachePool:v},i!==null&&Al(o,null),af(),Bv(o),i!==null&&zo(i,o,c,!0),o.childLanes=g,null}function $l(i,o){return o=Wl({mode:o.mode,children:o.children},i.mode),o.ref=i.ref,i.child=o,o.return=i,o}function j0(i,o,l){return Pr(o,i.child,null,l),i=$l(o,o.pendingProps),i.flags|=2,nn(o),o.memoizedState=null,i}function bL(i,o,l){var c=o.pendingProps,g=(o.flags&128)!==0;if(o.flags&=-129,i===null){if(Oe){if(c.mode==="hidden")return i=$l(o,c),o.lanes=536870912,ns(null,i);if(lf(o),(i=Ye)?(i=Zy(i,vn),i=i!==null&&i.data==="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:Gi!==null?{id:zn,overflow:Hn}:null,retryLane:536870912,hydrationErrors:null},l=xv(i),l.return=o,o.child=l,wt=o,Ye=null)):i=null,i===null)throw qi(o);return o.lanes=536870912,null}return $l(o,c)}var v=i.memoizedState;if(v!==null){var C=v.dehydrated;if(lf(o),g)if(o.flags&256)o.flags&=-257,o=j0(i,o,l);else if(o.memoizedState!==null)o.child=i.child,o.flags|=128,o=null;else throw Error(r(558));else if(lt||zo(i,o,l,!1),g=(l&i.childLanes)!==0,lt||g){if(c=$e,c!==null&&(C=Rg(c,l),C!==0&&C!==v.retryLane))throw v.retryLane=C,Rr(i,C),$t(c,i,C),Af;nu(),o=j0(i,o,l)}else i=v.treeContext,Ye=bn(C.nextSibling),wt=o,Oe=!0,$i=null,vn=!1,i!==null&&kv(o,i),o=$l(o,c),o.flags|=4096;return o}return i=si(i.child,{mode:c.mode,children:c.children}),i.ref=o.ref,o.child=i,i.return=o,i}function ql(i,o){var l=o.ref;if(l===null)i!==null&&i.ref!==null&&(o.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(i===null||i.ref!==l)&&(o.flags|=4194816)}}function Rf(i,o,l,c,g){return Nr(o),l=cf(i,o,l,c,void 0,g),c=df(),i!==null&&!lt?(ff(i,o,g),hi(i,o,g)):(Oe&&c&&Gd(o),o.flags|=1,Lt(i,o,l,g),o.child)}function V0(i,o,l,c,g,v){return Nr(o),o.updateQueue=null,l=Gv(o,c,l,g),Fv(i),c=df(),i!==null&&!lt?(ff(i,o,v),hi(i,o,v)):(Oe&&c&&Gd(o),o.flags|=1,Lt(i,o,l,v),o.child)}function B0(i,o,l,c,g){if(Nr(o),o.stateNode===null){var v=Do,C=l.contextType;typeof C=="object"&&C!==null&&(v=kt(C)),v=new l(c,v),o.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Lf,o.stateNode=v,v._reactInternals=o,v=o.stateNode,v.props=c,v.state=o.memoizedState,v.refs={},tf(o),C=l.contextType,v.context=typeof C=="object"&&C!==null?kt(C):Do,v.state=o.memoizedState,C=l.getDerivedStateFromProps,typeof C=="function"&&(kf(o,l,C,c),v.state=o.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(C=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),C!==v.state&&Lf.enqueueReplaceState(v,v.state,null),Qa(o,c,v,g),Xa(),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308),c=!0}else if(i===null){v=o.stateNode;var T=o.memoizedProps,z=jr(l,T);v.props=z;var F=v.context,Q=l.contextType;C=Do,typeof Q=="object"&&Q!==null&&(C=kt(Q));var ne=l.getDerivedStateFromProps;Q=typeof ne=="function"||typeof v.getSnapshotBeforeUpdate=="function",T=o.pendingProps!==T,Q||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(T||F!==C)&&T0(o,v,c,C),Yi=!1;var $=o.memoizedState;v.state=$,Qa(o,c,v,g),Xa(),F=o.memoizedState,T||$!==F||Yi?(typeof ne=="function"&&(kf(o,l,ne,c),F=o.memoizedState),(z=Yi||L0(o,l,z,c,$,F,C))?(Q||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(o.flags|=4194308)):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=c,o.memoizedState=F),v.props=c,v.state=F,v.context=C,c=z):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),c=!1)}else{v=o.stateNode,nf(i,o),C=o.memoizedProps,Q=jr(l,C),v.props=Q,ne=o.pendingProps,$=v.context,F=l.contextType,z=Do,typeof F=="object"&&F!==null&&(z=kt(F)),T=l.getDerivedStateFromProps,(F=typeof T=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(C!==ne||$!==z)&&T0(o,v,c,z),Yi=!1,$=o.memoizedState,v.state=$,Qa(o,c,v,g),Xa();var K=o.memoizedState;C!==ne||$!==K||Yi||i!==null&&i.dependencies!==null&&Ll(i.dependencies)?(typeof T=="function"&&(kf(o,l,T,c),K=o.memoizedState),(Q=Yi||L0(o,l,Q,c,$,K,z)||i!==null&&i.dependencies!==null&&Ll(i.dependencies))?(F||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(c,K,z),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(c,K,z)),typeof v.componentDidUpdate=="function"&&(o.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof v.componentDidUpdate!="function"||C===i.memoizedProps&&$===i.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||C===i.memoizedProps&&$===i.memoizedState||(o.flags|=1024),o.memoizedProps=c,o.memoizedState=K),v.props=c,v.state=K,v.context=z,c=Q):(typeof v.componentDidUpdate!="function"||C===i.memoizedProps&&$===i.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||C===i.memoizedProps&&$===i.memoizedState||(o.flags|=1024),c=!1)}return v=c,ql(i,o),c=(o.flags&128)!==0,v||c?(v=o.stateNode,l=c&&typeof l.getDerivedStateFromError!="function"?null:v.render(),o.flags|=1,i!==null&&c?(o.child=Pr(o,i.child,null,g),o.child=Pr(o,null,l,g)):Lt(i,o,l,g),o.memoizedState=v.state,i=o.child):i=hi(i,o,g),i}function F0(i,o,l,c){return Dr(),o.flags|=256,Lt(i,o,l,c),o.child}var Of={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Df(i){return{baseLanes:i,cachePool:Dv()}}function Mf(i,o,l){return i=i!==null?i.childLanes&~l:0,o&&(i|=on),i}function G0(i,o,l){var c=o.pendingProps,g=!1,v=(o.flags&128)!==0,C;if((C=v)||(C=i!==null&&i.memoizedState===null?!1:(nt.current&2)!==0),C&&(g=!0,o.flags&=-129),C=(o.flags&32)!==0,o.flags&=-33,i===null){if(Oe){if(g?Qi(o):Zi(),(i=Ye)?(i=Zy(i,vn),i=i!==null&&i.data!=="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:Gi!==null?{id:zn,overflow:Hn}:null,retryLane:536870912,hydrationErrors:null},l=xv(i),l.return=o,o.child=l,wt=o,Ye=null)):i=null,i===null)throw qi(o);return mh(i)?o.lanes=32:o.lanes=536870912,null}var T=c.children;return c=c.fallback,g?(Zi(),g=o.mode,T=Wl({mode:"hidden",children:T},g),c=Or(c,g,l,null),T.return=o,c.return=o,T.sibling=c,o.child=T,c=o.child,c.memoizedState=Df(l),c.childLanes=Mf(i,C,l),o.memoizedState=Of,ns(null,c)):(Qi(o),Nf(o,T))}var z=i.memoizedState;if(z!==null&&(T=z.dehydrated,T!==null)){if(v)o.flags&256?(Qi(o),o.flags&=-257,o=If(i,o,l)):o.memoizedState!==null?(Zi(),o.child=i.child,o.flags|=128,o=null):(Zi(),T=c.fallback,g=o.mode,c=Wl({mode:"visible",children:c.children},g),T=Or(T,g,l,null),T.flags|=2,c.return=o,T.return=o,c.sibling=T,o.child=c,Pr(o,i.child,null,l),c=o.child,c.memoizedState=Df(l),c.childLanes=Mf(i,C,l),o.memoizedState=Of,o=ns(null,c));else if(Qi(o),mh(T)){if(C=T.nextSibling&&T.nextSibling.dataset,C)var F=C.dgst;C=F,c=Error(r(419)),c.stack="",c.digest=C,Ga({value:c,source:null,stack:null}),o=If(i,o,l)}else if(lt||zo(i,o,l,!1),C=(l&i.childLanes)!==0,lt||C){if(C=$e,C!==null&&(c=Rg(C,l),c!==0&&c!==z.retryLane))throw z.retryLane=c,Rr(i,c),$t(C,i,c),Af;ph(T)||nu(),o=If(i,o,l)}else ph(T)?(o.flags|=192,o.child=i.child,o=null):(i=z.treeContext,Ye=bn(T.nextSibling),wt=o,Oe=!0,$i=null,vn=!1,i!==null&&kv(o,i),o=Nf(o,c.children),o.flags|=4096);return o}return g?(Zi(),T=c.fallback,g=o.mode,z=i.child,F=z.sibling,c=si(z,{mode:"hidden",children:c.children}),c.subtreeFlags=z.subtreeFlags&65011712,F!==null?T=si(F,T):(T=Or(T,g,l,null),T.flags|=2),T.return=o,c.return=o,c.sibling=T,o.child=c,ns(null,c),c=o.child,T=i.child.memoizedState,T===null?T=Df(l):(g=T.cachePool,g!==null?(z=at._currentValue,g=g.parent!==z?{parent:z,pool:z}:g):g=Dv(),T={baseLanes:T.baseLanes|l,cachePool:g}),c.memoizedState=T,c.childLanes=Mf(i,C,l),o.memoizedState=Of,ns(i.child,c)):(Qi(o),l=i.child,i=l.sibling,l=si(l,{mode:"visible",children:c.children}),l.return=o,l.sibling=null,i!==null&&(C=o.deletions,C===null?(o.deletions=[i],o.flags|=16):C.push(i)),o.child=l,o.memoizedState=null,l)}function Nf(i,o){return o=Wl({mode:"visible",children:o},i.mode),o.return=i,i.child=o}function Wl(i,o){return i=en(22,i,null,o),i.lanes=0,i}function If(i,o,l){return Pr(o,i.child,null,l),i=Nf(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function $0(i,o,l){i.lanes|=o;var c=i.alternate;c!==null&&(c.lanes|=o),Kd(i.return,o,l)}function zf(i,o,l,c,g,v){var C=i.memoizedState;C===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:c,tail:l,tailMode:g,treeForkCount:v}:(C.isBackwards=o,C.rendering=null,C.renderingStartTime=0,C.last=c,C.tail=l,C.tailMode=g,C.treeForkCount=v)}function q0(i,o,l){var c=o.pendingProps,g=c.revealOrder,v=c.tail;c=c.children;var C=nt.current,T=(C&2)!==0;if(T?(C=C&1|2,o.flags|=128):C&=1,oe(nt,C),Lt(i,o,c,l),c=Oe?Fa:0,!T&&i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&$0(i,l,o);else if(i.tag===19)$0(i,l,o);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break e;for(;i.sibling===null;){if(i.return===null||i.return===o)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(g){case"forwards":for(l=o.child,g=null;l!==null;)i=l.alternate,i!==null&&Il(i)===null&&(g=l),l=l.sibling;l=g,l===null?(g=o.child,o.child=null):(g=l.sibling,l.sibling=null),zf(o,!1,g,l,v,c);break;case"backwards":case"unstable_legacy-backwards":for(l=null,g=o.child,o.child=null;g!==null;){if(i=g.alternate,i!==null&&Il(i)===null){o.child=g;break}i=g.sibling,g.sibling=l,l=g,g=i}zf(o,!0,l,null,v,c);break;case"together":zf(o,!1,null,null,void 0,c);break;default:o.memoizedState=null}return o.child}function hi(i,o,l){if(i!==null&&(o.dependencies=i.dependencies),tr|=o.lanes,(l&o.childLanes)===0)if(i!==null){if(zo(i,o,l,!1),(l&o.childLanes)===0)return null}else return null;if(i!==null&&o.child!==i.child)throw Error(r(153));if(o.child!==null){for(i=o.child,l=si(i,i.pendingProps),o.child=l,l.return=o;i.sibling!==null;)i=i.sibling,l=l.sibling=si(i,i.pendingProps),l.return=o;l.sibling=null}return o.child}function Hf(i,o){return(i.lanes&o)!==0?!0:(i=i.dependencies,!!(i!==null&&Ll(i)))}function SL(i,o,l){switch(o.tag){case 3:ke(o,o.stateNode.containerInfo),Wi(o,at,i.memoizedState.cache),Dr();break;case 27:case 5:Fe(o);break;case 4:ke(o,o.stateNode.containerInfo);break;case 10:Wi(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,lf(o),null;break;case 13:var c=o.memoizedState;if(c!==null)return c.dehydrated!==null?(Qi(o),o.flags|=128,null):(l&o.child.childLanes)!==0?G0(i,o,l):(Qi(o),i=hi(i,o,l),i!==null?i.sibling:null);Qi(o);break;case 19:var g=(i.flags&128)!==0;if(c=(l&o.childLanes)!==0,c||(zo(i,o,l,!1),c=(l&o.childLanes)!==0),g){if(c)return q0(i,o,l);o.flags|=128}if(g=o.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),oe(nt,nt.current),c)break;return null;case 22:return o.lanes=0,P0(i,o,l,o.pendingProps);case 24:Wi(o,at,i.memoizedState.cache)}return hi(i,o,l)}function W0(i,o,l){if(i!==null)if(i.memoizedProps!==o.pendingProps)lt=!0;else{if(!Hf(i,l)&&(o.flags&128)===0)return lt=!1,SL(i,o,l);lt=(i.flags&131072)!==0}else lt=!1,Oe&&(o.flags&1048576)!==0&&wv(o,Fa,o.index);switch(o.lanes=0,o.tag){case 16:e:{var c=o.pendingProps;if(i=zr(o.elementType),o.type=i,typeof i=="function")Vd(i)?(c=jr(i,c),o.tag=1,o=B0(null,o,i,c,l)):(o.tag=0,o=Rf(null,o,i,c,l));else{if(i!=null){var g=i.$$typeof;if(g===R){o.tag=11,o=I0(null,o,i,c,l);break e}else if(g===H){o.tag=14,o=z0(null,o,i,c,l);break e}}throw o=ie(i)||i,Error(r(306,o,""))}}return o;case 0:return Rf(i,o,o.type,o.pendingProps,l);case 1:return c=o.type,g=jr(c,o.pendingProps),B0(i,o,c,g,l);case 3:e:{if(ke(o,o.stateNode.containerInfo),i===null)throw Error(r(387));c=o.pendingProps;var v=o.memoizedState;g=v.element,nf(i,o),Qa(o,c,null,l);var C=o.memoizedState;if(c=C.cache,Wi(o,at,c),c!==v.cache&&Xd(o,[at],l,!0),Xa(),c=C.element,v.isDehydrated)if(v={element:c,isDehydrated:!1,cache:C.cache},o.updateQueue.baseState=v,o.memoizedState=v,o.flags&256){o=F0(i,o,c,l);break e}else if(c!==g){g=pn(Error(r(424)),o),Ga(g),o=F0(i,o,c,l);break e}else for(i=o.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,Ye=bn(i.firstChild),wt=o,Oe=!0,$i=null,vn=!0,l=Pv(o,null,c,l),o.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Dr(),c===g){o=hi(i,o,l);break e}Lt(i,o,c,l)}o=o.child}return o;case 26:return ql(i,o),i===null?(l=rb(o.type,null,o.pendingProps,null))?o.memoizedState=l:Oe||(l=o.type,i=o.pendingProps,c=uu(re.current).createElement(l),c[Et]=o,c[Ut]=i,Tt(c,l,i),yt(c),o.stateNode=c):o.memoizedState=rb(o.type,i.memoizedProps,o.pendingProps,i.memoizedState),null;case 27:return Fe(o),i===null&&Oe&&(c=o.stateNode=tb(o.type,o.pendingProps,re.current),wt=o,vn=!0,g=Ye,ar(o.type)?(gh=g,Ye=bn(c.firstChild)):Ye=g),Lt(i,o,o.pendingProps.children,l),ql(i,o),i===null&&(o.flags|=4194304),o.child;case 5:return i===null&&Oe&&((g=c=Ye)&&(c=XL(c,o.type,o.pendingProps,vn),c!==null?(o.stateNode=c,wt=o,Ye=bn(c.firstChild),vn=!1,g=!0):g=!1),g||qi(o)),Fe(o),g=o.type,v=o.pendingProps,C=i!==null?i.memoizedProps:null,c=v.children,dh(g,v)?c=null:C!==null&&dh(g,C)&&(o.flags|=32),o.memoizedState!==null&&(g=cf(i,o,dL,null,null,l),vs._currentValue=g),ql(i,o),Lt(i,o,c,l),o.child;case 6:return i===null&&Oe&&((i=l=Ye)&&(l=QL(l,o.pendingProps,vn),l!==null?(o.stateNode=l,wt=o,Ye=null,i=!0):i=!1),i||qi(o)),null;case 13:return G0(i,o,l);case 4:return ke(o,o.stateNode.containerInfo),c=o.pendingProps,i===null?o.child=Pr(o,null,c,l):Lt(i,o,c,l),o.child;case 11:return I0(i,o,o.type,o.pendingProps,l);case 7:return Lt(i,o,o.pendingProps,l),o.child;case 8:return Lt(i,o,o.pendingProps.children,l),o.child;case 12:return Lt(i,o,o.pendingProps.children,l),o.child;case 10:return c=o.pendingProps,Wi(o,o.type,c.value),Lt(i,o,c.children,l),o.child;case 9:return g=o.type._context,c=o.pendingProps.children,Nr(o),g=kt(g),c=c(g),o.flags|=1,Lt(i,o,c,l),o.child;case 14:return z0(i,o,o.type,o.pendingProps,l);case 15:return H0(i,o,o.type,o.pendingProps,l);case 19:return q0(i,o,l);case 31:return bL(i,o,l);case 22:return P0(i,o,l,o.pendingProps);case 24:return Nr(o),c=kt(at),i===null?(g=Jd(),g===null&&(g=$e,v=Qd(),g.pooledCache=v,v.refCount++,v!==null&&(g.pooledCacheLanes|=l),g=v),o.memoizedState={parent:c,cache:g},tf(o),Wi(o,at,g)):((i.lanes&l)!==0&&(nf(i,o),Qa(o,null,null,l),Xa()),g=i.memoizedState,v=o.memoizedState,g.parent!==c?(g={parent:c,cache:c},o.memoizedState=g,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=g),Wi(o,at,c)):(c=v.cache,Wi(o,at,c),c!==g.cache&&Xd(o,[at],l,!0))),Lt(i,o,o.pendingProps.children,l),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function pi(i){i.flags|=4}function Pf(i,o,l,c,g){if((o=(i.mode&32)!==0)&&(o=!1),o){if(i.flags|=16777216,(g&335544128)===g)if(i.stateNode.complete)i.flags|=8192;else if(Sy())i.flags|=8192;else throw Hr=Ol,ef}else i.flags&=-16777217}function Y0(i,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!ub(o))if(Sy())i.flags|=8192;else throw Hr=Ol,ef}function Yl(i,o){o!==null&&(i.flags|=4),i.flags&16384&&(o=i.tag!==22?Lg():536870912,i.lanes|=o,Yo|=o)}function is(i,o){if(!Oe)switch(i.tailMode){case"hidden":o=i.tail;for(var l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?i.tail=null:l.sibling=null;break;case"collapsed":l=i.tail;for(var c=null;l!==null;)l.alternate!==null&&(c=l),l=l.sibling;c===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:c.sibling=null}}function Ke(i){var o=i.alternate!==null&&i.alternate.child===i.child,l=0,c=0;if(o)for(var g=i.child;g!==null;)l|=g.lanes|g.childLanes,c|=g.subtreeFlags&65011712,c|=g.flags&65011712,g.return=i,g=g.sibling;else for(g=i.child;g!==null;)l|=g.lanes|g.childLanes,c|=g.subtreeFlags,c|=g.flags,g.return=i,g=g.sibling;return i.subtreeFlags|=c,i.childLanes=l,o}function _L(i,o,l){var c=o.pendingProps;switch($d(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ke(o),null;case 1:return Ke(o),null;case 3:return l=o.stateNode,c=null,i!==null&&(c=i.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),ci(at),fe(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(i===null||i.child===null)&&(Io(o)?pi(o):i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Wd())),Ke(o),null;case 26:var g=o.type,v=o.memoizedState;return i===null?(pi(o),v!==null?(Ke(o),Y0(o,v)):(Ke(o),Pf(o,g,null,c,l))):v?v!==i.memoizedState?(pi(o),Ke(o),Y0(o,v)):(Ke(o),o.flags&=-16777217):(i=i.memoizedProps,i!==c&&pi(o),Ke(o),Pf(o,g,i,c,l)),null;case 27:if(Ge(o),l=re.current,g=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==c&&pi(o);else{if(!c){if(o.stateNode===null)throw Error(r(166));return Ke(o),null}i=le.current,Io(o)?Lv(o):(i=tb(g,c,l),o.stateNode=i,pi(o))}return Ke(o),null;case 5:if(Ge(o),g=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==c&&pi(o);else{if(!c){if(o.stateNode===null)throw Error(r(166));return Ke(o),null}if(v=le.current,Io(o))Lv(o);else{var C=uu(re.current);switch(v){case 1:v=C.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:v=C.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":v=C.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":v=C.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":v=C.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof c.is=="string"?C.createElement("select",{is:c.is}):C.createElement("select"),c.multiple?v.multiple=!0:c.size&&(v.size=c.size);break;default:v=typeof c.is=="string"?C.createElement(g,{is:c.is}):C.createElement(g)}}v[Et]=o,v[Ut]=c;e:for(C=o.child;C!==null;){if(C.tag===5||C.tag===6)v.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===o)break e;for(;C.sibling===null;){if(C.return===null||C.return===o)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}o.stateNode=v;e:switch(Tt(v,g,c),g){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&pi(o)}}return Ke(o),Pf(o,o.type,i===null?null:i.memoizedProps,o.pendingProps,l),null;case 6:if(i&&o.stateNode!=null)i.memoizedProps!==c&&pi(o);else{if(typeof c!="string"&&o.stateNode===null)throw Error(r(166));if(i=re.current,Io(o)){if(i=o.stateNode,l=o.memoizedProps,c=null,g=wt,g!==null)switch(g.tag){case 27:case 5:c=g.memoizedProps}i[Et]=o,i=!!(i.nodeValue===l||c!==null&&c.suppressHydrationWarning===!0||Gy(i.nodeValue,l)),i||qi(o,!0)}else i=uu(i).createTextNode(c),i[Et]=o,o.stateNode=i}return Ke(o),null;case 31:if(l=o.memoizedState,i===null||i.memoizedState!==null){if(c=Io(o),l!==null){if(i===null){if(!c)throw Error(r(318));if(i=o.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Et]=o}else Dr(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Ke(o),i=!1}else l=Wd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=l),i=!0;if(!i)return o.flags&256?(nn(o),o):(nn(o),null);if((o.flags&128)!==0)throw Error(r(558))}return Ke(o),null;case 13:if(c=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(g=Io(o),c!==null&&c.dehydrated!==null){if(i===null){if(!g)throw Error(r(318));if(g=o.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(r(317));g[Et]=o}else Dr(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Ke(o),g=!1}else g=Wd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=g),g=!0;if(!g)return o.flags&256?(nn(o),o):(nn(o),null)}return nn(o),(o.flags&128)!==0?(o.lanes=l,o):(l=c!==null,i=i!==null&&i.memoizedState!==null,l&&(c=o.child,g=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(g=c.alternate.memoizedState.cachePool.pool),v=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(v=c.memoizedState.cachePool.pool),v!==g&&(c.flags|=2048)),l!==i&&l&&(o.child.flags|=8192),Yl(o,o.updateQueue),Ke(o),null);case 4:return fe(),i===null&&ah(o.stateNode.containerInfo),Ke(o),null;case 10:return ci(o.type),Ke(o),null;case 19:if(q(nt),c=o.memoizedState,c===null)return Ke(o),null;if(g=(o.flags&128)!==0,v=c.rendering,v===null)if(g)is(c,!1);else{if(tt!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(v=Il(i),v!==null){for(o.flags|=128,is(c,!1),i=v.updateQueue,o.updateQueue=i,Yl(o,i),o.subtreeFlags=0,i=l,l=o.child;l!==null;)Cv(l,i),l=l.sibling;return oe(nt,nt.current&1|2),Oe&&li(o,c.treeForkCount),o.child}i=i.sibling}c.tail!==null&&Xt()>Jl&&(o.flags|=128,g=!0,is(c,!1),o.lanes=4194304)}else{if(!g)if(i=Il(v),i!==null){if(o.flags|=128,g=!0,i=i.updateQueue,o.updateQueue=i,Yl(o,i),is(c,!0),c.tail===null&&c.tailMode==="hidden"&&!v.alternate&&!Oe)return Ke(o),null}else 2*Xt()-c.renderingStartTime>Jl&&l!==536870912&&(o.flags|=128,g=!0,is(c,!1),o.lanes=4194304);c.isBackwards?(v.sibling=o.child,o.child=v):(i=c.last,i!==null?i.sibling=v:o.child=v,c.last=v)}return c.tail!==null?(i=c.tail,c.rendering=i,c.tail=i.sibling,c.renderingStartTime=Xt(),i.sibling=null,l=nt.current,oe(nt,g?l&1|2:l&1),Oe&&li(o,c.treeForkCount),i):(Ke(o),null);case 22:case 23:return nn(o),sf(),c=o.memoizedState!==null,i!==null?i.memoizedState!==null!==c&&(o.flags|=8192):c&&(o.flags|=8192),c?(l&536870912)!==0&&(o.flags&128)===0&&(Ke(o),o.subtreeFlags&6&&(o.flags|=8192)):Ke(o),l=o.updateQueue,l!==null&&Yl(o,l.retryQueue),l=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(l=i.memoizedState.cachePool.pool),c=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(c=o.memoizedState.cachePool.pool),c!==l&&(o.flags|=2048),i!==null&&q(Ir),null;case 24:return l=null,i!==null&&(l=i.memoizedState.cache),o.memoizedState.cache!==l&&(o.flags|=2048),ci(at),Ke(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function CL(i,o){switch($d(o),o.tag){case 1:return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return ci(at),fe(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 26:case 27:case 5:return Ge(o),null;case 31:if(o.memoizedState!==null){if(nn(o),o.alternate===null)throw Error(r(340));Dr()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 13:if(nn(o),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Dr()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return q(nt),null;case 4:return fe(),null;case 10:return ci(o.type),null;case 22:case 23:return nn(o),sf(),i!==null&&q(Ir),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 24:return ci(at),null;case 25:return null;default:return null}}function K0(i,o){switch($d(o),o.tag){case 3:ci(at),fe();break;case 26:case 27:case 5:Ge(o);break;case 4:fe();break;case 31:o.memoizedState!==null&&nn(o);break;case 13:nn(o);break;case 19:q(nt);break;case 10:ci(o.type);break;case 22:case 23:nn(o),sf(),i!==null&&q(Ir);break;case 24:ci(at)}}function rs(i,o){try{var l=o.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var g=c.next;l=g;do{if((l.tag&i)===i){c=void 0;var v=l.create,C=l.inst;c=v(),C.destroy=c}l=l.next}while(l!==g)}}catch(T){Pe(o,o.return,T)}}function Ji(i,o,l){try{var c=o.updateQueue,g=c!==null?c.lastEffect:null;if(g!==null){var v=g.next;c=v;do{if((c.tag&i)===i){var C=c.inst,T=C.destroy;if(T!==void 0){C.destroy=void 0,g=o;var z=l,F=T;try{F()}catch(Q){Pe(g,z,Q)}}}c=c.next}while(c!==v)}}catch(Q){Pe(o,o.return,Q)}}function X0(i){var o=i.updateQueue;if(o!==null){var l=i.stateNode;try{jv(o,l)}catch(c){Pe(i,i.return,c)}}}function Q0(i,o,l){l.props=jr(i.type,i.memoizedProps),l.state=i.memoizedState;try{l.componentWillUnmount()}catch(c){Pe(i,o,c)}}function os(i,o){try{var l=i.ref;if(l!==null){switch(i.tag){case 26:case 27:case 5:var c=i.stateNode;break;case 30:c=i.stateNode;break;default:c=i.stateNode}typeof l=="function"?i.refCleanup=l(c):l.current=c}}catch(g){Pe(i,o,g)}}function Pn(i,o){var l=i.ref,c=i.refCleanup;if(l!==null)if(typeof c=="function")try{c()}catch(g){Pe(i,o,g)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(g){Pe(i,o,g)}else l.current=null}function Z0(i){var o=i.type,l=i.memoizedProps,c=i.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":l.autoFocus&&c.focus();break e;case"img":l.src?c.src=l.src:l.srcSet&&(c.srcset=l.srcSet)}}catch(g){Pe(i,i.return,g)}}function Uf(i,o,l){try{var c=i.stateNode;GL(c,i.type,l,o),c[Ut]=o}catch(g){Pe(i,i.return,g)}}function J0(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&ar(i.type)||i.tag===4}function jf(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||J0(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&ar(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Vf(i,o,l){var c=i.tag;if(c===5||c===6)i=i.stateNode,o?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(i,o):(o=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,o.appendChild(i),l=l._reactRootContainer,l!=null||o.onclick!==null||(o.onclick=oi));else if(c!==4&&(c===27&&ar(i.type)&&(l=i.stateNode,o=null),i=i.child,i!==null))for(Vf(i,o,l),i=i.sibling;i!==null;)Vf(i,o,l),i=i.sibling}function Kl(i,o,l){var c=i.tag;if(c===5||c===6)i=i.stateNode,o?l.insertBefore(i,o):l.appendChild(i);else if(c!==4&&(c===27&&ar(i.type)&&(l=i.stateNode),i=i.child,i!==null))for(Kl(i,o,l),i=i.sibling;i!==null;)Kl(i,o,l),i=i.sibling}function ey(i){var o=i.stateNode,l=i.memoizedProps;try{for(var c=i.type,g=o.attributes;g.length;)o.removeAttributeNode(g[0]);Tt(o,c,l),o[Et]=i,o[Ut]=l}catch(v){Pe(i,i.return,v)}}var mi=!1,ut=!1,Bf=!1,ty=typeof WeakSet=="function"?WeakSet:Set,bt=null;function xL(i,o){if(i=i.containerInfo,uh=gu,i=hv(i),Nd(i)){if("selectionStart"in i)var l={start:i.selectionStart,end:i.selectionEnd};else e:{l=(l=i.ownerDocument)&&l.defaultView||window;var c=l.getSelection&&l.getSelection();if(c&&c.rangeCount!==0){l=c.anchorNode;var g=c.anchorOffset,v=c.focusNode;c=c.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var C=0,T=-1,z=-1,F=0,Q=0,ne=i,$=null;t:for(;;){for(var K;ne!==l||g!==0&&ne.nodeType!==3||(T=C+g),ne!==v||c!==0&&ne.nodeType!==3||(z=C+c),ne.nodeType===3&&(C+=ne.nodeValue.length),(K=ne.firstChild)!==null;)$=ne,ne=K;for(;;){if(ne===i)break t;if($===l&&++F===g&&(T=C),$===v&&++Q===c&&(z=C),(K=ne.nextSibling)!==null)break;ne=$,$=ne.parentNode}ne=K}l=T===-1||z===-1?null:{start:T,end:z}}else l=null}l=l||{start:0,end:0}}else l=null;for(ch={focusedElem:i,selectionRange:l},gu=!1,bt=o;bt!==null;)if(o=bt,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,bt=i;else for(;bt!==null;){switch(o=bt,v=o.alternate,i=o.flags,o.tag){case 0:if((i&4)!==0&&(i=o.updateQueue,i=i!==null?i.events:null,i!==null))for(l=0;l<i.length;l++)g=i[l],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&v!==null){i=void 0,l=o,g=v.memoizedProps,v=v.memoizedState,c=l.stateNode;try{var me=jr(l.type,g);i=c.getSnapshotBeforeUpdate(me,v),c.__reactInternalSnapshotBeforeUpdate=i}catch(ye){Pe(l,l.return,ye)}}break;case 3:if((i&1024)!==0){if(i=o.stateNode.containerInfo,l=i.nodeType,l===9)hh(i);else if(l===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":hh(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=o.sibling,i!==null){i.return=o.return,bt=i;break}bt=o.return}}function ny(i,o,l){var c=l.flags;switch(l.tag){case 0:case 11:case 15:vi(i,l),c&4&&rs(5,l);break;case 1:if(vi(i,l),c&4)if(i=l.stateNode,o===null)try{i.componentDidMount()}catch(C){Pe(l,l.return,C)}else{var g=jr(l.type,o.memoizedProps);o=o.memoizedState;try{i.componentDidUpdate(g,o,i.__reactInternalSnapshotBeforeUpdate)}catch(C){Pe(l,l.return,C)}}c&64&&X0(l),c&512&&os(l,l.return);break;case 3:if(vi(i,l),c&64&&(i=l.updateQueue,i!==null)){if(o=null,l.child!==null)switch(l.child.tag){case 27:case 5:o=l.child.stateNode;break;case 1:o=l.child.stateNode}try{jv(i,o)}catch(C){Pe(l,l.return,C)}}break;case 27:o===null&&c&4&&ey(l);case 26:case 5:vi(i,l),o===null&&c&4&&Z0(l),c&512&&os(l,l.return);break;case 12:vi(i,l);break;case 31:vi(i,l),c&4&&oy(i,l);break;case 13:vi(i,l),c&4&&ay(i,l),c&64&&(i=l.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(l=DL.bind(null,l),ZL(i,l))));break;case 22:if(c=l.memoizedState!==null||mi,!c){o=o!==null&&o.memoizedState!==null||ut,g=mi;var v=ut;mi=c,(ut=o)&&!v?yi(i,l,(l.subtreeFlags&8772)!==0):vi(i,l),mi=g,ut=v}break;case 30:break;default:vi(i,l)}}function iy(i){var o=i.alternate;o!==null&&(i.alternate=null,iy(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&vd(o)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var Xe=null,Vt=!1;function gi(i,o,l){for(l=l.child;l!==null;)ry(i,o,l),l=l.sibling}function ry(i,o,l){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(Aa,l)}catch{}switch(l.tag){case 26:ut||Pn(l,o),gi(i,o,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:ut||Pn(l,o);var c=Xe,g=Vt;ar(l.type)&&(Xe=l.stateNode,Vt=!1),gi(i,o,l),ps(l.stateNode),Xe=c,Vt=g;break;case 5:ut||Pn(l,o);case 6:if(c=Xe,g=Vt,Xe=null,gi(i,o,l),Xe=c,Vt=g,Xe!==null)if(Vt)try{(Xe.nodeType===9?Xe.body:Xe.nodeName==="HTML"?Xe.ownerDocument.body:Xe).removeChild(l.stateNode)}catch(v){Pe(l,o,v)}else try{Xe.removeChild(l.stateNode)}catch(v){Pe(l,o,v)}break;case 18:Xe!==null&&(Vt?(i=Xe,Xy(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,l.stateNode),na(i)):Xy(Xe,l.stateNode));break;case 4:c=Xe,g=Vt,Xe=l.stateNode.containerInfo,Vt=!0,gi(i,o,l),Xe=c,Vt=g;break;case 0:case 11:case 14:case 15:Ji(2,l,o),ut||Ji(4,l,o),gi(i,o,l);break;case 1:ut||(Pn(l,o),c=l.stateNode,typeof c.componentWillUnmount=="function"&&Q0(l,o,c)),gi(i,o,l);break;case 21:gi(i,o,l);break;case 22:ut=(c=ut)||l.memoizedState!==null,gi(i,o,l),ut=c;break;default:gi(i,o,l)}}function oy(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{na(i)}catch(l){Pe(o,o.return,l)}}}function ay(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{na(i)}catch(l){Pe(o,o.return,l)}}function EL(i){switch(i.tag){case 31:case 13:case 19:var o=i.stateNode;return o===null&&(o=i.stateNode=new ty),o;case 22:return i=i.stateNode,o=i._retryCache,o===null&&(o=i._retryCache=new ty),o;default:throw Error(r(435,i.tag))}}function Xl(i,o){var l=EL(i);o.forEach(function(c){if(!l.has(c)){l.add(c);var g=ML.bind(null,i,c);c.then(g,g)}})}function Bt(i,o){var l=o.deletions;if(l!==null)for(var c=0;c<l.length;c++){var g=l[c],v=i,C=o,T=C;e:for(;T!==null;){switch(T.tag){case 27:if(ar(T.type)){Xe=T.stateNode,Vt=!1;break e}break;case 5:Xe=T.stateNode,Vt=!1;break e;case 3:case 4:Xe=T.stateNode.containerInfo,Vt=!0;break e}T=T.return}if(Xe===null)throw Error(r(160));ry(v,C,g),Xe=null,Vt=!1,v=g.alternate,v!==null&&(v.return=null),g.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)sy(o,i),o=o.sibling}var Ln=null;function sy(i,o){var l=i.alternate,c=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Bt(o,i),Ft(i),c&4&&(Ji(3,i,i.return),rs(3,i),Ji(5,i,i.return));break;case 1:Bt(o,i),Ft(i),c&512&&(ut||l===null||Pn(l,l.return)),c&64&&mi&&(i=i.updateQueue,i!==null&&(c=i.callbacks,c!==null&&(l=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=l===null?c:l.concat(c))));break;case 26:var g=Ln;if(Bt(o,i),Ft(i),c&512&&(ut||l===null||Pn(l,l.return)),c&4){var v=l!==null?l.memoizedState:null;if(c=i.memoizedState,l===null)if(c===null)if(i.stateNode===null){e:{c=i.type,l=i.memoizedProps,g=g.ownerDocument||g;t:switch(c){case"title":v=g.getElementsByTagName("title")[0],(!v||v[Da]||v[Et]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=g.createElement(c),g.head.insertBefore(v,g.querySelector("head > title"))),Tt(v,c,l),v[Et]=i,yt(v),c=v;break e;case"link":var C=sb("link","href",g).get(c+(l.href||""));if(C){for(var T=0;T<C.length;T++)if(v=C[T],v.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&v.getAttribute("rel")===(l.rel==null?null:l.rel)&&v.getAttribute("title")===(l.title==null?null:l.title)&&v.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){C.splice(T,1);break t}}v=g.createElement(c),Tt(v,c,l),g.head.appendChild(v);break;case"meta":if(C=sb("meta","content",g).get(c+(l.content||""))){for(T=0;T<C.length;T++)if(v=C[T],v.getAttribute("content")===(l.content==null?null:""+l.content)&&v.getAttribute("name")===(l.name==null?null:l.name)&&v.getAttribute("property")===(l.property==null?null:l.property)&&v.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&v.getAttribute("charset")===(l.charSet==null?null:l.charSet)){C.splice(T,1);break t}}v=g.createElement(c),Tt(v,c,l),g.head.appendChild(v);break;default:throw Error(r(468,c))}v[Et]=i,yt(v),c=v}i.stateNode=c}else lb(g,i.type,i.stateNode);else i.stateNode=ab(g,c,i.memoizedProps);else v!==c?(v===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):v.count--,c===null?lb(g,i.type,i.stateNode):ab(g,c,i.memoizedProps)):c===null&&i.stateNode!==null&&Uf(i,i.memoizedProps,l.memoizedProps)}break;case 27:Bt(o,i),Ft(i),c&512&&(ut||l===null||Pn(l,l.return)),l!==null&&c&4&&Uf(i,i.memoizedProps,l.memoizedProps);break;case 5:if(Bt(o,i),Ft(i),c&512&&(ut||l===null||Pn(l,l.return)),i.flags&32){g=i.stateNode;try{wo(g,"")}catch(me){Pe(i,i.return,me)}}c&4&&i.stateNode!=null&&(g=i.memoizedProps,Uf(i,g,l!==null?l.memoizedProps:g)),c&1024&&(Bf=!0);break;case 6:if(Bt(o,i),Ft(i),c&4){if(i.stateNode===null)throw Error(r(162));c=i.memoizedProps,l=i.stateNode;try{l.nodeValue=c}catch(me){Pe(i,i.return,me)}}break;case 3:if(fu=null,g=Ln,Ln=cu(o.containerInfo),Bt(o,i),Ln=g,Ft(i),c&4&&l!==null&&l.memoizedState.isDehydrated)try{na(o.containerInfo)}catch(me){Pe(i,i.return,me)}Bf&&(Bf=!1,ly(i));break;case 4:c=Ln,Ln=cu(i.stateNode.containerInfo),Bt(o,i),Ft(i),Ln=c;break;case 12:Bt(o,i),Ft(i);break;case 31:Bt(o,i),Ft(i),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,Xl(i,c)));break;case 13:Bt(o,i),Ft(i),i.child.flags&8192&&i.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Zl=Xt()),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,Xl(i,c)));break;case 22:g=i.memoizedState!==null;var z=l!==null&&l.memoizedState!==null,F=mi,Q=ut;if(mi=F||g,ut=Q||z,Bt(o,i),ut=Q,mi=F,Ft(i),c&8192)e:for(o=i.stateNode,o._visibility=g?o._visibility&-2:o._visibility|1,g&&(l===null||z||mi||ut||Vr(i)),l=null,o=i;;){if(o.tag===5||o.tag===26){if(l===null){z=l=o;try{if(v=z.stateNode,g)C=v.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{T=z.stateNode;var ne=z.memoizedProps.style,$=ne!=null&&ne.hasOwnProperty("display")?ne.display:null;T.style.display=$==null||typeof $=="boolean"?"":(""+$).trim()}}catch(me){Pe(z,z.return,me)}}}else if(o.tag===6){if(l===null){z=o;try{z.stateNode.nodeValue=g?"":z.memoizedProps}catch(me){Pe(z,z.return,me)}}}else if(o.tag===18){if(l===null){z=o;try{var K=z.stateNode;g?Qy(K,!0):Qy(z.stateNode,!1)}catch(me){Pe(z,z.return,me)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===i)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break e;for(;o.sibling===null;){if(o.return===null||o.return===i)break e;l===o&&(l=null),o=o.return}l===o&&(l=null),o.sibling.return=o.return,o=o.sibling}c&4&&(c=i.updateQueue,c!==null&&(l=c.retryQueue,l!==null&&(c.retryQueue=null,Xl(i,l))));break;case 19:Bt(o,i),Ft(i),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,Xl(i,c)));break;case 30:break;case 21:break;default:Bt(o,i),Ft(i)}}function Ft(i){var o=i.flags;if(o&2){try{for(var l,c=i.return;c!==null;){if(J0(c)){l=c;break}c=c.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var g=l.stateNode,v=jf(i);Kl(i,v,g);break;case 5:var C=l.stateNode;l.flags&32&&(wo(C,""),l.flags&=-33);var T=jf(i);Kl(i,T,C);break;case 3:case 4:var z=l.stateNode.containerInfo,F=jf(i);Vf(i,F,z);break;default:throw Error(r(161))}}catch(Q){Pe(i,i.return,Q)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function ly(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var o=i;ly(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),i=i.sibling}}function vi(i,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)ny(i,o.alternate,o),o=o.sibling}function Vr(i){for(i=i.child;i!==null;){var o=i;switch(o.tag){case 0:case 11:case 14:case 15:Ji(4,o,o.return),Vr(o);break;case 1:Pn(o,o.return);var l=o.stateNode;typeof l.componentWillUnmount=="function"&&Q0(o,o.return,l),Vr(o);break;case 27:ps(o.stateNode);case 26:case 5:Pn(o,o.return),Vr(o);break;case 22:o.memoizedState===null&&Vr(o);break;case 30:Vr(o);break;default:Vr(o)}i=i.sibling}}function yi(i,o,l){for(l=l&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var c=o.alternate,g=i,v=o,C=v.flags;switch(v.tag){case 0:case 11:case 15:yi(g,v,l),rs(4,v);break;case 1:if(yi(g,v,l),c=v,g=c.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(F){Pe(c,c.return,F)}if(c=v,g=c.updateQueue,g!==null){var T=c.stateNode;try{var z=g.shared.hiddenCallbacks;if(z!==null)for(g.shared.hiddenCallbacks=null,g=0;g<z.length;g++)Uv(z[g],T)}catch(F){Pe(c,c.return,F)}}l&&C&64&&X0(v),os(v,v.return);break;case 27:ey(v);case 26:case 5:yi(g,v,l),l&&c===null&&C&4&&Z0(v),os(v,v.return);break;case 12:yi(g,v,l);break;case 31:yi(g,v,l),l&&C&4&&oy(g,v);break;case 13:yi(g,v,l),l&&C&4&&ay(g,v);break;case 22:v.memoizedState===null&&yi(g,v,l),os(v,v.return);break;case 30:break;default:yi(g,v,l)}o=o.sibling}}function Ff(i,o){var l=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(l=i.memoizedState.cachePool.pool),i=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(i=o.memoizedState.cachePool.pool),i!==l&&(i!=null&&i.refCount++,l!=null&&$a(l))}function Gf(i,o){i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&$a(i))}function Tn(i,o,l,c){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)uy(i,o,l,c),o=o.sibling}function uy(i,o,l,c){var g=o.flags;switch(o.tag){case 0:case 11:case 15:Tn(i,o,l,c),g&2048&&rs(9,o);break;case 1:Tn(i,o,l,c);break;case 3:Tn(i,o,l,c),g&2048&&(i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&$a(i)));break;case 12:if(g&2048){Tn(i,o,l,c),i=o.stateNode;try{var v=o.memoizedProps,C=v.id,T=v.onPostCommit;typeof T=="function"&&T(C,o.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(z){Pe(o,o.return,z)}}else Tn(i,o,l,c);break;case 31:Tn(i,o,l,c);break;case 13:Tn(i,o,l,c);break;case 23:break;case 22:v=o.stateNode,C=o.alternate,o.memoizedState!==null?v._visibility&2?Tn(i,o,l,c):as(i,o):v._visibility&2?Tn(i,o,l,c):(v._visibility|=2,$o(i,o,l,c,(o.subtreeFlags&10256)!==0||!1)),g&2048&&Ff(C,o);break;case 24:Tn(i,o,l,c),g&2048&&Gf(o.alternate,o);break;default:Tn(i,o,l,c)}}function $o(i,o,l,c,g){for(g=g&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var v=i,C=o,T=l,z=c,F=C.flags;switch(C.tag){case 0:case 11:case 15:$o(v,C,T,z,g),rs(8,C);break;case 23:break;case 22:var Q=C.stateNode;C.memoizedState!==null?Q._visibility&2?$o(v,C,T,z,g):as(v,C):(Q._visibility|=2,$o(v,C,T,z,g)),g&&F&2048&&Ff(C.alternate,C);break;case 24:$o(v,C,T,z,g),g&&F&2048&&Gf(C.alternate,C);break;default:$o(v,C,T,z,g)}o=o.sibling}}function as(i,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var l=i,c=o,g=c.flags;switch(c.tag){case 22:as(l,c),g&2048&&Ff(c.alternate,c);break;case 24:as(l,c),g&2048&&Gf(c.alternate,c);break;default:as(l,c)}o=o.sibling}}var ss=8192;function qo(i,o,l){if(i.subtreeFlags&ss)for(i=i.child;i!==null;)cy(i,o,l),i=i.sibling}function cy(i,o,l){switch(i.tag){case 26:qo(i,o,l),i.flags&ss&&i.memoizedState!==null&&cT(l,Ln,i.memoizedState,i.memoizedProps);break;case 5:qo(i,o,l);break;case 3:case 4:var c=Ln;Ln=cu(i.stateNode.containerInfo),qo(i,o,l),Ln=c;break;case 22:i.memoizedState===null&&(c=i.alternate,c!==null&&c.memoizedState!==null?(c=ss,ss=16777216,qo(i,o,l),ss=c):qo(i,o,l));break;default:qo(i,o,l)}}function dy(i){var o=i.alternate;if(o!==null&&(i=o.child,i!==null)){o.child=null;do o=i.sibling,i.sibling=null,i=o;while(i!==null)}}function ls(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var l=0;l<o.length;l++){var c=o[l];bt=c,hy(c,i)}dy(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)fy(i),i=i.sibling}function fy(i){switch(i.tag){case 0:case 11:case 15:ls(i),i.flags&2048&&Ji(9,i,i.return);break;case 3:ls(i);break;case 12:ls(i);break;case 22:var o=i.stateNode;i.memoizedState!==null&&o._visibility&2&&(i.return===null||i.return.tag!==13)?(o._visibility&=-3,Ql(i)):ls(i);break;default:ls(i)}}function Ql(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var l=0;l<o.length;l++){var c=o[l];bt=c,hy(c,i)}dy(i)}for(i=i.child;i!==null;){switch(o=i,o.tag){case 0:case 11:case 15:Ji(8,o,o.return),Ql(o);break;case 22:l=o.stateNode,l._visibility&2&&(l._visibility&=-3,Ql(o));break;default:Ql(o)}i=i.sibling}}function hy(i,o){for(;bt!==null;){var l=bt;switch(l.tag){case 0:case 11:case 15:Ji(8,l,o);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var c=l.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:$a(l.memoizedState.cache)}if(c=l.child,c!==null)c.return=l,bt=c;else e:for(l=i;bt!==null;){c=bt;var g=c.sibling,v=c.return;if(iy(c),c===l){bt=null;break e}if(g!==null){g.return=v,bt=g;break e}bt=v}}}var wL={getCacheForType:function(i){var o=kt(at),l=o.data.get(i);return l===void 0&&(l=i(),o.data.set(i,l)),l},cacheSignal:function(){return kt(at).controller.signal}},kL=typeof WeakMap=="function"?WeakMap:Map,Ie=0,$e=null,Le=null,Ae=0,He=0,rn=null,er=!1,Wo=!1,$f=!1,bi=0,tt=0,tr=0,Br=0,qf=0,on=0,Yo=0,us=null,Gt=null,Wf=!1,Zl=0,py=0,Jl=1/0,eu=null,nr=null,dt=0,ir=null,Ko=null,Si=0,Yf=0,Kf=null,my=null,cs=0,Xf=null;function an(){return(Ie&2)!==0&&Ae!==0?Ae&-Ae:I.T!==null?nh():Og()}function gy(){if(on===0)if((Ae&536870912)===0||Oe){var i=ll;ll<<=1,(ll&3932160)===0&&(ll=262144),on=i}else on=536870912;return i=tn.current,i!==null&&(i.flags|=32),on}function $t(i,o,l){(i===$e&&(He===2||He===9)||i.cancelPendingCommit!==null)&&(Xo(i,0),rr(i,Ae,on,!1)),Oa(i,l),((Ie&2)===0||i!==$e)&&(i===$e&&((Ie&2)===0&&(Br|=l),tt===4&&rr(i,Ae,on,!1)),Un(i))}function vy(i,o,l){if((Ie&6)!==0)throw Error(r(327));var c=!l&&(o&127)===0&&(o&i.expiredLanes)===0||Ra(i,o),g=c?AL(i,o):Zf(i,o,!0),v=c;do{if(g===0){Wo&&!c&&rr(i,o,0,!1);break}else{if(l=i.current.alternate,v&&!LL(l)){g=Zf(i,o,!1),v=!1;continue}if(g===2){if(v=o,i.errorRecoveryDisabledLanes&v)var C=0;else C=i.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){o=C;e:{var T=i;g=us;var z=T.current.memoizedState.isDehydrated;if(z&&(Xo(T,C).flags|=256),C=Zf(T,C,!1),C!==2){if($f&&!z){T.errorRecoveryDisabledLanes|=v,Br|=v,g=4;break e}v=Gt,Gt=g,v!==null&&(Gt===null?Gt=v:Gt.push.apply(Gt,v))}g=C}if(v=!1,g!==2)continue}}if(g===1){Xo(i,0),rr(i,o,0,!0);break}e:{switch(c=i,v=g,v){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:rr(c,o,on,!er);break e;case 2:Gt=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(g=Zl+300-Xt(),10<g)){if(rr(c,o,on,!er),cl(c,0,!0)!==0)break e;Si=o,c.timeoutHandle=Yy(yy.bind(null,c,l,Gt,eu,Wf,o,on,Br,Yo,er,v,"Throttled",-0,0),g);break e}yy(c,l,Gt,eu,Wf,o,on,Br,Yo,er,v,null,-0,0)}}break}while(!0);Un(i)}function yy(i,o,l,c,g,v,C,T,z,F,Q,ne,$,K){if(i.timeoutHandle=-1,ne=o.subtreeFlags,ne&8192||(ne&16785408)===16785408){ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:oi},cy(o,v,ne);var me=(v&62914560)===v?Zl-Xt():(v&4194048)===v?py-Xt():0;if(me=dT(ne,me),me!==null){Si=v,i.cancelPendingCommit=me(ky.bind(null,i,o,v,l,c,g,C,T,z,Q,ne,null,$,K)),rr(i,v,C,!F);return}}ky(i,o,v,l,c,g,C,T,z)}function LL(i){for(var o=i;;){var l=o.tag;if((l===0||l===11||l===15)&&o.flags&16384&&(l=o.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var c=0;c<l.length;c++){var g=l[c],v=g.getSnapshot;g=g.value;try{if(!Jt(v(),g))return!1}catch{return!1}}if(l=o.child,o.subtreeFlags&16384&&l!==null)l.return=o,o=l;else{if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function rr(i,o,l,c){o&=~qf,o&=~Br,i.suspendedLanes|=o,i.pingedLanes&=~o,c&&(i.warmLanes|=o),c=i.expirationTimes;for(var g=o;0<g;){var v=31-Zt(g),C=1<<v;c[v]=-1,g&=~C}l!==0&&Tg(i,l,o)}function tu(){return(Ie&6)===0?(ds(0),!1):!0}function Qf(){if(Le!==null){if(He===0)var i=Le.return;else i=Le,ui=Mr=null,hf(i),jo=null,Wa=0,i=Le;for(;i!==null;)K0(i.alternate,i),i=i.return;Le=null}}function Xo(i,o){var l=i.timeoutHandle;l!==-1&&(i.timeoutHandle=-1,WL(l)),l=i.cancelPendingCommit,l!==null&&(i.cancelPendingCommit=null,l()),Si=0,Qf(),$e=i,Le=l=si(i.current,null),Ae=o,He=0,rn=null,er=!1,Wo=Ra(i,o),$f=!1,Yo=on=qf=Br=tr=tt=0,Gt=us=null,Wf=!1,(o&8)!==0&&(o|=o&32);var c=i.entangledLanes;if(c!==0)for(i=i.entanglements,c&=o;0<c;){var g=31-Zt(c),v=1<<g;o|=i[g],c&=~v}return bi=o,Cl(),l}function by(i,o){xe=null,I.H=ts,o===Uo||o===Rl?(o=Iv(),He=3):o===ef?(o=Iv(),He=4):He=o===Af?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,rn=o,Le===null&&(tt=1,Gl(i,pn(o,i.current)))}function Sy(){var i=tn.current;return i===null?!0:(Ae&4194048)===Ae?yn===null:(Ae&62914560)===Ae||(Ae&536870912)!==0?i===yn:!1}function _y(){var i=I.H;return I.H=ts,i===null?ts:i}function Cy(){var i=I.A;return I.A=wL,i}function nu(){tt=4,er||(Ae&4194048)!==Ae&&tn.current!==null||(Wo=!0),(tr&134217727)===0&&(Br&134217727)===0||$e===null||rr($e,Ae,on,!1)}function Zf(i,o,l){var c=Ie;Ie|=2;var g=_y(),v=Cy();($e!==i||Ae!==o)&&(eu=null,Xo(i,o)),o=!1;var C=tt;e:do try{if(He!==0&&Le!==null){var T=Le,z=rn;switch(He){case 8:Qf(),C=6;break e;case 3:case 2:case 9:case 6:tn.current===null&&(o=!0);var F=He;if(He=0,rn=null,Qo(i,T,z,F),l&&Wo){C=0;break e}break;default:F=He,He=0,rn=null,Qo(i,T,z,F)}}TL(),C=tt;break}catch(Q){by(i,Q)}while(!0);return o&&i.shellSuspendCounter++,ui=Mr=null,Ie=c,I.H=g,I.A=v,Le===null&&($e=null,Ae=0,Cl()),C}function TL(){for(;Le!==null;)xy(Le)}function AL(i,o){var l=Ie;Ie|=2;var c=_y(),g=Cy();$e!==i||Ae!==o?(eu=null,Jl=Xt()+500,Xo(i,o)):Wo=Ra(i,o);e:do try{if(He!==0&&Le!==null){o=Le;var v=rn;t:switch(He){case 1:He=0,rn=null,Qo(i,o,v,1);break;case 2:case 9:if(Mv(v)){He=0,rn=null,Ey(o);break}o=function(){He!==2&&He!==9||$e!==i||(He=7),Un(i)},v.then(o,o);break e;case 3:He=7;break e;case 4:He=5;break e;case 7:Mv(v)?(He=0,rn=null,Ey(o)):(He=0,rn=null,Qo(i,o,v,7));break;case 5:var C=null;switch(Le.tag){case 26:C=Le.memoizedState;case 5:case 27:var T=Le;if(C?ub(C):T.stateNode.complete){He=0,rn=null;var z=T.sibling;if(z!==null)Le=z;else{var F=T.return;F!==null?(Le=F,iu(F)):Le=null}break t}}He=0,rn=null,Qo(i,o,v,5);break;case 6:He=0,rn=null,Qo(i,o,v,6);break;case 8:Qf(),tt=6;break e;default:throw Error(r(462))}}RL();break}catch(Q){by(i,Q)}while(!0);return ui=Mr=null,I.H=c,I.A=g,Ie=l,Le!==null?0:($e=null,Ae=0,Cl(),tt)}function RL(){for(;Le!==null&&!J1();)xy(Le)}function xy(i){var o=W0(i.alternate,i,bi);i.memoizedProps=i.pendingProps,o===null?iu(i):Le=o}function Ey(i){var o=i,l=o.alternate;switch(o.tag){case 15:case 0:o=V0(l,o,o.pendingProps,o.type,void 0,Ae);break;case 11:o=V0(l,o,o.pendingProps,o.type.render,o.ref,Ae);break;case 5:hf(o);default:K0(l,o),o=Le=Cv(o,bi),o=W0(l,o,bi)}i.memoizedProps=i.pendingProps,o===null?iu(i):Le=o}function Qo(i,o,l,c){ui=Mr=null,hf(o),jo=null,Wa=0;var g=o.return;try{if(yL(i,g,o,l,Ae)){tt=1,Gl(i,pn(l,i.current)),Le=null;return}}catch(v){if(g!==null)throw Le=g,v;tt=1,Gl(i,pn(l,i.current)),Le=null;return}o.flags&32768?(Oe||c===1?i=!0:Wo||(Ae&536870912)!==0?i=!1:(er=i=!0,(c===2||c===9||c===3||c===6)&&(c=tn.current,c!==null&&c.tag===13&&(c.flags|=16384))),wy(o,i)):iu(o)}function iu(i){var o=i;do{if((o.flags&32768)!==0){wy(o,er);return}i=o.return;var l=_L(o.alternate,o,bi);if(l!==null){Le=l;return}if(o=o.sibling,o!==null){Le=o;return}Le=o=i}while(o!==null);tt===0&&(tt=5)}function wy(i,o){do{var l=CL(i.alternate,i);if(l!==null){l.flags&=32767,Le=l;return}if(l=i.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!o&&(i=i.sibling,i!==null)){Le=i;return}Le=i=l}while(i!==null);tt=6,Le=null}function ky(i,o,l,c,g,v,C,T,z){i.cancelPendingCommit=null;do ru();while(dt!==0);if((Ie&6)!==0)throw Error(r(327));if(o!==null){if(o===i.current)throw Error(r(177));if(v=o.lanes|o.childLanes,v|=Ud,uk(i,l,v,C,T,z),i===$e&&(Le=$e=null,Ae=0),Ko=o,ir=i,Si=l,Yf=v,Kf=g,my=c,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,NL(al,function(){return Oy(),null})):(i.callbackNode=null,i.callbackPriority=0),c=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||c){c=I.T,I.T=null,g=G.p,G.p=2,C=Ie,Ie|=4;try{xL(i,o,l)}finally{Ie=C,G.p=g,I.T=c}}dt=1,Ly(),Ty(),Ay()}}function Ly(){if(dt===1){dt=0;var i=ir,o=Ko,l=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||l){l=I.T,I.T=null;var c=G.p;G.p=2;var g=Ie;Ie|=4;try{sy(o,i);var v=ch,C=hv(i.containerInfo),T=v.focusedElem,z=v.selectionRange;if(C!==T&&T&&T.ownerDocument&&fv(T.ownerDocument.documentElement,T)){if(z!==null&&Nd(T)){var F=z.start,Q=z.end;if(Q===void 0&&(Q=F),"selectionStart"in T)T.selectionStart=F,T.selectionEnd=Math.min(Q,T.value.length);else{var ne=T.ownerDocument||document,$=ne&&ne.defaultView||window;if($.getSelection){var K=$.getSelection(),me=T.textContent.length,ye=Math.min(z.start,me),Ve=z.end===void 0?ye:Math.min(z.end,me);!K.extend&&ye>Ve&&(C=Ve,Ve=ye,ye=C);var j=dv(T,ye),P=dv(T,Ve);if(j&&P&&(K.rangeCount!==1||K.anchorNode!==j.node||K.anchorOffset!==j.offset||K.focusNode!==P.node||K.focusOffset!==P.offset)){var B=ne.createRange();B.setStart(j.node,j.offset),K.removeAllRanges(),ye>Ve?(K.addRange(B),K.extend(P.node,P.offset)):(B.setEnd(P.node,P.offset),K.addRange(B))}}}}for(ne=[],K=T;K=K.parentNode;)K.nodeType===1&&ne.push({element:K,left:K.scrollLeft,top:K.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<ne.length;T++){var J=ne[T];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}gu=!!uh,ch=uh=null}finally{Ie=g,G.p=c,I.T=l}}i.current=o,dt=2}}function Ty(){if(dt===2){dt=0;var i=ir,o=Ko,l=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||l){l=I.T,I.T=null;var c=G.p;G.p=2;var g=Ie;Ie|=4;try{ny(i,o.alternate,o)}finally{Ie=g,G.p=c,I.T=l}}dt=3}}function Ay(){if(dt===4||dt===3){dt=0,ek();var i=ir,o=Ko,l=Si,c=my;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?dt=5:(dt=0,Ko=ir=null,Ry(i,i.pendingLanes));var g=i.pendingLanes;if(g===0&&(nr=null),md(l),o=o.stateNode,Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(Aa,o,void 0,(o.current.flags&128)===128)}catch{}if(c!==null){o=I.T,g=G.p,G.p=2,I.T=null;try{for(var v=i.onRecoverableError,C=0;C<c.length;C++){var T=c[C];v(T.value,{componentStack:T.stack})}}finally{I.T=o,G.p=g}}(Si&3)!==0&&ru(),Un(i),g=i.pendingLanes,(l&261930)!==0&&(g&42)!==0?i===Xf?cs++:(cs=0,Xf=i):cs=0,ds(0)}}function Ry(i,o){(i.pooledCacheLanes&=o)===0&&(o=i.pooledCache,o!=null&&(i.pooledCache=null,$a(o)))}function ru(){return Ly(),Ty(),Ay(),Oy()}function Oy(){if(dt!==5)return!1;var i=ir,o=Yf;Yf=0;var l=md(Si),c=I.T,g=G.p;try{G.p=32>l?32:l,I.T=null,l=Kf,Kf=null;var v=ir,C=Si;if(dt=0,Ko=ir=null,Si=0,(Ie&6)!==0)throw Error(r(331));var T=Ie;if(Ie|=4,fy(v.current),uy(v,v.current,C,l),Ie=T,ds(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(Aa,v)}catch{}return!0}finally{G.p=g,I.T=c,Ry(i,o)}}function Dy(i,o,l){o=pn(l,o),o=Tf(i.stateNode,o,2),i=Xi(i,o,2),i!==null&&(Oa(i,2),Un(i))}function Pe(i,o,l){if(i.tag===3)Dy(i,i,l);else for(;o!==null;){if(o.tag===3){Dy(o,i,l);break}else if(o.tag===1){var c=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(nr===null||!nr.has(c))){i=pn(l,i),l=M0(2),c=Xi(o,l,2),c!==null&&(N0(l,c,o,i),Oa(c,2),Un(c));break}}o=o.return}}function Jf(i,o,l){var c=i.pingCache;if(c===null){c=i.pingCache=new kL;var g=new Set;c.set(o,g)}else g=c.get(o),g===void 0&&(g=new Set,c.set(o,g));g.has(l)||($f=!0,g.add(l),i=OL.bind(null,i,o,l),o.then(i,i))}function OL(i,o,l){var c=i.pingCache;c!==null&&c.delete(o),i.pingedLanes|=i.suspendedLanes&l,i.warmLanes&=~l,$e===i&&(Ae&l)===l&&(tt===4||tt===3&&(Ae&62914560)===Ae&&300>Xt()-Zl?(Ie&2)===0&&Xo(i,0):qf|=l,Yo===Ae&&(Yo=0)),Un(i)}function My(i,o){o===0&&(o=Lg()),i=Rr(i,o),i!==null&&(Oa(i,o),Un(i))}function DL(i){var o=i.memoizedState,l=0;o!==null&&(l=o.retryLane),My(i,l)}function ML(i,o){var l=0;switch(i.tag){case 31:case 13:var c=i.stateNode,g=i.memoizedState;g!==null&&(l=g.retryLane);break;case 19:c=i.stateNode;break;case 22:c=i.stateNode._retryCache;break;default:throw Error(r(314))}c!==null&&c.delete(o),My(i,l)}function NL(i,o){return vt(i,o)}var ou=null,Zo=null,eh=!1,au=!1,th=!1,or=0;function Un(i){i!==Zo&&i.next===null&&(Zo===null?ou=Zo=i:Zo=Zo.next=i),au=!0,eh||(eh=!0,zL())}function ds(i,o){if(!th&&au){th=!0;do for(var l=!1,c=ou;c!==null;){if(i!==0){var g=c.pendingLanes;if(g===0)var v=0;else{var C=c.suspendedLanes,T=c.pingedLanes;v=(1<<31-Zt(42|i)+1)-1,v&=g&~(C&~T),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(l=!0,Hy(c,v))}else v=Ae,v=cl(c,c===$e?v:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(v&3)===0||Ra(c,v)||(l=!0,Hy(c,v));c=c.next}while(l);th=!1}}function IL(){Ny()}function Ny(){au=eh=!1;var i=0;or!==0&&qL()&&(i=or);for(var o=Xt(),l=null,c=ou;c!==null;){var g=c.next,v=Iy(c,o);v===0?(c.next=null,l===null?ou=g:l.next=g,g===null&&(Zo=l)):(l=c,(i!==0||(v&3)!==0)&&(au=!0)),c=g}dt!==0&&dt!==5||ds(i),or!==0&&(or=0)}function Iy(i,o){for(var l=i.suspendedLanes,c=i.pingedLanes,g=i.expirationTimes,v=i.pendingLanes&-62914561;0<v;){var C=31-Zt(v),T=1<<C,z=g[C];z===-1?((T&l)===0||(T&c)!==0)&&(g[C]=lk(T,o)):z<=o&&(i.expiredLanes|=T),v&=~T}if(o=$e,l=Ae,l=cl(i,i===o?l:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),c=i.callbackNode,l===0||i===o&&(He===2||He===9)||i.cancelPendingCommit!==null)return c!==null&&c!==null&&ji(c),i.callbackNode=null,i.callbackPriority=0;if((l&3)===0||Ra(i,l)){if(o=l&-l,o===i.callbackPriority)return o;switch(c!==null&&ji(c),md(l)){case 2:case 8:l=wg;break;case 32:l=al;break;case 268435456:l=kg;break;default:l=al}return c=zy.bind(null,i),l=vt(l,c),i.callbackPriority=o,i.callbackNode=l,o}return c!==null&&c!==null&&ji(c),i.callbackPriority=2,i.callbackNode=null,2}function zy(i,o){if(dt!==0&&dt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var l=i.callbackNode;if(ru()&&i.callbackNode!==l)return null;var c=Ae;return c=cl(i,i===$e?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),c===0?null:(vy(i,c,o),Iy(i,Xt()),i.callbackNode!=null&&i.callbackNode===l?zy.bind(null,i):null)}function Hy(i,o){if(ru())return null;vy(i,o,!0)}function zL(){YL(function(){(Ie&6)!==0?vt(Eg,IL):Ny()})}function nh(){if(or===0){var i=Ho;i===0&&(i=sl,sl<<=1,(sl&261888)===0&&(sl=256)),or=i}return or}function Py(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:pl(""+i)}function Uy(i,o){var l=o.ownerDocument.createElement("input");return l.name=o.name,l.value=o.value,i.id&&l.setAttribute("form",i.id),o.parentNode.insertBefore(l,o),i=new FormData(i),l.parentNode.removeChild(l),i}function HL(i,o,l,c,g){if(o==="submit"&&l&&l.stateNode===g){var v=Py((g[Ut]||null).action),C=c.submitter;C&&(o=(o=C[Ut]||null)?Py(o.formAction):C.getAttribute("formAction"),o!==null&&(v=o,C=null));var T=new yl("action","action",null,c,g);i.push({event:T,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(or!==0){var z=C?Uy(g,C):new FormData(g);Cf(l,{pending:!0,data:z,method:g.method,action:v},null,z)}}else typeof v=="function"&&(T.preventDefault(),z=C?Uy(g,C):new FormData(g),Cf(l,{pending:!0,data:z,method:g.method,action:v},v,z))},currentTarget:g}]})}}for(var ih=0;ih<Pd.length;ih++){var rh=Pd[ih],PL=rh.toLowerCase(),UL=rh[0].toUpperCase()+rh.slice(1);kn(PL,"on"+UL)}kn(gv,"onAnimationEnd"),kn(vv,"onAnimationIteration"),kn(yv,"onAnimationStart"),kn("dblclick","onDoubleClick"),kn("focusin","onFocus"),kn("focusout","onBlur"),kn(tL,"onTransitionRun"),kn(nL,"onTransitionStart"),kn(iL,"onTransitionCancel"),kn(bv,"onTransitionEnd"),xo("onMouseEnter",["mouseout","mouseover"]),xo("onMouseLeave",["mouseout","mouseover"]),xo("onPointerEnter",["pointerout","pointerover"]),xo("onPointerLeave",["pointerout","pointerover"]),kr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),kr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),kr("onBeforeInput",["compositionend","keypress","textInput","paste"]),kr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),kr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),kr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fs="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(" "),jL=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(fs));function jy(i,o){o=(o&4)!==0;for(var l=0;l<i.length;l++){var c=i[l],g=c.event;c=c.listeners;e:{var v=void 0;if(o)for(var C=c.length-1;0<=C;C--){var T=c[C],z=T.instance,F=T.currentTarget;if(T=T.listener,z!==v&&g.isPropagationStopped())break e;v=T,g.currentTarget=F;try{v(g)}catch(Q){_l(Q)}g.currentTarget=null,v=z}else for(C=0;C<c.length;C++){if(T=c[C],z=T.instance,F=T.currentTarget,T=T.listener,z!==v&&g.isPropagationStopped())break e;v=T,g.currentTarget=F;try{v(g)}catch(Q){_l(Q)}g.currentTarget=null,v=z}}}}function Te(i,o){var l=o[gd];l===void 0&&(l=o[gd]=new Set);var c=i+"__bubble";l.has(c)||(Vy(o,i,2,!1),l.add(c))}function oh(i,o,l){var c=0;o&&(c|=4),Vy(l,i,c,o)}var su="_reactListening"+Math.random().toString(36).slice(2);function ah(i){if(!i[su]){i[su]=!0,Ng.forEach(function(l){l!=="selectionchange"&&(jL.has(l)||oh(l,!1,i),oh(l,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[su]||(o[su]=!0,oh("selectionchange",!1,o))}}function Vy(i,o,l,c){switch(gb(o)){case 2:var g=pT;break;case 8:g=mT;break;default:g=_h}l=g.bind(null,o,l,i),g=void 0,!wd||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(g=!0),c?g!==void 0?i.addEventListener(o,l,{capture:!0,passive:g}):i.addEventListener(o,l,!0):g!==void 0?i.addEventListener(o,l,{passive:g}):i.addEventListener(o,l,!1)}function sh(i,o,l,c,g){var v=c;if((o&1)===0&&(o&2)===0&&c!==null)e:for(;;){if(c===null)return;var C=c.tag;if(C===3||C===4){var T=c.stateNode.containerInfo;if(T===g)break;if(C===4)for(C=c.return;C!==null;){var z=C.tag;if((z===3||z===4)&&C.stateNode.containerInfo===g)return;C=C.return}for(;T!==null;){if(C=So(T),C===null)return;if(z=C.tag,z===5||z===6||z===26||z===27){c=v=C;continue e}T=T.parentNode}}c=c.return}qg(function(){var F=v,Q=xd(l),ne=[];e:{var $=Sv.get(i);if($!==void 0){var K=yl,me=i;switch(i){case"keypress":if(gl(l)===0)break e;case"keydown":case"keyup":K=Mk;break;case"focusin":me="focus",K=Ad;break;case"focusout":me="blur",K=Ad;break;case"beforeblur":case"afterblur":K=Ad;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":K=Kg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=_k;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=zk;break;case gv:case vv:case yv:K=Ek;break;case bv:K=Pk;break;case"scroll":case"scrollend":K=bk;break;case"wheel":K=jk;break;case"copy":case"cut":case"paste":K=kk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=Qg;break;case"toggle":case"beforetoggle":K=Bk}var ye=(o&4)!==0,Ve=!ye&&(i==="scroll"||i==="scrollend"),j=ye?$!==null?$+"Capture":null:$;ye=[];for(var P=F,B;P!==null;){var J=P;if(B=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||B===null||j===null||(J=Na(P,j),J!=null&&ye.push(hs(P,J,B))),Ve)break;P=P.return}0<ye.length&&($=new K($,me,null,l,Q),ne.push({event:$,listeners:ye}))}}if((o&7)===0){e:{if($=i==="mouseover"||i==="pointerover",K=i==="mouseout"||i==="pointerout",$&&l!==Cd&&(me=l.relatedTarget||l.fromElement)&&(So(me)||me[bo]))break e;if((K||$)&&($=Q.window===Q?Q:($=Q.ownerDocument)?$.defaultView||$.parentWindow:window,K?(me=l.relatedTarget||l.toElement,K=F,me=me?So(me):null,me!==null&&(Ve=s(me),ye=me.tag,me!==Ve||ye!==5&&ye!==27&&ye!==6)&&(me=null)):(K=null,me=F),K!==me)){if(ye=Kg,J="onMouseLeave",j="onMouseEnter",P="mouse",(i==="pointerout"||i==="pointerover")&&(ye=Qg,J="onPointerLeave",j="onPointerEnter",P="pointer"),Ve=K==null?$:Ma(K),B=me==null?$:Ma(me),$=new ye(J,P+"leave",K,l,Q),$.target=Ve,$.relatedTarget=B,J=null,So(Q)===F&&(ye=new ye(j,P+"enter",me,l,Q),ye.target=B,ye.relatedTarget=Ve,J=ye),Ve=J,K&&me)t:{for(ye=VL,j=K,P=me,B=0,J=j;J;J=ye(J))B++;J=0;for(var ve=P;ve;ve=ye(ve))J++;for(;0<B-J;)j=ye(j),B--;for(;0<J-B;)P=ye(P),J--;for(;B--;){if(j===P||P!==null&&j===P.alternate){ye=j;break t}j=ye(j),P=ye(P)}ye=null}else ye=null;K!==null&&By(ne,$,K,ye,!1),me!==null&&Ve!==null&&By(ne,Ve,me,ye,!0)}}e:{if($=F?Ma(F):window,K=$.nodeName&&$.nodeName.toLowerCase(),K==="select"||K==="input"&&$.type==="file")var De=ov;else if(iv($))if(av)De=Zk;else{De=Xk;var ge=Kk}else K=$.nodeName,!K||K.toLowerCase()!=="input"||$.type!=="checkbox"&&$.type!=="radio"?F&&_d(F.elementType)&&(De=ov):De=Qk;if(De&&(De=De(i,F))){rv(ne,De,l,Q);break e}ge&&ge(i,$,F),i==="focusout"&&F&&$.type==="number"&&F.memoizedProps.value!=null&&Sd($,"number",$.value)}switch(ge=F?Ma(F):window,i){case"focusin":(iv(ge)||ge.contentEditable==="true")&&(Ao=ge,Id=F,Ba=null);break;case"focusout":Ba=Id=Ao=null;break;case"mousedown":zd=!0;break;case"contextmenu":case"mouseup":case"dragend":zd=!1,pv(ne,l,Q);break;case"selectionchange":if(eL)break;case"keydown":case"keyup":pv(ne,l,Q)}var Ee;if(Od)e:{switch(i){case"compositionstart":var Re="onCompositionStart";break e;case"compositionend":Re="onCompositionEnd";break e;case"compositionupdate":Re="onCompositionUpdate";break e}Re=void 0}else To?tv(i,l)&&(Re="onCompositionEnd"):i==="keydown"&&l.keyCode===229&&(Re="onCompositionStart");Re&&(Zg&&l.locale!=="ko"&&(To||Re!=="onCompositionStart"?Re==="onCompositionEnd"&&To&&(Ee=Wg()):(Fi=Q,kd="value"in Fi?Fi.value:Fi.textContent,To=!0)),ge=lu(F,Re),0<ge.length&&(Re=new Xg(Re,i,null,l,Q),ne.push({event:Re,listeners:ge}),Ee?Re.data=Ee:(Ee=nv(l),Ee!==null&&(Re.data=Ee)))),(Ee=Gk?$k(i,l):qk(i,l))&&(Re=lu(F,"onBeforeInput"),0<Re.length&&(ge=new Xg("onBeforeInput","beforeinput",null,l,Q),ne.push({event:ge,listeners:Re}),ge.data=Ee)),HL(ne,i,F,l,Q)}jy(ne,o)})}function hs(i,o,l){return{instance:i,listener:o,currentTarget:l}}function lu(i,o){for(var l=o+"Capture",c=[];i!==null;){var g=i,v=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||v===null||(g=Na(i,l),g!=null&&c.unshift(hs(i,g,v)),g=Na(i,o),g!=null&&c.push(hs(i,g,v))),i.tag===3)return c;i=i.return}return[]}function VL(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function By(i,o,l,c,g){for(var v=o._reactName,C=[];l!==null&&l!==c;){var T=l,z=T.alternate,F=T.stateNode;if(T=T.tag,z!==null&&z===c)break;T!==5&&T!==26&&T!==27||F===null||(z=F,g?(F=Na(l,v),F!=null&&C.unshift(hs(l,F,z))):g||(F=Na(l,v),F!=null&&C.push(hs(l,F,z)))),l=l.return}C.length!==0&&i.push({event:o,listeners:C})}var BL=/\r\n?/g,FL=/\u0000|\uFFFD/g;function Fy(i){return(typeof i=="string"?i:""+i).replace(BL,`
|
|
10
|
+
`).replace(FL,"")}function Gy(i,o){return o=Fy(o),Fy(i)===o}function je(i,o,l,c,g,v){switch(l){case"children":typeof c=="string"?o==="body"||o==="textarea"&&c===""||wo(i,c):(typeof c=="number"||typeof c=="bigint")&&o!=="body"&&wo(i,""+c);break;case"className":fl(i,"class",c);break;case"tabIndex":fl(i,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":fl(i,l,c);break;case"style":Gg(i,c,v);break;case"data":if(o!=="object"){fl(i,"data",c);break}case"src":case"href":if(c===""&&(o!=="a"||l!=="href")){i.removeAttribute(l);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){i.removeAttribute(l);break}c=pl(""+c),i.setAttribute(l,c);break;case"action":case"formAction":if(typeof c=="function"){i.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(l==="formAction"?(o!=="input"&&je(i,o,"name",g.name,g,null),je(i,o,"formEncType",g.formEncType,g,null),je(i,o,"formMethod",g.formMethod,g,null),je(i,o,"formTarget",g.formTarget,g,null)):(je(i,o,"encType",g.encType,g,null),je(i,o,"method",g.method,g,null),je(i,o,"target",g.target,g,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){i.removeAttribute(l);break}c=pl(""+c),i.setAttribute(l,c);break;case"onClick":c!=null&&(i.onclick=oi);break;case"onScroll":c!=null&&Te("scroll",i);break;case"onScrollEnd":c!=null&&Te("scrollend",i);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(l=c.__html,l!=null){if(g.children!=null)throw Error(r(60));i.innerHTML=l}}break;case"multiple":i.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":i.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){i.removeAttribute("xlink:href");break}l=pl(""+c),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?i.setAttribute(l,""+c):i.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?i.setAttribute(l,""):i.removeAttribute(l);break;case"capture":case"download":c===!0?i.setAttribute(l,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?i.setAttribute(l,c):i.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?i.setAttribute(l,c):i.removeAttribute(l);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?i.removeAttribute(l):i.setAttribute(l,c);break;case"popover":Te("beforetoggle",i),Te("toggle",i),dl(i,"popover",c);break;case"xlinkActuate":ri(i,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":ri(i,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":ri(i,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":ri(i,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":ri(i,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":ri(i,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":ri(i,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":ri(i,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":ri(i,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":dl(i,"is",c);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=vk.get(l)||l,dl(i,l,c))}}function lh(i,o,l,c,g,v){switch(l){case"style":Gg(i,c,v);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(l=c.__html,l!=null){if(g.children!=null)throw Error(r(60));i.innerHTML=l}}break;case"children":typeof c=="string"?wo(i,c):(typeof c=="number"||typeof c=="bigint")&&wo(i,""+c);break;case"onScroll":c!=null&&Te("scroll",i);break;case"onScrollEnd":c!=null&&Te("scrollend",i);break;case"onClick":c!=null&&(i.onclick=oi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ig.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(g=l.endsWith("Capture"),o=l.slice(2,g?l.length-7:void 0),v=i[Ut]||null,v=v!=null?v[l]:null,typeof v=="function"&&i.removeEventListener(o,v,g),typeof c=="function")){typeof v!="function"&&v!==null&&(l in i?i[l]=null:i.hasAttribute(l)&&i.removeAttribute(l)),i.addEventListener(o,c,g);break e}l in i?i[l]=c:c===!0?i.setAttribute(l,""):dl(i,l,c)}}}function Tt(i,o,l){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Te("error",i),Te("load",i);var c=!1,g=!1,v;for(v in l)if(l.hasOwnProperty(v)){var C=l[v];if(C!=null)switch(v){case"src":c=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:je(i,o,v,C,l,null)}}g&&je(i,o,"srcSet",l.srcSet,l,null),c&&je(i,o,"src",l.src,l,null);return;case"input":Te("invalid",i);var T=v=C=g=null,z=null,F=null;for(c in l)if(l.hasOwnProperty(c)){var Q=l[c];if(Q!=null)switch(c){case"name":g=Q;break;case"type":C=Q;break;case"checked":z=Q;break;case"defaultChecked":F=Q;break;case"value":v=Q;break;case"defaultValue":T=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(r(137,o));break;default:je(i,o,c,Q,l,null)}}jg(i,v,T,z,F,C,g,!1);return;case"select":Te("invalid",i),c=C=v=null;for(g in l)if(l.hasOwnProperty(g)&&(T=l[g],T!=null))switch(g){case"value":v=T;break;case"defaultValue":C=T;break;case"multiple":c=T;default:je(i,o,g,T,l,null)}o=v,l=C,i.multiple=!!c,o!=null?Eo(i,!!c,o,!1):l!=null&&Eo(i,!!c,l,!0);return;case"textarea":Te("invalid",i),v=g=c=null;for(C in l)if(l.hasOwnProperty(C)&&(T=l[C],T!=null))switch(C){case"value":c=T;break;case"defaultValue":g=T;break;case"children":v=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(r(91));break;default:je(i,o,C,T,l,null)}Bg(i,c,g,v);return;case"option":for(z in l)l.hasOwnProperty(z)&&(c=l[z],c!=null)&&(z==="selected"?i.selected=c&&typeof c!="function"&&typeof c!="symbol":je(i,o,z,c,l,null));return;case"dialog":Te("beforetoggle",i),Te("toggle",i),Te("cancel",i),Te("close",i);break;case"iframe":case"object":Te("load",i);break;case"video":case"audio":for(c=0;c<fs.length;c++)Te(fs[c],i);break;case"image":Te("error",i),Te("load",i);break;case"details":Te("toggle",i);break;case"embed":case"source":case"link":Te("error",i),Te("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(F in l)if(l.hasOwnProperty(F)&&(c=l[F],c!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:je(i,o,F,c,l,null)}return;default:if(_d(o)){for(Q in l)l.hasOwnProperty(Q)&&(c=l[Q],c!==void 0&&lh(i,o,Q,c,l,void 0));return}}for(T in l)l.hasOwnProperty(T)&&(c=l[T],c!=null&&je(i,o,T,c,l,null))}function GL(i,o,l,c){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,v=null,C=null,T=null,z=null,F=null,Q=null;for(K in l){var ne=l[K];if(l.hasOwnProperty(K)&&ne!=null)switch(K){case"checked":break;case"value":break;case"defaultValue":z=ne;default:c.hasOwnProperty(K)||je(i,o,K,null,c,ne)}}for(var $ in c){var K=c[$];if(ne=l[$],c.hasOwnProperty($)&&(K!=null||ne!=null))switch($){case"type":v=K;break;case"name":g=K;break;case"checked":F=K;break;case"defaultChecked":Q=K;break;case"value":C=K;break;case"defaultValue":T=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(r(137,o));break;default:K!==ne&&je(i,o,$,K,c,ne)}}bd(i,C,T,z,F,Q,v,g);return;case"select":K=C=T=$=null;for(v in l)if(z=l[v],l.hasOwnProperty(v)&&z!=null)switch(v){case"value":break;case"multiple":K=z;default:c.hasOwnProperty(v)||je(i,o,v,null,c,z)}for(g in c)if(v=c[g],z=l[g],c.hasOwnProperty(g)&&(v!=null||z!=null))switch(g){case"value":$=v;break;case"defaultValue":T=v;break;case"multiple":C=v;default:v!==z&&je(i,o,g,v,c,z)}o=T,l=C,c=K,$!=null?Eo(i,!!l,$,!1):!!c!=!!l&&(o!=null?Eo(i,!!l,o,!0):Eo(i,!!l,l?[]:"",!1));return;case"textarea":K=$=null;for(T in l)if(g=l[T],l.hasOwnProperty(T)&&g!=null&&!c.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:je(i,o,T,null,c,g)}for(C in c)if(g=c[C],v=l[C],c.hasOwnProperty(C)&&(g!=null||v!=null))switch(C){case"value":$=g;break;case"defaultValue":K=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(r(91));break;default:g!==v&&je(i,o,C,g,c,v)}Vg(i,$,K);return;case"option":for(var me in l)$=l[me],l.hasOwnProperty(me)&&$!=null&&!c.hasOwnProperty(me)&&(me==="selected"?i.selected=!1:je(i,o,me,null,c,$));for(z in c)$=c[z],K=l[z],c.hasOwnProperty(z)&&$!==K&&($!=null||K!=null)&&(z==="selected"?i.selected=$&&typeof $!="function"&&typeof $!="symbol":je(i,o,z,$,c,K));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 ye in l)$=l[ye],l.hasOwnProperty(ye)&&$!=null&&!c.hasOwnProperty(ye)&&je(i,o,ye,null,c,$);for(F in c)if($=c[F],K=l[F],c.hasOwnProperty(F)&&$!==K&&($!=null||K!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(r(137,o));break;default:je(i,o,F,$,c,K)}return;default:if(_d(o)){for(var Ve in l)$=l[Ve],l.hasOwnProperty(Ve)&&$!==void 0&&!c.hasOwnProperty(Ve)&&lh(i,o,Ve,void 0,c,$);for(Q in c)$=c[Q],K=l[Q],!c.hasOwnProperty(Q)||$===K||$===void 0&&K===void 0||lh(i,o,Q,$,c,K);return}}for(var j in l)$=l[j],l.hasOwnProperty(j)&&$!=null&&!c.hasOwnProperty(j)&&je(i,o,j,null,c,$);for(ne in c)$=c[ne],K=l[ne],!c.hasOwnProperty(ne)||$===K||$==null&&K==null||je(i,o,ne,$,c,K)}function $y(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function $L(){if(typeof performance.getEntriesByType=="function"){for(var i=0,o=0,l=performance.getEntriesByType("resource"),c=0;c<l.length;c++){var g=l[c],v=g.transferSize,C=g.initiatorType,T=g.duration;if(v&&T&&$y(C)){for(C=0,T=g.responseEnd,c+=1;c<l.length;c++){var z=l[c],F=z.startTime;if(F>T)break;var Q=z.transferSize,ne=z.initiatorType;Q&&$y(ne)&&(z=z.responseEnd,C+=Q*(z<T?1:(T-F)/(z-F)))}if(--c,o+=8*(v+C)/(g.duration/1e3),i++,10<i)break}}if(0<i)return o/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var uh=null,ch=null;function uu(i){return i.nodeType===9?i:i.ownerDocument}function qy(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Wy(i,o){if(i===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&o==="foreignObject"?0:i}function dh(i,o){return i==="textarea"||i==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var fh=null;function qL(){var i=window.event;return i&&i.type==="popstate"?i===fh?!1:(fh=i,!0):(fh=null,!1)}var Yy=typeof setTimeout=="function"?setTimeout:void 0,WL=typeof clearTimeout=="function"?clearTimeout:void 0,Ky=typeof Promise=="function"?Promise:void 0,YL=typeof queueMicrotask=="function"?queueMicrotask:typeof Ky<"u"?function(i){return Ky.resolve(null).then(i).catch(KL)}:Yy;function KL(i){setTimeout(function(){throw i})}function ar(i){return i==="head"}function Xy(i,o){var l=o,c=0;do{var g=l.nextSibling;if(i.removeChild(l),g&&g.nodeType===8)if(l=g.data,l==="/$"||l==="/&"){if(c===0){i.removeChild(g),na(o);return}c--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")c++;else if(l==="html")ps(i.ownerDocument.documentElement);else if(l==="head"){l=i.ownerDocument.head,ps(l);for(var v=l.firstChild;v;){var C=v.nextSibling,T=v.nodeName;v[Da]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&v.rel.toLowerCase()==="stylesheet"||l.removeChild(v),v=C}}else l==="body"&&ps(i.ownerDocument.body);l=g}while(l);na(o)}function Qy(i,o){var l=i;i=0;do{var c=l.nextSibling;if(l.nodeType===1?o?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(o?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),c&&c.nodeType===8)if(l=c.data,l==="/$"){if(i===0)break;i--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||i++;l=c}while(l)}function hh(i){var o=i.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var l=o;switch(o=o.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":hh(l),vd(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}i.removeChild(l)}}function XL(i,o,l,c){for(;i.nodeType===1;){var g=l;if(i.nodeName.toLowerCase()!==o.toLowerCase()){if(!c&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(c){if(!i[Da])switch(o){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(v=i.getAttribute("rel"),v==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(v!==g.rel||i.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||i.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||i.getAttribute("title")!==(g.title==null?null:g.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(v=i.getAttribute("src"),(v!==(g.src==null?null:g.src)||i.getAttribute("type")!==(g.type==null?null:g.type)||i.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&v&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(o==="input"&&i.type==="hidden"){var v=g.name==null?null:""+g.name;if(g.type==="hidden"&&i.getAttribute("name")===v)return i}else return i;if(i=bn(i.nextSibling),i===null)break}return null}function QL(i,o,l){if(o==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!l||(i=bn(i.nextSibling),i===null))return null;return i}function Zy(i,o){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=bn(i.nextSibling),i===null))return null;return i}function ph(i){return i.data==="$?"||i.data==="$~"}function mh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function ZL(i,o){var l=i.ownerDocument;if(i.data==="$~")i._reactRetry=o;else if(i.data!=="$?"||l.readyState!=="loading")o();else{var c=function(){o(),l.removeEventListener("DOMContentLoaded",c)};l.addEventListener("DOMContentLoaded",c),i._reactRetry=c}}function bn(i){for(;i!=null;i=i.nextSibling){var o=i.nodeType;if(o===1||o===3)break;if(o===8){if(o=i.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return i}var gh=null;function Jy(i){i=i.nextSibling;for(var o=0;i;){if(i.nodeType===8){var l=i.data;if(l==="/$"||l==="/&"){if(o===0)return bn(i.nextSibling);o--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||o++}i=i.nextSibling}return null}function eb(i){i=i.previousSibling;for(var o=0;i;){if(i.nodeType===8){var l=i.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(o===0)return i;o--}else l!=="/$"&&l!=="/&"||o++}i=i.previousSibling}return null}function tb(i,o,l){switch(o=uu(l),i){case"html":if(i=o.documentElement,!i)throw Error(r(452));return i;case"head":if(i=o.head,!i)throw Error(r(453));return i;case"body":if(i=o.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function ps(i){for(var o=i.attributes;o.length;)i.removeAttributeNode(o[0]);vd(i)}var Sn=new Map,nb=new Set;function cu(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var _i=G.d;G.d={f:JL,r:eT,D:tT,C:nT,L:iT,m:rT,X:aT,S:oT,M:sT};function JL(){var i=_i.f(),o=tu();return i||o}function eT(i){var o=_o(i);o!==null&&o.tag===5&&o.type==="form"?b0(o):_i.r(i)}var Jo=typeof document>"u"?null:document;function ib(i,o,l){var c=Jo;if(c&&typeof o=="string"&&o){var g=fn(o);g='link[rel="'+i+'"][href="'+g+'"]',typeof l=="string"&&(g+='[crossorigin="'+l+'"]'),nb.has(g)||(nb.add(g),i={rel:i,crossOrigin:l,href:o},c.querySelector(g)===null&&(o=c.createElement("link"),Tt(o,"link",i),yt(o),c.head.appendChild(o)))}}function tT(i){_i.D(i),ib("dns-prefetch",i,null)}function nT(i,o){_i.C(i,o),ib("preconnect",i,o)}function iT(i,o,l){_i.L(i,o,l);var c=Jo;if(c&&i&&o){var g='link[rel="preload"][as="'+fn(o)+'"]';o==="image"&&l&&l.imageSrcSet?(g+='[imagesrcset="'+fn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(g+='[imagesizes="'+fn(l.imageSizes)+'"]')):g+='[href="'+fn(i)+'"]';var v=g;switch(o){case"style":v=ea(i);break;case"script":v=ta(i)}Sn.has(v)||(i=m({rel:"preload",href:o==="image"&&l&&l.imageSrcSet?void 0:i,as:o},l),Sn.set(v,i),c.querySelector(g)!==null||o==="style"&&c.querySelector(ms(v))||o==="script"&&c.querySelector(gs(v))||(o=c.createElement("link"),Tt(o,"link",i),yt(o),c.head.appendChild(o)))}}function rT(i,o){_i.m(i,o);var l=Jo;if(l&&i){var c=o&&typeof o.as=="string"?o.as:"script",g='link[rel="modulepreload"][as="'+fn(c)+'"][href="'+fn(i)+'"]',v=g;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=ta(i)}if(!Sn.has(v)&&(i=m({rel:"modulepreload",href:i},o),Sn.set(v,i),l.querySelector(g)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(gs(v)))return}c=l.createElement("link"),Tt(c,"link",i),yt(c),l.head.appendChild(c)}}}function oT(i,o,l){_i.S(i,o,l);var c=Jo;if(c&&i){var g=Co(c).hoistableStyles,v=ea(i);o=o||"default";var C=g.get(v);if(!C){var T={loading:0,preload:null};if(C=c.querySelector(ms(v)))T.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":o},l),(l=Sn.get(v))&&vh(i,l);var z=C=c.createElement("link");yt(z),Tt(z,"link",i),z._p=new Promise(function(F,Q){z.onload=F,z.onerror=Q}),z.addEventListener("load",function(){T.loading|=1}),z.addEventListener("error",function(){T.loading|=2}),T.loading|=4,du(C,o,c)}C={type:"stylesheet",instance:C,count:1,state:T},g.set(v,C)}}}function aT(i,o){_i.X(i,o);var l=Jo;if(l&&i){var c=Co(l).hoistableScripts,g=ta(i),v=c.get(g);v||(v=l.querySelector(gs(g)),v||(i=m({src:i,async:!0},o),(o=Sn.get(g))&&yh(i,o),v=l.createElement("script"),yt(v),Tt(v,"link",i),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(g,v))}}function sT(i,o){_i.M(i,o);var l=Jo;if(l&&i){var c=Co(l).hoistableScripts,g=ta(i),v=c.get(g);v||(v=l.querySelector(gs(g)),v||(i=m({src:i,async:!0,type:"module"},o),(o=Sn.get(g))&&yh(i,o),v=l.createElement("script"),yt(v),Tt(v,"link",i),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(g,v))}}function rb(i,o,l,c){var g=(g=re.current)?cu(g):null;if(!g)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(o=ea(l.href),l=Co(g).hoistableStyles,c=l.get(o),c||(c={type:"style",instance:null,count:0,state:null},l.set(o,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){i=ea(l.href);var v=Co(g).hoistableStyles,C=v.get(i);if(C||(g=g.ownerDocument||g,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(i,C),(v=g.querySelector(ms(i)))&&!v._p&&(C.instance=v,C.state.loading=5),Sn.has(i)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Sn.set(i,l),v||lT(g,i,l,C.state))),o&&c===null)throw Error(r(528,""));return C}if(o&&c!==null)throw Error(r(529,""));return null;case"script":return o=l.async,l=l.src,typeof l=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=ta(l),l=Co(g).hoistableScripts,c=l.get(o),c||(c={type:"script",instance:null,count:0,state:null},l.set(o,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function ea(i){return'href="'+fn(i)+'"'}function ms(i){return'link[rel="stylesheet"]['+i+"]"}function ob(i){return m({},i,{"data-precedence":i.precedence,precedence:null})}function lT(i,o,l,c){i.querySelector('link[rel="preload"][as="style"]['+o+"]")?c.loading=1:(o=i.createElement("link"),c.preload=o,o.addEventListener("load",function(){return c.loading|=1}),o.addEventListener("error",function(){return c.loading|=2}),Tt(o,"link",l),yt(o),i.head.appendChild(o))}function ta(i){return'[src="'+fn(i)+'"]'}function gs(i){return"script[async]"+i}function ab(i,o,l){if(o.count++,o.instance===null)switch(o.type){case"style":var c=i.querySelector('style[data-href~="'+fn(l.href)+'"]');if(c)return o.instance=c,yt(c),c;var g=m({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return c=(i.ownerDocument||i).createElement("style"),yt(c),Tt(c,"style",g),du(c,l.precedence,i),o.instance=c;case"stylesheet":g=ea(l.href);var v=i.querySelector(ms(g));if(v)return o.state.loading|=4,o.instance=v,yt(v),v;c=ob(l),(g=Sn.get(g))&&vh(c,g),v=(i.ownerDocument||i).createElement("link"),yt(v);var C=v;return C._p=new Promise(function(T,z){C.onload=T,C.onerror=z}),Tt(v,"link",c),o.state.loading|=4,du(v,l.precedence,i),o.instance=v;case"script":return v=ta(l.src),(g=i.querySelector(gs(v)))?(o.instance=g,yt(g),g):(c=l,(g=Sn.get(v))&&(c=m({},l),yh(c,g)),i=i.ownerDocument||i,g=i.createElement("script"),yt(g),Tt(g,"link",c),i.head.appendChild(g),o.instance=g);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(c=o.instance,o.state.loading|=4,du(c,l.precedence,i));return o.instance}function du(i,o,l){for(var c=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=c.length?c[c.length-1]:null,v=g,C=0;C<c.length;C++){var T=c[C];if(T.dataset.precedence===o)v=T;else if(v!==g)break}v?v.parentNode.insertBefore(i,v.nextSibling):(o=l.nodeType===9?l.head:l,o.insertBefore(i,o.firstChild))}function vh(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.title==null&&(i.title=o.title)}function yh(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.integrity==null&&(i.integrity=o.integrity)}var fu=null;function sb(i,o,l){if(fu===null){var c=new Map,g=fu=new Map;g.set(l,c)}else g=fu,c=g.get(l),c||(c=new Map,g.set(l,c));if(c.has(i))return c;for(c.set(i,null),l=l.getElementsByTagName(i),g=0;g<l.length;g++){var v=l[g];if(!(v[Da]||v[Et]||i==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var C=v.getAttribute(o)||"";C=i+C;var T=c.get(C);T?T.push(v):c.set(C,[v])}}return c}function lb(i,o,l){i=i.ownerDocument||i,i.head.insertBefore(l,o==="title"?i.querySelector("head > title"):null)}function uT(i,o,l){if(l===1||o.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;return o.rel==="stylesheet"?(i=o.disabled,typeof o.precedence=="string"&&i==null):!0;case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function ub(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function cT(i,o,l,c){if(l.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var g=ea(c.href),v=o.querySelector(ms(g));if(v){o=v._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(i.count++,i=hu.bind(i),o.then(i,i)),l.state.loading|=4,l.instance=v,yt(v);return}v=o.ownerDocument||o,c=ob(c),(g=Sn.get(g))&&vh(c,g),v=v.createElement("link"),yt(v);var C=v;C._p=new Promise(function(T,z){C.onload=T,C.onerror=z}),Tt(v,"link",c),l.instance=v}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(l,o),(o=l.state.preload)&&(l.state.loading&3)===0&&(i.count++,l=hu.bind(i),o.addEventListener("load",l),o.addEventListener("error",l))}}var bh=0;function dT(i,o){return i.stylesheets&&i.count===0&&mu(i,i.stylesheets),0<i.count||0<i.imgCount?function(l){var c=setTimeout(function(){if(i.stylesheets&&mu(i,i.stylesheets),i.unsuspend){var v=i.unsuspend;i.unsuspend=null,v()}},6e4+o);0<i.imgBytes&&bh===0&&(bh=62500*$L());var g=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&mu(i,i.stylesheets),i.unsuspend)){var v=i.unsuspend;i.unsuspend=null,v()}},(i.imgBytes>bh?50:800)+o);return i.unsuspend=l,function(){i.unsuspend=null,clearTimeout(c),clearTimeout(g)}}:null}function hu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)mu(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var pu=null;function mu(i,o){i.stylesheets=null,i.unsuspend!==null&&(i.count++,pu=new Map,o.forEach(fT,i),pu=null,hu.call(i))}function fT(i,o){if(!(o.state.loading&4)){var l=pu.get(i);if(l)var c=l.get(null);else{l=new Map,pu.set(i,l);for(var g=i.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<g.length;v++){var C=g[v];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(l.set(C.dataset.precedence,C),c=C)}c&&l.set(null,c)}g=o.instance,C=g.getAttribute("data-precedence"),v=l.get(C)||c,v===c&&l.set(null,g),l.set(C,g),this.count++,c=hu.bind(this),g.addEventListener("load",c),g.addEventListener("error",c),v?v.parentNode.insertBefore(g,v.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(g,i.firstChild)),o.state.loading|=4}}var vs={$$typeof:L,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function hT(i,o,l,c,g,v,C,T,z){this.tag=1,this.containerInfo=i,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=hd(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hd(0),this.hiddenUpdates=hd(null),this.identifierPrefix=c,this.onUncaughtError=g,this.onCaughtError=v,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function cb(i,o,l,c,g,v,C,T,z,F,Q,ne){return i=new hT(i,o,l,C,z,F,Q,ne,T),o=1,v===!0&&(o|=24),v=en(3,null,null,o),i.current=v,v.stateNode=i,o=Qd(),o.refCount++,i.pooledCache=o,o.refCount++,v.memoizedState={element:c,isDehydrated:l,cache:o},tf(v),i}function db(i){return i?(i=Do,i):Do}function fb(i,o,l,c,g,v){g=db(g),c.context===null?c.context=g:c.pendingContext=g,c=Ki(o),c.payload={element:l},v=v===void 0?null:v,v!==null&&(c.callback=v),l=Xi(i,c,o),l!==null&&($t(l,i,o),Ka(l,i,o))}function hb(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var l=i.retryLane;i.retryLane=l!==0&&l<o?l:o}}function Sh(i,o){hb(i,o),(i=i.alternate)&&hb(i,o)}function pb(i){if(i.tag===13||i.tag===31){var o=Rr(i,67108864);o!==null&&$t(o,i,67108864),Sh(i,67108864)}}function mb(i){if(i.tag===13||i.tag===31){var o=an();o=pd(o);var l=Rr(i,o);l!==null&&$t(l,i,o),Sh(i,o)}}var gu=!0;function pT(i,o,l,c){var g=I.T;I.T=null;var v=G.p;try{G.p=2,_h(i,o,l,c)}finally{G.p=v,I.T=g}}function mT(i,o,l,c){var g=I.T;I.T=null;var v=G.p;try{G.p=8,_h(i,o,l,c)}finally{G.p=v,I.T=g}}function _h(i,o,l,c){if(gu){var g=Ch(c);if(g===null)sh(i,o,c,vu,l),vb(i,c);else if(vT(g,i,o,l,c))c.stopPropagation();else if(vb(i,c),o&4&&-1<gT.indexOf(i)){for(;g!==null;){var v=_o(g);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var C=wr(v.pendingLanes);if(C!==0){var T=v;for(T.pendingLanes|=2,T.entangledLanes|=2;C;){var z=1<<31-Zt(C);T.entanglements[1]|=z,C&=~z}Un(v),(Ie&6)===0&&(Jl=Xt()+500,ds(0))}}break;case 31:case 13:T=Rr(v,2),T!==null&&$t(T,v,2),tu(),Sh(v,2)}if(v=Ch(c),v===null&&sh(i,o,c,vu,l),v===g)break;g=v}g!==null&&c.stopPropagation()}else sh(i,o,c,null,l)}}function Ch(i){return i=xd(i),xh(i)}var vu=null;function xh(i){if(vu=null,i=So(i),i!==null){var o=s(i);if(o===null)i=null;else{var l=o.tag;if(l===13){if(i=u(o),i!==null)return i;i=null}else if(l===31){if(i=d(o),i!==null)return i;i=null}else if(l===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return vu=i,null}function gb(i){switch(i){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(tk()){case Eg:return 2;case wg:return 8;case al:case nk:return 32;case kg:return 268435456;default:return 32}default:return 32}}var Eh=!1,sr=null,lr=null,ur=null,ys=new Map,bs=new Map,cr=[],gT="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 vb(i,o){switch(i){case"focusin":case"focusout":sr=null;break;case"dragenter":case"dragleave":lr=null;break;case"mouseover":case"mouseout":ur=null;break;case"pointerover":case"pointerout":ys.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":bs.delete(o.pointerId)}}function Ss(i,o,l,c,g,v){return i===null||i.nativeEvent!==v?(i={blockedOn:o,domEventName:l,eventSystemFlags:c,nativeEvent:v,targetContainers:[g]},o!==null&&(o=_o(o),o!==null&&pb(o)),i):(i.eventSystemFlags|=c,o=i.targetContainers,g!==null&&o.indexOf(g)===-1&&o.push(g),i)}function vT(i,o,l,c,g){switch(o){case"focusin":return sr=Ss(sr,i,o,l,c,g),!0;case"dragenter":return lr=Ss(lr,i,o,l,c,g),!0;case"mouseover":return ur=Ss(ur,i,o,l,c,g),!0;case"pointerover":var v=g.pointerId;return ys.set(v,Ss(ys.get(v)||null,i,o,l,c,g)),!0;case"gotpointercapture":return v=g.pointerId,bs.set(v,Ss(bs.get(v)||null,i,o,l,c,g)),!0}return!1}function yb(i){var o=So(i.target);if(o!==null){var l=s(o);if(l!==null){if(o=l.tag,o===13){if(o=u(l),o!==null){i.blockedOn=o,Dg(i.priority,function(){mb(l)});return}}else if(o===31){if(o=d(l),o!==null){i.blockedOn=o,Dg(i.priority,function(){mb(l)});return}}else if(o===3&&l.stateNode.current.memoizedState.isDehydrated){i.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}i.blockedOn=null}function yu(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var l=Ch(i.nativeEvent);if(l===null){l=i.nativeEvent;var c=new l.constructor(l.type,l);Cd=c,l.target.dispatchEvent(c),Cd=null}else return o=_o(l),o!==null&&pb(o),i.blockedOn=l,!1;o.shift()}return!0}function bb(i,o,l){yu(i)&&l.delete(o)}function yT(){Eh=!1,sr!==null&&yu(sr)&&(sr=null),lr!==null&&yu(lr)&&(lr=null),ur!==null&&yu(ur)&&(ur=null),ys.forEach(bb),bs.forEach(bb)}function bu(i,o){i.blockedOn===o&&(i.blockedOn=null,Eh||(Eh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,yT)))}var Su=null;function Sb(i){Su!==i&&(Su=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Su===i&&(Su=null);for(var o=0;o<i.length;o+=3){var l=i[o],c=i[o+1],g=i[o+2];if(typeof c!="function"){if(xh(c||l)===null)continue;break}var v=_o(l);v!==null&&(i.splice(o,3),o-=3,Cf(v,{pending:!0,data:g,method:l.method,action:c},c,g))}}))}function na(i){function o(z){return bu(z,i)}sr!==null&&bu(sr,i),lr!==null&&bu(lr,i),ur!==null&&bu(ur,i),ys.forEach(o),bs.forEach(o);for(var l=0;l<cr.length;l++){var c=cr[l];c.blockedOn===i&&(c.blockedOn=null)}for(;0<cr.length&&(l=cr[0],l.blockedOn===null);)yb(l),l.blockedOn===null&&cr.shift();if(l=(i.ownerDocument||i).$$reactFormReplay,l!=null)for(c=0;c<l.length;c+=3){var g=l[c],v=l[c+1],C=g[Ut]||null;if(typeof v=="function")C||Sb(l);else if(C){var T=null;if(v&&v.hasAttribute("formAction")){if(g=v,C=v[Ut]||null)T=C.formAction;else if(xh(g)!==null)continue}else T=C.action;typeof T=="function"?l[c+1]=T:(l.splice(c,3),c-=3),Sb(l)}}}function _b(){function i(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(C){return g=C})},focusReset:"manual",scroll:"manual"})}function o(){g!==null&&(g(),g=null),c||setTimeout(l,20)}function l(){if(!c&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,g=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(l,100),function(){c=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),g!==null&&(g(),g=null)}}}function wh(i){this._internalRoot=i}_u.prototype.render=wh.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(r(409));var l=o.current,c=an();fb(l,c,i,o,null,null)},_u.prototype.unmount=wh.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;fb(i.current,2,null,i,null,null),tu(),o[bo]=null}};function _u(i){this._internalRoot=i}_u.prototype.unstable_scheduleHydration=function(i){if(i){var o=Og();i={blockedOn:null,target:i,priority:o};for(var l=0;l<cr.length&&o!==0&&o<cr[l].priority;l++);cr.splice(l,0,i),l===0&&yb(i)}};var Cb=t.version;if(Cb!=="19.2.8")throw Error(r(527,Cb,"19.2.8"));G.findDOMNode=function(i){var o=i._reactInternals;if(o===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=h(o),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var bT={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Cu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Cu.isDisabled&&Cu.supportsFiber)try{Aa=Cu.inject(bT),Qt=Cu}catch{}}return Cs.createRoot=function(i,o){if(!a(i))throw Error(r(299));var l=!1,c="",g=A0,v=R0,C=O0;return o!=null&&(o.unstable_strictMode===!0&&(l=!0),o.identifierPrefix!==void 0&&(c=o.identifierPrefix),o.onUncaughtError!==void 0&&(g=o.onUncaughtError),o.onCaughtError!==void 0&&(v=o.onCaughtError),o.onRecoverableError!==void 0&&(C=o.onRecoverableError)),o=cb(i,1,!1,null,null,l,c,null,g,v,C,_b),i[bo]=o.current,ah(i),new wh(o)},Cs.hydrateRoot=function(i,o,l){if(!a(i))throw Error(r(299));var c=!1,g="",v=A0,C=R0,T=O0,z=null;return l!=null&&(l.unstable_strictMode===!0&&(c=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onUncaughtError!==void 0&&(v=l.onUncaughtError),l.onCaughtError!==void 0&&(C=l.onCaughtError),l.onRecoverableError!==void 0&&(T=l.onRecoverableError),l.formState!==void 0&&(z=l.formState)),o=cb(i,1,!0,o,l??null,c,g,z,v,C,T,_b),o.context=db(null),l=o.current,c=an(),c=pd(c),g=Ki(c),g.callback=null,Xi(l,g,c),l=c,o.current.lanes=l,Oa(o,l),Un(o),i[bo]=o.current,ah(i),new _u(o)},Cs.version="19.2.8",Cs}var Db;function RT(){if(Db)return Th.exports;Db=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(),Th.exports=AT(),Th.exports}var OT=RT();function DT(e,t){const n=getComputedStyle(e),r=parseFloat(n.fontSize);return t*r}function MT(e,t){const n=getComputedStyle(e.ownerDocument.documentElement),r=parseFloat(n.fontSize);return t*r}function NT(e){return e/100*window.innerHeight}function IT(e){return e/100*window.innerWidth}function zT(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 Ls({groupSize:e,panelElement:t,styleProp:n}){let r;const[a,s]=zT(n);switch(s){case"%":{r=a/100*e;break}case"px":{r=a;break}case"rem":{r=MT(t,a);break}case"em":{r=DT(t,a);break}case"vh":{r=NT(a);break}case"vw":{r=IT(a);break}}return r}function It(e){return parseFloat(e.toFixed(3))}function Sa({group:e}){const{orientation:t,panels:n}=e;return n.reduce((r,a)=>(r+=t==="horizontal"?a.element.offsetWidth:a.element.offsetHeight,r),0)}function wp(e){const{panels:t}=e,n=Sa({group:e});return n===0?t.map(r=>({groupResizeBehavior:r.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:r.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:r.panelConstraints.disabled,minSize:0,maxSize:100,panelId:r.id})):t.map(r=>{const{element:a,panelConstraints:s}=r;let u=0;if(s.collapsedSize!==void 0){const p=Ls({groupSize:n,panelElement:a,styleProp:s.collapsedSize});u=It(p/n*100)}let d;if(s.defaultSize!==void 0){const p=Ls({groupSize:n,panelElement:a,styleProp:s.defaultSize});d=It(p/n*100)}let f=0;if(s.minSize!==void 0){const p=Ls({groupSize:n,panelElement:a,styleProp:s.minSize});f=It(p/n*100)}let h=100;if(s.maxSize!==void 0){const p=Ls({groupSize:n,panelElement:a,styleProp:s.maxSize});h=It(p/n*100)}return{groupResizeBehavior:s.groupResizeBehavior,collapsedSize:u,collapsible:s.collapsible===!0,defaultSize:d,disabled:s.disabled,minSize:f,maxSize:h,panelId:r.id}})}function Be(e,t="Assertion error"){if(!e)throw Error(t)}function kp(e,t){return Array.from(t).sort(e==="horizontal"?HT:PT)}function HT(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function PT(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function bC(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function SC(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 UT({orientation:e,rects:t,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let a,s=Number.MAX_VALUE;for(const u of t){const{x:d,y:f}=SC(r,u),h=e==="horizontal"?d:f;h<s&&(s=h,a=u)}return Be(a,"No rect found"),a}let xu;function jT(){return xu===void 0&&(typeof matchMedia=="function"?xu=!!matchMedia("(pointer:coarse)").matches:xu=!1),xu}function _C(e){const{element:t,orientation:n,panels:r,separators:a}=e,s=kp(n,Array.from(t.children).filter(bC).map(S=>({element:S}))).map(({element:S})=>S),u=[];let d=!1,f=!1,h=-1,p=-1,m=0,y,b=[];{let S=-1;for(const _ of s)_.hasAttribute("data-panel")&&(S++,_.hasAttribute("data-disabled")||(m++,h===-1&&(h=S),p=S))}if(m>1){let S=-1;for(const _ of s)if(_.hasAttribute("data-panel")){S++;const w=r.find(x=>x.element===_);if(w){if(y){const x=y.element.getBoundingClientRect(),E=_.getBoundingClientRect();let L;if(f){const R=n==="horizontal"?new DOMRect(x.right,x.top,0,x.height):new DOMRect(x.left,x.bottom,x.width,0),D=n==="horizontal"?new DOMRect(E.left,E.top,0,E.height):new DOMRect(E.left,E.top,E.width,0);switch(b.length){case 0:{L=[R,D];break}case 1:{const N=b[0],H=UT({orientation:n,rects:[x,E],targetRect:N.element.getBoundingClientRect()});L=[N,H===x?D:R];break}default:{L=b;break}}}else b.length?L=b:L=[n==="horizontal"?new DOMRect(x.right,E.top,E.left-x.right,E.height):new DOMRect(E.left,x.bottom,E.width,E.top-x.bottom)];for(const R of L){let D="width"in R?R:R.element.getBoundingClientRect();const N=jT()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(D.width<N){const U=N-D.width;D=new DOMRect(D.x-U/2,D.y,D.width+U,D.height)}if(D.height<N){const U=N-D.height;D=new DOMRect(D.x,D.y-U/2,D.width,D.height+U)}const H=S<=h||S>p;!d&&!H&&u.push({group:e,groupSize:Sa({group:e}),panels:[y,w],separator:"width"in R?void 0:R,rect:D}),d=!1}}f=!1,y=w,b=[]}}else if(_.hasAttribute("data-separator")){_.ariaDisabled!==null&&(d=!0);const w=a.find(x=>x.element===_);w?b.push(w):(y=void 0,b=[])}else f=!0}return u}class CC{#e={};addListener(t,n){const r=this.#e[t];return r===void 0?this.#e[t]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const r=this.#e[t];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let a=!1,s=null;const u=Array.from(r);for(let d=0;d<u.length;d++){const f=u[d];try{f.call(null,n)}catch(h){s===null&&(a=!0,s=h)}}if(a)throw s}}removeAllListeners(){this.#e={}}removeListener(t,n){const r=this.#e[t];if(r!==void 0){const a=r.indexOf(n);a>=0&&r.splice(a,1)}}}let ha={cursorFlags:0,state:"inactive"};const Rm=new CC;function io(){return ha}function VT(e){return Rm.addListener("change",e)}function BT(e){const t=ha,n={...ha};n.cursorFlags=e,ha=n,Rm.emit("change",{prev:t,next:n})}function pa(e){const t=ha;ha=e,Rm.emit("change",{prev:t,next:e})}const FT=e=>e,Dh=()=>{},xC=1,EC=2,wC=4,kC=8,Mb=3,Nb=12;let Eu;function Ib(){return Eu===void 0&&(Eu=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(Eu=!0)),Eu}function GT({cursorFlags:e,groups:t,state:n}){let r=0,a=0;switch(n){case"active":case"hover":t.forEach(s=>{if(!s.mutableState.disableCursor)switch(s.orientation){case"horizontal":{r++;break}case"vertical":{a++;break}}})}if(!(r===0&&a===0)){switch(n){case"active":{if(e&&Ib()){const s=(e&xC)!==0,u=(e&EC)!==0,d=(e&wC)!==0,f=(e&kC)!==0;if(s)return d?"se-resize":f?"ne-resize":"e-resize";if(u)return d?"sw-resize":f?"nw-resize":"w-resize";if(d)return"s-resize";if(f)return"n-resize"}break}}return Ib()?r>0&&a>0?"move":r>0?"ew-resize":"ns-resize":r>0&&a>0?"grab":r>0?"col-resize":"row-resize"}}const zb=new WeakMap;function Om(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=zb.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 r=io();switch(r.state){case"active":case"hover":{const a=GT({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(u=>u.group),state:r.state}),s=`*, *:hover {cursor: ${a} !important; }`;if(t===s)return;t=s,a?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}}zb.set(e,{prevStyle:t,styleSheet:n})}let Kn=new Map;const LC=new CC;function $T(e){Kn=new Map(Kn),Kn.delete(e)}function Hb(e,t){for(const[n]of Kn)if(n.id===e)return n}function yr(e,t){for(const[n,r]of Kn)if(n.id===e)return r;if(t)throw Error(`Could not find data for Group with id ${e}`)}function ho(){return Kn}function Dm(e,t){return LC.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function Mi(e,t,n){const r=Kn.get(e);Kn=new Map(Kn),Kn.set(e,t),LC.emit("groupChange",{group:e,isUserInteraction:n?.isUserInteraction===!0,prev:r,next:t})}function TC(e){const t=io();let n=!1;return t.state==="active"&&(pa({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(Om(e),n=!0,t.hitRegions.forEach(r=>{const a=yr(r.group.id,!0);Mi(r.group,a,{isUserInteraction:!0})}))),n}function Pb(e){e.defaultPrevented||TC(e.currentTarget)}function qT(e,t,n){let r,a={x:1/0,y:1/0};for(const s of t){const u=SC(n,s.rect);switch(e){case"horizontal":{u.x<=a.x&&(r=s,a=u);break}case"vertical":{u.y<=a.y&&(r=s,a=u);break}}}return r?{distance:a,hitRegion:r}:void 0}function WT(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function YT(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Vb(e),b:Vb(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();Be(r,"Stacking order can only be calculated for elements with a common ancestor");const a={a:jb(Ub(n.a)),b:jb(Ub(n.b))};if(a.a===a.b){const s=r.childNodes,u={a:n.a.at(-1),b:n.b.at(-1)};let d=s.length;for(;d--;){const f=s[d];if(f===u.a)return 1;if(f===u.b)return-1}}return Math.sign(a.a-a.b)}const KT=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function XT(e){const t=getComputedStyle(AC(e)??e).display;return t==="flex"||t==="inline-flex"}function QT(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||XT(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"||KT.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function Ub(e){let t=e.length;for(;t--;){const n=e[t];if(Be(n,"Missing node"),QT(n))return n}return null}function jb(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Vb(e){const t=[];for(;e;)t.push(e),e=AC(e);return t}function AC(e){const{parentNode:t}=e;return WT(t)?t.host:t}function ZT(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 JT({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!bC(n)||n.contains(e)||e.contains(n))return!0;if(YT(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(ZT(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function Mm(e,t){const n=[];return t.forEach((r,a)=>{if(a.disabled)return;const s=_C(a),u=qT(a.orientation,s,{x:e.clientX,y:e.clientY});u&&u.distance.x<=0&&u.distance.y<=0&&JT({groupElement:a.element,hitRegion:u.hitRegion.rect,pointerEventTarget:e.target})&&n.push(u.hitRegion)}),n}function eA(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 Ot(e,t,n=0){return Math.abs(It(e)-It(t))<=n}function Gn(e,t){return Ot(e,t)?0:e>t?1:-1}function ca({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){const{collapsedSize:a=0,collapsible:s,disabled:u,maxSize:d=100,minSize:f=0}=t;if(u&&!e)return n;if(Gn(r,f)<0)if(s){const h=(a+f)/2;Gn(r,h)<0?r=a:r=f}else r=f;return r=Math.min(d,r),r=It(r),r}function Ps({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:a,trigger:s}){if(Ot(e,0))return t;const u=s==="imperative-api",d=Object.values(t),f=Object.values(a),h=[...d],[p,m]=r;Be(p!=null,"Invalid first pivot index"),Be(m!=null,"Invalid second pivot index");let y=0;switch(s){case"keyboard":{{const _=e<0?m:p,w=n[_];Be(w,`Panel constraints not found for index ${_}`);const{collapsedSize:x=0,collapsible:E,minSize:L=0}=w;if(E){const R=d[_];if(Be(R!=null,`Previous layout not found for panel index ${_}`),Ot(R,x)){const D=L-R;Gn(D,Math.abs(e))>0&&(e=e<0?0-D:D)}}}{const _=e<0?p:m,w=n[_];Be(w,`No panel constraints found for index ${_}`);const{collapsedSize:x=0,collapsible:E,minSize:L=0}=w;if(E){const R=d[_];if(Be(R!=null,`Previous layout not found for panel index ${_}`),Ot(R,L)){const D=R-x;Gn(D,Math.abs(e))>0&&(e=e<0?0-D:D)}}}break}default:{const _=e<0?m:p,w=n[_];Be(w,`Panel constraints not found for index ${_}`);const x=d[_],{collapsible:E,collapsedSize:L,minSize:R}=w;if(E&&Gn(x,R)<0)if(e>0){const D=R-L,N=D/2,H=x+e;Gn(H,R)<0&&(e=Gn(e,N)<=0?0:D)}else{const D=R-L,N=100-D/2,H=x-e;Gn(H,R)<0&&(e=Gn(100+e,N)>0?0:-D)}break}}{const _=e<0?1:-1;let w=e<0?m:p,x=0;for(;;){const L=d[w];Be(L!=null,`Previous layout not found for panel index ${w}`);const R=ca({overrideDisabledPanels:u,panelConstraints:n[w],prevSize:L,size:100})-L;if(x+=R,w+=_,w<0||w>=n.length)break}const E=Math.min(Math.abs(e),Math.abs(x));e=e<0?0-E:E}{let _=e<0?p:m;for(;_>=0&&_<n.length;){const w=Math.abs(e)-Math.abs(y),x=d[_];Be(x!=null,`Previous layout not found for panel index ${_}`);const E=x-w,L=ca({overrideDisabledPanels:u,panelConstraints:n[_],prevSize:x,size:E});if(!Ot(x,L)&&(y+=x-L,h[_]=L,y.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?_--:_++}}if(eA(f,h))return a;{const _=e<0?m:p,w=d[_];Be(w!=null,`Previous layout not found for panel index ${_}`);const x=w+y,E=ca({overrideDisabledPanels:u,panelConstraints:n[_],prevSize:w,size:x});if(h[_]=E,!Ot(E,x)){let L=x-E,R=e<0?m:p;for(;R>=0&&R<n.length;){const D=h[R];Be(D!=null,`Previous layout not found for panel index ${R}`);const N=D+L,H=ca({overrideDisabledPanels:u,panelConstraints:n[R],prevSize:D,size:N});if(Ot(D,H)||(L-=H-D,h[R]=H),Ot(L,0))break;e>0?R--:R++}}}const b=Object.values(h).reduce((_,w)=>w+_,0);if(!Ot(b,100,.1))return a;const S=Object.keys(a);return h.reduce((_,w,x)=>(_[S[x]]=w,_),{})}function ro(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||Gn(e[n],t[n])!==0)return!1;return!0}function oo({layout:e,panelConstraints:t}){const n=Object.values(e),r=[...n],a=r.reduce((d,f)=>d+f,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(d=>`${d}%`).join(", ")}`);if(!Ot(a,100)&&r.length>0)for(let d=0;d<t.length;d++){const f=r[d];Be(f!=null,`No layout data found for index ${d}`);const h=100/a*f;r[d]=h}let s=0;for(let d=0;d<t.length;d++){const f=n[d];Be(f!=null,`No layout data found for index ${d}`);const h=r[d];Be(h!=null,`No layout data found for index ${d}`);const p=ca({overrideDisabledPanels:!0,panelConstraints:t[d],prevSize:f,size:h});h!=p&&(s+=h-p,r[d]=p)}if(!Ot(s,0))for(let d=0;d<t.length;d++){const f=r[d];Be(f!=null,`No layout data found for index ${d}`);const h=f+s,p=ca({overrideDisabledPanels:!0,panelConstraints:t[d],prevSize:f,size:h});if(f!==p&&(s-=p-f,r[d]=p,Ot(s,0)))break}const u=Object.keys(e);return r.reduce((d,f,h)=>(d[u[h]]=f,d),{})}function RC({groupId:e,panelId:t}){const n=()=>{const f=ho();for(const[h,{defaultLayoutDeferred:p,derivedPanelConstraints:m,layout:y,groupSize:b,separatorToPanels:S}]of f)if(h.id===e)return{defaultLayoutDeferred:p,derivedPanelConstraints:m,group:h,groupSize:b,layout:y,separatorToPanels:S};throw Error(`Group ${e} not found`)},r=()=>{const f=n().derivedPanelConstraints.find(h=>h.panelId===t);if(f!==void 0)return f;throw Error(`Panel constraints not found for Panel ${t}`)},a=()=>{const f=n().group.panels.find(h=>h.id===t);if(f!==void 0)return f;throw Error(`Layout not found for Panel ${t}`)},s=()=>{const f=n().layout[t];if(f!==void 0)return f;throw Error(`Layout not found for Panel ${t}`)},u=({nextSize:f,panels:h,prevLayout:p,derivedPanelConstraints:m})=>{const y=s(),b=h.findIndex(w=>w.id===t),S=b===0,_=b===h.length-1;if(_&&f<y&&(S||h.slice(0,b).every((w,x)=>{const E=m[x];return E?.collapsible&&Ot(E.collapsedSize,p[E.panelId])}))){const w=h.slice(0,b).reduce((x,E)=>x+p[E.id],0);return{...p,[t]:It(100-w)}}return Ps({delta:_?y-f:f-y,initialLayout:p,panelConstraints:m,pivotIndices:_?[b-1,b]:[b,b+1],prevLayout:p,trigger:"imperative-api"})},d=f=>{const h=s();if(f===h)return;const{defaultLayoutDeferred:p,derivedPanelConstraints:m,group:y,groupSize:b,layout:S,separatorToPanels:_}=n(),w=u({nextSize:f,panels:y.panels,prevLayout:S,derivedPanelConstraints:m}),x=oo({layout:w,panelConstraints:m});ro(S,x)||Mi(y,{defaultLayoutDeferred:p,derivedPanelConstraints:m,groupSize:b,layout:x,separatorToPanels:_})};return{collapse:()=>{const{collapsible:f,collapsedSize:h}=r(),{mutableValues:p}=a(),m=s();f&&m!==h&&(p.expandToSize=m,d(h))},expand:()=>{const{collapsible:f,collapsedSize:h,minSize:p}=r(),{mutableValues:m}=a(),y=s();if(f&&y===h){let b=m.expandToSize??p;b===0&&(b=1),d(b)}},getSize:()=>{const{group:f}=n(),h=s(),{element:p}=a(),m=f.orientation==="horizontal"?p.offsetWidth:p.offsetHeight;return{asPercentage:h,inPixels:m}},isCollapsed:()=>{const{collapsible:f,collapsedSize:h}=r(),p=s();return f&&Ot(h,p)},resize:f=>{const{group:h}=n(),{element:p}=a(),m=Sa({group:h}),y=Ls({groupSize:m,panelElement:p,styleProp:f}),b=It(y/m*100);d(b)}}}function Bb(e){if(e.defaultPrevented)return;const t=ho();Mm(e,t).forEach(n=>{if(n.separator&&!n.separator.disableDoubleClick){const r=n.panels.find(a=>a.panelConstraints.defaultSize!==void 0);if(r){const a=r.panelConstraints.defaultSize,s=RC({groupId:n.group.id,panelId:r.id});s&&a!==void 0&&(s.resize(a),e.preventDefault())}}})}function tc(e){const t=ho();for(const[n]of t)if(n.separators.some(r=>r.element===e))return n;throw Error("Could not find parent Group for separator element")}function OC({groupId:e}){const t=()=>{const n=ho();for(const[r,a]of n)if(r.id===e)return{group:r,...a};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:r}=t();return n?{}:r},setLayout(n){const{defaultLayoutDeferred:r,derivedPanelConstraints:a,group:s,groupSize:u,layout:d,separatorToPanels:f}=t(),h=oo({layout:n,panelConstraints:a});return r?d:(ro(d,h)||Mi(s,{defaultLayoutDeferred:r,derivedPanelConstraints:a,groupSize:u,layout:h,separatorToPanels:f}),h)}}}function Fr(e,t){const n=tc(e),r=yr(n.id,!0),a=n.separators.find(p=>p.element===e);Be(a,"Matching separator not found");const s=r.separatorToPanels.get(a);Be(s,"Matching panels not found");const u=s.map(p=>n.panels.indexOf(p)),d=OC({groupId:n.id}).getLayout(),f=Ps({delta:t,initialLayout:d,panelConstraints:r.derivedPanelConstraints,pivotIndices:u,prevLayout:d,trigger:"keyboard"}),h=oo({layout:f,panelConstraints:r.derivedPanelConstraints});ro(d,h)||Mi(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:h,separatorToPanels:r.separatorToPanels},{isUserInteraction:!0})}function Fb(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=tc(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&Fr(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&Fr(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&Fr(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&Fr(t,-5);break}case"End":{e.preventDefault(),Fr(t,100);break}case"Enter":{e.preventDefault();const r=tc(t),a=yr(r.id,!0),{derivedPanelConstraints:s,layout:u,separatorToPanels:d}=a,f=r.separators.find(y=>y.element===t);Be(f,"Matching separator not found");const h=d.get(f);Be(h,"Matching panels not found");const p=h[0],m=s.find(y=>y.panelId===p.id);if(Be(m,"Panel metadata not found"),m.collapsible){const y=u[p.id],b=m.collapsedSize===y?r.mutableState.expandedPanelSizes[p.id]??m.minSize:m.collapsedSize;Fr(t,b-y)}break}case"F6":{e.preventDefault();const r=tc(t).separators.map(u=>u.element),a=Array.from(r).findIndex(u=>u===e.currentTarget);Be(a!==null,"Index not found");const s=e.shiftKey?a>0?a-1:r.length-1:a+1<r.length?a+1:0;r[s].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),Fr(t,-100);break}}}function Gb(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=ho(),n=Mm(e,t),r=new Map;let a=!1;n.forEach(s=>{s.separator&&(a||(a=!0,s.separator.element.focus({focusVisible:!1,preventScroll:!0})));const u=t.get(s.group);u&&r.set(s.group,u.layout)}),pa({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}function DC({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:a,pointerDownAtPoint:s,prevCursorFlags:u}){let d=0;n.forEach(h=>{const{group:p,groupSize:m}=h,{orientation:y,panels:b}=p,{disableCursor:S}=p.mutableState;let _=0;s?y==="horizontal"?_=(t.clientX-s.x)/m*100:_=(t.clientY-s.y)/m*100:y==="horizontal"?_=t.clientX<0?-100:100:_=t.clientY<0?-100:100;const w=r.get(p),x=a.get(p);if(!w||!x)return;const{defaultLayoutDeferred:E,derivedPanelConstraints:L,groupSize:R,layout:D,separatorToPanels:N}=x;if(L&&D&&N){const H=Ps({delta:_,initialLayout:w,panelConstraints:L,pivotIndices:h.panels.map(U=>b.indexOf(U)),prevLayout:D,trigger:"mouse-or-touch"});if(ro(H,D)){if(_!==0&&!S)switch(y){case"horizontal":{d|=_<0?xC:EC;break}case"vertical":{d|=_<0?wC:kC;break}}}else Mi(h.group,{defaultLayoutDeferred:E,derivedPanelConstraints:L,groupSize:R,layout:H,separatorToPanels:N})}});let f=0;t.movementX===0?f|=u&Mb:f|=d&Mb,t.movementY===0?f|=u&Nb:f|=d&Nb,BT(f),Om(e)}function $b(e){const t=ho(),n=io();n.state==="active"&&DC({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}function qb(e){if(e.defaultPrevented)return;const t=io(),n=ho();switch(t.state){case"active":{if(e.buttons===0){pa({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(r=>{const a=yr(r.group.id,!0);Mi(r.group,a,{isUserInteraction:!0})});return}for(const r of t.hitRegions)if(r.separator){const{element:a}=r.separator;a.hasPointerCapture?.(e.pointerId)||a.setPointerCapture?.(e.pointerId)}DC({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const r=Mm(e,n);r.length===0?t.state!=="inactive"&&pa({cursorFlags:0,state:"inactive"}):pa({cursorFlags:0,hitRegions:r,state:"hover"}),Om(e.currentTarget);break}}}function Wb(e){e.relatedTarget instanceof HTMLIFrameElement&&io().state==="hover"&&pa({cursorFlags:0,state:"inactive"})}function Yb(e){e.defaultPrevented||e.pointerType==="mouse"&&e.button>0||TC(e.currentTarget)&&e.preventDefault()}function Kb(e){let t=0,n=0;const r={};for(const s of e)if(s.defaultSize!==void 0){t++;const u=It(s.defaultSize);n+=u,r[s.panelId]=u}else r[s.panelId]=void 0;const a=e.length-t;if(a!==0){const s=It((100-n)/a);for(const u of e)u.defaultSize===void 0&&(r[u.panelId]=s)}return r}function tA(e,t,n){if(!n[0])return;const r=e.panels.find(f=>f.element===t);if(!r||!r.onResize)return;const a=Sa({group:e}),s=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,u=r.mutableValues.prevSize,d={asPercentage:It(s/a*100),inPixels:s};r.mutableValues.prevSize=d,r.onResize(d,r.id,u)}function nA(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 iA({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let a=0,s=0,u=!1;const d=new Map,f=[];for(const m of e.panels){const y=r[m.id]??0;if(m.panelConstraints.groupResizeBehavior==="preserve-pixel-size"){u=!0;const b=y/100*n,S=It(b/t*100);d.set(m.id,S),a+=S}else f.push(m.id),s+=y}if(!u||f.length===0)return r;const h=100-a,p={...r};if(d.forEach((m,y)=>{p[y]=m}),s>0)for(const m of f){const y=r[m]??0;p[m]=It(y/s*h)}else{const m=It(h/f.length);for(const y of f)p[y]=m}return p}function rA(e,t){const n=e.map(a=>a.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(const a of n)if(!r.includes(a))return!1;return!0}const ia=new Map;function oA(e){let t=!0;Be(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,a=new Set,s=new n(S=>{for(const _ of S){const{borderBoxSize:w,target:x}=_;if(x===e.element){if(t){const E=Sa({group:e});if(E===0)return;const L=yr(e.id);if(!L)return;const R=wp(e),D=L.defaultLayoutDeferred?Kb(R):L.layout,N=iA({group:e,nextGroupSize:E,prevGroupSize:L.groupSize,prevLayout:D}),H=oo({layout:N,panelConstraints:R});if(!L.defaultLayoutDeferred&&ro(L.layout,H)&&nA(L.derivedPanelConstraints,R)&&L.groupSize===E)return;Mi(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:R,groupSize:E,layout:H,separatorToPanels:L.separatorToPanels})}}else tA(e,x,w)}});s.observe(e.element),e.panels.forEach(S=>{Be(!r.has(S.id),`Panel ids must be unique; id "${S.id}" was used more than once`),r.add(S.id),S.onResize&&s.observe(S.element)});const u=Sa({group:e}),d=wp(e),f=e.panels.map(({id:S})=>S).join(",");let h=e.mutableState.defaultLayout;h&&(rA(e.panels,h)||(h=void 0));const p=e.mutableState.layouts[f]??h??Kb(d),m=oo({layout:p,panelConstraints:d}),y=e.element.ownerDocument;ia.set(y,(ia.get(y)??0)+1);const b=new Map;return _C(e).forEach(S=>{S.separator&&b.set(S.separator,S.panels)}),Mi(e,{defaultLayoutDeferred:u===0,derivedPanelConstraints:d,groupSize:u,layout:m,separatorToPanels:b}),e.separators.forEach(S=>{Be(!a.has(S.id),`Separator ids must be unique; id "${S.id}" was used more than once`),a.add(S.id),S.element.addEventListener("keydown",Fb)}),ia.get(y)===1&&(y.addEventListener("contextmenu",Pb,!0),y.addEventListener("dblclick",Bb,!0),y.addEventListener("pointerdown",Gb,!0),y.addEventListener("pointerleave",$b),y.addEventListener("pointermove",qb),y.addEventListener("pointerout",Wb),y.addEventListener("pointerup",Yb,!0)),function(){t=!1,ia.set(y,Math.max(0,(ia.get(y)??0)-1)),$T(e),e.separators.forEach(S=>{S.element.removeEventListener("keydown",Fb)}),ia.get(y)||(y.removeEventListener("contextmenu",Pb,!0),y.removeEventListener("dblclick",Bb,!0),y.removeEventListener("pointerdown",Gb,!0),y.removeEventListener("pointerleave",$b),y.removeEventListener("pointermove",qb),y.removeEventListener("pointerout",Wb),y.removeEventListener("pointerup",Yb,!0)),s.disconnect()}}function aA(){const[e,t]=O.useState({}),n=O.useCallback(()=>t({}),[]);return[e,n]}function Nm(e){const t=O.useId();return`${e??t}`}const po=typeof window<"u"?O.useLayoutEffect:O.useEffect;function Ds(e){const t=O.useRef(e);return po(()=>{t.current=e},[e]),O.useCallback((...n)=>t.current?.(...n),[t])}function Im(...e){return Ds(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function zm(e){const t=O.useRef({...e});return po(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const MC=O.createContext(null);function sA(e,t){const n=O.useRef({getLayout:()=>({}),setLayout:FT});O.useImperativeHandle(t,()=>n.current,[]),po(()=>{Object.assign(n.current,OC({groupId:e}))})}function NC({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:a,elementRef:s,groupRef:u,id:d,onLayoutChange:f,onLayoutChanged:h,orientation:p="horizontal",resizeTargetMinimumSize:m={coarse:20,fine:10},style:y,...b}){const S=O.useRef({onLayoutChange:{},onLayoutChanged:{}}),_=Ds(te=>{ro(S.current.onLayoutChange,te)||(S.current.onLayoutChange=te,f?.(te))}),w=Ds((te,V)=>{ro(S.current.onLayoutChanged,te)||(S.current.onLayoutChanged=te,h?.(te,{isUserInteraction:V}))}),x=Nm(d),E=O.useRef(null),[L,R]=aA(),D=O.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:m,separators:[]}),N=Im(E,s);sA(x,u);const H=Ds((te,V)=>{const Z=io(),ie=Hb(te),se=yr(te);if(se){let I=!1;return Z.state==="active"&&(I=Z.hitRegions.some(G=>G.group===ie)),{flexGrow:se.layout[V]??1,pointerEvents:I?"none":void 0}}if(n?.[V])return{flexGrow:n?.[V]}}),U=zm({defaultLayout:n,disableCursor:r}),W=O.useMemo(()=>({get disableCursor(){return!!U.disableCursor},getPanelStyles:H,id:x,orientation:p,registerPanel:te=>{const V=D.current;return V.panels=kp(p,[...V.panels,te]),R(),()=>{V.panels=V.panels.filter(Z=>Z!==te),R()}},registerSeparator:te=>{const V=D.current;return V.separators=kp(p,[...V.separators,te]),R(),()=>{V.separators=V.separators.filter(Z=>Z!==te),R()}},updatePanelProps:(te,{disabled:V})=>{const Z=D.current.panels.find(I=>I.id===te);Z&&(Z.panelConstraints.disabled=V);const ie=Hb(x),se=yr(x);ie&&se&&Mi(ie,{...se,derivedPanelConstraints:wp(ie)})},updateSeparatorProps:(te,{disabled:V,disableDoubleClick:Z})=>{const ie=D.current.separators.find(se=>se.id===te);ie&&(ie.disabled=V,ie.disableDoubleClick=Z)}}),[H,x,R,p,U]),ee=O.useRef(null);return po(()=>{const te=E.current;if(te===null)return;const V=D.current;let Z;if(U.defaultLayout!==void 0&&Object.keys(U.defaultLayout).length===V.panels.length){Z={};for(const Y of V.panels){const M=U.defaultLayout[Y.id];M!==void 0&&(Z[Y.id]=M)}}const ie={disabled:!!a,element:te,id:x,mutableState:{defaultLayout:Z,disableCursor:!!U.disableCursor,expandedPanelSizes:D.current.lastExpandedPanelSizes,layouts:D.current.layouts},orientation:p,panels:V.panels,resizeTargetMinimumSize:V.resizeTargetMinimumSize,separators:V.separators};ee.current=ie;const se=oA(ie),{defaultLayoutDeferred:I,derivedPanelConstraints:G,layout:X}=yr(ie.id,!0);!I&&G.length>0&&(_(X),w(X,!1));const ue=Dm(x,Y=>{const{defaultLayoutDeferred:M,derivedPanelConstraints:q,layout:oe}=Y.next;if(M||q.length===0)return;const le=ie.panels.map(({id:re})=>re).join(",");ie.mutableState.layouts[le]=oe,q.forEach(re=>{if(re.collapsible){const{layout:ce}=Y.prev??{};if(ce){const ke=Ot(re.collapsedSize,oe[re.panelId]),fe=Ot(re.collapsedSize,ce[re.panelId]);ke&&!fe&&(ie.mutableState.expandedPanelSizes[re.panelId]=ce[re.panelId])}}});const de=io().state!=="active";_(oe),de&&w(oe,Y.isUserInteraction)});return()=>{ee.current=null,se(),ue()}},[a,x,w,_,p,L,U]),O.useEffect(()=>{const te=ee.current;te&&(te.mutableState.defaultLayout=n,te.mutableState.disableCursor=!!r)}),A.jsx(MC.Provider,{value:W,children:A.jsx("div",{...b,className:t,"data-group":!0,"data-testid":x,id:x,ref:N,style:{height:"100%",width:"100%",overflow:"hidden",...y,display:"flex",flexDirection:p==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:p==="horizontal"?"pan-y":"pan-x"},children:e})})}NC.displayName="Group";function nc(e,t){return`react-resizable-panels:${[e,...t].join(":")}`}function lA({id:e,panelIds:t,storage:n}){const r=nc(e,[]),a=n.getItem(r);if(a)try{const s=JSON.parse(a);if(t){const u=t.join(","),d=s[u];if(d&&Array.isArray(d.layout)&&t.length===d.layout.length){const f={};for(let h=0;h<t.length;h++)f[t[h]]=d.layout[h];return f}}else{const u=Object.keys(s);if(u.length===1){const d=s[u[0]];if(d&&Array.isArray(d.layout)){const f=u[0].split(",");if(f.length===d.layout.length){const h={};for(let p=0;p<f.length;p++)h[f[p]]=d.layout[p];return h}}}}}catch{}}function uA({debounceSaveMs:e=100,onlySaveAfterUserInteractions:t,panelIds:n,storage:r=localStorage,...a}){const s=n!==void 0,u="id"in a?a.id:a.groupId,d=nc(u,n??[]),f=O.useSyncExternalStore(cA,()=>r.getItem(d),()=>r.getItem(d)),h=O.useMemo(()=>{if(f){const w=JSON.parse(f),x=Object.values(w);if(Array.from(x).every(E=>typeof E=="number"))return w}},[f]),p=O.useMemo(()=>{if(!h)return lA({id:u,panelIds:n,storage:r})},[h,u,n,r]),m=h??p,y=O.useRef(null),b=O.useCallback(()=>{const w=y.current;w&&(y.current=null,clearTimeout(w))},[]);O.useLayoutEffect(()=>()=>{b()},[b]);const S=O.useCallback((w,x)=>{if(!x.isUserInteraction)return;b();let E;s?E=nc(u,Object.keys(w)):E=nc(u,[]);try{r.setItem(E,JSON.stringify(w))}catch(L){console.error(L)}},[b,s,u,t,r]),_=O.useCallback(w=>{b(),e===0?S(w,{isUserInteraction:!1}):y.current=setTimeout(()=>{S(w,{isUserInteraction:!1})},e)},[b,e,S]);return{defaultLayout:m,onLayoutChange:_,onLayoutChanged:S}}function cA(){return function(){}}function Hm(){const e=O.useContext(MC);return Be(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function dA(e,t){const{id:n}=Hm(),r=O.useRef({collapse:Dh,expand:Dh,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Dh});O.useImperativeHandle(t,()=>r.current,[]),po(()=>{Object.assign(r.current,RC({groupId:n,panelId:e}))})}function IC({children:e,className:t,collapsedSize:n="0%",collapsible:r=!1,defaultSize:a,disabled:s,elementRef:u,groupResizeBehavior:d="preserve-relative-size",id:f,maxSize:h="100%",minSize:p="0%",onResize:m,panelRef:y,style:b,...S}){const _=!!f,w=Nm(f),x=zm({disabled:s}),E=O.useRef(null),L=Im(E,u),{getPanelStyles:R,id:D,orientation:N,registerPanel:H,updatePanelProps:U}=Hm(),W=m!==null,ee=Ds((ie,se,I)=>{m?.(ie,f,I)});po(()=>{const ie=E.current;if(ie!==null){const se={element:ie,id:w,idIsStable:_,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:W?ee:void 0,panelConstraints:{groupResizeBehavior:d,collapsedSize:n,collapsible:r,defaultSize:a,disabled:x.disabled,maxSize:h,minSize:p}};return H(se)}},[d,n,r,a,W,w,_,h,p,ee,H,x]),O.useEffect(()=>{U(w,{disabled:s})},[s,w,U]),dA(w,y);const te=()=>{const ie=R(D,w);if(ie)return JSON.stringify(ie)},V=O.useSyncExternalStore(ie=>Dm(D,ie),te,te);let Z;return V?Z=JSON.parse(V):a!==void 0?Z={flexGrow:void 0,flexShrink:void 0,flexBasis:a}:Z={flexGrow:1},A.jsx("div",{...S,"data-disabled":s||void 0,"data-panel":!0,"data-testid":w,id:w,ref:L,style:{...fA,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...Z},children:A.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...b,touchAction:N==="horizontal"?"pan-y":"pan-x"},children:e})})}IC.displayName="Panel";const fA={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function hA({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let a,s;const u=e[n],d=t.find(f=>f.panelId===n);if(d){const f=d.maxSize,h=d.collapsible?d.collapsedSize:d.minSize,p=[r,r+1];s=oo({layout:Ps({delta:h-u,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e}),panelConstraints:t})[n],a=oo({layout:Ps({delta:f-u,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:a,valueMin:s,valueNow:u}}function zC({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:a,id:s,style:u,...d}){const f=Nm(s),h=zm({disabled:n,disableDoubleClick:r}),[p,m]=O.useState({}),[y,b]=O.useState("inactive"),[S,_]=O.useState(!1),w=O.useRef(null),x=Im(w,a),{disableCursor:E,id:L,orientation:R,registerSeparator:D,updateSeparatorProps:N}=Hm(),H=R==="horizontal"?"vertical":"horizontal";po(()=>{const ee=w.current;if(ee!==null){const te={disabled:h.disabled,disableDoubleClick:h.disableDoubleClick,element:ee,id:f},V=D(te),Z=VT(se=>{b(se.next.state!=="inactive"&&se.next.hitRegions.some(I=>I.separator===te)?se.next.state:"inactive")}),ie=Dm(L,se=>{const{derivedPanelConstraints:I,layout:G,separatorToPanels:X}=se.next,ue=X.get(te);if(ue){const Y=ue[0],M=ue.indexOf(Y);m(hA({layout:G,panelConstraints:I,panelId:Y.id,panelIndex:M}))}});return()=>{Z(),ie(),V()}}},[L,f,D,h]),O.useEffect(()=>{N(f,{disabled:n,disableDoubleClick:r})},[n,r,f,N]);let U;n&&!E&&(U="not-allowed");let W;return n?W="disabled":y==="active"?W="active":S?W="focus":W=y,A.jsx("div",{...d,"aria-controls":p.valueControls,"aria-disabled":n||void 0,"aria-orientation":H,"aria-valuemax":p.valueMax,"aria-valuemin":p.valueMin,"aria-valuenow":p.valueNow,children:e,className:t,"data-separator":W,"data-testid":f,id:f,onBlur:()=>_(!1),onFocus:()=>_(!0),ref:x,role:"separator",style:{flexBasis:"auto",cursor:U,...u,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}zC.displayName="Separator";function HC(e){switch(e.kind){case"review":return"api/review.json";case"hunks":return`api/hunks/${encodeURIComponent(e.group)}.json`;case"file":return`api/files/${e.side}/${Mh(e.path)}.json`;case"blame":return`api/blame/${e.side}/${Mh(e.path)}.json`;case"image":return`api/images/${e.side}/${Mh(e.path)}`}}function Mh(e){return e.split("/").map(encodeURIComponent).join("/")}function Lp(e){return new URL(HC(e),new URL("./",document.baseURI)).href}async function Bc(e){const t=new URL(HC(e),new URL("./",document.baseURI)).href,n=await fetch(t),r=await n.text();if(!n.ok){let a=r;try{const s=JSON.parse(r);s.error!==void 0&&(a=s.error)}catch{}throw new Error(a)}return JSON.parse(r)}function pA(){return Bc({kind:"review"})}function mA(e){return Bc({kind:"hunks",group:e})}function gA(e,t){return Bc({kind:"file",path:e,side:t})}function vA(e,t){return Bc({kind:"blame",path:e,side:t})}function Xb(e){return e.slice(0,7)}function PC(e,t){return e.findIndex(n=>n.id===t)+1}function Ms(e){return String(e).padStart(2,"0")}function UC(e){return e.replace("-"," ")}const jC=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const yA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const bA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const Qb=e=>{const t=bA(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Nh={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 SA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},_A=O.createContext({}),CA=()=>O.useContext(_A),xA=O.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:a="",children:s,iconNode:u,...d},f)=>{const{size:h=24,strokeWidth:p=2,absoluteStrokeWidth:m=!1,color:y="currentColor",className:b=""}=CA()??{},S=r??m?Number(n??p)*24/Number(t??h):n??p;return O.createElement("svg",{ref:f,...Nh,width:t??h??Nh.width,height:t??h??Nh.height,stroke:e??y,strokeWidth:S,className:jC("lucide",b,a),...!s&&!SA(d)&&{"aria-hidden":"true"},...d},[...u.map(([_,w])=>O.createElement(_,w)),...Array.isArray(s)?s:[s]])});const Fc=(e,t)=>{const n=O.forwardRef(({className:r,...a},s)=>O.createElement(xA,{ref:s,iconNode:t,className:jC(`lucide-${yA(Qb(e))}`,`lucide-${e}`,r),...a}));return n.displayName=Qb(e),n};const EA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],wA=Fc("chevron-down",EA);const kA=[["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"}]],VC=Fc("grip-vertical",kA);const LA=[["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"}]],TA=Fc("moon",LA);const AA=[["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"}]],RA=Fc("sun",AA),BC=180,_a={review:"Reading the review.",layer:"Reading git.",file:"Reading this file.",blame:"Reading blame."};function OA(e,t,n=BC){return e&&t>=n}var DA=Object.defineProperty,Pm=(e,t)=>DA(e,"name",{value:t,configurable:!0});function Tp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Pm(Tp,"setRef");function FC(...e){return t=>{let n=!1;const r=e.map(a=>{const s=Tp(a,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let a=0;a<r.length;a++){const s=r[a];typeof s=="function"?s():Tp(e[a],null)}}}}Pm(FC,"composeRefs");function mo(...e){return O.useCallback(FC(...e),e)}Pm(mo,"useComposedRefs");var MA=Object.defineProperty,In=(e,t)=>MA(e,"name",{value:t,configurable:!0});function Um(e){const t=O.forwardRef((n,r)=>{let{children:a,...s}=n,u=null,d=!1;const f=[];Ap(a)&&typeof wu=="function"&&(a=wu(a._payload)),O.Children.forEach(a,y=>{if(KC(y)){d=!0;const b=y;let S="child"in b.props?b.props.child:b.props.children;Ap(S)&&typeof wu=="function"&&(S=wu(S._payload)),u=NA(b,S),f.push(u?.props?.children)}else f.push(y)}),u?u=O.cloneElement(u,void 0,f):!d&&O.Children.count(a)===1&&O.isValidElement(a)&&(u=a);const h=u?YC(u):void 0,p=mo(r,h);if(!u){if(a||a===0)throw new Error(d?HA(e):zA(e));return a}const m=WC(s,u.props??{});return u.type!==O.Fragment&&(m.ref=r?p:h),O.cloneElement(u,m)});return t.displayName=`${e}.Slot`,t}In(Um,"createSlot");var GC=Um("Slot"),$C=Symbol.for("radix.slottable");function qC(e){const t=In(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=$C,t}In(qC,"createSlottable");var NA=In((e,t)=>{if("child"in e.props){const n=e.props.child;return O.isValidElement(n)?O.cloneElement(n,void 0,e.props.children(n.props.children)):null}return O.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function WC(e,t){const n={...t};for(const r in t){const a=e[r],s=t[r];/^on[A-Z]/.test(r)?a&&s?n[r]=(...d)=>{const f=s(...d);return a(...d),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...s}:r==="className"&&(n[r]=[a,s].filter(Boolean).join(" "))}return{...e,...n}}In(WC,"mergeProps");function YC(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)}In(YC,"getElementRef");function KC(e){return O.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$C}In(KC,"isSlottable");var IA=Symbol.for("react.lazy");function Ap(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===IA&&"_payload"in e&&XC(e._payload)}In(Ap,"isLazyComponent");function XC(e){return typeof e=="object"&&e!==null&&"then"in e}In(XC,"isPromiseLike");var zA=In(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),HA=In(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),wu=Zs[" use ".trim().toString()];function QC(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=QC(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ZC(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=QC(e))&&(r&&(r+=" "),r+=t);return r}const Zb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Jb=ZC,JC=(e,t)=>n=>{var r;if(t?.variants==null)return Jb(e,n?.class,n?.className);const{variants:a,defaultVariants:s}=t,u=Object.keys(a).map(h=>{const p=n?.[h],m=s?.[h];if(p===null)return null;const y=Zb(p)||Zb(m);return a[h][y]}),d=n&&Object.entries(n).reduce((h,p)=>{let[m,y]=p;return y===void 0||(h[m]=y),h},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((h,p)=>{let{class:m,className:y,...b}=p;return Object.entries(b).every(S=>{let[_,w]=S;return Array.isArray(w)?w.includes({...s,...d}[_]):{...s,...d}[_]===w})?[...h,m,y]:h},[]);return Jb(e,u,f,n?.class,n?.className)},PA=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},UA=(e,t)=>({classGroupId:e,validator:t}),ex=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),pc="-",eS=[],jA="arbitrary..",VA=e=>{const t=FA(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return BA(u);const d=u.split(pc),f=d[0]===""&&d.length>1?1:0;return tx(d,f,t)},getConflictingClassGroupIds:(u,d)=>{if(d){const f=r[u],h=n[u];return f?h?PA(h,f):f:h||eS}return n[u]||eS}}},tx=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],s=n.nextPart.get(a);if(s){const h=tx(e,t+1,s);if(h)return h}const u=n.validators;if(u===null)return;const d=t===0?e.join(pc):e.slice(t).join(pc),f=u.length;for(let h=0;h<f;h++){const p=u[h];if(p.validator(d))return p.classGroupId}},BA=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?jA+r:void 0})(),FA=e=>{const{theme:t,classGroups:n}=e;return GA(n,t)},GA=(e,t)=>{const n=ex();for(const r in e){const a=e[r];jm(a,n,r,t)}return n},jm=(e,t,n,r)=>{const a=e.length;for(let s=0;s<a;s++){const u=e[s];$A(u,t,n,r)}},$A=(e,t,n,r)=>{if(typeof e=="string"){qA(e,t,n);return}if(typeof e=="function"){WA(e,t,n,r);return}YA(e,t,n,r)},qA=(e,t,n)=>{const r=e===""?t:nx(t,e);r.classGroupId=n},WA=(e,t,n,r)=>{if(KA(e)){jm(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(UA(n,e))},YA=(e,t,n,r)=>{const a=Object.entries(e),s=a.length;for(let u=0;u<s;u++){const[d,f]=a[u];jm(f,nx(t,d),n,r)}},nx=(e,t)=>{let n=e;const r=t.split(pc),a=r.length;for(let s=0;s<a;s++){const u=r[s];let d=n.nextPart.get(u);d||(d=ex(),n.nextPart.set(u,d)),n=d}return n},KA=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,XA=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const a=(s,u)=>{n[s]=u,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let u=n[s];if(u!==void 0)return u;if((u=r[s])!==void 0)return a(s,u),u},set(s,u){s in n?n[s]=u:a(s,u)}}},Rp="!",tS=":",QA=[],nS=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),ZA=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const s=[];let u=0,d=0,f=0,h;const p=a.length;for(let _=0;_<p;_++){const w=a[_];if(u===0&&d===0){if(w===tS){s.push(a.slice(f,_)),f=_+1;continue}if(w==="/"){h=_;continue}}w==="["?u++:w==="]"?u--:w==="("?d++:w===")"&&d--}const m=s.length===0?a:a.slice(f);let y=m,b=!1;m.endsWith(Rp)?(y=m.slice(0,-1),b=!0):m.startsWith(Rp)&&(y=m.slice(1),b=!0);const S=h&&h>f?h-f:void 0;return nS(s,b,y,S)};if(t){const a=t+tS,s=r;r=u=>u.startsWith(a)?s(u.slice(a.length)):nS(QA,!1,u,void 0,!0)}if(n){const a=r;r=s=>n({className:s,parseClassName:a})}return r},JA=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let a=[];for(let s=0;s<n.length;s++){const u=n[s],d=u[0]==="[",f=t.has(u);d||f?(a.length>0&&(a.sort(),r.push(...a),a=[]),r.push(u)):a.push(u)}return a.length>0&&(a.sort(),r.push(...a)),r}},eR=e=>({cache:XA(e.cacheSize),parseClassName:ZA(e),sortModifiers:JA(e),postfixLookupClassGroupIds:tR(e),...VA(e)}),tR=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},nR=/\s+/,iR=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:s,postfixLookupClassGroupIds:u}=t,d=[],f=e.trim().split(nR);let h="";for(let p=f.length-1;p>=0;p-=1){const m=f[p],{isExternal:y,modifiers:b,hasImportantModifier:S,baseClassName:_,maybePostfixModifierPosition:w}=n(m);if(y){h=m+(h.length>0?" "+h:h);continue}let x=!!w,E;if(x){const H=_.substring(0,w);E=r(H);const U=E&&u[E]?r(_):void 0;U&&U!==E&&(E=U,x=!1)}else E=r(_);if(!E){if(!x){h=m+(h.length>0?" "+h:h);continue}if(E=r(_),!E){h=m+(h.length>0?" "+h:h);continue}x=!1}const L=b.length===0?"":b.length===1?b[0]:s(b).join(":"),R=S?L+Rp:L,D=R+E;if(d.indexOf(D)>-1)continue;d.push(D);const N=a(E,x);for(let H=0;H<N.length;++H){const U=N[H];d.push(R+U)}h=m+(h.length>0?" "+h:h)}return h},rR=(...e)=>{let t=0,n,r,a="";for(;t<e.length;)(n=e[t++])&&(r=ix(n))&&(a&&(a+=" "),a+=r);return a},ix=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ix(e[r]))&&(n&&(n+=" "),n+=t);return n},oR=(e,...t)=>{let n,r,a,s;const u=f=>{const h=t.reduce((p,m)=>m(p),e());return n=eR(h),r=n.cache.get,a=n.cache.set,s=d,d(f)},d=f=>{const h=r(f);if(h)return h;const p=iR(f,n);return a(f,p),p};return s=u,(...f)=>s(rR(...f))},aR=[],ft=e=>{const t=n=>n[e]||aR;return t.isThemeGetter=!0,t},rx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ox=/^\((?:(\w[\w-]*):)?(.+)\)$/i,sR=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,lR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,uR=/\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$/,cR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,dR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fr=e=>sR.test(e),we=e=>!!e&&!Number.isNaN(Number(e)),jn=e=>!!e&&Number.isInteger(Number(e)),Ih=e=>e.endsWith("%")&&we(e.slice(0,-1)),Ci=e=>lR.test(e),ax=()=>!0,hR=e=>uR.test(e)&&!cR.test(e),Vm=()=>!1,pR=e=>dR.test(e),mR=e=>fR.test(e),gR=e=>!he(e)&&!pe(e),vR=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)),yR=e=>xr(e,ux,Vm),he=e=>rx.test(e),Gr=e=>xr(e,cx,hR),iS=e=>xr(e,kR,we),bR=e=>xr(e,fx,ax),SR=e=>xr(e,dx,Vm),rS=e=>xr(e,sx,Vm),_R=e=>xr(e,lx,mR),ku=e=>xr(e,hx,pR),pe=e=>ox.test(e),xs=e=>go(e,cx),CR=e=>go(e,dx),oS=e=>go(e,sx),xR=e=>go(e,ux),ER=e=>go(e,lx),Lu=e=>go(e,hx,!0),wR=e=>go(e,fx,!0),xr=(e,t,n)=>{const r=rx.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},go=(e,t,n=!1)=>{const r=ox.exec(e);return r?r[1]?t(r[1]):n:!1},sx=e=>e==="position"||e==="percentage",lx=e=>e==="image"||e==="url",ux=e=>e==="length"||e==="size"||e==="bg-size",cx=e=>e==="length",kR=e=>e==="number",dx=e=>e==="family-name",fx=e=>e==="number"||e==="weight",hx=e=>e==="shadow",LR=()=>{const e=ft("color"),t=ft("font"),n=ft("text"),r=ft("font-weight"),a=ft("tracking"),s=ft("leading"),u=ft("breakpoint"),d=ft("container"),f=ft("spacing"),h=ft("radius"),p=ft("shadow"),m=ft("inset-shadow"),y=ft("text-shadow"),b=ft("drop-shadow"),S=ft("blur"),_=ft("perspective"),w=ft("aspect"),x=ft("ease"),E=ft("animate"),L=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...R(),pe,he],N=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto","contain","none"],U=()=>[pe,he,f],W=()=>[fr,"full","auto",...U()],ee=()=>[jn,"none","subgrid",pe,he],te=()=>["auto",{span:["full",jn,pe,he]},jn,pe,he],V=()=>[jn,"auto",pe,he],Z=()=>["auto","min","max","fr",pe,he],ie=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],se=()=>["start","end","center","stretch","center-safe","end-safe"],I=()=>["auto",...U()],G=()=>[fr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...U()],X=()=>[fr,"screen","full","dvw","lvw","svw","min","max","fit",...U()],ue=()=>[fr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...U()],Y=()=>[e,pe,he],M=()=>[...R(),oS,rS,{position:[pe,he]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],oe=()=>["auto","cover","contain",xR,yR,{size:[pe,he]}],le=()=>[Ih,xs,Gr],de=()=>["","none","full",h,pe,he],re=()=>["",we,xs,Gr],ce=()=>["solid","dashed","dotted","double"],ke=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>[we,Ih,oS,rS],Fe=()=>["","none",S,pe,he],Ge=()=>["none",we,pe,he],Ze=()=>["none",we,pe,he],Ne=()=>[we,pe,he],ze=()=>[fr,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ci],breakpoint:[Ci],color:[ax],container:[Ci],"drop-shadow":[Ci],ease:["in","out","in-out"],font:[gR],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ci],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ci],shadow:[Ci],spacing:["px",we],text:[Ci],"text-shadow":[Ci],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",fr,he,pe,w]}],container:["container"],"container-type":[{"@container":["","normal","size",pe,he]}],"container-named":[vR],columns:[{columns:[we,he,pe,d]}],"break-after":[{"break-after":L()}],"break-before":[{"break-before":L()}],"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:D()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:W()}],"inset-x":[{"inset-x":W()}],"inset-y":[{"inset-y":W()}],start:[{"inset-s":W(),start:W()}],end:[{"inset-e":W(),end:W()}],"inset-bs":[{"inset-bs":W()}],"inset-be":[{"inset-be":W()}],top:[{top:W()}],right:[{right:W()}],bottom:[{bottom:W()}],left:[{left:W()}],visibility:["visible","invisible","collapse"],z:[{z:[jn,"auto",pe,he]}],basis:[{basis:[fr,"full","auto",d,...U()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[we,fr,"auto","initial","none",he]}],grow:[{grow:["",we,pe,he]}],shrink:[{shrink:["",we,pe,he]}],order:[{order:[jn,"first","last","none",pe,he]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Z()}],"auto-rows":[{"auto-rows":Z()}],gap:[{gap:U()}],"gap-x":[{"gap-x":U()}],"gap-y":[{"gap-y":U()}],"justify-content":[{justify:[...ie(),"normal"]}],"justify-items":[{"justify-items":[...se(),"normal"]}],"justify-self":[{"justify-self":["auto",...se()]}],"align-content":[{content:["normal",...ie()]}],"align-items":[{items:[...se(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...se(),{baseline:["","last"]}]}],"place-content":[{"place-content":ie()}],"place-items":[{"place-items":[...se(),"baseline"]}],"place-self":[{"place-self":["auto",...se()]}],p:[{p:U()}],px:[{px:U()}],py:[{py:U()}],ps:[{ps:U()}],pe:[{pe:U()}],pbs:[{pbs:U()}],pbe:[{pbe:U()}],pt:[{pt:U()}],pr:[{pr:U()}],pb:[{pb:U()}],pl:[{pl:U()}],m:[{m:I()}],mx:[{mx:I()}],my:[{my:I()}],ms:[{ms:I()}],me:[{me:I()}],mbs:[{mbs:I()}],mbe:[{mbe:I()}],mt:[{mt:I()}],mr:[{mr:I()}],mb:[{mb:I()}],ml:[{ml:I()}],"space-x":[{"space-x":U()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":U()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],"inline-size":[{inline:["auto",...X()]}],"min-inline-size":[{"min-inline":["auto",...X()]}],"max-inline-size":[{"max-inline":["none",...X()]}],"block-size":[{block:["auto",...ue()]}],"min-block-size":[{"min-block":["auto",...ue()]}],"max-block-size":[{"max-block":["none",...ue()]}],w:[{w:[d,"screen",...G()]}],"min-w":[{"min-w":[d,"screen","none",...G()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[u]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",n,xs,Gr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,wR,bR]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ih,he]}],"font-family":[{font:[CR,SR,t]}],"font-features":[{"font-features":[he]}],"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:[a,pe,he]}],"line-clamp":[{"line-clamp":[we,"none",pe,iS]}],leading:[{leading:[s,...U()]}],"list-image":[{"list-image":["none",pe,he]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pe,he]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Y()}],"text-color":[{text:Y()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[we,"from-font","auto",pe,Gr]}],"text-decoration-color":[{decoration:Y()}],"underline-offset":[{"underline-offset":[we,"auto",pe,he]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"tab-size":[{tab:[jn,pe,he]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe,he]}],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",pe,he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:M()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},jn,pe,he],radial:["",pe,he],conic:[jn,pe,he]},ER,_R]}],"bg-color":[{bg:Y()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:Y()}],"gradient-via":[{via:Y()}],"gradient-to":[{to:Y()}],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:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ce(),"hidden","none"]}],"divide-style":[{divide:[...ce(),"hidden","none"]}],"border-color":[{border:Y()}],"border-color-x":[{"border-x":Y()}],"border-color-y":[{"border-y":Y()}],"border-color-s":[{"border-s":Y()}],"border-color-e":[{"border-e":Y()}],"border-color-bs":[{"border-bs":Y()}],"border-color-be":[{"border-be":Y()}],"border-color-t":[{"border-t":Y()}],"border-color-r":[{"border-r":Y()}],"border-color-b":[{"border-b":Y()}],"border-color-l":[{"border-l":Y()}],"divide-color":[{divide:Y()}],"outline-style":[{outline:[...ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[we,pe,he]}],"outline-w":[{outline:["",we,xs,Gr]}],"outline-color":[{outline:Y()}],shadow:[{shadow:["","none",p,Lu,ku]}],"shadow-color":[{shadow:Y()}],"inset-shadow":[{"inset-shadow":["none",m,Lu,ku]}],"inset-shadow-color":[{"inset-shadow":Y()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Y()}],"ring-offset-w":[{"ring-offset":[we,Gr]}],"ring-offset-color":[{"ring-offset":Y()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":Y()}],"text-shadow":[{"text-shadow":["none",y,Lu,ku]}],"text-shadow-color":[{"text-shadow":Y()}],opacity:[{opacity:[we,pe,he]}],"mix-blend":[{"mix-blend":[...ke(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ke()}],"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":[we]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":Y()}],"mask-image-linear-to-color":[{"mask-linear-to":Y()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":Y()}],"mask-image-t-to-color":[{"mask-t-to":Y()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":Y()}],"mask-image-r-to-color":[{"mask-r-to":Y()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":Y()}],"mask-image-b-to-color":[{"mask-b-to":Y()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":Y()}],"mask-image-l-to-color":[{"mask-l-to":Y()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":Y()}],"mask-image-x-to-color":[{"mask-x-to":Y()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":Y()}],"mask-image-y-to-color":[{"mask-y-to":Y()}],"mask-image-radial":[{"mask-radial":[pe,he]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":Y()}],"mask-image-radial-to-color":[{"mask-radial-to":Y()}],"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":R()}],"mask-image-conic-pos":[{"mask-conic":[we]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":Y()}],"mask-image-conic-to-color":[{"mask-conic-to":Y()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:M()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pe,he]}],filter:[{filter:["","none",pe,he]}],blur:[{blur:Fe()}],brightness:[{brightness:[we,pe,he]}],contrast:[{contrast:[we,pe,he]}],"drop-shadow":[{"drop-shadow":["","none",b,Lu,ku]}],"drop-shadow-color":[{"drop-shadow":Y()}],grayscale:[{grayscale:["",we,pe,he]}],"hue-rotate":[{"hue-rotate":[we,pe,he]}],invert:[{invert:["",we,pe,he]}],saturate:[{saturate:[we,pe,he]}],sepia:[{sepia:["",we,pe,he]}],"backdrop-filter":[{"backdrop-filter":["","none",pe,he]}],"backdrop-blur":[{"backdrop-blur":Fe()}],"backdrop-brightness":[{"backdrop-brightness":[we,pe,he]}],"backdrop-contrast":[{"backdrop-contrast":[we,pe,he]}],"backdrop-grayscale":[{"backdrop-grayscale":["",we,pe,he]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[we,pe,he]}],"backdrop-invert":[{"backdrop-invert":["",we,pe,he]}],"backdrop-opacity":[{"backdrop-opacity":[we,pe,he]}],"backdrop-saturate":[{"backdrop-saturate":[we,pe,he]}],"backdrop-sepia":[{"backdrop-sepia":["",we,pe,he]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":U()}],"border-spacing-x":[{"border-spacing-x":U()}],"border-spacing-y":[{"border-spacing-y":U()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pe,he]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[we,"initial",pe,he]}],ease:[{ease:["linear","initial",x,pe,he]}],delay:[{delay:[we,pe,he]}],animate:[{animate:["none",E,pe,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,pe,he]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Ge()}],"rotate-x":[{"rotate-x":Ge()}],"rotate-y":[{"rotate-y":Ge()}],"rotate-z":[{"rotate-z":Ge()}],scale:[{scale:Ze()}],"scale-x":[{"scale-x":Ze()}],"scale-y":[{"scale-y":Ze()}],"scale-z":[{"scale-z":Ze()}],"scale-3d":["scale-3d"],skew:[{skew:Ne()}],"skew-x":[{"skew-x":Ne()}],"skew-y":[{"skew-y":Ne()}],transform:[{transform:[pe,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ze()}],"translate-x":[{"translate-x":ze()}],"translate-y":[{"translate-y":ze()}],"translate-z":[{"translate-z":ze()}],"translate-none":["translate-none"],zoom:[{zoom:[jn,pe,he]}],accent:[{accent:Y()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Y()}],"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",pe,he]}],"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":Y()}],"scrollbar-track-color":[{"scrollbar-track":Y()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mbs":[{"scroll-mbs":U()}],"scroll-mbe":[{"scroll-mbe":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pbs":[{"scroll-pbs":U()}],"scroll-pbe":[{"scroll-pbe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"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",pe,he]}],fill:[{fill:["none",...Y()]}],"stroke-w":[{stroke:[we,xs,Gr,iS]}],stroke:[{stroke:["none",...Y()]}],"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"]}},TR=oR(LR);function Qe(...e){return TR(ZC(e))}const AR=JC("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-colors 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 Dt({className:e,variant:t="default",size:n="default",asChild:r=!1,...a}){const s=r?GC:"button";return A.jsx(s,{"data-slot":"button",className:Qe(AR({variant:t,size:n}),e),...a})}var RR=Object.defineProperty,Ca=(e,t)=>RR(e,"name",{value:t,configurable:!0}),px=!!(typeof window<"u"&&window.document&&window.document.createElement);function $n(e,t,{checkForDefaultPrevented:n=!0}={}){return Ca(function(a){if(e?.(a),n===!1||!a||!a.defaultPrevented)return t?.(a)},"handleEvent")}Ca($n,"composeEventHandlers");function OR(e){if(!px)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}Ca(OR,"getOwnerWindow");function Op(e){if(!px)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}Ca(Op,"getOwnerDocument");function mx(e,t=!1){const{activeElement:n}=Op(e);if(!n?.nodeName)return null;if(gx(n)&&n.contentDocument)return mx(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const a=Op(n).getElementById(r);if(a)return a}}return n}Ca(mx,"getActiveElement");function gx(e){return e.tagName==="IFRAME"}Ca(gx,"isFrame");var DR=Object.defineProperty,Cn=(e,t)=>DR(e,"name",{value:t,configurable:!0});function MR(e,t){const n=O.createContext(t);n.displayName=e+"Context";const r=Cn(s=>{const{children:u,...d}=s,f=O.useMemo(()=>d,Object.values(d));return A.jsx(n.Provider,{value:f,children:u})},"Provider");r.displayName=e+"Provider";function a(s,u={}){const{optional:d=!1}=u,f=O.useContext(n);if(f)return f;if(t!==void 0)return t;if(!d)throw new Error(`\`${s}\` must be used within \`${e}\``)}return Cn(a,"useContext"),[r,a]}Cn(MR,"createContext");function Bm(e,t=[]){let n=[];function r(s,u){const d=O.createContext(u);d.displayName=s+"Context";const f=n.length;n=[...n,u];const h=Cn(m=>{const{scope:y,children:b,...S}=m,_=y?.[e]?.[f]||d,w=O.useMemo(()=>S,Object.values(S));return A.jsx(_.Provider,{value:w,children:b})},"Provider");h.displayName=s+"Provider";function p(m,y,b={}){const{optional:S=!1}=b,_=y?.[e]?.[f]||d,w=O.useContext(_);if(w)return w;if(u!==void 0)return u;if(!S)throw new Error(`\`${m}\` must be used within \`${s}\``)}return Cn(p,"useContext"),[h,p]}Cn(r,"createContext");const a=Cn(()=>{const s=n.map(u=>O.createContext(u));return Cn(function(d){const f=d?.[e]||s;return O.useMemo(()=>({[`__scope${e}`]:{...d,[e]:f}}),[d,f])},"useScope")},"createScope");return a.scopeName=e,[r,vx(a,...t)]}Cn(Bm,"createContextScope");function vx(...e){const t=e[0];if(e.length===1)return t;const n=Cn(()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return Cn(function(s){const u=r.reduce((d,{useScope:f,scopeName:h})=>{const m=f(s)[`__scope${h}`];return{...d,...m}},{});return O.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}Cn(vx,"composeContextScopes");var Gc=yC(),NR=Object.defineProperty,IR=(e,t)=>NR(e,"name",{value:t,configurable:!0}),zR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],vo=zR.reduce((e,t)=>{const n=Um(`Primitive.${t}`),r=O.forwardRef((a,s)=>{const{asChild:u,...d}=a,f=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),A.jsx(f,{...d,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function yx(e,t){e&&Gc.flushSync(()=>e.dispatchEvent(t))}IR(yx,"dispatchDiscreteCustomEvent");var HR=Object.defineProperty,PR=(e,t)=>HR(e,"name",{value:t,configurable:!0});function Js(e){const t=O.useRef(e);return O.useEffect(()=>{t.current=e}),O.useMemo(()=>((...n)=>t.current?.(...n)),[])}PR(Js,"useCallbackRef");var UR=Object.defineProperty,_t=(e,t)=>UR(e,"name",{value:t,configurable:!0}),Dp="dismissableLayer.update",jR="dismissableLayer.pointerDownOutside",VR="dismissableLayer.focusOutside",aS,bx=O.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),BR=O.forwardRef(_t(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:a=!1,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,...p}=t,m=O.useContext(bx),[y,b]=O.useState(null),S=y?.ownerDocument??globalThis?.document,[,_]=O.useState({}),w=mo(n,b),x=Array.from(m.layers),[E]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),L=E?x.indexOf(E):-1,R=y?x.indexOf(y):-1,D=m.layersWithOutsidePointerEventsDisabled.size>0,N=R>=L,H=O.useRef(!1),U=Sx(V=>{u?.(V),f?.(V),V.defaultPrevented||h?.()},{ownerDocument:S,deferPointerDownOutside:a,isDeferredPointerDownOutsideRef:H,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:O.useCallback(V=>{if(!(V instanceof Node))return!1;const Z=[...m.branches].some(ie=>ie.contains(V));return N&&!Z},[m.branches,N])}),W=_x(V=>{if(a&&H.current)return;const Z=V.target;[...m.branches].some(se=>se.contains(Z))||(d?.(V),f?.(V),V.defaultPrevented||h?.())},S),ee=y?R===x.length-1:!1,te=Js(V=>{V.key==="Escape"&&(s?.(V),!V.defaultPrevented&&h&&(V.preventDefault(),h()))});return O.useEffect(()=>{if(ee)return S.addEventListener("keydown",te,{capture:!0}),()=>S.removeEventListener("keydown",te,{capture:!0})},[S,ee,te]),O.useEffect(()=>{if(y)return r&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(aS=S.body.style.pointerEvents,S.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(y)),m.layers.add(y),Mp(),()=>{r&&(m.layersWithOutsidePointerEventsDisabled.delete(y),m.layersWithOutsidePointerEventsDisabled.size===0&&(S.body.style.pointerEvents=aS))}},[y,S,r,m]),O.useEffect(()=>()=>{y&&(m.layers.delete(y),m.layersWithOutsidePointerEventsDisabled.delete(y),Mp())},[y,m]),O.useEffect(()=>{const V=_t(()=>_({}),"handleUpdate");return document.addEventListener(Dp,V),()=>document.removeEventListener(Dp,V)},[]),A.jsx(vo.div,{...p,ref:w,style:{pointerEvents:D?N?"auto":"none":void 0,...t.style},onFocusCapture:$n(t.onFocusCapture,W.onFocusCapture),onBlurCapture:$n(t.onBlurCapture,W.onBlurCapture),onPointerDownCapture:$n(t.onPointerDownCapture,U.onPointerDownCapture)})},"DismissableLayer"));function FR(){const e=O.useContext(bx),[t,n]=O.useState(null);return O.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}_t(FR,"useDismissableLayerSurface");var GR=_t(()=>!0,"IS_TRUE");function Sx(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:s,shouldHandlePointerDownOutside:u=GR}=t,d=Js(e),f=O.useRef(!1),h=O.useRef(!1),p=O.useRef(new Map),m=O.useRef(()=>{});return O.useEffect(()=>{function y(){h.current=!1,a.current=!1,p.current.clear()}_t(y,"resetOutsideInteraction");function b(){return Array.from(p.current.values()).some(Boolean)}_t(b,"isOutsideInteractionIntercepted");function S(L){if(!h.current)return;const R=L.target;R instanceof Node&&[...s].some(N=>N.contains(R))||p.current.set(L.type,!0),L.type==="click"&&window.setTimeout(()=>{h.current&&m.current()},0)}_t(S,"handleInteractionCapture");function _(L){h.current&&p.current.set(L.type,!1)}_t(_,"handleInteractionBubble");const w=_t(L=>{if(L.target&&!f.current){let R=function(){n.removeEventListener("click",m.current);const N=b();y(),N||Fm(jR,d,D,{discrete:!0})};if(_t(R,"handleAndDispatchPointerDownOutsideEvent"),!u(L.target)){n.removeEventListener("click",m.current),y(),f.current=!1;return}const D={originalEvent:L};h.current=!0,a.current=r&&L.button===0,p.current.clear(),!r||L.button!==0?R():(n.removeEventListener("click",m.current),m.current=R,n.addEventListener("click",m.current,{once:!0}))}else n.removeEventListener("click",m.current),y();f.current=!1},"handlePointerDown"),x=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const L of x)n.addEventListener(L,S,!0),n.addEventListener(L,_);const E=window.setTimeout(()=>{n.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(E),n.removeEventListener("pointerdown",w),n.removeEventListener("click",m.current);for(const L of x)n.removeEventListener(L,S,!0),n.removeEventListener(L,_)}},[n,d,r,a,s,u]),{onPointerDownCapture:_t(()=>f.current=!0,"onPointerDownCapture")}}_t(Sx,"usePointerDownOutside");function _x(e,t=globalThis?.document){const n=Js(e),r=O.useRef(!1);return O.useEffect(()=>{const a=_t(s=>{s.target&&!r.current&&Fm(VR,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:_t(()=>r.current=!0,"onFocusCapture"),onBlurCapture:_t(()=>r.current=!1,"onBlurCapture")}}_t(_x,"useFocusOutside");function Mp(){const e=new CustomEvent(Dp);document.dispatchEvent(e)}_t(Mp,"dispatchUpdate");function Fm(e,t,n,{discrete:r}){const a=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?yx(a,s):a.dispatchEvent(s)}_t(Fm,"handleAndDispatchCustomEvent");var On=globalThis?.document?O.useLayoutEffect:()=>{},$R=Object.defineProperty,qR=(e,t)=>$R(e,"name",{value:t,configurable:!0}),WR=Zs[" useId ".trim().toString()]||(()=>{}),YR=0;function Cx(e){const[t,n]=O.useState(WR());return On(()=>{e||n(r=>r??String(YR++))},[e]),e||(t?`radix-${t}`:"")}qR(Cx,"useId");const KR=["top","right","bottom","left"],_r=Math.min,Oi=Math.max,mc=Math.round,Tu=Math.floor,Di=e=>({x:e,y:e}),XR={left:"right",right:"left",bottom:"top",top:"bottom"};function xx(e,t,n){return Oi(e,_r(t,n))}function Ni(e,t){return typeof e=="function"?e(t):e}function Cr(e){return e.split("-")[0]}function xa(e){return e.split("-")[1]}function Gm(e){return e==="x"?"y":"x"}function $m(e){return e==="y"?"height":"width"}function Xn(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function qm(e){return Gm(Xn(e))}function QR(e,t,n){n===void 0&&(n=!1);const r=xa(e),a=qm(e),s=$m(a);let u=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(u=gc(u)),[u,gc(u)]}function ZR(e){const t=gc(e);return[Np(e),t,Np(t)]}function Np(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const sS=["left","right"],lS=["right","left"],JR=["top","bottom"],eO=["bottom","top"];function tO(e,t,n){switch(e){case"top":case"bottom":return n?t?lS:sS:t?sS:lS;case"left":case"right":return t?JR:eO;default:return[]}}function nO(e,t,n,r){const a=xa(e);let s=tO(Cr(e),n==="start",r);return a&&(s=s.map(u=>u+"-"+a),t&&(s=s.concat(s.map(Np)))),s}function gc(e){const t=Cr(e);return XR[t]+e.slice(t.length)}function iO(e){var t,n,r,a;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(a=e.left)!=null?a:0}}function Ex(e){return typeof e!="number"?iO(e):{top:e,right:e,bottom:e,left:e}}function vc(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function uS(e,t,n){let{reference:r,floating:a}=e;const s=Xn(t),u=qm(t),d=$m(u),f=Cr(t),h=s==="y",p=r.x+r.width/2-a.width/2,m=r.y+r.height/2-a.height/2,y=r[d]/2-a[d]/2;let b;switch(f){case"top":b={x:p,y:r.y-a.height};break;case"bottom":b={x:p,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:m};break;case"left":b={x:r.x-a.width,y:m};break;default:b={x:r.x,y:r.y}}const S=xa(t);return S&&(b[u]+=y*(S==="end"?1:-1)*(n&&h?-1:1)),b}async function rO(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:s,rects:u,elements:d,strategy:f}=e,{boundary:h="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:y=!1,padding:b=0}=Ni(t,e),S=Ex(b),w=d[y?m==="floating"?"reference":"floating":m],x=vc(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(d.floating)),boundary:h,rootBoundary:p,strategy:f})),E=m==="floating"?{x:r,y:a,width:u.floating.width,height:u.floating.height}:u.reference,L=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d.floating)),R=await(s.isElement==null?void 0:s.isElement(L))&&await(s.getScale==null?void 0:s.getScale(L))||{x:1,y:1},D=vc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:E,offsetParent:L,strategy:f}):E);return{top:(x.top-D.top+S.top)/R.y,bottom:(D.bottom-x.bottom+S.bottom)/R.y,left:(x.left-D.left+S.left)/R.x,right:(D.right-x.right+S.right)/R.x}}const oO=50,aO=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:s=[],platform:u}=n,d=u.detectOverflow?u:{...u,detectOverflow:rO},f=await(u.isRTL==null?void 0:u.isRTL(t));let h=await u.getElementRects({reference:e,floating:t,strategy:a}),{x:p,y:m}=uS(h,r,f),y=r,b=0;const S={};for(let _=0;_<s.length;_++){const w=s[_];if(!w)continue;const{name:x,fn:E}=w,{x:L,y:R,data:D,reset:N}=await E({x:p,y:m,initialPlacement:r,placement:y,strategy:a,middlewareData:S,rects:h,platform:d,elements:{reference:e,floating:t}});p=L??p,m=R??m,S[x]={...S[x],...D},N&&b<oO&&(b++,typeof N=="object"&&(N.placement&&(y=N.placement),N.rects&&(h=N.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:a}):N.rects),{x:p,y:m}=uS(h,y,f)),_=-1)}return{x:p,y:m,placement:y,strategy:a,middlewareData:S}},sO=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:s,platform:u,elements:d,middlewareData:f}=t,{element:h,padding:p=0}=Ni(e,t)||{};if(h==null)return{};const m=Ex(p),y={x:n,y:r},b=qm(a),S=$m(b),_=await u.getDimensions(h),w=b==="y",x=w?"top":"left",E=w?"bottom":"right",L=w?"clientHeight":"clientWidth",R=s.reference[S]+s.reference[b]-y[b]-s.floating[S],D=y[b]-s.reference[b],N=await(u.getOffsetParent==null?void 0:u.getOffsetParent(h));let H=N?N[L]:0;(!H||!await(u.isElement==null?void 0:u.isElement(N)))&&(H=d.floating[L]||s.floating[S]);const U=R/2-D/2,W=H/2-_[S]/2-1,ee=_r(m[x],W),te=_r(m[E],W),V=H-_[S]-te,Z=H/2-_[S]/2+U,ie=xx(ee,Z,V),se=!f.arrow&&xa(a)!=null&&Z!==ie&&s.reference[S]/2-(Z<ee?ee:te)-_[S]/2<0,I=se?Z<ee?Z-ee:Z-V:0;return{[b]:y[b]+I,data:{[b]:ie,centerOffset:Z-ie-I,...se&&{alignmentOffset:I}},reset:se}}}),lO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:s,rects:u,initialPlacement:d,platform:f,elements:h}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:y,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:_=!0,...w}=Ni(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=Cr(a),E=Xn(d),L=Cr(d)===d,R=await(f.isRTL==null?void 0:f.isRTL(h.floating)),D=y||(L||!_?[gc(d)]:ZR(d)),N=S!=="none";!y&&N&&D.push(...nO(d,_,S,R));const H=[d,...D],U=await f.detectOverflow(t,w),W=[];let ee=((r=s.flip)==null?void 0:r.overflows)||[];if(p&&W.push(U[x]),m){const ie=QR(a,u,R);W.push(U[ie[0]],U[ie[1]])}if(ee=[...ee,{placement:a,overflows:W}],!W.every(ie=>ie<=0)){var te,V;const ie=(((te=s.flip)==null?void 0:te.index)||0)+1,se=H[ie];if(se&&(!(m==="alignment"?E!==Xn(se):!1)||ee.every(X=>Xn(X.placement)===E?X.overflows[0]>0:!0)))return{data:{index:ie,overflows:ee},reset:{placement:se}};let I=(V=ee.filter(G=>G.overflows[0]<=0).sort((G,X)=>G.overflows[1]-X.overflows[1])[0])==null?void 0:V.placement;if(!I)switch(b){case"bestFit":{var Z;const G=(Z=ee.filter(X=>{if(N){const ue=Xn(X.placement);return ue===E||ue==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(ue=>ue>0).reduce((ue,Y)=>ue+Y,0)]).sort((X,ue)=>X[1]-ue[1])[0])==null?void 0:Z[0];G&&(I=G);break}case"initialPlacement":I=d;break}if(a!==I)return{reset:{placement:I}}}return{}}}};function cS(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function dS(e){return KR.some(t=>e[t]>=0)}const uO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...s}=Ni(e,t);switch(a){case"referenceHidden":{const u=await r.detectOverflow(t,{...s,elementContext:"reference"}),d=cS(u,n.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:dS(d)}}}case"escaped":{const u=await r.detectOverflow(t,{...s,altBoundary:!0}),d=cS(u,n.floating);return{data:{escapedOffsets:d,escaped:dS(d)}}}default:return{}}}}},wx=new Set(["left","top"]);async function cO(e,t){const{placement:n,platform:r,elements:a}=e,s=await(r.isRTL==null?void 0:r.isRTL(a.floating)),u=Cr(n),d=xa(n),f=Xn(n)==="y",h=wx.has(u)?-1:1,p=s&&f?-1:1,m=Ni(t,e);let{mainAxis:y,crossAxis:b,alignmentAxis:S}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return d&&typeof S=="number"&&(b=d==="end"?S*-1:S),f?{x:b*p,y:y*h}:{x:y*h,y:b*p}}const dO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:s,placement:u,middlewareData:d}=t,f=await cO(t,e);return u===((n=d.offset)==null?void 0:n.placement)&&(r=d.arrow)!=null&&r.alignmentOffset?{}:{x:a+f.x,y:s+f.y,data:{...f,placement:u}}}}},fO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:s}=t,{mainAxis:u=!0,crossAxis:d=!1,limiter:f={fn:E=>{let{x:L,y:R}=E;return{x:L,y:R}}},...h}=Ni(e,t),p={x:n,y:r},m=await s.detectOverflow(t,h),y=Xn(a),b=Gm(y);let S=p[b],_=p[y];const w=(E,L)=>xx(L+m[E==="y"?"top":"left"],L,L-m[E==="y"?"bottom":"right"]);u&&(S=w(b,S)),d&&(_=w(y,_));const x=f.fn({...t,[b]:S,[y]:_});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[b]:u,[y]:d}}}}}},hO=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:a,y:s,placement:u,rects:d,middlewareData:f}=t,{offset:h=0,mainAxis:p=!0,crossAxis:m=!0}=Ni(e,t),y={x:a,y:s},b=Xn(u),S=Gm(b);let _=y[S],w=y[b];const x=Ni(h,t),E=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:(n=x.mainAxis)!=null?n:0,crossAxis:(r=x.crossAxis)!=null?r:0};if(p){const D=S==="y"?"height":"width",N=d.reference[S]-d.floating[D]+E.mainAxis,H=d.reference[S]+d.reference[D]-E.mainAxis;_<N?_=N:_>H&&(_=H)}if(m){var L,R;const D=S==="y"?"width":"height",N=wx.has(Cr(u)),H=d.reference[b]-d.floating[D]+(N&&((L=f.offset)==null?void 0:L[b])||0)+(N?0:E.crossAxis),U=d.reference[b]+d.reference[D]+(N?0:((R=f.offset)==null?void 0:R[b])||0)-(N?E.crossAxis:0);w<H?w=H:w>U&&(w=U)}return{[S]:_,[b]:w}}}},pO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:a,elements:s}=t,{apply:u=()=>{},...d}=Ni(e,t),f=await a.detectOverflow(t,d),h=Cr(n),p=xa(n),m=Xn(n)==="y",{width:y,height:b}=r.floating;let S,_;h==="top"||h==="bottom"?(S=h,_=p===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(_=h,S=p==="end"?"top":"bottom");const w=b-f.top-f.bottom,x=y-f.left-f.right,E=_r(b-f[S],w),L=_r(y-f[_],x),R=t.middlewareData.shift,D=!R;let N=E,H=L;R!=null&&R.enabled.x&&(H=x),R!=null&&R.enabled.y&&(N=w),D&&!p&&(m?H=y-2*Oi(f.left,f.right):N=b-2*Oi(f.top,f.bottom)),await u({...t,availableWidth:H,availableHeight:N});const U=await a.getDimensions(s.floating);return y!==U.width||b!==U.height?{reset:{rects:!0}}:{}}}};function $c(){return typeof window<"u"}function Ea(e){return kx(e)?(e.nodeName||"").toLowerCase():"#document"}function qt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ui(e){var t;return(t=(kx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function kx(e){return $c()?e instanceof Node||e instanceof qt(e).Node:!1}function ti(e){return $c()?e instanceof Element||e instanceof qt(e).Element:!1}function Er(e){return $c()?e instanceof HTMLElement||e instanceof qt(e).HTMLElement:!1}function fS(e){return!$c()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof qt(e).ShadowRoot}function qc(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=ni(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&a!=="inline"&&a!=="contents"}function mO(e){return/^(table|td|th)$/.test(Ea(e))}function Wc(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const gO=/transform|translate|scale|rotate|perspective|filter/,vO=/paint|layout|strict|content/,$r=e=>!!e&&e!=="none";let zh;function Wm(e){const t=ti(e)?ni(e):e;return $r(t.transform)||$r(t.translate)||$r(t.scale)||$r(t.rotate)||$r(t.perspective)||!Ym()&&($r(t.backdropFilter)||$r(t.filter))||gO.test(t.willChange||"")||vO.test(t.contain||"")}function yO(e){let t=ao(e);for(;Er(t)&&!Us(t);){if(Wm(t))return t;if(Wc(t))return null;t=ao(t)}return null}function Ym(){return zh==null&&(zh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),zh}function Us(e){return/^(html|body|#document)$/.test(Ea(e))}function ni(e){return qt(e).getComputedStyle(e)}function Yc(e){return ti(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ao(e){if(Ea(e)==="html")return e;const t=e.assignedSlot||e.parentNode||fS(e)&&e.host||Ui(e);return fS(t)?t.host:t}function Lx(e){const t=ao(e);return Us(t)?(e.ownerDocument||e).body:Er(t)&&qc(t)?t:Lx(t)}function js(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=Lx(e),s=a===((r=e.ownerDocument)==null?void 0:r.body),u=qt(a);if(s){const d=Ip(u);return t.concat(u,u.visualViewport||[],qc(a)?a:[],d&&n?js(d):[])}else return t.concat(a,js(a,[],n))}function Ip(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Tx(e){const t=ni(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Er(e),s=a?e.offsetWidth:n,u=a?e.offsetHeight:r,d=mc(n)!==s||mc(r)!==u;return d&&(n=s,r=u),{width:n,height:r,$:d}}function Km(e){return ti(e)?e:e.contextElement}function ma(e){const t=Km(e);if(!Er(t))return Di(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:s}=Tx(t);let u=(s?mc(n.width):n.width)/r,d=(s?mc(n.height):n.height)/a;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const bO=Di(0);function Ax(e){const t=qt(e);return!Ym()||!t.visualViewport?bO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function SO(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===qt(e)}function so(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),s=Km(e);let u=Di(1);t&&(r?ti(r)&&(u=ma(r)):u=ma(e));const d=SO(s,n,r)?Ax(s):Di(0);let f=(a.left+d.x)/u.x,h=(a.top+d.y)/u.y,p=a.width/u.x,m=a.height/u.y;if(s&&r){const y=qt(s),b=ti(r)?qt(r):r;let S=y,_=Ip(S);for(;_&&b!==S;){const w=ma(_),x=_.getBoundingClientRect(),E=ni(_),L=x.left+(_.clientLeft+parseFloat(E.paddingLeft))*w.x,R=x.top+(_.clientTop+parseFloat(E.paddingTop))*w.y;f*=w.x,h*=w.y,p*=w.x,m*=w.y,f+=L,h+=R,S=qt(_),_=Ip(S)}}return vc({width:p,height:m,x:f,y:h})}function Kc(e,t){const n=Yc(e).scrollLeft;return t?t.left+n:so(Ui(e)).left+n}function Rx(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Kc(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function _O(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const s=a==="fixed",u=Ui(r),d=t?Wc(t.floating):!1;if(r===u||d&&s)return n;let f={scrollLeft:0,scrollTop:0},h=Di(1);const p=Di(0),m=Er(r);if((m||!s)&&((Ea(r)!=="body"||qc(u))&&(f=Yc(r)),m)){const b=so(r);h=ma(r),p.x=b.x+r.clientLeft,p.y=b.y+r.clientTop}const y=u&&!m&&!s?Rx(u,f):Di(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-f.scrollLeft*h.x+p.x+y.x,y:n.y*h.y-f.scrollTop*h.y+p.y+y.y}}function CO(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function xO(e){const t=Yc(e),n=e.ownerDocument.body,r=Oi(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=Oi(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+Kc(e);const u=-t.scrollTop;return ni(n).direction==="rtl"&&(s+=Oi(e.clientWidth,n.clientWidth)-r),{width:r,height:a,x:s,y:u}}const EO=25;function wO(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",a=qt(e),s=Ui(e),u=a.visualViewport;let d=s.clientWidth,f=s.clientHeight,h=0,p=0;if(u){const y=!Ym()||t==="fixed";r?y||(h=-u.offsetLeft,p=-u.offsetTop):(d=u.width,f=u.height,y&&(h=u.offsetLeft,p=u.offsetTop))}if(Kc(s)<=0){const y=s.ownerDocument,b=y.body,S=getComputedStyle(b),_=y.compatMode==="CSS1Compat"&&parseFloat(S.marginLeft)+parseFloat(S.marginRight)||0,w=Math.abs(s.clientWidth-b.clientWidth-_),x=getComputedStyle(s).scrollbarGutter==="stable both-edges"?w/2:w;x<=EO&&(d-=x)}return{width:d,height:f,x:h,y:p}}function kO(e,t){const n=so(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,s=ma(e),u=e.clientWidth*s.x,d=e.clientHeight*s.y,f=a*s.x,h=r*s.y;return{width:u,height:d,x:f,y:h}}function hS(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=wO(e,n,t);else if(t==="document")r=xO(Ui(e));else if(ti(t))r=kO(t,n);else{const a=Ax(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return vc(r)}function LO(e,t){const n=t.get(e);if(n)return n;let r=js(e,[],!1).filter(d=>ti(d)&&Ea(d)!=="body"),a=null;const s=ni(e).position==="fixed";let u=s?ao(e):e;for(;ti(u)&&!Us(u);){const d=ni(u),f=Wm(u),h=a?a.position:s?"fixed":"";!f&&(h==="fixed"||h==="absolute"&&d.position==="static")?r=r.filter(m=>m!==u):a=d,u=ao(u)}return t.set(e,r),r}function TO(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const u=[...n==="clippingAncestors"?Wc(t)?[]:LO(t,this._c):[].concat(n),r],d=hS(t,u[0],a);let f=d.top,h=d.right,p=d.bottom,m=d.left;for(let y=1;y<u.length;y++){const b=hS(t,u[y],a);f=Oi(b.top,f),h=_r(b.right,h),p=_r(b.bottom,p),m=Oi(b.left,m)}return{width:h-m,height:p-f,x:m,y:f}}function AO(e){const{width:t,height:n}=Tx(e);return{width:t,height:n}}function RO(e,t,n){const r=Er(t),a=Ui(t),s=n==="fixed",u=so(e,!0,s,t);let d={scrollLeft:0,scrollTop:0};const f=Di(0);if((r||!s)&&((Ea(t)!=="body"||qc(a))&&(d=Yc(t)),r)){const y=so(t,!0,s,t);f.x=y.x+t.clientLeft,f.y=y.y+t.clientTop}!r&&a&&(f.x=Kc(a));const h=a&&!r&&!s?Rx(a,d):Di(0),p=u.left+d.scrollLeft-f.x-h.x,m=u.top+d.scrollTop-f.y-h.y;return{x:p,y:m,width:u.width,height:u.height}}function Hh(e){return ni(e).position==="static"}function pS(e,t){if(!Er(e)||ni(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ui(e)===n&&(n=n.ownerDocument.body),n}function Ox(e,t){const n=qt(e);if(Wc(e))return n;if(!Er(e)){let a=ao(e);for(;a&&!Us(a);){if(ti(a)&&!Hh(a))return a;a=ao(a)}return n}let r=pS(e,t);for(;r&&mO(r)&&Hh(r);)r=pS(r,t);return r&&Us(r)&&Hh(r)&&!Wm(r)?n:r||yO(e)||n}const OO=async function(e){const t=this.getOffsetParent||Ox,n=this.getDimensions,r=await n(e.floating);return{reference:RO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function DO(e){return ni(e).direction==="rtl"}const MO={convertOffsetParentRelativeRectToViewportRelativeRect:_O,getDocumentElement:Ui,getClippingRect:TO,getOffsetParent:Ox,getElementRects:OO,getClientRects:CO,getDimensions:AO,getScale:ma,isElement:ti,isRTL:DO};function Dx(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function NO(e,t,n){let r=null,a;const s=Ui(e);function u(){var p;clearTimeout(a),(p=r)==null||p.disconnect(),r=null}function d(p,m){p===void 0&&(p=!1),m===void 0&&(m=1),u();const y=e.getBoundingClientRect(),{left:b,top:S,width:_,height:w}=y;if(p||t(),!_||!w)return;const x=Tu(S),E=Tu(s.clientWidth-(b+_)),L=Tu(s.clientHeight-(S+w)),R=Tu(b),N={rootMargin:-x+"px "+-E+"px "+-L+"px "+-R+"px",threshold:Oi(0,_r(1,m))||1};let H=!0;function U(W){const ee=W[0].intersectionRatio;if(!Dx(y,e.getBoundingClientRect()))return d();if(ee!==m){if(!H)return d();ee?d(!1,ee):a=setTimeout(()=>{d(!1,1e-7)},1e3)}H=!1}try{r=new IntersectionObserver(U,{...N,root:s.ownerDocument})}catch{r=new IntersectionObserver(U,N)}r.observe(e)}const f=qt(e),h=()=>d(n);return f.addEventListener("resize",h),d(!0),()=>{f.removeEventListener("resize",h),u()}}function IO(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,h=Km(e),p=a||s?[...h?js(h):[],...t?js(t):[]]:[];p.forEach(x=>{a&&x.addEventListener("scroll",n),s&&x.addEventListener("resize",n)});const m=h&&d?NO(h,n,s):null;let y=-1,b=null;u&&(b=new ResizeObserver(x=>{let[E]=x;E&&E.target===h&&b&&t&&(b.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var L;(L=b)==null||L.observe(t)})),n()}),h&&!f&&b.observe(h),t&&b.observe(t));let S,_=f?so(e):null;f&&w();function w(){const x=so(e);_&&!Dx(_,x)&&n(),_=x,S=requestAnimationFrame(w)}return n(),()=>{var x;p.forEach(E=>{a&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),m?.(),(x=b)==null||x.disconnect(),b=null,f&&cancelAnimationFrame(S)}}const zO=dO,HO=fO,PO=lO,UO=pO,jO=uO,mS=sO,VO=hO,BO=(e,t,n)=>{const r=new Map,a=n??{},s={...MO,...a.platform,_c:r};return aO(e,t,{...a,platform:s})};var FO=typeof document<"u",GO=function(){},ic=FO?O.useLayoutEffect:GO;function yc(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,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!yc(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const s=a[r];if(!(s==="_owner"&&e.$$typeof)&&!yc(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Mx(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gS(e,t){const n=Mx(e);return Math.round(t*n)/n}function Ph(e){const t=O.useRef(e);return ic(()=>{t.current=e}),t}function $O(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:s,floating:u}={},transform:d=!0,whileElementsMounted:f,open:h}=e,[p,m]=O.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,b]=O.useState(r);yc(y,r)||b(r);const[S,_]=O.useState(null),[w,x]=O.useState(null),E=O.useCallback(X=>{X!==N.current&&(N.current=X,_(X))},[]),L=O.useCallback(X=>{X!==H.current&&(H.current=X,x(X))},[]),R=s||S,D=u||w,N=O.useRef(null),H=O.useRef(null),U=O.useRef(p),W=f!=null,ee=Ph(f),te=Ph(a),V=Ph(h),Z=O.useCallback(()=>{if(!N.current||!H.current)return;const X={placement:t,strategy:n,middleware:y};te.current&&(X.platform=te.current),BO(N.current,H.current,X).then(ue=>{const Y={...ue,isPositioned:V.current!==!1};ie.current&&!yc(U.current,Y)&&(U.current=Y,Gc.flushSync(()=>{m(Y)}))})},[y,t,n,te,V]);ic(()=>{h===!1&&U.current.isPositioned&&(U.current.isPositioned=!1,m(X=>({...X,isPositioned:!1})))},[h]);const ie=O.useRef(!1);ic(()=>(ie.current=!0,()=>{ie.current=!1}),[]),ic(()=>{if(R&&(N.current=R),D&&(H.current=D),R&&D){if(ee.current)return ee.current(R,D,Z);Z()}},[R,D,Z,ee,W]);const se=O.useMemo(()=>({reference:N,floating:H,setReference:E,setFloating:L}),[E,L]),I=O.useMemo(()=>({reference:R,floating:D}),[R,D]),G=O.useMemo(()=>{const X={position:n,left:0,top:0};if(!I.floating)return X;const ue=gS(I.floating,p.x),Y=gS(I.floating,p.y);return d?{...X,transform:"translate("+ue+"px, "+Y+"px)",...Mx(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ue,top:Y}},[n,d,I.floating,p.x,p.y]);return O.useMemo(()=>({...p,update:Z,refs:se,elements:I,floatingStyles:G}),[p,Z,se,I,G])}const qO=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?mS({element:r.current,padding:a}).fn(n):{}:r?mS({element:r,padding:a}).fn(n):{}}}},WO=(e,t)=>{const n=zO(e);return{name:n.name,fn:n.fn,options:[e,t]}},YO=(e,t)=>{const n=HO(e);return{name:n.name,fn:n.fn,options:[e,t]}},KO=(e,t)=>({fn:VO(e).fn,options:[e,t]}),XO=(e,t)=>{const n=PO(e);return{name:n.name,fn:n.fn,options:[e,t]}},QO=(e,t)=>{const n=UO(e);return{name:n.name,fn:n.fn,options:[e,t]}},ZO=(e,t)=>{const n=jO(e);return{name:n.name,fn:n.fn,options:[e,t]}},JO=(e,t)=>{const n=qO(e);return{name:n.name,fn:n.fn,options:[e,t]}};var eD=Object.defineProperty,tD=(e,t)=>eD(e,"name",{value:t,configurable:!0});function Nx(e){const[t,n]=O.useState(void 0);return On(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const s=a[0];let u,d;if("borderBoxSize"in s){const f=s.borderBoxSize,h=Array.isArray(f)?f[0]:f;u=h.inlineSize,d=h.blockSize}else u=e.offsetWidth,d=e.offsetHeight;n({width:u,height:d})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}tD(Nx,"useSize");var nD=Object.defineProperty,br=(e,t)=>nD(e,"name",{value:t,configurable:!0}),Ix="Popper",[zx,Hx]=Bm(Ix),[iD,Px]=zx(Ix),rD=br(e=>{const{__scopePopper:t,children:n}=e,[r,a]=O.useState(null),[s,u]=O.useState(void 0);return A.jsx(iD,{scope:t,anchor:r,onAnchorChange:a,placementState:s,setPlacementState:u,children:n})},"Popper"),oD="PopperAnchor",aD=O.forwardRef(br(function(t,n){const{__scopePopper:r,virtualRef:a,...s}=t,u=Px(oD,r),d=O.useRef(null),f=u.onAnchorChange,h=O.useCallback(_=>{d.current=_,_&&f(_)},[f]),p=mo(n,h),m=O.useRef(null);O.useEffect(()=>{if(!a)return;const _=m.current;m.current=a.current,_!==m.current&&f(m.current)});const y=u.placementState&&Xc(u.placementState),b=y?.[0],S=y?.[1];return a?null:A.jsx(vo.div,{"data-radix-popper-side":b,"data-radix-popper-align":S,...s,ref:p})},"PopperAnchor")),Ux="PopperContent",[sD,V3]=zx(Ux),lD=O.forwardRef(br(function(t,n){const{__scopePopper:r,side:a="bottom",sideOffset:s=0,align:u="center",alignOffset:d=0,arrowPadding:f=0,avoidCollisions:h=!0,collisionBoundary:p=[],collisionPadding:m=0,sticky:y="partial",hideWhenDetached:b=!1,updatePositionStrategy:S="optimized",onPlaced:_,...w}=t,x=Px(Ux,r),[E,L]=O.useState(null),R=mo(n,L),[D,N]=O.useState(null),H=Nx(D),U=H?.width??0,W=H?.height??0,ee=a+(u!=="center"?"-"+u:""),te=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},V=Array.isArray(p)?p:[p],Z=V.length>0,ie={padding:te,boundary:V.filter(jx),altBoundary:Z},{refs:se,floatingStyles:I,placement:G,isPositioned:X,middlewareData:ue}=$O({strategy:"fixed",placement:ee,whileElementsMounted:br((...fe)=>IO(...fe,{animationFrame:S==="always"}),"whileElementsMounted"),elements:{reference:x.anchor},middleware:[WO({mainAxis:s+W,alignmentAxis:d}),h&&YO({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?KO():void 0,...ie}),h&&XO({...ie}),QO({...ie,apply:br(({elements:fe,rects:Fe,availableWidth:Ge,availableHeight:Ze})=>{const{width:Ne,height:ze}=Fe.reference,Je=fe.floating.style;Je.setProperty("--radix-popper-available-width",`${Ge}px`),Je.setProperty("--radix-popper-available-height",`${Ze}px`),Je.setProperty("--radix-popper-anchor-width",`${Ne}px`),Je.setProperty("--radix-popper-anchor-height",`${ze}px`)},"apply")}),D&&JO({element:D,padding:f}),uD({arrowWidth:U,arrowHeight:W}),b&&ZO({strategy:"referenceHidden",...ie,boundary:Z?ie.boundary:void 0})]}),Y=x.setPlacementState;On(()=>(Y(G),()=>{Y(void 0)}),[G,Y]);const[M,q]=Xc(G),oe=Js(_);On(()=>{X&&oe?.()},[X,oe]);const le=ue.arrow?.x,de=ue.arrow?.y,re=ue.arrow?.centerOffset!==0,[ce,ke]=O.useState();return On(()=>{E&&ke(window.getComputedStyle(E).zIndex)},[E]),A.jsx("div",{ref:se.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:X?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[ue.transformOrigin?.x,ue.transformOrigin?.y].join(" "),...ue.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:A.jsx(sD,{scope:r,placedSide:M,placedAlign:q,onArrowChange:N,arrowX:le,arrowY:de,shouldHideArrow:re,children:A.jsx(vo.div,{"data-side":M,"data-align":q,...w,ref:R,style:{...w.style,animation:X?w.style?.animation:"none"}})})})},"PopperContent"));function jx(e){return e!==null}br(jx,"isNotNull");var uD=br(e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:a}=t,u=a.arrow?.centerOffset!==0,d=u?0:e.arrowWidth,f=u?0:e.arrowHeight,[h,p]=Xc(n),m={start:"0%",center:"50%",end:"100%"}[p],y=(a.arrow?.x??0)+d/2,b=(a.arrow?.y??0)+f/2;let S="",_="";return h==="bottom"?(S=u?m:`${y}px`,_=`${-f}px`):h==="top"?(S=u?m:`${y}px`,_=`${r.floating.height+f}px`):h==="right"?(S=`${-f}px`,_=u?m:`${b}px`):h==="left"&&(S=`${r.floating.width+f}px`,_=u?m:`${b}px`),{data:{x:S,y:_}}}}),"transformOrigin");function Xc(e){const[t,n="center"]=e.split("-");return[t,n]}br(Xc,"getSideAndAlignFromPlacement");var cD=rD,dD=aD,fD=lD,hD=Object.defineProperty,pD=(e,t)=>hD(e,"name",{value:t,configurable:!0}),mD=O.forwardRef(pD(function(t,n){const{container:r,...a}=t,[s,u]=O.useState(!1);On(()=>u(!0),[]);const d=r||s&&globalThis?.document?.body;return d?Gc.createPortal(A.jsx(vo.div,{...a,ref:n}),d):null},"Portal")),gD=Object.defineProperty,Ii=(e,t)=>gD(e,"name",{value:t,configurable:!0});function Vx(e,t){return O.useReducer((n,r)=>t[n][r]??n,e)}Ii(Vx,"useStateMachine");var Bx=Ii(e=>{const{present:t,children:n}=e,r=Fx(t),a=typeof n=="function"?n({present:r.isPresent}):O.Children.only(n),s=Gx(r.ref,$x(a));return typeof n=="function"||r.isPresent?O.cloneElement(a,{ref:s}):null},"Presence");function Fx(e){const[t,n]=O.useState(),r=O.useRef(null),a=O.useRef(e),s=O.useRef("none"),u=O.useRef(void 0),d=e?"mounted":"unmounted",[f,h]=Vx(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return O.useEffect(()=>{f==="mounted"?(s.current=u.current??sa(r.current),u.current=void 0):s.current="none"},[f]),On(()=>{const p=r.current,m=a.current;if(m!==e){const b=s.current,S=sa(p);e?(u.current=S,h("MOUNT")):S==="none"||p?.display==="none"?h("UNMOUNT"):h(m&&b!==S?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,h]),On(()=>{if(t){let p;const m=t.ownerDocument.defaultView??window,y=Ii(S=>{const w=sa(r.current).includes(CSS.escape(S.animationName));if(S.target===t&&w&&(h("ANIMATION_END"),!a.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",p=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},"handleAnimationEnd"),b=Ii(S=>{S.target===t&&(s.current=sa(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{m.clearTimeout(p),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:O.useCallback(p=>{if(p){const m=getComputedStyle(p);r.current=m,u.current=sa(m)}else r.current=null;n(p)},[])}}Ii(Fx,"usePresence");function zp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Ii(zp,"setRef");function Gx(...e){const t=O.useRef(e);return t.current=e,O.useCallback(n=>{const r=t.current;let a=!1;const s=r.map(u=>{const d=zp(u,n);return!a&&typeof d=="function"&&(a=!0),d});if(a)return()=>{for(let u=0;u<s.length;u++){const d=s[u];typeof d=="function"?d():zp(r[u],null)}}},[])}Ii(Gx,"useStableComposedRefs");function sa(e){return e?.animationName||"none"}Ii(sa,"getAnimationName");function $x(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)}Ii($x,"getElementRef");var vD=Object.defineProperty,yD=(e,t)=>vD(e,"name",{value:t,configurable:!0}),vS=Zs[" useEffectEvent ".trim().toString()],yS=Zs[" useInsertionEffect ".trim().toString()];function qx(e){if(typeof vS=="function")return vS(e);const t=O.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof yS=="function"?yS(()=>{t.current=e}):On(()=>{t.current=e}),O.useMemo(()=>((...n)=>t.current?.(...n)),[])}yD(qx,"useEffectEvent");var bD=Object.defineProperty,el=(e,t)=>bD(e,"name",{value:t,configurable:!0}),SD=Zs[" useInsertionEffect ".trim().toString()]||On;function Wx({prop:e,defaultProp:t,onChange:n=el(()=>{},"onChange"),caller:r}){const[a,s,u]=Yx({defaultProp:t,onChange:n}),d=e!==void 0,f=d?e:a,h=O.useCallback(p=>{if(d){const m=Kx(p)?p(e):p;m!==e&&u.current?.(m)}else s(p)},[d,e,s,u]);return[f,h]}el(Wx,"useControllableState");function Yx({defaultProp:e,onChange:t}){const[n,r]=O.useState(e),a=O.useRef(n),s=O.useRef(t);return SD(()=>{s.current=t},[t]),O.useEffect(()=>{a.current!==n&&(s.current?.(n),a.current=n)},[n,a]),[n,r,s]}el(Yx,"useUncontrolledState");function Kx(e){return typeof e=="function"}el(Kx,"isFunction");var bS=Symbol("RADIX:SYNC_STATE");function _D(e,t,n,r){const{prop:a,defaultProp:s,onChange:u,caller:d}=t,f=a!==void 0,h=qx(u),p=[{...n,state:s}];r&&p.push(r);const[m,y]=O.useReducer((w,x)=>{if(x.type===bS)return{...w,state:x.state};const E=e(w,x);return f&&!Object.is(E.state,w.state)&&h(E.state),E},...p),b=m.state,S=O.useRef(b);O.useEffect(()=>{S.current!==b&&(S.current=b,f||h(b))},[b,S,f]);const _=O.useMemo(()=>a!==void 0?{...m,state:a}:m,[m,a]);return O.useEffect(()=>{f&&!Object.is(a,m.state)&&y({type:bS,state:a})},[a,m.state,f]),[_,y]}el(_D,"useControllableStateReducer");var CD=Object.defineProperty,xD=(e,t)=>CD(e,"name",{value:t,configurable:!0}),ED=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"}),wD=O.forwardRef(xD(function(t,n){return A.jsx(vo.span,{...t,ref:n,style:{...ED,...t.style}})},"VisuallyHidden")),kD=wD,LD=Object.defineProperty,xt=(e,t)=>LD(e,"name",{value:t,configurable:!0}),[Xm,B3]=Bm("Tooltip",[Hx]),Qm=Hx(),TD="TooltipProvider",AD=700,Hp="tooltip.open",[RD,Zm]=Xm(TD),OD=xt(e=>{const{__scopeTooltip:t,delayDuration:n=AD,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:s}=e,u=O.useRef(!0),d=O.useRef(!1),f=O.useRef(0);return O.useEffect(()=>{const h=f.current;return()=>window.clearTimeout(h)},[]),A.jsx(RD,{scope:t,isOpenDelayedRef:u,delayDuration:n,onOpen:O.useCallback(()=>{r<=0||(window.clearTimeout(f.current),u.current=!1)},[r]),onClose:O.useCallback(()=>{r<=0||(window.clearTimeout(f.current),f.current=window.setTimeout(()=>u.current=!0,r))},[r]),isPointerInTransitRef:d,onPointerInTransitChange:O.useCallback(h=>{d.current=h},[]),disableHoverableContent:a,children:s})},"TooltipProvider"),Pp="Tooltip",[DD,tl]=Xm(Pp),MD=xt(e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:s,disableHoverableContent:u,delayDuration:d}=e,f=Zm(Pp,e.__scopeTooltip),h=Qm(t),[p,m]=O.useState(null),[y,b]=O.useState(void 0),S=Cx(),_=O.useRef(0),w=u??f.disableHoverableContent,x=d??f.delayDuration,E=O.useRef(!1),[L,R]=Wx({prop:r,defaultProp:a??!1,onChange:xt(ee=>{ee?(f.onOpen(),document.dispatchEvent(new CustomEvent(Hp))):f.onClose(),s?.(ee)},"onChange"),caller:Pp}),D=O.useMemo(()=>L?E.current?"delayed-open":"instant-open":"closed",[L]),N=O.useCallback(()=>{window.clearTimeout(_.current),_.current=0,E.current=!1,R(!0)},[R]),H=O.useCallback(()=>{window.clearTimeout(_.current),_.current=0,R(!1)},[R]),U=O.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{E.current=!0,R(!0),_.current=0},x)},[x,R]);O.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]);const W=y??S;return A.jsx(cD,{...h,children:A.jsx(DD,{scope:t,contentId:W,setContentId:b,open:L,stateAttribute:D,trigger:p,onTriggerChange:m,onTriggerEnter:O.useCallback(()=>{f.isOpenDelayedRef.current?U():N()},[f.isOpenDelayedRef,U,N]),onTriggerLeave:O.useCallback(()=>{w?H():(window.clearTimeout(_.current),_.current=0)},[H,w]),onOpen:N,onClose:H,disableHoverableContent:w,children:n})})},"Tooltip"),SS="TooltipTrigger",ND=O.forwardRef(xt(function(t,n){const{__scopeTooltip:r,...a}=t,s=tl(SS,r),u=Zm(SS,r),d=Qm(r),f=O.useRef(null),h=mo(n,f,s.onTriggerChange),p=O.useRef(!1),m=O.useRef(!1),y=O.useCallback(()=>p.current=!1,[]);return O.useEffect(()=>()=>document.removeEventListener("pointerup",y),[y]),A.jsx(dD,{asChild:!0,...d,children:A.jsx(vo.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...a,ref:h,onPointerMove:$n(t.onPointerMove,b=>{b.pointerType!=="touch"&&!m.current&&!u.isPointerInTransitRef.current&&(s.onTriggerEnter(),m.current=!0)}),onPointerLeave:$n(t.onPointerLeave,()=>{s.onTriggerLeave(),m.current=!1}),onPointerDown:$n(t.onPointerDown,()=>{s.open&&s.onClose(),p.current=!0,document.addEventListener("pointerup",y,{once:!0})}),onFocus:$n(t.onFocus,()=>{p.current||s.onOpen()}),onBlur:$n(t.onBlur,s.onClose),onClick:$n(t.onClick,s.onClose)})})},"TooltipTrigger")),Xx="TooltipPortal",[ID,zD]=Xm(Xx,{forceMount:void 0}),HD=xt(e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:a}=e,s=tl(Xx,t);return A.jsx(ID,{scope:t,forceMount:n,children:A.jsx(Bx,{present:n||s.open,children:A.jsx(mD,{asChild:!0,container:a,children:r})})})},"TooltipPortal"),Vs="TooltipContent",PD=O.forwardRef(xt(function(t,n){const r=zD(Vs,t.__scopeTooltip),{forceMount:a=r.forceMount,side:s="top",...u}=t,d=tl(Vs,t.__scopeTooltip);return A.jsx(Bx,{present:a||d.open,children:d.disableHoverableContent?A.jsx(Qx,{side:s,...u,ref:n}):A.jsx(UD,{side:s,...u,ref:n})})},"TooltipContent")),UD=O.forwardRef(xt(function(t,n){const r=tl(Vs,t.__scopeTooltip),a=Zm(Vs,t.__scopeTooltip),s=O.useRef(null),u=mo(n,s),[d,f]=O.useState(null),{trigger:h,onClose:p}=r,m=s.current,{onPointerInTransitChange:y}=a,b=O.useCallback(()=>{f(null),y(!1)},[y]),S=O.useCallback((_,w)=>{const x=_.currentTarget,E={x:_.clientX,y:_.clientY},L=Zx(E,x.getBoundingClientRect()),R=Jx(E,L),D=eE(w.getBoundingClientRect()),N=nE([...R,...D]);f(N),y(!0)},[y]);return O.useEffect(()=>()=>b(),[b]),O.useEffect(()=>{if(h&&m){const _=xt(x=>S(x,m),"handleTriggerLeave"),w=xt(x=>S(x,h),"handleContentLeave");return h.addEventListener("pointerleave",_),m.addEventListener("pointerleave",w),()=>{h.removeEventListener("pointerleave",_),m.removeEventListener("pointerleave",w)}}},[h,m,S,b]),O.useEffect(()=>{if(d){const _=xt(w=>{const x=w.target,E={x:w.clientX,y:w.clientY},L=h?.contains(x)||m?.contains(x),R=!tE(E,d);L?b():R&&(b(),p())},"handleTrackPointerGrace");return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[h,m,d,p,b]),A.jsx(Qx,{...t,ref:u})},"TooltipContentHoverable")),jD=qC("TooltipContent"),Qx=O.forwardRef(xt(function(t,n){const{__scopeTooltip:r,children:a,"aria-label":s,id:u,onEscapeKeyDown:d,onPointerDownOutside:f,...h}=t,p=tl(Vs,r),m=Qm(r),{onClose:y}=p;O.useEffect(()=>(document.addEventListener(Hp,y),()=>document.removeEventListener(Hp,y)),[y]),O.useEffect(()=>{if(p.trigger){const S=xt(_=>{_.target instanceof Node&&_.target.contains(p.trigger)&&y()},"handleScroll");return window.addEventListener("scroll",S,{capture:!0}),()=>window.removeEventListener("scroll",S,{capture:!0})}},[p.trigger,y]);const{setContentId:b}=p;return On(()=>(b(u),()=>{b(void 0)}),[u,b]),A.jsx(BR,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:S=>S.preventDefault(),onDismiss:y,children:A.jsxs(fD,{"data-state":p.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:p.contentId,...m,...h,ref:n,style:{...h.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:[A.jsx(jD,{children:a}),s?A.jsx(kD,{id:p.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function Zx(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,a,s)){case s:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}xt(Zx,"getExitSideFromRect");function Jx(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}xt(Jx,"getPaddedExitPoints");function eE(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}xt(eE,"getPointsFromRect");function tE(e,t){const{x:n,y:r}=e;let a=!1;for(let s=0,u=t.length-1;s<t.length;u=s++){const d=t[s],f=t[u],h=d.x,p=d.y,m=f.x,y=f.y;p>r!=y>r&&n<(m-h)*(r-p)/(y-p)+h&&(a=!a)}return a}xt(tE,"isPointInPolygon");function nE(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),iE(t)}xt(nE,"getHull");function iE(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const s=t[t.length-1],u=t[t.length-2];if((s.x-u.x)*(a.y-u.y)>=(s.y-u.y)*(a.x-u.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const s=n[n.length-1],u=n[n.length-2];if((s.x-u.x)*(a.y-u.y)>=(s.y-u.y)*(a.x-u.x))n.pop();else break}n.push(a)}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)}xt(iE,"getHullPresorted");var VD=OD,BD=MD,FD=ND,GD=HD,$D=PD;function qD({delayDuration:e=400,...t}){return A.jsx(VD,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Qn({...e}){return A.jsx(BD,{"data-slot":"tooltip",...e})}function Zn({...e}){return A.jsx(FD,{"data-slot":"tooltip-trigger",...e})}function Jn({className:e,sideOffset:t=6,children:n,...r}){return A.jsx(GD,{children:A.jsx($D,{"data-slot":"tooltip-content",sideOffset:t,className:Qe("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),...r,children:n})})}const rE="comprehende.theme",Jm={dark:"github-dark",light:"github-light"};function WD(e){return e==="light"||e==="dark"||e==="system"?e:"system"}function YD(e,t){return e==="system"?t?"dark":"light":e}function KD(e){document.documentElement.classList.toggle("dark",e==="dark"),document.documentElement.style.colorScheme=e}function XD(){try{return WD(localStorage.getItem(rE))}catch{return"system"}}function QD(e){try{localStorage.setItem(rE,e)}catch{}}function ZD(){return window.matchMedia("(prefers-color-scheme: dark)").matches}const oE=O.createContext(null);function JD(e){const[t,n]=O.useState(XD),[r,a]=O.useState(ZD),s=YD(t,r),u=O.useCallback(h=>{QD(h),n(h)},[]),d=O.useCallback(()=>{u(s==="dark"?"light":"dark")},[s,u]);O.useEffect(()=>{KD(s)},[s]),O.useEffect(()=>{const h=window.matchMedia("(prefers-color-scheme: dark)"),p=()=>a(h.matches);return h.addEventListener("change",p),()=>h.removeEventListener("change",p)},[]);const f=O.useMemo(()=>({preference:t,resolved:s,setPreference:u,toggleTheme:d}),[t,s,u,d]);return A.jsx(oE.Provider,{value:f,children:e.children})}function eg(){const e=O.useContext(oE);if(e===null)throw new Error("useTheme must be used within ThemeProvider");return e}function rc(e){return A.jsx("kbd",{className:"font-mono text-[10px] font-normal text-muted-foreground",children:e.children})}function eM(e,t){const[n,r]=O.useState(t<=0?t:0);return O.useEffect(()=>{if(t<=0){r(0);return}r(0);const a=window.setTimeout(()=>r(t),t);return()=>window.clearTimeout(a)},[e,t]),OA(e,n,t)}function Qc(e){const t=e.layout??"well",n=e.delayMs??(t==="page"?0:BC);if(!eM(!0,n))return null;const a=t==="inline"?"span":"div",s=t==="inline";return A.jsxs(a,{className:Qe("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:[A.jsxs("span",{className:Qe("flex shrink-0 gap-[0.28rem]",s?"h-[1.1rem]":"h-7"),"aria-hidden":!0,children:[A.jsx(_S,{kind:"del",inline:s}),A.jsx(_S,{kind:"add",inline:s})]}),s?A.jsx("span",{className:"sr-only",children:e.label}):A.jsx("p",{className:"m-0 font-mono text-[11px] tracking-wide text-muted-foreground",children:e.label})]})}function _S(e){return A.jsx("span",{className:Qe("relative h-full overflow-hidden rounded-[1px]",e.inline?"w-0.5":"w-[3px]",e.kind==="del"?"bg-del/38":"bg-add/38"),children:A.jsx("span",{className:Qe("wait-gutter-walker absolute inset-x-0 top-[28%] h-[44%] rounded-[inherit]",e.kind==="del"?"bg-del":"bg-add")})})}function tM(e){const{meta:t,wrap:n,split:r,onWrap:a,onUnified:s,onSplit:u,onRefresh:d,busy:f=!1}=e;return A.jsxs("header",{className:"flex items-center gap-6 border-b border-border px-5 py-3",children:[A.jsx("span",{className:"font-serif text-lg leading-none text-foreground",children:"Comprehende"}),A.jsxs("div",{className:"flex min-w-0 flex-1 items-baseline gap-2 text-sm",title:`${t.resolved.baseSha} ... ${t.resolved.headSha}`,children:[A.jsx("code",{className:"text-primary",children:t.resolved.baseRef}),A.jsx("span",{className:"text-muted-foreground",children:"..."}),A.jsx("code",{className:"text-primary",children:t.resolved.headRef}),A.jsxs("span",{className:"font-mono text-[11px] text-muted-foreground",children:[Xb(t.resolved.baseSha)," → ",Xb(t.resolved.headSha)]})]}),A.jsx(iM,{meta:t}),A.jsxs("div",{className:"flex items-center gap-2",children:[A.jsxs(Qn,{children:[A.jsx(Zn,{asChild:!0,children:A.jsxs(Dt,{size:"sm",variant:n?"secondary":"outline","aria-pressed":n,"aria-label":"Wrap lines",onClick:a,children:["Wrap",A.jsx(rc,{children:"w"})]})}),A.jsx(Jn,{children:"Wrap long lines"})]}),A.jsxs("div",{className:"flex items-center gap-1.5",children:[A.jsxs("div",{className:"flex overflow-hidden rounded-md border border-input",children:[A.jsxs(Qn,{children:[A.jsx(Zn,{asChild:!0,children:A.jsx(Dt,{size:"sm",variant:r?"ghost":"secondary",className:"rounded-none border-0",onClick:s,"aria-pressed":!r,children:"Unified"})}),A.jsx(Jn,{children:"Unified diff"})]}),A.jsxs(Qn,{children:[A.jsx(Zn,{asChild:!0,children:A.jsx(Dt,{size:"sm",variant:r?"secondary":"ghost",className:"rounded-none border-0",onClick:u,"aria-pressed":r,children:"Split"})}),A.jsx(Jn,{children:"Side-by-side diff"})]})]}),A.jsx(rc,{children:"s"})]}),A.jsx(nM,{}),f?A.jsx(Qc,{layout:"inline",label:_a.review}):null,A.jsxs(Qn,{children:[A.jsx(Zn,{asChild:!0,children:A.jsxs(Dt,{size:"sm",variant:"outline",onClick:d,"aria-busy":f,children:["Refresh",A.jsx(rc,{children:"r"})]})}),A.jsx(Jn,{children:f?_a.review:"Reload review"})]})]})]})}function nM(){const{resolved:e,toggleTheme:t}=eg(),n=e==="dark"?"light":"dark";return A.jsxs(Qn,{children:[A.jsx(Zn,{asChild:!0,children:A.jsx(Dt,{size:"icon-sm",variant:"outline","aria-label":`Use ${n} theme`,onClick:t,children:e==="dark"?A.jsx(RA,{}):A.jsx(TA,{})})}),A.jsxs(Jn,{children:["Use ",n," theme"]})]})}function iM(e){const{meta:t}=e,n=t.coverage.unassignedCount>0||t.coverage.staleCount>0,r=[`${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].filter(a=>a!==null).join(" · ");return A.jsxs(Qn,{children:[A.jsx(Zn,{asChild:!0,children:A.jsxs("span",{className:Qe("font-mono text-xs tabular-nums",n?"text-warn":"text-muted-foreground"),children:[t.coverage.assignedHunks,"/",t.coverage.totalHunks]})}),A.jsx(Jn,{children:r})]})}const rM=["png","jpg","jpeg","gif","webp","bmp","avif","ico"],oM=new Set(rM);function aM(e){const t=e.split("/").pop()??e,n=t.lastIndexOf(".");if(n<=0)return;const r=t.slice(n+1).toLowerCase();return oM.has(r)?r:void 0}function sM(e){return aM(e)!==void 0}function lM(e){const t=[];for(const n of e){const r=t[t.length-1];if(r!==void 0&&r.sha===n.sha&&r.author===n.author){r.lines+=1;continue}t.push({lineNumber:n.line,sha:n.sha,author:n.author,timestamp:n.timestamp,lines:1})}return t}const tg="diffs-container";(()=>{try{return!1}catch{return!1}})();const uM=/(?=^From [a-f0-9]+ .+$)/m,aE=/(?=^diff --git)/gm,cM=new RegExp("(?<=\\n)"),dM=/^(---|\+\+\+)\s+([^\t\r\n]+)/,fM=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,hM=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,pM=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,ng="header-prefix",ig="header-filename-suffix",rg="header-metadata",nl="header-custom",ot={dark:"pierre-dark",light:"pierre-light"},mM="data-theme-css",gM="data-unsafe-css",vM="data-diffs-scrollbar-measure",sE="--diffs-scrollbar-gutter-measured",yM=1e5,og={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...og});const bM=Object.freeze({fromStart:0,fromEnd:0}),bc={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},lE={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},ga=new Set;let va=null;function uE(e){ga.add(e),va??=requestAnimationFrame(cE)}function Up(e){ga.delete(e)&&ga.size===0&&va!=null&&(cancelAnimationFrame(va),va=null)}function cE(e){const t=new Set(ga);ga.clear();for(const n of t)try{n(e)}catch(r){console.error(r)}ga.size>0?va=requestAnimationFrame(cE):va=null}function Sc(e,t,n){if(e===t||e==null||t==null)return e===t;const r=new Set(n),a=Object.keys(e),s=new Set(Object.keys(t));for(const u of a)if(s.delete(u),!r.has(u)&&(!(u in t)||e[u]!==t[u]))return!1;for(const u of Array.from(s))if(!r.has(u))return!1;return!0}function wa(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function Zc(e,t){const n=e?.theme??ot,r=t?.theme??ot,a=CS(e),s=CS(t);return wa(n,r)&&Sc(e,t,["theme","parseDiffOptions"])&&Sc(a,s)}function CS(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function jp(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function zi(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}const SM=new TextEncoder,_M=new TextDecoder("utf-8",{ignoreBOM:!0}),CM=/[\uD800-\uDFFF]/,Vp=1024;let da=new Uint8Array(Vp);function dE(){da.length!==Vp&&(da=new Uint8Array(Vp))}function ht(e){if(e.length===0)return e;if(CM.test(e))return JSON.parse(JSON.stringify(e));const t=e.length*3;da.length<t&&(da=new Uint8Array(t));const{written:n}=SM.encodeInto(e,da);return _M.decode(da.subarray(0,n))}function ii(e,t){return e-(t===0?0:1)}function Wt(e,t){return ii(e,t)+t}const xM=4096,EM=.5;function wM(e){for(const t of e.hunks){for(let n=0;n<t.hunkContent.length;n++){const r=t.hunkContent[n];if(r.type!=="change")continue;const a=LM(e,r);a!=null&&(t.hunkContent.splice(n,1,...a),n+=a.length-1)}kM(t,e)}}function kM(e,t){const{hunkContent:n}=e;for(let r=1;r<n.length;r++){const a=n[r],s=n[r-1];if(a.type!=="change"||a.additions>0&&a.deletions>0||s.type!=="context")continue;const u=a.additions>0,d=u?t.additionLines:t.deletionLines,f=u?a.additionLineIndex:a.deletionLineIndex,h=u?a.additions:a.deletions,p=d[f]??"";if(p.trim()!=="")continue;let m=!0;for(let w=1;w<h;w++)if(d[f+w]!==p){m=!1;break}if(!m)continue;let y=0;for(;y<s.lines&&t.additionLines[s.additionLineIndex+s.lines-1-y]===p;)y++;if(y===0||r===1&&y===s.lines)continue;a.additionLineIndex-=y,a.deletionLineIndex-=y;const b=a.additionLineIndex+a.additions,S=a.deletionLineIndex+a.deletions,_=n[r+1];_?.type==="context"?(_.lines+=y,_.additionLineIndex=b,_.deletionLineIndex=S):n.splice(r+1,0,{type:"context",lines:y,additionLineIndex:b,deletionLineIndex:S}),s.lines-=y,s.lines===0&&(n.splice(r-1,1),r--)}}function LM(e,t){const{deletions:n,additions:r,deletionLineIndex:a,additionLineIndex:s}=t,u=Math.min(n,r),d=Math.abs(r-n);if(u===0||d===0||u*(d+1)>xM)return null;const f=[];for(let _=0;_<n;_++)f.push(xS(e.deletionLines[a+_]??""));const h=[];for(let _=0;_<r;_++)h.push(xS(e.additionLines[s+_]??""));const p=r>n;let m=0,y=-1;for(let _=0;_<=d;_++){let w=0;for(let x=0;x<u;x++)w+=AM(f[x+(p?0:_)],h[x+(p?_:0)]);_===0?y=w+u*EM:w>y&&(y=w,m=_)}if(m===0)return null;const b=[],S=(_,w,x,E)=>{(_>0||w>0)&&b.push({type:"change",deletions:_,additions:w,deletionLineIndex:x,additionLineIndex:E})};return p?(S(0,m,a,s),S(u,u,a,s+m),S(0,r-u-m,a+u,s+m+u)):(S(m,0,a,s),S(u,u,a+m,s),S(n-u-m,0,a+m+u,s+u)),b}const TM=/\s+/g;function xS(e){return e.replace(TM,"")}function AM(e,t){if(e===t)return 1;const n=Math.max(e.length,t.length),r=Math.min(e.length,t.length);if(r===0)return 0;let a=0;for(;a<r&&e[a]===t[a];)a++;let s=0;for(;s<r-a&&e[e.length-1-s]===t[t.length-1-s];)s++;return(a+s)/n}function RM(e,t,n){try{return OM(e,t,n)}finally{dE()}}function OM(e,t,n=!1){const r=VM(e),a=r?IM(e):zM(e);let s;const u=[];for(const d of a){if(r&&!aE.test(d)){if(s==null)s=ht(d);else{if(n)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",d)}continue}else if(!r&&!HM(d)){if(s==null)s=ht(d);else{if(n)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",d)}continue}const f=fE(d,{cacheKey:t!=null?`${t}-${u.length}`:void 0,isGitDiff:r,throwOnError:n});f!=null&&u.push(f)}return{patchMetadata:s,files:u}}function DM(e,t){try{return fE(e,t)}finally{dE()}}function fE(e,{cacheKey:t,isGitDiff:n=aE.test(e),oldFile:r,newFile:a,throwOnError:s=!1}={}){let u=0;const d=gE(e,"@@ ");let f;const h=r==null||a==null;let p=0,m=0;for(const y of d){const b=hE(y),S=b[0];if(S==null){if(s)throw Error("parsePatchContent: invalid hunk");console.error("parsePatchContent: invalid hunk",y);continue}const _=mE(S);let w=0,x=0;if(_==null||f==null){if(f!=null){if(s)throw Error("parsePatchContent: Invalid hunk");console.error("parsePatchContent: Invalid hunk",y);continue}f={name:"",type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:h,additionLines:!h&&r!=null&&a!=null?ES(a.contents):[],deletionLines:!h&&r!=null&&a!=null?ES(r.contents):[],cacheKey:LS(t)},f.additionLines.length===1&&a?.contents===""&&(f.additionLines.length=0),f.deletionLines.length===1&&r?.contents===""&&(f.deletionLines.length=0);for(const W of b){if(W.startsWith("diff --git")){const te=W.trim().match(hM),V=te?.[1]??te?.[2],Z=te?.[3]??te?.[4];if(V==null||Z==null){if(s)throw Error("parsePatchContent: invalid git diff header");console.error("parsePatchContent: invalid git diff header",W);continue}f.name=ht(Z.trim()),V!==Z&&(f.prevName=ht(V.trim()));continue}const ee=W.startsWith("---")||W.startsWith("+++")?W.match(n?fM:dM):null;if(ee!=null){const[,te,V]=ee;if(te==="---"&&V!=="/dev/null"){const Z=ht(V.trim());f.prevName=Z,f.name=Z}else te==="+++"&&V!=="/dev/null"&&(f.name=ht(V.trim()))}else if(n){if(W.startsWith("new mode ")&&(f.mode=ht(W.slice(8).trim())),W.startsWith("old mode ")&&(f.prevMode=ht(W.slice(8).trim())),W.startsWith("new file mode")&&(f.type="new",f.mode=ht(W.slice(13).trim())),W.startsWith("deleted file mode")&&(f.type="deleted",f.mode=ht(W.slice(17).trim())),W.startsWith("similarity index")&&(W.startsWith("similarity index 100%")?f.type="rename-pure":f.type="rename-changed"),W.startsWith("index ")){const[,te,V,Z]=W.trim().match(pM)??[];te!=null&&(f.prevObjectId=ht(te)),V!=null&&(f.newObjectId=ht(V)),Z!=null&&(f.mode=ht(Z))}W.startsWith("rename from ")&&(f.prevName=ht(W.slice(12).trim())),W.startsWith("rename to ")&&(f.name=ht(W.slice(10).trim()))}}continue}let E,L;for(;b.length>0&&(b[b.length-1]===`
|
|
11
|
+
`||b[b.length-1]==="\r"||b[b.length-1]===`\r
|
|
12
|
+
`||b[b.length-1]==="");)b.pop();const{additionStart:R,deletionStart:D}=_;p=h?p:D-1,m=h?m:R-1;const N={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:_.additionCount,additionStart:R,additionLines:w,deletionCount:_.deletionCount,deletionStart:D,deletionLines:x,deletionLineIndex:p,additionLineIndex:m,hunkContent:[],hunkContext:LS(_.hunkContext),hunkSpecs:ht(S),noEOFCRAdditions:!1,noEOFCRDeletions:!1};let H=0,U=0;for(let W=1;W<b.length;W++){const ee=b[W];if(H>=N.additionCount&&U>=N.deletionCount&&!ee.startsWith("\\")){if(s&&PM(ee)&&!UM(ee))throw Error("parsePatchContent: hunk has more lines than expected");break}const te=ee[0];if(te!=="+"&&te!=="-"&&te!==" "&&te!=="\\"){if(s)throw Error("parsePatchContent: invalid hunk line");console.error(`parseLineType: Invalid firstChar: "${te}", full line: "${ee}"`),console.error("processFile: invalid rawLine:",ee);continue}const V=BM(te);if(V==="addition"){if(s&&H>=N.additionCount)throw Error("parsePatchContent: hunk has too many addition lines");const Z=Uh(ee);(E==null||E.type!=="change")&&(E=jh("change",p,m),N.hunkContent.push(E)),m++,H++,h&&f.additionLines.push(Z),E.additions++,w++,L="addition"}else if(V==="deletion"){if(s&&U>=N.deletionCount)throw Error("parsePatchContent: hunk has too many deletion lines");const Z=Uh(ee);(E==null||E.type!=="change")&&(E=jh("change",p,m),N.hunkContent.push(E)),p++,U++,h&&f.deletionLines.push(Z),E.deletions++,x++,L="deletion"}else if(V==="context"){if(s&&(U>=N.deletionCount||H>=N.additionCount))throw Error("parsePatchContent: hunk has too many context lines");const Z=Uh(ee);(E==null||E.type!=="context")&&(E=jh("context",p,m),N.hunkContent.push(E)),m++,p++,H++,U++,h&&(f.deletionLines.push(Z),f.additionLines.push(Z)),E.lines++,L="context"}else if(V==="metadata"&&E!=null){if(E.type==="context"?(N.noEOFCRAdditions=!0,N.noEOFCRDeletions=!0):L==="deletion"?N.noEOFCRDeletions=!0:L==="addition"&&(N.noEOFCRAdditions=!0),h&&(L==="addition"||L==="context")){const Z=f.additionLines.length-1;Z>=0&&(f.additionLines[Z]=zi(f.additionLines[Z]))}if(h&&(L==="deletion"||L==="context")){const Z=f.deletionLines.length-1;Z>=0&&(f.deletionLines[Z]=zi(f.deletionLines[Z]))}}}if(s&&(H!==N.additionCount||U!==N.deletionCount))throw Error("parsePatchContent: hunk line count mismatch");N.additionLines=w,N.deletionLines=x,N.collapsedBefore=Math.max(ii(N.additionStart,N.additionCount)-u,0),f.hunks.push(N),u=Wt(N.additionStart,N.additionCount);for(const W of N.hunkContent)W.type==="context"?(N.splitLineCount+=W.lines,N.unifiedLineCount+=W.lines):(N.splitLineCount+=Math.max(W.additions,W.deletions),N.unifiedLineCount+=W.deletions+W.additions);N.splitLineStart=f.splitLineCount+N.collapsedBefore,N.unifiedLineStart=f.unifiedLineCount+N.collapsedBefore,f.splitLineCount+=N.collapsedBefore+N.splitLineCount,f.unifiedLineCount+=N.collapsedBefore+N.unifiedLineCount}if(f!=null){if(s&&h&&!n&&f.hunks.length===0)throw Error("parsePatchContent: unified file has no hunks");if(f.hunks.length>0&&!h&&f.additionLines.length>0&&f.deletionLines.length>0){const y=f.hunks[f.hunks.length-1],b=Wt(y.additionStart,y.additionCount),S=f.additionLines.length,_=Math.max(S-b,0);f.splitLineCount+=_,f.unifiedLineCount+=_}return n||(f.prevName!=null&&f.name!==f.prevName?f.hunks.length>0?f.type="rename-changed":f.type="rename-pure":(r==null||r.contents==="")&&a!=null&&a.contents!==""?f.type="new":r!=null&&r.contents!==""&&(a==null||a.contents==="")&&(f.type="deleted")),f.type!=="rename-pure"&&f.type!=="rename-changed"&&(f.prevName=void 0),wM(f),f}}function MM(e,t,n=!1){const r=[],a=NM(e)?e.split(uM):[e];for(const s of a)try{r.push(RM(s,t!=null?`${t}-${r.length}`:void 0,n))}catch(u){if(n)throw u;console.error(u)}return r}function NM(e){return e.startsWith("From ")||e.includes(`
|
|
13
|
+
From `)}function ES(e){const t=hE(e);for(let n=0;n<t.length;n++)t[n]=ht(t[n]);return t}function hE(e){if(e.length===0)return[""];const t=[];let n=0;for(;;){const r=e.indexOf(`
|
|
14
|
+
`,n);if(r===-1)break;t.push(e.slice(n,r+1)),n=r+1}return n<e.length&&t.push(e.slice(n)),t}function IM(e){return gE(e,"diff --git")}function zM(e){if(e.length===0)return[""];const t=[];let n=0,r=0,a=0,s=0,u=!1;for(;r<e.length;){const d=Bp(e,r);if(a<=0&&s<=0){if(pE(e,r)){r>n&&t.push(e.slice(n,r)),n=r,u=!0,r=Bp(e,d);continue}if(u&&e.startsWith("@@ -",r)){const h=mE(e.slice(r,d));h!=null&&(a=h.deletionCount,s=h.additionCount)}r=d;continue}const f=e[r];if(f==="\\"){r=d;continue}f===" "?(a=Math.max(a-1,0),s=Math.max(s-1,0)):f==="-"?a=Math.max(a-1,0):f==="+"&&(s=Math.max(s-1,0)),r=d}return t.push(e.slice(n)),t}function HM(e){return pE(e,0)}function pE(e,t){const n=Bp(e,t);return wS(e,t,"---")&&wS(e,n,"+++")}function wS(e,t,n){if(!e.startsWith(n,t))return!1;const r=e[t+n.length];if(r!==" "&&r!==" ")return!1;for(let a=t+n.length+1;a<e.length;a++){const s=e[a];if(s===`
|
|
15
|
+
`||s==="\r")break;if(s!==" "&&s!==" ")return!0}return!1}function Bp(e,t){const n=e.indexOf(`
|
|
16
|
+
`,t);return n===-1?e.length:n+1}function PM(e){const t=e[0];return t==="+"||t==="-"||t===" "}function UM(e){if(!e.startsWith("--"))return!1;for(let t=2;t<e.length;t++){const n=e[t];if(n!==" "&&n!==" "&&n!==`
|
|
17
|
+
`&&n!=="\r")return!1}return!0}function mE(e){if(!e.startsWith("@@ -"))return;let t=4;const n=Au(e,t);if(n==null)return;const r=n.value;t=n.endIndex;let a=1;if(e[t]===","){const p=Au(e,t+1);if(p==null)return;a=p.value,t=p.endIndex}if(e[t]!==" "||e[t+1]!=="+")return;t+=2;const s=Au(e,t);if(s==null)return;const u=s.value;t=s.endIndex;let d=1;if(e[t]===","){const p=Au(e,t+1);if(p==null)return;d=p.value,t=p.endIndex}if(e[t]!==" "||e[t+1]!=="@"||e[t+2]!=="@")return;let f;const h=t+3;return e[h]===" "&&(f=jM(e.slice(h+1))),{additionCount:d,additionStart:u,deletionCount:a,deletionStart:r,hunkContext:f}}function Au(e,t){let n=t,r=0;for(;n<e.length;n++){const a=e.charCodeAt(n)-48;if(a<0||a>9)break;r=r*10+a}if(n!==t)return{value:r,endIndex:n}}function jM(e){return e.endsWith(`\r
|
|
18
|
+
`)?e.slice(0,-2):e.endsWith(`
|
|
19
|
+
`)?e.slice(0,-1):e}function VM(e){return e.startsWith("diff --git")||e.includes(`
|
|
20
|
+
diff --git`)}function gE(e,t){if(e.length===0)return[""];const n=`
|
|
21
|
+
${t}`,r=e.startsWith(t)?0:kS(e,n,0);if(r===-1)return[e];const a=[];r>0&&a.push(e.slice(0,r));let s=r;for(;;){const u=kS(e,n,s+1);if(u===-1)break;a.push(e.slice(s,u)),s=u}return a.push(e.slice(s)),a}function kS(e,t,n){const r=e.indexOf(t,n);return r===-1?-1:r+1}function LS(e){return e==null?e:ht(e)}function BM(e){return e===" "?"context":e==="\\"?"metadata":e==="+"?"addition":"deletion"}function Uh(e){const t=e.slice(1);return ht(t===""?`
|
|
22
|
+
`:t)}function jh(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 ag{diff(t,n,r={}){let a;typeof r=="function"?(a=r,r={}):"callback"in r&&(a=r.callback);const s=this.castInput(t,r),u=this.castInput(n,r),d=this.removeEmpty(this.tokenize(s,r)),f=this.removeEmpty(this.tokenize(u,r));return this.diffWithOptionsObj(d,f,r,a)}diffWithOptionsObj(t,n,r,a){var s;const u=E=>{if(E=this.postProcess(E,r),a){setTimeout(function(){a(E)},0);return}else return E},d=n.length,f=t.length;let h=1,p=d+f;r.maxEditLength!=null&&(p=Math.min(p,r.maxEditLength));const m=(s=r.timeout)!==null&&s!==void 0?s:1/0,y=Date.now()+m,b=[{oldPos:-1,lastComponent:void 0}];let S=this.extractCommon(b[0],n,t,0,r);if(b[0].oldPos+1>=f&&S+1>=d)return u(this.buildValues(b[0].lastComponent,n,t));let _=-1/0,w=1/0;const x=()=>{for(let E=Math.max(_,-h);E<=Math.min(w,h);E+=2){let L;const R=b[E-1],D=b[E+1];R&&(b[E-1]=void 0);let N=!1;if(D){const U=D.oldPos-E;N=D&&0<=U&&U<d}const H=R&&R.oldPos+1<f;if(!N&&!H){b[E]=void 0;continue}if(!H||N&&R.oldPos<D.oldPos?L=this.addToPath(D,!0,!1,0,r):L=this.addToPath(R,!1,!0,1,r),S=this.extractCommon(L,n,t,E,r),L.oldPos+1>=f&&S+1>=d)return u(this.buildValues(L.lastComponent,n,t))||!0;b[E]=L,L.oldPos+1>=f&&(w=Math.min(w,E-1)),S+1>=d&&(_=Math.max(_,E+1))}h++};if(a)(function E(){setTimeout(function(){if(h>p||Date.now()>y)return a(void 0);x()||E()},0)})();else for(;h<=p&&Date.now()<=y;){const E=x();if(E)return E}}addToPath(t,n,r,a,s){const u=t.lastComponent;return u&&!s.oneChangePerToken&&u.added===n&&u.removed===r?{oldPos:t.oldPos+a,lastComponent:{count:u.count+1,added:n,removed:r,previousComponent:u.previousComponent}}:{oldPos:t.oldPos+a,lastComponent:{count:1,added:n,removed:r,previousComponent:u}}}extractCommon(t,n,r,a,s){const u=n.length,d=r.length;let f=t.oldPos,h=f-a,p=0;for(;h+1<u&&f+1<d&&this.equals(r[f+1],n[h+1],s);)h++,f++,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=f,h}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);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,r){const a=[];let s;for(;t;)a.push(t),s=t.previousComponent,delete t.previousComponent,t=s;a.reverse();const u=a.length;let d=0,f=0,h=0;for(;d<u;d++){const p=a[d];if(p.removed)p.value=this.join(r.slice(h,h+p.count)),h+=p.count;else{if(!p.added&&this.useLongestToken){let m=n.slice(f,f+p.count);m=m.map(function(y,b){const S=r[h+b];return S.length>y.length?S:y}),p.value=this.join(m)}else p.value=this.join(n.slice(f,f+p.count));f+=p.count,p.added||(h+=p.count)}}return a}}class FM extends ag{}const GM=new FM;function $M(e,t,n){return GM.diff(e,t,n)}const TS="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 qM extends ag{tokenize(t){const n=new RegExp(`(\\r?\\n)|[${TS}]+|[^\\S\\n\\r]+|[^${TS}]`,"ug");return t.match(n)||[]}}const WM=new qM;function YM(e,t,n){return WM.diff(e,t,n)}class KM extends ag{constructor(){super(...arguments),this.tokenize=QM}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
|
|
23
|
+
`))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(`
|
|
24
|
+
`))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(`
|
|
25
|
+
`)&&(t=t.slice(0,-1)),n.endsWith(`
|
|
26
|
+
`)&&(n=n.slice(0,-1))),super.equals(t,n,r)}}const XM=new KM;function AS(e,t,n){return XM.diff(e,t,n)}function QM(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
27
|
+
`));const n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let a=0;a<r.length;a++){const s=r[a];a%2&&!t.newlineIsToken?n[n.length-1]+=s:n.push(s)}return n}function ZM(e){for(let t=0;t<e.length;t++)if(e[t]<" "||e[t]>"~"||e[t]==='"'||e[t]==="\\")return!0;return!1}function hr(e){if(!ZM(e))return e;let t='"';const n=new TextEncoder().encode(e);let r=0;for(;r<n.length;){const a=n[r];a===7?t+="\\a":a===8?t+="\\b":a===9?t+="\\t":a===10?t+="\\n":a===11?t+="\\v":a===12?t+="\\f":a===13?t+="\\r":a===34?t+='\\"':a===92?t+="\\\\":a>=32&&a<=126?t+=String.fromCharCode(a):t+="\\"+a.toString(8).padStart(3,"0"),r++}return t+='"',t}const RS={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function OS(e,t,n,r,a,s,u){let d;u?typeof u=="function"?d={callback:u}:d=u:d={},typeof d.context>"u"&&(d.context=4);const f=d.context;if(d.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(d.callback){const{callback:p}=d;AS(n,r,Object.assign(Object.assign({},d),{callback:m=>{const y=h(m);p(y)}}))}else return h(AS(n,r,d));function h(p){if(!p)return;p.push({value:"",lines:[]});function m(E){return E.map(function(L){return" "+L})}const y=[];let b=0,S=0,_=[],w=1,x=1;for(let E=0;E<p.length;E++){const L=p[E],R=L.lines||e2(L.value);if(L.lines=R,L.added||L.removed){if(!b){const D=p[E-1];b=w,S=x,D&&(_=f>0?m(D.lines.slice(-f)):[],b-=_.length,S-=_.length)}for(const D of R)_.push((L.added?"+":"-")+D);L.added?x+=R.length:w+=R.length}else{if(b)if(R.length<=f*2&&E<p.length-2)for(const D of m(R))_.push(D);else{const D=Math.min(R.length,f);for(const H of m(R.slice(0,D)))_.push(H);const N={oldStart:b,oldLines:w-b+D,newStart:S,newLines:x-S+D,lines:_};y.push(N),b=0,S=0,_=[]}w+=R.length,x+=R.length}}for(const E of y)for(let L=0;L<E.lines.length;L++)E.lines[L].endsWith(`
|
|
28
|
+
`)?E.lines[L]=E.lines[L].slice(0,-1):(E.lines.splice(L+1,0,"\"),L++);return{oldFileName:e,newFileName:t,oldHeader:a,newHeader:s,hunks:y}}}function Fp(e,t){var n,r,a,s,u,d;if(t||(t=RS),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=>Fp(p,t)).join(`
|
|
29
|
+
`)}const f=[];if(e.isGit){if(t=RS,!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/")),f.push("diff --git "+hr(p)+" "+hr(m)),e.isDelete&&f.push("deleted file mode "+((n=e.oldMode)!==null&&n!==void 0?n:"100644")),e.isCreate&&f.push("new file mode "+((r=e.newMode)!==null&&r!==void 0?r:"100644")),e.oldMode&&e.newMode&&!e.isDelete&&!e.isCreate&&(f.push("old mode "+e.oldMode),f.push("new mode "+e.newMode)),e.isRename&&(f.push("rename from "+hr(((a=e.oldFileName)!==null&&a!==void 0?a:"").replace(/^a\//,""))),f.push("rename to "+hr(((s=e.newFileName)!==null&&s!==void 0?s:"").replace(/^b\//,"")))),e.isCopy&&(f.push("copy from "+hr(((u=e.oldFileName)!==null&&u!==void 0?u:"").replace(/^a\//,""))),f.push("copy to "+hr(((d=e.newFileName)!==null&&d!==void 0?d:"").replace(/^b\//,""))))}else t.includeIndex&&e.oldFileName==e.newFileName&&e.oldFileName!==void 0&&f.push("Index: "+e.oldFileName),t.includeUnderline&&f.push("===================================================================");const h=e.hunks.length>0;t.includeFileHeaders&&e.oldFileName!==void 0&&e.newFileName!==void 0&&(!e.isGit||h)&&(f.push("--- "+hr(e.oldFileName)+(e.oldHeader?" "+e.oldHeader:"")),f.push("+++ "+hr(e.newFileName)+(e.newHeader?" "+e.newHeader:"")));for(let p=0;p<e.hunks.length;p++){const m=e.hunks[p],y=m.oldLines===0?m.oldStart-1:m.oldStart,b=m.newLines===0?m.newStart-1:m.newStart;f.push("@@ -"+y+","+m.oldLines+" +"+b+","+m.newLines+" @@");for(const S of m.lines)f.push(S)}return f.join(`
|
|
30
|
+
`)+`
|
|
31
|
+
`}function JM(e,t,n,r,a,s,u){if(typeof u=="function"&&(u={callback:u}),u?.callback){const{callback:d}=u;OS(e,t,n,r,a,s,Object.assign(Object.assign({},u),{callback:f=>{d(f?Fp(f,u.headerOptions):void 0)}}))}else{const d=OS(e,t,n,r,a,s,u);return d?Fp(d,u?.headerOptions):void 0}}function e2(e){const t=e.endsWith(`
|
|
32
|
+
`),n=e.split(`
|
|
33
|
+
`).map(r=>r+`
|
|
34
|
+
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}const t2="/dev/null";function lo(e,t,n,r=!1){if(e===null&&t===null)throw new Error("parseDiffFromFile: You must pass oldFile, newFile, or both");const a=e??DS(),s=t??DS(),u=DM(JM(a.name,s.name,a.contents,s.contents,a.header,s.header,n),{cacheKey:(()=>{const f=e?.cacheKey??e?.name,h=t?.cacheKey??t?.name;return f!=null&&h!=null?f+":"+h:f??h})(),oldFile:a,newFile:s,throwOnError:r});if(u==null)throw new Error("parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?");e===null?(u.type="new",u.prevName=void 0):t===null&&(u.type="deleted",u.prevName=void 0);const d=t?.lang??(t===null?e?.lang:void 0);return d!=null&&(u.lang=d),u}function DS(){return{name:t2,contents:""}}function An(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function ei(e){return{type:"text",value:e}}function Ce({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function _c({name:e,width:t=16,height:n=16,properties:r}){return Ce({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...r},children:[Ce({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function n2(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 fa(e){return Ce({tagName:"div",properties:{"data-gutter":""},children:e})}function vE(e,t,n,r={}){return Ce({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t!=null?[Ce({tagName:"span",properties:{"data-line-number-content":""},children:[ei(`${t}`)]})]:void 0})}function ln(e,t,n){return Ce({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 i2(){return Ce({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[_c({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}function r2(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function Ru(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 o2=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class il{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}il.prototype.normal={};il.prototype.property={};il.prototype.space=void 0;function yE(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new il(n,r,t)}function Gp(e){return e.toLowerCase()}class Yt{constructor(t,n){this.attribute=n,this.property=t}}Yt.prototype.attribute="";Yt.prototype.booleanish=!1;Yt.prototype.boolean=!1;Yt.prototype.commaOrSpaceSeparated=!1;Yt.prototype.commaSeparated=!1;Yt.prototype.defined=!1;Yt.prototype.mustUseProperty=!1;Yt.prototype.number=!1;Yt.prototype.overloadedBoolean=!1;Yt.prototype.property="";Yt.prototype.spaceSeparated=!1;Yt.prototype.space=void 0;let a2=0;const be=yo(),ct=yo(),$p=yo(),ae=yo(),qe=yo(),eo=yo(),sn=yo();function yo(){return 2**++a2}const qp=Object.freeze(Object.defineProperty({__proto__:null,boolean:be,booleanish:ct,commaOrSpaceSeparated:sn,commaSeparated:eo,number:ae,overloadedBoolean:$p,spaceSeparated:qe},Symbol.toStringTag,{value:"Module"})),Vh=Object.keys(qp);class sg extends Yt{constructor(t,n,r,a){let s=-1;if(super(t,n),MS(this,"space",a),typeof r=="number")for(;++s<Vh.length;){const u=Vh[s];MS(this,Vh[s],(r&qp[u])===qp[u])}}}sg.prototype.defined=!0;function MS(e,t,n){n&&(e[t]=n)}function ka(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const s=new sg(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Gp(r)]=r,n[Gp(s.attribute)]=r}return new il(t,n,e.space)}const bE=ka({properties:{ariaActiveDescendant:null,ariaAtomic:ct,ariaAutoComplete:null,ariaBusy:ct,ariaChecked:ct,ariaColCount:ae,ariaColIndex:ae,ariaColSpan:ae,ariaControls:qe,ariaCurrent:null,ariaDescribedBy:qe,ariaDetails:null,ariaDisabled:ct,ariaDropEffect:qe,ariaErrorMessage:null,ariaExpanded:ct,ariaFlowTo:qe,ariaGrabbed:ct,ariaHasPopup:null,ariaHidden:ct,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:qe,ariaLevel:ae,ariaLive:null,ariaModal:ct,ariaMultiLine:ct,ariaMultiSelectable:ct,ariaOrientation:null,ariaOwns:qe,ariaPlaceholder:null,ariaPosInSet:ae,ariaPressed:ct,ariaReadOnly:ct,ariaRelevant:null,ariaRequired:ct,ariaRoleDescription:qe,ariaRowCount:ae,ariaRowIndex:ae,ariaRowSpan:ae,ariaSelected:ct,ariaSetSize:ae,ariaSort:null,ariaValueMax:ae,ariaValueMin:ae,ariaValueNow:ae,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function SE(e,t){return t in e?e[t]:t}function _E(e,t){return SE(e,t.toLowerCase())}const s2=ka({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:eo,acceptCharset:qe,accessKey:qe,action:null,allow:null,allowFullScreen:be,allowPaymentRequest:be,allowUserMedia:be,alpha:be,alt:null,as:null,async:be,autoCapitalize:null,autoComplete:qe,autoFocus:be,autoPlay:be,blocking:qe,capture:null,charSet:null,checked:be,cite:null,className:qe,closedBy:null,colorSpace:null,cols:ae,colSpan:ae,command:null,commandFor:null,content:null,contentEditable:ct,controls:be,controlsList:qe,coords:ae|eo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:be,defer:be,dir:null,dirName:null,disabled:be,download:$p,draggable:ct,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:be,formTarget:null,headers:qe,height:ae,hidden:$p,high:ae,href:null,hrefLang:null,htmlFor:qe,httpEquiv:qe,id:null,imageSizes:null,imageSrcSet:null,inert:be,inputMode:null,integrity:null,is:null,isMap:be,itemId:null,itemProp:qe,itemRef:qe,itemScope:be,itemType:qe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:be,low:ae,manifest:null,max:null,maxLength:ae,media:null,method:null,min:null,minLength:ae,multiple:be,muted:be,name:null,nonce:null,noModule:be,noValidate:be,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:be,optimum:ae,pattern:null,ping:qe,placeholder:null,playsInline:be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:be,referrerPolicy:null,rel:qe,required:be,reversed:be,rows:ae,rowSpan:ae,sandbox:qe,scope:null,scoped:be,seamless:be,selected:be,shadowRootClonable:be,shadowRootCustomElementRegistry:be,shadowRootDelegatesFocus:be,shadowRootMode:null,shadowRootSerializable:be,shape:null,size:ae,sizes:null,slot:null,span:ae,spellCheck:ct,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ae,step:null,style:null,tabIndex:ae,target:null,title:null,translate:null,type:null,typeMustMatch:be,useMap:null,value:ct,width:ae,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:qe,axis:null,background:null,bgColor:null,border:ae,borderColor:null,bottomMargin:ae,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:be,declare:be,event:null,face:null,frame:null,frameBorder:null,hSpace:ae,leftMargin:ae,link:null,longDesc:null,lowSrc:null,marginHeight:ae,marginWidth:ae,noResize:be,noHref:be,noShade:be,noWrap:be,object:null,profile:null,prompt:null,rev:null,rightMargin:ae,rules:null,scheme:null,scrolling:ct,standby:null,summary:null,text:null,topMargin:ae,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ae,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:be,disablePictureInPicture:be,disableRemotePlayback:be,exportParts:eo,part:qe,prefix:null,property:null,results:ae,security:null,unselectable:null},space:"html",transform:_E}),l2=ka({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:sn,accentHeight:ae,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ae,amplitude:ae,arabicForm:null,ascent:ae,attributeName:null,attributeType:null,azimuth:ae,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ae,by:null,calcMode:null,capHeight:ae,className:qe,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:ae,diffuseConstant:ae,direction:null,display:null,dur:null,divisor:ae,dominantBaseline:null,download:be,dx:null,dy:null,edgeMode:null,editable:null,elevation:ae,enableBackground:null,end:null,event:null,exponent:ae,externalResourcesRequired:null,fill:null,fillOpacity:ae,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:eo,g2:eo,glyphName:eo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ae,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ae,horizOriginX:ae,horizOriginY:ae,id:null,ideographic:ae,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ae,k:ae,k1:ae,k2:ae,k3:ae,k4:ae,kernelMatrix:sn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ae,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:ae,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:ae,overlineThickness:ae,paintOrder:null,panose1:null,path:null,pathLength:ae,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:qe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ae,pointsAtY:ae,pointsAtZ:ae,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:sn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:sn,rev:sn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:sn,requiredFeatures:sn,requiredFonts:sn,requiredFormats:sn,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:ae,specularExponent:ae,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ae,strikethroughThickness:ae,string:null,stroke:null,strokeDashArray:sn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ae,strokeOpacity:ae,strokeWidth:null,style:null,surfaceScale:ae,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:sn,tabIndex:ae,tableValues:null,target:null,targetX:ae,targetY:ae,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:sn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ae,underlineThickness:ae,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ae,values:null,vAlphabetic:ae,vMathematical:ae,vectorEffect:null,vHanging:ae,vIdeographic:ae,version:null,vertAdvY:ae,vertOriginX:ae,vertOriginY:ae,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ae,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:SE}),CE=ka({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()}}),xE=ka({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:_E}),EE=ka({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),u2=/[A-Z]/g,NS=/-[a-z]/g,c2=/^data[-\w.:]+$/i;function d2(e,t){const n=Gp(t);let r=t,a=Yt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&c2.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(NS,h2);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!NS.test(s)){let u=s.replace(u2,f2);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}a=sg}return new a(r,t)}function f2(e){return"-"+e.toLowerCase()}function h2(e){return e.charAt(1).toUpperCase()}const p2=yE([bE,s2,CE,xE,EE],"html"),wE=yE([bE,l2,CE,xE,EE],"svg"),IS={}.hasOwnProperty;function m2(e,t){const n=t||{};function r(a,...s){let u=r.invalid;const d=r.handlers;if(a&&IS.call(a,e)){const f=String(a[e]);u=IS.call(d,f)?d[f]:r.unknown}if(u)return u.call(this,a,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const g2=/["&'<>`]/g,v2=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,y2=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,b2=/[|\\{}()[\]^$+*?.]/g,zS=new WeakMap;function S2(e,t){if(e=e.replace(t.subset?_2(t.subset):g2,r),t.subset||t.escapeOnly)return e;return e.replace(v2,n).replace(y2,r);function n(a,s,u){return t.format((a.charCodeAt(0)-55296)*1024+a.charCodeAt(1)-56320+65536,u.charCodeAt(s+2),t)}function r(a,s,u){return t.format(a.charCodeAt(0),u.charCodeAt(s+1),t)}}function _2(e){let t=zS.get(e);return t||(t=C2(e),zS.set(e,t)),t}function C2(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(b2,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const x2=/[\dA-Fa-f]/;function E2(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!x2.test(String.fromCharCode(t))?r:r+";"}const w2=/\d/;function k2(e,t,n){const r="&#"+String(e);return n&&t&&!w2.test(String.fromCharCode(t))?r:r+";"}const L2=["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"],Bh={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:"€"},T2=["cent","copy","divide","gt","lt","not","para","times"],kE={}.hasOwnProperty,Wp={};let Ou;for(Ou in Bh)kE.call(Bh,Ou)&&(Wp[Bh[Ou]]=Ou);const A2=/[^\dA-Za-z]/;function R2(e,t,n,r){const a=String.fromCharCode(e);if(kE.call(Wp,a)){const s=Wp[a],u="&"+s;return n&&L2.includes(s)&&!T2.includes(s)&&(!r||t&&t!==61&&A2.test(String.fromCharCode(t)))?u:u+";"}return""}function O2(e,t,n){let r=E2(e,t,n.omitOptionalSemicolons),a;if((n.useNamedReferences||n.useShortestReferences)&&(a=R2(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!a)&&n.useShortestReferences){const s=k2(e,t,n.omitOptionalSemicolons);s.length<r.length&&(r=s)}return a&&(!n.useShortestReferences||a.length<r.length)?a:r}function ya(e,t){return S2(e,Object.assign({format:O2},t))}const D2=/^>|^->|<!--|-->|--!>|<!-$/g,M2=[">"],N2=["<",">"];function I2(e,t,n,r){return r.settings.bogusComments?"<?"+ya(e.value,Object.assign({},r.settings.characterReferences,{subset:M2}))+">":"<!--"+e.value.replace(D2,a)+"-->";function a(s){return ya(s,Object.assign({},r.settings.characterReferences,{subset:N2}))}}function z2(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function HS(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function H2(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function P2(e){return e.join(" ").trim()}const U2=/[ \t\n\f\r]/g;function lg(e){return typeof e=="object"?e.type==="text"?PS(e.value):!1:PS(e)}function PS(e){return e.replace(U2,"")===""}const gt=TE(1),LE=TE(-1),j2=[];function TE(e){return t;function t(n,r,a){const s=n?n.children:j2;let u=(r||0)+e,d=s[u];if(!a)for(;d&&lg(d);)u+=e,d=s[u];return d}}const V2={}.hasOwnProperty;function AE(e){return t;function t(n,r,a){return V2.call(e,n.tagName)&&e[n.tagName](n,r,a)}}const ug=AE({body:F2,caption:Fh,colgroup:Fh,dd:W2,dt:q2,head:Fh,html:B2,li:$2,optgroup:Y2,option:K2,p:G2,rp:US,rt:US,tbody:Q2,td:jS,tfoot:Z2,th:jS,thead:X2,tr:J2});function Fh(e,t,n){const r=gt(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&lg(r.value.charAt(0)))}function B2(e,t,n){const r=gt(n,t);return!r||r.type!=="comment"}function F2(e,t,n){const r=gt(n,t);return!r||r.type!=="comment"}function G2(e,t,n){const r=gt(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.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 $2(e,t,n){const r=gt(n,t);return!r||r.type==="element"&&r.tagName==="li"}function q2(e,t,n){const r=gt(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function W2(e,t,n){const r=gt(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function US(e,t,n){const r=gt(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Y2(e,t,n){const r=gt(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function K2(e,t,n){const r=gt(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function X2(e,t,n){const r=gt(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Q2(e,t,n){const r=gt(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Z2(e,t,n){return!gt(n,t)}function J2(e,t,n){const r=gt(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function jS(e,t,n){const r=gt(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const eN=AE({body:iN,colgroup:rN,head:nN,html:tN,tbody:oN});function tN(e){const t=gt(e,-1);return!t||t.type!=="comment"}function nN(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function iN(e){const t=gt(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&lg(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function rN(e,t,n){const r=LE(n,t),a=gt(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&ug(r,n.children.indexOf(r),n)?!1:!!(a&&a.type==="element"&&a.tagName==="col")}function oN(e,t,n){const r=LE(n,t),a=gt(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&ug(r,n.children.indexOf(r),n)?!1:!!(a&&a.type==="element"&&a.tagName==="tr")}const Du={name:[[`
|
|
35
|
+
\f\r &/=>`.split(""),`
|
|
36
|
+
\f\r "&'/=>\``.split("")],[`\0
|
|
37
|
+
\f\r "&'/<=>`.split(""),`\0
|
|
38
|
+
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
39
|
+
\f\r &>`.split(""),`\0
|
|
40
|
+
\f\r "&'<=>\``.split("")],[`\0
|
|
41
|
+
\f\r "&'<=>\``.split(""),`\0
|
|
42
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function aN(e,t,n,r){const a=r.schema,s=a.space==="svg"?!1:r.settings.omitOptionalTags;let u=a.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const d=[];let f;a.space==="html"&&e.tagName==="svg"&&(r.schema=wE);const h=sN(r,e.properties),p=r.all(a.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=a,p&&(u=!1),(h||!s||!eN(e,t,n))&&(d.push("<",e.tagName,h?" "+h:""),u&&(a.space==="svg"||r.settings.closeSelfClosing)&&(f=h.charAt(h.length-1),(!r.settings.tightSelfClosing||f==="/"||f&&f!=='"'&&f!=="'")&&d.push(" "),d.push("/")),d.push(">")),d.push(p),!u&&(!s||!ug(e,t,n))&&d.push("</"+e.tagName+">"),d.join("")}function sN(e,t){const n=[];let r=-1,a;if(t){for(a in t)if(t[a]!==null&&t[a]!==void 0){const s=lN(e,a,t[a]);s&&n.push(s)}}for(;++r<n.length;){const s=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&s!=='"'&&s!=="'"&&(n[r]+=" ")}return n.join("")}function lN(e,t,n){const r=d2(e.schema,t),a=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,s=e.settings.allowDangerousCharacters?0:1;let u=e.quote,d;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const f=ya(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Du.name[a][s]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?H2:P2)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?f:(e.settings.preferUnquoted&&(d=ya(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Du.unquoted[a][s]}))),d!==n&&(e.settings.quoteSmart&&HS(n,u)>HS(n,e.alternative)&&(u=e.alternative),d=u+ya(n,Object.assign({},e.settings.characterReferences,{subset:(u==="'"?Du.single:Du.double)[a][s],attribute:!0}))+u),f+(d&&"="+d))}const uN=["<","&"];function RE(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:ya(e.value,Object.assign({},r.settings.characterReferences,{subset:uN}))}function cN(e,t,n,r){return r.settings.allowDangerousHtml?e.value:RE(e,t,n,r)}function dN(e,t,n,r){return r.all(e)}const fN=m2("type",{invalid:hN,unknown:pN,handlers:{comment:I2,doctype:z2,element:aN,raw:cN,root:dN,text:RE}});function hN(e){throw new Error("Expected node, not `"+e+"`")}function pN(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const mN={},gN={},vN=[];function zt(e,t){const n=t||mN,r=n.quote||'"',a=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:yN,all:bN,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||o2,characterReferences:n.characterReferences||gN,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?wE:p2,quote:r,alternative:a}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function yN(e,t,n){return fN(e,t,n,this)}function bN(e){const t=[],n=e&&e.children||vN;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}var OE=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(),Up(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||jp(e??void 0,this.selectedRange??void 0)),r=t?.lineNumberOnly??!1,a=t?.activeLineSide!==this.selectedRangeHighlightSide||r!==this.selectedRangeLineNumberOnly;!this.isSelectionDirty()&&!n&&!a||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=r,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){const r=e!==this.editorActiveLine,a=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;!this.isSelectionDirty()&&!r&&!a||(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:r,onTokenClick:a,onMergeConflictActionClick:s}=this.options;t==null&&n==null&&r==null&&s==null&&a==null||this.options.onGutterUtilityClick!=null&&Ru(e.composedPath())||(xi(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:r,onTokenEnter:a,onTokenLeave:s,enableGutterUtility:u=!1}=this.options;t==="disabled"&&!u&&n==null&&r==null&&a==null&&s==null||(xi(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{const{__debugPointerEvents:t}=this.options;if(xi(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null&&this.hoveredToken==null){xi(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,r=t.composedPath();xi(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:r});const a=this.resolvePointerTarget(r);xi(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",a);const{onLineClick:s,onLineNumberClick:u,onLineEnter:d,onLineLeave:f,onTokenClick:h,onTokenEnter:p,onTokenLeave:m,onHunkExpand:y,onMergeConflictActionClick:b}=this.options;switch(e){case"move":{const S=Gh(a)&&this.hoveredLine?.lineElement===a.lineElement;oc(a)&&this.hoveredToken?.tokenElement===a.tokenElement||(this.hoveredToken!=null&&(m?.(this.hoveredToken,t),this.clearHoveredToken()),oc(a)&&(this.setHoveredToken(this.toTokenEventBaseProps(a)),p?.(this.hoveredToken,t))),S||(this.hoveredLine!=null&&(f?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),Gh(a)?(this.setHoveredLine(this.toEventBaseProps(a)),this.placeUtility(),d?.({...this.hoveredLine,event:t})):this.placeUtility());break}case"click":{if(a==null)break;if(CN(a)&&b!=null){b(a);break}if(_N(a)&&y!=null){y(a.hunkIndex,a.all||t.shiftKey?"both":a.direction,a.all||t.shiftKey?Number.POSITIVE_INFINITY:void 0);break}if(!Gh(a))break;oc(a)&&h!=null&&h(this.toTokenEventBaseProps(a),t);const S=this.toEventBaseProps(a);u!=null&&a.numberColumn?u({...S,event:t}):s?.({...S,event:t});break}}}syncPointerListeners(e){const{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:r,onLineNumberClick:a,onLineEnter:s,onLineLeave:u,onTokenClick:d,onTokenEnter:f,onTokenLeave:h,onHunkExpand:p,onMergeConflictActionClick:m,enableGutterUtility:y=!1,enableLineSelection:b=!1,onGutterUtilityClick:S}=this.options,_=S!=null,w=n!=="disabled"||r!=null||a!=null||s!=null||u!=null||d!=null||f!=null||h!=null||p!=null||m!=null||y||b||_;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,xi(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const L=[];return(t==="both"||t==="click")&&(r!=null&&L.push("onLineClick"),a!=null&&L.push("onLineNumberClick"),p!=null&&L.push("expandable hunk separators"),m!=null&&L.push("merge conflict actions")),L})()),xi(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),xi(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 x=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",E=this.pointerSession.mode==="gutterSelecting";(!b&&x||!_&&E)&&(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,r=e!=null,a=t!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),a&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!a&&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();Ru(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:r}=this;if(r==null)return;const{lineNumber:a,eventSide:s,lineIndex:u}=n;if(e.shiftKey&&this.selectedRange!=null){const d=this.getIndexesFromSelection(this.selectedRange,r.getAttribute("data-diff-type")==="split");if(d==null)return;const f=d.start<=d.end?u>=d.start:u<=d.end;this.selectionAnchor={lineNumber:f?this.selectedRange.start:this.selectedRange.end,side:f?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(a,s,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===a&&this.selectedRange?.end===a){const d={lineNumber:a,side:s};this.selectionAnchor=d,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:d,pending:d},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:a,side:s},this.updateSelection(a,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(),r=n?.bottom??this.resolveSelectionPoint(e,{source:"event-path",excludeUtility:!1}),a=n?.top??r;r==null||a==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:a,current:r},this.selectionAnchor={lineNumber:a.lineNumber,side:a.side},this.updateSelection(r.lineNumber,r.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(r2(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 r=this.resolveSelectionPoint(e,{source:"coordinates-first"});r!=null&&(n.current=r,this.updateSelection(r.lineNumber,r.side));const a=this.buildSelectedLineRange(n.anchor,n.current);t?.({...a}),this.selectionAnchor=void 0,this.notifySelectionEnd(a),this.notifySelectionCommitted(a),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=zt(i2());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);Ts(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},r=this.selectionPointRowIndex(t),a=this.selectionPointRowIndex(n);if(!(r==null||a==null))return r>a?{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]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(const a of r){if(!(a instanceof HTMLElement))continue;const s=this.resolvePointerTarget(Mu(a));if(Ts(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(Ts(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(Ts(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 r=this.pathFromCoordinates(e,n);return r!==void 0?r??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&&Ru(e))){for(const n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){const n=Mu(e);if(t&&Ru(n))return;const r=EN(e);return r!=null?Mu(r):this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){const t=kN(wN(e));if(t==null)return;const n=this.targetForSelectionPoint(t);return n!=null?Mu(n.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;const t=this.pre?.getRootNode(),n=BS(t)?t:BS(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 r=this.getCurrentSelectionRange();let a;if(e==null)a=null;else{const s=this.selectionAnchor?.side??t,u=this.selectionAnchor?.lineNumber??e;a=this.buildSelectionRange(u,e,s,t)}jp(r??void 0,a??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=a:(this.selectedRange=a,uE(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;const n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[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 r=this.getIndexesFromSelection(e.range,t);if(r==null)throw console.error({rowRange:r,range:e.range}),new Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return r}getLineRenderColumns(e,t,n,r){if(this.pre==null||t==null&&r==null)return[];const{children:a}=this.pre;if(a.length>2)throw console.error(a),new Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");const s=[];for(const u of a){const d=u.hasAttribute("data-deletions")?"deletions":u.hasAttribute("data-additions")?"additions":void 0,f=e!=null&&t!=null&&(e.highlightSide==null||d==null||e.highlightSide===d),h=n!=null&&r!=null&&(n.highlightSide==null||d==null||n.highlightSide===d);if(!f&&!h)continue;const[p,m]=u.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:h,renderSelectedLines:f})}return s}renderSelection=()=>{Up(this.renderSelection);const e=this.getSelectionRenderState();if(this.pre==null)return;const{editorActiveLine:t,selectedLines:n}=e,r=!FS(this.renderedSelectedLinesState,n),a=!FS(this.renderedEditorActiveLineState,t);if(!r&&!a)return;r&&(this.renderedSelectedLinesState=void 0),a&&(this.renderedEditorActiveLineState=void 0);const s=this.pre.getAttribute("data-diff-type")==="split",u=r?this.resolveLineRenderRange(n,s,"selected-lines"):void 0,d=a?this.resolveLineRenderRange(t,s,"editor-active-line"):void 0,f=this.getLineRenderColumns(r?n:void 0,u,a?t:void 0,d),h=n.range==null||f.some(_=>_.renderSelectedLines),p=t.range==null||f.some(_=>_.renderEditorActiveLine);if(r)for(const _ of this.pre.querySelectorAll("[data-selected-line]"))_.removeAttribute("data-selected-line");if(a)for(const _ of this.pre.querySelectorAll("[data-editor-active-line]"))_.removeAttribute("data-editor-active-line");const m=u==null?void 0:Math.min(u.start,u.end),y=u==null?void 0:Math.max(u.start,u.end),b=m===y,S=d?.start;for(const _ of f){const{content:w,gutter:x,renderEditorActiveLine:E,renderSelectedLines:L}=_,R=Math.max(L?y??-1/0:-1/0,E?S??-1/0:-1/0),D=w.children.length;for(let N=0;N<D;N++){const H=w.children[N],U=x.children[N];if(!(H instanceof HTMLElement)||!(U instanceof HTMLElement))continue;const W=this.parseLineIndex(H,s);if((W??0)>R)break;if(W!=null){if(L&&m!=null&&y!=null&&W>=m&&W<=y){let ee=b?"single":W===m?"first":W===y?"last":"";U.setAttribute("data-selected-line",ee),n.lineNumberOnly||(H.setAttribute("data-selected-line",ee),U.nextSibling instanceof HTMLElement&&H.nextSibling instanceof HTMLElement&&(H.nextSibling.hasAttribute("data-line-annotation")||H.nextSibling.hasAttribute("data-merge-conflict-actions"))&&(b?(ee="last",H.setAttribute("data-selected-line","first")):W===m?ee="":W===y&&H.setAttribute("data-selected-line",""),H.nextSibling.setAttribute("data-selected-line",ee),U.nextSibling.setAttribute("data-selected-line",ee)))}E&&W===S&&(U.setAttribute("data-editor-active-line",""),t.lineNumberOnly||H.setAttribute("data-editor-active-line",""))}}}r&&h&&(this.renderedSelectedLinesState=n),a&&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:r,tokenElement:a,tokenText:s}){return this.mode==="file"?{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:a,tokenText:s}:{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:a,tokenText:s}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n!=null?{side:n}:{},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,a,s,u,d,f,h,p,m;for(const b of e){if(!(b instanceof HTMLElement))continue;if(m==null&&b.hasAttribute("data-merge-conflict-action")){const x=b.getAttribute("data-merge-conflict-action")??void 0,E=b.getAttribute("data-merge-conflict-conflict-index")??void 0,L=E!=null?Number.parseInt(E,10):NaN;xN(x)&&Number.isFinite(L)&&(m={kind:"merge-conflict-action",resolution:x,conflictIndex:L})}if(d==null&&b.hasAttribute("data-char")){d=b;const x=b.getAttribute("data-char");if(x!=null){const E=Number.parseInt(x,10);if(!Number.isNaN(E)){const L=b.textContent??"",R=E+L.length;(L.trim()!==""||this.options.enableTokenInteractionsOnWhitespace===!0)&&(f={tokenElement:d,lineCharStart:E,lineCharEnd:R,tokenText:L});continue}}}const S=u==null?b.getAttribute("data-column-number")??void 0:void 0;if(S!=null){u=b,p=Number.parseInt(S,10),t=!0,n=$S(b),s=b.getAttribute("data-line-index")??void 0;continue}const _=a==null?b.getAttribute("data-line")??void 0:void 0;if(_!=null){a=b,p=Number.parseInt(_,10),n=$S(b),s=b.getAttribute("data-line-index")??void 0;continue}if(h==null&&(b.hasAttribute("data-expand-button")||b.hasAttribute("data-unmodified-lines"))){h={hunkIndex:void 0,direction:b.hasAttribute("data-expand-up")?"up":b.hasAttribute("data-expand-down")?"down":"both",all:b.hasAttribute("data-expand-all-button")};continue}const w=h!=null?b.getAttribute("data-expand-index")??void 0:void 0;if(h!=null&&w!=null){const x=Number.parseInt(w,10);Number.isNaN(x)||(h.hunkIndex=x);continue}if(r==null&&b.hasAttribute("data-code")){r=b;break}}if(m!=null)return m;if(h?.hunkIndex!=null)return{type:"line-info",hunkIndex:h.hunkIndex,direction:h.direction,all:h.all};if(a??=s!=null?VS(r,`[data-line][data-line-index="${s}"]`):void 0,u??=s!=null?VS(r,`[data-column-number][data-line-index="${s}"]`):void 0,r==null||a==null||u==null||n==null||p==null||Number.isNaN(p))return;const y=this.parseLineIndex(a,this.isSplitDiff());return f!=null?this.mode==="file"?{kind:"token",lineType:n,lineElement:a,lineNumber:p,numberColumn:t,numberElement:u,side:void 0,splitLineIndex:y,...f}:{kind:"token",lineType:n,lineElement:a,lineNumber:p,numberColumn:t,numberElement:u,side:GS(n,r),splitLineIndex:y,...f}:this.mode==="file"?{kind:"line",lineType:n,lineElement:a,lineNumber:p,numberColumn:t,numberElement:u,side:void 0,splitLineIndex:y}:{kind:"line",lineType:n,lineElement:a,lineNumber:p,numberColumn:t,numberElement:u,side:GS(n,r),splitLineIndex:y}}isSplitDiff(){return this.pre?.getAttribute("data-diff-type")==="split"}parseLineIndex(e,t){const n=(e.getAttribute("data-line-index")??"").split(",").map(r=>Number.parseInt(r,10)).filter(r=>!Number.isNaN(r));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function Cc({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:a,onLineEnter:s,onLineLeave:u,onLineNumberClick:d,onTokenClick:f,onTokenEnter:h,onTokenLeave:p,renderGutterUtility:m,__debugPointerEvents:y,enableLineSelection:b,controlledSelection:S,onLineSelected:_,onLineSelectionStart:w,onLineSelectionChange:x,onLineSelectionEnd:E},L,R,D){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:SN({enableGutterUtility:t,renderGutterUtility:m,onGutterUtilityClick:r}),usesCustomGutterUtility:m!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:L,onMergeConflictActionClick:D,onLineClick:a,onLineEnter:s,onLineLeave:u,onLineNumberClick:d,onTokenClick:f,onTokenEnter:h,onTokenLeave:p,__debugPointerEvents:y,enableLineSelection:b,controlledSelection:S,onLineSelected:_,onLineSelectionStart:w,onLineSelectionChange:x,onLineSelectionEnd:E,getLineIndex:R}}function SN({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 Ts(e){return e!=null&&"kind"in e&&e.kind==="line"}function oc(e){return e!=null&&"kind"in e&&e.kind==="token"}function Gh(e){return Ts(e)||oc(e)}function _N(e){return"type"in e&&e.type==="line-info"}function CN(e){return"kind"in e&&e.kind==="merge-conflict-action"}function xN(e){return e==="current"||e==="incoming"||e==="both"}function VS(e,t){const n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function Mu(e){const t=[];let n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function EN(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 r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute("data-line")||r.hasAttribute("data-column-number"))?r:void 0}function wN(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 kN(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 BS(e){return e!=null&&typeof e.elementFromPoint=="function"}function LN(e,t){return e===t||jp(e??void 0,t??void 0)}function FS(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&LN(e?.range??null,t.range)}function GS(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function $S(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 xi(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 DE=class Li{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){const t=Li.resizeObserver??new ResizeObserver(Li.handleSharedResizeEntries);return Li.resizeObserver=t,t}static handleSharedResizeEntries(t){const n=new Map;for(const r of t){const a=Li.managersByElement.get(r.target);if(a==null)continue;const s=n.get(a);s==null?n.set(a,[r]):s.push(r)}for(const[r,a]of n)r.handleResizeEntries(a)}observedNodes=new Map;setup(t,{disableAnnotations:n,columnVariables:r="apply"}){const a=new Set,s=r==="apply";let u=0;const d=new Map(this.observedNodes);this.observedNodes.clear();for(const f of t.children){if(u===2)break;const h=(()=>{if(f instanceof HTMLElement&&f.tagName==="CODE")return f})();if(h==null)continue;u++;let p=d.get(h);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=h.firstElementChild;m instanceof HTMLElement||(m=null),p!=null?(this.observedNodes.set(h,p),d.delete(h),p.numberElement!==m?(p.numberElement!=null&&(this.unobserve(p.numberElement),d.delete(p.numberElement)),m!=null&&(this.observe(m),d.delete(m),this.observedNodes.set(m,p)),p.numberElement=m,p.numberWidth=0):p.numberElement!=null?(d.delete(p.numberElement),this.observedNodes.set(p.numberElement,p)):p.numberWidth=0,RN(p,s)):(p={type:"code",codeElement:h,numberElement:m,codeWidth:"auto",numberWidth:0,applyColumnVariables:s},this.observedNodes.set(h,p),this.observe(h),m!=null&&(this.observedNodes.set(m,p),this.observe(m)))}if(u>1&&!n){const f=t.querySelectorAll('[data-line-annotation*=","]'),h=new Map;for(const p of f){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 y=h.get(m);y==null&&(y=[],h.set(m,y)),y.push(p)}for(const[p,m]of h){if(m.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",p,m);continue}const[y,b]=m,S=y.firstElementChild,_=b.firstElementChild;if(!(y instanceof HTMLElement)||!(b instanceof HTMLElement)||!(S instanceof HTMLElement)||!(_ instanceof HTMLElement))continue;let w=d.get(S);if(w!=null){this.observedNodes.set(S,w),this.observedNodes.set(_,w),d.delete(S),d.delete(_);continue}const x=S.getBoundingClientRect().height,E=_.getBoundingClientRect().height;w={type:"annotations",column1:{container:y,child:S,childHeight:x},column2:{container:b,child:_,childHeight:E},currentHeight:"auto"},a.add({child1:S,child2:_,item:w,newHeight:Math.max(x,E)})}for(const p of a)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);a.clear()}for(const[f,h]of d)this.unobserve(f),h.type==="code"?ON(h):DN(h);d.clear()}cleanUp(){for(const t of this.observedNodes.keys())this.unobserve(t);this.observedNodes.clear()}observe(t){const{managersByElement:n}=Li,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw new Error("ResizeManager.observe: element is already owned by another ResizeManager");n.set(t,this),Li.getResizeObserver().observe(t)}}unobserve(t){const{managersByElement:n,resizeObserver:r}=Li,a=n.get(t);if(a!=null){if(a!==this)throw new Error("ResizeManager.unobserve: element is owned by another ResizeManager");n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),Li.resizeObserver=void 0)}}handleResizeEntries(t){const n=new Map,r=new Set;for(const a of t){const{target:s,borderBoxSize:u,contentBoxSize:d}=a;if(!(s instanceof HTMLElement)){console.error("ResizeManager.handleResizeEntries: Invalid element for ResizeObserver",a);continue}const f=this.observedNodes.get(s);if(f==null){console.error("ResizeManager.handleResizeEntries: Not a valid observed node",a);continue}if(f.type==="annotations"){const h=(()=>{if(s===f.column1.child)return f.column1;if(s===f.column2.child)return f.column2})();if(h==null){console.error("ResizeManager.handleResizeEntries: Couldn't find a column for",{item:f,target:s});continue}h.childHeight=u[0].blockSize,r.add(f)}else if(f.type==="code"){const h=n.get(f)??{},p=d[0].inlineSize;s===f.codeElement?h.codeInlineSize=p:s===f.numberElement&&(h.numberInlineSize=p),n.set(f,h)}}this.applyAnnotationUpdates(r),r.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,r]of t){const a=r.codeInlineSize!=null?TN(r.codeInlineSize):n.codeWidth,s=r.numberInlineSize!=null?AN(r.numberInlineSize):n.numberWidth,u=a!==n.codeWidth,d=s!==n.numberWidth;!u&&!d||(n.codeWidth=a,n.numberWidth=s,n.applyColumnVariables&&ME(n,{codeWidthChanged:u,numberWidthChanged:d}))}};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 TN(e){const t=Math.max(Math.floor(e),0);return t===0?"auto":t}function AN(e){return Math.max(Math.ceil(e),0)}function RN(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?ME(e,{codeWidthChanged:!0,numberWidthChanged:!0}):NE(e))}function ME(e,{codeWidthChanged:t,numberWidthChanged:n}){const{codeElement:r,codeWidth:a,numberWidth:s}=e;if(t&&r.style.setProperty("--diffs-column-width",`${typeof a=="number"?`${a}px`:"auto"}`),n&&r.style.setProperty("--diffs-column-number-width",`${s===0?"auto":`${s}px`}`),t||n&&a!=="auto"){const u=typeof a=="number"?Math.max(a-s,0):0;r.style.setProperty("--diffs-column-content-width",`${u>0?`${u}px`:"auto"}`)}}function NE(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 ON(e){e.codeElement.isConnected&&NE(e)}function DN(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 uo=new Map,$h=new Map,MN=new Map,Yp=new Set;function xc(e){for(const t of Array.isArray(e)?e:[e])if(!(t==="text"||t==="ansi")&&!Yp.has(t))return!1;return!0}function qS(e,t){e=Array.isArray(e)?e:[e];for(const n of e){if(Yp.has(n.name))continue;let r=uo.get(n.name);r==null&&(r=n,uo.set(n.name,r)),Yp.add(r.name),t.loadLanguageSync(r.data)}}function IE(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}var Kp=Object.defineProperty,NN=Object.getOwnPropertyDescriptor,IN=Object.getOwnPropertyNames,zN=Object.prototype.hasOwnProperty,HN=(e,t)=>{let n={};for(var r in e)Kp(n,r,{get:e[r],enumerable:!0});return Kp(n,Symbol.toStringTag,{value:"Module"}),n},PN=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var a=IN(t),s=0,u=a.length,d;s<u;s++)d=a[s],!zN.call(e,d)&&d!==n&&Kp(e,d,{get:(f=>t[f]).bind(null,d),enumerable:!(r=NN(t,d))||r.enumerable});return e},UN=(e,t,n)=>(PN(e,t,"default"),n);const jN="modulepreload",VN=function(e,t){return new URL(e,t).href},WS={},k=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let h=function(p){return Promise.all(p.map(m=>Promise.resolve(m).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};const u=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),f=d?.nonce||d?.getAttribute("nonce");a=h(n.map(p=>{if(p=VN(p,r),p in WS)return;WS[p]=!0;const m=p.endsWith(".css"),y=m?'[rel="stylesheet"]':"";if(r)for(let S=u.length-1;S>=0;S--){const _=u[S];if(_.href===p&&(!m||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${p}"]${y}`))return;const b=document.createElement("link");if(b.rel=m?"stylesheet":jN,m||(b.as="script"),b.crossOrigin="",b.href=p,f&&b.setAttribute("nonce",f),document.head.appendChild(b),m)return new Promise((S,_)=>{b.addEventListener("load",S),b.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${p}`)))})}))}function s(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return a.then(u=>{for(const d of u||[])d.status==="rejected"&&s(d.reason);return t().catch(s)})},zE=[{id:"abap",name:"ABAP",import:(()=>k(()=>import("./abap-BdImnpbu.js"),[],import.meta.url))},{id:"actionscript-3",name:"ActionScript",aliases:["actionscript","as3"],import:(()=>k(()=>import("./actionscript-3-B3316cI-.js"),[],import.meta.url))},{id:"ada",name:"Ada",import:(()=>k(()=>import("./ada-bCR0ucgS.js"),[],import.meta.url))},{id:"ahk",name:"AutoHotkey",aliases:["ahk1"],import:(()=>k(()=>import("./ahk-CsyLZFj1.js"),[],import.meta.url))},{id:"ahk2",name:"AutoHotkey2",import:(()=>k(()=>import("./ahk2-8Zs4aa1G.js"),[],import.meta.url))},{id:"angular-html",name:"Angular HTML",import:(()=>k(()=>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:(()=>k(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5]),import.meta.url))},{id:"apache",name:"Apache Conf",import:(()=>k(()=>import("./apache-Pmp26Uib.js"),[],import.meta.url))},{id:"apex",name:"Apex",import:(()=>k(()=>import("./apex-DhZFqWV2.js"),[],import.meta.url))},{id:"apl",name:"APL",import:(()=>k(()=>import("./apl-CORt7UWP.js"),__vite__mapDeps([6,1,2,3,7,8,9]),import.meta.url))},{id:"applescript",name:"AppleScript",import:(()=>k(()=>import("./applescript-Co6uUVPk.js"),[],import.meta.url))},{id:"ara",name:"Ara",import:(()=>k(()=>import("./ara-BRHolxvo.js"),[],import.meta.url))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>k(()=>import("./asciidoc-CSVQ5wI8.js"),[],import.meta.url))},{id:"asm",name:"Assembly",import:(()=>k(()=>import("./asm-D_Q5rh1f.js"),[],import.meta.url))},{id:"astro",name:"Astro",import:(()=>k(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([10,9,2,11,3,12,13]),import.meta.url))},{id:"awk",name:"AWK",import:(()=>k(()=>import("./awk-DMzUqQB5.js"),[],import.meta.url))},{id:"ballerina",name:"Ballerina",import:(()=>k(()=>import("./ballerina-BFfxhgS-.js"),[],import.meta.url))},{id:"bat",name:"Batch File",aliases:["batch","cmd"],import:(()=>k(()=>import("./bat-CickPsom.js"),[],import.meta.url))},{id:"beancount",name:"Beancount",import:(()=>k(()=>import("./beancount-k_qm7-4y.js"),[],import.meta.url))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>k(()=>import("./berry-uYugtg8r.js"),[],import.meta.url))},{id:"bibtex",name:"BibTeX",import:(()=>k(()=>import("./bibtex-CHM0blh-.js"),[],import.meta.url))},{id:"bicep",name:"Bicep",import:(()=>k(()=>import("./bicep-Bmn6On1c.js"),[],import.meta.url))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>k(()=>import("./bird2-Bx8U0n9b.js"),[],import.meta.url))},{id:"blade",name:"Blade",import:(()=>k(()=>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:(()=>k(()=>import("./bsl-DlhNcFeZ.js"),__vite__mapDeps([17,18]),import.meta.url))},{id:"c",name:"C",import:(()=>k(()=>import("./c-BIGW1oBm.js"),[],import.meta.url))},{id:"c3",name:"C3",import:(()=>k(()=>import("./c3-Dp5svz6Z.js"),[],import.meta.url))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>k(()=>import("./cadence-Bv_4Rxtq.js"),[],import.meta.url))},{id:"cairo",name:"Cairo",import:(()=>k(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20]),import.meta.url))},{id:"chapel",name:"Chapel",aliases:["chpl"],import:(()=>k(()=>import("./chapel-DTp_pixX.js"),__vite__mapDeps([21,22]),import.meta.url))},{id:"clarity",name:"Clarity",import:(()=>k(()=>import("./clarity-Dn5IMItf.js"),[],import.meta.url))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>k(()=>import("./clojure-P80f7IUj.js"),[],import.meta.url))},{id:"cmake",name:"CMake",import:(()=>k(()=>import("./cmake-D1j8_8rp.js"),[],import.meta.url))},{id:"cobol",name:"COBOL",import:(()=>k(()=>import("./cobol-nBiQ_Alo.js"),__vite__mapDeps([23,1,2,3,8]),import.meta.url))},{id:"codeowners",name:"CODEOWNERS",import:(()=>k(()=>import("./codeowners-Bp6g37R7.js"),[],import.meta.url))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>k(()=>import("./codeql-DsOJ9woJ.js"),[],import.meta.url))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>k(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([24,2]),import.meta.url))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>k(()=>import("./common-lisp-Cg-RD9OK.js"),[],import.meta.url))},{id:"coq",name:"Rocq",import:(()=>k(()=>import("./coq-C7JzOVbR.js"),[],import.meta.url))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>k(()=>import("./cpp-BMRokrvK.js"),__vite__mapDeps([25,26,27,22]),import.meta.url))},{id:"crystal",name:"Crystal",import:(()=>k(()=>import("./crystal-DGywbUpC.js"),__vite__mapDeps([28,1,2,3,16,22,29]),import.meta.url))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>k(()=>import("./csharp-DSvCPggb.js"),[],import.meta.url))},{id:"css",name:"CSS",import:(()=>k(()=>import("./css-CLj8gQPS.js"),[],import.meta.url))},{id:"csv",name:"CSV",import:(()=>k(()=>import("./csv-fuZLfV_i.js"),[],import.meta.url))},{id:"cue",name:"CUE",import:(()=>k(()=>import("./cue-D82EKSYY.js"),[],import.meta.url))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>k(()=>import("./cypher-COkxafJQ.js"),[],import.meta.url))},{id:"d",name:"D",import:(()=>k(()=>import("./d-85-TOEBH.js"),[],import.meta.url))},{id:"dart",name:"Dart",import:(()=>k(()=>import("./dart-bE4Kk8sk.js"),[],import.meta.url))},{id:"dax",name:"DAX",import:(()=>k(()=>import("./dax-CEL-wOlO.js"),[],import.meta.url))},{id:"desktop",name:"Desktop",import:(()=>k(()=>import("./desktop-BmXAJ9_W.js"),[],import.meta.url))},{id:"diff",name:"Diff",import:(()=>k(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>k(()=>import("./docker-BcOcwvcX.js"),[],import.meta.url))},{id:"dotenv",name:"dotEnv",import:(()=>k(()=>import("./dotenv-Da5cRb03.js"),[],import.meta.url))},{id:"dream-maker",name:"Dream Maker",import:(()=>k(()=>import("./dream-maker-BtqSS_iP.js"),[],import.meta.url))},{id:"edge",name:"Edge",import:(()=>k(()=>import("./edge-FbVlp4U3.js"),__vite__mapDeps([30,11,1,2,3,15]),import.meta.url))},{id:"elixir",name:"Elixir",import:(()=>k(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([31,1,2,3]),import.meta.url))},{id:"elm",name:"Elm",import:(()=>k(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([32,27,22]),import.meta.url))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>k(()=>import("./emacs-lisp-C_m_b--Z.js"),[],import.meta.url))},{id:"erb",name:"ERB",import:(()=>k(()=>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:(()=>k(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([40,41]),import.meta.url))},{id:"fennel",name:"Fennel",import:(()=>k(()=>import("./fennel-BYunw83y.js"),[],import.meta.url))},{id:"fish",name:"Fish",import:(()=>k(()=>import("./fish-BvzEVeQv.js"),[],import.meta.url))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>k(()=>import("./fluent-C4IJs8-o.js"),[],import.meta.url))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>k(()=>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:(()=>k(()=>import("./fortran-free-form-BxgE0vQu.js"),[],import.meta.url))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>k(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([44,41]),import.meta.url))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>k(()=>import("./gdresource-TyuKm33G.js"),__vite__mapDeps([45,46,47]),import.meta.url))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>k(()=>import("./gdscript-DqcFQ5yU.js"),[],import.meta.url))},{id:"gdshader",name:"GDShader",import:(()=>k(()=>import("./gdshader-DkwncUOv.js"),[],import.meta.url))},{id:"genie",name:"Genie",import:(()=>k(()=>import("./genie-D0YGMca9.js"),[],import.meta.url))},{id:"gherkin",name:"Gherkin",import:(()=>k(()=>import("./gherkin-DyxjwDmM.js"),[],import.meta.url))},{id:"git-commit",name:"Git Commit Message",import:(()=>k(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([48,49]),import.meta.url))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>k(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([50,29]),import.meta.url))},{id:"gleam",name:"Gleam",import:(()=>k(()=>import("./gleam-BspZqrRM.js"),[],import.meta.url))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>k(()=>import("./glimmer-js-ByusRIyA.js"),__vite__mapDeps([51,2,11,3,1]),import.meta.url))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>k(()=>import("./glimmer-ts-BfAWNZQY.js"),__vite__mapDeps([52,11,3,2,1]),import.meta.url))},{id:"glsl",name:"GLSL",import:(()=>k(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([27,22]),import.meta.url))},{id:"gn",name:"GN",import:(()=>k(()=>import("./gn-n2N0HUVH.js"),[],import.meta.url))},{id:"gnuplot",name:"Gnuplot",import:(()=>k(()=>import("./gnuplot-DdkO51Og.js"),[],import.meta.url))},{id:"go",name:"Go",import:(()=>k(()=>import("./go-C27-OAKa.js"),[],import.meta.url))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>k(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([36,2,11,37,13]),import.meta.url))},{id:"groovy",name:"Groovy",import:(()=>k(()=>import("./groovy-gcz8RCvz.js"),[],import.meta.url))},{id:"hack",name:"Hack",import:(()=>k(()=>import("./hack-BWmVpMyf.js"),__vite__mapDeps([53,1,2,3,16]),import.meta.url))},{id:"haml",name:"Ruby Haml",import:(()=>k(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([35,2,3]),import.meta.url))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>k(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([54,1,2,3,39]),import.meta.url))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>k(()=>import("./haskell-Df6bDoY_.js"),[],import.meta.url))},{id:"haxe",name:"Haxe",import:(()=>k(()=>import("./haxe-CfZj7gIn.js"),[],import.meta.url))},{id:"hcl",name:"HashiCorp HCL",import:(()=>k(()=>import("./hcl-BWvSN4gD.js"),[],import.meta.url))},{id:"hjson",name:"Hjson",import:(()=>k(()=>import("./hjson-D5-asLiD.js"),[],import.meta.url))},{id:"hlsl",name:"HLSL",import:(()=>k(()=>import("./hlsl-D3lLCCz7.js"),[],import.meta.url))},{id:"html",name:"HTML",import:(()=>k(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3]),import.meta.url))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>k(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([15,1,2,3]),import.meta.url))},{id:"http",name:"HTTP",import:(()=>k(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([55,29,9,7,8,36,2,11,37,13]),import.meta.url))},{id:"hurl",name:"Hurl",import:(()=>k(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([56,36,2,11,37,13,7,8,57]),import.meta.url))},{id:"hxml",name:"HXML",import:(()=>k(()=>import("./hxml-2-FPmUDs.js"),__vite__mapDeps([58,59]),import.meta.url))},{id:"hy",name:"Hy",import:(()=>k(()=>import("./hy-DFXneXwc.js"),[],import.meta.url))},{id:"imba",name:"Imba",import:(()=>k(()=>import("./imba-DGztddWO.js"),[],import.meta.url))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>k(()=>import("./ini-BEwlwnbL.js"),[],import.meta.url))},{id:"java",name:"Java",import:(()=>k(()=>import("./java-CylS5w8V.js"),[],import.meta.url))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>k(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url))},{id:"jinja",name:"Jinja",import:(()=>k(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([60,1,2,3]),import.meta.url))},{id:"jison",name:"Jison",import:(()=>k(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([61,2]),import.meta.url))},{id:"json",name:"JSON",import:(()=>k(()=>import("./json-Cp-IABpG.js"),[],import.meta.url))},{id:"json5",name:"JSON5",import:(()=>k(()=>import("./json5-C9tS-k6U.js"),[],import.meta.url))},{id:"jsonc",name:"JSON with Comments",import:(()=>k(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url))},{id:"jsonl",name:"JSON Lines",import:(()=>k(()=>import("./jsonl-DcaNXYhu.js"),[],import.meta.url))},{id:"jsonnet",name:"Jsonnet",import:(()=>k(()=>import("./jsonnet-DFQXde-d.js"),[],import.meta.url))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>k(()=>import("./jssm-C2t-YnRu.js"),[],import.meta.url))},{id:"jsx",name:"JSX",import:(()=>k(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>k(()=>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:(()=>k(()=>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:(()=>k(()=>import("./kdl-DV7GczEv.js"),[],import.meta.url))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>k(()=>import("./kotlin-BdnUsdx6.js"),[],import.meta.url))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>k(()=>import("./kusto-wEQ09or8.js"),[],import.meta.url))},{id:"latex",name:"LaTeX",import:(()=>k(()=>import("./latex-D5pSuvFb.js"),__vite__mapDeps([66,67,63]),import.meta.url))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>k(()=>import("./lean-BZvkOJ9d.js"),[],import.meta.url))},{id:"less",name:"Less",import:(()=>k(()=>import("./less-B1dDrJ26.js"),[],import.meta.url))},{id:"liquid",name:"Liquid",import:(()=>k(()=>import("./liquid-C0sCDyMI.js"),__vite__mapDeps([68,1,2,3,9]),import.meta.url))},{id:"llvm",name:"LLVM IR",import:(()=>k(()=>import("./llvm-BZoOZj88.js"),[],import.meta.url))},{id:"log",name:"Log file",import:(()=>k(()=>import("./log-2UxHyX5q.js"),[],import.meta.url))},{id:"logo",name:"Logo",import:(()=>k(()=>import("./logo-BtOb2qkB.js"),[],import.meta.url))},{id:"lua",name:"Lua",import:(()=>k(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([38,22]),import.meta.url))},{id:"luau",name:"Luau",import:(()=>k(()=>import("./luau-BnpPk5vE.js"),[],import.meta.url))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>k(()=>import("./make-CHLpvVh8.js"),[],import.meta.url))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>k(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url))},{id:"marko",name:"Marko",import:(()=>k(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([69,3,70,5,11]),import.meta.url))},{id:"matlab",name:"MATLAB",import:(()=>k(()=>import("./matlab-D7o27uSR.js"),[],import.meta.url))},{id:"mdc",name:"MDC",import:(()=>k(()=>import("./mdc-D1_yUvq7.js"),__vite__mapDeps([71,41,39,15,1,2,3]),import.meta.url))},{id:"mdx",name:"MDX",import:(()=>k(()=>import("./mdx-Cmh6b_Ma.js"),[],import.meta.url))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>k(()=>import("./mermaid-CQcHuHx7.js"),[],import.meta.url))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>k(()=>import("./mipsasm-CKIfxQSi.js"),[],import.meta.url))},{id:"mojo",name:"Mojo",import:(()=>k(()=>import("./mojo-DJz3ZmWd.js"),[],import.meta.url))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>k(()=>import("./moonbit-CHtswR0a.js"),[],import.meta.url))},{id:"move",name:"Move",import:(()=>k(()=>import("./move-el3G9tDJ.js"),[],import.meta.url))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>k(()=>import("./narrat-DRg8JJMk.js"),[],import.meta.url))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>k(()=>import("./nextflow-C-mBbutL.js"),__vite__mapDeps([72,73]),import.meta.url))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>k(()=>import("./nextflow-groovy-vE_lwT2v.js"),[],import.meta.url))},{id:"nginx",name:"Nginx",import:(()=>k(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([74,38,22]),import.meta.url))},{id:"nim",name:"Nim",import:(()=>k(()=>import("./nim-BIad80T-.js"),__vite__mapDeps([75,22,1,2,3,7,8,27,41]),import.meta.url))},{id:"nix",name:"Nix",import:(()=>k(()=>import("./nix-CwoSXNpI.js"),[],import.meta.url))},{id:"nsis",name:"NSIS",import:(()=>k(()=>import("./nsis-BlV79W_Q.js"),[],import.meta.url))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>k(()=>import("./nushell-D3jzshHO.js"),[],import.meta.url))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>k(()=>import("./objective-c-DXmwc3jG.js"),[],import.meta.url))},{id:"objective-cpp",name:"Objective-C++",import:(()=>k(()=>import("./objective-cpp-CLxacb5B.js"),[],import.meta.url))},{id:"ocaml",name:"OCaml",import:(()=>k(()=>import("./ocaml-C0hk2d4L.js"),[],import.meta.url))},{id:"odin",name:"Odin",import:(()=>k(()=>import("./odin-BBf5iR-q.js"),[],import.meta.url))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>k(()=>import("./openscad-C4EeE6gA.js"),[],import.meta.url))},{id:"org",name:"Org Markup",import:(()=>k(()=>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:(()=>k(()=>import("./pascal-D93ZcfNL.js"),[],import.meta.url))},{id:"perl",name:"Perl",import:(()=>k(()=>import("./perl-B9cMNwum.js"),__vite__mapDeps([65,1,2,3,7,8,16]),import.meta.url))},{id:"php",name:"PHP",import:(()=>k(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([79,1,2,3,7,8,16,9]),import.meta.url))},{id:"pkl",name:"Pkl",import:(()=>k(()=>import("./pkl-u5AG7uiY.js"),[],import.meta.url))},{id:"plsql",name:"PL/SQL",import:(()=>k(()=>import("./plsql-ChMvpjG-.js"),[],import.meta.url))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>k(()=>import("./po-BTJTHyun.js"),[],import.meta.url))},{id:"polar",name:"Polar",import:(()=>k(()=>import("./polar-C0HS_06l.js"),[],import.meta.url))},{id:"postcss",name:"PostCSS",import:(()=>k(()=>import("./postcss-CXtECtnM.js"),[],import.meta.url))},{id:"powerquery",name:"PowerQuery",import:(()=>k(()=>import("./powerquery-CEu0bR-o.js"),[],import.meta.url))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1","pwsh"],import:(()=>k(()=>import("./powershell-BmBUJMz7.js"),[],import.meta.url))},{id:"prisma",name:"Prisma",import:(()=>k(()=>import("./prisma-Vru482bI.js"),[],import.meta.url))},{id:"prolog",name:"Prolog",import:(()=>k(()=>import("./prolog-CbFg5uaA.js"),[],import.meta.url))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>k(()=>import("./proto-C7zT0LnQ.js"),[],import.meta.url))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>k(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([94,2,3,1]),import.meta.url))},{id:"puppet",name:"Puppet",import:(()=>k(()=>import("./puppet-BMWR74SV.js"),[],import.meta.url))},{id:"purescript",name:"PureScript",import:(()=>k(()=>import("./purescript-CklMAg4u.js"),[],import.meta.url))},{id:"python",name:"Python",aliases:["py"],import:(()=>k(()=>import("./python-B6aJPvgy.js"),[],import.meta.url))},{id:"qml",name:"QML",import:(()=>k(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([95,2]),import.meta.url))},{id:"qmldir",name:"QML Directory",import:(()=>k(()=>import("./qmldir-C8lEn-DE.js"),[],import.meta.url))},{id:"qss",name:"Qt Style Sheets",import:(()=>k(()=>import("./qss-IeuSbFQv.js"),[],import.meta.url))},{id:"r",name:"R",import:(()=>k(()=>import("./r-Cf5RLm7j.js"),[],import.meta.url))},{id:"racket",name:"Racket",import:(()=>k(()=>import("./racket-BqYA7rlc.js"),[],import.meta.url))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>k(()=>import("./raku-DXvB9xmW.js"),[],import.meta.url))},{id:"razor",name:"ASP.NET Razor",import:(()=>k(()=>import("./razor-BjBPvh-w.js"),__vite__mapDeps([96,1,2,3,89]),import.meta.url))},{id:"rbs",name:"RBS",aliases:["ruby-signature"],import:(()=>k(()=>import("./rbs-CpoqiR4B.js"),[],import.meta.url))},{id:"reg",name:"Windows Registry Script",import:(()=>k(()=>import("./reg-C-SQnVFl.js"),[],import.meta.url))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>k(()=>import("./regexp-CDVJQ6XC.js"),[],import.meta.url))},{id:"rel",name:"Rel",import:(()=>k(()=>import("./rel-C3B-1QV4.js"),[],import.meta.url))},{id:"riscv",name:"RISC-V",import:(()=>k(()=>import("./riscv-BM1_JUlF.js"),[],import.meta.url))},{id:"ron",name:"RON",import:(()=>k(()=>import("./ron-D8l8udqQ.js"),[],import.meta.url))},{id:"rosmsg",name:"ROS Interface",import:(()=>k(()=>import("./rosmsg-BJDFO7_C.js"),[],import.meta.url))},{id:"rst",name:"reStructuredText",import:(()=>k(()=>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:(()=>k(()=>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:(()=>k(()=>import("./rust-B1yitclQ.js"),[],import.meta.url))},{id:"sas",name:"SAS",import:(()=>k(()=>import("./sas-DEy46yEz.js"),__vite__mapDeps([99,16]),import.meta.url))},{id:"sass",name:"Sass",import:(()=>k(()=>import("./sass-Cj5Yp3dK.js"),[],import.meta.url))},{id:"scala",name:"Scala",import:(()=>k(()=>import("./scala-CqE71os6.js"),[],import.meta.url))},{id:"scheme",name:"Scheme",import:(()=>k(()=>import("./scheme-C98Dy4si.js"),[],import.meta.url))},{id:"scss",name:"SCSS",import:(()=>k(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3]),import.meta.url))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>k(()=>import("./sdbl-DVxCFoDh.js"),[],import.meta.url))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>k(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([100,101]),import.meta.url))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>k(()=>import("./shellscript-Yzrsuije.js"),[],import.meta.url))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>k(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([102,29]),import.meta.url))},{id:"smalltalk",name:"GNU Smalltalk",import:(()=>k(()=>import("./smalltalk-BOQMe2GC.js"),[],import.meta.url))},{id:"smithy",name:"Smithy",import:(()=>k(()=>import("./smithy-cds9vsN8.js"),[],import.meta.url))},{id:"solidity",name:"Solidity",import:(()=>k(()=>import("./solidity-DijEV5ha.js"),[],import.meta.url))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>k(()=>import("./soy-8wufbnw4.js"),__vite__mapDeps([103,1,2,3]),import.meta.url))},{id:"sparql",name:"SPARQL",import:(()=>k(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([104,105]),import.meta.url))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>k(()=>import("./splunk-BtCnVYZw.js"),[],import.meta.url))},{id:"sql",name:"SQL",import:(()=>k(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url))},{id:"ssh-config",name:"SSH Config",import:(()=>k(()=>import("./ssh-config-_ykCGR6B.js"),[],import.meta.url))},{id:"stata",name:"Stata",import:(()=>k(()=>import("./stata-DI20mbqo.js"),__vite__mapDeps([106,16]),import.meta.url))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>k(()=>import("./stylus-BEDo0Tqx.js"),[],import.meta.url))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>k(()=>import("./surrealql-Cjom0U5J.js"),__vite__mapDeps([107,2]),import.meta.url))},{id:"svelte",name:"Svelte",import:(()=>k(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([108,2,11,3,12]),import.meta.url))},{id:"swift",name:"Swift",import:(()=>k(()=>import("./swift-C2oV4EkX.js"),[],import.meta.url))},{id:"system-verilog",name:"SystemVerilog",import:(()=>k(()=>import("./system-verilog-0hqHdDBg.js"),[],import.meta.url))},{id:"systemd",name:"Systemd Units",import:(()=>k(()=>import("./systemd-4A_iFExJ.js"),[],import.meta.url))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>k(()=>import("./talonscript-CkByrt1z.js"),[],import.meta.url))},{id:"tasl",name:"Tasl",import:(()=>k(()=>import("./tasl-QIJgUcNo.js"),[],import.meta.url))},{id:"tcl",name:"Tcl",import:(()=>k(()=>import("./tcl-dwOrl1Do.js"),[],import.meta.url))},{id:"templ",name:"Templ",import:(()=>k(()=>import("./templ-DhtptRzy.js"),__vite__mapDeps([109,84,2,3]),import.meta.url))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>k(()=>import("./terraform-BETggiCN.js"),[],import.meta.url))},{id:"tex",name:"TeX",import:(()=>k(()=>import("./tex-D96PA37w.js"),__vite__mapDeps([67,63]),import.meta.url))},{id:"toml",name:"TOML",import:(()=>k(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>k(()=>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:(()=>k(()=>import("./tsv-B_m7g4N7.js"),[],import.meta.url))},{id:"tsx",name:"TSX",import:(()=>k(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url))},{id:"turtle",name:"Turtle",import:(()=>k(()=>import("./turtle-BsS91CYL.js"),[],import.meta.url))},{id:"twig",name:"Twig",import:(()=>k(()=>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:(()=>k(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>k(()=>import("./typespec-CAFt9gP4.js"),[],import.meta.url))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>k(()=>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:(()=>k(()=>import("./v-BGw2Nkan.js"),[],import.meta.url))},{id:"vala",name:"Vala",import:(()=>k(()=>import("./vala-CsfeWuGM.js"),[],import.meta.url))},{id:"vb",name:"Visual Basic",import:(()=>k(()=>import("./vb-Cu-pLBUe.js"),[],import.meta.url))},{id:"verilog",name:"Verilog",import:(()=>k(()=>import("./verilog-nZwndyjY.js"),[],import.meta.url))},{id:"vhdl",name:"VHDL",import:(()=>k(()=>import("./vhdl-CeAyd5Ju.js"),[],import.meta.url))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>k(()=>import("./viml-CJc9bBzg.js"),[],import.meta.url))},{id:"vue",name:"Vue",import:(()=>k(()=>import("./vue-BqiEGhQt.js"),__vite__mapDeps([121,3,2,11,9,1,15]),import.meta.url))},{id:"vue-html",name:"Vue HTML",import:(()=>k(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([122,2]),import.meta.url))},{id:"vue-vine",name:"Vue Vine",import:(()=>k(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([123,3,5,70,124,12,2]),import.meta.url))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>k(()=>import("./vyper-CDx5xZoG.js"),[],import.meta.url))},{id:"wasm",name:"WebAssembly",import:(()=>k(()=>import("./wasm-MzD3tlZU.js"),[],import.meta.url))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>k(()=>import("./wenyan-BV7otONQ.js"),[],import.meta.url))},{id:"wgsl",name:"WGSL",import:(()=>k(()=>import("./wgsl-Dx-B1_4e.js"),[],import.meta.url))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>k(()=>import("./wikitext-BhOHFoWU.js"),[],import.meta.url))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>k(()=>import("./wit-5i3qLPDT.js"),[],import.meta.url))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>k(()=>import("./wolfram-lXgVvXCa.js"),[],import.meta.url))},{id:"xml",name:"XML",import:(()=>k(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8]),import.meta.url))},{id:"xsl",name:"XSL",import:(()=>k(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([93,7,8]),import.meta.url))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>k(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url))},{id:"zenscript",name:"ZenScript",import:(()=>k(()=>import("./zenscript-DVFEvuxE.js"),[],import.meta.url))},{id:"zig",name:"Zig",import:(()=>k(()=>import("./zig-VOosw3JB.js"),[],import.meta.url))}],BN=Object.fromEntries(zE.map(e=>[e.id,e.import])),FN=Object.fromEntries(zE.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Xp={...BN,...FN},GN=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>k(()=>import("./andromeeda-C4gqWexZ.js"),[],import.meta.url))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>k(()=>import("./aurora-x-D-2ljcwZ.js"),[],import.meta.url))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>k(()=>import("./ayu-dark-DYE7WIF3.js"),[],import.meta.url))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>k(()=>import("./ayu-light-BA47KaF1.js"),[],import.meta.url))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>k(()=>import("./ayu-mirage-32ctXXKs.js"),[],import.meta.url))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>k(()=>import("./catppuccin-frappe-CZL1YF0i.js"),[],import.meta.url))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>k(()=>import("./catppuccin-latte-DH-8KZSZ.js"),[],import.meta.url))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>k(()=>import("./catppuccin-macchiato-B7yYVSCf.js"),[],import.meta.url))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>k(()=>import("./catppuccin-mocha-Ct7hS0mc.js"),[],import.meta.url))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>k(()=>import("./dark-plus-C3mMm8J8.js"),[],import.meta.url))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>k(()=>import("./dracula-BzJJZx-M.js"),[],import.meta.url))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>k(()=>import("./dracula-soft-BXkSAIEj.js"),[],import.meta.url))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>k(()=>import("./everforest-dark-BgDCqdQA.js"),[],import.meta.url))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>k(()=>import("./everforest-light-C8M2exoo.js"),[],import.meta.url))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>k(()=>import("./github-dark-DHJKELXO.js"),[],import.meta.url))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>k(()=>import("./github-dark-default-Cuk6v7N8.js"),[],import.meta.url))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>k(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[],import.meta.url))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>k(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[],import.meta.url))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>k(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>k(()=>import("./github-light-default-D7oLnXFd.js"),[],import.meta.url))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>k(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[],import.meta.url))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>k(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[],import.meta.url))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>k(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[],import.meta.url))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>k(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[],import.meta.url))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>k(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[],import.meta.url))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>k(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[],import.meta.url))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>k(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[],import.meta.url))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>k(()=>import("./horizon-BUw7H-hv.js"),[],import.meta.url))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>k(()=>import("./horizon-bright-CUuTKBJd.js"),[],import.meta.url))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>k(()=>import("./houston-DnULxvSX.js"),[],import.meta.url))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>k(()=>import("./kanagawa-dragon-BuwD2xS4.js"),[],import.meta.url))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>k(()=>import("./kanagawa-lotus-C3DzagqV.js"),[],import.meta.url))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>k(()=>import("./kanagawa-wave-DFGoQZhC.js"),[],import.meta.url))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>k(()=>import("./laserwave-DUszq2jm.js"),[],import.meta.url))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>k(()=>import("./light-plus-B7mTdjB0.js"),[],import.meta.url))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>k(()=>import("./material-theme-D5KoaKCx.js"),[],import.meta.url))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>k(()=>import("./material-theme-darker-BfHTSMKl.js"),[],import.meta.url))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>k(()=>import("./material-theme-lighter-B0m2ddpp.js"),[],import.meta.url))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>k(()=>import("./material-theme-ocean-CyktbL80.js"),[],import.meta.url))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>k(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[],import.meta.url))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>k(()=>import("./min-dark-CafNBF8u.js"),[],import.meta.url))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>k(()=>import("./min-light-CTRr51gU.js"),[],import.meta.url))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>k(()=>import("./monokai-BRVnQi9A.js"),[],import.meta.url))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>k(()=>import("./night-owl-C39BiMTA.js"),[],import.meta.url))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>k(()=>import("./night-owl-light-CMTm3GFP.js"),[],import.meta.url))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>k(()=>import("./nord-Ddv68eIx.js"),[],import.meta.url))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>k(()=>import("./one-dark-pro-DVMEJ2y_.js"),[],import.meta.url))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>k(()=>import("./one-light-C3Wv6jpd.js"),[],import.meta.url))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>k(()=>import("./plastic-3e1v2bzS.js"),[],import.meta.url))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>k(()=>import("./poimandres-CS3Unz2-.js"),[],import.meta.url))},{id:"red",displayName:"Red",type:"dark",import:(()=>k(()=>import("./red-hvxz__6c.js"),[],import.meta.url))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>k(()=>import("./rose-pine-5qJOZa0Y.js"),[],import.meta.url))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>k(()=>import("./rose-pine-dawn-zx0QlTCp.js"),[],import.meta.url))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>k(()=>import("./rose-pine-moon-C9pEdX9L.js"),[],import.meta.url))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>k(()=>import("./slack-dark-BthQWCQV.js"),[],import.meta.url))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>k(()=>import("./slack-ochin-DqwNpetd.js"),[],import.meta.url))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>k(()=>import("./snazzy-light-Bw305WKR.js"),[],import.meta.url))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>k(()=>import("./solarized-dark-CpvCGNkr.js"),[],import.meta.url))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>k(()=>import("./solarized-light-Dlz6yCKv.js"),[],import.meta.url))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>k(()=>import("./synthwave-84-CbfX1IO0.js"),[],import.meta.url))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>k(()=>import("./tokyo-night-hegEt444.js"),[],import.meta.url))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>k(()=>import("./vesper-DRje8inN.js"),[],import.meta.url))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>k(()=>import("./vitesse-black-Bkuqu6BP.js"),[],import.meta.url))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>k(()=>import("./vitesse-dark-D0r3Knsf.js"),[],import.meta.url))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>k(()=>import("./vitesse-light-CVO1_9PV.js"),[],import.meta.url))}],$N=Object.fromEntries(GN.map(e=>[e.id,e.import]));var cg=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function qN(){return 2147483648}function WN(){return typeof performance<"u"?performance.now():Date.now()}const YN=(e,t)=>e+(t-e%t)%t;async function KN(e){let t,n;const r={};function a(b){n=b,r.HEAPU8=new Uint8Array(b),r.HEAPU32=new Uint32Array(b)}function s(b,S,_){r.HEAPU8.copyWithin(b,S,S+_)}function u(b){try{return t.grow(b-n.byteLength+65535>>>16),a(t.buffer),1}catch{}}function d(b){const S=r.HEAPU8.length;b=b>>>0;const _=qN();if(b>_)return!1;for(let w=1;w<=4;w*=2){let x=S*(1+.2/w);x=Math.min(x,b+100663296);const E=Math.min(_,YN(Math.max(b,x),65536));if(u(E))return!0}return!1}const f=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function h(b,S,_=1024){const w=S+_;let x=S;for(;b[x]&&!(x>=w);)++x;if(x-S>16&&b.buffer&&f)return f.decode(b.subarray(S,x));let E="";for(;S<x;){let L=b[S++];if(!(L&128)){E+=String.fromCharCode(L);continue}const R=b[S++]&63;if((L&224)===192){E+=String.fromCharCode((L&31)<<6|R);continue}const D=b[S++]&63;if((L&240)===224?L=(L&15)<<12|R<<6|D:L=(L&7)<<18|R<<12|D<<6|b[S++]&63,L<65536)E+=String.fromCharCode(L);else{const N=L-65536;E+=String.fromCharCode(55296|N>>10,56320|N&1023)}}return E}function p(b,S){return b?h(r.HEAPU8,b,S):""}const m={emscripten_get_now:WN,emscripten_memcpy_big:s,emscripten_resize_heap:d,fd_write:()=>0};async function y(){const S=await e({env:m,wasi_snapshot_preview1:m});t=S.memory,a(t.buffer),Object.assign(r,S),r.UTF8ToString=p}return await y(),r}var XN=Object.defineProperty,QN=(e,t,n)=>t in e?XN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pt=(e,t,n)=>QN(e,typeof t!="symbol"?t+"":t,n);let St=null;function ZN(e){throw new cg(e.UTF8ToString(e.getLastOnigError()))}class Jc{constructor(t){pt(this,"utf16Length"),pt(this,"utf8Length"),pt(this,"utf16Value"),pt(this,"utf8Value"),pt(this,"utf16OffsetToUtf8"),pt(this,"utf8OffsetToUtf16");const n=t.length,r=Jc._utf8ByteLength(t),a=r!==n,s=a?new Uint32Array(n+1):null;a&&(s[n]=r);const u=a?new Uint32Array(r+1):null;a&&(u[r]=n);const d=new Uint8Array(r);let f=0;for(let h=0;h<n;h++){const p=t.charCodeAt(h);let m=p,y=!1;if(p>=55296&&p<=56319&&h+1<n){const b=t.charCodeAt(h+1);b>=56320&&b<=57343&&(m=(p-55296<<10)+65536|b-56320,y=!0)}a&&(s[h]=f,y&&(s[h+1]=f),m<=127?u[f+0]=h:m<=2047?(u[f+0]=h,u[f+1]=h):m<=65535?(u[f+0]=h,u[f+1]=h,u[f+2]=h):(u[f+0]=h,u[f+1]=h,u[f+2]=h,u[f+3]=h)),m<=127?d[f++]=m:m<=2047?(d[f++]=192|(m&1984)>>>6,d[f++]=128|(m&63)>>>0):m<=65535?(d[f++]=224|(m&61440)>>>12,d[f++]=128|(m&4032)>>>6,d[f++]=128|(m&63)>>>0):(d[f++]=240|(m&1835008)>>>18,d[f++]=128|(m&258048)>>>12,d[f++]=128|(m&4032)>>>6,d[f++]=128|(m&63)>>>0),y&&h++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=d,this.utf16OffsetToUtf8=s,this.utf8OffsetToUtf16=u}static _utf8ByteLength(t){let n=0;for(let r=0,a=t.length;r<a;r++){const s=t.charCodeAt(r);let u=s,d=!1;if(s>=55296&&s<=56319&&r+1<a){const f=t.charCodeAt(r+1);f>=56320&&f<=57343&&(u=(s-55296<<10)+65536|f-56320,d=!0)}u<=127?n+=1:u<=2047?n+=2:u<=65535?n+=3:n+=4,d&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const ed=class Bn{constructor(t){if(pt(this,"id",++Bn.LAST_ID),pt(this,"_onigBinding"),pt(this,"content"),pt(this,"utf16Length"),pt(this,"utf8Length"),pt(this,"utf16OffsetToUtf8"),pt(this,"utf8OffsetToUtf16"),pt(this,"ptr"),!St)throw new cg("Must invoke loadWasm first.");this._onigBinding=St,this.content=t;const n=new Jc(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!Bn._sharedPtrInUse?(Bn._sharedPtr||(Bn._sharedPtr=St.omalloc(1e4)),Bn._sharedPtrInUse=!0,St.HEAPU8.set(n.utf8Value,Bn._sharedPtr),this.ptr=Bn._sharedPtr):this.ptr=n.createString(St)}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===Bn._sharedPtr?Bn._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};pt(ed,"LAST_ID",0);pt(ed,"_sharedPtr",0);pt(ed,"_sharedPtrInUse",!1);let HE=ed;class JN{constructor(t){if(pt(this,"_onigBinding"),pt(this,"_ptr"),!St)throw new cg("Must invoke loadWasm first.");const n=[],r=[];for(let d=0,f=t.length;d<f;d++){const h=new Jc(t[d]);n[d]=h.createString(St),r[d]=h.utf8Length}const a=St.omalloc(4*t.length);St.HEAPU32.set(n,a/4);const s=St.omalloc(4*t.length);St.HEAPU32.set(r,s/4);const u=St.createOnigScanner(a,s,t.length);for(let d=0,f=t.length;d<f;d++)St.ofree(n[d]);St.ofree(s),St.ofree(a),u===0&&ZN(St),this._onigBinding=St,this._ptr=u}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,r){let a=0;if(typeof r=="number"&&(a=r),typeof t=="string"){t=new HE(t);const s=this._findNextMatchSync(t,n,!1,a);return t.dispose(),s}return this._findNextMatchSync(t,n,!1,a)}_findNextMatchSync(t,n,r,a){const s=this._onigBinding,u=s.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),a);if(u===0)return null;const d=s.HEAPU32;let f=u/4;const h=d[f++],p=d[f++],m=[];for(let y=0;y<p;y++){const b=t.convertUtf8OffsetToUtf16(d[f++]),S=t.convertUtf8OffsetToUtf16(d[f++]);m[y]={start:b,end:S,length:S-b}}return{index:h,captureIndices:m}}}function eI(e){return typeof e.instantiator=="function"}function tI(e){return typeof e.default=="function"}function nI(e){return typeof e.data<"u"}function iI(e){return typeof Response<"u"&&e instanceof Response}function rI(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 Nu;function PE(e){if(Nu)return Nu;async function t(){St=await KN(async n=>{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),eI(r)?r=await r.instantiator(n):tI(r)?r=await r.default(n):(nI(r)&&(r=r.data),iI(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await oI(r)(n):r=await aI(r)(n):rI(r)?r=await qh(r)(n):r instanceof WebAssembly.Module?r=await qh(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await qh(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Nu=t(),Nu}function qh(e){return t=>WebAssembly.instantiate(e,t)}function oI(e){return t=>WebAssembly.instantiateStreaming(e,t)}function aI(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let UE;function sI(e){UE=e}function lI(){return UE}async function jE(e){return e&&await PE(e),{createScanner(t){return new JN(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new HE(t)}}}const uI=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:jE,getDefaultWasmLoader:lI,loadWasm:PE,setDefaultWasmLoader:sI},Symbol.toStringTag,{value:"Module"}));var VE=HN({});UN(VE,uI);var We=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function cI(e){return dg(e)}function dg(e){return Array.isArray(e)?dI(e):e instanceof RegExp?e:typeof e=="object"?fI(e):e}function dI(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=dg(e[n]);return t}function fI(e){let t={};for(let n in e)t[n]=dg(e[n]);return t}function BE(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function FE(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?FE(e.substring(0,e.length-1)):e.substr(~t+1)}var Wh=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Iu=class{static hasCaptures(e){return e===null?!1:(Wh.lastIndex=0,Wh.test(e))}static replaceCaptures(e,t,n){return e.replace(Wh,(r,a,s,u)=>{let d=n[parseInt(a||s,10)];if(d){let f=t.substring(d.start,d.end);for(;f[0]===".";)f=f.substring(1);switch(u){case"downcase":return f.toLowerCase();case"upcase":return f.toUpperCase();default:return f}}else return r})}};function GE(e,t){return e<t?-1:e>t?1:0}function $E(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let a=0;a<n;a++){let s=GE(e[a],t[a]);if(s!==0)return s}return 0}return n-r}function YS(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 qE(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var WE=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}},Ec=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(mI(e),t)}static createFromParsedTheme(e,t){return vI(e,t)}_cachedMatchRoot=new WE(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,r=this._cachedMatchRoot.get(t).find(a=>hI(e.parent,a.parentScopes));return r?new YE(r.fontStyle,r.foreground,r.background):null}},Yh=class ac{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new ac(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new ac(n,t[r]);return n}push(t){return new ac(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 r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function hI(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],a=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],a=!0}for(;e&&!pI(e.scopeName,r);){if(a)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function pI(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var YE=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function mI(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let a=0,s=t.length;a<s;a++){let u=t[a];if(!u.settings)continue;let d;if(typeof u.scope=="string"){let m=u.scope;m=m.replace(/^[,]+/,""),m=m.replace(/[,]+$/,""),d=m.split(",")}else Array.isArray(u.scope)?d=u.scope:d=[""];let f=-1;if(typeof u.settings.fontStyle=="string"){f=0;let m=u.settings.fontStyle.split(" ");for(let y=0,b=m.length;y<b;y++)switch(m[y]){case"italic":f=f|1;break;case"bold":f=f|2;break;case"underline":f=f|4;break;case"strikethrough":f=f|8;break}}let h=null;typeof u.settings.foreground=="string"&&YS(u.settings.foreground)&&(h=u.settings.foreground);let p=null;typeof u.settings.background=="string"&&YS(u.settings.background)&&(p=u.settings.background);for(let m=0,y=d.length;m<y;m++){let S=d[m].trim().split(" "),_=S[S.length-1],w=null;S.length>1&&(w=S.slice(0,S.length-1),w.reverse()),n[r++]=new gI(_,w,a,f,h,p)}}return n}var gI=class{constructor(e,t,n,r,a,s){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=a,this.background=s}},Mt=(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))(Mt||{});function vI(e,t){e.sort((f,h)=>{let p=GE(f.scope,h.scope);return p!==0||(p=$E(f.parentScopes,h.parentScopes),p!==0)?p:f.index-h.index});let n=0,r="#000000",a="#ffffff";for(;e.length>=1&&e[0].scope==="";){let f=e.shift();f.fontStyle!==-1&&(n=f.fontStyle),f.foreground!==null&&(r=f.foreground),f.background!==null&&(a=f.background)}let s=new yI(t),u=new YE(n,s.getId(r),s.getId(a)),d=new SI(new Qp(0,null,-1,0,0),[]);for(let f=0,h=e.length;f<h;f++){let p=e[f];d.insert(0,p.scope,p.parentScopes,p.fontStyle,s.getId(p.foreground),s.getId(p.background))}return new Ec(s,u,d)}var yI=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)}},bI=Object.freeze([]),Qp=class KE{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,r,a,s){this.scopeDepth=t,this.parentScopes=n||bI,this.fontStyle=r,this.foreground=a,this.background=s}clone(){return new KE(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,a=t.length;r<a;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,a){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),a!==0&&(this.background=a)}},SI=class Zp{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,a=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[a]===">"&&a++,!(r>=t.parentScopes.length||a>=n.parentScopes.length);){const s=n.parentScopes[a].length-t.parentScopes[r].length;if(s!==0)return s;r++,a++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),a,s;if(r===-1?(a=t,s=""):(a=t.substring(0,r),s=t.substring(r+1)),this._children.hasOwnProperty(a))return this._children[a].match(s)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Zp._cmpBySpecificity),n}insert(t,n,r,a,s,u){if(n===""){this._doInsertHere(t,r,a,s,u);return}let d=n.indexOf("."),f,h;d===-1?(f=n,h=""):(f=n.substring(0,d),h=n.substring(d+1));let p;this._children.hasOwnProperty(f)?p=this._children[f]:(p=new Zp(this._mainRule.clone(),Qp.cloneArr(this._rulesWithParentScopes)),this._children[f]=p),p.insert(t+1,h,r,a,s,u)}_doInsertHere(t,n,r,a,s){if(n===null){this._mainRule.acceptOverwrite(t,r,a,s);return}for(let u=0,d=this._rulesWithParentScopes.length;u<d;u++){let f=this._rulesWithParentScopes[u];if($E(f.parentScopes,n)===0){f.acceptOverwrite(t,r,a,s);return}}r===-1&&(r=this._mainRule.fontStyle),a===0&&(a=this._mainRule.foreground),s===0&&(s=this._mainRule.background),this._rulesWithParentScopes.push(new Qp(t,n,r,a,s))}},to=class _n{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=_n.getLanguageId(t),r=_n.getTokenType(t),a=_n.getFontStyle(t),s=_n.getForeground(t),u=_n.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:a,foreground:s,background:u})}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,r,a,s,u,d){let f=_n.getLanguageId(t),h=_n.getTokenType(t),p=_n.containsBalancedBrackets(t)?1:0,m=_n.getFontStyle(t),y=_n.getForeground(t),b=_n.getBackground(t);return n!==0&&(f=n),r!==8&&(h=r),a!==null&&(p=a?1:0),s!==-1&&(m=s),u!==0&&(y=u),d!==0&&(b=d),(f<<0|h<<8|p<<10|m<<11|y<<15|b<<24)>>>0}};function wc(e,t){const n=[],r=_I(e);let a=r.next();for(;a!==null;){let f=0;if(a.length===2&&a.charAt(1)===":"){switch(a.charAt(0)){case"R":f=1;break;case"L":f=-1;break;default:console.log(`Unknown priority ${a} in scope selector`)}a=r.next()}let h=u();if(n.push({matcher:h,priority:f}),a!==",")break;a=r.next()}return n;function s(){if(a==="-"){a=r.next();const f=s();return h=>!!f&&!f(h)}if(a==="("){a=r.next();const f=d();return a===")"&&(a=r.next()),f}if(KS(a)){const f=[];do f.push(a),a=r.next();while(KS(a));return h=>t(f,h)}return null}function u(){const f=[];let h=s();for(;h;)f.push(h),h=s();return p=>f.every(m=>m(p))}function d(){const f=[];let h=u();for(;h&&(f.push(h),a==="|"||a===",");){do a=r.next();while(a==="|"||a===",");h=u()}return p=>f.some(m=>m(p))}}function KS(e){return!!e&&!!e.match(/[\w\.:]+/)}function _I(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function XE(e){typeof e.dispose=="function"&&e.dispose()}var Bs=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},CI=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},xI=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))}},EI=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Bs(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new xI;for(const n of e)wI(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Bs){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function wI(e,t,n,r){const a=n.lookup(e.scopeName);if(!a){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const s=n.lookup(t);e instanceof Bs?sc({baseGrammar:s,selfGrammar:a},r):Jp(e.ruleName,{baseGrammar:s,selfGrammar:a,repository:a.repository},r);const u=n.injections(e.scopeName);if(u)for(const d of u)r.add(new Bs(d))}function Jp(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];kc([r],t,n)}}function sc(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&kc(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&kc(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function kc(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const a=r.repository?BE({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&kc(r.patterns,{...t,repository:a},n);const s=r.include;if(!s)continue;const u=QE(s);switch(u.kind){case 0:sc({...t,selfGrammar:t.baseGrammar},n);break;case 1:sc(t,n);break;case 2:Jp(u.ruleName,{...t,repository:a},n);break;case 3:case 4:const d=u.scopeName===t.selfGrammar.scopeName?t.selfGrammar:u.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(d){const f={baseGrammar:t.baseGrammar,selfGrammar:d,repository:a};u.kind===4?Jp(u.ruleName,f,n):sc(f,n)}else u.kind===4?n.add(new CI(u.scopeName,u.ruleName)):n.add(new Bs(u.scopeName));break}}}var kI=class{kind=0},LI=class{kind=1},TI=class{constructor(e){this.ruleName=e}kind=2},AI=class{constructor(e){this.scopeName=e}kind=3},RI=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function QE(e){if(e==="$base")return new kI;if(e==="$self")return new LI;const t=e.indexOf("#");if(t===-1)return new AI(e);if(t===0)return new TI(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new RI(n,r)}}var OI=/\\(\d+)/,XS=/\\(\d+)/g,DI=-1,ZE=-2;var rl=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Iu.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Iu.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${FE(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:Iu.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Iu.replaceCaptures(this._contentName,e,t)}},MI=class extends rl{retokenizeCapturedWithRuleId;constructor(e,t,n,r,a){super(e,t,n,r),this.retokenizeCapturedWithRuleId=a}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},NI=class extends rl{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,a){super(e,t,n,null),this._match=new Fs(r,this.id),this.captures=a,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,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Gs,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},QS=class extends rl{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,a){super(e,t,n,r),this.patterns=a.patterns,this.hasMissingPatterns=a.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,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Gs,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},em=class extends rl{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,a,s,u,d,f,h){super(e,t,n,r),this._begin=new Fs(a,this.id),this.beginCaptures=s,this._end=new Fs(u||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=d,this.applyEndPatternLast=f||!1,this.patterns=h.patterns,this.hasMissingPatterns=h.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,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Gs;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}},Lc=class extends rl{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,a,s,u,d,f){super(e,t,n,r),this._begin=new Fs(a,this.id),this.beginCaptures=s,this.whileCaptures=d,this._while=new Fs(u,ZE),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=f.patterns,this.hasMissingPatterns=f.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Gs;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,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Gs,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},JE=class Rt{static createCaptureRule(t,n,r,a,s){return t.registerRule(u=>new MI(n,u,r,a,s))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(a=>{if(t.id=a,t.match)return new NI(t.$vscodeTextmateLocation,t.id,t.name,t.match,Rt._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=BE({},r,t.repository));let s=t.patterns;return typeof s>"u"&&t.include&&(s=[{include:t.include}]),new QS(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Rt._compilePatterns(s,n,r))}return t.while?new Lc(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Rt._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,Rt._compileCaptures(t.whileCaptures||t.captures,n,r),Rt._compilePatterns(t.patterns,n,r)):new em(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Rt._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,Rt._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,Rt._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let a=[];if(t){let s=0;for(const u in t){if(u==="$vscodeTextmateLocation")continue;const d=parseInt(u,10);d>s&&(s=d)}for(let u=0;u<=s;u++)a[u]=null;for(const u in t){if(u==="$vscodeTextmateLocation")continue;const d=parseInt(u,10);let f=0;t[u].patterns&&(f=Rt.getCompiledRuleId(t[u],n,r)),a[d]=Rt.createCaptureRule(n,t[u].$vscodeTextmateLocation,t[u].name,t[u].contentName,f)}}return a}static _compilePatterns(t,n,r){let a=[];if(t)for(let s=0,u=t.length;s<u;s++){const d=t[s];let f=-1;if(d.include){const h=QE(d.include);switch(h.kind){case 0:case 1:f=Rt.getCompiledRuleId(r[d.include],n,r);break;case 2:let p=r[h.ruleName];p&&(f=Rt.getCompiledRuleId(p,n,r));break;case 3:case 4:const m=h.scopeName,y=h.kind===4?h.ruleName:null,b=n.getExternalGrammar(m,r);if(b)if(y){let S=b.repository[y];S&&(f=Rt.getCompiledRuleId(S,n,b.repository))}else f=Rt.getCompiledRuleId(b.repository.$self,n,b.repository);break}}else f=Rt.getCompiledRuleId(d,n,r);if(f!==-1){const h=n.getRule(f);let p=!1;if((h instanceof QS||h instanceof em||h instanceof Lc)&&h.hasMissingPatterns&&h.patterns.length===0&&(p=!0),p)continue;a.push(f)}}return{patterns:a,hasMissingPatterns:(t?t.length:0)!==a.length}}},Fs=class ew{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const r=t.length;let a=0,s=[],u=!1;for(let d=0;d<r;d++)if(t.charAt(d)==="\\"&&d+1<r){const h=t.charAt(d+1);h==="z"?(s.push(t.substring(a,d)),s.push("$(?!\\n)(?<!\\n)"),a=d+2):(h==="A"||h==="G")&&(u=!0),d++}this.hasAnchor=u,a===0?this.source=t:(s.push(t.substring(a,r)),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=OI.test(this.source):this.hasBackReferences=!1}clone(){return new ew(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 r=n.map(a=>t.substring(a.start,a.end));return XS.lastIndex=0,this.source.replace(XS,(a,s)=>qE(r[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=[],r=[],a=[],s,u,d,f;for(s=0,u=this.source.length;s<u;s++)d=this.source.charAt(s),t[s]=d,n[s]=d,r[s]=d,a[s]=d,d==="\\"&&s+1<u&&(f=this.source.charAt(s+1),f==="A"?(t[s+1]="",n[s+1]="",r[s+1]="A",a[s+1]="A"):f==="G"?(t[s+1]="",n[s+1]="G",r[s+1]="",a[s+1]="G"):(t[s+1]=f,n[s+1]=f,r[s+1]=f,a[s+1]=f),s++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:a.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}},Gs=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 ZS(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 r=this._items.map(a=>a.resolveAnchors(t,n));return new ZS(e,r,this._items.map(a=>a.ruleId))}},ZS=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(`
|
|
43
|
+
`)}findNextMatchSync(e,t,n){const r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Kh=class{constructor(e,t){this.languageId=e,this.tokenType=t}},II=class tm{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Kh(t,8),this._embeddedLanguagesMatcher=new zI(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?tm._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Kh(0,0);_getBasicScopeAttributes=new WE(t=>{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new Kh(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(tm.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/},zI=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,r])=>qE(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])}},JS=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function tw(e,t,n,r,a,s,u,d){const f=t.content.length;let h=!1,p=-1;if(u){const b=HI(e,t,n,r,a,s);a=b.stack,r=b.linePos,n=b.isFirstLine,p=b.anchorPosition}const m=Date.now();for(;!h;){if(d!==0&&Date.now()-m>d)return new JS(a,!0);y()}return new JS(a,!1);function y(){const b=PI(e,t,n,r,a,p);if(!b){s.produce(a,f),h=!0;return}const S=b.captureIndices,_=b.matchedRuleId,w=S&&S.length>0?S[0].end>r:!1;if(_===DI){const x=a.getRule(e);s.produce(a,S[0].start),a=a.withContentNameScopesList(a.nameScopesList),As(e,t,n,a,s,x.endCaptures,S),s.produce(a,S[0].end);const E=a;if(a=a.parent,p=E.getAnchorPos(),!w&&E.getEnterPos()===r){a=E,s.produce(a,f),h=!0;return}}else{const x=e.getRule(_);s.produce(a,S[0].start);const E=a,L=x.getName(t.content,S),R=a.contentNameScopesList.pushAttributed(L,e);if(a=a.push(_,r,p,S[0].end===f,null,R,R),x instanceof em){const D=x;As(e,t,n,a,s,D.beginCaptures,S),s.produce(a,S[0].end),p=S[0].end;const N=D.getContentName(t.content,S),H=R.pushAttributed(N,e);if(a=a.withContentNameScopesList(H),D.endHasBackReferences&&(a=a.withEndRule(D.getEndWithResolvedBackReferences(t.content,S))),!w&&E.hasSameRuleAs(a)){a=a.pop(),s.produce(a,f),h=!0;return}}else if(x instanceof Lc){const D=x;As(e,t,n,a,s,D.beginCaptures,S),s.produce(a,S[0].end),p=S[0].end;const N=D.getContentName(t.content,S),H=R.pushAttributed(N,e);if(a=a.withContentNameScopesList(H),D.whileHasBackReferences&&(a=a.withEndRule(D.getWhileWithResolvedBackReferences(t.content,S))),!w&&E.hasSameRuleAs(a)){a=a.pop(),s.produce(a,f),h=!0;return}}else if(As(e,t,n,a,s,x.captures,S),s.produce(a,S[0].end),a=a.pop(),!w){a=a.safePop(),s.produce(a,f),h=!0;return}}S[0].end>r&&(r=S[0].end,n=!1)}}function HI(e,t,n,r,a,s){let u=a.beginRuleCapturedEOL?0:-1;const d=[];for(let f=a;f;f=f.pop()){const h=f.getRule(e);h instanceof Lc&&d.push({rule:h,stack:f})}for(let f=d.pop();f;f=d.pop()){const{ruleScanner:h,findOptions:p}=VI(f.rule,e,f.stack.endRule,n,r===u),m=h.findNextMatchSync(t,r,p);if(m){if(m.ruleId!==ZE){a=f.stack.pop();break}m.captureIndices&&m.captureIndices.length&&(s.produce(f.stack,m.captureIndices[0].start),As(e,t,n,f.stack,s,f.rule.whileCaptures,m.captureIndices),s.produce(f.stack,m.captureIndices[0].end),u=m.captureIndices[0].end,m.captureIndices[0].end>r&&(r=m.captureIndices[0].end,n=!1))}else{a=f.stack.pop();break}}return{stack:a,linePos:r,anchorPosition:u,isFirstLine:n}}function PI(e,t,n,r,a,s){const u=UI(e,t,n,r,a,s),d=e.getInjections();if(d.length===0)return u;const f=jI(d,e,t,n,r,a,s);if(!f)return u;if(!u)return f;const h=u.captureIndices[0].start,p=f.captureIndices[0].start;return p<h||f.priorityMatch&&p===h?f:u}function UI(e,t,n,r,a,s){const u=a.getRule(e),{ruleScanner:d,findOptions:f}=nw(u,e,a.endRule,n,r===s),h=d.findNextMatchSync(t,r,f);return h?{captureIndices:h.captureIndices,matchedRuleId:h.ruleId}:null}function jI(e,t,n,r,a,s,u){let d=Number.MAX_VALUE,f=null,h,p=0;const m=s.contentNameScopesList.getScopeNames();for(let y=0,b=e.length;y<b;y++){const S=e[y];if(!S.matcher(m))continue;const _=t.getRule(S.ruleId),{ruleScanner:w,findOptions:x}=nw(_,t,null,r,a===u),E=w.findNextMatchSync(n,a,x);if(!E)continue;const L=E.captureIndices[0].start;if(!(L>=d)&&(d=L,f=E.captureIndices,h=E.ruleId,p=S.priority,d===a))break}return f?{priorityMatch:p===-1,captureIndices:f,matchedRuleId:h}:null}function nw(e,t,n,r,a){return{ruleScanner:e.compileAG(t,n,r,a),findOptions:0}}function VI(e,t,n,r,a){return{ruleScanner:e.compileWhileAG(t,n,r,a),findOptions:0}}function As(e,t,n,r,a,s,u){if(s.length===0)return;const d=t.content,f=Math.min(s.length,u.length),h=[],p=u[0].end;for(let m=0;m<f;m++){const y=s[m];if(y===null)continue;const b=u[m];if(b.length===0)continue;if(b.start>p)break;for(;h.length>0&&h[h.length-1].endPos<=b.start;)a.produceFromScopes(h[h.length-1].scopes,h[h.length-1].endPos),h.pop();if(h.length>0?a.produceFromScopes(h[h.length-1].scopes,b.start):a.produce(r,b.start),y.retokenizeCapturedWithRuleId){const _=y.getName(d,u),w=r.contentNameScopesList.pushAttributed(_,e),x=y.getContentName(d,u),E=w.pushAttributed(x,e),L=r.push(y.retokenizeCapturedWithRuleId,b.start,-1,!1,null,w,E),R=e.createOnigString(d.substring(0,b.end));tw(e,R,n&&b.start===0,b.start,L,a,!1,0),XE(R);continue}const S=y.getName(d,u);if(S!==null){const w=(h.length>0?h[h.length-1].scopes:r.contentNameScopesList).pushAttributed(S,e);h.push(new BI(w,b.end))}}for(;h.length>0;)a.produceFromScopes(h[h.length-1].scopes,h[h.length-1].endPos),h.pop()}var BI=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function FI(e,t,n,r,a,s,u,d){return new $I(e,t,n,r,a,s,u,d)}function e_(e,t,n,r,a){const s=wc(t,Tc),u=JE.getCompiledRuleId(n,r,a.repository);for(const d of s)e.push({debugSelector:t,matcher:d.matcher,ruleId:u,grammar:a,priority:d.priority})}function Tc(e,t){if(t.length<e.length)return!1;let n=0;return e.every(r=>{for(let a=n;a<t.length;a++)if(GI(t[a],r))return n=a+1,!0;return!1})}function GI(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 $I=class{constructor(e,t,n,r,a,s,u,d){if(this._rootScopeName=e,this.balancedBracketSelectors=s,this._onigLib=d,this._basicScopeAttributesProvider=new II(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=u,this._grammar=t_(t,null),this._injections=null,this._tokenTypeMatchers=[],a)for(const f of Object.keys(a)){const h=wc(f,Tc);for(const p of h)this._tokenTypeMatchers.push({matcher:p.matcher,type:a[f]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:a=>a===this._rootScopeName?this._grammar:this.getExternalGrammar(a),injections:a=>this._grammarRepository.injections(a)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const a=r.injections;if(a)for(let u in a)e_(t,u,a[u],this,r);const s=this._grammarRepository.injections(n);s&&s.forEach(u=>{const d=this.getExternalGrammar(u);if(d){const f=d.injectionSelector;f&&e_(t,f,d,this,d)}})}return t.sort((a,s)=>a.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]=t_(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=JE.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let a;if(!t||t===nm.NULL){a=!0;const h=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),m=to.set(0,h.languageId,h.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),y=this.getRule(this._rootId).getName(null,null);let b;y?b=Ns.createRootAndLookUpScopeName(y,m,this):b=Ns.createRoot("unknown",m),t=new nm(null,this._rootId,-1,-1,!1,null,b,b)}else a=!1,t.reset();e=e+`
|
|
44
|
+
`;const s=this.createOnigString(e),u=s.content.length,d=new WI(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),f=tw(this,s,a,0,t,d,!0,r);return XE(s),{lineLength:u,lineTokens:d,ruleStack:f.stack,stoppedEarly:f.stoppedEarly}}};function t_(e,t){return e=cI(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 Ns=class Fn{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,a=t?.scopePath??null;for(const s of n)a=Yh.push(a,s.scopeNames),r=new Fn(r,a,s.encodedTokenAttributes);return r}static createRoot(t,n){return new Fn(null,new Yh(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const a=r.getMetadataForScope(t),s=new Yh(null,t),u=r.themeProvider.themeMatch(s),d=Fn.mergeAttributes(n,a,u);return new Fn(null,s,d)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Fn.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,r){let a=-1,s=0,u=0;return r!==null&&(a=r.fontStyle,s=r.foregroundId,u=r.backgroundId),to.set(t,n.languageId,n.tokenType,null,a,s,u)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return Fn._pushAttributed(this,t,n);const r=t.split(/ /g);let a=this;for(const s of r)a=Fn._pushAttributed(a,s,n);return a}static _pushAttributed(t,n,r){const a=r.getMetadataForScope(n),s=t.scopePath.push(n),u=r.themeProvider.themeMatch(s),d=Fn.mergeAttributes(t.tokenAttributes,a,u);return new Fn(t,s,d)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===t?n.reverse():void 0}},nm=class Wr{constructor(t,n,r,a,s,u,d,f){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=s,this.endRule=u,this.nameScopesList=d,this.contentNameScopesList=f,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=a}_stackElementBrand=void 0;static NULL=new Wr(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:Wr._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Ns.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(){Wr._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,a,s,u,d){return new Wr(this,t,n,r,a,s,u,d)}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 Wr(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 r=Ns.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new Wr(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Ns.fromExtension(r,n.contentNameScopesList))}},qI=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):wc(n,Tc).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>wc(n,Tc).map(r=>r.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}},WI=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,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 r=e?.tokenAttributes??0,a=!1;if(this.balancedBracketSelectors?.matchesAlways&&(a=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const s=e?.getScopeNames()??[];for(const u of this._tokenTypeOverrides)u.matcher(s)&&(r=to.set(r,0,u.type,null,-1,0,0));this.balancedBracketSelectors&&(a=this.balancedBracketSelectors.match(s))}if(a&&(r=to.set(r,0,8,a,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),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 r=0,a=this._binaryTokens.length;r<a;r++)n[r]=this._binaryTokens[r];return n}},YI=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,r,a){if(!this._grammars.has(e)){let s=this._rawGrammars.get(e);if(!s)return null;this._grammars.set(e,FI(e,s,t,n,r,a,this,this._onigLib))}return this._grammars.get(e)}},KI=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new YI(Ec.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(Ec.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,r){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(t,n,r){return this._loadGrammar(t,n,r.embeddedLanguages,r.tokenTypes,new qI(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,r,a,s){const u=new EI(this._syncRegistry,t);for(;u.Q.length>0;)u.Q.map(d=>this._loadSingleGrammar(d.scopeName)),u.processQueue();return this._grammarForScopeName(t,n,r,a,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 r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(t,n=[],r=0,a=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,a)}_grammarForScopeName(t,n=0,r=null,a=null,s=null){return this._syncRegistry.grammarForScopeName(t,n,r,a,s)}},im=nm.NULL;function Ac(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[a,s]of Object.entries(t?.colorReplacements||{}))typeof s=="string"?n[a]=s:a===r&&Object.assign(n,s);return n}function Sr(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function XI(e){return Array.isArray(e)?e:[e]}async function iw(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function td(e){return!e||["plaintext","txt","text","plain"].includes(e)}function rw(e){return e==="ansi"||td(e)}function nd(e){return e==="none"}function ow(e){return nd(e)}const QI=/(\r?\n)/g;function id(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(QI);let r=0;const a=[];for(let s=0;s<n.length;s+=2){const u=t?n[s]+(n[s+1]||""):n[s];a.push([u,r]),r+=n[s].length,r+=n[s+1]?.length||0}return a}const n_={light:"#333333",dark:"#bbbbbb"},i_={light:"#fffffe",dark:"#1e1e1e"},r_="__shiki_resolved";function rd(e){if(e?.[r_])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:r}=t;if(!n||!r){const d=t.settings?t.settings.find(f=>!f.name&&!f.scope):void 0;d?.settings?.foreground&&(r=d.settings.foreground),d?.settings?.background&&(n=d.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?n_.light:n_.dark),n||(n=t.type==="light"?i_.light:i_.dark),t.fg=r,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 a=0;const s=new Map;function u(d){if(s.has(d))return s.get(d);a+=1;const f=`#${a.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${f}`]?u(d):(s.set(d,f),f)}t.settings=t.settings.map(d=>{const f=d.settings?.foreground&&!d.settings.foreground.startsWith("#"),h=d.settings?.background&&!d.settings.background.startsWith("#");if(!f&&!h)return d;const p={...d,settings:{...d.settings}};if(f){const m=u(d.settings.foreground);t.colorReplacements[m]=d.settings.foreground,p.settings.foreground=m}if(h){const m=u(d.settings.background);t.colorReplacements[m]=d.settings.background,p.settings.background=m}return p});for(const d of Object.keys(t.colors||{}))if((d==="editor.foreground"||d==="editor.background"||d.startsWith("terminal.ansi"))&&!t.colors[d]?.startsWith("#")){const f=u(t.colors[d]);t.colorReplacements[f]=t.colors[d],t.colors[d]=f}return Object.defineProperty(t,r_,{enumerable:!1,writable:!1,value:!0}),t}async function aw(e){return[...new Set((await Promise.all(e.filter(t=>!rw(t)).map(async t=>await iw(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function sw(e){return(await Promise.all(e.map(async t=>ow(t)?null:rd(await iw(t))))).filter(t=>!!t)}function lw(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 We(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var ZI=class extends KI{_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,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(a=>this.loadTheme(a)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=rd(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=Ec.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=lw(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(a=>a.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(a=>{this._alias[a]=e.name}),this._loadedLanguagesCache=null,t.size)for(const a of t)this._resolvedGrammars.delete(a.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(a.scopeName),this._syncRegistry?._grammars?.delete(a.scopeName),this.loadLanguage(this._langMap.get(a.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const r of e)this.resolveEmbeddedLanguages(r);const t=[...this._langGraph.entries()],n=t.filter(([r,a])=>!a);if(n.length){const r=t.filter(([a,s])=>s?(s.embeddedLanguages||s.embeddedLangs)?.some(u=>n.map(([d])=>d).includes(u)):!1).filter(a=>!n.includes(a));throw new We(`Missing languages ${n.map(([a])=>`\`${a}\``).join(", ")}, required by ${r.map(([a])=>`\`${a}\``).join(", ")}`)}for(const[r,a]of t)this._resolver.addLanguage(a);for(const[r,a]of t)this.loadLanguage(a)}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))}},JI=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 r=1;r<=t.length;r++){const a=t.slice(0,r).join(".");n=[...n,...this._injections.get(a)||[]]}return n}};let Es=0;function ez(e){Es+=1,e.warnings!==!1&&Es>=10&&Es%10===0&&console.warn(`[Shiki] ${Es} 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 We("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(rd),a=new ZI(new JI(e.engine,n),r,n,e.langAlias);let s;function u(E){return lw(E,e.langAlias)}function d(E){w();const L=a.getGrammar(typeof E=="string"?E:E.name);if(!L)throw new We(`Language \`${E}\` not found, you may need to load it first`);return L}function f(E){if(E==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};w();const L=a.getTheme(E);if(!L)throw new We(`Theme \`${E}\` not found, you may need to load it first`);return L}function h(E){w();const L=f(E);return s!==E&&(a.setTheme(L),s=E),{theme:L,colorMap:a.getColorMap()}}function p(){return w(),a.getLoadedThemes()}function m(){return w(),a.getLoadedLanguages()}function y(...E){w(),a.loadLanguages(E.flat(1))}async function b(...E){return y(await aw(E))}function S(...E){w();for(const L of E.flat(1))a.loadTheme(L)}async function _(...E){return w(),S(await sw(E))}function w(){if(t)throw new We("Shiki instance has been disposed")}function x(){t||(t=!0,a.dispose(),Es-=1)}return{setTheme:h,getTheme:f,getLanguage:d,getLoadedThemes:p,getLoadedLanguages:m,resolveLangAlias:u,loadLanguage:b,loadLanguageSync:y,loadTheme:_,loadThemeSync:S,dispose:x,[Symbol.dispose]:x}}async function tz(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([sw(e.themes||[]),aw(e.langs||[]),e.engine]);return ez({...e,themes:t,langs:n,engine:r})}const uw=new WeakMap;function od(e,t){uw.set(e,t)}function $s(e){return uw.get(e)}var ad=class cw{_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 cw(Object.fromEntries(XI(n).map(r=>[r,im])),t)}constructor(...t){if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,a]=t;this.lang=r,this._stacks={[a]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return nz(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function nz(e){const t=[],n=new Set;function r(a){if(n.has(a))return;n.add(a);const s=a?.nameScopesList?.scopeName;s&&t.push(s),a.parent&&r(a.parent)}return r(e),t}function iz(e,t){if(!(e instanceof ad))throw new We("Invalid grammar state");return e.getInternalStack(t)}const rz=/,/,oz=/ /;function dw(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n;if(td(e.resolveLangAlias(n.lang||"text"))||nd(r))return id(t).map(d=>[{content:d[0],offset:d[1]}]);const{theme:a,colorMap:s}=e.setTheme(r),u=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==u.name)throw new We(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${u.name}"`);if(!n.grammarState.themes.includes(a.name))throw new We(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return sz(t,u,a,s,n)}function az(...e){if(e.length===2)return $s(e[1]);const[t,n,r={}]=e,{lang:a="text",theme:s=t.getLoadedThemes()[0]}=r;if(td(a)||nd(s))throw new We("Plain language does not have grammar state");if(a==="ansi")throw new We("ANSI language does not have grammar state");const{theme:u,colorMap:d}=t.setTheme(s),f=t.getLanguage(a);return new ad(fg(n,f,u,d,r).stateStack,f.name,u.name)}function sz(e,t,n,r,a){const s=fg(e,t,n,r,a),u=new ad(s.stateStack,t.name,n.name);return od(s.tokens,u),s.tokens}function fg(e,t,n,r,a){const s=Ac(n,a),{tokenizeMaxLineLength:u=0,tokenizeTimeLimit:d=500,includeExplanation:f=!1}=a,h=id(e);let p=a.grammarState?iz(a.grammarState,n.name)??im:a.grammarContextCode!=null?fg(a.grammarContextCode,t,n,r,{...a,grammarState:void 0,grammarContextCode:void 0}).stateStack:im,m=[];const y=[];for(let b=0,S=h.length;b<S;b++){const[_,w]=h[b];if(_===""){m=[],y.push([]);continue}if(u>0&&_.length>=u){m=[],y.push([{content:_,offset:w,color:"",fontStyle:0}]);continue}let x,E,L;f&&f!=="tokenType"&&(x=t.tokenizeLine(_,p,d),E=x.tokens,L=0);const R=t.tokenizeLine2(_,p,d),D=R.tokens.length/2;for(let N=0;N<D;N++){const H=R.tokens[2*N],U=N+1<D?R.tokens[2*N+2]:_.length;if(H===U)continue;const W=R.tokens[2*N+1],ee=Sr(r[to.getForeground(W)],s),te=to.getFontStyle(W),V={content:_.substring(H,U),offset:w+H,color:ee,fontStyle:te};if(f==="tokenType")V.type=to.getTokenType(W);else if(f){const Z=[];if(f!=="scopeName")for(const se of n.settings){let I;switch(typeof se.scope){case"string":I=se.scope.split(rz).map(G=>G.trim());break;case"object":I=se.scope;break;default:continue}Z.push({settings:se,selectors:I.map(G=>G.split(oz))})}V.explanation=[];let ie=0;for(;H+ie<U;){const se=E[L],I=_.substring(se.startIndex,se.endIndex);ie+=I.length,V.explanation.push({content:I,scopes:f==="scopeName"?lz(se.scopes):uz(Z,se.scopes)}),L+=1}}m.push(V)}y.push(m),m=[],p=R.ruleStack}return{tokens:y,stateStack:p}}function lz(e){return e.map(t=>({scopeName:t}))}function uz(e,t){const n=[];for(let r=0,a=t.length;r<a;r++){const s=t[r];n[r]={scopeName:s,themeMatches:dz(e,s,t.slice(0,r))}}return n}function o_(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function cz(e,t,n){if(!o_(e.at(-1),t))return!1;let r=e.length-2,a=n.length-1;for(;r>=0&&a>=0;)o_(e[r],n[a])&&(r-=1),a-=1;return r===-1}function dz(e,t,n){const r=[];for(const{selectors:a,settings:s}of e)for(const u of a)if(cz(u,t,n)){r.push(s);break}return r}function fw(e,t,n,r=dw){const a=Object.entries(n.themes).filter(h=>h[1]).map(h=>({color:h[0],theme:h[1]})),s=a.map(h=>{const p=r(e,t,{...n,theme:h.theme});return{tokens:p,state:$s(p),theme:typeof h.theme=="string"?h.theme:h.theme.name}}),u=fz(...s.map(h=>h.tokens)),d=u[0].map((h,p)=>h.map((m,y)=>{const b={content:m.content,variants:{},offset:m.offset};return"includeExplanation"in n&&n.includeExplanation&&(b.explanation=m.explanation),u.forEach((S,_)=>{const{content:w,explanation:x,offset:E,...L}=S[p][y];b.variants[a[_].color]=L}),b})),f=s[0].state?new ad(Object.fromEntries(s.map(h=>[h.theme,h.state?.getInternalStack(h.theme)])),s[0].state.lang):void 0;return f&&od(d,f),d}function fz(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const a=e.map(f=>f[r]),s=t.map(()=>[]);t.forEach((f,h)=>f.push(s[h]));const u=a.map(()=>0),d=a.map(f=>f[0]);for(;d.every(f=>f);){const f=Math.min(...d.map(h=>h.content.length));for(let h=0;h<n;h++){const p=d[h];p.content.length===f?(s[h].push(p),u[h]+=1,d[h]=a[h][u[h]]):(s[h].push({...p,content:p.content.slice(0,f)}),d[h]={...p,content:p.content.slice(f),offset:p.offset+f})}}}return t}const a_=/\s+/g;function hw(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(a_)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(a_);for(const r of n)r&&!e.properties.class.includes(r)&&e.properties.class.push(r);return e}function hz(e){const t=id(e,!0).map(([a])=>a);function n(a){if(a===e.length)return{line:t.length-1,character:t.at(-1).length};let s=a,u=0;for(const d of t){if(s<d.length)break;s-=d.length,u++}return{line:u,character:s}}function r(a,s){let u=0;for(let d=0;d<a;d++)u+=t[d].length;return u+=s,u}return{lines:t,indexToPos:n,posToIndex:r}}const pz=["color","background-color"];function mz(e,t){let n=0;const r=[];for(const a of t)a>n&&r.push({...e,content:e.content.slice(n,a),offset:e.offset+n}),n=a;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function gz(e,t){let n=0,r=e.length;for(;n<r;){const a=n+(r-n>>1);e[a]<=t?n=a+1:r=a}return n}function vz(e,t){const n=[...t instanceof Set?t:new Set(t)].sort((r,a)=>r-a);return n.length?e.map(r=>r.flatMap(a=>{const s=a.offset+a.content.length,u=gz(n,a.offset);let d=u;for(;d<n.length&&n[d]<s;)d++;if(u===d)return a;const f=n.slice(u,d);for(let h=0;h<f.length;h++)f[h]-=a.offset;return mz(a,f)})):e}function yz(e,t,n,r,a="css-vars"){const s={content:e.content,explanation:e.explanation,offset:e.offset},u=t.map(p=>Rc(e.variants[p])),d=new Set(u.flatMap(p=>Object.keys(p))),f={},h=(p,m)=>{const y=m==="color"?"":m==="background-color"?"-bg":`-${m}`;return n+t[p]+(m==="color"?"":y)};return u.forEach((p,m)=>{for(const y of d){const b=p[y]||"inherit";if(m===0&&r&&pz.includes(y))if(r==="light-dark()"&&u.length>1){const S=t.findIndex(E=>E==="light"),_=t.findIndex(E=>E==="dark");if(S===-1||_===-1)throw new We('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const w=u[S][y]||"inherit",x=u[_][y]||"inherit";f[y]=`light-dark(${w}, ${x})`,a==="css-vars"&&(f[h(m,y)]=b)}else f[y]=b;else a==="css-vars"&&(f[h(m,y)]=b)}}),s.htmlStyle=f,s}function Rc(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Mt.Italic&&(t["font-style"]="italic"),e.fontStyle&Mt.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Mt.Underline&&n.push("underline"),e.fontStyle&Mt.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function rm(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function bz(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let a=function(u){if(typeof u=="number"){if(u<0||u>n.source.length)throw new We(`Invalid decoration offset: ${u}. Code length: ${n.source.length}`);return{...r.indexToPos(u),offset:u}}else{const d=r.lines[u.line];if(d===void 0)throw new We(`Invalid decoration position ${JSON.stringify(u)}. Lines length: ${r.lines.length}`);let f=u.character;if(f<0&&(f=d.length+f),f<0||f>d.length)throw new We(`Invalid decoration position ${JSON.stringify(u)}. Line ${u.line} length: ${d.length}`);return{...u,character:f,offset:r.posToIndex(u.line,f)}}};const r=hz(n.source),s=(n.options.decorations||[]).map(u=>({...u,start:a(u.start),end:a(u.end)}));Sz(s),e.set(n.meta,{decorations:s,converter:r,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(this.options.decorations?.length)return vz(n,t(this).decorations.flatMap(r=>[r.start.offset,r.end.offset]))},code(n){if(!this.options.decorations?.length)return;const r=t(this),a=[...n.children].filter(p=>p.type==="element"&&p.tagName==="span");if(a.length!==r.converter.lines.length)throw new We(`Number of lines in code element (${a.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function s(p,m,y,b){const S=a[p];let _="",w=-1,x=-1;if(m===0&&(w=0),y===0&&(x=0),y===Number.POSITIVE_INFINITY&&(x=S.children.length),w===-1||x===-1)for(let L=0;L<S.children.length;L++)_+=pw(S.children[L]),w===-1&&_.length===m&&(w=L+1),x===-1&&_.length===y&&(x=L+1);if(w===-1)throw new We(`Failed to find start index for decoration ${JSON.stringify(b.start)}`);if(x===-1)throw new We(`Failed to find end index for decoration ${JSON.stringify(b.end)}`);const E=S.children.slice(w,x);if(!b.alwaysWrap&&E.length===S.children.length)d(S,b,"line");else if(!b.alwaysWrap&&E.length===1&&E[0].type==="element")d(E[0],b,"token");else{const L={type:"element",tagName:"span",properties:{},children:E};d(L,b,"wrapper"),S.children.splice(w,E.length,L)}}function u(p,m){a[p]=d(a[p],m,"line")}function d(p,m,y){const b=m.properties||{},S=m.transform||(_=>_);return p.tagName=m.tagName||"span",p.properties={...p.properties,...b,class:p.properties.class},m.properties?.class&&hw(p,m.properties.class),p=S(p,y)||p,p}const f=[],h=r.decorations.sort((p,m)=>m.start.offset-p.start.offset||p.end.offset-m.end.offset);for(const p of h){const{start:m,end:y}=p;if(m.line===y.line)s(m.line,m.character,y.character,p);else if(m.line<y.line){s(m.line,m.character,Number.POSITIVE_INFINITY,p);for(let b=m.line+1;b<y.line;b++)f.unshift(()=>u(b,p));s(y.line,0,y.character,p)}}f.forEach(p=>p())}}}function Sz(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new We(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const a=e[r],s=n.start.offset<=a.start.offset&&a.start.offset<n.end.offset,u=n.start.offset<a.end.offset&&a.end.offset<=n.end.offset,d=a.start.offset<=n.start.offset&&n.start.offset<a.end.offset,f=a.start.offset<n.end.offset&&n.end.offset<=a.end.offset;if(s||u||d||f){if(s&&u||d&&f||d&&n.start.offset===n.end.offset||u&&a.start.offset===a.end.offset)continue;throw new We(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(a.start)} intersect.`)}}}}function pw(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(pw).join(""):""}const _z=[bz()];function Oc(e){const t=Cz(e.transformers||[]);return[...t.pre,...t.normal,...t.post,..._z]}function Cz(e){const t=[],n=[],r=[];for(const a of e)switch(a.enforce){case"pre":t.push(a);break;case"post":n.push(a);break;default:r.push(a)}return{pre:t,post:n,normal:r}}var Qr=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Xh={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function xz(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const r=e.indexOf("m",n);if(r!==-1)return{sequence:e.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:e.length}}function s_(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(r=>Number.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function Ez(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)Xh[r]&&t.push({type:"setDecoration",value:Xh[r]});else if(r<=29){const a=Xh[r-20];a&&(t.push({type:"resetDecoration",value:a}),a==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Qr[r-30]}});else if(r===38){const a=s_(e);a&&t.push({type:"setForegroundColor",value:a})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Qr[r-40]}});else if(r===48){const a=s_(e);a&&t.push({type:"setBackgroundColor",value:a})}else r===49?t.push({type:"resetBackgroundColor"}):r===53?t.push({type:"setDecoration",value:"overline"}):r===55?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Qr[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Qr[r-100+8]}})}return t}function wz(){let e=null,t=null,n=new Set;return{parse(r){const a=[];let s=0;do{const u=xz(r,s),d=u.sequence?r.substring(s,u.startPosition):r.substring(s);if(d.length>0&&a.push({value:d,foreground:e,background:t,decorations:new Set(n)}),u.sequence){const f=Ez(u.sequence);for(const h of f)h.type==="resetAll"?(e=null,t=null,n.clear()):h.type==="resetForegroundColor"?e=null:h.type==="resetBackgroundColor"?t=null:h.type==="resetDecoration"&&n.delete(h.value);for(const h of f)h.type==="setForegroundColor"?e=h.value:h.type==="setBackgroundColor"?t=h.value:h.type==="setDecoration"&&n.add(h.value)}s=u.position}while(s<r.length);return a}}}var kz={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 Lz(e=kz){function t(d){return e[d]}function n(d){return`#${d.map(f=>Math.max(0,Math.min(f,255)).toString(16).padStart(2,"0")).join("")}`}let r;function a(){if(r)return r;r=[];for(let h=0;h<Qr.length;h++)r.push(t(Qr[h]));let d=[0,95,135,175,215,255];for(let h=0;h<6;h++)for(let p=0;p<6;p++)for(let m=0;m<6;m++)r.push(n([d[h],d[p],d[m]]));let f=8;for(let h=0;h<24;h++,f+=10)r.push(n([f,f,f]));return r}function s(d){return a()[d]}function u(d){switch(d.type){case"named":return t(d.name);case"rgb":return n(d.rgb);case"table":return s(d.index)}}return{value:u}}const Tz=/#([0-9a-f]{3,8})/i,Az=/var\((--[\w-]+-ansi-[\w-]+)\)/,Rz={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 Oz(e,t,n){const r=Ac(e,n),a=id(t),s=Lz(Object.fromEntries(Qr.map(d=>{const f=`terminal.ansi${d[0].toUpperCase()}${d.substring(1)}`;return[d,e.colors?.[f]||Rz[d]]}))),u=wz();return a.map(d=>u.parse(d[0]).map(f=>{let h,p;f.decorations.has("reverse")?(h=f.background?s.value(f.background):e.bg,p=f.foreground?s.value(f.foreground):e.fg):(h=f.foreground?s.value(f.foreground):e.fg,p=f.background?s.value(f.background):void 0),h=Sr(h,r),p=Sr(p,r),f.decorations.has("dim")&&(h=Dz(h));let m=Mt.None;return f.decorations.has("bold")&&(m|=Mt.Bold),f.decorations.has("italic")&&(m|=Mt.Italic),f.decorations.has("underline")&&(m|=Mt.Underline),f.decorations.has("strikethrough")&&(m|=Mt.Strikethrough),{content:f.value,offset:d[1],color:h,bgColor:p,fontStyle:m}}))}function Dz(e){const t=e.match(Tz);if(t){const r=t[1];if(r.length===8){const a=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${a}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const a=r[0],s=r[1],u=r[2],d=r[3];return`#${a}${a}${s}${s}${u}${u}${Math.round(Number.parseInt(`${d}${d}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){const a=r[0],s=r[1],u=r[2];return`#${a}${a}${s}${s}${u}${u}80`}}}const n=e.match(Az);return n?`var(${n[1]}-dim)`:e}function om(e,t,n={}){const r=e.resolveLangAlias(n.lang||"text"),{theme:a=e.getLoadedThemes()[0]}=n;if(!td(r)&&!nd(a)&&r==="ansi"){const{theme:s}=e.setTheme(a);return Oz(s,t,n)}return dw(e,t,n)}function Dc(e,t,n){let r,a,s,u,d,f;if("themes"in n){const{defaultColor:h="light",cssVariablePrefix:p="--shiki-",colorsRendering:m="css-vars"}=n,y=Object.entries(n.themes).filter(x=>x[1]).map(x=>({color:x[0],theme:x[1]})).sort((x,E)=>x.color===h?-1:E.color===h?1:0);if(y.length===0)throw new We("`themes` option must not be empty");const b=fw(e,t,n,om);if(f=$s(b),h&&h!=="light-dark()"&&!y.some(x=>x.color===h))throw new We(`\`themes\` option must contain the defaultColor key \`${h}\``);const S=y.map(x=>e.getTheme(x.theme)),_=y.map(x=>x.color);s=b.map(x=>x.map(E=>yz(E,_,p,h,m))),f&&od(s,f);const w=y.map(x=>Ac(x.theme,n));a=l_(y,S,w,p,h,"fg",m),r=l_(y,S,w,p,h,"bg",m),u=`shiki-themes ${S.map(x=>x.name).join(" ")}`,d=h?void 0:[a,r].join(";")}else if("theme"in n){const h=Ac(n.theme,n);s=om(e,t,n);const p=e.getTheme(n.theme);r=Sr(p.bg,h),a=Sr(p.fg,h),u=p.name,f=$s(s)}else throw new We("Invalid options, either `theme` or `themes` must be provided");return{tokens:s,fg:a,bg:r,themeName:u,rootStyle:d,grammarState:f}}function l_(e,t,n,r,a,s,u){return e.map((d,f)=>{const h=Sr(t[f][s],n[f])||"inherit",p=`${r+d.color}${s==="bg"?"-bg":""}:${h}`;if(f===0&&a){if(a==="light-dark()"&&e.length>1){const m=e.findIndex(b=>b.color==="light"),y=e.findIndex(b=>b.color==="dark");if(m===-1||y===-1)throw new We('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${Sr(t[m][s],n[m])||"inherit"}, ${Sr(t[y][s],n[y])||"inherit"});${p}`}return h}return u==="css-vars"?p:null}).filter(d=>!!d).join(";")}const mw=/^\s+$/,Mz=/^(\s*)(.*?)(\s*)$/;function Mc(e,t,n,r={meta:{},options:n,codeToHast:(a,s)=>Mc(e,a,s),codeToTokens:(a,s)=>Dc(e,a,s)}){let a=t;for(const S of Oc(n))a=S.preprocess?.call(r,a,n)||a;let{tokens:s,fg:u,bg:d,themeName:f,rootStyle:h,grammarState:p}=Dc(e,a,n);const{mergeWhitespaces:m=!0,mergeSameStyleTokens:y=!1}=n;m===!0?s=Iz(s):m==="never"&&(s=zz(s)),y&&(s=Hz(s));const b={...r,get source(){return a}};for(const S of Oc(n))s=S.tokens?.call(b,s)||s;return Nz(s,{...n,fg:u,bg:d,themeName:f,rootStyle:n.rootStyle===!1?!1:n.rootStyle??h},b,p)}function Nz(e,t,n,r=$s(e)){const a=Oc(t),s=[],u={type:"root",children:[]},{structure:d="classic",tabindex:f="0"}=t,h={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?h.style=t.rootStyle:h.style=`background-color:${t.bg};color:${t.fg}`),f!==!1&&f!=null&&(h.tabindex=f.toString());for(const[_,w]of Object.entries(t.meta||{}))_.startsWith("_")||(h[_]=w);let p={type:"element",tagName:"pre",properties:h,children:[],data:t.data},m={type:"element",tagName:"code",properties:{},children:s};const y=[],b={...n,structure:d,addClassToHast:hw,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return u},get pre(){return p},get code(){return m},get lines(){return y}};if(e.forEach((_,w)=>{w&&(d==="inline"?u.children.push({type:"element",tagName:"br",properties:{},children:[]}):d==="classic"&&s.push({type:"text",value:`
|
|
45
|
+
`}));let x={type:"element",tagName:"span",properties:{class:"line"},children:[]},E=0;for(const L of _){let R={type:"element",tagName:"span",properties:{...L.htmlAttrs},children:[{type:"text",value:L.content}]};const D=rm(L.htmlStyle||Rc(L));D&&(R.properties.style=D);for(const N of a)R=N?.span?.call(b,R,w+1,E,x,L)||R;d==="inline"?u.children.push(R):d==="classic"&&x.children.push(R),E+=L.content.length}if(d==="classic"){for(const L of a)x=L?.line?.call(b,x,w+1)||x;y.push(x),s.push(x)}else d==="inline"&&y.push(x)}),d==="classic"){for(const _ of a)m=_?.code?.call(b,m)||m;p.children.push(m);for(const _ of a)p=_?.pre?.call(b,p)||p;u.children.push(p)}else if(d==="inline"){const _=[];let w={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const E of u.children)E.type==="element"&&E.tagName==="br"?(_.push(w),w={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(E.type==="element"||E.type==="text")&&w.children.push(E);_.push(w);let x={type:"element",tagName:"code",properties:{},children:_};for(const E of a)x=E?.code?.call(b,x)||x;u.children=[];for(let E=0;E<x.children.length;E++){E>0&&u.children.push({type:"element",tagName:"br",properties:{},children:[]});const L=x.children[E];L.type==="element"&&u.children.push(...L.children)}}let S=u;for(const _ of a)S=_?.root?.call(b,S)||S;return r&&od(S,r),S}function Iz(e){return e.map(t=>{const n=[];let r="",a;return t.forEach((s,u)=>{const d=!(s.fontStyle&&(s.fontStyle&Mt.Underline||s.fontStyle&Mt.Strikethrough));d&&mw.test(s.content)&&t[u+1]?(a===void 0&&(a=s.offset),r+=s.content):r?(d?n.push({...s,offset:a,content:r+s.content}):n.push({content:r,offset:a},s),a=void 0,r=""):n.push(s)}),n})}function zz(e){return e.map(t=>t.flatMap(n=>{if(mw.test(n.content))return n;const r=n.content.match(Mz);if(!r)return n;const[,a,s,u]=r;if(!a&&!u)return n;const d=[{...n,offset:n.offset+a.length,content:s}];return a&&d.unshift({content:a,offset:n.offset}),u&&d.push({content:u,offset:n.offset+a.length+s.length}),d}))}function Hz(e){return e.map(t=>{const n=[];for(const r of t){if(n.length===0){n.push({...r});continue}const a=n.at(-1),s=rm(a.htmlStyle||Rc(a)),u=rm(r.htmlStyle||Rc(r)),d=a.fontStyle&&(a.fontStyle&Mt.Underline||a.fontStyle&Mt.Strikethrough),f=r.fontStyle&&(r.fontStyle&Mt.Underline||r.fontStyle&Mt.Strikethrough);!d&&!f&&s===u?a.content+=r.content:n.push({...r})}return n})}const Pz=zt;function Uz(e,t,n){const r={meta:{},options:n,codeToHast:(s,u)=>Mc(e,s,u),codeToTokens:(s,u)=>Dc(e,s,u)};let a=Pz(Mc(e,t,n,r));for(const s of Oc(n))a=s.postprocess?.call(r,a,n)||a;return a}async function jz(e){const t=await tz(e);return{getLastGrammarState:(...n)=>az(t,...n),codeToTokensBase:(n,r)=>om(t,n,r),codeToTokensWithThemes:(n,r)=>fw(t,n,r),codeToTokens:(n,r)=>Dc(t,n,r),codeToHast:(n,r)=>Mc(t,n,r),codeToHtml:(n,r)=>Uz(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Vz(e){const t=e.langs,n=e.themes,r=e.engine;async function a(s){function u(m){if(typeof m=="string"){if(m=s.langAlias?.[m]||m,rw(m))return[];const y=t[m];if(!y)throw new We(`Language \`${m}\` is not included in this bundle. You may want to load it from external source.`);return y}return m}function d(m){if(ow(m))return"none";if(typeof m=="string"){const y=n[m];if(!y)throw new We(`Theme \`${m}\` is not included in this bundle. You may want to load it from external source.`);return y}return m}const f=(s.themes??[]).map(m=>d(m)),h=(s.langs??[]).map(m=>u(m)),p=await jz({engine:s.engine??r(),...s,themes:f,langs:h});return{...p,loadLanguage(...m){return p.loadLanguage(...m.map(u))},loadTheme(...m){return p.loadTheme(...m.map(d))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return a}const Bz=Vz({langs:Xp,themes:$N,engine:()=>(0,VE.createOnigurumaEngine)(k(()=>import("./wasm-CG6Dc4jp.js"),[],import.meta.url))}),u_=4294967295;var Fz=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;const{forgiving:n=!1,cache:r,regexConstructor:a}=t;if(!a)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(s=>{if(typeof s!="string")return s;const u=r?.get(s);if(u){if(u instanceof RegExp)return u;if(n)return null;throw u}try{const d=a(s);return r?.set(s,d),d}catch(d){if(r?.set(s,d),n)return null;throw d}})}findNextMatchSync(e,t,n){const r=typeof e=="string"?e:e.content,a=[];function s(u,d,f=0){return{index:u,captureIndices:d.indices.map(h=>h==null?{start:u_,end:u_,length:0}:{start:h[0]+f,end:h[1]+f,length:h[1]-h[0]})}}for(let u=0;u<this.regexps.length;u++){const d=this.regexps[u];if(d)try{d.lastIndex=t;const f=d.exec(r);if(!f)continue;if(f.index===t)return s(u,f,0);a.push([u,f,0])}catch(f){if(this.options.forgiving)continue;throw f}}if(a.length){const u=Math.min(...a.map(d=>d[1].index));for(const[d,f,h]of a)if(f.index===u)return s(d,f,h)}return null}};function La(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function Gz(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const hg=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),Ct=String.raw;function Ta(e,t){if(e==null)throw new Error(t??"Value expected");return e}const gw=Ct`\[\^?`,vw=`c.? | C(?:-.?)?|${Ct`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${Ct`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${Ct`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${Ct`o\{[^\}]*\}?`}|${Ct`\d{1,3}`}`,pg=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,zu=new RegExp(Ct`
|
|
46
|
+
\\ (?:
|
|
47
|
+
${vw}
|
|
48
|
+
| [gk]<[^>]*>?
|
|
49
|
+
| [gk]'[^']*'?
|
|
50
|
+
| .
|
|
51
|
+
)
|
|
52
|
+
| \( (?:
|
|
53
|
+
\? (?:
|
|
54
|
+
[:=!>({]
|
|
55
|
+
| <[=!]
|
|
56
|
+
| <[^>]*>
|
|
57
|
+
| '[^']*'
|
|
58
|
+
| ~\|?
|
|
59
|
+
| #(?:[^)\\]|\\.?)*
|
|
60
|
+
| [^:)]*[:)]
|
|
61
|
+
)?
|
|
62
|
+
| \*[^\)]*\)?
|
|
63
|
+
)?
|
|
64
|
+
| (?:${pg.source})+
|
|
65
|
+
| ${gw}
|
|
66
|
+
| .
|
|
67
|
+
`.replace(/\s+/g,""),"gsu"),Qh=new RegExp(Ct`
|
|
68
|
+
\\ (?:
|
|
69
|
+
${vw}
|
|
70
|
+
| .
|
|
71
|
+
)
|
|
72
|
+
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
73
|
+
| ${gw}
|
|
74
|
+
| &&
|
|
75
|
+
| .
|
|
76
|
+
`.replace(/\s+/g,""),"gsu");function $z(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 r=cH(n.flags),a=[r.extended],s={captureGroup:n.rules.captureGroup,getCurrentModX(){return a.at(-1)},numOpenGroups:0,popModX(){a.pop()},pushModX(m){a.push(m)},replaceCurrentModX(m){a[a.length-1]=m},singleline:n.rules.singleline};let u=[],d;for(zu.lastIndex=0;d=zu.exec(e);){const m=qz(s,e,d[0],zu.lastIndex);m.tokens?u.push(...m.tokens):m.token&&u.push(m.token),m.lastIndex!==void 0&&(zu.lastIndex=m.lastIndex)}const f=[];let h=0;u.filter(m=>m.type==="GroupOpen").forEach(m=>{m.kind==="capturing"?m.number=++h:m.raw==="("&&f.push(m)}),h||f.forEach((m,y)=>{m.kind="capturing",m.number=y+1});const p=h||f.length;return{tokens:u.map(m=>m.type==="EscapedNumber"?fH(m,p):m).flat(),flags:r}}function qz(e,t,n,r){const[a,s]=n;if(n==="["||n==="[^"){const u=Wz(t,n,r);return{tokens:u.tokens,lastIndex:u.lastIndex}}if(a==="\\"){if("AbBGyYzZ".includes(s))return{token:c_(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:iH(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:bw(n)}}if(s==="K")return{token:Sw("keep",n)};if(s==="N"||s==="R")return{token:Zr("newline",n,{negate:s==="N"})};if(s==="O")return{token:Zr("any",n)};if(s==="X")return{token:Zr("text_segment",n)};const u=yw(n,{inCharClass:!1});return Array.isArray(u)?{tokens:u}:{token:u}}if(a==="("){if(s==="*")return{token:sH(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:aH(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:la("group",n)};if(n==="(?>")return{token:la("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:la(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:la("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:la("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:eH(n)}}if(e.getCurrentModX()){if(n==="#"){const u=t.indexOf(`
|
|
77
|
+
`,r);return{lastIndex:u===-1?t.length:u}}if(/^\s$/.test(n)){const u=/\s+/y;return u.lastIndex=r,{lastIndex:u.exec(t)?u.lastIndex:r}}}if(n===".")return{token:Zr("dot",n)};if(n==="^"||n==="$"){const u=e.singleline?{"^":Ct`\A`,$:Ct`\Z`}[n]:n;return{token:c_(u,n)}}return n==="|"?{token:Kz(n)}:pg.test(n)?{tokens:hH(n)}:{token:Ri(La(n),n)}}function Wz(e,t,n){const r=[d_(t[1]==="^",t)];let a=1,s;for(Qh.lastIndex=n;s=Qh.exec(e);){const u=s[0];if(u[0]==="["&&u[1]!==":")a++,r.push(d_(u[1]==="^",u));else if(u==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(Ri(93,u));else if(a--,r.push(Xz(u)),!a)break}else{const d=Yz(u);Array.isArray(d)?r.push(...d):r.push(d)}}return{tokens:r,lastIndex:Qh.lastIndex||e.length}}function Yz(e){if(e[0]==="\\")return yw(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!hg.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return Zr("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?Qz(e):e==="&&"?Zz(e):Ri(La(e),e)}function yw(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return oH(e);if("dDhHsSwW".includes(n))return lH(e);if(e.startsWith(Ct`\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 uH(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const r=e.split(/\\x/).slice(1).map(u=>parseInt(u,16)),a=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),s=new TextEncoder;return[...a].map(u=>{const d=[...s.encode(u)].map(f=>`\\x${f.toString(16)}`).join("");return Ri(La(u),d)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Ri(dH(e),e);if(f_.has(n))return Ri(f_.get(n),e);if(/\d/.test(n))return Jz(t,e);if(e==="\\")throw new Error(Ct`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Ri(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function Kz(e){return{type:"Alternator",raw:e}}function c_(e,t){return{type:"Assertion",kind:e,raw:t}}function bw(e){return{type:"Backreference",raw:e}}function Ri(e,t){return{type:"Character",value:e,raw:t}}function Xz(e){return{type:"CharacterClassClose",raw:e}}function Qz(e){return{type:"CharacterClassHyphen",raw:e}}function Zz(e){return{type:"CharacterClassIntersector",raw:e}}function d_(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function Zr(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function Sw(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Ta(n.flags),raw:t}}function Jz(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function eH(e){return{type:"GroupClose",raw:e}}function la(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function tH(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function nH(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function iH(e){return{type:"Subroutine",raw:e}}const rH=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),f_=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function oH(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 Ri(La(t.toUpperCase())-64,e)}function aH(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??="";const a=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),s=p_(n),u=p_(r),d={};if(s&&(d.enable=s),u&&(d.disable=u),e.endsWith(")"))return t.replaceCurrentModX(a),Sw("flags",e,{flags:d});if(e.endsWith(":"))return t.pushModX(a),t.numOpenGroups++,la("group",e,{...(s||u)&&{flags:d}});throw new Error(`Unexpected flag modifier "${e}"`)}function sH(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:r,args:a}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const s=a?a.split(",").filter(p=>p!=="").map(p=>/^[+-]?\d+$/.test(p)?+p:p):[],[u,d,f]=s,h=rH.has(n)?n.toLowerCase():"custom";switch(h){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 u=="string")throw new Error(`Named callout argument must be a number "${u}"`);break;case"max":if(!s.length||s.length>2)throw new Error(`Named callout must have one or two arguments "${s}"`);if(typeof u=="string"&&!/^[A-Za-z_]\w*$/.test(u))throw new Error(`Named callout argument one must be a tag or number "${u}"`);if(s.length===2&&(typeof d=="number"||!/^[<>X]$/.test(d)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${d}"`);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 u=="number"||!/^[<>X]$/.test(u)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${u}"`);break;case"cmp":if(s.length!==3)throw new Error(`Named callout must have three arguments "${s}"`);if(typeof u=="string"&&!/^[A-Za-z_]\w*$/.test(u))throw new Error(`Named callout argument one must be a tag or number "${u}"`);if(typeof d=="number"||!/^(?:[<>!=]=|[<>])$/.test(d))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${d}"`);if(typeof f=="string"&&!/^[A-Za-z_]\w*$/.test(f))throw new Error(`Named callout argument three must be a tag or number "${f}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${h}"`)}return tH(h,r??null,a?.split(",")??null,e)}function h_(e){let t=null,n,r;if(e[0]==="{"){const{minStr:a,maxStr:s}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,u=1e5;if(+a>u||s&&+s>u)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+a,r=s===void 0?+a:s===""?1/0:+s,n>r&&(t="possessive",[n,r]=[r,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,r=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return nH(t,n,r,e)}function lH(e){const t=e[1].toLowerCase();return Zr({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function uH(e){const{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return Zr("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function p_(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 cH(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 r=e[n];if(!"imxDPSWy".includes(r))throw new Error(`Invalid flag "${r}"`);if(r==="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"}[r]]=!0}return t}function dH(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 fH(e,t){const{raw:n,inCharClass:r}=e,a=n.slice(1);if(!r&&(a!=="0"&&a.length===1||a[0]!=="0"&&+a<=t))return[bw(n)];const s=[],u=a.match(/^[0-7]+|\d/g);for(let d=0;d<u.length;d++){const f=u[d];let h;if(d===0&&f!=="8"&&f!=="9"){if(h=parseInt(f,8),h>127)throw new Error(Ct`Octal encoded byte above 177 unsupported "${n}"`)}else h=La(f);s.push(Ri(h,(d===0?"\\":"")+f))}return s}function hH(e){const t=[],n=new RegExp(pg,"gy");let r;for(;r=n.exec(e);){const a=r[0];if(a[0]==="{"){const s=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(a);if(s){const{min:u,max:d}=s.groups;if(+u>+d&&a.endsWith("?")){n.lastIndex--,t.push(h_(a.slice(0,-1)));continue}}}t.push(h_(a))}return t}function _w(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(r=>t[r]===n[r])}function pH(e){return mH.has(e.type)}const mH=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Cw(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=$z(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),a=(y,b)=>{const S=r.tokens[s.nextIndex];switch(s.parent=y,s.nextIndex++,S.type){case"Alternator":return co();case"Assertion":return gH(S);case"Backreference":return vH(S,s);case"Character":return sd(S.value,{useLastValid:!!b.isCheckingRangeEnd});case"CharacterClassHyphen":return yH(S,s,b);case"CharacterClassOpen":return bH(S,s,b);case"CharacterSet":return SH(S,s);case"Directive":return kH(S.kind,{flags:S.flags});case"GroupOpen":return _H(S,s,b);case"NamedCallout":return TH(S.kind,S.tag,S.arguments);case"Quantifier":return CH(S,s);case"Subroutine":return xH(S,s);default:throw new Error(`Unexpected token type "${S.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:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:a},u=RH(LH(r.flags));let d=u.body[0];for(;s.nextIndex<r.tokens.length;){const y=a(d,{});y.type==="Alternative"?(u.body.push(y),d=y):d.body.push(y)}const{capturingGroups:f,hasNumberedRef:h,namedGroupsByName:p,subroutines:m}=s;if(h&&p.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:y}of m)if(typeof y=="number"){if(y>f.length)throw new Error("Subroutine uses a group number that's not defined");y&&(f[y-1].isSubroutined=!0)}else if(p.has(y)){if(p.get(y).length>1)throw new Error(Ct`Subroutine uses a duplicate group name "\g<${y}>"`);p.get(y)[0].isSubroutined=!0}else throw new Error(Ct`Subroutine uses a group name that's not defined "\g<${y}>"`);return u}function gH({kind:e}){return am(Ta({"^":"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===Ct`\B`||e===Ct`\Y`})}function vH({raw:e},t){const n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),a=(s,u=!1)=>{const d=t.capturingGroups.length;let f=!1;if(s>d)if(t.skipBackrefValidation)f=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,sm(u?d+1-s:s,{orphan:f})};if(n){const s=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(s)return a(+s.groups.num,!!s.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${e}"`);return sm(r)}return a(+r)}function yH(e,t,n){const{tokens:r,walk:a}=t,s=t.parent,u=s.body.at(-1),d=r[t.nextIndex];if(!n.isCheckingRangeEnd&&u&&u.type!=="CharacterClass"&&u.type!=="CharacterClassRange"&&d&&d.type!=="CharacterClassOpen"&&d.type!=="CharacterClassClose"&&d.type!=="CharacterClassIntersector"){const f=a(s,{...n,isCheckingRangeEnd:!0});if(u.type==="Character"&&f.type==="Character")return s.body.pop(),wH(u,f);throw new Error("Invalid character class range")}return sd(La("-"))}function bH({negate:e},t,n){const{tokens:r,walk:a}=t,s=[lc()],u=r[t.nextIndex];let d=v_(u);for(;d.type!=="CharacterClassClose";){if(d.type==="CharacterClassIntersector")s.push(lc()),t.nextIndex++;else{const h=s.at(-1);h.body.push(a(h,n))}d=v_(r[t.nextIndex],u)}const f=lc({negate:e});return s.length===1?f.body=s[0].body:(f.kind="intersection",f.body=s.map(h=>h.body.length===1?h.body[0]:h)),t.nextIndex++,f}function SH({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:a,skipPropertyNameValidation:s,unicodePropertyMap:u}=r;if(e==="property"){const d=ld(n);if(hg.has(d)&&!u?.has(d))e="posix",n=d;else return ua(n,{negate:t,normalizeUnknownPropertyNames:a,skipPropertyNameValidation:s,unicodePropertyMap:u})}return e==="posix"?AH(n,{negate:t}):lm(e,{negate:t})}function _H(e,t,n){const{tokens:r,capturingGroups:a,namedGroupsByName:s,skipLookbehindValidation:u,walk:d}=t,f=OH(e),h=f.type==="AbsenceFunction",p=g_(f),m=p&&f.negate;if(f.type==="CapturingGroup"&&(a.push(f),f.name&&Gz(s,f.name,[]).push(f)),h&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let y=y_(r[t.nextIndex]);for(;y.type!=="GroupClose";){if(y.type==="Alternator")f.body.push(co()),t.nextIndex++;else{const b=f.body.at(-1),S=d(b,{...n,isInAbsenceFunction:n.isInAbsenceFunction||h,isInLookbehind:n.isInLookbehind||p,isInNegLookbehind:n.isInNegLookbehind||m});if(b.body.push(S),(p||n.isInLookbehind)&&!u){const _="Lookbehind includes a pattern not allowed by Oniguruma";if(m||n.isInNegLookbehind){if(m_(S)||S.type==="CapturingGroup")throw new Error(_)}else if(m_(S)||g_(S)&&S.negate)throw new Error(_)}}y=y_(r[t.nextIndex])}return t.nextIndex++,f}function CH({kind:e,min:t,max:n},r){const a=r.parent,s=a.body.at(-1);if(!s||!pH(s))throw new Error("Quantifier requires a repeatable token");const u=Ew(e,t,n,s);return a.body.pop(),u}function xH({raw:e},t){const{capturingGroups:n,subroutines:r}=t;let a=e.slice(3,-1);const s=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(a);if(s){const d=+s.groups.num,f=n.length;if(t.hasNumberedRef=!0,a={"":d,"+":f+d,"-":f+1-d}[s.groups.sign],a<1)throw new Error("Invalid subroutine number")}else a==="0"&&(a=0);const u=ww(a);return r.push(u),u}function EH(e,t){return{type:"AbsenceFunction",kind:e,body:ol(t?.body)}}function co(e){return{type:"Alternative",body:kw(e?.body)}}function am(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function sm(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function xw(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!DH(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:ol(t?.body)}}function sd(e,t){const n={useLastValid:!1,...t};if(e>1114111){const r=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:e}}function lc(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:kw(e?.body)}}function wH(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function lm(e,t){const n=!!t?.negate,r={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(r.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(r.variableLength=!0),r}function kH(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:Ta(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function LH(e){return{type:"Flags",...e}}function Rn(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:ol(e?.body)}}function Kr(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:ol(e?.body)}}function TH(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function AH(e,t){const n=!!t?.negate;if(!hg.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function Ew(e,t,n,r){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:r}}function RH(e,t){return{type:"Regex",body:ol(t?.body),flags:e}}function ww(e){return{type:"Subroutine",ref:e}}function ua(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let r=n.unicodePropertyMap?.get(ld(e));if(!r){if(n.normalizeUnknownPropertyNames)r=MH(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(Ct`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function OH({flags:e,kind:t,name:n,negate:r,number:a}){switch(t){case"absence_repeater":return EH("repeater");case"atomic":return Rn({atomic:!0});case"capturing":return xw(a,{name:n});case"group":return Rn({flags:e});case"lookahead":case"lookbehind":return Kr({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function ol(e){if(e===void 0)e=[co()];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 kw(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 m_(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function g_(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function DH(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function MH(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 ld(e){return e.replace(/[- _]+/g,"").toLowerCase()}function v_(e,t){const n=t;return Ta(e,`Unclosed character class${n?.type==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function y_(e){return Ta(e,"Unclosed group")}function Is(e,t,n=null){function r(s,u){for(let d=0;d<s.length;d++){const f=a(s[d],u,d,s);d=Math.max(-1,d+f)}}function a(s,u=null,d=null,f=null){let h=0,p=!1;const m={node:s,parent:u,key:d,container:f,root:e,remove(){Hu(f).splice(Math.max(0,ra(d)+h),1),h--,p=!0},removeAllNextSiblings(){return Hu(f).splice(ra(d)+1)},removeAllPrevSiblings(){const x=ra(d)+h;return h-=x,Hu(f).splice(0,Math.max(0,x))},replaceWith(x,E={}){const L=!!E.traverse;f?f[Math.max(0,ra(d)+h)]=x:Ta(u,"Can't replace root node")[d]=x,L&&a(x,u,d,f),p=!0},replaceWithMultiple(x,E={}){const L=!!E.traverse;if(Hu(f).splice(Math.max(0,ra(d)+h),1,...x),h+=x.length-1,L){let R=0;for(let D=0;D<x.length;D++)R+=a(x[D],u,ra(d)+D+R,f)}p=!0},skip(){p=!0}},{type:y}=s,b=t["*"],S=t[y],_=typeof b=="function"?b:b?.enter,w=typeof S=="function"?S:S?.enter;if(_?.(m,n),w?.(m,n),!p)switch(y){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":r(s.body,s);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":a(s.min,s,"min"),a(s.max,s,"max");break;case"Quantifier":a(s.body,s,"body");break;case"Regex":r(s.body,s),a(s.flags,s,"flags");break;default:throw new Error(`Unexpected node type "${y}"`)}return S?.exit?.(m,n),b?.exit?.(m,n),h}return a(e),e}function Hu(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function ra(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const NH=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function IH(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function zH(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}const En=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function mg(e,t,n,r){const a=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),s=[!1];let u=0,d="";for(const f of e.matchAll(a)){const{0:h,groups:{$skip:p}}=f;if(!p&&(!r||r===En.DEFAULT==!u)){n instanceof Function?d+=n(f,{context:u?En.CHAR_CLASS:En.DEFAULT,negated:s[s.length-1]}):d+=n;continue}h[0]==="["?(u++,s.push(h[1]==="^")):h==="]"&&u&&(u--,s.pop()),d+=h}return d}function Lw(e,t,n,r){mg(e,t,n,r)}function HH(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;const a=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");a.lastIndex=n;let s=0,u;for(;u=a.exec(e);){const{0:d,groups:{$skip:f}}=u;if(!f&&(!r||r===En.DEFAULT==!s))return u;d==="["?s++:d==="]"&&s&&s--,a.lastIndex==u.index&&a.lastIndex++}return null}function Pu(e,t,n){return!!HH(e,t,0,n)}function PH(e,t){const n=/\\?./gsu;n.lastIndex=t;let r=e.length,a=0,s=1,u;for(;u=n.exec(e);){const[d]=u;if(d==="[")a++;else if(a)d==="]"&&a--;else if(d==="(")s++;else if(d===")"&&(s--,!s)){r=u.index;break}}return e.slice(t,r)}const b_=new RegExp(String.raw`(?<noncapturingStart>${NH})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function UH(e,t){const n=t?.hiddenCaptures??[];let r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};const a="(?>",s="(?:(?=(",u=[0],d=[];let f=0,h=0,p=NaN,m;do{m=!1;let y=0,b=0,S=!1,_;for(b_.lastIndex=Number.isNaN(p)?0:p+s.length;_=b_.exec(e);){const{0:w,index:x,groups:{capturingStart:E,noncapturingStart:L}}=_;if(w==="[")y++;else if(y)w==="]"&&y--;else if(w===a&&!S)p=x,S=!0;else if(S&&L)b++;else if(E)S?b++:(f++,u.push(f+h));else if(w===")"&&S){if(!b){h++;const R=f+h;if(e=`${e.slice(0,p)}${s}${e.slice(p+a.length,x)}))<$$${R}>)${e.slice(x+1)}`,m=!0,d.push(R),IH(n,R),r.size){const D=new Map;r.forEach((N,H)=>{D.set(H>=R?H+1:H,N.map(U=>U>=R?U+1:U))}),r=D}break}b--}}}while(m);return n.push(...d),e=mg(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:y,groups:{backrefNum:b,wrappedBackrefNum:S}})=>{if(b){const _=+b;if(_>u.length-1)throw new Error(`Backref "${y}" greater than number of captures`);return`\\${u[_]}`}return`\\${S}`},En.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}const Tw=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Zh=new RegExp(String.raw`
|
|
78
|
+
\\(?: \d+
|
|
79
|
+
| c[A-Za-z]
|
|
80
|
+
| [gk]<[^>]+>
|
|
81
|
+
| [pPu]\{[^\}]+\}
|
|
82
|
+
| u[A-Fa-f\d]{4}
|
|
83
|
+
| x[A-Fa-f\d]{2}
|
|
84
|
+
)
|
|
85
|
+
| \((?: \? (?: [:=!>]
|
|
86
|
+
| <(?:[=!]|[^>]+>)
|
|
87
|
+
| [A-Za-z\-]+:
|
|
88
|
+
| \(DEFINE\)
|
|
89
|
+
))?
|
|
90
|
+
| (?<qBase>${Tw})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
91
|
+
| \\?.
|
|
92
|
+
`.replace(/\s+/g,""),"gsu");function jH(e){if(!new RegExp(`${Tw}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,a="",s=0,u;for(Zh.lastIndex=0;u=Zh.exec(e);){const{0:d,index:f,groups:{qBase:h,qMod:p,invalidQ:m}}=u;if(d==="[")s||(r=f),s++;else if(d==="]")s?s--:r=null;else if(!s)if(p==="+"&&a&&!a.startsWith("(")){if(m)throw new Error(`Invalid quantifier "${d}"`);let y=-1;if(/^\{\d+\}$/.test(h))e=zH(e,f+h.length,p,"");else{if(a===")"||a==="]"){const b=a===")"?n:r;if(b===null)throw new Error(`Invalid unmatched "${a}"`);e=`${e.slice(0,b)}(?>${e.slice(b,f)}${h})${e.slice(f+d.length)}`}else e=`${e.slice(0,f-a.length)}(?>${a}${h})${e.slice(f+d.length)}`;y+=4}Zh.lastIndex+=y}else d[0]==="("?t.push(f):d===")"&&(n=t.length?t.pop():null);a=d}return{pattern:e}}const xn=String.raw,VH=xn`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,um=xn`\(\?R=(?<rDepth>[^\)]+)\)|${VH}`,ud=xn`\(\?<(?![=!])(?<captureName>[^>]+)>`,Aw=xn`${ud}|(?<unnamed>\()(?!\?)`,qr=new RegExp(xn`${ud}|${um}|\(\?|\\?.`,"gsu"),Jh="Cannot use multiple overlapping recursions";function BH(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let a=t?.captureTransfers??new Map;if(!new RegExp(um,"su").test(e))return{pattern:e,captureTransfers:a,hiddenCaptures:n};if(r==="plugin"&&Pu(e,xn`\(\?\(DEFINE\)`,En.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const s=[],u=Pu(e,xn`\\[1-9]`,En.DEFAULT),d=new Map,f=[];let h=!1,p=0,m=0,y;for(qr.lastIndex=0;y=qr.exec(e);){const{0:b,groups:{captureName:S,rDepth:_,gRNameOrNum:w,gRDepth:x}}=y;if(b==="[")p++;else if(p)b==="]"&&p--;else if(_){if(S_(_),h)throw new Error(Jh);if(u)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const E=e.slice(0,y.index),L=e.slice(qr.lastIndex);if(Pu(L,um,En.DEFAULT))throw new Error(Jh);const R=+_-1;e=__(E,L,R,!1,n,s,m),a=x_(a,E,R,s.length,0,m);break}else if(w){S_(x);let E=!1;for(const V of f)if(V.name===w||V.num===+w){if(E=!0,V.hasRecursedWithin)throw new Error(Jh);break}if(!E)throw new Error(xn`Recursive \g cannot be used outside the referenced group "${r==="external"?w:xn`\g<${w}&R=${x}>`}"`);const L=d.get(w),R=PH(e,L);if(u&&Pu(R,xn`${ud}|\((?!\?)`,En.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const D=e.slice(L,y.index),N=R.slice(D.length+b.length),H=s.length,U=+x-1,W=__(D,N,U,!0,n,s,m);a=x_(a,D,U,s.length-H,H,m);const ee=e.slice(0,L),te=e.slice(L+R.length);e=`${ee}${W}${te}`,qr.lastIndex+=W.length-b.length-D.length-N.length,f.forEach(V=>V.hasRecursedWithin=!0),h=!0}else if(S)m++,d.set(String(m),qr.lastIndex),d.set(S,qr.lastIndex),f.push({num:m,name:S});else if(b[0]==="("){const E=b==="(";E&&(m++,d.set(String(m),qr.lastIndex)),f.push(E?{num:m}:{})}else b===")"&&f.pop()}return n.push(...s),{pattern:e,captureTransfers:a,hiddenCaptures:n}}function S_(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 __(e,t,n,r,a,s,u){const d=new Set;r&&Lw(e+t,ud,({groups:{captureName:h}})=>{d.add(h)},En.DEFAULT);const f=[n,r?d:null,a,s,u];return`${e}${C_(`(?:${e}`,"forward",...f)}(?:)${C_(`${t})`,"backward",...f)}${t}`}function C_(e,t,n,r,a,s,u){const f=p=>t==="forward"?p+2:n-p+2-1;let h="";for(let p=0;p<n;p++){const m=f(p);h+=mg(e,xn`${Aw}|\\k<(?<backref>[^>]+)>`,({0:y,groups:{captureName:b,unnamed:S,backref:_}})=>{if(_&&r&&!r.has(_))return y;const w=`_$${m}`;if(S||b){const x=u+s.length+1;return s.push(x),FH(a,x),S?y:`(?<${b}${w}>`}return xn`\k<${_}${w}>`},En.DEFAULT)}return h}function FH(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function x_(e,t,n,r,a,s){if(e.size&&r){let u=0;Lw(t,Aw,()=>u++,En.DEFAULT);const d=s-u+a,f=new Map;return e.forEach((h,p)=>{const m=(r-u*n)/n,y=u*n,b=p>d+u?p+r:p,S=[];for(const _ of h)if(_<=d)S.push(_);else if(_>d+u+m)S.push(_+r);else if(_<=d+u)for(let w=0;w<=n;w++)S.push(_+u*w);else for(let w=0;w<=n;w++)S.push(_+y+m*w);f.set(b,S)}),f}return e}var mt=String.fromCodePoint,_e=String.raw,Dn={},cd=globalThis.RegExp;Dn.flagGroups=(()=>{try{new cd("(?i:)")}catch{return!1}return!0})();Dn.unicodeSets=(()=>{try{new cd("[[]]","v")}catch{return!1}return!0})();Dn.bugFlagVLiteralHyphenIsRange=Dn.unicodeSets?(()=>{try{new cd(_e`[\d\-a]`,"v")}catch{return!0}return!1})():!1;Dn.bugNestedClassIgnoresNegation=Dn.unicodeSets&&new cd("[[^a]]","v").test("a");function Nc(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function qs(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function cm(e,t){return E_[e]>=E_[t]}function GH(e,t){if(e==null)throw new Error(t??"Value expected");return e}var E_={ES2025:2025,ES2024:2024,ES2018:2018},$H={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function Rw(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!$H[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=Dn.flagGroups?"ES2025":Dn.unicodeSets?"ES2024":"ES2018"),t}var qH="[ -\r ]",WH=new Set([mt(304),mt(305)]),Ei=_e`[\p{L}\p{M}\p{N}\p{Pc}]`;function Ow(e){if(WH.has(e))return[e];const t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),a=XH.get(n),s=YH.get(n),u=KH.get(n);return[...r].length===1&&t.add(r),u&&t.add(u),a&&t.add(a),t.add(n),s&&t.add(s),[...t]}var gg=new Map(`C Other
|
|
93
|
+
Cc Control cntrl
|
|
94
|
+
Cf Format
|
|
95
|
+
Cn Unassigned
|
|
96
|
+
Co Private_Use
|
|
97
|
+
Cs Surrogate
|
|
98
|
+
L Letter
|
|
99
|
+
LC Cased_Letter
|
|
100
|
+
Ll Lowercase_Letter
|
|
101
|
+
Lm Modifier_Letter
|
|
102
|
+
Lo Other_Letter
|
|
103
|
+
Lt Titlecase_Letter
|
|
104
|
+
Lu Uppercase_Letter
|
|
105
|
+
M Mark Combining_Mark
|
|
106
|
+
Mc Spacing_Mark
|
|
107
|
+
Me Enclosing_Mark
|
|
108
|
+
Mn Nonspacing_Mark
|
|
109
|
+
N Number
|
|
110
|
+
Nd Decimal_Number digit
|
|
111
|
+
Nl Letter_Number
|
|
112
|
+
No Other_Number
|
|
113
|
+
P Punctuation punct
|
|
114
|
+
Pc Connector_Punctuation
|
|
115
|
+
Pd Dash_Punctuation
|
|
116
|
+
Pe Close_Punctuation
|
|
117
|
+
Pf Final_Punctuation
|
|
118
|
+
Pi Initial_Punctuation
|
|
119
|
+
Po Other_Punctuation
|
|
120
|
+
Ps Open_Punctuation
|
|
121
|
+
S Symbol
|
|
122
|
+
Sc Currency_Symbol
|
|
123
|
+
Sk Modifier_Symbol
|
|
124
|
+
Sm Math_Symbol
|
|
125
|
+
So Other_Symbol
|
|
126
|
+
Z Separator
|
|
127
|
+
Zl Line_Separator
|
|
128
|
+
Zp Paragraph_Separator
|
|
129
|
+
Zs Space_Separator
|
|
130
|
+
ASCII
|
|
131
|
+
ASCII_Hex_Digit AHex
|
|
132
|
+
Alphabetic Alpha
|
|
133
|
+
Any
|
|
134
|
+
Assigned
|
|
135
|
+
Bidi_Control Bidi_C
|
|
136
|
+
Bidi_Mirrored Bidi_M
|
|
137
|
+
Case_Ignorable CI
|
|
138
|
+
Cased
|
|
139
|
+
Changes_When_Casefolded CWCF
|
|
140
|
+
Changes_When_Casemapped CWCM
|
|
141
|
+
Changes_When_Lowercased CWL
|
|
142
|
+
Changes_When_NFKC_Casefolded CWKCF
|
|
143
|
+
Changes_When_Titlecased CWT
|
|
144
|
+
Changes_When_Uppercased CWU
|
|
145
|
+
Dash
|
|
146
|
+
Default_Ignorable_Code_Point DI
|
|
147
|
+
Deprecated Dep
|
|
148
|
+
Diacritic Dia
|
|
149
|
+
Emoji
|
|
150
|
+
Emoji_Component EComp
|
|
151
|
+
Emoji_Modifier EMod
|
|
152
|
+
Emoji_Modifier_Base EBase
|
|
153
|
+
Emoji_Presentation EPres
|
|
154
|
+
Extended_Pictographic ExtPict
|
|
155
|
+
Extender Ext
|
|
156
|
+
Grapheme_Base Gr_Base
|
|
157
|
+
Grapheme_Extend Gr_Ext
|
|
158
|
+
Hex_Digit Hex
|
|
159
|
+
IDS_Binary_Operator IDSB
|
|
160
|
+
IDS_Trinary_Operator IDST
|
|
161
|
+
ID_Continue IDC
|
|
162
|
+
ID_Start IDS
|
|
163
|
+
Ideographic Ideo
|
|
164
|
+
Join_Control Join_C
|
|
165
|
+
Logical_Order_Exception LOE
|
|
166
|
+
Lowercase Lower
|
|
167
|
+
Math
|
|
168
|
+
Noncharacter_Code_Point NChar
|
|
169
|
+
Pattern_Syntax Pat_Syn
|
|
170
|
+
Pattern_White_Space Pat_WS
|
|
171
|
+
Quotation_Mark QMark
|
|
172
|
+
Radical
|
|
173
|
+
Regional_Indicator RI
|
|
174
|
+
Sentence_Terminal STerm
|
|
175
|
+
Soft_Dotted SD
|
|
176
|
+
Terminal_Punctuation Term
|
|
177
|
+
Unified_Ideograph UIdeo
|
|
178
|
+
Uppercase Upper
|
|
179
|
+
Variation_Selector VS
|
|
180
|
+
White_Space space
|
|
181
|
+
XID_Continue XIDC
|
|
182
|
+
XID_Start XIDS`.split(/\s/).map(e=>[ld(e),e])),YH=new Map([["s",mt(383)],[mt(383),"s"]]),KH=new Map([[mt(223),mt(7838)],[mt(107),mt(8490)],[mt(229),mt(8491)],[mt(969),mt(8486)]]),XH=new Map([gr(453),gr(456),gr(459),gr(498),...ep(8072,8079),...ep(8088,8095),...ep(8104,8111),gr(8124),gr(8140),gr(8188)]),QH=new Map([["alnum",_e`[\p{Alpha}\p{Nd}]`],["alpha",_e`\p{Alpha}`],["ascii",_e`\p{ASCII}`],["blank",_e`[\p{Zs}\t]`],["cntrl",_e`\p{Cc}`],["digit",_e`\p{Nd}`],["graph",_e`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",_e`\p{Lower}`],["print",_e`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",_e`[\p{P}\p{S}]`],["space",_e`\p{space}`],["upper",_e`\p{Upper}`],["word",_e`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",_e`\p{AHex}`]]);function ZH(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function gr(e){const t=mt(e);return[t.toLowerCase(),t]}function ep(e,t){return ZH(e,t).map(n=>gr(n))}var Dw=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function JH(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};Mw(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:cm(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};Is(e,eP,r);const a={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},s={currentFlags:a,prevFlags:null,globalFlags:a,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};Is(e,tP,s);const u={groupsByName:s.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:s.reffedNodesByReferencer};return Is(e,nP,u),e._originMap=s.groupOriginByCopy,e._strategy=r.strategy,e}var eP={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:a}=e;if(a==="repeater"){const s=Rn();s.body[0].body.push(Kr({negate:!0,body:r}),ua("Any"));const u=Rn();u.body[0].body.push(Ew("greedy",0,1/0,s)),n(rt(u,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){const a=e.body.filter(s=>s.kind==="flags");for(let s=n+1;s<t.body.length;s++){const u=t.body[s];qs(r,u,[]).push(...a)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const n=Iw(t.get(e));if(n){const r=Rn({flags:n});r.body[0].body=e.body,e.body=[rt(r,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:a,remove:s,replaceWith:u},d){const{kind:f,negate:h}=e,{asciiWordBoundaries:p,avoidSubclass:m,supportedGNodes:y,wordIsAscii:b}=d;if(f==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${h?"Y":"y"}"`);if(f==="line_end")u(rt(Kr({body:[co({body:[am("string_end")]}),co({body:[sd(10)]})]}),t));else if(f==="line_start")u(rt(wi(_e`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(f==="search_start")if(y.has(e))a.flags.sticky=!0,s();else{const S=r[n-1];if(S&&lP(S))u(rt(Kr({negate:!0}),t));else{if(m)throw new Error(_e`Uses "\G" in a way that requires a subclass`);u(vr(am("string_start"),t)),d.strategy="clip_search"}}else if(!(f==="string_end"||f==="string_start"))if(f==="string_end_newline")u(rt(wi(_e`(?=\n?\z)`),t));else if(f==="word_boundary"){if(!b&&!p){const S=`(?:(?<=${Ei})(?!${Ei})|(?<!${Ei})(?=${Ei}))`,_=`(?:(?<=${Ei})(?=${Ei})|(?<!${Ei})(?!${Ei}))`;u(rt(wi(h?_:S),t))}}else throw new Error(`Unexpected assertion kind "${f}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!np(n)&&(n=tp(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!np(r)&&(r=tp(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){const r=lc({body:[e]});n(rt(r,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:a,digitIsAscii:s,spaceIsAscii:u,wordIsAscii:d}){const{kind:f,negate:h,value:p}=e;if(s&&(f==="digit"||p==="digit")){n(vr(lm("digit",{negate:h}),t));return}if(u&&(f==="space"||p==="space")){n(rt(ip(wi(qH),h),t));return}if(d&&(f==="word"||p==="word")){n(vr(lm("word",{negate:h}),t));return}if(f==="any")n(vr(ua("Any"),t));else if(f==="digit")n(vr(ua("Nd",{negate:h}),t));else if(f!=="dot")if(f==="text_segment"){if(r==="strict")throw new Error(_e`Use of "\X" requires non-strict accuracy`);const m="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",y=_e`\p{RI}{2}|${m}(?:\u200D${m})*`;n(rt(wi(_e`(?>\r\n|${a?_e`\p{RGI_Emoji}`:y}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(f==="hex")n(vr(ua("AHex",{negate:h}),t));else if(f==="newline")n(rt(wi(h?`[^
|
|
183
|
+
]`:`(?>\r
|
|
184
|
+
?|[
|
|
185
|
+
\v\f
\u2028\u2029])`),t));else if(f==="posix")if(!a&&(p==="graph"||p==="print")){if(r==="strict")throw new Error(`POSIX class "${p}" requires min target ES2024 or non-strict accuracy`);let m={graph:"!-~",print:" -~"}[p];h&&(m=`\0-${mt(m.codePointAt(0)-1)}${mt(m.codePointAt(2)+1)}-`),n(rt(wi(`[${m}]`),t))}else n(rt(ip(wi(QH.get(p)),h),t));else if(f==="property")gg.has(ld(p))||(e.key="sc");else if(f==="space")n(vr(ua("space",{negate:h}),t));else if(f==="word")n(rt(ip(wi(Ei),h),t));else throw new Error(`Unexpected character set kind "${f}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:a,removeAllPrevSiblings:s,removeAllNextSiblings:u}){const{kind:d,flags:f}=e;if(d==="flags")if(!f.enable&&!f.disable)r();else{const h=Rn({flags:f});h.body[0].body=u(),a(rt(h,t),{traverse:!0})}else if(d==="keep"){const h=n.body[0],m=n.body.length===1&&_w(h,{type:"Group"})&&h.body[0].body.length===1?h.body[0]:n;if(t.parent!==m||m.body.length>1)throw new Error(_e`Uses "\K" in a way that's unsupported`);const y=Kr({behind:!0});y.body[0].body=s(),a(rt(y,t))}else throw new Error(`Unexpected directive kind "${d}"`)},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:r}=e;if(r==="fail")n(rt(Kr({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=Rn();t.body[0].body.push(e.body),e.body=rt(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,a=!1;for(const s of e.body)if(s.body.length===1&&s.body[0].kind==="search_start")s.body.pop();else{const u=Hw(s.body);u?(r=!0,Array.isArray(u)?n.push(...u):n.push(u)):a=!0}r&&!a&&n.forEach(s=>t.add(s))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(_e`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!np(n)&&(n=tp(n,t),e.ref=n)}},tP={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:a}=e;r||n.set(e,[...t.get(a).map(({node:s})=>s)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:a,groupsByName:s,multiplexCapturesToLeftByRef:u,openRefs:d,reffedNodesByReferencer:f}){const h=a.get(e);if(h&&d.has(e.number)){const m=vr(w_(e.number),t);f.set(m,d.get(e.number)),n(m);return}d.set(e.number,e),u.set(e.number,[]),e.name&&qs(u,e.name,[]);const p=u.get(e.name??e.number);for(let m=0;m<p.length;m++){const y=p[m];if(h===y.node||h&&h===y.origin||e===y.origin){p.splice(m,1);break}}if(u.get(e.number).push({node:e,origin:h}),e.name&&u.get(e.name).push({node:e,origin:h}),e.name){const m=qs(s,e.name,new Map);let y=!1;if(h)y=!0;else for(const b of m.values())if(!b.hasDuplicateNameToRemove){y=!0;break}s.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:y})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=Nc(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){const{isRecursive:a,ref:s}=e;if(a){let p=t;for(;(p=p.parent)&&!(p.type==="CapturingGroup"&&(p.name===s||p.number===s)););r.reffedNodesByReferencer.set(e,p);return}const u=r.subroutineRefMap.get(s),d=s===0,f=d?w_(0):Nw(u,r.groupOriginByCopy,null);let h=f;if(!d){const p=Iw(oP(u,y=>y.type==="Group"&&!!y.flags)),m=p?Nc(r.globalFlags,p):r.globalFlags;iP(m,r.currentFlags)||(h=Rn({flags:aP(m)}),h.body[0].body.push(f))}n(rt(h,t),{traverse:!d})}},nP={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const s=r.reffedNodesByReferencer.get(e).filter(u=>rP(u,e));if(!s.length)n(rt(Kr({negate:!0}),t));else if(s.length>1){const u=Rn({atomic:!0,body:s.reverse().map(d=>co({body:[sm(d.number)]}))});n(rt(u,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 r=0;r<n;r++){const a=xw();e.body.at(-1).body.push(a)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function Mw(e){Is(e,{"*"({node:t,parent:n}){t.parent=n}})}function iP(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function rP(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const r=zw(n.parent);for(const a of r){if(a===n)break;if(a===e||Pw(a,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function Nw(e,t,n,r){const a=Array.isArray(e)?[]:{};for(const[s,u]of Object.entries(e))s==="parent"?a.parent=Array.isArray(n)?r:n:u&&typeof u=="object"?a[s]=Nw(u,t,a,n):(s==="type"&&u==="CapturingGroup"&&t.set(a,t.get(e)??e),a[s]=u);return a}function w_(e){const t=ww(e);return t.isRecursive=!0,t}function oP(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function tp(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 Iw(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:r})=>{t.forEach(a=>{r.enable?.[a]&&(delete n.disable[a],n.enable[a]=!0),r.disable?.[a]&&(n.disable[a]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function aP({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 zw(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Hw(e){const t=e.find(n=>n.kind==="search_start"||uP(n,{negate:!1})||!sP(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 r of t.body){const a=Hw(r.body);if(!a)return null;Array.isArray(a)?n.push(...a):n.push(a)}return n}return null}function Pw(e,t){const n=zw(e)??[];for(const r of n)if(r===t||Pw(r,t))return!0;return!1}function sP({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function lP(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function uP(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&_w(e.body[0],{type:"Assertion",kind:"search_start"})}function np(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function wi(e,t){const r=Cw(e,{...t,unicodePropertyMap:gg}).body;return r.length>1||r[0].body.length>1?Rn({body:r}):r[0].body[0]}function ip(e,t){return e.negate=t,e}function vr(e,t){return e.parent=t,e}function rt(e,t){return Mw(e),e.parent=t,e}function cP(e,t){const n=Rw(t),r=cm(n.target,"ES2024"),a=cm(n.target,"ES2025"),s=n.rules.recursionLimit;if(!Number.isInteger(s)||s<2||s>20)throw new Error("Invalid recursionLimit; use 2-20");let u=null,d=null;if(!a){const b=[e.flags.ignoreCase];Is(e,dP,{getCurrentModI:()=>b.at(-1),popModI(){b.pop()},pushModI(S){b.push(S)},setHasCasedChar(){b.at(-1)?u=!0:d=!0}})}const f={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||u)&&!d)};let h=e;const p={accuracy:n.accuracy,appliedGlobalFlags:f,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:h,originMap:e._originMap,recursionLimit:s,useAppliedIgnoreCase:!!(!a&&u&&d),useFlagMods:a,useFlagV:r,verbose:n.verbose};function m(b){return p.lastNode=h,h=b,GH(fP[b.type],`Unexpected node type "${b.type}"`)(b,p,m)}const y={pattern:e.body.map(m).join("|"),flags:m(e.flags),options:{...e.options}};return r||(delete y.options.force.v,y.options.disable.v=!0,y.options.unicodeSetsPlugin=null),y._captureTransfers=new Map,y._hiddenCaptures=[],p.captureMap.forEach((b,S)=>{b.hidden&&y._hiddenCaptures.push(S),b.transferTo&&qs(y._captureTransfers,b.transferTo,[]).push(S)}),y}var dP={"*":{enter({node:e},t){if(L_(e)){const n=t.getCurrentModI();t.pushModI(e.flags?Nc({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){L_(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){vg(mt(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),Uw(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&Dw.has(e.value)&&t.setHasCasedChar()}},fP={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?_e`\B`:_e`\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:r,name:a,number:s}=e,u={ignoreCase:t.currentFlags.ignoreCase},d=t.originMap.get(e);return d&&(u.hidden=!0,s>d.number&&(u.transferTo=d.number)),t.captureMap.set(s,u),`(${a?`?<${a}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=mt(e),r=oa(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&vg(n)){const a=Ow(n);return t.inCharClass?a.join(""):a.length>1?`[${a.join("")}]`:a[0]}return n},CharacterClass(e,t,n){const{kind:r,negate:a,parent:s}=e;let{body:u}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");Dn.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&u.some(T_)&&(u=[sd(45),...u.filter(h=>!T_(h))]);const d=()=>`[${a?"^":""}${u.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||Dn.bugNestedClassIgnoresNegation)&&!a){const p=u.filter(m=>m.type==="CharacterClass"&&m.kind==="union"&&m.negate);if(p.length){const m=Rn(),y=m.body[0];return m.parent=s,y.parent=m,u=u.filter(b=>!p.includes(b)),e.body=u,u.length?(e.parent=y,y.body.push(e)):m.body.pop(),p.forEach(b=>{const S=co({body:[b]});b.parent=S,S.parent=m,m.body.push(S)}),n(m)}}t.inCharClass=!0;const h=d();return t.inCharClass=!1,h}const f=u[0];if(r==="union"&&!a&&f&&((!t.useFlagV||!t.verbose)&&s.kind==="union"&&!(Dn.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&s.kind==="intersection"&&u.length===1&&f.type!=="CharacterClassRange"))return u.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 d()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,a={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},s=oa(n,a),u=oa(r,a),d=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const f=Uw(e);vP(f).forEach(p=>{d.add(Array.isArray(p)?`${oa(p[0],a)}-${oa(p[1],a)}`:oa(p,a))})}return`${s}-${u}${[...d].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},a){if(e==="dot")return a.currentFlags.dotAll?a.appliedGlobalFlags.dotAll||a.useFlagMods?".":"[^]":_e`[^\n]`;if(e==="digit")return t?_e`\D`:_e`\d`;if(e==="property"){if(a.useAppliedIgnoreCase&&a.currentFlags.ignoreCase&&Dw.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?_e`\P`:_e`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?_e`\W`:_e`\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:r},a,s){const u=a.currentFlags;n&&(a.currentFlags=Nc(u,n));const d=t.map(s).join("|"),f=!a.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!a.useFlagMods||!n)?d:`(?${yP(e,n,a.useFlagMods)}${d})`;return a.currentFlags=u,f},LookaroundAssertion({body:e,kind:t,negate:n},r,a){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(a).join("|")})`},Quantifier(e,t,n){return n(e.body)+bP(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return t===0?`(?R=${r})`:_e`\g<${t}&R=${r}>`}},hP=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),pP=new Set(["-","\\","]","^","["]),mP=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),k_=new Map([[9,_e`\t`],[10,_e`\n`],[11,_e`\v`],[12,_e`\f`],[13,_e`\r`],[8232,_e`\u2028`],[8233,_e`\u2029`],[65279,_e`\uFEFF`]]),gP=new RegExp("^\\p{Cased}$","u");function vg(e){return gP.test(e)}function Uw(e,t){const n=!!t?.firstOnly,r=e.min.value,a=e.max.value,s=[];if(r<65&&(a===65535||a>=131071)||r===65536&&a>=131071)return s;for(let u=r;u<=a;u++){const d=mt(u);if(!vg(d))continue;const f=Ow(d).filter(h=>{const p=h.codePointAt(0);return p<r||p>a});if(f.length&&(s.push(...f),n))break}return s}function oa(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(k_.has(e))return k_.get(e);if(e<32||e>126&&e<160||e>262143||t&&SP(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const a=n?r?mP:pP:hP,s=mt(e);return(a.has(s)?"\\":"")+s}function vP(e){const t=e.map(a=>a.codePointAt(0)).sort((a,s)=>a-s),n=[];let r=null;for(let a=0;a<t.length;a++)t[a+1]===t[a]+1?r??=t[a]:r===null?n.push(t[a]):(n.push([r,t[a]]),r=null);return n}function yP(e,t,n){if(e)return">";let r="";if(t&&n){const{enable:a,disable:s}=t;r=(a?.ignoreCase?"i":"")+(a?.dotAll?"s":"")+(s?"-":"")+(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")}return`${r}:`}function bP({kind:e,max:t,min:n}){let r;return!n&&t===1?r="?":!n&&t===1/0?r="*":n===1&&t===1/0?r="+":n===t?r=`{${n}}`:r=`{${n},${t===1/0?"":t}}`,r+{greedy:"",lazy:"?",possessive:"+"}[e]}function L_({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function SP(e){return e>47&&e<58}function T_({type:e,value:t}){return e==="Character"&&t===45}var _P=class dm extends RegExp{#e=new Map;#t=null;#i;#n=null;#r=null;rawOptions={};get source(){return this.#i||"(?:)"}constructor(t,n,r){const a=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw new Error("Cannot provide options when copying a regexp");const s=t;super(s,n),this.#i=s.source,s instanceof dm&&(this.#e=s.#e,this.#n=s.#n,this.#r=s.#r,this.rawOptions=s.rawOptions)}else{const s={hiddenCaptures:[],strategy:null,transfers:[],...r};super(a?"":t,n),this.#i=t,this.#e=xP(s.hiddenCaptures,s.transfers),this.#r=s.strategy,this.rawOptions=r??{}}a||(this.#t=this)}exec(t){if(!this.#t){const{lazyCompile:a,...s}=this.rawOptions;this.#t=new dm(this.#i,this.flags,s)}const n=this.global||this.sticky,r=this.lastIndex;if(this.#r==="clip_search"&&n&&r){this.lastIndex=0;const a=this.#o(t.slice(r));return a&&(CP(a,r,t,this.hasIndices),this.lastIndex+=r),a}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 r=[...n];n.length=1;let a;this.hasIndices&&(a=[...n.indices],n.indices.length=1);const s=[0];for(let u=1;u<r.length;u++){const{hidden:d,transferTo:f}=this.#e.get(u)??{};if(d?s.push(null):(s.push(n.length),n.push(r[u]),this.hasIndices&&n.indices.push(a[u])),f&&r[u]!==void 0){const h=s[f];if(!h)throw new Error(`Invalid capture transfer to "${h}"`);if(n[h]=r[u],this.hasIndices&&(n.indices[h]=a[u]),n.groups){this.#n||(this.#n=EP(this.source));const p=this.#n.get(f);p&&(n.groups[p]=r[u],this.hasIndices&&(n.indices.groups[p]=a[u]))}}}return n}};function CP(e,t,n,r){if(e.index+=t,e.input=n,r){const a=e.indices;for(let u=0;u<a.length;u++){const d=a[u];d&&(a[u]=[d[0]+t,d[1]+t])}const s=a.groups;s&&Object.keys(s).forEach(u=>{const d=s[u];d&&(s[u]=[d[0]+t,d[1]+t])})}}function xP(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,a]of t)for(const s of a)qs(n,s,{}).transferTo=r;return n}function EP(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,a=0,s;for(;s=t.exec(e);){const{0:u,groups:{capture:d,name:f}}=s;u==="["?r++:r?u==="]"&&r--:d&&(a++,f&&n.set(a,f))}return n}function wP(e,t){const n=kP(e,t);return n.options?new _P(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function kP(e,t){const n=Rw(t),r=Cw(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:gg}),a=JH(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),s=cP(a,n),u=BH(s.pattern,{captureTransfers:s._captureTransfers,hiddenCaptures:s._hiddenCaptures,mode:"external"}),d=jH(u.pattern),f=UH(d.pattern,{captureTransfers:u.captureTransfers,hiddenCaptures:u.hiddenCaptures}),h={pattern:f.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=f.hiddenCaptures.sort((S,_)=>S-_),m=Array.from(f.captureTransfers),y=a._strategy,b=h.pattern.length>=n.lazyCompileLength;(p.length||m.length||y||b)&&(h.options={...p.length&&{hiddenCaptures:p},...m.length&&{transfers:m},...y&&{strategy:y},...b&&{lazyCompile:b}})}return h}function LP(e,t){return wP(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function TP(e={}){const t={target:"auto",cache:new Map,...e};return t.regexConstructor||=n=>LP(n,{target:t.target}),{createScanner(n){return new Fz(n,t)},createString(n){return{content:n}}}}async function jw(e){if(IE())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=$h.get(e);if(t!=null)return t;try{let n=MN.get(e);if(n==null&&Object.prototype.hasOwnProperty.call(Xp,e)&&(n=Xp[e]),n==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const r=n().then(({default:a})=>{const s={name:e,data:a};return uo.has(e)||uo.set(e,s),s});return $h.set(e,r),await r}finally{$h.delete(e)}}function Vw(e){return uo.get(e)??jw(e)}const fm=new Set;function Ws(e){const t=[],n=new Set;for(const m of AP(e.themes)){const y=Bw(m)?m.getThemes():[m];for(const b of y){if(n.has(b.name))throw new Error(`Theme collection already contains theme "${b.name}"`);n.add(b.name),t.push(b)}}const r=Object.freeze([...t]),a=Object.freeze(r.filter(m=>m.colorScheme==="light")),s=Object.freeze(r.filter(m=>m.colorScheme==="dark")),u=new Map(r.map(m=>[m.name,m])),d=Object.freeze(r.map(m=>m.name)),f=Object.freeze(a.map(m=>m.name)),h=Object.freeze(s.map(m=>m.name));function p(m){if(m==null)return r;const{colorScheme:y,collection:b}=m;return b==null?y==="light"?a:y==="dark"?s:r:r.filter(S=>S.collection!==b?!1:y==null||S.colorScheme===y)}return{getTheme(m){return u.get(m)},getThemes(m){return p(m)},getThemeNames(m){return m?.collection==null?m?.colorScheme==="light"?f:m?.colorScheme==="dark"?h:d:p(m).map(y=>y.name)},hasTheme(m){return u.has(m)},orderBy(m){return Ws({themes:r.map((y,b)=>({descriptor:y,index:b})).sort((y,b)=>{const S=m(y.descriptor,b.descriptor);return S!==0?S:y.index-b.index}).map(y=>y.descriptor)})},pick(m){const y=[],b=new Set;for(const S of m){if(b.has(S))throw new Error(`Theme collection pick already includes theme "${S}"`);b.add(S);const _=u.get(S);if(_==null)throw new Error(`Theme collection does not contain theme "${S}"`);y.push(_)}return Ws({themes:y})},registerInto(m){for(const y of r)m.registerThemeIfAbsent(y.name,y.load)}}}function AP(e){return RP(e)?[e]:e}function RP(e){return Bw(e)||OP(e)}function OP(e){return typeof e.name=="string"&&typeof e.load=="function"}function Bw(e){return typeof e.getThemes=="function"}function Fw(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var DP=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},MP=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},NP=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function IP(){const e=new Map,t=new Map,n=new Map;let r=0;function a(x,E){if(e.has(x))throw new DP(x);e.set(x,E)}function s(x,E){return e.has(x)?!1:(e.set(x,E),!0)}function u(x){return e.has(x)}function d(x){const E=t.get(x);if(E!==void 0)return Promise.resolve(E);const L=n.get(x);if(L!==void 0)return L;const R=e.get(x);if(R===void 0)return Promise.reject(new MP(x));const D=r,N=R().then(H=>{const U=Fw(H);return D===r&&t.set(x,U),n.get(x)===N&&n.delete(x),U}).catch(H=>{throw n.get(x)===N&&n.delete(x),H});return n.set(x,N),N}function f(x){return Promise.all(x.map(E=>d(E)))}function h(x,E){t.set(x,E)}function p(x){for(const[E,L]of x)h(E,L)}function m(x){return t.get(x)}function y(x){const E=[];for(const L of x){const R=t.get(L);if(R===void 0)throw new NP(L);E.push(R)}return E}function b(x){return t.has(x)}function S(x){for(const E of x)if(!t.has(E))return!1;return!0}function _(x){const E=t.get(x);return E!==void 0?E:d(x)}function w(){r++,t.clear(),n.clear()}return{clearResolvedThemes:w,getResolvedOrResolveTheme:_,getResolvedTheme:m,getResolvedThemes:y,hasRegisteredTheme:u,hasResolvedTheme:b,hasResolvedThemes:S,registerTheme:a,registerThemeIfAbsent:s,resolveTheme:d,resolveThemes:f,seedResolvedTheme:h,seedResolvedThemes:p}}const Mn=IP();function hm(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let r;if(typeof n=="string"){if(r=Mn.getResolvedTheme(n),r==null)throw new Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else r=n,n=n.name,Mn.getResolvedTheme(n)==null&&Mn.seedResolvedTheme(n,r);fm.has(n)||(fm.add(n),t.loadThemeSync(r))}}function Gw({name:e,load:t,colorScheme:n,collection:r,displayName:a}){return{name:e,colorScheme:n,collection:r,displayName:a,load:zP(t)}}function zP(e){return async()=>rd(Fw(await e()))}const HP="pierre",PP=["pierre-dark","pierre-dark-soft","pierre-dark-vibrant","pierre-dark-protanopia-deuteranopia","pierre-dark-tritanopia"],$w=["pierre-light","pierre-light-soft","pierre-light-vibrant","pierre-light-protanopia-deuteranopia","pierre-light-tritanopia"],UP=[...$w,...PP],jP=new Set($w);function VP(e){return jP.has(e)?"light":"dark"}const BP={"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"},FP={"pierre-dark":()=>k(()=>import("./pierre-dark-CyvmCCZW.js"),[],import.meta.url),"pierre-dark-soft":()=>k(()=>import("./pierre-dark-soft-BHGpRqa4.js"),[],import.meta.url),"pierre-dark-vibrant":()=>k(()=>import("./pierre-dark-vibrant-BWBVywrn.js"),[],import.meta.url),"pierre-dark-protanopia-deuteranopia":()=>k(()=>import("./pierre-dark-protanopia-deuteranopia-Rgc0TwpF.js"),[],import.meta.url),"pierre-dark-tritanopia":()=>k(()=>import("./pierre-dark-tritanopia-Beq2gCRQ.js"),[],import.meta.url),"pierre-light":()=>k(()=>import("./pierre-light-480U9XYS.js"),[],import.meta.url),"pierre-light-soft":()=>k(()=>import("./pierre-light-soft-CVdyfjmI.js"),[],import.meta.url),"pierre-light-vibrant":()=>k(()=>import("./pierre-light-vibrant-DdTDNdfJ.js"),[],import.meta.url),"pierre-light-protanopia-deuteranopia":()=>k(()=>import("./pierre-light-protanopia-deuteranopia-CaVOBURG.js"),[],import.meta.url),"pierre-light-tritanopia":()=>k(()=>import("./pierre-light-tritanopia-B4_gpKOM.js"),[],import.meta.url)};function GP(e){return Gw({name:e,collection:HP,colorScheme:VP(e),displayName:BP[e],load:FP[e]})}const qw=Ws({themes:UP.map(e=>GP(e))}),$P="shiki",Ww=["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"],qP=["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"],WP=new Set(Ww);function YP(e){return WP.has(e)?"light":"dark"}const KP={andromeeda:()=>k(()=>import("./andromeeda-C4gqWexZ.js"),[],import.meta.url),"aurora-x":()=>k(()=>import("./aurora-x-D-2ljcwZ.js"),[],import.meta.url),"ayu-dark":()=>k(()=>import("./ayu-dark-DYE7WIF3.js"),[],import.meta.url),"ayu-light":()=>k(()=>import("./ayu-light-BA47KaF1.js"),[],import.meta.url),"ayu-mirage":()=>k(()=>import("./ayu-mirage-32ctXXKs.js"),[],import.meta.url),"catppuccin-frappe":()=>k(()=>import("./catppuccin-frappe-CZL1YF0i.js"),[],import.meta.url),"catppuccin-latte":()=>k(()=>import("./catppuccin-latte-DH-8KZSZ.js"),[],import.meta.url),"catppuccin-macchiato":()=>k(()=>import("./catppuccin-macchiato-B7yYVSCf.js"),[],import.meta.url),"catppuccin-mocha":()=>k(()=>import("./catppuccin-mocha-Ct7hS0mc.js"),[],import.meta.url),"dark-plus":()=>k(()=>import("./dark-plus-C3mMm8J8.js"),[],import.meta.url),dracula:()=>k(()=>import("./dracula-BzJJZx-M.js"),[],import.meta.url),"dracula-soft":()=>k(()=>import("./dracula-soft-BXkSAIEj.js"),[],import.meta.url),"everforest-dark":()=>k(()=>import("./everforest-dark-BgDCqdQA.js"),[],import.meta.url),"everforest-light":()=>k(()=>import("./everforest-light-C8M2exoo.js"),[],import.meta.url),"github-dark":()=>k(()=>import("./github-dark-DHJKELXO.js"),[],import.meta.url),"github-dark-default":()=>k(()=>import("./github-dark-default-Cuk6v7N8.js"),[],import.meta.url),"github-dark-dimmed":()=>k(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[],import.meta.url),"github-dark-high-contrast":()=>k(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[],import.meta.url),"github-light":()=>k(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url),"github-light-default":()=>k(()=>import("./github-light-default-D7oLnXFd.js"),[],import.meta.url),"github-light-high-contrast":()=>k(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[],import.meta.url),"gruvbox-dark-hard":()=>k(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[],import.meta.url),"gruvbox-dark-medium":()=>k(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[],import.meta.url),"gruvbox-dark-soft":()=>k(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[],import.meta.url),"gruvbox-light-hard":()=>k(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[],import.meta.url),"gruvbox-light-medium":()=>k(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[],import.meta.url),"gruvbox-light-soft":()=>k(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[],import.meta.url),horizon:()=>k(()=>import("./horizon-BUw7H-hv.js"),[],import.meta.url),"horizon-bright":()=>k(()=>import("./horizon-bright-CUuTKBJd.js"),[],import.meta.url),houston:()=>k(()=>import("./houston-DnULxvSX.js"),[],import.meta.url),"kanagawa-dragon":()=>k(()=>import("./kanagawa-dragon-BuwD2xS4.js"),[],import.meta.url),"kanagawa-lotus":()=>k(()=>import("./kanagawa-lotus-C3DzagqV.js"),[],import.meta.url),"kanagawa-wave":()=>k(()=>import("./kanagawa-wave-DFGoQZhC.js"),[],import.meta.url),laserwave:()=>k(()=>import("./laserwave-DUszq2jm.js"),[],import.meta.url),"light-plus":()=>k(()=>import("./light-plus-B7mTdjB0.js"),[],import.meta.url),"material-theme":()=>k(()=>import("./material-theme-D5KoaKCx.js"),[],import.meta.url),"material-theme-darker":()=>k(()=>import("./material-theme-darker-BfHTSMKl.js"),[],import.meta.url),"material-theme-lighter":()=>k(()=>import("./material-theme-lighter-B0m2ddpp.js"),[],import.meta.url),"material-theme-ocean":()=>k(()=>import("./material-theme-ocean-CyktbL80.js"),[],import.meta.url),"material-theme-palenight":()=>k(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[],import.meta.url),"min-dark":()=>k(()=>import("./min-dark-CafNBF8u.js"),[],import.meta.url),"min-light":()=>k(()=>import("./min-light-CTRr51gU.js"),[],import.meta.url),monokai:()=>k(()=>import("./monokai-BRVnQi9A.js"),[],import.meta.url),"night-owl":()=>k(()=>import("./night-owl-C39BiMTA.js"),[],import.meta.url),"night-owl-light":()=>k(()=>import("./night-owl-light-CMTm3GFP.js"),[],import.meta.url),nord:()=>k(()=>import("./nord-Ddv68eIx.js"),[],import.meta.url),"one-dark-pro":()=>k(()=>import("./one-dark-pro-DVMEJ2y_.js"),[],import.meta.url),"one-light":()=>k(()=>import("./one-light-C3Wv6jpd.js"),[],import.meta.url),plastic:()=>k(()=>import("./plastic-3e1v2bzS.js"),[],import.meta.url),poimandres:()=>k(()=>import("./poimandres-CS3Unz2-.js"),[],import.meta.url),red:()=>k(()=>import("./red-hvxz__6c.js"),[],import.meta.url),"rose-pine":()=>k(()=>import("./rose-pine-5qJOZa0Y.js"),[],import.meta.url),"rose-pine-dawn":()=>k(()=>import("./rose-pine-dawn-zx0QlTCp.js"),[],import.meta.url),"rose-pine-moon":()=>k(()=>import("./rose-pine-moon-C9pEdX9L.js"),[],import.meta.url),"slack-dark":()=>k(()=>import("./slack-dark-BthQWCQV.js"),[],import.meta.url),"slack-ochin":()=>k(()=>import("./slack-ochin-DqwNpetd.js"),[],import.meta.url),"snazzy-light":()=>k(()=>import("./snazzy-light-Bw305WKR.js"),[],import.meta.url),"solarized-dark":()=>k(()=>import("./solarized-dark-CpvCGNkr.js"),[],import.meta.url),"solarized-light":()=>k(()=>import("./solarized-light-Dlz6yCKv.js"),[],import.meta.url),"synthwave-84":()=>k(()=>import("./synthwave-84-CbfX1IO0.js"),[],import.meta.url),"tokyo-night":()=>k(()=>import("./tokyo-night-hegEt444.js"),[],import.meta.url),vesper:()=>k(()=>import("./vesper-DRje8inN.js"),[],import.meta.url),"vitesse-black":()=>k(()=>import("./vitesse-black-Bkuqu6BP.js"),[],import.meta.url),"vitesse-dark":()=>k(()=>import("./vitesse-dark-D0r3Knsf.js"),[],import.meta.url),"vitesse-light":()=>k(()=>import("./vitesse-light-CVO1_9PV.js"),[],import.meta.url)};function A_(e){return Gw({name:e,collection:$P,colorScheme:YP(e),load:KP[e]})}const Yw=Ws({themes:Object.freeze([...Ww.map(e=>A_(e)),...qP.map(e=>A_(e))])});Ws({themes:[qw,Yw]});function Kw(e){if(IE())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(Mn.hasRegisteredTheme(e))return;const t=Yw.getTheme(e);if(t!=null){Mn.registerThemeIfAbsent(t.name,t.load);return}throw new Error(`No valid theme loader registered for "${e}"`)}function Xw(e,t){if(t.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function XP(e){Kw(e);const t=await Mn.resolveTheme(e);return Xw(e,t),t}function QP(e){return Mn.getResolvedTheme(e)??XP(e)}let qn;async function Ic({themes:e,langs:t,preferredHighlighter:n="shiki-js"}){qn??=Bz({themes:[],langs:["text"],engine:n==="shiki-wasm"?jE(k(()=>import("./wasm-CG6Dc4jp.js"),[],import.meta.url)):TP()});const r=ZP(qn)?await qn:qn;qn=r;const a=[];for(const u of t){if(u==="text"||u==="ansi")continue;const d=Vw(u);"then"in d?a.push(d):qS(d,r)}const s=[];for(const u of e){const d=QP(u);"then"in d?s.push(d):hm(d,qn)}return(a.length>0||s.length>0)&&await Promise.all([Promise.all(a).then(u=>{qS(u,r)}),Promise.all(s).then(u=>{hm(u,r)})]),r}function Qw(){if(qn!=null&&!("then"in qn))return qn}function ZP(e=qn){return e!=null&&"then"in e}for(const e of qw.getThemes())Mn.registerThemeIfAbsent(e.name,e.load);function Ys(e=ot){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}function zs(e){for(const t of Ys(e))if(!fm.has(t))return!1;return!0}function pm(e){return Mn.hasResolvedThemes(e)}function Ai(e,t){return wa(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function dd(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 mm(e){return Ce({tagName:"div",children:[Ce({tagName:"div",children:e.annotations?.map(t=>Ce({tagName:"slot",properties:{name:t}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function JP(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 Zw({fileOrDiff:e,mode:t,stickyHeader:n}){const r="type"in e?e:void 0,a={"data-diffs-header":t,"data-change-type":r?.type,"data-sticky":n?"":void 0};return Ce({tagName:"div",children:[t==="custom"?Ce({tagName:"slot",properties:{name:nl}}):e8({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:r?.type??"file"}),...t==="custom"?[]:[t8(r)]],properties:a})}function e8({name:e,prevName:t,iconType:n}){const r=[Ce({tagName:"slot",properties:{name:ng}}),_c({name:JP(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(Ce({tagName:"div",children:[Ce({tagName:"bdi",children:[ei(t)]})],properties:{"data-prev-name":""}})),r.push(_c({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),r.push(Ce({tagName:"div",children:[Ce({tagName:"bdi",children:[ei(e)]})],properties:{"data-title":""}})),r.push(Ce({tagName:"slot",properties:{name:ig}})),Ce({tagName:"div",children:r,properties:{"data-header-content":""}})}function t8(e){const t=[];if(e!=null){let n=0,r=0;for(const a of e.hunks)n+=a.additionLines,r+=a.deletionLines;(r>0||n===0)&&t.push(Ce({tagName:"span",children:[ei(`-${r}`)],properties:{"data-deletions-count":""}})),(n>0||r===0)&&t.push(Ce({tagName:"span",children:[ei(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push(Ce({tagName:"slot",properties:{name:rg}})),Ce({tagName:"div",children:t,properties:{"data-metadata":""}})}function Jw(e){return Ce({tagName:"pre",properties:n8(e)})}function n8({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:a,totalLines:s,type:u,customProperties:d}){return{...d,"data-diff":u==="diff"?"":void 0,"data-file":u==="file"?"":void 0,"data-diff-type":u==="diff"?a?"split":"single":void 0,"data-overflow":r,"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 Yr=new Map;let i8=0;const ws={"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 Ht(e){if(Yr.has(e))return Yr.get(e)??"text";if(ws[e]!=null)return ws[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Yr.has(t[1]))return Yr.get(t[1])??"text";if(ws[t[1]]!=null)return ws[t[1]]??"text"}const n=e.match(/\.([^.]+)$/)?.[1]??"";return Yr.has(n)?Yr.get(n)??"text":ws[n]??"text"}function r8(){return i8}function o8(){return Object.fromEntries(Yr)}function e1(e,{theme:t,preferredHighlighter:n="shiki-js"}){return{langs:[e??"text"],themes:Ys(t),preferredHighlighter:n}}function Nn(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}function a8(e,t,n){const r=typeof n.lineInfo=="function"?n.lineInfo(t):n.lineInfo[t-1];if(r==null){const a=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(a,{node:e,line:t,state:n}),new Error(a)}return e.tagName="div",e.properties["data-line"]=r.lineNumber,e.properties["data-alt-line"]=r.altLineNumber,e.properties["data-line-type"]=r.type,e.properties["data-line-index"]=r.lineIndex,e.children.length===0&&e.children.push(ei(`
|
|
186
|
+
`)),e}const Uu=Symbol("no-token"),rp=Symbol("multiple-tokens");function t1(e){const t=s8(e);if(t!=null)return t;let n=Uu;const r=[];let a=[],s;const u=()=>{if(a.length===0||s==null){a=[],s=void 0;return}if(a.length===1){const f=a[0];if(f?.type==="element"){l8(f,s);for(const h of f.children)uc(h)}else uc(f);r.push(f),a=[],s=void 0;return}for(const f of a)uc(f);r.push(Ce({tagName:"span",properties:{"data-char":s},children:a})),a=[],s=void 0},d=f=>{if(f!==Uu){if(f===rp){n=rp;return}if(n===Uu){n=f;return}n!==f&&(n=rp)}};for(const f of e.children){const h=f.type==="element"?t1(f):Uu;if(d(h),typeof h!="number"){u(),r.push(f);continue}s!=null&&s!==h&&u(),s??=h,a.push(f)}return u(),e.children=r,n}function s8(e){const t=e.properties["data-char"];if(typeof t=="number")return t}function uc(e){if(e.type==="element"){e.properties["data-char"]=void 0;for(const t of e.children)uc(t)}}function l8(e,t){e.properties["data-char"]=t}function u8(e={}){const{classPrefix:t="__shiki_",classSuffix:n="",classReplacer:r=d=>d}=e,a=new Map;function s(d){return Object.entries(d).map(([f,h])=>`${f}:${h}`).join(";")}function u(d){const f=typeof d=="string"?d:s(d);let h=t+c8(f)+n;return h=r(h),a.has(h)||a.set(h,typeof d=="string"?d:{...d}),h}return{name:"@shikijs/transformers:style-to-class",pre(d){if(!d.properties.style)return;const f=u(d.properties.style);delete d.properties.style,this.addClassToHast(d,f)},tokens(d){for(const f of d)for(const h of f){if(!h.htmlStyle)continue;const p=u(h.htmlStyle);h.htmlStyle={},h.htmlAttrs||={},h.htmlAttrs.class?h.htmlAttrs.class+=` ${p}`:h.htmlAttrs.class=p}},getClassRegistry(){return a},getCSS(){let d="";for(const[f,h]of a.entries())d+=`.${f}{${typeof h=="string"?h:s(h)}}`;return d},clearRegistry(){a.clear()}}}function c8(e,t=0){let n=3735928559^t,r=1103547991^t;for(let a=0,s;a<e.length;a++)s=e.charCodeAt(a),n=Math.imul(n^s,2654435761),r=Math.imul(r^s,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36).slice(0,6)}function n1(e=!1,t=!1){const n={lineInfo:[]},r=[{line(a){return delete a.properties.class,a},pre(a){const s=n2(a),u=[];if(s!=null){let d=1;for(const f of s.children)f.type==="element"&&(e&&t1(f),u.push(a8(f,d,n)),d++);s.children=u}return a},...e?{tokens(a){for(const s of a){let u=0;for(const d of s){const f=d;f.__lineChar??=u,u+=d.content.length}}},preprocess(a,s){s.mergeWhitespaces="never"},span(a,s,u,d,f){if(f?.offset!=null&&f.content!=null){const h=f.__lineChar;return h!=null&&(a.properties["data-char"]=h),a}return a}}:null}];return t&&r.push(d8,R_),e&&r.push({line:a=>(a.type==="element"&&a.children.length===0&&a.children.push({type:"element",tagName:"br",properties:{},children:[]}),a)}),{state:n,transformers:r,toClass:R_}}const R_=u8({classPrefix:"hl-"}),d8={name:"token-style-normalizer",tokens(e){for(const t of e)for(const n of t){if(n.htmlStyle!=null)continue;const r={};n.color!=null&&(r.color=n.color),n.bgColor!=null&&(r["background-color"]=n.bgColor),n.fontStyle!=null&&n.fontStyle!==0&&((n.fontStyle&1)!==0&&(r["font-style"]="italic"),(n.fontStyle&2)!==0&&(r["font-weight"]="bold"),(n.fontStyle&4)!==0&&(r["text-decoration"]="underline")),Object.keys(r).length>0&&(n.htmlStyle=r)}}};function un(e){return`--${e==="token"?"diffs-token":"diffs"}-`}const f8=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,h8=/^0(?:\.0+)?%?$/;function p8(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 r=e.slice(t+1,-1).trim();if(r.length===0)return;const a=r.lastIndexOf("/");if(a!==-1)return r.slice(a+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){const s=r.split(",");if(s.length===4)return s[3]?.trim()}}function m8(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 r,a=1;return n.length===3?r=n.split("").map(s=>s+s).join(""):n.length===6?r=n:(r=n.slice(0,6),a=parseInt(n.slice(6,8),16)/255),[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16),a]}function op(e){if(e==null)return null;const t=m8(e);if(t==null)return null;const n=t[0]/255,r=t[1]/255,a=t[2]/255,s=u=>u<=.03928?u/12.92:((u+.055)/1.055)**2.4;return .2126*s(n)+.7152*s(r)+.0722*s(a)}function O_(e){if(e==null)return!1;const t=e.trim().toLowerCase();if(t==="transparent"||f8.test(t))return!0;const n=p8(t);return n!=null&&h8.test(n)}function g8(e,t,n){if(t==null||n==null)return!1;const r=op(e),a=op(t),s=op(n);return r==null||a==null||s==null?!1:Math.abs(r-s)<Math.abs(r-a)}const D_=new WeakMap;function ap(e){const t=D_.get(e);if(t!=null)return t;const n=e.colors??{},r={...n},a=n["editor.background"]??e.bg,s=n["editor.foreground"]??e.fg,u=n["sideBar.background"]??a,d=n["sideBar.foreground"]??s;Vn(r,"editor.background",a),Vn(r,"editor.foreground",s),Vn(r,"sideBar.background",u),Vn(r,"sideBar.foreground",d),Vn(r,"input.background",n["input.background"]??u),Vn(r,"sideBarSectionHeader.foreground",n["sideBarSectionHeader.foreground"]??d),Vn(r,"list.activeSelectionForeground",n["list.activeSelectionForeground"]??d),Vn(r,"gitDecoration.addedResourceForeground",sp(n["gitDecoration.addedResourceForeground"],n["terminal.ansiGreen"],n["editorGutter.addedBackground"])),Vn(r,"gitDecoration.modifiedResourceForeground",sp(n["gitDecoration.modifiedResourceForeground"],n["terminal.ansiBlue"],n["editorGutter.modifiedBackground"])),Vn(r,"gitDecoration.deletedResourceForeground",sp(n["gitDecoration.deletedResourceForeground"],n["terminal.ansiRed"],n["editorGutter.deletedBackground"]));const f=(O_(n["list.focusOutline"])?void 0:n["list.focusOutline"])??(O_(n.focusBorder)?void 0:n.focusBorder);f!=null?r["list.focusOutline"]=f:delete r["list.focusOutline"];const h=n["list.hoverBackground"];h!=null&&(v8(h,u)||g8(h,u,d))&&delete r["list.hoverBackground"];const p=Object.freeze({...e,colors:Object.freeze(r)});return D_.set(e,p),p}function Vn(e,t,n){n!=null&&n!==""&&(e[t]=n)}function sp(...e){for(const t of e)if(t!=null&&t!=="")return t}function v8(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function i1({theme:e=ot,highlighter:t,prefix:n}){let r="";if(typeof e=="string"){const a=t.getTheme(e),s=ap(a);r+=`color:${s.fg};`,r+=`background-color:${s.bg};`,r+=`${un("global")}fg:${s.fg};`,r+=`${un("global")}bg:${s.bg};`,r+=lp(a,n)}else{let a=t.getTheme(e.dark),s=ap(a);r+=`${un("global")}dark:${s.fg};`,r+=`${un("global")}dark-bg:${s.bg};`,r+=lp(a,"dark"),a=t.getTheme(e.light),s=ap(a),r+=`${un("global")}light:${s.fg};`,r+=`${un("global")}light-bg:${s.bg};`,r+=lp(a,"light")}return r}function lp(e,t){t=t!=null?`${t}-`:"";let n="";const r=e.colors?.["gitDecoration.addedResourceForeground"]??e.colors?.["terminal.ansiGreen"];r!=null&&(n+=`${un("global")}${t}addition-color:${r};`);const a=e.colors?.["gitDecoration.deletedResourceForeground"]??e.colors?.["terminal.ansiRed"];a!=null&&(n+=`${un("global")}${t}deletion-color:${a};`);const s=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];return s!=null&&(n+=`${un("global")}${t}modified-color:${s};`),n}function gm(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 M_=10,N_=13,y8=4,b8=40;function S8(e){const t=[0];let n=e.indexOf("\r"),r=e.indexOf(`
|
|
187
|
+
`),a=0,s=0;for(;n!==-1||r!==-1;){let u;if(n!==-1&&(r===-1||n<r)?r===n+1?(u=r+1,n=e.indexOf("\r",u),r=e.indexOf(`
|
|
188
|
+
`,u)):(u=n+1,n=e.indexOf("\r",u)):(u=r+1,r=e.indexOf(`
|
|
189
|
+
`,u)),t.push(u),++s===y8){if(u-a<=b8){for(let d=u;d<e.length;d++){const f=e.charCodeAt(d);(f===M_||f===N_)&&(f===N_&&d+1<e.length&&e.charCodeAt(d+1)===M_&&d++,t.push(d+1))}return t}a=u,s=0}}return t}function cc(e){const t=S8(e);return Array.from({length:t.length},(n,r)=>{const a=t[r],s=t[r+1]??e.length;return e.slice(a,s)})}const _8={forcePlainText:!1};function r1(e,t,{theme:n=ot,tokenizeMaxLineLength:r,useTokenTransformer:a},{forcePlainText:s,startingLine:u,totalLines:d,lines:f}=_8){s?(u??=0,d??=1/0):(u=0,d=1/0);const h=u>0||d<1/0,{state:p,transformers:m}=n1(a),y=s?"text":e.lang??Ht(e.name),b=typeof n=="string"?t.getTheme(n).type:void 0,S=i1({theme:n,highlighter:t});p.lineInfo=E=>({type:"context",lineIndex:E-1+u,lineNumber:E+u});const _=typeof n=="string"?{lang:y,theme:n,transformers:m,defaultColor:!1,cssVariablePrefix:un("token"),tokenizeMaxLineLength:r,tokenizeTimeLimit:0}:{lang:y,themes:n,transformers:m,defaultColor:!1,cssVariablePrefix:un("token"),tokenizeMaxLineLength:r,tokenizeTimeLimit:0},w=gm(t.codeToHast(h?C8(f??cc(e.contents),u,d):e.contents,_)),x=h?new Array(u):w;return h&&x.push(...w),{code:x,themeStyles:S,baseThemeType:b}}function C8(e,t,n){if(e.length===0)return"";const r=Math.min(t+n,e.length);return e.slice(t,r).join("")}const o1="-1,-1";function vm(e){return e?.some(t=>t.lineNumber===0)??!1}function ym(e){const t=e[0];return t!=null&&t.length>0?t:void 0}function fd(e){return e.startingLine===0&&e.totalLines>0}function a1(e,t){return e.endsWith(`\r
|
|
190
|
+
`)?t+`\r
|
|
191
|
+
`:e.endsWith("\r")?t+"\r":e.endsWith(`
|
|
192
|
+
`)?t+`
|
|
193
|
+
`:t}function s1(e,t){return Ce({tagName:"div",children:e,properties:{"data-content":"",style:`grid-row: span ${t}`}})}function Ks(e){return(e.lang??Ht(e.name))==="text"}function ju(e,t){return t.cacheKey==null?e.file===t&&e.sourceContents===t.contents:e.cacheKey===t.cacheKey}let x8=-1;var E8=class{options;onRenderUpdate;workerManager;__id=`file-renderer:${++x8}`;highlighter;renderCache;computedLang="text";lineAnnotations={};lineCache;pendingStructuralRows;textDocumentCache=new WeakMap;editSessionActive=!1;constructor(e={theme:ot},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=zs(e.theme??ot)?Qw():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||!ju(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=up(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());let r=this.workerManager?.getFileResultCache(e);r!=null&&!Ai(t,r.options)&&(r=void 0),this.renderCache??={file:e,options:t,highlighted:!n&&!Ks(e),result:n?void 0:r?.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??Ht(e.name),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getFileRenderOptions().theme??this.options.theme??ot}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 a=this.workerManager.getFileRenderOptions();return this.editSessionActive&&a.useTokenTransformer!==!0?{...a,useTokenTransformer:!0}:a}const{tokenizeMaxLineLength:r=1e3}=this.options;return{theme:this.getLocalHighlightTheme(),useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:r}})(),{renderCache:n}=this;return n?.result==null?{options:t,forceHighlight:!0}:!An(e,n.file)||!Ai(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getOrCreateLineCache(e){this.invalidateChangedUnkeyedFile(e);let{lineCache:t}=this;return(t==null||!ju(t,e))&&(t={cacheKey:e.cacheKey,file:e,sourceContents:e.contents,lines:cc(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:r,result:a}=this.renderCache;if(a==null)return;const s=n?new Map:void 0;this.pendingStructuralRows=s;const u=this.lineCache!=null&&ju(this.lineCache,r)?this.lineCache:void 0;for(const[d,f]of e){if(s===void 0&&u!=null&&d<u.lines.length){const p=f.map(m=>m[2]).join("");u.lines[d]=a1(u.lines[d]??"",p)}const h={type:"element",tagName:"div",properties:{"data-line":d+1,"data-line-type":"context","data-line-index":d},children:f.map(([p,m,y])=>p===0&&m===""?y===""?{type:"element",tagName:"br",properties:{},children:[]}:{type:"text",value:y}:{type:"element",tagName:"span",properties:{"data-char":p,style:`color:${m};`},children:[{type:"text",value:y}]})};s!==void 0?s.set(d,h):a.code[d]=h}a.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:r}=this.renderCache;if(r==null)return;const a=this.lineCache!=null&&ju(this.lineCache,n)?this.lineCache.lines:cc(n.contents),s=cc(e.getText());if(a.length!==s.length){const u=Math.min(a.length,s.length);let d=0;for(;d<u&&a[d]===s[d];)d++;let f=0;for(;f<u-d&&a[a.length-1-f]===s[s.length-1-f];)f++;const h=r.code;r.code=new Array(s.length);for(let p=0;p<d;p++)r.code[p]=h[p];for(let p=0;p<f;p++)r.code[s.length-1-p]=h[a.length-1-p];if(t!==void 0)for(const[p,m]of t)p<s.length&&(r.code[p]=m);for(let p=d;p<s.length-f;p++)r.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<r.code.length;p++){const m=r.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=bc){if(e==null)return;this.invalidateChangedUnkeyedFile(e),this.renderCache?.isDirty===!0&&!An(e,this.renderCache.file)&&(this.clearRenderCache(),this.lineCache=void 0,this.textDocumentCache=new WeakMap);let{options:n,forceHighlight:r}=this.getRenderOptions(e);this.renderCache?.isDirty===!0&&!Ai(n,this.renderCache.options)&&this.clearRenderCache();const a=this.getMatchingWorkerResultCache(e,n);a!=null&&!this.hasHighlightedRenderCache(e,n)&&(this.renderCache={file:e,highlighted:!0,renderRange:void 0,...a},r=!1),this.renderCache??={file:e,highlighted:!1,options:n,result:void 0,renderRange:void 0};const s=this.getOrCreateLineCache(e),u=e.contents.length>0,d=!u||Ks(e)||up(s.length,this.getTokenizeMaxLength()),f=!An(e,this.renderCache.file),h=!dd(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0)(d||this.renderCache.result==null||!this.renderCache.highlighted&&(f||h))&&(this.renderCache.file=e,this.renderCache.options=n,this.renderCache.highlighted=!1,(this.renderCache.result==null||f||h||r)&&(this.renderCache.result=this.workerManager.getPlainFileAST(e,t.startingLine,t.totalLines,s)),this.renderCache.renderRange=t),!d&&u&&(!this.renderCache.highlighted||r)&&this.workerManager.highlightFileAST(this,e);else{this.computedLang=e.lang??Ht(e.name);const p=this.highlighter!=null&&zs(n.theme),m=this.highlighter!=null&&xc(this.computedLang),y=!d&&m;if(this.highlighter!=null&&p&&(r||d||!this.renderCache.highlighted&&y||this.renderCache.result==null)){const{result:b,options:S}=this.renderFileWithHighlighter(e,this.highlighter,d||!m);this.renderCache={file:e,options:S,highlighted:y,result:b,renderRange:void 0}}(!p||!d&&!m)&&this.asyncHighlight(e).then(({result:b,options:S})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.applyHighlightResult(e,b,S,!d)})}return this.renderCache.result!=null?this.processFileResult(this.renderCache.file,t,this.renderCache.result):void 0}async asyncRender(e,t=bc){const{result:n}=await this.asyncHighlight(e);return this.processFileResult(e,t,n)}async asyncHighlight(e){const t=up(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??Ht(e.name);const n=this.highlighter!=null&&pm(Ys(this.getLocalHighlightTheme())),r=t||this.highlighter!=null&&xc(this.computedLang);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderFileWithHighlighter(e,this.highlighter,t)}renderFileWithHighlighter(e,t,n=!1){const{options:r}=this.getRenderOptions(e);return{result:r1(e,t,r,{forcePlainText:n}),options:r}}processFileResult(e,t,{code:n,themeStyles:r,baseThemeType:a}){const s=this.getLineCount(e),{disableFileHeader:u=!1}=this.options,d=[],f=fa(),h=Math.min(t.startingLine+t.totalLines,s);let p=0;const m=fd(t)?ym(this.lineAnnotations):void 0;m!=null&&(f.children.push(ln("context","annotation",1)),d.push(mm({hunkIndex:-1,lineIndex:-1,annotations:m.map(y=>Nn(y))})),p++);for(let y=t.startingLine;y<h;y++){const b=y+1,S=n[y];if(S==null){const w="FileRenderer.processFileResult: Line doesnt exist";throw console.error(w,{name:e.name,lineIndex:y,lineNumber:b}),new Error(w)}f.children.push(vE("context",b,`${y}`)),d.push(S),p++;const _=this.lineAnnotations[b];_!=null&&(f.children.push(ln("context","annotation",1)),d.push(mm({hunkIndex:0,lineIndex:b,annotations:_.map(w=>Nn(w))})),p++)}return f.properties.style=`grid-row: span ${p}`,{gutterAST:f.children??[],contentAST:d,preAST:this.createPreElement(s),headerAST:u?void 0:this.renderHeader(e),totalLines:s,rowCount:p,themeStyles:r,baseThemeType:a,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderHeader(e){const{headerRenderMode:t="default",stickyHeader:n=!1}=this.options;return Zw({fileOrDiff:e,mode:t,stickyHeader:n})}renderFullHTML(e){return zt(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push(Ce({tagName:"code",children:this.renderCodeAST(e),properties:{"data-code":""}})),{...e.preAST,children:t}}renderCodeAST(e){const t=fa();return t.children=e.gutterAST,t.properties.style=`grid-row: span ${e.rowCount}`,[t,s1(e.contentAST,e.rowCount)]}renderPartialHTML(e,t=!1){return zt(t?Ce({tagName:"code",children:e,properties:{"data-code":""}}):e)}async initializeHighlighter(){return this.highlighter=await Ic(e1(this.computedLang,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}onHighlightSuccess(e,t,n,r=!0){this.editSessionActive||this.applyHighlightResult(e,t,n,r)}applyHighlightResult(e,t,n,r=!0){if(this.renderCache==null)return;const a=!An(e,this.renderCache.file)||!this.renderCache.highlighted||!Ai(n,this.renderCache.options);this.renderCache={file:e,options:n,highlighted:r,result:t,renderRange:void 0},a&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;const n=this.workerManager?.getFileResultCache(e);if(!(n==null||!Ai(t,n.options)))return n}hasHighlightedRenderCache(e,t){const{renderCache:n}=this;return n?.result!=null&&n.highlighted&&An(e,n.file)&&Ai(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 Jw({type:"file",diffIndicators:"none",disableBackground:!0,disableLineNumbers:t,overflow:n,split:!1,totalLines:e})}};function up(e,t){return e>t}const l1=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
194
|
+
<symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
|
|
195
|
+
<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"/>
|
|
196
|
+
</symbol>
|
|
197
|
+
<symbol id="diffs-icon-brand-github" viewBox="0 0 16 16">
|
|
198
|
+
<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"/>
|
|
199
|
+
</symbol>
|
|
200
|
+
<symbol id="diffs-icon-chevron" viewBox="0 0 16 16">
|
|
201
|
+
<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"/>
|
|
202
|
+
</symbol>
|
|
203
|
+
<symbol id="diffs-icon-chevrons-narrow" viewBox="0 0 10 16">
|
|
204
|
+
<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"/>
|
|
205
|
+
</symbol>
|
|
206
|
+
<symbol id="diffs-icon-diff-split" viewBox="0 0 16 16">
|
|
207
|
+
<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"/>
|
|
208
|
+
</symbol>
|
|
209
|
+
<symbol id="diffs-icon-diff-unified" viewBox="0 0 16 16">
|
|
210
|
+
<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"/>
|
|
211
|
+
</symbol>
|
|
212
|
+
<symbol id="diffs-icon-expand" viewBox="0 0 16 16">
|
|
213
|
+
<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"/>
|
|
214
|
+
</symbol>
|
|
215
|
+
<symbol id="diffs-icon-expand-all" viewBox="0 0 16 16">
|
|
216
|
+
<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"/>
|
|
217
|
+
</symbol>
|
|
218
|
+
<symbol id="diffs-icon-file-code" viewBox="0 0 16 16">
|
|
219
|
+
<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"/>
|
|
220
|
+
</symbol>
|
|
221
|
+
<symbol id="diffs-icon-plus" viewBox="0 0 16 16">
|
|
222
|
+
<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"/>
|
|
223
|
+
</symbol>
|
|
224
|
+
<symbol id="diffs-icon-symbol-added" viewBox="0 0 16 16">
|
|
225
|
+
<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"/>
|
|
226
|
+
</symbol>
|
|
227
|
+
<symbol id="diffs-icon-symbol-deleted" viewBox="0 0 16 16">
|
|
228
|
+
<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"/>
|
|
229
|
+
</symbol>
|
|
230
|
+
<symbol id="diffs-icon-symbol-diffstat" viewBox="0 0 16 16">
|
|
231
|
+
<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"/>
|
|
232
|
+
</symbol>
|
|
233
|
+
<symbol id="diffs-icon-symbol-ignored" viewBox="0 0 16 16">
|
|
234
|
+
<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"/>
|
|
235
|
+
</symbol>
|
|
236
|
+
<symbol id="diffs-icon-symbol-modified" viewBox="0 0 16 16">
|
|
237
|
+
<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"/>
|
|
238
|
+
</symbol>
|
|
239
|
+
<symbol id="diffs-icon-symbol-moved" viewBox="0 0 16 16">
|
|
240
|
+
<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"/>
|
|
241
|
+
</symbol>
|
|
242
|
+
<symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
|
|
243
|
+
<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"/>
|
|
244
|
+
</symbol>
|
|
245
|
+
</svg>`;function w8(e,t){return e.lineNumber===t.lineNumber&&e.metadata===t.metadata}function u1(e,t){return e==null||t==null?e===t:k8(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 I_={};function k8(e=I_,t=I_){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const a of n)if(e[a]!==t[a])return!1;return!0}function c1(e){const t=document.createElement("div");return t.dataset.annotationSlot="",t.slot=e,t.style.whiteSpace="normal",t}function d1(){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 f1(){const e=document.createElement("style");return e.setAttribute(gM,""),e}var L8=`@layer base {
|
|
246
|
+
:host {
|
|
247
|
+
--diffs-font-fallback: "SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono",
|
|
248
|
+
"Courier New", monospace;
|
|
249
|
+
--diffs-header-font-fallback: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
|
|
250
|
+
"Noto Sans", "Liberation Sans", Arial, sans-serif;
|
|
251
|
+
--diffs-mixer: light-dark(#000, #fff);
|
|
252
|
+
--diffs-gap-fallback: 8px;
|
|
253
|
+
--diffs-scrollbar-gutter-fallback: 6px;
|
|
254
|
+
--diffs-scrollbar-gutter: var(--diffs-scrollbar-gutter-override, var(--diffs-scrollbar-gutter-measured, var(--diffs-scrollbar-gutter-fallback)));
|
|
255
|
+
--diffs-added-light: #0dbe4e;
|
|
256
|
+
--diffs-added-dark: #5ecc71;
|
|
257
|
+
--diffs-modified-light: #009fff;
|
|
258
|
+
--diffs-modified-dark: #69b1ff;
|
|
259
|
+
--diffs-deleted-light: #ff2e3f;
|
|
260
|
+
--diffs-deleted-dark: #ff6762;
|
|
261
|
+
--diffs-warning-light: #d5a910;
|
|
262
|
+
--diffs-warning-dark: #ffd452;
|
|
263
|
+
color-scheme: light dark;
|
|
264
|
+
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
265
|
+
font-size: var(--diffs-font-size, 13px);
|
|
266
|
+
line-height: var(--diffs-line-height, 20px);
|
|
267
|
+
font-feature-settings: var(--diffs-font-features);
|
|
268
|
+
--diffs-bg: light-dark(var(--diffs-light-bg, #fff), var(--diffs-dark-bg, #000));
|
|
269
|
+
--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))));
|
|
270
|
+
--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))));
|
|
271
|
+
--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))));
|
|
272
|
+
--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))));
|
|
273
|
+
--diffs-fg: light-dark(var(--diffs-light, #000), var(--diffs-dark, #fff));
|
|
274
|
+
--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))));
|
|
275
|
+
--diffs-fg-conflict-marker: var(--diffs-fg-conflict-marker-override, var(--diffs-fg-number));
|
|
276
|
+
--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)))));
|
|
277
|
+
--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)))));
|
|
278
|
+
--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)))));
|
|
279
|
+
--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))));
|
|
280
|
+
--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)));
|
|
281
|
+
--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))));
|
|
282
|
+
--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)));
|
|
283
|
+
--diffs-selection-base: var(--diffs-modified-base);
|
|
284
|
+
--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)));
|
|
285
|
+
background-color: var(--diffs-bg);
|
|
286
|
+
color: var(--diffs-fg);
|
|
287
|
+
display: block;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
pre, code, [data-error-wrapper] {
|
|
291
|
+
isolation: isolate;
|
|
292
|
+
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
293
|
+
outline: none;
|
|
294
|
+
margin: 0;
|
|
295
|
+
padding: 0;
|
|
296
|
+
display: block;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
pre, code {
|
|
300
|
+
background-color: var(--diffs-bg);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
code {
|
|
304
|
+
contain: content;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
input, button {
|
|
308
|
+
font-family: inherit;
|
|
309
|
+
font-size: inherit;
|
|
310
|
+
line-height: inherit;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
*, :before, :after {
|
|
314
|
+
box-sizing: border-box;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
[data-icon-sprite] {
|
|
318
|
+
display: none;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
[data-diffs-header], [data-separator] {
|
|
322
|
+
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
[data-diffs-header][data-sticky] {
|
|
326
|
+
z-index: 1;
|
|
327
|
+
background-color: var(--diffs-bg);
|
|
328
|
+
position: sticky;
|
|
329
|
+
top: 0;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
[data-file-info] {
|
|
333
|
+
color: var(--fg);
|
|
334
|
+
background-color: color-mix(in lab, var(--bg) 98%, var(--fg));
|
|
335
|
+
border-block: 1px solid color-mix(in lab, var(--bg) 95%, var(--fg));
|
|
336
|
+
padding: 10px;
|
|
337
|
+
font-weight: 700;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
[data-diff], [data-file] {
|
|
341
|
+
--diffs-grid-number-column-width: minmax(min-content, max-content);
|
|
342
|
+
--diffs-code-grid: var(--diffs-grid-number-column-width) 1fr;
|
|
343
|
+
|
|
344
|
+
&[data-dehydrated] {
|
|
345
|
+
--diffs-code-grid: var(--diffs-grid-number-column-width) minmax(0, 1fr);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
&:hover [data-code]::-webkit-scrollbar-thumb {
|
|
349
|
+
background-color: var(--diffs-bg-context);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
@supports (-webkit-touch-callout: none) {
|
|
354
|
+
:host {
|
|
355
|
+
--diffs-scrollbar-gutter-fallback: 0px;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
[data-line] span {
|
|
360
|
+
color: light-dark(var(--diffs-token-light, var(--diffs-light)), var(--diffs-token-dark, var(--diffs-dark)));
|
|
361
|
+
background-color: light-dark(var(--diffs-token-light-bg, inherit), var(--diffs-token-dark-bg, inherit));
|
|
362
|
+
font-weight: light-dark(var(--diffs-token-light-font-weight, inherit), var(--diffs-token-dark-font-weight, inherit));
|
|
363
|
+
font-style: light-dark(var(--diffs-token-light-font-style, inherit), var(--diffs-token-dark-font-style, inherit));
|
|
364
|
+
text-decoration: light-dark(var(--diffs-token-light-text-decoration, inherit), var(--diffs-token-dark-text-decoration, inherit));
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
[data-line], [data-gutter-buffer], [data-column-number], [data-line-annotation], [data-no-newline], [data-merge-conflict], [data-merge-conflict-actions], [data-editor-overlay] {
|
|
368
|
+
--diffs-computed-decoration-bg: var(--diffs-bg);
|
|
369
|
+
--diffs-computed-diff-line-bg: var(--diffs-computed-decoration-bg);
|
|
370
|
+
--diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg);
|
|
371
|
+
--diffs-computed-editor-active-line-bg: var(--diffs-computed-selected-line-bg);
|
|
372
|
+
--diffs-computed-hovered-line-bg: var(--diffs-computed-editor-active-line-bg);
|
|
373
|
+
--diffs-hover-mix-target: var(--diffs-bg-hover-override, var(--diffs-mixer));
|
|
374
|
+
--diffs-line-bg: var(--diffs-computed-hovered-line-bg);
|
|
375
|
+
color: var(--diffs-fg);
|
|
376
|
+
background-color: var(--diffs-line-bg, var(--diffs-bg));
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
[data-line], [data-no-newline] {
|
|
380
|
+
&[data-decoration-bg] {
|
|
381
|
+
--mix-deco-light: 92%;
|
|
382
|
+
--mix-deco-dark: 85%;
|
|
383
|
+
|
|
384
|
+
&[data-decoration-bg-depth="2"] {
|
|
385
|
+
--mix-deco-light: 88%;
|
|
386
|
+
--mix-deco-dark: 80%;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
&[data-decoration-bg-depth="3"] {
|
|
390
|
+
--mix-deco-light: 85%;
|
|
391
|
+
--mix-deco-dark: 78%;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
--diffs-hover-mix-target: var(--diffs-decoration-bg);
|
|
395
|
+
--diffs-computed-decoration-bg: light-dark(color-mix(in lab,
|
|
396
|
+
var(--diffs-bg) var(--mix-deco-light),
|
|
397
|
+
var(--diffs-decoration-bg)), color-mix(in lab,
|
|
398
|
+
var(--diffs-bg) var(--mix-deco-dark),
|
|
399
|
+
var(--diffs-decoration-bg)));
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
[data-line-annotation], [data-gutter-buffer="annotation"] {
|
|
404
|
+
--diffs-annotation-bg: var(--diffs-bg-context);
|
|
405
|
+
--diffs-computed-decoration-bg: var(--diffs-annotation-bg);
|
|
406
|
+
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
[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"] {
|
|
410
|
+
--diffs-computed-decoration-bg: var(--diffs-bg-context);
|
|
411
|
+
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
[data-gutter-buffer="merge-conflict-marker-start"], [data-merge-conflict="marker-start"] {
|
|
415
|
+
--diffs-computed-decoration-bg: light-dark(color-mix(in lab,
|
|
416
|
+
var(--diffs-bg) 78%,
|
|
417
|
+
var(--conflict-bg-current-header-override, var(--diffs-addition-base))), color-mix(in lab,
|
|
418
|
+
var(--diffs-bg) 68%,
|
|
419
|
+
var(--conflict-bg-current-header-override, var(--diffs-addition-base))));
|
|
420
|
+
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
[data-gutter-buffer="merge-conflict-marker-end"], [data-merge-conflict="marker-end"] {
|
|
424
|
+
--diffs-computed-decoration-bg: light-dark(color-mix(in lab,
|
|
425
|
+
var(--diffs-bg) 78%,
|
|
426
|
+
var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))), color-mix(in lab,
|
|
427
|
+
var(--diffs-bg) 68%,
|
|
428
|
+
var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))));
|
|
429
|
+
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
[data-has-merge-conflict] [data-line-annotation], [data-has-merge-conflict] [data-gutter-buffer="annotation"] {
|
|
433
|
+
--diffs-computed-decoration-bg: var(--diffs-bg);
|
|
434
|
+
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
:where([data-background]) {
|
|
438
|
+
& [data-gutter-buffer], & [data-column-number] {
|
|
439
|
+
--mix-light: 91%;
|
|
440
|
+
--mix-dark: 85%;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
& [data-line], & [data-no-newline] {
|
|
444
|
+
--mix-light: 88%;
|
|
445
|
+
--mix-dark: 80%;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
& [data-gutter-buffer], & [data-column-number], & [data-line], & [data-no-newline] {
|
|
449
|
+
--diffs-diff-line-mix-target: var(--diffs-bg);
|
|
450
|
+
|
|
451
|
+
&[data-line-type="change-deletion"] {
|
|
452
|
+
--diffs-diff-line-mix-target: var(--diffs-bg-deletion-override, var(--diffs-deletion-base));
|
|
453
|
+
--diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
|
|
454
|
+
|
|
455
|
+
&:where([data-gutter-buffer], [data-column-number]) {
|
|
456
|
+
color: var(--diffs-fg-number-deletion-override, var(--diffs-deletion-base));
|
|
457
|
+
--diffs-diff-line-mix-target: var(--diffs-bg-deletion-number-override, var(--diffs-deletion-base));
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
461
|
+
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
462
|
+
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
463
|
+
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
464
|
+
var(--diffs-diff-line-mix-target)));
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
&[data-line-type="change-addition"] {
|
|
468
|
+
--diffs-diff-line-mix-target: var(--diffs-bg-addition-override, var(--diffs-addition-base));
|
|
469
|
+
--diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
|
|
470
|
+
|
|
471
|
+
&:where([data-gutter-buffer], [data-column-number]) {
|
|
472
|
+
color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
|
|
473
|
+
--diffs-diff-line-mix-target: var(--diffs-bg-addition-number-override, var(--diffs-addition-base));
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
477
|
+
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
478
|
+
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
479
|
+
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
480
|
+
var(--diffs-diff-line-mix-target)));
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
&[data-merge-conflict="current"] {
|
|
484
|
+
--diffs-diff-line-mix-target: var(--conflict-bg-current-override, var(--diffs-addition-base));
|
|
485
|
+
--diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
|
|
486
|
+
|
|
487
|
+
&:where([data-gutter-buffer], [data-column-number]) {
|
|
488
|
+
color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
|
|
489
|
+
--diffs-diff-line-mix-target: var(--conflict-bg-current-number-override, var(--diffs-addition-base));
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
493
|
+
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
494
|
+
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
495
|
+
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
496
|
+
var(--diffs-diff-line-mix-target)));
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
&[data-merge-conflict="incoming"] {
|
|
500
|
+
--diffs-diff-line-mix-target: var(--conflict-bg-incoming-override, var(--diffs-modified-base));
|
|
501
|
+
--diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
|
|
502
|
+
|
|
503
|
+
&:where([data-gutter-buffer], [data-column-number]) {
|
|
504
|
+
color: var(--diffs-modified-base);
|
|
505
|
+
--diffs-diff-line-mix-target: var(--conflict-bg-incoming-number-override, var(--diffs-modified-base));
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
509
|
+
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
510
|
+
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
511
|
+
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
512
|
+
var(--diffs-diff-line-mix-target)));
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
[data-gutter-buffer], [data-column-number], [data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline], [data-editor-overlay] {
|
|
518
|
+
--diffs-selection-mix-target: var(--diffs-bg-selection-override, var(--diffs-selection-base));
|
|
519
|
+
--diffs-selection-emphasis-mix-target: var(--diffs-selection-mix-target);
|
|
520
|
+
|
|
521
|
+
&:where([data-editor-overlay]), &:where([data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline])[data-selected-line] {
|
|
522
|
+
--mix-selection-light: 82%;
|
|
523
|
+
--mix-selection-dark: 75%;
|
|
524
|
+
--diffs-hover-mix-target: var(--diffs-selection-mix-target);
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
&:where([data-gutter-buffer][data-selected-line], [data-column-number]:is([data-selected-line], [data-editor-active-line])) {
|
|
528
|
+
--mix-selection-light: 75%;
|
|
529
|
+
--mix-selection-dark: 60%;
|
|
530
|
+
--diffs-selection-mix-target: var(--diffs-bg-selection-number-override, var(--diffs-selection-base));
|
|
531
|
+
--diffs-hover-mix-target: var(--diffs-selection-mix-target);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
&:where([data-line][data-selected-line]):is([data-line-type="change-addition"], [data-line-type="change-deletion"]) {
|
|
535
|
+
--diffs-selection-emphasis-mix-target: light-dark(color-mix(in lab,
|
|
536
|
+
var(--diffs-diff-line-mix-target, var(--diffs-selection-mix-target))
|
|
537
|
+
var(--mix-selection-light),
|
|
538
|
+
var(--diffs-selection-mix-target)), var(--diffs-selection-mix-target));
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
&:where([data-editor-overlay]), &[data-selected-line] {
|
|
542
|
+
--diffs-computed-selected-line-bg: light-dark(color-mix(in lab,
|
|
543
|
+
var(--diffs-computed-diff-line-bg) var(--mix-selection-light),
|
|
544
|
+
var(--diffs-selection-mix-target)), color-mix(in lab,
|
|
545
|
+
var(--diffs-computed-diff-line-bg) var(--mix-selection-dark),
|
|
546
|
+
var(--diffs-selection-mix-target)));
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
[data-line][data-editor-active-line], [data-column-number][data-editor-active-line] {
|
|
551
|
+
--diffs-computed-editor-active-line-bg: color-mix(in lab,
|
|
552
|
+
var(--diffs-computed-selected-line-bg)
|
|
553
|
+
var(--diffs-editor-active-line-source-mix, 100%),
|
|
554
|
+
var(--diffs-selection-emphasis-mix-target));
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
@media (pointer: fine) {
|
|
558
|
+
[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] {
|
|
559
|
+
--diffs-computed-hovered-line-bg: light-dark(color-mix(in lab,
|
|
560
|
+
var(--diffs-computed-editor-active-line-bg) 97%,
|
|
561
|
+
var(--diffs-hover-mix-target)), color-mix(in lab,
|
|
562
|
+
var(--diffs-computed-editor-active-line-bg) 91%,
|
|
563
|
+
var(--diffs-hover-mix-target)));
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
[data-gutter-buffer][data-selected-line], [data-column-number]:is([data-selected-line], [data-editor-active-line]) {
|
|
568
|
+
color: var(--diffs-selection-number-fg);
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
[data-no-newline] {
|
|
572
|
+
user-select: none;
|
|
573
|
+
|
|
574
|
+
& span {
|
|
575
|
+
opacity: .6;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
[data-diff-type="split"][data-overflow="scroll"] {
|
|
580
|
+
grid-template-columns: 1fr 1fr;
|
|
581
|
+
display: grid;
|
|
582
|
+
|
|
583
|
+
& [data-additions] {
|
|
584
|
+
border-left: 1px solid var(--diffs-bg);
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
& [data-deletions] {
|
|
588
|
+
border-right: 1px solid var(--diffs-bg);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
[data-code] {
|
|
593
|
+
grid-auto-flow: dense;
|
|
594
|
+
grid-template-columns: var(--diffs-code-grid);
|
|
595
|
+
overflow: var(--diffs-overflow-override, scroll) clip;
|
|
596
|
+
overscroll-behavior-x: none;
|
|
597
|
+
tab-size: var(--diffs-tab-size, 2);
|
|
598
|
+
padding-top: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
599
|
+
padding-bottom: max(0px,
|
|
600
|
+
calc(var(--diffs-gap-block, var(--diffs-gap-fallback)) -
|
|
601
|
+
var(--diffs-scrollbar-gutter)));
|
|
602
|
+
scrollbar-gutter: stable;
|
|
603
|
+
align-self: flex-start;
|
|
604
|
+
display: grid;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
[data-diffs-scrollbar-measure] {
|
|
608
|
+
opacity: 0;
|
|
609
|
+
pointer-events: none;
|
|
610
|
+
scrollbar-gutter: auto;
|
|
611
|
+
grid-template-columns: none;
|
|
612
|
+
width: 100px;
|
|
613
|
+
height: 100px;
|
|
614
|
+
padding: 0;
|
|
615
|
+
position: absolute;
|
|
616
|
+
top: -200px;
|
|
617
|
+
left: -200px;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
[data-container-size] {
|
|
621
|
+
container-type: inline-size;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
[data-code]::-webkit-scrollbar {
|
|
625
|
+
width: 0;
|
|
626
|
+
height: var(--diffs-scrollbar-gutter);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
[data-code]::-webkit-scrollbar-track {
|
|
630
|
+
background: none;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
[data-code]::-webkit-scrollbar-thumb {
|
|
634
|
+
background-color: #0000;
|
|
635
|
+
background-clip: content-box;
|
|
636
|
+
border: 1px solid #0000;
|
|
637
|
+
border-radius: 3px;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
[data-code]::-webkit-scrollbar-corner {
|
|
641
|
+
background-color: #0000;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
@supports ((-moz-appearance: none)) {
|
|
645
|
+
[data-code] {
|
|
646
|
+
scrollbar-width: thin;
|
|
647
|
+
scrollbar-color: var(--diffs-bg-context) transparent;
|
|
648
|
+
padding-bottom: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
[data-diffs-header] ~ [data-diff], [data-diffs-header] ~ [data-file] {
|
|
653
|
+
& [data-code], &[data-overflow="wrap"], &[data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {
|
|
654
|
+
padding-top: 0;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
[data-gutter] {
|
|
659
|
+
grid-template-rows: subgrid;
|
|
660
|
+
grid-template-columns: subgrid;
|
|
661
|
+
z-index: 3;
|
|
662
|
+
background-color: var(--diffs-bg);
|
|
663
|
+
grid-column: 1;
|
|
664
|
+
display: grid;
|
|
665
|
+
position: relative;
|
|
666
|
+
|
|
667
|
+
& [data-gutter-buffer], & [data-column-number] {
|
|
668
|
+
border-right: var(--diffs-gap-style, 2px solid var(--diffs-bg));
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
[data-content] {
|
|
673
|
+
grid-template-rows: subgrid;
|
|
674
|
+
grid-template-columns: subgrid;
|
|
675
|
+
background-color: var(--diffs-bg);
|
|
676
|
+
grid-column: 2;
|
|
677
|
+
min-width: 0;
|
|
678
|
+
display: grid;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
[data-diff-type="split"][data-overflow="wrap"], [data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {
|
|
682
|
+
grid-auto-flow: dense;
|
|
683
|
+
grid-template-columns: repeat(2, var(--diffs-code-grid));
|
|
684
|
+
padding-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
685
|
+
display: grid;
|
|
686
|
+
|
|
687
|
+
& [data-code] {
|
|
688
|
+
display: contents;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
& [data-deletions] {
|
|
692
|
+
& [data-gutter] {
|
|
693
|
+
grid-column: 1;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
& [data-content] {
|
|
697
|
+
border-right: 1px solid var(--diffs-bg);
|
|
698
|
+
grid-column: 2;
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
& [data-additions] {
|
|
703
|
+
& [data-gutter] {
|
|
704
|
+
border-left: 1px solid var(--diffs-bg);
|
|
705
|
+
grid-column: 3;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
& [data-content] {
|
|
709
|
+
grid-column: 4;
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
[data-dehydrated][data-diff-type="split"][data-overflow="scroll"] [data-content] {
|
|
715
|
+
overflow: clip;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
[data-overflow="scroll"] [data-gutter] {
|
|
719
|
+
position: sticky;
|
|
720
|
+
left: 0;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
[data-interactive-lines] [data-line] {
|
|
724
|
+
cursor: pointer;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
[data-interactive-line-numbers] [data-column-number] {
|
|
728
|
+
cursor: pointer;
|
|
729
|
+
touch-action: none;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
[data-content-buffer], [data-gutter-buffer] {
|
|
733
|
+
user-select: none;
|
|
734
|
+
min-height: 1lh;
|
|
735
|
+
position: relative;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
[data-gutter-buffer] {
|
|
739
|
+
padding-left: 2ch;
|
|
740
|
+
padding-right: 1ch;
|
|
741
|
+
|
|
742
|
+
&:before {
|
|
743
|
+
content: "";
|
|
744
|
+
min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
|
|
745
|
+
display: block;
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
[data-gutter-buffer="annotation"] {
|
|
750
|
+
--diffs-annotation-bg: var(--diffs-bg-context-gutter);
|
|
751
|
+
min-height: 0;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
[data-gutter-buffer="buffer"] {
|
|
755
|
+
--diffs-line-bg: var(--diffs-bg-context-gutter);
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
[data-content-buffer] {
|
|
759
|
+
background-position: 5px 0;
|
|
760
|
+
background-size: 8px 8px;
|
|
761
|
+
background-origin: border-box;
|
|
762
|
+
background-image: repeating-linear-gradient(-45deg,
|
|
763
|
+
transparent,
|
|
764
|
+
transparent calc(3px * 1.414),
|
|
765
|
+
var(--diffs-bg-buffer) calc(3px * 1.414),
|
|
766
|
+
var(--diffs-bg-buffer) calc(4px * 1.414));
|
|
767
|
+
grid-column: 1;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
[data-separator] {
|
|
771
|
+
box-sizing: content-box;
|
|
772
|
+
background-color: var(--diffs-bg);
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
[data-separator="simple"] {
|
|
776
|
+
min-height: 4px;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
[data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"], [data-separator="simple"] {
|
|
780
|
+
background-color: var(--diffs-bg-separator);
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
[data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"] {
|
|
784
|
+
height: 32px;
|
|
785
|
+
position: relative;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
[data-separator-wrapper] {
|
|
789
|
+
user-select: none;
|
|
790
|
+
fill: currentColor;
|
|
791
|
+
background-color: var(--diffs-bg);
|
|
792
|
+
align-items: center;
|
|
793
|
+
height: 100%;
|
|
794
|
+
display: flex;
|
|
795
|
+
position: absolute;
|
|
796
|
+
inset-inline: 0;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
[data-content] [data-separator-wrapper] {
|
|
800
|
+
display: none;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
[data-separator="metadata"] [data-separator-wrapper] {
|
|
804
|
+
background-color: var(--diffs-bg-separator);
|
|
805
|
+
height: 100%;
|
|
806
|
+
color: var(--diffs-fg-number);
|
|
807
|
+
white-space: nowrap;
|
|
808
|
+
text-overflow: ellipsis;
|
|
809
|
+
min-width: min-content;
|
|
810
|
+
padding-inline: 1ch;
|
|
811
|
+
inset-inline: 100% auto;
|
|
812
|
+
overflow: hidden;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
[data-separator="line-info"] {
|
|
816
|
+
margin-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
817
|
+
|
|
818
|
+
& [data-separator-wrapper] {
|
|
819
|
+
min-width: 16px;
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
[data-separator="line-info-basic"], [data-separator="metadata"] {
|
|
824
|
+
margin-block: 0;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
[data-separator="line-info"][data-separator-first] {
|
|
828
|
+
margin-top: 0;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
[data-separator="line-info"][data-separator-last] {
|
|
832
|
+
margin-bottom: 0;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
[data-expand-index] [data-separator-wrapper] {
|
|
836
|
+
grid-template-columns: 32px auto;
|
|
837
|
+
display: grid;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
[data-expand-index] [data-separator-wrapper][data-separator-multi-button] {
|
|
841
|
+
grid-template-columns: 32px 32px auto;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
[data-expand-button], [data-separator-content] {
|
|
845
|
+
background-color: var(--diffs-bg-separator);
|
|
846
|
+
flex: none;
|
|
847
|
+
align-items: center;
|
|
848
|
+
display: flex;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
[data-expand-index] [data-separator-content]:hover {
|
|
852
|
+
cursor: pointer;
|
|
853
|
+
text-decoration: underline;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
[data-expand-button] {
|
|
857
|
+
cursor: pointer;
|
|
858
|
+
min-width: 32px;
|
|
859
|
+
color: var(--diffs-fg-number);
|
|
860
|
+
border-right: 2px solid var(--diffs-bg);
|
|
861
|
+
flex-shrink: 0;
|
|
862
|
+
justify-content: center;
|
|
863
|
+
align-self: stretch;
|
|
864
|
+
|
|
865
|
+
&:hover {
|
|
866
|
+
color: var(--diffs-fg);
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
&[data-expand-all-button] {
|
|
870
|
+
display: none;
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
[data-expand-down] [data-icon] {
|
|
875
|
+
transform: scaleY(-1);
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
[data-separator-content] {
|
|
879
|
+
height: 100%;
|
|
880
|
+
color: var(--diffs-fg-number);
|
|
881
|
+
flex: auto;
|
|
882
|
+
justify-content: flex-start;
|
|
883
|
+
padding: 0 1ch;
|
|
884
|
+
overflow: hidden;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
[data-separator="line-info"], [data-separator="line-info-basic"] {
|
|
888
|
+
& [data-separator-content] {
|
|
889
|
+
user-select: none;
|
|
890
|
+
height: 100%;
|
|
891
|
+
overflow: clip;
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
[data-unmodified-lines] {
|
|
896
|
+
text-overflow: ellipsis;
|
|
897
|
+
white-space: nowrap;
|
|
898
|
+
flex: 0 auto;
|
|
899
|
+
min-width: 0;
|
|
900
|
+
display: block;
|
|
901
|
+
overflow: hidden;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
@supports (width: 1cqi) {
|
|
905
|
+
[data-unified] {
|
|
906
|
+
& [data-separator="line-info"] [data-separator-wrapper] {
|
|
907
|
+
padding-inline: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
908
|
+
width: 100cqi;
|
|
909
|
+
|
|
910
|
+
& [data-separator-content] {
|
|
911
|
+
border-radius: 6px;
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
& [data-separator="line-info"][data-expand-index] [data-separator-wrapper] [data-separator-content] {
|
|
916
|
+
border-top-left-radius: unset;
|
|
917
|
+
border-bottom-left-radius: unset;
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
[data-gutter] {
|
|
922
|
+
& [data-separator="line-info"] [data-separator-wrapper] {
|
|
923
|
+
padding-left: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
& [data-separator="line-info"] [data-separator-content] {
|
|
927
|
+
border-top-left-radius: 6px;
|
|
928
|
+
border-bottom-left-radius: 6px;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
& [data-separator="line-info"][data-expand-index] [data-separator-content] {
|
|
932
|
+
border-top-left-radius: unset;
|
|
933
|
+
border-bottom-left-radius: unset;
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
[data-additions] {
|
|
938
|
+
& [data-content] [data-separator="line-info"] {
|
|
939
|
+
background-color: var(--diffs-bg);
|
|
940
|
+
|
|
941
|
+
& [data-separator-wrapper] {
|
|
942
|
+
display: none;
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
& [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
|
|
947
|
+
background-color: var(--diffs-bg-separator);
|
|
948
|
+
border-top-right-radius: 6px;
|
|
949
|
+
border-bottom-right-radius: 6px;
|
|
950
|
+
height: 100%;
|
|
951
|
+
display: block;
|
|
952
|
+
|
|
953
|
+
& [data-separator-content], & [data-expand-button] {
|
|
954
|
+
display: none;
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
[data-overflow="scroll"] [data-additions] [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
|
|
960
|
+
width: calc(100cqi - var(--diffs-gap-inline, var(--diffs-gap-fallback)));
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
[data-overflow="wrap"] [data-additions] [data-content] [data-separator="line-info"] [data-separator-wrapper] {
|
|
964
|
+
background-color: var(--diffs-bg-separator);
|
|
965
|
+
height: 100%;
|
|
966
|
+
margin-right: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
967
|
+
border-top-right-radius: 6px;
|
|
968
|
+
border-bottom-right-radius: 6px;
|
|
969
|
+
display: block;
|
|
970
|
+
|
|
971
|
+
& [data-separator-content], & [data-expand-button] {
|
|
972
|
+
display: none;
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
[data-separator="line-info"] [data-separator-wrapper] {
|
|
977
|
+
& [data-expand-both], & [data-expand-down], & [data-expand-up] {
|
|
978
|
+
border-top-left-radius: 6px;
|
|
979
|
+
border-bottom-left-radius: 6px;
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
@media (pointer: fine) {
|
|
984
|
+
[data-separator="line-info"] [data-separator-wrapper] {
|
|
985
|
+
&[data-separator-multi-button] {
|
|
986
|
+
& [data-expand-up] {
|
|
987
|
+
border-top-left-radius: 6px;
|
|
988
|
+
border-bottom-left-radius: unset;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
& [data-expand-down] {
|
|
992
|
+
border-bottom-left-radius: 6px;
|
|
993
|
+
border-top-left-radius: unset;
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
@media (pointer: coarse) {
|
|
1001
|
+
[data-separator="line-info-basic"] [data-separator-wrapper][data-separator-multi-button] {
|
|
1002
|
+
grid-template-columns: 34px 34px auto;
|
|
1003
|
+
|
|
1004
|
+
& [data-separator-content] {
|
|
1005
|
+
grid-column: unset;
|
|
1006
|
+
grid-row: unset;
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
@supports (width: 1cqi) {
|
|
1011
|
+
[data-separator="line-info"] [data-separator-wrapper] {
|
|
1012
|
+
& [data-expand-both], & [data-expand-down], & [data-expand-up] {
|
|
1013
|
+
border-top-left-radius: 6px;
|
|
1014
|
+
border-bottom-left-radius: 6px;
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
&[data-separator-multi-button] {
|
|
1018
|
+
& [data-expand-up] {
|
|
1019
|
+
border-top-left-radius: 6px;
|
|
1020
|
+
border-bottom-left-radius: 6px;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
& [data-expand-down] {
|
|
1024
|
+
border-bottom-left-radius: unset;
|
|
1025
|
+
border-top-left-radius: unset;
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
@media (pointer: fine) {
|
|
1033
|
+
[data-separator-wrapper][data-separator-multi-button] {
|
|
1034
|
+
grid-template-rows: 50% 50%;
|
|
1035
|
+
display: grid;
|
|
1036
|
+
|
|
1037
|
+
& [data-separator-content] {
|
|
1038
|
+
grid-area: 1 / 2 / -1;
|
|
1039
|
+
min-width: min-content;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
& [data-expand-button] {
|
|
1043
|
+
grid-column: 1;
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
[data-separator="line-info"] [data-separator-wrapper], [data-separator="line-info"] [data-separator-wrapper][data-separator-multi-button] {
|
|
1048
|
+
grid-template-columns: 34px auto;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
[data-separator="line-info-basic"][data-expand-index] [data-separator-wrapper] {
|
|
1052
|
+
grid-template-columns: 100% auto;
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
[data-separator="line-info"], [data-separator="line-info-basic"] {
|
|
1056
|
+
& [data-separator-multi-button] {
|
|
1057
|
+
& [data-expand-up] {
|
|
1058
|
+
border-bottom: 1px solid var(--diffs-bg);
|
|
1059
|
+
border-right: 2px solid var(--diffs-bg);
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
& [data-expand-down] {
|
|
1063
|
+
border-top: 1px solid var(--diffs-bg);
|
|
1064
|
+
border-right: 2px solid var(--diffs-bg);
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
[data-additions] [data-gutter] [data-separator-wrapper], [data-additions] [data-separator="line-info-basic"] [data-separator-wrapper], [data-content] [data-separator-wrapper] {
|
|
1071
|
+
display: none;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
[data-line-annotation] {
|
|
1075
|
+
min-height: var(--diffs-annotation-min-height, 0);
|
|
1076
|
+
z-index: 2;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
[data-merge-conflict-actions] {
|
|
1080
|
+
z-index: 2;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
[data-separator="custom"] {
|
|
1084
|
+
grid-template-columns: subgrid;
|
|
1085
|
+
display: grid;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
[data-line], [data-column-number], [data-no-newline] {
|
|
1089
|
+
padding-inline: 1ch;
|
|
1090
|
+
position: relative;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
[data-indicators="classic"] [data-line] {
|
|
1094
|
+
padding-inline-start: 2ch;
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
[data-indicators="classic"] {
|
|
1098
|
+
& [data-line-type="change-addition"], & [data-line-type="change-deletion"] {
|
|
1099
|
+
&[data-no-newline], &[data-line] {
|
|
1100
|
+
&:before {
|
|
1101
|
+
user-select: none;
|
|
1102
|
+
width: 1ch;
|
|
1103
|
+
height: 1lh;
|
|
1104
|
+
display: inline-block;
|
|
1105
|
+
position: absolute;
|
|
1106
|
+
top: 0;
|
|
1107
|
+
left: 0;
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
& [data-line-type="change-addition"] {
|
|
1113
|
+
&[data-line], &[data-no-newline] {
|
|
1114
|
+
&:before {
|
|
1115
|
+
content: "+";
|
|
1116
|
+
color: var(--diffs-addition-base);
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
& [data-line-type="change-deletion"] {
|
|
1122
|
+
&[data-line], &[data-no-newline] {
|
|
1123
|
+
&:before {
|
|
1124
|
+
content: "-";
|
|
1125
|
+
color: var(--diffs-deletion-base);
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
[data-indicators="bars"] {
|
|
1132
|
+
& [data-line-type="change-deletion"], & [data-line-type="change-addition"] {
|
|
1133
|
+
&[data-column-number] {
|
|
1134
|
+
&:before {
|
|
1135
|
+
content: "";
|
|
1136
|
+
user-select: none;
|
|
1137
|
+
contain: strict;
|
|
1138
|
+
width: 4px;
|
|
1139
|
+
height: 100%;
|
|
1140
|
+
display: block;
|
|
1141
|
+
position: absolute;
|
|
1142
|
+
top: 0;
|
|
1143
|
+
left: 0;
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
& [data-line-type="change-deletion"] {
|
|
1149
|
+
&[data-column-number] {
|
|
1150
|
+
&:before {
|
|
1151
|
+
background-image: linear-gradient(0deg,
|
|
1152
|
+
var(--diffs-bg-deletion) 50%,
|
|
1153
|
+
var(--diffs-deletion-base) 50%);
|
|
1154
|
+
background-repeat: repeat;
|
|
1155
|
+
background-size: 2px 2px;
|
|
1156
|
+
background-size: calc(1lh / round(1lh / 2px))
|
|
1157
|
+
calc(1lh / round(1lh / 2px));
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
& [data-line-type="change-addition"] {
|
|
1163
|
+
&[data-column-number] {
|
|
1164
|
+
&:before {
|
|
1165
|
+
background-color: var(--diffs-addition-base);
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
[data-overflow="wrap"] {
|
|
1172
|
+
& [data-line] {
|
|
1173
|
+
white-space: pre-wrap;
|
|
1174
|
+
word-break: break-word;
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
& [data-annotation-content] {
|
|
1178
|
+
word-break: break-word;
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
[data-overflow="scroll"] [data-line] {
|
|
1183
|
+
white-space: pre;
|
|
1184
|
+
min-height: 1lh;
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
[data-column-number] {
|
|
1188
|
+
box-sizing: content-box;
|
|
1189
|
+
text-align: right;
|
|
1190
|
+
user-select: none;
|
|
1191
|
+
color: var(--diffs-fg-number);
|
|
1192
|
+
padding-left: 2ch;
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
[data-line-number-content] {
|
|
1196
|
+
min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
|
|
1197
|
+
z-index: 1;
|
|
1198
|
+
display: inline-block;
|
|
1199
|
+
position: relative;
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
[data-disable-line-numbers] {
|
|
1203
|
+
& [data-gutter-buffer], & [data-column-number] {
|
|
1204
|
+
min-width: 4px;
|
|
1205
|
+
padding: 0;
|
|
1206
|
+
|
|
1207
|
+
&:before {
|
|
1208
|
+
min-width: 0;
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
& [data-line-number-content] {
|
|
1213
|
+
display: none;
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
& [data-gutter-utility-slot] {
|
|
1217
|
+
right: unset;
|
|
1218
|
+
justify-content: flex-start;
|
|
1219
|
+
left: 0;
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
&[data-indicators="bars"] [data-gutter-utility-slot] {
|
|
1223
|
+
left: 6px;
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
[data-file][data-disable-line-numbers] {
|
|
1228
|
+
& [data-gutter-buffer], & [data-column-number] {
|
|
1229
|
+
border-right: 0;
|
|
1230
|
+
min-width: 0;
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
[data-diff-span] {
|
|
1235
|
+
box-decoration-break: clone;
|
|
1236
|
+
border-radius: 3px;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
[data-line-type="change-addition"] [data-diff-span] {
|
|
1240
|
+
background-color: var(--diffs-bg-addition-emphasis);
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
[data-line-type="change-deletion"] [data-diff-span] {
|
|
1244
|
+
background-color: var(--diffs-bg-deletion-emphasis);
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
[data-merge-conflict="marker-start"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"], [data-merge-conflict="marker-end"] {
|
|
1248
|
+
color: var(--diffs-fg);
|
|
1249
|
+
padding-left: 1ch;
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
[data-merge-conflict="marker-start"], [data-merge-conflict="marker-end"] {
|
|
1253
|
+
align-items: center;
|
|
1254
|
+
display: flex;
|
|
1255
|
+
|
|
1256
|
+
&:after {
|
|
1257
|
+
color: var(--diffs-fg-conflict-marker);
|
|
1258
|
+
font-size: .75rem;
|
|
1259
|
+
font-style: normal;
|
|
1260
|
+
line-height: 1.25rem;
|
|
1261
|
+
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
1262
|
+
padding-left: 1ch;
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
[data-merge-conflict="marker-start"]:after {
|
|
1267
|
+
content: "(Current Change)";
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
[data-merge-conflict="marker-end"]:after {
|
|
1271
|
+
content: "(Incoming Change)";
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
[data-merge-conflict-actions-content] {
|
|
1275
|
+
min-height: 1.75rem;
|
|
1276
|
+
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
1277
|
+
color: var(--diffs-fg);
|
|
1278
|
+
align-items: center;
|
|
1279
|
+
gap: .25rem;
|
|
1280
|
+
padding-inline: .5rem;
|
|
1281
|
+
font-size: .75rem;
|
|
1282
|
+
line-height: 1.2;
|
|
1283
|
+
display: flex;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
[data-merge-conflict-action] {
|
|
1287
|
+
appearance: none;
|
|
1288
|
+
color: var(--diffs-fg-number);
|
|
1289
|
+
font: inherit;
|
|
1290
|
+
cursor: pointer;
|
|
1291
|
+
background: none;
|
|
1292
|
+
border: 0;
|
|
1293
|
+
padding: 0;
|
|
1294
|
+
font-style: normal;
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
[data-merge-conflict-action]:hover {
|
|
1298
|
+
color: var(--diffs-fg);
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
[data-merge-conflict-action="current"]:hover {
|
|
1302
|
+
color: var(--diffs-addition-base);
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
[data-merge-conflict-action="incoming"]:hover {
|
|
1306
|
+
color: var(--diffs-modified-base);
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
[data-merge-conflict-action-separator] {
|
|
1310
|
+
color: var(--diffs-fg-number);
|
|
1311
|
+
opacity: .6;
|
|
1312
|
+
user-select: none;
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
[data-diffs-header="default"] {
|
|
1316
|
+
background-color: var(--diffs-bg);
|
|
1317
|
+
justify-content: space-between;
|
|
1318
|
+
align-items: center;
|
|
1319
|
+
gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1320
|
+
min-height: calc(1lh + (var(--diffs-gap-block, var(--diffs-gap-fallback)) * 3));
|
|
1321
|
+
z-index: 2;
|
|
1322
|
+
flex-direction: row;
|
|
1323
|
+
padding-inline: 16px;
|
|
1324
|
+
display: flex;
|
|
1325
|
+
position: relative;
|
|
1326
|
+
top: 0;
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
[data-header-content] {
|
|
1330
|
+
align-items: center;
|
|
1331
|
+
gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1332
|
+
white-space: nowrap;
|
|
1333
|
+
flex-direction: row;
|
|
1334
|
+
min-width: 0;
|
|
1335
|
+
display: flex;
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
[data-header-content] [data-prev-name], [data-header-content] [data-title] {
|
|
1339
|
+
text-overflow: ellipsis;
|
|
1340
|
+
white-space: nowrap;
|
|
1341
|
+
direction: rtl;
|
|
1342
|
+
min-width: 0;
|
|
1343
|
+
overflow: hidden;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
[data-prev-name] {
|
|
1347
|
+
opacity: .7;
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
[data-rename-icon] {
|
|
1351
|
+
fill: currentColor;
|
|
1352
|
+
flex-grow: 0;
|
|
1353
|
+
flex-shrink: 0;
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
[data-diffs-header="default"] [data-metadata] {
|
|
1357
|
+
white-space: nowrap;
|
|
1358
|
+
align-items: center;
|
|
1359
|
+
gap: 1ch;
|
|
1360
|
+
display: flex;
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
[data-diffs-header="default"] [data-additions-count] {
|
|
1364
|
+
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
1365
|
+
color: var(--diffs-addition-base);
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
[data-diffs-header="default"] [data-deletions-count] {
|
|
1369
|
+
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
1370
|
+
color: var(--diffs-deletion-base);
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
[data-change-icon] {
|
|
1374
|
+
fill: currentColor;
|
|
1375
|
+
flex-shrink: 0;
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
[data-change-icon="change"], [data-change-icon="rename-pure"], [data-change-icon="rename-changed"] {
|
|
1379
|
+
color: var(--diffs-modified-base);
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
[data-change-icon="new"] {
|
|
1383
|
+
color: var(--diffs-addition-base);
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
[data-change-icon="deleted"] {
|
|
1387
|
+
color: var(--diffs-deletion-base);
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
[data-change-icon="file"] {
|
|
1391
|
+
opacity: .6;
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
[data-annotation-content] {
|
|
1395
|
+
z-index: 2;
|
|
1396
|
+
isolation: isolate;
|
|
1397
|
+
white-space: normal;
|
|
1398
|
+
align-self: flex-start;
|
|
1399
|
+
min-width: 0;
|
|
1400
|
+
display: flow-root;
|
|
1401
|
+
position: relative;
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
[data-overflow="scroll"] [data-annotation-content], [data-overflow="scroll"] [data-merge-conflict-actions-content] {
|
|
1405
|
+
width: var(--diffs-column-content-width, auto);
|
|
1406
|
+
left: var(--diffs-column-number-width, 0);
|
|
1407
|
+
position: sticky;
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
[data-annotation-slot] {
|
|
1411
|
+
text-wrap-mode: wrap;
|
|
1412
|
+
word-break: normal;
|
|
1413
|
+
white-space-collapse: collapse;
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
[data-gutter-utility-slot] {
|
|
1417
|
+
touch-action: none;
|
|
1418
|
+
justify-content: flex-end;
|
|
1419
|
+
display: flex;
|
|
1420
|
+
position: absolute;
|
|
1421
|
+
top: 0;
|
|
1422
|
+
bottom: 0;
|
|
1423
|
+
right: 0;
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
[data-utility-button] {
|
|
1427
|
+
appearance: none;
|
|
1428
|
+
cursor: pointer;
|
|
1429
|
+
width: 1lh;
|
|
1430
|
+
height: 1lh;
|
|
1431
|
+
font-size: var(--diffs-font-size, 13px);
|
|
1432
|
+
line-height: var(--diffs-line-height, 20px);
|
|
1433
|
+
background-color: var(--diffs-modified-base);
|
|
1434
|
+
color: var(--diffs-bg);
|
|
1435
|
+
fill: currentColor;
|
|
1436
|
+
z-index: 4;
|
|
1437
|
+
touch-action: none;
|
|
1438
|
+
border: none;
|
|
1439
|
+
border-radius: 4px;
|
|
1440
|
+
justify-content: center;
|
|
1441
|
+
align-items: center;
|
|
1442
|
+
margin-right: calc(-1lh + 1ch);
|
|
1443
|
+
padding: 0;
|
|
1444
|
+
display: flex;
|
|
1445
|
+
position: relative;
|
|
1446
|
+
|
|
1447
|
+
&:before {
|
|
1448
|
+
content: "";
|
|
1449
|
+
display: block;
|
|
1450
|
+
position: absolute;
|
|
1451
|
+
inset: 0 0 0 -4px;
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
[data-decoration-bar-stack] {
|
|
1456
|
+
pointer-events: none;
|
|
1457
|
+
isolation: isolate;
|
|
1458
|
+
z-index: 1;
|
|
1459
|
+
background-color: var(--diffs-decoration-bar-color, transparent);
|
|
1460
|
+
box-sizing: content-box;
|
|
1461
|
+
border-left: 2px solid var(--diffs-bg);
|
|
1462
|
+
border-right: 2px solid var(--diffs-bg);
|
|
1463
|
+
width: 6px;
|
|
1464
|
+
position: absolute;
|
|
1465
|
+
top: 0;
|
|
1466
|
+
bottom: 0;
|
|
1467
|
+
right: -2px;
|
|
1468
|
+
|
|
1469
|
+
[data-decoration-bar-depth="1"] & {
|
|
1470
|
+
background-color: color-mix(in lab,
|
|
1471
|
+
var(--diffs-bg) 20%,
|
|
1472
|
+
var(--diffs-decoration-bar-color, transparent));
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
[data-decoration-bar-depth="2"] & {
|
|
1476
|
+
background-color: color-mix(in lab,
|
|
1477
|
+
var(--diffs-bg) 45%,
|
|
1478
|
+
var(--diffs-decoration-bar-color, transparent));
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
[data-decoration-bar-depth="3"] & {
|
|
1482
|
+
background-color: color-mix(in lab,
|
|
1483
|
+
var(--diffs-bg) 65%,
|
|
1484
|
+
var(--diffs-decoration-bar-color, transparent));
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
[data-decoration-bar-start] & {
|
|
1488
|
+
border-top-left-radius: 5px;
|
|
1489
|
+
border-top-right-radius: 5px;
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
[data-decoration-bar-end] & {
|
|
1493
|
+
z-index: 3;
|
|
1494
|
+
border-bottom-right-radius: 5px;
|
|
1495
|
+
border-bottom-left-radius: 5px;
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
[data-placeholder] {
|
|
1500
|
+
contain: strict;
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
[data-error-wrapper] {
|
|
1504
|
+
padding: var(--diffs-gap-block, var(--diffs-gap-fallback))
|
|
1505
|
+
var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1506
|
+
scrollbar-width: none;
|
|
1507
|
+
max-height: 400px;
|
|
1508
|
+
overflow: auto;
|
|
1509
|
+
|
|
1510
|
+
& [data-error-message] {
|
|
1511
|
+
color: var(--diffs-deletion-base);
|
|
1512
|
+
font-size: 18px;
|
|
1513
|
+
font-weight: bold;
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
& [data-error-stack] {
|
|
1517
|
+
color: var(--diffs-fg-number);
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
@layer theme, rendered, unsafe;
|
|
1523
|
+
`;let Vu;function Xs(e){if(Vu!=null)return Vu;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(vM,"true");const r=document.createElement("div");return r.style.position="relative",r.style.width="200%",r.style.height="200%",n.appendChild(r),e.appendChild(n),Vu=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),Vu}function h1(e){return`${sE}: ${e==null?"var(--diffs-scrollbar-gutter-fallback)":`${e}px`};`}const p1="@layer base, theme, rendered, unsafe;",T8=new RegExp(`${A8(sE)}\\s*:\\s*[^;]+;`);function m1(e){return`${p1}
|
|
1524
|
+
@layer unsafe {
|
|
1525
|
+
${e}
|
|
1526
|
+
}`}function g1(e,t="system",n){return`${p1}
|
|
1527
|
+
@layer rendered {
|
|
1528
|
+
:host {${t==="system"?"":`
|
|
1529
|
+
color-scheme: ${t};`}
|
|
1530
|
+
${h1(n)}
|
|
1531
|
+
${e}
|
|
1532
|
+
}
|
|
1533
|
+
}`}function v1(e,t){const n=h1(t);return e.replace(T8,n)}function A8(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function dc({code:e,pre:t,columnType:n,rowSpan:r,containerSize:a=!1}={}){return e==null&&(e=document.createElement("code"),e.setAttribute("data-code",""),n!=null&&e.setAttribute(`data-${n}`,""),t?.appendChild(e)),r!=null?e.style.setProperty("grid-row",`span ${r}`):e.style.removeProperty("grid-row"),a?e.setAttribute("data-container-size",""):e.removeAttribute("data-container-size"),e}function y1(e,t){if(t==null)return;const n=e.shadowRoot??e.attachShadow({mode:"open"});n.innerHTML===""&&(n.innerHTML=t)}function b1(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:a,overflow:s,split:u,totalLines:d,customProperties:f}){if(f!=null)for(const h in f){const p=f[h];p!=null&&e.setAttribute(h,`${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 a?e.setAttribute("data-disable-line-numbers",""):e.removeAttribute("data-disable-line-numbers"),r?e.removeAttribute("data-background"):e.setAttribute("data-background",""),t==="diff"?e.setAttribute("data-diff-type",u?"split":"single"):e.removeAttribute("data-diff-type"),e.setAttribute("data-overflow",s),e.style.setProperty("--diffs-min-number-column-width-default",`${`${d}`.length}ch`),e}function zc(e){if(typeof HTMLStyleElement<"u"&&e instanceof HTMLStyleElement)return!0;const t=e.tagName??e.nodeName;return typeof t=="string"&&t.toLowerCase()==="style"}function S1(e){return e?.useTokenTransformer===!0||e?.onTokenClick!=null||e?.onTokenEnter!=null||e?.onTokenLeave!=null}function z_(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:S1(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,unsafeCSS:e?.unsafeCSS,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}function bm(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 _1({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===""){t?.remove();return}return t??=R8(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function R8(){const e=document.createElement("style");return e.setAttribute(mM,""),e}let O8;function C1(){return O8??="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 r=this.attachShadow({mode:"open"});e==null&&(e=new CSSStyleSheet,e.replaceSync(L8)),r.adoptedStyleSheets=[e]}connectedCallback(){Xs(this.shadowRoot??this.attachShadow({mode:"open"}))}}customElements.define(tg,t)}const D8=[""];let M8=-1;var x1=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file:${++M8}`;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:ot},n,r=!1){this.options=t,this.workerManager=n,this.isContainerManaged=r,this.fileRenderer=new E8(t,this.handleHighlightRender,this.workerManager),this.resizeManager=new DE,this.interactionManager=new OE("file",Cc(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(Cc(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&&!wa(this.appliedThemeCSS.theme,this.options.theme??ot)}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:r,preventEmit:a=!1,file:s,lineAnnotations:u}=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,r),N8(this.pre,s,this.options.collapsed)||I8(this.headerElement,s,this.options.disableFileHeader)?this.render({...t,preventEmit:!0}):this.hydrationSetup({file:s,lineAnnotations:u}),a||this.emitPostRender()}hydrateElements(t,n){this.fileContainer!==t&&this.emitPostRender(!0),y1(t,n);for(const r of Array.from(t.shadowRoot?.children??[])){if(r instanceof SVGElement){this.spriteSVG=r;continue}if(r instanceof HTMLElement){if(r instanceof HTMLPreElement){this.pre=r,this.appliedPreAttributes=void 0;continue}if(r instanceof HTMLStyleElement&&r.hasAttribute("data-theme-css")){this.themeCSSStyle=r;continue}if(r instanceof HTMLStyleElement&&r.hasAttribute("data-unsafe-css")){this.unsafeCSSStyle=r,this.appliedUnsafeCSS=r.textContent;continue}if("diffsHeader"in r.dataset){this.headerElement=r,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(z_(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):D8}updateBuffers(t){this.pre!=null&&this.applyBuffers(this.pre,t)}syncRenderViewToEditor(){const t=this.editor,n=this.fileContainer,r=this.file,a=this.lineAnnotations,s=this.renderRange;t!=null&&n!=null&&r!=null&&this.fileRenderer.initializeHighlighter().then(u=>{!this.enabled||this.editor!==t||this.fileContainer!==n||this.file!==r||t.__syncRenderView(u,n,r,a,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,r){this.fileRenderer.updateRenderCache(t,n,r?.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:r=!1,preventEmit:a=!1,containerWrapper:s,deferManagers:u=!1,lineAnnotations:d,renderRange:f}){this.editor?.__postponeBgTokenizeToNextFrame();const{collapsed:h=!1,themeType:p="system"}=this.options,m=h?void 0:f,y=this.renderRange,b=this.hasThemeChanged(),S=d!=null&&(d.length>0||this.lineAnnotations.length>0)?d!==this.lineAnnotations:!1,_=!An(this.file,t)||this.fileRenderer.hasUnkeyedFileContentsChanged(t);if(!h&&!r&&dd(m,this.renderRange)&&!_&&!S&&!b)return this.applyCachedThemeState(p);this.renderRange=m,_&&(this.cachedHeaderHTML=void 0),this.file=t,this.fileRenderer.setOptions(z_(this.options)),this.syncInteractionOptions(),d!=null&&this.setLineAnnotations(d),this.fileRenderer.setLineAnnotations(this.lineAnnotations);const{disableErrorHandling:w=!1,disableFileHeader:x=!1}=this.options;if(x&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),n=this.getOrCreateFileContainerNode(n,s),this.applyCachedThemeState(p),h){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const E=this.fileRenderer.renderFile(t,lE);E!=null&&this.applyThemeState(n,E.themeStyles,p,E.baseThemeType),E?.headerAST!=null&&this.applyHeaderToDOM(E.headerAST,n),this.injectUnsafeCSS()}catch(E){if(w)throw E;console.error(E),E instanceof Error&&this.applyErrorToDOM(E,n)}return a||this.emitPostRender(),!0}try{const E=this.getOrCreatePreNode(n);if(!this.canPartiallyRender(r,S,_||b)||!this.applyPartialRender(y,m)){const L=this.fileRenderer.renderFile(t,m);if(L==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(n,L.themeStyles,p,L.baseThemeType),L.headerAST!=null&&this.applyHeaderToDOM(L.headerAST,n),this.applyFullRender(L,E)}this.applyBuffers(E,m),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,u||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(E){if(w)throw E;console.error(E),E instanceof Error&&this.applyErrorToDOM(E,n)}return a||this.emitPostRender(),!0}emitPostRender(t=!1){const{fileContainer:n,options:{onPostRender:r}}=this;if(t){if(!this.mounted||(this.mounted=!1,n==null))return;r?.(n,this,"unmount");return}if(n==null)return;const a=this.mounted?"update":"mount";this.mounted=!0,r?.(n,this,a)}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,r){return!(t||n||r)}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||Ks(t))return;const r=this.options.tokenizeMaxLength??1e5;this.fileRenderer.getOrCreateLineCache(t).length>r||await n.primeFileHighlightCache(t).catch(a=>{console.error(a)})}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:r}of this.annotationCache.values())r.remove();this.annotationCache.clear();return}const t=new Map(this.annotationCache),{renderAnnotation:n}=this.options;if(n!=null&&this.lineAnnotations.length>0)for(const[r,a]of this.lineAnnotations.entries()){const s=`${r}-${Nn(a)}`;let u=this.annotationCache.get(s);if(u==null||!w8(a,u.annotation)){u?.element.remove();const d=n(a);if(d==null)continue;u={element:c1(Nn(a)),annotation:a},u.element.appendChild(d),this.fileContainer.appendChild(u.element),this.annotationCache.set(s,u)}t.delete(s)}for(const[r,{element:a}]of t.entries())this.annotationCache.delete(r),a.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 r=d1();r.appendChild(n),this.fileContainer.appendChild(r),this.gutterUtilityContent=r}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??=f1(),this.unsafeCSSStyle.parentNode!==n&&n.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=m1(t),this.appliedUnsafeCSS=t)}}applyThemeState(t,n,r,a){const s=t.shadowRoot??t.attachShadow({mode:"open"}),u=a??r,d=this.options.theme??ot,f=typeof d=="string"?d:{...d},h=Xs(s);if(this.themeCSSStyle?.parentNode===s&&this.appliedThemeCSS?.themeStyles===n&&this.appliedThemeCSS.themeType===u&&this.appliedThemeCSS.scrollbarGutter===h){this.appliedThemeCSS.theme=f;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===s){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:f,themeStyles:n,themeType:u,baseThemeType:a,scrollbarGutter:h};return}this.themeCSSStyle=_1({shadowRoot:s,currentNode:this.themeCSSStyle,themeCSS:g1(n,u,h)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:f,themeStyles:n,themeType:u,baseThemeType:a,scrollbarGutter:h}:void 0}hydrateMeasuredScrollbar(){const t=this.fileContainer?.shadowRoot;t==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=v1(this.themeCSSStyle.textContent??"",Xs(t)))}shouldGuardRebuildScroll(){return this.editor!=null&&C1()}applyFullRender(t,n){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(n,t);const r=this.code=dc({code:this.code}),a=this.fileRenderer.renderCodeAST(t);this.editor?.__captureFocusForDOMReplacement();const s=()=>{if(r.childElementCount>=2)for(let u=0;u<2;u++){const d=r.children[u],f=a[u];d.innerHTML=zt(f.children),d.style.cssText=f.properties.style}else r.innerHTML=zt(a);n.contains(r)||n.replaceChildren(r)};this.shouldGuardRebuildScroll()?bm(n,s):s(),this.lastRowCount=t.rowCount}applyPartialRender(t,n){if(t==null||n==null)return!1;const{file:r,code:a}=this,s=a!=null?this.getColumns(a):void 0;if(r==null||a==null||s==null)return!1;const u=t.startingLine,d=n.startingLine,f=t.totalLines===1/0?Number.POSITIVE_INFINITY:u+t.totalLines,h=n.totalLines===1/0?Number.POSITIVE_INFINITY:d+n.totalLines,p=Math.max(u,d),m=Math.min(f,h);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:y}=s.content.children;const b=(x,E)=>{if(!(E<=0))return this.fileRenderer.renderFile(r,{startingLine:x,totalLines:E,bufferBefore:0,bufferAfter:0})},S=d<p?b(d,p-d):void 0;if(S===void 0&&d<p)return!1;const _=h===Number.POSITIVE_INFINITY?Number.POSITIVE_INFINITY:Math.max(0,h-m),w=h>m?b(m,_):void 0;return w===void 0&&h>m?!1:(this.cleanupErrorWrapper(),S!=null&&(s.gutter.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(S.gutterAST)),s.content.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(S.contentAST)),y+=S.rowCount),w!=null&&(s.gutter.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(w.gutterAST)),s.content.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(w.contentAST)),y+=w.rowCount),this.lastRowCount!==y&&(s.gutter.style.setProperty("grid-row",`span ${y}`),s.content.style.setProperty("grid-row",`span ${y}`),this.lastRowCount=y),!0)}getColumns(t){const n=t.children[0],r=t.children[1];if(!(!(n instanceof HTMLElement)||!(r instanceof HTMLElement)||n.dataset.gutter==null||r.dataset.content==null))return{gutter:n,content:r}}trimDOMToOverlap(t,n,r){const a=this.getDOMBoundaryIndices(t,[n,r]),s=a.get(n)??t.children.length,u=a.get(r)??t.children.length;if(s>u)return!1;for(let d=t.children.length-1;d>=u;d-=1)t.children[d]?.remove();for(let d=s-1;d>=0;d-=1)t.children[d]?.remove();return!0}getDOMBoundaryIndices(t,n){const r=[...new Set(n)].sort((f,h)=>f-h),a=new Map;if(r.length===0)return a;let s=0,u=r[s];const{children:d}=t;u===0&&(a.set(0,0),s+=1,u=r[s]);for(let f=0;f<d.length;f+=1){const h=d[f];if(!(h instanceof HTMLElement))continue;const p=this.getLineIndexFromDOMNode(h);if(p!=null){for(;u!=null&&p>=u;)a.set(u,f),s+=1,u=r[s];if(s>=r.length)break}}for(const f of r)a.has(f)||a.set(f,d.length);return a}getLineIndexFromDOMNode(t){const n=t.dataset.lineIndex;if(n==null)return;const r=Number(n);return Number.isNaN(r)?void 0:r}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:r}=this;if(r==null)return;this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;const a=this.cachedHeaderHTML??zt(t);if(this.cachedHeaderHTML=a,a!==this.lastRenderedHeaderHTML){const h=document.createElement("div");h.innerHTML=a;const p=h.firstElementChild;if(!(p instanceof HTMLElement))return;this.headerElement!=null?n.shadowRoot?.replaceChild(p,this.headerElement):n.shadowRoot?.prepend(p),this.headerElement=p,this.lastRenderedHeaderHTML=a}if(this.isContainerManaged)return;const{renderHeaderPrefix:s,renderHeaderFilenameSuffix:u,renderCustomHeader:d,renderHeaderMetadata:f}=this.options;if(d!=null){const h=d(r)??void 0;this.headerCustom=this.upsertHeaderSlotElement(n,this.headerCustom,nl,h),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0}else{const h=s?.(r)??void 0,p=u?.(r)??void 0,m=f?.(r)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(n,this.headerPrefix,ng,h),this.headerFilenameSuffix=this.upsertHeaderSlotElement(n,this.headerFilenameSuffix,ig,p),this.headerMetadata=this.upsertHeaderSlotElement(n,this.headerMetadata,rg,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,r,a){if(a==null){n?.remove();return}const s=n??this.createHeaderSlotElement(r);return n==null&&t.appendChild(s),this.replaceHeaderSlotContent(s,a),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:r}=this,a=t??r??document.createElement("diffs-container"),s=r!==a;return r!=null&&s&&this.editor?.__captureFocusForDOMReplacement(),s&&this.emitPostRender(!0),this.fileContainer=a,r!=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 r of n.children)r instanceof SVGElement?this.spriteSVG??=r:zc(r)&&r.hasAttribute("data-theme-css")?(this.themeCSSStyle??=r,this.hasAdoptedThemeCSS=!0):zc(r)&&r.hasAttribute("data-unsafe-css")&&(this.unsafeCSSStyle??=r,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(t){const n=t.shadowRoot??t.attachShadow({mode:"open"});if(this.spriteSVG==null){const r=document.createElement("div");r.innerHTML=l1;const a=r.firstChild;a instanceof SVGElement&&(this.spriteSVG=a)}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:r="scroll",disableLineNumbers:a=!1}=this.options,s={type:"file",split:!1,overflow:r,disableLineNumbers:a,diffIndicators:"none",disableBackground:!0,totalLines:n};u1(s,this.appliedPreAttributes)||(b1(t,s),this.appliedPreAttributes=s)}applyErrorToDOM(t,n){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;const r=n.shadowRoot??n.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",r.appendChild(this.errorWrapper);const a=document.createElement("div");a.dataset.errorMessage="",a.innerText=t.message,this.errorWrapper.appendChild(a);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 N8(e,t,n=!1){return!n&&e==null&&t!=null}function I8(e,t,n=!1){return e==null&&t!=null&&!n}function fc(e){return{...og,...e}}function Yn(e,t){const n=z8(e,t);return t?n:e.diffHeaderHeight+n}function z8(e,t){return e.paddingTop??(t?e.spacing:0)}function Hc(e){return e.paddingBottom??e.spacing}function H8(e){switch(e){case"simple":return 4;case"metadata":case"line-info":case"line-info-basic":case"custom":return 32}}const P8=5e3;let U8=-1;function j8(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 V8=class extends x1{virtualizer;metrics;__id=`virtualized-file:${++U8}`;top;height=0;cache={heights:new Map,checkpoints:[],fileAnnotationHeight:0};isVisible=!1;isSetup=!1;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n=og,r,a=!1){super(e,r,a),this.virtualizer=t,this.metrics=n}setMetrics(e,t=!1){const n=fc(e);!t&&Sc(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 r=t?2:1;return this.metrics.lineHeight*r}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=!Zc(t,e),r=j8(t,e);super.setOptions(e),r&&this.resetLayoutCache(!0),n&&(this.forceRenderOverride=!0),n&&this.virtualizer.instanceChanged(this,r)}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 r=vm(this.lineAnnotations);if(this.renderRange!=null&&r&&fd(this.renderRange)){const a=B8(n)??0;a!==this.cache.fileAnnotationHeight&&(this.cache.fileAnnotationHeight=a,e=!0)}else!r&&this.cache.fileAnnotationHeight!==0&&(this.cache.fileAnnotationHeight=0,e=!0);for(const a of n.children){if(!(a instanceof HTMLElement))continue;const s=a.dataset.lineIndex;if(s==null)continue;const u=Number(s);let d=a.getBoundingClientRect().height,f=!1;a.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in a.nextElementSibling.dataset||"noNewline"in a.nextElementSibling.dataset)&&("noNewline"in a.nextElementSibling.dataset&&(f=!0),d+=a.nextElementSibling.getBoundingClientRect().height);const h=this.getLineHeight(u,f);d!==h&&(e=!0,d===this.metrics.lineHeight*(f?2:1)?this.cache.heights.delete(u):this.cache.heights.set(u,d))}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,r){const a=this.syncLineAnnotations(r),s=!An(this.file,e)||this.fileRenderer.hasUnkeyedFileContentsChanged(e);let u=n?.resetFileLayoutCache===!0||s||a;n?.metrics!=null&&(this.metrics=n.metrics,u=!0);const{collapsed:d=!1}=this.options;return this.currentCollapsed!==d&&(this.currentCollapsed=d,u=!0),u&&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,r=this.fileRenderer.getLineCount(this.file)-1;let a=Yn(this.metrics,t);if(n||r<0)return{top:a,height:0};const s=Math.min(Math.max(e-1,0),r),{overflow:u="scroll"}=this.options,{lineHeight:d}=this.metrics;if(a+=this.cache.fileAnnotationHeight,u==="scroll"&&!this.hasLineAnnotations())return{top:a+s*d,height:d};const f=this.getLayoutCheckpointBeforeLineIndex(s);a=f?.top??a;for(let h=f?.lineIndex??0;h<s;h++)a+=this.getLineHeight(h,!1);return{top:a,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:r="scroll"}=this.options;if(n||this.renderRange.totalLines<=0)return;const a=this.fileRenderer.getLineCount(this.file)-1;if(a<0)return;const s=Yn(this.metrics,t),u=Math.min(this.renderRange.startingLine,a),d=Math.min(u+this.renderRange.totalLines-1,a);if(d<u)return;const{fileAnnotationHeight:f}=this.cache;if(r==="scroll"&&!this.hasLineAnnotations()){const{lineHeight:p}=this.metrics,m=s+(u===0?f:this.renderRange.bufferBefore),y=u+Math.max(Math.ceil((e-m)/p),0);return y>d?void 0:{lineNumber:y+1,top:s+f+y*p}}let h=s+(u===0?f:this.renderRange.bufferBefore);for(let p=u;p<=d;p++){if(h>=e)return{lineNumber:p+1,top:h};h+=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:r,totalLines:a}=t;let s=0;if(a===0){const u=e??this.virtualizer.getWindowSpecs();this.top<u.top&&(s=r)}return{topOffset:this.top+n+s,height:this.height-(n+r)}}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 r=this.height===0;if(this.height=0,this.cache.checkpoints=[],t==null){this.layoutDirty=!1;return}const{disableFileHeader:a=!1,collapsed:s=!1,overflow:u="scroll"}=this.options,{lineHeight:d}=this.metrics,f=this.fileRenderer.getLineCount(t),h=Yn(this.metrics,a),p=Hc(this.metrics);if(this.height+=h,s){this.layoutDirty=!1;return}if(this.height+=this.cache.fileAnnotationHeight,u==="scroll"&&!this.hasLineAnnotations())this.height+=f*d;else for(let m=0;m<f;m++)this.addLayoutCheckpoint(m,this.height),this.height+=this.getLineHeight(m,!1);if(f>0&&(this.height+=p),this.fileContainer!=null&&n&&!r){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:r}=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&&r!==void 0&&this.file!==void 0){const a=this.virtualizer.getWindowSpecs(),s=this.computeRenderRangeFromWindow(this.file,this.top??0,a);s.bufferAfter!==r.bufferAfter&&this.updateBuffers(s)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}renderPreparedFile({fileContainer:e,file:t,forceRender:n=!1,lineAnnotations:r,...a}){const s=this.file==null||!An(this.file,t)||this.fileRenderer.hasUnkeyedFileContentsChanged(t),{forceRenderOverride:u,isSetup:d}=this;this.forceRenderOverride=void 0;const f=this.syncLineAnnotations(r);if(f&&this.resetLayoutCache(),e=this.getOrCreateFileContainerNode(e),t==null)return console.error("VirtualizedFile.render: attempting to virtually render when we dont have file"),!1;if(d)this.top??=this.getVirtualizedTop(),s&&this.isSimpleMode()&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache(!1),this.computeApproximateSize(!1,t));else{this.computeApproximateSize(!1,t);const b=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(b==null)throw new Error("VirtualizedFile.render: simple virtualizer is not available");b.connect(e,this),this.isVisible=b.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!s||!d))return this.file=t,s&&(this.cachedHeaderHTML=void 0),this.renderPlaceholder(this.height);const h=this.virtualizer.getWindowSpecs(),p=this.top??0,m=this.computeRenderRangeFromWindow(t,p,h),y=super.renderPreparedFile({file:t,fileContainer:e,renderRange:m,lineAnnotations:r,forceRender:(u??n)||f||s,...a});return this.isSimpleMode()&&y&&this.getSimpleVirtualizer()?.requestHeightReconcile(this),y}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%P8===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,r;for(;t<=n;){const a=t+n>>1,s=this.cache.checkpoints[a];if(s==null)throw new Error("VirtualizedFile: invalid checkpoint index");s.lineIndex<=e?(r=s,t=a+1):n=a-1}return r}getLayoutCheckpointBeforeTop(e,t){let n=0,r=this.cache.checkpoints.length-1,a=-1;for(;n<=r;){const s=n+r>>1,u=this.cache.checkpoints[s];if(u==null)throw new Error("VirtualizedFile: invalid checkpoint index");u.top<=e?(a=s,n=s+1):r=s-1}if(t==null)return a>=0?this.cache.checkpoints[a]:void 0;for(let s=a;s>=0;s--){const u=this.cache.checkpoints[s];if(u==null)throw new Error("VirtualizedFile: invalid checkpoint index");if(u.lineIndex%t===0)return u}}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:r}){const{disableFileHeader:a=!1,overflow:s="scroll"}=this.options,{hunkLineCount:u,lineHeight:d}=this.metrics,f=this.fileRenderer.getLineCount(e),h=this.height,p=Yn(this.metrics,a),m=f>0?Hc(this.metrics):0,{fileAnnotationHeight:y}=this.cache,b=p+y,S=Math.max(0,h-p-y-m),_=vm(this.lineAnnotations),w=t+p,x=y>0&&_&&w<r&&w+y>n;if(t<n-h||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:h-p-m};if(f<=u)return{startingLine:0,totalLines:u,bufferBefore:0,bufferAfter:0};const E=Math.ceil(Math.max(r-n,0)/d),L=Math.ceil(E/u)*u+u,R=L/u,D=(n+r)/2;if(s==="scroll"&&!this.hasLineAnnotations()){const le=t+b,de=le+S;if(!x&&!(le<r&&de>n))return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:h-p-m};const re=Math.floor(x&&D<t+b?0:(D-(t+b))/d),ce=Math.floor(re/u)-Math.floor(R/2),ke=Math.ceil(f/u),fe=Math.max(0,Math.min(ce,ke))*u,Fe=ce<0?L+ce*u:L,Ge=fe===0?0:y+fe*d,Ze=Math.min(Fe,f-fe);return{startingLine:fe,totalLines:Fe,bufferBefore:Ge,bufferAfter:Math.max(0,(f-fe-Ze)*d)}}const N=R,H=[],U=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-L*d*2),u);let W=t+(U?.top??b),ee=U?.lineIndex??0,te,V,Z;const ie=U?.lineIndex??0;for(let le=ie;le<f;le++){const de=ee%u===0,re=Math.floor(ee/u);if(de&&(H[re]=W-(t+b),Z!=null)){if(Z<=0)break;Z--}const ce=this.getLineHeight(le,!1);W>n-ce&&W<r&&(te??=re),W+ce>D&&(V??=re),Z==null&&W>=r&&de&&(Z=N),ee++,W+=ce}if(te==null)if(x)te=0,V=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:h-p-m};V??=te;const se=Math.round(V-R/2),I=Math.max(0,Math.ceil(f/u)-R),G=Math.max(0,Math.min(se,I)),X=G*u,ue=se<0?L+se*u:L,Y=H[G]??0,M=X===0?0:y+Y,q=G+ue/u,oe=q<H.length?S-H[q]:S-(W-t-b);return{startingLine:X,totalLines:ue,bufferBefore:M,bufferAfter:Math.max(0,oe)}}};function B8(e){let t;for(const n of e.children)n instanceof HTMLElement&&n.dataset.lineAnnotation===o1&&(t=Math.max(t??0,n.getBoundingClientRect().height));return t}function Jr(e,t){return e===t||e?.cacheKey!=null&&e.cacheKey===t?.cacheKey}function F8(e){return{...e,hunks:e.hunks.map(t=>({...t,hunkContent:t.hunkContent.map(n=>({...n}))})),deletionLines:[...e.deletionLines],additionLines:[...e.additionLines]}}function Sm(e){return e!==""?e.split(cM):[]}function _m(e,t,n){const r=e==="clone"?F8(t):t;if(!r.isPartial)throw new Error("hydratePartialDiff: fileDiff must be partial");switch(r.type){case"change":case"rename-changed":return G8(r,q8(r,n),H_(r,n));case"rename-pure":{const a=H_(r,n);W8(r,n);const s=Sm(a.contents);return r.isPartial=!1,r.deletionLines=s,r.additionLines=s,E1(r,null,a),r}}throw new Error(`hydratePartialDiff: ${r.type} diffs cannot be hydrated from loaded files`)}function G8(e,t,n){const r=Sm(t.contents),a=Sm(n.contents),{hunks:s,splitLineCount:u,unifiedLineCount:d}=$8(e.hunks,a.length);return e.hunks=s,e.splitLineCount=u,e.unifiedLineCount=d,e.isPartial=!1,e.deletionLines=r,e.additionLines=a,E1(e,t,n),e}function $8(e,t){let n=0,r=0,a=0;const s=[];for(const u of e){const d=Math.max(u.additionStart-1,0),f=Math.max(u.deletionStart-1,0);let h=d,p=f,m=0,y=0,b=0,S=0;const _=[];for(const x of u.hunkContent){if(x.type==="context"){_.push({...x,additionLineIndex:h,deletionLineIndex:p}),h+=x.lines,p+=x.lines,b+=x.lines,S+=x.lines;continue}_.push({...x,additionLineIndex:h,deletionLineIndex:p}),h+=x.additions,p+=x.deletions,m+=x.additions,y+=x.deletions,b+=Math.max(x.additions,x.deletions),S+=x.additions+x.deletions}const w=Math.max(ii(u.additionStart,u.additionCount)-a,0);s.push({...u,collapsedBefore:w,additionLineIndex:d,deletionLineIndex:f,additionLines:m,deletionLines:y,hunkContent:_,splitLineStart:n+w,unifiedLineStart:r+w,splitLineCount:b,unifiedLineCount:S}),n+=w+b,r+=w+S,a=Wt(u.additionStart,u.additionCount)}if(s.length>0){const u=s[s.length-1],d=Wt(u.additionStart,u.additionCount),f=Math.max(t-d,0);n+=f,r+=f}return{hunks:s,splitLineCount:n,unifiedLineCount:r}}function q8(e,t){if(t.oldFile==null)throw new Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile`);return t.oldFile}function H_(e,t){if(t.newFile==null)throw new Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires newFile`);return t.newFile}function W8(e,t){if(t.oldFile!==null)throw new Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile to be null`)}function Y8(e,t,n){return e.cacheKey!=null?`${e.cacheKey}:hydrated`:K8(t,n)}function E1(e,t,n){const r=Y8(e,t,n);if(r==null){delete e.cacheKey;return}e.cacheKey=r}function K8(e,t){return e!=null&&t!=null?e.cacheKey!=null&&t.cacheKey!=null?`${e.cacheKey}:${t.cacheKey}`:void 0:e?.cacheKey??t?.cacheKey}var X8=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 r of e.children??[])r instanceof HTMLElement&&("deletions"in r.dataset?t=r:"additions"in r.dataset&&(n=r));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 Wn(e,t){return wa(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function Bu(e){return Ce({tagName:"div",properties:{"data-content-buffer":"","data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function Fu(e){return Ce({tagName:"div",children:[Ce({tagName:"span",children:[ei("No newline at end of file")]})],properties:{"data-no-newline":"","data-line-type":e,"data-column-content":""}})}function cp(e){return Ce({tagName:"div",children:[_c({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 aa({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:a,isFirstHunk:s,isLastHunk:u}){let d=0;const f=[];if(e==="metadata"&&t!=null&&f.push(Ce({tagName:"div",children:[ei(t)],properties:{"data-separator-wrapper":""}})),(e==="line-info"||e==="line-info-basic")&&t!=null){const h=[];n!=null&&(r?(s||(h.push(cp("up")),d++),u||(h.push(cp("down")),d++)):(h.push(cp(!s&&!u?"both":s?"down":"up")),d++)),h.push(Ce({tagName:"div",children:[Ce({tagName:"span",children:[ei(t)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),r&&n!=null&&h.push(Ce({tagName:"div",children:[ei("Expand all")],properties:{role:"button","data-expand-button":"","data-expand-all-button":""}})),f.push(Ce({tagName:"div",children:h,properties:{"data-separator-wrapper":"","data-separator-multi-button":d>1?"":void 0}}))}return e==="custom"&&a!=null&&f.push(Ce({tagName:"slot",properties:{name:a}})),Ce({tagName:"div",children:f,properties:{"data-separator":f.length===0?"simple":e,"data-expand-index":n,"data-separator-first":s?"":void 0,"data-separator-last":u?"":void 0}})}function Q8(e,t){return`hunk-separator-${e}-${t}`}function Z8(e){const t=e.at(-1);return t==null?0:Math.max(Wt(t.additionStart,t.additionCount),Wt(t.deletionStart,t.deletionCount))}function Cm(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function P_({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 Gu({item:e,arr:t,enableJoin:n,isNeutral:r=!1,isLastItem:a=!1}){const s=t[t.length-1];if(s==null||a||!n){t.push([r?0:1,e.value]);return}const u=s[0]===0;if(r===u||r&&e.value.length===1&&!u){s[1]+=e.value;return}t.push([r?0:1,e.value])}function Qs(e){return[ii(e.additionStart,e.additionCount)+1,Wt(e.additionStart,e.additionCount)+1]}function Hi({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:r,collapsedContextThreshold:a}){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<=a)return{fromStart:s,fromEnd:0,rangeSize:s,collapsedLines:0,renderAll:!0};const u=n?.get(r),d=Math.min(Math.max(u?.fromStart??0,0),s),f=Math.min(Math.max(u?.fromEnd??0,0),s),h=d+f,p=h>=s;return{fromStart:p?s:d,fromEnd:p?0:f,rangeSize:s,collapsedLines:Math.max(s-h,0),renderAll:p}}function J8(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-Wt(t.additionStart,t.additionCount),r=e.deletionLines.length-Wt(t.deletionStart,t.deletionCount);return n<=0&&r<=0?!1:n!==r}function w1({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 r=e.additionLines.length-Wt(n.additionStart,n.additionCount),a=e.deletionLines.length-Wt(n.deletionStart,n.deletionCount);if(r<=0&&a<=0)return 0;if(r!==a)throw new Error(`${t}: trailing context mismatch (additions=${r}, deletions=${a}) for ${e.name}`);return Math.min(r,a)}function Pi({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:a}){if(t!==e.hunks.length-1)return;const s=w1({fileDiff:e,errorPrefix:a});if(s<=0)return;if(n===!0||s<=r)return{fromStart:s,fromEnd:0,rangeSize:s,collapsedLines:0,renderAll:!0};const u=n?.get(e.hunks.length),d=Math.min(Math.max(u?.fromStart??0,0),s);return{fromStart:d,fromEnd:0,rangeSize:s,collapsedLines:s-d,renderAll:d>=s}}function k1({fileDiff:e,lineNumber:t,expandedHunks:n,collapsedContextThreshold:r}){if(n===!0||e.isPartial)return!0;for(const[d,f]of e.hunks.entries()){const[h,p]=Qs(f);if(t<h){const m=Hi({isPartial:e.isPartial,rangeSize:f.collapsedBefore,expandedHunks:n,hunkIndex:d,collapsedContextThreshold:r}),y=h-m.rangeSize;return m.renderAll||t<y+m.fromStart||t>=h-m.fromEnd}if(t<p)return!0}const a=Pi({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:"isAdditionLineRenderable"});if(a==null||a.renderAll)return!0;const s=e.hunks[e.hunks.length-1],[,u]=Qs(s);return t<u+a.fromStart||t>=u+a.rangeSize}function e5({fileDiff:e,lineNumber:t,direction:n,expandedHunks:r,collapsedContextThreshold:a}){if(r===!0||e.isPartial)return t;const s=[];let u=1;for(const[f,h]of e.hunks.entries()){const[p,m]=Qs(h),y=Hi({isPartial:e.isPartial,rangeSize:h.collapsedBefore,expandedHunks:r,hunkIndex:f,collapsedContextThreshold:a}),b=p-y.rangeSize;y.renderAll?s.push([b,p]):(y.fromStart>0&&s.push([b,b+y.fromStart]),y.fromEnd>0&&s.push([p-y.fromEnd,p])),s.push([p,m]),u=m}const d=Pi({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:r,collapsedContextThreshold:a,errorPrefix:"getNearestRenderableAdditionLine"});if(d!=null){const f=u;u=f+d.rangeSize,d.renderAll?s.push([f,u]):d.fromStart>0&&s.push([f,f+d.fromStart])}if(t>=u)return t;if(n==="down"){for(const[f,h]of s)if(h>t)return Math.max(f,t);return}for(let f=s.length-1;f>=0;f--){const[h,p]=s[f];if(h<=t)return Math.min(p-1,t)}}function L1({type:e,metrics:t}){return t.hunkSeparatorHeight??H8(e)}function T1({type:e,metrics:t}){return e==="simple"||e==="metadata"||e==="line-info-basic"?0:t.spacing}function t5({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 n5(e){return e!=="simple"&&e!=="metadata"}function Rs({type:e,metrics:t,hunkIndex:n,hunkSpecs:r}){if(!t5({type:e,hunkIndex:n,hunkSpecs:r}))return;const a=L1({type:e,metrics:t}),s=T1({type:e,metrics:t}),u=n>0?s:0,d=s;return{height:a,gapBefore:u,gapAfter:d,totalHeight:u+a+d}}function Xr({type:e,metrics:t}){if(!n5(e))return;const n=L1({type:e,metrics:t}),r=T1({type:e,metrics:t});return{height:n,gapBefore:r,gapAfter:0,totalHeight:r+n}}function no({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:a,collapsedContextThreshold:s=1,callback:u}){const d=i5({diff:e,diffStyle:t,startingLine:n,expandedHunks:a,collapsedContextThreshold:s}),f={viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:d.splitCount,unifiedCount:d.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!f.isWindowedHighlight)return!1;const h=f.unifiedCount>=n+r,p=f.splitCount>=n+r;return t==="unified"?h:(t==="split"||h)&&p},shouldSkip(h,p){if(!f.isWindowedHighlight)return!1;const m=h>0&&f.unifiedCount+h<=n,y=p>0&&f.splitCount+p<=n;return t==="unified"?m:(t==="split"||m)&&y},incrementCounts(h,p){(t==="unified"||t==="both")&&(f.unifiedCount+=h),(t==="split"||t==="both")&&(f.splitCount+=p)},isInWindow(h,p){if(!f.isWindowedHighlight)return!0;const m=f.isInUnifiedWindow(h),y=f.isInSplitWindow(p);return t==="unified"?m:t==="split"?y:m||y},isInUnifiedWindow(h){return!f.isWindowedHighlight||f.unifiedCount>=n-h&&f.unifiedCount<n+r},isInSplitWindow(h){return!f.isWindowedHighlight||f.splitCount>=n-h&&f.splitCount<n+r},emit(h,p=!1){return p||(t==="unified"?f.incrementCounts(1,0):t==="split"?f.incrementCounts(0,1):f.incrementCounts(1,1)),u(h)??!1}};e:for(let h=d.hunkIndex;h<e.hunks.length;h++){let E=function(V,Z){return w==null||w.collapsedLines<=0||w.fromStart+w.fromEnd>0?0:t==="unified"?V===p.unifiedLineStart+p.unifiedLineCount-1?w.collapsedLines:0:Z===p.splitLineStart+p.splitLineCount-1?w.collapsedLines:0},R=function(){return L?0:(L=!0,_.collapsedLines)};const p=e.hunks[h];if(p==null)throw new Error("iterateOverDiff: invalid hunk index");if(f.shouldBreak())break;const m=ii(p.deletionStart,p.deletionCount),y=ii(p.additionStart,p.additionCount),b=!e.isPartial&&p.deletionCount===0?m:p.deletionLineIndex,S=!e.isPartial&&p.additionCount===0?y:p.additionLineIndex,_=Hi({isPartial:e.isPartial,rangeSize:p.collapsedBefore,expandedHunks:a,hunkIndex:h,collapsedContextThreshold:s}),w=h===f.finalHunkIndex?Pi({fileDiff:e,hunkIndex:h,expandedHunks:a,collapsedContextThreshold:s,errorPrefix:"iterateOverDiff"}):void 0,x=_.fromStart+_.fromEnd;let L=_.collapsedLines===0;if(f.shouldSkip(x,x))f.incrementCounts(x,x),R();else{let V=p.unifiedLineStart-_.rangeSize,Z=p.splitLineStart-_.rangeSize,ie=b-_.rangeSize,se=S-_.rangeSize,I=m+1-_.rangeSize,G=y+1-_.rangeSize;if($u(f,_.fromStart,t,X=>f.emit({hunkIndex:h,hunk:p,collapsedBefore:0,collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:I+X,lineIndex:ie+X,noEOFCR:!1,unifiedLineIndex:V+X,splitLineIndex:Z+X},additionLine:{unifiedLineIndex:V+X,splitLineIndex:Z+X,lineIndex:se+X,lineNumber:G+X,noEOFCR:!1}}))||(V=p.unifiedLineStart-_.fromEnd,Z=p.splitLineStart-_.fromEnd,ie=b-_.fromEnd,se=S-_.fromEnd,I=m+1-_.fromEnd,G=y+1-_.fromEnd,$u(f,_.fromEnd,t,X=>f.emit({hunkIndex:h,hunk:p,collapsedBefore:R(),collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:I+X,lineIndex:ie+X,noEOFCR:!1,unifiedLineIndex:V+X,splitLineIndex:Z+X},additionLine:{unifiedLineIndex:V+X,splitLineIndex:Z+X,lineIndex:se+X,lineNumber:G+X,noEOFCR:!1}}),()=>{R()})))break e}let D=p.unifiedLineStart,N=p.splitLineStart,H=b,U=S,W=m+1,ee=y+1;const te=p.hunkContent.at(-1);for(const V of p.hunkContent){if(f.shouldBreak())break e;const Z=V===te;if(V.type==="context"){if(f.shouldSkip(V.lines,V.lines))f.incrementCounts(V.lines,V.lines),R();else if($u(f,V.lines,t,ie=>{const se=Z&&ie===V.lines-1,I=D+ie,G=N+ie;return f.emit({hunkIndex:h,hunk:p,collapsedBefore:R(),collapsedAfter:E(I,G),type:"context",deletionLine:{lineNumber:W+ie,lineIndex:H+ie,noEOFCR:se&&p.noEOFCRDeletions,unifiedLineIndex:I,splitLineIndex:G},additionLine:{unifiedLineIndex:I,splitLineIndex:G,lineIndex:U+ie,lineNumber:ee+ie,noEOFCR:se&&p.noEOFCRAdditions}})},()=>{R()}))break e;D+=V.lines,N+=V.lines,H+=V.lines,U+=V.lines,W+=V.lines,ee+=V.lines}else{const ie=Math.max(V.deletions,V.additions),se=V.deletions+V.additions;if(!f.shouldSkip(se,ie)){const I=a5(f,V,t);(I[0]?.[0]??0)>0&&R();for(const[G,X]of I)for(let ue=G;ue<X;ue++){const Y=E(D+ue,t==="unified"?N+(ue<V.deletions?ue:ue-V.deletions):N+ue);if(f.emit(s5({hunkIndex:h,hunk:p,collapsedBefore:R(),collapsedAfter:Y,diffStyle:t,index:ue,unifiedLineIndex:D,splitLineIndex:N,additionLineIndex:U,deletionLineIndex:H,additionLineNumber:ee,deletionLineNumber:W,content:V,isLastContent:Z,unifiedCount:se,splitCount:ie}),!0))break e}}R(),f.incrementCounts(se,ie),D+=se,N+=ie,H+=V.deletions,U+=V.additions,W+=V.deletions,ee+=V.additions}}if(w!=null){const{collapsedLines:V,fromStart:Z,fromEnd:ie}=w,se=Z+ie;if($u(f,se,t,I=>{const G=I===se-1;return f.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:G?V:0,type:"context-expanded",deletionLine:{lineNumber:W+I,lineIndex:H+I,noEOFCR:!1,unifiedLineIndex:D+I,splitLineIndex:N+I},additionLine:{unifiedLineIndex:D+I,splitLineIndex:N+I,lineIndex:U+I,lineNumber:ee+I,noEOFCR:!1}})},void 0,()=>f.shouldBreak()))break e}}}function i5({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:a}){if(n<=0||t==="both")return{hunkIndex:0,splitCount:0,unifiedCount:0};const s=r5({diff:e,expandedHunks:r,collapsedContextThreshold:a});let u=0,d=e.hunks.length-1,f=e.hunks.length;for(;u<=d;){const p=u+d>>1,m=s[p+1];if(m==null)throw new Error("iterateOverDiff: invalid hunk prefix index");(t==="unified"?m.unifiedCount:m.splitCount)>n?(f=p,d=p-1):u=p+1}if(f>=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 h=s[f];if(h==null)throw new Error("iterateOverDiff: invalid selected hunk prefix index");return{hunkIndex:f,splitCount:h.splitCount,unifiedCount:h.unifiedCount}}function r5({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let r=0,a=0;const s=e.hunks.length-1,u=[{splitCount:0,unifiedCount:0}];for(let d=0;d<e.hunks.length;d++){const f=e.hunks[d];if(f==null)throw new Error("iterateOverDiff: invalid hunk summary index");const h=Hi({isPartial:e.isPartial,rangeSize:f.collapsedBefore,expandedHunks:t,hunkIndex:d,collapsedContextThreshold:n}),p=h.fromStart+h.fromEnd;r+=p+f.splitLineCount,a+=p+f.unifiedLineCount;const m=d===s?Pi({fileDiff:e,hunkIndex:d,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:"iterateOverDiff"}):void 0;if(m!=null){const y=m.fromStart+m.fromEnd;r+=y,a+=y}u.push({splitCount:r,unifiedCount:a})}return u}function o5(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];const r=[];function a(d){const f=Math.max(0,e.viewportStart-d),h=Math.min(t,e.viewportEnd-d);h>f&&r.push([f,h])}if(n!=="split"&&a(e.unifiedCount),n!=="unified"&&a(e.splitCount),r.length===0)return[0,0];let s=r[0][0],u=r[0][1];for(let d=1;d<r.length;d++){const f=r[d];s=Math.min(s,f[0]),u=Math.max(u,f[1])}return[s,u]}function $u(e,t,n,r,a,s){const[u,d]=o5(e,t,n);u>0&&(e.incrementCounts(u,u),a?.());let f=u;for(;f<t;){if(s?.()===!0)return!0;if(f>=d){e.incrementCounts(t-f,t-f);break}if(e.isInWindow(0,0)){if(r(f)===!0)return!0}else e.incrementCounts(1,1);f++}return!1}function a5(e,t,n){if(!e.isWindowedHighlight)return[[0,n==="unified"?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];const r=n!=="split",a=n!=="unified",s=n==="unified"?"unified":"split",u=[];function d(m,y){if(m+y<=e.viewportStart||m>=e.viewportEnd)return;const b=Math.max(0,e.viewportStart-m),S=Math.min(y,e.viewportEnd-m);return S>b?[b,S]:void 0}function f(m,y){return s==="split"?m:y==="additions"?[m[0]+t.deletions,m[1]+t.deletions]:m}function h(m,y){if(m==null)return;const[b,S]=f(m,y);S>b&&u.push([b,S])}if(r&&(h(d(e.unifiedCount,t.deletions),"deletions"),h(d(e.unifiedCount+t.deletions,t.additions),"additions")),a&&(h(d(e.splitCount,t.deletions),"deletions"),h(d(e.splitCount,t.additions),"additions")),u.length===0)return u;u.sort((m,y)=>m[0]-y[0]);const p=[u[0]];for(const[m,y]of u.slice(1)){const b=p[p.length-1];m<=b[1]?b[1]=Math.max(b[1],y):p.push([m,y])}return p}function s5({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:a,index:s,unifiedLineIndex:u,splitLineIndex:d,additionLineIndex:f,deletionLineIndex:h,additionLineNumber:p,deletionLineNumber:m,content:y,isLastContent:b,unifiedCount:S,splitCount:_}){const w=s<y.deletions?u+s:void 0,x=a==="unified"?s>=y.deletions?u+s:void 0:s<y.additions?u+y.deletions+s:void 0,E=a==="unified"?d+(s<y.deletions?s:s-y.deletions):d+s,L=s<y.deletions?h+s:void 0,R=s<y.deletions?m+s:void 0,D=a==="unified"?s>=y.deletions?f+(s-y.deletions):void 0:s<y.additions?f+s:void 0,N=a==="unified"?s>=y.deletions?p+(s-y.deletions):void 0:s<y.additions?p+s:void 0,H=a==="unified"?b&&s===y.deletions-1&&t.noEOFCRDeletions:b&&s===_-1&&t.noEOFCRDeletions,U=a==="unified"?b&&s===S-1&&t.noEOFCRAdditions:b&&s===_-1&&t.noEOFCRAdditions,W=L!=null&&R!=null&&w!=null?{lineNumber:R,lineIndex:L,noEOFCR:H,unifiedLineIndex:w,splitLineIndex:E}:void 0,ee=D!=null&&N!=null&&x!=null?{unifiedLineIndex:x,splitLineIndex:E,lineIndex:D,lineNumber:N,noEOFCR:U}:void 0;if(W==null&&ee!=null)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:void 0,additionLine:ee};if(W!=null&&ee==null)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:W,additionLine:void 0};if(W==null||ee==null)throw new Error("iterateOverDiff: missing change line data");return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:W,additionLine:ee}}const l5={forcePlainText:!1};function A1(e,t,n,{forcePlainText:r,startingLine:a,totalLines:s,expandedHunks:u,collapsedContextThreshold:d=1}=l5){r?(a??=0,s??=1/0):(a=0,s=1/0);const f=a>0||s<1/0,h=typeof n.theme=="string"?t.getTheme(n.theme).type:void 0,p=i1({theme:n.theme,highlighter:t}),m=r&&!f&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?"none":n.lineDiffType,y={deletionLines:[],additionLines:[]},{maxLineDiffLength:b}=n,S=!r&&!e.isPartial,_=r?u:void 0,w=new Map;function x(L){const R=S?0:L,D=w.get(R)??c5();return w.set(R,D),D}function E(L,R,D,N){if(f){let H=D.at(-1);(H==null||H.targetIndex+H.count!==R)&&(H={targetIndex:R,originalOffset:N.length,count:0},D.push(H)),H.count++}N.push(L)}no({diff:e,diffStyle:"both",startingLine:a,totalLines:s,expandedHunks:f?_:!0,collapsedContextThreshold:d,callback:({hunkIndex:L,additionLine:R,deletionLine:D,type:N})=>{const H=x(L),U=R!=null?R.splitLineIndex:D.splitLineIndex;N==="change"&&R!=null&&D!=null&&u5({additionLine:e.additionLines[R.lineIndex],deletionLine:e.deletionLines[D.lineIndex],deletionLineIndex:H.deletionContent.length,additionLineIndex:H.additionContent.length,deletionDecorations:H.deletionDecorations,additionDecorations:H.additionDecorations,lineDiffType:m,maxLineDiffLength:b}),D!=null&&(E(e.deletionLines[D.lineIndex],D.lineIndex,H.deletionSegments,H.deletionContent),H.deletionInfo.push({type:N==="change"?"change-deletion":N,lineNumber:D.lineNumber,altLineNumber:N==="change"?void 0:R.lineNumber??void 0,lineIndex:`${D.unifiedLineIndex},${U}`})),R!=null&&(E(e.additionLines[R.lineIndex],R.lineIndex,H.additionSegments,H.additionContent),H.additionInfo.push({type:N==="change"?"change-addition":N,lineNumber:R.lineNumber,altLineNumber:N==="change"?void 0:D.lineNumber??void 0,lineIndex:`${R.unifiedLineIndex},${U}`}))}});for(const L of w.values()){if(L.deletionContent.length===0&&L.additionContent.length===0)continue;const R={name:e.prevName??e.name,contents:L.deletionContent.value},D={name:e.name,contents:L.additionContent.value},{deletionLines:N,additionLines:H}=d5({deletionFile:R,deletionInfo:L.deletionInfo,deletionDecorations:L.deletionDecorations,additionFile:D,additionInfo:L.additionInfo,additionDecorations:L.additionDecorations,highlighter:t,options:n,languageOverride:r?"text":e.lang});if(S){y.deletionLines=N,y.additionLines=H;continue}if(L.deletionSegments.length>0)for(const U of L.deletionSegments)for(let W=0;W<U.count;W++)y.deletionLines[U.targetIndex+W]=N[U.originalOffset+W];else y.deletionLines.push(...N);if(L.additionSegments.length>0)for(const U of L.additionSegments)for(let W=0;W<U.count;W++)y.additionLines[U.targetIndex+W]=H[U.originalOffset+W];else y.additionLines.push(...H)}return{code:y,themeStyles:p,baseThemeType:h}}function u5({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:a,additionDecorations:s,lineDiffType:u,maxLineDiffLength:d}){if(e==null||t==null||u==="none"||(e=zi(e),t=zi(t),e.length>d||t.length>d))return;const f=u==="char"?$M(e,t):YM(e,t),h=[],p=[],m=u==="word-alt",y=f.at(-1);for(const S of f){const _=S===y;!S.added&&!S.removed?(Gu({item:S,arr:h,enableJoin:m,isNeutral:!0,isLastItem:_}),Gu({item:S,arr:p,enableJoin:m,isNeutral:!0,isLastItem:_})):S.removed?Gu({item:S,arr:h,enableJoin:m,isLastItem:_}):Gu({item:S,arr:p,enableJoin:m,isLastItem:_})}let b=0;for(const S of h)S[0]===1&&a.push(P_({line:n,spanStart:b,spanLength:S[1].length})),b+=S[1].length;b=0;for(const S of p)S[0]===1&&s.push(P_({line:r,spanStart:b,spanLength:S[1].length})),b+=S[1].length}function c5(){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 d5({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:a,deletionDecorations:s,additionDecorations:u,languageOverride:d,options:{theme:f=ot,...h}}){const p=d??Ht(e.name),m=d??Ht(t.name),{state:y,transformers:b}=n1(h.useTokenTransformer),S=typeof f=="string"?{...h,lang:"text",theme:f,transformers:b,decorations:void 0,defaultColor:!1,cssVariablePrefix:un("token"),tokenizeTimeLimit:0}:{...h,lang:"text",themes:f,transformers:b,decorations:void 0,defaultColor:!1,cssVariablePrefix:un("token"),tokenizeTimeLimit:0};return{deletionLines:e.contents===""?[]:(S.lang=p,y.lineInfo=n,S.decorations=s,gm(a.codeToHast(zi(e.contents),S))),additionLines:t.contents===""?[]:(S.lang=m,S.decorations=u,y.lineInfo=r,gm(a.codeToHast(zi(t.contents),S)))}}function Ti(e,t){const n=lo({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 f5(e,t){const n=Math.max(e,1);let r=Array.from({length:n},(a,s)=>`${" ".repeat(s+1)}
|
|
1534
|
+
`).join("");return r===t&&(r=Array.from({length:n},(a,s)=>`\0${" ".repeat(s)}
|
|
1535
|
+
`).join("")),r}function h5(e){for(const t of e)if(t.trim().length>0)return!1;return!0}function xm(e,t){return t.length>0&&t.length<e.deletionLines.length&&h5(t)}function Pc(e,t,n){const r=e.deletionLines.join(""),a=f5(t.length,r),s=lo({name:e.prevName??e.name,contents:r},{name:e.name,contents:a,lang:e.lang},n);return{hunks:s.hunks,splitLineCount:s.splitLineCount,unifiedLineCount:s.unifiedLineCount,additionLines:t,deletionLines:s.deletionLines,type:s.type}}function hc(e,t){return Pc(e,[""],t)}function R1(e,t){if(e.additionLines.length===0)return hc(e,t);if(xm(e,e.additionLines))return Pc(e,e.additionLines,t);const n=e.additionLines,r=Ti(e,t);return O1(r,n),r}function p5(e){return e.length>1&&e.at(-1)===""}function O1(e,t){if(!p5(t))return;const n=t.length-e.additionLines.length;if(n<=0)return;const r=e.additionLines.length,a=e.hunks.at(-1);if(a!=null&&Wt(a.additionStart,a.additionCount)===r){for(const s of a.hunkContent)if(s.type==="change"&&s.additions<s.deletions&&s.additionLineIndex+s.additions===r){e.additionLines=t,s.additions+=n,a.additionCount+=n,a.additionLines+=n,bg(e);return}}}function m5(e,t,n){if(e.isPartial||e.deletionLines.length!==e.additionLines.length)return ki(e,Ti(e,n));const r=Array.from(t);if(r.length===0)return ki(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type});for(const s of r){const u=e.additionLines[s],d=e.deletionLines[s];if(u==null||d==null||zi(u)===zi(d))return ki(e,Ti(e,n))}const a=g5(e,r);if(a.size===0)return ki(e,Ti(e,n));for(const s of a)if(!y5(e,s,n))return ki(e,Ti(e,n));return bg(e),J8(e)?ki(e,Ti(e,n)):ki(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}function ki(e,t){return Object.assign(e,t),t}function g5(e,t){const n=new Set;for(const r of t){const a=v5(e,r);if(a==null)return new Set;n.add(a)}return n}function v5(e,t){for(const[n,r]of e.hunks.entries()){const a=r.additionLineIndex+r.additionCount;if(t>=r.additionLineIndex&&t<a)return n}}function y5(e,t,n){const r=e.hunks[t];if(r==null)return!1;const a=e.deletionLines.slice(r.deletionLineIndex,r.deletionLineIndex+r.deletionCount),s=e.additionLines.slice(r.additionLineIndex,r.additionLineIndex+r.additionCount),u=lo({name:e.prevName??e.name,contents:a.join("")},{name:e.name,contents:s.join(""),lang:e.lang},{...n,context:0}),d=u.hunks[0];return d==null||u.hunks.length!==1?!1:(b5(r,d),D1(e,t),!0)}function D1(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 r=e.additionLines.at(-1),a=e.deletionLines.at(-1);n.noEOFCRAdditions=r!=null&&r!==""&&!r.endsWith(`
|
|
1536
|
+
`),n.noEOFCRDeletions=a!=null&&a!==""&&!a.endsWith(`
|
|
1537
|
+
`)}function b5(e,t){const n=e.additionLineIndex,r=e.deletionLineIndex;e.hunkContent=t.hunkContent.map(a=>M1(a,n,r)),e.additionLineIndex=n+t.additionLineIndex,e.additionStart=e.additionStart+t.additionLineIndex,e.additionCount=t.additionCount,e.additionLines=t.additionLines,t.deletionLineIndex>=0&&(e.deletionLineIndex=r+t.deletionLineIndex,e.deletionStart=e.deletionStart+t.deletionLineIndex),e.deletionCount=t.deletionCount,e.deletionLines=t.deletionLines,e.noEOFCRAdditions=t.noEOFCRAdditions,e.noEOFCRDeletions=t.noEOFCRDeletions,yg(e)}function M1(e,t,n){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+n}}function yg(e){let t=0,n=0;for(const r of e.hunkContent)r.type==="context"?(t+=r.lines,n+=r.lines):(t+=Math.max(r.additions,r.deletions),n+=r.additions+r.deletions);e.splitLineCount=t,e.unifiedLineCount=n}function bg(e){let t=0,n=0,r=0;for(const a of e.hunks)a.collapsedBefore=Math.max(ii(a.additionStart,a.additionCount)-r,0),a.splitLineStart=t+a.collapsedBefore,a.unifiedLineStart=n+a.collapsedBefore,yg(a),t+=a.collapsedBefore+a.splitLineCount,n+=a.collapsedBefore+a.unifiedLineCount,r=Wt(a.additionStart,a.additionCount);if(e.hunks.length>0){const a=e.hunks[e.hunks.length-1],s=Math.max(e.additionLines.length-Wt(a.additionStart,a.additionCount),0);t+=s,n+=s}e.splitLineCount=t,e.unifiedLineCount=n}const U_=new WeakMap;function S5(e){return e.length>1&&e[e.length-1]===""?e.slice(0,-1):e}function _5(e,t){const n=Math.min(e.length,t.length);let r=0;for(;r<n&&e[r]===t[r];)r++;let a=e.length,s=t.length;for(;a>r&&s>r&&e[a-1]===t[s-1];)a--,s--;if(!(r===a&&r===s))return{start:r,deletionEnd:a,additionEnd:s}}function Em(e,t){const n=e.hunks,r=e.additionLines,a=S5(r),s=a===r?e:{...e,additionLines:a},u=R5(n,A5(s,t),e.deletionLines.length),d=M5(s,u);if(e.additionLines=a,e.hunks=d,e.editSessionDirty=!0,H5(e),O1(e,r),!!I5(n,e.hunks))return{regions:u.map(f=>f.previousSpan)}}function C5(e,t,n,r){const a=Array.from(new Set(t)).filter(f=>f>=0&&f<e.additionLines.length).sort((f,h)=>f-h);if(a.length===0)return;const{hunks:s}=e;let u,d=0;for(const f of a){for(;d<s.length;){const m=s[d];if(f<Uc(m)+m.additionCount)break;d++}const h=s[d],p=h==null?void 0:Uc(h);if(p==null||f<p||u!=null&&u!==d)return Em(e,n);u=d}if(u!=null){if(x5(e,a,u,r,n)){e.editSessionDirty=!0;return}return Em(e,n)}}function x5(e,t,n,r,a){if(r==null||a?.ignoreWhitespace===!0||a?.stripTrailingCr===!0)return!1;const s=E5(e),u=e.hunks[n];if(u.hunkContent.some(w5))return!1;for(const d of t){const f=r.get(d),h=e.additionLines[d];if(f==null||h==null||s.has(f)||s.has(h))return!1;let p=!1;for(const m of u.hunkContent)if(m.type==="change"&&m.additions===m.deletions&&d>=m.additionLineIndex&&d<m.additionLineIndex+m.additions){p=!0;break}if(!p)return!1}return!0}function E5(e){const t=U_.get(e);if(t?.lines===e.deletionLines)return t.set;const n=new Set(e.deletionLines);return U_.set(e,{lines:e.deletionLines,set:n}),n}function w5(e){return e?.type==="change"&&(e.additions===0||e.deletions===0)}function k5(e,t){const n=new Map,{regions:r}=t;for(let a=0;a<=r.length;a++){const s=r[a-1],u=r[a],d=a===0?e.get(0):s==null?void 0:e.get(s.lastIndex+1),f=u==null?void 0:e.get(u.firstIndex),h=d?.fromStart??0,p=f?.fromEnd??0;(h>0||p>0)&&n.set(a,{fromStart:h,fromEnd:p})}return n}function L5(e,t,n){const r=[];if(e.isPartial)return r;for(const[s,u]of e.hunks.entries()){const d=Hi({isPartial:e.isPartial,rangeSize:u.collapsedBefore,expandedHunks:t,hunkIndex:s,collapsedContextThreshold:n});if(d.rangeSize<=n)continue;const f=fo(u),h=f-d.rangeSize;d.fromStart>0&&r.push([h,h+d.fromStart]),d.fromEnd>0&&r.push([f-d.fromEnd,f])}const a=Pi({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:"captureExpansionAnchors"});if(a!=null&&a.fromStart>0&&a.rangeSize>n){const s=e.hunks[e.hunks.length-1],u=fo(s)+s.deletionCount;r.push([u,u+a.fromStart])}return r}function T5(e,t){const n=new Map;if(t.length===0)return n;const r=(s,u,d)=>{if(d<=u)return;let f=0,h=0;for(const[p,m]of t)m<=u||p>=d||(p<=u&&(f=Math.max(f,Math.min(m,d)-u)),m>=d&&(h=Math.max(h,d-Math.max(p,u))));(f>0||h>0)&&n.set(s,{fromStart:f,fromEnd:h})};for(const[s,u]of e.hunks.entries()){const d=fo(u);r(s,d-Math.max(u.collapsedBefore,0),d)}const a=e.hunks[e.hunks.length-1];return a!=null&&!e.isPartial&&e.deletionLines.length>0&&r(e.hunks.length,fo(a)+a.deletionCount,e.deletionLines.length),n}function j_(e,t){return e.editSessionDirty!==!0?!1:(e.editSessionDirty=void 0,Object.assign(e,e.additionLines.length<=1&&e.additionLines.join("")===""?Ti(e,t):R1(e,t)),!0)}function A5(e,t){if(_5(e.deletionLines,e.additionLines)==null)return[];const n=lo({name:e.prevName??e.name,contents:e.deletionLines.join("")},{name:e.name,contents:e.additionLines.join(""),lang:e.lang},t),r=[];let a=0,s=0;for(const u of n.hunks){const d=u.additionCount>0?u.additionLineIndex-a:u.deletionLineIndex-s;a+=d,s+=d;for(const f of u.hunkContent){if(f.type==="context"){a+=f.lines,s+=f.lines;continue}const h=M1(f,0,0);h.additions===0&&(h.additionLineIndex=a),h.deletions===0&&(h.deletionLineIndex=s),r.push(h),a+=h.additions,s+=h.deletions}}return r}function R5(e,t,n){const r=e.map((u,d)=>{const f=fo(u);return{deletionStart:f,deletionEnd:f+u.deletionCount,blocks:[],previousSpan:{firstIndex:d,lastIndex:d}}}),a=[];let s=0;for(const u of t){const d=u.deletionLineIndex,f=d+u.deletions;for(;s<r.length&&r[s].deletionEnd<d;)a.push(r[s]),s++;let h=a.length>0&&O5(d,f,a[a.length-1])?a.pop():void 0;for(;s<r.length&&r[s].deletionStart<=f;)h=D5(h,r[s]),s++;if(h==null){let p=d,m=f;if((u.deletions===0||u.additions===0)&&n>u.deletions){const y=a[a.length-1]?.deletionEnd??0,b=r[s]?.deletionStart??n;d>y?p--:f<b&&m++}h={deletionStart:p,deletionEnd:m,blocks:[],previousSpan:void 0}}h.deletionStart=Math.min(h.deletionStart,d),h.deletionEnd=Math.max(h.deletionEnd,f),h.blocks.push(u),a.push(h)}for(;s<r.length;)a.push(r[s]),s++;return a}function O5(e,t,n){return e<=n.deletionEnd&&t>=n.deletionStart}function D5(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 M5(e,t){const n=[];let r=0,a=0;for(const s of t){const u=s.deletionStart-r;if(u<0)throw new Error("buildRegionHunks: overlapping old-side regions");r+=u,a+=u;const d=a,f=[];for(const p of s.blocks){const m=p.deletionLineIndex-r,y=p.additionLineIndex-a;if(m<0||m!==y)throw new Error("buildRegionHunks: canonical block context mismatch");V_(f,m,a,r),r+=m,a+=y,f.push({...p}),r+=p.deletions,a+=p.additions}const h=s.deletionEnd-r;if(h<0)throw new Error("buildRegionHunks: block exceeds its old-side region");V_(f,h,a,r),r+=h,a+=h,n.push(N5(e,{additionStart:d,additionEnd:a,deletionStart:s.deletionStart,deletionEnd:s.deletionEnd},f))}if(e.deletionLines.length-r!==e.additionLines.length-a)throw new Error("buildRegionHunks: trailing context mismatch");return n}function N5(e,t,n){const r=t.additionEnd-t.additionStart,a=t.deletionEnd-t.deletionStart;let s=0,u=0;for(const f of n)f.type==="change"&&(s+=f.additions,u+=f.deletions);const d={collapsedBefore:0,additionStart:qu(t.additionStart,r),additionCount:r,additionLines:s,additionLineIndex:F_(t.additionStart,r),deletionStart:qu(t.deletionStart,a),deletionCount:a,deletionLines:u,deletionLineIndex:F_(t.deletionStart,a),hunkContent:n,hunkSpecs:`@@ -${qu(t.deletionStart,a)},${a} +${qu(t.additionStart,r)},${r} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return yg(d),d}function V_(e,t,n,r){t>0&&e.push({type:"context",lines:t,additionLineIndex:n,deletionLineIndex:r})}function I5(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++){const r=e[n],a=t[n];if(fo(r)!==fo(a)||r.deletionCount!==a.deletionCount||Uc(r)!==Uc(a)||r.additionCount!==a.additionCount||r.splitLineCount!==a.splitLineCount||!z5(r,a))return!0}return!1}function z5(e,t){const n=B_(e),r=B_(t);for(;;){const a=n.next(),s=r.next();if(a.done===!0||s.done===!0)return a.done===s.done;if(a.value[0]!==s.value[0]||a.value[1]!==s.value[1])return!1}}function*B_(e){for(const t of e.hunkContent){if(t.type==="context"){for(let r=0;r<t.lines;r++)yield[t.deletionLineIndex+r,t.additionLineIndex+r];continue}const n=Math.max(t.deletions,t.additions);for(let r=0;r<n;r++)yield[r<t.deletions?t.deletionLineIndex+r:void 0,r<t.additions?t.additionLineIndex+r:void 0]}}function Uc(e){return ii(e.additionStart,e.additionCount)}function fo(e){return ii(e.deletionStart,e.deletionCount)}function qu(e,t){return t===0?e:e+1}function F_(e,t){return t===0?e-1:e}function H5(e){bg(e);for(let t=0;t<e.hunks.length;t++)D1(e,t)}function ba(e){const t=e.lang??Ht(e.name),n=e.lang??(e.prevName!=null?Ht(e.prevName):"text");return t==="text"&&n==="text"}let P5=-1;var U5=class{options;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++P5}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang="text";renderCache;editSessionActive=!1;constructor(e={theme:ot},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=zs(e.theme??ot)?Qw():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,hc(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||ba(e.diff)||Ku(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(r=>this.onHighlightError(r))):this.asyncHighlight(t).then(r=>this.applyRefreshedResult(t,r)).catch(r=>this.onHighlightError(r))}applyRefreshedResult(e,t){if(t==null||this.renderCache==null||this.renderCache.diff!==e||this.editSessionActive)return;const{options:n}=this.getRenderOptions(e);Wn(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 r={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t==="up"||t==="both")&&(r.fromStart+=n),(t==="down"||t==="both")&&(r.fromEnd+=n),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,r)}getExpandedHunk(e){return this.expandedHunks.get(e)??bM}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}})(),r=n[t.lineNumber]??[];n[t.lineNumber]=r,r.push(t)}}updateRenderCache(e,t,n=!1){if(this.renderCache==null)return!1;const{result:r,diff:a}=this.renderCache;if(r==null)return!1;if(a.isPartial)throw new Error("Could not update render cache for partial diff");const s=r.code.additionLines,u=[],d=new Map;for(const[h,p]of e){const m=s[h]?.properties??{},y=p.map(w=>w[2]).join(""),b=h<a.additionLines.length,S=b?a.additionLines[h]??"":"",_=zi(S);b&&(a.additionLines[h]=a1(S,y),_!==y&&(u.push(h),d.set(h,S))),s[h]={type:"element",tagName:"div",properties:{"data-line":m["data-line"]??h+1,"data-line-index":m["data-line-index"]??h,"data-line-type":m["data-line-type"]??"context"},children:p.map(([w,x,E])=>w===0&&x===""?E===""?{type:"element",tagName:"br",properties:{},children:[]}:{type:"text",value:E}:{type:"element",tagName:"span",properties:{"data-char":w,style:`color:${x};`},children:[{type:"text",value:E}]})}}let f=!1;if(u.length>0)if(this.editSessionActive&&!a.isPartial){if(!n)if(a.additionLines.length<=1&&a.additionLines.join("")==="")Object.assign(a,hc(a,this.options.parseDiffOptions)),this.markEditSessionPass(a),f=!0;else if(xm(a,a.additionLines))Object.assign(a,Pc(a,a.additionLines,this.options.parseDiffOptions)),this.markEditSessionPass(a),f=!0;else{const h=C5(a,u,this.options.parseDiffOptions,d);this.applyExpansionRemap(h),f=h!=null}}else Object.assign(a,m5(a,u,this.options.parseDiffOptions));return r.baseThemeType=t,this.renderCache.isDirty=!0,f}applyExpansionRemap(e){e!=null&&(this.expandedHunks=k5(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:r}=t;t.additionLines=F5(e,r),n.code.additionLines=B5(r,t.additionLines,n.code.additionLines,e),t.additionLines.length<=1&&t.additionLines.join("")===""?(Object.assign(t,hc(t,this.options.parseDiffOptions)),n.code.additionLines[0]=wm(0,e.getLineText(0)),this.markEditSessionPass(t)):this.editSessionActive?this.applySessionDocumentChange(t):Object.assign(t,R1(t,this.options.parseDiffOptions)),this.renderCache.isDirty=!0}applySessionDocumentChange(e){const{parseDiffOptions:t}=this.options,n=e.additionLines;if(xm(e,n)){Object.assign(e,Pc(e,n,t)),this.markEditSessionPass(e);return}this.applyExpansionRemap(Em(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=>mm(e);getOptionsWithDefaults(){const{diffIndicators:e="bars",diffStyle:t="split",disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:a=!1,disableVirtualizationBuffers:s=!1,collapsed:u=!1,expandUnchanged:d=!1,collapsedContextThreshold:f=1,expansionLineCount:h=100,hunkSeparators:p="line-info",lineDiffType:m="word-alt",maxLineDiffLength:y=1e3,overflow:b="scroll",stickyHeader:S=!1,theme:_=ot,headerRenderMode:w="default",tokenizeMaxLineLength:x=1e3,tokenizeMaxLength:E=yM,useTokenTransformer:L=!1,useCSSClasses:R=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:a,disableVirtualizationBuffers:s,collapsed:u,expandUnchanged:d,collapsedContextThreshold:f,expansionLineCount:h,hunkSeparators:p,lineDiffType:m,maxLineDiffLength:y,overflow:b,stickyHeader:S,theme:this.workerManager?.getDiffRenderOptions().theme??_,headerRenderMode:w,tokenizeMaxLineLength:x,tokenizeMaxLength:E,useTokenTransformer:L,useCSSClasses:R}}async initializeHighlighter(){return this.highlighter=await Ic(e1(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=Ku(e,this.getTokenizeMaxLength());let r=this.workerManager?.getDiffResultCache(e);r!=null&&!Wn(t,r.options)&&(r=void 0),this.renderCache??={diff:e,highlighted:!n&&!ba(e),options:t,result:n?void 0:r?.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??Ht(e.name),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??ot}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 d=this.workerManager.getDiffRenderOptions();return this.editSessionActive&&d.useTokenTransformer!==!0?{...d,useTokenTransformer:!0}:d}const{theme:r,tokenizeMaxLineLength:a,lineDiffType:s,maxLineDiffLength:u}=this.getOptionsWithDefaults();return{theme:r,useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:a,lineDiffType:s,maxLineDiffLength:u}})();this.getOptionsWithDefaults();const{renderCache:n}=this;return n?.result==null?{options:t,forceHighlight:!0}:!Jr(e,n.diff)||!Wn(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}renderDiff(e=this.renderCache?.diff,t=bc){if(e==null)return;const{expandUnchanged:n,collapsedContextThreshold:r}=this.getOptionsWithDefaults();let{options:a,forceHighlight:s}=this.getRenderOptions(e);const u=this.getMatchingWorkerResultCache(e,a);u!=null&&!this.hasHighlightedRenderCache(e,a)&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...u},s=!1),this.renderCache??={diff:e,highlighted:!1,options:a,result:void 0,renderRange:void 0};const d=e.additionLines.length>0||e.deletionLines.length>0,f=!d||ba(e)||Ku(e,this.getTokenizeMaxLength()),h=!Jr(e,this.renderCache.diff),p=!dd(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){const m=this.renderCache.result==null&&this.renderCache.highlighted&&!f&&!h&&Cm(t);m&&(this.renderCache.highlightPending=!0),!m&&(f||this.renderCache.result==null||!this.renderCache.highlighted&&(h||p))&&(this.renderCache.diff=e,this.renderCache.options=a,this.renderCache.highlighted=!1,(this.renderCache.result==null||h||p||s)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,Cm(t)||n?!0:this.expandedHunks,r)),this.renderCache.renderRange=t),!f&&d&&(!this.renderCache.highlighted||s)&&this.workerManager.highlightDiffAST(this,e)}else{this.computedLang=e.lang??Ht(e.name);const m=this.highlighter!=null&&zs(a.theme),y=this.highlighter!=null&&xc(this.computedLang),b=!f&&y;if(this.highlighter!=null&&m&&(s||f||!this.renderCache.highlighted&&b||this.renderCache.result==null)){const{result:S,options:_}=this.renderDiffWithHighlighter(e,this.highlighter,f||!y);this.renderCache={diff:e,options:_,highlighted:b,result:S,renderRange:void 0}}(!m||!f&&!y)&&this.asyncHighlight(e).then(({result:S,options:_})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.applyHighlightResult(e,S,_,!f)})}return this.renderCache.result!=null?this.processDiffResult(this.renderCache.diff,t,this.renderCache.result):void 0}async asyncRender(e,t=bc){const{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){const{diffIndicators:r,disableBackground:a,disableLineNumbers:s,overflow:u}=this.getOptionsWithDefaults();return Jw({type:"diff",diffIndicators:r,disableBackground:a,disableLineNumbers:s,overflow:u,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){const t=Ku(e,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??Ht(e.name);const n=this.highlighter!=null&&zs(this.getLocalHighlightTheme()),r=t||this.highlighter!=null&&xc(this.computedLang);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){const{options:r}=this.getRenderOptions(e),{collapsedContextThreshold:a}=this.getOptionsWithDefaults(),s=A1(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:a});if(this.editSessionActive&&e.additionLines.length===1&&e.additionLines[0]===""&&s.code.additionLines[0]==null){let u;if(no({diff:e,diffStyle:"both",expandedHunks:n?!0:void 0,collapsedContextThreshold:a,callback:({additionLine:d})=>{if(d?.lineIndex===0)return u=d,!0}}),u==null)throw new Error("DiffHunksRenderer: missing empty addition line");s.code.additionLines[0]=wm(0,"",u.unifiedLineIndex,u.splitLineIndex)}return{result:s,options:r}}onHighlightSuccess(e,t,n,r=!0){this.editSessionActive||this.applyHighlightResult(e,t,n,r)}applyHighlightResult(e,t,n,r=!0){if(this.renderCache==null)return;const a=this.renderCache.highlightPending===!0||!this.renderCache.highlighted||!Wn(this.renderCache.options,n)||!Jr(this.renderCache.diff,e);this.renderCache={diff:e,options:n,highlighted:r,result:t,renderRange:void 0},a&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;const n=this.workerManager?.getDiffResultCache(e);if(!(n==null||!Wn(t,n.options)))return n}hasHighlightedRenderCache(e,t){const{renderCache:n}=this;return n?.result!=null&&n.highlighted&&Jr(e,n.diff)&&Wn(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:r,baseThemeType:a}){const{diffStyle:s,disableFileHeader:u,expandUnchanged:d,expansionLineCount:f,collapsedContextThreshold:h,hunkSeparators:p}=this.getOptionsWithDefaults(),m=this.renderCache?.isDirty??!1;this.diff=e;const y=s==="unified",b=q5(e,this.options.loadDiffFiles!=null),S=!e.isPartial||b;let _=[],w=[],x=[];const E=[],{additionLines:L,deletionLines:R}=n,D={rowCount:0,hunkSeparators:p,additionsContentAST:_,deletionsContentAST:w,unifiedContentAST:x,unifiedGutterAST:fa(),deletionsGutterAST:fa(),additionsGutterAST:fa(),expansionLineCount:f,hunkData:E,incrementRowCount(I=1){D.rowCount+=I},pushToGutter(I,G){switch(I){case"unified":D.unifiedGutterAST.children.push(G);break;case"deletions":D.deletionsGutterAST.children.push(G);break;case"additions":D.additionsGutterAST.children.push(G);break}}},N=w1({fileDiff:e,errorPrefix:"DiffHunksRenderer.processDiffResult"}),H={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"?(D.pushToGutter("additions",ln(void 0,"buffer",this.size)),_?.push(Bu(this.size))):(D.pushToGutter("deletions",ln(void 0,"buffer",this.size)),w?.push(Bu(this.size))),this.size=0,this.side=void 0}}},U=(I,G,X,ue,Y)=>{D.pushToGutter(I,vE(G,X,ue,Y))};function W(I){H.flush(),s==="unified"?dp("unified",I,D):(dp("deletions",I,D),dp("additions",I,D))}this.pushFileLevelAnnotations(e,s,t,D),no({diff:e,diffStyle:s,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:d?!0:this.expandedHunks,collapsedContextThreshold:h,callback:({hunkIndex:I,hunk:G,collapsedBefore:X,collapsedAfter:ue,additionLine:Y,deletionLine:M,type:q})=>{const oe=M!=null?M.splitLineIndex:Y.splitLineIndex,le=Y!=null?Y.unifiedLineIndex:M.unifiedLineIndex;s==="split"&&q!=="change"&&H.flush(),X>0&&W({hunkIndex:I,collapsedLines:X,rangeSize:Math.max(G?.collapsedBefore??0,0),hunkSpecs:G?.hunkSpecs,isFirstHunk:I===0,isLastHunk:!1,isExpandable:S});const de=s==="unified"?le:oe,re={type:q,hunkIndex:I,lineIndex:de,unifiedLineIndex:le,splitLineIndex:oe,deletionLine:M,additionLine:Y};if(s==="unified"){const Ne=this.getUnifiedInjectedRowsForLine?.(re);Ne?.before!=null&&$_(Ne.before,D);let ze=M!=null?R[M.lineIndex]:void 0,Je=Y!=null?L[Y.lineIndex]:void 0;if(ze==null&&Je==null){const Pt="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(Pt,{file:e.name}),new Error(Pt)}const wn=q==="change"?Y!=null?"change-addition":"change-deletion":q,Kt=this.getUnifiedLineDecoration({type:q,lineType:wn,additionLineIndex:Y?.lineIndex,deletionLineIndex:M?.lineIndex});U("unified",Kt.gutterLineType,Y!=null?Y.lineNumber:M.lineNumber,`${le},${oe}`,Kt.gutterProperties),Je!=null?Je=Yu(Je,Kt.contentProperties,m&&Y!=null?{"data-line":Y.lineNumber,"data-line-index":`${le},${oe}`}:void 0):ze!=null&&(ze=Yu(ze,Kt.contentProperties,m&&M!=null?{"data-line":M.lineNumber,"data-line-index":`${le},${oe}`}:void 0)),Wu({diffStyle:"unified",type:q,deletionLine:ze,additionLine:Je,unifiedSpan:this.getAnnotations("unified",M?.lineNumber,Y?.lineNumber,I,de),createAnnotationElement:Pt=>this.createAnnotationElement(Pt),context:D}),Ne?.after!=null&&$_(Ne.after,D)}else{const Ne=this.getSplitInjectedRowsForLine?.(re);Ne?.before!=null&&q_(Ne.before,D,H);let ze=M!=null?R[M.lineIndex]:void 0,Je=Y!=null?L[Y.lineIndex]:void 0;const wn=this.getSplitLineDecoration({side:"deletions",type:q,lineIndex:M?.lineIndex}),Kt=this.getSplitLineDecoration({side:"additions",type:q,lineIndex:Y?.lineIndex});if(ze==null&&Je==null){const vt="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(vt,{file:e.name}),new Error(vt)}const Pt=(()=>{if(q==="change"){if(Je==null)return"additions";if(ze==null)return"deletions"}})();Pt!=null?(H.side!=null&&H.side!==Pt&&H.flush(),H.side=Pt,H.increment()):q==="change"&&H.flush();const cn=this.getAnnotations("split",M?.lineNumber,Y?.lineNumber,I,de);if(cn!=null&&H.size>0&&H.flush(),M!=null){const vt=Yu(ze,wn.contentProperties,m?{"data-line":M.lineNumber,"data-line-index":`${M.unifiedLineIndex},${oe}`}:void 0);U("deletions",wn.gutterLineType,M.lineNumber,`${M.unifiedLineIndex},${oe}`,wn.gutterProperties),vt!=null&&(ze=vt)}if(Y!=null){const vt=Yu(Je,Kt.contentProperties,m?{"data-line":Y.lineNumber,"data-line-index":`${Y.unifiedLineIndex},${oe}`}:void 0);U("additions",Kt.gutterLineType,Y.lineNumber,`${Y.unifiedLineIndex},${oe}`,Kt.gutterProperties),vt!=null&&(Je=vt)}Wu({diffStyle:"split",type:q,additionLine:Je,deletionLine:ze,...cn,createAnnotationElement:vt=>this.createAnnotationElement(vt),context:D}),Ne?.after!=null&&q_(Ne.after,D,H)}const ce=s==="split"&&G!=null&&oe===G.splitLineStart+G.splitLineCount-1,ke=I===e.hunks.length-1&&G!=null&&(s==="split"?oe===G.splitLineStart+G.splitLineCount-1:le===G.unifiedLineStart+G.unifiedLineCount-1),fe=ce?G.noEOFCRDeletions:!1,Fe=ce?G.noEOFCRAdditions:!1,Ge=(M?.noEOFCR??!1)||fe,Ze=(Y?.noEOFCR??!1)||Fe;if(Ze||Ge){if(s==="split"&&H.flush(),Ge){const Ne=q==="context"||q==="context-expanded"?q:"change-deletion";s==="unified"?(D.unifiedContentAST.push(Fu(Ne)),D.pushToGutter("unified",ln(Ne,"metadata",1))):(D.deletionsContentAST.push(Fu(Ne)),D.pushToGutter("deletions",ln(Ne,"metadata",1)),Ze||(D.pushToGutter("additions",ln(void 0,"buffer",1)),D.additionsContentAST.push(Bu(1))))}if(Ze){const Ne=q==="context"||q==="context-expanded"?q:"change-addition";s==="unified"?(D.unifiedContentAST.push(Fu(Ne)),D.pushToGutter("unified",ln(Ne,"metadata",1))):(D.additionsContentAST.push(Fu(Ne)),D.pushToGutter("additions",ln(Ne,"metadata",1)),Ge||(D.pushToGutter("deletions",ln(void 0,"buffer",1)),D.deletionsContentAST.push(Bu(1))))}D.incrementRowCount(1)}p!=="simple"&&p!=="metadata"&&(ue>0||ke&&b)&&W({hunkIndex:q==="context-expanded"?I:I+1,collapsedLines:ke&&b?"unknown":ue,rangeSize:N,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:S}),D.incrementRowCount(1)}}),s==="split"&&H.flush();const ee=Math.max(Z8(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),te=t.bufferBefore>0||t.bufferAfter>0,V=!y&&e.type!=="deleted",Z=!y&&e.type!=="new",ie=D.rowCount>0||te;_=V&&ie?_:void 0,w=Z&&ie?w:void 0,x=y&&ie?x:void 0;const se=this.createPreElement(w!=null&&_!=null,ee);return{unifiedGutterAST:y&&ie?D.unifiedGutterAST.children:void 0,unifiedContentAST:x,deletionsGutterAST:Z&&ie?D.deletionsGutterAST.children:void 0,deletionsContentAST:w,additionsGutterAST:V&&ie?D.additionsGutterAST.children:void 0,additionsContentAST:_,hunkData:E,preNode:se,themeStyles:r,baseThemeType:a,headerElement:u?void 0:this.renderHeader(this.diff),totalLines:ee,rowCount:D.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderCodeAST(e,t){const n=e==="unified"?t.unifiedGutterAST:e==="deletions"?t.deletionsGutterAST:t.additionsGutterAST,r=e==="unified"?t.unifiedContentAST:e==="deletions"?t.deletionsContentAST:t.additionsContentAST;if(n==null||r==null)return;const a=fa(n);return a.properties.style=`grid-row: span ${t.rowCount}`,[a,s1(r,t.rowCount)]}renderFullAST(e,t=[]){const n=this.getOptionsWithDefaults().hunkSeparators==="line-info",r=this.renderCodeAST("unified",e);if(r!=null)return t.push(Ce({tagName:"code",children:r,properties:{"data-code":"","data-container-size":n?"":void 0,"data-unified":""}})),{...e.preNode,children:t};const a=this.renderCodeAST("deletions",e);a!=null&&t.push(Ce({tagName:"code",children:a,properties:{"data-code":"","data-container-size":n?"":void 0,"data-deletions":""}}));const s=this.renderCodeAST("additions",e);return s!=null&&t.push(Ce({tagName:"code",children:s,properties:{"data-code":"","data-container-size":n?"":void 0,"data-additions":""}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return zt(this.renderFullAST(e,t))}renderPartialHTML(e,t){return t==null?zt(e):zt(Ce({tagName:"code",children:e,properties:{"data-code":"","data-container-size":this.getOptionsWithDefaults().hunkSeparators==="line-info"?"":void 0,[`data-${t}`]:""}}))}pushFileLevelAnnotations(e,t,n,r){if(!fd(n))return;const a=e.type!=="new"?G_(ym(this.deletionAnnotations)):[],s=e.type!=="deleted"?G_(ym(this.additionAnnotations)):[];if(a.length===0&&s.length===0)return;const u=-1,d=-1,{createAnnotationElement:f}=this;if(t==="unified"){Wu({diffStyle:t,type:"context",unifiedSpan:{type:"annotation",hunkIndex:u,lineIndex:d,annotations:a.concat(s)},createAnnotationElement:f,context:r});return}Wu({diffStyle:t,type:"context",deletionSpan:{type:"annotation",hunkIndex:u,lineIndex:d,annotations:a},additionSpan:{type:"annotation",hunkIndex:u,lineIndex:d,annotations:s},createAnnotationElement:f,context:r})}getAnnotations(e,t,n,r,a){const s={type:"annotation",hunkIndex:r,lineIndex:a,annotations:[]};if(t!=null)for(const d of this.deletionAnnotations[t]??[])s.annotations.push(Nn(d));const u={type:"annotation",hunkIndex:r,lineIndex:a,annotations:[]};if(n!=null)for(const d of this.additionAnnotations[n]??[])(e==="unified"?s:u).annotations.push(Nn(d));if(e==="unified")return s.annotations.length>0?s:void 0;if(!(u.annotations.length===0&&s.annotations.length===0))return{deletionSpan:s,additionSpan:u}}renderHeader(e){const{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return Zw({fileOrDiff:e,mode:t,stickyHeader:n})}};function G_(e){return e?.map(t=>Nn(t))??[]}const j5=new Intl.PluralRules("en-US");function V5(e){return`${e} unmodified line${j5.select(e)==="one"?"":"s"}`}function $_(e,t){for(const n of e)t.unifiedContentAST.push(n.content),t.pushToGutter("unified",n.gutter),t.incrementRowCount(1)}function q_(e,t,n){for(const{deletion:r,addition:a}of e){if(r==null&&a==null)continue;const s=r!=null&&a!=null?void 0:r==null?"deletions":"additions";(s==null||n.side!==s)&&n.flush(),r!=null&&(t.deletionsContentAST.push(r.content),t.pushToGutter("deletions",r.gutter)),a!=null&&(t.additionsContentAST.push(a.content),t.pushToGutter("additions",a.gutter)),s!=null&&(n.side=s,n.increment()),t.incrementRowCount(1)}}function Wu({diffStyle:e,type:t,deletionLine:n,additionLine:r,unifiedSpan:a,deletionSpan:s,additionSpan:u,createAnnotationElement:d,context:f}){let h=!1;if(e==="unified"){if(r!=null?f.unifiedContentAST.push(r):n!=null&&f.unifiedContentAST.push(n),a!=null){const p=t==="change"?n!=null?"change-deletion":"change-addition":t;f.unifiedContentAST.push(d(a)),f.pushToGutter("unified",ln(p,"annotation",1)),h=!0}}else if(e==="split"){if(n!=null&&f.deletionsContentAST.push(n),r!=null&&f.additionsContentAST.push(r),s!=null){const p=t==="change"?n!=null?"change-deletion":"context":t;f.deletionsContentAST.push(d(s)),f.pushToGutter("deletions",ln(p,"annotation",1)),h=!0}if(u!=null){const p=t==="change"?r!=null?"change-addition":"context":t;f.additionsContentAST.push(d(u)),f.pushToGutter("additions",ln(p,"annotation",1)),h=!0}}h&&f.incrementRowCount(1)}function dp(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:a,isFirstHunk:s,isLastHunk:u,isExpandable:d},f){if(typeof n=="number"&&n<=0)return;const h=e==="unified"?f.unifiedContentAST:e==="deletions"?f.deletionsContentAST:f.additionsContentAST;if(f.hunkSeparators==="metadata"){a!=null&&(f.pushToGutter(e,aa({type:"metadata",content:a,isFirstHunk:s,isLastHunk:u})),h.push(aa({type:"metadata",content:a,isFirstHunk:s,isLastHunk:u})),e!=="additions"&&f.incrementRowCount(1));return}if(f.hunkSeparators==="simple"){t>0&&(f.pushToGutter(e,aa({type:"simple",isFirstHunk:s,isLastHunk:!1})),h.push(aa({type:"simple",isFirstHunk:s,isLastHunk:!1})),e!=="additions"&&f.incrementRowCount(1));return}const p=Q8(e,t),m=r>f.expansionLineCount,y=d?t:void 0,b=typeof n=="number"?V5(n):"More unchanged context may be available";f.pushToGutter(e,aa({type:f.hunkSeparators,content:b,expandIndex:y,chunked:m,slotName:p,isFirstHunk:s,isLastHunk:u})),h.push(aa({type:f.hunkSeparators,content:b,expandIndex:y,chunked:m,slotName:p,isFirstHunk:s,isLastHunk:u})),e!=="additions"&&f.incrementRowCount(1),f.hunkData.push({slotName:p,hunkIndex:t,lines:typeof n=="number"?n:0,lineCountKnown:typeof n=="number",type:e,expandable:d?{up:!s,down:!u,chunked:m}:void 0})}function Yu(e,t,n){return e==null||e.type!=="element"||t==null&&n==null?e:{...e,properties:{...e.properties,...t,...n}}}function W_(e){return e.length>0&&e[e.length-1]===""?e.length-1:e.length}function B5(e,t,n,r){const a=W_(e),s=W_(t),u=Math.min(a,s);let d=0;for(;d<u&&e[d]===t[d];)d++;let f=0;for(;f<u-d&&e[a-1-f]===t[s-1-f];)f++;const h=new Array(t.length);for(let p=0;p<d;p++)h[p]=n[p];for(let p=0;p<f;p++)h[s-1-p]=n[a-1-p];a<e.length&&s<t.length&&(h[t.length-1]=n[e.length-1]);for(let p=e.length;p<t.length;p++)h[p]??=n[p];for(let p=d;p<t.length;p++)h[p]??=wm(p,r.getLineText(p));return h}function wm(e,t,n=e,r=e){return{type:"element",tagName:"div",properties:{"data-line":e+1,"data-line-index":`${n},${r}`,"data-line-type":"context"},children:[{type:"element",tagName:"span",properties:{"data-char":0},children:[{type:"text",value:t}]}]}}function F5(e,t){const n=[],r=$5(t);for(let a=0;a<e.lineCount;a++){const s=e.getLineText(a,!0);n.push(a<e.lineCount-1&&!G5(s)?s+r:s)}return n}function G5(e){return e.endsWith(`
|
|
1538
|
+
`)||e.endsWith("\r")}function $5(e){for(const t of e){if(t.endsWith(`\r
|
|
1539
|
+
`))return`\r
|
|
1540
|
+
`;if(t.endsWith(`
|
|
1541
|
+
`))return`
|
|
1542
|
+
`;if(t.endsWith("\r"))return"\r"}return`
|
|
1543
|
+
`}function Ku(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function q5(e,t){return e.isPartial&&t&&(e.type==="change"||e.type==="rename-changed")}function W5(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function Y5(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 km(e,t=300){let n;try{await Promise.race([e(),new Promise(r=>{n=setTimeout(r,t)})])}finally{n!=null&&clearTimeout(n)}}function Lm({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 K5(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:S1(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 X5(e){return e.isPartial&&(e.type==="change"||e.type==="rename-changed"||e.type==="rename-pure")}let Q5=-1;var N1=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++Q5}`;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:ot},n,r=!1){this.options=t,this.workerManager=n,this.isContainerManaged=r,this.hunksRenderer=this.createHunksRenderer(t),this.resizeManager=new DE,this.scrollSyncManager=new X8,this.interactionManager=new OE("diff",Cc(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 K5(t)}createHunksRenderer(t){return new U5(this.getHunksRendererOptions(t),this.handleHighlightRender,this.workerManager)}getLineIndex=(t,n="additions")=>{const r=this.fileDiffCache;if(r==null)return;const a=r.hunks.at(-1);let s,u;e:for(const d of r.hunks){const f=n==="deletions"?d.deletionStart:d.additionStart,h=n==="deletions"?d.deletionCount:d.additionCount;let p=ii(f,h)+1,m=d.splitLineStart,y=d.unifiedLineStart;if(t<p){const b=p-t;s=Math.max(y-b,0),u=Math.max(m-b,0);break e}if(t>=p+h){if(d===a){const b=t-(p+h);s=y+d.unifiedLineCount+b,u=m+d.splitLineCount+b;break e}continue}for(const b of d.hunkContent)if(b.type==="context")if(t<p+b.lines){const S=t-p;u=m+S,s=y+S;break e}else p+=b.lines,m+=b.lines,y+=b.lines;else{const S=n==="deletions"?b.deletions:b.additions;if(t<p+S){const _=t-p;s=y+(n==="additions"?b.deletions:0)+_,u=m+_;break e}else p+=S,m+=Math.max(b.deletions,b.additions),y+=b.deletions+b.additions}break e}if(!(s==null||u==null))return[s,u]};setOptions(t){t!=null&&(this.options=t,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(t)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(Cc(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&&!wa(this.appliedThemeCSS.theme,this.options.theme??ot)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(t){this.lineAnnotations=t}canPartiallyRender(t,n,r){return!(t||n||r||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){Up(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:r=!1,lineAnnotations:a,fileDiff:s,...u}){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 d=Lm(u,"FileDiff.hydrate"),f=d?.oldFile,h=d?.newFile;this.hydrateElements(t,n),e6(this.pre,Z5({fileDiff:s,oldFile:f,newFile:h}),this.options.collapsed)||t6(this.headerElement,J5({fileDiff:s,oldFile:f,newFile:h}),this.options.disableFileHeader)?this.render({...u,fileContainer:t,lineAnnotations:a,fileDiff:s,preventEmit:!0}):this.hydrationSetup({fileDiff:s,lineAnnotations:a,...d}),r||this.emitPostRender()}hydrateElements(t,n){this.fileContainer!==t&&this.emitPostRender(!0),y1(t,n);for(const r of t.shadowRoot?.children??[]){if(r instanceof SVGElement){this.spriteSVG=r;continue}if(r instanceof HTMLElement){if(r instanceof HTMLPreElement){this.pre=r;for(const a of r.children)!(a instanceof HTMLElement)||a.tagName.toLowerCase()!=="code"||("deletions"in a.dataset&&(this.codeDeletions=a),"additions"in a.dataset&&(this.codeAdditions=a),"unified"in a.dataset&&(this.codeUnified=a));continue}if("diffsHeader"in r.dataset){this.headerElement=r;continue}if(r instanceof HTMLStyleElement&&r.hasAttribute("data-theme-css")){this.themeCSSStyle=r;continue}if(r instanceof HTMLStyleElement&&r.hasAttribute("data-unsafe-css")){this.unsafeCSSStyle=r,this.appliedUnsafeCSS=r.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:r,lineAnnotations:a}){this.lineAnnotations=a??this.lineAnnotations,this.additionFile=r,this.deletionFile=n,this.fileDiff=t??(n!==void 0&&r!==void 0?lo(n,r,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,r)=>{this.expandHunk(t,n,r)};expandHunk=(t,n,r)=>{this.hunksRenderer.expandHunk(t,n,r),this.loadFilesIfNecessary(),this.rerender()};loadFilesIfNecessary(){const{fileDiff:t,options:{loadDiffFiles:n}}=this;t==null||n==null||!X5(t)||this.pendingFiles?.fileDiff===t||(this.pendingFiles={fileDiff:t,promise:this.loadFilesForDiff(t,n)})}async loadFilesForDiff(t,n){try{const r=await n(t);if(!this.enabled||this.fileDiff!==t)return;await this.handleFilesLoaded(t,r)}catch(r){if(this.options.disableErrorHandling===!0)throw r;console.error(r)}finally{this.pendingFiles?.fileDiff===t&&(this.pendingFiles=void 0)}}async handleFilesLoaded(t,n){this.fileDiff!==t||!t.isPartial||(_m("merge",t,n),this.setHydratedState(n),await km(()=>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:r=!1,preventEmit:a=!1,lineAnnotations:s,fileContainer:u,containerWrapper:d,renderRange:f,...h}){const p=Lm(h,"FileDiff.render"),m=p?.oldFile,y=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:b=!1,themeType:S="system",expandUnchanged:_=!1}=this.options,w=b?void 0:f,x=this.hasThemeChanged(),E=p!=null,L=E&&(!Y_(m,this.deletionFile)||!Y_(y,this.additionFile));let R=t!=null&&t!==this.fileDiff;const D=s!=null&&(s.length>0||this.lineAnnotations.length>0)?s!==this.lineAnnotations:!1;if(!b&&dd(w,this.renderRange)&&!r&&!D&&!x&&(t!=null&&t===this.fileDiff||t==null&&!L))return this.applyCachedThemeState(S);let N;t==null&&E&&(L||this.fileDiff==null)&&(N=lo(p.oldFile,p.newFile,this.options.parseDiffOptions));const{renderRange:H}=this;if(this.renderRange=w,E?(this.deletionFile=m,this.additionFile=y):t!=null&&(this.deletionFile=void 0,this.additionFile=void 0),t!=null?this.fileDiff=t:N!=null&&(R=!0,this.fileDiff=N),R&&(this.cachedHeaderHTML=void 0),s!=null&&this.setLineAnnotations(s),this.fileDiff==null)return!1;this.fileDiff.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(j_(this.fileDiff,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),_&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);const{disableErrorHandling:U=!1,disableFileHeader:W=!1}=this.options;if(W&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),u=this.getOrCreateFileContainer(u,d),this.applyCachedThemeState(S),b){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const ee=this.hunksRenderer.renderDiff(this.fileDiff,lE);ee!=null&&this.applyThemeState(u,ee.themeStyles,S,ee.baseThemeType),ee?.headerElement!=null&&this.applyHeaderToDOM(ee.headerElement,u),this.renderSeparators([]),this.injectUnsafeCSS()}catch(ee){if(U)throw ee;console.error(ee),ee instanceof Error&&this.applyErrorToDOM(ee,u)}return a||this.emitPostRender(),!0}try{const ee=this.getOrCreatePreNode(u);if(!(this.canPartiallyRender(r,D,L||R||x)&&this.applyPartialRender({previousRenderRange:H,renderRange:w}))){const te=this.hunksRenderer.renderDiff(this.fileDiff,w);if(te==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(u,te.themeStyles,S,te.baseThemeType),te.headerElement!=null&&this.applyHeaderToDOM(te.headerElement,u),te.additionsContentAST!=null||te.deletionsContentAST!=null||te.unifiedContentAST!=null?this.applyHunksToDOM(ee,te):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(te.hunkData)}this.applyBuffers(ee,w),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,n||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(ee){if(U)throw ee;console.error(ee),ee instanceof Error&&this.applyErrorToDOM(ee,u)}return a||this.emitPostRender(),!0}emitPostRender(t=!1){const{fileContainer:n,options:{onPostRender:r}}=this;if(t){if(!this.mounted||(this.mounted=!1,n==null))return;this.options.onPostRender?.(n,this,"unmount");return}if(n==null)return;const a=this.mounted?"update":"mount";this.mounted=!0,r?.(n,this,a)}get fileDiffCache(){return this.hunksRenderer.diffCache??this.fileDiff}syncRenderViewToEditor(){const t=this.editor,n=this.fileContainer,r=this.fileDiffCache,a=this.lineAnnotations,s=this.computeEditorRenderRange(this.renderRange);t!=null&&n!=null&&r!=null&&!r.isPartial&&this.hunksRenderer.initializeHighlighter().then(u=>{!this.enabled||this.editor!==t||this.fileContainer!==n||this.fileDiffCache!==r||t.__syncRenderView(u,n,r,a,s)})}computeEditorRenderRange(t){const n=this.fileDiffCache;if(t==null||n==null||Cm(t))return t;const{diffStyle:r="split",expandUnchanged:a=!1,collapsedContextThreshold:s=1}=this.options;let u,d;return no({diff:n,diffStyle:r,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s,callback:({additionLine:f})=>{f!=null&&(u??=f.lineNumber,d=f.lineNumber)}}),u==null||d==null?{...t,startingLine:0,totalLines:0}:{...t,startingLine:u-1,totalLines:d-u+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,r=L5(t,this.hunksRenderer.getExpandedHunksMap(),n);return j_(t,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(T5(t,r)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(t,n){this.hunksRenderer.applyDocumentChange(t);const r=this.hunksRenderer.diffCache;if(r!=null){const a=this.fileDiff?.cacheKey;a!=null&&r.cacheKey==null&&(r.cacheKey=a),this.fileDiff=r}n!==void 0&&n!==this.lineAnnotations&&(this.setLineAnnotations(n),this.hunksRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations()),this.rerender(),this.interactionManager.setSelectionDirty()}updateRenderCache(t,n,r={}){const{shouldRefreshDiffsView:a,lineCountChangeInFlight:s}=r;if(this.hunksRenderer.updateRenderCache(t,n,s)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}a===!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:r=!1,collapsedContextThreshold:a=1}=this.options;return k1({fileDiff:n,lineNumber:t,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:a})}getNearestRenderableLine(t,n){const r=this.fileDiffCache;if(r==null)return t;const{expandUnchanged:a=!1,collapsedContextThreshold:s=1}=this.options;return e5({fileDiff:r,lineNumber:t,direction:n,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s})}revealLine(t){const n=this.fileDiffCache,{expandUnchanged:r=!1,collapsedContextThreshold:a=1,expansionLineCount:s=100}=this.options;if(n==null||n.isPartial||r)return!1;const u=this.hunksRenderer.getExpandedHunksMap();for(const[p,m]of n.hunks.entries()){const[y,b]=Qs(m);if(t<y){const S=Hi({isPartial:n.isPartial,rangeSize:m.collapsedBefore,expandedHunks:u,hunkIndex:p,collapsedContextThreshold:a}),_=y-S.rangeSize;if(S.renderAll||t<_+S.fromStart||t>=y-S.fromEnd)return!1;const w=t-(_+S.fromStart)+1,x=y-S.fromEnd-t;return w<=x?this.expandHunk(p,"up",w+s):this.expandHunk(p,"down",x+s),!0}if(t<b)return!1}const d=Pi({fileDiff:n,hunkIndex:n.hunks.length-1,expandedHunks:u,collapsedContextThreshold:a,errorPrefix:"FileDiff.revealLine"});if(d==null||d.renderAll)return!1;const f=n.hunks[n.hunks.length-1],[,h]=Qs(f);return t<h+d.fromStart||t>=h+d.rangeSize?!1:(this.expandHunk(n.hunks.length,"up",t-(h+d.fromStart)+1+s),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){uE(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||ba(t))return;const r=this.options.tokenizeMaxLength??1e5;Math.max(t.additionLines.length,t.deletionLines.length)>r||await n.primeDiffHighlightCache(t).catch(a=>{console.error(a)})}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:a}of this.separatorCache.values())a.remove();this.separatorCache.clear();return}const r=new Map(this.separatorCache);for(const a of t){const s=a.slotName;let u=this.separatorCache.get(s);if(u==null||!Y5(a,u.hunkData)){u?.element.remove();const d=document.createElement("div");d.style.display="contents",d.slot=a.slotName;const f=n(a,this);f!=null&&d.appendChild(f),this.fileContainer.appendChild(d),u={element:d,hunkData:a},this.separatorCache.set(s,u)}r.delete(s)}for(const[a,{element:s}]of r.entries())this.separatorCache.delete(a),s.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(const{element:r}of this.annotationCache.values())r.remove();this.annotationCache.clear();return}const t=new Map(this.annotationCache),{renderAnnotation:n}=this.options;if(n!=null&&this.lineAnnotations.length>0)for(const[r,a]of this.lineAnnotations.entries()){const s=`${r}-${Nn(a)}`;let u=this.annotationCache.get(s);if(u==null||!W5(a,u.annotation)){u?.element.remove();const d=n(a);if(d==null)continue;u={element:c1(Nn(a)),annotation:a},u.element.appendChild(d),this.fileContainer.appendChild(u.element),this.annotationCache.set(s,u)}t.delete(s)}for(const[r,{element:a}]of t.entries())this.annotationCache.delete(r),a.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 r=d1();r.appendChild(n),this.fileContainer.appendChild(r),this.gutterUtilityContent=r}getOrCreateFileContainer(t,n){const{fileContainer:r}=this,a=t??r??document.createElement("diffs-container"),s=r!==a;return r!=null&&s&&this.editor?.__captureFocusForDOMReplacement(),s&&this.emitPostRender(!0),this.fileContainer=a,r!=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 r of n.children)r instanceof SVGElement?this.spriteSVG??=r:zc(r)&&r.hasAttribute("data-theme-css")?(this.themeCSSStyle??=r,this.hasAdoptedThemeCSS=!0):zc(r)&&r.hasAttribute("data-unsafe-css")&&(this.unsafeCSSStyle??=r,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(t){const n=t.shadowRoot??t.attachShadow({mode:"open"});if(this.spriteSVG==null){const r=document.createElement("div");r.innerHTML=l1;const a=r.firstChild;a instanceof SVGElement&&(this.spriteSVG=a)}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:r}=this,a=this.cachedHeaderHTML??zt(t);if(this.cachedHeaderHTML=a,a!==this.lastRenderedHeaderHTML){const y=document.createElement("div");y.innerHTML=a;const b=y.firstElementChild;if(!(b instanceof HTMLElement))return;this.headerElement!=null?n.shadowRoot?.replaceChild(b,this.headerElement):n.shadowRoot?.prepend(b),this.headerElement=b,this.lastRenderedHeaderHTML=a}if(this.isContainerManaged||r==null)return;const{renderCustomHeader:s,renderHeaderPrefix:u,renderHeaderFilenameSuffix:d,renderHeaderMetadata:f}=this.options;if(s!=null){const y=s(r)??void 0;this.headerCustom=this.upsertHeaderSlotElement(n,this.headerCustom,nl,y),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}const h=u?.(r)??void 0,p=d?.(r)??void 0,m=f?.(r)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(n,this.headerPrefix,ng,h),this.headerFilenameSuffix=this.upsertHeaderSlotElement(n,this.headerFilenameSuffix,ig,p),this.headerMetadata=this.upsertHeaderSlotElement(n,this.headerMetadata,rg,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,r,a){if(a==null){n?.remove();return}const s=n??this.createHeaderSlotElement(r);return n==null&&t.appendChild(s),this.replaceHeaderSlotContent(s,a),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??=f1(),this.unsafeCSSStyle.parentNode!==n&&n.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=m1(t),this.appliedUnsafeCSS=t)}}applyThemeState(t,n,r,a){const s=t.shadowRoot??t.attachShadow({mode:"open"}),u=a??r,d=this.options.theme??ot,f=typeof d=="string"?d:{...d},h=Xs(s);if(this.themeCSSStyle?.parentNode===s&&this.appliedThemeCSS?.themeStyles===n&&this.appliedThemeCSS.themeType===u&&this.appliedThemeCSS.scrollbarGutter===h){this.appliedThemeCSS.theme=f;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===s){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:f,themeStyles:n,themeType:u,baseThemeType:a,scrollbarGutter:h};return}this.themeCSSStyle=_1({shadowRoot:s,currentNode:this.themeCSSStyle,themeCSS:g1(n,u,h)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:f,themeStyles:n,themeType:u,baseThemeType:a,scrollbarGutter:h}:void 0}hydrateMeasuredScrollbar(){const t=this.fileContainer?.shadowRoot;t==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=v1(this.themeCSSStyle.textContent??"",Xs(t)))}shouldGuardRebuildScroll(){return this.editor!=null&&C1()}applyHunksToDOM(t,n){this.shouldGuardRebuildScroll()?bm(t,()=>this.replaceCodeColumns(t,n)):this.replaceCodeColumns(t,n)}applyCodeColumnsInPlace(t,n,r){const a=this.getColumnPair(t);if(a==null)return!1;const s=pr(n[0]),u=pr(n[1]);return s==null||u==null?!1:(a.gutter.innerHTML=zt(s),a.content.innerHTML=zt(u),r!==this.lastRowCount&&(a.gutter.style.setProperty("grid-row",`span ${r}`),a.content.style.setProperty("grid-row",`span ${r}`)),!0)}replaceCodeColumns(t,n){const{overflow:r="scroll"}=this.options,a=(this.options.hunkSeparators??"line-info")==="line-info",s=r==="wrap"?n.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(t,n);let u=!1;const d=[],f=this.hunksRenderer.renderCodeAST("unified",n),h=this.hunksRenderer.renderCodeAST("deletions",n),p=this.hunksRenderer.renderCodeAST("additions",n);this.editor?.__captureFocusForDOMReplacement(),f!=null?(u=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=dc({code:this.codeUnified,columnType:"unified",rowSpan:s,containerSize:a}),this.applyCodeColumnsInPlace(this.codeUnified,f,n.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(f)),d.push(this.codeUnified)):h!=null||p!=null?(h!=null?(u=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=dc({code:this.codeDeletions,columnType:"deletions",rowSpan:s,containerSize:a}),this.applyCodeColumnsInPlace(this.codeDeletions,h,n.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(h)),d.push(this.codeDeletions)):(this.codeDeletions?.remove(),this.codeDeletions=void 0),p!=null?(u=u||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=dc({code:this.codeAdditions,columnType:"additions",rowSpan:s,containerSize:a}),this.applyCodeColumnsInPlace(this.codeAdditions,p,n.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(p)),d.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),d.length===0?t.textContent="":u&&t.replaceChildren(...d),this.lastRowCount=n.rowCount}applyPartialRender({previousRenderRange:t,renderRange:n}){const{pre:r,codeUnified:a,codeAdditions:s,codeDeletions:u,options:{diffStyle:d="split"}}=this;if(r==null||t==null||n==null||!Number.isFinite(t.totalLines)||!Number.isFinite(n.totalLines)||this.lastRowCount==null)return!1;const f=this.getCodeColumns(d,a,u,s);if(f==null)return!1;const h=t.startingLine,p=n.startingLine,m=h+t.totalLines,y=p+n.totalLines,b=Math.max(h,p),S=Math.min(m,y);if(S<=b)return!1;const _=Math.max(0,b-h),w=Math.max(0,m-S),x=this.trimColumns({columns:f,trimStart:_,trimEnd:w,previousStart:h,overlapStart:b,overlapEnd:S,diffStyle:d});if(x<0)throw new Error("FileDiff.applyPartialRender: failed to trim to overlap");if(this.lastRowCount<x)throw new Error("FileDiff.applyPartialRender: trimmed beyond DOM row count");let E=this.lastRowCount-x;const L=(H,U)=>{if(!(U<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:H,totalLines:U,bufferBefore:0,bufferAfter:0})},R=L(p,Math.max(b-p,0));if(R==null&&p<b)return!1;const D=L(S,Math.max(y-S,0));if(D==null&&y>S)return!1;const N=(H,U)=>{if(H!=null){if(d==="unified"&&!Array.isArray(f))this.insertPartialHTML(d,f,H,U);else if(d==="split"&&Array.isArray(f))this.insertPartialHTML(d,f,H,U);else throw new Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");E+=H.rowCount}};return this.cleanupErrorWrapper(),N(R,"afterbegin"),N(D,"beforeend"),this.lastRowCount!==E&&(this.applyRowSpan(d,f,E),this.lastRowCount=E),!0}insertPartialHTML(t,n,r,a){if(t==="unified"&&!Array.isArray(n)){const s=this.hunksRenderer.renderCodeAST("unified",r);this.renderPartialColumn(n,s,a)}else if(t==="split"&&Array.isArray(n)){const s=this.hunksRenderer.renderCodeAST("deletions",r),u=this.hunksRenderer.renderCodeAST("additions",r);this.renderPartialColumn(n[0],s,a),this.renderPartialColumn(n[1],u,a)}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 r=(a,s)=>{if(s==null)return;const u=this.hunksRenderer.renderCodeAST(a,t),d=pr(u?.[0]),f=pr(u?.[1]);for(const[h,p]of[[s.gutter,d],[s.content,f]])if(p!=null&&h.childElementCount===p.length)for(let m=0;m<p.length;m++){const y=h.children[m],b=p[m].properties["data-line-type"];b!=null&&y.dataset.lineType!==b&&(y.dataset.lineType=b)}};r("deletions",n[0]),r("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 r=this.hunksRenderer.renderCodeAST("unified",t),a=pr(r?.[0]),s=pr(r?.[1]),u=()=>{for(const[d,f]of[[n.gutter,a],[n.content,s]])f!=null&&(d.innerHTML=zt(f));t.rowCount!==this.lastRowCount&&(this.applyRowSpan("unified",n,t.rowCount),this.lastRowCount=t.rowCount)};this.shouldGuardRebuildScroll()?bm(this.pre,u):u(),this.renderSeparators(t.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(t,n,r){if(t==null||n==null)return;const a=pr(n[0]),s=pr(n[1]);if(a==null||s==null)throw new Error("FileDiff.insertPartialHTML: Unexpected AST structure");const u=s.at(0);r==="beforeend"&&u?.type==="element"&&typeof u.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(u.properties["data-buffer-size"],t.content.children[t.content.children.length-1],t.gutter.children[t.gutter.children.length-1],a,s,!0);const d=s.at(-1);r==="afterbegin"&&d?.type==="element"&&typeof d.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(d.properties["data-buffer-size"],t.content.children[0],t.gutter.children[0],a,s,!1),t.gutter.insertAdjacentHTML(r,this.hunksRenderer.renderPartialHTML(a)),t.content.insertAdjacentHTML(r,this.hunksRenderer.renderPartialHTML(s))}mergeBuffersIfNecessary(t,n,r,a,s,u){if(!(n instanceof HTMLElement)||!(r instanceof HTMLElement))return;const d=this.getBufferSize(n.dataset);d!=null&&(u?(a.shift(),s.shift()):(a.pop(),s.pop()),this.updateBufferSize(n,d+t),this.updateBufferSize(r,d+t))}applyRowSpan(t,n,r){const a=s=>{s!=null&&(s.gutter.style.setProperty("grid-row",`span ${r}`),s.content.style.setProperty("grid-row",`span ${r}`))};if(t==="unified"&&!Array.isArray(n))a(n);else if(t==="split"&&Array.isArray(n))a(n[0]),a(n[1]);else throw new Error("dun fuuuuked up")}trimColumnRows(t,n,r){let a=0,s=0,u=0,d=!1;const f=r>=0;if(t==null)return 0;const h=Array.from(t.content.children),p=Array.from(t.gutter.children);if(h.length!==p.length)throw new Error("FileDiff.trimColumnRows: columns do not match");for(;u<h.length&&!(n<=0&&!f&&!d);){const m=p[u],y=h[u];if(u++,!(m instanceof HTMLElement)||!(y instanceof HTMLElement))throw console.error({gutterElement:m,contentElement:y}),new Error("FileDiff.trimColumnRows: invalid row elements");if(d&&(d=!1,m.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in y.dataset||m.dataset.gutterBuffer==="metadata"&&"noNewline"in y.dataset)){m.remove(),y.remove(),s++;continue}if("lineIndex"in m.dataset&&"lineIndex"in y.dataset){(n>0||f&&a>=r)&&(m.remove(),y.remove(),n>0&&(n--,n===0&&(d=!0)),s++),a++;continue}if("separator"in m.dataset&&"separator"in y.dataset){(n>0||f&&a>=r)&&(m.remove(),y.remove(),s++);continue}if(m.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in y.dataset){(n>0||f&&a>=r)&&(m.remove(),y.remove(),s++);continue}if(m.dataset.gutterBuffer==="metadata"&&"noNewline"in y.dataset){(n>0||f&&a>=r)&&(m.remove(),y.remove(),s++);continue}if(m.dataset.gutterBuffer==="buffer"&&"contentBuffer"in y.dataset){const b=this.getBufferSize(y.dataset);if(b==null)throw new Error("FileDiff.trimColumnRows: invalid element");if(n>0){const S=Math.min(n,b),_=b-S;_>0?(this.updateBufferSize(m,_),this.updateBufferSize(y,_),s+=S):(m.remove(),y.remove(),s+=b),n-=S,n===0&&_===0&&(d=!0)}else if(f){const S=a,_=a+b-1;if(r<=S)m.remove(),y.remove(),s+=b;else if(r<=_){const w=_-r+1,x=b-w;this.updateBufferSize(m,x),this.updateBufferSize(y,x),s+=w}}a+=b;continue}throw console.error({gutterElement:m,contentElement:y}),new Error("FileDiff.trimColumnRows: unknown row elements")}return s}trimColumns({columns:t,diffStyle:n,overlapEnd:r,overlapStart:a,previousStart:s,trimEnd:u,trimStart:d}){const f=Math.max(0,a-s),h=r-s;if(h<0)throw new Error("FileDiff.trimColumns: overlap ends before previous");const p=d>0,m=u>0;if(!p&&!m)return 0;const y=p?f:0,b=m?h:-1;if(n==="unified"&&!Array.isArray(t))return this.trimColumnRows(t,y,b);if(n==="split"&&Array.isArray(t)){const S=this.trimColumnRows(t[0],y,b),_=this.trimColumnRows(t[1],y,b);if(t[0]!=null&&t[1]!=null&&S!==_)throw new Error("FileDiff.trimColumns: split columns out of sync");return t[0]!=null?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],r=t.children[1];if(!(!(n instanceof HTMLElement)||!(r instanceof HTMLElement)||n.dataset.gutter==null||r.dataset.content==null))return{gutter:n,content:r}}getCodeColumns(t,n,r,a){if(t==="unified")return this.getColumnPair(n);{const s=this.getColumnPair(r),u=this.getColumnPair(a);return s!=null||u!=null?[s,u]: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:r,totalLines:a},s){const{diffIndicators:u="bars",disableBackground:d=!1,disableLineNumbers:f=!1,overflow:h="scroll",diffStyle:p="split"}=this.options,m={type:"diff",diffIndicators:u,disableBackground:d,disableLineNumbers:f,overflow:h,split:p==="unified"?!1:n!=null&&r!=null,totalLines:a,customProperties:s};u1(m,this.appliedPreAttributes)||(b1(t,m),this.appliedPreAttributes=m)}applyErrorToDOM(t,n){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;const r=n.shadowRoot??n.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",r.appendChild(this.errorWrapper);const a=document.createElement("div");a.dataset.errorMessage="",a.innerText=t.message,this.errorWrapper.appendChild(a);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 Y_(e,t){return e==null||t==null?e==null&&t==null:An(e,t)}function Z5({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function J5({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function e6(e,t,n=!1){return!n&&e==null&&t}function t6(e,t,n=!1){return e==null&&t&&!n}function pr(e){if(!(e==null||e.type!=="element"))return e.children??[]}function n6({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:r,expandUnchanged:a,expandedHunks:s,collapsedContextThreshold:u,canHydratePartialDiff:d}){let f=Yn(t,n),h=f;const p=a?!0:s,m=e.hunks.length-1;for(let y=0;y<e.hunks.length;y++){const b=e.hunks[y];if(b==null)throw new Error("computeEstimatedDiffHeights: invalid hunk index");const S=Hi({isPartial:e.isPartial,rangeSize:b.collapsedBefore,expandedHunks:p,hunkIndex:y,collapsedContextThreshold:u}),_=(S.fromStart+S.fromEnd)*t.lineHeight;if(f+=_,h+=_,S.collapsedLines>0){const E=Rs({type:r,metrics:t,hunkIndex:y,hunkSpecs:b.hunkSpecs})?.totalHeight??0;f+=E,h+=E}f+=b.splitLineCount*t.lineHeight,h+=b.unifiedLineCount*t.lineHeight;const w=i6(b);f+=w.split*t.lineHeight,h+=w.unified*t.lineHeight;const x=y===m?Pi({fileDiff:e,hunkIndex:y,expandedHunks:p,collapsedContextThreshold:u,errorPrefix:"computeEstimatedDiffHeights"}):void 0;if(x!=null){const E=(x.fromStart+x.fromEnd)*t.lineHeight;if(f+=E,h+=E,x.collapsedLines>0){const L=Xr({type:r,metrics:t})?.totalHeight??0;f+=L,h+=L}}else if(y===m&&e.isPartial&&d){const E=Xr({type:r,metrics:t})?.totalHeight??0;f+=E,h+=E}}if(e.hunks.length>0){const y=Hc(t);f+=y,h+=y}return{splitHeight:f,unifiedHeight:h}}function i6(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 r6(e,t)}function r6(e,t){const n=(t.deletions>0&&e.noEOFCRDeletions?1:0)+(t.additions>0&&e.noEOFCRAdditions?1:0),r=t.deletions>0&&e.noEOFCRDeletions,a=t.additions>0&&e.noEOFCRAdditions;return{split:r||a?1:0,unified:n}}const Tm=3e3;let o6=-1;var a6=class extends N1{__id=`little-virtualized-file-diff:${++o6}`;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,r,a=!1){super(e,r,a),this.virtualizer=t,this.metrics=fc(n)}setMetrics(e,t=!1){const n=fc(e);!t&&Sc(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||!vm(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=!Zc(t,e),r=n&&f6(t,e);super.setOptions(e),r&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:h6(t,e)}),n&&(this.forceRenderOverride=!0),n&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,r)}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(),r=n==="split"?[this.codeDeletions,this.codeAdditions]:[this.codeUnified],a=this.hasFileAnnotations(this.fileDiff);if(this.renderRange!=null&&a&&fd(this.renderRange)){const s=s6(r)??0;this.setFileAnnotationHeight(s)&&(e=!0)}else!a&&this.setFileAnnotationHeight(0)&&(e=!0);for(const s of r){if(s==null)continue;const u=s.children[1];if(u instanceof HTMLElement)for(const d of u.children){if(!(d instanceof HTMLElement))continue;const f=d.dataset.lineIndex;if(f==null)continue;const h=m6(f,n);let p=d.getBoundingClientRect().height,m=!1;d.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in d.nextElementSibling.dataset||"noNewline"in d.nextElementSibling.dataset)&&("noNewline"in d.nextElementSibling.dataset&&(m=!0),p+=d.nextElementSibling.getBoundingClientRect().height);const y=this.getEstimatedLineHeight(m),b=this.cache.heightDeltas.get(h)??0,S=p-y;S!==b&&(e=!0,this.cache.measuredHeightDeltaTotal+=S-b,S===0?this.cache.heightDeltas.delete(h):this.cache.heightDeltas.set(h,S))}}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,r){const a=!Jr(this.fileDiff,e),s=this.syncLineAnnotations(r);let u=n?.resetDiffLayoutCache===!0||a||s,d=a||n?.resetDiffLayoutCache===!0&&n.includeEstimatedDiffHeights;n?.metrics!=null&&(this.metrics=fc(n.metrics),u=!0,d=!0);const{collapsed:f=!1,expandUnchanged:h=!1}=this.options;return this.currentCollapsed!==f&&(this.currentCollapsed=f,u=!0),this.currentExpandUnchanged!==h&&(this.currentExpandUnchanged=h,u=!0,d=!0),u&&this.resetLayoutCache({includeEstimatedHeights:d}),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:r=!1,expandUnchanged:a=!1,collapsed:s=!1,collapsedContextThreshold:u=1}=this.options,d=this.getDiffStyle(),f=this.getHunkSeparatorType(),h=d==="split"?n[1]:n[0];this.approximateLayoutCheckpoints();const p=Yn(this.metrics,r),m=this.getLayoutCheckpointBeforeLineIndex(h);let y=m?.top??p+this.cache.fileAnnotationHeight;if(s)return{top:p,height:0};let b;return no({diff:this.fileDiff,diffStyle:d,startingLine:m?.renderedLineIndex??0,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:u,callback:({hunkIndex:S,hunk:_,collapsedBefore:w,collapsedAfter:x,deletionLine:E,additionLine:L})=>{const R=d==="split"?L?.splitLineIndex??E?.splitLineIndex:L?.unifiedLineIndex??E?.unifiedLineIndex;if(R==null)throw new Error("VirtualizedFileDiff.getLinePosition: missing line index data");if(w>0){const N=Rs({type:f,metrics:this.metrics,hunkIndex:S,hunkSpecs:_?.hunkSpecs});if(N!=null){if(y+=N.gapBefore,h>=R-w&&h<R)return b={top:y,height:N.height},!0;y+=N.height+N.gapAfter}}const D=this.getLineHeight(R,(L?.noEOFCR??!1)||(E?.noEOFCR??!1));if(R===h)return b={top:y,height:D},!0;if(y+=D,x>0){const N=Xr({type:f,metrics:this.metrics});if(N!=null){if(h>R&&h<=R+x)return b={top:y+N.gapBefore,height:N.height},!0;y+=N.totalHeight}}return!1}}),b}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:r=!1,collapsedContextThreshold:a=1}=this.options;if(r)return;const s=this.getDiffStyle(),u=this.getHunkSeparatorType();this.approximateLayoutCheckpoints();const d=this.getLayoutCheckpointBeforeTop(e);let f=d?.top??Yn(this.metrics,t)+this.cache.fileAnnotationHeight,h;return no({diff:this.fileDiff,diffStyle:s,startingLine:d?.renderedLineIndex??0,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:a,callback:({hunkIndex:p,hunk:m,collapsedBefore:y,collapsedAfter:b,deletionLine:S,additionLine:_})=>{const w=s==="split"?_?.splitLineIndex??S?.splitLineIndex:_?.unifiedLineIndex??S?.unifiedLineIndex;if(w==null)throw new Error("VirtualizedFileDiff.getNumericScrollAnchor: missing line index data");if(y>0){const E=Rs({type:u,metrics:this.metrics,hunkIndex:p,hunkSpecs:m?.hunkSpecs});E!=null&&(f+=E.totalHeight)}if(f>=e&&(S!=null?h={lineNumber:S.lineNumber,side:"deletions",top:f}:_!=null&&(h={lineNumber:_.lineNumber,side:"additions",top:f}),h!=null))return!0;const x=this.getLineHeight(w,(_?.noEOFCR??!1)||(S?.noEOFCR??!1));if(f+=x,b>0){const E=Xr({type:u,metrics:this.metrics});E!=null&&(f+=E.totalHeight)}return!1}}),h}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:r,totalLines:a}=t;let s=0;if(a===0){const u=e??this.virtualizer.getWindowSpecs();this.top<u.top&&(s=r)}return{topOffset:this.top+n+s,height:this.height-(n+r)}}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=_m("clone",e,t);if(await km(()=>this.primeHighlightCache(n)),!this.enabled||this.fileDiff!==e)return;this.pendingHydratedDiff={expectedDiff:e,nextDiff:n,files:t}}else{if(_m("merge",e,t),this.setHydratedState(t),await km(()=>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:r,pendingHydratedDiff:a}=this;if(r!=null){this.pendingExpansions=void 0;for(const s of r)this.hunksRenderer.expandHunk(s.hunkIndex,s.direction,s.expansionLineCountOverride),t=!0}return a!=null&&(this.pendingHydratedDiff=void 0,a.expectedDiff===e&&(this.setHydratedState(a.files),n=a.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:r=100,collapsedContextThreshold:a=1}=this.options,s=new Map(this.hunksRenderer.getExpandedHunksMap());for(const u of t){const d={...s.get(u.hunkIndex)??{fromStart:0,fromEnd:0}},f=u.expansionLineCountOverride??r;(u.direction==="up"||u.direction==="both")&&(d.fromStart+=f),(u.direction==="down"||u.direction==="both")&&(d.fromEnd+=f),s.set(u.hunkIndex,d)}return k1({fileDiff:n,lineNumber:e,expandedHunks:s,collapsedContextThreshold:a})}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:r}=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&&r!==void 0&&this.fileDiff!==void 0){const a=this.virtualizer.getWindowSpecs(),s=this.computeRenderRangeFromWindow(this.fileDiff,this.top??0,a);s.bufferAfter!==r.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 r=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,t==null){this.layoutDirty=!1;return}const{disableFileHeader:a=!1,collapsed:s=!1}=this.options,u=Yn(this.metrics,a);if(this.height+=u,s){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight(t)+this.cache.measuredHeightDeltaTotal,n&&!r&&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:r=1}=this.options,{splitHeight:a,unifiedHeight:s}=n6({fileDiff:e,metrics:this.metrics,disableFileHeader:t,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:n,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,canHydratePartialDiff:fp(e,this.options.loadDiffFiles!=null)});this.cache.estimatedSplitHeight=a,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:r,...a}={}){const s=Lm(a,"VirtualizedFileDiff.render"),u=s!=null,d=s?.oldFile,f=s?.newFile,h=u&&(!Q_(d,this.deletionFile)||!Q_(f,this.additionFile));let p=t??this.fileDiff;t==null&&u&&(h||this.fileDiff==null)&&(p=lo(s.oldFile,s.newFile,this.options.parseDiffOptions));const{forceRenderOverride:m,isSetup:y}=this;this.forceRenderOverride=void 0;const b=this.syncLineAnnotations(r);b&&this.resetLayoutCache({includeEstimatedHeights:!1});const S=t!=null&&t!==this.fileDiff,_=p!=null&&!Jr(this.fileDiff,p),w=S||h;if(_&&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(y)this.top??=this.getVirtualizedTop(),_&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.computeApproximateSize(!1,p));else{this.computeApproximateSize(!1,p);const D=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(D==null)throw new Error("VirtualizedFileDiff.render: simple virtualizer is not available");D.connect(e,this),this.isVisible=D.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!w||!y))return this.fileDiff=p,s!=null&&(this.deletionFile=d,this.additionFile=f),_&&(this.cachedHeaderHTML=void 0),this.renderPlaceholder(this.height);const x=this.virtualizer.getWindowSpecs(),E=this.top??0,L=this.computeRenderRangeFromWindow(p,E,x),R=super.render({fileDiff:p,fileContainer:e,renderRange:L,lineAnnotations:r,forceRender:(m??n)||b||_,...s,...a});return this.isSimpleMode()&&R&&this.getSimpleVirtualizer()?.requestHeightReconcile(this),R}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 p6(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:r=1}=this.options,a=e.hunks.length-1,s=fp(e,this.options.loadDiffFiles!=null),u=this.getDiffStyle(),d=this.getHunkSeparatorType(),f=n?!0:this.hunksRenderer.getExpandedHunksMap(),h=l6(this.cache.heightDeltas);let p=Yn(this.metrics,t)+this.cache.fileAnnotationHeight,m=0;const y=({rowCount:b,startLineIndex:S,preSeparatorHeight:_=0,postSeparatorHeight:w=0,metadataOffsets:x=[]})=>{if(b<=0)return;const E=m,L=m+b;let R=u6(E);for(;R<L;){const D=R-E,N=p+(D>0?_:0)+D*this.metrics.lineHeight+c6(x,D)*this.metrics.lineHeight+K_(h,S,S+D);this.cache.checkpoints.push({renderedLineIndex:R,lineIndex:S+D,top:N}),R+=Tm}p+=_+b*this.metrics.lineHeight+x.length*this.metrics.lineHeight+K_(h,S,S+b)+w,m=L};for(let b=0;b<e.hunks.length;b++){const S=e.hunks[b];if(S==null)throw new Error("VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index");const _=Hi({isPartial:e.isPartial,rangeSize:S.collapsedBefore,expandedHunks:f,hunkIndex:b,collapsedContextThreshold:r}),w=_.collapsedLines>0?Rs({type:d,metrics:this.metrics,hunkIndex:b,hunkSpecs:S.hunkSpecs})?.totalHeight??0:0;y({rowCount:_.fromStart,startLineIndex:(u==="split"?S.splitLineStart:S.unifiedLineStart)-_.rangeSize});let x=w;y({rowCount:_.fromEnd,startLineIndex:(u==="split"?S.splitLineStart:S.unifiedLineStart)-_.fromEnd,preSeparatorHeight:x}),_.fromEnd>0&&(x=0);const E=b===a?Pi({fileDiff:e,hunkIndex:b,expandedHunks:f,collapsedContextThreshold:r,errorPrefix:"VirtualizedFileDiff"}):void 0,L=E!=null&&E.collapsedLines>0?Xr({type:d,metrics:this.metrics})?.totalHeight??0:b===a&&s?Xr({type:d,metrics:this.metrics})?.totalHeight??0:0,R=E!=null?E.fromStart+E.fromEnd:0,D=u==="split"?S.splitLineCount:S.unifiedLineCount,N=u==="split"?S.splitLineStart:S.unifiedLineStart;y({rowCount:D,startLineIndex:N,preSeparatorHeight:x,postSeparatorHeight:R===0?L:0,metadataOffsets:d6({diffStyle:u,hunk:S,rowCount:D})}),E!=null&&R>0&&y({rowCount:R,startLineIndex:N+D,postSeparatorHeight:L})}this.cache.totalLines=m}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,r;for(;t<=n;){const a=t+n>>1,s=this.cache.checkpoints[a];if(s==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");s.lineIndex<=e?(r=s,t=a+1):n=a-1}return r}getLayoutCheckpointBeforeTop(e,t){let n=0,r=this.cache.checkpoints.length-1,a=-1;for(;n<=r;){const s=n+r>>1,u=this.cache.checkpoints[s];if(u==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");u.top<=e?(a=s,n=s+1):r=s-1}if(t==null)return a>=0?this.cache.checkpoints[a]:void 0;for(let s=a;s>=0;s--){const u=this.cache.checkpoints[s];if(u==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");if(u.renderedLineIndex%t===0)return u}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(const d of e.hunks)n+=t==="split"?d.splitLineCount:d.unifiedLineCount;return n}const{expandUnchanged:r=!1,collapsedContextThreshold:a=1}=this.options,s=r?!0:this.hunksRenderer.getExpandedHunksMap();for(const[d,f]of e.hunks.entries()){const h=t==="split"?f.splitLineCount:f.unifiedLineCount;n+=h;const p=Math.max(f.collapsedBefore,0),{fromStart:m,fromEnd:y,renderAll:b}=Hi({isPartial:e.isPartial,rangeSize:p,expandedHunks:s,hunkIndex:d,collapsedContextThreshold:a});p>0&&(n+=b?p:m+y)}const u=Pi({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:s,collapsedContextThreshold:a,errorPrefix:"VirtualizedFileDiff"});return u!=null&&(n+=u.fromStart+u.fromEnd),n}getLayoutLineCount(e,t){const n=this.getExpandedLineCount(e,t),r=t==="split"?e.splitLineCount:e.unifiedLineCount;return Math.max(n,r,e.additionLines.length,e.deletionLines.length,this.cache.totalLines)}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){const{disableFileHeader:a=!1,expandUnchanged:s=!1,collapsedContextThreshold:u=1}=this.options,{hunkLineCount:d,lineHeight:f}=this.metrics,h=this.getDiffStyle(),p=this.getHunkSeparatorType(),m=fp(e,this.options.loadDiffFiles!=null),y=this.height;let b=this.getLayoutLineCount(e,h);const S=Yn(this.metrics,a),_=e.hunks.length>0?Hc(this.metrics):0,{fileAnnotationHeight:w}=this.cache,x=S+w,E=Math.max(0,y-S-w-_),L=this.hasFileAnnotations(e),R=t+S,D=w>0&&L&&R<r&&R+w>n;if(t<n-y||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:y-S-_};if(b<=d||e.hunks.length===0)return{startingLine:0,totalLines:d,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(e),b=this.getLayoutLineCount(e,h);const N=Math.ceil(Math.max(r-n,0)/f),H=Math.ceil(N/d)*d+d,U=H/d,W=U,ee=[],te=(n+r)/2,V=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-H*f*2),d);let Z=t+(V?.top??x),ie=V?.renderedLineIndex??0,se,I,G;if(no({diff:e,diffStyle:h,startingLine:V?.renderedLineIndex??0,expandedHunks:s?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:u,callback:({hunkIndex:ce,hunk:ke,collapsedBefore:fe,collapsedAfter:Fe,deletionLine:Ge,additionLine:Ze})=>{const Ne=Ze!=null?Ze.splitLineIndex:Ge.splitLineIndex,ze=Ze!=null?Ze.unifiedLineIndex:Ge.unifiedLineIndex,Je=(Ze?.noEOFCR??!1)||(Ge?.noEOFCR??!1),wn=ce===e.hunks.length-1&&ke!=null&&(h==="split"?Ne===ke.splitLineStart+ke.splitLineCount-1:ze===ke.unifiedLineStart+ke.unifiedLineCount-1),Kt=(fe>0?Rs({type:p,metrics:this.metrics,hunkIndex:ce,hunkSpecs:ke?.hunkSpecs}):void 0)?.totalHeight??0;Z+=Kt;const Pt=ie%d===0,cn=Math.floor(ie/d);if(Pt&&(ee[cn]=Z-(t+x+Kt),G!=null)){if(G<=0)return!0;G--}const vt=this.getLineHeight(h==="split"?Ne:ze,Je);if(Z>n-vt&&Z<r&&(se??=cn),I==null&&Z+vt>te&&(I=cn),G==null&&Z>=r&&Pt&&(G=W),ie++,Z+=vt,Fe>0||wn&&m){const ji=Xr({type:p,metrics:this.metrics});ji!=null&&(Z<r&&Z+ji.totalHeight>n&&(se??=cn),I==null&&Z+ji.totalHeight>te&&(I=cn),Z+=ji.totalHeight)}return!1}}),se==null)if(D)se=0,I=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:y-S-_};I??=se;const X=Math.round(I-U/2),ue=Math.max(0,Math.ceil(b/d)-U),Y=Math.max(0,Math.min(X,ue)),M=Y*d,q=X<0?H+X*d:H,oe=ee[Y]??0,le=M===0?0:w+oe,de=Y+q/d,re=de<ee.length?E-ee[de]:E-(Z-t-x);return{startingLine:M,totalLines:q,bufferBefore:le,bufferAfter:Math.max(0,re)}}};function s6(e){let t;for(const n of e){if(n==null)continue;const r=n.children[1];if(r instanceof HTMLElement)for(const a of r.children)a instanceof HTMLElement&&a.dataset.lineAnnotation===o1&&(t=Math.max(t??0,a.getBoundingClientRect().height))}return t}function l6(e){const t=Array.from(e).sort((s,u)=>s[0]-u[0]),n=[],r=[0];let a=0;for(const[s,u]of t)n.push(s),a+=u,r.push(a);return{lineIndexes:n,prefixTotals:r}}function K_({lineIndexes:e,prefixTotals:t},n,r){if(n>=r||e.length===0)return 0;const a=X_(e,n);return(t[X_(e,r)]??0)-(t[a]??0)}function X_(e,t){let n=0,r=e.length;for(;n<r;){const a=n+r>>1,s=e[a];if(s==null)throw new Error("VirtualizedFileDiff: invalid prefix index");s<t?n=a+1:r=a}return n}function u6(e){return Math.ceil(e/Tm)*Tm}function c6(e,t){let n=0;for(const r of e)r<t&&n++;return n}function d6({diffStyle:e,hunk:t,rowCount:n}){if(n<=0||!t.noEOFCRAdditions&&!t.noEOFCRDeletions)return[];const r=t.hunkContent.at(-1);if(r==null)return[];if(r.type==="context")return[n-1];const a=Math.max(r.deletions,r.additions),s=r.deletions+r.additions;if(e==="split")return a>0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[n-1]:[];const u=[],d=n-s;return r.deletions>0&&t.noEOFCRDeletions&&u.push(d+r.deletions-1),r.additions>0&&t.noEOFCRAdditions&&u.push(n-1),u}function f6(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 h6(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 fp(e,t){return e.isPartial&&t&&(e.type==="change"||e.type==="rename-changed")}function p6(e){return typeof e=="function"?"custom":e??"line-info"}function Q_(e,t){return e==null||t==null?e==null&&t==null:An(e,t)}function m6(e,t){const[n,r]=e.split(",").map(Number);return t==="split"?r:n}function g6({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function v6(e,t){const n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:y6(n,e.startContentIndex)}}function y6(e,t){let n=e.unifiedLineStart;for(let r=0;r<t;r++){const a=e.hunkContent[r];n+=a.type==="context"?a.lines:a.deletions+a.additions}return n}function Z_(e){const t=[];for(const n of e){const r=uo.get(n);if(r==null)throw new Error(`getResolvedLanguages: ${n} is not resolved. Please resolve languages before calling getResolvedLanguages`);t.push(r)}return t}function J_(e){for(const t of Array.isArray(e)?e:[e])if(!uo.has(t))return!1;return!0}async function eC(e){const t=[],n=[];for(const r of e){if(r==="text"||r==="ansi")continue;const a=Vw(r)??jw(r);"then"in a?n.push(a):t.push(a)}return n.length>0&&await Promise.all(n).then(r=>{for(const a of r){if(a==null)throw new Error("resolvedLanguages: unable to resolve language");t.push(a)}}),t}function tC(e){return Mn.getResolvedThemes(e)}async function nC(e){for(const n of e)Kw(n);const t=await Mn.resolveThemes(e);for(let n=0;n<e.length;n++)Xw(e[n],t[n]);return t}function I1(e){const t=O.useRef(e);return O.useInsertionEffect(()=>{t.current=e}),O.useCallback((...n)=>t.current(...n),[])}const b6=O.createContext(void 0);function z1(){return O.useContext(b6)}const H1={position:"absolute",top:0,bottom:0,textAlign:"center",whiteSpace:"normal",touchAction:"none"},S6={display:"contents"};function jc(){return null}function _6({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:r,renderHeaderFilenameSuffix:a,renderHeaderMetadata:s,renderAnnotation:u,renderGutterUtility:d,renderMergeConflictUtility:f,lineAnnotations:h,getHoveredLine:p,getInstance:m}){const y=n?.(e),b=r?.(e),S=a?.(e),_=s?.(e);return A.jsxs(A.Fragment,{children:[y!=null?A.jsx("div",{slot:nl,children:y}):A.jsxs(A.Fragment,{children:[b!=null&&A.jsx("div",{slot:"header-prefix",children:b}),S!=null&&A.jsx("div",{slot:"header-filename-suffix",children:S}),_!=null&&A.jsx("div",{slot:"header-metadata",children:_})]}),u!=null&&h?.map((w,x)=>A.jsx("div",{slot:Nn(w),children:u(w)},x)),t!=null&&f!=null&&m!=null&&t.map(w=>{if(w==null)return;const x=C6(w,e);return A.jsx("div",{slot:x,style:S6,children:f(w,m)},x)}),d!=null&&A.jsx("div",{slot:"gutter-utility-slot",style:H1,children:d(p)})]})}function C6(e,t){const n=v6(e,t);return n!=null?g6({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex}):void 0}function x6({file:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:a,renderAnnotation:s,lineAnnotations:u,renderGutterUtility:d,getHoveredLine:f}){const h=t?.(e),p=n?.(e),m=r?.(e),y=a?.(e);return A.jsxs(A.Fragment,{children:[h!=null?A.jsx("div",{slot:nl,children:h}):A.jsxs(A.Fragment,{children:[p!=null&&A.jsx("div",{slot:"header-prefix",children:p}),m!=null&&A.jsx("div",{slot:"header-filename-suffix",children:m}),y!=null&&A.jsx("div",{slot:"header-metadata",children:y})]}),s!=null&&u?.map((b,S)=>A.jsx("div",{slot:Nn(b),children:s(b)},S)),d!=null&&A.jsx("div",{slot:"gutter-utility-slot",style:H1,children:d(f)})]})}var Os={exports:{}},E6=Os.exports,iC;function w6(){return iC||(iC=1,(function(e,t){(function(n,r){r(t)})(E6,function(n){const r=Symbol("newer"),a=Symbol("older");class s{constructor(m,y){typeof m!="number"&&(y=m,m=0),this.size=0,this.limit=m,this.oldest=this.newest=void 0,this._keymap=new Map,y&&(this.assign(y),m<1&&(this.limit=this.size))}_markEntryAsUsed(m){m!==this.newest&&(m[r]&&(m===this.oldest&&(this.oldest=m[r]),m[r][a]=m[a]),m[a]&&(m[a][r]=m[r]),m[r]=void 0,m[a]=this.newest,this.newest&&(this.newest[r]=m),this.newest=m)}assign(m){let y,b=this.limit||Number.MAX_VALUE;this._keymap.clear();let S=m[Symbol.iterator]();for(let _=S.next();!_.done;_=S.next()){let w=new u(_.value[0],_.value[1]);if(this._keymap.set(w.key,w),y?(y[r]=w,w[a]=y):this.oldest=w,y=w,b--==0)throw new Error("overflow")}this.newest=y,this.size=this._keymap.size}get(m){var y=this._keymap.get(m);return y?(this._markEntryAsUsed(y),y.value):void 0}set(m,y){var b=this._keymap.get(m);return b?(b.value=y,this._markEntryAsUsed(b),this):(this._keymap.set(m,b=new u(m,y)),this.newest?(this.newest[r]=b,b[a]=this.newest):this.oldest=b,this.newest=b,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var m=this.oldest;if(m)return this.oldest[r]?(this.oldest=this.oldest[r],this.oldest[a]=void 0):(this.oldest=void 0,this.newest=void 0),m[r]=m[a]=void 0,this._keymap.delete(m.key),--this.size,[m.key,m.value]}find(m){let y=this._keymap.get(m);return y?y.value:void 0}has(m){return this._keymap.has(m)}delete(m){var y=this._keymap.get(m);return y?(this._keymap.delete(y.key),y[r]&&y[a]?(y[a][r]=y[r],y[r][a]=y[a]):y[r]?(y[r][a]=void 0,this.oldest=y[r]):y[a]?(y[a][r]=void 0,this.newest=y[a]):this.oldest=this.newest=void 0,this.size--,y.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new f(this.oldest)}values(){return new h(this.oldest)}entries(){return this}[Symbol.iterator](){return new d(this.oldest)}forEach(m,y){typeof y!="object"&&(y=this);let b=this.oldest;for(;b;)m.call(y,b.value,b.key,this),b=b[r]}toJSON(){for(var m=new Array(this.size),y=0,b=this.oldest;b;)m[y++]={key:b.key,value:b.value},b=b[r];return m}toString(){for(var m="",y=this.oldest;y;)m+=String(y.key)+":"+y.value,y=y[r],y&&(m+=" < ");return m}}n.LRUMap=s;function u(p,m){this.key=p,this.value=m,this[r]=void 0,this[a]=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[r],{done:!1,value:[p.key,p.value]}):{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[r],{done:!1,value:p.key}):{done:!0,value:void 0}};function h(p){this.entry=p}h.prototype[Symbol.iterator]=function(){return this},h.prototype.next=function(){let p=this.entry;return p?(this.entry=p[r],{done:!1,value:p.value}):{done:!0,value:void 0}}})})(Os,Os.exports)),Os.exports}var k6=w6();const rC=vC(k6),Xu=Symbol("IGNORE_RESPONSE");var Qu=class extends Error{constructor(){super("WorkerPoolManager: operation canceled because the pool terminated")}},hp=class extends Error{constructor(){super("WorkerPoolManager: operation canceled before the task completed")}},L6=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=ot,useTokenTransformer:r=!1,lineDiffType:a="word-alt",maxLineDiffLength:s=1e3,tokenizeMaxLineLength:u=1e3,preferredHighlighter:d="shiki-js"}){this.options=e,this.preferredHighlighter=d,this.renderOptions={theme:n,useTokenTransformer:r,lineDiffType:a,maxLineDiffLength:s,tokenizeMaxLineLength:u},this.fileCache=new rC.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new rC.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??ot,useTokenTransformer:t=this.renderOptions.useTokenTransformer??!1,lineDiffType:n=this.renderOptions.lineDiffType??"word-alt",maxLineDiffLength:r=this.renderOptions.maxLineDiffLength??1e3,tokenizeMaxLineLength:a=this.renderOptions.tokenizeMaxLineLength??1e3}){const{lifecycleGeneration:s}=this,u=++this.renderOptionsRequestVersion,d=()=>this.isCurrentLifecycle(s)&&this.renderOptionsRequestVersion===u;try{const f={theme:e,useTokenTransformer:t,lineDiffType:n,maxLineDiffLength:r,tokenizeMaxLineLength:a};if(this.isInitialized()||await this.initialize(),!d()||Wn(f,this.renderOptions))return;const h=Ys(e);let p=[];if(wa(f.theme,this.renderOptions.theme)||(pm(h)?p=tC(h):p=await nC(h)),!d())return;if(this.highlighter!=null)hm(p,this.highlighter);else{const y=await Ic({themes:h,langs:["text"],preferredHighlighter:this.preferredHighlighter});if(!d())return;this.highlighter=y}const m=this.setRenderOptionsOnWorkers(f,p);this.renderOptions=f,this.renderOptionsVersion++,this.diffCache.clear(),this.fileCache.clear(),this.invalidateRenderTasks();for(const y of this.themeSubscribers)y.onThemeChange();await m}catch(f){if(f instanceof Qu||!d())return;throw f}}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 r of this.workers){if(!r.initialized)throw console.log({managedWorker:r}),new Error("setRenderOptionsOnWorkers: Somehow we have an uninitialized worker");n.push(new Promise((a,s)=>{const u=this.generateRequestId(),d={type:"set-render-options",id:u,request:{type:"set-render-options",id:u,renderOptions:e,resolvedThemes:t},resolve:a,reject:s,requestStart:Date.now()};this.activeTaskById.set(u,d),r.pendingSetupRequestId=u,r.worker.postMessage(d.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);mr(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,r)=>{(async()=>{try{const a=Ys(this.renderOptions.theme);let s=[];if(pm(a)?s=tC(a):s=await nC(a),!this.isCurrentLifecycle(t)){n();return}let u=[];if(J_(e)?u=Z_(e):u=await eC(e),!this.isCurrentLifecycle(t)){n();return}const[d]=await Promise.all([Ic({themes:a,langs:["text",...e],preferredHighlighter:this.preferredHighlighter}),this.initializeWorkers(s,u)]);if(!this.isCurrentLifecycle(t)){this.terminateWorkers(),n();return}this.highlighter=d,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),this.queueBroadcastStateChanges(),n()}catch(a){if(a instanceof Qu||!this.isCurrentLifecycle(t)){n();return}this.initialized=!1,this.workersFailed=!0;for(const s of this.queuedTasks)this.rejectRenderTaskCallbacks(s,pp(a));this.queueBroadcastStateChanges(),r(a)}})()}),this.queueBroadcastStateChanges()}else return this.initialized}async initializeWorkers(e,t){this.workersFailed=!1;const n=[],r=void 0;this.workers.length>0&&this.terminateWorkers();for(let a=0;a<(this.options.poolSize??8);a++){const s=this.options.workerFactory(),u={worker:s,requestId:void 0,pendingSetupRequestId:void 0,initialized:!1,langs:new Set(["text",...t.map(({name:d})=>d)]),customExtensionsVersion:0};s.addEventListener("message",d=>{this.handleWorkerMessage(u,d.data)}),s.addEventListener("error",d=>console.error("Worker error:",d,u)),this.workers.push(u),n.push(new Promise((d,f)=>{const h=this.generateRequestId(),p={type:"initialize",id:h,request:{type:"initialize",id:h,renderOptions:this.renderOptions,preferredHighlighter:this.preferredHighlighter,resolvedThemes:e,resolvedLanguages:t,customExtensionsVersion:void 0,customExtensionMap:r},resolve(){u.initialized=!0,d()},reject:f,requestStart:Date.now()};this.activeTaskById.set(h,p),this.executeTask(u,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=oC(t),r=this.getAvailableWorker(n);if(r==null)break;this.queuedTasks.splice(e,1),this.assignWorkerToTask(t,r),this.resolveLanguagesAndExecuteTask(r,t,n)}this.queueBroadcastStateChanges()}};highlightFileAST(e,t){const n=this.getFileResultCache(t);Ks(t)||n!=null&&Ai(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||Ks(e)||t!=null&&Ai(t.options,this.getFileRenderOptions()))return;const r=this.getTaskByHighlightKey(n);if(r!=null)return r.primeCache=!0,r.type==="file"?r:void 0;{const a=this.submitCacheTask({type:"file",file:e},n);return a.type==="file"?a:void 0}}getPlainFileAST(e,t,n,r){if(this.highlighter==null){this.queueInitialization();return}return r1(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,lines:r})}highlightDiffAST(e,t){const n=this.getDiffResultCache(t);ba(t)||n!=null&&Wn(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||ba(e)||t!=null&&Wn(t.options,this.getDiffRenderOptions()))return;const r=this.getTaskByHighlightKey(n);if(r!=null)return r.primeCache=!0,r.type==="diff"?r:void 0;{const a=this.submitCacheTask({type:"diff",diff:e},n);return a.type==="diff"?a:void 0}}getPlainDiffAST(e,t,n,r,a){return this.highlighter!=null?A1(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,expandedHunks:r,collapsedContextThreshold:a}):void 0}terminate(){this.lifecycleGeneration++,this.cancelActiveWorkerTasks(),this.terminateWorkers();const e=new Qu;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 Qu;for(const t of this.activeTaskById.values())"reject"in t?t.reject(e):mr(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),r=n!=null?this.getTaskByHighlightKey(n):void 0;if(r!=null){this.detachInstanceFromQueuedTasks(e,r),this.addInstanceToTask(r,e),this.queueBroadcastStateChanges();return}this.detachInstanceFromQueuedTasks(e);const a=this.generateRequestId(),s=Date.now(),{renderOptionsVersion:u}=this,d=(()=>{switch(t.type){case"file":return{type:"file",id:a,request:{...t,id:a},instances:new Set([e]),primeCache:!1,highlightKey:n,callbacks:new Set,renderOptionsVersion:u,requestStart:s};case"diff":return{type:"diff",id:a,request:{...t,id:a},instances:new Set([e]),primeCache:!1,highlightKey:n,callbacks:new Set,renderOptionsVersion:u,requestStart:s}}})();this.enqueueRenderTask(d,e)}submitCacheTask(e,t){this.initialized===!1&&this.queueInitialization();const n=this.generateRequestId(),r=Date.now(),{renderOptionsVersion:a}=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:a,requestStart:r};case"diff":return{type:"diff",id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,callbacks:new Set,renderOptionsVersion:a,requestStart:r}}})();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 r=n.filter(a=>!e.langs.has(a));if(r.length>0&&(J_(r)?t.request.resolvedLanguages=Z_(r):t.request.resolvedLanguages=await eC(r)),!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(r){this.rejectRenderTaskCallbacks(t,pp(r)),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 Xu;if(t.type==="error"){const r=new Error(t.error);if(t.stack&&(r.stack=t.stack),"reject"in n)n.reject(r);else if(mr(n))this.notifyHighlightError(n,r),this.rejectRenderTaskCallbacks(n,r);else throw new Error("handleWorkerMessage: unknown task type");throw r}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:r,options:a}=t;if(!this.isCurrentRenderTask(n)||!Ai(a,this.getFileRenderOptions()))throw Xu;const{request:s}=n;this.syncCustomExtensionVersion(e,s),n.cacheKeyAtDispatch!=null&&this.fileCache.set(n.cacheKeyAtDispatch,{result:r,options:a}),this.resolveRenderTaskCallbacks(n),this.notifyFileInstances(n,r,a);break}case"diff":{if(n.type!=="diff")throw new Error("handleWorkerMessage: task/response dont match");const{result:r,options:a}=t;if(!this.isCurrentRenderTask(n)||!Wn(a,this.getDiffRenderOptions()))throw Xu;const{request:s}=n;this.syncCustomExtensionVersion(e,s),n.cacheKeyAtDispatch!=null&&this.diffCache.set(n.cacheKeyAtDispatch,{result:r,options:a}),this.resolveRenderTaskCallbacks(n),this.notifyDiffInstances(n,r,a);break}}}catch(r){r!==Xu&&console.error(r,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,mr(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&&(mr(t)&&(this.rejectRenderTaskCallbacks(t,new hp),this.clearInstanceRequests(t),this.clearHighlightKey(t)),this.activeTaskById.delete(t.id))}executeTask(e,t){T6(t.request)&&this.maybeAttachCustomExtensions(e,t.request),this.activeTaskById.has(t.id)||this.assignWorkerToTask(t,e);for(const n of oC(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),mr(t)?(this.notifyHighlightError(t,n),this.rejectRenderTaskCallbacks(t,pp(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=r8();e.customExtensionsVersion>=n||(t.customExtensionsVersion=n,t.customExtensionMap=o8())}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 r=!0;for(const a of e)if(!n.langs.has(a)){r=!1;break}if(r)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 ks(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 hp),this.clearQueuedInstanceRequests(e),this.clearHighlightKey(e)}removeActiveTask(e){this.rejectRenderTaskCallbacks(e,new hp),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()))mr(e)&&e.renderOptionsVersion!==this.renderOptionsVersion&&this.removeActiveTask(e)}clearQueuedInstanceRequests(e){for(const t of ks(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 ks(e))this.activeRequestByInstance.set(t,e.id)}clearInstanceRequests(e){for(const t of ks(e))this.activeRequestByInstance.get(t)===e.id&&this.activeRequestByInstance.delete(t)}notifyFileInstances(e,t,n){for(const r of e.instances)this.activeRequestByInstance.get(r)===e.id&&r.onHighlightSuccess(e.request.file,t,n)}notifyDiffInstances(e,t,n){for(const r of e.instances)this.activeRequestByInstance.get(r)===e.id&&r.onHighlightSuccess(e.request.diff,t,n)}notifyHighlightError(e,t){for(const n of ks(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)&&An(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)&&Jr(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())mr(e)&&(yield e)}generateRequestId(){return`req_${++this.nextRequestId}`}};function T6(e){return e.type==="initialize"||e.type==="file"||e.type==="diff"}function oC(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??Ht(e.request.file.name));break;case"diff":t.add(e.request.diff.lang??Ht(e.request.diff.name)),t.add(e.request.diff.lang??Ht(e.request.diff.prevName??"-"));break}return t.delete("text"),Array.from(t)}function mr(e){return e?.type==="file"||e?.type==="diff"}function ks(e){return e.instances}function pp(e){return e instanceof Error?e:new Error(String(e))}let Hs;function A6({poolOptions:e,highlighterOptions:t}){return Hs??=new L6(e,t),Hs}function R6(){Hs!=null&&(Hs.terminate(),Hs=void 0)}const Sg=O.createContext(void 0);let mp=0;function O6({children:e,poolOptions:t,highlighterOptions:n}){const[r]=O.useState(()=>{if(!(typeof window>"u"))return A6({poolOptions:t,highlighterOptions:n})});return O.useInsertionEffect(()=>{if(r!=null)return mp++,()=>{mp--}},[r]),O.useEffect(()=>()=>{mp===0&&R6()},[]),A.jsx(Sg.Provider,{value:r,children:e})}function P1(e,t){return typeof window>"u"&&t!=null?A.jsxs(A.Fragment,{children:[A.jsx("template",{shadowrootmode:"open",dangerouslySetInnerHTML:{__html:t}}),e]}):A.jsx(A.Fragment,{children:e})}const D6=O.createContext(void 0);function U1(){return O.useContext(D6)}const aC=typeof window>"u"?O.useEffect:O.useLayoutEffect;function M6({file:e,options:t,editorOptions:n,lineAnnotations:r,selectedLines:a,prerenderedHTML:s,metrics:u,hasGutterRenderUtility:d,hasCustomHeader:f,disableWorkerPool:h,edit:p}){const m=U1(),y=a!==void 0,b=O.useContext(Sg),S=z1(),_=O.useRef(null),w=I1(x=>{if(x!=null){if(_.current!=null)throw new Error("File: An instance should not already exist when a node is created");m!=null?_.current=new V8(gp({controlledSelection:y,hasCustomHeader:f,hasGutterRenderUtility:d,options:t}),m,u,h?void 0:b,!0):_.current=new x1(gp({controlledSelection:y,hasCustomHeader:f,hasGutterRenderUtility:d,options:t}),h?void 0:b,!0),_.current.hydrate({file:e,fileContainer:x,lineAnnotations:r,prerenderedHTML:s})}else{if(_.current==null)throw new Error("File: A File instance should exist when unmounting");_.current.cleanUp(),_.current=null}});return aC(()=>{if(_.current==null)return;const x=gp({controlledSelection:y,hasCustomHeader:f,hasGutterRenderUtility:d,options:t}),E=x!==void 0&&!Zc(_.current.options,x);_.current.setOptions(x),_.current.render({file:e,lineAnnotations:r,forceRender:E}),a!==void 0&&_.current.setSelectedLines(a)}),aC(()=>{if(p&&_.current!=null){if(S===void 0)throw new Error("File: EditContext is not attached");const x=S(n??{});if(x==null)throw new Error("File: EditProvider.createEditor must return an editor instance");try{return x.edit(_.current)}catch(E){throw x.cleanUp(),E}}},[p]),{ref:w,getHoveredLine:O.useCallback(()=>_.current?.getHoveredLine(),[])}}function gp({options:e,controlledSelection:t,hasCustomHeader:n,hasGutterRenderUtility:r}){return t||r||n?{...e,controlledSelection:t,renderCustomHeader:n?jc:e?.renderCustomHeader,renderGutterUtility:r?jc:e?.renderGutterUtility}:e}function N6({file:e,lineAnnotations:t,selectedLines:n,options:r,editorOptions:a,metrics:s,className:u,style:d,renderAnnotation:f,renderCustomHeader:h,renderHeaderPrefix:p,renderHeaderFilenameSuffix:m,renderHeaderMetadata:y,prerenderedHTML:b,renderGutterUtility:S,disableWorkerPool:_=!1,edit:w=!1}){const{ref:x,getHoveredLine:E}=M6({file:e,options:r,editorOptions:a,metrics:s,lineAnnotations:t,selectedLines:n,prerenderedHTML:b,hasGutterRenderUtility:S!=null,hasCustomHeader:h!=null,disableWorkerPool:_,edit:w});return A.jsx(tg,{ref:x,className:u,style:d,children:P1(x6({file:e,renderAnnotation:f,renderCustomHeader:h,renderHeaderPrefix:p,renderHeaderFilenameSuffix:m,renderHeaderMetadata:y,renderGutterUtility:S,lineAnnotations:t,getHoveredLine:E}),b)})}const sC=typeof window>"u"?O.useEffect:O.useLayoutEffect;function I6({fileDiff:e,options:t,editorOptions:n,lineAnnotations:r,selectedLines:a,prerenderedHTML:s,metrics:u,hasGutterRenderUtility:d,hasCustomHeader:f,disableWorkerPool:h,edit:p}){const m=U1(),y=a!==void 0,b=O.useContext(Sg),S=z1(),_=O.useRef(null),w=I1(x=>{if(x!=null){if(_.current!=null)throw new Error("useFileDiffInstance: An instance should not already exist when a node is created");m!=null?_.current=new a6(vp({controlledSelection:y,hasCustomHeader:f,hasGutterRenderUtility:d,options:t}),m,u,h?void 0:b,!0):_.current=new N1(vp({controlledSelection:y,hasCustomHeader:f,hasGutterRenderUtility:d,options:t}),h?void 0:b,!0),_.current.hydrate({fileDiff:e,fileContainer:x,lineAnnotations:r,prerenderedHTML:s})}else{if(_.current==null)throw new Error("useFileDiffInstance: A FileDiff instance should exist when unmounting");_.current.cleanUp(),_.current=null}});return sC(()=>{const{current:x}=_;if(x==null)return;const E=vp({controlledSelection:y,hasCustomHeader:f,hasGutterRenderUtility:d,options:t}),L=E!==void 0&&!Zc(x.options,E);x.setOptions(E),x.render({forceRender:L,fileDiff:e,lineAnnotations:r}),a!==void 0&&x.setSelectedLines(a)}),sC(()=>{if(p&&_.current!=null){if(S===void 0)throw new Error("FileDiff: EditContext is not attached");const x=S(n??{});if(x==null)throw new Error("FileDiff: EditProvider.createEditor must return an editor instance");try{return x.edit(_.current)}catch(E){throw x.cleanUp(),E}}},[p]),{ref:w,getHoveredLine:O.useCallback(()=>_.current?.getHoveredLine(),[])}}function vp({options:e,controlledSelection:t,hasCustomHeader:n,hasGutterRenderUtility:r}){return t||r||n?{...e,controlledSelection:t,renderCustomHeader:n?jc:e?.renderCustomHeader,renderGutterUtility:r?jc:e?.renderGutterUtility}:e}function z6({fileDiff:e,options:t,editorOptions:n,metrics:r,lineAnnotations:a,selectedLines:s,className:u,style:d,prerenderedHTML:f,renderAnnotation:h,renderCustomHeader:p,renderHeaderPrefix:m,renderHeaderFilenameSuffix:y,renderHeaderMetadata:b,renderGutterUtility:S,disableWorkerPool:_=!1,edit:w=!1}){const{ref:x,getHoveredLine:E}=I6({fileDiff:e,options:t,editorOptions:n,metrics:r,lineAnnotations:a,selectedLines:s,prerenderedHTML:f,hasGutterRenderUtility:S!=null,hasCustomHeader:p!=null,disableWorkerPool:_,edit:w});return A.jsx(tg,{ref:x,className:u,style:d,children:P1(_6({fileDiff:e,renderCustomHeader:p,renderHeaderPrefix:m,renderHeaderFilenameSuffix:y,renderHeaderMetadata:b,renderAnnotation:h,renderGutterUtility:S,lineAnnotations:a,getHoveredLine:E}),f)})}function H6(e){return new Worker(""+new URL("worker-DsKBD11i.js",import.meta.url).href,{type:"module",name:e?.name})}const j1=`
|
|
1544
|
+
[data-diffs-header],
|
|
1545
|
+
[data-diff],
|
|
1546
|
+
[data-file],
|
|
1547
|
+
[data-error-wrapper],
|
|
1548
|
+
[data-virtualizer-buffer] {
|
|
1549
|
+
--diffs-header-font-family: var(--font-sans) !important;
|
|
1550
|
+
--diffs-font-family: var(--font-mono) !important;
|
|
1551
|
+
--diffs-bg: var(--diff-canvas) !important;
|
|
1552
|
+
--diffs-light-bg: var(--diff-canvas) !important;
|
|
1553
|
+
--diffs-dark-bg: var(--diff-canvas) !important;
|
|
1554
|
+
--diffs-token-light-bg: transparent;
|
|
1555
|
+
--diffs-token-dark-bg: transparent;
|
|
1556
|
+
--diffs-bg-context-override: var(--diff-canvas);
|
|
1557
|
+
--diffs-bg-hover-override: var(--diff-hover);
|
|
1558
|
+
--diffs-bg-separator-override: var(--diff-hunk);
|
|
1559
|
+
--diffs-bg-buffer-override: var(--diff-hunk);
|
|
1560
|
+
--diffs-bg-addition-override: var(--diff-add-line);
|
|
1561
|
+
--diffs-bg-addition-number-override: var(--diff-add-num);
|
|
1562
|
+
--diffs-bg-addition-hover-override: var(--diff-add-line);
|
|
1563
|
+
--diffs-bg-addition-emphasis-override: var(--diff-add-word);
|
|
1564
|
+
--diffs-bg-deletion-override: var(--diff-del-line);
|
|
1565
|
+
--diffs-bg-deletion-number-override: var(--diff-del-num);
|
|
1566
|
+
--diffs-bg-deletion-hover-override: var(--diff-del-line);
|
|
1567
|
+
--diffs-bg-deletion-emphasis-override: var(--diff-del-word);
|
|
1568
|
+
background-color: var(--diff-canvas) !important;
|
|
1569
|
+
color: var(--diff-fg) !important;
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
[data-line-type="change-addition"] {
|
|
1573
|
+
background-color: var(--diff-add-line) !important;
|
|
1574
|
+
}
|
|
1575
|
+
[data-line-type="change-addition"][data-column-number] {
|
|
1576
|
+
background-color: var(--diff-add-num) !important;
|
|
1577
|
+
}
|
|
1578
|
+
[data-line-type="change-deletion"] {
|
|
1579
|
+
background-color: var(--diff-del-line) !important;
|
|
1580
|
+
}
|
|
1581
|
+
[data-line-type="change-deletion"][data-column-number] {
|
|
1582
|
+
background-color: var(--diff-del-num) !important;
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
[data-diff-type="split"][data-overflow="scroll"] {
|
|
1586
|
+
grid-template-columns: minmax(0, var(--comprehende-split-left, 1fr)) minmax(0, var(--comprehende-split-right, 1fr)) !important;
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
[data-diff-type="split"][data-overflow="wrap"],
|
|
1590
|
+
[data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {
|
|
1591
|
+
grid-template-columns:
|
|
1592
|
+
var(--diffs-grid-number-column-width)
|
|
1593
|
+
minmax(0, var(--comprehende-split-left, 1fr))
|
|
1594
|
+
var(--diffs-grid-number-column-width)
|
|
1595
|
+
minmax(0, var(--comprehende-split-right, 1fr)) !important;
|
|
1596
|
+
}
|
|
1597
|
+
`,V1=.2,B1=.8;function yp(e){return Math.min(B1,Math.max(V1,e))}function P6(e){const t=O.useMemo(()=>{const r=typeof navigator>"u"?4:Math.max(1,navigator.hardwareConcurrency||4);return{workerFactory:()=>new H6,poolSize:Math.max(2,Math.min(6,Math.floor(r/2)))}},[]),n=O.useMemo(()=>({theme:Jm,tokenizeMaxLineLength:1e3,useTokenTransformer:!0,lineDiffType:"none"}),[]);return A.jsx(O6,{poolOptions:t,highlighterOptions:n,children:e.children})}function U6(e){if(e.trim()!=="")try{return MM(e,`comprehende:${e.length}`)[0]?.files[0]}catch{return}}const j6=O.memo(function(t){const n=O.useMemo(()=>({theme:Jm,themeType:t.themeType,diffStyle:t.split?"split":"unified",overflow:t.wrap?"wrap":"scroll",disableFileHeader:!0,stickyHeader:!1,lineDiffType:"none",unsafeCSS:j1}),[t.split,t.themeType,t.wrap]);return A.jsx(z6,{className:"block w-full",fileDiff:t.fileDiff,options:n})}),V6=O.memo(function(t){const n=O.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]),r=O.useMemo(()=>({theme:Jm,themeType:t.themeType,overflow:t.wrap?"wrap":"scroll",disableFileHeader:!0,stickyHeader:!1,unsafeCSS:j1}),[t.themeType,t.wrap]);return A.jsx(N6,{className:"block w-full",file:n,options:r,lineAnnotations:t.annotations,renderAnnotation:t.annotations===void 0?void 0:B6})});function B6(e){const t=e.metadata,n=new Date(t.timestamp*1e3).toISOString().slice(0,10);return A.jsxs("div",{className:"flex min-w-0 items-baseline gap-2 px-2 py-1 font-sans text-[11px] text-muted-foreground",children:[A.jsx("code",{className:"text-primary",children:t.sha.slice(0,7)}),A.jsx("span",{className:"min-w-0 truncate",children:t.author}),A.jsx("span",{className:"shrink-0 tabular-nums",children:n}),t.lines>1?A.jsxs("span",{className:"shrink-0 tabular-nums",children:[t.lines," lines"]}):null]})}function lC(e){const{resolved:t}=eg();return A.jsx("div",{className:"min-h-0 min-w-0",children:A.jsx(V6,{path:e.path,contents:e.contents,wrap:e.wrap,themeType:t,annotations:e.annotations})})}function F6(e){const{patch:t,split:n,wrap:r,splitRatio:a,onSplitRatio:s}=e,{resolved:u}=eg(),d=O.useMemo(()=>U6(t),[t]);return d===void 0?A.jsx("p",{className:"px-3 py-2 text-xs text-warn",children:"Could not render this git patch."}):A.jsxs("div",{className:"relative min-w-0",style:{"--comprehende-split-left":`${a}fr`,"--comprehende-split-right":`${1-a}fr`},children:[A.jsx(j6,{fileDiff:d,split:n,wrap:r,themeType:u}),n?A.jsx(G6,{ratio:a,onRatio:s}):null]})}function G6(e){const t=O.useRef(null),n=s=>{const u=s.currentTarget.parentElement;u!==null&&(s.preventDefault(),s.currentTarget.setPointerCapture(s.pointerId),t.current={startX:s.clientX,start:e.ratio,width:u.getBoundingClientRect().width})},r=s=>{const u=t.current;u===null||u.width===0||e.onRatio(yp(u.start+(s.clientX-u.startX)/u.width))},a=()=>{t.current=null};return A.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize split diff","aria-valuemin":Math.round(V1*100),"aria-valuemax":Math.round(B1*100),"aria-valuenow":Math.round(e.ratio*100),tabIndex:0,className:Qe("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:r,onPointerUp:a,onPointerCancel:a,onDoubleClick:()=>e.onRatio(.5),onKeyDown:s=>{s.key==="ArrowLeft"?(s.preventDefault(),e.onRatio(yp(e.ratio-.05))):s.key==="ArrowRight"?(s.preventDefault(),e.onRatio(yp(e.ratio+.05))):(s.key==="Home"||s.key==="Enter")&&(s.preventDefault(),e.onRatio(.5))},children:A.jsx("div",{className:"z-10 flex h-8 w-3 items-center justify-center rounded-sm border border-border bg-card",children:A.jsx(VC,{className:"size-2.5 text-muted-foreground"})})})}var $6=Object.defineProperty,F1=(e,t)=>$6(e,"name",{value:t,configurable:!0}),uC="horizontal",q6=["horizontal","vertical"],W6=O.forwardRef(F1(function(t,n){const{decorative:r,orientation:a=uC,...s}=t,u=G1(a)?a:uC,f=r?{role:"none"}:{"aria-orientation":u==="vertical"?u:void 0,role:"separator"};return A.jsx(vo.div,{"data-orientation":u,...f,...s,ref:n})},"Separator"));function G1(e){return q6.includes(e)}F1(G1,"isValidOrientation");var Y6=W6;function K6({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return A.jsx(Y6,{"data-slot":"separator",decorative:n,orientation:t,className:Qe("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),...r})}function X6(e){const{inspector:t,wrap:n,setInspector:r,onClose:a}=e,s=sM(t.path),[u,d]=O.useState(""),[f,h]=O.useState(null),[p,m]=O.useState(null),[y,b]=O.useState(!0),S=O.useMemo(()=>f===null?"":f.map(w=>w.text).join(`
|
|
1598
|
+
`),[f]),_=O.useMemo(()=>{if(f!==null)return lM(f).map(w=>({lineNumber:w.lineNumber,metadata:{sha:w.sha,author:w.author,timestamp:w.timestamp,lines:w.lines}}))},[f]);return O.useEffect(()=>{let w=!1;if(m(null),b(!0),d(""),h(null),s){b(!1);return}return t.mode==="file"?gA(t.path,t.side).then(x=>{w||(d(x.content),b(!1))}).catch(x=>{w||(m(x instanceof Error?x.message:String(x)),b(!1))}):vA(t.path,t.side).then(x=>{w||(h(x.lines),b(!1))}).catch(x=>{w||(m(x instanceof Error?x.message:String(x)),b(!1))}),()=>{w=!0}},[s,t]),A.jsxs("div",{className:"review-inspector flex h-full min-h-0 flex-col","aria-busy":y,children:[A.jsxs("div",{className:"flex flex-wrap items-center gap-3 px-8 pt-6 pb-4",children:[A.jsxs(Qn,{children:[A.jsx(Zn,{asChild:!0,children:A.jsxs(Dt,{type:"button",size:"sm",variant:"outline",onClick:a,children:["Back",A.jsx(rc,{children:"esc"})]})}),A.jsx(Jn,{children:"Back to the diff"})]}),A.jsx("strong",{className:"min-w-0 truncate font-mono text-sm font-medium",children:t.path}),A.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[A.jsx(Dt,{type:"button",size:"sm",variant:t.mode==="file"?"secondary":"ghost",onClick:()=>r({...t,mode:"file"}),children:"File"}),s?null:A.jsx(Dt,{type:"button",size:"sm",variant:t.mode==="blame"?"secondary":"ghost",onClick:()=>r({...t,mode:"blame"}),children:"Blame"}),A.jsx(K6,{orientation:"vertical",className:"mx-1 h-6"}),A.jsx(Dt,{type:"button",size:"sm",variant:t.side==="old"?"secondary":"ghost",onClick:()=>r({...t,side:"old"}),children:"Old"}),A.jsx(Dt,{type:"button",size:"sm",variant:t.side==="new"?"secondary":"ghost",onClick:()=>r({...t,side:"new"}),children:"New"})]})]}),p!==null?A.jsx("p",{className:"px-8 text-warn",children:p}):null,y&&p===null&&!s?A.jsx("div",{className:"px-8 pt-2",children:A.jsx(Qc,{label:t.mode==="file"?_a.file:_a.blame})}):null,s?A.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-8 pb-8",children:A.jsx("img",{src:Lp({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&&!y?A.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-4 pb-8",children:A.jsx(lC,{path:t.path,contents:u,wrap:n})}):null,!s&&t.mode==="blame"&&p===null&&!y&&f!==null?A.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-4 pb-8",children:A.jsx(lC,{path:t.path,contents:S,wrap:n,annotations:_})}):null]})}function Q6(e){return/^(@@ -\d+(?:,\d+)? \+\d+(?:,\d+)? @@)/.exec(e)?.[1]??e}function Z6(e){const t=[],n=/^(?:export\s+)?(?:async\s+)?(?:function|class|type|interface|enum)\s+([A-Za-z_][\w]*)/;for(const r of e){const s=n.exec(r.trim())?.[1];s!==void 0&&!t.includes(s)&&t.push(s)}return t}function J6(e){let t=0,n=0;for(const r of e)r.kind==="add"?t+=1:r.kind==="del"&&(n+=1);return{added:t,removed:n}}const e3=.35,t3=8;function n3(e,t,n,r,a=t3){const s=n*r,u=new Uint8ClampedArray(s*4);let d=0;for(let f=0;f<s;f+=1){const h=f*4,p=e[h+3]??0,m=t[h+3]??0,y=p===0&&m===0,b=Math.abs((e[h]??0)-(t[h]??0)),S=Math.abs((e[h+1]??0)-(t[h+1]??0)),_=Math.abs((e[h+2]??0)-(t[h+2]??0)),w=Math.abs(p-m),x=Math.max(b,S,_,w);if(y||x<=a){const E=i3(t[h]??0,t[h+1]??0,t[h+2]??0),L=Math.round(E*e3);u[h]=L,u[h+1]=L,u[h+2]=L,u[h+3]=255;continue}if(d+=1,p===0&&m>0){u[h]=26,u[h+1]=127,u[h+2]=55,u[h+3]=255;continue}if(m===0&&p>0){u[h]=207,u[h+1]=34,u[h+2]=46,u[h+3]=255;continue}u[h]=200,u[h+1]=40,u[h+2]=160,u[h+3]=255}return{pixels:u,changed:d,total:s}}function i3(e,t,n){return Math.round(.2126*e+.7152*t+.0722*n)}function $1(e,t,n,r){if(e<=0||t<=0||n<=0||r<=0)return{width:0,height:0,scale:1};const a=Math.min(1,n/e,r/t);return{width:Math.max(1,Math.round(e*a)),height:Math.max(1,Math.round(t*a)),scale:a}}function r3(e,t,n,r){return $1(e,t,Math.floor(Math.max(0,n-1)/2),r)}function o3(e,t,n){const r=`${e} × ${t}`;return n>=.995?r:`${r} at ${Math.round(n*100)}%`}function a3(e){return`${e}%`}function s3(e){const{path:t,status:n}=e,r=n!=="added",a=n!=="deleted",s=r?Lp({kind:"image",path:t,side:"old"}):void 0,u=a?Lp({kind:"image",path:t,side:"new"}):void 0,d=s!==void 0&&u!==void 0,f=cC(s),h=cC(u),p=c3(),[m,y]=O.useState("side-by-side"),[b,S]=O.useState(50),_=Math.max(f.naturalWidth,h.naturalWidth),w=Math.max(f.naturalHeight,h.naturalHeight),E=m==="side-by-side"||!d?r3(_,w,p.width,p.maxHeight):$1(_,w,p.width,p.maxHeight),L=E.width>0&&(f.ok||h.ok),R=f.error&&h.error?"These images are not in this clone. Fetch Git LFS objects, then refresh.":f.error?"The old image is not in this clone. Fetch Git LFS objects, then refresh.":h.error?"The new image is not in this clone. Fetch Git LFS objects, then refresh.":null;return A.jsxs("div",{ref:p.ref,className:"min-w-0",children:[A.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 border-b border-border px-3 py-2",children:[d?A.jsxs("div",{className:"flex overflow-hidden rounded-md border border-input",children:[A.jsx(bp,{active:m==="side-by-side",onClick:()=>y("side-by-side"),hint:"Old and new at the same size",children:"Side by side"}),A.jsx(bp,{active:m==="slider",onClick:()=>y("slider"),hint:"Drag to reveal new over old",children:"Slider"}),A.jsx(bp,{active:m==="diff",onClick:()=>y("diff"),hint:"Pixels that differ",children:"Diff"})]}):A.jsx("span",{className:"font-mono text-[11px] text-muted-foreground",children:n==="added"?"Added":"Deleted"}),L?A.jsx("span",{className:"ml-auto font-mono text-[11px] tabular-nums text-muted-foreground",children:o3(_,w,E.scale)}):null]}),R!==null?A.jsx("p",{className:"px-3 py-2 text-sm text-warn",children:R}):null,!L&&R===null?A.jsx("p",{className:"px-3 py-2 text-sm text-muted-foreground",children:"Reading image…"}):null,A.jsxs("div",{className:"flex w-full justify-center",children:[L&&(m==="side-by-side"||!d)?A.jsxs("div",{className:"flex",children:[r?A.jsx(Zu,{label:"Old",width:E.width,height:E.height,rule:a,children:s!==void 0&&!f.error?A.jsx(Vc,{src:s,alt:"Old",width:E.width,height:E.height}):A.jsx(Ju,{})}):A.jsx(Zu,{label:"Old",width:E.width,height:E.height,children:A.jsx(Ju,{text:"Added — no old image"})}),a?A.jsx(Zu,{label:"New",width:E.width,height:E.height,children:u!==void 0&&!h.error?A.jsx(Vc,{src:u,alt:"New",width:E.width,height:E.height}):A.jsx(Ju,{})}):A.jsx(Zu,{label:"New",width:E.width,height:E.height,children:A.jsx(Ju,{text:"Deleted — no new image"})})]}):null,L&&m==="slider"&&d&&s!==void 0&&u!==void 0?A.jsx(l3,{oldUrl:s,newUrl:u,width:E.width,height:E.height,wipe:b,onWipe:S}):null,L&&m==="diff"&&d&&f.element!==null&&h.element!==null?A.jsx(u3,{oldImage:f.element,newImage:h.element,naturalWidth:_,naturalHeight:w,width:E.width,height:E.height}):null]})]})}function bp(e){return A.jsxs(Qn,{children:[A.jsx(Zn,{asChild:!0,children:A.jsx(Dt,{type:"button",size:"sm",variant:e.active?"secondary":"ghost",className:"rounded-none border-0","aria-pressed":e.active,onClick:e.onClick,children:e.children})}),A.jsx(Jn,{children:e.hint})]})}function Zu(e){return A.jsxs("figure",{className:Qe("w-fit shrink-0",e.rule===!0&&"border-r border-border"),children:[A.jsx("figcaption",{className:"border-b border-border px-3 py-1 font-mono text-[11px] text-muted-foreground",children:e.label}),A.jsx(_g,{width:e.width,height:e.height,children:e.children})]})}function _g(e){return A.jsx("div",{ref:e.ref,className:Qe("image-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 Vc(e){return A.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 Ju(e){return A.jsx("p",{className:"flex h-full items-center px-3 text-sm text-muted-foreground",children:e.text??"Image missing"})}function l3(e){const{oldUrl:t,newUrl:n,width:r,height:a,wipe:s,onWipe:u}=e,d=O.useId(),f=O.useRef(null),h=y=>{const b=f.current;if(b===null)return;const S=b.getBoundingClientRect();S.width!==0&&u(Math.min(100,Math.max(0,(y-S.left)/S.width*100)))},p=y=>{y.preventDefault(),y.currentTarget.setPointerCapture(y.pointerId),h(y.clientX)},m=y=>{y.buttons!==0&&h(y.clientX)};return A.jsxs("figure",{className:"mx-auto w-fit shrink-0",children:[A.jsxs(_g,{ref:f,width:r,height:a,className:"cursor-col-resize touch-none",onPointerDown:p,onPointerMove:m,children:[A.jsx(Vc,{src:t,alt:"Old",width:r,height:a}),A.jsx("div",{className:"absolute inset-y-0 left-0 overflow-hidden",style:{width:a3(s)},children:A.jsx(Vc,{src:n,alt:"New",width:r,height:a})}),A.jsxs("div",{className:"pointer-events-none absolute inset-y-0",style:{left:`${s}%`},"aria-hidden":!0,children:[A.jsx("span",{className:"absolute inset-y-0 left-0 w-px -translate-x-1/2 bg-primary"}),A.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"})]})]}),A.jsxs("label",{className:"flex w-full items-center gap-3 px-3 py-2 font-mono text-[11px] text-muted-foreground",htmlFor:d,children:["Old",A.jsx("input",{id:d,type:"range",min:0,max:100,value:s,"aria-label":"Wipe between old and new",className:"min-w-0 flex-1 accent-primary",onChange:y=>u(Number(y.target.value))}),"New"]})]})}function u3(e){const t=O.useRef(null),[n,r]=O.useState(null);return O.useEffect(()=>{const a=t.current;if(a===null)return;const s=e.naturalWidth,u=e.naturalHeight;a.width=s,a.height=u;const d=a.getContext("2d");if(d===null)return;const f=dC(e.oldImage,s,u),h=dC(e.newImage,s,u),p=n3(f,h,s,u),m=d.createImageData(s,u);m.data.set(p.pixels),d.putImageData(m,0,0),r({changed:p.changed,total:p.total})},[e.naturalHeight,e.naturalWidth,e.newImage,e.oldImage]),A.jsxs("figure",{className:"mx-auto w-fit shrink-0",children:[A.jsx(_g,{width:e.width,height:e.height,children:A.jsx("canvas",{ref:t,className:"block size-full"})}),n!==null?A.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 cC(e){const[t,n]=O.useState({ok:!1,error:!1,element:null,naturalWidth:0,naturalHeight:0});return O.useEffect(()=>{if(e===void 0){n({ok:!1,error:!1,element:null,naturalWidth:0,naturalHeight:0});return}let r=!1;return n({ok:!1,error:!1,element:null,naturalWidth:0,naturalHeight:0}),d3(e).then(a=>{r||n({ok:!0,error:!1,element:a,naturalWidth:a.naturalWidth,naturalHeight:a.naturalHeight})}).catch(()=>{r||n({ok:!1,error:!0,element:null,naturalWidth:0,naturalHeight:0})}),()=>{r=!0}},[e]),t}function c3(){const e=O.useRef(null),[t,n]=O.useState({width:0,maxHeight:0});return O.useLayoutEffect(()=>{const r=e.current;if(r===null)return;const a=()=>{const u=Math.floor(r.clientWidth),d=Math.max(120,Math.round(window.innerHeight*.7));n(f=>f.width===u&&f.maxHeight===d?f:{width:u,maxHeight:d})};a();const s=new ResizeObserver(a);return s.observe(r),window.addEventListener("resize",a),()=>{s.disconnect(),window.removeEventListener("resize",a)}},[]),{ref:e,width:t.width,maxHeight:t.maxHeight}}function d3(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>t(r),r.onerror=()=>n(new Error("image load failed")),r.src=e})}function dC(e,t,n){const r=document.createElement("canvas");r.width=t,r.height=n;const a=r.getContext("2d");return a===null?new Uint8ClampedArray(t*n*4):(a.clearRect(0,0,t,n),a.drawImage(e,0,0),a.getImageData(0,0,t,n).data)}const f3=JC("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-colors 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 h3({className:e,variant:t="default",asChild:n=!1,...r}){const a=n?GC:"span";return A.jsx(a,{"data-slot":"badge",className:Qe(f3({variant:t}),e),...r})}function p3(e){const{file:t,active:n,index:r,split:a,splitRatio:s,wrap:u,viewed:d,onSplitRatio:f,onOpen:h,onViewed:p}=e,[m,y]=O.useState(d),b=t.hunks[0],S=Z6(t.hunks.flatMap(E=>E.lines.filter(L=>L.kind==="add").map(L=>L.text))),_=t.oldPath!==void 0?`${t.oldPath} → ${t.path}`:t.path,w=O.useId();O.useEffect(()=>{y(d)},[d]);const x=E=>{E.target instanceof Element&&E.target.closest("button, input, label, a")!==null||y(L=>!L)};return A.jsxs("article",{className:Qe("hunk-card overflow-hidden rounded-lg border bg-card",n?"border-primary":"border-border"),"data-hunk":r,children:[A.jsxs("header",{className:Qe("sticky top-0 z-10 flex cursor-pointer flex-wrap items-center gap-x-3 gap-y-1 bg-card px-3 py-2",m?null:"border-b border-border"),onClick:x,children:[A.jsx(Dt,{type:"button",variant:"ghost",size:"icon-sm",className:"size-6","aria-expanded":!m,"aria-controls":w,"aria-label":m?"Expand file":"Collapse file",onClick:()=>y(E=>!E),children:A.jsx(wA,{className:Qe("hunk-chevron size-4",m&&"-rotate-90")})}),A.jsxs(Qn,{children:[A.jsx(Zn,{asChild:!0,children:A.jsx(Dt,{type:"button",variant:"link",className:Qe("file-path h-auto p-0 font-mono text-sm",d&&"text-muted-foreground"),onClick:()=>h(t.path),children:_})}),A.jsx(Jn,{children:"Open file"})]}),A.jsx("code",{className:"font-mono text-xs text-muted-foreground",children:t.kind==="image"?"image":t.hunkCount===1&&b!==void 0?Q6(b.header):`${t.hunkCount} hunks`}),t.kind==="image"?A.jsx("span",{className:"font-mono text-[11px] text-muted-foreground",children:t.status}):A.jsxs("span",{className:"font-mono text-[11px] tabular-nums",children:[A.jsxs("span",{className:"text-del",children:["−",t.removed]})," ",A.jsxs("span",{className:"text-add",children:["+",t.added]})]}),S.length>0?S.map(E=>A.jsx(h3,{variant:"outline",className:"font-mono font-normal",children:E},E)):null,A.jsxs(Qn,{children:[A.jsx(Zn,{asChild:!0,children:A.jsxs("label",{className:"ml-auto flex shrink-0 cursor-pointer items-center gap-1.5 text-xs text-muted-foreground select-none",children:[A.jsx("input",{type:"checkbox",className:"size-3.5 accent-primary",checked:d,onChange:E=>p(t.path,E.target.checked)}),"Viewed"]})}),A.jsxs(Jn,{children:[d?"Mark as not viewed":"Mark as viewed"," (v)"]})]})]}),A.jsx("div",{id:w,hidden:m,children:m?null:t.kind==="image"?A.jsx(s3,{path:t.path,status:t.status}):A.jsx(F6,{patch:t.patch,split:a,wrap:u,splitRatio:s,onSplitRatio:f})})]})}function q1(e){return A.jsxs("div",{className:Qe("max-w-[68ch]",e.className),children:[e.kicker!==void 0?A.jsx("p",{className:"mb-2 font-mono text-[11px] tracking-wide text-muted-foreground",children:e.kicker}):null,A.jsx("h1",{className:"mb-3 font-serif text-[1.75rem] leading-snug text-foreground",children:e.title}),e.children]})}function m3(e){const{group:t,index:n,groups:r,partTitle:a,onOpenLayer:s}=e;return A.jsxs(q1,{kicker:a!==void 0?`${a} · ${Ms(n)}`:Ms(n),title:t.title,children:[A.jsx("p",{className:"mb-5 font-serif text-lg leading-relaxed text-foreground",children:t.summary}),t.dependsOn.length>0?A.jsxs("p",{className:"mb-5 text-muted-foreground",children:["Depends on"," ",t.dependsOn.map((u,d)=>{const f=r.find(p=>p.id===u),h=f!==void 0?`${Ms(PC(r,u))} ${f.title}`:u;return A.jsxs("span",{children:[d>0?", ":"",A.jsx(Dt,{type:"button",variant:"link",className:"h-auto p-0",onClick:()=>s(u),children:h})]},u)})]}):null,t.lookFor.length>0?A.jsx("ul",{className:"mb-2 list-disc space-y-2 pl-5 leading-relaxed",children:t.lookFor.map(u=>A.jsx("li",{children:u},u))}):null,t.staleCount>0?A.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]})}function g3(e){const{group:t,groups:n,mixed:r,strandColor:a,loading:s,hunkError:u,files:d,activeHunk:f,split:h,splitRatio:p,wrap:m,viewedPaths:y}=e;return A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"review-brief",children:[a!==void 0?A.jsx("span",{className:"review-brief-strand",style:{backgroundColor:a},"aria-hidden":!0}):null,A.jsx("div",{className:"review-brief-copy",children:t!==null?A.jsx(m3,{group:t,index:PC(n,t.id),groups:n,partTitle:r?t.part:void 0,onOpenLayer:e.onOpenLayer}):A.jsx(q1,{kicker:"Unassigned",title:"Not in any layer",children:A.jsx("p",{className:"font-serif text-lg leading-relaxed text-foreground",children:"These hunks are in git and in no layer. Fix the review document — never the diff."})})})]}),u!==null?A.jsx("p",{className:"mt-4 text-warn",children:u}):null,s?A.jsx("article",{className:"hunk-card mt-8 overflow-hidden rounded-lg border border-border bg-card",children:A.jsx(Qc,{label:_a.layer})}):null,!s&&d.length===0&&u===null?A.jsx("p",{className:"mt-8 text-muted-foreground",children:"No hunks in this layer."}):null,!s&&d.length>0?A.jsxs("p",{className:"mt-8 font-mono text-xs tabular-nums text-muted-foreground",children:[d.filter(b=>y.has(b.path)).length," of ",d.length," files viewed"]}):null,!s&&d.length>0?A.jsx("div",{className:"mt-4 space-y-8",children:d.map(b=>A.jsx(p3,{file:b,active:f>=b.firstIndex&&f<b.firstIndex+b.hunkCount,index:b.firstIndex,split:h,splitRatio:p,wrap:m,viewed:y.has(b.path),onSplitRatio:e.onSplitRatio,onOpen:e.onOpenFile,onViewed:e.onViewed},b.path))}):null]})}const W1=6;function v3(e){const t=new Map(e.map(s=>[s.id,s.suggestedOrder]));if(!e.some(s=>s.part!==void 0))return[{colorIndex:0,layerIds:fC(e.map(s=>s.id),t)}];const r=new Map;for(const s of e){const u=s.part??`\0${s.id}`,d=r.get(u)??[];d.push(s.id),r.set(u,d)}const a=[...r.entries()].map(([s,u])=>{const d=fC(u,t);return{title:s.startsWith("\0")?void 0:s,layerIds:d,minOrder:t.get(d[0]??"")??0,sortKey:d[0]??""}});return a.sort((s,u)=>s.minOrder-u.minOrder||(s.title??s.sortKey).localeCompare(u.title??u.sortKey)),a.map((s,u)=>({colorIndex:u%W1,layerIds:s.layerIds,...s.title!==void 0?{title:s.title}:{}}))}function Y1(e){const t=new Map;for(const n of e)for(const r of n.layerIds)t.set(r,n.colorIndex);return t}function Cg(e){return`var(--strand-${e%W1})`}function xg(e){return e.length>1}function fC(e,t){return[...e].sort((n,r)=>(t.get(n)??0)-(t.get(r)??0)||n.localeCompare(r))}function y3(e){const{meta:t,parts:n,onOpenLayer:r}=e,a=xg(n),s=new Map(t.groups.map(u=>[u.id,u]));return A.jsxs("div",{className:"review-overview mb-8",children:[t.document.walkthrough!==void 0?A.jsx("h1",{className:"mb-4 font-serif text-[1.75rem] leading-snug text-foreground",children:t.document.walkthrough}):A.jsx("h1",{className:"mb-4 font-serif text-[1.75rem] leading-snug text-foreground",children:"Overview"}),A.jsxs("p",{className:"mb-10 text-muted-foreground",children:[UC(t.document.size)," · ",t.files.length," files"]}),A.jsx("div",{className:a?"grid grid-flow-col auto-cols-[minmax(16rem,1fr)] items-start gap-4 overflow-x-auto pb-1":void 0,children:n.map(u=>A.jsx(b3,{part:u,mixed:a,groups:t.groups,byId:s,onOpenLayer:r},u.layerIds.join("\0")))}),t.commits.length>0?A.jsx("ul",{className:"mt-12 space-y-2 text-sm text-muted-foreground",children:t.commits.map(u=>A.jsxs("li",{children:[A.jsx("code",{className:"text-primary",children:u.shortSha})," ",u.subject]},u.sha))}):null]})}function b3(e){const{part:t,mixed:n,groups:r,byId:a,onOpenLayer:s}=e,u=Cg(t.colorIndex);return A.jsxs("section",{className:Qe("min-w-0",n&&"rounded-md border border-border py-2"),style:n?S3(u):void 0,"aria-label":t.title,children:[n&&t.title!==void 0?A.jsxs("p",{className:"mb-1 flex items-center gap-2 px-4 pt-2 font-mono text-[11px] tracking-wide text-muted-foreground",children:[A.jsx("span",{"aria-hidden":!0,className:"size-2 shrink-0 rounded-full",style:{backgroundColor:u}}),t.title]}):null,A.jsx("ol",{className:"m-0 list-none p-0",children:t.layerIds.map(d=>{const f=a.get(d);if(f===void 0)return null;const h=r.findIndex(p=>p.id===d)+1;return A.jsx("li",{className:"mb-2 last:mb-0",children:A.jsxs(Dt,{type:"button",variant:"ghost",className:"h-auto w-full min-w-0 items-start justify-start gap-4 rounded-md px-4 py-4 text-left font-normal whitespace-normal",onClick:()=>s(f.id),children:[A.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[11px] text-muted-foreground tabular-nums",children:Ms(h)}),A.jsxs("span",{className:"min-w-0 flex-1",children:[A.jsx("strong",{className:"block font-medium text-foreground",children:f.title}),A.jsx("span",{className:"mt-1 block leading-relaxed text-muted-foreground",children:f.summary})]})]})},f.id)})})]})}function S3(e){return{"--strand":e,borderLeftWidth:3,borderLeftColor:e,backgroundColor:`color-mix(in srgb, ${e} 8%, var(--card))`}}function _3(e){const{meta:t,selection:n,parts:r,onSelect:a}=e,u=xg(r)?Y1(r):new Map;return A.jsxs("nav",{className:"h-full overflow-auto py-6",children:[A.jsxs("div",{className:"stack",children:[A.jsx("span",{className:"stack-selection","aria-hidden":!0}),A.jsx("ul",{className:"mb-6 list-none p-0",children:A.jsx("li",{children:A.jsx(Sp,{active:n?.kind==="overview",onClick:()=>a({kind:"overview"}),title:"Overview",count:UC(t.document.size)})})}),A.jsxs("ul",{className:"mb-6 list-none p-0",children:[t.groups.map((d,f)=>A.jsx("li",{children:A.jsx(Sp,{active:n?.kind==="group"&&n.id===d.id,onClick:()=>a({kind:"group",id:d.id}),index:Ms(f+1),title:d.title,count:d.staleCount>0?`${d.staleCount} stale`:void 0,colorIndex:u.get(d.id)})},d.id)),t.unassigned.hunkCount>0?A.jsx("li",{children:A.jsx(Sp,{active:n?.kind==="unassigned",onClick:()=>a({kind:"unassigned"}),title:"Unassigned",count:String(t.unassigned.hunkCount),warn:!0})}):null]})]}),t.document.tickets!==void 0&&t.document.tickets.length>0?A.jsx("ul",{className:"space-y-2 px-4 text-sm text-muted-foreground",children:t.document.tickets.map(d=>A.jsx("li",{children:d.url!==void 0?A.jsxs("a",{className:"text-primary hover:underline",href:d.url,target:"_blank",rel:"noreferrer",children:[d.id,d.title!==void 0?` ${d.title}`:""]}):A.jsxs("span",{children:[d.id,d.title!==void 0?` ${d.title}`:""]})},d.id))}):null]})}function Sp(e){const t=e.colorIndex,n=t!==void 0||e.active;return A.jsxs(Dt,{type:"button",variant:"ghost",onClick:e.onClick,style:t!==void 0?{"--strand":Cg(t)}:void 0,className:Qe("stack-item 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&&"stack-item-active text-foreground",e.warn&&"text-warn hover:text-warn"),children:[n?A.jsx("span",{className:Qe("stack-strand",t!==void 0&&!e.active&&"opacity-45"),"aria-hidden":!0}):null,e.index!==void 0?A.jsx("span",{className:"mt-px w-5 shrink-0 font-mono text-[11px] text-muted-foreground tabular-nums",children:e.index}):null,A.jsx("span",{className:"min-w-0 flex-1 text-left leading-snug",children:e.title}),e.count!==void 0?A.jsx("span",{className:Qe("shrink-0 text-[11px] tabular-nums text-muted-foreground",e.warn&&"text-warn"),children:e.count}):null]})}function ec(e){let t=0;return e.map(n=>{const r=J6(n.hunks.flatMap(s=>s.lines)),a={path:n.path,kind:n.kind??"text",status:n.status??"modified",patch:n.patch,added:r.added,removed:r.removed,hunkCount:n.hunks.length,firstIndex:t,hunks:n.hunks};return n.oldPath!==void 0&&(a.oldPath=n.oldPath),t+=Math.max(n.hunks.length,1),a})}function _p(e,t){return e.findIndex(n=>t>=n.firstIndex&&t<n.firstIndex+n.hunkCount)}let Cp=0;function C3(){return typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches}function x3(e){const t=C3(),n=typeof document>"u"?void 0:document.startViewTransition;return!t&&typeof n=="function"}function xp(e,t){if(!x3()){e();return}const n=document.startViewTransition;if(typeof n!="function"){e();return}const r=document.documentElement,a=++Cp;r.dataset.motion=t;try{n.call(document,()=>{Gc.flushSync(e)}).finished.finally(()=>{a===Cp&&delete r.dataset.motion})}catch{a===Cp&&delete r.dataset.motion,e()}}function Ep(e){return e.groups.length>0?{kind:"overview"}:{kind:"unassigned"}}function K1(e,t){return`comprehende.layer.${e}.${t}`}function E3(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==="group"&&"id"in t&&typeof t.id=="string"&&t.id!==""?{kind:"group",id:t.id}:null}catch{return null}}function w3(e){return JSON.stringify(e)}function k3(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?Ep(e):t}function L3(e){return k3(e,A3(e.resolved.baseSha,e.resolved.headSha))}function T3(e,t){R3(e.resolved.baseSha,e.resolved.headSha,t)}function A3(e,t){try{return E3(sessionStorage.getItem(K1(e,t)))}catch{return null}}function R3(e,t,n){try{sessionStorage.setItem(K1(e,t),w3(n))}catch{}}function O3(e){const t=[{kind:"overview"},...e.groups.map(n=>({kind:"group",id:n.id}))];return e.unassigned.hunkCount>0&&t.push({kind:"unassigned"}),t}function hC(e,t,n,r){if(e===null)return;const a=O3(e),s=a.findIndex(d=>X1(d,t)),u=a[(s+r+a.length)%a.length];u!==void 0&&n(u)}function X1(e,t){return t===null?!1:e.kind==="overview"?t.kind==="overview":e.kind==="unassigned"?t.kind==="unassigned":t.kind==="group"&&t.id===e.id}function D3(e,t){return`comprehende.viewed.${e}.${t}`}function M3(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 N3(e){return JSON.stringify([...e].sort())}function I3(e,t,n){const r=new Set(e);return n?r.add(t):r.delete(t),r}function pC(e){try{return Q1(e),M3(sessionStorage.getItem(e))}catch{return new Set}}function z3(e,t){try{Q1(e),sessionStorage.setItem(e,N3(t))}catch{}}function Q1(e){try{localStorage.removeItem(e)}catch{}}function H3(e,t){const n=e!==void 0&&t!==void 0?D3(e,t):null,[r,a]=O.useState(()=>n===null?new Set:pC(n));O.useEffect(()=>{a(n===null?new Set:pC(n))},[n]);const s=O.useCallback((u,d)=>{n!==null&&a(f=>{const h=I3(f,u,d);return z3(n,h),h})},[n]);return{viewedPaths:r,setFileViewed:s}}function P3({className:e,...t}){return A.jsx(NC,{"data-slot":"resizable-panel-group",className:Qe("flex h-full w-full aria-[orientation=vertical]:flex-col",e),...t})}function mC({...e}){return A.jsx(IC,{"data-slot":"resizable-panel",...e})}function U3({withHandle:e=!1,className:t,...n}){return A.jsx(zC,{"data-slot":"resizable-handle",className:Qe("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 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?A.jsx("div",{className:"bg-border z-10 flex h-8 w-3 items-center justify-center rounded-sm border border-border",children:A.jsx(VC,{className:"size-2.5 text-muted-foreground"})}):null})}function j3(){const[e,t]=O.useState(null),[n,r]=O.useState(null),[a,s]=O.useState(null),[u,d]=O.useState([]),[f,h]=O.useState(null),[p,m]=O.useState(null),[y,b]=O.useState(!1),[S,_]=O.useState(!1),[w,x]=O.useState(.5),[E,L]=O.useState(0),[R,D]=O.useState(null),[N,H]=O.useState(!0),U=O.useRef(null),{defaultLayout:W,onLayoutChanged:ee}=uA({id:"comprehende-shell-overlay",panelIds:["stack","main"],onlySaveAfterUserInteractions:!0}),te=O.useCallback(async()=>{H(!0),r(null);try{const re=await pA();t(re),s(ce=>ce??L3(re))}catch(re){r(re instanceof Error?re.message:String(re))}finally{H(!1)}},[]);O.useEffect(()=>{te()},[te]),O.useEffect(()=>{e===null||a===null||T3(e,a)},[e,a]);const V=a?.kind==="group"?a.id:a?.kind==="unassigned"?"unassigned":null;O.useEffect(()=>{if(V===null){d([]),h(null);return}let re=!1;return m(null),mA(V).then(ce=>{re||(d(ce.files),h(V),L(0))}).catch(ce=>{re||(d([]),h(V),m(ce instanceof Error?ce.message:String(ce)))}),()=>{re=!0}},[V]);const Z=V!==null&&V!==f,ie=O.useCallback(re=>{if(X1(re,a)&&R===null)return;xp(()=>{s(re),D(null)},R!==null?"scene":"layer")},[R,a]),se=O.useCallback(re=>{xp(()=>{D({path:re,mode:"file",side:"new"})},"scene")},[]),I=O.useCallback(()=>{R!==null&&xp(()=>D(null),"scene")},[R]),{viewedPaths:G,setFileViewed:X}=H3(e?.resolved.baseSha,e?.resolved.headSha),ue=O.useCallback(re=>{L(re),requestAnimationFrame(()=>{document.querySelector(`[data-hunk="${re}"]`)?.scrollIntoView({block:"nearest"})})},[]);O.useEffect(()=>{const re=ce=>{if(ce.metaKey||ce.ctrlKey||ce.altKey)return;const ke=ce.target;if(!(ke instanceof HTMLElement&&(ke.isContentEditable||ke.closest("input, textarea, select")!==null)))if(ce.key==="w")b(fe=>!fe);else if(ce.key==="s")_(fe=>(fe||x(.5),!fe));else if(ce.key==="r")te();else if(ce.key==="o")ie({kind:"overview"});else if(ce.key==="u")ie({kind:"unassigned"});else if(ce.key==="Escape")I();else if(ce.key==="[")hC(e,a,ie,-1);else if(ce.key==="]")hC(e,a,ie,1);else{if(R!==null)return;if(ce.key==="j"){const fe=ec(u),Fe=_p(fe,E),Ge=fe[Math.min(fe.length-1,Math.max(Fe,0)+1)];Ge!==void 0&&ue(Ge.firstIndex)}else if(ce.key==="k"){const fe=ec(u),Fe=_p(fe,E),Ge=fe[Math.max(0,(Fe===-1?0:Fe)-1)];Ge!==void 0&&ue(Ge.firstIndex)}else if(ce.key==="v"){const fe=ec(u),Fe=fe[Math.max(0,_p(fe,E))];Fe!==void 0&&X(Fe.path,!G.has(Fe.path))}}};return window.addEventListener("keydown",re),()=>window.removeEventListener("keydown",re)},[E,I,R,u,te,e,ue,ie,a,X,G]),O.useEffect(()=>{U.current?.scrollTo({top:0})},[a]);const Y=O.useMemo(()=>e===null||a?.kind!=="group"?null:e.groups.find(re=>re.id===a.id)??null,[e,a]),M=O.useMemo(()=>ec(u),[u]),q=O.useMemo(()=>v3(e?.groups??[]),[e]),oe=O.useMemo(()=>Y1(q),[q]),le=xg(q),de=le&&Y!==null?oe.get(Y.id):void 0;return N&&e===null?A.jsxs(gC,{children:[A.jsx("p",{className:"mb-5 font-serif text-lg leading-none text-foreground",children:"Comprehende"}),A.jsx(Qc,{layout:"page",label:_a.review})]}):n!==null&&e===null?A.jsx(gC,{className:"text-warn",children:n}):e===null?null:A.jsx(qD,{children:A.jsxs("div",{className:"flex h-full min-h-0 flex-col","aria-busy":N||Z,children:[A.jsx(tM,{meta:e,wrap:y,split:S,onWrap:()=>b(re=>!re),onUnified:()=>_(!1),onSplit:()=>{_(!0),S||x(.5)},onRefresh:()=>{te()},busy:N}),A.jsxs(P3,{className:"min-h-0 flex-1",defaultLayout:W,onLayoutChanged:ee,children:[A.jsx(mC,{id:"stack",defaultSize:"20",minSize:"14%",className:"min-h-0 min-w-0",children:A.jsx(_3,{meta:e,selection:a,parts:q,onSelect:ie})}),A.jsx(U3,{withHandle:!0}),A.jsx(mC,{id:"main",defaultSize:"80",minSize:"40%",className:"min-h-0 min-w-0",children:A.jsx("div",{className:"review-scene h-full min-h-0",children:R!==null?A.jsx(X6,{inspector:R,wrap:y,setInspector:D,onClose:I}):A.jsx("main",{ref:U,className:"review-main h-full overflow-auto px-10 py-8","aria-busy":Z,children:a?.kind==="overview"?A.jsx(y3,{meta:e,parts:q,onOpenLayer:re=>ie({kind:"group",id:re})}):A.jsx(g3,{group:Y,groups:e.groups,mixed:le,strandColor:de!==void 0?Cg(de):void 0,loading:Z,hunkError:p,files:Z?[]:M,activeHunk:E,split:S,splitRatio:w,wrap:y,viewedPaths:G,onOpenLayer:re=>ie({kind:"group",id:re}),onOpenFile:se,onSplitRatio:x,onViewed:X})})})})]})]})})}function gC(e){return A.jsx("div",{className:Qe("px-10 py-8 text-muted-foreground",e.className),children:e.children})}const Z1=document.getElementById("root");if(Z1===null)throw new Error("missing #root");OT.createRoot(Z1).render(A.jsx(O.StrictMode,{children:A.jsx(JD,{children:A.jsx(P6,{children:A.jsx(j3,{})})})}));
|