@wes-dev/pr 0.0.1 → 0.0.2

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.
Files changed (80) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +8 -1
  3. package/dist/cli/index.js +57 -53
  4. package/dist/web/assets/{angular-html-Dy5TOb5M.js → angular-html-B5muZzOL.js} +1 -1
  5. package/dist/web/assets/{angular-ts-CQ-VvwG4.js → angular-ts-BNVL9bga.js} +1 -1
  6. package/dist/web/assets/{apl-DLPyOpzA.js → apl-Ba-70I0G.js} +1 -1
  7. package/dist/web/assets/{astro-Bg8eE3kY.js → astro-BOUSDj4v.js} +1 -1
  8. package/dist/web/assets/{blade-kDLtazTS.js → blade-CSo5obC-.js} +1 -1
  9. package/dist/web/assets/{c-LLHuKvL1.js → c-DYYU8xas.js} +1 -1
  10. package/dist/web/assets/{cobol-KB1NrS7u.js → cobol-C9OKkX73.js} +1 -1
  11. package/dist/web/assets/{coffee-BIVXoYBq.js → coffee-0xKLvqsI.js} +1 -1
  12. package/dist/web/assets/{cpp-t-AOohLk.js → cpp-DYVE8zaK.js} +1 -1
  13. package/dist/web/assets/{crystal-Siw7Sgsi.js → crystal-Bv8VoCOd.js} +1 -1
  14. package/dist/web/assets/{css-C4JxYney.js → css-7PZLnWQA.js} +1 -1
  15. package/dist/web/assets/{edge-DWGhPgzT.js → edge-BdU2UXTK.js} +1 -1
  16. package/dist/web/assets/{elixir-CRNPk2CS.js → elixir-CM8mfLuD.js} +1 -1
  17. package/dist/web/assets/{elm-wtHW2ZzC.js → elm-BlMVHBgM.js} +1 -1
  18. package/dist/web/assets/{erb-zY-7xODc.js → erb-vDm0sMMR.js} +1 -1
  19. package/dist/web/assets/{git-rebase-DryBRQqt.js → git-rebase-JZjTkDb3.js} +1 -1
  20. package/dist/web/assets/{glimmer-js-C1lI2oOe.js → glimmer-js-BFo0CPy5.js} +1 -1
  21. package/dist/web/assets/{glimmer-ts-w8P2a6UH.js → glimmer-ts-DAcq7Y_c.js} +1 -1
  22. package/dist/web/assets/{glsl-BOGqvuHx.js → glsl-DhnGzt33.js} +1 -1
  23. package/dist/web/assets/{graphql-CMxvykwD.js → graphql-CEXh_N73.js} +1 -1
  24. package/dist/web/assets/{hack-BTJt-rSc.js → hack-UWFhVRVC.js} +1 -1
  25. package/dist/web/assets/{haml-CpShFG-s.js → haml-DHtICXqF.js} +1 -1
  26. package/dist/web/assets/{handlebars-BsUSmFng.js → handlebars-CCtme0Ck.js} +1 -1
  27. package/dist/web/assets/{html-efT10kNy.js → html-BgUj8HFK.js} +1 -1
  28. package/dist/web/assets/{html-derivative-DslI7lKP.js → html-derivative-BDqxxldY.js} +1 -1
  29. package/dist/web/assets/{http-DGneOSH7.js → http-BRNbuWVo.js} +1 -1
  30. package/dist/web/assets/{hurl-D7wxeizR.js → hurl-DM6YEz2O.js} +1 -1
  31. package/dist/web/assets/index-BtY1CskE.css +1 -0
  32. package/dist/web/assets/{index-CuLPuzv1.js → index-CAv_RdEc.js} +40 -42
  33. package/dist/web/assets/{java-DRV6EAgN.js → java-Du-Dsutn.js} +1 -1
  34. package/dist/web/assets/{javascript-VqTwarqZ.js → javascript-BdZ05Y4l.js} +1 -1
  35. package/dist/web/assets/{jinja-B0K-1eZW.js → jinja-Jckv6-6l.js} +1 -1
  36. package/dist/web/assets/{jison-C6X_CrUT.js → jison-BQFOoWvG.js} +1 -1
  37. package/dist/web/assets/{json-BMTvgpRj.js → json-D0dNduVK.js} +1 -1
  38. package/dist/web/assets/{jsx-BdBaYpud.js → jsx-D7il4Mt6.js} +1 -1
  39. package/dist/web/assets/{julia-eSoxcKep.js → julia-F62Yi6id.js} +1 -1
  40. package/dist/web/assets/{just-BMl4E389.js → just-D7KHnvi5.js} +1 -1
  41. package/dist/web/assets/{latex-vrLDptzo.js → latex-CZxmkjNE.js} +1 -1
  42. package/dist/web/assets/{liquid-DhiVbfmF.js → liquid-Bpa1WZEW.js} +1 -1
  43. package/dist/web/assets/{lua-BZarQnS9.js → lua-jRS_G-7D.js} +1 -1
  44. package/dist/web/assets/{marko-BWPwdtQS.js → marko-tsekaf7E.js} +1 -1
  45. package/dist/web/assets/{mdc-Cx_ikHJA.js → mdc-BlxcKKfr.js} +1 -1
  46. package/dist/web/assets/{nginx-iNlDtGB5.js → nginx-DJu3RFz6.js} +1 -1
  47. package/dist/web/assets/{nim-DGF5L7xM.js → nim-SbVsqvzV.js} +1 -1
  48. package/dist/web/assets/{perl-CFfHYoph.js → perl-ZGwW4ebs.js} +1 -1
  49. package/dist/web/assets/{php-CtPBh1K5.js → php-9NN3eieL.js} +1 -1
  50. package/dist/web/assets/{pug-CxRWcKXx.js → pug-BlT7g5Ne.js} +1 -1
  51. package/dist/web/assets/{qml-CQ8J3wuq.js → qml-C_5EqAo9.js} +1 -1
  52. package/dist/web/assets/{r-CItjESd8.js → r-CZMC2qW_.js} +1 -1
  53. package/dist/web/assets/{razor-BPkkINsq.js → razor-D0g1dB-1.js} +1 -1
  54. package/dist/web/assets/{regexp-DX3MNthO.js → regexp-BNgjJOCE.js} +1 -1
  55. package/dist/web/assets/{rst-ClRAjKbC.js → rst-phuZIdUj.js} +1 -1
  56. package/dist/web/assets/{ruby-CgYgA9Jj.js → ruby-CRc73zUI.js} +1 -1
  57. package/dist/web/assets/{sas-CPmYLbzU.js → sas-BwNzgNew.js} +1 -1
  58. package/dist/web/assets/{scss-Cm-sHo09.js → scss-DwoZqi_J.js} +1 -1
  59. package/dist/web/assets/{shellscript-DmaaF0b7.js → shellscript-tUaVh2-4.js} +1 -1
  60. package/dist/web/assets/{shellsession-CQx7VqyU.js → shellsession-CVBDwkDH.js} +1 -1
  61. package/dist/web/assets/{soy-B_yUNzV2.js → soy-E8dxwmqc.js} +1 -1
  62. package/dist/web/assets/{sql-BJHohXqk.js → sql-DMhkqFze.js} +1 -1
  63. package/dist/web/assets/{stata-UAFrzABU.js → stata-Cv2byDFf.js} +1 -1
  64. package/dist/web/assets/{surrealql-CWvgOHzZ.js → surrealql-DI-zENE_.js} +1 -1
  65. package/dist/web/assets/{svelte-BddkVZXj.js → svelte-TJTH4Mgd.js} +1 -1
  66. package/dist/web/assets/{templ-C84Bu3va.js → templ-COT0AySu.js} +1 -1
  67. package/dist/web/assets/{tex-RrP2i1xH.js → tex-Bd66EYiM.js} +1 -1
  68. package/dist/web/assets/{ts-tags-BRr3h9RL.js → ts-tags-K-IcEfKc.js} +1 -1
  69. package/dist/web/assets/{tsx-CzdrIvPO.js → tsx-BGS9ggj2.js} +1 -1
  70. package/dist/web/assets/{twig-CibPnSwR.js → twig-naFMeh9B.js} +1 -1
  71. package/dist/web/assets/{typescript-CWzslnac.js → typescript-C5djjABa.js} +1 -1
  72. package/dist/web/assets/{vue-C-b1or0S.js → vue-CQ06WBnQ.js} +1 -1
  73. package/dist/web/assets/{vue-html-B7qsQ7no.js → vue-html-DKhLybFP.js} +1 -1
  74. package/dist/web/assets/{vue-vine-dqyrjuMF.js → vue-vine-DL36Bfrd.js} +1 -1
  75. package/dist/web/assets/{xml-CG7JAl4q.js → xml-DSuqdaRn.js} +1 -1
  76. package/dist/web/assets/{xsl-DE3Ct1nt.js → xsl-hJI5_JEr.js} +1 -1
  77. package/dist/web/assets/{yaml-76tnpMFk.js → yaml-BbSaoh0K.js} +1 -1
  78. package/dist/web/index.html +2 -2
  79. package/package.json +1 -1
  80. package/dist/web/assets/index-dvXjNgUr.css +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-Dy5TOb5M.js","assets/html-efT10kNy.js","assets/javascript-VqTwarqZ.js","assets/css-C4JxYney.js","assets/angular-ts-CQ-VvwG4.js","assets/scss-Cm-sHo09.js","assets/apl-DLPyOpzA.js","assets/xml-CG7JAl4q.js","assets/java-DRV6EAgN.js","assets/json-BMTvgpRj.js","assets/astro-Bg8eE3kY.js","assets/typescript-CWzslnac.js","assets/postcss-BXeXVLqQ.js","assets/tsx-CzdrIvPO.js","assets/blade-kDLtazTS.js","assets/html-derivative-DslI7lKP.js","assets/sql-BJHohXqk.js","assets/bsl-BkkzgIyY.js","assets/sdbl-bTVj8UrX.js","assets/cairo-DLTphjLi.js","assets/python-gzcpVVnB.js","assets/cobol-KB1NrS7u.js","assets/coffee-BIVXoYBq.js","assets/cpp-t-AOohLk.js","assets/regexp-DX3MNthO.js","assets/glsl-BOGqvuHx.js","assets/c-LLHuKvL1.js","assets/crystal-Siw7Sgsi.js","assets/shellscript-DmaaF0b7.js","assets/edge-DWGhPgzT.js","assets/elixir-CRNPk2CS.js","assets/elm-wtHW2ZzC.js","assets/erb-zY-7xODc.js","assets/ruby-CgYgA9Jj.js","assets/haml-CpShFG-s.js","assets/graphql-CMxvykwD.js","assets/jsx-BdBaYpud.js","assets/lua-BZarQnS9.js","assets/yaml-76tnpMFk.js","assets/erlang-Cphh6RMH.js","assets/markdown-BYOwaDjH.js","assets/fortran-fixed-form-DEKoE2YW.js","assets/fortran-free-form-CYNrtFtB.js","assets/fsharp-D13ZGOAj.js","assets/gdresource-C0sCabJj.js","assets/gdshader-CBce3t8t.js","assets/gdscript-Cp2uCuqX.js","assets/git-commit-BSykSTBG.js","assets/diff-woXpYk--.js","assets/git-rebase-DryBRQqt.js","assets/glimmer-js-C1lI2oOe.js","assets/glimmer-ts-w8P2a6UH.js","assets/hack-BTJt-rSc.js","assets/handlebars-BsUSmFng.js","assets/http-DGneOSH7.js","assets/hurl-D7wxeizR.js","assets/csv-Dx-8-gkx.js","assets/hxml-B0Qn7Nwc.js","assets/haxe-OTjmBuCE.js","assets/jinja-B0K-1eZW.js","assets/jison-C6X_CrUT.js","assets/julia-eSoxcKep.js","assets/r-CItjESd8.js","assets/just-BMl4E389.js","assets/perl-CFfHYoph.js","assets/latex-vrLDptzo.js","assets/tex-RrP2i1xH.js","assets/liquid-DhiVbfmF.js","assets/marko-BWPwdtQS.js","assets/less-DVTAwKKz.js","assets/mdc-Cx_ikHJA.js","assets/nextflow-BJtWHP5T.js","assets/nextflow-groovy-DJMQeKeT.js","assets/nginx-iNlDtGB5.js","assets/nim-DGF5L7xM.js","assets/php-CtPBh1K5.js","assets/pug-CxRWcKXx.js","assets/qml-CQ8J3wuq.js","assets/razor-BPkkINsq.js","assets/csharp-oqKa8noW.js","assets/rst-ClRAjKbC.js","assets/cmake-Bj61d0ZC.js","assets/sas-CPmYLbzU.js","assets/shaderlab-TOUzSsQk.js","assets/hlsl-Cvrh5tZx.js","assets/shellsession-CQx7VqyU.js","assets/soy-B_yUNzV2.js","assets/sparql-D_iOobhT.js","assets/turtle-ByJddavk.js","assets/stata-UAFrzABU.js","assets/surrealql-CWvgOHzZ.js","assets/svelte-BddkVZXj.js","assets/templ-C84Bu3va.js","assets/go-rLFTqkRN.js","assets/ts-tags-BRr3h9RL.js","assets/twig-CibPnSwR.js","assets/vue-C-b1or0S.js","assets/vue-html-B7qsQ7no.js","assets/vue-vine-dqyrjuMF.js","assets/stylus-B6D30XZt.js","assets/xsl-DE3Ct1nt.js"])))=>i.map(i=>d[i]);
2
- var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var n={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return r(this.context.count)},getNextContextId(){return r(this.context.count++)}};function r(e){let t=String(e),r=t.length-1;return n.context.id+(r?String.fromCharCode(96+r):``)+t}function i(e){n.context=e}function a(){return{...n.context,id:n.getNextContextId(),count:0}}var o=(e,t)=>e===t,s=Symbol(`solid-track`),c={equals:o},l=null,u=le,d=1,f=2,p={owned:null,cleanups:null,context:null,owner:null},m=null,h=null,g=null,_=null,v=null,y=null,b=null,x=0;function S(e,t){let n=v,r=m,i=e.length===0,a=t===void 0?r:t,o=i?p:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>D(()=>me(o)));m=o,v=null;try{return se(s,!0)}finally{v=n,m=r}}function C(e,t){t=t?Object.assign({},c,t):c;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0};return[N.bind(n),e=>(typeof e==`function`&&(e=h&&h.running&&h.sources.has(n)?e(n.tValue):e(n.value)),ne(n,e))]}function w(e,t,n){let r=ae(e,t,!1,d);g&&h&&h.running?y.push(r):re(r)}function T(e,t,n){u=de;let r=ae(e,t,!1,d),i=M&&j(M);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),b?b.push(r):re(r)}function E(e,t,n){n=n?Object.assign({},c,n):c;let r=ae(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,g&&h&&h.running?(r.tState=d,y.push(r)):re(r),N.bind(r)}function D(e){if(!_&&v===null)return e();let t=v;v=null;try{return _?_.untrack(e):e()}finally{v=t}}function ee(e){T(()=>D(e))}function te(e){return m===null||(m.cleanups===null?m.cleanups=[e]:m.cleanups.push(e)),e}function O(e){if(h&&h.running)return e(),h.done;let t=v,n=m;return Promise.resolve().then(()=>{v=t,m=n;let r;return(g||M)&&(r=h||={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0},r.done||=new Promise(e=>r.resolve=e),r.running=!0),se(e,!1),v=m=null,r?r.done:void 0})}var[k,A]=C(!1);function j(e){let t;return m&&m.context&&(t=m.context[e.id])!==void 0?t:e.defaultValue}var M;function N(){let e=h&&h.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===d)re(this);else{let e=y;y=null,se(()=>fe(this),!1),y=e}if(v){let e=this.observers;if(!e||e[e.length-1]!==v){let t=e?e.length:0;v.sources?(v.sources.push(this),v.sourceSlots.push(t)):(v.sources=[this],v.sourceSlots=[t]),e?(e.push(v),this.observerSlots.push(v.sources.length-1)):(this.observers=[v],this.observerSlots=[v.sources.length-1])}}return e&&h.sources.has(this)?this.tValue:this.value}function ne(e,t,n){let r=h&&h.running&&h.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(h){let r=h.running;(r||!n&&h.sources.has(e))&&(h.sources.add(e),e.tValue=t),r||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&se(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t],r=h&&h.running;r&&h.disposed.has(n)||((r?!n.tState:!n.state)&&(n.pure?y.push(n):b.push(n),n.observers&&pe(n)),r?n.tState=d:n.state=d)}if(y.length>1e6)throw y=[],Error()},!1)}return t}function re(e){if(!e.fn)return;me(e);let t=x;ie(e,h&&h.running&&h.sources.has(e)?e.tValue:e.value,t),h&&!h.running&&h.sources.has(e)&&queueMicrotask(()=>{se(()=>{h&&(h.running=!0),v=m=e,ie(e,e.tValue,t),v=m=null},!1)})}function ie(e,t,n){let r,i=m,a=v;v=m=e;try{r=e.fn(t)}catch(t){return e.pure&&(h&&h.running?(e.tState=d,e.tOwned&&e.tOwned.forEach(me),e.tOwned=void 0):(e.state=d,e.owned&&e.owned.forEach(me),e.owned=null)),e.updatedAt=n+1,ve(t)}finally{v=a,m=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&`observers`in e?ne(e,r,!0):h&&h.running&&e.pure?(h.sources.has(e)||(e.value=r),h.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function ae(e,t,n,r=d,i){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:m,context:m?m.context:null,pure:n};if(h&&h.running&&(a.state=0,a.tState=r),m===null||m!==p&&(h&&h.running&&m.pure?m.tOwned?m.tOwned.push(a):m.tOwned=[a]:m.owned?m.owned.push(a):m.owned=[a]),_&&a.fn){let e=a.fn,[t,n]=C(void 0,{equals:!1}),r=_.factory(e,n);te(()=>r.dispose());let i,o=()=>O(n).then(()=>{i&&=(i.dispose(),void 0)});a.fn=n=>(t(),h&&h.running?(i||=_.factory(e,o),i.track(n)):r.track(n))}return a}function oe(e){let t=h&&h.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===f)return fe(e);if(e.suspense&&D(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<x);){if(t&&h.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let t=e,i=n[r+1];for(;(t=t.owner)&&t!==i;)if(h.disposed.has(t))return}if((t?e.tState:e.state)===d)re(e);else if((t?e.tState:e.state)===f){let t=y;y=null,se(()=>fe(e,n[0]),!1),y=t}}}function se(e,t){if(y)return e();let n=!1;t||(y=[]),b?n=!0:b=[],x++;try{let t=e();return ce(n),t}catch(e){n||(b=null),y=null,ve(e)}}function ce(e){if(y&&=(g&&h&&h.running?ue(y):le(y),null),e)return;let t;if(h){if(!h.promises.size&&!h.queue.size){let e=h.sources,n=h.disposed;b.push.apply(b,h.effects),t=h.resolve;for(let e of b)`tState`in e&&(e.state=e.tState),delete e.tState;h=null,se(()=>{for(let e of n)me(e);for(let t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e<n;e++)me(t.owned[e]);t.tOwned&&(t.owned=t.tOwned),delete t.tValue,delete t.tOwned,t.tState=0}A(!1)},!1)}else if(h.running){h.running=!1,h.effects.push.apply(h.effects,b),b=null,A(!0);return}}let n=b;b=null,n.length&&se(()=>u(n),!1),t&&t()}function le(e){for(let t=0;t<e.length;t++)oe(e[t])}function ue(e){for(let t=0;t<e.length;t++){let n=e[t],r=h.queue;r.has(n)||(r.add(n),g(()=>{r.delete(n),se(()=>{h.running=!0,oe(n)},!1),h&&(h.running=!1)}))}}function de(e){let t,r=0;for(t=0;t<e.length;t++){let n=e[t];n.user?e[r++]=n:oe(n)}if(n.context){if(n.count){n.effects||=[],n.effects.push(...e.slice(0,r));return}i()}for(n.effects&&(n.done||!n.count)&&(e=[...n.effects,...e],r+=n.effects.length,delete n.effects),t=0;t<r;t++)oe(e[t])}function fe(e,t){let n=h&&h.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let i=e.sources[r];if(i.sources){let e=n?i.tState:i.state;e===d?i!==t&&(!i.updatedAt||i.updatedAt<x)&&oe(i):e===f&&fe(i,t)}}}function pe(e){let t=h&&h.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=f:r.state=f,r.pure?y.push(r):b.push(r),r.observers&&pe(r))}}function me(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),i=t.observerSlots.pop();n<r.length&&(e.sourceSlots[i]=n,r[n]=e,t.observerSlots[n]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)me(e.tOwned[t]);delete e.tOwned}if(h&&h.running&&e.pure)he(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)me(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}h&&h.running?e.tState=0:e.state=0}function he(e,t){if(t||(e.tState=0,h.disposed.add(e)),e.owned)for(let t=0;t<e.owned.length;t++)he(e.owned[t])}function ge(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function _e(e,t,n){try{for(let n of t)n(e)}catch(e){ve(e,n&&n.owner||null)}}function ve(e,t=m){let n=l&&t&&t.context&&t.context[l],r=ge(e);if(!n)throw r;b?b.push({fn(){_e(r,n,t)},state:d}):_e(r,n,t)}var ye=Symbol(`fallback`);function be(e){for(let t=0;t<e.length;t++)e[t]()}function xe(e,t,n={}){let r=[],i=[],a=[],o=0,c=t.length>1?[]:null;return te(()=>be(a)),()=>{let l=e()||[],u=l.length,d,f;return l[s],D(()=>{let e,t,s,m,h,g,_,v,y;if(u===0)o!==0&&(be(a),a=[],r=[],i=[],o=0,c&&=[]),n.fallback&&(r=[ye],i[0]=S(e=>(a[0]=e,n.fallback())),o=1);else if(o===0){for(i=Array(u),f=0;f<u;f++)r[f]=l[f],i[f]=S(p);o=u}else{for(s=Array(u),m=Array(u),c&&(h=Array(u)),g=0,_=Math.min(o,u);g<_&&r[g]===l[g];g++);for(_=o-1,v=u-1;_>=g&&v>=g&&r[_]===l[v];_--,v--)s[v]=i[_],m[v]=a[_],c&&(h[v]=c[_]);for(e=new Map,t=Array(v+1),f=v;f>=g;f--)y=l[f],d=e.get(y),t[f]=d===void 0?-1:d,e.set(y,f);for(d=g;d<=_;d++)y=r[d],f=e.get(y),f!==void 0&&f!==-1?(s[f]=i[d],m[f]=a[d],c&&(h[f]=c[d]),f=t[f],e.set(y,f)):a[d]();for(f=g;f<u;f++)f in s?(i[f]=s[f],a[f]=m[f],c&&(c[f]=h[f],c[f](f))):i[f]=S(p);i=i.slice(0,o=u),r=l.slice(0)}return i});function p(e){if(a[f]=e,c){let[e,n]=C(f);return c[f]=n,t(l[f],e)}return t(l[f])}}}var Se=!1;function Ce(e,t){if(Se&&n.context){let r=n.context;i(a());let o=D(()=>e(t||{}));return i(r),o}return D(()=>e(t||{}))}var we=e=>`Stale read from <${e}>.`;function Te(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return E(xe(()=>e.each,e.children,t||void 0))}function Ee(e){let t=e.keyed,n=E(()=>e.when,void 0,void 0),r=t?n:E(n,void 0,{equals:(e,t)=>!e==!t});return E(()=>{let i=r();if(i){let a=e.children;return typeof a==`function`&&a.length>0?D(()=>a(t?i:()=>{if(!D(r))throw we(`Show`);return n()})):a}return e.fallback},void 0,void 0)}var De=e=>E(()=>e());function P(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null)if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&!((d=l.get(t[c]))==null||d!==r+u);)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++;else t[o++].remove()}}}var Oe=`_$DX_DELEGATE`;function ke(e,t,n,r={}){let i;return S(r=>{i=r,t===document?e():I(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function F(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},o=t?()=>D(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return o.cloneNode=o,o}function Ae(e,t=window.document){let n=t[Oe]||(t[Oe]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,Fe))}}function je(e,t,n){Pe(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Me(e,t){Pe(e)||(t==null?e.removeAttribute(`class`):e.className=t)}function Ne(e,t,n){return D(()=>e(t,n))}function I(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return Ie(e,t,r,n);w(r=>Ie(e,t(),r,n),r)}function Pe(e){return!!n.context&&!n.done&&(!e||e.isConnected)}function Fe(e){if(n.registry&&n.events&&n.events.find(([t,n])=>n===e))return;let t=e.target,r=`$$${e.type}`,i=e.target,a=e.currentTarget,o=t=>Object.defineProperty(e,"target",{configurable:!0,value:t}),s=()=>{let n=t[r];if(n&&!t.disabled){let i=t[`${r}Data`];if(i===void 0?n.call(t,e):n.call(t,i,e),e.cancelBubble)return}return t.host&&typeof t.host!=`string`&&!t.host._$host&&t.contains(e.target)&&o(t.host),!0},c=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),n.registry&&!n.done&&(n.done=_$HY.done=!0),e.composedPath){let n=e.composedPath();o(n[0]);for(let e=0;e<n.length-2&&(t=n[e],s());e++){if(t._$host){t=t._$host,c();break}if(t.parentNode===a)break}}else c();o(i)}function Ie(e,t,n,r,i){let a=Pe(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=ze(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=ze(e,n,r)}else if(o===`function`)return w(()=>{let i=t();for(;typeof i==`function`;)i=i();n=Ie(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(Le(o,t,n,i))return w(()=>n=Ie(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=ze(e,n,r),s)return n}else c?n.length===0?Re(e,o,r):P(e,n,o):(n&&ze(e),Re(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=ze(e,n,r,t);ze(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function Le(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(!(o==null||o===!0||o===!1))if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=Le(e,o,s)||i;else if(c===`function`)if(r){for(;typeof o==`function`;)o=o();i=Le(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0;else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}return i}function Re(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function ze(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}var Be=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-B5muZzOL.js","assets/html-BgUj8HFK.js","assets/javascript-BdZ05Y4l.js","assets/css-7PZLnWQA.js","assets/angular-ts-BNVL9bga.js","assets/scss-DwoZqi_J.js","assets/apl-Ba-70I0G.js","assets/xml-DSuqdaRn.js","assets/java-Du-Dsutn.js","assets/json-D0dNduVK.js","assets/astro-BOUSDj4v.js","assets/typescript-C5djjABa.js","assets/postcss-BXeXVLqQ.js","assets/tsx-BGS9ggj2.js","assets/blade-CSo5obC-.js","assets/html-derivative-BDqxxldY.js","assets/sql-DMhkqFze.js","assets/bsl-BkkzgIyY.js","assets/sdbl-bTVj8UrX.js","assets/cairo-DLTphjLi.js","assets/python-gzcpVVnB.js","assets/cobol-C9OKkX73.js","assets/coffee-0xKLvqsI.js","assets/cpp-DYVE8zaK.js","assets/regexp-BNgjJOCE.js","assets/glsl-DhnGzt33.js","assets/c-DYYU8xas.js","assets/crystal-Bv8VoCOd.js","assets/shellscript-tUaVh2-4.js","assets/edge-BdU2UXTK.js","assets/elixir-CM8mfLuD.js","assets/elm-BlMVHBgM.js","assets/erb-vDm0sMMR.js","assets/ruby-CRc73zUI.js","assets/haml-DHtICXqF.js","assets/graphql-CEXh_N73.js","assets/jsx-D7il4Mt6.js","assets/lua-jRS_G-7D.js","assets/yaml-BbSaoh0K.js","assets/erlang-Cphh6RMH.js","assets/markdown-BYOwaDjH.js","assets/fortran-fixed-form-DEKoE2YW.js","assets/fortran-free-form-CYNrtFtB.js","assets/fsharp-D13ZGOAj.js","assets/gdresource-C0sCabJj.js","assets/gdshader-CBce3t8t.js","assets/gdscript-Cp2uCuqX.js","assets/git-commit-BSykSTBG.js","assets/diff-woXpYk--.js","assets/git-rebase-JZjTkDb3.js","assets/glimmer-js-BFo0CPy5.js","assets/glimmer-ts-DAcq7Y_c.js","assets/hack-UWFhVRVC.js","assets/handlebars-CCtme0Ck.js","assets/http-BRNbuWVo.js","assets/hurl-DM6YEz2O.js","assets/csv-Dx-8-gkx.js","assets/hxml-B0Qn7Nwc.js","assets/haxe-OTjmBuCE.js","assets/jinja-Jckv6-6l.js","assets/jison-BQFOoWvG.js","assets/julia-F62Yi6id.js","assets/r-CZMC2qW_.js","assets/just-D7KHnvi5.js","assets/perl-ZGwW4ebs.js","assets/latex-CZxmkjNE.js","assets/tex-Bd66EYiM.js","assets/liquid-Bpa1WZEW.js","assets/marko-tsekaf7E.js","assets/less-DVTAwKKz.js","assets/mdc-BlxcKKfr.js","assets/nextflow-BJtWHP5T.js","assets/nextflow-groovy-DJMQeKeT.js","assets/nginx-DJu3RFz6.js","assets/nim-SbVsqvzV.js","assets/php-9NN3eieL.js","assets/pug-BlT7g5Ne.js","assets/qml-C_5EqAo9.js","assets/razor-D0g1dB-1.js","assets/csharp-oqKa8noW.js","assets/rst-phuZIdUj.js","assets/cmake-Bj61d0ZC.js","assets/sas-BwNzgNew.js","assets/shaderlab-TOUzSsQk.js","assets/hlsl-Cvrh5tZx.js","assets/shellsession-CVBDwkDH.js","assets/soy-E8dxwmqc.js","assets/sparql-D_iOobhT.js","assets/turtle-ByJddavk.js","assets/stata-Cv2byDFf.js","assets/surrealql-DI-zENE_.js","assets/svelte-TJTH4Mgd.js","assets/templ-COT0AySu.js","assets/go-rLFTqkRN.js","assets/ts-tags-K-IcEfKc.js","assets/twig-naFMeh9B.js","assets/vue-CQ06WBnQ.js","assets/vue-html-DKhLybFP.js","assets/vue-vine-DL36Bfrd.js","assets/stylus-B6D30XZt.js","assets/xsl-hJI5_JEr.js"])))=>i.map(i=>d[i]);
2
+ var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var n={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return r(this.context.count)},getNextContextId(){return r(this.context.count++)}};function r(e){let t=String(e),r=t.length-1;return n.context.id+(r?String.fromCharCode(96+r):``)+t}function i(e){n.context=e}function a(){return{...n.context,id:n.getNextContextId(),count:0}}var o=(e,t)=>e===t,s=Symbol(`solid-track`),c={equals:o},l=null,u=de,d=1,f=2,p={owned:null,cleanups:null,context:null,owner:null},m=null,h=null,g=null,_=null,v=null,y=null,b=null,x=0;function S(e,t){let n=v,r=m,i=e.length===0,a=t===void 0?r:t,o=i?p:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>D(()=>M(o)));m=o,v=null;try{return j(s,!0)}finally{v=n,m=r}}function C(e,t){t=t?Object.assign({},c,t):c;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0};return[ie.bind(n),e=>(typeof e==`function`&&(e=h&&h.running&&h.sources.has(n)?e(n.tValue):e(n.value)),ae(n,e))]}function w(e,t,n){let r=ce(e,t,!1,d);g&&h&&h.running?y.push(r):oe(r)}function T(e,t,n){u=pe;let r=ce(e,t,!1,d),i=A&&k(A);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),b?b.push(r):oe(r)}function E(e,t,n){n=n?Object.assign({},c,n):c;let r=ce(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,g&&h&&h.running?(r.tState=d,y.push(r)):oe(r),ie.bind(r)}function D(e){if(!_&&v===null)return e();let t=v;v=null;try{return _?_.untrack(e):e()}finally{v=t}}function ee(e){T(()=>D(e))}function te(e){return m===null||(m.cleanups===null?m.cleanups=[e]:m.cleanups.push(e)),e}function ne(e){if(h&&h.running)return e(),h.done;let t=v,n=m;return Promise.resolve().then(()=>{v=t,m=n;let r;return(g||A)&&(r=h||={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0},r.done||=new Promise(e=>r.resolve=e),r.running=!0),j(e,!1),v=m=null,r?r.done:void 0})}var[re,O]=C(!1);function k(e){let t;return m&&m.context&&(t=m.context[e.id])!==void 0?t:e.defaultValue}var A;function ie(){let e=h&&h.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===d)oe(this);else{let e=y;y=null,j(()=>me(this),!1),y=e}if(v){let e=this.observers;if(!e||e[e.length-1]!==v){let t=e?e.length:0;v.sources?(v.sources.push(this),v.sourceSlots.push(t)):(v.sources=[this],v.sourceSlots=[t]),e?(e.push(v),this.observerSlots.push(v.sources.length-1)):(this.observers=[v],this.observerSlots=[v.sources.length-1])}}return e&&h.sources.has(this)?this.tValue:this.value}function ae(e,t,n){let r=h&&h.running&&h.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(h){let r=h.running;(r||!n&&h.sources.has(e))&&(h.sources.add(e),e.tValue=t),r||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&j(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t],r=h&&h.running;r&&h.disposed.has(n)||((r?!n.tState:!n.state)&&(n.pure?y.push(n):b.push(n),n.observers&&he(n)),r?n.tState=d:n.state=d)}if(y.length>1e6)throw y=[],Error()},!1)}return t}function oe(e){if(!e.fn)return;M(e);let t=x;se(e,h&&h.running&&h.sources.has(e)?e.tValue:e.value,t),h&&!h.running&&h.sources.has(e)&&queueMicrotask(()=>{j(()=>{h&&(h.running=!0),v=m=e,se(e,e.tValue,t),v=m=null},!1)})}function se(e,t,n){let r,i=m,a=v;v=m=e;try{r=e.fn(t)}catch(t){return e.pure&&(h&&h.running?(e.tState=d,e.tOwned&&e.tOwned.forEach(M),e.tOwned=void 0):(e.state=d,e.owned&&e.owned.forEach(M),e.owned=null)),e.updatedAt=n+1,ye(t)}finally{v=a,m=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&`observers`in e?ae(e,r,!0):h&&h.running&&e.pure?(h.sources.has(e)||(e.value=r),h.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function ce(e,t,n,r=d,i){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:m,context:m?m.context:null,pure:n};if(h&&h.running&&(a.state=0,a.tState=r),m===null||m!==p&&(h&&h.running&&m.pure?m.tOwned?m.tOwned.push(a):m.tOwned=[a]:m.owned?m.owned.push(a):m.owned=[a]),_&&a.fn){let e=a.fn,[t,n]=C(void 0,{equals:!1}),r=_.factory(e,n);te(()=>r.dispose());let i,o=()=>ne(n).then(()=>{i&&=(i.dispose(),void 0)});a.fn=n=>(t(),h&&h.running?(i||=_.factory(e,o),i.track(n)):r.track(n))}return a}function le(e){let t=h&&h.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===f)return me(e);if(e.suspense&&D(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<x);){if(t&&h.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let t=e,i=n[r+1];for(;(t=t.owner)&&t!==i;)if(h.disposed.has(t))return}if((t?e.tState:e.state)===d)oe(e);else if((t?e.tState:e.state)===f){let t=y;y=null,j(()=>me(e,n[0]),!1),y=t}}}function j(e,t){if(y)return e();let n=!1;t||(y=[]),b?n=!0:b=[],x++;try{let t=e();return ue(n),t}catch(e){n||(b=null),y=null,ye(e)}}function ue(e){if(y&&=(g&&h&&h.running?fe(y):de(y),null),e)return;let t;if(h){if(!h.promises.size&&!h.queue.size){let e=h.sources,n=h.disposed;b.push.apply(b,h.effects),t=h.resolve;for(let e of b)`tState`in e&&(e.state=e.tState),delete e.tState;h=null,j(()=>{for(let e of n)M(e);for(let t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e<n;e++)M(t.owned[e]);t.tOwned&&(t.owned=t.tOwned),delete t.tValue,delete t.tOwned,t.tState=0}O(!1)},!1)}else if(h.running){h.running=!1,h.effects.push.apply(h.effects,b),b=null,O(!0);return}}let n=b;b=null,n.length&&j(()=>u(n),!1),t&&t()}function de(e){for(let t=0;t<e.length;t++)le(e[t])}function fe(e){for(let t=0;t<e.length;t++){let n=e[t],r=h.queue;r.has(n)||(r.add(n),g(()=>{r.delete(n),j(()=>{h.running=!0,le(n)},!1),h&&(h.running=!1)}))}}function pe(e){let t,r=0;for(t=0;t<e.length;t++){let n=e[t];n.user?e[r++]=n:le(n)}if(n.context){if(n.count){n.effects||=[],n.effects.push(...e.slice(0,r));return}i()}for(n.effects&&(n.done||!n.count)&&(e=[...n.effects,...e],r+=n.effects.length,delete n.effects),t=0;t<r;t++)le(e[t])}function me(e,t){let n=h&&h.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let i=e.sources[r];if(i.sources){let e=n?i.tState:i.state;e===d?i!==t&&(!i.updatedAt||i.updatedAt<x)&&le(i):e===f&&me(i,t)}}}function he(e){let t=h&&h.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=f:r.state=f,r.pure?y.push(r):b.push(r),r.observers&&he(r))}}function M(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),i=t.observerSlots.pop();n<r.length&&(e.sourceSlots[i]=n,r[n]=e,t.observerSlots[n]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)M(e.tOwned[t]);delete e.tOwned}if(h&&h.running&&e.pure)ge(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)M(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}h&&h.running?e.tState=0:e.state=0}function ge(e,t){if(t||(e.tState=0,h.disposed.add(e)),e.owned)for(let t=0;t<e.owned.length;t++)ge(e.owned[t])}function _e(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function ve(e,t,n){try{for(let n of t)n(e)}catch(e){ye(e,n&&n.owner||null)}}function ye(e,t=m){let n=l&&t&&t.context&&t.context[l],r=_e(e);if(!n)throw r;b?b.push({fn(){ve(r,n,t)},state:d}):ve(r,n,t)}var be=Symbol(`fallback`);function xe(e){for(let t=0;t<e.length;t++)e[t]()}function Se(e,t,n={}){let r=[],i=[],a=[],o=0,c=t.length>1?[]:null;return te(()=>xe(a)),()=>{let l=e()||[],u=l.length,d,f;return l[s],D(()=>{let e,t,s,m,h,g,_,v,y;if(u===0)o!==0&&(xe(a),a=[],r=[],i=[],o=0,c&&=[]),n.fallback&&(r=[be],i[0]=S(e=>(a[0]=e,n.fallback())),o=1);else if(o===0){for(i=Array(u),f=0;f<u;f++)r[f]=l[f],i[f]=S(p);o=u}else{for(s=Array(u),m=Array(u),c&&(h=Array(u)),g=0,_=Math.min(o,u);g<_&&r[g]===l[g];g++);for(_=o-1,v=u-1;_>=g&&v>=g&&r[_]===l[v];_--,v--)s[v]=i[_],m[v]=a[_],c&&(h[v]=c[_]);for(e=new Map,t=Array(v+1),f=v;f>=g;f--)y=l[f],d=e.get(y),t[f]=d===void 0?-1:d,e.set(y,f);for(d=g;d<=_;d++)y=r[d],f=e.get(y),f!==void 0&&f!==-1?(s[f]=i[d],m[f]=a[d],c&&(h[f]=c[d]),f=t[f],e.set(y,f)):a[d]();for(f=g;f<u;f++)f in s?(i[f]=s[f],a[f]=m[f],c&&(c[f]=h[f],c[f](f))):i[f]=S(p);i=i.slice(0,o=u),r=l.slice(0)}return i});function p(e){if(a[f]=e,c){let[e,n]=C(f);return c[f]=n,t(l[f],e)}return t(l[f])}}}var Ce=!1;function N(e,t){if(Ce&&n.context){let r=n.context;i(a());let o=D(()=>e(t||{}));return i(r),o}return D(()=>e(t||{}))}var we=e=>`Stale read from <${e}>.`;function Te(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return E(Se(()=>e.each,e.children,t||void 0))}function Ee(e){let t=e.keyed,n=E(()=>e.when,void 0,void 0),r=t?n:E(n,void 0,{equals:(e,t)=>!e==!t});return E(()=>{let i=r();if(i){let a=e.children;return typeof a==`function`&&a.length>0?D(()=>a(t?i:()=>{if(!D(r))throw we(`Show`);return n()})):a}return e.fallback},void 0,void 0)}var De=e=>E(()=>e());function P(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null)if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&!((d=l.get(t[c]))==null||d!==r+u);)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++;else t[o++].remove()}}}var Oe=`_$DX_DELEGATE`;function ke(e,t,n,r={}){let i;return S(r=>{i=r,t===document?e():I(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function F(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},o=t?()=>D(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return o.cloneNode=o,o}function Ae(e,t=window.document){let n=t[Oe]||(t[Oe]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,Fe))}}function je(e,t,n){Pe(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Me(e,t){Pe(e)||(t==null?e.removeAttribute(`class`):e.className=t)}function Ne(e,t,n){return D(()=>e(t,n))}function I(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return Ie(e,t,r,n);w(r=>Ie(e,t(),r,n),r)}function Pe(e){return!!n.context&&!n.done&&(!e||e.isConnected)}function Fe(e){if(n.registry&&n.events&&n.events.find(([t,n])=>n===e))return;let t=e.target,r=`$$${e.type}`,i=e.target,a=e.currentTarget,o=t=>Object.defineProperty(e,"target",{configurable:!0,value:t}),s=()=>{let n=t[r];if(n&&!t.disabled){let i=t[`${r}Data`];if(i===void 0?n.call(t,e):n.call(t,i,e),e.cancelBubble)return}return t.host&&typeof t.host!=`string`&&!t.host._$host&&t.contains(e.target)&&o(t.host),!0},c=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),n.registry&&!n.done&&(n.done=_$HY.done=!0),e.composedPath){let n=e.composedPath();o(n[0]);for(let e=0;e<n.length-2&&(t=n[e],s());e++){if(t._$host){t=t._$host,c();break}if(t.parentNode===a)break}}else c();o(i)}function Ie(e,t,n,r,i){let a=Pe(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=ze(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=ze(e,n,r)}else if(o===`function`)return w(()=>{let i=t();for(;typeof i==`function`;)i=i();n=Ie(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(Le(o,t,n,i))return w(()=>n=Ie(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=ze(e,n,r),s)return n}else c?n.length===0?Re(e,o,r):P(e,n,o):(n&&ze(e),Re(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=ze(e,n,r,t);ze(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function Le(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(!(o==null||o===!0||o===!1))if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=Le(e,o,s)||i;else if(c===`function`)if(r){for(;typeof o==`function`;)o=o();i=Le(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0;else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}return i}function Re(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function ze(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}var Be=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
3
3
  <symbol id="file-tree-icon-chevron" viewBox="0 0 16 16">
4
4
  <path d="M12.4697 5.46973C12.7626 5.17684 13.2374 5.17684 13.5303 5.46973C13.8232 5.76262 13.8232 6.23738 13.5303 6.53028L8.53028 11.5303C8.23738 11.8232 7.76262 11.8232 7.46973 11.5303L2.46973 6.53028C2.17684 6.23738 2.17684 5.76262 2.46973 5.46973C2.76262 5.17684 3.23738 5.17684 3.53028 5.46973L8 9.93946L12.4697 5.46973Z" fill="currentcolor"/>
5
5
  </symbol>
@@ -1264,20 +1264,18 @@ var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],en
1264
1264
  }`}function hn(e){return`${pn}
1265
1265
  @layer unsafe {
1266
1266
  ${e}
1267
- }`}var gn=new WeakMap;function _n(e){let t=gn.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(en,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),gn.set(e,i),i}function vn(e,t){if(!e.isConnected)return;let n=_n(t);if(n==null)return;let r=t.querySelector(`style[${tn}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(tn,``),t.appendChild(i)),i.textContent=`:host { ${nn}: ${n}px; }`}var yn;function bn(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){yn??(yn=new CSSStyleSheet,yn.replaceSync(mn(fn)));let t=!1;try{e.adoptedStyleSheets=[yn],t=!0}catch{}if(t){e.querySelector(`style[${Qt}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(Qt,``),t.textContent=mn(fn),e.prepend(t)}}function xn(e,t){Sn(e,t),bn(t),vn(e,t)}function Sn(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});xn(this,e)}}if(customElements.define(Zt,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(Zt)))e instanceof HTMLElement&&xn(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var Cn=5,wn=1<<Cn,Tn=wn*4;function En(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function Dn(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function On(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function kn(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function An(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function jn(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function Mn(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,In(e,t)}function Nn(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=kn(e).get(t);if(i===void 0)return;let a=i>>Cn;e.childVisibleChunkSums[a]+=r}function Pn(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=Ln(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=wn}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function Fn(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>Cn;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<Cn}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function In(e,t){if(t.childIds.length<Tn){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/wn),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>Cn]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function Ln(e,t,n,r){let i=Math.min(t.childIds.length,n+wn),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var Rn=7,zn=3,Bn=1<<zn,Vn=4;function Hn(e,t,n=0){return e<<Vn|n<<zn|t}function Un(e){return e.depthAndFlags>>>Vn}function Wn(e){return(e.depthAndFlags&Bn)>>zn}function z(e){return(e.depthAndFlags&Bn)!==0}function Gn(e){return e.depthAndFlags&Rn}function Kn(e,t){return(Gn(e)&t)!==0}function qn(e,t){e.depthAndFlags|=t}function Jn(e,t){e.depthAndFlags=Hn(t,Gn(e),Wn(e))}var Yn=Symbol(`benchmarkInstrumentation`);function Xn(e,t){return t==null||Object.defineProperty(e,Yn,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function Zn(e){return e==null?null:e[Yn]??null}function B(e,t,n){return e==null?n():e.measurePhase(t,n)}function Qn(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function $n(e){return e>=48&&e<=57}function er(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!$n(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&$n(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function tr(e){let t=e.toLowerCase();return{lowerValue:t,tokens:er(t)}}function nr(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function rr(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=nr(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function ir(e,t,n){let r=rr(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function ar(e,t){return ir(e,t,tr)}function or(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function sr(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=or(e,r);return a===or(t,r)?ar(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function cr(e,t){return sr(e,t)}function lr(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=tr(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=or(e,n);return o===or(t,n)?ir(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function ur(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=tr(r);return e.sortKeyById[t]=i,i}function dr(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function fr(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function pr(e){let{hasTrailingSlash:t,segments:n}=fr(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function mr(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=fr(e);return{requiresDirectory:t,segments:n}}function hr(){let e=new Map;return e.set(``,0),{idByValue:e,valueById:[``],sortKeyById:[tr(``)]}}function gr(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function _r(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var vr=Symbol(`pathStorePreparedInputKind`);function yr(e,t){return e[vr]=t,e}function br(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function xr(e,t,n){return n==="default"?cr(e,t):n(br(e),br(t))}function Sr(){return{depthAndFlags:Hn(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function Cr(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function wr(e){return e.isDirectory?e.segments.length:e.segments.length-1}function Tr(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function Er(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function Dr(e,t={}){return Nr(e,t).map(e=>e.path)}function Or(e,t={}){let n=Nr(e,t);return yr({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function kr(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return yr({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function Ar(e){let t=e,n=t.preparedPaths;if(t[vr]===`prepared`&&n!=null)return n;if(!Tr(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function jr(e){let t=e;return t[vr]===`presorted`&&t.presortedPaths!=null||Er(t.presortedPaths)?t.presortedPaths:null}function Mr(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function Nr(e,t={}){let n=dr(t),r=Zn(t);Qn(r,`workload.inputFiles`,e.length);let i=B(r,`store.preparePathEntries.parse`,()=>e.map(e=>pr(e)));return B(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>xr(e,t,n.sort))),i}var Pr=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[Sr()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=hr();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=Zn(e),this.options=dr(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,En())}appendPaths(e){return B(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>pr(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,B(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return B(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null)if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:Hn(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:Hn(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:Hn(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=pr(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null)if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:Hn(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:Hn(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=pr(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(B(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||B(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort==="default"?lr(this.lastPreparedPath,e,this.segmentSortKeyCache):xr(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=wr(e),i=n==null?0:wr(n),a=n==null?0:Cr(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){!this.createdDirectoriesAllExpanded||this.initialExpandedPathSet==null||(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=gr(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:Hn(Un(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),An(i,s),s}createFileChildUnchecked(e,t){let n=gr(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:Hn(Un(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),An(r,a),a}getOrCreateDirectoryChild(e,t){let n=gr(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!z(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:Hn(Un(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),An(r,a),this.directories.set(a,En()),a}createDirectoryChild(e,t){let n=gr(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:Hn(Un(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),An(r,a),this.directories.set(a,En()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!z(n))throw Error(`Path is not a directory: "${t}"`);if(Kn(n,1))throw Error(`Duplicate path: "${t}"`);qn(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,Dn());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(z(a)){let t=Dn();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;z(n)&&this.directories.set(t,En());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),An(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!z(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return Mn(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function Fr(e,t=`closed`,n=null){let r=Lr(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function Ir(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function Lr(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function Rr(e,t){return Kn(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion===`closed`?!1:Un(t)<=e.defaultExpansion}function zr(e,t,n=e.snapshot.nodes[t]){return n==null||!z(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:Rr(e,n)}function Br(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!z(r))return;let i=Rr(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function Vr(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function Hr(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function Ur(e,t){let n=Vr(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function Wr(e,t){let n=Vr(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function Gr(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function Kr(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function qr(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function Jr(e,t){e.directoryLoadInfoById.delete(t)}function Yr(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function Xr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Zr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function Qr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function $r(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function ei(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function ti(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function ni(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function ri(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function ii(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function ai(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function oi(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function si(e,t,n){return{...n,visibleCountDelta:vi(e)-t}}function ci(e,t){let n=vi(e),r=Ir();e.transactionStack.push(r);try{t()}catch(t){throw di(e,r,!1),t}di(e,r,!0,vi(e)-n)}function li(e,t){let n=e.instrumentation;if(n==null){ui(e,t);return}B(n,`store.events.record`,()=>ui(e,t))}function ui(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){gi(e,t);return}n.events.push(t),hi(n,t)}function di(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?mi(i,t):B(n,`store.events.batch.merge`,()=>mi(i,t));return}let a=fi(t,r),o=e.instrumentation;if(o==null){gi(e,a);return}B(o,`store.events.batch.commit`,()=>gi(e,a))}function fi(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function pi(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function mi(e,t){for(let n of t.events)e.events.push(n);pi(e,t)}function hi(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function gi(e,t){let n=e.instrumentation;if(n==null){_i(e,t);return}B(n,`store.events.emit`,()=>_i(e,t))}function _i(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function vi(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function yi(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!z(n)||Kn(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!z(a)?null:i}function bi(e,t){let n=t;for(;;){let t=yi(e,n);if(t==null)return n;n=t}}function xi(e,t){let n=[t],r=t;for(;;){let t=yi(e,r);if(t==null)return n;n.push(t),r=t}}function Si(e,t){let n=t==null?e.snapshot.rootId:ji(e,t);return n==null?[]:Ni(e,n)}function Ci(e,t){let n=pr(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=Ji(e,qi(e,r)),{createdNodeIds:a,directoryId:o}=Pi(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=U(e,o);if(Kn(n,1))throw Error(`Path already exists: "${t}"`);qn(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=Ii(e,o,n.basename),s.add(c);Oi(e,o);let l=Ji(e,o);return Xr({affectedAncestorIds:Ai(e,c),affectedNodeIds:[...s],path:t,projectionChanged:Yi(i,l)})}function wi(e,t,n){let r=ji(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=U(e,r);if(Kn(i,2))throw Error(`The root node cannot be removed`);if(z(i)&&H(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=Ji(e,a),s=Gi(e,r);zi(e,a,r,i.nameId),Ki(e,a),Oi(e,a);let c=Ji(e,a);return Zr({affectedAncestorIds:Ai(e,a),affectedNodeIds:s,path:t,projectionChanged:Yi(o,c),recursive:n.recursive===!0})}function Ti(e,t,n,r){let i=ji(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=U(e,i);if(Kn(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=Ui(e,i,n),c=Ji(e,a.parentId),l=Ji(e,s.parentId),u=_r(e.snapshot.segmentTable,a.nameId),d=gr(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(z(a)&&$i(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=On(e.snapshot.nodes,H(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&Wi(e,p,o,Wn(a))===`skip`)return null;let m=a.parentId;zi(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),Qi(e,i),Ri(e,s.parentId,i),Ki(e,m),e.pathCacheVersion++,Oi(e,m),s.parentId!==m&&Oi(e,s.parentId);let h=Ji(e,m),g=Ji(e,s.parentId);return Qr({affectedAncestorIds:[...new Set([...Ai(e,m),...Ai(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:Xi([c,l],[h,g]),to:V(e,i)})}function Ei(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function Di(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function V(e,t){let n=U(e,t),r=Ei(e,t);if(r!=null)return r;if(Kn(n,2))return Di(e,t,``);let i=V(e,n.parentId),a=_r(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return Di(e,t,z(n)?`${o}/`:o)}function Oi(e,t){let n=e.instrumentation;if(n==null){ta(e,t);return}B(n,`store.recomputeCountsUpwardFrom`,()=>ta(e,t))}function ki(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!z(o)){ea(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){ea(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function Ai(e,t){let n=[],r=t;for(;r!=null;){let t=U(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function ji(e,t){if(t.length===0)return e.snapshot.rootId;let n=mr(t);return Mi(e,n.segments,n.requiresDirectory)}function Mi(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=H(e,r),a=On(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=U(e,r);return n&&!z(i)?null:r}function H(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function U(e,t){let n=e.snapshot.nodes[t];if(n===void 0||Kn(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function Ni(e,t){let n=e.snapshot.nodes[t];if(n===void 0||Kn(n,4))return[];if(!z(n))return[V(e,t)];if(H(e,t).childIds.length===0)return Kn(n,1)&&!Kn(n,2)?[V(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||Kn(n,4)){i.pop();continue}if(!z(n)){r.push(V(e,t.nodeId)),i.pop();continue}let a=H(e,t.nodeId);if(a.childIds.length===0){Kn(n,1)&&!Kn(n,2)&&r.push(V(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function Pi(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=gr(e.snapshot.segmentTable,i),a=H(e,r),o=On(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!z(U(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=Fi(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function Fi(e,t,n){let r=U(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:Hn(Un(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,En()),Ri(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function Ii(e,t,n){let r=gr(e.snapshot.segmentTable,n),i=H(e,t);if(On(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${ra(e,t,n)}"`);let a=U(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:Hn(Un(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),Ri(e,t,o),e.activeNodeCount++,o}function Li(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}Bi(e,n,o)<0?i=a:r=a+1}return r}function Ri(e,t,n){let r=H(e,t),i=U(e,n);On(e.snapshot.nodes,r).set(i.nameId,n),Nn(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=Li(e,r,n);r.childIds.splice(a,0,n),jn(r,a),In(e.snapshot.nodes,r)}function zi(e,t,n,r){let i=H(e,t),a=kn(i),o=a.get(n)??-1;On(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&Nn(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),jn(i,o),In(e.snapshot.nodes,i))}function Bi(e,t,n){let r=e.snapshot.options.sort;return r==="default"?Vi(e,t,n):r(Hi(e,t),Hi(e,n))}function Vi(e,t,n){let r=U(e,t),i=U(e,n),a=z(r);if(a!==z(i))return a?-1:1;let o=rr(ur(e.snapshot.segmentTable,r.nameId),ur(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=_r(e.snapshot.segmentTable,r.nameId),c=_r(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function Hi(e,t){let n=U(e,t),r=V(e,t),i=z(n),a=i?r.slice(0,-1):r;return{basename:_r(e.snapshot.segmentTable,n.nameId),depth:Un(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function Ui(e,t,n){let r=U(e,t),i=ji(e,n);if(i!=null){let t=U(e,i);if(z(t))return{basename:_r(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=mr(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=mr(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:Mi(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function Wi(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${V(e,t)}"`);let i=U(e,t);if(Wn(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(z(i)&&H(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return Gi(e,t),zi(e,a,t,o),Ki(e,a),Oi(e,a),`handled`}function Gi(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=U(e,t.nodeId);if(t.visitedChildren||!z(i)){z(i)&&e.snapshot.directories.delete(t.nodeId),qn(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),Jr(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=H(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function Ki(e,t){let n=t;for(;n!=null;){let t=U(e,n);if(!z(t)||Kn(t,2)||H(e,n).childIds.length>0)return;qn(t,1),n=t.parentId===n?null:t.parentId}}function qi(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=On(e.snapshot.nodes,H(e,n)).get(t);if(i==null||!z(U(e,i)))break;n=i}return n}function Ji(e,t){let n=Zi(e,t);if(n==null)return null;let r=bi(e,n),i=U(e,r),a=n===r?null:xi(e,n).map(t=>V(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:H(e,r).childIds.length>0,path:V(e,r),terminalKind:Wn(i)})}function Yi(e,t){return Xi([e],[t])}function Xi(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function Zi(e,t){let n=t;for(;n!=null;){let t=U(e,n);if(!z(t)||Kn(t,2))return null;if(!zr(e,n,t))return n;n=t.parentId}return null}function Qi(e,t){let n=U(e,t);if(Jn(n,(t===e.snapshot.rootId?-1:Un(U(e,n.parentId)))+1),!z(n))return;let r=H(e,t);for(let t of r.childIds)Qi(e,t)}function $i(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=U(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function ea(e,t,n=U(e,t),r=!1){let i=e.instrumentation;if(i==null){na(e,t,n,r);return}B(i,`store.recomputeNodeCounts`,()=>na(e,t,n,r))}function ta(e,t){let n=t;for(;n!=null;){let t=U(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(ea(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&Nn(H(e,s),n,a,o),n=s}}function na(e,t,n,r){if(!z(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=H(e,t);if(r){let t=e.instrumentation;t==null?Mn(e.snapshot.nodes,i):B(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>Mn(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,Kn(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=yi(e,t)==null?zr(e,t,n)?1+o:1:o}function ra(e,t,n){let r=V(e,t);return r.length===0?n:`${r}${n}`}function ia(e){return e!=null&&!Kn(e,4)}function aa(e,t){let n=e.snapshot.nodes[t];return!ia(n)||!z(n)||Kn(n,2)?null:n}function oa(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&ia(e.snapshot.nodes[n])&&(t+=1);return t}function sa(e){return Math.max(0,e.valueById.length-1)}function ca(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:oa(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:sa(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function la(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function ua(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)aa(e,n)!=null&&t.push(V(e,n));for(let t of e.expandedDirectoryIds)aa(e,t)!=null&&n.push(V(e,t));return{collapsedPaths:t,expandedPaths:n}}function da(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)aa(e,n)==null||Hr(e,n)===`loaded`||t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:V(e,n)});return t}function fa(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=ji(e,n);t!=null&&Br(e,t,!0,U(e,t))}for(let n of t.collapsedPaths){let t=ji(e,n);t!=null&&Br(e,t,!1,U(e,t))}}function pa(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=ji(e,n.path);t!=null&&aa(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function ma(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function ha(e){let t=e.snapshot.segmentTable,n=hr();for(let r of e.snapshot.nodes)if(ia(r)){if(Kn(r,2)){r.nameId=0;continue}r.nameId=gr(n,_r(t,r.nameId))}e.snapshot.segmentTable=n}function ga(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!ia(r)||!z(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return ia(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[U(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),Mn(e.snapshot.nodes,n)}}function _a(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(ia(n))break;--t}e.snapshot.nodes.length=t+1}function va(e){let t=ua(e),n=da(e);B(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>ma(e)),B(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>ha(e)),B(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>ga(e)),B(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>_a(e)),B(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>fa(e,t)),B(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>pa(e,n)),B(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>ki(e,e.snapshot.rootId))}function ya(e){let t=ua(e),n=da(e),r=B(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>Si(e)),i=Xn({...e.snapshot.options},e.instrumentation),a=B(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new Pr(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,B(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>fa(e,t)),B(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>pa(e,n)),B(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>ki(e,e.snapshot.rootId))}function ba(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function xa(e,t){let n=ca(e);t===`stable`?B(e.instrumentation,`store.cleanup.stable`,()=>va(e)):B(e.instrumentation,`store.cleanup.aggressive`,()=>ya(e));let r=ca(e);return la(t,t===`stable`,n,r)}var Sa=64;function Ca(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function wa(e){return U(e,e.snapshot.rootId).visibleSubtreeCount}function Ta(e,t,n,r){let i=U(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function Ea(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:Ga(e,t.cursor),setSize:t.setSize,subtreeEndIndex:Ta(e,t.cursor,t.index,n)}}function Da(e,t,n,r,i,a){let o=H(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=Pn(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return Oa(e,u,l,r+c,i+1,s,o.childIds.length,a)}function Oa(e,t,n,r,i,a,o,s){if(!z(U(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=za(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=U(e,c.terminalNodeId);if(!z(l)||!zr(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return Da(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function ka(e,t){let n=wa(e);if(t<0||t>=n)return null;let r=Da(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>V(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=Ea(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:Ga(e,r.cursor),setSize:r.setSize,subtreeEndIndex:Ta(e,r.cursor,r.index,n)}}function Aa(e,t,n){let r=e.instrumentation,i=wa(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return Wa(e,o+1);let t=[],n=Ia(e,a);for(let r=a;r<=o&&n!=null;r++){let r=Ga(e,n);t.push(r),n=Va(e,n)}return t}let s=[],c=0,l=0,u=B(r,`store.getVisibleSlice.selectFirstRow`,()=>Ia(e,a));for(let t=a;t<=o&&u!=null;t++){let t=B(r,`store.getVisibleSlice.materializeRow`,()=>Ga(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=B(r,`store.getVisibleSlice.advanceCursor`,()=>Va(e,u))}return Qn(r,`workload.visibleRowsRead`,s.length),Qn(r,`workload.flattenedRowsRead`,c),Qn(r,`workload.flattenedSegmentsRead`,l),s}function ja(e,t=wa(e)){let n=e.instrumentation;return n==null?Ua(e,t):B(n,`store.getVisibleTreeProjection`,()=>Ua(e,t))}function Ma(e){return Ha(ja(e))}function Na(e,t){let n=ji(e,t);if(n==null||n===e.snapshot.rootId||z(U(e,n))&&bi(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=U(e,i).parentId,n=H(e,t),s=kn(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=Fn(a,n,s),t!==o){let n=U(e,t),a=yi(e,t);if(!zr(e,t,n)&&a!==i)return null;bi(e,t)===t&&(r+=1)}i=t}return r}function Pa(e,t){let n=ji(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=U(e,n);if(!z(r))throw Error(`Path is not a directory: "${t}"`);return zr(e,n,r)?null:(Br(e,n,!0,r),Oi(e,n),$r({affectedAncestorIds:Ai(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function Fa(e,t){let n=ji(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=U(e,n);if(!z(r))throw Error(`Path is not a directory: "${t}"`);return zr(e,n,r)?(Br(e,n,!1,r),Oi(e,n),ei({affectedAncestorIds:Ai(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function Ia(e,t){return t<0||t>=wa(e)?null:La(e,e.snapshot.rootId,t,-1)}function La(e,t,n,r){let i=H(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?Pn(e.snapshot.nodes,i,n):B(a,`store.getVisibleSlice.selectChildIndex`,()=>Pn(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return Ra(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function Ra(e,t,n,r){if(!z(U(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=za(e,t,r);if(n===0)return i;let a=U(e,i.terminalNodeId);if(!z(a)||!zr(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return La(e,i.terminalNodeId,n-1,i.visibleDepth)}function za(e,t,n){return z(U(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:bi(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:B(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>bi(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function Ba(e,t){let n=U(e,t);if(!z(n))return!0;let r=n.parentId;return r===e.snapshot.rootId?!0:yi(e,r)!==t}function Va(e,t){let n=U(e,t.terminalNodeId);if(z(n)){let r=H(e,t.terminalNodeId);if(zr(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:Ra(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=U(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=H(e,n),o=kn(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return Ra(e,s,0,i);Ba(e,r)&&i--,r=n}}function Ha(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function Ua(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(Sa);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=Ca(o,y);let x,S=_;if(z(v))S=f?bi(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:V(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&z(C)&&zr(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function Wa(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!z(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:V(e,f)};continue}let h=l?bi(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=Ga(e,g);let _=i[h];_!=null&&z(_)&&zr(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function Ga(e,t){let n=U(e,t.terminalNodeId),r=z(n)?Ka(e,t):null,i=V(e,t.terminalNodeId),a=_r(e.snapshot.segmentTable,n.nameId),o=z(n)&&H(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?xi(e,t.headNodeId).map(n=>{let r=U(e,n);return{isTerminal:n===t.terminalNodeId,name:_r(e.snapshot.segmentTable,r.nameId),nodeId:n,path:V(e,n)}}):B(c,`store.getVisibleSlice.flatten.collectSegments`,()=>xi(e,t.headNodeId).map(n=>{let r=U(e,n);return{isTerminal:n===t.terminalNodeId,name:_r(e.snapshot.segmentTable,r.nameId),nodeId:n,path:V(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:z(n)&&zr(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:z(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function Ka(e,t){if(t.headNodeId===t.terminalNodeId)return Hr(e,t.terminalNodeId);let n=xi(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=Hr(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}function qa(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!z(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&In(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&z(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,In(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function Ja(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var Ya=class e{#e;constructor(e={}){let t=Zn(e),n=B(t,`store.builder.create`,()=>new Pr(e));if(e.preparedInput!=null){let t=jr(e.preparedInput);t==null?n.appendPreparedPaths(Ar(e.preparedInput),!1):n.appendPresortedPaths(t,Mr(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(B(t,`store.preparePathEntries`,()=>Nr(r,e)))}let r=B(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=B(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=B(t,`store.state.create`,()=>Fr(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:B(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||Ja(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&B(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?B(t,`store.state.initializeOpenVisibleCounts`,()=>qa(this.#e)):B(t,`store.state.recomputeCounts`,()=>ki(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return Dr(e,t)}static prepareInput(e,t={}){return Or(e,t)}static preparePresortedInput(e){return kr(e)}list(e){return B(this.#e.instrumentation,`store.list`,()=>Si(this.#e,e))}add(e){B(this.#e.instrumentation,`store.add`,()=>{let t=wa(this.#e);li(this.#e,si(this.#e,t,Ci(this.#e,e)))})}remove(e,t={}){B(this.#e.instrumentation,`store.remove`,()=>{let n=wa(this.#e);li(this.#e,si(this.#e,n,wi(this.#e,e,t)))})}move(e,t,n={}){B(this.#e.instrumentation,`store.move`,()=>{let r=wa(this.#e),i=Ti(this.#e,e,t,n);i!=null&&li(this.#e,si(this.#e,r,i))})}batch(e){ci(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision});break}})}getVisibleCount(){return B(this.#e.instrumentation,`store.getVisibleCount`,()=>wa(this.#e))}getVisibleSlice(e,t){return B(this.#e.instrumentation,`store.getVisibleSlice`,()=>Aa(this.#e,e,t))}getVisibleRowContext(e){return B(this.#e.instrumentation,`store.getVisibleRowContext`,()=>ka(this.#e,e))}getVisibleTreeProjection(){return Ma(this.#e)}getVisibleTreeProjectionData(e){return ja(this.#e,e)}getVisibleIndex(e){return B(this.#e.instrumentation,`store.getVisibleIndex`,()=>Na(this.#e,e))}getPathInfo(e){return B(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=ji(this.#e,e);if(t==null)return null;let n=U(this.#e,t);return{depth:Un(n),kind:z(n)?`directory`:`file`,path:V(this.#e,t)}})}isExpanded(e){return B(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=U(this.#e,t);return zr(this.#e,t,n)})}expand(e){B(this.#e.instrumentation,`store.expand`,()=>{let t=wa(this.#e),n=Pa(this.#e,e);n!=null&&li(this.#e,si(this.#e,t,n))})}collapse(e){B(this.#e.instrumentation,`store.collapse`,()=>{let t=wa(this.#e),n=Fa(this.#e,e);n!=null&&li(this.#e,si(this.#e,t,n))})}on(e,t){return Yr(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return Hr(this.#e,t)}markDirectoryUnloaded(e){B(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(H(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=wa(this.#e);Wr(this.#e,t),li(this.#e,si(this.#e,n,ti({affectedAncestorIds:Ai(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return B(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=wa(this.#e),r=Ur(this.#e,t);return li(this.#e,si(this.#e,n,ni({affectedAncestorIds:Ai(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return B(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||Hr(this.#e,n)!==`loading`||!Kr(this.#e,n,e.attemptId))return!1;let r=V(this.#e,n);this.validateChildPatch(r,t);let i=wa(this.#e),a=[];for(let e of t.operations){Xa(r,e);let t=wa(this.#e);switch(e.type){case`add`:a.push(si(this.#e,t,Ci(this.#e,e.path)));break;case`remove`:a.push(si(this.#e,t,wi(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=Ti(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(si(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return li(this.#e,si(this.#e,i,ri({affectedAncestorIds:Ai(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:V(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return B(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=wa(this.#e),r=Gr(this.#e,t,e.attemptId);return li(this.#e,si(this.#e,n,ii({affectedAncestorIds:Ai(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:V(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return B(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=wa(this.#e),i=qr(this.#e,n,e.attemptId,t);return li(this.#e,si(this.#e,r,ai({affectedAncestorIds:Ai(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:V(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return B(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(ba(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=wa(this.#e),n=xa(this.#e,e.mode??`stable`);return li(this.#e,si(this.#e,t,oi({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=H(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??tr(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=rr(ur(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!z(U(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=U(this.#e,n);zr(this.#e,n,i)||(Br(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=U(this.#e,e);if(!zr(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=ji(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!z(U(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!z(U(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=U(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=U(this.#e,e),r=yi(this.#e,e);if(!zr(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function Xa(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`);break}}var Za=e=>e.startsWith(`f::`)?e.slice(3):e;function Qa(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function $a(e,t){return e===``?t:`${e}/${t}`}function eo({files:e,path:t,isFolder:n,nextBasename:r}){let i=Za(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=Qa(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=$a(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function to(e){return e.endsWith(`/`)}function no(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function ro(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function io(e,t){return t.includes(e)?ro(t):[e]}function ao(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function oo(e,t){return{draggedPaths:e,target:t}}function so(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(to(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function co(e,t){return t.kind===`root`||t.directoryPath==null?no(e):t.directoryPath}function lo(e,t){let n=e.map(e=>{let n=co(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function uo(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function fo(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!uo(Ya.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function po(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function mo(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function ho(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function go(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return ho(e,t.path)?n?e:null:e;case`move`:return mo(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=go(r,e,n),r==null)return null;return r}}}function _o(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function vo(e){switch(e.operation){case`add`:return{..._o(e),operation:`add`,path:e.path};case`remove`:return{..._o(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{..._o(e),from:e.from,operation:`move`,to:e.to}}}function yo(e){return{..._o(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>vo(e)),operation:`batch`}}function bo(e){switch(e.operation){case`add`:case`remove`:case`move`:return vo(e);case`batch`:return yo(e);default:return null}}function xo(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function So(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function Co(e){return So(e).at(-1)??null}function wo(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function To(e){return e.endsWith(`/`)}var Eo=e=>e.toLowerCase();function Do(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function Oo(e){return e.endsWith(`/`)?e.slice(0,-1):e}function ko(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var Ao=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},jo=Symbol(`FILE_TREE_RENAME_VIEW`),Mo=512,No=512;function Po(e){return e===`top`||e===`center`?e:`nearest`}function Fo(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=So(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function Io(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:Fo(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var Lo=class e{static{Object.defineProperty(e.prototype,jo,{configurable:!0,value(){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}},writable:!0})}#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=fo({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=Co(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:Po(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=No){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t==null||!this.#B.has(t)||this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.#ae([...this.#B].filter(e=>e!==t),t);return}this.#ae([...this.#B,t],t)}}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=io(t,n);return this.#r.canDrag?.(r)===!1?!1:(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=oo(t.draggedPaths,n);(so(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}ao(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=oo(e.draggedPaths,t);if(so(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=lo(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=To(r),a=Oo(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of So(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=Do(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,To(e)?{recursive:!0}:void 0);return}this.#Pe(e),this.#De()}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,To(e)?{recursive:!0}:void 0);return}let t=To(e),n=eo({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:Oo(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#Pe(e),this.#v?.(n.error),this.#De();return}if(n.sourcePath===n.destinationPath){this.#Pe(e),this.#De();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(ko(n.sourcePath,t),ko(n.destinationPath,t))}#Y(e){this.#T==null||this.#E===e||(this.#E=e,this.#De())}resetPaths(e,t={}){let n=!Array.isArray(e),r=n?void 0:e,i=n?e:t,a=this.#H.list().length,o=this.#G,s=fo({paths:r,preparedInput:i.preparedInput},`resetPaths`,this.#e.sort),c=this.#le(s.paths,s.preparedInput,i.initialExpandedPaths),l=this.#c,u=this.#T,d=this.getSelectedPaths(),f=this.#z;this.#K?.(),this.#H=c,this.#d.clear(),this.#he();let p=d.map(e=>c.getPathInfo(e)?.path??null).filter(e=>e!=null),m=!xo(this.#B,p);this.#B=new Set(p),m&&(this.#V+=1),this.#z=f==null?null:c.getPathInfo(f)?.path??null,this.#T=u==null?null:c.getPathInfo(u)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(l,l!=null||p.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:s.paths.length,pathCountBefore:a,projectionChanged:!0,usedPreparedInput:i.preparedInput!=null,visibleCountDelta:this.#G-o})}#X(e){this.#Ie();let t=Co(e),n=wo(e,t),r=null,i=null;for(let e of this.#be()){if(Co(e)!==t)continue;let a=wo(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=So(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!xo(this.#B,r),a=this.#z!==t;!i&&!a||(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new Ya({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of So(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(Eo),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(Eo),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of So(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:Ao(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of So(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of So(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=Io(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,Mo)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s===e&&this.#c===n||(this.#s=e,this.#c=n,t&&this.#De()))}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=go(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=go(this.#c,e,!0),r=[...this.#B].map(t=>go(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=go(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return xo(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&po(e)&&(this.#i=null);let t=po(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=bo(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},Ro=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function zo(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(!(e[t]===`/`||t===e.length)){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function Bo(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=[],r=0;for(;;){let e=t.indexOf(`/`,r);if(e===-1)break;n.push(t.slice(0,e+1)),r=e+1}return n}function Vo(e,t){return t?`${e}/`:e}function Ho(e,t=null){let n=Ro(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set,o=new Map;for(let t of e??[]){let e=Wo(t);e!=null&&qo({canonicalPath:e.canonicalPath,changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,isDirectory:e.isDirectory,status:t.status,statusByPath:r})}return r.size===0?null:{changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}function Uo(e,t){let n=t?.remove??[],r=t?.set??[];if(n.length===0&&r.length===0)return e;let i=new Map(e?.statusByPath),a=new Set(e?.directoriesWithChanges),o=new Set(e?.ignoredDirectoryPaths),s=new Map(e?.changeCountByDirectoryPath),c=!1;for(let e of n){let t=Go(e);t!=null&&(c=Ko({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,statusByPath:i})||c)}for(let e of r){let t=Wo(e);t!=null&&(c=qo({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,isDirectory:t.isDirectory,status:e.status,statusByPath:i})||c)}return c?i.size===0?null:{changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,signature:Xo(i),statusByPath:i}:e}function Wo(e){return Go(e.path)}function Go(e){let t=zo(e);if(t!=null)return{canonicalPath:Vo(t.path,t.isDirectory),isDirectory:t.isDirectory}}function Ko({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,statusByPath:i}){let a=i.get(e);return a==null?!1:(i.delete(e),a===`ignored`&&e.endsWith(`/`)&&r.delete(e),Yo(t,n,e),!0)}function qo({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,isDirectory:i,status:a,statusByPath:o}){let s=o.get(e);return s===a?!1:(s??Jo(t,n,e),o.set(e,a),a===`ignored`&&i?r.add(e):i&&r.delete(e),!0)}function Jo(e,t,n){for(let r of Bo(n))e.set(r,(e.get(r)??0)+1),t.add(r)}function Yo(e,t,n){for(let r of Bo(n)){let n=(e.get(r)??0)-1;n>0?e.set(r,n):(e.delete(r),t.delete(r))}}function Xo(e){let t=`${e.size}`;for(let[n,r]of e)t+=`\0${n}\0${r}`;return t}var Zo=e=>e.trim().toLowerCase(),Qo=e=>e.split(`/`).at(-1)??e,$o=e=>{let t=e.toLowerCase().split(`.`),n=[];for(let e=1;e<t.length;e+=1)n.push(t.slice(e).join(`.`));return n};function es(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function ts(e){let t=cn(e),n=t.remap,r=new Map;for(let[e,n]of Object.entries(t.byFileName??{}))r.set(e.toLowerCase(),n);let i=new Map;for(let[e,n]of Object.entries(t.byFileExtension??{}))i.set(Zo(e),n);let a=Object.entries(t.byFileNameContains??{}).map(([e,t])=>[e.toLowerCase(),t]);return{resolveIcon:(e,o)=>{if(e===`file-tree-icon-file`&&o!=null){let s=Qo(o),c=s.toLowerCase(),l=r.get(c);if(l!=null)return es(l,e);for(let[t,n]of a)if(c.includes(t))return es(n,e);let u=$o(s);for(let t of u){let n=i.get(t);if(n!=null)return es(n,e)}let d=Xt(t.set,s,u);if(d!=null&&t.set!==`none`){if(d==="default"){let t=n?.[e];if(t!=null)return es(t,e)}return{name:Jt(d),remappedFrom:e,token:d}}}let s=n?.[e];return s==null?{name:e}:es(s,e)}}}var W,ns,rs,is,as,os,ss,cs,ls,us,ds={},fs=[],ps=Array.isArray,ms=fs.slice,hs=Object.assign;function gs(e){e&&e.parentNode&&e.remove()}function _s(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?ms.call(arguments,2):n),vs(e,o,r,i,null)}function vs(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++ns,__i:-1,__u:0};return i==null&&W.vnode!=null&&W.vnode(a),a}function ys(e){return e.children}function bs(e,t){this.props=e,this.context=t,this.__g=0}function xs(e,t){if(t==null)return e.__?xs(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?xs(e):null}function Ss(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return Ss(e)}}function Cs(e){(8&e.__g||!(e.__g|=8)||!rs.push(e)||as++)&&is==W.debounceRendering||((is=W.debounceRendering)||queueMicrotask)(ws)}function ws(){for(var e,t,n,r,i,a,o,s,c=1;rs.length;)rs.length>c&&rs.sort(os),e=rs.shift(),c=rs.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=hs({},r)).__v=r.__v+1,W.vnode&&W.vnode(n),Ms(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??xs(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,Ps(a,n,o),n.__e!=i&&Ss(n)));as=0}function Ts(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||fs,b=t.length;for(c=Es(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?ds:y[m.__i]||ds,m.__i=f,_=Ms(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&Ls(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=Ds(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function Es(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?vs(null,o,null,null,null):ps(o)?vs(ys,{children:o},null,null,null):o.constructor==null&&o.__b>0?vs(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=Os(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=xs(s)),Rs(s,s));return r}function Ds(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=Ds(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=xs(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Os(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function ks(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function As(e,t,n,r,i){var a;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||ks(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||ks(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(ss,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=cs,e.addEventListener(t,a?us:ls,a)):e.removeEventListener(t,a?us:ls,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function js(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=cs++;else if(t.u<n.l)return;return n(W.event?W.event(t):t)}}}function Ms(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,ee,te,O,k,A=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=W.__b)&&d(t);n:if(typeof A==`function`)try{if(v=t.props,y=`prototype`in A&&A.prototype.render,b=(d=A.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new A(v,x):(t.__c=f=new bs(v,x),f.constructor=A,f.render=zs),b&&b.sub(f),f.props=v,f.state||={},f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&A.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=hs({},f.__s)),hs(f.__s,A.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&A.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&A.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=W.__r,w=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),T=0;T<f._sb.length;T++)f.__h.push(f._sb[T]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++w<25);f.state=f.__s,f.getChildContext!=null&&(r=hs({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===ys&&d.key==null&&(E=Fs(d.props.children)),s=Ts(e,ps(E)?E:[E],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(D=0,ee=!1,t.__u|=c?160:128,t.__c.__z=[],te=0;te<a.length;te++)(O=a[te])==null||ee||(O.nodeType==8&&O.data==`$s`?(D>0&&t.__c.__z.push(O),D++,a[te]=null):O.nodeType==8&&O.data==`/$s`?(--D>0&&t.__c.__z.push(O),ee=D===0,s=a[te],a[te]=null):D>0&&(t.__c.__z.push(O),a[te]=null));if(!ee){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(k=a.length;k--;)gs(a[k]);Ns(t)}else t.__e=n.__e,t.__k=n.__k,e.then||Ns(t);W.__e(e,t,n)}else s=t.__e=Is(n.__e,t,n,r,i,a,o,c,l,u);return(d=W.diffed)&&d(t),128&t.__u?void 0:s}function Ns(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(Ns)}function Ps(e,t,n){for(var r=0;r<n.length;r++)Ls(n[r],n[++r],n[++r]);W.__c&&W.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){W.__e(e,t.__v)}})}function Fs(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:ps(e)?e.map(Fs):hs({},e)}function Is(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(W.__m&&W.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=ms.call(e.childNodes),v=n.props||ds,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;As(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||As(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),Ts(b==`template`?e.content:e,ps(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&xs(n,0),s,c,l),a!=null)for(u=a.length;u--;)gs(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||As(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&As(e,u,g,v[u],i))}return e}function Ls(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){W.__e(e,n)}}function Rs(e,t,n){var r,i;if(W.unmount&&W.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Ls(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){W.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Rs(r[i],t,n||typeof e.type!=`function`);n||gs(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function zs(e,t,n){return this.constructor(e,n)}function Bs(e,t){var n,r,i,a;t==document&&(t=document.documentElement),W.__&&W.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=_s(ys,null,[e]),i=[],a=[],Ms(t,e,r||ds,ds,t.namespaceURI,r?null:t.firstChild?ms.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),Ps(i,e,a)}function Vs(e,t){e.__u|=32,Bs(e,t)}W={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw as=0,e}},ns=0,bs.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=hs({},this.state);typeof e==`function`&&(e=e(hs({},n),this.props)),e&&hs(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Cs(this))},bs.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),Cs(this))},bs.prototype.render=ys,rs=[],as=0,os=function(e,t){return e.__v.__b-t.__v.__b},ss=/(PointerCapture)$|Capture$/i,cs=0,ls=js(!1),us=js(!0);var Hs=0;Array.isArray;function G(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Hs,__i:-1,__u:0,__source:i,__self:a};return W.vnode&&W.vnode(l),l}var Us=16,Ws=16,Gs={};function Ks({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=Gs[e]??{width:Us,height:Ws},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return G(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`},viewBox:m,width:f,height:p,children:G(`use`,{href:c})})}var qs=e=>e!==void 0&&/\s/.test(e),Js=(e,t)=>{let n=t=>qs(e[t-1])||qs(e[t]);if(!n(t))return t;for(let r=1;r<e.length;r++){let i=t-r;if(i>0&&!n(i))return i;let a=t+r;if(a<e.length&&!n(a))return a}return t},Ys=e=>Js(e,Math.ceil(e.length/2)),Xs=e=>{if(e.length<2)return[e,``];let t=Ys(e);return[e.slice(0,t),e.slice(t)]},Zs=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:Ys(e);return[e.slice(0,r),e.slice(r)]},Qs=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},$s=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},ec=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},tc=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function nc({children:e,marker:t,variant:n=`default`}){"use no memo";return G(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:G(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?G(`span`,{"data-truncate-fade":!0}):t})})}function rc(e){"use no memo";let{mode:t,children:n}=e;return G(`div`,{children:[G(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?G(`span`,{children:n}):n}),G(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?G(`span`,{children:n}):n})]})}function ic({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=G(rc,{mode:t,children:e},`content`),o=G(nc,{marker:n,mode:t,variant:r},`marker`),s=G(`div`,{"data-truncate-fill":!0},`fill`);return G(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:G(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function ac({children:e,...t}){"use no memo";return G(ic,{mode:`truncate`,...t,children:e})}function oc({children:e,...t}){"use no memo";return G(ic,{mode:`fruncate`,...t,children:e})}function sc({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=G(ac,{...s,children:t[0]}),l=G(oc,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return G(`div`,{className:a,style:o});if(e.length<i)return G(n===`end`?oc:ac,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=Xs:r===`extension`?t=Zs:r===`leaf-path`&&(t=Qs);else if(typeof r==`number`)t=$s,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=ec:e===`first`&&(t=tc)}else typeof r==`function`&&(t=r);t??=Xs;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=G(ac,{...s,..._,children:f}),l=G(oc,{...s,...v,children:p})}return G(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[G(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),G(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var cc={endIndex:-1,startIndex:-1};function lc(e,t,n){return Math.min(Math.max(e,t),n)}function uc(e,t){return e<0||t<e?cc:{endIndex:t,startIndex:e}}function dc(e){return e.startIndex<0||e.endIndex<e.startIndex}function fc(e,t){return dc(e)?0:(e.endIndex-e.startIndex+1)*t}function pc(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function mc(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function hc(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function gc(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function _c(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function vc(e,t,n){if(e.length===0||t<=0)return[];let r=_c(e),i=hc(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=gc(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function yc(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=lc(t.scrollTop,0,o),c=t.stickyRows??vc(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=pc(s,n,t.itemHeight),m=pc(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?cc:uc(m,mc(u+d,n,t.itemHeight)),y=g+1,b=dc(v)?cc:uc(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=fc(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:dc(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var bc={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},xc={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},Sc=`Contains git status items`;function Cc(e){return e.current?!0:(e.current=!0,!1)}function wc(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function Tc(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return wc({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function Ec(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function Dc(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function Oc(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function kc(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function Ac(e,t){return e!=null&&e>0?e:t}function jc(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function Mc(e,t,n,r,i=0){let a=wc({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a==null?!1:(e.scrollTop=a,!0)}function Nc(e,t,n,r,i,a,o=0){let s=Tc({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s==null?!1:(e.scrollTop=s,!0)}function Pc(e,t,n,r,i,a){let o=Ec({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o==null?!1:(e.scrollTop=o,!0)}function Fc(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function Ic(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function Lc({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return G(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function Rc(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function zc(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var Bc,Vc,Hc,Uc,Wc=Object.is,Gc=0,Kc=[],qc=W,Jc=qc.__b,Yc=qc.__r,Xc=qc.diffed,Zc=qc.__c,Qc=qc.unmount,$c=qc.__;function el(e,t){qc.__h&&qc.__h(Vc,e,Gc||t),Gc=0;var n=Vc.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function tl(e){return Gc=1,nl(pl,e)}function nl(e,t,n){var r=el(Bc++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):pl(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);Wc(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Vc,!Vc.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,Wc(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};Vc.__f=!0;var a=Vc.shouldComponentUpdate,o=Vc.componentWillUpdate;Vc.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},Vc.shouldComponentUpdate=i}return r.__N||r.__}function rl(e,t){var n=el(Bc++,3);!qc.__s&&fl(n.__H,t)&&(n.__=e,n.u=t,Vc.__H.__h.push(n))}function il(e,t){var n=el(Bc++,4);!qc.__s&&fl(n.__H,t)&&(n.__=e,n.u=t,Vc.__h.push(n))}function K(e){return Gc=5,al(function(){return{current:e}},[])}function al(e,t){var n=el(Bc++,7);return fl(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ol(e,t){return Gc=8,al(function(){return e},t)}function sl(){for(var e;e=Kc.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ul),e.__H.__h.forEach(dl),e.__H.__h=[]}catch(t){e.__H.__h=[],qc.__e(t,e.__v)}}qc.__b=function(e){Vc=null,Jc&&Jc(e)},qc.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),$c&&$c(e,t)},qc.__r=function(e){Yc&&Yc(e),Bc=0;var t=(Vc=e.__c).__H;t&&(Hc===Vc?(t.__h=[],Vc.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(ul),t.__h.forEach(dl),t.__h=[],Bc=0)),Hc=Vc},qc.diffed=function(e){Xc&&Xc(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Kc.push(t)!==1&&Uc===qc.requestAnimationFrame||((Uc=qc.requestAnimationFrame)||ll)(sl)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),Hc=Vc=null},qc.__c=function(e,t){t.some(function(e){try{e.__h.forEach(ul),e.__h=e.__h.filter(function(e){return!e.__||dl(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],qc.__e(n,e.__v)}}),Zc&&Zc(e,t)},qc.unmount=function(e){Qc&&Qc(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{ul(e)}catch(e){t=e}}),n.__H=void 0,t&&qc.__e(t,n.__v))};var cl=typeof requestAnimationFrame==`function`;function ll(e){var t,n=function(){clearTimeout(r),cl&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);cl&&(t=requestAnimationFrame(n))}function ul(e){var t=Vc,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),Vc=t}function dl(e){var t=Vc;e.__c=e.__(),Vc=t}function fl(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!Wc(t,e[n])})}function pl(e,t){return typeof t==`function`?t(e):t}function ml(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:G(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return G(ys,{children:[G(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:G(ac,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function hl(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function gl(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function _l(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function vl({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=yc(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:_l(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?_l(u,1,t,o):i&&r<=0&&c.length>0?vc(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var yl=400,bl=10,xl=40,Sl=18;function Cl(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?wl(e,t,n):a instanceof HTMLElement?a:null}function wl(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function Tl(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function El(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function Dl(){return navigator.vendor!==`Apple Computer, Inc.`}function Ol(e,t){let n=e-t.top;if(n<xl)return-Math.ceil((xl-Math.max(0,n))/xl*Sl);let r=t.bottom-e;return r<xl?Math.ceil((xl-Math.max(0,r))/xl*Sl):0}function kl(e,t){if(e!=null){let t=bc[e];return t==null?null:{text:t,title:xc[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:Sc}:null}function Al(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function jl(e){return e!=null&&`toggle`in e}function Ml(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function Nl(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function Pl(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function Fl(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function Il(e,t){return t&&Fl(e)||(e.ctrlKey||e.metaKey)&&Ml(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var Ll=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function Rl(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function zl(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function Bl(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function Vl(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function Hl(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function Ul(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function Wl(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function Gl(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function Kl(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=Gl(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function ql(e,t){return{kind:e.kind,name:gl(e),path:t}}function Jl(e){return e==null?void 0:`${e}__tree`}function Yl(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function Xl(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function Zl(e,t){if(e==null)return null;if(`text`in e)return G(`span`,{title:e.title,children:e.text});let n=typeof e.icon==`string`?Xl(e.icon)?t(e.icon):{name:e.icon}:Xl(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return G(`span`,{title:e.title,children:G(Ks,{...n})})}function Ql(e){e!=null&&Dc(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function $l(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=hl(e);return G(ys,{children:[e.depth>0?G(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>G(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,G(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?G(Ks,{...t(`file-tree-icon-chevron`)}):G(Ks,{...t(`file-tree-icon-file`,u)})}),G(`div`,{"data-item-section":`content`,children:e.isFlattened?ml(e,c,a):c??G(sc,{minimumLength:5,split:`extension`,children:e.name})}),i?G(`div`,{"data-item-section":`decoration`,children:r==null?null:Zl(r,t)}):null,s?G(`div`,{"data-item-section":`git`,children:Zl(o,t)}):null,n?G(`div`,{"data-item-section":`action`,children:l?G(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:G(Ks,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function eu(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:w,contextMenuButtonVisibility:T,contextMenuRightClickEnabled:E,registerRenameInput:D,registerButton:ee,resolveIcon:te,renderDecorationForRow:O,openContextMenuForRow:k,onRowClick:A,onKeyDown:j}=e,M=hl(t),{isParked:N=!1,mode:ne=`flow`,style:re}=r,ie=ne===`sticky`,ae=_?.get(M)??null??Al(t.ancestorPaths,v,y),oe=t.kind===`directory`&&(b?.has(M)??!1),se=O(t,M),ce=kl(ae,oe),le=S&&w,ue=se!=null||x||le,de=le&&T===`always`,fe=a.getPath()===M,pe=fe?a.getValue():``,me=ie||!fe?null:G(Lc,{ref:D,ariaLabel:`Rename ${gl(t)}`,isFlattened:t.isFlattened,value:pe,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),he=$l(t,te,{actionLaneEnabled:le,customDecoration:se,decorationLaneEnabled:ue,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:ce,gitLaneActive:x,renameInput:me,showDecorativeActionAffordance:de}),ge={...Rc({ariaLabel:gl(t),domId:t.isFocused?Yl(h,M,N):void 0,extraStyle:re,features:{actionLaneEnabled:le,contextMenuButtonVisibility:le?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:N,itemHeight:g,mode:ne,row:t,state:{containsGitChange:oe,effectiveGitStatus:ae,isContextHovered:s===M,isDragTarget:l?.kind===`directory`&&l.directoryPath===M,isDragging:c?.has(M)===!0,isFocusRinged:t.isFocused&&o===M},targetPath:M}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),E&&(i.focusMountedPathFromInput(M),k(t,M,{anchorRect:Bl(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:ie?void 0:()=>{i.focusMountedPathFromInput(M)},onKeyDown:ie?void 0:j,ref:e=>{ee(M,e)}};return!ie&&fe?G(`div`,{...ge,children:he}):G(`button`,{...ge,type:`button`,draggable:u&&!N,onDragEnd:u&&!N?p:void 0,onDragStart:u&&!N?e=>{f(e,t,M)}:void 0,onMouseDown:e=>{if(ie){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!N?e=>{m(e,t,M)}:void 0,onClick:e=>{A(e,t,M,ne)},children:he})}function tu(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(hl(e))).map((n,r)=>eu(e,n,t.start+r))}function nu({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=dn,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=K(null),v=K(null),y=K(!1),b=K(null),x=K(null),S=K(null),C=K(null),w=K(null),T=K(new Map),E=K(new Map),D=K(()=>{}),ee=K(null),te=K(0),O=K(!1),k=K(null);k.current!==t&&(O.current=!1,k.current=t);let A=K(!1),j=K(null),M=K(null),N=K(!1),ne=K(null),re=K(null),ie=K(null),ae=K(null),oe=K(null),se=K(null),ce=K(null),le=K(null),ue=K(!1),de=K(null),fe=K(null),pe=K(null),me=K(null),he=al(()=>new Map,[]),[,ge]=tl(0),_e=K(!1),[ve,ye]=tl(null),[be,xe]=tl(null),[Se,Ce]=tl(null),[we,Te]=tl(null),[Ee,De]=tl(0),[P,Oe]=tl(null),ke=K(P);ke.current=P;let F=K(null),Ae=K(null),je=K(null),Me=K(null),Ne=K(null),I=K(!1),Pe=()=>{Ae.current=null,je.current=null,Me.current=null},Fe=(e,t)=>{Ae.current=e,je.current=null,Me.current=t==null?null:{path:e,scrollTop:t}},Ie=(e,t)=>{Ae.current=null,je.current={path:e,viewportOffset:t},Me.current=null},Le=K(d===`retain`&&t.isSearchOpen()),[Re,ze]=tl(p);rl(()=>{p||ze(!1)},[p]);let Be=K(!1),Ve=ol(()=>{Be.current=!0,ze(e=>e&&!1)},[]),[He,Ue]=tl(()=>vl({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[We,Ge]=tl(!1);rl(()=>{Ge(!0)},[]);let Ke=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,qe=e?.contextMenu?.triggerMode??(Ke?`right-click`:`both`),Je=qe===`both`||qe===`button`,Ye=e?.contextMenu?.buttonVisibility??`when-needed`,Xe=qe===`both`||qe===`right-click`;il(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;Ne.current=t,xe(t),Te(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(I.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let Ze=ol((e,t)=>{Hl(T.current,e,t)},[]),Qe=ol((e,t)=>{Hl(E.current,e,t)},[]),$e=ol(e=>{x.current=e},[]),et=ol(e=>Ul(e,E.current,T.current),[]),tt=n!=null||r!=null||i!=null,{resolveIcon:nt}=al(()=>ts(a),[a]),rt=t[jo](),it=rt.getPath(),at=it!=null,ot=t.isSearchOpen(),st=t.getSearchValue(),L=t.getFocusedPath(),R=t.getFocusedIndex(),ct=t.getScrollRequest(),lt=t.isDragAndDropEnabled(),ut=t.getDragSession(),dt=al(()=>ut==null?null:new Set(ut.draggedPaths),[ut]),ft=ut?.target??null,pt=ut?.primaryPath??null,mt=Jl(o),{overlayHeight:ht,overlayRows:gt,snapshot:_t,visibleRows:vt}=He,yt=_t.physical.viewportHeight,bt=al(()=>({end:_t.window.endIndex,start:_t.window.startIndex}),[_t.window.endIndex,_t.window.startIndex]),xt=gt,St=_t.sticky.rows,Ct=_t.physical.totalHeight,wt=_t.sticky.height,Tt=al(()=>new Set(St.map(e=>hl(e.row))),[St]),Et=R>=0&&R>=bt.start&&R<=bt.end,Dt=ol((e,t)=>u?.({item:ql(e,t),row:e})??null,[u]),Ot=ol(e=>Dc(e==null?null:T.current.get(e)??null)?!0:Dc(S.current),[]),kt=ol(e=>{Ot(t.focusNearestPath(e))},[t,Ot]),At=K(kt);At.current=kt;let jt=K(!0),Mt=K(()=>{}),Nt=ol((t=!0)=>{let n=ke.current;n!=null&&(jt.current=jt.current&&t,Oe(null),e?.contextMenu?.onClose?.(),jt.current&&kt(n.path))},[e?.contextMenu,kt]);Mt.current=Nt;let Pt=ol(e=>{let t=e==null?null:Vl(S.current,e);Ce(e=>e===t?e:t)},[]),Ft=ol((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=et(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Fe(n,e?.scrollTop??null),A.current=!0,ye(e=>e===n?e:n)}i.focus(),Pt(a),jt.current=!0,Oe({anchorRect:r?.anchorRect??null,item:ql(e,n),path:n,source:r?.source??`keyboard`})},[t,et,Pt]),It=ol(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=kc(e,yt);ne.current=R<0||e==null?null:Math.max(0,Math.min(R*s-e.scrollTop,Math.max(0,t-s))),N.current=!0}t.startRenaming(e)!==!1&&(Te(`focus`),ge(e=>e+1))}},[t,R,s,l,yt]),Lt=ol((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=kc(i,yt),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:vl({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return A.current=!0,Pc(i,a,s,l,u,d),D.current(),F.current=n?e:null,!0},[t,s,c,yt,h]),Rt=()=>y.current===!0||me.current!=null||ue.current===!0,zt=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Bt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Vt=()=>{ae.current!=null&&(clearTimeout(ae.current),ae.current=null),ie.current=null},Ht=()=>{se.current?.remove(),se.current=null},Ut=()=>{Bt(re.current),re.current=null,oe.current=null},Wt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},Gt=()=>{le.current?.(),le.current=null,me.current!=null&&(clearTimeout(me.current),me.current=null),ue.current=!1,de.current=null,pe.current=null,fe.current!=null&&(fe.current.setAttribute(`draggable`,`true`),fe.current.style.removeProperty(`touch-action`),fe.current=null),Ht(),Vt(),Ut(),ce.current=null},Kt=(e,n)=>{let r=S.current?.getRootNode(),i=Tl(Cl(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},qt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Vt();return}let r=t.getItem(e.directoryPath),i=jl(r)?r:null;if(i==null||i.isExpanded()){Vt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;ie.current!==a&&(Vt(),ie.current=a,ae.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind!==`directory`||n.directoryPath!==e.directoryPath||n.flattenedSegmentPath!==e.flattenedSegmentPath||i.expand()},n))},Jt=()=>{re.current=null;let e=oe.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=Ol(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,D.current()),qt(Kt(e.clientX,e.clientY)),re.current=zt(Jt)},Yt=(e,t)=>{oe.current={clientX:e,clientY:t},re.current??=zt(Jt)},Xt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(Gt(),Ht(),Vt(),Ut(),t.startDrag(r)===!1){e.preventDefault();return}if(ce.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),Dl())){let t=El(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Wt(t),se.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Zt=()=>{Ht(),Vt(),Ut(),ce.current=null,t.cancelDrag()},Qt=(e,n,r)=>{if(me.current!=null||ue.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;pe.current={clientX:i.clientX,clientY:i.clientY},fe.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!ue.current;me.current!=null&&(clearTimeout(me.current),me.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),le.current===o&&(le.current=null),t&&(a.setAttribute(`draggable`,`true`),fe.current===a&&(fe.current=null),pe.current=null)},s=e=>{let t=e.touches[0],n=pe.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=bl*bl||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),le.current=o,me.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),fe.current===a&&(fe.current=null),pe.current=null;return}ue.current=!0,fe.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),ce.current=n;let e=a.getBoundingClientRect(),s=El(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),Wt(s),se.current=s,de.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=de.current;n!=null&&se.current!=null&&(se.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),qt(Kt(t.clientX,t.clientY)),Yt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Kt(n.clientX,n.clientY),t.completeDrag(),Gt()},u=()=>{t.cancelDrag(),Gt()};le.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},yl)},$t=e=>{if(P!=null){if(e.key===`Escape`){Nt(),e.preventDefault(),e.stopPropagation();return}Ll.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(rt.isActive()){if(e.key===`Escape`)rt.cancel();else if(e.key===`Enter`)rt.commit();else return;Te(`focus`),ge(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){It(L??void 0),e.preventDefault(),e.stopPropagation();return}if(ot){if(e.key===`Escape`)N.current=!1,ne.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=kc(n,yt);ne.current=R<0||n==null?null:Math.max(0,Math.min(R*s-n.scrollTop,Math.max(0,r-s))),N.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;Te(`focus`),ge(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&Nl(e)){t.openSearch(e.key),ge(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Ke&&Fl(e),r=Il(e,Ke),i=r&&S.current!=null?Oc(S.current):null,a=r?new Set(Wl(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==L&&a.has(o)){let e=C.current;Fe(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=jl(p)?p:null,h=u!=null&&(Tt.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=Ul(u,E.current,T.current);e==null||n==null?y=!1:Ft(e,u)}else if((e.ctrlKey||e.metaKey)&&Ml(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;Te(`focus`);let b=t.getFocusedPath(),x=b!=null&&(Tt.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))Fe(b,v?.scrollTop??null),A.current=!0,ye(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(Ie(b,Kl(S.current,v,i,u,s,wt,yt)),A.current=!0,ye(e=>e===b?e:b)):Pe()}ge(e=>e+1),e.preventDefault(),e.stopPropagation()};il(()=>{if(!(!f||!ot)){if(Le.current){Le.current=!1;return}Dc(w.current)}},[ot,f]),il(()=>{let e=x.current;switch(Ic({hasRenderedInput:e!=null,previousRenamingPath:M.current,renamingPath:it})){case`reset`:M.current=null;return;case`reveal-canonical`:it!=null&&Lt(it,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(F.current=null,M.current=it,Dc(e),e.select());return}},[bt.end,bt.start,it,Lt,Tt]),il(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=Oc(e)?.dataset.itemPath??null;ye(e=>e===t?e:t)},i=()=>{n(),A.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,Oc(e)!=null){r();return}A.current=!1,ye(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),A.current=!1,ye(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;ye(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),il(()=>{let e=S.current;e!=null&&(_t.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[_t.physical.scrollTop]),il(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;ee.current=kc(n,g);let a=()=>{let e=t.getVisibleCount(),r=Ac(ee.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Ue(vl({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!O.current){O.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=Ac(ee.current,g),i=t.getVisibleRows(e,e)[0]??null;Mc(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}D.current=a;let o=t.subscribe(()=>{Cc(_e)&&ge(e=>e+1),a()}),l=()=>{I.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,De(e=>e+1),e=null},50))},u=null,d=()=>{i!=null&&delete i.dataset.overlayReveal,u!=null&&(clearTimeout(u),u=null)},f=()=>{i==null||I.current===!0||n.scrollTop>0||(i.dataset.overlayReveal=`true`,u!=null&&clearTimeout(u),u=setTimeout(()=>{d()},200))},p=()=>{if(a(),n.scrollTop>0&&d(),ke.current!=null&&y.current&&Mt.current(),I.current===!0){y.current=!1;return}xe(e=>e==null?e:null),l()},m=()=>{l(),f()},_=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),v=e=>{_.has(e.key)&&m()};n.addEventListener(`scroll`,p,{passive:!0}),n.addEventListener(`wheel`,m,{passive:!0}),n.addEventListener(`touchmove`,m,{passive:!0}),n.addEventListener(`keydown`,v);let x=typeof ResizeObserver<`u`?new ResizeObserver(e=>{ee.current=(e[0]==null?null:jc(e[0]))??kc(n,g),a()}):null;return x?.observe(n),()=>{D.current=()=>{},o(),n.removeEventListener(`scroll`,p),n.removeEventListener(`wheel`,m),n.removeEventListener(`touchmove`,m),n.removeEventListener(`keydown`,v),e!=null&&clearTimeout(e),u!=null&&clearTimeout(u),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,ee.current=null,x?.disconnect()}},[t,g,s,c,h]),il(()=>{Ke||P==null||Nt(!1)},[Nt,Ke,P]);let en=al(()=>P==null?null:`${P.path}::${P.source}`,[P]);il(()=>{if(en==null){m?.clearSlotContent(an);return}let t=ke.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??zl(n.getBoundingClientRect()),close:e=>{Mt.current(e?.restoreFocus??!0)},restoreFocus:()=>{jt.current&&At.current(ke.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(an,i),e?.contextMenu?.onOpen?.(t.item,r),Ql(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&Ql(i)}),()=>{m?.clearSlotContent(an)}},[en,e?.contextMenu,m]),il(()=>{P!=null&&t.getItem(P.path)==null&&Nt()},[Nt,P,t]),il(()=>{if(P==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(Rl(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Nt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Nt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Nt,P]),il(()=>{let e=C.current,n=S.current;if(e==null||n==null){j.current=L;return}let r=L==null?null:T.current.get(L)??null,i=Oc(n),a=i?.dataset.itemPath??null,o=at&&x.current===i,c=f&&w.current===i,l=N.current&&!ot,u=ne.current??0,d=F.current,p=Ae.current,m=je.current,g=Me.current,_=i!=null,v=A.current||_,y=j.current!==L,b=p!=null&&p===L&&L!=null,E=!1,ee=!1;if(ct!=null&&ct.id!==te.current){te.current=ct.id;let n=ct.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,yt-s))):wt;E=!0,ee=Nc(e,n,s,yt,Ct,ct.offset,t)}t.clearScrollRequest(ct.id)}let O=!E&&l&&Pc(e,R,s,yt,Ct,u),k=!E&&d!=null&&d===L&&Pc(e,R,s,yt,Ct,wt),M=!E&&m!=null&&m.path===L&&Pc(e,R,s,yt,Ct,m.viewportOffset),re=!E&&g!=null&&g.path===L&&e.scrollTop!==g.scrollTop;if(re&&(e.scrollTop=g.scrollTop),(re||ee||k||M||O||v&&y&&d!==L&&!b&&Mc(e,R,s,yt,wt))&&D.current(),E){j.current=L;return}if(!v){j.current=L;return}if(o){j.current=L;return}if(c&&!l){j.current=L;return}if(r==null){l&&R>=0&&(Pc(e,R,s,yt,Ct,u),D.current()),j.current=L;return}(y||l||d===L||p===L||m?.path===L||g?.path===L||a==null||a!==L)&&(Dc(r),d===L&&(F.current=null),p===L&&(Ae.current=null),m?.path===L&&(je.current=null),g?.path===L&&(Me.current=null),N.current=!1,ne.current=null),j.current=L},[t,R,L,Et,s,at,ot,bt,yt,f,ct,h,wt,Ct,vt]);let tn=R>=0&&R>=_t.visible.startIndex&&R<=_t.visible.endIndex,nn=L!=null&&xt.some(e=>hl(e.row)===L),sn=tn||nn,cn=Je&&A.current===!0&&sn?L:null,ln=we===`pointer`?be:null,un=P?.path??Ne.current??ln??cn??be,fn=P?.source===`right-click`;il(()=>{y.current&&P==null||Pt(et(un))},[P,et,bt,yt,Ee,xt,un,Pt,vt]);let pn=ol(e=>{if(y.current||Rl(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&Te(e=>e===`pointer`?e:`pointer`),xe(e=>e===i?e:i)},[]),mn=ol(()=>{xe(null)},[]);il(()=>{if(!lt)return;let e=()=>{Gt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Gt(),t.cancelDrag()}},[t,lt]);let hn=e=>{if(!lt||t.getDragSession()==null||ue.current)return;let n=Tl(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),qt(t.getDragSession()?.target??null),Yt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},gn=e=>{if(!lt||t.getDragSession()==null||ue.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Vt(),Ut(),t.setDragTarget(null))},_n=e=>{!lt||t.getDragSession()==null||ue.current||(e.preventDefault(),Kt(e.clientX,e.clientY),t.completeDrag(),Ht(),Vt(),Ut(),ce.current=null)},vn=_t.window.height,yn=_t.window.offsetTop,bn=Math.min(0,yt-vn),xn=Math.min(0,yt-vn-wt),Sn=ve===L||N.current,Cn=L!=null&&Sn&&!Et&&R>=0?vt[R]??t.getVisibleRows(R,R)[0]??null:null,wn=Cn==null?null:Fc(R,s,bt,vn),Tn=ce.current,En=pt!=null&&Tn!=null&&Tn.path===pt&&Tn.index>=bt.start&&Tn.index<=bt.end,Dn=pt!=null&&Tn!=null&&Tn.path===pt&&!En&&Tn.path!==Cn?.path?Tn:null,On=Dn==null?null:Fc(Dn.index,s,bt,vn),kn=Pl((R>=0?vt[R]??t.getVisibleRows(R,R)[0]??null:null)?.ancestorPaths.at(-1)??null),An=ot&&L!=null?Yl(o,L,!Et):void 0,jn=P?.path??(ot?L:ve),Mn=P?.path??be,Nn=et(un),Pn=Ke&&Je&&!fn&&!at&&Nn!=null&&Se!=null&&un!=null,Fn=Ke&&(Pn||P!=null),In=P?.anchorRect,Ln=In==null&&Nn!=null&&Se!=null&&(P!=null||Pn)?Se:null,Rn=In==null?Ln==null?void 0:{top:`${Ln}px`}:{left:`${In.left}px`,position:`fixed`,right:`auto`,top:`${In.top}px`},zn=fn?{opacity:`0`}:void 0,Bn=ol((e,n,r,i)=>{let a=zc({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:ot,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c);break}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=_t.visible.startIndex&&n.index<=_t.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(A.current=!0,ye(e=>e===c?e:c),Te(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&Lt(c,{targetOffset:`sticky-parents`})},[t,ot,_t.visible.endIndex,_t.visible.startIndex,Lt]),Vn=()=>{if(y.current||!Je||un==null||Nn==null)return;let e=t.getItem(un);e!=null&&(Pt(Nn),jt.current=!0,Oe({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:Nn.getAttribute(`aria-label`)??un,path:e.getPath()},path:e.getPath(),source:`button`}))},Hn={contextHoverPath:Mn,contextMenuButtonTriggerEnabled:Je,contextMenuButtonVisibility:Ye,contextMenuEnabled:Ke,contextMenuRightClickEnabled:Xe,contextMenuTriggerMode:qe,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:lt,draggedPathSet:dt,dragTarget:ft,gitLaneActive:tt,gitStatusByPath:n,handleRowDragEnd:Zt,handleRowDragStart:Xt,handleRowTouchStart:Qt,ignoredGitDirectories:r,ignoredInheritanceCache:he,instanceId:o,itemHeight:s,onKeyDown:$t,onRowClick:Bn,openContextMenuForRow:Ft,registerButton:Ze,registerRenameInput:$e,renameView:rt,renderDecorationForRow:Dt,resolveIcon:nt,shouldSuppressContextMenu:Rt,visualFocusPath:jn},Un={...Hn,registerButton:Qe};return G(`div`,{ref:S,id:mt,"data-file-tree-context-menu-button-visibility":Ke&&Je?Ye:void 0,"data-file-tree-context-menu-trigger-mode":Ke?qe:void 0,"data-file-tree-has-context-menu-action-lane":Ke&&Je?`true`:void 0,"data-file-tree-has-git-lane":tt?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:lt?gn:void 0,onDragOver:lt?hn:void 0,onDrop:lt?_n:void 0,onKeyDown:$t,onPointerLeave:Ke?mn:void 0,onPointerOver:Ke?pn:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[G(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:kn}}),G(`slot`,{name:rn,"data-type":`header-slot`}),f?G(`div`,{"data-file-tree-search-container":!0,"data-open":ot?`true`:`false`,children:G(`input`,{ref:w,"aria-activedescendant":An,"aria-controls":mt,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Re?`true`:void 0,value:st,onBlur:()=>{d===`retain`&&!Be.current||t.closeSearch()},onFocus:Ve,onPointerDown:Ve,onInput:e=>{Ve();let n=e.currentTarget;t.setSearch(n.value)}})}):null,G(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&We&&xt.length>0?G(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:G(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${ht}px`},children:xt.map((e,t)=>eu(Un,e.row,`sticky:${hl(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${xt.length-t}`}}))})}):null,G(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${Ct}px`},children:[G(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${yn}px`}}),G(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${vn}px`,top:`${bn}px`,bottom:`${xn}px`},children:[tu(Hn,bt,Tt),Cn!=null&&wn!=null?eu(Hn,Cn,`parked:${Cn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:pt===Cn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${wn}px`}}):null,Dn!=null&&On!=null?eu(Hn,Dn,`parked-drag:${Dn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${On}px`}}):null]})]})]}),Ke?G(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":Fn?`true`:`false`,style:Rn,children:[G(`button`,{ref:v,type:`button`,"data-type":on,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":P==null?`false`:`true`,"data-visible":Pn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),P!=null){Nt();return}Vn()},tabIndex:-1,style:zn,children:G(Ks,{...nt(`file-tree-icon-ellipsis`)})}),P==null?null:G(`slot`,{name:an})]}):null,P==null?null:G(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Nt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Nt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var ru={hydrateRoot:(e,t)=>{Vs(_s(nu,t),e)},renderRoot:(e,t)=>{Bs(_s(nu,t),e)},unmountRoot:e=>{Bs(null,e)}};function iu(e,t){ru.renderRoot(e,t)}function au(e,t){ru.hydrateRoot(e,t)}function ou(e){ru.unmountRoot(e)}var su=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}},cu=`__c`,lu=`__k`,uu=`__d`,du=`__s`,fu=/[\s\n\\/='"\0<>]/,pu=/^(xlink|xmlns|xml)([A-Z])/,mu=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,hu=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,gu=new Set([`draggable`,`spellcheck`]);function _u(e){e.__g===void 0?e[uu]=!0:e.__g|=8}function vu(e){e.__g===void 0?e[uu]=!1:e.__g&=-9}function yu(e){return e.__g===void 0?!0===e[uu]:!!(8&e.__g)}var bu=/["&<]/;function xu(e){if(e.length===0||!1===bu.test(e))return e;for(var t=0,n=0,r=``,i=``;n<e.length;n++){switch(e.charCodeAt(n)){case 34:i=`&quot;`;break;case 38:i=`&amp;`;break;case 60:i=`&lt;`;break;default:continue}n!==t&&(r+=e.slice(t,n)),r+=i,t=n+1}return n!==t&&(r+=e.slice(t,n)),r}var Su={},Cu=new Set(`animation-iteration-count.border-image-outset.border-image-slice.border-image-width.box-flex.box-flex-group.box-ordinal-group.column-count.fill-opacity.flex.flex-grow.flex-negative.flex-order.flex-positive.flex-shrink.flood-opacity.font-weight.grid-column.grid-row.line-clamp.line-height.opacity.order.orphans.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.widows.z-index.zoom`.split(`.`)),wu=/[A-Z]/g;function Tu(e){var t=``;for(var n in e){var r=e[n];if(r!=null&&r!==``){var i=n[0]==`-`?n:Su[n]||(Su[n]=n.replace(wu,`-$&`).toLowerCase()),a=`;`;typeof r!=`number`||i.startsWith(`--`)||Cu.has(i)||(a=`px;`),t=t+i+`:`+r+a}}return t||void 0}function Eu(){this.__d=!0}function Du(e,t){return{__v:e,context:t,props:e.props,setState:Eu,forceUpdate:Eu,__d:!0,__h:[]}}function Ou(e,t,n){if(!e.s){if(n instanceof ku){if(!n.s)return void(n.o=Ou.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(Ou.bind(null,e,t),Ou.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var ku=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{Ou(r,1,a(this.v))}catch(e){Ou(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?Ou(r,1,t?t(i):i):n?Ou(r,1,n(i)):Ou(r,2,i)}catch(e){Ou(r,2,e)}},r},e}(),Au,ju,Mu,Nu,Pu={},Fu=Array.isArray,Iu=Object.assign,Lu=``,Ru=`<!--$s-->`,zu=`<!--/$s-->`;function Bu(e,t){var n,r=e.type,i=!0;return e[cu]?(i=!1,(n=e[cu]).state=n[du]):n=new r(e.props,t),e[cu]=n,n.__v=e,n.props=e.props,n.context=t,_u(n),n.state??=Pu,n[du]??(n[du]=n.state),r.getDerivedStateFromProps?n.state=Iu({},n.state,r.getDerivedStateFromProps(n.props,n.state)):i&&n.componentWillMount?(n.componentWillMount(),n.state=n[du]===n.state?n.state:n[du]):!i&&n.componentWillUpdate&&n.componentWillUpdate(),Mu&&Mu(e),n.render(n.props,n.state,t)}function Vu(e,t,n,r,i,a,o){if(e==null||!0===e||!1===e||e===Lu)return Lu;var s=typeof e;if(s!=`object`)return s==`function`?Lu:s==`string`?xu(e):e+Lu;if(Fu(e)){var c,l=Lu;i[lu]=e;for(var u=e.length,d=0;d<u;d++){var f=e[d];if(f!=null&&typeof f!=`boolean`){var p,m=Vu(f,t,n,r,i,a,o);typeof m==`string`?l+=m:(c||=Array(u),l&&c.push(l),l=Lu,Fu(m)?(p=c).push.apply(p,m):c.push(m))}}return c?(l&&c.push(l),c):l}if(e.constructor!==void 0)return Lu;e.__=i,Au&&Au(e);var h=e.type,g=e.props;if(typeof h==`function`){var _,v,y,b=t;if(h===ys){if(`tpl`in g){for(var x=Lu,S=0;S<g.tpl.length;S++)if(x+=g.tpl[S],g.exprs&&S<g.exprs.length){var C=g.exprs[S];if(C==null)continue;typeof C!=`object`||C.constructor!==void 0&&!Fu(C)?x+=C:x+=Vu(C,t,n,r,e,a,o)}return x}if(`UNSTABLE_comment`in g)return`<!--`+xu(g.UNSTABLE_comment)+`-->`;v=g.children}else{if((_=h.contextType)!=null){var w=t[_.__c];b=w?w.props.value:_.__}var T=h.prototype&&typeof h.prototype.render==`function`;if(T)v=Bu(e,b),y=e[cu];else{e[cu]=y=Du(e,b);for(var E=0;yu(y)&&E++<25;){vu(y),Mu&&Mu(e);try{v=h.call(y,g,b)}catch(t){throw a&&t&&typeof t.then==`function`&&(e._suspended=!0),t}}_u(y)}if(y.getChildContext!=null&&(t=Iu({},t,y.getChildContext())),T&&W.errorBoundaries&&(h.getDerivedStateFromError||y.componentDidCatch)){v=v!=null&&v.type===ys&&v.key==null&&v.props.tpl==null?v.props.children:v;try{return Vu(v,t,n,r,e,a,!1)}catch(i){return h.getDerivedStateFromError&&(y[du]=h.getDerivedStateFromError(i)),y.componentDidCatch&&y.componentDidCatch(i,Pu),yu(y)?(v=Bu(e,t),(y=e[cu]).getChildContext!=null&&(t=Iu({},t,y.getChildContext())),Vu(v=v!=null&&v.type===ys&&v.key==null&&v.props.tpl==null?v.props.children:v,t,n,r,e,a,o)):Lu}finally{ju&&ju(e),Nu&&Nu(e)}}}v=v!=null&&v.type===ys&&v.key==null&&v.props.tpl==null?v.props.children:v;try{var D=Vu(v,t,n,r,e,a,o);return ju&&ju(e),W.unmount&&W.unmount(e),e._suspended?typeof D==`string`?Ru+D+zu:Fu(D)?(D.unshift(Ru),D.push(zu),D):D.then(function(e){return Ru+e+zu}):D}catch(i){if(!a&&o&&o.onError){var ee=function i(s){return o.onError(s,e,function(e,s){try{return Vu(e,t,n,r,s,a,o)}catch(e){return i(e)}})}(i);if(ee!==void 0)return ee;var te=W.__e;return te&&te(i,e),Lu}if(!a||!i||typeof i.then!=`function`)throw i;return i.then(function i(){try{var s=Vu(v,t,n,r,e,a,o);return e._suspended?Ru+s+zu:s}catch(e){if(!e||typeof e.then!=`function`)throw e;return e.then(i)}})}}var O,k=`<`+h,A=Lu;for(var j in g){var M=g[j];if(typeof(M=Uu(M)?M.value:M)!=`function`||j===`class`||j===`className`){switch(j){case`children`:O=M;continue;case`key`:case`ref`:case`__self`:case`__source`:continue;case`htmlFor`:if(`for`in g)continue;j=`for`;break;case`className`:if(`class`in g)continue;j=`class`;break;case`defaultChecked`:j=`checked`;break;case`defaultSelected`:j=`selected`;break;case`defaultValue`:case`value`:switch(j=`value`,h){case`textarea`:O=M;continue;case`select`:r=M;continue;case`option`:r!=M||`selected`in g||(k+=` selected`)}break;case`dangerouslySetInnerHTML`:A=M&&M.__html;continue;case`style`:typeof M==`object`&&(M=Tu(M));break;case`acceptCharset`:j=`accept-charset`;break;case`httpEquiv`:j=`http-equiv`;break;default:if(pu.test(j))j=j.replace(pu,`$1:$2`).toLowerCase();else{if(fu.test(j))continue;j[4]!==`-`&&!gu.has(j)||M==null?n?hu.test(j)&&(j=j===`panose1`?`panose-1`:j.replace(/([A-Z])/g,`-$1`).toLowerCase()):mu.test(j)&&(j=j.toLowerCase()):M+=Lu}}M!=null&&!1!==M&&(k=!0===M||M===Lu?k+` `+j:k+` `+j+`="`+(typeof M==`string`?xu(M):M+Lu)+`"`)}}if(fu.test(h))throw Error(h+` is not a valid HTML tag name in `+k+`>`);if(A||(typeof O==`string`?A=xu(O):O!=null&&!1!==O&&!0!==O&&(A=Vu(O,t,h===`svg`||h!==`foreignObject`&&n,r,e,a,o))),ju&&ju(e),Nu&&Nu(e),!A&&Hu.has(h))return k+`/>`;var N=`</`+h+`>`,ne=k+`>`;return Fu(A)?[ne].concat(A,[N]):typeof A==`string`?ne+A+N:[ne,A,N]}var Hu=new Set([`area`,`base`,`br`,`col`,`command`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function Uu(e){return typeof e==`object`&&!!e&&typeof e.peek==`function`&&`value`in e}var Wu=0;function Gu(e){return e!=null&&e.length>0?e:(Wu+=1,`pst_ft_${Wu}`)}function Ku({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??dn)}function qu(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function Ju(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function Yu(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var Xu=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new su;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=Gu(a),this.#p=Ho(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=un(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new Lo({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(ou(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}applyGitStatusPatch(e){let t=Uo(this.#p,e);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&iu(n.wrapper,this.#w())}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){Array.isArray(e)?this.#t.resetPaths(e,t):this.#t.resetPaths(e)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),iu(t.wrapper,this.#w()))}setGitStatus(e){let t=Ho(e,this.#p);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&iu(n.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),iu(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),au(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),iu(r,this.#w())}#C(){return{initialViewportHeight:Ku({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(rn,e());return}this.#l.setSlotHtml(rn,this.#e?.header?.html??null)}#k(e){let t=Yu(e).find(e=>Ju(e)),n=qu(qt(cn(this.#m).set));n!=null&&(t!=null&&t.outerHTML===n.outerHTML||(t==null?e.prepend(n):t.replaceWith(n)))}#A(e){let t=Yu(e),n=t.find(e=>Ju(e)),r=t.filter(e=>e!==n),i=cn(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=qu(i);if(a==null){for(let e of r)e.remove();return}if(!(r.length===1&&r[0].outerHTML===a.outerHTML)){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=cn(this.#m);t.colored&&Yt(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${$t}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}this.#g?.parentNode===e&&this.#_===this.#h||(this.#g??=document.createElement(`style`),this.#g.setAttribute($t,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=hn(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return xn(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}};function Zu(e,t){return e.split(/(?=^diff --git )/m).find(e=>$u(e)===t)}function Qu(e,t,n){let r=new Set(n),i=new Map,a=new Map;for(let e of t){let t=i.get(e.path)??[];if(t.push(e),i.set(e.path,t),r.has(e.id)){let t=a.get(e.path)??[];t.push(e),a.set(e.path,t)}}return e.split(/(?=^diff --git )/m).flatMap(e=>{let t=$u(e),n=t?a.get(t)?.sort((e,t)=>e.index-t.index):void 0;if(!t||!n||n.length===0)return[];if(n.length===i.get(t)?.length)return e;let r=e.search(/^@@ /m);return r<0?e:`${e.slice(0,r).trimEnd()}\n${n.map(e=>e.content).join(`
1268
- `)}\n`}).join(`
1269
- `)}function $u(e){return e.match(/^\+\+\+ b\/(.+)$/m)?.[1]||e.match(/^--- a\/(.+)$/m)?.[1]||e.match(/^diff --git a\/(.+?) b\/(.+)$/m)?.[2]}function ed(e){let t=e.trim();if(t)return rd(t)??nd(t)}function td(e){let t=e.split(`/`);return(t.length===2||t.length===3)&&t.every(e=>e.length>0&&!/\s/.test(e))}function nd(e){let t=e.match(/^(?:(.+)#)?(\d+)$/);if(!t)return;let n=Number(t[2]),r=t[1];if(!(!Number.isSafeInteger(n)||n<=0)&&!(r&&!td(r)))return{repository:r,number:n}}function rd(e){let t;try{t=new URL(e)}catch{return}if(t.protocol!==`https:`&&t.protocol!==`http:`)return;let[n,r,i,a]=t.pathname.split(`/`).filter(Boolean);if(!(!n||!r||!a||![`pull`,`pulls`].includes(i??``)))return nd(`${t.hostname===`github.com`?`${n}/${r}`:`${t.host}/${n}/${r}`}#${a}`)}var id=Object.create,ad=Object.defineProperty,od=Object.getOwnPropertyDescriptor,sd=Object.getOwnPropertyNames,cd=Object.getPrototypeOf,ld=Object.prototype.hasOwnProperty,ud=(e,t)=>function(){return t||(0,e[sd(e)[0]])((t={exports:{}}).exports,t),t.exports},dd=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=sd(t),a=0,o=i.length,s;a<o;a++)s=i[a],!ld.call(e,s)&&s!==n&&ad(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=od(t,s))||r.enumerable});return e},fd=(e,t,n)=>(n=e==null?{}:id(cd(e)),dd(t||!e||!e.__esModule?ad(n,`default`,{value:e,enumerable:!0}):n,e)),pd=ud({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(e){"@babel/helpers - typeof";return t.exports=n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),md=ud({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=pd().default;function r(e,t){if(n(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),hd=ud({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=pd().default,r=md();function i(e){var t=r(e,`string`);return n(t)==`symbol`?t:t+``}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}}),gd=ud({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=hd();function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),_d=ud({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=gd();function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]==null?{}:arguments[t];t%2?r(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}});function vd(e){let t={subscribe(t){let n=null,r=!1,i=!1,a=!1;function o(){if(n===null){a=!0;return}i||(i=!0,typeof n==`function`?n():n&&n.unsubscribe())}return n=e({next(e){var n;r||(n=t.next)==null||n.call(t,e)},error(e){var n;r||(r=!0,(n=t.error)==null||n.call(t,e),o())},complete(){var e;r||(r=!0,(e=t.complete)==null||e.call(t),o())}}),a&&o(),{unsubscribe:o}},pipe(...e){return e.reduce(yd,t)}};return t}function yd(e,t){return t(e)}function bd(e){let t=new AbortController;return new Promise((n,r)=>{let i=!1;function a(){i||(i=!0,o.unsubscribe())}t.signal.addEventListener(`abort`,()=>{r(t.signal.reason)});let o=e.subscribe({next(e){i=!0,n(e),a()},error(e){r(e)},complete(){t.abort(),a()}})})}function xd(e){return e=>{let t=0,n=null,r=[];function i(){n||=e.subscribe({next(e){for(let n of r){var t;(t=n.next)==null||t.call(n,e)}},error(e){for(let n of r){var t;(t=n.error)==null||t.call(n,e)}},complete(){for(let t of r){var e;(e=t.complete)==null||e.call(t)}}})}function a(){if(t===0&&n){let e=n;n=null,e.unsubscribe()}}return vd(e=>(t++,r.push(e),i(),{unsubscribe(){t--,a();let n=r.findIndex(t=>t===e);n>-1&&r.splice(n,1)}}))}}function Sd(e){let t=e,n=[],r=e=>{t!==void 0&&e.next(t),n.push(e)},i=e=>{n.splice(n.indexOf(e),1)},a=vd(e=>(r(e),()=>{i(e)}));return a.next=e=>{if(t!==e){t=e;for(let t of n)t.next(e)}},a.get=()=>t,a}function Cd(e){return vd(t=>{function n(t=0,r=e.op){let i=e.links[t];if(!i)throw Error(`No more links to execute - did you forget to add an ending link?`);return i({op:r,next(e){return n(t+1,e)}})}return n().subscribe(t)})}function wd(e){return!!e&&!Array.isArray(e)&&typeof e==`object`}function Td(){return Object.create(null)}var Ed={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603,UNAUTHORIZED:-32001,PAYMENT_REQUIRED:-32002,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNSUPPORTED_MEDIA_TYPE:-32015,UNPROCESSABLE_CONTENT:-32022,PRECONDITION_REQUIRED:-32028,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};Ed.BAD_GATEWAY,Ed.SERVICE_UNAVAILABLE,Ed.GATEWAY_TIMEOUT,Ed.INTERNAL_SERVER_ERROR;var Dd=Object.create,Od=Object.defineProperty,kd=Object.getOwnPropertyDescriptor,Ad=Object.getOwnPropertyNames,jd=Object.getPrototypeOf,Md=Object.prototype.hasOwnProperty,Nd=(e,t)=>function(){return t||(0,e[Ad(e)[0]])((t={exports:{}}).exports,t),t.exports},Pd=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Ad(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Md.call(e,s)&&s!==n&&Od(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=kd(t,s))||r.enumerable});return e},Fd=(e,t,n)=>(n=e==null?{}:Dd(jd(e)),Pd(t||!e||!e.__esModule?Od(n,`default`,{value:e,enumerable:!0}):n,e)),Id=()=>{},Ld=e=>{Object.freeze&&Object.freeze(e)};function Rd(e,t,n){let r=t.join(`.`);return n[r]??(n[r]=new Proxy(Id,{get(r,i){if(!(typeof i!=`string`||i===`then`))return Rd(e,[...t,i],n)},apply(n,r,i){let a=t[t.length-1];if(a===`valueOf`||a===`toString`||a===`toJSON`)return`tRPC.proxy(${t.slice(0,-1).join(`.`)})`;let o={args:i,path:t};return a===`call`?o={args:i.length>=2?[i[1]]:[],path:t.slice(0,-1)}:a===`apply`&&(o={args:i.length>=2?i[1]:[],path:t.slice(0,-1)}),Ld(o.args),Ld(o.path),e(o)}})),n[r]}var zd=e=>Rd(e,[],Td()),Bd=e=>new Proxy(Id,{get(t,n){if(n!==`then`)return e(n)}}),Vd=Nd({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(e){"@babel/helpers - typeof";return t.exports=n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Hd=Nd({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=Vd().default;function r(e,t){if(n(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Ud=Nd({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=Vd().default,r=Hd();function i(e){var t=r(e,`string`);return n(t)==`symbol`?t:t+``}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}}),Wd=Nd({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=Ud();function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Gd=Nd({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=Wd();function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]==null?{}:arguments[t];t%2?r(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}});Fd(Gd(),1),Fd(Wd(),1);var Kd=Fd(Gd(),1);function qd(e,t){if(`error`in e){let n=t.deserialize(e.error);return{ok:!1,error:(0,Kd.default)((0,Kd.default)({},e),{},{error:n})}}return{ok:!0,result:(0,Kd.default)((0,Kd.default)({},e.result),(!e.result.type||e.result.type===`data`)&&{type:`data`,data:t.deserialize(e.result.data)})}}var Jd=class extends Error{constructor(){super(`Unable to transform response from server`)}};function Yd(e,t){let n;try{n=qd(e,t)}catch{throw new Jd}if(!n.ok&&(!wd(n.error.error)||typeof n.error.error.code!=`number`)||n.ok&&!wd(n.result))throw new Jd;return n}Fd(Gd(),1);var Xd=fd(gd(),1),Zd=fd(_d(),1);function Qd(e){return e instanceof tf}function $d(e){return wd(e)&&wd(e.error)&&typeof e.error.code==`number`&&typeof e.error.message==`string`}function ef(e,t){return typeof e==`string`?e:wd(e)&&typeof e.message==`string`?e.message:t}var tf=class e extends Error{constructor(t,n){var r,i;let a=n?.cause;super(t,{cause:a}),(0,Xd.default)(this,`cause`,void 0),(0,Xd.default)(this,`shape`,void 0),(0,Xd.default)(this,`data`,void 0),(0,Xd.default)(this,`meta`,void 0),this.meta=n?.meta,this.cause=a,this.shape=n==null||(r=n.result)==null?void 0:r.error,this.data=n==null||(i=n.result)==null?void 0:i.error.data,this.name=`TRPCClientError`,Object.setPrototypeOf(this,e.prototype)}static from(t,n={}){let r=t;return Qd(r)?(n.meta&&(r.meta=(0,Zd.default)((0,Zd.default)({},r.meta),n.meta)),r):$d(r)?new e(r.error.message,(0,Zd.default)((0,Zd.default)({},n),{},{result:r,cause:n.cause})):new e(ef(r,`Unknown error`),(0,Zd.default)((0,Zd.default)({},n),{},{cause:r}))}};function nf(e){let t=e;return t?`input`in t?t:{input:t,output:t}:{input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}}}var rf=e=>typeof e==`function`;function af(e){if(e)return e;if(typeof window<`u`&&rf(window.fetch))return window.fetch;if(typeof globalThis<`u`&&rf(globalThis.fetch))return globalThis.fetch;throw Error(`No fetch implementation found`)}var of=fd(_d());function sf(e){return{url:e.url.toString(),fetch:e.fetch,transformer:nf(e.transformer),methodOverride:e.methodOverride}}function cf(e){let t={};for(let n=0;n<e.length;n++)t[n]=e[n];return t}var lf={query:`GET`,mutation:`POST`,subscription:`PATCH`};function uf(e){return`input`in e?e.transformer.input.serialize(e.input):cf(e.inputs.map(t=>e.transformer.input.serialize(t)))}var df=e=>{let t=e.url.split(`?`),n=t[0].replace(/\/$/,``)+`/`+e.path,r=[];if(t[1]&&r.push(t[1]),`inputs`in e&&r.push(`batch=1`),e.type===`query`||e.type===`subscription`){let t=uf(e);t!==void 0&&e.methodOverride!==`POST`&&r.push(`input=${encodeURIComponent(JSON.stringify(t))}`)}return r.length&&(n+=`?`+r.join(`&`)),n},ff=e=>{if(e.type===`query`&&e.methodOverride!==`POST`)return;let t=uf(e);return t===void 0?void 0:JSON.stringify(t)},pf=e=>_f((0,of.default)((0,of.default)({},e),{},{contentTypeHeader:`application/json`,getUrl:df,getBody:ff})),mf=class extends Error{constructor(){let e=`AbortError`;super(e),this.name=e,this.message=e}},hf=e=>{var t;if(e?.aborted)throw(t=e.throwIfAborted)==null||t.call(e),typeof DOMException<`u`?new DOMException(`AbortError`,`AbortError`):new mf};async function gf(e){hf(e.signal);let t=e.getUrl(e),n=e.getBody(e),r=e.methodOverride??lf[e.type],i=await(async()=>{let t=await e.headers();return Symbol.iterator in t?Object.fromEntries(t):t})(),a=(0,of.default)((0,of.default)((0,of.default)({},e.contentTypeHeader&&r!==`GET`?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{[e.trpcAcceptHeaderKey??`trpc-accept`]:e.trpcAcceptHeader}:void 0),i);return af(e.fetch)(t,{method:r,signal:e.signal,body:n,headers:a})}async function _f(e){let t={},n=await gf(e);t.response=n;let r=await n.json();return t.responseJSON=r,{json:r,meta:t}}fd(_d(),1);var vf=()=>{throw Error(`Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new`)};function yf(e){let t=null,n=null,r=()=>{clearTimeout(n),n=null,t=null};function i(t){let n=[[]],r=0;for(;;){let o=t[r];if(!o)break;let s=n[n.length-1];if(o.aborted){var i;(i=o.reject)==null||i.call(o,Error(`Aborted`)),r++;continue}if(e.validate(s.concat(o).map(e=>e.key))){s.push(o),r++;continue}if(s.length===0){var a;(a=o.reject)==null||a.call(o,Error(`Input is too big for a single dispatch`)),r++;continue}n.push([])}return n}function a(){let n=i(t);r();for(let t of n){if(!t.length)continue;let n={items:t};for(let e of t)e.batch=n;e.fetch(n.items.map(e=>e.key)).then(async e=>{await Promise.all(e.map(async(e,t)=>{let r=n.items[t];try{var i;let t=await Promise.resolve(e);(i=r.resolve)==null||i.call(r,t)}catch(e){var a;(a=r.reject)==null||a.call(r,e)}r.batch=null,r.reject=null,r.resolve=null}));for(let e of n.items){var t;(t=e.reject)==null||t.call(e,Error(`Missing result`)),e.batch=null}}).catch(e=>{for(let r of n.items){var t;(t=r.reject)==null||t.call(r,e),r.batch=null}})}}function o(e){let r={aborted:!1,key:e,batch:null,resolve:vf,reject:vf},i=new Promise((e,n)=>{r.reject=n,r.resolve=e,t??=[],t.push(r)});return n??=setTimeout(a),i}return{load:o}}function bf(...e){let t=new AbortController,n=e.length,r=0,i=()=>{++r===n&&t.abort()};for(let t of e)t?.aborted?i():t?.addEventListener(`abort`,i,{once:!0});return t.signal}var xf=fd(_d(),1);function Sf(e){let t=sf(e),n=e.maxURLLength??1/0,r=e.maxItems??1/0;return()=>{let i=i=>({validate(e){if(n===1/0&&r===1/0)return!0;if(e.length>r)return!1;let a=e.map(e=>e.path).join(`,`),o=e.map(e=>e.input);return df((0,xf.default)((0,xf.default)({},t),{},{type:i,path:a,inputs:o,signal:null})).length<=n},async fetch(n){let r=n.map(e=>e.path).join(`,`),a=n.map(e=>e.input),o=bf(...n.map(e=>e.signal)),s=await pf((0,xf.default)((0,xf.default)({},t),{},{path:r,inputs:a,type:i,headers(){return e.headers?typeof e.headers==`function`?e.headers({opList:n}):e.headers:{}},signal:o}));return(Array.isArray(s.json)?s.json:n.map(()=>s.json)).map(e=>({meta:s.meta,json:e}))}}),a={query:yf(i(`query`)),mutation:yf(i(`mutation`))};return({op:e})=>vd(n=>{if(e.type===`subscription`)throw Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let r=a[e.type].load(e),i;return r.then(e=>{i=e;let r=Yd(e.json,t.transformer.output);if(!r.ok){n.error(tf.from(r.error,{meta:e.meta}));return}n.next({context:e.meta,result:r.result}),n.complete()}).catch(e=>{n.error(tf.from(e,{meta:i?.meta}))}),()=>{}})}}fd(_d(),1);var Cf=(e,...t)=>typeof e==`function`?e(...t):e;fd(gd(),1);function wf(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}async function Tf(e){let t=await Cf(e.url);return e.connectionParams?t+`${t.includes(`?`)?`&`:`?`}connectionParams=1`:t}async function Ef(e,t){let n={method:`connectionParams`,data:await Cf(e)};return t.encode(n)}fd(gd(),1);var Df=fd(gd(),1);function Of(e){let{promise:t,resolve:n,reject:r}=wf();return e.addEventListener(`open`,()=>{e.removeEventListener(`error`,r),n()}),e.addEventListener(`error`,r),t}function kf(e,{intervalMs:t,pongTimeoutMs:n}){let r,i;function a(){r=setTimeout(()=>{e.send(`PING`),i=setTimeout(()=>{e.close()},n)},t)}function o(){clearTimeout(r),a()}function s(){clearTimeout(i),o()}e.addEventListener(`open`,a),e.addEventListener(`message`,({data:e})=>{clearTimeout(r),a(),e===`PONG`&&s()}),e.addEventListener(`close`,()=>{clearTimeout(r),clearTimeout(i)})}var Af=class e{constructor(t){if((0,Df.default)(this,`id`,++e.connectCount),(0,Df.default)(this,`WebSocketPonyfill`,void 0),(0,Df.default)(this,`urlOptions`,void 0),(0,Df.default)(this,`keepAliveOpts`,void 0),(0,Df.default)(this,`encoder`,void 0),(0,Df.default)(this,`wsObservable`,Sd(null)),(0,Df.default)(this,`openPromise`,null),this.WebSocketPonyfill=t.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive,this.encoder=t.encoder}get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var t=this;if(t.openPromise)return t.openPromise;t.id=++e.connectCount,t.openPromise=Tf(t.urlOptions).then(e=>new t.WebSocketPonyfill(e)).then(async e=>{t.ws=e,e.binaryType=`arraybuffer`,e.addEventListener(`message`,function({data:e}){e===`PING`&&this.send(`PONG`)}),t.keepAliveOpts.enabled&&kf(e,t.keepAliveOpts),e.addEventListener(`close`,()=>{t.ws===e&&(t.ws=null)}),await Of(e),t.urlOptions.connectionParams&&e.send(await Ef(t.urlOptions.connectionParams,t.encoder))});try{await t.openPromise}finally{t.openPromise=null}}async close(){var e=this;try{await e.openPromise}finally{var t;(t=e.ws)==null||t.close()}}};(0,Df.default)(Af,`connectCount`,0),fd(gd(),1),fd(_d(),1);var jf=fd(gd(),1),Mf=fd(_d(),1),Nf=class{constructor(e){(0,jf.default)(this,`links`,void 0),(0,jf.default)(this,`runtime`,void 0),(0,jf.default)(this,`requestId`,void 0),this.requestId=0,this.runtime={},this.links=e.links.map(e=>e(this.runtime))}$request(e){return Cd({links:this.links,op:(0,Mf.default)((0,Mf.default)({},e),{},{context:e.context??{},id:++this.requestId})}).pipe(xd())}async requestAsPromise(e){var t=this;try{return(await bd(t.$request(e))).result.data}catch(e){throw tf.from(e)}}query(e,t,n){return this.requestAsPromise({type:`query`,path:e,input:t,context:n?.context,signal:n?.signal})}mutation(e,t,n){return this.requestAsPromise({type:`mutation`,path:e,input:t,context:n?.context,signal:n?.signal})}subscription(e,t,n){return this.$request({type:`subscription`,path:e,input:t,context:n.context,signal:n.signal}).subscribe({next(e){switch(e.result.type){case`state`:var t;(t=n.onConnectionStateChange)==null||t.call(n,e.result);break;case`started`:var r;(r=n.onStarted)==null||r.call(n,{context:e.context});break;case`stopped`:var i;(i=n.onStopped)==null||i.call(n);break;case`data`:case void 0:var a;(a=n.onData)==null||a.call(n,e.result.data);break}},error(e){var t;(t=n.onError)==null||t.call(n,e)},complete(){var e;(e=n.onComplete)==null||e.call(n)}})}},Pf=Symbol.for(`trpc_untypedClient`),Ff={query:`query`,mutate:`mutation`,subscribe:`subscription`},If=e=>Ff[e];function Lf(e){let t=zd(({path:t,args:n})=>{let r=[...t],i=If(r.pop()),a=r.join(`.`);return e[i](a,...n)});return Bd(n=>n===Pf?e:t[n])}function Rf(e){return Lf(new Nf(e))}fd(_d(),1),fd(_d(),1),fd(ud({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function n(e){var t,n,i,a=2;for(typeof Symbol<`u`&&(n=Symbol.asyncIterator,i=Symbol.iterator);a--;){if(n&&(t=e[n])!=null)return t.call(e);if(i&&(t=e[i])!=null)return new r(t.call(e));n=`@@asyncIterator`,i=`@@iterator`}throw TypeError(`Object is not async iterable`)}function r(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+` is not an object.`));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return r=function(e){this.s=e,this.n=e.next},r.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return n===void 0?Promise.reject(e):t(n.apply(this.s,arguments))}},new r(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}})(),1),fd(_d(),1);var zf=ud({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e,t){function n(){var e=typeof SuppressedError==`function`?SuppressedError:function(e,t){var n=Error();return n.name=`SuppressedError`,n.error=e,n.suppressed=t,n},t={},n=[];function r(e,t){if(t!=null){if(Object(t)!==t)throw TypeError(`using declarations can only be used with objects, functions, null, or undefined.`);if(e)var r=t[Symbol.asyncDispose||Symbol.for(`Symbol.asyncDispose`)];if(r===void 0&&(r=t[Symbol.dispose||Symbol.for(`Symbol.dispose`)],e))var i=r;if(typeof r!=`function`)throw TypeError(`Object is not disposable.`);i&&(r=function(){try{i.call(t)}catch(e){return Promise.reject(e)}}),n.push({v:t,d:r,a:e})}else e&&n.push({d:t,a:e});return t}return{e:t,u:r.bind(null,!1),a:r.bind(null,!0),d:function(){var r,i=this.e,a=0;function o(){for(;r=n.pop();)try{if(!r.a&&a===1)return a=0,n.push(r),Promise.resolve().then(o);if(r.d){var e=r.d.call(r.v);if(r.a)return a|=2,Promise.resolve(e).then(o,s)}else a|=1}catch(e){return s(e)}if(a===1)return i===t?Promise.resolve():Promise.reject(i);if(i!==t)throw i}function s(n){return i=i===t?n:new e(n,i),o()}return o()}}}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Bf=ud({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(e,t){function n(e,t){this.v=e,this.k=t}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Vf=ud({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e,t){var n=Bf();function r(e){return new n(e,0)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Hf=ud({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e,t){var n=Bf();function r(e){return function(){return new i(e.apply(this,arguments))}}function i(e){var t,r;function i(t,r){try{var o=e[t](r),s=o.value,c=s instanceof n;Promise.resolve(c?s.v:s).then(function(n){if(c){var r=t===`return`?`return`:`next`;if(!s.k||n.done)return i(r,n);n=e[r](n).value}a(o.done?`return`:`normal`,n)},function(e){i(`throw`,e)})}catch(e){a(`throw`,e)}}function a(e,n){switch(e){case`return`:t.resolve({value:n,done:!0});break;case`throw`:t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?i(t.key,t.arg):r=null}this._invoke=function(e,n){return new Promise(function(a,o){var s={key:e,arg:n,resolve:a,reject:o,next:null};r?r=r.next=s:(t=r=s,i(e,n))})},typeof e.return!=`function`&&(this.return=void 0)}i.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},i.prototype.next=function(e){return this._invoke(`next`,e)},i.prototype.throw=function(e){return this._invoke(`throw`,e)},i.prototype.return=function(e){return this._invoke(`return`,e)},t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}});fd(zf(),1),fd(Vf(),1),fd(Hf(),1),fd(_d(),1);var Uf=Rf({links:[Sf({url:`/api/trpc`})]}),Wf=`diffs-container`;(()=>{try{return!1}catch{return!1}})();var Gf=/(?=^From [a-f0-9]+ .+$)/m,Kf=/(?=^diff --git)/gm,qf=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Jf=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,Yf=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,Xf=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Zf=`header-prefix`,Qf=`header-metadata`,$f=`header-custom`,ep={dark:`pierre-dark`,light:`pierre-light`},tp=`data-theme-css`,np=`data-unsafe-css`,rp=`data-diffs-scrollbar-measure`,ip=`--diffs-scrollbar-gutter-measured`,ap=1e5,op=Object.freeze({fromStart:0,fromEnd:0}),sp={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},cp={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};function lp(e){return e.replace(/\n$|\r\n$/,``)}var up=new TextEncoder,dp=new TextDecoder(`utf-8`,{ignoreBOM:!0}),fp=/[\uD800-\uDFFF]/,pp=1024,mp=new Uint8Array(pp);function hp(){mp.length!==pp&&(mp=new Uint8Array(pp))}function gp(e){if(e.length===0)return e;if(fp.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;mp.length<t&&(mp=new Uint8Array(t));let{written:n}=up.encodeInto(e,mp);return dp.decode(mp.subarray(0,n))}function _p(e,t,n){try{return vp(e,t,n)}finally{hp()}}function vp(e,t,n=!1){let r=Ip(e),i=r?Tp(e):Ep(e),a,o=[];for(let e of i){if(r&&!Kf.test(e)){if(a==null)a=gp(e);else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}else if(!r&&!Dp(e)){if(a==null)a=gp(e);else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}let i=bp(e,{cacheKey:t==null?void 0:`${t}-${o.length}`,isGitDiff:r,throwOnError:n});i!=null&&o.push(i)}return{patchMetadata:a,files:o}}function yp(e,t){try{return bp(e,t)}finally{hp()}}function bp(e,{cacheKey:t,isGitDiff:n=Kf.test(e),oldFile:r,newFile:i,throwOnError:a=!1}={}){let o=0,s=Lp(e,`@@ `),c,l=r==null||i==null,u=0,d=0;for(let e of s){let s=wp(e),f=s[0];if(f==null){if(a)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,e);continue}let p=Np(f),m=0,h=0;if(p==null||c==null){if(c!=null){if(a)throw Error(`parsePatchContent: Invalid hunk`);console.error(`parsePatchContent: Invalid hunk`,e);continue}c={name:``,type:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:l,additionLines:!l&&r!=null&&i!=null?Cp(i.contents):[],deletionLines:!l&&r!=null&&i!=null?Cp(r.contents):[],cacheKey:zp(t)},c.additionLines.length===1&&i?.contents===``&&(c.additionLines.length=0),c.deletionLines.length===1&&r?.contents===``&&(c.deletionLines.length=0);for(let e of s){if(e.startsWith(`diff --git`)){let t=e.trim().match(Yf),n=t?.[1]??t?.[2],r=t?.[3]??t?.[4];if(n==null||r==null){if(a)throw Error(`parsePatchContent: invalid git diff header`);console.error(`parsePatchContent: invalid git diff header`,e);continue}c.name=gp(r.trim()),n!==r&&(c.prevName=gp(n.trim()));continue}let t=e.startsWith(`---`)||e.startsWith(`+++`)?e.match(n?Jf:qf):null;if(t!=null){let[,e,n]=t;if(e===`---`&&n!==`/dev/null`){let e=gp(n.trim());c.prevName=e,c.name=e}else e===`+++`&&n!==`/dev/null`&&(c.name=gp(n.trim()))}else if(n){if(e.startsWith(`new mode `)&&(c.mode=gp(e.slice(8).trim())),e.startsWith(`old mode `)&&(c.prevMode=gp(e.slice(8).trim())),e.startsWith(`new file mode`)&&(c.type=`new`,c.mode=gp(e.slice(13).trim())),e.startsWith(`deleted file mode`)&&(c.type=`deleted`,c.mode=gp(e.slice(17).trim())),e.startsWith(`similarity index`)&&(e.startsWith(`similarity index 100%`)?c.type=`rename-pure`:c.type=`rename-changed`),e.startsWith(`index `)){let[,t,n,r]=e.trim().match(Xf)??[];t!=null&&(c.prevObjectId=gp(t)),n!=null&&(c.newObjectId=gp(n)),r!=null&&(c.mode=gp(r))}e.startsWith(`rename from `)&&(c.prevName=gp(e.slice(12).trim())),e.startsWith(`rename to `)&&(c.name=gp(e.slice(10).trim()))}}continue}let g,_;for(;s.length>0&&(s[s.length-1]===`
1267
+ }`}var gn=new WeakMap;function _n(e){let t=gn.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(en,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),gn.set(e,i),i}function vn(e,t){if(!e.isConnected)return;let n=_n(t);if(n==null)return;let r=t.querySelector(`style[${tn}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(tn,``),t.appendChild(i)),i.textContent=`:host { ${nn}: ${n}px; }`}var yn;function bn(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){yn??(yn=new CSSStyleSheet,yn.replaceSync(mn(fn)));let t=!1;try{e.adoptedStyleSheets=[yn],t=!0}catch{}if(t){e.querySelector(`style[${Qt}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(Qt,``),t.textContent=mn(fn),e.prepend(t)}}function xn(e,t){Sn(e,t),bn(t),vn(e,t)}function Sn(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});xn(this,e)}}if(customElements.define(Zt,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(Zt)))e instanceof HTMLElement&&xn(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var Cn=5,wn=1<<Cn,Tn=wn*4;function En(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function Dn(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function On(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function kn(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function An(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function jn(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function Mn(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,In(e,t)}function Nn(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=kn(e).get(t);if(i===void 0)return;let a=i>>Cn;e.childVisibleChunkSums[a]+=r}function Pn(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=Ln(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=wn}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function Fn(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>Cn;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<Cn}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function In(e,t){if(t.childIds.length<Tn){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/wn),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>Cn]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function Ln(e,t,n,r){let i=Math.min(t.childIds.length,n+wn),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var Rn=7,zn=3,Bn=1<<zn,Vn=4;function Hn(e,t,n=0){return e<<Vn|n<<zn|t}function Un(e){return e.depthAndFlags>>>Vn}function Wn(e){return(e.depthAndFlags&Bn)>>zn}function z(e){return(e.depthAndFlags&Bn)!==0}function Gn(e){return e.depthAndFlags&Rn}function Kn(e,t){return(Gn(e)&t)!==0}function qn(e,t){e.depthAndFlags|=t}function Jn(e,t){e.depthAndFlags=Hn(t,Gn(e),Wn(e))}var Yn=Symbol(`benchmarkInstrumentation`);function Xn(e,t){return t==null||Object.defineProperty(e,Yn,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function Zn(e){return e==null?null:e[Yn]??null}function B(e,t,n){return e==null?n():e.measurePhase(t,n)}function Qn(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function $n(e){return e>=48&&e<=57}function er(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!$n(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&$n(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function tr(e){let t=e.toLowerCase();return{lowerValue:t,tokens:er(t)}}function nr(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function rr(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=nr(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function ir(e,t,n){let r=rr(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function ar(e,t){return ir(e,t,tr)}function or(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function sr(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=or(e,r);return a===or(t,r)?ar(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function cr(e,t){return sr(e,t)}function lr(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=tr(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=or(e,n);return o===or(t,n)?ir(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function ur(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=tr(r);return e.sortKeyById[t]=i,i}function dr(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function fr(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function pr(e){let{hasTrailingSlash:t,segments:n}=fr(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function mr(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=fr(e);return{requiresDirectory:t,segments:n}}function hr(){let e=new Map;return e.set(``,0),{idByValue:e,valueById:[``],sortKeyById:[tr(``)]}}function gr(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function _r(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var vr=Symbol(`pathStorePreparedInputKind`);function yr(e,t){return e[vr]=t,e}function br(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function xr(e,t,n){return n==="default"?cr(e,t):n(br(e),br(t))}function Sr(){return{depthAndFlags:Hn(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function Cr(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function wr(e){return e.isDirectory?e.segments.length:e.segments.length-1}function Tr(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function Er(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function Dr(e,t={}){return Nr(e,t).map(e=>e.path)}function Or(e,t={}){let n=Nr(e,t);return yr({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function kr(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return yr({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function Ar(e){let t=e,n=t.preparedPaths;if(t[vr]===`prepared`&&n!=null)return n;if(!Tr(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function jr(e){let t=e;return t[vr]===`presorted`&&t.presortedPaths!=null||Er(t.presortedPaths)?t.presortedPaths:null}function Mr(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function Nr(e,t={}){let n=dr(t),r=Zn(t);Qn(r,`workload.inputFiles`,e.length);let i=B(r,`store.preparePathEntries.parse`,()=>e.map(e=>pr(e)));return B(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>xr(e,t,n.sort))),i}var Pr=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[Sr()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=hr();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=Zn(e),this.options=dr(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,En())}appendPaths(e){return B(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>pr(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,B(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return B(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null)if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:Hn(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:Hn(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:Hn(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=pr(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null)if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:Hn(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:Hn(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=pr(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(B(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||B(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort==="default"?lr(this.lastPreparedPath,e,this.segmentSortKeyCache):xr(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=wr(e),i=n==null?0:wr(n),a=n==null?0:Cr(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){!this.createdDirectoriesAllExpanded||this.initialExpandedPathSet==null||(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=gr(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:Hn(Un(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),An(i,s),s}createFileChildUnchecked(e,t){let n=gr(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:Hn(Un(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),An(r,a),a}getOrCreateDirectoryChild(e,t){let n=gr(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!z(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:Hn(Un(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),An(r,a),this.directories.set(a,En()),a}createDirectoryChild(e,t){let n=gr(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:Hn(Un(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),An(r,a),this.directories.set(a,En()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!z(n))throw Error(`Path is not a directory: "${t}"`);if(Kn(n,1))throw Error(`Duplicate path: "${t}"`);qn(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,Dn());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(z(a)){let t=Dn();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;z(n)&&this.directories.set(t,En());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),An(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!z(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return Mn(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function Fr(e,t=`closed`,n=null){let r=Lr(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function Ir(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function Lr(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function Rr(e,t){return Kn(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion===`closed`?!1:Un(t)<=e.defaultExpansion}function zr(e,t,n=e.snapshot.nodes[t]){return n==null||!z(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:Rr(e,n)}function Br(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!z(r))return;let i=Rr(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function Vr(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function Hr(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function Ur(e,t){let n=Vr(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function Wr(e,t){let n=Vr(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function Gr(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function Kr(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function qr(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function Jr(e,t){e.directoryLoadInfoById.delete(t)}function Yr(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function Xr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Zr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function Qr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function $r(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function ei(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function ti(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function ni(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function ri(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function ii(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function ai(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function oi(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function si(e,t,n){return{...n,visibleCountDelta:vi(e)-t}}function ci(e,t){let n=vi(e),r=Ir();e.transactionStack.push(r);try{t()}catch(t){throw di(e,r,!1),t}di(e,r,!0,vi(e)-n)}function li(e,t){let n=e.instrumentation;if(n==null){ui(e,t);return}B(n,`store.events.record`,()=>ui(e,t))}function ui(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){gi(e,t);return}n.events.push(t),hi(n,t)}function di(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?mi(i,t):B(n,`store.events.batch.merge`,()=>mi(i,t));return}let a=fi(t,r),o=e.instrumentation;if(o==null){gi(e,a);return}B(o,`store.events.batch.commit`,()=>gi(e,a))}function fi(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function pi(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function mi(e,t){for(let n of t.events)e.events.push(n);pi(e,t)}function hi(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function gi(e,t){let n=e.instrumentation;if(n==null){_i(e,t);return}B(n,`store.events.emit`,()=>_i(e,t))}function _i(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function vi(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function yi(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!z(n)||Kn(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!z(a)?null:i}function bi(e,t){let n=t;for(;;){let t=yi(e,n);if(t==null)return n;n=t}}function xi(e,t){let n=[t],r=t;for(;;){let t=yi(e,r);if(t==null)return n;n.push(t),r=t}}function Si(e,t){let n=t==null?e.snapshot.rootId:ji(e,t);return n==null?[]:Ni(e,n)}function Ci(e,t){let n=pr(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=Ji(e,qi(e,r)),{createdNodeIds:a,directoryId:o}=Pi(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=U(e,o);if(Kn(n,1))throw Error(`Path already exists: "${t}"`);qn(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=Ii(e,o,n.basename),s.add(c);Oi(e,o);let l=Ji(e,o);return Xr({affectedAncestorIds:Ai(e,c),affectedNodeIds:[...s],path:t,projectionChanged:Yi(i,l)})}function wi(e,t,n){let r=ji(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=U(e,r);if(Kn(i,2))throw Error(`The root node cannot be removed`);if(z(i)&&H(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=Ji(e,a),s=Gi(e,r);zi(e,a,r,i.nameId),Ki(e,a),Oi(e,a);let c=Ji(e,a);return Zr({affectedAncestorIds:Ai(e,a),affectedNodeIds:s,path:t,projectionChanged:Yi(o,c),recursive:n.recursive===!0})}function Ti(e,t,n,r){let i=ji(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=U(e,i);if(Kn(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=Ui(e,i,n),c=Ji(e,a.parentId),l=Ji(e,s.parentId),u=_r(e.snapshot.segmentTable,a.nameId),d=gr(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(z(a)&&$i(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=On(e.snapshot.nodes,H(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&Wi(e,p,o,Wn(a))===`skip`)return null;let m=a.parentId;zi(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),Qi(e,i),Ri(e,s.parentId,i),Ki(e,m),e.pathCacheVersion++,Oi(e,m),s.parentId!==m&&Oi(e,s.parentId);let h=Ji(e,m),g=Ji(e,s.parentId);return Qr({affectedAncestorIds:[...new Set([...Ai(e,m),...Ai(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:Xi([c,l],[h,g]),to:V(e,i)})}function Ei(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function Di(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function V(e,t){let n=U(e,t),r=Ei(e,t);if(r!=null)return r;if(Kn(n,2))return Di(e,t,``);let i=V(e,n.parentId),a=_r(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return Di(e,t,z(n)?`${o}/`:o)}function Oi(e,t){let n=e.instrumentation;if(n==null){ta(e,t);return}B(n,`store.recomputeCountsUpwardFrom`,()=>ta(e,t))}function ki(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!z(o)){ea(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){ea(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function Ai(e,t){let n=[],r=t;for(;r!=null;){let t=U(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function ji(e,t){if(t.length===0)return e.snapshot.rootId;let n=mr(t);return Mi(e,n.segments,n.requiresDirectory)}function Mi(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=H(e,r),a=On(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=U(e,r);return n&&!z(i)?null:r}function H(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function U(e,t){let n=e.snapshot.nodes[t];if(n===void 0||Kn(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function Ni(e,t){let n=e.snapshot.nodes[t];if(n===void 0||Kn(n,4))return[];if(!z(n))return[V(e,t)];if(H(e,t).childIds.length===0)return Kn(n,1)&&!Kn(n,2)?[V(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||Kn(n,4)){i.pop();continue}if(!z(n)){r.push(V(e,t.nodeId)),i.pop();continue}let a=H(e,t.nodeId);if(a.childIds.length===0){Kn(n,1)&&!Kn(n,2)&&r.push(V(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function Pi(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=gr(e.snapshot.segmentTable,i),a=H(e,r),o=On(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!z(U(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=Fi(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function Fi(e,t,n){let r=U(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:Hn(Un(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,En()),Ri(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function Ii(e,t,n){let r=gr(e.snapshot.segmentTable,n),i=H(e,t);if(On(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${ra(e,t,n)}"`);let a=U(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:Hn(Un(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),Ri(e,t,o),e.activeNodeCount++,o}function Li(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}Bi(e,n,o)<0?i=a:r=a+1}return r}function Ri(e,t,n){let r=H(e,t),i=U(e,n);On(e.snapshot.nodes,r).set(i.nameId,n),Nn(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=Li(e,r,n);r.childIds.splice(a,0,n),jn(r,a),In(e.snapshot.nodes,r)}function zi(e,t,n,r){let i=H(e,t),a=kn(i),o=a.get(n)??-1;On(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&Nn(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),jn(i,o),In(e.snapshot.nodes,i))}function Bi(e,t,n){let r=e.snapshot.options.sort;return r==="default"?Vi(e,t,n):r(Hi(e,t),Hi(e,n))}function Vi(e,t,n){let r=U(e,t),i=U(e,n),a=z(r);if(a!==z(i))return a?-1:1;let o=rr(ur(e.snapshot.segmentTable,r.nameId),ur(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=_r(e.snapshot.segmentTable,r.nameId),c=_r(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function Hi(e,t){let n=U(e,t),r=V(e,t),i=z(n),a=i?r.slice(0,-1):r;return{basename:_r(e.snapshot.segmentTable,n.nameId),depth:Un(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function Ui(e,t,n){let r=U(e,t),i=ji(e,n);if(i!=null){let t=U(e,i);if(z(t))return{basename:_r(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=mr(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=mr(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:Mi(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function Wi(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${V(e,t)}"`);let i=U(e,t);if(Wn(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(z(i)&&H(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return Gi(e,t),zi(e,a,t,o),Ki(e,a),Oi(e,a),`handled`}function Gi(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=U(e,t.nodeId);if(t.visitedChildren||!z(i)){z(i)&&e.snapshot.directories.delete(t.nodeId),qn(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),Jr(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=H(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function Ki(e,t){let n=t;for(;n!=null;){let t=U(e,n);if(!z(t)||Kn(t,2)||H(e,n).childIds.length>0)return;qn(t,1),n=t.parentId===n?null:t.parentId}}function qi(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=On(e.snapshot.nodes,H(e,n)).get(t);if(i==null||!z(U(e,i)))break;n=i}return n}function Ji(e,t){let n=Zi(e,t);if(n==null)return null;let r=bi(e,n),i=U(e,r),a=n===r?null:xi(e,n).map(t=>V(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:H(e,r).childIds.length>0,path:V(e,r),terminalKind:Wn(i)})}function Yi(e,t){return Xi([e],[t])}function Xi(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function Zi(e,t){let n=t;for(;n!=null;){let t=U(e,n);if(!z(t)||Kn(t,2))return null;if(!zr(e,n,t))return n;n=t.parentId}return null}function Qi(e,t){let n=U(e,t);if(Jn(n,(t===e.snapshot.rootId?-1:Un(U(e,n.parentId)))+1),!z(n))return;let r=H(e,t);for(let t of r.childIds)Qi(e,t)}function $i(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=U(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function ea(e,t,n=U(e,t),r=!1){let i=e.instrumentation;if(i==null){na(e,t,n,r);return}B(i,`store.recomputeNodeCounts`,()=>na(e,t,n,r))}function ta(e,t){let n=t;for(;n!=null;){let t=U(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(ea(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&Nn(H(e,s),n,a,o),n=s}}function na(e,t,n,r){if(!z(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=H(e,t);if(r){let t=e.instrumentation;t==null?Mn(e.snapshot.nodes,i):B(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>Mn(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,Kn(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=yi(e,t)==null?zr(e,t,n)?1+o:1:o}function ra(e,t,n){let r=V(e,t);return r.length===0?n:`${r}${n}`}function ia(e){return e!=null&&!Kn(e,4)}function aa(e,t){let n=e.snapshot.nodes[t];return!ia(n)||!z(n)||Kn(n,2)?null:n}function oa(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&ia(e.snapshot.nodes[n])&&(t+=1);return t}function sa(e){return Math.max(0,e.valueById.length-1)}function ca(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:oa(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:sa(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function la(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function ua(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)aa(e,n)!=null&&t.push(V(e,n));for(let t of e.expandedDirectoryIds)aa(e,t)!=null&&n.push(V(e,t));return{collapsedPaths:t,expandedPaths:n}}function da(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)aa(e,n)==null||Hr(e,n)===`loaded`||t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:V(e,n)});return t}function fa(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=ji(e,n);t!=null&&Br(e,t,!0,U(e,t))}for(let n of t.collapsedPaths){let t=ji(e,n);t!=null&&Br(e,t,!1,U(e,t))}}function pa(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=ji(e,n.path);t!=null&&aa(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function ma(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function ha(e){let t=e.snapshot.segmentTable,n=hr();for(let r of e.snapshot.nodes)if(ia(r)){if(Kn(r,2)){r.nameId=0;continue}r.nameId=gr(n,_r(t,r.nameId))}e.snapshot.segmentTable=n}function ga(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!ia(r)||!z(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return ia(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[U(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),Mn(e.snapshot.nodes,n)}}function _a(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(ia(n))break;--t}e.snapshot.nodes.length=t+1}function va(e){let t=ua(e),n=da(e);B(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>ma(e)),B(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>ha(e)),B(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>ga(e)),B(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>_a(e)),B(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>fa(e,t)),B(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>pa(e,n)),B(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>ki(e,e.snapshot.rootId))}function ya(e){let t=ua(e),n=da(e),r=B(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>Si(e)),i=Xn({...e.snapshot.options},e.instrumentation),a=B(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new Pr(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,B(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>fa(e,t)),B(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>pa(e,n)),B(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>ki(e,e.snapshot.rootId))}function ba(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function xa(e,t){let n=ca(e);t===`stable`?B(e.instrumentation,`store.cleanup.stable`,()=>va(e)):B(e.instrumentation,`store.cleanup.aggressive`,()=>ya(e));let r=ca(e);return la(t,t===`stable`,n,r)}var Sa=64;function Ca(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function wa(e){return U(e,e.snapshot.rootId).visibleSubtreeCount}function Ta(e,t,n,r){let i=U(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function Ea(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:Ga(e,t.cursor),setSize:t.setSize,subtreeEndIndex:Ta(e,t.cursor,t.index,n)}}function Da(e,t,n,r,i,a){let o=H(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=Pn(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return Oa(e,u,l,r+c,i+1,s,o.childIds.length,a)}function Oa(e,t,n,r,i,a,o,s){if(!z(U(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=za(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=U(e,c.terminalNodeId);if(!z(l)||!zr(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return Da(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function ka(e,t){let n=wa(e);if(t<0||t>=n)return null;let r=Da(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>V(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=Ea(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:Ga(e,r.cursor),setSize:r.setSize,subtreeEndIndex:Ta(e,r.cursor,r.index,n)}}function Aa(e,t,n){let r=e.instrumentation,i=wa(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return Wa(e,o+1);let t=[],n=Ia(e,a);for(let r=a;r<=o&&n!=null;r++){let r=Ga(e,n);t.push(r),n=Va(e,n)}return t}let s=[],c=0,l=0,u=B(r,`store.getVisibleSlice.selectFirstRow`,()=>Ia(e,a));for(let t=a;t<=o&&u!=null;t++){let t=B(r,`store.getVisibleSlice.materializeRow`,()=>Ga(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=B(r,`store.getVisibleSlice.advanceCursor`,()=>Va(e,u))}return Qn(r,`workload.visibleRowsRead`,s.length),Qn(r,`workload.flattenedRowsRead`,c),Qn(r,`workload.flattenedSegmentsRead`,l),s}function ja(e,t=wa(e)){let n=e.instrumentation;return n==null?Ua(e,t):B(n,`store.getVisibleTreeProjection`,()=>Ua(e,t))}function Ma(e){return Ha(ja(e))}function Na(e,t){let n=ji(e,t);if(n==null||n===e.snapshot.rootId||z(U(e,n))&&bi(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=U(e,i).parentId,n=H(e,t),s=kn(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=Fn(a,n,s),t!==o){let n=U(e,t),a=yi(e,t);if(!zr(e,t,n)&&a!==i)return null;bi(e,t)===t&&(r+=1)}i=t}return r}function Pa(e,t){let n=ji(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=U(e,n);if(!z(r))throw Error(`Path is not a directory: "${t}"`);return zr(e,n,r)?null:(Br(e,n,!0,r),Oi(e,n),$r({affectedAncestorIds:Ai(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function Fa(e,t){let n=ji(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=U(e,n);if(!z(r))throw Error(`Path is not a directory: "${t}"`);return zr(e,n,r)?(Br(e,n,!1,r),Oi(e,n),ei({affectedAncestorIds:Ai(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function Ia(e,t){return t<0||t>=wa(e)?null:La(e,e.snapshot.rootId,t,-1)}function La(e,t,n,r){let i=H(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?Pn(e.snapshot.nodes,i,n):B(a,`store.getVisibleSlice.selectChildIndex`,()=>Pn(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return Ra(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function Ra(e,t,n,r){if(!z(U(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=za(e,t,r);if(n===0)return i;let a=U(e,i.terminalNodeId);if(!z(a)||!zr(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return La(e,i.terminalNodeId,n-1,i.visibleDepth)}function za(e,t,n){return z(U(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:bi(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:B(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>bi(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function Ba(e,t){let n=U(e,t);if(!z(n))return!0;let r=n.parentId;return r===e.snapshot.rootId?!0:yi(e,r)!==t}function Va(e,t){let n=U(e,t.terminalNodeId);if(z(n)){let r=H(e,t.terminalNodeId);if(zr(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:Ra(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=U(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=H(e,n),o=kn(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return Ra(e,s,0,i);Ba(e,r)&&i--,r=n}}function Ha(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function Ua(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(Sa);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=Ca(o,y);let x,S=_;if(z(v))S=f?bi(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:V(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&z(C)&&zr(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function Wa(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!z(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:V(e,f)};continue}let h=l?bi(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=Ga(e,g);let _=i[h];_!=null&&z(_)&&zr(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function Ga(e,t){let n=U(e,t.terminalNodeId),r=z(n)?Ka(e,t):null,i=V(e,t.terminalNodeId),a=_r(e.snapshot.segmentTable,n.nameId),o=z(n)&&H(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?xi(e,t.headNodeId).map(n=>{let r=U(e,n);return{isTerminal:n===t.terminalNodeId,name:_r(e.snapshot.segmentTable,r.nameId),nodeId:n,path:V(e,n)}}):B(c,`store.getVisibleSlice.flatten.collectSegments`,()=>xi(e,t.headNodeId).map(n=>{let r=U(e,n);return{isTerminal:n===t.terminalNodeId,name:_r(e.snapshot.segmentTable,r.nameId),nodeId:n,path:V(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:z(n)&&zr(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:z(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function Ka(e,t){if(t.headNodeId===t.terminalNodeId)return Hr(e,t.terminalNodeId);let n=xi(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=Hr(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}function qa(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!z(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&In(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&z(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,In(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function Ja(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var Ya=class e{#e;constructor(e={}){let t=Zn(e),n=B(t,`store.builder.create`,()=>new Pr(e));if(e.preparedInput!=null){let t=jr(e.preparedInput);t==null?n.appendPreparedPaths(Ar(e.preparedInput),!1):n.appendPresortedPaths(t,Mr(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(B(t,`store.preparePathEntries`,()=>Nr(r,e)))}let r=B(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=B(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=B(t,`store.state.create`,()=>Fr(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:B(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||Ja(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&B(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?B(t,`store.state.initializeOpenVisibleCounts`,()=>qa(this.#e)):B(t,`store.state.recomputeCounts`,()=>ki(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return Dr(e,t)}static prepareInput(e,t={}){return Or(e,t)}static preparePresortedInput(e){return kr(e)}list(e){return B(this.#e.instrumentation,`store.list`,()=>Si(this.#e,e))}add(e){B(this.#e.instrumentation,`store.add`,()=>{let t=wa(this.#e);li(this.#e,si(this.#e,t,Ci(this.#e,e)))})}remove(e,t={}){B(this.#e.instrumentation,`store.remove`,()=>{let n=wa(this.#e);li(this.#e,si(this.#e,n,wi(this.#e,e,t)))})}move(e,t,n={}){B(this.#e.instrumentation,`store.move`,()=>{let r=wa(this.#e),i=Ti(this.#e,e,t,n);i!=null&&li(this.#e,si(this.#e,r,i))})}batch(e){ci(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision});break}})}getVisibleCount(){return B(this.#e.instrumentation,`store.getVisibleCount`,()=>wa(this.#e))}getVisibleSlice(e,t){return B(this.#e.instrumentation,`store.getVisibleSlice`,()=>Aa(this.#e,e,t))}getVisibleRowContext(e){return B(this.#e.instrumentation,`store.getVisibleRowContext`,()=>ka(this.#e,e))}getVisibleTreeProjection(){return Ma(this.#e)}getVisibleTreeProjectionData(e){return ja(this.#e,e)}getVisibleIndex(e){return B(this.#e.instrumentation,`store.getVisibleIndex`,()=>Na(this.#e,e))}getPathInfo(e){return B(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=ji(this.#e,e);if(t==null)return null;let n=U(this.#e,t);return{depth:Un(n),kind:z(n)?`directory`:`file`,path:V(this.#e,t)}})}isExpanded(e){return B(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=U(this.#e,t);return zr(this.#e,t,n)})}expand(e){B(this.#e.instrumentation,`store.expand`,()=>{let t=wa(this.#e),n=Pa(this.#e,e);n!=null&&li(this.#e,si(this.#e,t,n))})}collapse(e){B(this.#e.instrumentation,`store.collapse`,()=>{let t=wa(this.#e),n=Fa(this.#e,e);n!=null&&li(this.#e,si(this.#e,t,n))})}on(e,t){return Yr(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return Hr(this.#e,t)}markDirectoryUnloaded(e){B(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(H(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=wa(this.#e);Wr(this.#e,t),li(this.#e,si(this.#e,n,ti({affectedAncestorIds:Ai(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return B(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=wa(this.#e),r=Ur(this.#e,t);return li(this.#e,si(this.#e,n,ni({affectedAncestorIds:Ai(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return B(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||Hr(this.#e,n)!==`loading`||!Kr(this.#e,n,e.attemptId))return!1;let r=V(this.#e,n);this.validateChildPatch(r,t);let i=wa(this.#e),a=[];for(let e of t.operations){Xa(r,e);let t=wa(this.#e);switch(e.type){case`add`:a.push(si(this.#e,t,Ci(this.#e,e.path)));break;case`remove`:a.push(si(this.#e,t,wi(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=Ti(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(si(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return li(this.#e,si(this.#e,i,ri({affectedAncestorIds:Ai(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:V(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return B(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=wa(this.#e),r=Gr(this.#e,t,e.attemptId);return li(this.#e,si(this.#e,n,ii({affectedAncestorIds:Ai(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:V(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return B(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=wa(this.#e),i=qr(this.#e,n,e.attemptId,t);return li(this.#e,si(this.#e,r,ai({affectedAncestorIds:Ai(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:V(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return B(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(ba(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=wa(this.#e),n=xa(this.#e,e.mode??`stable`);return li(this.#e,si(this.#e,t,oi({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=H(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??tr(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=rr(ur(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!z(U(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=U(this.#e,n);zr(this.#e,n,i)||(Br(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=U(this.#e,e);if(!zr(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=ji(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!z(U(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!z(U(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=U(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=U(this.#e,e),r=yi(this.#e,e);if(!zr(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function Xa(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`);break}}var Za=e=>e.startsWith(`f::`)?e.slice(3):e;function Qa(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function $a(e,t){return e===``?t:`${e}/${t}`}function eo({files:e,path:t,isFolder:n,nextBasename:r}){let i=Za(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=Qa(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=$a(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function to(e){return e.endsWith(`/`)}function no(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function ro(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function io(e,t){return t.includes(e)?ro(t):[e]}function ao(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function oo(e,t){return{draggedPaths:e,target:t}}function so(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(to(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function co(e,t){return t.kind===`root`||t.directoryPath==null?no(e):t.directoryPath}function lo(e,t){let n=e.map(e=>{let n=co(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function uo(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function fo(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!uo(Ya.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function po(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function mo(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function ho(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function go(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return ho(e,t.path)?n?e:null:e;case`move`:return mo(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=go(r,e,n),r==null)return null;return r}}}function _o(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function vo(e){switch(e.operation){case`add`:return{..._o(e),operation:`add`,path:e.path};case`remove`:return{..._o(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{..._o(e),from:e.from,operation:`move`,to:e.to}}}function yo(e){return{..._o(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>vo(e)),operation:`batch`}}function bo(e){switch(e.operation){case`add`:case`remove`:case`move`:return vo(e);case`batch`:return yo(e);default:return null}}function xo(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function So(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function Co(e){return So(e).at(-1)??null}function wo(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function To(e){return e.endsWith(`/`)}var Eo=e=>e.toLowerCase();function Do(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function Oo(e){return e.endsWith(`/`)?e.slice(0,-1):e}function ko(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var Ao=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},jo=Symbol(`FILE_TREE_RENAME_VIEW`),Mo=512,No=512;function Po(e){return e===`top`||e===`center`?e:`nearest`}function Fo(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=So(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function Io(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:Fo(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var Lo=class e{static{Object.defineProperty(e.prototype,jo,{configurable:!0,value(){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}},writable:!0})}#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=fo({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=Co(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:Po(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=No){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t==null||!this.#B.has(t)||this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.#ae([...this.#B].filter(e=>e!==t),t);return}this.#ae([...this.#B,t],t)}}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=io(t,n);return this.#r.canDrag?.(r)===!1?!1:(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=oo(t.draggedPaths,n);(so(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}ao(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=oo(e.draggedPaths,t);if(so(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=lo(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=To(r),a=Oo(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of So(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=Do(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,To(e)?{recursive:!0}:void 0);return}this.#Pe(e),this.#De()}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,To(e)?{recursive:!0}:void 0);return}let t=To(e),n=eo({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:Oo(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#Pe(e),this.#v?.(n.error),this.#De();return}if(n.sourcePath===n.destinationPath){this.#Pe(e),this.#De();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(ko(n.sourcePath,t),ko(n.destinationPath,t))}#Y(e){this.#T==null||this.#E===e||(this.#E=e,this.#De())}resetPaths(e,t={}){let n=!Array.isArray(e),r=n?void 0:e,i=n?e:t,a=this.#H.list().length,o=this.#G,s=fo({paths:r,preparedInput:i.preparedInput},`resetPaths`,this.#e.sort),c=this.#le(s.paths,s.preparedInput,i.initialExpandedPaths),l=this.#c,u=this.#T,d=this.getSelectedPaths(),f=this.#z;this.#K?.(),this.#H=c,this.#d.clear(),this.#he();let p=d.map(e=>c.getPathInfo(e)?.path??null).filter(e=>e!=null),m=!xo(this.#B,p);this.#B=new Set(p),m&&(this.#V+=1),this.#z=f==null?null:c.getPathInfo(f)?.path??null,this.#T=u==null?null:c.getPathInfo(u)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(l,l!=null||p.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:s.paths.length,pathCountBefore:a,projectionChanged:!0,usedPreparedInput:i.preparedInput!=null,visibleCountDelta:this.#G-o})}#X(e){this.#Ie();let t=Co(e),n=wo(e,t),r=null,i=null;for(let e of this.#be()){if(Co(e)!==t)continue;let a=wo(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=So(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!xo(this.#B,r),a=this.#z!==t;!i&&!a||(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new Ya({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of So(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(Eo),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(Eo),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of So(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:Ao(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of So(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of So(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=Io(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,Mo)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s===e&&this.#c===n||(this.#s=e,this.#c=n,t&&this.#De()))}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=go(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=go(this.#c,e,!0),r=[...this.#B].map(t=>go(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=go(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return xo(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&po(e)&&(this.#i=null);let t=po(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=bo(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},Ro=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function zo(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(!(e[t]===`/`||t===e.length)){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function Bo(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=[],r=0;for(;;){let e=t.indexOf(`/`,r);if(e===-1)break;n.push(t.slice(0,e+1)),r=e+1}return n}function Vo(e,t){return t?`${e}/`:e}function Ho(e,t=null){let n=Ro(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set,o=new Map;for(let t of e??[]){let e=Wo(t);e!=null&&qo({canonicalPath:e.canonicalPath,changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,isDirectory:e.isDirectory,status:t.status,statusByPath:r})}return r.size===0?null:{changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}function Uo(e,t){let n=t?.remove??[],r=t?.set??[];if(n.length===0&&r.length===0)return e;let i=new Map(e?.statusByPath),a=new Set(e?.directoriesWithChanges),o=new Set(e?.ignoredDirectoryPaths),s=new Map(e?.changeCountByDirectoryPath),c=!1;for(let e of n){let t=Go(e);t!=null&&(c=Ko({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,statusByPath:i})||c)}for(let e of r){let t=Wo(e);t!=null&&(c=qo({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,isDirectory:t.isDirectory,status:e.status,statusByPath:i})||c)}return c?i.size===0?null:{changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,signature:Xo(i),statusByPath:i}:e}function Wo(e){return Go(e.path)}function Go(e){let t=zo(e);if(t!=null)return{canonicalPath:Vo(t.path,t.isDirectory),isDirectory:t.isDirectory}}function Ko({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,statusByPath:i}){let a=i.get(e);return a==null?!1:(i.delete(e),a===`ignored`&&e.endsWith(`/`)&&r.delete(e),Yo(t,n,e),!0)}function qo({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,isDirectory:i,status:a,statusByPath:o}){let s=o.get(e);return s===a?!1:(s??Jo(t,n,e),o.set(e,a),a===`ignored`&&i?r.add(e):i&&r.delete(e),!0)}function Jo(e,t,n){for(let r of Bo(n))e.set(r,(e.get(r)??0)+1),t.add(r)}function Yo(e,t,n){for(let r of Bo(n)){let n=(e.get(r)??0)-1;n>0?e.set(r,n):(e.delete(r),t.delete(r))}}function Xo(e){let t=`${e.size}`;for(let[n,r]of e)t+=`\0${n}\0${r}`;return t}var Zo=e=>e.trim().toLowerCase(),Qo=e=>e.split(`/`).at(-1)??e,$o=e=>{let t=e.toLowerCase().split(`.`),n=[];for(let e=1;e<t.length;e+=1)n.push(t.slice(e).join(`.`));return n};function es(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function ts(e){let t=cn(e),n=t.remap,r=new Map;for(let[e,n]of Object.entries(t.byFileName??{}))r.set(e.toLowerCase(),n);let i=new Map;for(let[e,n]of Object.entries(t.byFileExtension??{}))i.set(Zo(e),n);let a=Object.entries(t.byFileNameContains??{}).map(([e,t])=>[e.toLowerCase(),t]);return{resolveIcon:(e,o)=>{if(e===`file-tree-icon-file`&&o!=null){let s=Qo(o),c=s.toLowerCase(),l=r.get(c);if(l!=null)return es(l,e);for(let[t,n]of a)if(c.includes(t))return es(n,e);let u=$o(s);for(let t of u){let n=i.get(t);if(n!=null)return es(n,e)}let d=Xt(t.set,s,u);if(d!=null&&t.set!==`none`){if(d==="default"){let t=n?.[e];if(t!=null)return es(t,e)}return{name:Jt(d),remappedFrom:e,token:d}}}let s=n?.[e];return s==null?{name:e}:es(s,e)}}}var W,ns,rs,is,as,os,ss,cs,ls,us,ds={},fs=[],ps=Array.isArray,ms=fs.slice,hs=Object.assign;function gs(e){e&&e.parentNode&&e.remove()}function _s(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?ms.call(arguments,2):n),vs(e,o,r,i,null)}function vs(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++ns,__i:-1,__u:0};return i==null&&W.vnode!=null&&W.vnode(a),a}function ys(e){return e.children}function bs(e,t){this.props=e,this.context=t,this.__g=0}function xs(e,t){if(t==null)return e.__?xs(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?xs(e):null}function Ss(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return Ss(e)}}function Cs(e){(8&e.__g||!(e.__g|=8)||!rs.push(e)||as++)&&is==W.debounceRendering||((is=W.debounceRendering)||queueMicrotask)(ws)}function ws(){for(var e,t,n,r,i,a,o,s,c=1;rs.length;)rs.length>c&&rs.sort(os),e=rs.shift(),c=rs.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=hs({},r)).__v=r.__v+1,W.vnode&&W.vnode(n),Ms(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??xs(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,Ps(a,n,o),n.__e!=i&&Ss(n)));as=0}function Ts(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||fs,b=t.length;for(c=Es(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?ds:y[m.__i]||ds,m.__i=f,_=Ms(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&Ls(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=Ds(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function Es(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?vs(null,o,null,null,null):ps(o)?vs(ys,{children:o},null,null,null):o.constructor==null&&o.__b>0?vs(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=Os(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=xs(s)),Rs(s,s));return r}function Ds(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=Ds(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=xs(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Os(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function ks(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function As(e,t,n,r,i){var a;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||ks(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||ks(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(ss,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=cs,e.addEventListener(t,a?us:ls,a)):e.removeEventListener(t,a?us:ls,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function js(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=cs++;else if(t.u<n.l)return;return n(W.event?W.event(t):t)}}}function Ms(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,ee,te,ne,re,O=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=W.__b)&&d(t);n:if(typeof O==`function`)try{if(v=t.props,y=`prototype`in O&&O.prototype.render,b=(d=O.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new O(v,x):(t.__c=f=new bs(v,x),f.constructor=O,f.render=zs),b&&b.sub(f),f.props=v,f.state||={},f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&O.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=hs({},f.__s)),hs(f.__s,O.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&O.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&O.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=W.__r,w=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),T=0;T<f._sb.length;T++)f.__h.push(f._sb[T]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++w<25);f.state=f.__s,f.getChildContext!=null&&(r=hs({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===ys&&d.key==null&&(E=Fs(d.props.children)),s=Ts(e,ps(E)?E:[E],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(D=0,ee=!1,t.__u|=c?160:128,t.__c.__z=[],te=0;te<a.length;te++)(ne=a[te])==null||ee||(ne.nodeType==8&&ne.data==`$s`?(D>0&&t.__c.__z.push(ne),D++,a[te]=null):ne.nodeType==8&&ne.data==`/$s`?(--D>0&&t.__c.__z.push(ne),ee=D===0,s=a[te],a[te]=null):D>0&&(t.__c.__z.push(ne),a[te]=null));if(!ee){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(re=a.length;re--;)gs(a[re]);Ns(t)}else t.__e=n.__e,t.__k=n.__k,e.then||Ns(t);W.__e(e,t,n)}else s=t.__e=Is(n.__e,t,n,r,i,a,o,c,l,u);return(d=W.diffed)&&d(t),128&t.__u?void 0:s}function Ns(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(Ns)}function Ps(e,t,n){for(var r=0;r<n.length;r++)Ls(n[r],n[++r],n[++r]);W.__c&&W.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){W.__e(e,t.__v)}})}function Fs(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:ps(e)?e.map(Fs):hs({},e)}function Is(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(W.__m&&W.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=ms.call(e.childNodes),v=n.props||ds,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;As(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||As(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),Ts(b==`template`?e.content:e,ps(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&xs(n,0),s,c,l),a!=null)for(u=a.length;u--;)gs(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||As(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&As(e,u,g,v[u],i))}return e}function Ls(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){W.__e(e,n)}}function Rs(e,t,n){var r,i;if(W.unmount&&W.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Ls(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){W.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Rs(r[i],t,n||typeof e.type!=`function`);n||gs(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function zs(e,t,n){return this.constructor(e,n)}function Bs(e,t){var n,r,i,a;t==document&&(t=document.documentElement),W.__&&W.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=_s(ys,null,[e]),i=[],a=[],Ms(t,e,r||ds,ds,t.namespaceURI,r?null:t.firstChild?ms.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),Ps(i,e,a)}function Vs(e,t){e.__u|=32,Bs(e,t)}W={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw as=0,e}},ns=0,bs.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=hs({},this.state);typeof e==`function`&&(e=e(hs({},n),this.props)),e&&hs(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Cs(this))},bs.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),Cs(this))},bs.prototype.render=ys,rs=[],as=0,os=function(e,t){return e.__v.__b-t.__v.__b},ss=/(PointerCapture)$|Capture$/i,cs=0,ls=js(!1),us=js(!0);var Hs=0;Array.isArray;function G(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Hs,__i:-1,__u:0,__source:i,__self:a};return W.vnode&&W.vnode(l),l}var Us=16,Ws=16,Gs={};function Ks({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=Gs[e]??{width:Us,height:Ws},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return G(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`},viewBox:m,width:f,height:p,children:G(`use`,{href:c})})}var qs=e=>e!==void 0&&/\s/.test(e),Js=(e,t)=>{let n=t=>qs(e[t-1])||qs(e[t]);if(!n(t))return t;for(let r=1;r<e.length;r++){let i=t-r;if(i>0&&!n(i))return i;let a=t+r;if(a<e.length&&!n(a))return a}return t},Ys=e=>Js(e,Math.ceil(e.length/2)),Xs=e=>{if(e.length<2)return[e,``];let t=Ys(e);return[e.slice(0,t),e.slice(t)]},Zs=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:Ys(e);return[e.slice(0,r),e.slice(r)]},Qs=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},$s=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},ec=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},tc=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function nc({children:e,marker:t,variant:n=`default`}){"use no memo";return G(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:G(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?G(`span`,{"data-truncate-fade":!0}):t})})}function rc(e){"use no memo";let{mode:t,children:n}=e;return G(`div`,{children:[G(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?G(`span`,{children:n}):n}),G(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?G(`span`,{children:n}):n})]})}function ic({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=G(rc,{mode:t,children:e},`content`),o=G(nc,{marker:n,mode:t,variant:r},`marker`),s=G(`div`,{"data-truncate-fill":!0},`fill`);return G(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:G(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function ac({children:e,...t}){"use no memo";return G(ic,{mode:`truncate`,...t,children:e})}function oc({children:e,...t}){"use no memo";return G(ic,{mode:`fruncate`,...t,children:e})}function sc({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=G(ac,{...s,children:t[0]}),l=G(oc,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return G(`div`,{className:a,style:o});if(e.length<i)return G(n===`end`?oc:ac,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=Xs:r===`extension`?t=Zs:r===`leaf-path`&&(t=Qs);else if(typeof r==`number`)t=$s,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=ec:e===`first`&&(t=tc)}else typeof r==`function`&&(t=r);t??=Xs;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=G(ac,{...s,..._,children:f}),l=G(oc,{...s,...v,children:p})}return G(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[G(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),G(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var cc={endIndex:-1,startIndex:-1};function lc(e,t,n){return Math.min(Math.max(e,t),n)}function uc(e,t){return e<0||t<e?cc:{endIndex:t,startIndex:e}}function dc(e){return e.startIndex<0||e.endIndex<e.startIndex}function fc(e,t){return dc(e)?0:(e.endIndex-e.startIndex+1)*t}function pc(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function mc(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function hc(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function gc(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function _c(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function vc(e,t,n){if(e.length===0||t<=0)return[];let r=_c(e),i=hc(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=gc(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function yc(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=lc(t.scrollTop,0,o),c=t.stickyRows??vc(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=pc(s,n,t.itemHeight),m=pc(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?cc:uc(m,mc(u+d,n,t.itemHeight)),y=g+1,b=dc(v)?cc:uc(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=fc(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:dc(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var bc={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},xc={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},Sc=`Contains git status items`;function Cc(e){return e.current?!0:(e.current=!0,!1)}function wc(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function Tc(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return wc({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function Ec(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function Dc(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function Oc(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function kc(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function Ac(e,t){return e!=null&&e>0?e:t}function jc(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function Mc(e,t,n,r,i=0){let a=wc({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a==null?!1:(e.scrollTop=a,!0)}function Nc(e,t,n,r,i,a,o=0){let s=Tc({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s==null?!1:(e.scrollTop=s,!0)}function Pc(e,t,n,r,i,a){let o=Ec({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o==null?!1:(e.scrollTop=o,!0)}function Fc(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function Ic(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function Lc({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return G(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function Rc(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function zc(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var Bc,Vc,Hc,Uc,Wc=Object.is,Gc=0,Kc=[],qc=W,Jc=qc.__b,Yc=qc.__r,Xc=qc.diffed,Zc=qc.__c,Qc=qc.unmount,$c=qc.__;function el(e,t){qc.__h&&qc.__h(Vc,e,Gc||t),Gc=0;var n=Vc.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function tl(e){return Gc=1,nl(pl,e)}function nl(e,t,n){var r=el(Bc++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):pl(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);Wc(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Vc,!Vc.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,Wc(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};Vc.__f=!0;var a=Vc.shouldComponentUpdate,o=Vc.componentWillUpdate;Vc.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},Vc.shouldComponentUpdate=i}return r.__N||r.__}function rl(e,t){var n=el(Bc++,3);!qc.__s&&fl(n.__H,t)&&(n.__=e,n.u=t,Vc.__H.__h.push(n))}function il(e,t){var n=el(Bc++,4);!qc.__s&&fl(n.__H,t)&&(n.__=e,n.u=t,Vc.__h.push(n))}function K(e){return Gc=5,al(function(){return{current:e}},[])}function al(e,t){var n=el(Bc++,7);return fl(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ol(e,t){return Gc=8,al(function(){return e},t)}function sl(){for(var e;e=Kc.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ul),e.__H.__h.forEach(dl),e.__H.__h=[]}catch(t){e.__H.__h=[],qc.__e(t,e.__v)}}qc.__b=function(e){Vc=null,Jc&&Jc(e)},qc.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),$c&&$c(e,t)},qc.__r=function(e){Yc&&Yc(e),Bc=0;var t=(Vc=e.__c).__H;t&&(Hc===Vc?(t.__h=[],Vc.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(ul),t.__h.forEach(dl),t.__h=[],Bc=0)),Hc=Vc},qc.diffed=function(e){Xc&&Xc(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Kc.push(t)!==1&&Uc===qc.requestAnimationFrame||((Uc=qc.requestAnimationFrame)||ll)(sl)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),Hc=Vc=null},qc.__c=function(e,t){t.some(function(e){try{e.__h.forEach(ul),e.__h=e.__h.filter(function(e){return!e.__||dl(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],qc.__e(n,e.__v)}}),Zc&&Zc(e,t)},qc.unmount=function(e){Qc&&Qc(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{ul(e)}catch(e){t=e}}),n.__H=void 0,t&&qc.__e(t,n.__v))};var cl=typeof requestAnimationFrame==`function`;function ll(e){var t,n=function(){clearTimeout(r),cl&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);cl&&(t=requestAnimationFrame(n))}function ul(e){var t=Vc,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),Vc=t}function dl(e){var t=Vc;e.__c=e.__(),Vc=t}function fl(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!Wc(t,e[n])})}function pl(e,t){return typeof t==`function`?t(e):t}function ml(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:G(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return G(ys,{children:[G(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:G(ac,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function hl(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function gl(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function _l(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function vl({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=yc(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:_l(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?_l(u,1,t,o):i&&r<=0&&c.length>0?vc(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var yl=400,bl=10,xl=40,Sl=18;function Cl(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?wl(e,t,n):a instanceof HTMLElement?a:null}function wl(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function Tl(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function El(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function Dl(){return navigator.vendor!==`Apple Computer, Inc.`}function Ol(e,t){let n=e-t.top;if(n<xl)return-Math.ceil((xl-Math.max(0,n))/xl*Sl);let r=t.bottom-e;return r<xl?Math.ceil((xl-Math.max(0,r))/xl*Sl):0}function kl(e,t){if(e!=null){let t=bc[e];return t==null?null:{text:t,title:xc[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:Sc}:null}function Al(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function jl(e){return e!=null&&`toggle`in e}function Ml(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function Nl(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function Pl(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function Fl(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function Il(e,t){return t&&Fl(e)||(e.ctrlKey||e.metaKey)&&Ml(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var Ll=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function Rl(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function zl(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function Bl(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function Vl(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function Hl(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function Ul(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function Wl(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function Gl(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function Kl(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=Gl(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function ql(e,t){return{kind:e.kind,name:gl(e),path:t}}function Jl(e){return e==null?void 0:`${e}__tree`}function Yl(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function Xl(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function Zl(e,t){if(e==null)return null;if(`text`in e)return G(`span`,{title:e.title,children:e.text});let n=typeof e.icon==`string`?Xl(e.icon)?t(e.icon):{name:e.icon}:Xl(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return G(`span`,{title:e.title,children:G(Ks,{...n})})}function Ql(e){e!=null&&Dc(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function $l(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=hl(e);return G(ys,{children:[e.depth>0?G(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>G(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,G(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?G(Ks,{...t(`file-tree-icon-chevron`)}):G(Ks,{...t(`file-tree-icon-file`,u)})}),G(`div`,{"data-item-section":`content`,children:e.isFlattened?ml(e,c,a):c??G(sc,{minimumLength:5,split:`extension`,children:e.name})}),i?G(`div`,{"data-item-section":`decoration`,children:r==null?null:Zl(r,t)}):null,s?G(`div`,{"data-item-section":`git`,children:Zl(o,t)}):null,n?G(`div`,{"data-item-section":`action`,children:l?G(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:G(Ks,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function eu(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:w,contextMenuButtonVisibility:T,contextMenuRightClickEnabled:E,registerRenameInput:D,registerButton:ee,resolveIcon:te,renderDecorationForRow:ne,openContextMenuForRow:re,onRowClick:O,onKeyDown:k}=e,A=hl(t),{isParked:ie=!1,mode:ae=`flow`,style:oe}=r,se=ae===`sticky`,ce=_?.get(A)??null??Al(t.ancestorPaths,v,y),le=t.kind===`directory`&&(b?.has(A)??!1),j=ne(t,A),ue=kl(ce,le),de=S&&w,fe=j!=null||x||de,pe=de&&T===`always`,me=a.getPath()===A,he=me?a.getValue():``,M=se||!me?null:G(Lc,{ref:D,ariaLabel:`Rename ${gl(t)}`,isFlattened:t.isFlattened,value:he,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),ge=$l(t,te,{actionLaneEnabled:de,customDecoration:j,decorationLaneEnabled:fe,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:ue,gitLaneActive:x,renameInput:M,showDecorativeActionAffordance:pe}),_e={...Rc({ariaLabel:gl(t),domId:t.isFocused?Yl(h,A,ie):void 0,extraStyle:oe,features:{actionLaneEnabled:de,contextMenuButtonVisibility:de?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:ie,itemHeight:g,mode:ae,row:t,state:{containsGitChange:le,effectiveGitStatus:ce,isContextHovered:s===A,isDragTarget:l?.kind===`directory`&&l.directoryPath===A,isDragging:c?.has(A)===!0,isFocusRinged:t.isFocused&&o===A},targetPath:A}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),E&&(i.focusMountedPathFromInput(A),re(t,A,{anchorRect:Bl(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:se?void 0:()=>{i.focusMountedPathFromInput(A)},onKeyDown:se?void 0:k,ref:e=>{ee(A,e)}};return!se&&me?G(`div`,{..._e,children:ge}):G(`button`,{..._e,type:`button`,draggable:u&&!ie,onDragEnd:u&&!ie?p:void 0,onDragStart:u&&!ie?e=>{f(e,t,A)}:void 0,onMouseDown:e=>{if(se){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!ie?e=>{m(e,t,A)}:void 0,onClick:e=>{O(e,t,A,ae)},children:ge})}function tu(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(hl(e))).map((n,r)=>eu(e,n,t.start+r))}function nu({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=dn,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=K(null),v=K(null),y=K(!1),b=K(null),x=K(null),S=K(null),C=K(null),w=K(null),T=K(new Map),E=K(new Map),D=K(()=>{}),ee=K(null),te=K(0),ne=K(!1),re=K(null);re.current!==t&&(ne.current=!1,re.current=t);let O=K(!1),k=K(null),A=K(null),ie=K(!1),ae=K(null),oe=K(null),se=K(null),ce=K(null),le=K(null),j=K(null),ue=K(null),de=K(null),fe=K(!1),pe=K(null),me=K(null),he=K(null),M=K(null),ge=al(()=>new Map,[]),[,_e]=tl(0),ve=K(!1),[ye,be]=tl(null),[xe,Se]=tl(null),[Ce,N]=tl(null),[we,Te]=tl(null),[Ee,De]=tl(0),[P,Oe]=tl(null),ke=K(P);ke.current=P;let F=K(null),Ae=K(null),je=K(null),Me=K(null),Ne=K(null),I=K(!1),Pe=()=>{Ae.current=null,je.current=null,Me.current=null},Fe=(e,t)=>{Ae.current=e,je.current=null,Me.current=t==null?null:{path:e,scrollTop:t}},Ie=(e,t)=>{Ae.current=null,je.current={path:e,viewportOffset:t},Me.current=null},Le=K(d===`retain`&&t.isSearchOpen()),[Re,ze]=tl(p);rl(()=>{p||ze(!1)},[p]);let Be=K(!1),Ve=ol(()=>{Be.current=!0,ze(e=>e&&!1)},[]),[He,Ue]=tl(()=>vl({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[We,Ge]=tl(!1);rl(()=>{Ge(!0)},[]);let Ke=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,qe=e?.contextMenu?.triggerMode??(Ke?`right-click`:`both`),Je=qe===`both`||qe===`button`,Ye=e?.contextMenu?.buttonVisibility??`when-needed`,Xe=qe===`both`||qe===`right-click`;il(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;Ne.current=t,Se(t),Te(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(I.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let Ze=ol((e,t)=>{Hl(T.current,e,t)},[]),Qe=ol((e,t)=>{Hl(E.current,e,t)},[]),$e=ol(e=>{x.current=e},[]),et=ol(e=>Ul(e,E.current,T.current),[]),tt=n!=null||r!=null||i!=null,{resolveIcon:nt}=al(()=>ts(a),[a]),rt=t[jo](),it=rt.getPath(),at=it!=null,ot=t.isSearchOpen(),st=t.getSearchValue(),L=t.getFocusedPath(),R=t.getFocusedIndex(),ct=t.getScrollRequest(),lt=t.isDragAndDropEnabled(),ut=t.getDragSession(),dt=al(()=>ut==null?null:new Set(ut.draggedPaths),[ut]),ft=ut?.target??null,pt=ut?.primaryPath??null,mt=Jl(o),{overlayHeight:ht,overlayRows:gt,snapshot:_t,visibleRows:vt}=He,yt=_t.physical.viewportHeight,bt=al(()=>({end:_t.window.endIndex,start:_t.window.startIndex}),[_t.window.endIndex,_t.window.startIndex]),xt=gt,St=_t.sticky.rows,Ct=_t.physical.totalHeight,wt=_t.sticky.height,Tt=al(()=>new Set(St.map(e=>hl(e.row))),[St]),Et=R>=0&&R>=bt.start&&R<=bt.end,Dt=ol((e,t)=>u?.({item:ql(e,t),row:e})??null,[u]),Ot=ol(e=>Dc(e==null?null:T.current.get(e)??null)?!0:Dc(S.current),[]),kt=ol(e=>{Ot(t.focusNearestPath(e))},[t,Ot]),At=K(kt);At.current=kt;let jt=K(!0),Mt=K(()=>{}),Nt=ol((t=!0)=>{let n=ke.current;n!=null&&(jt.current=jt.current&&t,Oe(null),e?.contextMenu?.onClose?.(),jt.current&&kt(n.path))},[e?.contextMenu,kt]);Mt.current=Nt;let Pt=ol(e=>{let t=e==null?null:Vl(S.current,e);N(e=>e===t?e:t)},[]),Ft=ol((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=et(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Fe(n,e?.scrollTop??null),O.current=!0,be(e=>e===n?e:n)}i.focus(),Pt(a),jt.current=!0,Oe({anchorRect:r?.anchorRect??null,item:ql(e,n),path:n,source:r?.source??`keyboard`})},[t,et,Pt]),It=ol(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=kc(e,yt);ae.current=R<0||e==null?null:Math.max(0,Math.min(R*s-e.scrollTop,Math.max(0,t-s))),ie.current=!0}t.startRenaming(e)!==!1&&(Te(`focus`),_e(e=>e+1))}},[t,R,s,l,yt]),Lt=ol((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=kc(i,yt),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:vl({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return O.current=!0,Pc(i,a,s,l,u,d),D.current(),F.current=n?e:null,!0},[t,s,c,yt,h]),Rt=()=>y.current===!0||M.current!=null||fe.current===!0,zt=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Bt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Vt=()=>{ce.current!=null&&(clearTimeout(ce.current),ce.current=null),se.current=null},Ht=()=>{j.current?.remove(),j.current=null},Ut=()=>{Bt(oe.current),oe.current=null,le.current=null},Wt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},Gt=()=>{de.current?.(),de.current=null,M.current!=null&&(clearTimeout(M.current),M.current=null),fe.current=!1,pe.current=null,he.current=null,me.current!=null&&(me.current.setAttribute(`draggable`,`true`),me.current.style.removeProperty(`touch-action`),me.current=null),Ht(),Vt(),Ut(),ue.current=null},Kt=(e,n)=>{let r=S.current?.getRootNode(),i=Tl(Cl(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},qt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Vt();return}let r=t.getItem(e.directoryPath),i=jl(r)?r:null;if(i==null||i.isExpanded()){Vt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;se.current!==a&&(Vt(),se.current=a,ce.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind!==`directory`||n.directoryPath!==e.directoryPath||n.flattenedSegmentPath!==e.flattenedSegmentPath||i.expand()},n))},Jt=()=>{oe.current=null;let e=le.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=Ol(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,D.current()),qt(Kt(e.clientX,e.clientY)),oe.current=zt(Jt)},Yt=(e,t)=>{le.current={clientX:e,clientY:t},oe.current??=zt(Jt)},Xt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(Gt(),Ht(),Vt(),Ut(),t.startDrag(r)===!1){e.preventDefault();return}if(ue.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),Dl())){let t=El(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Wt(t),j.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Zt=()=>{Ht(),Vt(),Ut(),ue.current=null,t.cancelDrag()},Qt=(e,n,r)=>{if(M.current!=null||fe.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;he.current={clientX:i.clientX,clientY:i.clientY},me.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!fe.current;M.current!=null&&(clearTimeout(M.current),M.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),de.current===o&&(de.current=null),t&&(a.setAttribute(`draggable`,`true`),me.current===a&&(me.current=null),he.current=null)},s=e=>{let t=e.touches[0],n=he.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=bl*bl||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),de.current=o,M.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),me.current===a&&(me.current=null),he.current=null;return}fe.current=!0,me.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),ue.current=n;let e=a.getBoundingClientRect(),s=El(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),Wt(s),j.current=s,pe.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=pe.current;n!=null&&j.current!=null&&(j.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),qt(Kt(t.clientX,t.clientY)),Yt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Kt(n.clientX,n.clientY),t.completeDrag(),Gt()},u=()=>{t.cancelDrag(),Gt()};de.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},yl)},$t=e=>{if(P!=null){if(e.key===`Escape`){Nt(),e.preventDefault(),e.stopPropagation();return}Ll.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(rt.isActive()){if(e.key===`Escape`)rt.cancel();else if(e.key===`Enter`)rt.commit();else return;Te(`focus`),_e(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){It(L??void 0),e.preventDefault(),e.stopPropagation();return}if(ot){if(e.key===`Escape`)ie.current=!1,ae.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=kc(n,yt);ae.current=R<0||n==null?null:Math.max(0,Math.min(R*s-n.scrollTop,Math.max(0,r-s))),ie.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;Te(`focus`),_e(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&Nl(e)){t.openSearch(e.key),_e(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Ke&&Fl(e),r=Il(e,Ke),i=r&&S.current!=null?Oc(S.current):null,a=r?new Set(Wl(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==L&&a.has(o)){let e=C.current;Fe(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=jl(p)?p:null,h=u!=null&&(Tt.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=Ul(u,E.current,T.current);e==null||n==null?y=!1:Ft(e,u)}else if((e.ctrlKey||e.metaKey)&&Ml(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;Te(`focus`);let b=t.getFocusedPath(),x=b!=null&&(Tt.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))Fe(b,v?.scrollTop??null),O.current=!0,be(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(Ie(b,Kl(S.current,v,i,u,s,wt,yt)),O.current=!0,be(e=>e===b?e:b)):Pe()}_e(e=>e+1),e.preventDefault(),e.stopPropagation()};il(()=>{if(!(!f||!ot)){if(Le.current){Le.current=!1;return}Dc(w.current)}},[ot,f]),il(()=>{let e=x.current;switch(Ic({hasRenderedInput:e!=null,previousRenamingPath:A.current,renamingPath:it})){case`reset`:A.current=null;return;case`reveal-canonical`:it!=null&&Lt(it,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(F.current=null,A.current=it,Dc(e),e.select());return}},[bt.end,bt.start,it,Lt,Tt]),il(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=Oc(e)?.dataset.itemPath??null;be(e=>e===t?e:t)},i=()=>{n(),O.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,Oc(e)!=null){r();return}O.current=!1,be(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),O.current=!1,be(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;be(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),il(()=>{let e=S.current;e!=null&&(_t.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[_t.physical.scrollTop]),il(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;ee.current=kc(n,g);let a=()=>{let e=t.getVisibleCount(),r=Ac(ee.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Ue(vl({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!ne.current){ne.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=Ac(ee.current,g),i=t.getVisibleRows(e,e)[0]??null;Mc(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}D.current=a;let o=t.subscribe(()=>{Cc(ve)&&_e(e=>e+1),a()}),l=()=>{I.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,De(e=>e+1),e=null},50))},u=null,d=()=>{i!=null&&delete i.dataset.overlayReveal,u!=null&&(clearTimeout(u),u=null)},f=()=>{i==null||I.current===!0||n.scrollTop>0||(i.dataset.overlayReveal=`true`,u!=null&&clearTimeout(u),u=setTimeout(()=>{d()},200))},p=()=>{if(a(),n.scrollTop>0&&d(),ke.current!=null&&y.current&&Mt.current(),I.current===!0){y.current=!1;return}Se(e=>e==null?e:null),l()},m=()=>{l(),f()},_=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),v=e=>{_.has(e.key)&&m()};n.addEventListener(`scroll`,p,{passive:!0}),n.addEventListener(`wheel`,m,{passive:!0}),n.addEventListener(`touchmove`,m,{passive:!0}),n.addEventListener(`keydown`,v);let x=typeof ResizeObserver<`u`?new ResizeObserver(e=>{ee.current=(e[0]==null?null:jc(e[0]))??kc(n,g),a()}):null;return x?.observe(n),()=>{D.current=()=>{},o(),n.removeEventListener(`scroll`,p),n.removeEventListener(`wheel`,m),n.removeEventListener(`touchmove`,m),n.removeEventListener(`keydown`,v),e!=null&&clearTimeout(e),u!=null&&clearTimeout(u),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,ee.current=null,x?.disconnect()}},[t,g,s,c,h]),il(()=>{Ke||P==null||Nt(!1)},[Nt,Ke,P]);let en=al(()=>P==null?null:`${P.path}::${P.source}`,[P]);il(()=>{if(en==null){m?.clearSlotContent(an);return}let t=ke.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??zl(n.getBoundingClientRect()),close:e=>{Mt.current(e?.restoreFocus??!0)},restoreFocus:()=>{jt.current&&At.current(ke.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(an,i),e?.contextMenu?.onOpen?.(t.item,r),Ql(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&Ql(i)}),()=>{m?.clearSlotContent(an)}},[en,e?.contextMenu,m]),il(()=>{P!=null&&t.getItem(P.path)==null&&Nt()},[Nt,P,t]),il(()=>{if(P==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(Rl(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Nt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Nt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Nt,P]),il(()=>{let e=C.current,n=S.current;if(e==null||n==null){k.current=L;return}let r=L==null?null:T.current.get(L)??null,i=Oc(n),a=i?.dataset.itemPath??null,o=at&&x.current===i,c=f&&w.current===i,l=ie.current&&!ot,u=ae.current??0,d=F.current,p=Ae.current,m=je.current,g=Me.current,_=i!=null,v=O.current||_,y=k.current!==L,b=p!=null&&p===L&&L!=null,E=!1,ee=!1;if(ct!=null&&ct.id!==te.current){te.current=ct.id;let n=ct.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,yt-s))):wt;E=!0,ee=Nc(e,n,s,yt,Ct,ct.offset,t)}t.clearScrollRequest(ct.id)}let ne=!E&&l&&Pc(e,R,s,yt,Ct,u),re=!E&&d!=null&&d===L&&Pc(e,R,s,yt,Ct,wt),A=!E&&m!=null&&m.path===L&&Pc(e,R,s,yt,Ct,m.viewportOffset),oe=!E&&g!=null&&g.path===L&&e.scrollTop!==g.scrollTop;if(oe&&(e.scrollTop=g.scrollTop),(oe||ee||re||A||ne||v&&y&&d!==L&&!b&&Mc(e,R,s,yt,wt))&&D.current(),E){k.current=L;return}if(!v){k.current=L;return}if(o){k.current=L;return}if(c&&!l){k.current=L;return}if(r==null){l&&R>=0&&(Pc(e,R,s,yt,Ct,u),D.current()),k.current=L;return}(y||l||d===L||p===L||m?.path===L||g?.path===L||a==null||a!==L)&&(Dc(r),d===L&&(F.current=null),p===L&&(Ae.current=null),m?.path===L&&(je.current=null),g?.path===L&&(Me.current=null),ie.current=!1,ae.current=null),k.current=L},[t,R,L,Et,s,at,ot,bt,yt,f,ct,h,wt,Ct,vt]);let tn=R>=0&&R>=_t.visible.startIndex&&R<=_t.visible.endIndex,nn=L!=null&&xt.some(e=>hl(e.row)===L),sn=tn||nn,cn=Je&&O.current===!0&&sn?L:null,ln=we===`pointer`?xe:null,un=P?.path??Ne.current??ln??cn??xe,fn=P?.source===`right-click`;il(()=>{y.current&&P==null||Pt(et(un))},[P,et,bt,yt,Ee,xt,un,Pt,vt]);let pn=ol(e=>{if(y.current||Rl(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&Te(e=>e===`pointer`?e:`pointer`),Se(e=>e===i?e:i)},[]),mn=ol(()=>{Se(null)},[]);il(()=>{if(!lt)return;let e=()=>{Gt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Gt(),t.cancelDrag()}},[t,lt]);let hn=e=>{if(!lt||t.getDragSession()==null||fe.current)return;let n=Tl(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),qt(t.getDragSession()?.target??null),Yt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},gn=e=>{if(!lt||t.getDragSession()==null||fe.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Vt(),Ut(),t.setDragTarget(null))},_n=e=>{!lt||t.getDragSession()==null||fe.current||(e.preventDefault(),Kt(e.clientX,e.clientY),t.completeDrag(),Ht(),Vt(),Ut(),ue.current=null)},vn=_t.window.height,yn=_t.window.offsetTop,bn=Math.min(0,yt-vn),xn=Math.min(0,yt-vn-wt),Sn=ye===L||ie.current,Cn=L!=null&&Sn&&!Et&&R>=0?vt[R]??t.getVisibleRows(R,R)[0]??null:null,wn=Cn==null?null:Fc(R,s,bt,vn),Tn=ue.current,En=pt!=null&&Tn!=null&&Tn.path===pt&&Tn.index>=bt.start&&Tn.index<=bt.end,Dn=pt!=null&&Tn!=null&&Tn.path===pt&&!En&&Tn.path!==Cn?.path?Tn:null,On=Dn==null?null:Fc(Dn.index,s,bt,vn),kn=Pl((R>=0?vt[R]??t.getVisibleRows(R,R)[0]??null:null)?.ancestorPaths.at(-1)??null),An=ot&&L!=null?Yl(o,L,!Et):void 0,jn=P?.path??(ot?L:ye),Mn=P?.path??xe,Nn=et(un),Pn=Ke&&Je&&!fn&&!at&&Nn!=null&&Ce!=null&&un!=null,Fn=Ke&&(Pn||P!=null),In=P?.anchorRect,Ln=In==null&&Nn!=null&&Ce!=null&&(P!=null||Pn)?Ce:null,Rn=In==null?Ln==null?void 0:{top:`${Ln}px`}:{left:`${In.left}px`,position:`fixed`,right:`auto`,top:`${In.top}px`},zn=fn?{opacity:`0`}:void 0,Bn=ol((e,n,r,i)=>{let a=zc({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:ot,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c);break}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=_t.visible.startIndex&&n.index<=_t.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(O.current=!0,be(e=>e===c?e:c),Te(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&Lt(c,{targetOffset:`sticky-parents`})},[t,ot,_t.visible.endIndex,_t.visible.startIndex,Lt]),Vn=()=>{if(y.current||!Je||un==null||Nn==null)return;let e=t.getItem(un);e!=null&&(Pt(Nn),jt.current=!0,Oe({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:Nn.getAttribute(`aria-label`)??un,path:e.getPath()},path:e.getPath(),source:`button`}))},Hn={contextHoverPath:Mn,contextMenuButtonTriggerEnabled:Je,contextMenuButtonVisibility:Ye,contextMenuEnabled:Ke,contextMenuRightClickEnabled:Xe,contextMenuTriggerMode:qe,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:lt,draggedPathSet:dt,dragTarget:ft,gitLaneActive:tt,gitStatusByPath:n,handleRowDragEnd:Zt,handleRowDragStart:Xt,handleRowTouchStart:Qt,ignoredGitDirectories:r,ignoredInheritanceCache:ge,instanceId:o,itemHeight:s,onKeyDown:$t,onRowClick:Bn,openContextMenuForRow:Ft,registerButton:Ze,registerRenameInput:$e,renameView:rt,renderDecorationForRow:Dt,resolveIcon:nt,shouldSuppressContextMenu:Rt,visualFocusPath:jn},Un={...Hn,registerButton:Qe};return G(`div`,{ref:S,id:mt,"data-file-tree-context-menu-button-visibility":Ke&&Je?Ye:void 0,"data-file-tree-context-menu-trigger-mode":Ke?qe:void 0,"data-file-tree-has-context-menu-action-lane":Ke&&Je?`true`:void 0,"data-file-tree-has-git-lane":tt?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:lt?gn:void 0,onDragOver:lt?hn:void 0,onDrop:lt?_n:void 0,onKeyDown:$t,onPointerLeave:Ke?mn:void 0,onPointerOver:Ke?pn:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[G(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:kn}}),G(`slot`,{name:rn,"data-type":`header-slot`}),f?G(`div`,{"data-file-tree-search-container":!0,"data-open":ot?`true`:`false`,children:G(`input`,{ref:w,"aria-activedescendant":An,"aria-controls":mt,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Re?`true`:void 0,value:st,onBlur:()=>{d===`retain`&&!Be.current||t.closeSearch()},onFocus:Ve,onPointerDown:Ve,onInput:e=>{Ve();let n=e.currentTarget;t.setSearch(n.value)}})}):null,G(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&We&&xt.length>0?G(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:G(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${ht}px`},children:xt.map((e,t)=>eu(Un,e.row,`sticky:${hl(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${xt.length-t}`}}))})}):null,G(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${Ct}px`},children:[G(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${yn}px`}}),G(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${vn}px`,top:`${bn}px`,bottom:`${xn}px`},children:[tu(Hn,bt,Tt),Cn!=null&&wn!=null?eu(Hn,Cn,`parked:${Cn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:pt===Cn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${wn}px`}}):null,Dn!=null&&On!=null?eu(Hn,Dn,`parked-drag:${Dn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${On}px`}}):null]})]})]}),Ke?G(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":Fn?`true`:`false`,style:Rn,children:[G(`button`,{ref:v,type:`button`,"data-type":on,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":P==null?`false`:`true`,"data-visible":Pn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),P!=null){Nt();return}Vn()},tabIndex:-1,style:zn,children:G(Ks,{...nt(`file-tree-icon-ellipsis`)})}),P==null?null:G(`slot`,{name:an})]}):null,P==null?null:G(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Nt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Nt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var ru={hydrateRoot:(e,t)=>{Vs(_s(nu,t),e)},renderRoot:(e,t)=>{Bs(_s(nu,t),e)},unmountRoot:e=>{Bs(null,e)}};function iu(e,t){ru.renderRoot(e,t)}function au(e,t){ru.hydrateRoot(e,t)}function ou(e){ru.unmountRoot(e)}var su=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}},cu=`__c`,lu=`__k`,uu=`__d`,du=`__s`,fu=/[\s\n\\/='"\0<>]/,pu=/^(xlink|xmlns|xml)([A-Z])/,mu=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,hu=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,gu=new Set([`draggable`,`spellcheck`]);function _u(e){e.__g===void 0?e[uu]=!0:e.__g|=8}function vu(e){e.__g===void 0?e[uu]=!1:e.__g&=-9}function yu(e){return e.__g===void 0?!0===e[uu]:!!(8&e.__g)}var bu=/["&<]/;function xu(e){if(e.length===0||!1===bu.test(e))return e;for(var t=0,n=0,r=``,i=``;n<e.length;n++){switch(e.charCodeAt(n)){case 34:i=`&quot;`;break;case 38:i=`&amp;`;break;case 60:i=`&lt;`;break;default:continue}n!==t&&(r+=e.slice(t,n)),r+=i,t=n+1}return n!==t&&(r+=e.slice(t,n)),r}var Su={},Cu=new Set(`animation-iteration-count.border-image-outset.border-image-slice.border-image-width.box-flex.box-flex-group.box-ordinal-group.column-count.fill-opacity.flex.flex-grow.flex-negative.flex-order.flex-positive.flex-shrink.flood-opacity.font-weight.grid-column.grid-row.line-clamp.line-height.opacity.order.orphans.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.widows.z-index.zoom`.split(`.`)),wu=/[A-Z]/g;function Tu(e){var t=``;for(var n in e){var r=e[n];if(r!=null&&r!==``){var i=n[0]==`-`?n:Su[n]||(Su[n]=n.replace(wu,`-$&`).toLowerCase()),a=`;`;typeof r!=`number`||i.startsWith(`--`)||Cu.has(i)||(a=`px;`),t=t+i+`:`+r+a}}return t||void 0}function Eu(){this.__d=!0}function Du(e,t){return{__v:e,context:t,props:e.props,setState:Eu,forceUpdate:Eu,__d:!0,__h:[]}}function Ou(e,t,n){if(!e.s){if(n instanceof ku){if(!n.s)return void(n.o=Ou.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(Ou.bind(null,e,t),Ou.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var ku=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{Ou(r,1,a(this.v))}catch(e){Ou(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?Ou(r,1,t?t(i):i):n?Ou(r,1,n(i)):Ou(r,2,i)}catch(e){Ou(r,2,e)}},r},e}(),Au,ju,Mu,Nu,Pu={},Fu=Array.isArray,Iu=Object.assign,Lu=``,Ru=`<!--$s-->`,zu=`<!--/$s-->`;function Bu(e,t){var n,r=e.type,i=!0;return e[cu]?(i=!1,(n=e[cu]).state=n[du]):n=new r(e.props,t),e[cu]=n,n.__v=e,n.props=e.props,n.context=t,_u(n),n.state??=Pu,n[du]??(n[du]=n.state),r.getDerivedStateFromProps?n.state=Iu({},n.state,r.getDerivedStateFromProps(n.props,n.state)):i&&n.componentWillMount?(n.componentWillMount(),n.state=n[du]===n.state?n.state:n[du]):!i&&n.componentWillUpdate&&n.componentWillUpdate(),Mu&&Mu(e),n.render(n.props,n.state,t)}function Vu(e,t,n,r,i,a,o){if(e==null||!0===e||!1===e||e===Lu)return Lu;var s=typeof e;if(s!=`object`)return s==`function`?Lu:s==`string`?xu(e):e+Lu;if(Fu(e)){var c,l=Lu;i[lu]=e;for(var u=e.length,d=0;d<u;d++){var f=e[d];if(f!=null&&typeof f!=`boolean`){var p,m=Vu(f,t,n,r,i,a,o);typeof m==`string`?l+=m:(c||=Array(u),l&&c.push(l),l=Lu,Fu(m)?(p=c).push.apply(p,m):c.push(m))}}return c?(l&&c.push(l),c):l}if(e.constructor!==void 0)return Lu;e.__=i,Au&&Au(e);var h=e.type,g=e.props;if(typeof h==`function`){var _,v,y,b=t;if(h===ys){if(`tpl`in g){for(var x=Lu,S=0;S<g.tpl.length;S++)if(x+=g.tpl[S],g.exprs&&S<g.exprs.length){var C=g.exprs[S];if(C==null)continue;typeof C!=`object`||C.constructor!==void 0&&!Fu(C)?x+=C:x+=Vu(C,t,n,r,e,a,o)}return x}if(`UNSTABLE_comment`in g)return`<!--`+xu(g.UNSTABLE_comment)+`-->`;v=g.children}else{if((_=h.contextType)!=null){var w=t[_.__c];b=w?w.props.value:_.__}var T=h.prototype&&typeof h.prototype.render==`function`;if(T)v=Bu(e,b),y=e[cu];else{e[cu]=y=Du(e,b);for(var E=0;yu(y)&&E++<25;){vu(y),Mu&&Mu(e);try{v=h.call(y,g,b)}catch(t){throw a&&t&&typeof t.then==`function`&&(e._suspended=!0),t}}_u(y)}if(y.getChildContext!=null&&(t=Iu({},t,y.getChildContext())),T&&W.errorBoundaries&&(h.getDerivedStateFromError||y.componentDidCatch)){v=v!=null&&v.type===ys&&v.key==null&&v.props.tpl==null?v.props.children:v;try{return Vu(v,t,n,r,e,a,!1)}catch(i){return h.getDerivedStateFromError&&(y[du]=h.getDerivedStateFromError(i)),y.componentDidCatch&&y.componentDidCatch(i,Pu),yu(y)?(v=Bu(e,t),(y=e[cu]).getChildContext!=null&&(t=Iu({},t,y.getChildContext())),Vu(v=v!=null&&v.type===ys&&v.key==null&&v.props.tpl==null?v.props.children:v,t,n,r,e,a,o)):Lu}finally{ju&&ju(e),Nu&&Nu(e)}}}v=v!=null&&v.type===ys&&v.key==null&&v.props.tpl==null?v.props.children:v;try{var D=Vu(v,t,n,r,e,a,o);return ju&&ju(e),W.unmount&&W.unmount(e),e._suspended?typeof D==`string`?Ru+D+zu:Fu(D)?(D.unshift(Ru),D.push(zu),D):D.then(function(e){return Ru+e+zu}):D}catch(i){if(!a&&o&&o.onError){var ee=function i(s){return o.onError(s,e,function(e,s){try{return Vu(e,t,n,r,s,a,o)}catch(e){return i(e)}})}(i);if(ee!==void 0)return ee;var te=W.__e;return te&&te(i,e),Lu}if(!a||!i||typeof i.then!=`function`)throw i;return i.then(function i(){try{var s=Vu(v,t,n,r,e,a,o);return e._suspended?Ru+s+zu:s}catch(e){if(!e||typeof e.then!=`function`)throw e;return e.then(i)}})}}var ne,re=`<`+h,O=Lu;for(var k in g){var A=g[k];if(typeof(A=Uu(A)?A.value:A)!=`function`||k===`class`||k===`className`){switch(k){case`children`:ne=A;continue;case`key`:case`ref`:case`__self`:case`__source`:continue;case`htmlFor`:if(`for`in g)continue;k=`for`;break;case`className`:if(`class`in g)continue;k=`class`;break;case`defaultChecked`:k=`checked`;break;case`defaultSelected`:k=`selected`;break;case`defaultValue`:case`value`:switch(k=`value`,h){case`textarea`:ne=A;continue;case`select`:r=A;continue;case`option`:r!=A||`selected`in g||(re+=` selected`)}break;case`dangerouslySetInnerHTML`:O=A&&A.__html;continue;case`style`:typeof A==`object`&&(A=Tu(A));break;case`acceptCharset`:k=`accept-charset`;break;case`httpEquiv`:k=`http-equiv`;break;default:if(pu.test(k))k=k.replace(pu,`$1:$2`).toLowerCase();else{if(fu.test(k))continue;k[4]!==`-`&&!gu.has(k)||A==null?n?hu.test(k)&&(k=k===`panose1`?`panose-1`:k.replace(/([A-Z])/g,`-$1`).toLowerCase()):mu.test(k)&&(k=k.toLowerCase()):A+=Lu}}A!=null&&!1!==A&&(re=!0===A||A===Lu?re+` `+k:re+` `+k+`="`+(typeof A==`string`?xu(A):A+Lu)+`"`)}}if(fu.test(h))throw Error(h+` is not a valid HTML tag name in `+re+`>`);if(O||(typeof ne==`string`?O=xu(ne):ne!=null&&!1!==ne&&!0!==ne&&(O=Vu(ne,t,h===`svg`||h!==`foreignObject`&&n,r,e,a,o))),ju&&ju(e),Nu&&Nu(e),!O&&Hu.has(h))return re+`/>`;var ie=`</`+h+`>`,ae=re+`>`;return Fu(O)?[ae].concat(O,[ie]):typeof O==`string`?ae+O+ie:[ae,O,ie]}var Hu=new Set([`area`,`base`,`br`,`col`,`command`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function Uu(e){return typeof e==`object`&&!!e&&typeof e.peek==`function`&&`value`in e}var Wu=0;function Gu(e){return e!=null&&e.length>0?e:(Wu+=1,`pst_ft_${Wu}`)}function Ku({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??dn)}function qu(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function Ju(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function Yu(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var Xu=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new su;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=Gu(a),this.#p=Ho(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=un(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new Lo({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(ou(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}applyGitStatusPatch(e){let t=Uo(this.#p,e);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&iu(n.wrapper,this.#w())}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){Array.isArray(e)?this.#t.resetPaths(e,t):this.#t.resetPaths(e)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),iu(t.wrapper,this.#w()))}setGitStatus(e){let t=Ho(e,this.#p);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&iu(n.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),iu(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),au(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),iu(r,this.#w())}#C(){return{initialViewportHeight:Ku({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(rn,e());return}this.#l.setSlotHtml(rn,this.#e?.header?.html??null)}#k(e){let t=Yu(e).find(e=>Ju(e)),n=qu(qt(cn(this.#m).set));n!=null&&(t!=null&&t.outerHTML===n.outerHTML||(t==null?e.prepend(n):t.replaceWith(n)))}#A(e){let t=Yu(e),n=t.find(e=>Ju(e)),r=t.filter(e=>e!==n),i=cn(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=qu(i);if(a==null){for(let e of r)e.remove();return}if(!(r.length===1&&r[0].outerHTML===a.outerHTML)){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=cn(this.#m);t.colored&&Yt(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${$t}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}this.#g?.parentNode===e&&this.#_===this.#h||(this.#g??=document.createElement(`style`),this.#g.setAttribute($t,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=hn(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return xn(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}};function Zu(e){let t=e.trim();if(t)return ed(t)??$u(t)}function Qu(e){let t=e.split(`/`);return(t.length===2||t.length===3)&&t.every(e=>e.length>0&&!/\s/.test(e))}function $u(e){let t=e.match(/^(?:(.+)#)?(\d+)$/);if(!t)return;let n=Number(t[2]),r=t[1];if(!(!Number.isSafeInteger(n)||n<=0)&&!(r&&!Qu(r)))return{repository:r,number:n}}function ed(e){let t;try{t=new URL(e)}catch{return}if(t.protocol!==`https:`&&t.protocol!==`http:`)return;let[n,r,i,a]=t.pathname.split(`/`).filter(Boolean);if(!(!n||!r||!a||![`pull`,`pulls`].includes(i??``)))return $u(`${t.hostname===`github.com`?`${n}/${r}`:`${t.host}/${n}/${r}`}#${a}`)}var td=Object.create,nd=Object.defineProperty,rd=Object.getOwnPropertyDescriptor,id=Object.getOwnPropertyNames,ad=Object.getPrototypeOf,od=Object.prototype.hasOwnProperty,sd=(e,t)=>function(){return t||(0,e[id(e)[0]])((t={exports:{}}).exports,t),t.exports},cd=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=id(t),a=0,o=i.length,s;a<o;a++)s=i[a],!od.call(e,s)&&s!==n&&nd(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=rd(t,s))||r.enumerable});return e},ld=(e,t,n)=>(n=e==null?{}:td(ad(e)),cd(t||!e||!e.__esModule?nd(n,`default`,{value:e,enumerable:!0}):n,e)),ud=sd({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(e){"@babel/helpers - typeof";return t.exports=n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),dd=sd({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=ud().default;function r(e,t){if(n(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),fd=sd({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=ud().default,r=dd();function i(e){var t=r(e,`string`);return n(t)==`symbol`?t:t+``}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}}),pd=sd({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=fd();function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),md=sd({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=pd();function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]==null?{}:arguments[t];t%2?r(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}});function hd(e){let t={subscribe(t){let n=null,r=!1,i=!1,a=!1;function o(){if(n===null){a=!0;return}i||(i=!0,typeof n==`function`?n():n&&n.unsubscribe())}return n=e({next(e){var n;r||(n=t.next)==null||n.call(t,e)},error(e){var n;r||(r=!0,(n=t.error)==null||n.call(t,e),o())},complete(){var e;r||(r=!0,(e=t.complete)==null||e.call(t),o())}}),a&&o(),{unsubscribe:o}},pipe(...e){return e.reduce(gd,t)}};return t}function gd(e,t){return t(e)}function _d(e){let t=new AbortController;return new Promise((n,r)=>{let i=!1;function a(){i||(i=!0,o.unsubscribe())}t.signal.addEventListener(`abort`,()=>{r(t.signal.reason)});let o=e.subscribe({next(e){i=!0,n(e),a()},error(e){r(e)},complete(){t.abort(),a()}})})}function vd(e){return e=>{let t=0,n=null,r=[];function i(){n||=e.subscribe({next(e){for(let n of r){var t;(t=n.next)==null||t.call(n,e)}},error(e){for(let n of r){var t;(t=n.error)==null||t.call(n,e)}},complete(){for(let t of r){var e;(e=t.complete)==null||e.call(t)}}})}function a(){if(t===0&&n){let e=n;n=null,e.unsubscribe()}}return hd(e=>(t++,r.push(e),i(),{unsubscribe(){t--,a();let n=r.findIndex(t=>t===e);n>-1&&r.splice(n,1)}}))}}function yd(e){let t=e,n=[],r=e=>{t!==void 0&&e.next(t),n.push(e)},i=e=>{n.splice(n.indexOf(e),1)},a=hd(e=>(r(e),()=>{i(e)}));return a.next=e=>{if(t!==e){t=e;for(let t of n)t.next(e)}},a.get=()=>t,a}function bd(e){return hd(t=>{function n(t=0,r=e.op){let i=e.links[t];if(!i)throw Error(`No more links to execute - did you forget to add an ending link?`);return i({op:r,next(e){return n(t+1,e)}})}return n().subscribe(t)})}function xd(e){return!!e&&!Array.isArray(e)&&typeof e==`object`}function Sd(){return Object.create(null)}var Cd={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603,UNAUTHORIZED:-32001,PAYMENT_REQUIRED:-32002,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNSUPPORTED_MEDIA_TYPE:-32015,UNPROCESSABLE_CONTENT:-32022,PRECONDITION_REQUIRED:-32028,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};Cd.BAD_GATEWAY,Cd.SERVICE_UNAVAILABLE,Cd.GATEWAY_TIMEOUT,Cd.INTERNAL_SERVER_ERROR;var wd=Object.create,Td=Object.defineProperty,Ed=Object.getOwnPropertyDescriptor,Dd=Object.getOwnPropertyNames,Od=Object.getPrototypeOf,kd=Object.prototype.hasOwnProperty,Ad=(e,t)=>function(){return t||(0,e[Dd(e)[0]])((t={exports:{}}).exports,t),t.exports},jd=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Dd(t),a=0,o=i.length,s;a<o;a++)s=i[a],!kd.call(e,s)&&s!==n&&Td(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Ed(t,s))||r.enumerable});return e},Md=(e,t,n)=>(n=e==null?{}:wd(Od(e)),jd(t||!e||!e.__esModule?Td(n,`default`,{value:e,enumerable:!0}):n,e)),Nd=()=>{},Pd=e=>{Object.freeze&&Object.freeze(e)};function Fd(e,t,n){let r=t.join(`.`);return n[r]??(n[r]=new Proxy(Nd,{get(r,i){if(!(typeof i!=`string`||i===`then`))return Fd(e,[...t,i],n)},apply(n,r,i){let a=t[t.length-1];if(a===`valueOf`||a===`toString`||a===`toJSON`)return`tRPC.proxy(${t.slice(0,-1).join(`.`)})`;let o={args:i,path:t};return a===`call`?o={args:i.length>=2?[i[1]]:[],path:t.slice(0,-1)}:a===`apply`&&(o={args:i.length>=2?i[1]:[],path:t.slice(0,-1)}),Pd(o.args),Pd(o.path),e(o)}})),n[r]}var Id=e=>Fd(e,[],Sd()),Ld=e=>new Proxy(Nd,{get(t,n){if(n!==`then`)return e(n)}}),Rd=Ad({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(e){"@babel/helpers - typeof";return t.exports=n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),zd=Ad({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=Rd().default;function r(e,t){if(n(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Bd=Ad({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=Rd().default,r=zd();function i(e){var t=r(e,`string`);return n(t)==`symbol`?t:t+``}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}}),Vd=Ad({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=Bd();function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Hd=Ad({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=Vd();function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]==null?{}:arguments[t];t%2?r(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}});Md(Hd(),1),Md(Vd(),1);var Ud=Md(Hd(),1);function Wd(e,t){if(`error`in e){let n=t.deserialize(e.error);return{ok:!1,error:(0,Ud.default)((0,Ud.default)({},e),{},{error:n})}}return{ok:!0,result:(0,Ud.default)((0,Ud.default)({},e.result),(!e.result.type||e.result.type===`data`)&&{type:`data`,data:t.deserialize(e.result.data)})}}var Gd=class extends Error{constructor(){super(`Unable to transform response from server`)}};function Kd(e,t){let n;try{n=Wd(e,t)}catch{throw new Gd}if(!n.ok&&(!xd(n.error.error)||typeof n.error.error.code!=`number`)||n.ok&&!xd(n.result))throw new Gd;return n}Md(Hd(),1);var qd=ld(pd(),1),Jd=ld(md(),1);function Yd(e){return e instanceof Qd}function Xd(e){return xd(e)&&xd(e.error)&&typeof e.error.code==`number`&&typeof e.error.message==`string`}function Zd(e,t){return typeof e==`string`?e:xd(e)&&typeof e.message==`string`?e.message:t}var Qd=class e extends Error{constructor(t,n){var r,i;let a=n?.cause;super(t,{cause:a}),(0,qd.default)(this,`cause`,void 0),(0,qd.default)(this,`shape`,void 0),(0,qd.default)(this,`data`,void 0),(0,qd.default)(this,`meta`,void 0),this.meta=n?.meta,this.cause=a,this.shape=n==null||(r=n.result)==null?void 0:r.error,this.data=n==null||(i=n.result)==null?void 0:i.error.data,this.name=`TRPCClientError`,Object.setPrototypeOf(this,e.prototype)}static from(t,n={}){let r=t;return Yd(r)?(n.meta&&(r.meta=(0,Jd.default)((0,Jd.default)({},r.meta),n.meta)),r):Xd(r)?new e(r.error.message,(0,Jd.default)((0,Jd.default)({},n),{},{result:r,cause:n.cause})):new e(Zd(r,`Unknown error`),(0,Jd.default)((0,Jd.default)({},n),{},{cause:r}))}};function $d(e){let t=e;return t?`input`in t?t:{input:t,output:t}:{input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}}}var ef=e=>typeof e==`function`;function tf(e){if(e)return e;if(typeof window<`u`&&ef(window.fetch))return window.fetch;if(typeof globalThis<`u`&&ef(globalThis.fetch))return globalThis.fetch;throw Error(`No fetch implementation found`)}var nf=ld(md());function rf(e){return{url:e.url.toString(),fetch:e.fetch,transformer:$d(e.transformer),methodOverride:e.methodOverride}}function af(e){let t={};for(let n=0;n<e.length;n++)t[n]=e[n];return t}var of={query:`GET`,mutation:`POST`,subscription:`PATCH`};function sf(e){return`input`in e?e.transformer.input.serialize(e.input):af(e.inputs.map(t=>e.transformer.input.serialize(t)))}var cf=e=>{let t=e.url.split(`?`),n=t[0].replace(/\/$/,``)+`/`+e.path,r=[];if(t[1]&&r.push(t[1]),`inputs`in e&&r.push(`batch=1`),e.type===`query`||e.type===`subscription`){let t=sf(e);t!==void 0&&e.methodOverride!==`POST`&&r.push(`input=${encodeURIComponent(JSON.stringify(t))}`)}return r.length&&(n+=`?`+r.join(`&`)),n},lf=e=>{if(e.type===`query`&&e.methodOverride!==`POST`)return;let t=sf(e);return t===void 0?void 0:JSON.stringify(t)},uf=e=>mf((0,nf.default)((0,nf.default)({},e),{},{contentTypeHeader:`application/json`,getUrl:cf,getBody:lf})),df=class extends Error{constructor(){let e=`AbortError`;super(e),this.name=e,this.message=e}},ff=e=>{var t;if(e?.aborted)throw(t=e.throwIfAborted)==null||t.call(e),typeof DOMException<`u`?new DOMException(`AbortError`,`AbortError`):new df};async function pf(e){ff(e.signal);let t=e.getUrl(e),n=e.getBody(e),r=e.methodOverride??of[e.type],i=await(async()=>{let t=await e.headers();return Symbol.iterator in t?Object.fromEntries(t):t})(),a=(0,nf.default)((0,nf.default)((0,nf.default)({},e.contentTypeHeader&&r!==`GET`?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{[e.trpcAcceptHeaderKey??`trpc-accept`]:e.trpcAcceptHeader}:void 0),i);return tf(e.fetch)(t,{method:r,signal:e.signal,body:n,headers:a})}async function mf(e){let t={},n=await pf(e);t.response=n;let r=await n.json();return t.responseJSON=r,{json:r,meta:t}}ld(md(),1);var hf=()=>{throw Error(`Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new`)};function gf(e){let t=null,n=null,r=()=>{clearTimeout(n),n=null,t=null};function i(t){let n=[[]],r=0;for(;;){let o=t[r];if(!o)break;let s=n[n.length-1];if(o.aborted){var i;(i=o.reject)==null||i.call(o,Error(`Aborted`)),r++;continue}if(e.validate(s.concat(o).map(e=>e.key))){s.push(o),r++;continue}if(s.length===0){var a;(a=o.reject)==null||a.call(o,Error(`Input is too big for a single dispatch`)),r++;continue}n.push([])}return n}function a(){let n=i(t);r();for(let t of n){if(!t.length)continue;let n={items:t};for(let e of t)e.batch=n;e.fetch(n.items.map(e=>e.key)).then(async e=>{await Promise.all(e.map(async(e,t)=>{let r=n.items[t];try{var i;let t=await Promise.resolve(e);(i=r.resolve)==null||i.call(r,t)}catch(e){var a;(a=r.reject)==null||a.call(r,e)}r.batch=null,r.reject=null,r.resolve=null}));for(let e of n.items){var t;(t=e.reject)==null||t.call(e,Error(`Missing result`)),e.batch=null}}).catch(e=>{for(let r of n.items){var t;(t=r.reject)==null||t.call(r,e),r.batch=null}})}}function o(e){let r={aborted:!1,key:e,batch:null,resolve:hf,reject:hf},i=new Promise((e,n)=>{r.reject=n,r.resolve=e,t??=[],t.push(r)});return n??=setTimeout(a),i}return{load:o}}function _f(...e){let t=new AbortController,n=e.length,r=0,i=()=>{++r===n&&t.abort()};for(let t of e)t?.aborted?i():t?.addEventListener(`abort`,i,{once:!0});return t.signal}var vf=ld(md(),1);function yf(e){let t=rf(e),n=e.maxURLLength??1/0,r=e.maxItems??1/0;return()=>{let i=i=>({validate(e){if(n===1/0&&r===1/0)return!0;if(e.length>r)return!1;let a=e.map(e=>e.path).join(`,`),o=e.map(e=>e.input);return cf((0,vf.default)((0,vf.default)({},t),{},{type:i,path:a,inputs:o,signal:null})).length<=n},async fetch(n){let r=n.map(e=>e.path).join(`,`),a=n.map(e=>e.input),o=_f(...n.map(e=>e.signal)),s=await uf((0,vf.default)((0,vf.default)({},t),{},{path:r,inputs:a,type:i,headers(){return e.headers?typeof e.headers==`function`?e.headers({opList:n}):e.headers:{}},signal:o}));return(Array.isArray(s.json)?s.json:n.map(()=>s.json)).map(e=>({meta:s.meta,json:e}))}}),a={query:gf(i(`query`)),mutation:gf(i(`mutation`))};return({op:e})=>hd(n=>{if(e.type===`subscription`)throw Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let r=a[e.type].load(e),i;return r.then(e=>{i=e;let r=Kd(e.json,t.transformer.output);if(!r.ok){n.error(Qd.from(r.error,{meta:e.meta}));return}n.next({context:e.meta,result:r.result}),n.complete()}).catch(e=>{n.error(Qd.from(e,{meta:i?.meta}))}),()=>{}})}}ld(md(),1);var bf=(e,...t)=>typeof e==`function`?e(...t):e;ld(pd(),1);function xf(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}async function Sf(e){let t=await bf(e.url);return e.connectionParams?t+`${t.includes(`?`)?`&`:`?`}connectionParams=1`:t}async function Cf(e,t){let n={method:`connectionParams`,data:await bf(e)};return t.encode(n)}ld(pd(),1);var wf=ld(pd(),1);function Tf(e){let{promise:t,resolve:n,reject:r}=xf();return e.addEventListener(`open`,()=>{e.removeEventListener(`error`,r),n()}),e.addEventListener(`error`,r),t}function Ef(e,{intervalMs:t,pongTimeoutMs:n}){let r,i;function a(){r=setTimeout(()=>{e.send(`PING`),i=setTimeout(()=>{e.close()},n)},t)}function o(){clearTimeout(r),a()}function s(){clearTimeout(i),o()}e.addEventListener(`open`,a),e.addEventListener(`message`,({data:e})=>{clearTimeout(r),a(),e===`PONG`&&s()}),e.addEventListener(`close`,()=>{clearTimeout(r),clearTimeout(i)})}var Df=class e{constructor(t){if((0,wf.default)(this,`id`,++e.connectCount),(0,wf.default)(this,`WebSocketPonyfill`,void 0),(0,wf.default)(this,`urlOptions`,void 0),(0,wf.default)(this,`keepAliveOpts`,void 0),(0,wf.default)(this,`encoder`,void 0),(0,wf.default)(this,`wsObservable`,yd(null)),(0,wf.default)(this,`openPromise`,null),this.WebSocketPonyfill=t.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive,this.encoder=t.encoder}get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var t=this;if(t.openPromise)return t.openPromise;t.id=++e.connectCount,t.openPromise=Sf(t.urlOptions).then(e=>new t.WebSocketPonyfill(e)).then(async e=>{t.ws=e,e.binaryType=`arraybuffer`,e.addEventListener(`message`,function({data:e}){e===`PING`&&this.send(`PONG`)}),t.keepAliveOpts.enabled&&Ef(e,t.keepAliveOpts),e.addEventListener(`close`,()=>{t.ws===e&&(t.ws=null)}),await Tf(e),t.urlOptions.connectionParams&&e.send(await Cf(t.urlOptions.connectionParams,t.encoder))});try{await t.openPromise}finally{t.openPromise=null}}async close(){var e=this;try{await e.openPromise}finally{var t;(t=e.ws)==null||t.close()}}};(0,wf.default)(Df,`connectCount`,0),ld(pd(),1),ld(md(),1);var Of=ld(pd(),1),kf=ld(md(),1),Af=class{constructor(e){(0,Of.default)(this,`links`,void 0),(0,Of.default)(this,`runtime`,void 0),(0,Of.default)(this,`requestId`,void 0),this.requestId=0,this.runtime={},this.links=e.links.map(e=>e(this.runtime))}$request(e){return bd({links:this.links,op:(0,kf.default)((0,kf.default)({},e),{},{context:e.context??{},id:++this.requestId})}).pipe(vd())}async requestAsPromise(e){var t=this;try{return(await _d(t.$request(e))).result.data}catch(e){throw Qd.from(e)}}query(e,t,n){return this.requestAsPromise({type:`query`,path:e,input:t,context:n?.context,signal:n?.signal})}mutation(e,t,n){return this.requestAsPromise({type:`mutation`,path:e,input:t,context:n?.context,signal:n?.signal})}subscription(e,t,n){return this.$request({type:`subscription`,path:e,input:t,context:n.context,signal:n.signal}).subscribe({next(e){switch(e.result.type){case`state`:var t;(t=n.onConnectionStateChange)==null||t.call(n,e.result);break;case`started`:var r;(r=n.onStarted)==null||r.call(n,{context:e.context});break;case`stopped`:var i;(i=n.onStopped)==null||i.call(n);break;case`data`:case void 0:var a;(a=n.onData)==null||a.call(n,e.result.data);break}},error(e){var t;(t=n.onError)==null||t.call(n,e)},complete(){var e;(e=n.onComplete)==null||e.call(n)}})}},jf=Symbol.for(`trpc_untypedClient`),Mf={query:`query`,mutate:`mutation`,subscribe:`subscription`},Nf=e=>Mf[e];function Pf(e){let t=Id(({path:t,args:n})=>{let r=[...t],i=Nf(r.pop()),a=r.join(`.`);return e[i](a,...n)});return Ld(n=>n===jf?e:t[n])}function Ff(e){return Pf(new Af(e))}ld(md(),1),ld(md(),1),ld(sd({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function n(e){var t,n,i,a=2;for(typeof Symbol<`u`&&(n=Symbol.asyncIterator,i=Symbol.iterator);a--;){if(n&&(t=e[n])!=null)return t.call(e);if(i&&(t=e[i])!=null)return new r(t.call(e));n=`@@asyncIterator`,i=`@@iterator`}throw TypeError(`Object is not async iterable`)}function r(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+` is not an object.`));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return r=function(e){this.s=e,this.n=e.next},r.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return n===void 0?Promise.reject(e):t(n.apply(this.s,arguments))}},new r(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}})(),1),ld(md(),1);var If=sd({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e,t){function n(){var e=typeof SuppressedError==`function`?SuppressedError:function(e,t){var n=Error();return n.name=`SuppressedError`,n.error=e,n.suppressed=t,n},t={},n=[];function r(e,t){if(t!=null){if(Object(t)!==t)throw TypeError(`using declarations can only be used with objects, functions, null, or undefined.`);if(e)var r=t[Symbol.asyncDispose||Symbol.for(`Symbol.asyncDispose`)];if(r===void 0&&(r=t[Symbol.dispose||Symbol.for(`Symbol.dispose`)],e))var i=r;if(typeof r!=`function`)throw TypeError(`Object is not disposable.`);i&&(r=function(){try{i.call(t)}catch(e){return Promise.reject(e)}}),n.push({v:t,d:r,a:e})}else e&&n.push({d:t,a:e});return t}return{e:t,u:r.bind(null,!1),a:r.bind(null,!0),d:function(){var r,i=this.e,a=0;function o(){for(;r=n.pop();)try{if(!r.a&&a===1)return a=0,n.push(r),Promise.resolve().then(o);if(r.d){var e=r.d.call(r.v);if(r.a)return a|=2,Promise.resolve(e).then(o,s)}else a|=1}catch(e){return s(e)}if(a===1)return i===t?Promise.resolve():Promise.reject(i);if(i!==t)throw i}function s(n){return i=i===t?n:new e(n,i),o()}return o()}}}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Lf=sd({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(e,t){function n(e,t){this.v=e,this.k=t}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Rf=sd({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e,t){var n=Lf();function r(e){return new n(e,0)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),zf=sd({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e,t){var n=Lf();function r(e){return function(){return new i(e.apply(this,arguments))}}function i(e){var t,r;function i(t,r){try{var o=e[t](r),s=o.value,c=s instanceof n;Promise.resolve(c?s.v:s).then(function(n){if(c){var r=t===`return`?`return`:`next`;if(!s.k||n.done)return i(r,n);n=e[r](n).value}a(o.done?`return`:`normal`,n)},function(e){i(`throw`,e)})}catch(e){a(`throw`,e)}}function a(e,n){switch(e){case`return`:t.resolve({value:n,done:!0});break;case`throw`:t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?i(t.key,t.arg):r=null}this._invoke=function(e,n){return new Promise(function(a,o){var s={key:e,arg:n,resolve:a,reject:o,next:null};r?r=r.next=s:(t=r=s,i(e,n))})},typeof e.return!=`function`&&(this.return=void 0)}i.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},i.prototype.next=function(e){return this._invoke(`next`,e)},i.prototype.throw=function(e){return this._invoke(`throw`,e)},i.prototype.return=function(e){return this._invoke(`return`,e)},t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}});ld(If(),1),ld(Rf(),1),ld(zf(),1),ld(md(),1);var Bf=Ff({links:[yf({url:`/api/trpc`})]}),Vf=`diffs-container`;(()=>{try{return!1}catch{return!1}})();var Hf=/(?=^From [a-f0-9]+ .+$)/m,Uf=/(?=^diff --git)/gm,Wf=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Gf=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,Kf=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,qf=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Jf=`header-prefix`,Yf=`header-metadata`,Xf=`header-custom`,Zf={dark:`pierre-dark`,light:`pierre-light`},Qf=`data-theme-css`,$f=`data-unsafe-css`,ep=`data-diffs-scrollbar-measure`,tp=`--diffs-scrollbar-gutter-measured`,np=1e5,rp=Object.freeze({fromStart:0,fromEnd:0}),ip={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},ap={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};function op(e){return e.replace(/\n$|\r\n$/,``)}var sp=new TextEncoder,cp=new TextDecoder(`utf-8`,{ignoreBOM:!0}),lp=/[\uD800-\uDFFF]/,up=1024,dp=new Uint8Array(up);function fp(){dp.length!==up&&(dp=new Uint8Array(up))}function pp(e){if(e.length===0)return e;if(lp.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;dp.length<t&&(dp=new Uint8Array(t));let{written:n}=sp.encodeInto(e,dp);return cp.decode(dp.subarray(0,n))}function mp(e,t,n){try{return hp(e,t,n)}finally{fp()}}function hp(e,t,n=!1){let r=Np(e),i=r?Sp(e):Cp(e),a,o=[];for(let e of i){if(r&&!Uf.test(e)){if(a==null)a=pp(e);else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}else if(!r&&!wp(e)){if(a==null)a=pp(e);else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}let i=_p(e,{cacheKey:t==null?void 0:`${t}-${o.length}`,isGitDiff:r,throwOnError:n});i!=null&&o.push(i)}return{patchMetadata:a,files:o}}function gp(e,t){try{return _p(e,t)}finally{fp()}}function _p(e,{cacheKey:t,isGitDiff:n=Uf.test(e),oldFile:r,newFile:i,throwOnError:a=!1}={}){let o=0,s=Pp(e,`@@ `),c,l=r==null||i==null,u=0,d=0;for(let e of s){let s=xp(e),f=s[0];if(f==null){if(a)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,e);continue}let p=Ap(f),m=0,h=0;if(p==null||c==null){if(c!=null){if(a)throw Error(`parsePatchContent: Invalid hunk`);console.error(`parsePatchContent: Invalid hunk`,e);continue}c={name:``,type:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:l,additionLines:!l&&r!=null&&i!=null?bp(i.contents):[],deletionLines:!l&&r!=null&&i!=null?bp(r.contents):[],cacheKey:Ip(t)},c.additionLines.length===1&&i?.contents===``&&(c.additionLines.length=0),c.deletionLines.length===1&&r?.contents===``&&(c.deletionLines.length=0);for(let e of s){if(e.startsWith(`diff --git`)){let t=e.trim().match(Kf),n=t?.[1]??t?.[2],r=t?.[3]??t?.[4];if(n==null||r==null){if(a)throw Error(`parsePatchContent: invalid git diff header`);console.error(`parsePatchContent: invalid git diff header`,e);continue}c.name=pp(r.trim()),n!==r&&(c.prevName=pp(n.trim()));continue}let t=e.startsWith(`---`)||e.startsWith(`+++`)?e.match(n?Gf:Wf):null;if(t!=null){let[,e,n]=t;if(e===`---`&&n!==`/dev/null`){let e=pp(n.trim());c.prevName=e,c.name=e}else e===`+++`&&n!==`/dev/null`&&(c.name=pp(n.trim()))}else if(n){if(e.startsWith(`new mode `)&&(c.mode=pp(e.slice(8).trim())),e.startsWith(`old mode `)&&(c.prevMode=pp(e.slice(8).trim())),e.startsWith(`new file mode`)&&(c.type=`new`,c.mode=pp(e.slice(13).trim())),e.startsWith(`deleted file mode`)&&(c.type=`deleted`,c.mode=pp(e.slice(17).trim())),e.startsWith(`similarity index`)&&(e.startsWith(`similarity index 100%`)?c.type=`rename-pure`:c.type=`rename-changed`),e.startsWith(`index `)){let[,t,n,r]=e.trim().match(qf)??[];t!=null&&(c.prevObjectId=pp(t)),n!=null&&(c.newObjectId=pp(n)),r!=null&&(c.mode=pp(r))}e.startsWith(`rename from `)&&(c.prevName=pp(e.slice(12).trim())),e.startsWith(`rename to `)&&(c.name=pp(e.slice(10).trim()))}}continue}let g,_;for(;s.length>0&&(s[s.length-1]===`
1270
1268
  `||s[s.length-1]===`\r`||s[s.length-1]===`\r
1271
- `||s[s.length-1]===``);)s.pop();let{additionStart:v,deletionStart:y}=p;u=l?u:y-1,d=l?d:v-1;let b={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:p.additionCount,additionStart:v,additionLines:m,deletionCount:p.deletionCount,deletionStart:y,deletionLines:h,deletionLineIndex:u,additionLineIndex:d,hunkContent:[],hunkContext:zp(p.hunkContext),hunkSpecs:gp(f),noEOFCRAdditions:!1,noEOFCRDeletions:!1},x=0,S=0;for(let e=1;e<s.length;e++){let t=s[e];if(x>=b.additionCount&&S>=b.deletionCount&&!t.startsWith(`\\`)){if(a&&jp(t)&&!Mp(t))throw Error(`parsePatchContent: hunk has more lines than expected`);break}let n=t[0];if(n!==`+`&&n!==`-`&&n!==` `&&n!==`\\`){if(a)throw Error(`parsePatchContent: invalid hunk line`);console.error(`parseLineType: Invalid firstChar: "${n}", full line: "${t}"`),console.error(`processFile: invalid rawLine:`,t);continue}let r=Bp(n);if(r===`addition`){if(a&&x>=b.additionCount)throw Error(`parsePatchContent: hunk has too many addition lines`);let e=Vp(t);(g==null||g.type!==`change`)&&(g=Hp(`change`,u,d),b.hunkContent.push(g)),d++,x++,l&&c.additionLines.push(e),g.additions++,m++,_=`addition`}else if(r===`deletion`){if(a&&S>=b.deletionCount)throw Error(`parsePatchContent: hunk has too many deletion lines`);let e=Vp(t);(g==null||g.type!==`change`)&&(g=Hp(`change`,u,d),b.hunkContent.push(g)),u++,S++,l&&c.deletionLines.push(e),g.deletions++,h++,_=`deletion`}else if(r===`context`){if(a&&(S>=b.deletionCount||x>=b.additionCount))throw Error(`parsePatchContent: hunk has too many context lines`);let e=Vp(t);(g==null||g.type!==`context`)&&(g=Hp(`context`,u,d),b.hunkContent.push(g)),d++,u++,x++,S++,l&&(c.deletionLines.push(e),c.additionLines.push(e)),g.lines++,_=`context`}else if(r===`metadata`&&g!=null){if(g.type===`context`?(b.noEOFCRAdditions=!0,b.noEOFCRDeletions=!0):_===`deletion`?b.noEOFCRDeletions=!0:_===`addition`&&(b.noEOFCRAdditions=!0),l&&(_===`addition`||_===`context`)){let e=c.additionLines.length-1;e>=0&&(c.additionLines[e]=lp(c.additionLines[e]))}if(l&&(_===`deletion`||_===`context`)){let e=c.deletionLines.length-1;e>=0&&(c.deletionLines[e]=lp(c.deletionLines[e]))}}}if(a&&(x!==b.additionCount||S!==b.deletionCount))throw Error(`parsePatchContent: hunk line count mismatch`);b.additionLines=m,b.deletionLines=h,b.collapsedBefore=Math.max(b.additionStart-1-o,0),c.hunks.push(b),o=b.additionStart+b.additionCount-1;for(let e of b.hunkContent)e.type===`context`?(b.splitLineCount+=e.lines,b.unifiedLineCount+=e.lines):(b.splitLineCount+=Math.max(e.additions,e.deletions),b.unifiedLineCount+=e.deletions+e.additions);b.splitLineStart=c.splitLineCount+b.collapsedBefore,b.unifiedLineStart=c.unifiedLineCount+b.collapsedBefore,c.splitLineCount+=b.collapsedBefore+b.splitLineCount,c.unifiedLineCount+=b.collapsedBefore+b.unifiedLineCount}if(c!=null){if(a&&l&&!n&&c.hunks.length===0)throw Error(`parsePatchContent: unified file has no hunks`);if(c.hunks.length>0&&!l&&c.additionLines.length>0&&c.deletionLines.length>0){let e=c.hunks[c.hunks.length-1],t=e.additionStart+e.additionCount-1,n=c.additionLines.length,r=Math.max(n-t,0);c.splitLineCount+=r,c.unifiedLineCount+=r}return n||(c.prevName!=null&&c.name!==c.prevName?c.hunks.length>0?c.type=`rename-changed`:c.type=`rename-pure`:(r==null||r.contents===``)&&i!=null&&i.contents!==``?c.type=`new`:r!=null&&r.contents!==``&&(i==null||i.contents===``)&&(c.type=`deleted`)),c.type!==`rename-pure`&&c.type!==`rename-changed`&&(c.prevName=void 0),c}}function xp(e,t,n=!1){let r=[],i=Sp(e)?e.split(Gf):[e];for(let e of i)try{r.push(_p(e,t==null?void 0:`${t}-${r.length}`,n))}catch(e){if(n)throw e;console.error(e)}return r}function Sp(e){return e.startsWith(`From `)||e.includes(`
1272
- From `)}function Cp(e){let t=wp(e);for(let e=0;e<t.length;e++)t[e]=gp(t[e]);return t}function wp(e){if(e.length===0)return[``];let t=[],n=0;for(;;){let r=e.indexOf(`
1273
- `,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 Tp(e){return Lp(e,`diff --git`)}function Ep(e){if(e.length===0)return[``];let t=[],n=0,r=0,i=0,a=0,o=!1;for(;r<e.length;){let s=Ap(e,r);if(i<=0&&a<=0){if(Op(e,r)){r>n&&t.push(e.slice(n,r)),n=r,o=!0,r=Ap(e,s);continue}if(o&&e.startsWith(`@@ -`,r)){let t=Np(e.slice(r,s));t!=null&&(i=t.deletionCount,a=t.additionCount)}r=s;continue}let c=e[r];if(c===`\\`){r=s;continue}c===` `?(i=Math.max(i-1,0),a=Math.max(a-1,0)):c===`-`?i=Math.max(i-1,0):c===`+`&&(a=Math.max(a-1,0)),r=s}return t.push(e.slice(n)),t}function Dp(e){return Op(e,0)}function Op(e,t){let n=Ap(e,t);return kp(e,t,`---`)&&kp(e,n,`+++`)}function kp(e,t,n){if(!e.startsWith(n,t))return!1;let r=e[t+n.length];if(r!==` `&&r!==` `)return!1;for(let r=t+n.length+1;r<e.length;r++){let t=e[r];if(t===`
1274
- `||t===`\r`)break;if(t!==` `&&t!==` `)return!0}return!1}function Ap(e,t){let n=e.indexOf(`
1275
- `,t);return n===-1?e.length:n+1}function jp(e){let t=e[0];return t===`+`||t===`-`||t===` `}function Mp(e){if(!e.startsWith(`--`))return!1;for(let t=2;t<e.length;t++){let n=e[t];if(n!==` `&&n!==` `&&n!==`
1276
- `&&n!==`\r`)return!1}return!0}function Np(e){if(!e.startsWith(`@@ -`))return;let t=4,n=Pp(e,t);if(n==null)return;let r=n.value;t=n.endIndex;let i=1;if(e[t]===`,`){let n=Pp(e,t+1);if(n==null)return;i=n.value,t=n.endIndex}if(e[t]!==` `||e[t+1]!==`+`)return;t+=2;let a=Pp(e,t);if(a==null)return;let o=a.value;t=a.endIndex;let s=1;if(e[t]===`,`){let n=Pp(e,t+1);if(n==null)return;s=n.value,t=n.endIndex}if(e[t]!==` `||e[t+1]!==`@`||e[t+2]!==`@`)return;let c,l=t+3;return e[l]===` `&&(c=Fp(e.slice(l+1))),{additionCount:s,additionStart:o,deletionCount:i,deletionStart:r,hunkContext:c}}function Pp(e,t){let n=t,r=0;for(;n<e.length;n++){let t=e.charCodeAt(n)-48;if(t<0||t>9)break;r=r*10+t}if(n!==t)return{value:r,endIndex:n}}function Fp(e){return e.endsWith(`\r
1269
+ `||s[s.length-1]===``);)s.pop();let{additionStart:v,deletionStart:y}=p;u=l?u:y-1,d=l?d:v-1;let b={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:p.additionCount,additionStart:v,additionLines:m,deletionCount:p.deletionCount,deletionStart:y,deletionLines:h,deletionLineIndex:u,additionLineIndex:d,hunkContent:[],hunkContext:Ip(p.hunkContext),hunkSpecs:pp(f),noEOFCRAdditions:!1,noEOFCRDeletions:!1},x=0,S=0;for(let e=1;e<s.length;e++){let t=s[e];if(x>=b.additionCount&&S>=b.deletionCount&&!t.startsWith(`\\`)){if(a&&Op(t)&&!kp(t))throw Error(`parsePatchContent: hunk has more lines than expected`);break}let n=t[0];if(n!==`+`&&n!==`-`&&n!==` `&&n!==`\\`){if(a)throw Error(`parsePatchContent: invalid hunk line`);console.error(`parseLineType: Invalid firstChar: "${n}", full line: "${t}"`),console.error(`processFile: invalid rawLine:`,t);continue}let r=Lp(n);if(r===`addition`){if(a&&x>=b.additionCount)throw Error(`parsePatchContent: hunk has too many addition lines`);let e=Rp(t);(g==null||g.type!==`change`)&&(g=zp(`change`,u,d),b.hunkContent.push(g)),d++,x++,l&&c.additionLines.push(e),g.additions++,m++,_=`addition`}else if(r===`deletion`){if(a&&S>=b.deletionCount)throw Error(`parsePatchContent: hunk has too many deletion lines`);let e=Rp(t);(g==null||g.type!==`change`)&&(g=zp(`change`,u,d),b.hunkContent.push(g)),u++,S++,l&&c.deletionLines.push(e),g.deletions++,h++,_=`deletion`}else if(r===`context`){if(a&&(S>=b.deletionCount||x>=b.additionCount))throw Error(`parsePatchContent: hunk has too many context lines`);let e=Rp(t);(g==null||g.type!==`context`)&&(g=zp(`context`,u,d),b.hunkContent.push(g)),d++,u++,x++,S++,l&&(c.deletionLines.push(e),c.additionLines.push(e)),g.lines++,_=`context`}else if(r===`metadata`&&g!=null){if(g.type===`context`?(b.noEOFCRAdditions=!0,b.noEOFCRDeletions=!0):_===`deletion`?b.noEOFCRDeletions=!0:_===`addition`&&(b.noEOFCRAdditions=!0),l&&(_===`addition`||_===`context`)){let e=c.additionLines.length-1;e>=0&&(c.additionLines[e]=op(c.additionLines[e]))}if(l&&(_===`deletion`||_===`context`)){let e=c.deletionLines.length-1;e>=0&&(c.deletionLines[e]=op(c.deletionLines[e]))}}}if(a&&(x!==b.additionCount||S!==b.deletionCount))throw Error(`parsePatchContent: hunk line count mismatch`);b.additionLines=m,b.deletionLines=h,b.collapsedBefore=Math.max(b.additionStart-1-o,0),c.hunks.push(b),o=b.additionStart+b.additionCount-1;for(let e of b.hunkContent)e.type===`context`?(b.splitLineCount+=e.lines,b.unifiedLineCount+=e.lines):(b.splitLineCount+=Math.max(e.additions,e.deletions),b.unifiedLineCount+=e.deletions+e.additions);b.splitLineStart=c.splitLineCount+b.collapsedBefore,b.unifiedLineStart=c.unifiedLineCount+b.collapsedBefore,c.splitLineCount+=b.collapsedBefore+b.splitLineCount,c.unifiedLineCount+=b.collapsedBefore+b.unifiedLineCount}if(c!=null){if(a&&l&&!n&&c.hunks.length===0)throw Error(`parsePatchContent: unified file has no hunks`);if(c.hunks.length>0&&!l&&c.additionLines.length>0&&c.deletionLines.length>0){let e=c.hunks[c.hunks.length-1],t=e.additionStart+e.additionCount-1,n=c.additionLines.length,r=Math.max(n-t,0);c.splitLineCount+=r,c.unifiedLineCount+=r}return n||(c.prevName!=null&&c.name!==c.prevName?c.hunks.length>0?c.type=`rename-changed`:c.type=`rename-pure`:(r==null||r.contents===``)&&i!=null&&i.contents!==``?c.type=`new`:r!=null&&r.contents!==``&&(i==null||i.contents===``)&&(c.type=`deleted`)),c.type!==`rename-pure`&&c.type!==`rename-changed`&&(c.prevName=void 0),c}}function vp(e,t,n=!1){let r=[],i=yp(e)?e.split(Hf):[e];for(let e of i)try{r.push(mp(e,t==null?void 0:`${t}-${r.length}`,n))}catch(e){if(n)throw e;console.error(e)}return r}function yp(e){return e.startsWith(`From `)||e.includes(`
1270
+ From `)}function bp(e){let t=xp(e);for(let e=0;e<t.length;e++)t[e]=pp(t[e]);return t}function xp(e){if(e.length===0)return[``];let t=[],n=0;for(;;){let r=e.indexOf(`
1271
+ `,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 Sp(e){return Pp(e,`diff --git`)}function Cp(e){if(e.length===0)return[``];let t=[],n=0,r=0,i=0,a=0,o=!1;for(;r<e.length;){let s=Dp(e,r);if(i<=0&&a<=0){if(Tp(e,r)){r>n&&t.push(e.slice(n,r)),n=r,o=!0,r=Dp(e,s);continue}if(o&&e.startsWith(`@@ -`,r)){let t=Ap(e.slice(r,s));t!=null&&(i=t.deletionCount,a=t.additionCount)}r=s;continue}let c=e[r];if(c===`\\`){r=s;continue}c===` `?(i=Math.max(i-1,0),a=Math.max(a-1,0)):c===`-`?i=Math.max(i-1,0):c===`+`&&(a=Math.max(a-1,0)),r=s}return t.push(e.slice(n)),t}function wp(e){return Tp(e,0)}function Tp(e,t){let n=Dp(e,t);return Ep(e,t,`---`)&&Ep(e,n,`+++`)}function Ep(e,t,n){if(!e.startsWith(n,t))return!1;let r=e[t+n.length];if(r!==` `&&r!==` `)return!1;for(let r=t+n.length+1;r<e.length;r++){let t=e[r];if(t===`
1272
+ `||t===`\r`)break;if(t!==` `&&t!==` `)return!0}return!1}function Dp(e,t){let n=e.indexOf(`
1273
+ `,t);return n===-1?e.length:n+1}function Op(e){let t=e[0];return t===`+`||t===`-`||t===` `}function kp(e){if(!e.startsWith(`--`))return!1;for(let t=2;t<e.length;t++){let n=e[t];if(n!==` `&&n!==` `&&n!==`
1274
+ `&&n!==`\r`)return!1}return!0}function Ap(e){if(!e.startsWith(`@@ -`))return;let t=4,n=jp(e,t);if(n==null)return;let r=n.value;t=n.endIndex;let i=1;if(e[t]===`,`){let n=jp(e,t+1);if(n==null)return;i=n.value,t=n.endIndex}if(e[t]!==` `||e[t+1]!==`+`)return;t+=2;let a=jp(e,t);if(a==null)return;let o=a.value;t=a.endIndex;let s=1;if(e[t]===`,`){let n=jp(e,t+1);if(n==null)return;s=n.value,t=n.endIndex}if(e[t]!==` `||e[t+1]!==`@`||e[t+2]!==`@`)return;let c,l=t+3;return e[l]===` `&&(c=Mp(e.slice(l+1))),{additionCount:s,additionStart:o,deletionCount:i,deletionStart:r,hunkContext:c}}function jp(e,t){let n=t,r=0;for(;n<e.length;n++){let t=e.charCodeAt(n)-48;if(t<0||t>9)break;r=r*10+t}if(n!==t)return{value:r,endIndex:n}}function Mp(e){return e.endsWith(`\r
1277
1275
  `)?e.slice(0,-2):e.endsWith(`
1278
- `)?e.slice(0,-1):e}function Ip(e){return e.startsWith(`diff --git`)||e.includes(`
1279
- diff --git`)}function Lp(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.startsWith(t)?0:Rp(e,n,0);if(r===-1)return[e];let i=[];r>0&&i.push(e.slice(0,r));let a=r;for(;;){let t=Rp(e,n,a+1);if(t===-1)break;i.push(e.slice(a,t)),a=t}return i.push(e.slice(a)),i}function Rp(e,t,n){let r=e.indexOf(t,n);return r===-1?-1:r+1}function zp(e){return e==null?e:gp(e)}function Bp(e){return e===` `?`context`:e===`\\`?`metadata`:e===`+`?`addition`:`deletion`}function Vp(e){let t=e.slice(1);return gp(t===``?`
1280
- `:t)}function Hp(e,t,n){return e===`change`?{type:`change`,additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:`context`,lines:0,additionLineIndex:n,deletionLineIndex:t}}function Up(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function Wp(e){if(typeof HTMLStyleElement<`u`&&e instanceof HTMLStyleElement)return!0;let t=e.tagName??e.nodeName;return typeof t==`string`&&t.toLowerCase()===`style`}function Gp(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Kp(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function qp(e){return{type:`text`,value:e}}function q({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function Jp({name:e,width:t=16,height:n=16,properties:r}){return q({tagName:`svg`,properties:{width:t,height:n,viewBox:`0 0 16 16`,...r},children:[q({tagName:`use`,properties:{href:`#${e.replace(/^#/,``)}`}})]})}function Yp(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t;t=`children`in t?t.children[0]:null}}function Xp(e){return q({tagName:`div`,properties:{"data-gutter":``},children:e})}function Zp(e,t,n,r={}){return q({tagName:`div`,properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t==null?void 0:[q({tagName:`span`,properties:{"data-line-number-content":``},children:[qp(`${t}`)]})]})}function Qp(e,t,n){return q({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 $p(){return q({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[Jp({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}var em=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],tm=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};tm.prototype.normal={},tm.prototype.property={},tm.prototype.space=void 0;function nm(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new tm(n,r,t)}function rm(e){return e.toLowerCase()}var im=class{constructor(e,t){this.attribute=t,this.property=e}};im.prototype.attribute=``,im.prototype.booleanish=!1,im.prototype.boolean=!1,im.prototype.commaOrSpaceSeparated=!1,im.prototype.commaSeparated=!1,im.prototype.defined=!1,im.prototype.mustUseProperty=!1,im.prototype.number=!1,im.prototype.overloadedBoolean=!1,im.prototype.property=``,im.prototype.spaceSeparated=!1,im.prototype.space=void 0;var am=t({boolean:()=>J,booleanish:()=>sm,commaOrSpaceSeparated:()=>um,commaSeparated:()=>lm,number:()=>Y,overloadedBoolean:()=>cm,spaceSeparated:()=>X}),om=0,J=dm(),sm=dm(),cm=dm(),Y=dm(),X=dm(),lm=dm(),um=dm();function dm(){return 2**++om}var fm=Object.keys(am),pm=class extends im{constructor(e,t,n,r){let i=-1;if(super(e,t),mm(this,`space`,r),typeof n==`number`)for(;++i<fm.length;){let e=fm[i];mm(this,fm[i],(n&am[e])===am[e])}}};pm.prototype.defined=!0;function mm(e,t,n){n&&(e[t]=n)}function hm(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new pm(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[rm(r)]=r,n[rm(a.attribute)]=r}return new tm(t,n,e.space)}var gm=hm({properties:{ariaActiveDescendant:null,ariaAtomic:sm,ariaAutoComplete:null,ariaBusy:sm,ariaChecked:sm,ariaColCount:Y,ariaColIndex:Y,ariaColSpan:Y,ariaControls:X,ariaCurrent:null,ariaDescribedBy:X,ariaDetails:null,ariaDisabled:sm,ariaDropEffect:X,ariaErrorMessage:null,ariaExpanded:sm,ariaFlowTo:X,ariaGrabbed:sm,ariaHasPopup:null,ariaHidden:sm,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:X,ariaLevel:Y,ariaLive:null,ariaModal:sm,ariaMultiLine:sm,ariaMultiSelectable:sm,ariaOrientation:null,ariaOwns:X,ariaPlaceholder:null,ariaPosInSet:Y,ariaPressed:sm,ariaReadOnly:sm,ariaRelevant:null,ariaRequired:sm,ariaRoleDescription:X,ariaRowCount:Y,ariaRowIndex:Y,ariaRowSpan:Y,ariaSelected:sm,ariaSetSize:Y,ariaSort:null,ariaValueMax:Y,ariaValueMin:Y,ariaValueNow:Y,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function _m(e,t){return t in e?e[t]:t}function vm(e,t){return _m(e,t.toLowerCase())}var ym=hm({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:lm,acceptCharset:X,accessKey:X,action:null,allow:null,allowFullScreen:J,allowPaymentRequest:J,allowUserMedia:J,alpha:J,alt:null,as:null,async:J,autoCapitalize:null,autoComplete:X,autoFocus:J,autoPlay:J,blocking:X,capture:null,charSet:null,checked:J,cite:null,className:X,closedBy:null,colorSpace:null,cols:Y,colSpan:Y,command:null,commandFor:null,content:null,contentEditable:sm,controls:J,controlsList:X,coords:Y|lm,crossOrigin:null,data:null,dateTime:null,decoding:null,default:J,defer:J,dir:null,dirName:null,disabled:J,download:cm,draggable:sm,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:J,formTarget:null,headers:X,height:Y,hidden:cm,high:Y,href:null,hrefLang:null,htmlFor:X,httpEquiv:X,id:null,imageSizes:null,imageSrcSet:null,inert:J,inputMode:null,integrity:null,is:null,isMap:J,itemId:null,itemProp:X,itemRef:X,itemScope:J,itemType:X,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:J,low:Y,manifest:null,max:null,maxLength:Y,media:null,method:null,min:null,minLength:Y,multiple:J,muted:J,name:null,nonce:null,noModule:J,noValidate:J,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:J,optimum:Y,pattern:null,ping:X,placeholder:null,playsInline:J,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:J,referrerPolicy:null,rel:X,required:J,reversed:J,rows:Y,rowSpan:Y,sandbox:X,scope:null,scoped:J,seamless:J,selected:J,shadowRootClonable:J,shadowRootCustomElementRegistry:J,shadowRootDelegatesFocus:J,shadowRootMode:null,shadowRootSerializable:J,shape:null,size:Y,sizes:null,slot:null,span:Y,spellCheck:sm,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Y,step:null,style:null,tabIndex:Y,target:null,title:null,translate:null,type:null,typeMustMatch:J,useMap:null,value:sm,width:Y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:X,axis:null,background:null,bgColor:null,border:Y,borderColor:null,bottomMargin:Y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:J,declare:J,event:null,face:null,frame:null,frameBorder:null,hSpace:Y,leftMargin:Y,link:null,longDesc:null,lowSrc:null,marginHeight:Y,marginWidth:Y,noResize:J,noHref:J,noShade:J,noWrap:J,object:null,profile:null,prompt:null,rev:null,rightMargin:Y,rules:null,scheme:null,scrolling:sm,standby:null,summary:null,text:null,topMargin:Y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Y,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:J,disablePictureInPicture:J,disableRemotePlayback:J,exportParts:lm,part:X,prefix:null,property:null,results:Y,security:null,unselectable:null},space:`html`,transform:vm}),bm=hm({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:um,accentHeight:Y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Y,amplitude:Y,arabicForm:null,ascent:Y,attributeName:null,attributeType:null,azimuth:Y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Y,by:null,calcMode:null,capHeight:Y,className:X,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:Y,diffuseConstant:Y,direction:null,display:null,dur:null,divisor:Y,dominantBaseline:null,download:J,dx:null,dy:null,edgeMode:null,editable:null,elevation:Y,enableBackground:null,end:null,event:null,exponent:Y,externalResourcesRequired:null,fill:null,fillOpacity:Y,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:lm,g2:lm,glyphName:lm,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Y,horizOriginX:Y,horizOriginY:Y,id:null,ideographic:Y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Y,k:Y,k1:Y,k2:Y,k3:Y,k4:Y,kernelMatrix:um,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Y,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:Y,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:Y,overlineThickness:Y,paintOrder:null,panose1:null,path:null,pathLength:Y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:X,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Y,pointsAtY:Y,pointsAtZ:Y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:um,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:um,rev:um,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:um,requiredFeatures:um,requiredFonts:um,requiredFormats:um,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:Y,specularExponent:Y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Y,strikethroughThickness:Y,string:null,stroke:null,strokeDashArray:um,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Y,strokeOpacity:Y,strokeWidth:null,style:null,surfaceScale:Y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:um,tabIndex:Y,tableValues:null,target:null,targetX:Y,targetY:Y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:um,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Y,underlineThickness:Y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Y,values:null,vAlphabetic:Y,vMathematical:Y,vectorEffect:null,vHanging:Y,vIdeographic:Y,version:null,vertAdvY:Y,vertOriginX:Y,vertOriginY:Y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:_m}),xm=hm({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()}}),Sm=hm({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:vm}),Cm=hm({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),wm=/[A-Z]/g,Tm=/-[a-z]/g,Em=/^data[-\w.:]+$/i;function Dm(e,t){let n=rm(t),r=t,i=im;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Em.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Tm,km);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Tm.test(e)){let n=e.replace(wm,Om);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=pm}return new i(r,t)}function Om(e){return`-`+e.toLowerCase()}function km(e){return e.charAt(1).toUpperCase()}var Am=nm([gm,ym,xm,Sm,Cm],`html`),jm=nm([gm,bm,xm,Sm,Cm],`svg`),Mm={}.hasOwnProperty;function Nm(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&Mm.call(t,e)){let n=String(t[e]);i=Mm.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var Pm=/["&'<>`]/g,Fm=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Im=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Lm=/[|\\{}()[\]^$+*?.]/g,Rm=new WeakMap;function zm(e,t){if(e=e.replace(t.subset?Bm(t.subset):Pm,r),t.subset||t.escapeOnly)return e;return e.replace(Fm,n).replace(Im,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Bm(e){let t=Rm.get(e);return t||(t=Vm(e),Rm.set(e,t)),t}function Vm(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Lm,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var Hm=/[\dA-Fa-f]/;function Um(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!Hm.test(String.fromCharCode(t))?r:r+`;`}var Wm=/\d/;function Gm(e,t,n){let r=`&#`+String(e);return n&&t&&!Wm.test(String.fromCharCode(t))?r:r+`;`}var Km=`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`.split(`.`),qm={nbsp:`\xA0`,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:`€`},Jm=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],Ym={}.hasOwnProperty,Xm={},Zm;for(Zm in qm)Ym.call(qm,Zm)&&(Xm[qm[Zm]]=Zm);var Qm=/[^\dA-Za-z]/;function $m(e,t,n,r){let i=String.fromCharCode(e);if(Ym.call(Xm,i)){let e=Xm[i],a=`&`+e;return n&&Km.includes(e)&&!Jm.includes(e)&&(!r||t&&t!==61&&Qm.test(String.fromCharCode(t)))?a:a+`;`}return``}function eh(e,t,n){let r=Um(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=$m(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=Gm(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function th(e,t){return zm(e,Object.assign({format:eh},t))}var nh=/^>|^->|<!--|-->|--!>|<!-$/g,rh=[`>`],ih=[`<`,`>`];function ah(e,t,n,r){return r.settings.bogusComments?`<?`+th(e.value,Object.assign({},r.settings.characterReferences,{subset:rh}))+`>`:`<!--`+e.value.replace(nh,i)+`-->`;function i(e){return th(e,Object.assign({},r.settings.characterReferences,{subset:ih}))}}function oh(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function sh(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function ch(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function lh(e){return e.join(` `).trim()}var uh=/[ \t\n\f\r]/g;function dh(e){return typeof e==`object`?e.type===`text`?fh(e.value):!1:fh(e)}function fh(e){return e.replace(uh,``)===``}var ph=gh(1),mh=gh(-1),hh=[];function gh(e){return t;function t(t,n,r){let i=t?t.children:hh,a=(n||0)+e,o=i[a];if(!r)for(;o&&dh(o);)a+=e,o=i[a];return o}}var _h={}.hasOwnProperty;function vh(e){return t;function t(t,n,r){return _h.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var yh=vh({body:Sh,caption:bh,colgroup:bh,dd:Eh,dt:Th,head:bh,html:xh,li:wh,optgroup:Oh,option:kh,p:Ch,rp:Dh,rt:Dh,tbody:jh,td:Ph,tfoot:Mh,th:Ph,thead:Ah,tr:Nh});function bh(e,t,n){let r=ph(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&dh(r.value.charAt(0)))}function xh(e,t,n){let r=ph(n,t);return!r||r.type!==`comment`}function Sh(e,t,n){let r=ph(n,t);return!r||r.type!==`comment`}function Ch(e,t,n){let r=ph(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 wh(e,t,n){let r=ph(n,t);return!r||r.type===`element`&&r.tagName===`li`}function Th(e,t,n){let r=ph(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function Eh(e,t,n){let r=ph(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function Dh(e,t,n){let r=ph(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function Oh(e,t,n){let r=ph(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function kh(e,t,n){let r=ph(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Ah(e,t,n){let r=ph(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function jh(e,t,n){let r=ph(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function Mh(e,t,n){return!ph(n,t)}function Nh(e,t,n){let r=ph(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function Ph(e,t,n){let r=ph(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var Fh=vh({body:Rh,colgroup:zh,head:Lh,html:Ih,tbody:Bh});function Ih(e){let t=ph(e,-1);return!t||t.type!==`comment`}function Lh(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function Rh(e){let t=ph(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&dh(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function zh(e,t,n){let r=mh(n,t),i=ph(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&yh(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Bh(e,t,n){let r=mh(n,t),i=ph(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&yh(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var Vh={name:[[`
1276
+ `)?e.slice(0,-1):e}function Np(e){return e.startsWith(`diff --git`)||e.includes(`
1277
+ diff --git`)}function Pp(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.startsWith(t)?0:Fp(e,n,0);if(r===-1)return[e];let i=[];r>0&&i.push(e.slice(0,r));let a=r;for(;;){let t=Fp(e,n,a+1);if(t===-1)break;i.push(e.slice(a,t)),a=t}return i.push(e.slice(a)),i}function Fp(e,t,n){let r=e.indexOf(t,n);return r===-1?-1:r+1}function Ip(e){return e==null?e:pp(e)}function Lp(e){return e===` `?`context`:e===`\\`?`metadata`:e===`+`?`addition`:`deletion`}function Rp(e){let t=e.slice(1);return pp(t===``?`
1278
+ `:t)}function zp(e,t,n){return e===`change`?{type:`change`,additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:`context`,lines:0,additionLineIndex:n,deletionLineIndex:t}}function Bp(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function Vp(e){if(typeof HTMLStyleElement<`u`&&e instanceof HTMLStyleElement)return!0;let t=e.tagName??e.nodeName;return typeof t==`string`&&t.toLowerCase()===`style`}function Hp(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Up(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function Wp(e){return{type:`text`,value:e}}function q({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function Gp({name:e,width:t=16,height:n=16,properties:r}){return q({tagName:`svg`,properties:{width:t,height:n,viewBox:`0 0 16 16`,...r},children:[q({tagName:`use`,properties:{href:`#${e.replace(/^#/,``)}`}})]})}function Kp(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t;t=`children`in t?t.children[0]:null}}function qp(e){return q({tagName:`div`,properties:{"data-gutter":``},children:e})}function Jp(e,t,n,r={}){return q({tagName:`div`,properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t==null?void 0:[q({tagName:`span`,properties:{"data-line-number-content":``},children:[Wp(`${t}`)]})]})}function Yp(e,t,n){return q({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 Xp(){return q({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[Gp({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}var Zp=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],Qp=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Qp.prototype.normal={},Qp.prototype.property={},Qp.prototype.space=void 0;function $p(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Qp(n,r,t)}function em(e){return e.toLowerCase()}var tm=class{constructor(e,t){this.attribute=t,this.property=e}};tm.prototype.attribute=``,tm.prototype.booleanish=!1,tm.prototype.boolean=!1,tm.prototype.commaOrSpaceSeparated=!1,tm.prototype.commaSeparated=!1,tm.prototype.defined=!1,tm.prototype.mustUseProperty=!1,tm.prototype.number=!1,tm.prototype.overloadedBoolean=!1,tm.prototype.property=``,tm.prototype.spaceSeparated=!1,tm.prototype.space=void 0;var nm=t({boolean:()=>J,booleanish:()=>im,commaOrSpaceSeparated:()=>sm,commaSeparated:()=>om,number:()=>Y,overloadedBoolean:()=>am,spaceSeparated:()=>X}),rm=0,J=cm(),im=cm(),am=cm(),Y=cm(),X=cm(),om=cm(),sm=cm();function cm(){return 2**++rm}var lm=Object.keys(nm),um=class extends tm{constructor(e,t,n,r){let i=-1;if(super(e,t),dm(this,`space`,r),typeof n==`number`)for(;++i<lm.length;){let e=lm[i];dm(this,lm[i],(n&nm[e])===nm[e])}}};um.prototype.defined=!0;function dm(e,t,n){n&&(e[t]=n)}function fm(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new um(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[em(r)]=r,n[em(a.attribute)]=r}return new Qp(t,n,e.space)}var pm=fm({properties:{ariaActiveDescendant:null,ariaAtomic:im,ariaAutoComplete:null,ariaBusy:im,ariaChecked:im,ariaColCount:Y,ariaColIndex:Y,ariaColSpan:Y,ariaControls:X,ariaCurrent:null,ariaDescribedBy:X,ariaDetails:null,ariaDisabled:im,ariaDropEffect:X,ariaErrorMessage:null,ariaExpanded:im,ariaFlowTo:X,ariaGrabbed:im,ariaHasPopup:null,ariaHidden:im,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:X,ariaLevel:Y,ariaLive:null,ariaModal:im,ariaMultiLine:im,ariaMultiSelectable:im,ariaOrientation:null,ariaOwns:X,ariaPlaceholder:null,ariaPosInSet:Y,ariaPressed:im,ariaReadOnly:im,ariaRelevant:null,ariaRequired:im,ariaRoleDescription:X,ariaRowCount:Y,ariaRowIndex:Y,ariaRowSpan:Y,ariaSelected:im,ariaSetSize:Y,ariaSort:null,ariaValueMax:Y,ariaValueMin:Y,ariaValueNow:Y,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function mm(e,t){return t in e?e[t]:t}function hm(e,t){return mm(e,t.toLowerCase())}var gm=fm({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:om,acceptCharset:X,accessKey:X,action:null,allow:null,allowFullScreen:J,allowPaymentRequest:J,allowUserMedia:J,alpha:J,alt:null,as:null,async:J,autoCapitalize:null,autoComplete:X,autoFocus:J,autoPlay:J,blocking:X,capture:null,charSet:null,checked:J,cite:null,className:X,closedBy:null,colorSpace:null,cols:Y,colSpan:Y,command:null,commandFor:null,content:null,contentEditable:im,controls:J,controlsList:X,coords:Y|om,crossOrigin:null,data:null,dateTime:null,decoding:null,default:J,defer:J,dir:null,dirName:null,disabled:J,download:am,draggable:im,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:J,formTarget:null,headers:X,height:Y,hidden:am,high:Y,href:null,hrefLang:null,htmlFor:X,httpEquiv:X,id:null,imageSizes:null,imageSrcSet:null,inert:J,inputMode:null,integrity:null,is:null,isMap:J,itemId:null,itemProp:X,itemRef:X,itemScope:J,itemType:X,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:J,low:Y,manifest:null,max:null,maxLength:Y,media:null,method:null,min:null,minLength:Y,multiple:J,muted:J,name:null,nonce:null,noModule:J,noValidate:J,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:J,optimum:Y,pattern:null,ping:X,placeholder:null,playsInline:J,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:J,referrerPolicy:null,rel:X,required:J,reversed:J,rows:Y,rowSpan:Y,sandbox:X,scope:null,scoped:J,seamless:J,selected:J,shadowRootClonable:J,shadowRootCustomElementRegistry:J,shadowRootDelegatesFocus:J,shadowRootMode:null,shadowRootSerializable:J,shape:null,size:Y,sizes:null,slot:null,span:Y,spellCheck:im,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Y,step:null,style:null,tabIndex:Y,target:null,title:null,translate:null,type:null,typeMustMatch:J,useMap:null,value:im,width:Y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:X,axis:null,background:null,bgColor:null,border:Y,borderColor:null,bottomMargin:Y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:J,declare:J,event:null,face:null,frame:null,frameBorder:null,hSpace:Y,leftMargin:Y,link:null,longDesc:null,lowSrc:null,marginHeight:Y,marginWidth:Y,noResize:J,noHref:J,noShade:J,noWrap:J,object:null,profile:null,prompt:null,rev:null,rightMargin:Y,rules:null,scheme:null,scrolling:im,standby:null,summary:null,text:null,topMargin:Y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Y,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:J,disablePictureInPicture:J,disableRemotePlayback:J,exportParts:om,part:X,prefix:null,property:null,results:Y,security:null,unselectable:null},space:`html`,transform:hm}),_m=fm({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:sm,accentHeight:Y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Y,amplitude:Y,arabicForm:null,ascent:Y,attributeName:null,attributeType:null,azimuth:Y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Y,by:null,calcMode:null,capHeight:Y,className:X,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:Y,diffuseConstant:Y,direction:null,display:null,dur:null,divisor:Y,dominantBaseline:null,download:J,dx:null,dy:null,edgeMode:null,editable:null,elevation:Y,enableBackground:null,end:null,event:null,exponent:Y,externalResourcesRequired:null,fill:null,fillOpacity:Y,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:om,g2:om,glyphName:om,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Y,horizOriginX:Y,horizOriginY:Y,id:null,ideographic:Y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Y,k:Y,k1:Y,k2:Y,k3:Y,k4:Y,kernelMatrix:sm,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Y,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:Y,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:Y,overlineThickness:Y,paintOrder:null,panose1:null,path:null,pathLength:Y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:X,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Y,pointsAtY:Y,pointsAtZ:Y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:sm,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:sm,rev:sm,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:sm,requiredFeatures:sm,requiredFonts:sm,requiredFormats:sm,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:Y,specularExponent:Y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Y,strikethroughThickness:Y,string:null,stroke:null,strokeDashArray:sm,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Y,strokeOpacity:Y,strokeWidth:null,style:null,surfaceScale:Y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:sm,tabIndex:Y,tableValues:null,target:null,targetX:Y,targetY:Y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:sm,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Y,underlineThickness:Y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Y,values:null,vAlphabetic:Y,vMathematical:Y,vectorEffect:null,vHanging:Y,vIdeographic:Y,version:null,vertAdvY:Y,vertOriginX:Y,vertOriginY:Y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:mm}),vm=fm({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()}}),ym=fm({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:hm}),bm=fm({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),xm=/[A-Z]/g,Sm=/-[a-z]/g,Cm=/^data[-\w.:]+$/i;function wm(e,t){let n=em(t),r=t,i=tm;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Cm.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Sm,Em);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Sm.test(e)){let n=e.replace(xm,Tm);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=um}return new i(r,t)}function Tm(e){return`-`+e.toLowerCase()}function Em(e){return e.charAt(1).toUpperCase()}var Dm=$p([pm,gm,vm,ym,bm],`html`),Om=$p([pm,_m,vm,ym,bm],`svg`),km={}.hasOwnProperty;function Am(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&km.call(t,e)){let n=String(t[e]);i=km.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var jm=/["&'<>`]/g,Mm=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Nm=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Pm=/[|\\{}()[\]^$+*?.]/g,Fm=new WeakMap;function Im(e,t){if(e=e.replace(t.subset?Lm(t.subset):jm,r),t.subset||t.escapeOnly)return e;return e.replace(Mm,n).replace(Nm,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Lm(e){let t=Fm.get(e);return t||(t=Rm(e),Fm.set(e,t)),t}function Rm(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Pm,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var zm=/[\dA-Fa-f]/;function Bm(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!zm.test(String.fromCharCode(t))?r:r+`;`}var Vm=/\d/;function Hm(e,t,n){let r=`&#`+String(e);return n&&t&&!Vm.test(String.fromCharCode(t))?r:r+`;`}var Um=`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`.split(`.`),Wm={nbsp:`\xA0`,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:`€`},Gm=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],Km={}.hasOwnProperty,qm={},Jm;for(Jm in Wm)Km.call(Wm,Jm)&&(qm[Wm[Jm]]=Jm);var Ym=/[^\dA-Za-z]/;function Xm(e,t,n,r){let i=String.fromCharCode(e);if(Km.call(qm,i)){let e=qm[i],a=`&`+e;return n&&Um.includes(e)&&!Gm.includes(e)&&(!r||t&&t!==61&&Ym.test(String.fromCharCode(t)))?a:a+`;`}return``}function Zm(e,t,n){let r=Bm(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Xm(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=Hm(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function Qm(e,t){return Im(e,Object.assign({format:Zm},t))}var $m=/^>|^->|<!--|-->|--!>|<!-$/g,eh=[`>`],th=[`<`,`>`];function nh(e,t,n,r){return r.settings.bogusComments?`<?`+Qm(e.value,Object.assign({},r.settings.characterReferences,{subset:eh}))+`>`:`<!--`+e.value.replace($m,i)+`-->`;function i(e){return Qm(e,Object.assign({},r.settings.characterReferences,{subset:th}))}}function rh(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function ih(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function ah(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function oh(e){return e.join(` `).trim()}var sh=/[ \t\n\f\r]/g;function ch(e){return typeof e==`object`?e.type===`text`?lh(e.value):!1:lh(e)}function lh(e){return e.replace(sh,``)===``}var uh=ph(1),dh=ph(-1),fh=[];function ph(e){return t;function t(t,n,r){let i=t?t.children:fh,a=(n||0)+e,o=i[a];if(!r)for(;o&&ch(o);)a+=e,o=i[a];return o}}var mh={}.hasOwnProperty;function hh(e){return t;function t(t,n,r){return mh.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var gh=hh({body:yh,caption:_h,colgroup:_h,dd:Ch,dt:Sh,head:_h,html:vh,li:xh,optgroup:Th,option:Eh,p:bh,rp:wh,rt:wh,tbody:Oh,td:jh,tfoot:kh,th:jh,thead:Dh,tr:Ah});function _h(e,t,n){let r=uh(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&ch(r.value.charAt(0)))}function vh(e,t,n){let r=uh(n,t);return!r||r.type!==`comment`}function yh(e,t,n){let r=uh(n,t);return!r||r.type!==`comment`}function bh(e,t,n){let r=uh(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 xh(e,t,n){let r=uh(n,t);return!r||r.type===`element`&&r.tagName===`li`}function Sh(e,t,n){let r=uh(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function Ch(e,t,n){let r=uh(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function wh(e,t,n){let r=uh(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function Th(e,t,n){let r=uh(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function Eh(e,t,n){let r=uh(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Dh(e,t,n){let r=uh(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function Oh(e,t,n){let r=uh(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function kh(e,t,n){return!uh(n,t)}function Ah(e,t,n){let r=uh(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function jh(e,t,n){let r=uh(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var Mh=hh({body:Fh,colgroup:Ih,head:Ph,html:Nh,tbody:Lh});function Nh(e){let t=uh(e,-1);return!t||t.type!==`comment`}function Ph(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function Fh(e){let t=uh(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&ch(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function Ih(e,t,n){let r=dh(n,t),i=uh(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&gh(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Lh(e,t,n){let r=dh(n,t),i=uh(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&gh(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var Rh={name:[[`
1281
1279
  \f\r &/=>`.split(``),`
1282
1280
  \f\r "&'/=>\``.split(``)],[`\0
1283
1281
  \f\r "&'/<=>`.split(``),`\0
@@ -1285,7 +1283,7 @@ diff --git`)}function Lp(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.star
1285
1283
  \f\r &>`.split(``),`\0
1286
1284
  \f\r "&'<=>\``.split(``)],[`\0
1287
1285
  \f\r "&'<=>\``.split(``),`\0
1288
- \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function Hh(e,t,n,r){let i=r.schema,a=i.space===`svg`?!1:r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=jm);let l=Uh(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!Fh(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!yh(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Uh(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=Wh(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function Wh(e,t,n){let r=Dm(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;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``;let c=th(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Vh.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?ch:lh)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=th(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Vh.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&sh(n,o)>sh(n,e.alternative)&&(o=e.alternative),s=o+th(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Vh.single:Vh.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var Gh=[`<`,`&`];function Kh(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:th(e.value,Object.assign({},r.settings.characterReferences,{subset:Gh}))}function qh(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Kh(e,t,n,r)}function Jh(e,t,n,r){return r.all(e)}var Yh=Nm(`type`,{invalid:Xh,unknown:Zh,handlers:{comment:ah,doctype:oh,element:Hh,raw:qh,root:Jh,text:Kh}});function Xh(e){throw Error("Expected node, not `"+e+"`")}function Zh(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Qh={},$h={},eg=[];function tg(e,t){let n=t||Qh,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:ng,all:rg,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||em,characterReferences:n.characterReferences||$h,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?jm:Am,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function ng(e,t,n){return Yh(e,t,n,this)}function rg(e){let t=[],n=e&&e.children||eg,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var ig=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;proposedSelectedRange;renderedSelectionRange;selectionAnchor;queuedSelectionRender;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(),this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1}setup(e){this.setSelectionDirty();let{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.renderedSelectionRange=void 0}isSelectionDirty(){return this.renderedSelectionRange===null}setSelection(e,t){let n=!(e===this.selectedRange||Gp(e??void 0,this.selectedRange??void 0));!this.isSelectionDirty()&&!n||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let 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=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;t==null&&n==null&&r==null&&a==null&&i==null||this.options.onGutterUtilityClick!=null&&xg(e.composedPath())||(Sg(this.options.__debugPointerEvents,`click`,`FileDiff.DEBUG.handlePointerClick:`,e),this.handlePointerEvent({eventType:`click`,event:e}))};handlePointerMove=e=>{if(e.pointerType!==`mouse`)return;let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:a,enableGutterUtility:o=!1}=this.options;t===`disabled`&&!o&&n==null&&r==null&&i==null&&a==null||(Sg(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(Sg(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){Sg(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}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();Sg(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);Sg(n,e,`FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:p}=this.options;switch(e){case`move`:{let e=lg(i)&&this.hoveredLine?.lineElement===i.lineElement;cg(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),cg(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),lg(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(dg(i)&&p!=null){p(i);break}if(ug(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!lg(i))break;cg(i)&&l!=null&&l(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...e,event:t}):a?.({...e,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n=`disabled`,onLineClick:r,onLineNumberClick:i,onLineEnter:a,onLineLeave:o,onTokenClick:s,onTokenEnter:c,onTokenLeave:l,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,h=m!=null,g=n!==`disabled`||r!=null||i!=null||a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f||p||h;g&&!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,Sg(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(r!=null&&e.push(`onLineClick`),i!=null&&e.push(`onLineNumberClick`),u!=null&&e.push(`expandable hunk separators`),d!=null&&e.push(`merge conflict actions`)),e})()),Sg(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),Sg(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!g&&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);let _=this.pointerSession.mode===`selecting`||this.pointerSession.mode===`pendingSingleLineUnselect`,v=this.pointerSession.mode===`gutterSelecting`;(!p&&_||!h&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,i=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),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLineNumbersAttr=!0):!i&&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;let t=e.composedPath();xg(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;if(n==null)return;let r=this.currentSelectionEnds(),i=r?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),a=r?.top??i;i==null||a==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:a,current:i},t&&(this.selectionAnchor={lineNumber:a.lineNumber,side:a.side},this.updateSelection(i.lineNumber,i.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange())),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{let{enableLineSelection:t=!1}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let n=this.resolveSelectionPoint(e,{source:`coordinates-first`});if(n==null)return;this.pointerSession.current=n,t===!0&&this.updateSelection(n.lineNumber,n.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let 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();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(Kp(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=>{let{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(this.pointerSession.current=r,t&&this.updateSelection(r.lineNumber,r.side)),n?.(this.buildSelectedLineRange(this.pointerSession.anchor,this.pointerSession.current)),this.selectionAnchor=void 0,t&&(this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),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.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.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){let{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??(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??(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){let e=document.createElement(`div`);e.innerHTML=tg($p());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error(`InteractionManager.ensureGutterUtilityNode: Node element should be a button`);t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);sg(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(e==null)return!1;let 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(){let e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){let t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},r=this.selectionPointRowIndex(t),i=this.selectionPointRowIndex(n);if(!(r==null||i==null))return r>i?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;let t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;let n=this.mode===`diff`?`${t[0]},${t[1]}`:`${t[0]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(let t of r){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(mg(t));if(sg(n)&&!(this.mode===`diff`&&e.side!=null&&n.side!==e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||=(document.addEventListener(`pointermove`,this.handleDocumentPointerMove),document.addEventListener(`pointerup`,this.handleDocumentPointerUp),document.addEventListener(`pointercancel`,this.handleDocumentPointerCancel),!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&=(document.removeEventListener(`pointermove`,this.handleDocumentPointerMove),document.removeEventListener(`pointerup`,this.handleDocumentPointerUp),document.removeEventListener(`pointercancel`,this.handleDocumentPointerCancel),!1)}clearPointerSession(){this.pointerSession={mode:`idle`}}clearPendingSingleLineState(){this.pointerSession.mode===`pendingSingleLineUnselect`&&(this.pointerSession={mode:`idle`})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(sg(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){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionInfoFromPath(n,t.requireNumberColumn)}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(sg(t))return{lineNumber:t.lineNumber,side:this.mode===`diff`?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionPointFromPath(n)}resolveSelectionPath(e,t){let n=t.excludeUtility!==!1;switch(t.source){case`event-path`:return this.pathFromEventPath(e.composedPath(),n);case`coordinates-first`:{let t=this.pathFromCoordinates(e,n);return t===void 0?this.pathFromEventPath(e.composedPath(),n):t??void 0}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&xg(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=mg(e);if(t&&xg(n))return;let r=hg(e);return r==null?this.pathFromAnnotationSlot(e):mg(r)}pathFromAnnotationSlot(e){let t=_g(gg(e));if(t==null)return;let n=this.targetForSelectionPoint(t);return n==null?void 0:mg(n.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=vg(t)?t:vg(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}getCurrentSelectionRange(){return this.proposedSelectedRange===void 0?this.selectedRange:this.proposedSelectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let r=this.getCurrentSelectionRange(),i;if(e==null)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}Gp(r??void 0,i??void 0)||(this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,this.queuedSelectionRender??=requestAnimationFrame(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let 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}renderSelection=()=>{if(this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;let e=this.pre.querySelectorAll(`[data-selected-line]`);for(let t of e)t.removeAttribute(`data-selected-line`);if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;let{children:t}=this.pre;if(t.length===0)return;if(t.length>2)throw console.error(t),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let n=this.pre.getAttribute(`data-diff-type`)===`split`,r=this.getIndexesFromSelection(this.selectedRange,n);if(r==null)throw console.error({rowRange:r,selectedRange:this.selectedRange}),Error(`InteractionManager.renderSelection: No valid rowRange`);let i=r.start===r.end,a=Math.min(r.start,r.end),o=Math.max(r.start,r.end);for(let e of t){let[t,r]=e.children,s=r.children.length;if(s!==t.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);for(let e=0;e<s;e++){let s=r.children[e],c=t.children[e];if(!(s instanceof HTMLElement)||!(c instanceof HTMLElement))continue;let l=this.parseLineIndex(s,n);if((l??0)>o)break;if(l==null||l<a)continue;let u=i?`single`:l===a?`first`:l===o?`last`:``;s.setAttribute(`data-selected-line`,u),c.setAttribute(`data-selected-line`,u),c.nextSibling instanceof HTMLElement&&s.nextSibling instanceof HTMLElement&&(s.nextSibling.hasAttribute(`data-line-annotation`)||s.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(i?(u=`last`,s.setAttribute(`data-selected-line`,`first`)):l===a?u=``:l===o&&s.setAttribute(`data-selected-line`,``),s.nextSibling.setAttribute(`data-selected-line`,u),c.nextSibling.setAttribute(`data-selected-line`,u))}}};notifySelectionCommitted(){this.options.onLineSelected?.(this.getCurrentSelectionRange()??null)}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:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}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,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);fg(e)&&Number.isFinite(n)&&(d={kind:`merge-conflict-action`,resolution:e,conflictIndex:n})}if(s==null&&f.hasAttribute(`data-char`)){s=f;let e=f.getAttribute(`data-char`);if(e!=null){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??``,n=t+e.length;(e.trim()!==``||this.options.enableTokenInteractionsOnWhitespace===!0)&&(c={tokenElement:s,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=o==null?f.getAttribute(`data-column-number`)??void 0:void 0;if(e!=null){o=f,u=Number.parseInt(e,10),t=!0,n=bg(f),a=f.getAttribute(`data-line-index`)??void 0;continue}let p=i==null?f.getAttribute(`data-line`)??void 0:void 0;if(p!=null){i=f,u=Number.parseInt(p,10),n=bg(f),a=f.getAttribute(`data-line-index`)??void 0;continue}if(l==null&&(f.hasAttribute(`data-expand-button`)||f.hasAttribute(`data-unmodified-lines`))){l={hunkIndex:void 0,direction:f.hasAttribute(`data-expand-up`)?`up`:f.hasAttribute(`data-expand-down`)?`down`:`both`,all:f.hasAttribute(`data-expand-all-button`)};continue}let m=l==null?void 0:f.getAttribute(`data-expand-index`)??void 0;if(l!=null&&m!=null){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(r==null&&f.hasAttribute(`data-code`)){r=f;break}}if(d!=null)return d;if(l?.hunkIndex!=null)return{type:`line-info`,hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=a==null?void 0:pg(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:pg(r,`[data-column-number][data-line-index="${a}"]`),r==null||i==null||o==null||n==null||u==null||Number.isNaN(u))return;let f=this.parseLineIndex(i,this.isSplitDiff());return c==null?this.mode===`file`?{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f}:{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:yg(n,r),splitLineIndex:f}:this.mode===`file`?{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f,...c}:{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:yg(n,r),splitLineIndex:f,...c}}isSplitDiff(){return this.pre?.getAttribute(`data-diff-type`)===`split`}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function ag({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,renderGutterUtility:d,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v},y,b,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:og({enableGutterUtility:t,renderGutterUtility:d,onGutterUtilityClick:r}),usesCustomGutterUtility:d!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:y,onMergeConflictActionClick:x,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v,getLineIndex:b}}function og({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw Error(`Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.`);return e??!1}function sg(e){return e!=null&&`kind`in e&&e.kind===`line`}function cg(e){return e!=null&&`kind`in e&&e.kind===`token`}function lg(e){return sg(e)||cg(e)}function ug(e){return`type`in e&&e.type===`line-info`}function dg(e){return`kind`in e&&e.kind===`merge-conflict-action`}function fg(e){return e===`current`||e===`incoming`||e===`both`}function pg(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function mg(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function hg(e){let t=e.closest(`[data-line], [data-column-number]`);if(t instanceof HTMLElement)return t;let n=e.closest(`[data-line-annotation], [data-gutter-buffer="annotation"]`);if(!(n instanceof HTMLElement))return;let r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute(`data-line`)||r.hasAttribute(`data-column-number`))?r:void 0}function gg(e){let t=e.closest(`[slot^="annotation-"]`);if(t instanceof HTMLElement)return t.getAttribute(`slot`)??void 0;if(e instanceof HTMLElement){let t=e.getAttribute(`name`)??void 0;return t!=null&&t.startsWith(`annotation-`)?t:void 0}}function _g(e){if(e==null)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;let n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function vg(e){return e!=null&&typeof e.elementFromPoint==`function`}function yg(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function bg(e){let 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 xg(e){for(let 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}function Sg(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 Cg=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,t){let n=new Set,r=0,i=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(r===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;r++;let n=i.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let a=e.firstElementChild;a instanceof HTMLElement||(a=null),n==null?(n={type:`code`,codeElement:e,numberElement:a,codeWidth:`auto`,numberWidth:0},this.observedNodes.set(e,n),this.observe(e),a!=null&&(this.observedNodes.set(a,n),this.observe(a))):(this.observedNodes.set(e,n),i.delete(e),n.numberElement===a?n.numberElement==null?n.numberWidth=0:(i.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),i.delete(n.numberElement)),a!=null&&(this.observe(a),i.delete(a),this.observedNodes.set(a,n)),n.numberElement=a,n.numberWidth=0))}if(r>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),r=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^-?\d+,-?\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let n=r.get(t);n??(n=[],r.set(t,n)),n.push(e)}for(let[e,t]of r){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[r,a]=t,o=r.firstElementChild,s=a.firstElementChild;if(!(r instanceof HTMLElement)||!(a instanceof HTMLElement)||!(o instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=i.get(o);if(c!=null){this.observedNodes.set(o,c),this.observedNodes.set(s,c),i.delete(o),i.delete(s);continue}let l=o.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:r,child:o,childHeight:l},column2:{container:a,child:s,childHeight:u},currentHeight:`auto`},n.add({child1:o,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of n)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);n.clear()}for(let[e,t]of i)this.unobserve(e),t.type===`code`?Eg(t):Dg(t);i.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null){console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);continue}if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:wg(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:Tg(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;if(!(!i&&!a)&&(t.codeWidth=e,t.numberWidth=r,i&&t.codeElement.style.setProperty(`--diffs-column-width`,`${typeof e==`number`?`${e}px`:`auto`}`),a&&t.codeElement.style.setProperty(`--diffs-column-number-width`,`${r===0?`auto`:`${r}px`}`),i||a&&e!==`auto`)){let n=typeof e==`number`?Math.max(e-r,0):0;t.codeElement.style.setProperty(`--diffs-column-content-width`,`${n>0?`${n}px`:`auto`}`)}}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function wg(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function Tg(e){return Math.max(Math.ceil(e),0)}function Eg(e){e.codeElement.isConnected&&(e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`))}function Dg(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`)}function Og(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function kg(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 Ag(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}var jg=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
1286
+ \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function zh(e,t,n,r){let i=r.schema,a=i.space===`svg`?!1:r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=Om);let l=Bh(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!Mh(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!gh(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Bh(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=Vh(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function Vh(e,t,n){let r=wm(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;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``;let c=Qm(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Rh.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?ah:oh)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=Qm(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Rh.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&ih(n,o)>ih(n,e.alternative)&&(o=e.alternative),s=o+Qm(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Rh.single:Rh.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var Hh=[`<`,`&`];function Uh(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:Qm(e.value,Object.assign({},r.settings.characterReferences,{subset:Hh}))}function Wh(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Uh(e,t,n,r)}function Gh(e,t,n,r){return r.all(e)}var Kh=Am(`type`,{invalid:qh,unknown:Jh,handlers:{comment:nh,doctype:rh,element:zh,raw:Wh,root:Gh,text:Uh}});function qh(e){throw Error("Expected node, not `"+e+"`")}function Jh(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Yh={},Xh={},Zh=[];function Qh(e,t){let n=t||Yh,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:$h,all:eg,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||Zp,characterReferences:n.characterReferences||Xh,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?Om:Dm,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function $h(e,t,n){return Kh(e,t,n,this)}function eg(e){let t=[],n=e&&e.children||Zh,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var tg=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;proposedSelectedRange;renderedSelectionRange;selectionAnchor;queuedSelectionRender;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(),this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1}setup(e){this.setSelectionDirty();let{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.renderedSelectionRange=void 0}isSelectionDirty(){return this.renderedSelectionRange===null}setSelection(e,t){let n=!(e===this.selectedRange||Hp(e??void 0,this.selectedRange??void 0));!this.isSelectionDirty()&&!n||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let 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=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;t==null&&n==null&&r==null&&a==null&&i==null||this.options.onGutterUtilityClick!=null&&vg(e.composedPath())||(yg(this.options.__debugPointerEvents,`click`,`FileDiff.DEBUG.handlePointerClick:`,e),this.handlePointerEvent({eventType:`click`,event:e}))};handlePointerMove=e=>{if(e.pointerType!==`mouse`)return;let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:a,enableGutterUtility:o=!1}=this.options;t===`disabled`&&!o&&n==null&&r==null&&i==null&&a==null||(yg(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(yg(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){yg(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}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();yg(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);yg(n,e,`FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:p}=this.options;switch(e){case`move`:{let e=og(i)&&this.hoveredLine?.lineElement===i.lineElement;ag(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),ag(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),og(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(cg(i)&&p!=null){p(i);break}if(sg(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!og(i))break;ag(i)&&l!=null&&l(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...e,event:t}):a?.({...e,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n=`disabled`,onLineClick:r,onLineNumberClick:i,onLineEnter:a,onLineLeave:o,onTokenClick:s,onTokenEnter:c,onTokenLeave:l,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,h=m!=null,g=n!==`disabled`||r!=null||i!=null||a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f||p||h;g&&!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,yg(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(r!=null&&e.push(`onLineClick`),i!=null&&e.push(`onLineNumberClick`),u!=null&&e.push(`expandable hunk separators`),d!=null&&e.push(`merge conflict actions`)),e})()),yg(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),yg(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!g&&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);let _=this.pointerSession.mode===`selecting`||this.pointerSession.mode===`pendingSingleLineUnselect`,v=this.pointerSession.mode===`gutterSelecting`;(!p&&_||!h&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,i=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),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLineNumbersAttr=!0):!i&&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;let t=e.composedPath();vg(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;if(n==null)return;let r=this.currentSelectionEnds(),i=r?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),a=r?.top??i;i==null||a==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:a,current:i},t&&(this.selectionAnchor={lineNumber:a.lineNumber,side:a.side},this.updateSelection(i.lineNumber,i.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange())),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{let{enableLineSelection:t=!1}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let n=this.resolveSelectionPoint(e,{source:`coordinates-first`});if(n==null)return;this.pointerSession.current=n,t===!0&&this.updateSelection(n.lineNumber,n.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let 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();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(Up(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=>{let{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(this.pointerSession.current=r,t&&this.updateSelection(r.lineNumber,r.side)),n?.(this.buildSelectedLineRange(this.pointerSession.anchor,this.pointerSession.current)),this.selectionAnchor=void 0,t&&(this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),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.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.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){let{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??(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??(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){let e=document.createElement(`div`);e.innerHTML=Qh(Xp());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error(`InteractionManager.ensureGutterUtilityNode: Node element should be a button`);t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);ig(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(e==null)return!1;let 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(){let e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){let t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},r=this.selectionPointRowIndex(t),i=this.selectionPointRowIndex(n);if(!(r==null||i==null))return r>i?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;let t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;let n=this.mode===`diff`?`${t[0]},${t[1]}`:`${t[0]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(let t of r){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(dg(t));if(ig(n)&&!(this.mode===`diff`&&e.side!=null&&n.side!==e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||=(document.addEventListener(`pointermove`,this.handleDocumentPointerMove),document.addEventListener(`pointerup`,this.handleDocumentPointerUp),document.addEventListener(`pointercancel`,this.handleDocumentPointerCancel),!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&=(document.removeEventListener(`pointermove`,this.handleDocumentPointerMove),document.removeEventListener(`pointerup`,this.handleDocumentPointerUp),document.removeEventListener(`pointercancel`,this.handleDocumentPointerCancel),!1)}clearPointerSession(){this.pointerSession={mode:`idle`}}clearPendingSingleLineState(){this.pointerSession.mode===`pendingSingleLineUnselect`&&(this.pointerSession={mode:`idle`})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(ig(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){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionInfoFromPath(n,t.requireNumberColumn)}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(ig(t))return{lineNumber:t.lineNumber,side:this.mode===`diff`?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionPointFromPath(n)}resolveSelectionPath(e,t){let n=t.excludeUtility!==!1;switch(t.source){case`event-path`:return this.pathFromEventPath(e.composedPath(),n);case`coordinates-first`:{let t=this.pathFromCoordinates(e,n);return t===void 0?this.pathFromEventPath(e.composedPath(),n):t??void 0}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&vg(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=dg(e);if(t&&vg(n))return;let r=fg(e);return r==null?this.pathFromAnnotationSlot(e):dg(r)}pathFromAnnotationSlot(e){let t=mg(pg(e));if(t==null)return;let n=this.targetForSelectionPoint(t);return n==null?void 0:dg(n.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=hg(t)?t:hg(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}getCurrentSelectionRange(){return this.proposedSelectedRange===void 0?this.selectedRange:this.proposedSelectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let r=this.getCurrentSelectionRange(),i;if(e==null)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}Hp(r??void 0,i??void 0)||(this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,this.queuedSelectionRender??=requestAnimationFrame(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let 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}renderSelection=()=>{if(this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;let e=this.pre.querySelectorAll(`[data-selected-line]`);for(let t of e)t.removeAttribute(`data-selected-line`);if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;let{children:t}=this.pre;if(t.length===0)return;if(t.length>2)throw console.error(t),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let n=this.pre.getAttribute(`data-diff-type`)===`split`,r=this.getIndexesFromSelection(this.selectedRange,n);if(r==null)throw console.error({rowRange:r,selectedRange:this.selectedRange}),Error(`InteractionManager.renderSelection: No valid rowRange`);let i=r.start===r.end,a=Math.min(r.start,r.end),o=Math.max(r.start,r.end);for(let e of t){let[t,r]=e.children,s=r.children.length;if(s!==t.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);for(let e=0;e<s;e++){let s=r.children[e],c=t.children[e];if(!(s instanceof HTMLElement)||!(c instanceof HTMLElement))continue;let l=this.parseLineIndex(s,n);if((l??0)>o)break;if(l==null||l<a)continue;let u=i?`single`:l===a?`first`:l===o?`last`:``;s.setAttribute(`data-selected-line`,u),c.setAttribute(`data-selected-line`,u),c.nextSibling instanceof HTMLElement&&s.nextSibling instanceof HTMLElement&&(s.nextSibling.hasAttribute(`data-line-annotation`)||s.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(i?(u=`last`,s.setAttribute(`data-selected-line`,`first`)):l===a?u=``:l===o&&s.setAttribute(`data-selected-line`,``),s.nextSibling.setAttribute(`data-selected-line`,u),c.nextSibling.setAttribute(`data-selected-line`,u))}}};notifySelectionCommitted(){this.options.onLineSelected?.(this.getCurrentSelectionRange()??null)}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:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}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,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);lg(e)&&Number.isFinite(n)&&(d={kind:`merge-conflict-action`,resolution:e,conflictIndex:n})}if(s==null&&f.hasAttribute(`data-char`)){s=f;let e=f.getAttribute(`data-char`);if(e!=null){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??``,n=t+e.length;(e.trim()!==``||this.options.enableTokenInteractionsOnWhitespace===!0)&&(c={tokenElement:s,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=o==null?f.getAttribute(`data-column-number`)??void 0:void 0;if(e!=null){o=f,u=Number.parseInt(e,10),t=!0,n=_g(f),a=f.getAttribute(`data-line-index`)??void 0;continue}let p=i==null?f.getAttribute(`data-line`)??void 0:void 0;if(p!=null){i=f,u=Number.parseInt(p,10),n=_g(f),a=f.getAttribute(`data-line-index`)??void 0;continue}if(l==null&&(f.hasAttribute(`data-expand-button`)||f.hasAttribute(`data-unmodified-lines`))){l={hunkIndex:void 0,direction:f.hasAttribute(`data-expand-up`)?`up`:f.hasAttribute(`data-expand-down`)?`down`:`both`,all:f.hasAttribute(`data-expand-all-button`)};continue}let m=l==null?void 0:f.getAttribute(`data-expand-index`)??void 0;if(l!=null&&m!=null){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(r==null&&f.hasAttribute(`data-code`)){r=f;break}}if(d!=null)return d;if(l?.hunkIndex!=null)return{type:`line-info`,hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=a==null?void 0:ug(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:ug(r,`[data-column-number][data-line-index="${a}"]`),r==null||i==null||o==null||n==null||u==null||Number.isNaN(u))return;let f=this.parseLineIndex(i,this.isSplitDiff());return c==null?this.mode===`file`?{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f}:{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:gg(n,r),splitLineIndex:f}:this.mode===`file`?{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f,...c}:{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:gg(n,r),splitLineIndex:f,...c}}isSplitDiff(){return this.pre?.getAttribute(`data-diff-type`)===`split`}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function ng({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,renderGutterUtility:d,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v},y,b,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:rg({enableGutterUtility:t,renderGutterUtility:d,onGutterUtilityClick:r}),usesCustomGutterUtility:d!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:y,onMergeConflictActionClick:x,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v,getLineIndex:b}}function rg({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw Error(`Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.`);return e??!1}function ig(e){return e!=null&&`kind`in e&&e.kind===`line`}function ag(e){return e!=null&&`kind`in e&&e.kind===`token`}function og(e){return ig(e)||ag(e)}function sg(e){return`type`in e&&e.type===`line-info`}function cg(e){return`kind`in e&&e.kind===`merge-conflict-action`}function lg(e){return e===`current`||e===`incoming`||e===`both`}function ug(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function dg(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function fg(e){let t=e.closest(`[data-line], [data-column-number]`);if(t instanceof HTMLElement)return t;let n=e.closest(`[data-line-annotation], [data-gutter-buffer="annotation"]`);if(!(n instanceof HTMLElement))return;let r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute(`data-line`)||r.hasAttribute(`data-column-number`))?r:void 0}function pg(e){let t=e.closest(`[slot^="annotation-"]`);if(t instanceof HTMLElement)return t.getAttribute(`slot`)??void 0;if(e instanceof HTMLElement){let t=e.getAttribute(`name`)??void 0;return t!=null&&t.startsWith(`annotation-`)?t:void 0}}function mg(e){if(e==null)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;let n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function hg(e){return e!=null&&typeof e.elementFromPoint==`function`}function gg(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function _g(e){let 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 vg(e){for(let 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}function yg(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 bg=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,t){let n=new Set,r=0,i=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(r===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;r++;let n=i.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let a=e.firstElementChild;a instanceof HTMLElement||(a=null),n==null?(n={type:`code`,codeElement:e,numberElement:a,codeWidth:`auto`,numberWidth:0},this.observedNodes.set(e,n),this.observe(e),a!=null&&(this.observedNodes.set(a,n),this.observe(a))):(this.observedNodes.set(e,n),i.delete(e),n.numberElement===a?n.numberElement==null?n.numberWidth=0:(i.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),i.delete(n.numberElement)),a!=null&&(this.observe(a),i.delete(a),this.observedNodes.set(a,n)),n.numberElement=a,n.numberWidth=0))}if(r>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),r=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^-?\d+,-?\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let n=r.get(t);n??(n=[],r.set(t,n)),n.push(e)}for(let[e,t]of r){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[r,a]=t,o=r.firstElementChild,s=a.firstElementChild;if(!(r instanceof HTMLElement)||!(a instanceof HTMLElement)||!(o instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=i.get(o);if(c!=null){this.observedNodes.set(o,c),this.observedNodes.set(s,c),i.delete(o),i.delete(s);continue}let l=o.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:r,child:o,childHeight:l},column2:{container:a,child:s,childHeight:u},currentHeight:`auto`},n.add({child1:o,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of n)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);n.clear()}for(let[e,t]of i)this.unobserve(e),t.type===`code`?Cg(t):wg(t);i.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null){console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);continue}if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:xg(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:Sg(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;if(!(!i&&!a)&&(t.codeWidth=e,t.numberWidth=r,i&&t.codeElement.style.setProperty(`--diffs-column-width`,`${typeof e==`number`?`${e}px`:`auto`}`),a&&t.codeElement.style.setProperty(`--diffs-column-number-width`,`${r===0?`auto`:`${r}px`}`),i||a&&e!==`auto`)){let n=typeof e==`number`?Math.max(e-r,0):0;t.codeElement.style.setProperty(`--diffs-column-content-width`,`${n>0?`${n}px`:`auto`}`)}}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function xg(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function Sg(e){return Math.max(Math.ceil(e),0)}function Cg(e){e.codeElement.isConnected&&(e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`))}function wg(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`)}function Tg(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function Eg(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 Dg(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}var Og=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
1289
1287
  <symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
1290
1288
  <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"/>
1291
1289
  </symbol>
@@ -1337,7 +1335,7 @@ diff --git`)}function Lp(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.star
1337
1335
  <symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
1338
1336
  <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"/>
1339
1337
  </symbol>
1340
- </svg>`;function Mg(e,t){return e==null||t==null?e===t:Pg(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}var Ng={};function Pg(e=Ng,t=Ng){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}function Fg(e){let t=document.createElement(`div`);return t.dataset.annotationSlot=``,t.slot=e,t.style.whiteSpace=`normal`,t}function Ig(){let 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 Lg(){let e=document.createElement(`style`);return e.setAttribute(np,``),e}var Rg;function zg(e){if(Rg!=null)return Rg;let t=e.host;if(typeof HTMLElement<`u`&&t instanceof HTMLElement&&!t.isConnected)return;let n=document.createElement(`div`);n.setAttribute(`data-code`,``),n.setAttribute(rp,`true`);let r=document.createElement(`div`);return r.style.position=`relative`,r.style.width=`200%`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n),Rg=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),Rg}function Bg(e){return`${ip}: ${e==null?`var(--diffs-scrollbar-gutter-fallback)`:`${e}px`};`}var Vg=`@layer base {
1338
+ </svg>`;function kg(e,t){return e==null||t==null?e===t:jg(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}var Ag={};function jg(e=Ag,t=Ag){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}function Mg(e){let t=document.createElement(`div`);return t.dataset.annotationSlot=``,t.slot=e,t.style.whiteSpace=`normal`,t}function Ng(){let 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 Pg(){let e=document.createElement(`style`);return e.setAttribute($f,``),e}var Fg;function Ig(e){if(Fg!=null)return Fg;let t=e.host;if(typeof HTMLElement<`u`&&t instanceof HTMLElement&&!t.isConnected)return;let n=document.createElement(`div`);n.setAttribute(`data-code`,``),n.setAttribute(ep,`true`);let r=document.createElement(`div`);return r.style.position=`relative`,r.style.width=`200%`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n),Fg=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),Fg}function Lg(e){return`${tp}: ${e==null?`var(--diffs-scrollbar-gutter-fallback)`:`${e}px`};`}var Rg=`@layer base {
1341
1339
  :host {
1342
1340
  --diffs-font-fallback: "SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono",
1343
1341
  "Courier New", monospace;
@@ -2656,34 +2654,34 @@ diff --git`)}function Lp(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.star
2656
2654
  }
2657
2655
 
2658
2656
  @layer theme, rendered, unsafe;
2659
- `,Hg=`@layer base, theme, rendered, unsafe;`,Ug=RegExp(`${qg(ip)}\\s*:\\s*[^;]+;`);function Wg(e){return`${Hg}
2657
+ `,zg=`@layer base, theme, rendered, unsafe;`,Bg=RegExp(`${Wg(tp)}\\s*:\\s*[^;]+;`);function Vg(e){return`${zg}
2660
2658
  @layer unsafe {
2661
2659
  ${e}
2662
- }`}function Gg(e,t=`system`,n){return`${Hg}
2660
+ }`}function Hg(e,t=`system`,n){return`${zg}
2663
2661
  @layer rendered {
2664
2662
  :host {${t===`system`?``:`
2665
2663
  color-scheme: ${t};`}
2666
- ${Bg(n)}
2664
+ ${Lg(n)}
2667
2665
  ${e}
2668
2666
  }
2669
- }`}function Kg(e,t){let n=Bg(t);return e.replace(Ug,n)}function qg(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Jg({code:e,pre:t,columnType:n,rowSpan:r,containerSize:i=!1}={}){return e??(e=document.createElement(`code`),e.setAttribute(`data-code`,``),n!=null&&e.setAttribute(`data-${n}`,``),t?.appendChild(e)),r==null?e.style.removeProperty(`grid-row`):e.style.setProperty(`grid-row`,`span ${r}`),i?e.setAttribute(`data-container-size`,``):e.removeAttribute(`data-container-size`),e}function Yg({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===``){t?.remove();return}return t??=Xg(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function Xg(){let e=document.createElement(`style`);return e.setAttribute(tp,``),e}function Zg(e,t){if(t==null)return;let n=e.shadowRoot??e.attachShadow({mode:`open`});n.innerHTML===``&&(n.innerHTML=t)}function Qg(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:i,overflow:a,split:o,totalLines:s,customProperties:c}){if(c!=null)for(let t in c){let n=c[t];n!=null&&e.setAttribute(t,`${n}`)}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 i?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`,o?`split`:`single`):e.removeAttribute(`data-diff-type`),e.setAttribute(`data-overflow`,a),e.style.setProperty(`--diffs-min-number-column-width-default`,`${`${s}`.length}ch`),e}if(typeof HTMLElement<`u`&&customElements.get(`diffs-container`)==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;let t=this.attachShadow({mode:`open`});e??(e=new CSSStyleSheet,e.replaceSync(Vg)),t.adoptedStyleSheets=[e]}connectedCallback(){zg(this.shadowRoot??this.attachShadow({mode:`open`}))}}customElements.define(Wf,t)}var $g=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}else return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}},e_=new class extends $g{};function t_(e,t,n){return e_.diff(e,t,n)}function n_(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function r_(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function i_(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function a_(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function o_(e,t){return i_(e,t,``)}function s_(e,t){return a_(e,t,``)}function c_(e,t){return t.slice(0,l_(e,t))}function l_(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function u_(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function d_(e,t){if(t)return p_(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function f_(e,t){if(t)return p_(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function p_(e,t){if(!t)return[f_(e),d_(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=u_(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var m_=`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}`,h_=RegExp(`[${m_}]+|\\s+|[^${m_}]`,`ug`);new class extends $g{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=u_(e,r)}else n=e.match(h_)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&g_(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&g_(n,i,r,null,t.intlSegmenter),e}};function g_(e,t,n,r,i){if(t&&n){let[a,o]=p_(t.value,i),[s,c]=p_(n.value,i);if(e){let r=n_(a,s);e.value=a_(e.value,s,r),t.value=o_(t.value,r),n.value=o_(n.value,r)}if(r){let e=r_(o,c);r.value=i_(r.value,c,e),t.value=s_(t.value,e),n.value=s_(n.value,e)}}else if(n){if(e){let e=f_(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=f_(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=f_(r.value,i),[a,o]=p_(t.value,i),s=n_(n,a);t.value=o_(t.value,s);let c=r_(o_(n,s),o);t.value=s_(t.value,c),r.value=i_(r.value,n,c),e.value=a_(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=f_(r.value,i),n=c_(d_(t.value,i),e);t.value=s_(t.value,n)}else if(e){let n=c_(d_(e.value,i),f_(t.value,i));t.value=o_(t.value,n)}}var __=new class extends $g{tokenize(e){let t=RegExp(`(\\r?\\n)|[${m_}]+|[^\\S\\n\\r]+|[^${m_}]`,`ug`);return e.match(t)||[]}};function v_(e,t,n){return __.diff(e,t,n)}var y_=new class extends $g{constructor(){super(...arguments),this.tokenize=x_}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
2667
+ }`}function Ug(e,t){let n=Lg(t);return e.replace(Bg,n)}function Wg(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Gg({code:e,pre:t,columnType:n,rowSpan:r,containerSize:i=!1}={}){return e??(e=document.createElement(`code`),e.setAttribute(`data-code`,``),n!=null&&e.setAttribute(`data-${n}`,``),t?.appendChild(e)),r==null?e.style.removeProperty(`grid-row`):e.style.setProperty(`grid-row`,`span ${r}`),i?e.setAttribute(`data-container-size`,``):e.removeAttribute(`data-container-size`),e}function Kg({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===``){t?.remove();return}return t??=qg(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function qg(){let e=document.createElement(`style`);return e.setAttribute(Qf,``),e}function Jg(e,t){if(t==null)return;let n=e.shadowRoot??e.attachShadow({mode:`open`});n.innerHTML===``&&(n.innerHTML=t)}function Yg(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:i,overflow:a,split:o,totalLines:s,customProperties:c}){if(c!=null)for(let t in c){let n=c[t];n!=null&&e.setAttribute(t,`${n}`)}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 i?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`,o?`split`:`single`):e.removeAttribute(`data-diff-type`),e.setAttribute(`data-overflow`,a),e.style.setProperty(`--diffs-min-number-column-width-default`,`${`${s}`.length}ch`),e}if(typeof HTMLElement<`u`&&customElements.get(`diffs-container`)==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;let t=this.attachShadow({mode:`open`});e??(e=new CSSStyleSheet,e.replaceSync(Rg)),t.adoptedStyleSheets=[e]}connectedCallback(){Ig(this.shadowRoot??this.attachShadow({mode:`open`}))}}customElements.define(Vf,t)}var Xg=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}else return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}},Zg=new class extends Xg{};function Qg(e,t,n){return Zg.diff(e,t,n)}function $g(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function e_(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function t_(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function n_(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function r_(e,t){return t_(e,t,``)}function i_(e,t){return n_(e,t,``)}function a_(e,t){return t.slice(0,o_(e,t))}function o_(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function s_(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function c_(e,t){if(t)return u_(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function l_(e,t){if(t)return u_(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function u_(e,t){if(!t)return[l_(e),c_(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=s_(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var d_=`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}`,f_=RegExp(`[${d_}]+|\\s+|[^${d_}]`,`ug`);new class extends Xg{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=s_(e,r)}else n=e.match(f_)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&p_(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&p_(n,i,r,null,t.intlSegmenter),e}};function p_(e,t,n,r,i){if(t&&n){let[a,o]=u_(t.value,i),[s,c]=u_(n.value,i);if(e){let r=$g(a,s);e.value=n_(e.value,s,r),t.value=r_(t.value,r),n.value=r_(n.value,r)}if(r){let e=e_(o,c);r.value=t_(r.value,c,e),t.value=i_(t.value,e),n.value=i_(n.value,e)}}else if(n){if(e){let e=l_(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=l_(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=l_(r.value,i),[a,o]=u_(t.value,i),s=$g(n,a);t.value=r_(t.value,s);let c=e_(r_(n,s),o);t.value=i_(t.value,c),r.value=t_(r.value,n,c),e.value=n_(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=l_(r.value,i),n=a_(c_(t.value,i),e);t.value=i_(t.value,n)}else if(e){let n=a_(c_(e.value,i),l_(t.value,i));t.value=r_(t.value,n)}}var m_=new class extends Xg{tokenize(e){let t=RegExp(`(\\r?\\n)|[${d_}]+|[^\\S\\n\\r]+|[^${d_}]`,`ug`);return e.match(t)||[]}};function h_(e,t,n){return m_.diff(e,t,n)}var g_=new class extends Xg{constructor(){super(...arguments),this.tokenize=v_}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
2670
2668
  `))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
2671
2669
  `))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
2672
2670
  `)&&(e=e.slice(0,-1)),t.endsWith(`
2673
- `)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function b_(e,t,n){return y_.diff(e,t,n)}function x_(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
2674
- `));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function S_(e){return e==`.`||e==`!`||e==`?`}new class extends $g{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(S_(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends $g{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends $g{constructor(){super(...arguments),this.tokenize=x_}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(C_(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function C_(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=C_(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=C_(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends $g{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function w_(e){for(let t=0;t<e.length;t++)if(e[t]<` `||e[t]>`~`||e[t]===`"`||e[t]===`\\`)return!0;return!1}function T_(e){if(!w_(e))return e;let t=`"`,n=new TextEncoder().encode(e),r=0;for(;r<n.length;){let e=n[r];e===7?t+=`\\a`:e===8?t+=`\\b`:e===9?t+=`\\t`:e===10?t+=`\\n`:e===11?t+=`\\v`:e===12?t+=`\\f`:e===13?t+=`\\r`:e===34?t+=`\\"`:e===92?t+=`\\\\`:e>=32&&e<=126?t+=String.fromCharCode(e):t+=`\\`+e.toString(8).padStart(3,`0`),r++}return t+=`"`,t}var E_={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function D_(e,t,n,r,i,a,o){let s;s=o?typeof o==`function`?{callback:o}:o:{},s.context===void 0&&(s.context=4);let c=s.context;if(s.newlineIsToken)throw Error(`newlineIsToken may not be used with patch-generation functions, only with diffing functions`);if(s.callback){let{callback:e}=s;b_(n,r,Object.assign(Object.assign({},s),{callback:t=>{e(l(t))}}))}else return l(b_(n,r,s));function l(n){if(!n)return;n.push({value:``,lines:[]});function r(e){return e.map(function(e){return` `+e})}let o=[],s=0,l=0,u=[],d=1,f=1;for(let e=0;e<n.length;e++){let t=n[e],i=t.lines||A_(t.value);if(t.lines=i,t.added||t.removed){if(!s){let t=n[e-1];s=d,l=f,t&&(u=c>0?r(t.lines.slice(-c)):[],s-=u.length,l-=u.length)}for(let e of i)u.push((t.added?`+`:`-`)+e);t.added?f+=i.length:d+=i.length}else{if(s)if(i.length<=c*2&&e<n.length-2)for(let e of r(i))u.push(e);else{let e=Math.min(i.length,c);for(let t of r(i.slice(0,e)))u.push(t);let t={oldStart:s,oldLines:d-s+e,newStart:l,newLines:f-l+e,lines:u};o.push(t),s=0,l=0,u=[]}d+=i.length,f+=i.length}}for(let e of o)for(let t=0;t<e.lines.length;t++)e.lines[t].endsWith(`
2675
- `)?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,`\`),t++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:a,hunks:o}}}function O_(e,t){if(t||=E_,Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders&&!e.every(e=>e.isGit))throw 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(e=>O_(e,t)).join(`
2676
- `)}let n=[];if(e.isGit){if(t=E_,!e.oldFileName)throw Error(`oldFileName must be specified for Git patches`);if(!e.newFileName)throw Error(`newFileName must be specified for Git patches`);let r=e.oldFileName,i=e.newFileName;e.isCreate&&r===`/dev/null`?r=i.replace(/^b\//,`a/`):e.isDelete&&i===`/dev/null`&&(i=r.replace(/^a\//,`b/`)),n.push(`diff --git `+T_(r)+` `+T_(i)),e.isDelete&&n.push(`deleted file mode `+(e.oldMode??`100644`)),e.isCreate&&n.push(`new file mode `+(e.newMode??`100644`)),e.oldMode&&e.newMode&&!e.isDelete&&!e.isCreate&&(n.push(`old mode `+e.oldMode),n.push(`new mode `+e.newMode)),e.isRename&&(n.push(`rename from `+T_((e.oldFileName??``).replace(/^a\//,``))),n.push(`rename to `+T_((e.newFileName??``).replace(/^b\//,``)))),e.isCopy&&(n.push(`copy from `+T_((e.oldFileName??``).replace(/^a\//,``))),n.push(`copy to `+T_((e.newFileName??``).replace(/^b\//,``))))}else t.includeIndex&&e.oldFileName==e.newFileName&&e.oldFileName!==void 0&&n.push(`Index: `+e.oldFileName),t.includeUnderline&&n.push(`===================================================================`);let r=e.hunks.length>0;t.includeFileHeaders&&e.oldFileName!==void 0&&e.newFileName!==void 0&&(!e.isGit||r)&&(n.push(`--- `+T_(e.oldFileName)+(e.oldHeader?` `+e.oldHeader:``)),n.push(`+++ `+T_(e.newFileName)+(e.newHeader?` `+e.newHeader:``)));for(let t=0;t<e.hunks.length;t++){let r=e.hunks[t],i=r.oldLines===0?r.oldStart-1:r.oldStart,a=r.newLines===0?r.newStart-1:r.newStart;n.push(`@@ -`+i+`,`+r.oldLines+` +`+a+`,`+r.newLines+` @@`);for(let e of r.lines)n.push(e)}return n.join(`
2671
+ `)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function __(e,t,n){return g_.diff(e,t,n)}function v_(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
2672
+ `));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function y_(e){return e==`.`||e==`!`||e==`?`}new class extends Xg{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(y_(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends Xg{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends Xg{constructor(){super(...arguments),this.tokenize=v_}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(b_(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function b_(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=b_(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=b_(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends Xg{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function x_(e){for(let t=0;t<e.length;t++)if(e[t]<` `||e[t]>`~`||e[t]===`"`||e[t]===`\\`)return!0;return!1}function S_(e){if(!x_(e))return e;let t=`"`,n=new TextEncoder().encode(e),r=0;for(;r<n.length;){let e=n[r];e===7?t+=`\\a`:e===8?t+=`\\b`:e===9?t+=`\\t`:e===10?t+=`\\n`:e===11?t+=`\\v`:e===12?t+=`\\f`:e===13?t+=`\\r`:e===34?t+=`\\"`:e===92?t+=`\\\\`:e>=32&&e<=126?t+=String.fromCharCode(e):t+=`\\`+e.toString(8).padStart(3,`0`),r++}return t+=`"`,t}var C_={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function w_(e,t,n,r,i,a,o){let s;s=o?typeof o==`function`?{callback:o}:o:{},s.context===void 0&&(s.context=4);let c=s.context;if(s.newlineIsToken)throw Error(`newlineIsToken may not be used with patch-generation functions, only with diffing functions`);if(s.callback){let{callback:e}=s;__(n,r,Object.assign(Object.assign({},s),{callback:t=>{e(l(t))}}))}else return l(__(n,r,s));function l(n){if(!n)return;n.push({value:``,lines:[]});function r(e){return e.map(function(e){return` `+e})}let o=[],s=0,l=0,u=[],d=1,f=1;for(let e=0;e<n.length;e++){let t=n[e],i=t.lines||D_(t.value);if(t.lines=i,t.added||t.removed){if(!s){let t=n[e-1];s=d,l=f,t&&(u=c>0?r(t.lines.slice(-c)):[],s-=u.length,l-=u.length)}for(let e of i)u.push((t.added?`+`:`-`)+e);t.added?f+=i.length:d+=i.length}else{if(s)if(i.length<=c*2&&e<n.length-2)for(let e of r(i))u.push(e);else{let e=Math.min(i.length,c);for(let t of r(i.slice(0,e)))u.push(t);let t={oldStart:s,oldLines:d-s+e,newStart:l,newLines:f-l+e,lines:u};o.push(t),s=0,l=0,u=[]}d+=i.length,f+=i.length}}for(let e of o)for(let t=0;t<e.lines.length;t++)e.lines[t].endsWith(`
2673
+ `)?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,`\`),t++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:a,hunks:o}}}function T_(e,t){if(t||=C_,Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders&&!e.every(e=>e.isGit))throw 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(e=>T_(e,t)).join(`
2674
+ `)}let n=[];if(e.isGit){if(t=C_,!e.oldFileName)throw Error(`oldFileName must be specified for Git patches`);if(!e.newFileName)throw Error(`newFileName must be specified for Git patches`);let r=e.oldFileName,i=e.newFileName;e.isCreate&&r===`/dev/null`?r=i.replace(/^b\//,`a/`):e.isDelete&&i===`/dev/null`&&(i=r.replace(/^a\//,`b/`)),n.push(`diff --git `+S_(r)+` `+S_(i)),e.isDelete&&n.push(`deleted file mode `+(e.oldMode??`100644`)),e.isCreate&&n.push(`new file mode `+(e.newMode??`100644`)),e.oldMode&&e.newMode&&!e.isDelete&&!e.isCreate&&(n.push(`old mode `+e.oldMode),n.push(`new mode `+e.newMode)),e.isRename&&(n.push(`rename from `+S_((e.oldFileName??``).replace(/^a\//,``))),n.push(`rename to `+S_((e.newFileName??``).replace(/^b\//,``)))),e.isCopy&&(n.push(`copy from `+S_((e.oldFileName??``).replace(/^a\//,``))),n.push(`copy to `+S_((e.newFileName??``).replace(/^b\//,``))))}else t.includeIndex&&e.oldFileName==e.newFileName&&e.oldFileName!==void 0&&n.push(`Index: `+e.oldFileName),t.includeUnderline&&n.push(`===================================================================`);let r=e.hunks.length>0;t.includeFileHeaders&&e.oldFileName!==void 0&&e.newFileName!==void 0&&(!e.isGit||r)&&(n.push(`--- `+S_(e.oldFileName)+(e.oldHeader?` `+e.oldHeader:``)),n.push(`+++ `+S_(e.newFileName)+(e.newHeader?` `+e.newHeader:``)));for(let t=0;t<e.hunks.length;t++){let r=e.hunks[t],i=r.oldLines===0?r.oldStart-1:r.oldStart,a=r.newLines===0?r.newStart-1:r.newStart;n.push(`@@ -`+i+`,`+r.oldLines+` +`+a+`,`+r.newLines+` @@`);for(let e of r.lines)n.push(e)}return n.join(`
2677
2675
  `)+`
2678
- `}function k_(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;D_(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?O_(e,o.headerOptions):void 0)}}))}else{let s=D_(e,t,n,r,i,a,o);return s?O_(s,o?.headerOptions):void 0}}function A_(e){let t=e.endsWith(`
2676
+ `}function E_(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;w_(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?T_(e,o.headerOptions):void 0)}}))}else{let s=w_(e,t,n,r,i,a,o);return s?T_(s,o?.headerOptions):void 0}}function D_(e){let t=e.endsWith(`
2679
2677
  `),n=e.split(`
2680
2678
  `).map(e=>e+`
2681
- `);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function j_(e,t,n,r=!1){let i=yp(k_(e.name,t.name,e.contents,t.contents,e.header,t.header,n),{cacheKey:(()=>{if(e.cacheKey!=null&&t.cacheKey!=null)return`${e.cacheKey}:${t.cacheKey}`})(),oldFile:e,newFile:t,throwOnError:r});if(i==null)throw Error(`parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?`);return t.lang!=null&&(i.lang=t.lang),i}var M_=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,!1)}setup(e,t,n){if(t==null||n==null)for(let 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}))}},N_=new Map,P_={"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`,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 F_(e){if(N_.has(e))return N_.get(e)??`text`;if(P_[e]!=null)return P_[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(N_.has(t[1]))return N_.get(t[1])??`text`;if(P_[t[1]]!=null)return P_[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return N_.has(n)?N_.get(n)??`text`:P_[n]??`text`}function I_(e){let t=e.lang??F_(e.name),n=e.lang??(e.prevName==null?`text`:F_(e.prevName));return t===`text`&&n===`text`}function L_(e){let t=e[0];return t!=null&&t.length>0?t:void 0}function R_(e){return e.startingLine===0&&e.totalLines>0}var z_=new Map,B_=new Map,V_=new Map,H_=new Set;function U_(e){for(let t of Array.isArray(e)?e:[e])if(!(t===`text`||t===`ansi`)&&!H_.has(t))return!1;return!0}function W_(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(H_.has(n.name))continue;let e=z_.get(n.name);e??(e=n,z_.set(n.name,e)),H_.add(e.name),t.loadLanguageSync(e.data)}}function G_(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var K_=`modulepreload`,q_=function(e){return`/`+e},J_={},Z=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,new URL(`../../../src/node/plugins/importAnalysisBuild.ts`,import.meta.url)).href}r=o(t.map(t=>{if(t=q_(t,n),t=s(t),t in J_)return;J_[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:K_,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Y_=[{id:`abap`,name:`ABAP`,import:(()=>Z(()=>import(`./abap-CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,import:(()=>Z(()=>import(`./actionscript-3--17pq3dv.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>Z(()=>import(`./ada-C5qYipkI.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>Z(()=>import(`./angular-html-Dy5TOb5M.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>Z(()=>import(`./angular-ts-CQ-VvwG4.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>Z(()=>import(`./apache-U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>Z(()=>import(`./apex-VAyPSnFM.js`),[]))},{id:`apl`,name:`APL`,import:(()=>Z(()=>import(`./apl-DLPyOpzA.js`),__vite__mapDeps([6,2,3,1,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>Z(()=>import(`./applescript-CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>Z(()=>import(`./ara-4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>Z(()=>import(`./asciidoc-DE70LPWp.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>Z(()=>import(`./asm-Cmm7eHzH.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>Z(()=>import(`./astro-Bg8eE3kY.js`),__vite__mapDeps([10,2,3,9,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>Z(()=>import(`./awk-BWXHIvNe.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>Z(()=>import(`./ballerina-B7ZEbQpA.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`],import:(()=>Z(()=>import(`./bat-Bo4NYOV-.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>Z(()=>import(`./beancount-D-usSTwE.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>Z(()=>import(`./berry-DKpUyyne.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>Z(()=>import(`./bibtex-Ci_nEsc7.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>Z(()=>import(`./bicep-CUHmPFLl.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>Z(()=>import(`./bird2-C6vDhewU.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>Z(()=>import(`./blade-kDLtazTS.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>Z(()=>import(`./bsl-BkkzgIyY.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>Z(()=>import(`./c-LLHuKvL1.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>Z(()=>import(`./c3-BFHwR3_K.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>Z(()=>import(`./cadence-CQ2zXKGN.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>Z(()=>import(`./cairo-DLTphjLi.js`),__vite__mapDeps([19,20])))},{id:`clarity`,name:`Clarity`,import:(()=>Z(()=>import(`./clarity-SemFz856.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>Z(()=>import(`./clojure-DqKBuwfJ.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>Z(()=>import(`./cmake-Bj61d0ZC.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>Z(()=>import(`./cobol-KB1NrS7u.js`),__vite__mapDeps([21,1,2,3,8])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>Z(()=>import(`./codeowners-C8r90Shi.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>Z(()=>import(`./codeql-oeQT6MSM.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>Z(()=>import(`./coffee-BIVXoYBq.js`),__vite__mapDeps([22,2])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>Z(()=>import(`./common-lisp-Cv5bFMCO.js`),[]))},{id:`coq`,name:`Coq`,import:(()=>Z(()=>import(`./coq-BrsZFFmf.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>Z(()=>import(`./cpp-t-AOohLk.js`).then(e=>e.n),__vite__mapDeps([23,16,24,25,26])))},{id:`crystal`,name:`Crystal`,import:(()=>Z(()=>import(`./crystal-Siw7Sgsi.js`),__vite__mapDeps([27,2,3,1,16,26,28])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>Z(()=>import(`./csharp-oqKa8noW.js`),[]))},{id:`css`,name:`CSS`,import:(()=>Z(()=>import(`./css-C4JxYney.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>Z(()=>import(`./csv-Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>Z(()=>import(`./cue-CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>Z(()=>import(`./cypher-ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>Z(()=>import(`./d-qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>Z(()=>import(`./dart-CnvKMtbv.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>Z(()=>import(`./dax-BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>Z(()=>import(`./desktop-Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>Z(()=>import(`./diff-woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>Z(()=>import(`./docker-IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>Z(()=>import(`./dotenv-_5a1GRtc.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>Z(()=>import(`./dream-maker-DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>Z(()=>import(`./edge-DWGhPgzT.js`),__vite__mapDeps([29,1,2,3,11,15])))},{id:`elixir`,name:`Elixir`,import:(()=>Z(()=>import(`./elixir-CRNPk2CS.js`),__vite__mapDeps([30,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>Z(()=>import(`./elm-wtHW2ZzC.js`),__vite__mapDeps([31,25,26])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>Z(()=>import(`./emacs-lisp-B4R74twV.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>Z(()=>import(`./erb-zY-7xODc.js`),__vite__mapDeps([32,1,2,3,33,7,8,16,26,23,24,25,28,34,35,11,13,36,37,38])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>Z(()=>import(`./erlang-Cphh6RMH.js`),__vite__mapDeps([39,40])))},{id:`fennel`,name:`Fennel`,import:(()=>Z(()=>import(`./fennel-DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>Z(()=>import(`./fish-BJitypiv.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>Z(()=>import(`./fluent-C03EYrpw.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>Z(()=>import(`./fortran-fixed-form-DEKoE2YW.js`),__vite__mapDeps([41,42])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>Z(()=>import(`./fortran-free-form-CYNrtFtB.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>Z(()=>import(`./fsharp-D13ZGOAj.js`),__vite__mapDeps([43,40])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>Z(()=>import(`./gdresource-C0sCabJj.js`),__vite__mapDeps([44,45,46])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>Z(()=>import(`./gdscript-Cp2uCuqX.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>Z(()=>import(`./gdshader-CBce3t8t.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>Z(()=>import(`./genie-CV2tkWYe.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>Z(()=>import(`./gherkin-DExj1W_8.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>Z(()=>import(`./git-commit-BSykSTBG.js`),__vite__mapDeps([47,48])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>Z(()=>import(`./git-rebase-DryBRQqt.js`),__vite__mapDeps([49,28])))},{id:`gleam`,name:`Gleam`,import:(()=>Z(()=>import(`./gleam-CSRkHgEL.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>Z(()=>import(`./glimmer-js-C1lI2oOe.js`),__vite__mapDeps([50,2,3,1,11])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>Z(()=>import(`./glimmer-ts-w8P2a6UH.js`),__vite__mapDeps([51,2,3,1,11])))},{id:`glsl`,name:`GLSL`,import:(()=>Z(()=>import(`./glsl-BOGqvuHx.js`).then(e=>e.n),__vite__mapDeps([25,26])))},{id:`gn`,name:`GN`,import:(()=>Z(()=>import(`./gn-ilITqXS6.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>Z(()=>import(`./gnuplot-7GGW24-e.js`),[]))},{id:`go`,name:`Go`,import:(()=>Z(()=>import(`./go-rLFTqkRN.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>Z(()=>import(`./graphql-CMxvykwD.js`).then(e=>e.n),__vite__mapDeps([35,2,11,13,36])))},{id:`groovy`,name:`Groovy`,import:(()=>Z(()=>import(`./groovy-CacY0gHj.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>Z(()=>import(`./hack-BTJt-rSc.js`),__vite__mapDeps([52,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>Z(()=>import(`./haml-CpShFG-s.js`).then(e=>e.n),__vite__mapDeps([34,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>Z(()=>import(`./handlebars-BsUSmFng.js`),__vite__mapDeps([53,2,3,1,38])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>Z(()=>import(`./haskell-D8IpX4py.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>Z(()=>import(`./haxe-OTjmBuCE.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>Z(()=>import(`./hcl-Dh228itO.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>Z(()=>import(`./hjson-CxZEssPk.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>Z(()=>import(`./hlsl-Cvrh5tZx.js`),[]))},{id:`html`,name:`HTML`,import:(()=>Z(()=>import(`./html-efT10kNy.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>Z(()=>import(`./html-derivative-DslI7lKP.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>Z(()=>import(`./http-DGneOSH7.js`),__vite__mapDeps([54,7,8,9,28,35,2,11,13,36])))},{id:`hurl`,name:`Hurl`,import:(()=>Z(()=>import(`./hurl-D7wxeizR.js`),__vite__mapDeps([55,7,8,56,35,2,11,13,36])))},{id:`hxml`,name:`HXML`,import:(()=>Z(()=>import(`./hxml-B0Qn7Nwc.js`),__vite__mapDeps([57,58])))},{id:`hy`,name:`Hy`,import:(()=>Z(()=>import(`./hy-CZbG8q4J.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>Z(()=>import(`./imba-DsUTQ-LC.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>Z(()=>import(`./ini-B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>Z(()=>import(`./java-DRV6EAgN.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>Z(()=>import(`./javascript-VqTwarqZ.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>Z(()=>import(`./jinja-B0K-1eZW.js`),__vite__mapDeps([59,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>Z(()=>import(`./jison-C6X_CrUT.js`),__vite__mapDeps([60,2])))},{id:`json`,name:`JSON`,import:(()=>Z(()=>import(`./json-BMTvgpRj.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>Z(()=>import(`./json5-BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>Z(()=>import(`./jsonc-CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>Z(()=>import(`./jsonl-CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>Z(()=>import(`./jsonnet-CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>Z(()=>import(`./jssm-DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>Z(()=>import(`./jsx-BdBaYpud.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>Z(()=>import(`./julia-eSoxcKep.js`),__vite__mapDeps([61,2,16,20,23,24,25,26,62])))},{id:`just`,name:`Just`,import:(()=>Z(()=>import(`./just-BMl4E389.js`),__vite__mapDeps([63,2,11,20,28,33,3,1,7,8,16,26,23,24,25,34,35,13,36,37,38,64])))},{id:`kdl`,name:`KDL`,import:(()=>Z(()=>import(`./kdl-CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>Z(()=>import(`./kotlin-DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>Z(()=>import(`./kusto-C7mF5XQf.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>Z(()=>import(`./latex-vrLDptzo.js`),__vite__mapDeps([65,66,62])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>Z(()=>import(`./lean-CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>Z(()=>import(`./less-DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>Z(()=>import(`./liquid-DhiVbfmF.js`),__vite__mapDeps([67,2,3,1,9])))},{id:`llvm`,name:`LLVM IR`,import:(()=>Z(()=>import(`./llvm-Cm23YOpf.js`),[]))},{id:`log`,name:`Log file`,import:(()=>Z(()=>import(`./log-BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>Z(()=>import(`./logo-Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>Z(()=>import(`./lua-BZarQnS9.js`).then(e=>e.n),__vite__mapDeps([37,26])))},{id:`luau`,name:`Luau`,import:(()=>Z(()=>import(`./luau-FMPmPwt6.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>Z(()=>import(`./make-Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>Z(()=>import(`./markdown-BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>Z(()=>import(`./marko-BWPwdtQS.js`),__vite__mapDeps([68,3,5,11,69])))},{id:`matlab`,name:`MATLAB`,import:(()=>Z(()=>import(`./matlab-D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>Z(()=>import(`./mdc-Cx_ikHJA.js`),__vite__mapDeps([70,15,1,2,3,38,40])))},{id:`mdx`,name:`MDX`,import:(()=>Z(()=>import(`./mdx-DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>Z(()=>import(`./mermaid-Bk4SNUv9.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>Z(()=>import(`./mipsasm-BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>Z(()=>import(`./mojo-BgCJLMeH.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>Z(()=>import(`./moonbit-CaWjb8XO.js`),[]))},{id:`move`,name:`Move`,import:(()=>Z(()=>import(`./move-B1IS1UjX.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>Z(()=>import(`./narrat-_X_XdTYD.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>Z(()=>import(`./nextflow-BJtWHP5T.js`),__vite__mapDeps([71,72])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>Z(()=>import(`./nextflow-groovy-DJMQeKeT.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>Z(()=>import(`./nginx-iNlDtGB5.js`),__vite__mapDeps([73,37,26])))},{id:`nim`,name:`Nim`,import:(()=>Z(()=>import(`./nim-DGF5L7xM.js`),__vite__mapDeps([74,2,3,1,7,8,26,25,40])))},{id:`nix`,name:`Nix`,import:(()=>Z(()=>import(`./nix-IvuFDN5E.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>Z(()=>import(`./nushell-DcLAeLz5.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>Z(()=>import(`./objective-c-D1A_Heim.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>Z(()=>import(`./objective-cpp-BsSzOQcm.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>Z(()=>import(`./ocaml-O90oeIOV.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>Z(()=>import(`./odin-B1RWQWA5.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>Z(()=>import(`./openscad-BUDT5pXO.js`),[]))},{id:`pascal`,name:`Pascal`,import:(()=>Z(()=>import(`./pascal-4ZHwLPI5.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>Z(()=>import(`./perl-CFfHYoph.js`),__vite__mapDeps([64,2,3,1,7,8,16])))},{id:`php`,name:`PHP`,import:(()=>Z(()=>import(`./php-CtPBh1K5.js`),__vite__mapDeps([75,2,3,1,7,8,9,16])))},{id:`pkl`,name:`Pkl`,import:(()=>Z(()=>import(`./pkl-ot-7Btpt.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>Z(()=>import(`./plsql-DGHpHOYJ.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>Z(()=>import(`./po-BiJDBrnU.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>Z(()=>import(`./polar-C7UOKdEL.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>Z(()=>import(`./postcss-BXeXVLqQ.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>Z(()=>import(`./powerquery-DNMTfnFr.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`],import:(()=>Z(()=>import(`./powershell-DshXNtvi.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>Z(()=>import(`./prisma-BsRQq5mF.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>Z(()=>import(`./prolog-iXnhIJG7.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>Z(()=>import(`./proto-DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>Z(()=>import(`./pug-CxRWcKXx.js`),__vite__mapDeps([76,2,3,1])))},{id:`puppet`,name:`Puppet`,import:(()=>Z(()=>import(`./puppet-CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>Z(()=>import(`./purescript-9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>Z(()=>import(`./python-gzcpVVnB.js`),[]))},{id:`qml`,name:`QML`,import:(()=>Z(()=>import(`./qml-CQ8J3wuq.js`),__vite__mapDeps([77,2])))},{id:`qmldir`,name:`QML Directory`,import:(()=>Z(()=>import(`./qmldir-DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>Z(()=>import(`./qss-Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>Z(()=>import(`./r-CItjESd8.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>Z(()=>import(`./racket-DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>Z(()=>import(`./raku-B3gFvitq.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>Z(()=>import(`./razor-BPkkINsq.js`),__vite__mapDeps([78,1,2,3,79])))},{id:`reg`,name:`Windows Registry Script`,import:(()=>Z(()=>import(`./reg-CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>Z(()=>import(`./regexp-DX3MNthO.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>Z(()=>import(`./rel-BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>Z(()=>import(`./riscv-Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>Z(()=>import(`./ron-VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>Z(()=>import(`./rosmsg-CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>Z(()=>import(`./rst-ClRAjKbC.js`),__vite__mapDeps([80,2,15,1,3,20,81,23,16,24,25,26,28,38,33,7,8,34,35,11,13,36,37])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>Z(()=>import(`./ruby-CgYgA9Jj.js`),__vite__mapDeps([33,2,3,1,7,8,16,26,23,24,25,28,34,35,11,13,36,37,38])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>Z(()=>import(`./rust-Cfkwpbl8.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>Z(()=>import(`./sas-CPmYLbzU.js`),__vite__mapDeps([82,16])))},{id:`sass`,name:`Sass`,import:(()=>Z(()=>import(`./sass-DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>Z(()=>import(`./scala-DKOlJaKm.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>Z(()=>import(`./scheme-DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>Z(()=>import(`./scss-Cm-sHo09.js`).then(e=>e.n),__vite__mapDeps([5,3])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>Z(()=>import(`./sdbl-bTVj8UrX.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>Z(()=>import(`./shaderlab-TOUzSsQk.js`),__vite__mapDeps([83,84])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>Z(()=>import(`./shellscript-DmaaF0b7.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>Z(()=>import(`./shellsession-CQx7VqyU.js`),__vite__mapDeps([85,28])))},{id:`smalltalk`,name:`Smalltalk`,import:(()=>Z(()=>import(`./smalltalk-B16xEiuN.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>Z(()=>import(`./solidity-CKzVLygQ.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>Z(()=>import(`./soy-B_yUNzV2.js`),__vite__mapDeps([86,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>Z(()=>import(`./sparql-D_iOobhT.js`),__vite__mapDeps([87,88])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>Z(()=>import(`./splunk-BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>Z(()=>import(`./sql-BJHohXqk.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>Z(()=>import(`./ssh-config-BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>Z(()=>import(`./stata-UAFrzABU.js`),__vite__mapDeps([89,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>Z(()=>import(`./stylus-B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>Z(()=>import(`./surrealql-CWvgOHzZ.js`),__vite__mapDeps([90,2])))},{id:`svelte`,name:`Svelte`,import:(()=>Z(()=>import(`./svelte-BddkVZXj.js`),__vite__mapDeps([91,2,3,11,12])))},{id:`swift`,name:`Swift`,import:(()=>Z(()=>import(`./swift-DonLKvLd.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>Z(()=>import(`./system-verilog-DJ5XKQeo.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>Z(()=>import(`./systemd-BxMlprV5.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>Z(()=>import(`./talonscript-CohzipZa.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>Z(()=>import(`./tasl-DMoTqEGO.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>Z(()=>import(`./tcl-CZd0xW_V.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>Z(()=>import(`./templ-C84Bu3va.js`),__vite__mapDeps([92,2,3,93])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>Z(()=>import(`./terraform-DswuEJGm.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>Z(()=>import(`./tex-RrP2i1xH.js`),__vite__mapDeps([66,62])))},{id:`toml`,name:`TOML`,import:(()=>Z(()=>import(`./toml-CcmNWLt0.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>Z(()=>import(`./ts-tags-BRr3h9RL.js`),__vite__mapDeps([94,2,3,1,7,8,11,16,25,26])))},{id:`tsv`,name:`TSV`,import:(()=>Z(()=>import(`./tsv-sltzmVWM.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>Z(()=>import(`./tsx-CzdrIvPO.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>Z(()=>import(`./turtle-ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>Z(()=>import(`./twig-CibPnSwR.js`),__vite__mapDeps([95,2,3,5,20,33,1,7,8,16,26,23,24,25,28,34,35,11,13,36,37,38,75,9])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>Z(()=>import(`./typescript-CWzslnac.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>Z(()=>import(`./typespec-BRdr0IET.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>Z(()=>import(`./typst-DI99ib-x.js`),[]))},{id:`v`,name:`V`,import:(()=>Z(()=>import(`./v-DETTlOr0.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>Z(()=>import(`./vala-zf12oZj6.js`),[]))},{id:`vb`,name:`Visual Basic`,aliases:[`cmd`],import:(()=>Z(()=>import(`./vb-Djn5o6TS.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>Z(()=>import(`./verilog-CiiDBU1e.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>Z(()=>import(`./vhdl-BroJfC0k.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>Z(()=>import(`./viml-DvXPmvsu.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>Z(()=>import(`./vue-C-b1or0S.js`),__vite__mapDeps([96,2,3,1,9,11,15])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>Z(()=>import(`./vue-html-B7qsQ7no.js`),__vite__mapDeps([97,2])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>Z(()=>import(`./vue-vine-dqyrjuMF.js`),__vite__mapDeps([98,2,3,5,12,69,99])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>Z(()=>import(`./vyper-CgoNMtux.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>Z(()=>import(`./wasm-ByWQv1Qj.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>Z(()=>import(`./wenyan-C8pVoKbM.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>Z(()=>import(`./wgsl-BsKzXJz4.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>Z(()=>import(`./wikitext-ClFFjSW2.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>Z(()=>import(`./wit-DdvCle-K.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>Z(()=>import(`./wolfram-DLL8P-h_.js`),[]))},{id:`xml`,name:`XML`,import:(()=>Z(()=>import(`./xml-CG7JAl4q.js`).then(e=>e.n),__vite__mapDeps([7,8])))},{id:`xsl`,name:`XSL`,import:(()=>Z(()=>import(`./xsl-DE3Ct1nt.js`),__vite__mapDeps([100,7,8])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>Z(()=>import(`./yaml-76tnpMFk.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>Z(()=>import(`./zenscript-BnlCZFoB.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>Z(()=>import(`./zig-CMLA9XwU.js`),[]))}],X_=Object.fromEntries(Y_.map(e=>[e.id,e.import])),Z_=Object.fromEntries(Y_.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Q_={...X_,...Z_},$_=Object.defineProperty,ev=Object.getOwnPropertyDescriptor,tv=Object.getOwnPropertyNames,nv=Object.prototype.hasOwnProperty,rv=(e,t)=>{let n={};for(var r in e)$_(n,r,{get:e[r],enumerable:!0});return t||$_(n,Symbol.toStringTag,{value:`Module`}),n},iv=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=tv(t),a=0,o=i.length,s;a<o;a++)s=i[a],!nv.call(e,s)&&s!==n&&$_(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=ev(t,s))||r.enumerable});return e},av=(e,t,n)=>(iv(e,t,`default`),n&&iv(n,t,`default`)),ov=t({createOnigurumaEngine:()=>Pv,getDefaultWasmLoader:()=>Nv,loadWasm:()=>Dv,setDefaultWasmLoader:()=>Mv}),sv=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function cv(){return 2147483648}function lv(){return typeof performance<`u`?performance.now():Date.now()}var uv=(e,t)=>e+(t-e%t)%t;async function dv(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=cv();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,uv(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:lv,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var fv=Object.defineProperty,pv=(e,t,n)=>t in e?fv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mv=(e,t,n)=>pv(e,typeof t==`symbol`?t:t+``,n),hv=null;function gv(e){throw new sv(e.UTF8ToString(e.getLastOnigError()))}var _v=class e{constructor(t){mv(this,`utf16Length`),mv(this,`utf8Length`),mv(this,`utf16Value`),mv(this,`utf8Value`),mv(this,`utf16OffsetToUtf8`),mv(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}a<=127?t+=1:a<=2047?t+=2:a<=65535?t+=3:t+=4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},vv=class e{constructor(t){if(mv(this,`id`,++e.LAST_ID),mv(this,`_onigBinding`),mv(this,`content`),mv(this,`utf16Length`),mv(this,`utf8Length`),mv(this,`utf16OffsetToUtf8`),mv(this,`utf8OffsetToUtf16`),mv(this,`ptr`),!hv)throw new sv(`Must invoke loadWasm first.`);this._onigBinding=hv,this.content=t;let n=new _v(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=hv.omalloc(1e4),e._sharedPtrInUse=!0,hv.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(hv)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};mv(vv,`LAST_ID`,0),mv(vv,`_sharedPtr`,0),mv(vv,`_sharedPtrInUse`,!1);var yv=vv,bv=class{constructor(e){if(mv(this,`_onigBinding`),mv(this,`_ptr`),!hv)throw new sv(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new _v(e[r]);t[r]=i.createString(hv),n[r]=i.utf8Length}let r=hv.omalloc(4*e.length);hv.HEAPU32.set(t,r/4);let i=hv.omalloc(4*e.length);hv.HEAPU32.set(n,i/4);let a=hv.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)hv.ofree(t[n]);hv.ofree(i),hv.ofree(r),a===0&&gv(hv),this._onigBinding=hv,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new yv(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function xv(e){return typeof e.instantiator==`function`}function Sv(e){return typeof e.default==`function`}function Cv(e){return e.data!==void 0}function wv(e){return typeof Response<`u`&&e instanceof Response}function Tv(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}var Ev;function Dv(e){if(Ev)return Ev;async function t(){hv=await dv(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),xv(n)?n=await n.instantiator(t):Sv(n)?n=await n.default(t):(Cv(n)&&(n=n.data),wv(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await kv(n)(t):await Av(n)(t):Tv(n)||n instanceof WebAssembly.Module?n=await Ov(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await Ov(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return Ev=t(),Ev}function Ov(e){return t=>WebAssembly.instantiate(e,t)}function kv(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Av(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var jv;function Mv(e){jv=e}function Nv(){return jv}async function Pv(e){return e&&await Dv(e),{createScanner(e){return new bv(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new yv(e)}}}var Fv=rv({});av(Fv,ov);var Iv=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>Z(()=>import(`./andromeeda-vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>Z(()=>import(`./aurora-x-CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>Z(()=>import(`./ayu-dark-DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>Z(()=>import(`./ayu-light-C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>Z(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>Z(()=>import(`./catppuccin-frappe-3VR1Za6u.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>Z(()=>import(`./catppuccin-latte-DwIHMF0Q.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>Z(()=>import(`./catppuccin-macchiato-DYnBP6_5.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>Z(()=>import(`./catppuccin-mocha-DYhrFGRu.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>Z(()=>import(`./dark-plus-Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>Z(()=>import(`./dracula-BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>Z(()=>import(`./dracula-soft-5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>Z(()=>import(`./everforest-dark-sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>Z(()=>import(`./everforest-light-Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>Z(()=>import(`./github-dark-C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>Z(()=>import(`./github-dark-default-DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>Z(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>Z(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>Z(()=>import(`./github-light-EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>Z(()=>import(`./github-light-default-BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>Z(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>Z(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>Z(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>Z(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>Z(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>Z(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>Z(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>Z(()=>import(`./horizon-CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>Z(()=>import(`./horizon-bright-DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>Z(()=>import(`./houston-CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>Z(()=>import(`./kanagawa-dragon-CXtmUGW6.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>Z(()=>import(`./kanagawa-lotus-BN08jTvb.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>Z(()=>import(`./kanagawa-wave-CTweb8Dz.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>Z(()=>import(`./laserwave-C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>Z(()=>import(`./light-plus-DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>Z(()=>import(`./material-theme-Bm3Qr25_.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>Z(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>Z(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>Z(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>Z(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>Z(()=>import(`./min-dark-BSWPekZh.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>Z(()=>import(`./min-light-DDpmG2fV.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>Z(()=>import(`./monokai-CdkpiU2Y.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>Z(()=>import(`./night-owl-DhmEMT88.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>Z(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>Z(()=>import(`./nord-Cb4Vim4T.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>Z(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>Z(()=>import(`./one-light-D7Lr4KcI.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>Z(()=>import(`./plastic-DQwYfKfQ.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>Z(()=>import(`./poimandres-DRFjx7u4.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>Z(()=>import(`./red-CJ3rzSJv.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>Z(()=>import(`./rose-pine-BthvhNj6.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>Z(()=>import(`./rose-pine-dawn-Dg85fqjY.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>Z(()=>import(`./rose-pine-moon-hon4tzzS.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>Z(()=>import(`./slack-dark-DnToyrRv.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>Z(()=>import(`./slack-ochin-B2OO5cIa.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>Z(()=>import(`./snazzy-light-4G7pJPwS.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>Z(()=>import(`./solarized-dark-DV17i1UV.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>Z(()=>import(`./solarized-light-DSh2HLQt.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>Z(()=>import(`./synthwave-84-nFMaYfgc.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>Z(()=>import(`./tokyo-night-oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>Z(()=>import(`./vesper-DdrHHSXu.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>Z(()=>import(`./vitesse-black-fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>Z(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>Z(()=>import(`./vitesse-light-VbXTXTou.js`),[]))}].map(e=>[e.id,e.import])),Q=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Lv(e){return Rv(e)}function Rv(e){return Array.isArray(e)?zv(e):e instanceof RegExp?e:typeof e==`object`?Bv(e):e}function zv(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Rv(e[n]);return t}function Bv(e){let t={};for(let n in e)t[n]=Rv(e[n]);return t}function Vv(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Hv(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?Hv(e.substring(0,e.length-1)):e.substr(~t+1)}var Uv=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Wv=class{static hasCaptures(e){return e===null?!1:(Uv.lastIndex=0,Uv.test(e))}static replaceCaptures(e,t,n){return e.replace(Uv,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function Gv(e,t){return e<t?-1:+(e>t)}function Kv(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 r=0;r<n;r++){let n=Gv(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function qv(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 Jv(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Yv=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},Xv=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(ty(e),t)}static createFromParsedTheme(e,t){return iy(e,t)}_cachedMatchRoot=new Yv(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>Qv(e.parent,t.parentScopes));return n?new ey(n.fontStyle,n.foreground,n.background):null}},Zv=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Qv(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!$v(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function $v(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var ey=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function ty(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8;break}}let s=null;typeof i.settings.foreground==`string`&&qv(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&qv(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new ny(l,u,e,o,s,c)}}return n}var ny=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},ry=(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))(ry||{});function iy(e,t){e.sort((e,t)=>{let n=Gv(e.scope,t.scope);return n!==0||(n=Kv(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new ay(t),o=new ey(n,a.getId(r),a.getId(i)),s=new cy(new sy(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new Xv(a,o,s)}var ay=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 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)}},oy=Object.freeze([]),sy=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||oy,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},cy=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),sy.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(Kv(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new sy(e,t,n,r,i))}},ly=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!=0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=dy(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function uy(e){return e}function dy(e){return e}function fy(e,t){let n=[],r=my(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(py(i)){let e=[];do e.push(i),i=r.next();while(py(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function py(e){return!!e&&!!e.match(/[\w\.:]+/)}function my(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function hy(e){typeof e.dispose==`function`&&e.dispose()}var gy=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},_y=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},vy=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},yy=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new gy(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new vy;for(let n of e)by(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof gy){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function by(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof gy?Sy({baseGrammar:a,selfGrammar:i},r):xy(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new gy(e))}function xy(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];Cy([r],t,n)}}function Sy(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Cy(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Cy(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Cy(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?Vv({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Cy(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=ky(i);switch(a.kind){case 0:Sy({...t,selfGrammar:t.baseGrammar},n);break;case 1:Sy(t,n);break;case 2:xy(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?xy(a.ruleName,i,n):Sy(i,n)}else a.kind===4?n.add(new _y(a.scopeName,a.ruleName)):n.add(new gy(a.scopeName));break}}}var wy=class{kind=0},Ty=class{kind=1},Ey=class{constructor(e){this.ruleName=e}kind=2},Dy=class{constructor(e){this.scopeName=e}kind=3},Oy=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function ky(e){if(e===`$base`)return new wy;if(e===`$self`)return new Ty;let t=e.indexOf(`#`);return t===-1?new Dy(e):t===0?new Ey(e.substring(1)):new Oy(e.substring(0,t),e.substring(t+1))}var Ay=/\\(\d+)/,jy=/\\(\d+)/g,My=-1,Ny=-2;function Py(e){return e}function Fy(e){return e}var Iy=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Wv.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Wv.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Hv(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:Wv.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Wv.replaceCaptures(this._contentName,e,t)}},Ly=class extends Iy{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},Ry=class extends Iy{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Uy(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),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 Wy,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},zy=class extends Iy{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let 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 Wy,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},By=class extends Iy{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new Uy(i,this.id),this.beginCaptures=a,this._end=new Uy(o||`￿`,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),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 Wy;for(let t of this.patterns)e.getRule(t).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}},Vy=class extends Iy{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new Uy(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Uy(o,Ny),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),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 Wy;for(let 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 Wy,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},Hy=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Ly(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Ry(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=Vv({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new zy(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Vy(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new By(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=ky(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l)if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository);break}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof zy||e instanceof By||e instanceof Vy)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Uy=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source==`string`?this.hasBackReferences=Ay.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return jy.lastIndex=0,this.source.replace(jy,(e,t)=>Jv(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=`￿`,t[i+1]=`￿`,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=`￿`,t[i+1]=`G`,n[i+1]=`￿`,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Wy=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(),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(e=>e.source);this._cached=new Gy(e,t,this._items.map(e=>e.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){return new Gy(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Gy=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(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
2682
- `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Ky=class{constructor(e,t){this.languageId=e,this.tokenType=t}},qy=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Ky(e,8),this._embeddedLanguagesMatcher=new Jy(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Ky(0,0);_getBasicScopeAttributes=new Yv(e=>new Ky(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.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 Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Jy=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>Jv(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var Yy=!1,Xy=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Zy(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Qy(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new Xy(i,!0);f()}return new Xy(i,!1);function f(){let o=$y(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===My){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),ab(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof By){let r=o;ab(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof Vy){let r=o;ab(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(ab(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function Qy(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof Vy&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=rb(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==Ny){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),ab(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function $y(e,t,n,r,i,a){let o=eb(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=tb(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function eb(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=nb(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function tb(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=nb(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function nb(e,t,n,r,i){return Yy?{ruleScanner:e.compile(t,n),findOptions:ib(r,i)}:{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function rb(e,t,n,r,i){return Yy?{ruleScanner:e.compileWhile(t,n),findOptions:ib(r,i)}:{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function ib(e,t){let n=0;return e||(n|=1),t||(n|=4),n}function ab(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));Zy(e,p,n&&d.start===0,d.start,f,i,!1,0),hy(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new ob(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var ob=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function sb(e,t,n,r,i,a,o,s){return new db(e,t,n,r,i,a,o,s)}function cb(e,t,n,r,i){let a=fy(t,lb),o=Hy.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function lb(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(ub(t[r],e))return n=r+1,!0;return!1})}function ub(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var db=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new qy(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=fb(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=fy(e,lb);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let 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(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)cb(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&cb(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(Py(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[Fy(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=fb(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let 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){let 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=Hy.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===mb.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=ly.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?pb.createRootAndLookUpScopeName(a,r,this):pb.createRoot(`unknown`,r),t=new mb(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
2683
- `;let a=this.createOnigString(e),o=a.content.length,s=new gb(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Zy(this,a,i,0,t,s,!0,r);return hy(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function fb(e,t){return e=Lv(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 pb=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=Zv.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new Zv(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new Zv(null,t),o=r.themeProvider.themeMatch(a);return new e(null,a,e.mergeAttributes(n,i,o))}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),ly.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a);return new e(t,a,e.mergeAttributes(t.tokenAttributes,i,o))}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},mb=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?pb.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:Fy(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){let r=pb.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Py(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,pb.fromExtension(r,n.contentNameScopesList))}},hb=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):fy(e,lb).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>fy(e,lb).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},gb=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 n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=ly.set(n,0,uy(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=ly.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let 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);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},_b=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let 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,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,sb(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},vb=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new _b(Xv.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(Xv.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new hb(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new yy(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},yb=mb.NULL;function bb(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function xb(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Sb(e){return Array.isArray(e)?e:[e]}async function Cb(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function wb(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function Tb(e){return e===`ansi`||wb(e)}function Eb(e){return e===`none`}function Db(e){return Eb(e)}var Ob=/(\r?\n)/g;function kb(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(Ob),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var Ab={light:`#333333`,dark:`#bbbbbb`},jb={light:`#fffffe`,dark:`#1e1e1e`},Mb=`__shiki_resolved`;function Nb(e){if(e?.[Mb])return e;let 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){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?Ab.light:Ab.dark,n||=t.type===`light`?jb.light:jb.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 i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,Mb,{enumerable:!1,writable:!1,value:!0}),t}async function Pb(e){return[...new Set((await Promise.all(e.filter(e=>!Tb(e)).map(async e=>await Cb(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function Fb(e){return(await Promise.all(e.map(async e=>Db(e)?null:Nb(await Cb(e))))).filter(e=>!!e)}function Ib(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new Q(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var Lb=class extends vb{_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(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=Nb(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Xv.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Ib(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new Q(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return 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);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},Rb=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}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){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},zb=0;function Bb(e){zb+=1,e.warnings!==!1&&zb>=10&&zb%10==0&&console.warn(`[Shiki] ${zb} 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 Q("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(Nb),i=new Lb(new Rb(e.engine,n),r,n,e.langAlias),a;function o(t){return Ib(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new Q(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new Q(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await Pb(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await Fb(e))}function g(){if(t)throw new Q(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--zb)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function Vb(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([Fb(e.themes||[]),Pb(e.langs||[]),e.engine]);return Bb({...e,themes:t,langs:n,engine:r})}var Hb=new WeakMap;function Ub(e,t){Hb.set(e,t)}function Wb(e){return Hb.get(e)}var Gb=class e{_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 e(Object.fromEntries(Sb(n).map(e=>[e,yb])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Kb(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Kb(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function qb(e,t){if(!(e instanceof Gb))throw new Q(`Invalid grammar state`);return e.getInternalStack(t)}var Jb=/,/,Yb=/ /;function Xb(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(wb(e.resolveLangAlias(n.lang||`text`))||Eb(r))return kb(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new Q(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new Q(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return Qb(t,o,i,a,n)}function Zb(...e){if(e.length===2)return Wb(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(wb(i)||Eb(a))throw new Q(`Plain language does not have grammar state`);if(i===`ansi`)throw new Q(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new Gb($b(n,c,o,s,r).stateStack,c.name,o.name)}function Qb(e,t,n,r,i){let a=$b(e,t,n,r,i),o=new Gb(a.stateStack,t.name,n.name);return Ub(a.tokens,o),a.tokens}function $b(e,t,n,r,i){let a=bb(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500}=i,c=kb(e),l=i.grammarState?qb(i.grammarState,n.name)??yb:i.grammarContextCode==null?yb:$b(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,u=[],d=[];for(let e=0,f=c.length;e<f;e++){let[f,p]=c[e];if(f===``){u=[],d.push([]);continue}if(o>0&&f.length>=o){u=[],d.push([{content:f,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;i.includeExplanation&&(m=t.tokenizeLine(f,l,s),h=m.tokens,g=0);let _=t.tokenizeLine2(f,l,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:f.length;if(t===o)continue;let s=_.tokens[2*e+1],c=xb(r[ly.getForeground(s)],a),l=ly.getFontStyle(s),d={content:f.substring(t,o),offset:p+t,color:c,fontStyle:l};if(i.includeExplanation){let e=[];if(i.includeExplanation!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(Jb).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(Yb))})}d.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=f.substring(t.startIndex,t.endIndex);r+=n.length,d.explanation.push({content:n,scopes:i.includeExplanation===`scopeName`?ex(t.scopes):tx(e,t.scopes)}),g+=1}}u.push(d)}d.push(u),u=[],l=_.ruleStack}return{tokens:d,stateStack:l}}function ex(e){return e.map(e=>({scopeName:e}))}function tx(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:ix(e,i,t.slice(0,r))}}return n}function nx(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function rx(e,t,n){if(!nx(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)nx(e[r],n[i])&&--r,--i;return r===-1}function ix(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(rx(e,t,n)){r.push(a);break}return r}function ax(e,t,n,r=Xb){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:Wb(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=ox(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new Gb(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&Ub(s,c),s}function ox(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var sx=/\s+/g;function cx(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(sx)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(sx);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}var lx=/:?lang=["']([^"']+)["']/g,ux=/(?:```|~~~)([\w-]+)/g,dx=/\\begin\{([\w-]+)\}/g,fx=/<script\s+(?:type|lang)=["']([^"']+)["']/gi;function px(e){let t=kb(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function mx(e,t,n){let r=new Set;for(let t of e.matchAll(lx)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(ux)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(dx)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(fx)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(!n)return[...r];let i=n.getBundledLanguages();return[...r].filter(e=>e&&i[e])}var hx=[`color`,`background-color`];function gx(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function _x(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?gx(e,t):e})):e}function vx(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>yx(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&hx.includes(a))if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new Q('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');c[a]=`light-dark(${o[e][a]||`inherit`}, ${o[r][a]||`inherit`})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s;else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function yx(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&ry.Italic&&(t[`font-style`]=`italic`),e.fontStyle&ry.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&ry.Underline&&n.push(`underline`),e.fontStyle&ry.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function bx(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function xx(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=px(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new Q(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}else{let t=n.lines[e.line];if(t===void 0)throw new Q(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new Q(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));Sx(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return _x(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new Q(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=Cx(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new Q(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new Q(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&cx(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function Sx(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new Q(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new Q(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function Cx(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(Cx).join(``):``}var wx=[xx()];function Tx(e){let t=Ex(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...wx]}function Ex(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var Dx=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],Ox={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function kx(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function Ax(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}else if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function jx(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:`resetAll`});else if(r<=9)Ox[r]&&t.push({type:`setDecoration`,value:Ox[r]});else if(r<=29){let e=Ox[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:Dx[r-30]}});else if(r===38){let n=Ax(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:Dx[r-40]}});else if(r===48){let n=Ax(e);n&&t.push({type:`setBackgroundColor`,value:n})}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:Dx[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:Dx[r-100+8]}})}return t}function Mx(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=kx(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=jx(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var Nx={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 Px(e=Nx){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<Dx.length;e++)r.push(t(Dx[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var Fx=/#([0-9a-f]{3,8})/i,Ix=/var\((--[\w-]+-ansi-[\w-]+)\)/,Lx={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 Rx(e,t,n){let r=bb(e,n),i=kb(t),a=Px(Object.fromEntries(Dx.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Lx[t]]}))),o=Mx();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=xb(i,r),o=xb(o,r),n.decorations.has(`dim`)&&(i=zx(i));let s=ry.None;return n.decorations.has(`bold`)&&(s|=ry.Bold),n.decorations.has(`italic`)&&(s|=ry.Italic),n.decorations.has(`underline`)&&(s|=ry.Underline),n.decorations.has(`strikethrough`)&&(s|=ry.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function zx(e){let t=e.match(Fx);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}else if(e.length===6)return`#${e}80`;else if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}else if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(Ix);return n?`var(${n[1]}-dim)`:e}function Bx(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!wb(r)&&!Eb(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return Rx(r,t,n)}return Xb(e,t,n)}function Vx(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new Q("`themes` option must not be empty");let p=ax(e,t,n,Bx);if(c=Wb(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new Q(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>vx(e,h,u,l,d))),c&&Ub(a,c);let g=f.map(e=>bb(e.theme,n));i=Hx(f,m,g,u,l,`fg`,d),r=Hx(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=bb(n.theme,n);a=Bx(e,t,n);let l=e.getTheme(n.theme);r=xb(l.bg,s),i=xb(l.fg,s),o=l.name,c=Wb(a)}else throw new Q("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function Hx(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=xb(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new Q('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${xb(t[r][a],n[r])||`inherit`}, ${xb(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var Ux=/^\s+$/,Wx=/^(\s*)(.*?)(\s*)$/;function Gx(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>Gx(e,t,n),codeToTokens:(t,n)=>Vx(e,t,n)}){let i=t;for(let e of Tx(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=Vx(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=qx(a):d===`never`&&(a=Jx(a)),f&&(a=Yx(a));let p={...r,get source(){return i}};for(let e of Tx(n))a=e.tokens?.call(p,a)||a;return Kx(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function Kx(e,t,n,r=Wb(e)){let i=Tx(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(t.rootStyle==null?l.style=`background-color:${t.bg};color:${t.fg}`:l.style=t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:cx,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
2684
- `}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=bx(a.htmlStyle||yx(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&Ub(m,r),m}function qx(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&ry.Underline||i.fontStyle&ry.Strikethrough));o&&Ux.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function Jx(e){return e.map(e=>e.flatMap(e=>{if(Ux.test(e.content))return e;let t=e.content.match(Wx);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function Yx(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=bx(e.htmlStyle||yx(e)),i=bx(n.htmlStyle||yx(n)),a=e.fontStyle&&(e.fontStyle&ry.Underline||e.fontStyle&ry.Strikethrough),o=n.fontStyle&&(n.fontStyle&ry.Underline||n.fontStyle&ry.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Xx=tg;function Zx(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>Gx(e,t,n),codeToTokens:(t,n)=>Vx(e,t,n)},i=Xx(Gx(e,t,n,r));for(let e of Tx(n))i=e.postprocess?.call(r,i,n)||i;return i}async function Qx(e){let t=await Vb(e);return{getLastGrammarState:(...e)=>Zb(t,...e),codeToTokensBase:(e,n)=>Bx(t,e,n),codeToTokensWithThemes:(e,n)=>ax(t,e,n),codeToTokens:(e,n)=>Vx(t,e,n),codeToHast:(e,n)=>Gx(t,e,n),codeToHtml:(e,n)=>Zx(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function $x(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,Tb(n))return[];let r=t[n];if(!r)throw new Q(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(Db(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new Q(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await Qx({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function eS(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}else{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function tS(e,t){let n=eS(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var nS=$x({langs:Q_,themes:Iv,engine:()=>(0,Fv.createOnigurumaEngine)(Z(()=>import(`./wasm-BnjxR4X6.js`),[]))}),{codeToHtml:rS,codeToHast:iS,codeToTokens:aS,codeToTokensBase:oS,codeToTokensWithThemes:sS,getSingletonHighlighter:cS,getLastGrammarState:lS}=tS(nS,{guessEmbeddedLanguages:mx}),uS=4294967295,dS=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:uS,end:uS,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let o=n.exec(r);if(!o)continue;if(o.index===t)return a(e,o,0);i.push([e,o,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(i.length){let e=Math.min(...i.map(e=>e[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function fS(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function pS(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var mS=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),hS=String.raw;function gS(e,t){if(e==null)throw Error(t??`Value expected`);return e}var _S=hS`\[\^?`,vS=`c.? | C(?:-.?)?|${hS`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${hS`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${hS`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${hS`o\{[^\}]*\}?`}|${hS`\d{1,3}`}`,yS=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,bS=new RegExp(hS`
2679
+ `);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function O_(e,t,n,r=!1){let i=gp(E_(e.name,t.name,e.contents,t.contents,e.header,t.header,n),{cacheKey:(()=>{if(e.cacheKey!=null&&t.cacheKey!=null)return`${e.cacheKey}:${t.cacheKey}`})(),oldFile:e,newFile:t,throwOnError:r});if(i==null)throw Error(`parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?`);return t.lang!=null&&(i.lang=t.lang),i}var k_=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,!1)}setup(e,t,n){if(t==null||n==null)for(let 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}))}},A_=new Map,j_={"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`,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 M_(e){if(A_.has(e))return A_.get(e)??`text`;if(j_[e]!=null)return j_[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(A_.has(t[1]))return A_.get(t[1])??`text`;if(j_[t[1]]!=null)return j_[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return A_.has(n)?A_.get(n)??`text`:j_[n]??`text`}function N_(e){let t=e.lang??M_(e.name),n=e.lang??(e.prevName==null?`text`:M_(e.prevName));return t===`text`&&n===`text`}function P_(e){let t=e[0];return t!=null&&t.length>0?t:void 0}function F_(e){return e.startingLine===0&&e.totalLines>0}var I_=new Map,L_=new Map,R_=new Map,z_=new Set;function B_(e){for(let t of Array.isArray(e)?e:[e])if(!(t===`text`||t===`ansi`)&&!z_.has(t))return!1;return!0}function V_(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(z_.has(n.name))continue;let e=I_.get(n.name);e??(e=n,I_.set(n.name,e)),z_.add(e.name),t.loadLanguageSync(e.data)}}function H_(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var U_=`modulepreload`,W_=function(e){return`/`+e},G_={},Z=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,new URL(`../../../src/node/plugins/importAnalysisBuild.ts`,import.meta.url)).href}r=o(t.map(t=>{if(t=W_(t,n),t=s(t),t in G_)return;G_[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:U_,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},K_=[{id:`abap`,name:`ABAP`,import:(()=>Z(()=>import(`./abap-CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,import:(()=>Z(()=>import(`./actionscript-3--17pq3dv.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>Z(()=>import(`./ada-C5qYipkI.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>Z(()=>import(`./angular-html-B5muZzOL.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>Z(()=>import(`./angular-ts-BNVL9bga.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>Z(()=>import(`./apache-U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>Z(()=>import(`./apex-VAyPSnFM.js`),[]))},{id:`apl`,name:`APL`,import:(()=>Z(()=>import(`./apl-Ba-70I0G.js`),__vite__mapDeps([6,2,3,1,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>Z(()=>import(`./applescript-CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>Z(()=>import(`./ara-4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>Z(()=>import(`./asciidoc-DE70LPWp.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>Z(()=>import(`./asm-Cmm7eHzH.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>Z(()=>import(`./astro-BOUSDj4v.js`),__vite__mapDeps([10,2,3,9,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>Z(()=>import(`./awk-BWXHIvNe.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>Z(()=>import(`./ballerina-B7ZEbQpA.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`],import:(()=>Z(()=>import(`./bat-Bo4NYOV-.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>Z(()=>import(`./beancount-D-usSTwE.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>Z(()=>import(`./berry-DKpUyyne.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>Z(()=>import(`./bibtex-Ci_nEsc7.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>Z(()=>import(`./bicep-CUHmPFLl.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>Z(()=>import(`./bird2-C6vDhewU.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>Z(()=>import(`./blade-CSo5obC-.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>Z(()=>import(`./bsl-BkkzgIyY.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>Z(()=>import(`./c-DYYU8xas.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>Z(()=>import(`./c3-BFHwR3_K.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>Z(()=>import(`./cadence-CQ2zXKGN.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>Z(()=>import(`./cairo-DLTphjLi.js`),__vite__mapDeps([19,20])))},{id:`clarity`,name:`Clarity`,import:(()=>Z(()=>import(`./clarity-SemFz856.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>Z(()=>import(`./clojure-DqKBuwfJ.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>Z(()=>import(`./cmake-Bj61d0ZC.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>Z(()=>import(`./cobol-C9OKkX73.js`),__vite__mapDeps([21,1,2,3,8])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>Z(()=>import(`./codeowners-C8r90Shi.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>Z(()=>import(`./codeql-oeQT6MSM.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>Z(()=>import(`./coffee-0xKLvqsI.js`),__vite__mapDeps([22,2])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>Z(()=>import(`./common-lisp-Cv5bFMCO.js`),[]))},{id:`coq`,name:`Coq`,import:(()=>Z(()=>import(`./coq-BrsZFFmf.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>Z(()=>import(`./cpp-DYVE8zaK.js`).then(e=>e.n),__vite__mapDeps([23,16,24,25,26])))},{id:`crystal`,name:`Crystal`,import:(()=>Z(()=>import(`./crystal-Bv8VoCOd.js`),__vite__mapDeps([27,2,3,1,16,26,28])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>Z(()=>import(`./csharp-oqKa8noW.js`),[]))},{id:`css`,name:`CSS`,import:(()=>Z(()=>import(`./css-7PZLnWQA.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>Z(()=>import(`./csv-Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>Z(()=>import(`./cue-CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>Z(()=>import(`./cypher-ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>Z(()=>import(`./d-qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>Z(()=>import(`./dart-CnvKMtbv.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>Z(()=>import(`./dax-BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>Z(()=>import(`./desktop-Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>Z(()=>import(`./diff-woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>Z(()=>import(`./docker-IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>Z(()=>import(`./dotenv-_5a1GRtc.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>Z(()=>import(`./dream-maker-DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>Z(()=>import(`./edge-BdU2UXTK.js`),__vite__mapDeps([29,1,2,3,11,15])))},{id:`elixir`,name:`Elixir`,import:(()=>Z(()=>import(`./elixir-CM8mfLuD.js`),__vite__mapDeps([30,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>Z(()=>import(`./elm-BlMVHBgM.js`),__vite__mapDeps([31,25,26])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>Z(()=>import(`./emacs-lisp-B4R74twV.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>Z(()=>import(`./erb-vDm0sMMR.js`),__vite__mapDeps([32,1,2,3,33,7,8,16,26,23,24,25,28,34,35,11,13,36,37,38])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>Z(()=>import(`./erlang-Cphh6RMH.js`),__vite__mapDeps([39,40])))},{id:`fennel`,name:`Fennel`,import:(()=>Z(()=>import(`./fennel-DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>Z(()=>import(`./fish-BJitypiv.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>Z(()=>import(`./fluent-C03EYrpw.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>Z(()=>import(`./fortran-fixed-form-DEKoE2YW.js`),__vite__mapDeps([41,42])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>Z(()=>import(`./fortran-free-form-CYNrtFtB.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>Z(()=>import(`./fsharp-D13ZGOAj.js`),__vite__mapDeps([43,40])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>Z(()=>import(`./gdresource-C0sCabJj.js`),__vite__mapDeps([44,45,46])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>Z(()=>import(`./gdscript-Cp2uCuqX.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>Z(()=>import(`./gdshader-CBce3t8t.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>Z(()=>import(`./genie-CV2tkWYe.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>Z(()=>import(`./gherkin-DExj1W_8.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>Z(()=>import(`./git-commit-BSykSTBG.js`),__vite__mapDeps([47,48])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>Z(()=>import(`./git-rebase-JZjTkDb3.js`),__vite__mapDeps([49,28])))},{id:`gleam`,name:`Gleam`,import:(()=>Z(()=>import(`./gleam-CSRkHgEL.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>Z(()=>import(`./glimmer-js-BFo0CPy5.js`),__vite__mapDeps([50,2,3,1,11])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>Z(()=>import(`./glimmer-ts-DAcq7Y_c.js`),__vite__mapDeps([51,2,3,1,11])))},{id:`glsl`,name:`GLSL`,import:(()=>Z(()=>import(`./glsl-DhnGzt33.js`).then(e=>e.n),__vite__mapDeps([25,26])))},{id:`gn`,name:`GN`,import:(()=>Z(()=>import(`./gn-ilITqXS6.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>Z(()=>import(`./gnuplot-7GGW24-e.js`),[]))},{id:`go`,name:`Go`,import:(()=>Z(()=>import(`./go-rLFTqkRN.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>Z(()=>import(`./graphql-CEXh_N73.js`).then(e=>e.n),__vite__mapDeps([35,2,11,13,36])))},{id:`groovy`,name:`Groovy`,import:(()=>Z(()=>import(`./groovy-CacY0gHj.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>Z(()=>import(`./hack-UWFhVRVC.js`),__vite__mapDeps([52,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>Z(()=>import(`./haml-DHtICXqF.js`).then(e=>e.n),__vite__mapDeps([34,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>Z(()=>import(`./handlebars-CCtme0Ck.js`),__vite__mapDeps([53,2,3,1,38])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>Z(()=>import(`./haskell-D8IpX4py.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>Z(()=>import(`./haxe-OTjmBuCE.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>Z(()=>import(`./hcl-Dh228itO.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>Z(()=>import(`./hjson-CxZEssPk.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>Z(()=>import(`./hlsl-Cvrh5tZx.js`),[]))},{id:`html`,name:`HTML`,import:(()=>Z(()=>import(`./html-BgUj8HFK.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>Z(()=>import(`./html-derivative-BDqxxldY.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>Z(()=>import(`./http-BRNbuWVo.js`),__vite__mapDeps([54,7,8,9,28,35,2,11,13,36])))},{id:`hurl`,name:`Hurl`,import:(()=>Z(()=>import(`./hurl-DM6YEz2O.js`),__vite__mapDeps([55,7,8,56,35,2,11,13,36])))},{id:`hxml`,name:`HXML`,import:(()=>Z(()=>import(`./hxml-B0Qn7Nwc.js`),__vite__mapDeps([57,58])))},{id:`hy`,name:`Hy`,import:(()=>Z(()=>import(`./hy-CZbG8q4J.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>Z(()=>import(`./imba-DsUTQ-LC.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>Z(()=>import(`./ini-B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>Z(()=>import(`./java-Du-Dsutn.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>Z(()=>import(`./javascript-BdZ05Y4l.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>Z(()=>import(`./jinja-Jckv6-6l.js`),__vite__mapDeps([59,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>Z(()=>import(`./jison-BQFOoWvG.js`),__vite__mapDeps([60,2])))},{id:`json`,name:`JSON`,import:(()=>Z(()=>import(`./json-D0dNduVK.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>Z(()=>import(`./json5-BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>Z(()=>import(`./jsonc-CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>Z(()=>import(`./jsonl-CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>Z(()=>import(`./jsonnet-CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>Z(()=>import(`./jssm-DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>Z(()=>import(`./jsx-D7il4Mt6.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>Z(()=>import(`./julia-F62Yi6id.js`),__vite__mapDeps([61,2,16,20,23,24,25,26,62])))},{id:`just`,name:`Just`,import:(()=>Z(()=>import(`./just-D7KHnvi5.js`),__vite__mapDeps([63,2,11,20,28,33,3,1,7,8,16,26,23,24,25,34,35,13,36,37,38,64])))},{id:`kdl`,name:`KDL`,import:(()=>Z(()=>import(`./kdl-CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>Z(()=>import(`./kotlin-DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>Z(()=>import(`./kusto-C7mF5XQf.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>Z(()=>import(`./latex-CZxmkjNE.js`),__vite__mapDeps([65,66,62])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>Z(()=>import(`./lean-CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>Z(()=>import(`./less-DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>Z(()=>import(`./liquid-Bpa1WZEW.js`),__vite__mapDeps([67,2,3,1,9])))},{id:`llvm`,name:`LLVM IR`,import:(()=>Z(()=>import(`./llvm-Cm23YOpf.js`),[]))},{id:`log`,name:`Log file`,import:(()=>Z(()=>import(`./log-BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>Z(()=>import(`./logo-Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>Z(()=>import(`./lua-jRS_G-7D.js`).then(e=>e.n),__vite__mapDeps([37,26])))},{id:`luau`,name:`Luau`,import:(()=>Z(()=>import(`./luau-FMPmPwt6.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>Z(()=>import(`./make-Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>Z(()=>import(`./markdown-BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>Z(()=>import(`./marko-tsekaf7E.js`),__vite__mapDeps([68,3,5,11,69])))},{id:`matlab`,name:`MATLAB`,import:(()=>Z(()=>import(`./matlab-D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>Z(()=>import(`./mdc-BlxcKKfr.js`),__vite__mapDeps([70,15,1,2,3,38,40])))},{id:`mdx`,name:`MDX`,import:(()=>Z(()=>import(`./mdx-DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>Z(()=>import(`./mermaid-Bk4SNUv9.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>Z(()=>import(`./mipsasm-BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>Z(()=>import(`./mojo-BgCJLMeH.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>Z(()=>import(`./moonbit-CaWjb8XO.js`),[]))},{id:`move`,name:`Move`,import:(()=>Z(()=>import(`./move-B1IS1UjX.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>Z(()=>import(`./narrat-_X_XdTYD.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>Z(()=>import(`./nextflow-BJtWHP5T.js`),__vite__mapDeps([71,72])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>Z(()=>import(`./nextflow-groovy-DJMQeKeT.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>Z(()=>import(`./nginx-DJu3RFz6.js`),__vite__mapDeps([73,37,26])))},{id:`nim`,name:`Nim`,import:(()=>Z(()=>import(`./nim-SbVsqvzV.js`),__vite__mapDeps([74,2,3,1,7,8,26,25,40])))},{id:`nix`,name:`Nix`,import:(()=>Z(()=>import(`./nix-IvuFDN5E.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>Z(()=>import(`./nushell-DcLAeLz5.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>Z(()=>import(`./objective-c-D1A_Heim.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>Z(()=>import(`./objective-cpp-BsSzOQcm.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>Z(()=>import(`./ocaml-O90oeIOV.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>Z(()=>import(`./odin-B1RWQWA5.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>Z(()=>import(`./openscad-BUDT5pXO.js`),[]))},{id:`pascal`,name:`Pascal`,import:(()=>Z(()=>import(`./pascal-4ZHwLPI5.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>Z(()=>import(`./perl-ZGwW4ebs.js`),__vite__mapDeps([64,2,3,1,7,8,16])))},{id:`php`,name:`PHP`,import:(()=>Z(()=>import(`./php-9NN3eieL.js`),__vite__mapDeps([75,2,3,1,7,8,9,16])))},{id:`pkl`,name:`Pkl`,import:(()=>Z(()=>import(`./pkl-ot-7Btpt.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>Z(()=>import(`./plsql-DGHpHOYJ.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>Z(()=>import(`./po-BiJDBrnU.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>Z(()=>import(`./polar-C7UOKdEL.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>Z(()=>import(`./postcss-BXeXVLqQ.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>Z(()=>import(`./powerquery-DNMTfnFr.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`],import:(()=>Z(()=>import(`./powershell-DshXNtvi.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>Z(()=>import(`./prisma-BsRQq5mF.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>Z(()=>import(`./prolog-iXnhIJG7.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>Z(()=>import(`./proto-DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>Z(()=>import(`./pug-BlT7g5Ne.js`),__vite__mapDeps([76,2,3,1])))},{id:`puppet`,name:`Puppet`,import:(()=>Z(()=>import(`./puppet-CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>Z(()=>import(`./purescript-9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>Z(()=>import(`./python-gzcpVVnB.js`),[]))},{id:`qml`,name:`QML`,import:(()=>Z(()=>import(`./qml-C_5EqAo9.js`),__vite__mapDeps([77,2])))},{id:`qmldir`,name:`QML Directory`,import:(()=>Z(()=>import(`./qmldir-DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>Z(()=>import(`./qss-Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>Z(()=>import(`./r-CZMC2qW_.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>Z(()=>import(`./racket-DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>Z(()=>import(`./raku-B3gFvitq.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>Z(()=>import(`./razor-D0g1dB-1.js`),__vite__mapDeps([78,1,2,3,79])))},{id:`reg`,name:`Windows Registry Script`,import:(()=>Z(()=>import(`./reg-CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>Z(()=>import(`./regexp-BNgjJOCE.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>Z(()=>import(`./rel-BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>Z(()=>import(`./riscv-Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>Z(()=>import(`./ron-VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>Z(()=>import(`./rosmsg-CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>Z(()=>import(`./rst-phuZIdUj.js`),__vite__mapDeps([80,2,15,1,3,20,81,23,16,24,25,26,28,38,33,7,8,34,35,11,13,36,37])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>Z(()=>import(`./ruby-CRc73zUI.js`),__vite__mapDeps([33,2,3,1,7,8,16,26,23,24,25,28,34,35,11,13,36,37,38])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>Z(()=>import(`./rust-Cfkwpbl8.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>Z(()=>import(`./sas-BwNzgNew.js`),__vite__mapDeps([82,16])))},{id:`sass`,name:`Sass`,import:(()=>Z(()=>import(`./sass-DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>Z(()=>import(`./scala-DKOlJaKm.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>Z(()=>import(`./scheme-DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>Z(()=>import(`./scss-DwoZqi_J.js`).then(e=>e.n),__vite__mapDeps([5,3])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>Z(()=>import(`./sdbl-bTVj8UrX.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>Z(()=>import(`./shaderlab-TOUzSsQk.js`),__vite__mapDeps([83,84])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>Z(()=>import(`./shellscript-tUaVh2-4.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>Z(()=>import(`./shellsession-CVBDwkDH.js`),__vite__mapDeps([85,28])))},{id:`smalltalk`,name:`Smalltalk`,import:(()=>Z(()=>import(`./smalltalk-B16xEiuN.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>Z(()=>import(`./solidity-CKzVLygQ.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>Z(()=>import(`./soy-E8dxwmqc.js`),__vite__mapDeps([86,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>Z(()=>import(`./sparql-D_iOobhT.js`),__vite__mapDeps([87,88])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>Z(()=>import(`./splunk-BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>Z(()=>import(`./sql-DMhkqFze.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>Z(()=>import(`./ssh-config-BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>Z(()=>import(`./stata-Cv2byDFf.js`),__vite__mapDeps([89,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>Z(()=>import(`./stylus-B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>Z(()=>import(`./surrealql-DI-zENE_.js`),__vite__mapDeps([90,2])))},{id:`svelte`,name:`Svelte`,import:(()=>Z(()=>import(`./svelte-TJTH4Mgd.js`),__vite__mapDeps([91,2,3,11,12])))},{id:`swift`,name:`Swift`,import:(()=>Z(()=>import(`./swift-DonLKvLd.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>Z(()=>import(`./system-verilog-DJ5XKQeo.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>Z(()=>import(`./systemd-BxMlprV5.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>Z(()=>import(`./talonscript-CohzipZa.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>Z(()=>import(`./tasl-DMoTqEGO.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>Z(()=>import(`./tcl-CZd0xW_V.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>Z(()=>import(`./templ-COT0AySu.js`),__vite__mapDeps([92,2,3,93])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>Z(()=>import(`./terraform-DswuEJGm.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>Z(()=>import(`./tex-Bd66EYiM.js`),__vite__mapDeps([66,62])))},{id:`toml`,name:`TOML`,import:(()=>Z(()=>import(`./toml-CcmNWLt0.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>Z(()=>import(`./ts-tags-K-IcEfKc.js`),__vite__mapDeps([94,2,3,1,7,8,11,16,25,26])))},{id:`tsv`,name:`TSV`,import:(()=>Z(()=>import(`./tsv-sltzmVWM.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>Z(()=>import(`./tsx-BGS9ggj2.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>Z(()=>import(`./turtle-ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>Z(()=>import(`./twig-naFMeh9B.js`),__vite__mapDeps([95,2,3,5,20,33,1,7,8,16,26,23,24,25,28,34,35,11,13,36,37,38,75,9])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>Z(()=>import(`./typescript-C5djjABa.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>Z(()=>import(`./typespec-BRdr0IET.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>Z(()=>import(`./typst-DI99ib-x.js`),[]))},{id:`v`,name:`V`,import:(()=>Z(()=>import(`./v-DETTlOr0.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>Z(()=>import(`./vala-zf12oZj6.js`),[]))},{id:`vb`,name:`Visual Basic`,aliases:[`cmd`],import:(()=>Z(()=>import(`./vb-Djn5o6TS.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>Z(()=>import(`./verilog-CiiDBU1e.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>Z(()=>import(`./vhdl-BroJfC0k.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>Z(()=>import(`./viml-DvXPmvsu.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>Z(()=>import(`./vue-CQ06WBnQ.js`),__vite__mapDeps([96,2,3,1,9,11,15])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>Z(()=>import(`./vue-html-DKhLybFP.js`),__vite__mapDeps([97,2])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>Z(()=>import(`./vue-vine-DL36Bfrd.js`),__vite__mapDeps([98,2,3,5,12,69,99])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>Z(()=>import(`./vyper-CgoNMtux.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>Z(()=>import(`./wasm-ByWQv1Qj.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>Z(()=>import(`./wenyan-C8pVoKbM.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>Z(()=>import(`./wgsl-BsKzXJz4.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>Z(()=>import(`./wikitext-ClFFjSW2.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>Z(()=>import(`./wit-DdvCle-K.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>Z(()=>import(`./wolfram-DLL8P-h_.js`),[]))},{id:`xml`,name:`XML`,import:(()=>Z(()=>import(`./xml-DSuqdaRn.js`).then(e=>e.n),__vite__mapDeps([7,8])))},{id:`xsl`,name:`XSL`,import:(()=>Z(()=>import(`./xsl-hJI5_JEr.js`),__vite__mapDeps([100,7,8])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>Z(()=>import(`./yaml-BbSaoh0K.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>Z(()=>import(`./zenscript-BnlCZFoB.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>Z(()=>import(`./zig-CMLA9XwU.js`),[]))}],q_=Object.fromEntries(K_.map(e=>[e.id,e.import])),J_=Object.fromEntries(K_.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Y_={...q_,...J_},X_=Object.defineProperty,Z_=Object.getOwnPropertyDescriptor,Q_=Object.getOwnPropertyNames,$_=Object.prototype.hasOwnProperty,ev=(e,t)=>{let n={};for(var r in e)X_(n,r,{get:e[r],enumerable:!0});return t||X_(n,Symbol.toStringTag,{value:`Module`}),n},tv=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Q_(t),a=0,o=i.length,s;a<o;a++)s=i[a],!$_.call(e,s)&&s!==n&&X_(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Z_(t,s))||r.enumerable});return e},nv=(e,t,n)=>(tv(e,t,`default`),n&&tv(n,t,`default`)),rv=t({createOnigurumaEngine:()=>jv,getDefaultWasmLoader:()=>Av,loadWasm:()=>wv,setDefaultWasmLoader:()=>kv}),iv=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function av(){return 2147483648}function ov(){return typeof performance<`u`?performance.now():Date.now()}var sv=(e,t)=>e+(t-e%t)%t;async function cv(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=av();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,sv(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:ov,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var lv=Object.defineProperty,uv=(e,t,n)=>t in e?lv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dv=(e,t,n)=>uv(e,typeof t==`symbol`?t:t+``,n),fv=null;function pv(e){throw new iv(e.UTF8ToString(e.getLastOnigError()))}var mv=class e{constructor(t){dv(this,`utf16Length`),dv(this,`utf8Length`),dv(this,`utf16Value`),dv(this,`utf8Value`),dv(this,`utf16OffsetToUtf8`),dv(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}a<=127?t+=1:a<=2047?t+=2:a<=65535?t+=3:t+=4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},hv=class e{constructor(t){if(dv(this,`id`,++e.LAST_ID),dv(this,`_onigBinding`),dv(this,`content`),dv(this,`utf16Length`),dv(this,`utf8Length`),dv(this,`utf16OffsetToUtf8`),dv(this,`utf8OffsetToUtf16`),dv(this,`ptr`),!fv)throw new iv(`Must invoke loadWasm first.`);this._onigBinding=fv,this.content=t;let n=new mv(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=fv.omalloc(1e4),e._sharedPtrInUse=!0,fv.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(fv)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};dv(hv,`LAST_ID`,0),dv(hv,`_sharedPtr`,0),dv(hv,`_sharedPtrInUse`,!1);var gv=hv,_v=class{constructor(e){if(dv(this,`_onigBinding`),dv(this,`_ptr`),!fv)throw new iv(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new mv(e[r]);t[r]=i.createString(fv),n[r]=i.utf8Length}let r=fv.omalloc(4*e.length);fv.HEAPU32.set(t,r/4);let i=fv.omalloc(4*e.length);fv.HEAPU32.set(n,i/4);let a=fv.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)fv.ofree(t[n]);fv.ofree(i),fv.ofree(r),a===0&&pv(fv),this._onigBinding=fv,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new gv(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function vv(e){return typeof e.instantiator==`function`}function yv(e){return typeof e.default==`function`}function bv(e){return e.data!==void 0}function xv(e){return typeof Response<`u`&&e instanceof Response}function Sv(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}var Cv;function wv(e){if(Cv)return Cv;async function t(){fv=await cv(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),vv(n)?n=await n.instantiator(t):yv(n)?n=await n.default(t):(bv(n)&&(n=n.data),xv(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await Ev(n)(t):await Dv(n)(t):Sv(n)||n instanceof WebAssembly.Module?n=await Tv(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await Tv(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return Cv=t(),Cv}function Tv(e){return t=>WebAssembly.instantiate(e,t)}function Ev(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Dv(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var Ov;function kv(e){Ov=e}function Av(){return Ov}async function jv(e){return e&&await wv(e),{createScanner(e){return new _v(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new gv(e)}}}var Mv=ev({});nv(Mv,rv);var Nv=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>Z(()=>import(`./andromeeda-vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>Z(()=>import(`./aurora-x-CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>Z(()=>import(`./ayu-dark-DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>Z(()=>import(`./ayu-light-C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>Z(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>Z(()=>import(`./catppuccin-frappe-3VR1Za6u.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>Z(()=>import(`./catppuccin-latte-DwIHMF0Q.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>Z(()=>import(`./catppuccin-macchiato-DYnBP6_5.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>Z(()=>import(`./catppuccin-mocha-DYhrFGRu.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>Z(()=>import(`./dark-plus-Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>Z(()=>import(`./dracula-BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>Z(()=>import(`./dracula-soft-5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>Z(()=>import(`./everforest-dark-sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>Z(()=>import(`./everforest-light-Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>Z(()=>import(`./github-dark-C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>Z(()=>import(`./github-dark-default-DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>Z(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>Z(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>Z(()=>import(`./github-light-EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>Z(()=>import(`./github-light-default-BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>Z(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>Z(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>Z(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>Z(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>Z(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>Z(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>Z(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>Z(()=>import(`./horizon-CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>Z(()=>import(`./horizon-bright-DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>Z(()=>import(`./houston-CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>Z(()=>import(`./kanagawa-dragon-CXtmUGW6.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>Z(()=>import(`./kanagawa-lotus-BN08jTvb.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>Z(()=>import(`./kanagawa-wave-CTweb8Dz.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>Z(()=>import(`./laserwave-C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>Z(()=>import(`./light-plus-DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>Z(()=>import(`./material-theme-Bm3Qr25_.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>Z(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>Z(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>Z(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>Z(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>Z(()=>import(`./min-dark-BSWPekZh.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>Z(()=>import(`./min-light-DDpmG2fV.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>Z(()=>import(`./monokai-CdkpiU2Y.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>Z(()=>import(`./night-owl-DhmEMT88.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>Z(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>Z(()=>import(`./nord-Cb4Vim4T.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>Z(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>Z(()=>import(`./one-light-D7Lr4KcI.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>Z(()=>import(`./plastic-DQwYfKfQ.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>Z(()=>import(`./poimandres-DRFjx7u4.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>Z(()=>import(`./red-CJ3rzSJv.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>Z(()=>import(`./rose-pine-BthvhNj6.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>Z(()=>import(`./rose-pine-dawn-Dg85fqjY.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>Z(()=>import(`./rose-pine-moon-hon4tzzS.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>Z(()=>import(`./slack-dark-DnToyrRv.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>Z(()=>import(`./slack-ochin-B2OO5cIa.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>Z(()=>import(`./snazzy-light-4G7pJPwS.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>Z(()=>import(`./solarized-dark-DV17i1UV.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>Z(()=>import(`./solarized-light-DSh2HLQt.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>Z(()=>import(`./synthwave-84-nFMaYfgc.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>Z(()=>import(`./tokyo-night-oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>Z(()=>import(`./vesper-DdrHHSXu.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>Z(()=>import(`./vitesse-black-fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>Z(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>Z(()=>import(`./vitesse-light-VbXTXTou.js`),[]))}].map(e=>[e.id,e.import])),Q=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Pv(e){return Fv(e)}function Fv(e){return Array.isArray(e)?Iv(e):e instanceof RegExp?e:typeof e==`object`?Lv(e):e}function Iv(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Fv(e[n]);return t}function Lv(e){let t={};for(let n in e)t[n]=Fv(e[n]);return t}function Rv(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function zv(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?zv(e.substring(0,e.length-1)):e.substr(~t+1)}var Bv=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Vv=class{static hasCaptures(e){return e===null?!1:(Bv.lastIndex=0,Bv.test(e))}static replaceCaptures(e,t,n){return e.replace(Bv,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function Hv(e,t){return e<t?-1:+(e>t)}function Uv(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 r=0;r<n;r++){let n=Hv(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function Wv(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 Gv(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Kv=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},qv=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Qv(e),t)}static createFromParsedTheme(e,t){return ty(e,t)}_cachedMatchRoot=new Kv(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>Yv(e.parent,t.parentScopes));return n?new Zv(n.fontStyle,n.foreground,n.background):null}},Jv=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Yv(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Xv(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Xv(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var Zv=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Qv(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8;break}}let s=null;typeof i.settings.foreground==`string`&&Wv(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&Wv(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new $v(l,u,e,o,s,c)}}return n}var $v=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},ey=(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))(ey||{});function ty(e,t){e.sort((e,t)=>{let n=Hv(e.scope,t.scope);return n!==0||(n=Uv(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new ny(t),o=new Zv(n,a.getId(r),a.getId(i)),s=new ay(new iy(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new qv(a,o,s)}var ny=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 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)}},ry=Object.freeze([]),iy=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||ry,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},ay=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),iy.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(Uv(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new iy(e,t,n,r,i))}},oy=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!=0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=cy(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function sy(e){return e}function cy(e){return e}function ly(e,t){let n=[],r=dy(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(uy(i)){let e=[];do e.push(i),i=r.next();while(uy(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function uy(e){return!!e&&!!e.match(/[\w\.:]+/)}function dy(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function fy(e){typeof e.dispose==`function`&&e.dispose()}var py=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},my=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},hy=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},gy=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new py(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new hy;for(let n of e)_y(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof py){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function _y(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof py?yy({baseGrammar:a,selfGrammar:i},r):vy(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new py(e))}function vy(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];by([r],t,n)}}function yy(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&by(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&by(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function by(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?Rv({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&by(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Ey(i);switch(a.kind){case 0:yy({...t,selfGrammar:t.baseGrammar},n);break;case 1:yy(t,n);break;case 2:vy(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?vy(a.ruleName,i,n):yy(i,n)}else a.kind===4?n.add(new my(a.scopeName,a.ruleName)):n.add(new py(a.scopeName));break}}}var xy=class{kind=0},Sy=class{kind=1},Cy=class{constructor(e){this.ruleName=e}kind=2},wy=class{constructor(e){this.scopeName=e}kind=3},Ty=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Ey(e){if(e===`$base`)return new xy;if(e===`$self`)return new Sy;let t=e.indexOf(`#`);return t===-1?new wy(e):t===0?new Cy(e.substring(1)):new Ty(e.substring(0,t),e.substring(t+1))}var Dy=/\\(\d+)/,Oy=/\\(\d+)/g,ky=-1,Ay=-2;function jy(e){return e}function My(e){return e}var Ny=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Vv.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Vv.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${zv(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:Vv.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Vv.replaceCaptures(this._contentName,e,t)}},Py=class extends Ny{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},Fy=class extends Ny{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new By(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),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 Vy,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Iy=class extends Ny{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let 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 Vy,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ly=class extends Ny{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new By(i,this.id),this.beginCaptures=a,this._end=new By(o||`￿`,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),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 Vy;for(let t of this.patterns)e.getRule(t).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}},Ry=class extends Ny{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new By(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new By(o,Ay),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),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 Vy;for(let 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 Vy,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},zy=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Py(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Fy(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=Rv({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Iy(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Ry(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new Ly(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=Ey(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l)if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository);break}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof Iy||e instanceof Ly||e instanceof Ry)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},By=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source==`string`?this.hasBackReferences=Dy.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return Oy.lastIndex=0,this.source.replace(Oy,(e,t)=>Gv(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=`￿`,t[i+1]=`￿`,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=`￿`,t[i+1]=`G`,n[i+1]=`￿`,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Vy=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(),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(e=>e.source);this._cached=new Hy(e,t,this._items.map(e=>e.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){return new Hy(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Hy=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(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
2680
+ `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Uy=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Wy=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Uy(e,8),this._embeddedLanguagesMatcher=new Gy(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Uy(0,0);_getBasicScopeAttributes=new Kv(e=>new Uy(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.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 Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Gy=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>Gv(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var Ky=!1,qy=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Jy(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Yy(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new qy(i,!0);f()}return new qy(i,!1);function f(){let o=Xy(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===ky){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),nb(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof Ly){let r=o;nb(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof Ry){let r=o;nb(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(nb(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function Yy(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof Ry&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=eb(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==Ay){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),nb(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Xy(e,t,n,r,i,a){let o=Zy(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Qy(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function Zy(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=$y(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Qy(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=$y(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function $y(e,t,n,r,i){return Ky?{ruleScanner:e.compile(t,n),findOptions:tb(r,i)}:{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function eb(e,t,n,r,i){return Ky?{ruleScanner:e.compileWhile(t,n),findOptions:tb(r,i)}:{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function tb(e,t){let n=0;return e||(n|=1),t||(n|=4),n}function nb(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));Jy(e,p,n&&d.start===0,d.start,f,i,!1,0),fy(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new rb(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var rb=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function ib(e,t,n,r,i,a,o,s){return new cb(e,t,n,r,i,a,o,s)}function ab(e,t,n,r,i){let a=ly(t,ob),o=zy.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function ob(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(sb(t[r],e))return n=r+1,!0;return!1})}function sb(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var cb=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new Wy(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=lb(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=ly(e,ob);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let 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(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)ab(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&ab(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(jy(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[My(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=lb(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let 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){let 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=zy.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===db.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=oy.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?ub.createRootAndLookUpScopeName(a,r,this):ub.createRoot(`unknown`,r),t=new db(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
2681
+ `;let a=this.createOnigString(e),o=a.content.length,s=new pb(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Jy(this,a,i,0,t,s,!0,r);return fy(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function lb(e,t){return e=Pv(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 ub=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=Jv.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new Jv(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new Jv(null,t),o=r.themeProvider.themeMatch(a);return new e(null,a,e.mergeAttributes(n,i,o))}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),oy.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a);return new e(t,a,e.mergeAttributes(t.tokenAttributes,i,o))}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},db=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?ub.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:My(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){let r=ub.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,jy(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,ub.fromExtension(r,n.contentNameScopesList))}},fb=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):ly(e,ob).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>ly(e,ob).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},pb=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 n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=oy.set(n,0,sy(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=oy.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let 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);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},mb=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let 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,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,ib(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},hb=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new mb(qv.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(qv.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new fb(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new gy(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},gb=db.NULL;function _b(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function vb(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function yb(e){return Array.isArray(e)?e:[e]}async function bb(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function xb(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function Sb(e){return e===`ansi`||xb(e)}function Cb(e){return e===`none`}function wb(e){return Cb(e)}var Tb=/(\r?\n)/g;function Eb(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(Tb),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var Db={light:`#333333`,dark:`#bbbbbb`},Ob={light:`#fffffe`,dark:`#1e1e1e`},kb=`__shiki_resolved`;function Ab(e){if(e?.[kb])return e;let 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){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?Db.light:Db.dark,n||=t.type===`light`?Ob.light:Ob.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 i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,kb,{enumerable:!1,writable:!1,value:!0}),t}async function jb(e){return[...new Set((await Promise.all(e.filter(e=>!Sb(e)).map(async e=>await bb(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function Mb(e){return(await Promise.all(e.map(async e=>wb(e)?null:Ab(await bb(e))))).filter(e=>!!e)}function Nb(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new Q(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var Pb=class extends hb{_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(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=Ab(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=qv.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Nb(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new Q(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return 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);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},Fb=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}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){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},Ib=0;function Lb(e){Ib+=1,e.warnings!==!1&&Ib>=10&&Ib%10==0&&console.warn(`[Shiki] ${Ib} 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 Q("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(Ab),i=new Pb(new Fb(e.engine,n),r,n,e.langAlias),a;function o(t){return Nb(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new Q(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new Q(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await jb(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await Mb(e))}function g(){if(t)throw new Q(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--Ib)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function Rb(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([Mb(e.themes||[]),jb(e.langs||[]),e.engine]);return Lb({...e,themes:t,langs:n,engine:r})}var zb=new WeakMap;function Bb(e,t){zb.set(e,t)}function Vb(e){return zb.get(e)}var Hb=class e{_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 e(Object.fromEntries(yb(n).map(e=>[e,gb])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Ub(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Ub(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function Wb(e,t){if(!(e instanceof Hb))throw new Q(`Invalid grammar state`);return e.getInternalStack(t)}var Gb=/,/,Kb=/ /;function qb(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(xb(e.resolveLangAlias(n.lang||`text`))||Cb(r))return Eb(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new Q(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new Q(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return Yb(t,o,i,a,n)}function Jb(...e){if(e.length===2)return Vb(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(xb(i)||Cb(a))throw new Q(`Plain language does not have grammar state`);if(i===`ansi`)throw new Q(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new Hb(Xb(n,c,o,s,r).stateStack,c.name,o.name)}function Yb(e,t,n,r,i){let a=Xb(e,t,n,r,i),o=new Hb(a.stateStack,t.name,n.name);return Bb(a.tokens,o),a.tokens}function Xb(e,t,n,r,i){let a=_b(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500}=i,c=Eb(e),l=i.grammarState?Wb(i.grammarState,n.name)??gb:i.grammarContextCode==null?gb:Xb(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,u=[],d=[];for(let e=0,f=c.length;e<f;e++){let[f,p]=c[e];if(f===``){u=[],d.push([]);continue}if(o>0&&f.length>=o){u=[],d.push([{content:f,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;i.includeExplanation&&(m=t.tokenizeLine(f,l,s),h=m.tokens,g=0);let _=t.tokenizeLine2(f,l,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:f.length;if(t===o)continue;let s=_.tokens[2*e+1],c=vb(r[oy.getForeground(s)],a),l=oy.getFontStyle(s),d={content:f.substring(t,o),offset:p+t,color:c,fontStyle:l};if(i.includeExplanation){let e=[];if(i.includeExplanation!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(Gb).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(Kb))})}d.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=f.substring(t.startIndex,t.endIndex);r+=n.length,d.explanation.push({content:n,scopes:i.includeExplanation===`scopeName`?Zb(t.scopes):Qb(e,t.scopes)}),g+=1}}u.push(d)}d.push(u),u=[],l=_.ruleStack}return{tokens:d,stateStack:l}}function Zb(e){return e.map(e=>({scopeName:e}))}function Qb(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:tx(e,i,t.slice(0,r))}}return n}function $b(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function ex(e,t,n){if(!$b(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)$b(e[r],n[i])&&--r,--i;return r===-1}function tx(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(ex(e,t,n)){r.push(a);break}return r}function nx(e,t,n,r=qb){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:Vb(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=rx(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new Hb(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&Bb(s,c),s}function rx(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var ix=/\s+/g;function ax(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(ix)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(ix);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}var ox=/:?lang=["']([^"']+)["']/g,sx=/(?:```|~~~)([\w-]+)/g,cx=/\\begin\{([\w-]+)\}/g,lx=/<script\s+(?:type|lang)=["']([^"']+)["']/gi;function ux(e){let t=Eb(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function dx(e,t,n){let r=new Set;for(let t of e.matchAll(ox)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(sx)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(cx)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(lx)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(!n)return[...r];let i=n.getBundledLanguages();return[...r].filter(e=>e&&i[e])}var fx=[`color`,`background-color`];function px(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function mx(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?px(e,t):e})):e}function hx(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>gx(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&fx.includes(a))if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new Q('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');c[a]=`light-dark(${o[e][a]||`inherit`}, ${o[r][a]||`inherit`})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s;else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function gx(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&ey.Italic&&(t[`font-style`]=`italic`),e.fontStyle&ey.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&ey.Underline&&n.push(`underline`),e.fontStyle&ey.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function _x(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function vx(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=ux(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new Q(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}else{let t=n.lines[e.line];if(t===void 0)throw new Q(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new Q(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));yx(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return mx(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new Q(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=bx(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new Q(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new Q(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&ax(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function yx(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new Q(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new Q(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function bx(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(bx).join(``):``}var xx=[vx()];function Sx(e){let t=Cx(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...xx]}function Cx(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var wx=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],Tx={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function Ex(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function Dx(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}else if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function Ox(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:`resetAll`});else if(r<=9)Tx[r]&&t.push({type:`setDecoration`,value:Tx[r]});else if(r<=29){let e=Tx[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:wx[r-30]}});else if(r===38){let n=Dx(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:wx[r-40]}});else if(r===48){let n=Dx(e);n&&t.push({type:`setBackgroundColor`,value:n})}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:wx[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:wx[r-100+8]}})}return t}function kx(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=Ex(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=Ox(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var Ax={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 jx(e=Ax){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<wx.length;e++)r.push(t(wx[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var Mx=/#([0-9a-f]{3,8})/i,Nx=/var\((--[\w-]+-ansi-[\w-]+)\)/,Px={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 Fx(e,t,n){let r=_b(e,n),i=Eb(t),a=jx(Object.fromEntries(wx.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Px[t]]}))),o=kx();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=vb(i,r),o=vb(o,r),n.decorations.has(`dim`)&&(i=Ix(i));let s=ey.None;return n.decorations.has(`bold`)&&(s|=ey.Bold),n.decorations.has(`italic`)&&(s|=ey.Italic),n.decorations.has(`underline`)&&(s|=ey.Underline),n.decorations.has(`strikethrough`)&&(s|=ey.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Ix(e){let t=e.match(Mx);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}else if(e.length===6)return`#${e}80`;else if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}else if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(Nx);return n?`var(${n[1]}-dim)`:e}function Lx(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!xb(r)&&!Cb(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return Fx(r,t,n)}return qb(e,t,n)}function Rx(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new Q("`themes` option must not be empty");let p=nx(e,t,n,Lx);if(c=Vb(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new Q(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>hx(e,h,u,l,d))),c&&Bb(a,c);let g=f.map(e=>_b(e.theme,n));i=zx(f,m,g,u,l,`fg`,d),r=zx(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=_b(n.theme,n);a=Lx(e,t,n);let l=e.getTheme(n.theme);r=vb(l.bg,s),i=vb(l.fg,s),o=l.name,c=Vb(a)}else throw new Q("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function zx(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=vb(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new Q('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${vb(t[r][a],n[r])||`inherit`}, ${vb(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var Bx=/^\s+$/,Vx=/^(\s*)(.*?)(\s*)$/;function Hx(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>Hx(e,t,n),codeToTokens:(t,n)=>Rx(e,t,n)}){let i=t;for(let e of Sx(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=Rx(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=Wx(a):d===`never`&&(a=Gx(a)),f&&(a=Kx(a));let p={...r,get source(){return i}};for(let e of Sx(n))a=e.tokens?.call(p,a)||a;return Ux(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function Ux(e,t,n,r=Vb(e)){let i=Sx(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(t.rootStyle==null?l.style=`background-color:${t.bg};color:${t.fg}`:l.style=t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:ax,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
2682
+ `}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=_x(a.htmlStyle||gx(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&Bb(m,r),m}function Wx(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&ey.Underline||i.fontStyle&ey.Strikethrough));o&&Bx.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function Gx(e){return e.map(e=>e.flatMap(e=>{if(Bx.test(e.content))return e;let t=e.content.match(Vx);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function Kx(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=_x(e.htmlStyle||gx(e)),i=_x(n.htmlStyle||gx(n)),a=e.fontStyle&&(e.fontStyle&ey.Underline||e.fontStyle&ey.Strikethrough),o=n.fontStyle&&(n.fontStyle&ey.Underline||n.fontStyle&ey.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var qx=Qh;function Jx(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>Hx(e,t,n),codeToTokens:(t,n)=>Rx(e,t,n)},i=qx(Hx(e,t,n,r));for(let e of Sx(n))i=e.postprocess?.call(r,i,n)||i;return i}async function Yx(e){let t=await Rb(e);return{getLastGrammarState:(...e)=>Jb(t,...e),codeToTokensBase:(e,n)=>Lx(t,e,n),codeToTokensWithThemes:(e,n)=>nx(t,e,n),codeToTokens:(e,n)=>Rx(t,e,n),codeToHast:(e,n)=>Hx(t,e,n),codeToHtml:(e,n)=>Jx(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Xx(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,Sb(n))return[];let r=t[n];if(!r)throw new Q(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(wb(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new Q(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await Yx({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function Zx(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}else{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function Qx(e,t){let n=Zx(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var $x=Xx({langs:Y_,themes:Nv,engine:()=>(0,Mv.createOnigurumaEngine)(Z(()=>import(`./wasm-BnjxR4X6.js`),[]))}),{codeToHtml:eS,codeToHast:tS,codeToTokens:nS,codeToTokensBase:rS,codeToTokensWithThemes:iS,getSingletonHighlighter:aS,getLastGrammarState:oS}=Qx($x,{guessEmbeddedLanguages:dx}),sS=4294967295,cS=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:sS,end:sS,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let o=n.exec(r);if(!o)continue;if(o.index===t)return a(e,o,0);i.push([e,o,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(i.length){let e=Math.min(...i.map(e=>e[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function lS(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function uS(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var dS=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),fS=String.raw;function pS(e,t){if(e==null)throw Error(t??`Value expected`);return e}var mS=fS`\[\^?`,hS=`c.? | C(?:-.?)?|${fS`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${fS`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${fS`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${fS`o\{[^\}]*\}?`}|${fS`\d{1,3}`}`,gS=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,_S=new RegExp(fS`
2685
2683
  \\ (?:
2686
- ${vS}
2684
+ ${hS}
2687
2685
  | [gk]<[^>]*>?
2688
2686
  | [gk]'[^']*'?
2689
2687
  | .
@@ -2700,20 +2698,20 @@ diff --git`)}function Lp(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.star
2700
2698
  )?
2701
2699
  | \*[^\)]*\)?
2702
2700
  )?
2703
- | (?:${yS.source})+
2704
- | ${_S}
2701
+ | (?:${gS.source})+
2702
+ | ${mS}
2705
2703
  | .
2706
- `.replace(/\s+/g,``),`gsu`),xS=new RegExp(hS`
2704
+ `.replace(/\s+/g,``),`gsu`),vS=new RegExp(fS`
2707
2705
  \\ (?:
2708
- ${vS}
2706
+ ${hS}
2709
2707
  | .
2710
2708
  )
2711
2709
  | \[:(?:\^?\p{Alpha}+|\^):\]
2712
- | ${_S}
2710
+ | ${mS}
2713
2711
  | &&
2714
2712
  | .
2715
- `.replace(/\s+/g,``),`gsu`);function SS(e,t={}){let n={flags:``,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!=`string`)throw Error(`String expected as pattern`);let r=QS(n.flags),i=[r.extended],a={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(e){i.push(e)},replaceCurrentModX(e){i[i.length-1]=e},singleline:n.rules.singleline},o=[],s;for(bS.lastIndex=0;s=bS.exec(e);){let t=CS(a,e,s[0],bS.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(bS.lastIndex=t.lastIndex)}let c=[],l=0;o.filter(e=>e.type===`GroupOpen`).forEach(e=>{e.kind===`capturing`?e.number=++l:e.raw===`(`&&c.push(e)}),l||c.forEach((e,t)=>{e.kind=`capturing`,e.number=t+1});let u=l||c.length;return{tokens:o.map(e=>e.type===`EscapedNumber`?eC(e,u):e).flat(),flags:r}}function CS(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=wS(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:OS(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:HS(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:kS(n)}}if(a===`K`)return{token:IS(`keep`,n)};if(a===`N`||a===`R`)return{token:FS(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:FS(`any`,n)};if(a===`X`)return{token:FS(`text_segment`,n)};let e=ES(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:qS(n)};if(n===`(?{`)throw Error(`Unsupported callout "${n}"`);if(n.startsWith(`(?#`)){if(t[r]!==`)`)throw Error(`Unclosed comment group "(?#"`);return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:KS(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:zS(`group`,n)};if(n===`(?>`)return{token:zS(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:zS(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:zS(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:zS(`absence_repeater`,n)}}throw Error(n===`(?(`?`Unsupported conditional "${n}"`:`Invalid or unsupported group option "${n}"`)}if(n===`)`){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error(`Unmatched ")"`);return{token:RS(n)}}if(e.getCurrentModX()){if(n===`#`){let e=t.indexOf(`
2716
- `,r);return{lastIndex:e===-1?t.length:e}}if(/^\s$/.test(n)){let e=/\s+/y;return e.lastIndex=r,{lastIndex:e.exec(t)?e.lastIndex:r}}}return n===`.`?{token:FS(`dot`,n)}:n===`^`||n===`$`?{token:OS(e.singleline?{"^":hS`\A`,$:hS`\Z`}[n]:n,n)}:n===`|`?{token:DS(n)}:yS.test(n)?{tokens:tC(n)}:{token:AS(fS(n),n)}}function wS(e,t,n){let r=[PS(t[1]===`^`,t)],i=1,a;for(xS.lastIndex=n;a=xS.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(PS(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(AS(93,e));else if(i--,r.push(jS(e)),!i)break}else{let t=TS(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:xS.lastIndex||e.length}}function TS(e){if(e[0]===`\\`)return ES(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!mS.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return FS(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?MS(e):e===`&&`?NS(e):AS(fS(e),e)}function ES(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return GS(e);if(`dDhHsSwW`.includes(n))return YS(e);if(e.startsWith(hS`\o{`))throw Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw Error(`Incomplete or invalid Unicode property "${e}"`);return XS(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let t=e.split(/\\x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),r=new TextEncoder;return[...n].map(e=>{let t=[...r.encode(e)].map(e=>`\\x${e.toString(16)}`).join(``);return AS(fS(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return AS($S(e),e);if(WS.has(n))return AS(WS.get(n),e);if(/\d/.test(n))return LS(t,e);if(e===`\\`)throw Error(hS`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return AS(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function DS(e){return{type:`Alternator`,raw:e}}function OS(e,t){return{type:`Assertion`,kind:e,raw:t}}function kS(e){return{type:`Backreference`,raw:e}}function AS(e,t){return{type:`Character`,value:e,raw:t}}function jS(e){return{type:`CharacterClassClose`,raw:e}}function MS(e){return{type:`CharacterClassHyphen`,raw:e}}function NS(e){return{type:`CharacterClassIntersector`,raw:e}}function PS(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function FS(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function IS(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:gS(n.flags),raw:t}}function LS(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function RS(e){return{type:`GroupClose`,raw:e}}function zS(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function BS(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function VS(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function HS(e){return{type:`Subroutine`,raw:e}}var US=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),WS=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function GS(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return AS(fS(t.toUpperCase())-64,e)}function KS(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??=``;let i=(t.getCurrentModX()||n.includes(`x`))&&!r.includes(`x`),a=ZS(n),o=ZS(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),IS(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,zS(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function qS(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:r,args:i}=t.groups;if(!n)throw Error(`Invalid named callout "${e}"`);if(r===``)throw Error(`Named callout tag with empty value not allowed "${e}"`);let a=i?i.split(`,`).filter(e=>e!==``).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[o,s,c]=a,l=US.has(n)?n.toLowerCase():`custom`;switch(l){case`fail`:case`mismatch`:case`skip`:if(a.length>0)throw Error(`Named callout arguments not allowed "${a}"`);break;case`error`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(typeof o==`string`)throw Error(`Named callout argument must be a number "${o}"`);break;case`max`:if(!a.length||a.length>2)throw Error(`Named callout must have one or two arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(a.length===2&&(typeof s==`number`||!/^[<>X]$/.test(s)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case`count`:case`total_count`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(a.length===1&&(typeof o==`number`||!/^[<>X]$/.test(o)))throw Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case`cmp`:if(a.length!==3)throw Error(`Named callout must have three arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof s==`number`||!/^(?:[<>!=]=|[<>])$/.test(s))throw Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);if(typeof c==`string`&&!/^[A-Za-z_]\w*$/.test(c))throw Error(`Named callout argument three must be a tag or number "${c}"`);break;case`custom`:throw Error(`Undefined callout name "${n}"`);default:throw Error(`Unexpected named callout kind "${l}"`)}return BS(l,r??null,i?.split(`,`)??null,e)}function JS(e){let t=null,n,r;if(e[0]===`{`){let{minStr:i,maxStr:a}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||a&&+a>o)throw Error(`Quantifier value unsupported in Oniguruma`);if(n=+i,r=a===void 0?+i:a===``?1/0:+a,n>r&&(t=`possessive`,[n,r]=[r,n]),e.endsWith(`?`)){if(t===`possessive`)throw Error(`Unsupported possessive interval quantifier chain with "?"`);t=`lazy`}else t||=`greedy`}else n=+(e[0]===`+`),r=e[0]===`?`?1:1/0,t=e[1]===`+`?`possessive`:e[1]===`?`?`lazy`:`greedy`;return VS(t,n,r,e)}function YS(e){let t=e[1].toLowerCase();return FS({d:`digit`,h:`hex`,s:`space`,w:`word`}[t],e,{negate:e[1]!==t})}function XS(e){let{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return FS(`property`,e,{value:r,negate:t===`P`&&!n||t===`p`&&!!n})}function ZS(e){let 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 QS(e){let 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++){let r=e[n];if(!`imxDPSWy`.includes(r))throw Error(`Invalid flag "${r}"`);if(r===`y`){if(!/^y{[gw]}/.test(e.slice(n)))throw 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 $S(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw Error(`Incomplete or invalid escape "${e}"`);let t=e[2]===`{`?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function eC(e,t){let{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!==`0`&&i.length===1||i[0]!==`0`&&+i<=t))return[kS(n)];let a=[],o=i.match(/^[0-7]+|\d/g);for(let e=0;e<o.length;e++){let t=o[e],r;if(e===0&&t!==`8`&&t!==`9`){if(r=parseInt(t,8),r>127)throw Error(hS`Octal encoded byte above 177 unsupported "${n}"`)}else r=fS(t);a.push(AS(r,(e===0?`\\`:``)+t))}return a}function tC(e){let t=[],n=new RegExp(yS,`gy`),r;for(;r=n.exec(e);){let e=r[0];if(e[0]===`{`){let r=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(e);if(r){let{min:i,max:a}=r.groups;if(+i>+a&&e.endsWith(`?`)){n.lastIndex--,t.push(JS(e.slice(0,-1)));continue}}}t.push(JS(e))}return t}function nC(e,t){if(!Array.isArray(e.body))throw Error(`Expected node with body array`);if(e.body.length!==1)return!1;let n=e.body[0];return!t||Object.keys(t).every(e=>t[e]===n[e])}function rC(e){return iC.has(e.type)}var iC=new Set([`AbsenceFunction`,`Backreference`,`CapturingGroup`,`Character`,`CharacterClass`,`CharacterSet`,`Group`,`Quantifier`,`Subroutine`]);function aC(e,t={}){let n={flags:``,normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=SS(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(e,t)=>{let n=r.tokens[a.nextIndex];switch(a.parent=e,a.nextIndex++,n.type){case`Alternator`:return hC();case`Assertion`:return oC(n);case`Backreference`:return sC(n,a);case`Character`:return yC(n.value,{useLastValid:!!t.isCheckingRangeEnd});case`CharacterClassHyphen`:return cC(n,a,t);case`CharacterClassOpen`:return lC(n,a,t);case`CharacterSet`:return uC(n,a);case`Directive`:return CC(n.kind,{flags:n.flags});case`GroupOpen`:return dC(n,a,t);case`NamedCallout`:return DC(n.kind,n.tag,n.arguments);case`Quantifier`:return fC(n,a);case`Subroutine`:return pC(n,a);default:throw Error(`Unexpected token type "${n.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=AC(wC(r.flags)),s=o.body[0];for(;a.nextIndex<r.tokens.length;){let e=i(s,{});e.type===`Alternative`?(o.body.push(e),s=e):s.body.push(e)}let{capturingGroups:c,hasNumberedRef:l,namedGroupsByName:u,subroutines:d}=a;if(l&&u.size&&!n.rules.captureGroup)throw Error(`Numbered backref/subroutine not allowed when using named capture`);for(let{ref:e}of d)if(typeof e==`number`){if(e>c.length)throw Error(`Subroutine uses a group number that's not defined`);e&&(c[e-1].isSubroutined=!0)}else if(u.has(e)){if(u.get(e).length>1)throw Error(hS`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}else throw Error(hS`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function oC({kind:e}){return gC(gS({"^":`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===hS`\B`||e===hS`\Y`})}function sC({raw:e},t){let n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(n,r=!1)=>{let i=t.capturingGroups.length,a=!1;if(n>i)if(t.skipBackrefValidation)a=!0;else throw Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,_C(r?i+1-n:n,{orphan:a})};if(n){let n=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(n)return i(+n.groups.num,!!n.groups.sign);if(/[-+]/.test(r))throw Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw Error(`Group name not defined to the left "${e}"`);return _C(r)}return i(+r)}function cC(e,t,n){let{tokens:r,walk:i}=t,a=t.parent,o=a.body.at(-1),s=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!==`CharacterClass`&&o.type!==`CharacterClassRange`&&s&&s.type!==`CharacterClassOpen`&&s.type!==`CharacterClassClose`&&s.type!==`CharacterClassIntersector`){let e=i(a,{...n,isCheckingRangeEnd:!0});if(o.type===`Character`&&e.type===`Character`)return a.body.pop(),xC(o,e);throw Error(`Invalid character class range`)}return yC(fS(`-`))}function lC({negate:e},t,n){let{tokens:r,walk:i}=t,a=[bC()],o=r[t.nextIndex],s=VC(o);for(;s.type!==`CharacterClassClose`;){if(s.type===`CharacterClassIntersector`)a.push(bC()),t.nextIndex++;else{let e=a.at(-1);e.body.push(i(e,n))}s=VC(r[t.nextIndex],o)}let c=bC({negate:e});return a.length===1?c.body=a[0].body:(c.kind=`intersection`,c.body=a.map(e=>e.body.length===1?e.body[0]:e)),t.nextIndex++,c}function uC({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e===`property`){let r=BC(n);if(mS.has(r)&&!o?.has(r))e=`posix`,n=r;else return MC(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e===`posix`?OC(n,{negate:t}):SC(e,{negate:t})}function dC(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:o,walk:s}=t,c=NC(e),l=c.type===`AbsenceFunction`,u=LC(c),d=u&&c.negate;if(c.type===`CapturingGroup`&&(i.push(c),c.name&&pS(a,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw Error(`Nested absence function not supported by Oniguruma`);let f=HC(r[t.nextIndex]);for(;f.type!==`GroupClose`;){if(f.type===`Alternator`)c.body.push(hC()),t.nextIndex++;else{let e=c.body.at(-1),t=s(e,{...n,isInAbsenceFunction:n.isInAbsenceFunction||l,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(e.body.push(t),(u||n.isInLookbehind)&&!o){let e=`Lookbehind includes a pattern not allowed by Oniguruma`;if(d||n.isInNegLookbehind){if(IC(t)||t.type===`CapturingGroup`)throw Error(e)}else if(IC(t)||LC(t)&&t.negate)throw Error(e)}}f=HC(r[t.nextIndex])}return t.nextIndex++,c}function fC({kind:e,min:t,max:n},r){let i=r.parent,a=i.body.at(-1);if(!a||!rC(a))throw Error(`Quantifier requires a repeatable token`);let o=kC(e,t,n,a);return i.body.pop(),o}function pC({raw:e},t){let{capturingGroups:n,subroutines:r}=t,i=e.slice(3,-1),a=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(a){let e=+a.groups.num,r=n.length;if(t.hasNumberedRef=!0,i={"":e,"+":r+e,"-":r+1-e}[a.groups.sign],i<1)throw Error(`Invalid subroutine number`)}else i===`0`&&(i=0);let o=jC(i);return r.push(o),o}function mC(e,t){if(e!==`repeater`)throw Error(`Unexpected absence function kind "${e}"`);return{type:`AbsenceFunction`,kind:e,body:PC(t?.body)}}function hC(e){return{type:`Alternative`,body:FC(e?.body)}}function gC(e,t){let n={type:`Assertion`,kind:e};return(e===`word_boundary`||e===`text_segment_boundary`)&&(n.negate=!!t?.negate),n}function _C(e,t){let n=!!t?.orphan;return{type:`Backreference`,ref:e,...n&&{orphan:n}}}function vC(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!RC(n.name))throw Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:`CapturingGroup`,number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:PC(t?.body)}}function yC(e,t){let n={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(n.useLastValid)e=1114111;else throw Error(e>1310719?`Invalid code point out of range "\\x{${t}}"`:`Invalid code point out of range in JS "\\x{${t}}"`)}return{type:`Character`,value:e}}function bC(e){let t={kind:`union`,negate:!1,...e};return{type:`CharacterClass`,kind:t.kind,negate:t.negate,body:FC(e?.body)}}function xC(e,t){if(t.value<e.value)throw Error(`Character class range out of order`);return{type:`CharacterClassRange`,min:e,max:t}}function SC(e,t){let 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 CC(e,t={}){if(e===`keep`)return{type:`Directive`,kind:e};if(e===`flags`)return{type:`Directive`,kind:e,flags:gS(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}function wC(e){return{type:`Flags`,...e}}function TC(e){let t=e?.atomic,n=e?.flags;if(t&&n)throw Error(`Atomic group cannot have flags`);return{type:`Group`,...t&&{atomic:t},...n&&{flags:n},body:PC(e?.body)}}function EC(e){let t={behind:!1,negate:!1,...e};return{type:`LookaroundAssertion`,kind:t.behind?`lookbehind`:`lookahead`,negate:t.negate,body:PC(e?.body)}}function DC(e,t,n){return{type:`NamedCallout`,kind:e,tag:t,arguments:n}}function OC(e,t){let n=!!t?.negate;if(!mS.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:`CharacterSet`,kind:`posix`,value:e,negate:n}}function kC(e,t,n,r){if(t>n)throw Error(`Invalid reversed quantifier range`);return{type:`Quantifier`,kind:e,min:t,max:n,body:r}}function AC(e,t){return{type:`Regex`,body:PC(t?.body),flags:e}}function jC(e){return{type:`Subroutine`,ref:e}}function MC(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(BC(e));if(!r){if(n.normalizeUnknownPropertyNames)r=zC(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(hS`Invalid Unicode property "\p{${e}}"`)}return{type:`CharacterSet`,kind:`property`,value:r??e,negate:n.negate}}function NC({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case`absence_repeater`:return mC(`repeater`);case`atomic`:return TC({atomic:!0});case`capturing`:return vC(i,{name:n});case`group`:return TC({flags:e});case`lookahead`:case`lookbehind`:return EC({behind:t===`lookbehind`,negate:r});default:throw Error(`Unexpected group kind "${t}"`)}}function PC(e){if(e===void 0)e=[hC()];else if(!Array.isArray(e)||!e.length||!e.every(e=>e.type===`Alternative`))throw Error(`Invalid body; expected array of one or more Alternative nodes`);return e}function FC(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(e=>!!e.type))throw Error(`Invalid body; expected array of nodes`);return e}function IC(e){return e.type===`LookaroundAssertion`&&e.kind===`lookahead`}function LC(e){return e.type===`LookaroundAssertion`&&e.kind===`lookbehind`}function RC(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function zC(e){return e.trim().replace(/[- _]+/g,`_`).replace(/[A-Z][a-z]+(?=[A-Z])/g,`$&_`).replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function BC(e){return e.replace(/[- _]+/g,``).toLowerCase()}function VC(e,t){let n=t;return gS(e,`Unclosed character class${n?.type===`Character`&&n.value===93&&n.raw===`]`?` (started with "]")`:``}`)}function HC(e){return gS(e,`Unclosed group`)}function UC(e,t,n=null){function r(e,t){for(let n=0;n<e.length;n++){let r=i(e[n],t,n,e);n=Math.max(-1,n+r)}}function i(a,o=null,s=null,c=null){let l=0,u=!1,d={node:a,parent:o,key:s,container:c,root:e,remove(){WC(c).splice(Math.max(0,GC(s)+l),1),l--,u=!0},removeAllNextSiblings(){return WC(c).splice(GC(s)+1)},removeAllPrevSiblings(){let e=GC(s)+l;return l-=e,WC(c).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;c?c[Math.max(0,GC(s)+l)]=e:gS(o,`Can't replace root node`)[s]=e,n&&i(e,o,s,c),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(WC(c).splice(Math.max(0,GC(s)+l),1,...e),l+=e.length-1,n){let t=0;for(let n=0;n<e.length;n++)t+=i(e[n],o,GC(s)+n+t,c)}u=!0},skip(){u=!0}},{type:f}=a,p=t[`*`],m=t[f],h=typeof p==`function`?p:p?.enter,g=typeof m==`function`?m:m?.enter;if(h?.(d,n),g?.(d,n),!u)switch(f){case`AbsenceFunction`:case`Alternative`:case`CapturingGroup`:case`CharacterClass`:case`Group`:case`LookaroundAssertion`:r(a.body,a);break;case`Assertion`:case`Backreference`:case`Character`:case`CharacterSet`:case`Directive`:case`Flags`:case`NamedCallout`:case`Subroutine`:break;case`CharacterClassRange`:i(a.min,a,`min`),i(a.max,a,`max`);break;case`Quantifier`:i(a.body,a,`body`);break;case`Regex`:r(a.body,a),i(a.flags,a,`flags`);break;default:throw Error(`Unexpected node type "${f}"`)}return m?.exit?.(d,n),p?.exit?.(d,n),l}return i(e),e}function WC(e){if(!Array.isArray(e))throw Error(`Container expected`);return e}function GC(e){if(typeof e!=`number`)throw Error(`Numeric key expected`);return e}var KC=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function qC(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function JC(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var YC=Object.freeze({DEFAULT:`DEFAULT`,CHAR_CLASS:`CHAR_CLASS`});function XC(e,t,n,r){let i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,`gsu`),a=[!1],o=0,s=``;for(let t of e.matchAll(i)){let{0:e,groups:{$skip:i}}=t;if(!i&&(!r||r===YC.DEFAULT==!o)){n instanceof Function?s+=n(t,{context:o?YC.CHAR_CLASS:YC.DEFAULT,negated:a[a.length-1]}):s+=n;continue}e[0]===`[`?(o++,a.push(e[1]===`^`)):e===`]`&&o&&(o--,a.pop()),s+=e}return s}function ZC(e,t,n,r){XC(e,t,n,r)}function QC(e,t,n=0,r){if(!new RegExp(t,`su`).test(e))return null;let i=RegExp(`${t}|(?<$skip>\\\\?.)`,`gsu`);i.lastIndex=n;let a=0,o;for(;o=i.exec(e);){let{0:e,groups:{$skip:t}}=o;if(!t&&(!r||r===YC.DEFAULT==!a))return o;e===`[`?a++:e===`]`&&a&&a--,i.lastIndex==o.index&&i.lastIndex++}return null}function $C(e,t,n){return!!QC(e,t,0,n)}function ew(e,t){let n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,a=1,o;for(;o=n.exec(e);){let[e]=o;if(e===`[`)i++;else if(i)e===`]`&&i--;else if(e===`(`)a++;else if(e===`)`&&(a--,!a)){r=o.index;break}}return e.slice(t,r)}var tw=new RegExp(String.raw`(?<noncapturingStart>${KC})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,`gsu`);function nw(e,t){let n=t?.hiddenCaptures??[],r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};let i=[0],a=[],o=0,s=0,c=NaN,l;do{l=!1;let t=0,u=0,d=!1,f;for(tw.lastIndex=Number.isNaN(c)?0:c+7;f=tw.exec(e);){let{0:p,index:m,groups:{capturingStart:h,noncapturingStart:g}}=f;if(p===`[`)t++;else if(t)p===`]`&&t--;else if(p===`(?>`&&!d)c=m,d=!0;else if(d&&g)u++;else if(h)d?u++:(o++,i.push(o+s));else if(p===`)`&&d){if(!u){s++;let t=o+s;if(e=`${e.slice(0,c)}(?:(?=(${e.slice(c+3,m)}))<$$${t}>)${e.slice(m+1)}`,l=!0,a.push(t),qC(n,t),r.size){let e=new Map;r.forEach((n,r)=>{e.set(r>=t?r+1:r,n.map(e=>e>=t?e+1:e))}),r=e}break}u--}}}while(l);return n.push(...a),e=XC(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:e,groups:{backrefNum:t,wrappedBackrefNum:n}})=>{if(t){let n=+t;if(n>i.length-1)throw Error(`Backref "${e}" greater than number of captures`);return`\\${i[n]}`}return`\\${n}`},YC.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}var rw=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,iw=new RegExp(String.raw`
2713
+ `.replace(/\s+/g,``),`gsu`);function yS(e,t={}){let n={flags:``,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!=`string`)throw Error(`String expected as pattern`);let r=YS(n.flags),i=[r.extended],a={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(e){i.push(e)},replaceCurrentModX(e){i[i.length-1]=e},singleline:n.rules.singleline},o=[],s;for(_S.lastIndex=0;s=_S.exec(e);){let t=bS(a,e,s[0],_S.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(_S.lastIndex=t.lastIndex)}let c=[],l=0;o.filter(e=>e.type===`GroupOpen`).forEach(e=>{e.kind===`capturing`?e.number=++l:e.raw===`(`&&c.push(e)}),l||c.forEach((e,t)=>{e.kind=`capturing`,e.number=t+1});let u=l||c.length;return{tokens:o.map(e=>e.type===`EscapedNumber`?ZS(e,u):e).flat(),flags:r}}function bS(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=xS(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:TS(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:zS(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:ES(n)}}if(a===`K`)return{token:NS(`keep`,n)};if(a===`N`||a===`R`)return{token:MS(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:MS(`any`,n)};if(a===`X`)return{token:MS(`text_segment`,n)};let e=CS(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:WS(n)};if(n===`(?{`)throw Error(`Unsupported callout "${n}"`);if(n.startsWith(`(?#`)){if(t[r]!==`)`)throw Error(`Unclosed comment group "(?#"`);return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:US(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:IS(`group`,n)};if(n===`(?>`)return{token:IS(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:IS(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:IS(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:IS(`absence_repeater`,n)}}throw Error(n===`(?(`?`Unsupported conditional "${n}"`:`Invalid or unsupported group option "${n}"`)}if(n===`)`){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error(`Unmatched ")"`);return{token:FS(n)}}if(e.getCurrentModX()){if(n===`#`){let e=t.indexOf(`
2714
+ `,r);return{lastIndex:e===-1?t.length:e}}if(/^\s$/.test(n)){let e=/\s+/y;return e.lastIndex=r,{lastIndex:e.exec(t)?e.lastIndex:r}}}return n===`.`?{token:MS(`dot`,n)}:n===`^`||n===`$`?{token:TS(e.singleline?{"^":fS`\A`,$:fS`\Z`}[n]:n,n)}:n===`|`?{token:wS(n)}:gS.test(n)?{tokens:QS(n)}:{token:DS(lS(n),n)}}function xS(e,t,n){let r=[jS(t[1]===`^`,t)],i=1,a;for(vS.lastIndex=n;a=vS.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(jS(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(DS(93,e));else if(i--,r.push(OS(e)),!i)break}else{let t=SS(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:vS.lastIndex||e.length}}function SS(e){if(e[0]===`\\`)return CS(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!dS.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return MS(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?kS(e):e===`&&`?AS(e):DS(lS(e),e)}function CS(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return HS(e);if(`dDhHsSwW`.includes(n))return KS(e);if(e.startsWith(fS`\o{`))throw Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw Error(`Incomplete or invalid Unicode property "${e}"`);return qS(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let t=e.split(/\\x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),r=new TextEncoder;return[...n].map(e=>{let t=[...r.encode(e)].map(e=>`\\x${e.toString(16)}`).join(``);return DS(lS(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return DS(XS(e),e);if(VS.has(n))return DS(VS.get(n),e);if(/\d/.test(n))return PS(t,e);if(e===`\\`)throw Error(fS`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return DS(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function wS(e){return{type:`Alternator`,raw:e}}function TS(e,t){return{type:`Assertion`,kind:e,raw:t}}function ES(e){return{type:`Backreference`,raw:e}}function DS(e,t){return{type:`Character`,value:e,raw:t}}function OS(e){return{type:`CharacterClassClose`,raw:e}}function kS(e){return{type:`CharacterClassHyphen`,raw:e}}function AS(e){return{type:`CharacterClassIntersector`,raw:e}}function jS(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function MS(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function NS(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:pS(n.flags),raw:t}}function PS(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function FS(e){return{type:`GroupClose`,raw:e}}function IS(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function LS(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function RS(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function zS(e){return{type:`Subroutine`,raw:e}}var BS=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),VS=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function HS(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return DS(lS(t.toUpperCase())-64,e)}function US(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??=``;let i=(t.getCurrentModX()||n.includes(`x`))&&!r.includes(`x`),a=JS(n),o=JS(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),NS(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,IS(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function WS(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:r,args:i}=t.groups;if(!n)throw Error(`Invalid named callout "${e}"`);if(r===``)throw Error(`Named callout tag with empty value not allowed "${e}"`);let a=i?i.split(`,`).filter(e=>e!==``).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[o,s,c]=a,l=BS.has(n)?n.toLowerCase():`custom`;switch(l){case`fail`:case`mismatch`:case`skip`:if(a.length>0)throw Error(`Named callout arguments not allowed "${a}"`);break;case`error`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(typeof o==`string`)throw Error(`Named callout argument must be a number "${o}"`);break;case`max`:if(!a.length||a.length>2)throw Error(`Named callout must have one or two arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(a.length===2&&(typeof s==`number`||!/^[<>X]$/.test(s)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case`count`:case`total_count`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(a.length===1&&(typeof o==`number`||!/^[<>X]$/.test(o)))throw Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case`cmp`:if(a.length!==3)throw Error(`Named callout must have three arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof s==`number`||!/^(?:[<>!=]=|[<>])$/.test(s))throw Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);if(typeof c==`string`&&!/^[A-Za-z_]\w*$/.test(c))throw Error(`Named callout argument three must be a tag or number "${c}"`);break;case`custom`:throw Error(`Undefined callout name "${n}"`);default:throw Error(`Unexpected named callout kind "${l}"`)}return LS(l,r??null,i?.split(`,`)??null,e)}function GS(e){let t=null,n,r;if(e[0]===`{`){let{minStr:i,maxStr:a}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||a&&+a>o)throw Error(`Quantifier value unsupported in Oniguruma`);if(n=+i,r=a===void 0?+i:a===``?1/0:+a,n>r&&(t=`possessive`,[n,r]=[r,n]),e.endsWith(`?`)){if(t===`possessive`)throw Error(`Unsupported possessive interval quantifier chain with "?"`);t=`lazy`}else t||=`greedy`}else n=+(e[0]===`+`),r=e[0]===`?`?1:1/0,t=e[1]===`+`?`possessive`:e[1]===`?`?`lazy`:`greedy`;return RS(t,n,r,e)}function KS(e){let t=e[1].toLowerCase();return MS({d:`digit`,h:`hex`,s:`space`,w:`word`}[t],e,{negate:e[1]!==t})}function qS(e){let{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return MS(`property`,e,{value:r,negate:t===`P`&&!n||t===`p`&&!!n})}function JS(e){let 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 YS(e){let 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++){let r=e[n];if(!`imxDPSWy`.includes(r))throw Error(`Invalid flag "${r}"`);if(r===`y`){if(!/^y{[gw]}/.test(e.slice(n)))throw 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 XS(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw Error(`Incomplete or invalid escape "${e}"`);let t=e[2]===`{`?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function ZS(e,t){let{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!==`0`&&i.length===1||i[0]!==`0`&&+i<=t))return[ES(n)];let a=[],o=i.match(/^[0-7]+|\d/g);for(let e=0;e<o.length;e++){let t=o[e],r;if(e===0&&t!==`8`&&t!==`9`){if(r=parseInt(t,8),r>127)throw Error(fS`Octal encoded byte above 177 unsupported "${n}"`)}else r=lS(t);a.push(DS(r,(e===0?`\\`:``)+t))}return a}function QS(e){let t=[],n=new RegExp(gS,`gy`),r;for(;r=n.exec(e);){let e=r[0];if(e[0]===`{`){let r=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(e);if(r){let{min:i,max:a}=r.groups;if(+i>+a&&e.endsWith(`?`)){n.lastIndex--,t.push(GS(e.slice(0,-1)));continue}}}t.push(GS(e))}return t}function $S(e,t){if(!Array.isArray(e.body))throw Error(`Expected node with body array`);if(e.body.length!==1)return!1;let n=e.body[0];return!t||Object.keys(t).every(e=>t[e]===n[e])}function eC(e){return tC.has(e.type)}var tC=new Set([`AbsenceFunction`,`Backreference`,`CapturingGroup`,`Character`,`CharacterClass`,`CharacterSet`,`Group`,`Quantifier`,`Subroutine`]);function nC(e,t={}){let n={flags:``,normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=yS(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(e,t)=>{let n=r.tokens[a.nextIndex];switch(a.parent=e,a.nextIndex++,n.type){case`Alternator`:return fC();case`Assertion`:return rC(n);case`Backreference`:return iC(n,a);case`Character`:return gC(n.value,{useLastValid:!!t.isCheckingRangeEnd});case`CharacterClassHyphen`:return aC(n,a,t);case`CharacterClassOpen`:return oC(n,a,t);case`CharacterSet`:return sC(n,a);case`Directive`:return bC(n.kind,{flags:n.flags});case`GroupOpen`:return cC(n,a,t);case`NamedCallout`:return wC(n.kind,n.tag,n.arguments);case`Quantifier`:return lC(n,a);case`Subroutine`:return uC(n,a);default:throw Error(`Unexpected token type "${n.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=DC(xC(r.flags)),s=o.body[0];for(;a.nextIndex<r.tokens.length;){let e=i(s,{});e.type===`Alternative`?(o.body.push(e),s=e):s.body.push(e)}let{capturingGroups:c,hasNumberedRef:l,namedGroupsByName:u,subroutines:d}=a;if(l&&u.size&&!n.rules.captureGroup)throw Error(`Numbered backref/subroutine not allowed when using named capture`);for(let{ref:e}of d)if(typeof e==`number`){if(e>c.length)throw Error(`Subroutine uses a group number that's not defined`);e&&(c[e-1].isSubroutined=!0)}else if(u.has(e)){if(u.get(e).length>1)throw Error(fS`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}else throw Error(fS`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function rC({kind:e}){return pC(pS({"^":`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===fS`\B`||e===fS`\Y`})}function iC({raw:e},t){let n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(n,r=!1)=>{let i=t.capturingGroups.length,a=!1;if(n>i)if(t.skipBackrefValidation)a=!0;else throw Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,mC(r?i+1-n:n,{orphan:a})};if(n){let n=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(n)return i(+n.groups.num,!!n.groups.sign);if(/[-+]/.test(r))throw Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw Error(`Group name not defined to the left "${e}"`);return mC(r)}return i(+r)}function aC(e,t,n){let{tokens:r,walk:i}=t,a=t.parent,o=a.body.at(-1),s=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!==`CharacterClass`&&o.type!==`CharacterClassRange`&&s&&s.type!==`CharacterClassOpen`&&s.type!==`CharacterClassClose`&&s.type!==`CharacterClassIntersector`){let e=i(a,{...n,isCheckingRangeEnd:!0});if(o.type===`Character`&&e.type===`Character`)return a.body.pop(),vC(o,e);throw Error(`Invalid character class range`)}return gC(lS(`-`))}function oC({negate:e},t,n){let{tokens:r,walk:i}=t,a=[_C()],o=r[t.nextIndex],s=RC(o);for(;s.type!==`CharacterClassClose`;){if(s.type===`CharacterClassIntersector`)a.push(_C()),t.nextIndex++;else{let e=a.at(-1);e.body.push(i(e,n))}s=RC(r[t.nextIndex],o)}let c=_C({negate:e});return a.length===1?c.body=a[0].body:(c.kind=`intersection`,c.body=a.map(e=>e.body.length===1?e.body[0]:e)),t.nextIndex++,c}function sC({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e===`property`){let r=LC(n);if(dS.has(r)&&!o?.has(r))e=`posix`,n=r;else return kC(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e===`posix`?TC(n,{negate:t}):yC(e,{negate:t})}function cC(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:o,walk:s}=t,c=AC(e),l=c.type===`AbsenceFunction`,u=PC(c),d=u&&c.negate;if(c.type===`CapturingGroup`&&(i.push(c),c.name&&uS(a,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw Error(`Nested absence function not supported by Oniguruma`);let f=zC(r[t.nextIndex]);for(;f.type!==`GroupClose`;){if(f.type===`Alternator`)c.body.push(fC()),t.nextIndex++;else{let e=c.body.at(-1),t=s(e,{...n,isInAbsenceFunction:n.isInAbsenceFunction||l,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(e.body.push(t),(u||n.isInLookbehind)&&!o){let e=`Lookbehind includes a pattern not allowed by Oniguruma`;if(d||n.isInNegLookbehind){if(NC(t)||t.type===`CapturingGroup`)throw Error(e)}else if(NC(t)||PC(t)&&t.negate)throw Error(e)}}f=zC(r[t.nextIndex])}return t.nextIndex++,c}function lC({kind:e,min:t,max:n},r){let i=r.parent,a=i.body.at(-1);if(!a||!eC(a))throw Error(`Quantifier requires a repeatable token`);let o=EC(e,t,n,a);return i.body.pop(),o}function uC({raw:e},t){let{capturingGroups:n,subroutines:r}=t,i=e.slice(3,-1),a=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(a){let e=+a.groups.num,r=n.length;if(t.hasNumberedRef=!0,i={"":e,"+":r+e,"-":r+1-e}[a.groups.sign],i<1)throw Error(`Invalid subroutine number`)}else i===`0`&&(i=0);let o=OC(i);return r.push(o),o}function dC(e,t){if(e!==`repeater`)throw Error(`Unexpected absence function kind "${e}"`);return{type:`AbsenceFunction`,kind:e,body:jC(t?.body)}}function fC(e){return{type:`Alternative`,body:MC(e?.body)}}function pC(e,t){let n={type:`Assertion`,kind:e};return(e===`word_boundary`||e===`text_segment_boundary`)&&(n.negate=!!t?.negate),n}function mC(e,t){let n=!!t?.orphan;return{type:`Backreference`,ref:e,...n&&{orphan:n}}}function hC(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!FC(n.name))throw Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:`CapturingGroup`,number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:jC(t?.body)}}function gC(e,t){let n={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(n.useLastValid)e=1114111;else throw Error(e>1310719?`Invalid code point out of range "\\x{${t}}"`:`Invalid code point out of range in JS "\\x{${t}}"`)}return{type:`Character`,value:e}}function _C(e){let t={kind:`union`,negate:!1,...e};return{type:`CharacterClass`,kind:t.kind,negate:t.negate,body:MC(e?.body)}}function vC(e,t){if(t.value<e.value)throw Error(`Character class range out of order`);return{type:`CharacterClassRange`,min:e,max:t}}function yC(e,t){let 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 bC(e,t={}){if(e===`keep`)return{type:`Directive`,kind:e};if(e===`flags`)return{type:`Directive`,kind:e,flags:pS(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}function xC(e){return{type:`Flags`,...e}}function SC(e){let t=e?.atomic,n=e?.flags;if(t&&n)throw Error(`Atomic group cannot have flags`);return{type:`Group`,...t&&{atomic:t},...n&&{flags:n},body:jC(e?.body)}}function CC(e){let t={behind:!1,negate:!1,...e};return{type:`LookaroundAssertion`,kind:t.behind?`lookbehind`:`lookahead`,negate:t.negate,body:jC(e?.body)}}function wC(e,t,n){return{type:`NamedCallout`,kind:e,tag:t,arguments:n}}function TC(e,t){let n=!!t?.negate;if(!dS.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:`CharacterSet`,kind:`posix`,value:e,negate:n}}function EC(e,t,n,r){if(t>n)throw Error(`Invalid reversed quantifier range`);return{type:`Quantifier`,kind:e,min:t,max:n,body:r}}function DC(e,t){return{type:`Regex`,body:jC(t?.body),flags:e}}function OC(e){return{type:`Subroutine`,ref:e}}function kC(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(LC(e));if(!r){if(n.normalizeUnknownPropertyNames)r=IC(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(fS`Invalid Unicode property "\p{${e}}"`)}return{type:`CharacterSet`,kind:`property`,value:r??e,negate:n.negate}}function AC({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case`absence_repeater`:return dC(`repeater`);case`atomic`:return SC({atomic:!0});case`capturing`:return hC(i,{name:n});case`group`:return SC({flags:e});case`lookahead`:case`lookbehind`:return CC({behind:t===`lookbehind`,negate:r});default:throw Error(`Unexpected group kind "${t}"`)}}function jC(e){if(e===void 0)e=[fC()];else if(!Array.isArray(e)||!e.length||!e.every(e=>e.type===`Alternative`))throw Error(`Invalid body; expected array of one or more Alternative nodes`);return e}function MC(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(e=>!!e.type))throw Error(`Invalid body; expected array of nodes`);return e}function NC(e){return e.type===`LookaroundAssertion`&&e.kind===`lookahead`}function PC(e){return e.type===`LookaroundAssertion`&&e.kind===`lookbehind`}function FC(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function IC(e){return e.trim().replace(/[- _]+/g,`_`).replace(/[A-Z][a-z]+(?=[A-Z])/g,`$&_`).replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function LC(e){return e.replace(/[- _]+/g,``).toLowerCase()}function RC(e,t){let n=t;return pS(e,`Unclosed character class${n?.type===`Character`&&n.value===93&&n.raw===`]`?` (started with "]")`:``}`)}function zC(e){return pS(e,`Unclosed group`)}function BC(e,t,n=null){function r(e,t){for(let n=0;n<e.length;n++){let r=i(e[n],t,n,e);n=Math.max(-1,n+r)}}function i(a,o=null,s=null,c=null){let l=0,u=!1,d={node:a,parent:o,key:s,container:c,root:e,remove(){VC(c).splice(Math.max(0,HC(s)+l),1),l--,u=!0},removeAllNextSiblings(){return VC(c).splice(HC(s)+1)},removeAllPrevSiblings(){let e=HC(s)+l;return l-=e,VC(c).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;c?c[Math.max(0,HC(s)+l)]=e:pS(o,`Can't replace root node`)[s]=e,n&&i(e,o,s,c),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(VC(c).splice(Math.max(0,HC(s)+l),1,...e),l+=e.length-1,n){let t=0;for(let n=0;n<e.length;n++)t+=i(e[n],o,HC(s)+n+t,c)}u=!0},skip(){u=!0}},{type:f}=a,p=t[`*`],m=t[f],h=typeof p==`function`?p:p?.enter,g=typeof m==`function`?m:m?.enter;if(h?.(d,n),g?.(d,n),!u)switch(f){case`AbsenceFunction`:case`Alternative`:case`CapturingGroup`:case`CharacterClass`:case`Group`:case`LookaroundAssertion`:r(a.body,a);break;case`Assertion`:case`Backreference`:case`Character`:case`CharacterSet`:case`Directive`:case`Flags`:case`NamedCallout`:case`Subroutine`:break;case`CharacterClassRange`:i(a.min,a,`min`),i(a.max,a,`max`);break;case`Quantifier`:i(a.body,a,`body`);break;case`Regex`:r(a.body,a),i(a.flags,a,`flags`);break;default:throw Error(`Unexpected node type "${f}"`)}return m?.exit?.(d,n),p?.exit?.(d,n),l}return i(e),e}function VC(e){if(!Array.isArray(e))throw Error(`Container expected`);return e}function HC(e){if(typeof e!=`number`)throw Error(`Numeric key expected`);return e}var UC=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function WC(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function GC(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var KC=Object.freeze({DEFAULT:`DEFAULT`,CHAR_CLASS:`CHAR_CLASS`});function qC(e,t,n,r){let i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,`gsu`),a=[!1],o=0,s=``;for(let t of e.matchAll(i)){let{0:e,groups:{$skip:i}}=t;if(!i&&(!r||r===KC.DEFAULT==!o)){n instanceof Function?s+=n(t,{context:o?KC.CHAR_CLASS:KC.DEFAULT,negated:a[a.length-1]}):s+=n;continue}e[0]===`[`?(o++,a.push(e[1]===`^`)):e===`]`&&o&&(o--,a.pop()),s+=e}return s}function JC(e,t,n,r){qC(e,t,n,r)}function YC(e,t,n=0,r){if(!new RegExp(t,`su`).test(e))return null;let i=RegExp(`${t}|(?<$skip>\\\\?.)`,`gsu`);i.lastIndex=n;let a=0,o;for(;o=i.exec(e);){let{0:e,groups:{$skip:t}}=o;if(!t&&(!r||r===KC.DEFAULT==!a))return o;e===`[`?a++:e===`]`&&a&&a--,i.lastIndex==o.index&&i.lastIndex++}return null}function XC(e,t,n){return!!YC(e,t,0,n)}function ZC(e,t){let n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,a=1,o;for(;o=n.exec(e);){let[e]=o;if(e===`[`)i++;else if(i)e===`]`&&i--;else if(e===`(`)a++;else if(e===`)`&&(a--,!a)){r=o.index;break}}return e.slice(t,r)}var QC=new RegExp(String.raw`(?<noncapturingStart>${UC})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,`gsu`);function $C(e,t){let n=t?.hiddenCaptures??[],r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};let i=[0],a=[],o=0,s=0,c=NaN,l;do{l=!1;let t=0,u=0,d=!1,f;for(QC.lastIndex=Number.isNaN(c)?0:c+7;f=QC.exec(e);){let{0:p,index:m,groups:{capturingStart:h,noncapturingStart:g}}=f;if(p===`[`)t++;else if(t)p===`]`&&t--;else if(p===`(?>`&&!d)c=m,d=!0;else if(d&&g)u++;else if(h)d?u++:(o++,i.push(o+s));else if(p===`)`&&d){if(!u){s++;let t=o+s;if(e=`${e.slice(0,c)}(?:(?=(${e.slice(c+3,m)}))<$$${t}>)${e.slice(m+1)}`,l=!0,a.push(t),WC(n,t),r.size){let e=new Map;r.forEach((n,r)=>{e.set(r>=t?r+1:r,n.map(e=>e>=t?e+1:e))}),r=e}break}u--}}}while(l);return n.push(...a),e=qC(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:e,groups:{backrefNum:t,wrappedBackrefNum:n}})=>{if(t){let n=+t;if(n>i.length-1)throw Error(`Backref "${e}" greater than number of captures`);return`\\${i[n]}`}return`\\${n}`},KC.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}var ew=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,tw=new RegExp(String.raw`
2717
2715
  \\(?: \d+
2718
2716
  | c[A-Za-z]
2719
2717
  | [gk]<[^>]+>
@@ -2726,9 +2724,9 @@ diff --git`)}function Lp(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.star
2726
2724
  | [A-Za-z\-]+:
2727
2725
  | \(DEFINE\)
2728
2726
  ))?
2729
- | (?<qBase>${rw})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
2727
+ | (?<qBase>${ew})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
2730
2728
  | \\?.
2731
- `.replace(/\s+/g,``),`gsu`);function aw(e){if(!RegExp(`${rw}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,i=``,a=0,o;for(iw.lastIndex=0;o=iw.exec(e);){let{0:s,index:c,groups:{qBase:l,qMod:u,invalidQ:d}}=o;if(s===`[`)a||(r=c),a++;else if(s===`]`)a?a--:r=null;else if(!a)if(u===`+`&&i&&!i.startsWith(`(`)){if(d)throw Error(`Invalid quantifier "${s}"`);let t=-1;if(/^\{\d+\}$/.test(l))e=JC(e,c+l.length,u,``);else{if(i===`)`||i===`]`){let t=i===`)`?n:r;if(t===null)throw Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,t)}(?>${e.slice(t,c)}${l})${e.slice(c+s.length)}`}else e=`${e.slice(0,c-i.length)}(?>${i}${l})${e.slice(c+s.length)}`;t+=4}iw.lastIndex+=t}else s[0]===`(`?t.push(c):s===`)`&&(n=t.length?t.pop():null);i=s}return{pattern:e}}var ow=String.raw,sw=ow`\(\?R=(?<rDepth>[^\)]+)\)|${ow`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`}`,cw=ow`\(\?<(?![=!])(?<captureName>[^>]+)>`,lw=ow`${cw}|(?<unnamed>\()(?!\?)`,uw=new RegExp(ow`${cw}|${sw}|\(\?|\\?.`,`gsu`),dw=`Cannot use multiple overlapping recursions`;function fw(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:`plugin`,...t},i=t?.captureTransfers??new Map;if(!new RegExp(sw,`su`).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r===`plugin`&&$C(e,ow`\(\?\(DEFINE\)`,YC.DEFAULT))throw Error(`DEFINE groups cannot be used with recursion`);let a=[],o=$C(e,ow`\\[1-9]`,YC.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for(uw.lastIndex=0;f=uw.exec(e);){let{0:t,groups:{captureName:p,rDepth:m,gRNameOrNum:h,gRDepth:g}}=f;if(t===`[`)u++;else if(u)t===`]`&&u--;else if(m){if(pw(m),l)throw Error(dw);if(o)throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with global recursion`);let t=e.slice(0,f.index),s=e.slice(uw.lastIndex);if($C(s,sw,YC.DEFAULT))throw Error(dw);let c=m-1;e=mw(t,s,c,!1,n,a,d),i=_w(i,t,c,a.length,0,d);break}else if(h){pw(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(dw);break}if(!u)throw Error(ow`Recursive \g cannot be used outside the referenced group "${r===`external`?h:ow`\g<${h}&R=${g}>`}"`);let p=s.get(h),m=ew(e,p);if(o&&$C(m,ow`${cw}|\((?!\?)`,YC.DEFAULT))throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with recursion of capturing groups`);let _=e.slice(p,f.index),v=m.slice(_.length+t.length),y=a.length,b=g-1,x=mw(_,v,b,!0,n,a,d);i=_w(i,_,b,a.length-y,y,d),e=`${e.slice(0,p)}${x}${e.slice(p+m.length)}`,uw.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),uw.lastIndex),s.set(p,uw.lastIndex),c.push({num:d,name:p});else if(t[0]===`(`){let e=t===`(`;e&&(d++,s.set(String(d),uw.lastIndex)),c.push(e?{num:d}:{})}else t===`)`&&c.pop()}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function pw(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e)||(e=+e,e<2||e>100))throw Error(t)}function mw(e,t,n,r,i,a,o){let s=new Set;r&&ZC(e+t,cw,({groups:{captureName:e}})=>{s.add(e)},YC.DEFAULT);let c=[n,r?s:null,i,a,o];return`${e}${hw(`(?:${e}`,`forward`,...c)}(?:)${hw(`${t})`,`backward`,...c)}${t}`}function hw(e,t,n,r,i,a,o){let s=e=>t===`forward`?e+2:n-e+2-1,c=``;for(let t=0;t<n;t++){let n=s(t);c+=XC(e,ow`${lw}|\\k<(?<backref>[^>]+)>`,({0:e,groups:{captureName:t,unnamed:s,backref:c}})=>{if(c&&r&&!r.has(c))return e;let l=`_$${n}`;if(s||t){let n=o+a.length+1;return a.push(n),gw(i,n),s?e:`(?<${t}${l}>`}return ow`\k<${c}${l}>`},YC.DEFAULT)}return c}function gw(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function _w(e,t,n,r,i,a){if(e.size&&r){let o=0;ZC(t,lw,()=>o++,YC.DEFAULT);let s=a-o+i,c=new Map;return e.forEach((e,t)=>{let i=(r-o*n)/n,a=o*n,l=t>s+o?t+r:t,u=[];for(let t of e)if(t<=s)u.push(t);else if(t>s+o+i)u.push(t+r);else if(t<=s+o)for(let e=0;e<=n;e++)u.push(t+o*e);else for(let e=0;e<=n;e++)u.push(t+a+i*e);c.set(l,u)}),c}return e}var vw=String.fromCodePoint,$=String.raw,yw={},bw=globalThis.RegExp;yw.flagGroups=(()=>{try{new bw(`(?i:)`)}catch{return!1}return!0})(),yw.unicodeSets=(()=>{try{new bw(`[[]]`,`v`)}catch{return!1}return!0})(),yw.bugFlagVLiteralHyphenIsRange=yw.unicodeSets?(()=>{try{new bw($`[\d\-a]`,`v`)}catch{return!0}return!1})():!1,yw.bugNestedClassIgnoresNegation=yw.unicodeSets&&new bw(`[[^a]]`,`v`).test(`a`);function xw(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function Sw(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Cw(e,t){return Tw[e]>=Tw[t]}function ww(e,t){if(e==null)throw Error(t??`Value expected`);return e}var Tw={ES2025:2025,ES2024:2024,ES2018:2018},Ew={auto:`auto`,ES2025:`ES2025`,ES2024:`ES2024`,ES2018:`ES2018`};function Dw(e={}){if({}.toString.call(e)!==`[object Object]`)throw Error(`Unexpected options`);if(e.target!==void 0&&!Ew[e.target])throw Error(`Unexpected target "${e.target}"`);let 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=yw.flagGroups?`ES2025`:yw.unicodeSets?`ES2024`:`ES2018`),t}var Ow=`[ -\r ]`,kw=new Set([vw(304),vw(305)]),Aw=$`[\p{L}\p{M}\p{N}\p{Pc}]`;function jw(e){if(kw.has(e))return[e];let t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=Fw.get(n),a=Nw.get(n),o=Pw.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),a&&t.add(a),[...t]}var Mw=new Map(`C Other
2729
+ `.replace(/\s+/g,``),`gsu`);function nw(e){if(!RegExp(`${ew}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,i=``,a=0,o;for(tw.lastIndex=0;o=tw.exec(e);){let{0:s,index:c,groups:{qBase:l,qMod:u,invalidQ:d}}=o;if(s===`[`)a||(r=c),a++;else if(s===`]`)a?a--:r=null;else if(!a)if(u===`+`&&i&&!i.startsWith(`(`)){if(d)throw Error(`Invalid quantifier "${s}"`);let t=-1;if(/^\{\d+\}$/.test(l))e=GC(e,c+l.length,u,``);else{if(i===`)`||i===`]`){let t=i===`)`?n:r;if(t===null)throw Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,t)}(?>${e.slice(t,c)}${l})${e.slice(c+s.length)}`}else e=`${e.slice(0,c-i.length)}(?>${i}${l})${e.slice(c+s.length)}`;t+=4}tw.lastIndex+=t}else s[0]===`(`?t.push(c):s===`)`&&(n=t.length?t.pop():null);i=s}return{pattern:e}}var rw=String.raw,iw=rw`\(\?R=(?<rDepth>[^\)]+)\)|${rw`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`}`,aw=rw`\(\?<(?![=!])(?<captureName>[^>]+)>`,ow=rw`${aw}|(?<unnamed>\()(?!\?)`,sw=new RegExp(rw`${aw}|${iw}|\(\?|\\?.`,`gsu`),cw=`Cannot use multiple overlapping recursions`;function lw(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:`plugin`,...t},i=t?.captureTransfers??new Map;if(!new RegExp(iw,`su`).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r===`plugin`&&XC(e,rw`\(\?\(DEFINE\)`,KC.DEFAULT))throw Error(`DEFINE groups cannot be used with recursion`);let a=[],o=XC(e,rw`\\[1-9]`,KC.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for(sw.lastIndex=0;f=sw.exec(e);){let{0:t,groups:{captureName:p,rDepth:m,gRNameOrNum:h,gRDepth:g}}=f;if(t===`[`)u++;else if(u)t===`]`&&u--;else if(m){if(uw(m),l)throw Error(cw);if(o)throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with global recursion`);let t=e.slice(0,f.index),s=e.slice(sw.lastIndex);if(XC(s,iw,KC.DEFAULT))throw Error(cw);let c=m-1;e=dw(t,s,c,!1,n,a,d),i=mw(i,t,c,a.length,0,d);break}else if(h){uw(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(cw);break}if(!u)throw Error(rw`Recursive \g cannot be used outside the referenced group "${r===`external`?h:rw`\g<${h}&R=${g}>`}"`);let p=s.get(h),m=ZC(e,p);if(o&&XC(m,rw`${aw}|\((?!\?)`,KC.DEFAULT))throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with recursion of capturing groups`);let _=e.slice(p,f.index),v=m.slice(_.length+t.length),y=a.length,b=g-1,x=dw(_,v,b,!0,n,a,d);i=mw(i,_,b,a.length-y,y,d),e=`${e.slice(0,p)}${x}${e.slice(p+m.length)}`,sw.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),sw.lastIndex),s.set(p,sw.lastIndex),c.push({num:d,name:p});else if(t[0]===`(`){let e=t===`(`;e&&(d++,s.set(String(d),sw.lastIndex)),c.push(e?{num:d}:{})}else t===`)`&&c.pop()}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function uw(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e)||(e=+e,e<2||e>100))throw Error(t)}function dw(e,t,n,r,i,a,o){let s=new Set;r&&JC(e+t,aw,({groups:{captureName:e}})=>{s.add(e)},KC.DEFAULT);let c=[n,r?s:null,i,a,o];return`${e}${fw(`(?:${e}`,`forward`,...c)}(?:)${fw(`${t})`,`backward`,...c)}${t}`}function fw(e,t,n,r,i,a,o){let s=e=>t===`forward`?e+2:n-e+2-1,c=``;for(let t=0;t<n;t++){let n=s(t);c+=qC(e,rw`${ow}|\\k<(?<backref>[^>]+)>`,({0:e,groups:{captureName:t,unnamed:s,backref:c}})=>{if(c&&r&&!r.has(c))return e;let l=`_$${n}`;if(s||t){let n=o+a.length+1;return a.push(n),pw(i,n),s?e:`(?<${t}${l}>`}return rw`\k<${c}${l}>`},KC.DEFAULT)}return c}function pw(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function mw(e,t,n,r,i,a){if(e.size&&r){let o=0;JC(t,ow,()=>o++,KC.DEFAULT);let s=a-o+i,c=new Map;return e.forEach((e,t)=>{let i=(r-o*n)/n,a=o*n,l=t>s+o?t+r:t,u=[];for(let t of e)if(t<=s)u.push(t);else if(t>s+o+i)u.push(t+r);else if(t<=s+o)for(let e=0;e<=n;e++)u.push(t+o*e);else for(let e=0;e<=n;e++)u.push(t+a+i*e);c.set(l,u)}),c}return e}var hw=String.fromCodePoint,$=String.raw,gw={},_w=globalThis.RegExp;gw.flagGroups=(()=>{try{new _w(`(?i:)`)}catch{return!1}return!0})(),gw.unicodeSets=(()=>{try{new _w(`[[]]`,`v`)}catch{return!1}return!0})(),gw.bugFlagVLiteralHyphenIsRange=gw.unicodeSets?(()=>{try{new _w($`[\d\-a]`,`v`)}catch{return!0}return!1})():!1,gw.bugNestedClassIgnoresNegation=gw.unicodeSets&&new _w(`[[^a]]`,`v`).test(`a`);function vw(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function yw(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function bw(e,t){return Sw[e]>=Sw[t]}function xw(e,t){if(e==null)throw Error(t??`Value expected`);return e}var Sw={ES2025:2025,ES2024:2024,ES2018:2018},Cw={auto:`auto`,ES2025:`ES2025`,ES2024:`ES2024`,ES2018:`ES2018`};function ww(e={}){if({}.toString.call(e)!==`[object Object]`)throw Error(`Unexpected options`);if(e.target!==void 0&&!Cw[e.target])throw Error(`Unexpected target "${e.target}"`);let 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=gw.flagGroups?`ES2025`:gw.unicodeSets?`ES2024`:`ES2018`),t}var Tw=`[ -\r ]`,Ew=new Set([hw(304),hw(305)]),Dw=$`[\p{L}\p{M}\p{N}\p{Pc}]`;function Ow(e){if(Ew.has(e))return[e];let t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=Mw.get(n),a=Aw.get(n),o=jw.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),a&&t.add(a),[...t]}var kw=new Map(`C Other
2732
2730
  Cc Control cntrl
2733
2731
  Cf Format
2734
2732
  Cn Unassigned
@@ -2818,8 +2816,8 @@ Uppercase Upper
2818
2816
  Variation_Selector VS
2819
2817
  White_Space space
2820
2818
  XID_Continue XIDC
2821
- XID_Start XIDS`.split(/\s/).map(e=>[BC(e),e])),Nw=new Map([[`s`,vw(383)],[vw(383),`s`]]),Pw=new Map([[vw(223),vw(7838)],[vw(107),vw(8490)],[vw(229),vw(8491)],[vw(969),vw(8486)]]),Fw=new Map([Rw(453),Rw(456),Rw(459),Rw(498),...zw(8072,8079),...zw(8088,8095),...zw(8104,8111),Rw(8124),Rw(8140),Rw(8188)]),Iw=new Map([[`alnum`,$`[\p{Alpha}\p{Nd}]`],[`alpha`,$`\p{Alpha}`],[`ascii`,$`\p{ASCII}`],[`blank`,$`[\p{Zs}\t]`],[`cntrl`,$`\p{Cc}`],[`digit`,$`\p{Nd}`],[`graph`,$`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,$`\p{Lower}`],[`print`,$`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,$`[\p{P}\p{S}]`],[`space`,$`\p{space}`],[`upper`,$`\p{Upper}`],[`word`,$`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,$`\p{AHex}`]]);function Lw(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Rw(e){let t=vw(e);return[t.toLowerCase(),t]}function zw(e,t){return Lw(e,t).map(e=>Rw(e))}var Bw=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function Vw(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};Gw(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Cw(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};UC(e,Hw,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return UC(e,Uw,a),UC(e,Ww,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var Hw={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=TC();e.body[0].body.push(EC({negate:!0,body:r}),MC(`Any`));let i=TC();i.body[0].body.push(kC(`greedy`,0,1/0,e)),n(uT(i,t),{traverse:!0})}else throw Error(`Unsupported absence function "(?~|"`)},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>e.kind===`flags`);for(let e=n+1;e<t.body.length;e++){let n=t.body[e];Sw(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=Qw(t.get(e));if(n){let t=TC({flags:n});t.body[0].body=e.body,e.body=[uT(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:a,replaceWith:o},s){let{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:p}=s;if(c===`text_segment_boundary`)throw Error(`Unsupported text segment boundary "\\${l?`Y`:`y`}"`);if(c===`line_end`)o(uT(EC({body:[hC({body:[gC(`string_end`)]}),hC({body:[yC(10)]})]}),t));else if(c===`line_start`)o(uT(sT($`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c===`search_start`)if(f.has(e))i.flags.sticky=!0,a();else{let e=r[n-1];if(e&&iT(e))o(uT(EC({negate:!0}),t));else if(d)throw Error($`Uses "\G" in a way that requires a subclass`);else o(lT(gC(`string_start`),t)),s.strategy=`clip_search`}else if(!(c===`string_end`||c===`string_start`))if(c===`string_end_newline`)o(uT(sT($`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${Aw})(?!${Aw})|(?<!${Aw})(?=${Aw}))`,n=`(?:(?<=${Aw})(?=${Aw})|(?<!${Aw})(?!${Aw}))`;o(uT(sT(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!oT(n)&&(n=Zw(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!oT(r)&&(r=Zw(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){t.kind===`intersection`&&n(uT(bC({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:a,spaceIsAscii:o,wordIsAscii:s}){let{kind:c,negate:l,value:u}=e;if(a&&(c===`digit`||u===`digit`)){n(lT(SC(`digit`,{negate:l}),t));return}if(o&&(c===`space`||u===`space`)){n(uT(cT(sT(Ow),l),t));return}if(s&&(c===`word`||u===`word`)){n(lT(SC(`word`,{negate:l}),t));return}if(c===`any`)n(lT(MC(`Any`),t));else if(c===`digit`)n(lT(MC(`Nd`,{negate:l}),t));else if(c!==`dot`)if(c===`text_segment`){if(r===`strict`)throw Error($`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=$`\p{RI}{2}|${e}(?:\u200D${e})*`;n(uT(sT($`(?>\r\n|${i?$`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(lT(MC(`AHex`,{negate:l}),t));else if(c===`newline`)n(uT(sT(l?`[^
2819
+ XID_Start XIDS`.split(/\s/).map(e=>[LC(e),e])),Aw=new Map([[`s`,hw(383)],[hw(383),`s`]]),jw=new Map([[hw(223),hw(7838)],[hw(107),hw(8490)],[hw(229),hw(8491)],[hw(969),hw(8486)]]),Mw=new Map([Fw(453),Fw(456),Fw(459),Fw(498),...Iw(8072,8079),...Iw(8088,8095),...Iw(8104,8111),Fw(8124),Fw(8140),Fw(8188)]),Nw=new Map([[`alnum`,$`[\p{Alpha}\p{Nd}]`],[`alpha`,$`\p{Alpha}`],[`ascii`,$`\p{ASCII}`],[`blank`,$`[\p{Zs}\t]`],[`cntrl`,$`\p{Cc}`],[`digit`,$`\p{Nd}`],[`graph`,$`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,$`\p{Lower}`],[`print`,$`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,$`[\p{P}\p{S}]`],[`space`,$`\p{space}`],[`upper`,$`\p{Upper}`],[`word`,$`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,$`\p{AHex}`]]);function Pw(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Fw(e){let t=hw(e);return[t.toLowerCase(),t]}function Iw(e,t){return Pw(e,t).map(e=>Fw(e))}var Lw=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function Rw(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};Hw(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:bw(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};BC(e,zw,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return BC(e,Bw,a),BC(e,Vw,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var zw={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=SC();e.body[0].body.push(CC({negate:!0,body:r}),kC(`Any`));let i=SC();i.body[0].body.push(EC(`greedy`,0,1/0,e)),n(sT(i,t),{traverse:!0})}else throw Error(`Unsupported absence function "(?~|"`)},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>e.kind===`flags`);for(let e=n+1;e<t.body.length;e++){let n=t.body[e];yw(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=Yw(t.get(e));if(n){let t=SC({flags:n});t.body[0].body=e.body,e.body=[sT(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:a,replaceWith:o},s){let{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:p}=s;if(c===`text_segment_boundary`)throw Error(`Unsupported text segment boundary "\\${l?`Y`:`y`}"`);if(c===`line_end`)o(sT(CC({body:[fC({body:[pC(`string_end`)]}),fC({body:[gC(10)]})]}),t));else if(c===`line_start`)o(sT(iT($`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c===`search_start`)if(f.has(e))i.flags.sticky=!0,a();else{let e=r[n-1];if(e&&tT(e))o(sT(CC({negate:!0}),t));else if(d)throw Error($`Uses "\G" in a way that requires a subclass`);else o(oT(pC(`string_start`),t)),s.strategy=`clip_search`}else if(!(c===`string_end`||c===`string_start`))if(c===`string_end_newline`)o(sT(iT($`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${Dw})(?!${Dw})|(?<!${Dw})(?=${Dw}))`,n=`(?:(?<=${Dw})(?=${Dw})|(?<!${Dw})(?!${Dw}))`;o(sT(iT(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!rT(n)&&(n=Jw(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!rT(r)&&(r=Jw(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){t.kind===`intersection`&&n(sT(_C({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:a,spaceIsAscii:o,wordIsAscii:s}){let{kind:c,negate:l,value:u}=e;if(a&&(c===`digit`||u===`digit`)){n(oT(yC(`digit`,{negate:l}),t));return}if(o&&(c===`space`||u===`space`)){n(sT(aT(iT(Tw),l),t));return}if(s&&(c===`word`||u===`word`)){n(oT(yC(`word`,{negate:l}),t));return}if(c===`any`)n(oT(kC(`Any`),t));else if(c===`digit`)n(oT(kC(`Nd`,{negate:l}),t));else if(c!==`dot`)if(c===`text_segment`){if(r===`strict`)throw Error($`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=$`\p{RI}{2}|${e}(?:\u200D${e})*`;n(sT(iT($`(?>\r\n|${i?$`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(oT(kC(`AHex`,{negate:l}),t));else if(c===`newline`)n(sT(iT(l?`[^
2822
2820
  ]`:`(?>\r
2823
2821
  ?|[
2824
- \v\f…\u2028\u2029])`),t));else if(c===`posix`)if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${vw(e.codePointAt(0)-1)}${vw(e.codePointAt(2)+1)}-\u{10FFFF}`),n(uT(sT(`[${e}]`),t))}else n(uT(cT(sT(Iw.get(u)),l),t));else if(c===`property`)Mw.has(BC(u))||(e.key=`sc`);else if(c===`space`)n(lT(MC(`space`,{negate:l}),t));else if(c===`word`)n(uT(cT(sT(Aw),l),t));else throw Error(`Unexpected character set kind "${c}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`)if(!c.enable&&!c.disable)r();else{let e=TC({flags:c});e.body[0].body=o(),i(uT(e,t),{traverse:!0})}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&nC(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error($`Uses "\K" in a way that's unsupported`);let o=EC({behind:!0});o.body[0].body=a(),i(uT(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),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;let{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){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(uT(EC({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=TC();t.body[0].body.push(e.body),e.body=uT(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=tT(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error($`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!oT(n)&&(n=Zw(n,t),e.ref=n)}},Uw={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=lT(Yw(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&Sw(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=Sw(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},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=xw(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&!(n.type===`CapturingGroup`&&(n.name===a||n.number===a)););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?Yw(0):Jw(o,r.groupOriginByCopy,null),l=c;if(!s){let e=Qw(Xw(o,e=>e.type===`Group`&&!!e.flags)),t=e?xw(r.globalFlags,e):r.globalFlags;Kw(t,r.currentFlags)||(l=TC({flags:$w(t)}),l.body[0].body.push(c))}n(uT(l,t),{traverse:!s})}},Ww={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>qw(t,e));i.length?i.length>1?n(uT(TC({atomic:!0,body:i.reverse().map(e=>hC({body:[_C(e.number)]}))}),t)):e.ref=i[0].number:n(uT(EC({negate:!0}),t))},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){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=vC();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function Gw(e){UC(e,{"*"({node:e,parent:t}){e.parent=t}})}function Kw(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function qw(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=eT(n.parent);for(let r of t){if(r===n)break;if(r===e||nT(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function Jw(e,t,n,r){let i=Array.isArray(e)?[]:{};for(let[a,o]of Object.entries(e))a===`parent`?i.parent=Array.isArray(n)?r:n:o&&typeof o==`object`?i[a]=Jw(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function Yw(e){let t=jC(e);return t.isRecursive=!0,t}function Xw(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Zw(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu,`_`)}`;return t.set(e,n),n}function Qw(e){let t=[`dotAll`,`ignoreCase`],n={enable:{},disable:{}};return e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function $w({dotAll:e,ignoreCase:t}){let 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 eT(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function tT(e){let t=e.find(e=>e.kind===`search_start`||aT(e,{negate:!1})||!rT(e));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`){let e=[];for(let n of t.body){let t=tT(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function nT(e,t){let n=eT(e)??[];for(let e of n)if(e===t||nT(e,t))return!0;return!1}function rT({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function iT(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function aT(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&nC(e.body[0],{type:`Assertion`,kind:`search_start`})}function oT(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function sT(e,t){let n=aC(e,{...t,unicodePropertyMap:Mw}).body;return n.length>1||n[0].body.length>1?TC({body:n}):n[0].body[0]}function cT(e,t){return e.negate=t,e}function lT(e,t){return e.parent=t,e}function uT(e,t){return Gw(e),e.parent=t,e}function dT(e,t){let n=Dw(t),r=Cw(n.target,`ES2024`),i=Cw(n.target,`ES2025`),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw Error(`Invalid recursionLimit; use 2-20`);let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];UC(e,fT,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let c={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!s)},l=e,u={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!i&&o&&s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(e){return u.lastNode=l,l=e,ww(pT[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let f={pattern:e.body.map(d).join(`|`),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&f._hiddenCaptures.push(t),e.transferTo&&Sw(f._captureTransfers,e.transferTo,[]).push(t)}),f}var fT={"*":{enter({node:e},t){if(TT(e)){let n=t.getCurrentModI();t.pushModI(e.flags?xw({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){TT(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){yT(vw(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),bT(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&Bw.has(e.value)&&t.setHasCasedChar()}},pT={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?$`\B`:$`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!=`number`)throw Error(`Unexpected named backref in transformed AST`);if(!t.useFlagMods&&t.accuracy===`strict`&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error(`Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy`);return`\\`+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(o.hidden=!0,a>s.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:``}${r.map(n).join(`|`)})`},Character({value:e},t){let n=vw(e),r=xT(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&yT(n)){let e=jw(n);return t.inCharClass?e.join(``):e.length>1?`[${e.join(``)}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if(r===`intersection`&&!t.useFlagV)throw Error(`Use of character class intersection requires min target ES2024`);yw.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(DT)&&(o=[yC(45),...o.filter(e=>!DT(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||yw.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=TC(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=hC({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let c=o[0];if(r===`union`&&!i&&c&&((!t.useFlagV||!t.verbose)&&a.kind===`union`&&!(yw.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind===`intersection`&&o.length===1&&c.type!==`CharacterClassRange`))return o.map(n).join(``);if(!t.useFlagV&&a.type===`CharacterClass`)throw Error(`Uses nested character class in a way that requires min target ES2024`);return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=xT(n,i),o=xT(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&ST(bT(e)).forEach(e=>{s.add(Array.isArray(e)?`${xT(e[0],i)}-${xT(e[1],i)}`:xT(e,i))}),`${a}-${o}${[...s].join(``)}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e===`dot`)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?`.`:`[^]`:$`[^\n]`;if(e===`digit`)return t?$`\D`:$`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&Bw.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?$`\P`:$`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?$`\W`:$`\w`;throw 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},i,a){let o=i.currentFlags;n&&(i.currentFlags=xw(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${CT(e,n,i.useFlagMods)}${s})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t===`lookahead`?``:`<`}${n?`!`:`=`}`}${e.map(i).join(`|`)})`},Quantifier(e,t,n){return n(e.body)+wT(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error(`Unexpected non-recursive subroutine in transformed AST`);let r=n.recursionLimit;return t===0?`(?R=${r})`:$`\g<${t}&R=${r}>`}},mT=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),hT=new Set([`-`,`\\`,`]`,`^`,`[`]),gT=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),_T=new Map([[9,$`\t`],[10,$`\n`],[11,$`\v`],[12,$`\f`],[13,$`\r`],[8232,$`\u2028`],[8233,$`\u2029`],[65279,$`\uFEFF`]]),vT=/^\p{Cased}$/u;function yT(e){return vT.test(e)}function bT(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return a;for(let e=r;e<=i;e++){let t=vw(e);if(!yT(t))continue;let o=jw(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function xT(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(_T.has(e))return _T.get(e);if(e<32||e>126&&e<160||e>262143||t&&ET(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?gT:hT:mT,a=vw(e);return(i.has(a)?`\\`:``)+a}function ST(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?r??=t[e]:r===null?n.push(t[e]):(n.push([r,t[e]]),r=null);return n}function CT(e,t,n){if(e)return`>`;let r=``;if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?`i`:``)+(e?.dotAll?`s`:``)+(n?`-`:``)+(n?.ignoreCase?`i`:``)+(n?.dotAll?`s`:``)}return`${r}:`}function wT({kind:e,max:t,min:n}){let r;return r=!n&&t===1?`?`:!n&&t===1/0?`*`:n===1&&t===1/0?`+`:n===t?`{${n}}`:`{${n},${t===1/0?``:t}}`,r+{greedy:``,lazy:`?`,possessive:`+`}[e]}function TT({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function ET(e){return e>47&&e<58}function DT({type:e,value:t}){return e===`Character`&&t===45}var OT=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||`(?:)`}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw Error(`Cannot provide options when copying a regexp`);let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?``:t,n),this.#n=t,this.#e=AT(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#i===`clip_search`&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(kT(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n=[...t];t.length=1;let r;this.hasIndices&&(r=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e<n.length;e++){let{hidden:a,transferTo:o}=this.#e.get(e)??{};if(a?i.push(null):(i.push(t.length),t.push(n[e]),this.hasIndices&&t.indices.push(r[e])),o&&n[e]!==void 0){let a=i[o];if(!a)throw Error(`Invalid capture transfer to "${a}"`);if(t[a]=n[e],this.hasIndices&&(t.indices[a]=r[e]),t.groups){this.#r||=jT(this.source);let i=this.#r.get(o);i&&(t.groups[i]=n[e],this.hasIndices&&(t.indices.groups[i]=r[e]))}}}return t}};function kT(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e<n.length;e++){let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])}let r=n.groups;r&&Object.keys(r).forEach(e=>{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}function AT(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)Sw(n,t,{}).transferTo=e;return n}function jT(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,i=0,a;for(;a=t.exec(e);){let{0:e,groups:{capture:t,name:o}}=a;e===`[`?r++:r?e===`]`&&r--:t&&(i++,o&&n.set(i,o))}return n}function MT(e,t){let n=NT(e,t);return n.options?new OT(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function NT(e,t){let n=Dw(t),r=Vw(aC(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Mw}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=dT(r,n),a=fw(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=nw(aw(a.pattern).pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),s={pattern:o.pattern,flags:`${n.hasIndices?`d`:``}${n.global?`g`:``}${i.flags}${i.options.disable.v?`u`:`v`}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw Error(`Lazy compilation requires subclass`)}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=s.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(s.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return s}function PT(e,t){return MT(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function FT(e={}){let t={target:`auto`,cache:new Map,...e};return t.regexConstructor||=e=>PT(e,{target:t.target}),{createScanner(e){return new dS(e,t)},createString(e){return{content:e}}}}async function IT(e){if(G_())throw 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.`);let t=B_.get(e);if(t!=null)return t;try{let t=V_.get(e);if(t==null&&Object.prototype.hasOwnProperty.call(Q_,e)&&(t=Q_[e]),t==null)throw Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);let n=t().then(({default:t})=>{let n={name:e,data:t};return z_.has(e)||z_.set(e,n),n});return B_.set(e,n),await n}finally{B_.delete(e)}}function LT(e){return z_.get(e)??IT(e)}function RT(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var zT=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},BT=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},VT=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function HT(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new zT(t);e.set(t,n)}function a(t,n){return e.has(t)?!1:(e.set(t,n),!0)}function o(t){return e.has(t)}function s(i){let a=t.get(i);if(a!==void 0)return Promise.resolve(a);let o=n.get(i);if(o!==void 0)return o;let s=e.get(i);if(s===void 0)return Promise.reject(new BT(i));let c=r,l=s().then(e=>{let a=RT(e);return c===r&&t.set(i,a),n.get(i)===l&&n.delete(i),a}).catch(e=>{throw n.get(i)===l&&n.delete(i),e});return n.set(i,l),l}function c(e){return Promise.all(e.map(e=>s(e)))}function l(e,n){t.set(e,n)}function u(e){for(let[t,n]of e)l(t,n)}function d(e){return t.get(e)}function f(e){let n=[];for(let r of e){let e=t.get(r);if(e===void 0)throw new VT(r);n.push(e)}return n}function p(e){return t.has(e)}function m(e){for(let n of e)if(!t.has(n))return!1;return!0}function h(e){let n=t.get(e);return n===void 0?s(e):n}function g(){r++,t.clear(),n.clear()}return{clearResolvedThemes:g,getResolvedOrResolveTheme:h,getResolvedTheme:d,getResolvedThemes:f,hasRegisteredTheme:o,hasResolvedTheme:p,hasResolvedThemes:m,registerTheme:i,registerThemeIfAbsent:a,resolveTheme:s,resolveThemes:c,seedResolvedTheme:l,seedResolvedThemes:u}}var UT=HT(),WT=new Set;function GT(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=UT.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,UT.getResolvedTheme(n)??UT.seedResolvedTheme(n,e);WT.has(n)||(WT.add(n),t.loadThemeSync(e))}}function KT(e){let t=[],n=new Set;for(let r of qT(e.themes)){let e=XT(r)?r.getThemes():[r];for(let r of e){if(n.has(r.name))throw Error(`Theme collection already contains theme "${r.name}"`);n.add(r.name),t.push(r)}}let r=Object.freeze([...t]),i=Object.freeze(r.filter(e=>e.colorScheme===`light`)),a=Object.freeze(r.filter(e=>e.colorScheme===`dark`)),o=new Map(r.map(e=>[e.name,e])),s=Object.freeze(r.map(e=>e.name)),c=Object.freeze(i.map(e=>e.name)),l=Object.freeze(a.map(e=>e.name));function u(e){if(e==null)return r;let{colorScheme:t,collection:n}=e;return n==null?t===`light`?i:t===`dark`?a:r:r.filter(e=>e.collection===n?t==null||e.colorScheme===t:!1)}return{getTheme(e){return o.get(e)},getThemes(e){return u(e)},getThemeNames(e){return e?.collection==null?e?.colorScheme===`light`?c:e?.colorScheme===`dark`?l:s:u(e).map(e=>e.name)},hasTheme(e){return o.has(e)},orderBy(e){return KT({themes:r.map((e,t)=>({descriptor:e,index:t})).sort((t,n)=>{let r=e(t.descriptor,n.descriptor);return r===0?t.index-n.index:r}).map(e=>e.descriptor)})},pick(e){let t=[],n=new Set;for(let r of e){if(n.has(r))throw Error(`Theme collection pick already includes theme "${r}"`);n.add(r);let e=o.get(r);if(e==null)throw Error(`Theme collection does not contain theme "${r}"`);t.push(e)}return KT({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function qT(e){return JT(e)?[e]:e}function JT(e){return XT(e)||YT(e)}function YT(e){return typeof e.name==`string`&&typeof e.load==`function`}function XT(e){return typeof e.getThemes==`function`}function ZT({name:e,load:t,colorScheme:n,collection:r,displayName:i}){return{name:e,colorScheme:n,collection:r,displayName:i,load:QT(t)}}function QT(e){return async()=>Nb(RT(await e()))}var $T=`pierre`,eE=[`pierre-dark`,`pierre-dark-soft`,`pierre-dark-vibrant`,`pierre-dark-protanopia-deuteranopia`,`pierre-dark-tritanopia`],tE=[`pierre-light`,`pierre-light-soft`,`pierre-light-vibrant`,`pierre-light-protanopia-deuteranopia`,`pierre-light-tritanopia`],nE=[...tE,...eE],rE=new Set(tE);function iE(e){return rE.has(e)?`light`:`dark`}var aE={"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`},oE={"pierre-dark":()=>Z(()=>import(`./pierre-dark-CpLgRqie.js`),[]),"pierre-dark-soft":()=>Z(()=>import(`./pierre-dark-soft-kZQmAZld.js`),[]),"pierre-dark-vibrant":()=>Z(()=>import(`./pierre-dark-vibrant-CpQYzh95.js`),[]),"pierre-dark-protanopia-deuteranopia":()=>Z(()=>import(`./pierre-dark-protanopia-deuteranopia-B35FxJx-.js`),[]),"pierre-dark-tritanopia":()=>Z(()=>import(`./pierre-dark-tritanopia-CpjhbsIL.js`),[]),"pierre-light":()=>Z(()=>import(`./pierre-light-CoaEpmwp.js`),[]),"pierre-light-soft":()=>Z(()=>import(`./pierre-light-soft-lWLdNTOI.js`),[]),"pierre-light-vibrant":()=>Z(()=>import(`./pierre-light-vibrant-D80Fkn33.js`),[]),"pierre-light-protanopia-deuteranopia":()=>Z(()=>import(`./pierre-light-protanopia-deuteranopia-0fSaH845.js`),[]),"pierre-light-tritanopia":()=>Z(()=>import(`./pierre-light-tritanopia-CEbqgOJL.js`),[])};function sE(e){return ZT({name:e,collection:$T,colorScheme:iE(e),displayName:aE[e],load:oE[e]})}var cE=KT({themes:nE.map(e=>sE(e))}),lE=`shiki`,uE=[`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`],dE=`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`.split(`.`),fE=new Set(uE);function pE(e){return fE.has(e)?`light`:`dark`}var mE={andromeeda:()=>Z(()=>import(`./andromeeda-vGVdxbeo.js`),[]),"aurora-x":()=>Z(()=>import(`./aurora-x-CDeNXAV0.js`),[]),"ayu-dark":()=>Z(()=>import(`./ayu-dark-DluEY0Gj.js`),[]),"ayu-light":()=>Z(()=>import(`./ayu-light-C3h-C4tm.js`),[]),"ayu-mirage":()=>Z(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]),"catppuccin-frappe":()=>Z(()=>import(`./catppuccin-frappe-3VR1Za6u.js`),[]),"catppuccin-latte":()=>Z(()=>import(`./catppuccin-latte-DwIHMF0Q.js`),[]),"catppuccin-macchiato":()=>Z(()=>import(`./catppuccin-macchiato-DYnBP6_5.js`),[]),"catppuccin-mocha":()=>Z(()=>import(`./catppuccin-mocha-DYhrFGRu.js`),[]),"dark-plus":()=>Z(()=>import(`./dark-plus-Cs2F2srj.js`),[]),dracula:()=>Z(()=>import(`./dracula-BHWKrbxM.js`),[]),"dracula-soft":()=>Z(()=>import(`./dracula-soft-5eyTD99u.js`),[]),"everforest-dark":()=>Z(()=>import(`./everforest-dark-sB-x3p7T.js`),[]),"everforest-light":()=>Z(()=>import(`./everforest-light-Df2xbC6M.js`),[]),"github-dark":()=>Z(()=>import(`./github-dark-C-LZuMrd.js`),[]),"github-dark-default":()=>Z(()=>import(`./github-dark-default-DXG-b-1a.js`),[]),"github-dark-dimmed":()=>Z(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]),"github-dark-high-contrast":()=>Z(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]),"github-light":()=>Z(()=>import(`./github-light-EUqPIrTm.js`),[]),"github-light-default":()=>Z(()=>import(`./github-light-default-BXViO-2h.js`),[]),"github-light-high-contrast":()=>Z(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]),"gruvbox-dark-hard":()=>Z(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]),"gruvbox-dark-medium":()=>Z(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]),"gruvbox-dark-soft":()=>Z(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]),"gruvbox-light-hard":()=>Z(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]),"gruvbox-light-medium":()=>Z(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]),"gruvbox-light-soft":()=>Z(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]),horizon:()=>Z(()=>import(`./horizon-CE9ld1lL.js`),[]),"horizon-bright":()=>Z(()=>import(`./horizon-bright-DSNQnXHK.js`),[]),houston:()=>Z(()=>import(`./houston-CsvMBhTu.js`),[]),"kanagawa-dragon":()=>Z(()=>import(`./kanagawa-dragon-CXtmUGW6.js`),[]),"kanagawa-lotus":()=>Z(()=>import(`./kanagawa-lotus-BN08jTvb.js`),[]),"kanagawa-wave":()=>Z(()=>import(`./kanagawa-wave-CTweb8Dz.js`),[]),laserwave:()=>Z(()=>import(`./laserwave-C_8bwKvT.js`),[]),"light-plus":()=>Z(()=>import(`./light-plus-DVQuIRkW.js`),[]),"material-theme":()=>Z(()=>import(`./material-theme-Bm3Qr25_.js`),[]),"material-theme-darker":()=>Z(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]),"material-theme-lighter":()=>Z(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]),"material-theme-ocean":()=>Z(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]),"material-theme-palenight":()=>Z(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]),"min-dark":()=>Z(()=>import(`./min-dark-BSWPekZh.js`),[]),"min-light":()=>Z(()=>import(`./min-light-DDpmG2fV.js`),[]),monokai:()=>Z(()=>import(`./monokai-CdkpiU2Y.js`),[]),"night-owl":()=>Z(()=>import(`./night-owl-DhmEMT88.js`),[]),"night-owl-light":()=>Z(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]),nord:()=>Z(()=>import(`./nord-Cb4Vim4T.js`),[]),"one-dark-pro":()=>Z(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]),"one-light":()=>Z(()=>import(`./one-light-D7Lr4KcI.js`),[]),plastic:()=>Z(()=>import(`./plastic-DQwYfKfQ.js`),[]),poimandres:()=>Z(()=>import(`./poimandres-DRFjx7u4.js`),[]),red:()=>Z(()=>import(`./red-CJ3rzSJv.js`),[]),"rose-pine":()=>Z(()=>import(`./rose-pine-BthvhNj6.js`),[]),"rose-pine-dawn":()=>Z(()=>import(`./rose-pine-dawn-Dg85fqjY.js`),[]),"rose-pine-moon":()=>Z(()=>import(`./rose-pine-moon-hon4tzzS.js`),[]),"slack-dark":()=>Z(()=>import(`./slack-dark-DnToyrRv.js`),[]),"slack-ochin":()=>Z(()=>import(`./slack-ochin-B2OO5cIa.js`),[]),"snazzy-light":()=>Z(()=>import(`./snazzy-light-4G7pJPwS.js`),[]),"solarized-dark":()=>Z(()=>import(`./solarized-dark-DV17i1UV.js`),[]),"solarized-light":()=>Z(()=>import(`./solarized-light-DSh2HLQt.js`),[]),"synthwave-84":()=>Z(()=>import(`./synthwave-84-nFMaYfgc.js`),[]),"tokyo-night":()=>Z(()=>import(`./tokyo-night-oM2G3aXe.js`),[]),vesper:()=>Z(()=>import(`./vesper-DdrHHSXu.js`),[]),"vitesse-black":()=>Z(()=>import(`./vitesse-black-fwtXNY1n.js`),[]),"vitesse-dark":()=>Z(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]),"vitesse-light":()=>Z(()=>import(`./vitesse-light-VbXTXTou.js`),[])};function hE(e){return ZT({name:e,collection:lE,colorScheme:pE(e),load:mE[e]})}var gE=KT({themes:Object.freeze([...uE.map(e=>hE(e)),...dE.map(e=>hE(e))])});function _E(e){if(G_())throw 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(UT.hasRegisteredTheme(e))return;let t=gE.getTheme(e);if(t!=null){UT.registerThemeIfAbsent(t.name,t.load);return}throw Error(`No valid theme loader registered for "${e}"`)}function vE(e,t){if(t.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function yE(e){_E(e);let t=await UT.resolveTheme(e);return vE(e,t),t}function bE(e){return UT.getResolvedTheme(e)??yE(e)}var xE;async function SE({themes:e,langs:t,preferredHighlighter:n=`shiki-js`}){xE??=nS({themes:[],langs:[`text`],engine:n===`shiki-wasm`?Pv(Z(()=>import(`./wasm-BnjxR4X6.js`),[])):FT()});let r=wE(xE)?await xE:xE;xE=r;let i=[];for(let e of t){if(e===`text`||e===`ansi`)continue;let t=LT(e);`then`in t?i.push(t):W_(t,r)}let a=[];for(let t of e){let e=bE(t);`then`in e?a.push(e):GT(e,xE)}return(i.length>0||a.length>0)&&await Promise.all([Promise.all(i).then(e=>{W_(e,r)}),Promise.all(a).then(e=>{GT(e,r)})]),r}function CE(){if(xE!=null&&!(`then`in xE))return xE}function wE(e=xE){return e!=null&&`then`in e}for(let e of cE.getThemes())UT.registerThemeIfAbsent(e.name,e.load);function TE(e=ep){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}function EE(e){for(let t of TE(e))if(!WT.has(t))return!1;return!0}function DE(e){return q({tagName:`div`,children:[q({tagName:`div`,children:e.annotations?.map(e=>q({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function OE(e,t){return q({tagName:`div`,children:e,properties:{"data-content":``,style:`grid-row: span ${t}`}})}function kE(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 AE({fileOrDiff:e,mode:t,stickyHeader:n}){let r=`type`in e?e:void 0,i={"data-diffs-header":t,"data-change-type":r?.type,"data-sticky":n?``:void 0};return q({tagName:`div`,children:[t===`custom`?q({tagName:`slot`,properties:{name:$f}}):jE({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),...t===`custom`?[]:[ME(r)]],properties:i})}function jE({name:e,prevName:t,iconType:n}){let r=[q({tagName:`slot`,properties:{name:Zf}}),Jp({name:kE(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(q({tagName:`div`,children:[q({tagName:`bdi`,children:[qp(t)]})],properties:{"data-prev-name":``}})),r.push(Jp({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push(q({tagName:`div`,children:[q({tagName:`bdi`,children:[qp(e)]})],properties:{"data-title":``}})),q({tagName:`div`,children:r,properties:{"data-header-content":``}})}function ME(e){let t=[];if(e!=null){let n=0,r=0;for(let t of e.hunks)n+=t.additionLines,r+=t.deletionLines;(r>0||n===0)&&t.push(q({tagName:`span`,children:[qp(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push(q({tagName:`span`,children:[qp(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push(q({tagName:`slot`,properties:{name:Qf}})),q({tagName:`div`,children:t,properties:{"data-metadata":``}})}function NE(e){return q({tagName:`pre`,properties:PE(e)})}function PE({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,totalLines:a,type:o,customProperties:s}){return{...s,"data-diff":o===`diff`?``:void 0,"data-file":o===`file`?``:void 0,"data-diff-type":o===`diff`?i?`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:${`${a}`.length}ch;`}}function FE(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:[e??`text`],themes:TE(t),preferredHighlighter:n}}function IE(e){return e.useTokenTransformer===!0||e.onTokenClick!=null||e.onTokenEnter!=null||e.onTokenLeave!=null}function LE(e,t){return e===t||e?.cacheKey!=null&&e.cacheKey===t?.cacheKey}function RE({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:r,collapsedContextThreshold:i}){let a=Math.max(t,0);if(a===0||e)return{fromStart:0,fromEnd:0,rangeSize:a,collapsedLines:a,renderAll:!1};if(n===!0||a<=i)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(r),s=Math.min(Math.max(o?.fromStart??0,0),a),c=Math.min(Math.max(o?.fromEnd??0,0),a),l=s+c,u=l>=a;return{fromStart:u?a:s,fromEnd:u?0:c,rangeSize:a,collapsedLines:Math.max(a-l,0),renderAll:u}}function zE({fileDiff:e,errorPrefix:t}){let n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;let r=e.additionLines.length-(n.additionLineIndex+n.additionCount),i=e.deletionLines.length-(n.deletionLineIndex+n.deletionCount);if(r<=0&&i<=0)return 0;if(r!==i)throw Error(`${t}: trailing context mismatch (additions=${r}, deletions=${i}) for ${e.name}`);return Math.min(r,i)}function BE({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:i}){if(t!==e.hunks.length-1)return;let a=zE({fileDiff:e,errorPrefix:i});if(a<=0)return;if(n===!0||a<=r)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(e.hunks.length),s=Math.min(Math.max(o?.fromStart??0,0),a);return{fromStart:s,fromEnd:0,rangeSize:a,collapsedLines:a-s,renderAll:s>=a}}function VE({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:a=1,callback:o}){let s=HE({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:a}),c={viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:s.splitCount,unifiedCount:s.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!c.isWindowedHighlight)return!1;let e=c.unifiedCount>=n+r,i=c.splitCount>=n+r;return t===`unified`?e:(t===`split`||e)&&i},shouldSkip(e,r){if(!c.isWindowedHighlight)return!1;let i=c.unifiedCount+e<n,a=c.splitCount+r<n;return t===`unified`?i:(t===`split`||i)&&a},incrementCounts(e,n){(t===`unified`||t===`both`)&&(c.unifiedCount+=e),(t===`split`||t===`both`)&&(c.splitCount+=n)},isInWindow(e,n){if(!c.isWindowedHighlight)return!0;let r=c.isInUnifiedWindow(e),i=c.isInSplitWindow(n);return t===`unified`?r:t===`split`?i:r||i},isInUnifiedWindow(e){return!c.isWindowedHighlight||c.unifiedCount>=n-e&&c.unifiedCount<n+r},isInSplitWindow(e){return!c.isWindowedHighlight||c.splitCount>=n-e&&c.splitCount<n+r},emit(e,n=!1){return n||(t===`unified`?c.incrementCounts(1,0):t===`split`?c.incrementCounts(0,1):c.incrementCounts(1,1)),o(e)??!1}};hunkIterator:for(let n=s.hunkIndex;n<e.hunks.length;n++){let r=e.hunks[n];if(r==null)throw Error(`iterateOverDiff: invalid hunk index`);if(c.shouldBreak())break;let o=RE({isPartial:e.isPartial,rangeSize:r.collapsedBefore,expandedHunks:i,hunkIndex:n,collapsedContextThreshold:a}),s=n===c.finalHunkIndex?BE({fileDiff:e,hunkIndex:n,expandedHunks:i,collapsedContextThreshold:a,errorPrefix:`iterateOverDiff`}):void 0,l=o.fromStart+o.fromEnd;function u(e,n){return s==null||s.collapsedLines<=0||s.fromStart+s.fromEnd>0?0:t===`unified`?e===r.unifiedLineStart+r.unifiedLineCount-1?s.collapsedLines:0:n===r.splitLineStart+r.splitLineCount-1?s.collapsedLines:0}let d=o.collapsedLines===0;function f(){return d?0:(d=!0,o.collapsedLines)}if(c.shouldSkip(l,l))c.incrementCounts(l,l),f();else{let e=r.unifiedLineStart-o.rangeSize,i=r.splitLineStart-o.rangeSize,a=r.deletionLineIndex-o.rangeSize,s=r.additionLineIndex-o.rangeSize,l=r.deletionStart-o.rangeSize,u=r.additionStart-o.rangeSize;if(GE(c,o.fromStart,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:0,collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:l+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:s+t,lineNumber:u+t,noEOFCR:!1}}))||(e=r.unifiedLineStart-o.fromEnd,i=r.splitLineStart-o.fromEnd,a=r.deletionLineIndex-o.fromEnd,s=r.additionLineIndex-o.fromEnd,l=r.deletionStart-o.fromEnd,u=r.additionStart-o.fromEnd,GE(c,o.fromEnd,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:f(),collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:l+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:s+t,lineNumber:u+t,noEOFCR:!1}}),()=>{f()})))break hunkIterator}let p=r.unifiedLineStart,m=r.splitLineStart,h=r.deletionLineIndex,g=r.additionLineIndex,_=r.deletionStart,v=r.additionStart,y=r.hunkContent.at(-1);for(let e of r.hunkContent){if(c.shouldBreak())break hunkIterator;let i=e===y;if(e.type===`context`){if(c.shouldSkip(e.lines,e.lines))c.incrementCounts(e.lines,e.lines),f();else if(GE(c,e.lines,t,t=>{let a=i&&t===e.lines-1,o=p+t,s=m+t;return c.emit({hunkIndex:n,hunk:r,collapsedBefore:f(),collapsedAfter:u(o,s),type:`context`,deletionLine:{lineNumber:_+t,lineIndex:h+t,noEOFCR:a&&r.noEOFCRDeletions,unifiedLineIndex:o,splitLineIndex:s},additionLine:{unifiedLineIndex:o,splitLineIndex:s,lineIndex:g+t,lineNumber:v+t,noEOFCR:a&&r.noEOFCRAdditions}})},()=>{f()}))break hunkIterator;p+=e.lines,m+=e.lines,h+=e.lines,g+=e.lines,_+=e.lines,v+=e.lines}else{let a=Math.max(e.deletions,e.additions),o=e.deletions+e.additions;if(!c.shouldSkip(o,a)){let s=KE(c,e,t);(s[0]?.[0]??0)>0&&f();for(let[l,d]of s)for(let s=l;s<d;s++){let l=u(p+s,t===`unified`?m+(s<e.deletions?s:s-e.deletions):m+s);if(c.emit(qE({hunkIndex:n,hunk:r,collapsedBefore:f(),collapsedAfter:l,diffStyle:t,index:s,unifiedLineIndex:p,splitLineIndex:m,additionLineIndex:g,deletionLineIndex:h,additionLineNumber:v,deletionLineNumber:_,content:e,isLastContent:i,unifiedCount:o,splitCount:a}),!0))break hunkIterator}}f(),c.incrementCounts(o,a),p+=o,m+=a,h+=e.deletions,g+=e.additions,_+=e.deletions,v+=e.additions}}if(s!=null){let{collapsedLines:n,fromStart:r,fromEnd:i}=s,a=r+i;if(GE(c,a,t,t=>{let r=t===a-1;return c.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:r?n:0,type:`context-expanded`,deletionLine:{lineNumber:_+t,lineIndex:h+t,noEOFCR:!1,unifiedLineIndex:p+t,splitLineIndex:m+t},additionLine:{unifiedLineIndex:p+t,splitLineIndex:m+t,lineIndex:g+t,lineNumber:v+t,noEOFCR:!1}})},void 0,()=>c.shouldBreak()))break hunkIterator}}}function HE({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:i}){if(n<=0||t===`both`)return{hunkIndex:0,splitCount:0,unifiedCount:0};let a=UE({diff:e,expandedHunks:r,collapsedContextThreshold:i}),o=0,s=e.hunks.length-1,c=e.hunks.length;for(;o<=s;){let e=o+s>>1,r=a[e+1];if(r==null)throw Error(`iterateOverDiff: invalid hunk prefix index`);(t===`unified`?r.unifiedCount:r.splitCount)>n?(c=e,s=e-1):o=e+1}if(c>=e.hunks.length){let t=a[e.hunks.length];if(t==null)throw Error(`iterateOverDiff: invalid terminal hunk prefix index`);return{hunkIndex:e.hunks.length,splitCount:t.splitCount,unifiedCount:t.unifiedCount}}let l=a[c];if(l==null)throw Error(`iterateOverDiff: invalid selected hunk prefix index`);return{hunkIndex:c,splitCount:l.splitCount,unifiedCount:l.unifiedCount}}function UE({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let r=0,i=0,a=e.hunks.length-1,o=[{splitCount:0,unifiedCount:0}];for(let s=0;s<e.hunks.length;s++){let c=e.hunks[s];if(c==null)throw Error(`iterateOverDiff: invalid hunk summary index`);let l=RE({isPartial:e.isPartial,rangeSize:c.collapsedBefore,expandedHunks:t,hunkIndex:s,collapsedContextThreshold:n}),u=l.fromStart+l.fromEnd;r+=u+c.splitLineCount,i+=u+c.unifiedLineCount;let d=s===a?BE({fileDiff:e,hunkIndex:s,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`iterateOverDiff`}):void 0;if(d!=null){let e=d.fromStart+d.fromEnd;r+=e,i+=e}o.push({splitCount:r,unifiedCount:i})}return o}function WE(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];let r=[];function i(n){let i=Math.max(0,e.viewportStart-n),a=Math.min(t,e.viewportEnd-n);a>i&&r.push([i,a])}if(n!==`split`&&i(e.unifiedCount),n!==`unified`&&i(e.splitCount),r.length===0)return[0,0];let a=r[0][0],o=r[0][1];for(let e=1;e<r.length;e++){let t=r[e];a=Math.min(a,t[0]),o=Math.max(o,t[1])}return[a,o]}function GE(e,t,n,r,i,a){let[o,s]=WE(e,t,n);o>0&&(e.incrementCounts(o,o),i?.());let c=o;for(;c<t;){if(a?.()===!0)return!0;if(c>=s){e.incrementCounts(t-c,t-c);break}if(e.isInWindow(0,0)){if(r(c)===!0)return!0}else e.incrementCounts(1,1);c++}return!1}function KE(e,t,n){if(!e.isWindowedHighlight)return[[0,n===`unified`?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];let r=n!==`split`,i=n!==`unified`,a=n===`unified`?`unified`:`split`,o=[];function s(t,n){if(t+n<=e.viewportStart||t>=e.viewportEnd)return;let r=Math.max(0,e.viewportStart-t),i=Math.min(n,e.viewportEnd-t);return i>r?[r,i]:void 0}function c(e,n){return a===`split`?e:n===`additions`?[e[0]+t.deletions,e[1]+t.deletions]:e}function l(e,t){if(e==null)return;let[n,r]=c(e,t);r>n&&o.push([n,r])}if(r&&(l(s(e.unifiedCount,t.deletions),`deletions`),l(s(e.unifiedCount+t.deletions,t.additions),`additions`)),i&&(l(s(e.splitCount,t.deletions),`deletions`),l(s(e.splitCount,t.additions),`additions`)),o.length===0)return o;o.sort((e,t)=>e[0]-t[0]);let u=[o[0]];for(let[e,t]of o.slice(1)){let n=u[u.length-1];e<=n[1]?n[1]=Math.max(n[1],t):u.push([e,t])}return u}function qE({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:i,index:a,unifiedLineIndex:o,splitLineIndex:s,additionLineIndex:c,deletionLineIndex:l,additionLineNumber:u,deletionLineNumber:d,content:f,isLastContent:p,unifiedCount:m,splitCount:h}){let g=a<f.deletions?o+a:void 0,_=i===`unified`?a>=f.deletions?o+a:void 0:a<f.additions?o+f.deletions+a:void 0,v=i===`unified`?s+(a<f.deletions?a:a-f.deletions):s+a,y=a<f.deletions?l+a:void 0,b=a<f.deletions?d+a:void 0,x=i===`unified`?a>=f.deletions?c+(a-f.deletions):void 0:a<f.additions?c+a:void 0,S=i===`unified`?a>=f.deletions?u+(a-f.deletions):void 0:a<f.additions?u+a:void 0,C=i===`unified`?p&&a===f.deletions-1&&t.noEOFCRDeletions:p&&a===h-1&&t.noEOFCRDeletions,w=i===`unified`?p&&a===m-1&&t.noEOFCRAdditions:p&&a===h-1&&t.noEOFCRAdditions,T=y!=null&&b!=null&&g!=null?{lineNumber:b,lineIndex:y,noEOFCR:C,unifiedLineIndex:g,splitLineIndex:v}:void 0,E=x!=null&&S!=null&&_!=null?{unifiedLineIndex:_,splitLineIndex:v,lineIndex:x,lineNumber:S,noEOFCR:w}:void 0;if(T==null&&E!=null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:void 0,additionLine:E};if(T!=null&&E==null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:T,additionLine:void 0};if(T==null||E==null)throw Error(`iterateOverDiff: missing change line data`);return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:T,additionLine:E}}function JE(e,t){return Up(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function YE(e){return q({tagName:`div`,properties:{"data-content-buffer":``,"data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function XE(e){return q({tagName:`div`,children:[q({tagName:`span`,children:[qp(`No newline at end of file`)]})],properties:{"data-no-newline":``,"data-line-type":e,"data-column-content":``}})}function ZE(e){return q({tagName:`div`,children:[Jp({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 QE({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:i,isFirstHunk:a,isLastHunk:o}){let s=0,c=[];if(e===`metadata`&&t!=null&&c.push(q({tagName:`div`,children:[qp(t)],properties:{"data-separator-wrapper":``}})),(e===`line-info`||e===`line-info-basic`)&&t!=null){let e=[];n!=null&&(r?(a||(e.push(ZE(`up`)),s++),o||(e.push(ZE(`down`)),s++)):(e.push(ZE(!a&&!o?`both`:a?`down`:`up`)),s++)),e.push(q({tagName:`div`,children:[q({tagName:`span`,children:[qp(t)],properties:{"data-unmodified-lines":``}})],properties:{"data-separator-content":``}})),r&&n!=null&&e.push(q({tagName:`div`,children:[qp(`Expand all`)],properties:{role:`button`,"data-expand-button":``,"data-expand-all-button":``}})),c.push(q({tagName:`div`,children:e,properties:{"data-separator-wrapper":``,"data-separator-multi-button":s>1?``:void 0}}))}return e===`custom`&&i!=null&&c.push(q({tagName:`slot`,properties:{name:i}})),q({tagName:`div`,children:c,properties:{"data-separator":c.length===0?`simple`:e,"data-expand-index":n,"data-separator-first":a?``:void 0,"data-separator-last":o?``:void 0}})}function $E(e,t){return`hunk-separator-${e}-${t}`}function eD(e){let t=e.at(-1);return t==null?0:Math.max(t.additionStart+t.additionCount,t.deletionStart+t.deletionCount)}function tD(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function nD(e,t,n){let r=typeof n.lineInfo==`function`?n.lineInfo(t):n.lineInfo[t-1];if(r==null){let r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),Error(r)}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(qp(`
2825
- `)),e}var rD=Symbol(`no-token`),iD=Symbol(`multiple-tokens`);function aD(e){let t=oD(e);if(t!=null)return t;let n=rD,r=[],i=[],a,o=()=>{if(i.length===0||a==null){i=[],a=void 0;return}if(i.length===1){let e=i[0];if(e?.type===`element`){cD(e,a);for(let t of e.children)sD(t)}else sD(e);r.push(e),i=[],a=void 0;return}for(let e of i)sD(e);r.push(q({tagName:`span`,properties:{"data-char":a},children:i})),i=[],a=void 0},s=e=>{if(e!==rD){if(e===iD){n=iD;return}if(n===rD){n=e;return}n!==e&&(n=iD)}};for(let t of e.children){let e=t.type===`element`?aD(t):rD;if(s(e),typeof e!=`number`){o(),r.push(t);continue}a!=null&&a!==e&&o(),a??=e,i.push(t)}return o(),e.children=r,n}function oD(e){let t=e.properties[`data-char`];if(typeof t==`number`)return t}function sD(e){if(e.type===`element`){e.properties[`data-char`]=void 0;for(let t of e.children)sD(t)}}function cD(e,t){e.properties[`data-char`]=t}function lD(e={}){let{classPrefix:t=`__shiki_`,classSuffix:n=``,classReplacer:r=e=>e}=e,i=new Map;function a(e){return Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function o(e){let o=t+uD(typeof e==`string`?e:a(e))+n;return o=r(o),i.has(o)||i.set(o,typeof e==`string`?e:{...e}),o}return{name:`@shikijs/transformers:style-to-class`,pre(e){if(!e.properties.style)return;let t=o(e.properties.style);delete e.properties.style,this.addClassToHast(e,t)},tokens(e){for(let t of e)for(let e of t){if(!e.htmlStyle)continue;let t=o(e.htmlStyle);e.htmlStyle={},e.htmlAttrs||={},e.htmlAttrs.class?e.htmlAttrs.class+=` ${t}`:e.htmlAttrs.class=t}},getClassRegistry(){return i},getCSS(){let e=``;for(let[t,n]of i.entries())e+=`.${t}{${typeof n==`string`?n:a(n)}}`;return e},clearRegistry(){i.clear()}}}function uD(e,t=0){let n=3735928559^t,r=1103547991^t;for(let t=0,i;t<e.length;t++)i=e.charCodeAt(t),n=Math.imul(n^i,2654435761),r=Math.imul(r^i,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 dD(e=!1,t=!1){let n={lineInfo:[]},r=[{line(e){return delete e.properties.class,e},pre(t){let r=Yp(t),i=[];if(r!=null){let t=1;for(let a of r.children)a.type===`element`&&(e&&aD(a),i.push(nD(a,t,n)),t++);r.children=i}return t},...e?{tokens(e){for(let t of e){let e=0;for(let n of t){let t=n;t.__lineChar??=e,e+=n.content.length}}},preprocess(e,t){t.mergeWhitespaces=`never`},span(e,t,n,r,i){if(i?.offset!=null&&i.content!=null){let t=i.__lineChar;return t!=null&&(e.properties[`data-char`]=t),e}return e}}:null}];return t&&r.push(pD,fD),{state:n,transformers:r,toClass:fD}}var fD=lD({classPrefix:`hl-`}),pD={name:`token-style-normalizer`,tokens(e){for(let t of e)for(let e of t){if(e.htmlStyle!=null)continue;let t={};e.color!=null&&(t.color=e.color),e.bgColor!=null&&(t[`background-color`]=e.bgColor),e.fontStyle!=null&&e.fontStyle!==0&&(e.fontStyle&1&&(t[`font-style`]=`italic`),e.fontStyle&2&&(t[`font-weight`]=`bold`),e.fontStyle&4&&(t[`text-decoration`]=`underline`)),Object.keys(t).length>0&&(e.htmlStyle=t)}}};function mD(e){return`--${e===`token`?`diffs-token`:`diffs`}-`}var hD=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,gD=/^0(?:\.0+)?%?$/;function _D(e){let t=e.indexOf(`(`);if(t<=0||!e.endsWith(`)`))return;let n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;let r=e.slice(t+1,-1).trim();if(r.length===0)return;let i=r.lastIndexOf(`/`);if(i!==-1)return r.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){let e=r.split(`,`);if(e.length===4)return e[3]?.trim()}}function vD(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;let n=t[1],r,i=1;return n.length===3?r=n.split(``).map(e=>e+e).join(``):n.length===6?r=n:(r=n.slice(0,6),i=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),i]}function yD(e){if(e==null)return null;let t=vD(e);if(t==null)return null;let n=t[0]/255,r=t[1]/255,i=t[2]/255,a=e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4;return .2126*a(n)+.7152*a(r)+.0722*a(i)}function bD(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||hD.test(t))return!0;let n=_D(t);return n!=null&&gD.test(n)}function xD(e,t,n){if(t==null||n==null)return!1;let r=yD(e),i=yD(t),a=yD(n);return r==null||i==null||a==null?!1:Math.abs(r-a)<Math.abs(r-i)}var SD=new WeakMap;function CD(e){let t=SD.get(e);if(t!=null)return t;let n=e.colors??{},r={...n},i=n[`editor.background`]??e.bg,a=n[`editor.foreground`]??e.fg,o=n[`sideBar.background`]??i,s=n[`sideBar.foreground`]??a;wD(r,`editor.background`,i),wD(r,`editor.foreground`,a),wD(r,`sideBar.background`,o),wD(r,`sideBar.foreground`,s),wD(r,`input.background`,n[`input.background`]??o),wD(r,`sideBarSectionHeader.foreground`,n[`sideBarSectionHeader.foreground`]??s),wD(r,`list.activeSelectionForeground`,n[`list.activeSelectionForeground`]??s),wD(r,`gitDecoration.addedResourceForeground`,TD(n[`gitDecoration.addedResourceForeground`],n[`terminal.ansiGreen`],n[`editorGutter.addedBackground`])),wD(r,`gitDecoration.modifiedResourceForeground`,TD(n[`gitDecoration.modifiedResourceForeground`],n[`terminal.ansiBlue`],n[`editorGutter.modifiedBackground`])),wD(r,`gitDecoration.deletedResourceForeground`,TD(n[`gitDecoration.deletedResourceForeground`],n[`terminal.ansiRed`],n[`editorGutter.deletedBackground`]));let c=(bD(n[`list.focusOutline`])?void 0:n[`list.focusOutline`])??(bD(n.focusBorder)?void 0:n.focusBorder);c==null?delete r[`list.focusOutline`]:r[`list.focusOutline`]=c;let l=n[`list.hoverBackground`];l!=null&&(ED(l,o)||xD(l,o,s))&&delete r[`list.hoverBackground`];let u=Object.freeze({...e,colors:Object.freeze(r)});return SD.set(e,u),u}function wD(e,t,n){n!=null&&n!==``&&(e[t]=n)}function TD(...e){for(let t of e)if(t!=null&&t!==``)return t}function ED(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function DD({theme:e=ep,highlighter:t,prefix:n}){let r=``;if(typeof e==`string`){let i=t.getTheme(e),a=CD(i);r+=`color:${a.fg};`,r+=`background-color:${a.bg};`,r+=`${mD(`global`)}fg:${a.fg};`,r+=`${mD(`global`)}bg:${a.bg};`,r+=OD(i,n)}else{let n=t.getTheme(e.dark),i=CD(n);r+=`${mD(`global`)}dark:${i.fg};`,r+=`${mD(`global`)}dark-bg:${i.bg};`,r+=OD(n,`dark`),n=t.getTheme(e.light),i=CD(n),r+=`${mD(`global`)}light:${i.fg};`,r+=`${mD(`global`)}light-bg:${i.bg};`,r+=OD(n,`light`)}return r}function OD(e,t){t=t==null?``:`${t}-`;let n=``,r=e.colors?.[`gitDecoration.addedResourceForeground`]??e.colors?.[`terminal.ansiGreen`];r!=null&&(n+=`${mD(`global`)}${t}addition-color:${r};`);let i=e.colors?.[`gitDecoration.deletedResourceForeground`]??e.colors?.[`terminal.ansiRed`];i!=null&&(n+=`${mD(`global`)}${t}deletion-color:${i};`);let a=e.colors?.[`gitDecoration.modifiedResourceForeground`]??e.colors?.[`terminal.ansiBlue`];return a!=null&&(n+=`${mD(`global`)}${t}modified-color:${a};`),n}function kD(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t.children;t=`children`in t?t.children[0]:null}throw console.error(e),Error(`getLineNodes: Unable to find children`)}function AD({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 jD({item:e,arr:t,enableJoin:n,isNeutral:r=!1,isLastItem:i=!1}){let a=t[t.length-1];if(a==null||i||!n){t.push([+!r,e.value]);return}let o=a[0]===0;if(r===o||r&&e.value.length===1&&!o){a[1]+=e.value;return}t.push([+!r,e.value])}var MD={forcePlainText:!1};function ND(e,t,n,{forcePlainText:r,startingLine:i,totalLines:a,expandedHunks:o,collapsedContextThreshold:s=1}=MD){r?(i??=0,a??=1/0):(i=0,a=1/0);let c=i>0||a<1/0,l=typeof n.theme==`string`?t.getTheme(n.theme).type:void 0,u=DD({theme:n.theme,highlighter:t}),d=r&&!c&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?`none`:n.lineDiffType,f={deletionLines:[],additionLines:[]},{maxLineDiffLength:p}=n,m=!r&&!e.isPartial,h=r?o:void 0,g=new Map;function _(e){let t=m?0:e,n=g.get(t)??FD();return g.set(t,n),n}function v(e,t,n,r){if(c){let e=n.at(-1);(e==null||e.targetIndex+e.count!==t)&&(e={targetIndex:t,originalOffset:r.length,count:0},n.push(e)),e.count++}r.push(e)}VE({diff:e,diffStyle:`both`,startingLine:i,totalLines:a,expandedHunks:c?h:!0,collapsedContextThreshold:s,callback:({hunkIndex:t,additionLine:n,deletionLine:r,type:i})=>{let a=_(t),o=n==null?r.splitLineIndex:n.splitLineIndex;i===`change`&&n!=null&&r!=null&&PD({additionLine:e.additionLines[n.lineIndex],deletionLine:e.deletionLines[r.lineIndex],deletionLineIndex:a.deletionContent.length,additionLineIndex:a.additionContent.length,deletionDecorations:a.deletionDecorations,additionDecorations:a.additionDecorations,lineDiffType:d,maxLineDiffLength:p}),r!=null&&(v(e.deletionLines[r.lineIndex],r.lineIndex,a.deletionSegments,a.deletionContent),a.deletionInfo.push({type:i===`change`?`change-deletion`:i,lineNumber:r.lineNumber,altLineNumber:i===`change`?void 0:n.lineNumber??void 0,lineIndex:`${r.unifiedLineIndex},${o}`})),n!=null&&(v(e.additionLines[n.lineIndex],n.lineIndex,a.additionSegments,a.additionContent),a.additionInfo.push({type:i===`change`?`change-addition`:i,lineNumber:n.lineNumber,altLineNumber:i===`change`?void 0:r.lineNumber??void 0,lineIndex:`${n.unifiedLineIndex},${o}`}))}});for(let i of g.values()){if(i.deletionContent.length===0&&i.additionContent.length===0)continue;let a={name:e.prevName??e.name,contents:i.deletionContent.value},o={name:e.name,contents:i.additionContent.value},{deletionLines:s,additionLines:c}=ID({deletionFile:a,deletionInfo:i.deletionInfo,deletionDecorations:i.deletionDecorations,additionFile:o,additionInfo:i.additionInfo,additionDecorations:i.additionDecorations,highlighter:t,options:n,languageOverride:r?`text`:e.lang});if(m){f.deletionLines=s,f.additionLines=c;continue}if(i.deletionSegments.length>0)for(let e of i.deletionSegments)for(let t=0;t<e.count;t++)f.deletionLines[e.targetIndex+t]=s[e.originalOffset+t];else f.deletionLines.push(...s);if(i.additionSegments.length>0)for(let e of i.additionSegments)for(let t=0;t<e.count;t++)f.additionLines[e.targetIndex+t]=c[e.originalOffset+t];else f.additionLines.push(...c)}return{code:f,themeStyles:u,baseThemeType:l}}function PD({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:i,additionDecorations:a,lineDiffType:o,maxLineDiffLength:s}){if(e==null||t==null||o===`none`||(e=lp(e),t=lp(t),e.length>s||t.length>s))return;let c=o===`char`?t_(e,t):v_(e,t),l=[],u=[],d=o===`word-alt`,f=c.at(-1);for(let e of c){let t=e===f;!e.added&&!e.removed?(jD({item:e,arr:l,enableJoin:d,isNeutral:!0,isLastItem:t}),jD({item:e,arr:u,enableJoin:d,isNeutral:!0,isLastItem:t})):e.removed?jD({item:e,arr:l,enableJoin:d,isLastItem:t}):jD({item:e,arr:u,enableJoin:d,isLastItem:t})}let p=0;for(let e of l)e[0]===1&&i.push(AD({line:n,spanStart:p,spanLength:e[1].length})),p+=e[1].length;p=0;for(let e of u)e[0]===1&&a.push(AD({line:r,spanStart:p,spanLength:e[1].length})),p+=e[1].length}function FD(){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 ID({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:i,deletionDecorations:a,additionDecorations:o,languageOverride:s,options:{theme:c=ep,...l}}){let u=s??F_(e.name),d=s??F_(t.name),{state:f,transformers:p}=dD(l.useTokenTransformer),m=typeof c==`string`?{...l,lang:`text`,theme:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:mD(`token`),tokenizeTimeLimit:0}:{...l,lang:`text`,themes:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:mD(`token`),tokenizeTimeLimit:0};return{deletionLines:e.contents===``?[]:(m.lang=u,f.lineInfo=n,m.decorations=a,kD(i.codeToHast(lp(e.contents),m))),additionLines:t.contents===``?[]:(m.lang=d,m.decorations=o,f.lineInfo=r,kD(i.codeToHast(lp(t.contents),m)))}}var LD=-1,RD=class{options;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++LD}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang=`text`;renderCache;constructor(e={theme:ep},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=EE(e.theme??ep)?CE():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)}clearRenderCache(){this.renderCache=void 0}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){let 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)??op}getExpandedHunksMap(){return this.expandedHunks}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(let t of e){let e=(()=>{switch(t.side){case`deletions`:return this.deletionAnnotations;case`additions`:return this.additionAnnotations}})(),n=e[t.lineNumber]??[];e[t.lineNumber]=n,n.push(t)}}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e}}getSplitLineDecoration({side:e,type:t}){return t===`change`?{gutterLineType:e===`deletions`?`change-deletion`:`change-addition`}:{gutterLineType:t}}createAnnotationElement=e=>DE(e);getOptionsWithDefaults(){let{diffIndicators:e=`bars`,diffStyle:t=`split`,disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:i=!1,disableVirtualizationBuffers:a=!1,collapsed:o=!1,expandUnchanged:s=!1,collapsedContextThreshold:c=1,expansionLineCount:l=100,hunkSeparators:u=`line-info`,lineDiffType:d=`word-alt`,maxLineDiffLength:f=1e3,overflow:p=`scroll`,stickyHeader:m=!1,theme:h=ep,headerRenderMode:g=`default`,tokenizeMaxLineLength:_=1e3,tokenizeMaxLength:v=ap,useTokenTransformer:y=!1,useCSSClasses:b=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:i,disableVirtualizationBuffers:a,collapsed:o,expandUnchanged:s,collapsedContextThreshold:c,expansionLineCount:l,hunkSeparators:u,lineDiffType:d,maxLineDiffLength:f,overflow:p,stickyHeader:m,theme:this.workerManager?.getDiffRenderOptions().theme??h,headerRenderMode:g,tokenizeMaxLineLength:_,tokenizeMaxLength:v,useTokenTransformer:y,useCSSClasses:b}}async initializeHighlighter(){return this.highlighter=await SE(FE(this.computedLang,this.options)),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;let{options:t}=this.getRenderOptions(e),n=qD(e,this.getTokenizeMaxLength()),r=this.workerManager?.getDiffResultCache(e);r!=null&&!JE(t,r.options)&&(r=void 0),this.renderCache??={diff:e,highlighted:!n&&!I_(e),options:t,result:n?void 0:r?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter??(this.computedLang=e.lang??F_(e.name),this.initializeHighlighter())}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getDiffRenderOptions();let{theme:e,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}=this.getOptionsWithDefaults();return{theme:e,useTokenTransformer:IE(this.options),tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}})();this.getOptionsWithDefaults();let{renderCache:n}=this;return n?.result==null||!LE(e,n.diff)||!JE(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}renderDiff(e=this.renderCache?.diff,t=sp){if(e==null)return;let{expandUnchanged:n=!1,collapsedContextThreshold:r}=this.getOptionsWithDefaults(),{options:i,forceHighlight:a}=this.getRenderOptions(e),o=this.getMatchingWorkerResultCache(e,i);o!=null&&!this.hasHighlightedRenderCache(e,i)&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...o},a=!1),this.renderCache??={diff:e,highlighted:!1,options:i,result:void 0,renderRange:void 0};let s=e.additionLines.length>0||e.deletionLines.length>0,c=!s||I_(e)||qD(e,this.getTokenizeMaxLength()),l=!LE(e,this.renderCache.diff),u=!kg(this.renderCache.renderRange,t);if(this.workerManager?.isWorkingPool()===!0)(c||this.renderCache.result==null||!this.renderCache.highlighted&&(l||u))&&(this.renderCache.diff=e,this.renderCache.options=i,this.renderCache.highlighted=!1,(this.renderCache.result==null||l||u||a)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,tD(t)||n?!0:this.expandedHunks,r)),this.renderCache.renderRange=t),!c&&s&&(!this.renderCache.highlighted||a)&&this.workerManager.highlightDiffAST(this,e);else{this.computedLang=e.lang??F_(e.name);let t=this.highlighter!=null&&EE(i.theme),n=this.highlighter!=null&&U_(this.computedLang),r=!c&&n;if(this.highlighter!=null&&t&&(a||c||!this.renderCache.highlighted&&r||this.renderCache.result==null)){let{result:t,options:i}=this.renderDiffWithHighlighter(e,this.highlighter,c||!n);this.renderCache={diff:e,options:i,highlighted:r,result:t,renderRange:void 0}}(!t||!c&&!n)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,t,n,!c)})}return this.renderCache.result==null?void 0:this.processDiffResult(this.renderCache.diff,t,this.renderCache.result)}async asyncRender(e,t=sp){let{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){let{diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o}=this.getOptionsWithDefaults();return NE({type:`diff`,diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){let t=qD(e,this.getTokenizeMaxLength());this.computedLang=t?`text`:e.lang??F_(e.name);let n=this.highlighter!=null&&EE(this.options.theme??ep),r=t||this.highlighter!=null&&U_(this.computedLang);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e),{collapsedContextThreshold:i}=this.getOptionsWithDefaults();return{result:ND(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:i}),options:r}}onHighlightSuccess(e,t,n,r=!0){if(this.renderCache==null)return;let i=!this.renderCache.highlighted||!JE(this.renderCache.options,n)||!LE(this.renderCache.diff,e);this.renderCache={diff:e,options:n,highlighted:r,result:t,renderRange:void 0},i&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){let n=this.workerManager?.getDiffResultCache(e);if(!(n==null||!JE(t,n.options)))return n}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&LE(e,n.diff)&&JE(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){let{diffStyle:a,disableFileHeader:o,expandUnchanged:s,expansionLineCount:c,collapsedContextThreshold:l,hunkSeparators:u}=this.getOptionsWithDefaults();this.diff=e;let d=a===`unified`,f=[],p=[],m=[],h=[],{additionLines:g,deletionLines:_}=n,v={rowCount:0,hunkSeparators:u,additionsContentAST:f,deletionsContentAST:p,unifiedContentAST:m,unifiedGutterAST:Xp(),deletionsGutterAST:Xp(),additionsGutterAST:Xp(),expansionLineCount:c,hunkData:h,incrementRowCount(e=1){v.rowCount+=e},pushToGutter(e,t){switch(e){case`unified`:v.unifiedGutterAST.children.push(t);break;case`deletions`:v.deletionsGutterAST.children.push(t);break;case`additions`:v.additionsGutterAST.children.push(t);break}}},y=zE({fileDiff:e,errorPrefix:`DiffHunksRenderer.processDiffResult`}),b={size:0,side:void 0,increment(){this.size+=1},flush(){if(a!==`unified`){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side===`additions`?(v.pushToGutter(`additions`,Qp(void 0,`buffer`,this.size)),f?.push(YE(this.size))):(v.pushToGutter(`deletions`,Qp(void 0,`buffer`,this.size)),p?.push(YE(this.size))),this.size=0,this.side=void 0}}},x=(e,t,n,r,i)=>{v.pushToGutter(e,Zp(t,n,r,i))};function S(e){b.flush(),a===`unified`?GD(`unified`,e,v):(GD(`deletions`,e,v),GD(`additions`,e,v))}this.pushFileLevelAnnotations(e,a,t,v),VE({diff:e,diffStyle:a,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:s?!0:this.expandedHunks,collapsedContextThreshold:l,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,additionLine:o,deletionLine:s,type:c})=>{let l=s==null?o.splitLineIndex:s.splitLineIndex,d=o==null?s.unifiedLineIndex:o.unifiedLineIndex;a===`split`&&c!==`change`&&b.flush(),r>0&&S({hunkIndex:t,collapsedLines:r,rangeSize:Math.max(n?.collapsedBefore??0,0),hunkSpecs:n?.hunkSpecs,isFirstHunk:t===0,isLastHunk:!1,isExpandable:!e.isPartial});let f=a===`unified`?d:l,p={type:c,hunkIndex:t,lineIndex:f,unifiedLineIndex:d,splitLineIndex:l,deletionLine:s,additionLine:o};if(a===`unified`){let n=this.getUnifiedInjectedRowsForLine?.(p);n?.before!=null&&HD(n.before,v);let r=s==null?void 0:_[s.lineIndex],i=o==null?void 0:g[o.lineIndex];if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let a=c===`change`?o==null?`change-deletion`:`change-addition`:c,u=this.getUnifiedLineDecoration({type:c,lineType:a,additionLineIndex:o?.lineIndex,deletionLineIndex:s?.lineIndex});x(`unified`,u.gutterLineType,o==null?s.lineNumber:o.lineNumber,`${d},${l}`,u.gutterProperties),i==null?r!=null&&(r=KD(r,u.contentProperties)):i=KD(i,u.contentProperties),WD({diffStyle:`unified`,type:c,deletionLine:r,additionLine:i,unifiedSpan:this.getAnnotations(`unified`,s?.lineNumber,o?.lineNumber,t,f),createAnnotationElement:e=>this.createAnnotationElement(e),context:v}),n?.after!=null&&HD(n.after,v)}else{let n=this.getSplitInjectedRowsForLine?.(p);n?.before!=null&&UD(n.before,v,b);let r=s==null?void 0:_[s.lineIndex],i=o==null?void 0:g[o.lineIndex],a=this.getSplitLineDecoration({side:`deletions`,type:c,lineIndex:s?.lineIndex}),u=this.getSplitLineDecoration({side:`additions`,type:c,lineIndex:o?.lineIndex});if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let d=(()=>{if(c===`change`){if(i==null)return`additions`;if(r==null)return`deletions`}})();if(d!=null){if(b.side!=null&&b.side!==d)throw Error(`DiffHunksRenderer.processDiffResult: iterateOverDiff, invalid pending splits`);b.side=d,b.increment()}let m=this.getAnnotations(`split`,s?.lineNumber,o?.lineNumber,t,f);if(m!=null&&b.size>0&&b.flush(),s!=null){let e=KD(r,a.contentProperties);x(`deletions`,a.gutterLineType,s.lineNumber,`${s.unifiedLineIndex},${l}`,a.gutterProperties),e!=null&&(r=e)}if(o!=null){let e=KD(i,u.contentProperties);x(`additions`,u.gutterLineType,o.lineNumber,`${o.unifiedLineIndex},${l}`,u.gutterProperties),e!=null&&(i=e)}WD({diffStyle:`split`,type:c,additionLine:i,deletionLine:r,...m,createAnnotationElement:e=>this.createAnnotationElement(e),context:v}),n?.after!=null&&UD(n.after,v,b)}let m=a===`split`&&n!=null&&l===n.splitLineStart+n.splitLineCount-1,h=m?n.noEOFCRDeletions:!1,C=m?n.noEOFCRAdditions:!1,w=(s?.noEOFCR??!1)||h,T=(o?.noEOFCR??!1)||C;if(T||w){if(a===`split`&&b.flush(),w){let e=c===`context`||c===`context-expanded`?c:`change-deletion`;a===`unified`?(v.unifiedContentAST.push(XE(e)),v.pushToGutter(`unified`,Qp(e,`metadata`,1))):(v.deletionsContentAST.push(XE(e)),v.pushToGutter(`deletions`,Qp(e,`metadata`,1)),T||(v.pushToGutter(`additions`,Qp(void 0,`buffer`,1)),v.additionsContentAST.push(YE(1))))}if(T){let e=c===`context`||c===`context-expanded`?c:`change-addition`;a===`unified`?(v.unifiedContentAST.push(XE(e)),v.pushToGutter(`unified`,Qp(e,`metadata`,1))):(v.additionsContentAST.push(XE(e)),v.pushToGutter(`additions`,Qp(e,`metadata`,1)),w||(v.pushToGutter(`deletions`,Qp(void 0,`buffer`,1)),v.deletionsContentAST.push(YE(1))))}v.incrementRowCount(1)}i>0&&u!==`simple`&&S({hunkIndex:c===`context-expanded`?t:t+1,collapsedLines:i,rangeSize:y,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:!e.isPartial}),v.incrementRowCount(1)}}),a===`split`&&b.flush();let C=Math.max(eD(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),w=t.bufferBefore>0||t.bufferAfter>0,T=!d&&e.type!==`deleted`,E=!d&&e.type!==`new`,D=v.rowCount>0||w;f=T&&D?f:void 0,p=E&&D?p:void 0,m=d&&D?m:void 0;let ee=this.createPreElement(p!=null&&f!=null,C);return{unifiedGutterAST:d&&D?v.unifiedGutterAST.children:void 0,unifiedContentAST:m,deletionsGutterAST:E&&D?v.deletionsGutterAST.children:void 0,deletionsContentAST:p,additionsGutterAST:T&&D?v.additionsGutterAST.children:void 0,additionsContentAST:f,hunkData:h,preNode:ee,themeStyles:r,baseThemeType:i,headerElement:o?void 0:this.renderHeader(this.diff),totalLines:C,rowCount:v.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:``}}renderCodeAST(e,t){let 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;let i=Xp(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,OE(r,t.rowCount)]}renderFullAST(e,t=[]){let n=this.getOptionsWithDefaults().hunkSeparators===`line-info`,r=this.renderCodeAST(`unified`,e);if(r!=null)return t.push(q({tagName:`code`,children:r,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-unified":``}})),{...e.preNode,children:t};let i=this.renderCodeAST(`deletions`,e);i!=null&&t.push(q({tagName:`code`,children:i,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-deletions":``}}));let a=this.renderCodeAST(`additions`,e);return a!=null&&t.push(q({tagName:`code`,children:a,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-additions":``}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return tg(this.renderFullAST(e,t))}renderPartialHTML(e,t){return tg(t==null?e:q({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(!R_(n))return;let i=e.type===`new`?[]:zD(L_(this.deletionAnnotations)),a=e.type===`deleted`?[]:zD(L_(this.additionAnnotations));if(i.length===0&&a.length===0)return;let{createAnnotationElement:o}=this;if(t===`unified`){WD({diffStyle:t,type:`context`,unifiedSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i.concat(a)},createAnnotationElement:o,context:r});return}WD({diffStyle:t,type:`context`,deletionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i},additionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:a},createAnnotationElement:o,context:r})}getAnnotations(e,t,n,r,i){let a={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(t!=null)for(let e of this.deletionAnnotations[t]??[])a.annotations.push(Ag(e));let o={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(n!=null)for(let t of this.additionAnnotations[n]??[])(e===`unified`?a:o).annotations.push(Ag(t));if(e===`unified`)return a.annotations.length>0?a:void 0;if(!(o.annotations.length===0&&a.annotations.length===0))return{deletionSpan:a,additionSpan:o}}renderHeader(e){let{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return AE({fileOrDiff:e,mode:t,stickyHeader:n})}};function zD(e){return e?.map(e=>Ag(e))??[]}var BD=new Intl.PluralRules(`en-US`);function VD(e){return`${e} unmodified line${BD.select(e)===`one`?``:`s`}`}function HD(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter(`unified`,n.gutter),t.incrementRowCount(1)}function UD(e,t,n){for(let{deletion:r,addition:i}of e){if(r==null&&i==null)continue;let e=r!=null&&i!=null?void 0:r==null?`deletions`:`additions`;(e==null||n.side!==e)&&n.flush(),r!=null&&(t.deletionsContentAST.push(r.content),t.pushToGutter(`deletions`,r.gutter)),i!=null&&(t.additionsContentAST.push(i.content),t.pushToGutter(`additions`,i.gutter)),e!=null&&(n.side=e,n.increment()),t.incrementRowCount(1)}}function WD({diffStyle:e,type:t,deletionLine:n,additionLine:r,unifiedSpan:i,deletionSpan:a,additionSpan:o,createAnnotationElement:s,context:c}){let l=!1;if(e===`unified`){if(r==null?n!=null&&c.unifiedContentAST.push(n):c.unifiedContentAST.push(r),i!=null){let e=t===`change`?n==null?`change-addition`:`change-deletion`:t;c.unifiedContentAST.push(s(i)),c.pushToGutter(`unified`,Qp(e,`annotation`,1)),l=!0}}else if(e===`split`){if(n!=null&&c.deletionsContentAST.push(n),r!=null&&c.additionsContentAST.push(r),a!=null){let e=t===`change`?n==null?`context`:`change-deletion`:t;c.deletionsContentAST.push(s(a)),c.pushToGutter(`deletions`,Qp(e,`annotation`,1)),l=!0}if(o!=null){let e=t===`change`?r==null?`context`:`change-addition`:t;c.additionsContentAST.push(s(o)),c.pushToGutter(`additions`,Qp(e,`annotation`,1)),l=!0}}l&&c.incrementRowCount(1)}function GD(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:i,isFirstHunk:a,isLastHunk:o,isExpandable:s},c){if(n<=0)return;let l=e===`unified`?c.unifiedContentAST:e===`deletions`?c.deletionsContentAST:c.additionsContentAST;if(c.hunkSeparators===`metadata`){i!=null&&(c.pushToGutter(e,QE({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),l.push(QE({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1));return}if(c.hunkSeparators===`simple`){t>0&&(c.pushToGutter(e,QE({type:`simple`,isFirstHunk:a,isLastHunk:!1})),l.push(QE({type:`simple`,isFirstHunk:a,isLastHunk:!1})),e!==`additions`&&c.incrementRowCount(1));return}let u=$E(e,t),d=r>c.expansionLineCount,f=s?t:void 0;c.pushToGutter(e,QE({type:c.hunkSeparators,content:VD(n),expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),l.push(QE({type:c.hunkSeparators,content:VD(n),expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1),c.hunkData.push({slotName:u,hunkIndex:t,lines:n,type:e,expandable:s?{up:!a,down:!o,chunked:d}:void 0})}function KD(e,t){return e==null||e.type!==`element`||t==null?e:{...e,properties:{...e.properties,...t}}}function qD(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function JD(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function YD(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}function XD(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:e?.useTokenTransformer,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,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}var ZD=-1,QD=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++ZD}`;type=`file-diff`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;constructor(e={theme:ep},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new Cg,this.scrollSyncManager=new M_,this.interactionManager=new ig(`diff`,ag(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(e){return XD(e)}createHunksRenderer(e){return new RD(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>{if(this.fileDiff==null)return;let n=this.fileDiff.hunks.at(-1),r,i;hunkIterator:for(let a of this.fileDiff.hunks){let o=t===`deletions`?a.deletionStart:a.additionStart,s=t===`deletions`?a.deletionCount:a.additionCount,c=a.splitLineStart,l=a.unifiedLineStart;if(e<o){let t=o-e;r=Math.max(l-t,0),i=Math.max(c-t,0);break hunkIterator}if(e>=o+s){if(a===n){let t=e-(o+s);r=l+a.unifiedLineCount+t,i=c+a.splitLineCount+t;break hunkIterator}continue}for(let n of a.hunkContent)if(n.type===`context`)if(e<o+n.lines){let t=e-o;i=c+t,r=l+t;break hunkIterator}else o+=n.lines,c+=n.lines,l+=n.lines;else{let a=t===`deletions`?n.deletions:n.additions;if(e<o+a){let a=e-o;r=l+(t===`additions`?n.deletions:0)+a,i=c+a;break hunkIterator}else o+=a,c+=Math.max(n.deletions,n.additions),l+=n.deletions+n.additions}break hunkIterator}if(!(r==null||i==null))return[r,i]};setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(ag(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(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType===t?!1:(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!Up(this.appliedThemeCSS.theme,this.options.theme??ep)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e,t){this.interactionManager.setSelection(e,t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{diffStyle:e=`split`,overflow:t=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,t===`wrap`),t===`scroll`&&e===`split`?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}cleanUp(e=!1){this.emitPostRender(!0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(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=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),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,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){let{fileContainer:t,prerenderedHTML:n,preventEmit:r=!1,lineAnnotations:i,oldFile:a,newFile:o,fileDiff:s}=e;this.hydrateElements(t,n),tO(this.pre,$D({fileDiff:s,oldFile:a,newFile:o}),this.options.collapsed)||nO(this.headerElement,eO({fileDiff:s,oldFile:a,newFile:o}),this.options.disableFileHeader)?this.render({...e,preventEmit:!0}):this.hydrationSetup({fileDiff:s,oldFile:a,newFile:o,lineAnnotations:i}),r||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),Zg(e,t);for(let t of e.shadowRoot?.children??[]){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t;for(let e of t.children)!(e instanceof HTMLElement)||e.tagName.toLowerCase()!==`code`||(`deletions`in e.dataset&&(this.codeDeletions=e),`additions`in e.dataset&&(this.codeAdditions=e),`unified`in e.dataset&&(this.codeUnified=e));continue}if(`diffsHeader`in t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:r}){this.lineAnnotations=r??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!=null&&n!=null?j_(t,n,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=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.rerender()};render({oldFile:e,newFile:t,fileDiff:n,deferManagers:r=!1,forceRender:i=!1,preventEmit:a=!1,lineAnnotations:o,fileContainer:s,containerWrapper:c,renderRange:l}){if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);let{collapsed:u=!1,themeType:d=`system`}=this.options,f=u?void 0:l,p=this.hasThemeChanged(),m=e!=null&&t!=null&&(!Og(e,this.deletionFile)||!Og(t,this.additionFile)),h=n!=null&&n!==this.fileDiff,g=o!=null&&(o.length>0||this.lineAnnotations.length>0)?o!==this.lineAnnotations:!1;if(!u&&kg(f,this.renderRange)&&!i&&!g&&!p&&(n!=null&&n===this.fileDiff||n==null&&!m))return this.applyCachedThemeState(d);let{renderRange:_}=this;if(this.renderRange=f,this.deletionFile=e,this.additionFile=t,n==null?e!=null&&t!=null&&m&&(h=!0,this.fileDiff=j_(e,t,this.options.parseDiffOptions)):this.fileDiff=n,h&&(this.cachedHeaderHTML=void 0),o!=null&&this.setLineAnnotations(o),this.fileDiff==null)return!1;this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:v=!1,disableFileHeader:y=!1}=this.options;if(y&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),s=this.getOrCreateFileContainer(s,c),this.applyCachedThemeState(d),u){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,cp);e!=null&&this.applyThemeState(s,e.themeStyles,d,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,s),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(v)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,s)}return a||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(s);if(!(this.canPartiallyRender(i,g,m||h||p)&&this.applyPartialRender({previousRenderRange:_,renderRange:f}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,f);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(s,t.themeStyles,d,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,s),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,f),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,r||this.flushManagers()}catch(e){if(v)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,s)}return a||this.emitPostRender(),!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}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(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}primeHighlightCache(){let{fileDiff:e,workerManager:t}=this;if(e==null||t==null||I_(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||t.primeDiffHighlightCache(e)}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.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.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(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!=`function`){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){let e=r.slotName,i=this.separatorCache.get(e);if(i==null||!YD(r,i.hunkData)){i?.element.remove();let n=document.createElement(`div`);n.style.display=`contents`,n.slot=r.slotName;let a=t(r,this);a!=null&&n.appendChild(a),this.fileContainer.appendChild(n),i={element:n,hunkData:r},this.separatorCache.set(e,i)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(let[n,r]of this.lineAnnotations.entries()){let i=`${n}-${Ag(r)}`,a=this.annotationCache.get(i);if(a==null||!JD(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:Fg(Ag(r)),annotation:r},a.element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(i,a)}e.delete(i)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=Ig();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:Wp(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):Wp(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=jg;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.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,t.appendChild(this.pre)):this.pre.parentNode!==t&&(t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(let t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute(`data-unified`)?this.codeUnified=t:t.hasAttribute(`data-deletions`)?this.codeDeletions=t:t.hasAttribute(`data-additions`)&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:n}=this,r=this.cachedHeaderHTML??tg(e);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=r;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged||n==null)return;let{renderCustomHeader:i,renderHeaderPrefix:a,renderHeaderMetadata:o}=this.options;if(i!=null){let e=i(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,$f,e),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0;return}let s=a?.(n)??void 0,c=o?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,Zf,s),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,Qf,c),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}this.unsafeCSSStyle?.parentNode===t&&this.appliedUnsafeCSS===e||(this.unsafeCSSStyle??=Lg(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=Wg(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??ep,s=typeof o==`string`?o:{...o},c=zg(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c};return}this.themeCSSStyle=Yg({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:Gg(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=Kg(this.themeCSSStyle.textContent??``,zg(e)))}applyHunksToDOM(e,t){let{overflow:n=`scroll`}=this.options,r=(this.options.hunkSeparators??`line-info`)===`line-info`,i=n===`wrap`?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let a=!1,o=[],s=this.hunksRenderer.renderCodeAST(`unified`,t),c=this.hunksRenderer.renderCodeAST(`deletions`,t),l=this.hunksRenderer.renderCodeAST(`additions`,t);s==null?c!=null||l!=null?(c==null?(this.codeDeletions?.remove(),this.codeDeletions=void 0):(a=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=Jg({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(c),o.push(this.codeDeletions)),l==null?(this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=a||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=Jg({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(l),o.push(this.codeAdditions))):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=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=Jg({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s),o.push(this.codeUnified)),o.length===0?e.textContent=``:a&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:a,options:{diffStyle:o=`split`}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;let s=this.getCodeColumns(o,r,a,i);if(s==null)return!1;let c=e.startingLine,l=t.startingLine,u=c+e.totalLines,d=l+t.totalLines,f=Math.max(c,l),p=Math.min(u,d);if(p<=f)return!1;let m=Math.max(0,f-c),h=Math.max(0,u-p),g=this.trimColumns({columns:s,trimStart:m,trimEnd:h,previousStart:c,overlapStart:f,overlapEnd:p,diffStyle:o});if(g<0)throw Error(`applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<g)throw Error(`applyPartialRender: trimmed beyond DOM row count`);let _=this.lastRowCount-g,v=(e,t)=>{if(!(t<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},y=v(l,Math.max(f-l,0));if(y==null&&l<f)return!1;let b=v(p,Math.max(d-p,0));if(b==null&&d>p)return!1;let x=(e,t)=>{if(e!=null){if(o===`unified`&&!Array.isArray(s))this.insertPartialHTML(o,s,e,t);else if(o===`split`&&Array.isArray(s))this.insertPartialHTML(o,s,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);_+=e.rowCount}};return this.cleanupErrorWrapper(),x(y,`afterbegin`),x(b,`beforeend`),this.lastRowCount!==_&&(this.applyRowSpan(o,s,_),this.lastRowCount=_),!0}insertPartialHTML(e,t,n,r){if(e===`unified`&&!Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`unified`,n);this.renderPartialColumn(t,e,r)}else if(e===`split`&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`deletions`,n),i=this.hunksRenderer.renderCodeAST(`additions`,n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error(`FileDiff.insertPartialHTML: Invalid argument composition`)}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=rO(t[0]),i=rO(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let o=i.at(-1);n===`afterbegin`&&o?.type===`element`&&typeof o.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(o.properties[`data-buffer-size`],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.content.style.setProperty(`grid-row`,`span ${n}`))};if(e===`unified`&&!Array.isArray(t))r(t);else if(e===`split`&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a<c.length&&!(t<=0&&!s&&!o);){let e=l[a],u=c[a];if(a++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: invalid row elements`);if(o&&(o=!1,e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset||e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset)){e.remove(),u.remove(),i++;continue}if(`lineIndex`in e.dataset&&`lineIndex`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n,t===0&&r===0&&(o=!0)}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}else throw console.error({diffStyle:t,columns:e}),Error(`FileDiff.trimColumns: Invalid columns for diffType`)}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??``,10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty(`grid-row`,`span ${t}`),e.style.setProperty(`min-height`,`calc(${t} * 1lh)`)}getCodeColumns(e,t,n,r){function i(e){if(e==null)return;let t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}if(e===`unified`)return i(t);{let e=i(n),t=i(r);return e!=null||t!=null?[e,t]:void 0}}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.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(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){let{diffIndicators:a=`bars`,disableBackground:o=!1,disableLineNumbers:s=!1,overflow:c=`scroll`,diffStyle:l=`split`}=this.options,u={type:`diff`,diffIndicators:a,disableBackground:o,disableLineNumbers:s,overflow:c,split:l===`unified`?!1:t!=null&&n!=null,totalLines:r,customProperties:i};Mg(u,this.appliedPreAttributes)||(Qg(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement(`pre`);i.dataset.errorStack=``,i.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function $D({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function eO({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function tO(e,t,n=!1){return!n&&e==null&&t}function nO(e,t,n=!1){return e==null&&t&&!n}function rO(e){if(!(e==null||e.type!==`element`))return e.children??[]}var iO=F(`<div>`),aO=F(`<div class=diff-viewer>`),oO=F(`<p class=empty>No diff is available for this file.`);function sO(e){let[t,n]=C(),r;function i(){return new QD({diffStyle:`split`,hunkSeparators:`line-info`,lineDiffType:`word`,overflow:`scroll`,theme:{dark:`github-dark`,light:`github-light`},themeType:`light`})}function a(){r?.cleanUp(),r=void 0}let o=E(()=>{let t=(e.selectedPath?Zu(e.diff,e.selectedPath):e.diff)?.trim()??``;if(t.length!==0)return xp(t,`review-diff`).flatMap(e=>e.files)[0]});return T(()=>{let e=o(),n=t();if(!n||!e){a();return}a(),r=i(),r.render({fileDiff:e,containerWrapper:n,forceRender:!0})}),te(a),(()=>{var e=aO();return I(e,Ce(Ee,{get when(){return o()},get fallback(){return oO()},get children(){var e=iO();return Ne(n,e),e}})),e})()}var cO=F(`<p class=empty>Load a PR to see its changed files.`),lO=F(`<div class=file-tree><div class=file-tree-mount>`),uO=F(`<details class=grouping-progress><summary><span></span><span></span></summary><ol>`),dO=F(`<li><span class=grouping-step-state></span><span>`),fO=F(`<p class=empty>Run grouping to organize this PR for review.`),pO=F(`<div class=group-list><button type=button class=group-item><strong>All changes</strong><span> groups`),mO=F(`<button type=button class=group-item><strong></strong><span></span><small> files, <!> chunks`),hO=F(`<section class=empty-state><h2>Load a pull request</h2><p>Enter an explicit repository and PR number, or leave the repository blank to use the one in the directory where this command was started.`),gO=F(`<main class=app-shell><section class=review-header><div><p class=eyebrow>@wes-dev/pr</p><h1>Pull request review</h1></div><form class=pr-loader><label class=repository-input>Repository<input type=text placeholder=owner/repo></label><label>PR number<input type=text min=1 inputmode=numeric></label><button type=submit>Load PR`),_O=F(`<p class=pr-context> #`),vO=F(`<p class=error>`),yO=F(`<p>`),bO=F(`<section class=pr-summary><div><h2></h2></div><div class=header-actions><a target=_blank rel=noreferrer>Open on GitHub</a><button type=button class=primary>Group changes`),xO=F(`<section class=review-grid><aside class="panel group-panel"><div class=panel-heading><h2>Logical groups</h2><span></span></div></aside><section class="panel diff-panel"><div class=panel-heading><h2>Diff</h2><span></span></div></section><aside class="panel file-panel"><div class=panel-heading><h2>Files</h2><span>`),SO=F(`<ul class=draft-list>`),CO=F(`<div class=current-comments>`),wO=F(`<section class=review-actions><section class="panel draft-panel"><div class=panel-heading><h2>Draft inline comment</h2><span> drafts</span></div><div class=form-content><p class=comment-target></p><div class=inline-fields><label>Side<select><option value=right>New (right)</option><option value=left>Old (left)</option></select></label><label>Line<input type=number min=1></label></div><label>Comment<textarea></textarea></label><button type=button>Add draft comment</button></div></section><section class="panel submit-panel"><div class=panel-heading><h2>Review</h2><button type=button>Refresh GitHub comments</button></div><div class=form-content><label>Decision<select><option value=pending>Choose a decision</option><option value=comment>Comment</option><option value=approve>Approve</option><option value=request-changes>Request changes</option></select></label><label>Review body<textarea></textarea></label><div class=submit-actions><button type=button>Save draft</button><button type=button class=primary>Submit review`),TO=F(`<li><strong>:</strong><span>`),EO=F(`<article><strong></strong><span></span><p>`);function DO(e){return e.status===`added`?`added`:e.status===`removed`?`deleted`:`modified`}function OO(e){let t,n,r=``,i=E(()=>e.files.map(e=>e.path)),a=E(()=>e.files.map(e=>({path:e.path,status:DO(e)})));return ee(()=>{if(!t)return;let o=i();r=kO(o),n=new Xu({density:`compact`,flattenEmptyDirectories:!0,gitStatus:a(),initialExpansion:`open`,initialSelectedPaths:e.activePath?[e.activePath]:[],paths:o,onSelectionChange:t=>{let[n]=t;n&&e.onSelect(n)}}),n.render({containerWrapper:t})}),T(()=>{let e=i(),t=kO(e);n&&t!==r&&(n.resetPaths(e,{initialExpandedPaths:e}),r=t),n?.setGitStatus(a())}),T(()=>{let t=e.activePath;if(!t)return;let r=n?.getItem(t);r&&!r.isSelected()&&r.select(),n?.scrollToPath(t,{focus:!1,offset:`nearest`})}),te(()=>{n?.cleanUp()}),(()=>{var n=lO(),r=n.firstChild;return Ne(e=>{t=e},r),I(n,Ce(Ee,{get when(){return e.files.length===0},get children(){return cO()}}),null),n})()}function kO(e){return e.join(`\0`)}function AO(e){return e instanceof Error?e.message:String(e)}function jO(e){return(()=>{var t=uO(),n=t.firstChild,r=n.firstChild,i=r.nextSibling,a=n.nextSibling;return I(i,()=>e.grouping.message??`Grouping changes`),I(a,Ce(Te,{get each(){return e.grouping.steps},children:e=>(()=>{var t=dO(),n=t.firstChild.nextSibling;return I(n,()=>e.label),w(()=>je(t,`data-state`,e.state)),t})()})),w(n=>{var i=e.grouping.state===`running`,a=`grouping-state ${e.grouping.state}`;return i!==n.e&&(t.open=n.e=i),a!==n.t&&Me(r,n.t=a),n},{e:void 0,t:void 0}),t})()}function MO(e){return(()=>{var t=pO(),n=t.firstChild,r=n.firstChild.nextSibling,i=r.firstChild;return n.$$click=()=>e.onSelect(void 0),I(r,()=>e.groups.length,i),I(t,Ce(Te,{get each(){return e.groups},children:t=>(()=>{var n=mO(),r=n.firstChild,i=r.nextSibling,a=i.nextSibling,o=a.firstChild,s=o.nextSibling;return s.nextSibling,n.$$click=()=>e.onSelect(t.id),I(r,()=>t.title),I(i,()=>t.summary),I(a,()=>t.files.length,o),I(a,()=>t.chunks.length,s),w(r=>{var i=t.id===e.selectedGroupId,a=t.id===e.selectedGroupId;return i!==r.e&&n.classList.toggle(`selected`,r.e=i),a!==r.t&&je(n,`aria-pressed`,r.t=a),r},{e:void 0,t:void 0}),n})()}),null),I(t,Ce(Ee,{get when(){return e.groups.length===0},get children(){return fO()}}),null),w(t=>{var r=!e.selectedGroupId,i=!e.selectedGroupId;return r!==t.e&&n.classList.toggle(`selected`,t.e=r),i!==t.t&&je(n,`aria-pressed`,t.t=i),t},{e:void 0,t:void 0}),t})()}function NO(){let[e,t]=C(``),[n,r]=C(``),[i,a]=C(),[o,s]=C(),[c,l]=C(),[u,d]=C(``),[f,p]=C(``),[m,h]=C(`right`),[g,_]=C(`pending`),[v,y]=C(``),[b,x]=C([]),[S,D]=C(),[O,k]=C(),A,j=E(()=>i()?.files??[]),M=E(()=>i()?.groups.find(e=>e.id===o())),N=E(()=>{let e=M();return e?j().filter(t=>e.files.includes(t.path)):j()}),ne=E(()=>c()??N()[0]?.path),re=E(()=>{let e=i(),t=M(),n=ne();if(!e)return``;if(!t)return e.diff;if(!n)return``;let r=e.chunks.filter(e=>e.path===n&&t.files.includes(n)).map(e=>e.id);return r.length===0?e.diff:Qu(e.diff,e.chunks,r)});T(()=>{let e=N(),t=c();t&&!e.some(e=>e.path===t)&&l(e[0]?.path)}),T(()=>{o()&&!M()&&s(void 0)}),T(()=>{let e=i(),t=e?.grouping.state===`running`?e.id:void 0;t!==A?.sessionId&&(se(),t&&oe(t))}),te(se),ee(()=>{(async()=>{try{let e=await Uf.review.initialPullRequest.query();e.target&&(t(e.target.repository??``),r(String(e.target.number)),await ie(e.target))}catch(e){k(AO(e))}})()});async function ie(r){let i=r?.number??Number(n()),o=r?.repository??(e().trim()||void 0);if(!Number.isInteger(i)||i<=0){k(`Enter a positive pull request number.`);return}D(`load`),k(void 0);try{let e=await Uf.review.loadPullRequest.mutate({repository:o,number:i});a(e),s(void 0),t(e.pullRequest.repository),l(e.files[0]?.path),_(e.decision.decision),y(e.decision.body),x([]),d(``),p(``)}catch(e){k(AO(e))}finally{D(void 0)}}function ae(e){s(e);let t=e?j().filter(t=>i()?.groups.find(t=>t.id===e)?.files.includes(t.path)):j();t.some(e=>e.path===c())||l(t[0]?.path)}function oe(e){let t={cancelled:!1,inFlight:!1,interval:0,sessionId:e},n=async()=>{if(!(t.cancelled||t.inFlight||i()?.id!==e)){t.inFlight=!0;try{let n=await Uf.review.getSession.query({sessionId:e});!t.cancelled&&i()?.id===e&&a(n)}catch(e){t.cancelled||k(AO(e))}finally{t.inFlight=!1}}};t.interval=window.setInterval(()=>{n()},750),A=t,n()}function se(){A&&=(A.cancelled=!0,window.clearInterval(A.interval),void 0)}function ce(e){let n=ed(e);if(n?.repository){t(n.repository),r(String(n.number));return}t(e)}function le(e){let n=ed(e);if(n?.repository){t(n.repository),r(String(n.number));return}r(e)}async function ue(){let e=i();if(e){D(`groups`),k(void 0);try{a(await Uf.review.groupChanges.mutate({sessionId:e.id}))}catch(t){try{a(await Uf.review.getSession.query({sessionId:e.id}))}catch{}k(AO(t))}finally{D(void 0)}}}async function de(){let e=i(),t=ne(),n=Number(f());if(!(!e||!t||!u().trim())){if(!Number.isInteger(n)||n<=0){k(`Set the visible diff line for this draft comment.`);return}D(`comment`),k(void 0);try{a(await Uf.review.addDraftComment.mutate({sessionId:e.id,filePath:t,line:n,side:m(),body:u().trim()})),d(``)}catch(e){k(AO(e))}finally{D(void 0)}}}async function fe(){let e=i();if(e){D(`decision`),k(void 0);try{a(await Uf.review.setDecisionDraft.mutate({sessionId:e.id,decision:{decision:g(),body:v()}}))}catch(e){k(AO(e))}finally{D(void 0)}}}async function pe(){let e=i();if(e){D(`comments`),k(void 0);try{x(await Uf.review.listCurrentComments.query({sessionId:e.id}))}catch(e){k(AO(e))}finally{D(void 0)}}}async function me(){let e=i();if(!(!e||g()===`pending`)){D(`submit`),k(void 0);try{await Uf.review.setDecisionDraft.mutate({sessionId:e.id,decision:{decision:g(),body:v()}}),a(await Uf.review.submitReview.mutate({sessionId:e.id})),_(`pending`),y(``),x([])}catch(e){k(AO(e))}finally{D(void 0)}}}return(()=>{var t=gO(),r=t.firstChild.firstChild;r.firstChild.nextSibling;var a=r.nextSibling,s=a.firstChild,c=s.firstChild.nextSibling,x=s.nextSibling,C=x.firstChild.nextSibling,T=x.nextSibling;return I(r,Ce(Ee,{get when(){return i()},children:e=>(()=>{var t=_O(),n=t.firstChild;return I(t,()=>e().pullRequest.repository,n),I(t,()=>e().pullRequest.number,null),t})()}),null),a.addEventListener(`submit`,e=>{e.preventDefault(),ie()}),c.$$input=e=>ce(e.currentTarget.value),C.$$input=e=>le(e.currentTarget.value),I(t,Ce(Ee,{get when(){return O()},children:e=>(()=>{var t=vO();return I(t,e),t})()}),null),I(t,Ce(Ee,{get when(){return i()},children:e=>[(()=>{var t=bO(),n=t.firstChild,r=n.firstChild,i=n.nextSibling.firstChild,a=i.nextSibling;return I(r,()=>e().pullRequest.title),I(n,Ce(Ee,{get when(){return e().pullRequest.body},get children(){var t=yO();return I(t,()=>e().pullRequest.body),t}}),null),a.$$click=ue,w(t=>{var n=e().pullRequest.url,r=!!S()||e().grouping.state===`running`;return n!==t.e&&je(i,`href`,t.e=n),r!==t.t&&(a.disabled=t.t=r),t},{e:void 0,t:void 0}),t})(),(()=>{var t=xO(),n=t.firstChild,r=n.firstChild.firstChild.nextSibling,i=n.nextSibling,a=i.firstChild.firstChild.nextSibling,s=i.nextSibling,c=s.firstChild.firstChild.nextSibling;return I(r,()=>e().groups.length),I(n,Ce(Ee,{get when(){return e().grouping.state!==`idle`},get children(){return Ce(jO,{get grouping(){return e().grouping}})}}),null),I(n,Ce(MO,{get groups(){return e().groups},get selectedGroupId(){return o()},onSelect:ae}),null),I(a,()=>ne()??`No file selected`),I(i,Ce(sO,{get diff(){return re()},get selectedPath(){return ne()}}),null),I(c,()=>N().length),I(s,Ce(OO,{get activePath(){return ne()},get files(){return N()},onSelect:l}),null),t})(),(()=>{var t=wO(),n=t.firstChild,r=n.firstChild,i=r.firstChild.nextSibling,a=i.firstChild,o=r.nextSibling,s=o.firstChild,c=s.nextSibling,l=c.firstChild,x=l.firstChild.nextSibling,C=l.nextSibling.firstChild.nextSibling,T=c.nextSibling,E=T.firstChild.nextSibling,D=T.nextSibling,ee=n.nextSibling.firstChild,te=ee.firstChild.nextSibling,O=ee.nextSibling,k=O.firstChild,A=k.firstChild.nextSibling,j=k.nextSibling,M=j.firstChild.nextSibling,N=j.nextSibling.firstChild,re=N.nextSibling;return I(i,()=>e().draftComments.length,a),I(s,()=>ne()??`Select a file`),x.addEventListener(`change`,e=>h(e.currentTarget.value)),C.$$input=e=>p(e.currentTarget.value),E.$$input=e=>d(e.currentTarget.value),D.$$click=de,I(o,Ce(Ee,{get when(){return e().draftComments.length>0},get children(){var t=SO();return I(t,Ce(Te,{get each(){return e().draftComments},children:e=>(()=>{var t=TO(),n=t.firstChild,r=n.firstChild,i=n.nextSibling;return I(n,()=>e.filePath,r),I(n,()=>e.line,null),I(i,()=>e.body),t})()})),t}}),null),te.$$click=pe,A.addEventListener(`change`,e=>_(e.currentTarget.value)),M.$$input=e=>y(e.currentTarget.value),N.$$click=fe,re.$$click=me,I(O,Ce(Ee,{get when(){return b().length>0},get children(){var e=CO();return I(e,Ce(Te,{get each(){return b()},children:e=>(()=>{var t=EO(),n=t.firstChild,r=n.nextSibling,i=r.nextSibling;return I(n,()=>e.author),I(r,(()=>{var t=De(()=>!!e.filePath);return()=>t()?`${e.filePath}:${e.line??``}`:`General comment`})()),I(i,()=>e.body),t})()})),e}}),null),w(e=>{var t=!!S()||!ne(),n=!!S(),r=!!S(),i=!!S()||g()===`pending`;return t!==e.e&&(D.disabled=e.e=t),n!==e.t&&(te.disabled=e.t=n),r!==e.a&&(N.disabled=e.a=r),i!==e.o&&(re.disabled=e.o=i),e},{e:void 0,t:void 0,a:void 0,o:void 0}),w(()=>x.value=m()),w(()=>C.value=f()),w(()=>E.value=u()),w(()=>A.value=g()),w(()=>M.value=v()),t})()]}),null),I(t,Ce(Ee,{get when(){return De(()=>!i())()&&!O()},get children(){return hO()}}),null),w(()=>T.disabled=!!S()),w(()=>c.value=e()),w(()=>C.value=n()),t})()}Ae([`click`,`input`]);var PO=document.getElementById(`root`);if(!PO)throw Error(`Missing root element.`);ke(()=>Ce(NO,{}),PO);export{t};
2822
+ \v\f…\u2028\u2029])`),t));else if(c===`posix`)if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${hw(e.codePointAt(0)-1)}${hw(e.codePointAt(2)+1)}-\u{10FFFF}`),n(sT(iT(`[${e}]`),t))}else n(sT(aT(iT(Nw.get(u)),l),t));else if(c===`property`)kw.has(LC(u))||(e.key=`sc`);else if(c===`space`)n(oT(kC(`space`,{negate:l}),t));else if(c===`word`)n(sT(aT(iT(Dw),l),t));else throw Error(`Unexpected character set kind "${c}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`)if(!c.enable&&!c.disable)r();else{let e=SC({flags:c});e.body[0].body=o(),i(sT(e,t),{traverse:!0})}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&$S(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error($`Uses "\K" in a way that's unsupported`);let o=CC({behind:!0});o.body[0].body=a(),i(sT(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),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;let{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){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(sT(CC({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=SC();t.body[0].body.push(e.body),e.body=sT(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=Qw(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error($`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!rT(n)&&(n=Jw(n,t),e.ref=n)}},Bw={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=oT(Kw(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&yw(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=yw(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},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=vw(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&!(n.type===`CapturingGroup`&&(n.name===a||n.number===a)););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?Kw(0):Gw(o,r.groupOriginByCopy,null),l=c;if(!s){let e=Yw(qw(o,e=>e.type===`Group`&&!!e.flags)),t=e?vw(r.globalFlags,e):r.globalFlags;Uw(t,r.currentFlags)||(l=SC({flags:Xw(t)}),l.body[0].body.push(c))}n(sT(l,t),{traverse:!s})}},Vw={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>Ww(t,e));i.length?i.length>1?n(sT(SC({atomic:!0,body:i.reverse().map(e=>fC({body:[mC(e.number)]}))}),t)):e.ref=i[0].number:n(sT(CC({negate:!0}),t))},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){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=hC();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function Hw(e){BC(e,{"*"({node:e,parent:t}){e.parent=t}})}function Uw(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function Ww(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=Zw(n.parent);for(let r of t){if(r===n)break;if(r===e||$w(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function Gw(e,t,n,r){let i=Array.isArray(e)?[]:{};for(let[a,o]of Object.entries(e))a===`parent`?i.parent=Array.isArray(n)?r:n:o&&typeof o==`object`?i[a]=Gw(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function Kw(e){let t=OC(e);return t.isRecursive=!0,t}function qw(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Jw(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu,`_`)}`;return t.set(e,n),n}function Yw(e){let t=[`dotAll`,`ignoreCase`],n={enable:{},disable:{}};return e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Xw({dotAll:e,ignoreCase:t}){let 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 Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Qw(e){let t=e.find(e=>e.kind===`search_start`||nT(e,{negate:!1})||!eT(e));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`){let e=[];for(let n of t.body){let t=Qw(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function $w(e,t){let n=Zw(e)??[];for(let e of n)if(e===t||$w(e,t))return!0;return!1}function eT({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function tT(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function nT(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&$S(e.body[0],{type:`Assertion`,kind:`search_start`})}function rT(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function iT(e,t){let n=nC(e,{...t,unicodePropertyMap:kw}).body;return n.length>1||n[0].body.length>1?SC({body:n}):n[0].body[0]}function aT(e,t){return e.negate=t,e}function oT(e,t){return e.parent=t,e}function sT(e,t){return Hw(e),e.parent=t,e}function cT(e,t){let n=ww(t),r=bw(n.target,`ES2024`),i=bw(n.target,`ES2025`),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw Error(`Invalid recursionLimit; use 2-20`);let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];BC(e,lT,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let c={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!s)},l=e,u={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!i&&o&&s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(e){return u.lastNode=l,l=e,xw(uT[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let f={pattern:e.body.map(d).join(`|`),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&f._hiddenCaptures.push(t),e.transferTo&&yw(f._captureTransfers,e.transferTo,[]).push(t)}),f}var lT={"*":{enter({node:e},t){if(ST(e)){let n=t.getCurrentModI();t.pushModI(e.flags?vw({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){ST(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){gT(hw(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),_T(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&Lw.has(e.value)&&t.setHasCasedChar()}},uT={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?$`\B`:$`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!=`number`)throw Error(`Unexpected named backref in transformed AST`);if(!t.useFlagMods&&t.accuracy===`strict`&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error(`Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy`);return`\\`+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(o.hidden=!0,a>s.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:``}${r.map(n).join(`|`)})`},Character({value:e},t){let n=hw(e),r=vT(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&gT(n)){let e=Ow(n);return t.inCharClass?e.join(``):e.length>1?`[${e.join(``)}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if(r===`intersection`&&!t.useFlagV)throw Error(`Use of character class intersection requires min target ES2024`);gw.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(wT)&&(o=[gC(45),...o.filter(e=>!wT(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||gw.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=SC(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=fC({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let c=o[0];if(r===`union`&&!i&&c&&((!t.useFlagV||!t.verbose)&&a.kind===`union`&&!(gw.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind===`intersection`&&o.length===1&&c.type!==`CharacterClassRange`))return o.map(n).join(``);if(!t.useFlagV&&a.type===`CharacterClass`)throw Error(`Uses nested character class in a way that requires min target ES2024`);return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=vT(n,i),o=vT(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&yT(_T(e)).forEach(e=>{s.add(Array.isArray(e)?`${vT(e[0],i)}-${vT(e[1],i)}`:vT(e,i))}),`${a}-${o}${[...s].join(``)}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e===`dot`)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?`.`:`[^]`:$`[^\n]`;if(e===`digit`)return t?$`\D`:$`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&Lw.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?$`\P`:$`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?$`\W`:$`\w`;throw 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},i,a){let o=i.currentFlags;n&&(i.currentFlags=vw(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${bT(e,n,i.useFlagMods)}${s})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t===`lookahead`?``:`<`}${n?`!`:`=`}`}${e.map(i).join(`|`)})`},Quantifier(e,t,n){return n(e.body)+xT(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error(`Unexpected non-recursive subroutine in transformed AST`);let r=n.recursionLimit;return t===0?`(?R=${r})`:$`\g<${t}&R=${r}>`}},dT=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),fT=new Set([`-`,`\\`,`]`,`^`,`[`]),pT=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),mT=new Map([[9,$`\t`],[10,$`\n`],[11,$`\v`],[12,$`\f`],[13,$`\r`],[8232,$`\u2028`],[8233,$`\u2029`],[65279,$`\uFEFF`]]),hT=/^\p{Cased}$/u;function gT(e){return hT.test(e)}function _T(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return a;for(let e=r;e<=i;e++){let t=hw(e);if(!gT(t))continue;let o=Ow(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function vT(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(mT.has(e))return mT.get(e);if(e<32||e>126&&e<160||e>262143||t&&CT(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?pT:fT:dT,a=hw(e);return(i.has(a)?`\\`:``)+a}function yT(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?r??=t[e]:r===null?n.push(t[e]):(n.push([r,t[e]]),r=null);return n}function bT(e,t,n){if(e)return`>`;let r=``;if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?`i`:``)+(e?.dotAll?`s`:``)+(n?`-`:``)+(n?.ignoreCase?`i`:``)+(n?.dotAll?`s`:``)}return`${r}:`}function xT({kind:e,max:t,min:n}){let r;return r=!n&&t===1?`?`:!n&&t===1/0?`*`:n===1&&t===1/0?`+`:n===t?`{${n}}`:`{${n},${t===1/0?``:t}}`,r+{greedy:``,lazy:`?`,possessive:`+`}[e]}function ST({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function CT(e){return e>47&&e<58}function wT({type:e,value:t}){return e===`Character`&&t===45}var TT=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||`(?:)`}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw Error(`Cannot provide options when copying a regexp`);let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?``:t,n),this.#n=t,this.#e=DT(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#i===`clip_search`&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(ET(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n=[...t];t.length=1;let r;this.hasIndices&&(r=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e<n.length;e++){let{hidden:a,transferTo:o}=this.#e.get(e)??{};if(a?i.push(null):(i.push(t.length),t.push(n[e]),this.hasIndices&&t.indices.push(r[e])),o&&n[e]!==void 0){let a=i[o];if(!a)throw Error(`Invalid capture transfer to "${a}"`);if(t[a]=n[e],this.hasIndices&&(t.indices[a]=r[e]),t.groups){this.#r||=OT(this.source);let i=this.#r.get(o);i&&(t.groups[i]=n[e],this.hasIndices&&(t.indices.groups[i]=r[e]))}}}return t}};function ET(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e<n.length;e++){let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])}let r=n.groups;r&&Object.keys(r).forEach(e=>{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}function DT(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)yw(n,t,{}).transferTo=e;return n}function OT(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,i=0,a;for(;a=t.exec(e);){let{0:e,groups:{capture:t,name:o}}=a;e===`[`?r++:r?e===`]`&&r--:t&&(i++,o&&n.set(i,o))}return n}function kT(e,t){let n=AT(e,t);return n.options?new TT(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function AT(e,t){let n=ww(t),r=Rw(nC(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:kw}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=cT(r,n),a=lw(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=$C(nw(a.pattern).pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),s={pattern:o.pattern,flags:`${n.hasIndices?`d`:``}${n.global?`g`:``}${i.flags}${i.options.disable.v?`u`:`v`}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw Error(`Lazy compilation requires subclass`)}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=s.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(s.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return s}function jT(e,t){return kT(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function MT(e={}){let t={target:`auto`,cache:new Map,...e};return t.regexConstructor||=e=>jT(e,{target:t.target}),{createScanner(e){return new cS(e,t)},createString(e){return{content:e}}}}async function NT(e){if(H_())throw 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.`);let t=L_.get(e);if(t!=null)return t;try{let t=R_.get(e);if(t==null&&Object.prototype.hasOwnProperty.call(Y_,e)&&(t=Y_[e]),t==null)throw Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);let n=t().then(({default:t})=>{let n={name:e,data:t};return I_.has(e)||I_.set(e,n),n});return L_.set(e,n),await n}finally{L_.delete(e)}}function PT(e){return I_.get(e)??NT(e)}function FT(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var IT=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},LT=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},RT=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function zT(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new IT(t);e.set(t,n)}function a(t,n){return e.has(t)?!1:(e.set(t,n),!0)}function o(t){return e.has(t)}function s(i){let a=t.get(i);if(a!==void 0)return Promise.resolve(a);let o=n.get(i);if(o!==void 0)return o;let s=e.get(i);if(s===void 0)return Promise.reject(new LT(i));let c=r,l=s().then(e=>{let a=FT(e);return c===r&&t.set(i,a),n.get(i)===l&&n.delete(i),a}).catch(e=>{throw n.get(i)===l&&n.delete(i),e});return n.set(i,l),l}function c(e){return Promise.all(e.map(e=>s(e)))}function l(e,n){t.set(e,n)}function u(e){for(let[t,n]of e)l(t,n)}function d(e){return t.get(e)}function f(e){let n=[];for(let r of e){let e=t.get(r);if(e===void 0)throw new RT(r);n.push(e)}return n}function p(e){return t.has(e)}function m(e){for(let n of e)if(!t.has(n))return!1;return!0}function h(e){let n=t.get(e);return n===void 0?s(e):n}function g(){r++,t.clear(),n.clear()}return{clearResolvedThemes:g,getResolvedOrResolveTheme:h,getResolvedTheme:d,getResolvedThemes:f,hasRegisteredTheme:o,hasResolvedTheme:p,hasResolvedThemes:m,registerTheme:i,registerThemeIfAbsent:a,resolveTheme:s,resolveThemes:c,seedResolvedTheme:l,seedResolvedThemes:u}}var BT=zT(),VT=new Set;function HT(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=BT.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,BT.getResolvedTheme(n)??BT.seedResolvedTheme(n,e);VT.has(n)||(VT.add(n),t.loadThemeSync(e))}}function UT(e){let t=[],n=new Set;for(let r of WT(e.themes)){let e=qT(r)?r.getThemes():[r];for(let r of e){if(n.has(r.name))throw Error(`Theme collection already contains theme "${r.name}"`);n.add(r.name),t.push(r)}}let r=Object.freeze([...t]),i=Object.freeze(r.filter(e=>e.colorScheme===`light`)),a=Object.freeze(r.filter(e=>e.colorScheme===`dark`)),o=new Map(r.map(e=>[e.name,e])),s=Object.freeze(r.map(e=>e.name)),c=Object.freeze(i.map(e=>e.name)),l=Object.freeze(a.map(e=>e.name));function u(e){if(e==null)return r;let{colorScheme:t,collection:n}=e;return n==null?t===`light`?i:t===`dark`?a:r:r.filter(e=>e.collection===n?t==null||e.colorScheme===t:!1)}return{getTheme(e){return o.get(e)},getThemes(e){return u(e)},getThemeNames(e){return e?.collection==null?e?.colorScheme===`light`?c:e?.colorScheme===`dark`?l:s:u(e).map(e=>e.name)},hasTheme(e){return o.has(e)},orderBy(e){return UT({themes:r.map((e,t)=>({descriptor:e,index:t})).sort((t,n)=>{let r=e(t.descriptor,n.descriptor);return r===0?t.index-n.index:r}).map(e=>e.descriptor)})},pick(e){let t=[],n=new Set;for(let r of e){if(n.has(r))throw Error(`Theme collection pick already includes theme "${r}"`);n.add(r);let e=o.get(r);if(e==null)throw Error(`Theme collection does not contain theme "${r}"`);t.push(e)}return UT({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function WT(e){return GT(e)?[e]:e}function GT(e){return qT(e)||KT(e)}function KT(e){return typeof e.name==`string`&&typeof e.load==`function`}function qT(e){return typeof e.getThemes==`function`}function JT({name:e,load:t,colorScheme:n,collection:r,displayName:i}){return{name:e,colorScheme:n,collection:r,displayName:i,load:YT(t)}}function YT(e){return async()=>Ab(FT(await e()))}var XT=`pierre`,ZT=[`pierre-dark`,`pierre-dark-soft`,`pierre-dark-vibrant`,`pierre-dark-protanopia-deuteranopia`,`pierre-dark-tritanopia`],QT=[`pierre-light`,`pierre-light-soft`,`pierre-light-vibrant`,`pierre-light-protanopia-deuteranopia`,`pierre-light-tritanopia`],$T=[...QT,...ZT],eE=new Set(QT);function tE(e){return eE.has(e)?`light`:`dark`}var nE={"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`},rE={"pierre-dark":()=>Z(()=>import(`./pierre-dark-CpLgRqie.js`),[]),"pierre-dark-soft":()=>Z(()=>import(`./pierre-dark-soft-kZQmAZld.js`),[]),"pierre-dark-vibrant":()=>Z(()=>import(`./pierre-dark-vibrant-CpQYzh95.js`),[]),"pierre-dark-protanopia-deuteranopia":()=>Z(()=>import(`./pierre-dark-protanopia-deuteranopia-B35FxJx-.js`),[]),"pierre-dark-tritanopia":()=>Z(()=>import(`./pierre-dark-tritanopia-CpjhbsIL.js`),[]),"pierre-light":()=>Z(()=>import(`./pierre-light-CoaEpmwp.js`),[]),"pierre-light-soft":()=>Z(()=>import(`./pierre-light-soft-lWLdNTOI.js`),[]),"pierre-light-vibrant":()=>Z(()=>import(`./pierre-light-vibrant-D80Fkn33.js`),[]),"pierre-light-protanopia-deuteranopia":()=>Z(()=>import(`./pierre-light-protanopia-deuteranopia-0fSaH845.js`),[]),"pierre-light-tritanopia":()=>Z(()=>import(`./pierre-light-tritanopia-CEbqgOJL.js`),[])};function iE(e){return JT({name:e,collection:XT,colorScheme:tE(e),displayName:nE[e],load:rE[e]})}var aE=UT({themes:$T.map(e=>iE(e))}),oE=`shiki`,sE=[`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`],cE=`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`.split(`.`),lE=new Set(sE);function uE(e){return lE.has(e)?`light`:`dark`}var dE={andromeeda:()=>Z(()=>import(`./andromeeda-vGVdxbeo.js`),[]),"aurora-x":()=>Z(()=>import(`./aurora-x-CDeNXAV0.js`),[]),"ayu-dark":()=>Z(()=>import(`./ayu-dark-DluEY0Gj.js`),[]),"ayu-light":()=>Z(()=>import(`./ayu-light-C3h-C4tm.js`),[]),"ayu-mirage":()=>Z(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]),"catppuccin-frappe":()=>Z(()=>import(`./catppuccin-frappe-3VR1Za6u.js`),[]),"catppuccin-latte":()=>Z(()=>import(`./catppuccin-latte-DwIHMF0Q.js`),[]),"catppuccin-macchiato":()=>Z(()=>import(`./catppuccin-macchiato-DYnBP6_5.js`),[]),"catppuccin-mocha":()=>Z(()=>import(`./catppuccin-mocha-DYhrFGRu.js`),[]),"dark-plus":()=>Z(()=>import(`./dark-plus-Cs2F2srj.js`),[]),dracula:()=>Z(()=>import(`./dracula-BHWKrbxM.js`),[]),"dracula-soft":()=>Z(()=>import(`./dracula-soft-5eyTD99u.js`),[]),"everforest-dark":()=>Z(()=>import(`./everforest-dark-sB-x3p7T.js`),[]),"everforest-light":()=>Z(()=>import(`./everforest-light-Df2xbC6M.js`),[]),"github-dark":()=>Z(()=>import(`./github-dark-C-LZuMrd.js`),[]),"github-dark-default":()=>Z(()=>import(`./github-dark-default-DXG-b-1a.js`),[]),"github-dark-dimmed":()=>Z(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]),"github-dark-high-contrast":()=>Z(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]),"github-light":()=>Z(()=>import(`./github-light-EUqPIrTm.js`),[]),"github-light-default":()=>Z(()=>import(`./github-light-default-BXViO-2h.js`),[]),"github-light-high-contrast":()=>Z(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]),"gruvbox-dark-hard":()=>Z(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]),"gruvbox-dark-medium":()=>Z(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]),"gruvbox-dark-soft":()=>Z(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]),"gruvbox-light-hard":()=>Z(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]),"gruvbox-light-medium":()=>Z(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]),"gruvbox-light-soft":()=>Z(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]),horizon:()=>Z(()=>import(`./horizon-CE9ld1lL.js`),[]),"horizon-bright":()=>Z(()=>import(`./horizon-bright-DSNQnXHK.js`),[]),houston:()=>Z(()=>import(`./houston-CsvMBhTu.js`),[]),"kanagawa-dragon":()=>Z(()=>import(`./kanagawa-dragon-CXtmUGW6.js`),[]),"kanagawa-lotus":()=>Z(()=>import(`./kanagawa-lotus-BN08jTvb.js`),[]),"kanagawa-wave":()=>Z(()=>import(`./kanagawa-wave-CTweb8Dz.js`),[]),laserwave:()=>Z(()=>import(`./laserwave-C_8bwKvT.js`),[]),"light-plus":()=>Z(()=>import(`./light-plus-DVQuIRkW.js`),[]),"material-theme":()=>Z(()=>import(`./material-theme-Bm3Qr25_.js`),[]),"material-theme-darker":()=>Z(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]),"material-theme-lighter":()=>Z(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]),"material-theme-ocean":()=>Z(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]),"material-theme-palenight":()=>Z(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]),"min-dark":()=>Z(()=>import(`./min-dark-BSWPekZh.js`),[]),"min-light":()=>Z(()=>import(`./min-light-DDpmG2fV.js`),[]),monokai:()=>Z(()=>import(`./monokai-CdkpiU2Y.js`),[]),"night-owl":()=>Z(()=>import(`./night-owl-DhmEMT88.js`),[]),"night-owl-light":()=>Z(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]),nord:()=>Z(()=>import(`./nord-Cb4Vim4T.js`),[]),"one-dark-pro":()=>Z(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]),"one-light":()=>Z(()=>import(`./one-light-D7Lr4KcI.js`),[]),plastic:()=>Z(()=>import(`./plastic-DQwYfKfQ.js`),[]),poimandres:()=>Z(()=>import(`./poimandres-DRFjx7u4.js`),[]),red:()=>Z(()=>import(`./red-CJ3rzSJv.js`),[]),"rose-pine":()=>Z(()=>import(`./rose-pine-BthvhNj6.js`),[]),"rose-pine-dawn":()=>Z(()=>import(`./rose-pine-dawn-Dg85fqjY.js`),[]),"rose-pine-moon":()=>Z(()=>import(`./rose-pine-moon-hon4tzzS.js`),[]),"slack-dark":()=>Z(()=>import(`./slack-dark-DnToyrRv.js`),[]),"slack-ochin":()=>Z(()=>import(`./slack-ochin-B2OO5cIa.js`),[]),"snazzy-light":()=>Z(()=>import(`./snazzy-light-4G7pJPwS.js`),[]),"solarized-dark":()=>Z(()=>import(`./solarized-dark-DV17i1UV.js`),[]),"solarized-light":()=>Z(()=>import(`./solarized-light-DSh2HLQt.js`),[]),"synthwave-84":()=>Z(()=>import(`./synthwave-84-nFMaYfgc.js`),[]),"tokyo-night":()=>Z(()=>import(`./tokyo-night-oM2G3aXe.js`),[]),vesper:()=>Z(()=>import(`./vesper-DdrHHSXu.js`),[]),"vitesse-black":()=>Z(()=>import(`./vitesse-black-fwtXNY1n.js`),[]),"vitesse-dark":()=>Z(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]),"vitesse-light":()=>Z(()=>import(`./vitesse-light-VbXTXTou.js`),[])};function fE(e){return JT({name:e,collection:oE,colorScheme:uE(e),load:dE[e]})}var pE=UT({themes:Object.freeze([...sE.map(e=>fE(e)),...cE.map(e=>fE(e))])});function mE(e){if(H_())throw 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(BT.hasRegisteredTheme(e))return;let t=pE.getTheme(e);if(t!=null){BT.registerThemeIfAbsent(t.name,t.load);return}throw Error(`No valid theme loader registered for "${e}"`)}function hE(e,t){if(t.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function gE(e){mE(e);let t=await BT.resolveTheme(e);return hE(e,t),t}function _E(e){return BT.getResolvedTheme(e)??gE(e)}var vE;async function yE({themes:e,langs:t,preferredHighlighter:n=`shiki-js`}){vE??=$x({themes:[],langs:[`text`],engine:n===`shiki-wasm`?jv(Z(()=>import(`./wasm-BnjxR4X6.js`),[])):MT()});let r=xE(vE)?await vE:vE;vE=r;let i=[];for(let e of t){if(e===`text`||e===`ansi`)continue;let t=PT(e);`then`in t?i.push(t):V_(t,r)}let a=[];for(let t of e){let e=_E(t);`then`in e?a.push(e):HT(e,vE)}return(i.length>0||a.length>0)&&await Promise.all([Promise.all(i).then(e=>{V_(e,r)}),Promise.all(a).then(e=>{HT(e,r)})]),r}function bE(){if(vE!=null&&!(`then`in vE))return vE}function xE(e=vE){return e!=null&&`then`in e}for(let e of aE.getThemes())BT.registerThemeIfAbsent(e.name,e.load);function SE(e=Zf){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}function CE(e){for(let t of SE(e))if(!VT.has(t))return!1;return!0}function wE(e){return q({tagName:`div`,children:[q({tagName:`div`,children:e.annotations?.map(e=>q({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function TE(e,t){return q({tagName:`div`,children:e,properties:{"data-content":``,style:`grid-row: span ${t}`}})}function EE(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 DE({fileOrDiff:e,mode:t,stickyHeader:n}){let r=`type`in e?e:void 0,i={"data-diffs-header":t,"data-change-type":r?.type,"data-sticky":n?``:void 0};return q({tagName:`div`,children:[t===`custom`?q({tagName:`slot`,properties:{name:Xf}}):OE({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),...t===`custom`?[]:[kE(r)]],properties:i})}function OE({name:e,prevName:t,iconType:n}){let r=[q({tagName:`slot`,properties:{name:Jf}}),Gp({name:EE(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(q({tagName:`div`,children:[q({tagName:`bdi`,children:[Wp(t)]})],properties:{"data-prev-name":``}})),r.push(Gp({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push(q({tagName:`div`,children:[q({tagName:`bdi`,children:[Wp(e)]})],properties:{"data-title":``}})),q({tagName:`div`,children:r,properties:{"data-header-content":``}})}function kE(e){let t=[];if(e!=null){let n=0,r=0;for(let t of e.hunks)n+=t.additionLines,r+=t.deletionLines;(r>0||n===0)&&t.push(q({tagName:`span`,children:[Wp(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push(q({tagName:`span`,children:[Wp(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push(q({tagName:`slot`,properties:{name:Yf}})),q({tagName:`div`,children:t,properties:{"data-metadata":``}})}function AE(e){return q({tagName:`pre`,properties:jE(e)})}function jE({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,totalLines:a,type:o,customProperties:s}){return{...s,"data-diff":o===`diff`?``:void 0,"data-file":o===`file`?``:void 0,"data-diff-type":o===`diff`?i?`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:${`${a}`.length}ch;`}}function ME(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:[e??`text`],themes:SE(t),preferredHighlighter:n}}function NE(e){return e.useTokenTransformer===!0||e.onTokenClick!=null||e.onTokenEnter!=null||e.onTokenLeave!=null}function PE(e,t){return e===t||e?.cacheKey!=null&&e.cacheKey===t?.cacheKey}function FE({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:r,collapsedContextThreshold:i}){let a=Math.max(t,0);if(a===0||e)return{fromStart:0,fromEnd:0,rangeSize:a,collapsedLines:a,renderAll:!1};if(n===!0||a<=i)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(r),s=Math.min(Math.max(o?.fromStart??0,0),a),c=Math.min(Math.max(o?.fromEnd??0,0),a),l=s+c,u=l>=a;return{fromStart:u?a:s,fromEnd:u?0:c,rangeSize:a,collapsedLines:Math.max(a-l,0),renderAll:u}}function IE({fileDiff:e,errorPrefix:t}){let n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;let r=e.additionLines.length-(n.additionLineIndex+n.additionCount),i=e.deletionLines.length-(n.deletionLineIndex+n.deletionCount);if(r<=0&&i<=0)return 0;if(r!==i)throw Error(`${t}: trailing context mismatch (additions=${r}, deletions=${i}) for ${e.name}`);return Math.min(r,i)}function LE({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:i}){if(t!==e.hunks.length-1)return;let a=IE({fileDiff:e,errorPrefix:i});if(a<=0)return;if(n===!0||a<=r)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(e.hunks.length),s=Math.min(Math.max(o?.fromStart??0,0),a);return{fromStart:s,fromEnd:0,rangeSize:a,collapsedLines:a-s,renderAll:s>=a}}function RE({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:a=1,callback:o}){let s=zE({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:a}),c={viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:s.splitCount,unifiedCount:s.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!c.isWindowedHighlight)return!1;let e=c.unifiedCount>=n+r,i=c.splitCount>=n+r;return t===`unified`?e:(t===`split`||e)&&i},shouldSkip(e,r){if(!c.isWindowedHighlight)return!1;let i=c.unifiedCount+e<n,a=c.splitCount+r<n;return t===`unified`?i:(t===`split`||i)&&a},incrementCounts(e,n){(t===`unified`||t===`both`)&&(c.unifiedCount+=e),(t===`split`||t===`both`)&&(c.splitCount+=n)},isInWindow(e,n){if(!c.isWindowedHighlight)return!0;let r=c.isInUnifiedWindow(e),i=c.isInSplitWindow(n);return t===`unified`?r:t===`split`?i:r||i},isInUnifiedWindow(e){return!c.isWindowedHighlight||c.unifiedCount>=n-e&&c.unifiedCount<n+r},isInSplitWindow(e){return!c.isWindowedHighlight||c.splitCount>=n-e&&c.splitCount<n+r},emit(e,n=!1){return n||(t===`unified`?c.incrementCounts(1,0):t===`split`?c.incrementCounts(0,1):c.incrementCounts(1,1)),o(e)??!1}};hunkIterator:for(let n=s.hunkIndex;n<e.hunks.length;n++){let r=e.hunks[n];if(r==null)throw Error(`iterateOverDiff: invalid hunk index`);if(c.shouldBreak())break;let o=FE({isPartial:e.isPartial,rangeSize:r.collapsedBefore,expandedHunks:i,hunkIndex:n,collapsedContextThreshold:a}),s=n===c.finalHunkIndex?LE({fileDiff:e,hunkIndex:n,expandedHunks:i,collapsedContextThreshold:a,errorPrefix:`iterateOverDiff`}):void 0,l=o.fromStart+o.fromEnd;function u(e,n){return s==null||s.collapsedLines<=0||s.fromStart+s.fromEnd>0?0:t===`unified`?e===r.unifiedLineStart+r.unifiedLineCount-1?s.collapsedLines:0:n===r.splitLineStart+r.splitLineCount-1?s.collapsedLines:0}let d=o.collapsedLines===0;function f(){return d?0:(d=!0,o.collapsedLines)}if(c.shouldSkip(l,l))c.incrementCounts(l,l),f();else{let e=r.unifiedLineStart-o.rangeSize,i=r.splitLineStart-o.rangeSize,a=r.deletionLineIndex-o.rangeSize,s=r.additionLineIndex-o.rangeSize,l=r.deletionStart-o.rangeSize,u=r.additionStart-o.rangeSize;if(HE(c,o.fromStart,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:0,collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:l+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:s+t,lineNumber:u+t,noEOFCR:!1}}))||(e=r.unifiedLineStart-o.fromEnd,i=r.splitLineStart-o.fromEnd,a=r.deletionLineIndex-o.fromEnd,s=r.additionLineIndex-o.fromEnd,l=r.deletionStart-o.fromEnd,u=r.additionStart-o.fromEnd,HE(c,o.fromEnd,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:f(),collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:l+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:s+t,lineNumber:u+t,noEOFCR:!1}}),()=>{f()})))break hunkIterator}let p=r.unifiedLineStart,m=r.splitLineStart,h=r.deletionLineIndex,g=r.additionLineIndex,_=r.deletionStart,v=r.additionStart,y=r.hunkContent.at(-1);for(let e of r.hunkContent){if(c.shouldBreak())break hunkIterator;let i=e===y;if(e.type===`context`){if(c.shouldSkip(e.lines,e.lines))c.incrementCounts(e.lines,e.lines),f();else if(HE(c,e.lines,t,t=>{let a=i&&t===e.lines-1,o=p+t,s=m+t;return c.emit({hunkIndex:n,hunk:r,collapsedBefore:f(),collapsedAfter:u(o,s),type:`context`,deletionLine:{lineNumber:_+t,lineIndex:h+t,noEOFCR:a&&r.noEOFCRDeletions,unifiedLineIndex:o,splitLineIndex:s},additionLine:{unifiedLineIndex:o,splitLineIndex:s,lineIndex:g+t,lineNumber:v+t,noEOFCR:a&&r.noEOFCRAdditions}})},()=>{f()}))break hunkIterator;p+=e.lines,m+=e.lines,h+=e.lines,g+=e.lines,_+=e.lines,v+=e.lines}else{let a=Math.max(e.deletions,e.additions),o=e.deletions+e.additions;if(!c.shouldSkip(o,a)){let s=UE(c,e,t);(s[0]?.[0]??0)>0&&f();for(let[l,d]of s)for(let s=l;s<d;s++){let l=u(p+s,t===`unified`?m+(s<e.deletions?s:s-e.deletions):m+s);if(c.emit(WE({hunkIndex:n,hunk:r,collapsedBefore:f(),collapsedAfter:l,diffStyle:t,index:s,unifiedLineIndex:p,splitLineIndex:m,additionLineIndex:g,deletionLineIndex:h,additionLineNumber:v,deletionLineNumber:_,content:e,isLastContent:i,unifiedCount:o,splitCount:a}),!0))break hunkIterator}}f(),c.incrementCounts(o,a),p+=o,m+=a,h+=e.deletions,g+=e.additions,_+=e.deletions,v+=e.additions}}if(s!=null){let{collapsedLines:n,fromStart:r,fromEnd:i}=s,a=r+i;if(HE(c,a,t,t=>{let r=t===a-1;return c.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:r?n:0,type:`context-expanded`,deletionLine:{lineNumber:_+t,lineIndex:h+t,noEOFCR:!1,unifiedLineIndex:p+t,splitLineIndex:m+t},additionLine:{unifiedLineIndex:p+t,splitLineIndex:m+t,lineIndex:g+t,lineNumber:v+t,noEOFCR:!1}})},void 0,()=>c.shouldBreak()))break hunkIterator}}}function zE({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:i}){if(n<=0||t===`both`)return{hunkIndex:0,splitCount:0,unifiedCount:0};let a=BE({diff:e,expandedHunks:r,collapsedContextThreshold:i}),o=0,s=e.hunks.length-1,c=e.hunks.length;for(;o<=s;){let e=o+s>>1,r=a[e+1];if(r==null)throw Error(`iterateOverDiff: invalid hunk prefix index`);(t===`unified`?r.unifiedCount:r.splitCount)>n?(c=e,s=e-1):o=e+1}if(c>=e.hunks.length){let t=a[e.hunks.length];if(t==null)throw Error(`iterateOverDiff: invalid terminal hunk prefix index`);return{hunkIndex:e.hunks.length,splitCount:t.splitCount,unifiedCount:t.unifiedCount}}let l=a[c];if(l==null)throw Error(`iterateOverDiff: invalid selected hunk prefix index`);return{hunkIndex:c,splitCount:l.splitCount,unifiedCount:l.unifiedCount}}function BE({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let r=0,i=0,a=e.hunks.length-1,o=[{splitCount:0,unifiedCount:0}];for(let s=0;s<e.hunks.length;s++){let c=e.hunks[s];if(c==null)throw Error(`iterateOverDiff: invalid hunk summary index`);let l=FE({isPartial:e.isPartial,rangeSize:c.collapsedBefore,expandedHunks:t,hunkIndex:s,collapsedContextThreshold:n}),u=l.fromStart+l.fromEnd;r+=u+c.splitLineCount,i+=u+c.unifiedLineCount;let d=s===a?LE({fileDiff:e,hunkIndex:s,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`iterateOverDiff`}):void 0;if(d!=null){let e=d.fromStart+d.fromEnd;r+=e,i+=e}o.push({splitCount:r,unifiedCount:i})}return o}function VE(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];let r=[];function i(n){let i=Math.max(0,e.viewportStart-n),a=Math.min(t,e.viewportEnd-n);a>i&&r.push([i,a])}if(n!==`split`&&i(e.unifiedCount),n!==`unified`&&i(e.splitCount),r.length===0)return[0,0];let a=r[0][0],o=r[0][1];for(let e=1;e<r.length;e++){let t=r[e];a=Math.min(a,t[0]),o=Math.max(o,t[1])}return[a,o]}function HE(e,t,n,r,i,a){let[o,s]=VE(e,t,n);o>0&&(e.incrementCounts(o,o),i?.());let c=o;for(;c<t;){if(a?.()===!0)return!0;if(c>=s){e.incrementCounts(t-c,t-c);break}if(e.isInWindow(0,0)){if(r(c)===!0)return!0}else e.incrementCounts(1,1);c++}return!1}function UE(e,t,n){if(!e.isWindowedHighlight)return[[0,n===`unified`?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];let r=n!==`split`,i=n!==`unified`,a=n===`unified`?`unified`:`split`,o=[];function s(t,n){if(t+n<=e.viewportStart||t>=e.viewportEnd)return;let r=Math.max(0,e.viewportStart-t),i=Math.min(n,e.viewportEnd-t);return i>r?[r,i]:void 0}function c(e,n){return a===`split`?e:n===`additions`?[e[0]+t.deletions,e[1]+t.deletions]:e}function l(e,t){if(e==null)return;let[n,r]=c(e,t);r>n&&o.push([n,r])}if(r&&(l(s(e.unifiedCount,t.deletions),`deletions`),l(s(e.unifiedCount+t.deletions,t.additions),`additions`)),i&&(l(s(e.splitCount,t.deletions),`deletions`),l(s(e.splitCount,t.additions),`additions`)),o.length===0)return o;o.sort((e,t)=>e[0]-t[0]);let u=[o[0]];for(let[e,t]of o.slice(1)){let n=u[u.length-1];e<=n[1]?n[1]=Math.max(n[1],t):u.push([e,t])}return u}function WE({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:i,index:a,unifiedLineIndex:o,splitLineIndex:s,additionLineIndex:c,deletionLineIndex:l,additionLineNumber:u,deletionLineNumber:d,content:f,isLastContent:p,unifiedCount:m,splitCount:h}){let g=a<f.deletions?o+a:void 0,_=i===`unified`?a>=f.deletions?o+a:void 0:a<f.additions?o+f.deletions+a:void 0,v=i===`unified`?s+(a<f.deletions?a:a-f.deletions):s+a,y=a<f.deletions?l+a:void 0,b=a<f.deletions?d+a:void 0,x=i===`unified`?a>=f.deletions?c+(a-f.deletions):void 0:a<f.additions?c+a:void 0,S=i===`unified`?a>=f.deletions?u+(a-f.deletions):void 0:a<f.additions?u+a:void 0,C=i===`unified`?p&&a===f.deletions-1&&t.noEOFCRDeletions:p&&a===h-1&&t.noEOFCRDeletions,w=i===`unified`?p&&a===m-1&&t.noEOFCRAdditions:p&&a===h-1&&t.noEOFCRAdditions,T=y!=null&&b!=null&&g!=null?{lineNumber:b,lineIndex:y,noEOFCR:C,unifiedLineIndex:g,splitLineIndex:v}:void 0,E=x!=null&&S!=null&&_!=null?{unifiedLineIndex:_,splitLineIndex:v,lineIndex:x,lineNumber:S,noEOFCR:w}:void 0;if(T==null&&E!=null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:void 0,additionLine:E};if(T!=null&&E==null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:T,additionLine:void 0};if(T==null||E==null)throw Error(`iterateOverDiff: missing change line data`);return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:T,additionLine:E}}function GE(e,t){return Bp(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function KE(e){return q({tagName:`div`,properties:{"data-content-buffer":``,"data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function qE(e){return q({tagName:`div`,children:[q({tagName:`span`,children:[Wp(`No newline at end of file`)]})],properties:{"data-no-newline":``,"data-line-type":e,"data-column-content":``}})}function JE(e){return q({tagName:`div`,children:[Gp({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 YE({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:i,isFirstHunk:a,isLastHunk:o}){let s=0,c=[];if(e===`metadata`&&t!=null&&c.push(q({tagName:`div`,children:[Wp(t)],properties:{"data-separator-wrapper":``}})),(e===`line-info`||e===`line-info-basic`)&&t!=null){let e=[];n!=null&&(r?(a||(e.push(JE(`up`)),s++),o||(e.push(JE(`down`)),s++)):(e.push(JE(!a&&!o?`both`:a?`down`:`up`)),s++)),e.push(q({tagName:`div`,children:[q({tagName:`span`,children:[Wp(t)],properties:{"data-unmodified-lines":``}})],properties:{"data-separator-content":``}})),r&&n!=null&&e.push(q({tagName:`div`,children:[Wp(`Expand all`)],properties:{role:`button`,"data-expand-button":``,"data-expand-all-button":``}})),c.push(q({tagName:`div`,children:e,properties:{"data-separator-wrapper":``,"data-separator-multi-button":s>1?``:void 0}}))}return e===`custom`&&i!=null&&c.push(q({tagName:`slot`,properties:{name:i}})),q({tagName:`div`,children:c,properties:{"data-separator":c.length===0?`simple`:e,"data-expand-index":n,"data-separator-first":a?``:void 0,"data-separator-last":o?``:void 0}})}function XE(e,t){return`hunk-separator-${e}-${t}`}function ZE(e){let t=e.at(-1);return t==null?0:Math.max(t.additionStart+t.additionCount,t.deletionStart+t.deletionCount)}function QE(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function $E(e,t,n){let r=typeof n.lineInfo==`function`?n.lineInfo(t):n.lineInfo[t-1];if(r==null){let r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),Error(r)}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(Wp(`
2823
+ `)),e}var eD=Symbol(`no-token`),tD=Symbol(`multiple-tokens`);function nD(e){let t=rD(e);if(t!=null)return t;let n=eD,r=[],i=[],a,o=()=>{if(i.length===0||a==null){i=[],a=void 0;return}if(i.length===1){let e=i[0];if(e?.type===`element`){aD(e,a);for(let t of e.children)iD(t)}else iD(e);r.push(e),i=[],a=void 0;return}for(let e of i)iD(e);r.push(q({tagName:`span`,properties:{"data-char":a},children:i})),i=[],a=void 0},s=e=>{if(e!==eD){if(e===tD){n=tD;return}if(n===eD){n=e;return}n!==e&&(n=tD)}};for(let t of e.children){let e=t.type===`element`?nD(t):eD;if(s(e),typeof e!=`number`){o(),r.push(t);continue}a!=null&&a!==e&&o(),a??=e,i.push(t)}return o(),e.children=r,n}function rD(e){let t=e.properties[`data-char`];if(typeof t==`number`)return t}function iD(e){if(e.type===`element`){e.properties[`data-char`]=void 0;for(let t of e.children)iD(t)}}function aD(e,t){e.properties[`data-char`]=t}function oD(e={}){let{classPrefix:t=`__shiki_`,classSuffix:n=``,classReplacer:r=e=>e}=e,i=new Map;function a(e){return Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function o(e){let o=t+sD(typeof e==`string`?e:a(e))+n;return o=r(o),i.has(o)||i.set(o,typeof e==`string`?e:{...e}),o}return{name:`@shikijs/transformers:style-to-class`,pre(e){if(!e.properties.style)return;let t=o(e.properties.style);delete e.properties.style,this.addClassToHast(e,t)},tokens(e){for(let t of e)for(let e of t){if(!e.htmlStyle)continue;let t=o(e.htmlStyle);e.htmlStyle={},e.htmlAttrs||={},e.htmlAttrs.class?e.htmlAttrs.class+=` ${t}`:e.htmlAttrs.class=t}},getClassRegistry(){return i},getCSS(){let e=``;for(let[t,n]of i.entries())e+=`.${t}{${typeof n==`string`?n:a(n)}}`;return e},clearRegistry(){i.clear()}}}function sD(e,t=0){let n=3735928559^t,r=1103547991^t;for(let t=0,i;t<e.length;t++)i=e.charCodeAt(t),n=Math.imul(n^i,2654435761),r=Math.imul(r^i,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 cD(e=!1,t=!1){let n={lineInfo:[]},r=[{line(e){return delete e.properties.class,e},pre(t){let r=Kp(t),i=[];if(r!=null){let t=1;for(let a of r.children)a.type===`element`&&(e&&nD(a),i.push($E(a,t,n)),t++);r.children=i}return t},...e?{tokens(e){for(let t of e){let e=0;for(let n of t){let t=n;t.__lineChar??=e,e+=n.content.length}}},preprocess(e,t){t.mergeWhitespaces=`never`},span(e,t,n,r,i){if(i?.offset!=null&&i.content!=null){let t=i.__lineChar;return t!=null&&(e.properties[`data-char`]=t),e}return e}}:null}];return t&&r.push(uD,lD),{state:n,transformers:r,toClass:lD}}var lD=oD({classPrefix:`hl-`}),uD={name:`token-style-normalizer`,tokens(e){for(let t of e)for(let e of t){if(e.htmlStyle!=null)continue;let t={};e.color!=null&&(t.color=e.color),e.bgColor!=null&&(t[`background-color`]=e.bgColor),e.fontStyle!=null&&e.fontStyle!==0&&(e.fontStyle&1&&(t[`font-style`]=`italic`),e.fontStyle&2&&(t[`font-weight`]=`bold`),e.fontStyle&4&&(t[`text-decoration`]=`underline`)),Object.keys(t).length>0&&(e.htmlStyle=t)}}};function dD(e){return`--${e===`token`?`diffs-token`:`diffs`}-`}var fD=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,pD=/^0(?:\.0+)?%?$/;function mD(e){let t=e.indexOf(`(`);if(t<=0||!e.endsWith(`)`))return;let n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;let r=e.slice(t+1,-1).trim();if(r.length===0)return;let i=r.lastIndexOf(`/`);if(i!==-1)return r.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){let e=r.split(`,`);if(e.length===4)return e[3]?.trim()}}function hD(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;let n=t[1],r,i=1;return n.length===3?r=n.split(``).map(e=>e+e).join(``):n.length===6?r=n:(r=n.slice(0,6),i=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),i]}function gD(e){if(e==null)return null;let t=hD(e);if(t==null)return null;let n=t[0]/255,r=t[1]/255,i=t[2]/255,a=e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4;return .2126*a(n)+.7152*a(r)+.0722*a(i)}function _D(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||fD.test(t))return!0;let n=mD(t);return n!=null&&pD.test(n)}function vD(e,t,n){if(t==null||n==null)return!1;let r=gD(e),i=gD(t),a=gD(n);return r==null||i==null||a==null?!1:Math.abs(r-a)<Math.abs(r-i)}var yD=new WeakMap;function bD(e){let t=yD.get(e);if(t!=null)return t;let n=e.colors??{},r={...n},i=n[`editor.background`]??e.bg,a=n[`editor.foreground`]??e.fg,o=n[`sideBar.background`]??i,s=n[`sideBar.foreground`]??a;xD(r,`editor.background`,i),xD(r,`editor.foreground`,a),xD(r,`sideBar.background`,o),xD(r,`sideBar.foreground`,s),xD(r,`input.background`,n[`input.background`]??o),xD(r,`sideBarSectionHeader.foreground`,n[`sideBarSectionHeader.foreground`]??s),xD(r,`list.activeSelectionForeground`,n[`list.activeSelectionForeground`]??s),xD(r,`gitDecoration.addedResourceForeground`,SD(n[`gitDecoration.addedResourceForeground`],n[`terminal.ansiGreen`],n[`editorGutter.addedBackground`])),xD(r,`gitDecoration.modifiedResourceForeground`,SD(n[`gitDecoration.modifiedResourceForeground`],n[`terminal.ansiBlue`],n[`editorGutter.modifiedBackground`])),xD(r,`gitDecoration.deletedResourceForeground`,SD(n[`gitDecoration.deletedResourceForeground`],n[`terminal.ansiRed`],n[`editorGutter.deletedBackground`]));let c=(_D(n[`list.focusOutline`])?void 0:n[`list.focusOutline`])??(_D(n.focusBorder)?void 0:n.focusBorder);c==null?delete r[`list.focusOutline`]:r[`list.focusOutline`]=c;let l=n[`list.hoverBackground`];l!=null&&(CD(l,o)||vD(l,o,s))&&delete r[`list.hoverBackground`];let u=Object.freeze({...e,colors:Object.freeze(r)});return yD.set(e,u),u}function xD(e,t,n){n!=null&&n!==``&&(e[t]=n)}function SD(...e){for(let t of e)if(t!=null&&t!==``)return t}function CD(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function wD({theme:e=Zf,highlighter:t,prefix:n}){let r=``;if(typeof e==`string`){let i=t.getTheme(e),a=bD(i);r+=`color:${a.fg};`,r+=`background-color:${a.bg};`,r+=`${dD(`global`)}fg:${a.fg};`,r+=`${dD(`global`)}bg:${a.bg};`,r+=TD(i,n)}else{let n=t.getTheme(e.dark),i=bD(n);r+=`${dD(`global`)}dark:${i.fg};`,r+=`${dD(`global`)}dark-bg:${i.bg};`,r+=TD(n,`dark`),n=t.getTheme(e.light),i=bD(n),r+=`${dD(`global`)}light:${i.fg};`,r+=`${dD(`global`)}light-bg:${i.bg};`,r+=TD(n,`light`)}return r}function TD(e,t){t=t==null?``:`${t}-`;let n=``,r=e.colors?.[`gitDecoration.addedResourceForeground`]??e.colors?.[`terminal.ansiGreen`];r!=null&&(n+=`${dD(`global`)}${t}addition-color:${r};`);let i=e.colors?.[`gitDecoration.deletedResourceForeground`]??e.colors?.[`terminal.ansiRed`];i!=null&&(n+=`${dD(`global`)}${t}deletion-color:${i};`);let a=e.colors?.[`gitDecoration.modifiedResourceForeground`]??e.colors?.[`terminal.ansiBlue`];return a!=null&&(n+=`${dD(`global`)}${t}modified-color:${a};`),n}function ED(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t.children;t=`children`in t?t.children[0]:null}throw console.error(e),Error(`getLineNodes: Unable to find children`)}function DD({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 OD({item:e,arr:t,enableJoin:n,isNeutral:r=!1,isLastItem:i=!1}){let a=t[t.length-1];if(a==null||i||!n){t.push([+!r,e.value]);return}let o=a[0]===0;if(r===o||r&&e.value.length===1&&!o){a[1]+=e.value;return}t.push([+!r,e.value])}var kD={forcePlainText:!1};function AD(e,t,n,{forcePlainText:r,startingLine:i,totalLines:a,expandedHunks:o,collapsedContextThreshold:s=1}=kD){r?(i??=0,a??=1/0):(i=0,a=1/0);let c=i>0||a<1/0,l=typeof n.theme==`string`?t.getTheme(n.theme).type:void 0,u=wD({theme:n.theme,highlighter:t}),d=r&&!c&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?`none`:n.lineDiffType,f={deletionLines:[],additionLines:[]},{maxLineDiffLength:p}=n,m=!r&&!e.isPartial,h=r?o:void 0,g=new Map;function _(e){let t=m?0:e,n=g.get(t)??MD();return g.set(t,n),n}function v(e,t,n,r){if(c){let e=n.at(-1);(e==null||e.targetIndex+e.count!==t)&&(e={targetIndex:t,originalOffset:r.length,count:0},n.push(e)),e.count++}r.push(e)}RE({diff:e,diffStyle:`both`,startingLine:i,totalLines:a,expandedHunks:c?h:!0,collapsedContextThreshold:s,callback:({hunkIndex:t,additionLine:n,deletionLine:r,type:i})=>{let a=_(t),o=n==null?r.splitLineIndex:n.splitLineIndex;i===`change`&&n!=null&&r!=null&&jD({additionLine:e.additionLines[n.lineIndex],deletionLine:e.deletionLines[r.lineIndex],deletionLineIndex:a.deletionContent.length,additionLineIndex:a.additionContent.length,deletionDecorations:a.deletionDecorations,additionDecorations:a.additionDecorations,lineDiffType:d,maxLineDiffLength:p}),r!=null&&(v(e.deletionLines[r.lineIndex],r.lineIndex,a.deletionSegments,a.deletionContent),a.deletionInfo.push({type:i===`change`?`change-deletion`:i,lineNumber:r.lineNumber,altLineNumber:i===`change`?void 0:n.lineNumber??void 0,lineIndex:`${r.unifiedLineIndex},${o}`})),n!=null&&(v(e.additionLines[n.lineIndex],n.lineIndex,a.additionSegments,a.additionContent),a.additionInfo.push({type:i===`change`?`change-addition`:i,lineNumber:n.lineNumber,altLineNumber:i===`change`?void 0:r.lineNumber??void 0,lineIndex:`${n.unifiedLineIndex},${o}`}))}});for(let i of g.values()){if(i.deletionContent.length===0&&i.additionContent.length===0)continue;let a={name:e.prevName??e.name,contents:i.deletionContent.value},o={name:e.name,contents:i.additionContent.value},{deletionLines:s,additionLines:c}=ND({deletionFile:a,deletionInfo:i.deletionInfo,deletionDecorations:i.deletionDecorations,additionFile:o,additionInfo:i.additionInfo,additionDecorations:i.additionDecorations,highlighter:t,options:n,languageOverride:r?`text`:e.lang});if(m){f.deletionLines=s,f.additionLines=c;continue}if(i.deletionSegments.length>0)for(let e of i.deletionSegments)for(let t=0;t<e.count;t++)f.deletionLines[e.targetIndex+t]=s[e.originalOffset+t];else f.deletionLines.push(...s);if(i.additionSegments.length>0)for(let e of i.additionSegments)for(let t=0;t<e.count;t++)f.additionLines[e.targetIndex+t]=c[e.originalOffset+t];else f.additionLines.push(...c)}return{code:f,themeStyles:u,baseThemeType:l}}function jD({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:i,additionDecorations:a,lineDiffType:o,maxLineDiffLength:s}){if(e==null||t==null||o===`none`||(e=op(e),t=op(t),e.length>s||t.length>s))return;let c=o===`char`?Qg(e,t):h_(e,t),l=[],u=[],d=o===`word-alt`,f=c.at(-1);for(let e of c){let t=e===f;!e.added&&!e.removed?(OD({item:e,arr:l,enableJoin:d,isNeutral:!0,isLastItem:t}),OD({item:e,arr:u,enableJoin:d,isNeutral:!0,isLastItem:t})):e.removed?OD({item:e,arr:l,enableJoin:d,isLastItem:t}):OD({item:e,arr:u,enableJoin:d,isLastItem:t})}let p=0;for(let e of l)e[0]===1&&i.push(DD({line:n,spanStart:p,spanLength:e[1].length})),p+=e[1].length;p=0;for(let e of u)e[0]===1&&a.push(DD({line:r,spanStart:p,spanLength:e[1].length})),p+=e[1].length}function MD(){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 ND({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:i,deletionDecorations:a,additionDecorations:o,languageOverride:s,options:{theme:c=Zf,...l}}){let u=s??M_(e.name),d=s??M_(t.name),{state:f,transformers:p}=cD(l.useTokenTransformer),m=typeof c==`string`?{...l,lang:`text`,theme:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:dD(`token`),tokenizeTimeLimit:0}:{...l,lang:`text`,themes:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:dD(`token`),tokenizeTimeLimit:0};return{deletionLines:e.contents===``?[]:(m.lang=u,f.lineInfo=n,m.decorations=a,ED(i.codeToHast(op(e.contents),m))),additionLines:t.contents===``?[]:(m.lang=d,m.decorations=o,f.lineInfo=r,ED(i.codeToHast(op(t.contents),m)))}}var PD=-1,FD=class{options;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++PD}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang=`text`;renderCache;constructor(e={theme:Zf},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=CE(e.theme??Zf)?bE():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)}clearRenderCache(){this.renderCache=void 0}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){let 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)??rp}getExpandedHunksMap(){return this.expandedHunks}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(let t of e){let e=(()=>{switch(t.side){case`deletions`:return this.deletionAnnotations;case`additions`:return this.additionAnnotations}})(),n=e[t.lineNumber]??[];e[t.lineNumber]=n,n.push(t)}}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e}}getSplitLineDecoration({side:e,type:t}){return t===`change`?{gutterLineType:e===`deletions`?`change-deletion`:`change-addition`}:{gutterLineType:t}}createAnnotationElement=e=>wE(e);getOptionsWithDefaults(){let{diffIndicators:e=`bars`,diffStyle:t=`split`,disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:i=!1,disableVirtualizationBuffers:a=!1,collapsed:o=!1,expandUnchanged:s=!1,collapsedContextThreshold:c=1,expansionLineCount:l=100,hunkSeparators:u=`line-info`,lineDiffType:d=`word-alt`,maxLineDiffLength:f=1e3,overflow:p=`scroll`,stickyHeader:m=!1,theme:h=Zf,headerRenderMode:g=`default`,tokenizeMaxLineLength:_=1e3,tokenizeMaxLength:v=np,useTokenTransformer:y=!1,useCSSClasses:b=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:i,disableVirtualizationBuffers:a,collapsed:o,expandUnchanged:s,collapsedContextThreshold:c,expansionLineCount:l,hunkSeparators:u,lineDiffType:d,maxLineDiffLength:f,overflow:p,stickyHeader:m,theme:this.workerManager?.getDiffRenderOptions().theme??h,headerRenderMode:g,tokenizeMaxLineLength:_,tokenizeMaxLength:v,useTokenTransformer:y,useCSSClasses:b}}async initializeHighlighter(){return this.highlighter=await yE(ME(this.computedLang,this.options)),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;let{options:t}=this.getRenderOptions(e),n=WD(e,this.getTokenizeMaxLength()),r=this.workerManager?.getDiffResultCache(e);r!=null&&!GE(t,r.options)&&(r=void 0),this.renderCache??={diff:e,highlighted:!n&&!N_(e),options:t,result:n?void 0:r?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter??(this.computedLang=e.lang??M_(e.name),this.initializeHighlighter())}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getDiffRenderOptions();let{theme:e,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}=this.getOptionsWithDefaults();return{theme:e,useTokenTransformer:NE(this.options),tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}})();this.getOptionsWithDefaults();let{renderCache:n}=this;return n?.result==null||!PE(e,n.diff)||!GE(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}renderDiff(e=this.renderCache?.diff,t=ip){if(e==null)return;let{expandUnchanged:n=!1,collapsedContextThreshold:r}=this.getOptionsWithDefaults(),{options:i,forceHighlight:a}=this.getRenderOptions(e),o=this.getMatchingWorkerResultCache(e,i);o!=null&&!this.hasHighlightedRenderCache(e,i)&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...o},a=!1),this.renderCache??={diff:e,highlighted:!1,options:i,result:void 0,renderRange:void 0};let s=e.additionLines.length>0||e.deletionLines.length>0,c=!s||N_(e)||WD(e,this.getTokenizeMaxLength()),l=!PE(e,this.renderCache.diff),u=!Eg(this.renderCache.renderRange,t);if(this.workerManager?.isWorkingPool()===!0)(c||this.renderCache.result==null||!this.renderCache.highlighted&&(l||u))&&(this.renderCache.diff=e,this.renderCache.options=i,this.renderCache.highlighted=!1,(this.renderCache.result==null||l||u||a)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,QE(t)||n?!0:this.expandedHunks,r)),this.renderCache.renderRange=t),!c&&s&&(!this.renderCache.highlighted||a)&&this.workerManager.highlightDiffAST(this,e);else{this.computedLang=e.lang??M_(e.name);let t=this.highlighter!=null&&CE(i.theme),n=this.highlighter!=null&&B_(this.computedLang),r=!c&&n;if(this.highlighter!=null&&t&&(a||c||!this.renderCache.highlighted&&r||this.renderCache.result==null)){let{result:t,options:i}=this.renderDiffWithHighlighter(e,this.highlighter,c||!n);this.renderCache={diff:e,options:i,highlighted:r,result:t,renderRange:void 0}}(!t||!c&&!n)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,t,n,!c)})}return this.renderCache.result==null?void 0:this.processDiffResult(this.renderCache.diff,t,this.renderCache.result)}async asyncRender(e,t=ip){let{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){let{diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o}=this.getOptionsWithDefaults();return AE({type:`diff`,diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){let t=WD(e,this.getTokenizeMaxLength());this.computedLang=t?`text`:e.lang??M_(e.name);let n=this.highlighter!=null&&CE(this.options.theme??Zf),r=t||this.highlighter!=null&&B_(this.computedLang);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e),{collapsedContextThreshold:i}=this.getOptionsWithDefaults();return{result:AD(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:i}),options:r}}onHighlightSuccess(e,t,n,r=!0){if(this.renderCache==null)return;let i=!this.renderCache.highlighted||!GE(this.renderCache.options,n)||!PE(this.renderCache.diff,e);this.renderCache={diff:e,options:n,highlighted:r,result:t,renderRange:void 0},i&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){let n=this.workerManager?.getDiffResultCache(e);if(!(n==null||!GE(t,n.options)))return n}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&PE(e,n.diff)&&GE(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){let{diffStyle:a,disableFileHeader:o,expandUnchanged:s,expansionLineCount:c,collapsedContextThreshold:l,hunkSeparators:u}=this.getOptionsWithDefaults();this.diff=e;let d=a===`unified`,f=[],p=[],m=[],h=[],{additionLines:g,deletionLines:_}=n,v={rowCount:0,hunkSeparators:u,additionsContentAST:f,deletionsContentAST:p,unifiedContentAST:m,unifiedGutterAST:qp(),deletionsGutterAST:qp(),additionsGutterAST:qp(),expansionLineCount:c,hunkData:h,incrementRowCount(e=1){v.rowCount+=e},pushToGutter(e,t){switch(e){case`unified`:v.unifiedGutterAST.children.push(t);break;case`deletions`:v.deletionsGutterAST.children.push(t);break;case`additions`:v.additionsGutterAST.children.push(t);break}}},y=IE({fileDiff:e,errorPrefix:`DiffHunksRenderer.processDiffResult`}),b={size:0,side:void 0,increment(){this.size+=1},flush(){if(a!==`unified`){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side===`additions`?(v.pushToGutter(`additions`,Yp(void 0,`buffer`,this.size)),f?.push(KE(this.size))):(v.pushToGutter(`deletions`,Yp(void 0,`buffer`,this.size)),p?.push(KE(this.size))),this.size=0,this.side=void 0}}},x=(e,t,n,r,i)=>{v.pushToGutter(e,Jp(t,n,r,i))};function S(e){b.flush(),a===`unified`?HD(`unified`,e,v):(HD(`deletions`,e,v),HD(`additions`,e,v))}this.pushFileLevelAnnotations(e,a,t,v),RE({diff:e,diffStyle:a,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:s?!0:this.expandedHunks,collapsedContextThreshold:l,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,additionLine:o,deletionLine:s,type:c})=>{let l=s==null?o.splitLineIndex:s.splitLineIndex,d=o==null?s.unifiedLineIndex:o.unifiedLineIndex;a===`split`&&c!==`change`&&b.flush(),r>0&&S({hunkIndex:t,collapsedLines:r,rangeSize:Math.max(n?.collapsedBefore??0,0),hunkSpecs:n?.hunkSpecs,isFirstHunk:t===0,isLastHunk:!1,isExpandable:!e.isPartial});let f=a===`unified`?d:l,p={type:c,hunkIndex:t,lineIndex:f,unifiedLineIndex:d,splitLineIndex:l,deletionLine:s,additionLine:o};if(a===`unified`){let n=this.getUnifiedInjectedRowsForLine?.(p);n?.before!=null&&zD(n.before,v);let r=s==null?void 0:_[s.lineIndex],i=o==null?void 0:g[o.lineIndex];if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let a=c===`change`?o==null?`change-deletion`:`change-addition`:c,u=this.getUnifiedLineDecoration({type:c,lineType:a,additionLineIndex:o?.lineIndex,deletionLineIndex:s?.lineIndex});x(`unified`,u.gutterLineType,o==null?s.lineNumber:o.lineNumber,`${d},${l}`,u.gutterProperties),i==null?r!=null&&(r=UD(r,u.contentProperties)):i=UD(i,u.contentProperties),VD({diffStyle:`unified`,type:c,deletionLine:r,additionLine:i,unifiedSpan:this.getAnnotations(`unified`,s?.lineNumber,o?.lineNumber,t,f),createAnnotationElement:e=>this.createAnnotationElement(e),context:v}),n?.after!=null&&zD(n.after,v)}else{let n=this.getSplitInjectedRowsForLine?.(p);n?.before!=null&&BD(n.before,v,b);let r=s==null?void 0:_[s.lineIndex],i=o==null?void 0:g[o.lineIndex],a=this.getSplitLineDecoration({side:`deletions`,type:c,lineIndex:s?.lineIndex}),u=this.getSplitLineDecoration({side:`additions`,type:c,lineIndex:o?.lineIndex});if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let d=(()=>{if(c===`change`){if(i==null)return`additions`;if(r==null)return`deletions`}})();if(d!=null){if(b.side!=null&&b.side!==d)throw Error(`DiffHunksRenderer.processDiffResult: iterateOverDiff, invalid pending splits`);b.side=d,b.increment()}let m=this.getAnnotations(`split`,s?.lineNumber,o?.lineNumber,t,f);if(m!=null&&b.size>0&&b.flush(),s!=null){let e=UD(r,a.contentProperties);x(`deletions`,a.gutterLineType,s.lineNumber,`${s.unifiedLineIndex},${l}`,a.gutterProperties),e!=null&&(r=e)}if(o!=null){let e=UD(i,u.contentProperties);x(`additions`,u.gutterLineType,o.lineNumber,`${o.unifiedLineIndex},${l}`,u.gutterProperties),e!=null&&(i=e)}VD({diffStyle:`split`,type:c,additionLine:i,deletionLine:r,...m,createAnnotationElement:e=>this.createAnnotationElement(e),context:v}),n?.after!=null&&BD(n.after,v,b)}let m=a===`split`&&n!=null&&l===n.splitLineStart+n.splitLineCount-1,h=m?n.noEOFCRDeletions:!1,C=m?n.noEOFCRAdditions:!1,w=(s?.noEOFCR??!1)||h,T=(o?.noEOFCR??!1)||C;if(T||w){if(a===`split`&&b.flush(),w){let e=c===`context`||c===`context-expanded`?c:`change-deletion`;a===`unified`?(v.unifiedContentAST.push(qE(e)),v.pushToGutter(`unified`,Yp(e,`metadata`,1))):(v.deletionsContentAST.push(qE(e)),v.pushToGutter(`deletions`,Yp(e,`metadata`,1)),T||(v.pushToGutter(`additions`,Yp(void 0,`buffer`,1)),v.additionsContentAST.push(KE(1))))}if(T){let e=c===`context`||c===`context-expanded`?c:`change-addition`;a===`unified`?(v.unifiedContentAST.push(qE(e)),v.pushToGutter(`unified`,Yp(e,`metadata`,1))):(v.additionsContentAST.push(qE(e)),v.pushToGutter(`additions`,Yp(e,`metadata`,1)),w||(v.pushToGutter(`deletions`,Yp(void 0,`buffer`,1)),v.deletionsContentAST.push(KE(1))))}v.incrementRowCount(1)}i>0&&u!==`simple`&&S({hunkIndex:c===`context-expanded`?t:t+1,collapsedLines:i,rangeSize:y,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:!e.isPartial}),v.incrementRowCount(1)}}),a===`split`&&b.flush();let C=Math.max(ZE(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),w=t.bufferBefore>0||t.bufferAfter>0,T=!d&&e.type!==`deleted`,E=!d&&e.type!==`new`,D=v.rowCount>0||w;f=T&&D?f:void 0,p=E&&D?p:void 0,m=d&&D?m:void 0;let ee=this.createPreElement(p!=null&&f!=null,C);return{unifiedGutterAST:d&&D?v.unifiedGutterAST.children:void 0,unifiedContentAST:m,deletionsGutterAST:E&&D?v.deletionsGutterAST.children:void 0,deletionsContentAST:p,additionsGutterAST:T&&D?v.additionsGutterAST.children:void 0,additionsContentAST:f,hunkData:h,preNode:ee,themeStyles:r,baseThemeType:i,headerElement:o?void 0:this.renderHeader(this.diff),totalLines:C,rowCount:v.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:``}}renderCodeAST(e,t){let 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;let i=qp(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,TE(r,t.rowCount)]}renderFullAST(e,t=[]){let n=this.getOptionsWithDefaults().hunkSeparators===`line-info`,r=this.renderCodeAST(`unified`,e);if(r!=null)return t.push(q({tagName:`code`,children:r,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-unified":``}})),{...e.preNode,children:t};let i=this.renderCodeAST(`deletions`,e);i!=null&&t.push(q({tagName:`code`,children:i,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-deletions":``}}));let a=this.renderCodeAST(`additions`,e);return a!=null&&t.push(q({tagName:`code`,children:a,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-additions":``}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return Qh(this.renderFullAST(e,t))}renderPartialHTML(e,t){return Qh(t==null?e:q({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(!F_(n))return;let i=e.type===`new`?[]:ID(P_(this.deletionAnnotations)),a=e.type===`deleted`?[]:ID(P_(this.additionAnnotations));if(i.length===0&&a.length===0)return;let{createAnnotationElement:o}=this;if(t===`unified`){VD({diffStyle:t,type:`context`,unifiedSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i.concat(a)},createAnnotationElement:o,context:r});return}VD({diffStyle:t,type:`context`,deletionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i},additionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:a},createAnnotationElement:o,context:r})}getAnnotations(e,t,n,r,i){let a={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(t!=null)for(let e of this.deletionAnnotations[t]??[])a.annotations.push(Dg(e));let o={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(n!=null)for(let t of this.additionAnnotations[n]??[])(e===`unified`?a:o).annotations.push(Dg(t));if(e===`unified`)return a.annotations.length>0?a:void 0;if(!(o.annotations.length===0&&a.annotations.length===0))return{deletionSpan:a,additionSpan:o}}renderHeader(e){let{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return DE({fileOrDiff:e,mode:t,stickyHeader:n})}};function ID(e){return e?.map(e=>Dg(e))??[]}var LD=new Intl.PluralRules(`en-US`);function RD(e){return`${e} unmodified line${LD.select(e)===`one`?``:`s`}`}function zD(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter(`unified`,n.gutter),t.incrementRowCount(1)}function BD(e,t,n){for(let{deletion:r,addition:i}of e){if(r==null&&i==null)continue;let e=r!=null&&i!=null?void 0:r==null?`deletions`:`additions`;(e==null||n.side!==e)&&n.flush(),r!=null&&(t.deletionsContentAST.push(r.content),t.pushToGutter(`deletions`,r.gutter)),i!=null&&(t.additionsContentAST.push(i.content),t.pushToGutter(`additions`,i.gutter)),e!=null&&(n.side=e,n.increment()),t.incrementRowCount(1)}}function VD({diffStyle:e,type:t,deletionLine:n,additionLine:r,unifiedSpan:i,deletionSpan:a,additionSpan:o,createAnnotationElement:s,context:c}){let l=!1;if(e===`unified`){if(r==null?n!=null&&c.unifiedContentAST.push(n):c.unifiedContentAST.push(r),i!=null){let e=t===`change`?n==null?`change-addition`:`change-deletion`:t;c.unifiedContentAST.push(s(i)),c.pushToGutter(`unified`,Yp(e,`annotation`,1)),l=!0}}else if(e===`split`){if(n!=null&&c.deletionsContentAST.push(n),r!=null&&c.additionsContentAST.push(r),a!=null){let e=t===`change`?n==null?`context`:`change-deletion`:t;c.deletionsContentAST.push(s(a)),c.pushToGutter(`deletions`,Yp(e,`annotation`,1)),l=!0}if(o!=null){let e=t===`change`?r==null?`context`:`change-addition`:t;c.additionsContentAST.push(s(o)),c.pushToGutter(`additions`,Yp(e,`annotation`,1)),l=!0}}l&&c.incrementRowCount(1)}function HD(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:i,isFirstHunk:a,isLastHunk:o,isExpandable:s},c){if(n<=0)return;let l=e===`unified`?c.unifiedContentAST:e===`deletions`?c.deletionsContentAST:c.additionsContentAST;if(c.hunkSeparators===`metadata`){i!=null&&(c.pushToGutter(e,YE({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),l.push(YE({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1));return}if(c.hunkSeparators===`simple`){t>0&&(c.pushToGutter(e,YE({type:`simple`,isFirstHunk:a,isLastHunk:!1})),l.push(YE({type:`simple`,isFirstHunk:a,isLastHunk:!1})),e!==`additions`&&c.incrementRowCount(1));return}let u=XE(e,t),d=r>c.expansionLineCount,f=s?t:void 0;c.pushToGutter(e,YE({type:c.hunkSeparators,content:RD(n),expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),l.push(YE({type:c.hunkSeparators,content:RD(n),expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1),c.hunkData.push({slotName:u,hunkIndex:t,lines:n,type:e,expandable:s?{up:!a,down:!o,chunked:d}:void 0})}function UD(e,t){return e==null||e.type!==`element`||t==null?e:{...e,properties:{...e.properties,...t}}}function WD(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function GD(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function KD(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}function qD(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:e?.useTokenTransformer,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,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}var JD=-1,YD=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++JD}`;type=`file-diff`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;constructor(e={theme:Zf},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new bg,this.scrollSyncManager=new k_,this.interactionManager=new tg(`diff`,ng(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(e){return qD(e)}createHunksRenderer(e){return new FD(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>{if(this.fileDiff==null)return;let n=this.fileDiff.hunks.at(-1),r,i;hunkIterator:for(let a of this.fileDiff.hunks){let o=t===`deletions`?a.deletionStart:a.additionStart,s=t===`deletions`?a.deletionCount:a.additionCount,c=a.splitLineStart,l=a.unifiedLineStart;if(e<o){let t=o-e;r=Math.max(l-t,0),i=Math.max(c-t,0);break hunkIterator}if(e>=o+s){if(a===n){let t=e-(o+s);r=l+a.unifiedLineCount+t,i=c+a.splitLineCount+t;break hunkIterator}continue}for(let n of a.hunkContent)if(n.type===`context`)if(e<o+n.lines){let t=e-o;i=c+t,r=l+t;break hunkIterator}else o+=n.lines,c+=n.lines,l+=n.lines;else{let a=t===`deletions`?n.deletions:n.additions;if(e<o+a){let a=e-o;r=l+(t===`additions`?n.deletions:0)+a,i=c+a;break hunkIterator}else o+=a,c+=Math.max(n.deletions,n.additions),l+=n.deletions+n.additions}break hunkIterator}if(!(r==null||i==null))return[r,i]};setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(ng(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(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType===t?!1:(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!Bp(this.appliedThemeCSS.theme,this.options.theme??Zf)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e,t){this.interactionManager.setSelection(e,t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{diffStyle:e=`split`,overflow:t=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,t===`wrap`),t===`scroll`&&e===`split`?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}cleanUp(e=!1){this.emitPostRender(!0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(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=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),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,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){let{fileContainer:t,prerenderedHTML:n,preventEmit:r=!1,lineAnnotations:i,oldFile:a,newFile:o,fileDiff:s}=e;this.hydrateElements(t,n),QD(this.pre,XD({fileDiff:s,oldFile:a,newFile:o}),this.options.collapsed)||$D(this.headerElement,ZD({fileDiff:s,oldFile:a,newFile:o}),this.options.disableFileHeader)?this.render({...e,preventEmit:!0}):this.hydrationSetup({fileDiff:s,oldFile:a,newFile:o,lineAnnotations:i}),r||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),Jg(e,t);for(let t of e.shadowRoot?.children??[]){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t;for(let e of t.children)!(e instanceof HTMLElement)||e.tagName.toLowerCase()!==`code`||(`deletions`in e.dataset&&(this.codeDeletions=e),`additions`in e.dataset&&(this.codeAdditions=e),`unified`in e.dataset&&(this.codeUnified=e));continue}if(`diffsHeader`in t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:r}){this.lineAnnotations=r??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!=null&&n!=null?O_(t,n,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=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.rerender()};render({oldFile:e,newFile:t,fileDiff:n,deferManagers:r=!1,forceRender:i=!1,preventEmit:a=!1,lineAnnotations:o,fileContainer:s,containerWrapper:c,renderRange:l}){if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);let{collapsed:u=!1,themeType:d=`system`}=this.options,f=u?void 0:l,p=this.hasThemeChanged(),m=e!=null&&t!=null&&(!Tg(e,this.deletionFile)||!Tg(t,this.additionFile)),h=n!=null&&n!==this.fileDiff,g=o!=null&&(o.length>0||this.lineAnnotations.length>0)?o!==this.lineAnnotations:!1;if(!u&&Eg(f,this.renderRange)&&!i&&!g&&!p&&(n!=null&&n===this.fileDiff||n==null&&!m))return this.applyCachedThemeState(d);let{renderRange:_}=this;if(this.renderRange=f,this.deletionFile=e,this.additionFile=t,n==null?e!=null&&t!=null&&m&&(h=!0,this.fileDiff=O_(e,t,this.options.parseDiffOptions)):this.fileDiff=n,h&&(this.cachedHeaderHTML=void 0),o!=null&&this.setLineAnnotations(o),this.fileDiff==null)return!1;this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:v=!1,disableFileHeader:y=!1}=this.options;if(y&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),s=this.getOrCreateFileContainer(s,c),this.applyCachedThemeState(d),u){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,ap);e!=null&&this.applyThemeState(s,e.themeStyles,d,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,s),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(v)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,s)}return a||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(s);if(!(this.canPartiallyRender(i,g,m||h||p)&&this.applyPartialRender({previousRenderRange:_,renderRange:f}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,f);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(s,t.themeStyles,d,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,s),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,f),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,r||this.flushManagers()}catch(e){if(v)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,s)}return a||this.emitPostRender(),!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}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(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}primeHighlightCache(){let{fileDiff:e,workerManager:t}=this;if(e==null||t==null||N_(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||t.primeDiffHighlightCache(e)}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.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.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(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!=`function`){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){let e=r.slotName,i=this.separatorCache.get(e);if(i==null||!KD(r,i.hunkData)){i?.element.remove();let n=document.createElement(`div`);n.style.display=`contents`,n.slot=r.slotName;let a=t(r,this);a!=null&&n.appendChild(a),this.fileContainer.appendChild(n),i={element:n,hunkData:r},this.separatorCache.set(e,i)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(let[n,r]of this.lineAnnotations.entries()){let i=`${n}-${Dg(r)}`,a=this.annotationCache.get(i);if(a==null||!GD(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:Mg(Dg(r)),annotation:r},a.element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(i,a)}e.delete(i)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=Ng();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:Vp(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):Vp(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=Og;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.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,t.appendChild(this.pre)):this.pre.parentNode!==t&&(t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(let t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute(`data-unified`)?this.codeUnified=t:t.hasAttribute(`data-deletions`)?this.codeDeletions=t:t.hasAttribute(`data-additions`)&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:n}=this,r=this.cachedHeaderHTML??Qh(e);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=r;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged||n==null)return;let{renderCustomHeader:i,renderHeaderPrefix:a,renderHeaderMetadata:o}=this.options;if(i!=null){let e=i(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,Xf,e),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0;return}let s=a?.(n)??void 0,c=o?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,Jf,s),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,Yf,c),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}this.unsafeCSSStyle?.parentNode===t&&this.appliedUnsafeCSS===e||(this.unsafeCSSStyle??=Pg(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=Vg(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??Zf,s=typeof o==`string`?o:{...o},c=Ig(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c};return}this.themeCSSStyle=Kg({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:Hg(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=Ug(this.themeCSSStyle.textContent??``,Ig(e)))}applyHunksToDOM(e,t){let{overflow:n=`scroll`}=this.options,r=(this.options.hunkSeparators??`line-info`)===`line-info`,i=n===`wrap`?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let a=!1,o=[],s=this.hunksRenderer.renderCodeAST(`unified`,t),c=this.hunksRenderer.renderCodeAST(`deletions`,t),l=this.hunksRenderer.renderCodeAST(`additions`,t);s==null?c!=null||l!=null?(c==null?(this.codeDeletions?.remove(),this.codeDeletions=void 0):(a=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=Gg({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(c),o.push(this.codeDeletions)),l==null?(this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=a||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=Gg({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(l),o.push(this.codeAdditions))):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=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=Gg({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s),o.push(this.codeUnified)),o.length===0?e.textContent=``:a&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:a,options:{diffStyle:o=`split`}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;let s=this.getCodeColumns(o,r,a,i);if(s==null)return!1;let c=e.startingLine,l=t.startingLine,u=c+e.totalLines,d=l+t.totalLines,f=Math.max(c,l),p=Math.min(u,d);if(p<=f)return!1;let m=Math.max(0,f-c),h=Math.max(0,u-p),g=this.trimColumns({columns:s,trimStart:m,trimEnd:h,previousStart:c,overlapStart:f,overlapEnd:p,diffStyle:o});if(g<0)throw Error(`applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<g)throw Error(`applyPartialRender: trimmed beyond DOM row count`);let _=this.lastRowCount-g,v=(e,t)=>{if(!(t<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},y=v(l,Math.max(f-l,0));if(y==null&&l<f)return!1;let b=v(p,Math.max(d-p,0));if(b==null&&d>p)return!1;let x=(e,t)=>{if(e!=null){if(o===`unified`&&!Array.isArray(s))this.insertPartialHTML(o,s,e,t);else if(o===`split`&&Array.isArray(s))this.insertPartialHTML(o,s,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);_+=e.rowCount}};return this.cleanupErrorWrapper(),x(y,`afterbegin`),x(b,`beforeend`),this.lastRowCount!==_&&(this.applyRowSpan(o,s,_),this.lastRowCount=_),!0}insertPartialHTML(e,t,n,r){if(e===`unified`&&!Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`unified`,n);this.renderPartialColumn(t,e,r)}else if(e===`split`&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`deletions`,n),i=this.hunksRenderer.renderCodeAST(`additions`,n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error(`FileDiff.insertPartialHTML: Invalid argument composition`)}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=eO(t[0]),i=eO(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let o=i.at(-1);n===`afterbegin`&&o?.type===`element`&&typeof o.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(o.properties[`data-buffer-size`],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.content.style.setProperty(`grid-row`,`span ${n}`))};if(e===`unified`&&!Array.isArray(t))r(t);else if(e===`split`&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a<c.length&&!(t<=0&&!s&&!o);){let e=l[a],u=c[a];if(a++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: invalid row elements`);if(o&&(o=!1,e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset||e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset)){e.remove(),u.remove(),i++;continue}if(`lineIndex`in e.dataset&&`lineIndex`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n,t===0&&r===0&&(o=!0)}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}else throw console.error({diffStyle:t,columns:e}),Error(`FileDiff.trimColumns: Invalid columns for diffType`)}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??``,10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty(`grid-row`,`span ${t}`),e.style.setProperty(`min-height`,`calc(${t} * 1lh)`)}getCodeColumns(e,t,n,r){function i(e){if(e==null)return;let t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}if(e===`unified`)return i(t);{let e=i(n),t=i(r);return e!=null||t!=null?[e,t]:void 0}}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.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(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){let{diffIndicators:a=`bars`,disableBackground:o=!1,disableLineNumbers:s=!1,overflow:c=`scroll`,diffStyle:l=`split`}=this.options,u={type:`diff`,diffIndicators:a,disableBackground:o,disableLineNumbers:s,overflow:c,split:l===`unified`?!1:t!=null&&n!=null,totalLines:r,customProperties:i};kg(u,this.appliedPreAttributes)||(Yg(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement(`pre`);i.dataset.errorStack=``,i.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function XD({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function ZD({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function QD(e,t,n=!1){return!n&&e==null&&t}function $D(e,t,n=!1){return e==null&&t&&!n}function eO(e){if(!(e==null||e.type!==`element`))return e.children??[]}function tO(e,t){return e.split(/(?=^diff --git )/m).find(e=>nO(e)===t)}function nO(e){return e.match(/^\+\+\+ b\/(.+)$/m)?.[1]||e.match(/^--- a\/(.+)$/m)?.[1]||e.match(/^diff --git a\/(.+?) b\/(.+)$/m)?.[2]}var rO=F(`<div>`),iO=F(`<div class=diff-viewer>`),aO=F(`<p class=empty>`);function oO(e){let[t,n]=C(),r;function i(){return new YD({diffStyle:`split`,hunkSeparators:`line-info`,lineDiffType:`word`,overflow:`scroll`,theme:{dark:`github-dark`,light:`github-light`},themeType:`light`})}function a(){r?.cleanUp(),r=void 0}let o=E(()=>{let t=(e.selectedPath?tO(e.diff,e.selectedPath):e.diff)?.trim()??``;if(t.length!==0)return vp(t,`review-diff`).flatMap(e=>e.files)[0]});return T(()=>{let e=o(),n=t();if(!n||!e){a();return}a(),r=i(),r.render({fileDiff:e,containerWrapper:n,forceRender:!0})}),te(a),(()=>{var t=iO();return I(t,N(Ee,{get when(){return o()},get fallback(){return(()=>{var t=aO();return I(t,()=>e.loading?`Loading diff...`:`No diff is available for this file.`),t})()},get children(){var e=rO();return Ne(n,e),e}})),t})()}var sO=F(`<p class=empty>Load a PR to see its changed files.`),cO=F(`<div class=file-tree><div class=file-tree-mount>`),lO=F(`<ul class=grouping-warnings>`),uO=F(`<details class=grouping-progress><summary><span></span><span></span></summary><ol>`),dO=F(`<li><span class=grouping-step-state></span><span>`),fO=F(`<li>`),pO=F(`<p class=empty>Run grouping to organize this PR for review.`),mO=F(`<div class=group-list><button type=button class=group-item><strong>All changes</strong><span> groups`),hO=F(`<button type=button class=group-item><strong></strong><span></span><small> files, <!> chunks`),gO=F(`<section class=empty-state><h2>Load a pull request</h2><p>Enter an explicit repository and PR number, or leave the repository blank to use the one in the directory where this command was started.`),_O=F(`<main class=app-shell><section class=review-header><div><p class=eyebrow>@wes-dev/pr</p><h1>Pull request review</h1></div><form class=pr-loader><label class=repository-input>Repository<input type=text placeholder=owner/repo></label><label>PR number<input type=text min=1 inputmode=numeric></label><button type=submit>Load PR`),vO=F(`<p class=pr-context> #`),yO=F(`<p class=error>`),bO=F(`<p>`),xO=F(`<section class=pr-summary><div><h2></h2></div><div class=header-actions><a target=_blank rel=noreferrer>Open on GitHub</a><details class=llm-settings><summary>LLM settings</summary><div class=llm-settings-panel><label>Manifest effort<select></select></label><label>Group agent effort<select></select></label><label>Reducer effort<select></select></label><button type=button>Apply</button></div></details><button type=button class=primary>Group changes`),SO=F(`<section class=review-grid><aside class="panel group-panel"><div class=panel-heading><h2>Logical groups</h2><span></span></div></aside><section class="panel diff-panel"><div class=panel-heading><h2>Diff</h2><span></span></div></section><aside class="panel file-panel"><div class=panel-heading><h2>Files</h2><span>`),CO=F(`<ul class=draft-list>`),wO=F(`<div class=current-comments>`),TO=F(`<section class=review-actions><section class="panel draft-panel"><div class=panel-heading><h2>Draft inline comment</h2><span> drafts</span></div><div class=form-content><p class=comment-target></p><div class=inline-fields><label>Side<select><option value=right>New (right)</option><option value=left>Old (left)</option></select></label><label>Line<input type=number min=1></label></div><label>Comment<textarea></textarea></label><button type=button>Add draft comment</button></div></section><section class="panel submit-panel"><div class=panel-heading><h2>Review</h2><button type=button>Refresh GitHub comments</button></div><div class=form-content><label>Decision<select><option value=pending>Choose a decision</option><option value=comment>Comment</option><option value=approve>Approve</option><option value=request-changes>Request changes</option></select></label><label>Review body<textarea></textarea></label><div class=submit-actions><button type=button>Save draft</button><button type=button class=primary>Submit review`),EO=F(`<option>`),DO=F(`<li><strong>:</strong><span>`),OO=F(`<article><strong></strong><span></span><p>`),kO=[{label:`Model default`,value:``},{label:`None`,value:`none`},{label:`Minimal`,value:`minimal`},{label:`Low`,value:`low`},{label:`Medium`,value:`medium`},{label:`High`,value:`high`},{label:`Extra high`,value:`xhigh`}];function AO(e){return e.status===`added`?`added`:e.status===`removed`?`deleted`:`modified`}function jO(e){let t,n,r=``,i=E(()=>e.files.map(e=>e.path)),a=E(()=>e.files.map(e=>({path:e.path,status:AO(e)})));return ee(()=>{if(!t)return;let o=i();r=MO(o),n=new Xu({density:`compact`,flattenEmptyDirectories:!0,gitStatus:a(),initialExpansion:`open`,initialSelectedPaths:e.activePath?[e.activePath]:[],paths:o,onSelectionChange:t=>{let[n]=t;n&&e.onSelect(n)}}),n.render({containerWrapper:t})}),T(()=>{let e=i(),t=MO(e);n&&t!==r&&(n.resetPaths(e,{initialExpandedPaths:e}),r=t),n?.setGitStatus(a())}),T(()=>{let t=e.activePath;if(!t)return;let r=n?.getItem(t);r&&!r.isSelected()&&r.select(),n?.scrollToPath(t,{focus:!1,offset:`nearest`})}),te(()=>{n?.cleanUp()}),(()=>{var n=cO(),r=n.firstChild;return Ne(e=>{t=e},r),I(n,N(Ee,{get when(){return e.files.length===0},get children(){return sO()}}),null),n})()}function MO(e){return e.join(`\0`)}function NO(e){return e instanceof Error?e.message:String(e)}function PO(e){return(()=>{var t=uO(),n=t.firstChild,r=n.firstChild,i=r.nextSibling,a=n.nextSibling;return I(i,()=>e.grouping.message??`Grouping changes`),I(a,N(Te,{get each(){return e.grouping.steps},children:e=>(()=>{var t=dO(),n=t.firstChild.nextSibling;return I(n,()=>e.label),w(()=>je(t,`data-state`,e.state)),t})()})),I(t,N(Ee,{get when(){return e.grouping.warnings.length>0},get children(){var t=lO();return I(t,N(Te,{get each(){return e.grouping.warnings},children:e=>(()=>{var t=fO();return I(t,e),t})()})),t}}),null),w(n=>{var i=e.grouping.state===`running`||e.grouping.warnings.length>0,a=`grouping-state ${e.grouping.state}`;return i!==n.e&&(t.open=n.e=i),a!==n.t&&Me(r,n.t=a),n},{e:void 0,t:void 0}),t})()}function FO(e){return(()=>{var t=mO(),n=t.firstChild,r=n.firstChild.nextSibling,i=r.firstChild;return n.$$click=()=>e.onSelect(void 0),I(r,()=>e.groups.length,i),I(t,N(Te,{get each(){return e.groups},children:t=>(()=>{var n=hO(),r=n.firstChild,i=r.nextSibling,a=i.nextSibling,o=a.firstChild,s=o.nextSibling;return s.nextSibling,n.$$click=()=>e.onSelect(t.id),I(r,()=>t.title),I(i,()=>t.summary),I(a,()=>t.files.length,o),I(a,()=>t.chunks.length,s),w(r=>{var i=t.id===e.selectedGroupId,a=t.id===e.selectedGroupId;return i!==r.e&&n.classList.toggle(`selected`,r.e=i),a!==r.t&&je(n,`aria-pressed`,r.t=a),r},{e:void 0,t:void 0}),n})()}),null),I(t,N(Ee,{get when(){return e.groups.length===0},get children(){return pO()}}),null),w(t=>{var r=!e.selectedGroupId,i=!e.selectedGroupId;return r!==t.e&&n.classList.toggle(`selected`,t.e=r),i!==t.t&&je(n,`aria-pressed`,t.t=i),t},{e:void 0,t:void 0}),t})()}function IO(){let[e,t]=C(``),[n,r]=C(``),[i,a]=C(),[o,s]=C(),[c,l]=C(),[u,d]=C(``),[f,p]=C(!1),[m,h]=C(``),[g,_]=C(``),[v,y]=C(``),[b,x]=C(``),[S,D]=C(``),[ne,re]=C(`right`),[O,k]=C(`pending`),[A,ie]=C(``),[ae,oe]=C([]),[se,ce]=C(),[le,j]=C(),ue,de=0,fe=E(()=>i()?.id),pe=E(()=>i()?.files??[]),me=E(()=>i()?.groups.find(e=>e.id===o())),he=E(()=>{let e=me();return e?pe().filter(t=>e.files.includes(t.path)):pe()}),M=E(()=>c()??he()[0]?.path);T(()=>{let e=he(),t=c();t&&!e.some(e=>e.path===t)&&l(e[0]?.path)}),T(()=>{let e=fe(),t=M(),n=o(),r=++de;if(!e||!t){d(``),p(!1);return}d(``),p(!0),Bf.review.getFileDiff.query({sessionId:e,path:t,groupId:n}).then(e=>{r===de&&d(e.diff)}).catch(e=>{r===de&&j(NO(e))}).finally(()=>{r===de&&p(!1)})}),T(()=>{o()&&!me()&&s(void 0)}),T(()=>{let e=i(),t=e?.grouping.state===`running`?e.id:void 0;t!==ue?.sessionId&&(ye(),t&&ve(t))}),te(ye),ee(()=>{(async()=>{try{let e=await Bf.review.getLlmSettings.query();h(e.reasoning.manifest??``),_(e.reasoning.groupAgent??``),y(e.reasoning.reducer??``)}catch(e){j(NO(e))}try{let e=await Bf.review.initialPullRequest.query();e.target&&(t(e.target.repository??``),r(String(e.target.number)),await ge(e.target))}catch(e){j(NO(e))}})()});async function ge(r){let i=r?.number??Number(n()),o=r?.repository??(e().trim()||void 0);if(!Number.isInteger(i)||i<=0){j(`Enter a positive pull request number.`);return}ce(`load`),j(void 0);try{let e=await Bf.review.loadPullRequest.mutate({repository:o,number:i});a(e),d(``),s(void 0),t(e.pullRequest.repository),l(e.files[0]?.path),k(e.decision.decision),ie(e.decision.body),oe([]),x(``),D(``)}catch(e){j(NO(e))}finally{ce(void 0)}}function _e(e){s(e);let t=e?pe().filter(t=>i()?.groups.find(t=>t.id===e)?.files.includes(t.path)):pe();t.some(e=>e.path===c())||l(t[0]?.path)}function ve(e){let t={cancelled:!1,inFlight:!1,interval:0,sessionId:e},n=async()=>{if(!(t.cancelled||t.inFlight||i()?.id!==e)){t.inFlight=!0;try{let n=await Bf.review.getSession.query({sessionId:e});!t.cancelled&&i()?.id===e&&a(n)}catch(e){t.cancelled||j(NO(e))}finally{t.inFlight=!1}}};t.interval=window.setInterval(()=>{n()},750),ue=t,n()}function ye(){ue&&=(ue.cancelled=!0,window.clearInterval(ue.interval),void 0)}function be(e){let n=Zu(e);if(n?.repository){t(n.repository),r(String(n.number));return}t(e)}function xe(e){let n=Zu(e);if(n?.repository){t(n.repository),r(String(n.number));return}r(e)}async function Se(){let e=i();if(e){ce(`groups`),j(void 0);try{a(await Bf.review.groupChanges.mutate({sessionId:e.id}))}catch(t){try{a(await Bf.review.getSession.query({sessionId:e.id}))}catch{}j(NO(t))}finally{ce(void 0)}}}async function Ce(){ce(`llm-settings`),j(void 0);try{let e=await Bf.review.setLlmSettings.mutate({reasoning:{manifest:m()||void 0,groupAgent:g()||void 0,reducer:v()||void 0}});h(e.reasoning.manifest??``),_(e.reasoning.groupAgent??``),y(e.reasoning.reducer??``)}catch(e){j(NO(e))}finally{ce(void 0)}}async function we(){let e=i(),t=M(),n=Number(S());if(!(!e||!t||!b().trim())){if(!Number.isInteger(n)||n<=0){j(`Set the visible diff line for this draft comment.`);return}ce(`comment`),j(void 0);try{a(await Bf.review.addDraftComment.mutate({sessionId:e.id,filePath:t,line:n,side:ne(),body:b().trim()})),x(``)}catch(e){j(NO(e))}finally{ce(void 0)}}}async function P(){let e=i();if(e){ce(`decision`),j(void 0);try{a(await Bf.review.setDecisionDraft.mutate({sessionId:e.id,decision:{decision:O(),body:A()}}))}catch(e){j(NO(e))}finally{ce(void 0)}}}async function Oe(){let e=i();if(e){ce(`comments`),j(void 0);try{oe(await Bf.review.listCurrentComments.query({sessionId:e.id}))}catch(e){j(NO(e))}finally{ce(void 0)}}}async function ke(){let e=i();if(!(!e||O()===`pending`)){ce(`submit`),j(void 0);try{await Bf.review.setDecisionDraft.mutate({sessionId:e.id,decision:{decision:O(),body:A()}}),a(await Bf.review.submitReview.mutate({sessionId:e.id})),k(`pending`),ie(``),oe([])}catch(e){j(NO(e))}finally{ce(void 0)}}}return(()=>{var t=_O(),r=t.firstChild.firstChild;r.firstChild.nextSibling;var a=r.nextSibling,s=a.firstChild,c=s.firstChild.nextSibling,d=s.nextSibling,p=d.firstChild.nextSibling,C=d.nextSibling;return I(r,N(Ee,{get when(){return i()},children:e=>(()=>{var t=vO(),n=t.firstChild;return I(t,()=>e().pullRequest.repository,n),I(t,()=>e().pullRequest.number,null),t})()}),null),a.addEventListener(`submit`,e=>{e.preventDefault(),ge()}),c.$$input=e=>be(e.currentTarget.value),p.$$input=e=>xe(e.currentTarget.value),I(t,N(Ee,{get when(){return le()},children:e=>(()=>{var t=yO();return I(t,e),t})()}),null),I(t,N(Ee,{get when(){return i()},children:e=>[(()=>{var t=xO(),n=t.firstChild,r=n.firstChild,i=n.nextSibling.firstChild,a=i.nextSibling,o=a.firstChild.nextSibling.firstChild,s=o.firstChild.nextSibling,c=o.nextSibling,l=c.firstChild.nextSibling,u=c.nextSibling,d=u.firstChild.nextSibling,f=u.nextSibling,p=a.nextSibling;return I(r,()=>e().pullRequest.title),I(n,N(Ee,{get when(){return e().pullRequest.body},get children(){var t=bO();return I(t,()=>e().pullRequest.body),t}}),null),s.addEventListener(`change`,e=>h(e.currentTarget.value)),I(s,N(Te,{each:kO,children:e=>(()=>{var t=EO();return I(t,()=>e.label),w(()=>t.value=e.value),t})()})),l.addEventListener(`change`,e=>_(e.currentTarget.value)),I(l,N(Te,{each:kO,children:e=>(()=>{var t=EO();return I(t,()=>e.label),w(()=>t.value=e.value),t})()})),d.addEventListener(`change`,e=>y(e.currentTarget.value)),I(d,N(Te,{each:kO,children:e=>(()=>{var t=EO();return I(t,()=>e.label),w(()=>t.value=e.value),t})()})),f.$$click=Ce,p.$$click=Se,w(t=>{var n=e().pullRequest.url,r=!!se(),a=!!se()||e().grouping.state===`running`;return n!==t.e&&je(i,`href`,t.e=n),r!==t.t&&(f.disabled=t.t=r),a!==t.a&&(p.disabled=t.a=a),t},{e:void 0,t:void 0,a:void 0}),w(()=>s.value=m()),w(()=>l.value=g()),w(()=>d.value=v()),t})(),(()=>{var t=SO(),n=t.firstChild,r=n.firstChild.firstChild.nextSibling,i=n.nextSibling,a=i.firstChild.firstChild.nextSibling,s=i.nextSibling,c=s.firstChild.firstChild.nextSibling;return I(r,()=>e().groups.length),I(n,N(Ee,{get when(){return e().grouping.state!==`idle`},get children(){return N(PO,{get grouping(){return e().grouping}})}}),null),I(n,N(FO,{get groups(){return e().groups},get selectedGroupId(){return o()},onSelect:_e}),null),I(a,()=>M()??`No file selected`),I(i,N(oO,{get diff(){return u()},get loading(){return f()},get selectedPath(){return M()}}),null),I(c,()=>he().length),I(s,N(jO,{get activePath(){return M()},get files(){return he()},onSelect:l}),null),t})(),(()=>{var t=TO(),n=t.firstChild,r=n.firstChild,i=r.firstChild.nextSibling,a=i.firstChild,o=r.nextSibling,s=o.firstChild,c=s.nextSibling,l=c.firstChild,u=l.firstChild.nextSibling,d=l.nextSibling.firstChild.nextSibling,f=c.nextSibling,p=f.firstChild.nextSibling,m=f.nextSibling,h=n.nextSibling.firstChild,g=h.firstChild.nextSibling,_=h.nextSibling,v=_.firstChild,y=v.firstChild.nextSibling,C=v.nextSibling,T=C.firstChild.nextSibling,E=C.nextSibling.firstChild,ee=E.nextSibling;return I(i,()=>e().draftComments.length,a),I(s,()=>M()??`Select a file`),u.addEventListener(`change`,e=>re(e.currentTarget.value)),d.$$input=e=>D(e.currentTarget.value),p.$$input=e=>x(e.currentTarget.value),m.$$click=we,I(o,N(Ee,{get when(){return e().draftComments.length>0},get children(){var t=CO();return I(t,N(Te,{get each(){return e().draftComments},children:e=>(()=>{var t=DO(),n=t.firstChild,r=n.firstChild,i=n.nextSibling;return I(n,()=>e.filePath,r),I(n,()=>e.line,null),I(i,()=>e.body),t})()})),t}}),null),g.$$click=Oe,y.addEventListener(`change`,e=>k(e.currentTarget.value)),T.$$input=e=>ie(e.currentTarget.value),E.$$click=P,ee.$$click=ke,I(_,N(Ee,{get when(){return ae().length>0},get children(){var e=wO();return I(e,N(Te,{get each(){return ae()},children:e=>(()=>{var t=OO(),n=t.firstChild,r=n.nextSibling,i=r.nextSibling;return I(n,()=>e.author),I(r,(()=>{var t=De(()=>!!e.filePath);return()=>t()?`${e.filePath}:${e.line??``}`:`General comment`})()),I(i,()=>e.body),t})()})),e}}),null),w(e=>{var t=!!se()||!M(),n=!!se(),r=!!se(),i=!!se()||O()===`pending`;return t!==e.e&&(m.disabled=e.e=t),n!==e.t&&(g.disabled=e.t=n),r!==e.a&&(E.disabled=e.a=r),i!==e.o&&(ee.disabled=e.o=i),e},{e:void 0,t:void 0,a:void 0,o:void 0}),w(()=>u.value=ne()),w(()=>d.value=S()),w(()=>p.value=b()),w(()=>y.value=O()),w(()=>T.value=A()),t})()]}),null),I(t,N(Ee,{get when(){return De(()=>!i())()&&!le()},get children(){return gO()}}),null),w(()=>C.disabled=!!se()),w(()=>c.value=e()),w(()=>p.value=n()),t})()}Ae([`click`,`input`]);var LO=document.getElementById(`root`);if(!LO)throw Error(`Missing root element.`);ke(()=>N(IO,{}),LO);export{t};