@moritzwilksch/diffle 0.1.4 → 0.1.6

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 (83) hide show
  1. package/README.md +25 -6
  2. package/dist/client/assets/{angular-html-DCs801AK.js → angular-html-VfoYZbqR.js} +1 -1
  3. package/dist/client/assets/{angular-ts-BWhN0w8_.js → angular-ts-E_ds17k3.js} +1 -1
  4. package/dist/client/assets/{apl-Djz0ErNW.js → apl-DfLg31Yo.js} +1 -1
  5. package/dist/client/assets/{astro-MWC3rLUN.js → astro-DDZGZEa0.js} +1 -1
  6. package/dist/client/assets/{blade-B8pycf1w.js → blade-C7j7NUSc.js} +1 -1
  7. package/dist/client/assets/{c-B-Jcxs--.js → c-B9ldfZRm.js} +1 -1
  8. package/dist/client/assets/{chapel-CuJCeKLf.js → chapel-D1rbgfGL.js} +1 -1
  9. package/dist/client/assets/{cobol-DgquORVs.js → cobol-CvvLWZ5H.js} +1 -1
  10. package/dist/client/assets/{coffee-ECOaIhT5.js → coffee-Cq5EY8Kf.js} +1 -1
  11. package/dist/client/assets/{cpp-CqnSivHO.js → cpp-KDnKhkos.js} +1 -1
  12. package/dist/client/assets/{crystal-Cs7ZYBfN.js → crystal-qnDGw82Q.js} +1 -1
  13. package/dist/client/assets/{css-p0qk9Lci.js → css-DbYR8NW9.js} +1 -1
  14. package/dist/client/assets/{edge-mMULBvUs.js → edge-BytNLpnp.js} +1 -1
  15. package/dist/client/assets/{elixir-VIosceup.js → elixir-BOIZTT6O.js} +1 -1
  16. package/dist/client/assets/{elm-C3kw87lA.js → elm-BLyo2uoF.js} +1 -1
  17. package/dist/client/assets/{erb-DZjmloke.js → erb-C8RG1ggg.js} +1 -1
  18. package/dist/client/assets/{git-rebase-qAMhScBw.js → git-rebase-BsJjDHkQ.js} +1 -1
  19. package/dist/client/assets/{glimmer-js-DJdA7CEB.js → glimmer-js-F0nfRvQ4.js} +1 -1
  20. package/dist/client/assets/{glimmer-ts-6xtV4JQb.js → glimmer-ts-BaUh_0sm.js} +1 -1
  21. package/dist/client/assets/{glsl-BRqSJ3dN.js → glsl-r7jKENsf.js} +1 -1
  22. package/dist/client/assets/{graphql-nm_X3Hg7.js → graphql-DecxGIfy.js} +1 -1
  23. package/dist/client/assets/{hack-CQ7j-SLC.js → hack-D1QdSbsI.js} +1 -1
  24. package/dist/client/assets/{haml-nw30ZCFe.js → haml-DZ3Y8IEU.js} +1 -1
  25. package/dist/client/assets/{handlebars-CbbUPaYB.js → handlebars-9ij-Y0dS.js} +1 -1
  26. package/dist/client/assets/{html-C-E44L0y.js → html-_813EOsa.js} +1 -1
  27. package/dist/client/assets/{html-derivative-DTCnXXkR.js → html-derivative-DMoYXYJX.js} +1 -1
  28. package/dist/client/assets/{http-Cg4Jw-kz.js → http-BHZjBd1F.js} +1 -1
  29. package/dist/client/assets/{hurl-CITbwYVL.js → hurl-B9C7GLqi.js} +1 -1
  30. package/dist/client/assets/index-CDwn6vHT.css +2 -0
  31. package/dist/client/assets/{index-BdA8MWLx.js → index-DDePiSWW.js} +104 -93
  32. package/dist/client/assets/{java-DNT_EPVr.js → java-BXcKXYSC.js} +1 -1
  33. package/dist/client/assets/{javascript-DBrMK690.js → javascript-DzK8bvMk.js} +1 -1
  34. package/dist/client/assets/{jinja-DqPnwJo-.js → jinja-DkPJymJ8.js} +1 -1
  35. package/dist/client/assets/{jison-A5ieRkCJ.js → jison-BRfwGndr.js} +1 -1
  36. package/dist/client/assets/{json-BolWLdCd.js → json-CVsgTDXF.js} +1 -1
  37. package/dist/client/assets/{jsx-CkIysgAJ.js → jsx-CCEGQMKy.js} +1 -1
  38. package/dist/client/assets/{julia-jBzm267c.js → julia-DB5wqhUl.js} +1 -1
  39. package/dist/client/assets/{just-cr8UASbW.js → just-saVQlczz.js} +1 -1
  40. package/dist/client/assets/{latex-DcdC0vak.js → latex-C7pJ0jXy.js} +1 -1
  41. package/dist/client/assets/{liquid-BBR6eAOA.js → liquid-BzVhxXiW.js} +1 -1
  42. package/dist/client/assets/{lua-CnUVAA9w.js → lua-B68msXNV.js} +1 -1
  43. package/dist/client/assets/{marko-BxH5DxB_.js → marko-D0vTAOKD.js} +1 -1
  44. package/dist/client/assets/{mdc-CVc0_tcy.js → mdc-C5xXBRll.js} +1 -1
  45. package/dist/client/assets/{nginx-B1DQmN_N.js → nginx-BgUn926n.js} +1 -1
  46. package/dist/client/assets/{nim-C3rsdIhh.js → nim-BWiAEcU7.js} +1 -1
  47. package/dist/client/assets/{org-DICsbmv1.js → org-PxncFL6r.js} +1 -1
  48. package/dist/client/assets/{perl-B-6tgIaz.js → perl-DNCL3XMU.js} +1 -1
  49. package/dist/client/assets/{php-CSZf1YiM.js → php-B4HLiXa-.js} +1 -1
  50. package/dist/client/assets/{pug-BvQ97HKe.js → pug-YBRTFp5G.js} +1 -1
  51. package/dist/client/assets/{qml-B_gSWBeZ.js → qml-Kbw3ykka.js} +1 -1
  52. package/dist/client/assets/{r-Dbh43Ti8.js → r-e7ntBSQI.js} +1 -1
  53. package/dist/client/assets/{razor-Dks3_W39.js → razor-C-7kbnr6.js} +1 -1
  54. package/dist/client/assets/{regexp-cZE9On7Z.js → regexp-BfKQ26Bd.js} +1 -1
  55. package/dist/client/assets/{rst-Cgn-1Zks.js → rst-Dk61acH4.js} +1 -1
  56. package/dist/client/assets/{ruby-DkGM-R-6.js → ruby-B-Gsrm_0.js} +1 -1
  57. package/dist/client/assets/{sas-D6c_PGbn.js → sas-DrwY32Sv.js} +1 -1
  58. package/dist/client/assets/{scss-BKxWJNFh.js → scss-BQ0tGjl9.js} +1 -1
  59. package/dist/client/assets/{shellscript-Bcg5lXvK.js → shellscript-70AyB6AW.js} +1 -1
  60. package/dist/client/assets/{shellsession-Bf400BZo.js → shellsession-C0TRVWC2.js} +1 -1
  61. package/dist/client/assets/{soy-VDZj_scj.js → soy-ljPZKxfc.js} +1 -1
  62. package/dist/client/assets/{sql-ushyJdRf.js → sql-CpAh8MTM.js} +1 -1
  63. package/dist/client/assets/{stata-87RYcwm-.js → stata-U-vhcCzr.js} +1 -1
  64. package/dist/client/assets/{surrealql-DiJkNDgM.js → surrealql-Cq-W9D43.js} +1 -1
  65. package/dist/client/assets/{svelte-B6zEQCqX.js → svelte-CsPr3yNN.js} +1 -1
  66. package/dist/client/assets/{templ-BbUkdxgW.js → templ-DieGJMZV.js} +1 -1
  67. package/dist/client/assets/{tex-8DUlt0ja.js → tex-D0ERfPEs.js} +1 -1
  68. package/dist/client/assets/{ts-tags-B9TjJt8W.js → ts-tags-Bw9LC0mV.js} +1 -1
  69. package/dist/client/assets/{tsx-KtVv-1tC.js → tsx-DIXVqg6z.js} +1 -1
  70. package/dist/client/assets/{twig-SRZcBkws.js → twig-DbTBKLwc.js} +1 -1
  71. package/dist/client/assets/{typescript-XxBZhs1X.js → typescript-Bd6Plo3n.js} +1 -1
  72. package/dist/client/assets/{typst-zdrwuFs3.js → typst-DqDsanSi.js} +1 -1
  73. package/dist/client/assets/{vue-CIJzu_ou.js → vue-Da_CXJw9.js} +1 -1
  74. package/dist/client/assets/{vue-html-Cbh4Xclf.js → vue-html-n6FmJEJ_.js} +1 -1
  75. package/dist/client/assets/{vue-vine-B3rP3Gia.js → vue-vine-BOc7r2gI.js} +1 -1
  76. package/dist/client/assets/{xml-B8FuGGpH.js → xml-DzU5oF9g.js} +1 -1
  77. package/dist/client/assets/{xsl-DGb4ZSQs.js → xsl-BTxmEaay.js} +1 -1
  78. package/dist/client/assets/{yaml-DgFlGzOM.js → yaml-DYMpEUsY.js} +1 -1
  79. package/dist/client/index.html +2 -2
  80. package/dist/server/{Watcher-C_X03LRa.js → Watcher-CKwvGuPB.js} +5 -4
  81. package/dist/server/main.js +343 -145
  82. package/package.json +1 -1
  83. package/dist/client/assets/index-CBL0EMlj.css +0 -2
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./angular-html-DCs801AK.js","./html-C-E44L0y.js","./javascript-DBrMK690.js","./css-p0qk9Lci.js","./angular-ts-BWhN0w8_.js","./scss-BKxWJNFh.js","./apl-Djz0ErNW.js","./xml-B8FuGGpH.js","./java-DNT_EPVr.js","./json-BolWLdCd.js","./astro-MWC3rLUN.js","./typescript-XxBZhs1X.js","./postcss-BXeXVLqQ.js","./tsx-KtVv-1tC.js","./blade-B8pycf1w.js","./html-derivative-DTCnXXkR.js","./sql-ushyJdRf.js","./bsl-_VjlB9mv.js","./sdbl-bTVj8UrX.js","./cairo-DLTphjLi.js","./python-gzcpVVnB.js","./chapel-CuJCeKLf.js","./c-B-Jcxs--.js","./cobol-DgquORVs.js","./coffee-ECOaIhT5.js","./cpp-CqnSivHO.js","./regexp-cZE9On7Z.js","./glsl-BRqSJ3dN.js","./crystal-Cs7ZYBfN.js","./shellscript-Bcg5lXvK.js","./edge-mMULBvUs.js","./elixir-VIosceup.js","./elm-C3kw87lA.js","./erb-DZjmloke.js","./ruby-DkGM-R-6.js","./haml-nw30ZCFe.js","./graphql-nm_X3Hg7.js","./jsx-CkIysgAJ.js","./lua-CnUVAA9w.js","./yaml-DgFlGzOM.js","./erlang-Cphh6RMH.js","./markdown-BYOwaDjH.js","./fortran-fixed-form-DEKoE2YW.js","./fortran-free-form-CYNrtFtB.js","./fsharp-D13ZGOAj.js","./gdresource-xMC7jr7x.js","./gdshader-CBce3t8t.js","./gdscript-DYvRD3hg.js","./git-commit-BSykSTBG.js","./diff-woXpYk--.js","./git-rebase-qAMhScBw.js","./glimmer-js-DJdA7CEB.js","./glimmer-ts-6xtV4JQb.js","./hack-CQ7j-SLC.js","./handlebars-CbbUPaYB.js","./http-Cg4Jw-kz.js","./hurl-CITbwYVL.js","./csv-Dx-8-gkx.js","./hxml-Dcm88srW.js","./haxe-C8oCnwJJ.js","./jinja-DqPnwJo-.js","./jison-A5ieRkCJ.js","./julia-jBzm267c.js","./r-Dbh43Ti8.js","./just-cr8UASbW.js","./perl-B-6tgIaz.js","./latex-DcdC0vak.js","./tex-8DUlt0ja.js","./liquid-BBR6eAOA.js","./marko-BxH5DxB_.js","./less-DVTAwKKz.js","./mdc-CVc0_tcy.js","./nextflow-BJtWHP5T.js","./nextflow-groovy-DJMQeKeT.js","./nginx-B1DQmN_N.js","./nim-C3rsdIhh.js","./org-DICsbmv1.js","./clojure-DqKBuwfJ.js","./csharp-oqKa8noW.js","./dart-CnvKMtbv.js","./docker-IyjqRm3v.js","./go-rLFTqkRN.js","./groovy-CacY0gHj.js","./ini-B5eOa1yu.js","./make-Dixweg8N.js","./objective-c-D1A_Heim.js","./ocaml-O90oeIOV.js","./php-CSZf1YiM.js","./vb-DOwzaHZ0.js","./raku-B3gFvitq.js","./rust-Cfkwpbl8.js","./scala-BiFt_7mu.js","./zig-CMLA9XwU.js","./xsl-DGb4ZSQs.js","./pug-BvQ97HKe.js","./qml-B_gSWBeZ.js","./razor-Dks3_W39.js","./rst-Cgn-1Zks.js","./cmake-Bj61d0ZC.js","./sas-D6c_PGbn.js","./shaderlab-TOUzSsQk.js","./hlsl-Cvrh5tZx.js","./shellsession-Bf400BZo.js","./soy-VDZj_scj.js","./sparql-D_iOobhT.js","./turtle-ByJddavk.js","./stata-87RYcwm-.js","./surrealql-DiJkNDgM.js","./svelte-B6zEQCqX.js","./templ-BbUkdxgW.js","./ts-tags-B9TjJt8W.js","./twig-SRZcBkws.js","./typst-zdrwuFs3.js","./bat-qdxAdBWQ.js","./bibtex-Ci_nEsc7.js","./jsonc-CYpm1nAK.js","./log-BNLmms1o.js","./powershell-CCSX75yM.js","./swift-CyEgAFGc.js","./system-verilog-Dh5ihWbf.js","./verilog-B2gwz-sJ.js","./vue-CIJzu_ou.js","./vue-html-Cbh4Xclf.js","./vue-vine-B3rP3Gia.js","./stylus-B6D30XZt.js"])))=>i.map(i=>d[i]);
2
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(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),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function u(e){return new Worker(``+new URL(`worker-DZo603XT.js`,import.meta.url).href,{type:`module`,name:e?.name})}var d=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),f=o(((e,t)=>{t.exports=d()})),p=l(f(),1);function m(e){let t=(0,p.useRef)(e);return(0,p.useInsertionEffect)(()=>void(t.current=e)),(0,p.useCallback)((...e)=>t.current(...e),[])}var h=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),g=o(((e,t)=>{t.exports=h()}))(),_=(0,p.createContext)(void 0);function v(){return(0,p.useContext)(_)}var y={position:`absolute`,top:0,bottom:0,textAlign:`center`,whiteSpace:`normal`,touchAction:`none`},b={display:`contents`};function x(){return null}var S=`diffs-container`,C=(()=>{try{return!1}catch{return!1}})(),w=/(?=^From [a-f0-9]+ .+$)/m,T=/(?=^diff --git)/gm,E=/(?<=\n)/,D=/^(---|\+\+\+)\s+([^\t\r\n]+)/,O=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,k=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,A=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,j=`header-prefix`,M=`header-filename-suffix`,N=`header-metadata`,P=`header-custom`,F={dark:`pierre-dark`,light:`pierre-light`},I=`data-theme-css`,L=`data-unsafe-css`,ee=`data-diffs-scrollbar-measure`,te=`data-diffs-code-view-header`,ne=`data-diffs-code-view-footer`,R=`--diffs-scrollbar-gutter-measured`,z=1e5,B={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},re={...B,hunkLineCount:1},ie={paddingTop:8,paddingBottom:8,gap:8},ae={omega:.015,positionEpsilon:.5,velocityEpsilon:.05},oe=Object.freeze({fromStart:0,fromEnd:0}),se={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},ce={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};function le(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function ue({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function V(e,t){return e-(t===0?0:1)}function de(e,t){return V(e,t)+t}function fe(e,t){let n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:pe(n,e.startContentIndex)}}function pe(e,t){let n=e.unifiedLineStart;for(let r=0;r<t;r++){let t=e.hunkContent[r];n+=t.type===`context`?t.lines:t.deletions+t.additions}return n}function me({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:r,renderHeaderFilenameSuffix:i,renderHeaderMetadata:a,renderAnnotation:o,renderGutterUtility:s,renderMergeConflictUtility:c,lineAnnotations:l,getHoveredLine:u,getInstance:d}){let f=n?.(e),p=r?.(e),m=i?.(e),h=a?.(e);return(0,g.jsxs)(g.Fragment,{children:[f==null?(0,g.jsxs)(g.Fragment,{children:[p!=null&&(0,g.jsx)(`div`,{slot:`header-prefix`,children:p}),m!=null&&(0,g.jsx)(`div`,{slot:`header-filename-suffix`,children:m}),h!=null&&(0,g.jsx)(`div`,{slot:`header-metadata`,children:h})]}):(0,g.jsx)(`div`,{slot:P,children:f}),o!=null&&l?.map((e,t)=>(0,g.jsx)(`div`,{slot:le(e),children:o(e)},t)),t!=null&&c!=null&&d!=null&&t.map(t=>{if(t==null)return;let n=he(t,e);return(0,g.jsx)(`div`,{slot:n,style:b,children:c(t,d)},n)}),s!=null&&(0,g.jsx)(`div`,{slot:`gutter-utility-slot`,style:y,children:s(u)})]})}function he(e,t){let n=fe(e,t);return n==null?void 0:ue({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex})}function ge({file:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:i,renderAnnotation:a,lineAnnotations:o,renderGutterUtility:s,getHoveredLine:c}){let l=t?.(e),u=n?.(e),d=r?.(e),f=i?.(e);return(0,g.jsxs)(g.Fragment,{children:[l==null?(0,g.jsxs)(g.Fragment,{children:[u!=null&&(0,g.jsx)(`div`,{slot:`header-prefix`,children:u}),d!=null&&(0,g.jsx)(`div`,{slot:`header-filename-suffix`,children:d}),f!=null&&(0,g.jsx)(`div`,{slot:`header-metadata`,children:f})]}):(0,g.jsx)(`div`,{slot:P,children:l}),a!=null&&o?.map((e,t)=>(0,g.jsx)(`div`,{slot:le(e),children:a(e)},t)),s!=null&&(0,g.jsx)(`div`,{slot:`gutter-utility-slot`,style:y,children:s(c)})]})}function _e(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function ve(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}var ye=new Set;function be(e){let t=[],n=new Set;for(let r of xe(e.themes)){let e=we(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 be({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 be({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function xe(e){return Se(e)?[e]:e}function Se(e){return we(e)||Ce(e)}function Ce(e){return typeof e.name==`string`&&typeof e.load==`function`}function we(e){return typeof e.getThemes==`function`}function Te(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var Ee=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},De=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},Oe=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function ke(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new Ee(t);e.set(t,n)}function a(t,n){return!e.has(t)&&(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 De(i));let c=r,l=s().then(e=>{let a=Te(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 Oe(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 Ae=ke();function je(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=Ae.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,Ae.getResolvedTheme(n)??Ae.seedResolvedTheme(n,e);ye.has(n)||(ye.add(n),t.loadThemeSync(e))}}var Me=new Map,Ne=new Map,Pe=new Map,Fe=new Set;function Ie(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(Fe.has(n.name))continue;let e=Me.get(n.name);e??(e=n,Me.set(n.name,e)),Fe.add(e.name),t.loadLanguageSync(e.data)}}function Le(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var Re=Object.defineProperty,ze=Object.getOwnPropertyDescriptor,Be=Object.getOwnPropertyNames,Ve=Object.prototype.hasOwnProperty,He=(e,t)=>{let n={};for(var r in e)Re(n,r,{get:e[r],enumerable:!0});return t||Re(n,Symbol.toStringTag,{value:`Module`}),n},Ue=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Be(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Ve.call(e,s)&&s!==n&&Re(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=ze(t,s))||r.enumerable});return e},We=(e,t,n)=>(Ue(e,t,`default`),n&&Ue(n,t,`default`)),Ge=`modulepreload`,Ke=function(e,t){return new URL(e,t).href},qe={},H=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,import.meta.url).href}r=o(t.map(t=>{if(t=Ke(t,n),t=s(t),t in qe)return;qe[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`:Ge,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)})},Je=[{id:`abap`,name:`ABAP`,import:(()=>H(()=>import(`./abap-CLvhMVsD.js`),[],import.meta.url))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>H(()=>import(`./actionscript-3-Cs6JJXT5.js`),[],import.meta.url))},{id:`ada`,name:`Ada`,import:(()=>H(()=>import(`./ada-C5qYipkI.js`),[],import.meta.url))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>H(()=>import(`./ahk-CA9gdOdF.js`),[],import.meta.url))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>H(()=>import(`./ahk2-_6rzW9BS.js`),[],import.meta.url))},{id:`angular-html`,name:`Angular HTML`,import:(()=>H(()=>import(`./angular-html-DCs801AK.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3]),import.meta.url))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>H(()=>import(`./angular-ts-BWhN0w8_.js`),__vite__mapDeps([4,0,1,2,3,5]),import.meta.url))},{id:`apache`,name:`Apache Conf`,import:(()=>H(()=>import(`./apache-U0d_L8uA.js`),[],import.meta.url))},{id:`apex`,name:`Apex`,import:(()=>H(()=>import(`./apex-KFGFyKwG.js`),[],import.meta.url))},{id:`apl`,name:`APL`,import:(()=>H(()=>import(`./apl-Djz0ErNW.js`),__vite__mapDeps([6,2,3,1,7,8,9]),import.meta.url))},{id:`applescript`,name:`AppleScript`,import:(()=>H(()=>import(`./applescript-CCn79oCD.js`),[],import.meta.url))},{id:`ara`,name:`Ara`,import:(()=>H(()=>import(`./ara-4CJ0cIlV.js`),[],import.meta.url))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>H(()=>import(`./asciidoc-SCjQUq34.js`),[],import.meta.url))},{id:`asm`,name:`Assembly`,import:(()=>H(()=>import(`./asm-Cmm7eHzH.js`),[],import.meta.url))},{id:`astro`,name:`Astro`,import:(()=>H(()=>import(`./astro-MWC3rLUN.js`),__vite__mapDeps([10,2,3,9,11,12,13]),import.meta.url))},{id:`awk`,name:`AWK`,import:(()=>H(()=>import(`./awk-BWXHIvNe.js`),[],import.meta.url))},{id:`ballerina`,name:`Ballerina`,import:(()=>H(()=>import(`./ballerina-B7ZEbQpA.js`),[],import.meta.url))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>H(()=>import(`./bat-qdxAdBWQ.js`),[],import.meta.url))},{id:`beancount`,name:`Beancount`,import:(()=>H(()=>import(`./beancount-D-usSTwE.js`),[],import.meta.url))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>H(()=>import(`./berry-DKpUyyne.js`),[],import.meta.url))},{id:`bibtex`,name:`BibTeX`,import:(()=>H(()=>import(`./bibtex-Ci_nEsc7.js`),[],import.meta.url))},{id:`bicep`,name:`Bicep`,import:(()=>H(()=>import(`./bicep-CUHmPFLl.js`),[],import.meta.url))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>H(()=>import(`./bird2-CYIUgYqB.js`),[],import.meta.url))},{id:`blade`,name:`Blade`,import:(()=>H(()=>import(`./blade-B8pycf1w.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16]),import.meta.url))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>H(()=>import(`./bsl-_VjlB9mv.js`),__vite__mapDeps([17,18]),import.meta.url))},{id:`c`,name:`C`,import:(()=>H(()=>import(`./c-B-Jcxs--.js`).then(e=>e.n),[],import.meta.url))},{id:`c3`,name:`C3`,import:(()=>H(()=>import(`./c3-D0apG41V.js`),[],import.meta.url))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>H(()=>import(`./cadence-CQ2zXKGN.js`),[],import.meta.url))},{id:`cairo`,name:`Cairo`,import:(()=>H(()=>import(`./cairo-DLTphjLi.js`),__vite__mapDeps([19,20]),import.meta.url))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>H(()=>import(`./chapel-CuJCeKLf.js`),__vite__mapDeps([21,22]),import.meta.url))},{id:`clarity`,name:`Clarity`,import:(()=>H(()=>import(`./clarity-CtfBBspg.js`),[],import.meta.url))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>H(()=>import(`./clojure-DqKBuwfJ.js`),[],import.meta.url))},{id:`cmake`,name:`CMake`,import:(()=>H(()=>import(`./cmake-Bj61d0ZC.js`),[],import.meta.url))},{id:`cobol`,name:`COBOL`,import:(()=>H(()=>import(`./cobol-DgquORVs.js`),__vite__mapDeps([23,1,2,3,8]),import.meta.url))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>H(()=>import(`./codeowners-C8r90Shi.js`),[],import.meta.url))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>H(()=>import(`./codeql-oeQT6MSM.js`),[],import.meta.url))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>H(()=>import(`./coffee-ECOaIhT5.js`),__vite__mapDeps([24,2]),import.meta.url))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>H(()=>import(`./common-lisp-Cv5bFMCO.js`),[],import.meta.url))},{id:`coq`,name:`Rocq`,import:(()=>H(()=>import(`./coq-DuBRPxYg.js`),[],import.meta.url))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>H(()=>import(`./cpp-CqnSivHO.js`).then(e=>e.n),__vite__mapDeps([25,26,27,22]),import.meta.url))},{id:`crystal`,name:`Crystal`,import:(()=>H(()=>import(`./crystal-Cs7ZYBfN.js`),__vite__mapDeps([28,2,3,1,16,22,29]),import.meta.url))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>H(()=>import(`./csharp-oqKa8noW.js`),[],import.meta.url))},{id:`css`,name:`CSS`,import:(()=>H(()=>import(`./css-p0qk9Lci.js`).then(e=>e.n),[],import.meta.url))},{id:`csv`,name:`CSV`,import:(()=>H(()=>import(`./csv-Dx-8-gkx.js`),[],import.meta.url))},{id:`cue`,name:`CUE`,import:(()=>H(()=>import(`./cue-CE9AQfxI.js`),[],import.meta.url))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>H(()=>import(`./cypher-ClKdZ_lG.js`),[],import.meta.url))},{id:`d`,name:`D`,import:(()=>H(()=>import(`./d-qD-0Kul2.js`),[],import.meta.url))},{id:`dart`,name:`Dart`,import:(()=>H(()=>import(`./dart-CnvKMtbv.js`),[],import.meta.url))},{id:`dax`,name:`DAX`,import:(()=>H(()=>import(`./dax-BkyTk9wS.js`),[],import.meta.url))},{id:`desktop`,name:`Desktop`,import:(()=>H(()=>import(`./desktop-Dlh5hvp9.js`),[],import.meta.url))},{id:`diff`,name:`Diff`,import:(()=>H(()=>import(`./diff-woXpYk--.js`),[],import.meta.url))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>H(()=>import(`./docker-IyjqRm3v.js`),[],import.meta.url))},{id:`dotenv`,name:`dotEnv`,import:(()=>H(()=>import(`./dotenv-_5a1GRtc.js`),[],import.meta.url))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>H(()=>import(`./dream-maker-DW3nJb8Q.js`),[],import.meta.url))},{id:`edge`,name:`Edge`,import:(()=>H(()=>import(`./edge-mMULBvUs.js`),__vite__mapDeps([30,1,2,3,11,15]),import.meta.url))},{id:`elixir`,name:`Elixir`,import:(()=>H(()=>import(`./elixir-VIosceup.js`),__vite__mapDeps([31,1,2,3]),import.meta.url))},{id:`elm`,name:`Elm`,import:(()=>H(()=>import(`./elm-C3kw87lA.js`),__vite__mapDeps([32,27,22]),import.meta.url))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>H(()=>import(`./emacs-lisp-c_oH4hRZ.js`),[],import.meta.url))},{id:`erb`,name:`ERB`,import:(()=>H(()=>import(`./erb-DZjmloke.js`),__vite__mapDeps([33,1,2,3,34,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39]),import.meta.url))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>H(()=>import(`./erlang-Cphh6RMH.js`),__vite__mapDeps([40,41]),import.meta.url))},{id:`fennel`,name:`Fennel`,import:(()=>H(()=>import(`./fennel-DQxkIbk2.js`),[],import.meta.url))},{id:`fish`,name:`Fish`,import:(()=>H(()=>import(`./fish-BJitypiv.js`),[],import.meta.url))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>H(()=>import(`./fluent-C03EYrpw.js`),[],import.meta.url))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>H(()=>import(`./fortran-fixed-form-DEKoE2YW.js`),__vite__mapDeps([42,43]),import.meta.url))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>H(()=>import(`./fortran-free-form-CYNrtFtB.js`),[],import.meta.url))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>H(()=>import(`./fsharp-D13ZGOAj.js`),__vite__mapDeps([44,41]),import.meta.url))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>H(()=>import(`./gdresource-xMC7jr7x.js`),__vite__mapDeps([45,46,47]),import.meta.url))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>H(()=>import(`./gdscript-DYvRD3hg.js`),[],import.meta.url))},{id:`gdshader`,name:`GDShader`,import:(()=>H(()=>import(`./gdshader-CBce3t8t.js`),[],import.meta.url))},{id:`genie`,name:`Genie`,import:(()=>H(()=>import(`./genie-CV2tkWYe.js`),[],import.meta.url))},{id:`gherkin`,name:`Gherkin`,import:(()=>H(()=>import(`./gherkin-DExj1W_8.js`),[],import.meta.url))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>H(()=>import(`./git-commit-BSykSTBG.js`),__vite__mapDeps([48,49]),import.meta.url))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>H(()=>import(`./git-rebase-qAMhScBw.js`),__vite__mapDeps([50,29]),import.meta.url))},{id:`gleam`,name:`Gleam`,import:(()=>H(()=>import(`./gleam-CSRkHgEL.js`),[],import.meta.url))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>H(()=>import(`./glimmer-js-DJdA7CEB.js`),__vite__mapDeps([51,2,3,1,11]),import.meta.url))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>H(()=>import(`./glimmer-ts-6xtV4JQb.js`),__vite__mapDeps([52,2,3,1,11]),import.meta.url))},{id:`glsl`,name:`GLSL`,import:(()=>H(()=>import(`./glsl-BRqSJ3dN.js`).then(e=>e.n),__vite__mapDeps([27,22]),import.meta.url))},{id:`gn`,name:`GN`,import:(()=>H(()=>import(`./gn-ilITqXS6.js`),[],import.meta.url))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>H(()=>import(`./gnuplot-7GGW24-e.js`),[],import.meta.url))},{id:`go`,name:`Go`,import:(()=>H(()=>import(`./go-rLFTqkRN.js`),[],import.meta.url))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>H(()=>import(`./graphql-nm_X3Hg7.js`).then(e=>e.n),__vite__mapDeps([36,2,11,13,37]),import.meta.url))},{id:`groovy`,name:`Groovy`,import:(()=>H(()=>import(`./groovy-CacY0gHj.js`),[],import.meta.url))},{id:`hack`,name:`Hack`,import:(()=>H(()=>import(`./hack-CQ7j-SLC.js`),__vite__mapDeps([53,1,2,3,16]),import.meta.url))},{id:`haml`,name:`Ruby Haml`,import:(()=>H(()=>import(`./haml-nw30ZCFe.js`).then(e=>e.n),__vite__mapDeps([35,2,3]),import.meta.url))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>H(()=>import(`./handlebars-CbbUPaYB.js`),__vite__mapDeps([54,2,3,1,39]),import.meta.url))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>H(()=>import(`./haskell-D8IpX4py.js`),[],import.meta.url))},{id:`haxe`,name:`Haxe`,import:(()=>H(()=>import(`./haxe-C8oCnwJJ.js`),[],import.meta.url))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>H(()=>import(`./hcl-Dh228itO.js`),[],import.meta.url))},{id:`hjson`,name:`Hjson`,import:(()=>H(()=>import(`./hjson-CxZEssPk.js`),[],import.meta.url))},{id:`hlsl`,name:`HLSL`,import:(()=>H(()=>import(`./hlsl-Cvrh5tZx.js`),[],import.meta.url))},{id:`html`,name:`HTML`,import:(()=>H(()=>import(`./html-C-E44L0y.js`).then(e=>e.n),__vite__mapDeps([1,2,3]),import.meta.url))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>H(()=>import(`./html-derivative-DTCnXXkR.js`),__vite__mapDeps([15,1,2,3]),import.meta.url))},{id:`http`,name:`HTTP`,import:(()=>H(()=>import(`./http-Cg4Jw-kz.js`),__vite__mapDeps([55,7,8,9,29,36,2,11,13,37]),import.meta.url))},{id:`hurl`,name:`Hurl`,import:(()=>H(()=>import(`./hurl-CITbwYVL.js`),__vite__mapDeps([56,7,8,57,36,2,11,13,37]),import.meta.url))},{id:`hxml`,name:`HXML`,import:(()=>H(()=>import(`./hxml-Dcm88srW.js`),__vite__mapDeps([58,59]),import.meta.url))},{id:`hy`,name:`Hy`,import:(()=>H(()=>import(`./hy-CZbG8q4J.js`),[],import.meta.url))},{id:`imba`,name:`Imba`,import:(()=>H(()=>import(`./imba-DsUTQ-LC.js`),[],import.meta.url))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>H(()=>import(`./ini-B5eOa1yu.js`),[],import.meta.url))},{id:`java`,name:`Java`,import:(()=>H(()=>import(`./java-DNT_EPVr.js`).then(e=>e.n),[],import.meta.url))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>H(()=>import(`./javascript-DBrMK690.js`).then(e=>e.n),[],import.meta.url))},{id:`jinja`,name:`Jinja`,import:(()=>H(()=>import(`./jinja-DqPnwJo-.js`),__vite__mapDeps([60,1,2,3]),import.meta.url))},{id:`jison`,name:`Jison`,import:(()=>H(()=>import(`./jison-A5ieRkCJ.js`),__vite__mapDeps([61,2]),import.meta.url))},{id:`json`,name:`JSON`,import:(()=>H(()=>import(`./json-BolWLdCd.js`).then(e=>e.n),[],import.meta.url))},{id:`json5`,name:`JSON5`,import:(()=>H(()=>import(`./json5-BR5RXkoi.js`),[],import.meta.url))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>H(()=>import(`./jsonc-CYpm1nAK.js`),[],import.meta.url))},{id:`jsonl`,name:`JSON Lines`,import:(()=>H(()=>import(`./jsonl-CmCQp5Yx.js`),[],import.meta.url))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>H(()=>import(`./jsonnet-CJTPZ8u_.js`),[],import.meta.url))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>H(()=>import(`./jssm-DXw9l8Rf.js`),[],import.meta.url))},{id:`jsx`,name:`JSX`,import:(()=>H(()=>import(`./jsx-CkIysgAJ.js`).then(e=>e.n),[],import.meta.url))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>H(()=>import(`./julia-jBzm267c.js`),__vite__mapDeps([62,2,16,20,25,26,27,22,63]),import.meta.url))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>H(()=>import(`./just-cr8UASbW.js`),__vite__mapDeps([64,2,11,20,29,34,3,1,7,8,16,22,25,26,27,35,36,13,37,38,39,65]),import.meta.url))},{id:`kdl`,name:`KDL`,import:(()=>H(()=>import(`./kdl-CsD5j6eV.js`),[],import.meta.url))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>H(()=>import(`./kotlin-DhhofPvG.js`),[],import.meta.url))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>H(()=>import(`./kusto-C7mF5XQf.js`),[],import.meta.url))},{id:`latex`,name:`LaTeX`,import:(()=>H(()=>import(`./latex-DcdC0vak.js`),__vite__mapDeps([66,67,63]),import.meta.url))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>H(()=>import(`./lean-CewbzKMR.js`),[],import.meta.url))},{id:`less`,name:`Less`,import:(()=>H(()=>import(`./less-DVTAwKKz.js`),[],import.meta.url))},{id:`liquid`,name:`Liquid`,import:(()=>H(()=>import(`./liquid-BBR6eAOA.js`),__vite__mapDeps([68,2,3,1,9]),import.meta.url))},{id:`llvm`,name:`LLVM IR`,import:(()=>H(()=>import(`./llvm-DqHOMS-s.js`),[],import.meta.url))},{id:`log`,name:`Log file`,import:(()=>H(()=>import(`./log-BNLmms1o.js`),[],import.meta.url))},{id:`logo`,name:`Logo`,import:(()=>H(()=>import(`./logo-Cluzi2Zq.js`),[],import.meta.url))},{id:`lua`,name:`Lua`,import:(()=>H(()=>import(`./lua-CnUVAA9w.js`).then(e=>e.n),__vite__mapDeps([38,22]),import.meta.url))},{id:`luau`,name:`Luau`,import:(()=>H(()=>import(`./luau-C2pBCSgt.js`),[],import.meta.url))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>H(()=>import(`./make-Dixweg8N.js`),[],import.meta.url))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>H(()=>import(`./markdown-BYOwaDjH.js`),[],import.meta.url))},{id:`marko`,name:`Marko`,import:(()=>H(()=>import(`./marko-BxH5DxB_.js`),__vite__mapDeps([69,3,5,11,70]),import.meta.url))},{id:`matlab`,name:`MATLAB`,import:(()=>H(()=>import(`./matlab-D7qyCx1q.js`),[],import.meta.url))},{id:`mdc`,name:`MDC`,import:(()=>H(()=>import(`./mdc-CVc0_tcy.js`),__vite__mapDeps([71,15,1,2,3,39,41]),import.meta.url))},{id:`mdx`,name:`MDX`,import:(()=>H(()=>import(`./mdx-DQZ5AkYe.js`),[],import.meta.url))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>H(()=>import(`./mermaid-BxpfTIzt.js`),[],import.meta.url))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>H(()=>import(`./mipsasm-BMqwQI7S.js`),[],import.meta.url))},{id:`mojo`,name:`Mojo`,import:(()=>H(()=>import(`./mojo-fg40_ntQ.js`),[],import.meta.url))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>H(()=>import(`./moonbit-DgjMoLWr.js`),[],import.meta.url))},{id:`move`,name:`Move`,import:(()=>H(()=>import(`./move-BYnGhZoM.js`),[],import.meta.url))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>H(()=>import(`./narrat-_X_XdTYD.js`),[],import.meta.url))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>H(()=>import(`./nextflow-BJtWHP5T.js`),__vite__mapDeps([72,73]),import.meta.url))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>H(()=>import(`./nextflow-groovy-DJMQeKeT.js`),[],import.meta.url))},{id:`nginx`,name:`Nginx`,import:(()=>H(()=>import(`./nginx-B1DQmN_N.js`),__vite__mapDeps([74,38,22]),import.meta.url))},{id:`nim`,name:`Nim`,import:(()=>H(()=>import(`./nim-C3rsdIhh.js`),__vite__mapDeps([75,2,3,1,7,8,22,27,41]),import.meta.url))},{id:`nix`,name:`Nix`,import:(()=>H(()=>import(`./nix-IvuFDN5E.js`),[],import.meta.url))},{id:`nsis`,name:`NSIS`,import:(()=>H(()=>import(`./nsis-CjNLYCLg.js`),[],import.meta.url))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>H(()=>import(`./nushell-DHYfO66s.js`),[],import.meta.url))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>H(()=>import(`./objective-c-D1A_Heim.js`),[],import.meta.url))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>H(()=>import(`./objective-cpp-BsSzOQcm.js`),[],import.meta.url))},{id:`ocaml`,name:`OCaml`,import:(()=>H(()=>import(`./ocaml-O90oeIOV.js`),[],import.meta.url))},{id:`odin`,name:`Odin`,import:(()=>H(()=>import(`./odin-B1RWQWA5.js`),[],import.meta.url))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>H(()=>import(`./openscad-BUDT5pXO.js`),[],import.meta.url))},{id:`org`,name:`Org Markup`,import:(()=>H(()=>import(`./org-DICsbmv1.js`),__vite__mapDeps([76,2,3,1,5,8,7,9,11,13,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,48,50,81,82,83,63,65,66,67,70,84,75,85,86,87,88,89,90,91,92,93]),import.meta.url))},{id:`pascal`,name:`Pascal`,import:(()=>H(()=>import(`./pascal-4ZHwLPI5.js`),[],import.meta.url))},{id:`perl`,name:`Perl`,import:(()=>H(()=>import(`./perl-B-6tgIaz.js`),__vite__mapDeps([65,2,3,1,7,8,16]),import.meta.url))},{id:`php`,name:`PHP`,import:(()=>H(()=>import(`./php-CSZf1YiM.js`),__vite__mapDeps([87,2,3,1,7,8,9,16]),import.meta.url))},{id:`pkl`,name:`Pkl`,import:(()=>H(()=>import(`./pkl-ot-7Btpt.js`),[],import.meta.url))},{id:`plsql`,name:`PL/SQL`,import:(()=>H(()=>import(`./plsql-DGHpHOYJ.js`),[],import.meta.url))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>H(()=>import(`./po-BiJDBrnU.js`),[],import.meta.url))},{id:`polar`,name:`Polar`,import:(()=>H(()=>import(`./polar-C7UOKdEL.js`),[],import.meta.url))},{id:`postcss`,name:`PostCSS`,import:(()=>H(()=>import(`./postcss-BXeXVLqQ.js`),[],import.meta.url))},{id:`powerquery`,name:`PowerQuery`,import:(()=>H(()=>import(`./powerquery-DNMTfnFr.js`),[],import.meta.url))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>H(()=>import(`./powershell-CCSX75yM.js`),[],import.meta.url))},{id:`prisma`,name:`Prisma`,import:(()=>H(()=>import(`./prisma-DMgNhnYS.js`),[],import.meta.url))},{id:`prolog`,name:`Prolog`,import:(()=>H(()=>import(`./prolog-iXnhIJG7.js`),[],import.meta.url))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>H(()=>import(`./proto-DB4EqR-F.js`),[],import.meta.url))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>H(()=>import(`./pug-BvQ97HKe.js`),__vite__mapDeps([94,2,3,1]),import.meta.url))},{id:`puppet`,name:`Puppet`,import:(()=>H(()=>import(`./puppet-CDv2pdJW.js`),[],import.meta.url))},{id:`purescript`,name:`PureScript`,import:(()=>H(()=>import(`./purescript-9MfHhQsQ.js`),[],import.meta.url))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>H(()=>import(`./python-gzcpVVnB.js`),[],import.meta.url))},{id:`qml`,name:`QML`,import:(()=>H(()=>import(`./qml-B_gSWBeZ.js`),__vite__mapDeps([95,2]),import.meta.url))},{id:`qmldir`,name:`QML Directory`,import:(()=>H(()=>import(`./qmldir-DCQb3MpD.js`),[],import.meta.url))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>H(()=>import(`./qss-Fe1Jh2GI.js`),[],import.meta.url))},{id:`r`,name:`R`,import:(()=>H(()=>import(`./r-Dbh43Ti8.js`).then(e=>e.n),[],import.meta.url))},{id:`racket`,name:`Racket`,import:(()=>H(()=>import(`./racket-DcIDlBhZ.js`),[],import.meta.url))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>H(()=>import(`./raku-B3gFvitq.js`),[],import.meta.url))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>H(()=>import(`./razor-Dks3_W39.js`),__vite__mapDeps([96,1,2,3,78]),import.meta.url))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>H(()=>import(`./rbs-C0MpOrj4.js`),[],import.meta.url))},{id:`reg`,name:`Windows Registry Script`,import:(()=>H(()=>import(`./reg-CRGYupPL.js`),[],import.meta.url))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>H(()=>import(`./regexp-cZE9On7Z.js`).then(e=>e.n),[],import.meta.url))},{id:`rel`,name:`Rel`,import:(()=>H(()=>import(`./rel-BtDbiS_P.js`),[],import.meta.url))},{id:`riscv`,name:`RISC-V`,import:(()=>H(()=>import(`./riscv-Ckw8ddFX.js`),[],import.meta.url))},{id:`ron`,name:`RON`,import:(()=>H(()=>import(`./ron-VUp2lXgN.js`),[],import.meta.url))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>H(()=>import(`./rosmsg-CAekHB0j.js`),[],import.meta.url))},{id:`rst`,name:`reStructuredText`,import:(()=>H(()=>import(`./rst-Cgn-1Zks.js`),__vite__mapDeps([97,2,15,1,3,20,98,25,26,27,22,29,39,34,7,8,16,35,36,11,13,37,38]),import.meta.url))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>H(()=>import(`./ruby-DkGM-R-6.js`),__vite__mapDeps([34,2,3,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39]),import.meta.url))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>H(()=>import(`./rust-Cfkwpbl8.js`),[],import.meta.url))},{id:`sas`,name:`SAS`,import:(()=>H(()=>import(`./sas-D6c_PGbn.js`),__vite__mapDeps([99,16]),import.meta.url))},{id:`sass`,name:`Sass`,import:(()=>H(()=>import(`./sass-DXrisJhu.js`),[],import.meta.url))},{id:`scala`,name:`Scala`,import:(()=>H(()=>import(`./scala-BiFt_7mu.js`),[],import.meta.url))},{id:`scheme`,name:`Scheme`,import:(()=>H(()=>import(`./scheme-DQCgrYNe.js`),[],import.meta.url))},{id:`scss`,name:`SCSS`,import:(()=>H(()=>import(`./scss-BKxWJNFh.js`).then(e=>e.n),__vite__mapDeps([5,3]),import.meta.url))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>H(()=>import(`./sdbl-bTVj8UrX.js`),[],import.meta.url))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>H(()=>import(`./shaderlab-TOUzSsQk.js`),__vite__mapDeps([100,101]),import.meta.url))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>H(()=>import(`./shellscript-Bcg5lXvK.js`).then(e=>e.n),[],import.meta.url))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>H(()=>import(`./shellsession-Bf400BZo.js`),__vite__mapDeps([102,29]),import.meta.url))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>H(()=>import(`./smalltalk-BHpQb5nM.js`),[],import.meta.url))},{id:`smithy`,name:`Smithy`,import:(()=>H(()=>import(`./smithy-Dgaz7aur.js`),[],import.meta.url))},{id:`solidity`,name:`Solidity`,import:(()=>H(()=>import(`./solidity-Bj7E1mRn.js`),[],import.meta.url))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>H(()=>import(`./soy-VDZj_scj.js`),__vite__mapDeps([103,1,2,3]),import.meta.url))},{id:`sparql`,name:`SPARQL`,import:(()=>H(()=>import(`./sparql-D_iOobhT.js`),__vite__mapDeps([104,105]),import.meta.url))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>H(()=>import(`./splunk-BC2Px7Mm.js`),[],import.meta.url))},{id:`sql`,name:`SQL`,import:(()=>H(()=>import(`./sql-ushyJdRf.js`).then(e=>e.n),[],import.meta.url))},{id:`ssh-config`,name:`SSH Config`,import:(()=>H(()=>import(`./ssh-config-BgfXC-Er.js`),[],import.meta.url))},{id:`stata`,name:`Stata`,import:(()=>H(()=>import(`./stata-87RYcwm-.js`),__vite__mapDeps([106,16]),import.meta.url))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>H(()=>import(`./stylus-B6D30XZt.js`),[],import.meta.url))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>H(()=>import(`./surrealql-DiJkNDgM.js`),__vite__mapDeps([107,2]),import.meta.url))},{id:`svelte`,name:`Svelte`,import:(()=>H(()=>import(`./svelte-B6zEQCqX.js`),__vite__mapDeps([108,2,3,11,12]),import.meta.url))},{id:`swift`,name:`Swift`,import:(()=>H(()=>import(`./swift-CyEgAFGc.js`),[],import.meta.url))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>H(()=>import(`./system-verilog-Dh5ihWbf.js`),[],import.meta.url))},{id:`systemd`,name:`Systemd Units`,import:(()=>H(()=>import(`./systemd-BxMlprV5.js`),[],import.meta.url))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>H(()=>import(`./talonscript-CohzipZa.js`),[],import.meta.url))},{id:`tasl`,name:`Tasl`,import:(()=>H(()=>import(`./tasl-DMoTqEGO.js`),[],import.meta.url))},{id:`tcl`,name:`Tcl`,import:(()=>H(()=>import(`./tcl-CZd0xW_V.js`),[],import.meta.url))},{id:`templ`,name:`Templ`,import:(()=>H(()=>import(`./templ-BbUkdxgW.js`),__vite__mapDeps([109,2,3,81]),import.meta.url))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>H(()=>import(`./terraform-DswuEJGm.js`),[],import.meta.url))},{id:`tex`,name:`TeX`,import:(()=>H(()=>import(`./tex-8DUlt0ja.js`).then(e=>e.n),__vite__mapDeps([67,63]),import.meta.url))},{id:`toml`,name:`TOML`,import:(()=>H(()=>import(`./toml-CcmNWLt0.js`),[],import.meta.url))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>H(()=>import(`./ts-tags-B9TjJt8W.js`),__vite__mapDeps([110,2,3,1,7,8,11,16,27,22]),import.meta.url))},{id:`tsv`,name:`TSV`,import:(()=>H(()=>import(`./tsv-sltzmVWM.js`),[],import.meta.url))},{id:`tsx`,name:`TSX`,import:(()=>H(()=>import(`./tsx-KtVv-1tC.js`).then(e=>e.n),[],import.meta.url))},{id:`turtle`,name:`Turtle`,import:(()=>H(()=>import(`./turtle-ByJddavk.js`),[],import.meta.url))},{id:`twig`,name:`Twig`,import:(()=>H(()=>import(`./twig-SRZcBkws.js`),__vite__mapDeps([111,2,3,5,20,34,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39,87,9]),import.meta.url))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>H(()=>import(`./typescript-XxBZhs1X.js`).then(e=>e.n),[],import.meta.url))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>H(()=>import(`./typespec-BRdr0IET.js`),[],import.meta.url))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>H(()=>import(`./typst-zdrwuFs3.js`),__vite__mapDeps([112,2,3,1,5,8,7,9,11,13,113,114,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,44,48,50,81,82,54,83,115,63,62,65,66,67,70,116,84,85,87,88,89,90,91,93,117,94,118,119,111,120]),import.meta.url))},{id:`v`,name:`V`,import:(()=>H(()=>import(`./v-DBj4K9d_.js`),[],import.meta.url))},{id:`vala`,name:`Vala`,import:(()=>H(()=>import(`./vala-zf12oZj6.js`),[],import.meta.url))},{id:`vb`,name:`Visual Basic`,import:(()=>H(()=>import(`./vb-DOwzaHZ0.js`),[],import.meta.url))},{id:`verilog`,name:`Verilog`,import:(()=>H(()=>import(`./verilog-B2gwz-sJ.js`),[],import.meta.url))},{id:`vhdl`,name:`VHDL`,import:(()=>H(()=>import(`./vhdl-BroJfC0k.js`),[],import.meta.url))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>H(()=>import(`./viml-DvXPmvsu.js`),[],import.meta.url))},{id:`vue`,name:`Vue`,import:(()=>H(()=>import(`./vue-CIJzu_ou.js`),__vite__mapDeps([121,2,3,1,9,11,15]),import.meta.url))},{id:`vue-html`,name:`Vue HTML`,import:(()=>H(()=>import(`./vue-html-Cbh4Xclf.js`),__vite__mapDeps([122,2]),import.meta.url))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>H(()=>import(`./vue-vine-B3rP3Gia.js`),__vite__mapDeps([123,2,3,5,12,70,124]),import.meta.url))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>H(()=>import(`./vyper-CgoNMtux.js`),[],import.meta.url))},{id:`wasm`,name:`WebAssembly`,import:(()=>H(()=>import(`./wasm-ByWQv1Qj.js`),[],import.meta.url))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>H(()=>import(`./wenyan-C8pVoKbM.js`),[],import.meta.url))},{id:`wgsl`,name:`WGSL`,import:(()=>H(()=>import(`./wgsl-BsKzXJz4.js`),[],import.meta.url))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>H(()=>import(`./wikitext-ClFFjSW2.js`),[],import.meta.url))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>H(()=>import(`./wit-DdvCle-K.js`),[],import.meta.url))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>H(()=>import(`./wolfram-DLL8P-h_.js`),[],import.meta.url))},{id:`xml`,name:`XML`,import:(()=>H(()=>import(`./xml-B8FuGGpH.js`).then(e=>e.n),__vite__mapDeps([7,8]),import.meta.url))},{id:`xsl`,name:`XSL`,import:(()=>H(()=>import(`./xsl-DGb4ZSQs.js`),__vite__mapDeps([93,7,8]),import.meta.url))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>H(()=>import(`./yaml-DgFlGzOM.js`).then(e=>e.n),[],import.meta.url))},{id:`zenscript`,name:`ZenScript`,import:(()=>H(()=>import(`./zenscript-BnlCZFoB.js`),[],import.meta.url))},{id:`zig`,name:`Zig`,import:(()=>H(()=>import(`./zig-CMLA9XwU.js`),[],import.meta.url))}],Ye=Object.fromEntries(Je.map(e=>[e.id,e.import])),Xe=Object.fromEntries(Je.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Ze={...Ye,...Xe},Qe=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>H(()=>import(`./andromeeda-vGVdxbeo.js`),[],import.meta.url))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>H(()=>import(`./aurora-x-CDeNXAV0.js`),[],import.meta.url))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>H(()=>import(`./ayu-dark-DluEY0Gj.js`),[],import.meta.url))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>H(()=>import(`./ayu-light-C3h-C4tm.js`),[],import.meta.url))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>H(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[],import.meta.url))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>H(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[],import.meta.url))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>H(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[],import.meta.url))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>H(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[],import.meta.url))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>H(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[],import.meta.url))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>H(()=>import(`./dark-plus-Cs2F2srj.js`),[],import.meta.url))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>H(()=>import(`./dracula-BHWKrbxM.js`),[],import.meta.url))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>H(()=>import(`./dracula-soft-5eyTD99u.js`),[],import.meta.url))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>H(()=>import(`./everforest-dark-sB-x3p7T.js`),[],import.meta.url))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>H(()=>import(`./everforest-light-Df2xbC6M.js`),[],import.meta.url))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>H(()=>import(`./github-dark-C-LZuMrd.js`),[],import.meta.url))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>H(()=>import(`./github-dark-default-DXG-b-1a.js`),[],import.meta.url))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>H(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[],import.meta.url))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>H(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[],import.meta.url))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>H(()=>import(`./github-light-EUqPIrTm.js`),[],import.meta.url))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>H(()=>import(`./github-light-default-BXViO-2h.js`),[],import.meta.url))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>H(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[],import.meta.url))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>H(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[],import.meta.url))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>H(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[],import.meta.url))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>H(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[],import.meta.url))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>H(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[],import.meta.url))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>H(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[],import.meta.url))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>H(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[],import.meta.url))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>H(()=>import(`./horizon-CE9ld1lL.js`),[],import.meta.url))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>H(()=>import(`./horizon-bright-DSNQnXHK.js`),[],import.meta.url))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>H(()=>import(`./houston-CsvMBhTu.js`),[],import.meta.url))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>H(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[],import.meta.url))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>H(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[],import.meta.url))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>H(()=>import(`./kanagawa-wave-BML5mF2J.js`),[],import.meta.url))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>H(()=>import(`./laserwave-C_8bwKvT.js`),[],import.meta.url))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>H(()=>import(`./light-plus-DVQuIRkW.js`),[],import.meta.url))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>H(()=>import(`./material-theme-Bm3Qr25_.js`),[],import.meta.url))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>H(()=>import(`./material-theme-darker-2IIEA8gg.js`),[],import.meta.url))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>H(()=>import(`./material-theme-lighter-uhdI0v04.js`),[],import.meta.url))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>H(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[],import.meta.url))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>H(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[],import.meta.url))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>H(()=>import(`./min-dark-BSWPekZh.js`),[],import.meta.url))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>H(()=>import(`./min-light-DDpmG2fV.js`),[],import.meta.url))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>H(()=>import(`./monokai-B_bV9PQ9.js`),[],import.meta.url))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>H(()=>import(`./night-owl-DhmEMT88.js`),[],import.meta.url))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>H(()=>import(`./night-owl-light-eJ-hLW7d.js`),[],import.meta.url))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>H(()=>import(`./nord-Cb4Vim4T.js`),[],import.meta.url))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>H(()=>import(`./one-dark-pro-CLwyXe_n.js`),[],import.meta.url))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>H(()=>import(`./one-light-D7Lr4KcI.js`),[],import.meta.url))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>H(()=>import(`./plastic-DQwYfKfQ.js`),[],import.meta.url))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>H(()=>import(`./poimandres-DRFjx7u4.js`),[],import.meta.url))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>H(()=>import(`./red-DX1BQOs8.js`),[],import.meta.url))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>H(()=>import(`./rose-pine-aMsaMD1D.js`),[],import.meta.url))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>H(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[],import.meta.url))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>H(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[],import.meta.url))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>H(()=>import(`./slack-dark-DnToyrRv.js`),[],import.meta.url))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>H(()=>import(`./slack-ochin-B2OO5cIa.js`),[],import.meta.url))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>H(()=>import(`./snazzy-light-4G7pJPwS.js`),[],import.meta.url))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>H(()=>import(`./solarized-dark-UdsmMDCL.js`),[],import.meta.url))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>H(()=>import(`./solarized-light-C1IUL_tW.js`),[],import.meta.url))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>H(()=>import(`./synthwave-84-nFMaYfgc.js`),[],import.meta.url))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>H(()=>import(`./tokyo-night-oM2G3aXe.js`),[],import.meta.url))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>H(()=>import(`./vesper-DdrHHSXu.js`),[],import.meta.url))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>H(()=>import(`./vitesse-black-fwtXNY1n.js`),[],import.meta.url))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>H(()=>import(`./vitesse-dark-BZCL-v6S.js`),[],import.meta.url))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>H(()=>import(`./vitesse-light-VbXTXTou.js`),[],import.meta.url))}].map(e=>[e.id,e.import])),$e=s({createOnigurumaEngine:()=>Dt,getDefaultWasmLoader:()=>Et,loadWasm:()=>bt,setDefaultWasmLoader:()=>Tt}),et=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function tt(){return 2147483648}function nt(){return typeof performance<`u`?performance.now():Date.now()}var rt=(e,t)=>e+(t-e%t)%t;async function it(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=tt();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,rt(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:nt,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 at=Object.defineProperty,ot=(e,t,n)=>t in e?at(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,st=(e,t,n)=>ot(e,typeof t==`symbol`?t:t+``,n),ct=null;function lt(e){throw new et(e.UTF8ToString(e.getLastOnigError()))}var ut=class e{constructor(t){st(this,`utf16Length`),st(this,`utf8Length`),st(this,`utf16Value`),st(this,`utf8Value`),st(this,`utf16OffsetToUtf8`),st(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)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},dt=class e{constructor(t){if(st(this,`id`,++e.LAST_ID),st(this,`_onigBinding`),st(this,`content`),st(this,`utf16Length`),st(this,`utf8Length`),st(this,`utf16OffsetToUtf8`),st(this,`utf8OffsetToUtf16`),st(this,`ptr`),!ct)throw new et(`Must invoke loadWasm first.`);this._onigBinding=ct,this.content=t;let n=new ut(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=ct.omalloc(1e4),e._sharedPtrInUse=!0,ct.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(ct)}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)}};st(dt,`LAST_ID`,0),st(dt,`_sharedPtr`,0),st(dt,`_sharedPtrInUse`,!1);var ft=dt,pt=class{constructor(e){if(st(this,`_onigBinding`),st(this,`_ptr`),!ct)throw new et(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new ut(e[r]);t[r]=i.createString(ct),n[r]=i.utf8Length}let r=ct.omalloc(4*e.length);ct.HEAPU32.set(t,r/4);let i=ct.omalloc(4*e.length);ct.HEAPU32.set(n,i/4);let a=ct.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)ct.ofree(t[n]);ct.ofree(i),ct.ofree(r),a===0&&lt(ct),this._onigBinding=ct,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 ft(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 mt(e){return typeof e.instantiator==`function`}function ht(e){return typeof e.default==`function`}function gt(e){return e.data!==void 0}function _t(e){return typeof Response<`u`&&e instanceof Response}function vt(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 yt;function bt(e){if(yt)return yt;async function t(){ct=await it(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),mt(n)?n=await n.instantiator(t):ht(n)?n=await n.default(t):(gt(n)&&(n=n.data),_t(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await St(n)(t):await Ct(n)(t):vt(n)||n instanceof WebAssembly.Module?n=await xt(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await xt(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return yt=t(),yt}function xt(e){return t=>WebAssembly.instantiate(e,t)}function St(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Ct(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var wt;function Tt(e){wt=e}function Et(){return wt}async function Dt(e){return e&&await bt(e),{createScanner(e){return new pt(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new ft(e)}}}var Ot=He({});We(Ot,$e);var kt=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function At(e){return jt(e)}function jt(e){return Array.isArray(e)?Mt(e):e instanceof RegExp?e:typeof e==`object`?Nt(e):e}function Mt(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=jt(e[n]);return t}function Nt(e){let t={};for(let n in e)t[n]=jt(e[n]);return t}function Pt(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Ft(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?Ft(e.substring(0,e.length-1)):e.substr(~t+1)}var It=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Lt=class{static hasCaptures(e){return e!==null&&(It.lastIndex=0,It.test(e))}static replaceCaptures(e,t,n){return e.replace(It,(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 Rt(e,t){return e<t?-1:+(e>t)}function zt(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=Rt(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function Bt(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 Vt(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Ht=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}},Ut=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Jt(e),t)}static createFromParsedTheme(e,t){return Zt(e,t)}_cachedMatchRoot=new Ht(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=>Gt(e.parent,t.parentScopes));return n?new qt(n.fontStyle,n.foreground,n.background):null}},Wt=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||this.parent!==null&&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 Gt(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&&!Kt(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Kt(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var qt=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Jt(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}}let s=null;typeof i.settings.foreground==`string`&&Bt(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&Bt(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 Yt(l,u,e,o,s,c)}}return n}var Yt=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}},Xt=(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))(Xt||{});function Zt(e,t){e.sort((e,t)=>{let n=Rt(e.scope,t.scope);return n!==0||(n=zt(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 Qt(t),o=new qt(n,a.getId(r),a.getId(i)),s=new tn(new en(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 Ut(a,o,s)}var Qt=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)}},$t=Object.freeze([]),en=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||$t,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)}},tn=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(),en.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(zt(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 en(e,t,n,r,i))}},nn=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)}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=an(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 rn(e){return e}function an(e){return e}function on(e,t){let n=[],r=cn(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(sn(i)){let e=[];do e.push(i),i=r.next();while(sn(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 sn(e){return!!e&&!!e.match(/[\w\.:]+/)}function cn(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 ln(e){typeof e.dispose==`function`&&e.dispose()}var un=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},dn=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},fn=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))}},pn=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new un(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new fn;for(let n of e)mn(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof un){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 mn(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 un?gn({baseGrammar:a,selfGrammar:i},r):hn(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 un(e))}function hn(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];_n([r],t,n)}}function gn(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&_n(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&_n(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function _n(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?Pt({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&_n(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Cn(i);switch(a.kind){case 0:gn({...t,selfGrammar:t.baseGrammar},n);break;case 1:gn(t,n);break;case 2:hn(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?hn(a.ruleName,i,n):gn(i,n)}else a.kind===4?n.add(new dn(a.scopeName,a.ruleName)):n.add(new un(a.scopeName))}}}var vn=class{kind=0},yn=class{kind=1},bn=class{constructor(e){this.ruleName=e}kind=2},xn=class{constructor(e){this.scopeName=e}kind=3},Sn=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Cn(e){if(e===`$base`)return new vn;if(e===`$self`)return new yn;let t=e.indexOf(`#`);return t===-1?new xn(e):t===0?new bn(e.substring(1)):new Sn(e.substring(0,t),e.substring(t+1))}var wn=/\\(\d+)/,Tn=/\\(\d+)/g,En=-1,Dn=-2;function On(e){return e}function kn(e){return e}var An=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Lt.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Lt.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Ft(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:Lt.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Lt.replaceCaptures(this._contentName,e,t)}},jn=class extends An{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!`)}},Mn=class extends An{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Ln(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 Rn,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Nn=class extends An{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 Rn,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Pn=class extends An{_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 Ln(i,this.id),this.beginCaptures=a,this._end=new Ln(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 Rn;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}},Fn=class extends An{_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 Ln(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Ln(o,Dn),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 Rn;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 Rn,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},In=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new jn(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Mn(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=Pt({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Nn(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Fn(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 Pn(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=Cn(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)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof Nn||e instanceof Pn||e instanceof Fn)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Ln=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._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&wn.test(this.source)}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 Tn.lastIndex=0,this.source.replace(Tn,(e,t)=>Vt(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}},Rn=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 zn(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 zn(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},zn=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(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./angular-html-VfoYZbqR.js","./html-_813EOsa.js","./javascript-DzK8bvMk.js","./css-DbYR8NW9.js","./angular-ts-E_ds17k3.js","./scss-BQ0tGjl9.js","./apl-DfLg31Yo.js","./xml-DzU5oF9g.js","./java-BXcKXYSC.js","./json-CVsgTDXF.js","./astro-DDZGZEa0.js","./typescript-Bd6Plo3n.js","./postcss-BXeXVLqQ.js","./tsx-DIXVqg6z.js","./blade-C7j7NUSc.js","./html-derivative-DMoYXYJX.js","./sql-CpAh8MTM.js","./bsl-_VjlB9mv.js","./sdbl-bTVj8UrX.js","./cairo-DLTphjLi.js","./python-gzcpVVnB.js","./chapel-D1rbgfGL.js","./c-B9ldfZRm.js","./cobol-CvvLWZ5H.js","./coffee-Cq5EY8Kf.js","./cpp-KDnKhkos.js","./regexp-BfKQ26Bd.js","./glsl-r7jKENsf.js","./crystal-qnDGw82Q.js","./shellscript-70AyB6AW.js","./edge-BytNLpnp.js","./elixir-BOIZTT6O.js","./elm-BLyo2uoF.js","./erb-C8RG1ggg.js","./ruby-B-Gsrm_0.js","./haml-DZ3Y8IEU.js","./graphql-DecxGIfy.js","./jsx-CCEGQMKy.js","./lua-B68msXNV.js","./yaml-DYMpEUsY.js","./erlang-Cphh6RMH.js","./markdown-BYOwaDjH.js","./fortran-fixed-form-DEKoE2YW.js","./fortran-free-form-CYNrtFtB.js","./fsharp-D13ZGOAj.js","./gdresource-xMC7jr7x.js","./gdshader-CBce3t8t.js","./gdscript-DYvRD3hg.js","./git-commit-BSykSTBG.js","./diff-woXpYk--.js","./git-rebase-BsJjDHkQ.js","./glimmer-js-F0nfRvQ4.js","./glimmer-ts-BaUh_0sm.js","./hack-D1QdSbsI.js","./handlebars-9ij-Y0dS.js","./http-BHZjBd1F.js","./hurl-B9C7GLqi.js","./csv-Dx-8-gkx.js","./hxml-Dcm88srW.js","./haxe-C8oCnwJJ.js","./jinja-DkPJymJ8.js","./jison-BRfwGndr.js","./julia-DB5wqhUl.js","./r-e7ntBSQI.js","./just-saVQlczz.js","./perl-DNCL3XMU.js","./latex-C7pJ0jXy.js","./tex-D0ERfPEs.js","./liquid-BzVhxXiW.js","./marko-D0vTAOKD.js","./less-DVTAwKKz.js","./mdc-C5xXBRll.js","./nextflow-BJtWHP5T.js","./nextflow-groovy-DJMQeKeT.js","./nginx-BgUn926n.js","./nim-BWiAEcU7.js","./org-PxncFL6r.js","./clojure-DqKBuwfJ.js","./csharp-oqKa8noW.js","./dart-CnvKMtbv.js","./docker-IyjqRm3v.js","./go-rLFTqkRN.js","./groovy-CacY0gHj.js","./ini-B5eOa1yu.js","./make-Dixweg8N.js","./objective-c-D1A_Heim.js","./ocaml-O90oeIOV.js","./php-B4HLiXa-.js","./vb-DOwzaHZ0.js","./raku-B3gFvitq.js","./rust-Cfkwpbl8.js","./scala-BiFt_7mu.js","./zig-CMLA9XwU.js","./xsl-BTxmEaay.js","./pug-YBRTFp5G.js","./qml-Kbw3ykka.js","./razor-C-7kbnr6.js","./rst-Dk61acH4.js","./cmake-Bj61d0ZC.js","./sas-DrwY32Sv.js","./shaderlab-TOUzSsQk.js","./hlsl-Cvrh5tZx.js","./shellsession-C0TRVWC2.js","./soy-ljPZKxfc.js","./sparql-D_iOobhT.js","./turtle-ByJddavk.js","./stata-U-vhcCzr.js","./surrealql-Cq-W9D43.js","./svelte-CsPr3yNN.js","./templ-DieGJMZV.js","./ts-tags-Bw9LC0mV.js","./twig-DbTBKLwc.js","./typst-DqDsanSi.js","./bat-qdxAdBWQ.js","./bibtex-Ci_nEsc7.js","./jsonc-CYpm1nAK.js","./log-BNLmms1o.js","./powershell-CCSX75yM.js","./swift-CyEgAFGc.js","./system-verilog-Dh5ihWbf.js","./verilog-B2gwz-sJ.js","./vue-Da_CXJw9.js","./vue-html-n6FmJEJ_.js","./vue-vine-BOc7r2gI.js","./stylus-B6D30XZt.js"])))=>i.map(i=>d[i]);
2
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(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),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function u(e){return new Worker(``+new URL(`worker-DZo603XT.js`,import.meta.url).href,{type:`module`,name:e?.name})}var d=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),f=o(((e,t)=>{t.exports=d()})),p=l(f(),1);function m(e){let t=(0,p.useRef)(e);return(0,p.useInsertionEffect)(()=>void(t.current=e)),(0,p.useCallback)((...e)=>t.current(...e),[])}var h=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),g=o(((e,t)=>{t.exports=h()}))(),_=(0,p.createContext)(void 0);function v(){return(0,p.useContext)(_)}var y={position:`absolute`,top:0,bottom:0,textAlign:`center`,whiteSpace:`normal`,touchAction:`none`},b={display:`contents`};function x(){return null}var S=`diffs-container`,C=(()=>{try{return!1}catch{return!1}})(),w=/(?=^From [a-f0-9]+ .+$)/m,T=/(?=^diff --git)/gm,E=/(?<=\n)/,D=/^(---|\+\+\+)\s+([^\t\r\n]+)/,O=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,k=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,A=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,j=`header-prefix`,M=`header-filename-suffix`,N=`header-metadata`,P=`header-custom`,F={dark:`pierre-dark`,light:`pierre-light`},I=`data-theme-css`,L=`data-unsafe-css`,ee=`data-diffs-scrollbar-measure`,te=`data-diffs-code-view-header`,ne=`data-diffs-code-view-footer`,R=`--diffs-scrollbar-gutter-measured`,z=1e5,B={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},re={...B,hunkLineCount:1},ie={paddingTop:8,paddingBottom:8,gap:8},ae={omega:.015,positionEpsilon:.5,velocityEpsilon:.05},oe=Object.freeze({fromStart:0,fromEnd:0}),se={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},ce={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};function le(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function ue({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function V(e,t){return e-(t===0?0:1)}function de(e,t){return V(e,t)+t}function fe(e,t){let n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:pe(n,e.startContentIndex)}}function pe(e,t){let n=e.unifiedLineStart;for(let r=0;r<t;r++){let t=e.hunkContent[r];n+=t.type===`context`?t.lines:t.deletions+t.additions}return n}function me({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:r,renderHeaderFilenameSuffix:i,renderHeaderMetadata:a,renderAnnotation:o,renderGutterUtility:s,renderMergeConflictUtility:c,lineAnnotations:l,getHoveredLine:u,getInstance:d}){let f=n?.(e),p=r?.(e),m=i?.(e),h=a?.(e);return(0,g.jsxs)(g.Fragment,{children:[f==null?(0,g.jsxs)(g.Fragment,{children:[p!=null&&(0,g.jsx)(`div`,{slot:`header-prefix`,children:p}),m!=null&&(0,g.jsx)(`div`,{slot:`header-filename-suffix`,children:m}),h!=null&&(0,g.jsx)(`div`,{slot:`header-metadata`,children:h})]}):(0,g.jsx)(`div`,{slot:P,children:f}),o!=null&&l?.map((e,t)=>(0,g.jsx)(`div`,{slot:le(e),children:o(e)},t)),t!=null&&c!=null&&d!=null&&t.map(t=>{if(t==null)return;let n=he(t,e);return(0,g.jsx)(`div`,{slot:n,style:b,children:c(t,d)},n)}),s!=null&&(0,g.jsx)(`div`,{slot:`gutter-utility-slot`,style:y,children:s(u)})]})}function he(e,t){let n=fe(e,t);return n==null?void 0:ue({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex})}function ge({file:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:i,renderAnnotation:a,lineAnnotations:o,renderGutterUtility:s,getHoveredLine:c}){let l=t?.(e),u=n?.(e),d=r?.(e),f=i?.(e);return(0,g.jsxs)(g.Fragment,{children:[l==null?(0,g.jsxs)(g.Fragment,{children:[u!=null&&(0,g.jsx)(`div`,{slot:`header-prefix`,children:u}),d!=null&&(0,g.jsx)(`div`,{slot:`header-filename-suffix`,children:d}),f!=null&&(0,g.jsx)(`div`,{slot:`header-metadata`,children:f})]}):(0,g.jsx)(`div`,{slot:P,children:l}),a!=null&&o?.map((e,t)=>(0,g.jsx)(`div`,{slot:le(e),children:a(e)},t)),s!=null&&(0,g.jsx)(`div`,{slot:`gutter-utility-slot`,style:y,children:s(c)})]})}function _e(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function ve(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}var ye=new Set;function be(e){let t=[],n=new Set;for(let r of xe(e.themes)){let e=we(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 be({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 be({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function xe(e){return Se(e)?[e]:e}function Se(e){return we(e)||Ce(e)}function Ce(e){return typeof e.name==`string`&&typeof e.load==`function`}function we(e){return typeof e.getThemes==`function`}function Te(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var Ee=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},De=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},Oe=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function ke(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new Ee(t);e.set(t,n)}function a(t,n){return!e.has(t)&&(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 De(i));let c=r,l=s().then(e=>{let a=Te(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 Oe(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 Ae=ke();function je(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=Ae.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,Ae.getResolvedTheme(n)??Ae.seedResolvedTheme(n,e);ye.has(n)||(ye.add(n),t.loadThemeSync(e))}}var Me=new Map,Ne=new Map,Pe=new Map,Fe=new Set;function Ie(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(Fe.has(n.name))continue;let e=Me.get(n.name);e??(e=n,Me.set(n.name,e)),Fe.add(e.name),t.loadLanguageSync(e.data)}}function Le(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var Re=Object.defineProperty,ze=Object.getOwnPropertyDescriptor,Be=Object.getOwnPropertyNames,Ve=Object.prototype.hasOwnProperty,He=(e,t)=>{let n={};for(var r in e)Re(n,r,{get:e[r],enumerable:!0});return t||Re(n,Symbol.toStringTag,{value:`Module`}),n},Ue=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Be(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Ve.call(e,s)&&s!==n&&Re(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=ze(t,s))||r.enumerable});return e},We=(e,t,n)=>(Ue(e,t,`default`),n&&Ue(n,t,`default`)),Ge=`modulepreload`,Ke=function(e,t){return new URL(e,t).href},qe={},H=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,import.meta.url).href}r=o(t.map(t=>{if(t=Ke(t,n),t=s(t),t in qe)return;qe[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`:Ge,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)})},Je=[{id:`abap`,name:`ABAP`,import:(()=>H(()=>import(`./abap-CLvhMVsD.js`),[],import.meta.url))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>H(()=>import(`./actionscript-3-Cs6JJXT5.js`),[],import.meta.url))},{id:`ada`,name:`Ada`,import:(()=>H(()=>import(`./ada-C5qYipkI.js`),[],import.meta.url))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>H(()=>import(`./ahk-CA9gdOdF.js`),[],import.meta.url))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>H(()=>import(`./ahk2-_6rzW9BS.js`),[],import.meta.url))},{id:`angular-html`,name:`Angular HTML`,import:(()=>H(()=>import(`./angular-html-VfoYZbqR.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3]),import.meta.url))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>H(()=>import(`./angular-ts-E_ds17k3.js`),__vite__mapDeps([4,0,1,2,3,5]),import.meta.url))},{id:`apache`,name:`Apache Conf`,import:(()=>H(()=>import(`./apache-U0d_L8uA.js`),[],import.meta.url))},{id:`apex`,name:`Apex`,import:(()=>H(()=>import(`./apex-KFGFyKwG.js`),[],import.meta.url))},{id:`apl`,name:`APL`,import:(()=>H(()=>import(`./apl-DfLg31Yo.js`),__vite__mapDeps([6,2,3,1,7,8,9]),import.meta.url))},{id:`applescript`,name:`AppleScript`,import:(()=>H(()=>import(`./applescript-CCn79oCD.js`),[],import.meta.url))},{id:`ara`,name:`Ara`,import:(()=>H(()=>import(`./ara-4CJ0cIlV.js`),[],import.meta.url))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>H(()=>import(`./asciidoc-SCjQUq34.js`),[],import.meta.url))},{id:`asm`,name:`Assembly`,import:(()=>H(()=>import(`./asm-Cmm7eHzH.js`),[],import.meta.url))},{id:`astro`,name:`Astro`,import:(()=>H(()=>import(`./astro-DDZGZEa0.js`),__vite__mapDeps([10,2,3,9,11,12,13]),import.meta.url))},{id:`awk`,name:`AWK`,import:(()=>H(()=>import(`./awk-BWXHIvNe.js`),[],import.meta.url))},{id:`ballerina`,name:`Ballerina`,import:(()=>H(()=>import(`./ballerina-B7ZEbQpA.js`),[],import.meta.url))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>H(()=>import(`./bat-qdxAdBWQ.js`),[],import.meta.url))},{id:`beancount`,name:`Beancount`,import:(()=>H(()=>import(`./beancount-D-usSTwE.js`),[],import.meta.url))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>H(()=>import(`./berry-DKpUyyne.js`),[],import.meta.url))},{id:`bibtex`,name:`BibTeX`,import:(()=>H(()=>import(`./bibtex-Ci_nEsc7.js`),[],import.meta.url))},{id:`bicep`,name:`Bicep`,import:(()=>H(()=>import(`./bicep-CUHmPFLl.js`),[],import.meta.url))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>H(()=>import(`./bird2-CYIUgYqB.js`),[],import.meta.url))},{id:`blade`,name:`Blade`,import:(()=>H(()=>import(`./blade-C7j7NUSc.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16]),import.meta.url))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>H(()=>import(`./bsl-_VjlB9mv.js`),__vite__mapDeps([17,18]),import.meta.url))},{id:`c`,name:`C`,import:(()=>H(()=>import(`./c-B9ldfZRm.js`).then(e=>e.n),[],import.meta.url))},{id:`c3`,name:`C3`,import:(()=>H(()=>import(`./c3-D0apG41V.js`),[],import.meta.url))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>H(()=>import(`./cadence-CQ2zXKGN.js`),[],import.meta.url))},{id:`cairo`,name:`Cairo`,import:(()=>H(()=>import(`./cairo-DLTphjLi.js`),__vite__mapDeps([19,20]),import.meta.url))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>H(()=>import(`./chapel-D1rbgfGL.js`),__vite__mapDeps([21,22]),import.meta.url))},{id:`clarity`,name:`Clarity`,import:(()=>H(()=>import(`./clarity-CtfBBspg.js`),[],import.meta.url))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>H(()=>import(`./clojure-DqKBuwfJ.js`),[],import.meta.url))},{id:`cmake`,name:`CMake`,import:(()=>H(()=>import(`./cmake-Bj61d0ZC.js`),[],import.meta.url))},{id:`cobol`,name:`COBOL`,import:(()=>H(()=>import(`./cobol-CvvLWZ5H.js`),__vite__mapDeps([23,1,2,3,8]),import.meta.url))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>H(()=>import(`./codeowners-C8r90Shi.js`),[],import.meta.url))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>H(()=>import(`./codeql-oeQT6MSM.js`),[],import.meta.url))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>H(()=>import(`./coffee-Cq5EY8Kf.js`),__vite__mapDeps([24,2]),import.meta.url))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>H(()=>import(`./common-lisp-Cv5bFMCO.js`),[],import.meta.url))},{id:`coq`,name:`Rocq`,import:(()=>H(()=>import(`./coq-DuBRPxYg.js`),[],import.meta.url))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>H(()=>import(`./cpp-KDnKhkos.js`).then(e=>e.n),__vite__mapDeps([25,26,27,22]),import.meta.url))},{id:`crystal`,name:`Crystal`,import:(()=>H(()=>import(`./crystal-qnDGw82Q.js`),__vite__mapDeps([28,2,3,1,16,22,29]),import.meta.url))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>H(()=>import(`./csharp-oqKa8noW.js`),[],import.meta.url))},{id:`css`,name:`CSS`,import:(()=>H(()=>import(`./css-DbYR8NW9.js`).then(e=>e.n),[],import.meta.url))},{id:`csv`,name:`CSV`,import:(()=>H(()=>import(`./csv-Dx-8-gkx.js`),[],import.meta.url))},{id:`cue`,name:`CUE`,import:(()=>H(()=>import(`./cue-CE9AQfxI.js`),[],import.meta.url))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>H(()=>import(`./cypher-ClKdZ_lG.js`),[],import.meta.url))},{id:`d`,name:`D`,import:(()=>H(()=>import(`./d-qD-0Kul2.js`),[],import.meta.url))},{id:`dart`,name:`Dart`,import:(()=>H(()=>import(`./dart-CnvKMtbv.js`),[],import.meta.url))},{id:`dax`,name:`DAX`,import:(()=>H(()=>import(`./dax-BkyTk9wS.js`),[],import.meta.url))},{id:`desktop`,name:`Desktop`,import:(()=>H(()=>import(`./desktop-Dlh5hvp9.js`),[],import.meta.url))},{id:`diff`,name:`Diff`,import:(()=>H(()=>import(`./diff-woXpYk--.js`),[],import.meta.url))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>H(()=>import(`./docker-IyjqRm3v.js`),[],import.meta.url))},{id:`dotenv`,name:`dotEnv`,import:(()=>H(()=>import(`./dotenv-_5a1GRtc.js`),[],import.meta.url))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>H(()=>import(`./dream-maker-DW3nJb8Q.js`),[],import.meta.url))},{id:`edge`,name:`Edge`,import:(()=>H(()=>import(`./edge-BytNLpnp.js`),__vite__mapDeps([30,1,2,3,11,15]),import.meta.url))},{id:`elixir`,name:`Elixir`,import:(()=>H(()=>import(`./elixir-BOIZTT6O.js`),__vite__mapDeps([31,1,2,3]),import.meta.url))},{id:`elm`,name:`Elm`,import:(()=>H(()=>import(`./elm-BLyo2uoF.js`),__vite__mapDeps([32,27,22]),import.meta.url))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>H(()=>import(`./emacs-lisp-c_oH4hRZ.js`),[],import.meta.url))},{id:`erb`,name:`ERB`,import:(()=>H(()=>import(`./erb-C8RG1ggg.js`),__vite__mapDeps([33,1,2,3,34,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39]),import.meta.url))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>H(()=>import(`./erlang-Cphh6RMH.js`),__vite__mapDeps([40,41]),import.meta.url))},{id:`fennel`,name:`Fennel`,import:(()=>H(()=>import(`./fennel-DQxkIbk2.js`),[],import.meta.url))},{id:`fish`,name:`Fish`,import:(()=>H(()=>import(`./fish-BJitypiv.js`),[],import.meta.url))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>H(()=>import(`./fluent-C03EYrpw.js`),[],import.meta.url))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>H(()=>import(`./fortran-fixed-form-DEKoE2YW.js`),__vite__mapDeps([42,43]),import.meta.url))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>H(()=>import(`./fortran-free-form-CYNrtFtB.js`),[],import.meta.url))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>H(()=>import(`./fsharp-D13ZGOAj.js`),__vite__mapDeps([44,41]),import.meta.url))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>H(()=>import(`./gdresource-xMC7jr7x.js`),__vite__mapDeps([45,46,47]),import.meta.url))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>H(()=>import(`./gdscript-DYvRD3hg.js`),[],import.meta.url))},{id:`gdshader`,name:`GDShader`,import:(()=>H(()=>import(`./gdshader-CBce3t8t.js`),[],import.meta.url))},{id:`genie`,name:`Genie`,import:(()=>H(()=>import(`./genie-CV2tkWYe.js`),[],import.meta.url))},{id:`gherkin`,name:`Gherkin`,import:(()=>H(()=>import(`./gherkin-DExj1W_8.js`),[],import.meta.url))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>H(()=>import(`./git-commit-BSykSTBG.js`),__vite__mapDeps([48,49]),import.meta.url))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>H(()=>import(`./git-rebase-BsJjDHkQ.js`),__vite__mapDeps([50,29]),import.meta.url))},{id:`gleam`,name:`Gleam`,import:(()=>H(()=>import(`./gleam-CSRkHgEL.js`),[],import.meta.url))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>H(()=>import(`./glimmer-js-F0nfRvQ4.js`),__vite__mapDeps([51,2,3,1,11]),import.meta.url))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>H(()=>import(`./glimmer-ts-BaUh_0sm.js`),__vite__mapDeps([52,2,3,1,11]),import.meta.url))},{id:`glsl`,name:`GLSL`,import:(()=>H(()=>import(`./glsl-r7jKENsf.js`).then(e=>e.n),__vite__mapDeps([27,22]),import.meta.url))},{id:`gn`,name:`GN`,import:(()=>H(()=>import(`./gn-ilITqXS6.js`),[],import.meta.url))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>H(()=>import(`./gnuplot-7GGW24-e.js`),[],import.meta.url))},{id:`go`,name:`Go`,import:(()=>H(()=>import(`./go-rLFTqkRN.js`),[],import.meta.url))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>H(()=>import(`./graphql-DecxGIfy.js`).then(e=>e.n),__vite__mapDeps([36,2,11,13,37]),import.meta.url))},{id:`groovy`,name:`Groovy`,import:(()=>H(()=>import(`./groovy-CacY0gHj.js`),[],import.meta.url))},{id:`hack`,name:`Hack`,import:(()=>H(()=>import(`./hack-D1QdSbsI.js`),__vite__mapDeps([53,1,2,3,16]),import.meta.url))},{id:`haml`,name:`Ruby Haml`,import:(()=>H(()=>import(`./haml-DZ3Y8IEU.js`).then(e=>e.n),__vite__mapDeps([35,2,3]),import.meta.url))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>H(()=>import(`./handlebars-9ij-Y0dS.js`),__vite__mapDeps([54,2,3,1,39]),import.meta.url))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>H(()=>import(`./haskell-D8IpX4py.js`),[],import.meta.url))},{id:`haxe`,name:`Haxe`,import:(()=>H(()=>import(`./haxe-C8oCnwJJ.js`),[],import.meta.url))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>H(()=>import(`./hcl-Dh228itO.js`),[],import.meta.url))},{id:`hjson`,name:`Hjson`,import:(()=>H(()=>import(`./hjson-CxZEssPk.js`),[],import.meta.url))},{id:`hlsl`,name:`HLSL`,import:(()=>H(()=>import(`./hlsl-Cvrh5tZx.js`),[],import.meta.url))},{id:`html`,name:`HTML`,import:(()=>H(()=>import(`./html-_813EOsa.js`).then(e=>e.n),__vite__mapDeps([1,2,3]),import.meta.url))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>H(()=>import(`./html-derivative-DMoYXYJX.js`),__vite__mapDeps([15,1,2,3]),import.meta.url))},{id:`http`,name:`HTTP`,import:(()=>H(()=>import(`./http-BHZjBd1F.js`),__vite__mapDeps([55,7,8,9,29,36,2,11,13,37]),import.meta.url))},{id:`hurl`,name:`Hurl`,import:(()=>H(()=>import(`./hurl-B9C7GLqi.js`),__vite__mapDeps([56,7,8,57,36,2,11,13,37]),import.meta.url))},{id:`hxml`,name:`HXML`,import:(()=>H(()=>import(`./hxml-Dcm88srW.js`),__vite__mapDeps([58,59]),import.meta.url))},{id:`hy`,name:`Hy`,import:(()=>H(()=>import(`./hy-CZbG8q4J.js`),[],import.meta.url))},{id:`imba`,name:`Imba`,import:(()=>H(()=>import(`./imba-DsUTQ-LC.js`),[],import.meta.url))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>H(()=>import(`./ini-B5eOa1yu.js`),[],import.meta.url))},{id:`java`,name:`Java`,import:(()=>H(()=>import(`./java-BXcKXYSC.js`).then(e=>e.n),[],import.meta.url))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>H(()=>import(`./javascript-DzK8bvMk.js`).then(e=>e.n),[],import.meta.url))},{id:`jinja`,name:`Jinja`,import:(()=>H(()=>import(`./jinja-DkPJymJ8.js`),__vite__mapDeps([60,1,2,3]),import.meta.url))},{id:`jison`,name:`Jison`,import:(()=>H(()=>import(`./jison-BRfwGndr.js`),__vite__mapDeps([61,2]),import.meta.url))},{id:`json`,name:`JSON`,import:(()=>H(()=>import(`./json-CVsgTDXF.js`).then(e=>e.n),[],import.meta.url))},{id:`json5`,name:`JSON5`,import:(()=>H(()=>import(`./json5-BR5RXkoi.js`),[],import.meta.url))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>H(()=>import(`./jsonc-CYpm1nAK.js`),[],import.meta.url))},{id:`jsonl`,name:`JSON Lines`,import:(()=>H(()=>import(`./jsonl-CmCQp5Yx.js`),[],import.meta.url))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>H(()=>import(`./jsonnet-CJTPZ8u_.js`),[],import.meta.url))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>H(()=>import(`./jssm-DXw9l8Rf.js`),[],import.meta.url))},{id:`jsx`,name:`JSX`,import:(()=>H(()=>import(`./jsx-CCEGQMKy.js`).then(e=>e.n),[],import.meta.url))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>H(()=>import(`./julia-DB5wqhUl.js`),__vite__mapDeps([62,2,16,20,25,26,27,22,63]),import.meta.url))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>H(()=>import(`./just-saVQlczz.js`),__vite__mapDeps([64,2,11,20,29,34,3,1,7,8,16,22,25,26,27,35,36,13,37,38,39,65]),import.meta.url))},{id:`kdl`,name:`KDL`,import:(()=>H(()=>import(`./kdl-CsD5j6eV.js`),[],import.meta.url))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>H(()=>import(`./kotlin-DhhofPvG.js`),[],import.meta.url))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>H(()=>import(`./kusto-C7mF5XQf.js`),[],import.meta.url))},{id:`latex`,name:`LaTeX`,import:(()=>H(()=>import(`./latex-C7pJ0jXy.js`),__vite__mapDeps([66,67,63]),import.meta.url))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>H(()=>import(`./lean-CewbzKMR.js`),[],import.meta.url))},{id:`less`,name:`Less`,import:(()=>H(()=>import(`./less-DVTAwKKz.js`),[],import.meta.url))},{id:`liquid`,name:`Liquid`,import:(()=>H(()=>import(`./liquid-BzVhxXiW.js`),__vite__mapDeps([68,2,3,1,9]),import.meta.url))},{id:`llvm`,name:`LLVM IR`,import:(()=>H(()=>import(`./llvm-DqHOMS-s.js`),[],import.meta.url))},{id:`log`,name:`Log file`,import:(()=>H(()=>import(`./log-BNLmms1o.js`),[],import.meta.url))},{id:`logo`,name:`Logo`,import:(()=>H(()=>import(`./logo-Cluzi2Zq.js`),[],import.meta.url))},{id:`lua`,name:`Lua`,import:(()=>H(()=>import(`./lua-B68msXNV.js`).then(e=>e.n),__vite__mapDeps([38,22]),import.meta.url))},{id:`luau`,name:`Luau`,import:(()=>H(()=>import(`./luau-C2pBCSgt.js`),[],import.meta.url))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>H(()=>import(`./make-Dixweg8N.js`),[],import.meta.url))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>H(()=>import(`./markdown-BYOwaDjH.js`),[],import.meta.url))},{id:`marko`,name:`Marko`,import:(()=>H(()=>import(`./marko-D0vTAOKD.js`),__vite__mapDeps([69,3,5,11,70]),import.meta.url))},{id:`matlab`,name:`MATLAB`,import:(()=>H(()=>import(`./matlab-D7qyCx1q.js`),[],import.meta.url))},{id:`mdc`,name:`MDC`,import:(()=>H(()=>import(`./mdc-C5xXBRll.js`),__vite__mapDeps([71,15,1,2,3,39,41]),import.meta.url))},{id:`mdx`,name:`MDX`,import:(()=>H(()=>import(`./mdx-DQZ5AkYe.js`),[],import.meta.url))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>H(()=>import(`./mermaid-BxpfTIzt.js`),[],import.meta.url))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>H(()=>import(`./mipsasm-BMqwQI7S.js`),[],import.meta.url))},{id:`mojo`,name:`Mojo`,import:(()=>H(()=>import(`./mojo-fg40_ntQ.js`),[],import.meta.url))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>H(()=>import(`./moonbit-DgjMoLWr.js`),[],import.meta.url))},{id:`move`,name:`Move`,import:(()=>H(()=>import(`./move-BYnGhZoM.js`),[],import.meta.url))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>H(()=>import(`./narrat-_X_XdTYD.js`),[],import.meta.url))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>H(()=>import(`./nextflow-BJtWHP5T.js`),__vite__mapDeps([72,73]),import.meta.url))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>H(()=>import(`./nextflow-groovy-DJMQeKeT.js`),[],import.meta.url))},{id:`nginx`,name:`Nginx`,import:(()=>H(()=>import(`./nginx-BgUn926n.js`),__vite__mapDeps([74,38,22]),import.meta.url))},{id:`nim`,name:`Nim`,import:(()=>H(()=>import(`./nim-BWiAEcU7.js`),__vite__mapDeps([75,2,3,1,7,8,22,27,41]),import.meta.url))},{id:`nix`,name:`Nix`,import:(()=>H(()=>import(`./nix-IvuFDN5E.js`),[],import.meta.url))},{id:`nsis`,name:`NSIS`,import:(()=>H(()=>import(`./nsis-CjNLYCLg.js`),[],import.meta.url))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>H(()=>import(`./nushell-DHYfO66s.js`),[],import.meta.url))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>H(()=>import(`./objective-c-D1A_Heim.js`),[],import.meta.url))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>H(()=>import(`./objective-cpp-BsSzOQcm.js`),[],import.meta.url))},{id:`ocaml`,name:`OCaml`,import:(()=>H(()=>import(`./ocaml-O90oeIOV.js`),[],import.meta.url))},{id:`odin`,name:`Odin`,import:(()=>H(()=>import(`./odin-B1RWQWA5.js`),[],import.meta.url))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>H(()=>import(`./openscad-BUDT5pXO.js`),[],import.meta.url))},{id:`org`,name:`Org Markup`,import:(()=>H(()=>import(`./org-PxncFL6r.js`),__vite__mapDeps([76,2,3,1,5,8,7,9,11,13,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,48,50,81,82,83,63,65,66,67,70,84,75,85,86,87,88,89,90,91,92,93]),import.meta.url))},{id:`pascal`,name:`Pascal`,import:(()=>H(()=>import(`./pascal-4ZHwLPI5.js`),[],import.meta.url))},{id:`perl`,name:`Perl`,import:(()=>H(()=>import(`./perl-DNCL3XMU.js`),__vite__mapDeps([65,2,3,1,7,8,16]),import.meta.url))},{id:`php`,name:`PHP`,import:(()=>H(()=>import(`./php-B4HLiXa-.js`),__vite__mapDeps([87,2,3,1,7,8,9,16]),import.meta.url))},{id:`pkl`,name:`Pkl`,import:(()=>H(()=>import(`./pkl-ot-7Btpt.js`),[],import.meta.url))},{id:`plsql`,name:`PL/SQL`,import:(()=>H(()=>import(`./plsql-DGHpHOYJ.js`),[],import.meta.url))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>H(()=>import(`./po-BiJDBrnU.js`),[],import.meta.url))},{id:`polar`,name:`Polar`,import:(()=>H(()=>import(`./polar-C7UOKdEL.js`),[],import.meta.url))},{id:`postcss`,name:`PostCSS`,import:(()=>H(()=>import(`./postcss-BXeXVLqQ.js`),[],import.meta.url))},{id:`powerquery`,name:`PowerQuery`,import:(()=>H(()=>import(`./powerquery-DNMTfnFr.js`),[],import.meta.url))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>H(()=>import(`./powershell-CCSX75yM.js`),[],import.meta.url))},{id:`prisma`,name:`Prisma`,import:(()=>H(()=>import(`./prisma-DMgNhnYS.js`),[],import.meta.url))},{id:`prolog`,name:`Prolog`,import:(()=>H(()=>import(`./prolog-iXnhIJG7.js`),[],import.meta.url))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>H(()=>import(`./proto-DB4EqR-F.js`),[],import.meta.url))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>H(()=>import(`./pug-YBRTFp5G.js`),__vite__mapDeps([94,2,3,1]),import.meta.url))},{id:`puppet`,name:`Puppet`,import:(()=>H(()=>import(`./puppet-CDv2pdJW.js`),[],import.meta.url))},{id:`purescript`,name:`PureScript`,import:(()=>H(()=>import(`./purescript-9MfHhQsQ.js`),[],import.meta.url))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>H(()=>import(`./python-gzcpVVnB.js`),[],import.meta.url))},{id:`qml`,name:`QML`,import:(()=>H(()=>import(`./qml-Kbw3ykka.js`),__vite__mapDeps([95,2]),import.meta.url))},{id:`qmldir`,name:`QML Directory`,import:(()=>H(()=>import(`./qmldir-DCQb3MpD.js`),[],import.meta.url))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>H(()=>import(`./qss-Fe1Jh2GI.js`),[],import.meta.url))},{id:`r`,name:`R`,import:(()=>H(()=>import(`./r-e7ntBSQI.js`).then(e=>e.n),[],import.meta.url))},{id:`racket`,name:`Racket`,import:(()=>H(()=>import(`./racket-DcIDlBhZ.js`),[],import.meta.url))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>H(()=>import(`./raku-B3gFvitq.js`),[],import.meta.url))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>H(()=>import(`./razor-C-7kbnr6.js`),__vite__mapDeps([96,1,2,3,78]),import.meta.url))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>H(()=>import(`./rbs-C0MpOrj4.js`),[],import.meta.url))},{id:`reg`,name:`Windows Registry Script`,import:(()=>H(()=>import(`./reg-CRGYupPL.js`),[],import.meta.url))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>H(()=>import(`./regexp-BfKQ26Bd.js`).then(e=>e.n),[],import.meta.url))},{id:`rel`,name:`Rel`,import:(()=>H(()=>import(`./rel-BtDbiS_P.js`),[],import.meta.url))},{id:`riscv`,name:`RISC-V`,import:(()=>H(()=>import(`./riscv-Ckw8ddFX.js`),[],import.meta.url))},{id:`ron`,name:`RON`,import:(()=>H(()=>import(`./ron-VUp2lXgN.js`),[],import.meta.url))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>H(()=>import(`./rosmsg-CAekHB0j.js`),[],import.meta.url))},{id:`rst`,name:`reStructuredText`,import:(()=>H(()=>import(`./rst-Dk61acH4.js`),__vite__mapDeps([97,2,15,1,3,20,98,25,26,27,22,29,39,34,7,8,16,35,36,11,13,37,38]),import.meta.url))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>H(()=>import(`./ruby-B-Gsrm_0.js`),__vite__mapDeps([34,2,3,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39]),import.meta.url))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>H(()=>import(`./rust-Cfkwpbl8.js`),[],import.meta.url))},{id:`sas`,name:`SAS`,import:(()=>H(()=>import(`./sas-DrwY32Sv.js`),__vite__mapDeps([99,16]),import.meta.url))},{id:`sass`,name:`Sass`,import:(()=>H(()=>import(`./sass-DXrisJhu.js`),[],import.meta.url))},{id:`scala`,name:`Scala`,import:(()=>H(()=>import(`./scala-BiFt_7mu.js`),[],import.meta.url))},{id:`scheme`,name:`Scheme`,import:(()=>H(()=>import(`./scheme-DQCgrYNe.js`),[],import.meta.url))},{id:`scss`,name:`SCSS`,import:(()=>H(()=>import(`./scss-BQ0tGjl9.js`).then(e=>e.n),__vite__mapDeps([5,3]),import.meta.url))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>H(()=>import(`./sdbl-bTVj8UrX.js`),[],import.meta.url))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>H(()=>import(`./shaderlab-TOUzSsQk.js`),__vite__mapDeps([100,101]),import.meta.url))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>H(()=>import(`./shellscript-70AyB6AW.js`).then(e=>e.n),[],import.meta.url))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>H(()=>import(`./shellsession-C0TRVWC2.js`),__vite__mapDeps([102,29]),import.meta.url))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>H(()=>import(`./smalltalk-BHpQb5nM.js`),[],import.meta.url))},{id:`smithy`,name:`Smithy`,import:(()=>H(()=>import(`./smithy-Dgaz7aur.js`),[],import.meta.url))},{id:`solidity`,name:`Solidity`,import:(()=>H(()=>import(`./solidity-Bj7E1mRn.js`),[],import.meta.url))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>H(()=>import(`./soy-ljPZKxfc.js`),__vite__mapDeps([103,1,2,3]),import.meta.url))},{id:`sparql`,name:`SPARQL`,import:(()=>H(()=>import(`./sparql-D_iOobhT.js`),__vite__mapDeps([104,105]),import.meta.url))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>H(()=>import(`./splunk-BC2Px7Mm.js`),[],import.meta.url))},{id:`sql`,name:`SQL`,import:(()=>H(()=>import(`./sql-CpAh8MTM.js`).then(e=>e.n),[],import.meta.url))},{id:`ssh-config`,name:`SSH Config`,import:(()=>H(()=>import(`./ssh-config-BgfXC-Er.js`),[],import.meta.url))},{id:`stata`,name:`Stata`,import:(()=>H(()=>import(`./stata-U-vhcCzr.js`),__vite__mapDeps([106,16]),import.meta.url))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>H(()=>import(`./stylus-B6D30XZt.js`),[],import.meta.url))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>H(()=>import(`./surrealql-Cq-W9D43.js`),__vite__mapDeps([107,2]),import.meta.url))},{id:`svelte`,name:`Svelte`,import:(()=>H(()=>import(`./svelte-CsPr3yNN.js`),__vite__mapDeps([108,2,3,11,12]),import.meta.url))},{id:`swift`,name:`Swift`,import:(()=>H(()=>import(`./swift-CyEgAFGc.js`),[],import.meta.url))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>H(()=>import(`./system-verilog-Dh5ihWbf.js`),[],import.meta.url))},{id:`systemd`,name:`Systemd Units`,import:(()=>H(()=>import(`./systemd-BxMlprV5.js`),[],import.meta.url))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>H(()=>import(`./talonscript-CohzipZa.js`),[],import.meta.url))},{id:`tasl`,name:`Tasl`,import:(()=>H(()=>import(`./tasl-DMoTqEGO.js`),[],import.meta.url))},{id:`tcl`,name:`Tcl`,import:(()=>H(()=>import(`./tcl-CZd0xW_V.js`),[],import.meta.url))},{id:`templ`,name:`Templ`,import:(()=>H(()=>import(`./templ-DieGJMZV.js`),__vite__mapDeps([109,2,3,81]),import.meta.url))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>H(()=>import(`./terraform-DswuEJGm.js`),[],import.meta.url))},{id:`tex`,name:`TeX`,import:(()=>H(()=>import(`./tex-D0ERfPEs.js`).then(e=>e.n),__vite__mapDeps([67,63]),import.meta.url))},{id:`toml`,name:`TOML`,import:(()=>H(()=>import(`./toml-CcmNWLt0.js`),[],import.meta.url))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>H(()=>import(`./ts-tags-Bw9LC0mV.js`),__vite__mapDeps([110,2,3,1,7,8,11,16,27,22]),import.meta.url))},{id:`tsv`,name:`TSV`,import:(()=>H(()=>import(`./tsv-sltzmVWM.js`),[],import.meta.url))},{id:`tsx`,name:`TSX`,import:(()=>H(()=>import(`./tsx-DIXVqg6z.js`).then(e=>e.n),[],import.meta.url))},{id:`turtle`,name:`Turtle`,import:(()=>H(()=>import(`./turtle-ByJddavk.js`),[],import.meta.url))},{id:`twig`,name:`Twig`,import:(()=>H(()=>import(`./twig-DbTBKLwc.js`),__vite__mapDeps([111,2,3,5,20,34,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39,87,9]),import.meta.url))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>H(()=>import(`./typescript-Bd6Plo3n.js`).then(e=>e.n),[],import.meta.url))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>H(()=>import(`./typespec-BRdr0IET.js`),[],import.meta.url))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>H(()=>import(`./typst-DqDsanSi.js`),__vite__mapDeps([112,2,3,1,5,8,7,9,11,13,113,114,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,44,48,50,81,82,54,83,115,63,62,65,66,67,70,116,84,85,87,88,89,90,91,93,117,94,118,119,111,120]),import.meta.url))},{id:`v`,name:`V`,import:(()=>H(()=>import(`./v-DBj4K9d_.js`),[],import.meta.url))},{id:`vala`,name:`Vala`,import:(()=>H(()=>import(`./vala-zf12oZj6.js`),[],import.meta.url))},{id:`vb`,name:`Visual Basic`,import:(()=>H(()=>import(`./vb-DOwzaHZ0.js`),[],import.meta.url))},{id:`verilog`,name:`Verilog`,import:(()=>H(()=>import(`./verilog-B2gwz-sJ.js`),[],import.meta.url))},{id:`vhdl`,name:`VHDL`,import:(()=>H(()=>import(`./vhdl-BroJfC0k.js`),[],import.meta.url))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>H(()=>import(`./viml-DvXPmvsu.js`),[],import.meta.url))},{id:`vue`,name:`Vue`,import:(()=>H(()=>import(`./vue-Da_CXJw9.js`),__vite__mapDeps([121,2,3,1,9,11,15]),import.meta.url))},{id:`vue-html`,name:`Vue HTML`,import:(()=>H(()=>import(`./vue-html-n6FmJEJ_.js`),__vite__mapDeps([122,2]),import.meta.url))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>H(()=>import(`./vue-vine-BOc7r2gI.js`),__vite__mapDeps([123,2,3,5,12,70,124]),import.meta.url))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>H(()=>import(`./vyper-CgoNMtux.js`),[],import.meta.url))},{id:`wasm`,name:`WebAssembly`,import:(()=>H(()=>import(`./wasm-ByWQv1Qj.js`),[],import.meta.url))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>H(()=>import(`./wenyan-C8pVoKbM.js`),[],import.meta.url))},{id:`wgsl`,name:`WGSL`,import:(()=>H(()=>import(`./wgsl-BsKzXJz4.js`),[],import.meta.url))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>H(()=>import(`./wikitext-ClFFjSW2.js`),[],import.meta.url))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>H(()=>import(`./wit-DdvCle-K.js`),[],import.meta.url))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>H(()=>import(`./wolfram-DLL8P-h_.js`),[],import.meta.url))},{id:`xml`,name:`XML`,import:(()=>H(()=>import(`./xml-DzU5oF9g.js`).then(e=>e.n),__vite__mapDeps([7,8]),import.meta.url))},{id:`xsl`,name:`XSL`,import:(()=>H(()=>import(`./xsl-BTxmEaay.js`),__vite__mapDeps([93,7,8]),import.meta.url))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>H(()=>import(`./yaml-DYMpEUsY.js`).then(e=>e.n),[],import.meta.url))},{id:`zenscript`,name:`ZenScript`,import:(()=>H(()=>import(`./zenscript-BnlCZFoB.js`),[],import.meta.url))},{id:`zig`,name:`Zig`,import:(()=>H(()=>import(`./zig-CMLA9XwU.js`),[],import.meta.url))}],Ye=Object.fromEntries(Je.map(e=>[e.id,e.import])),Xe=Object.fromEntries(Je.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Ze={...Ye,...Xe},Qe=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>H(()=>import(`./andromeeda-vGVdxbeo.js`),[],import.meta.url))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>H(()=>import(`./aurora-x-CDeNXAV0.js`),[],import.meta.url))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>H(()=>import(`./ayu-dark-DluEY0Gj.js`),[],import.meta.url))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>H(()=>import(`./ayu-light-C3h-C4tm.js`),[],import.meta.url))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>H(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[],import.meta.url))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>H(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[],import.meta.url))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>H(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[],import.meta.url))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>H(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[],import.meta.url))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>H(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[],import.meta.url))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>H(()=>import(`./dark-plus-Cs2F2srj.js`),[],import.meta.url))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>H(()=>import(`./dracula-BHWKrbxM.js`),[],import.meta.url))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>H(()=>import(`./dracula-soft-5eyTD99u.js`),[],import.meta.url))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>H(()=>import(`./everforest-dark-sB-x3p7T.js`),[],import.meta.url))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>H(()=>import(`./everforest-light-Df2xbC6M.js`),[],import.meta.url))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>H(()=>import(`./github-dark-C-LZuMrd.js`),[],import.meta.url))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>H(()=>import(`./github-dark-default-DXG-b-1a.js`),[],import.meta.url))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>H(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[],import.meta.url))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>H(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[],import.meta.url))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>H(()=>import(`./github-light-EUqPIrTm.js`),[],import.meta.url))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>H(()=>import(`./github-light-default-BXViO-2h.js`),[],import.meta.url))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>H(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[],import.meta.url))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>H(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[],import.meta.url))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>H(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[],import.meta.url))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>H(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[],import.meta.url))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>H(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[],import.meta.url))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>H(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[],import.meta.url))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>H(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[],import.meta.url))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>H(()=>import(`./horizon-CE9ld1lL.js`),[],import.meta.url))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>H(()=>import(`./horizon-bright-DSNQnXHK.js`),[],import.meta.url))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>H(()=>import(`./houston-CsvMBhTu.js`),[],import.meta.url))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>H(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[],import.meta.url))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>H(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[],import.meta.url))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>H(()=>import(`./kanagawa-wave-BML5mF2J.js`),[],import.meta.url))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>H(()=>import(`./laserwave-C_8bwKvT.js`),[],import.meta.url))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>H(()=>import(`./light-plus-DVQuIRkW.js`),[],import.meta.url))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>H(()=>import(`./material-theme-Bm3Qr25_.js`),[],import.meta.url))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>H(()=>import(`./material-theme-darker-2IIEA8gg.js`),[],import.meta.url))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>H(()=>import(`./material-theme-lighter-uhdI0v04.js`),[],import.meta.url))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>H(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[],import.meta.url))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>H(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[],import.meta.url))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>H(()=>import(`./min-dark-BSWPekZh.js`),[],import.meta.url))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>H(()=>import(`./min-light-DDpmG2fV.js`),[],import.meta.url))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>H(()=>import(`./monokai-B_bV9PQ9.js`),[],import.meta.url))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>H(()=>import(`./night-owl-DhmEMT88.js`),[],import.meta.url))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>H(()=>import(`./night-owl-light-eJ-hLW7d.js`),[],import.meta.url))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>H(()=>import(`./nord-Cb4Vim4T.js`),[],import.meta.url))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>H(()=>import(`./one-dark-pro-CLwyXe_n.js`),[],import.meta.url))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>H(()=>import(`./one-light-D7Lr4KcI.js`),[],import.meta.url))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>H(()=>import(`./plastic-DQwYfKfQ.js`),[],import.meta.url))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>H(()=>import(`./poimandres-DRFjx7u4.js`),[],import.meta.url))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>H(()=>import(`./red-DX1BQOs8.js`),[],import.meta.url))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>H(()=>import(`./rose-pine-aMsaMD1D.js`),[],import.meta.url))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>H(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[],import.meta.url))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>H(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[],import.meta.url))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>H(()=>import(`./slack-dark-DnToyrRv.js`),[],import.meta.url))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>H(()=>import(`./slack-ochin-B2OO5cIa.js`),[],import.meta.url))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>H(()=>import(`./snazzy-light-4G7pJPwS.js`),[],import.meta.url))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>H(()=>import(`./solarized-dark-UdsmMDCL.js`),[],import.meta.url))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>H(()=>import(`./solarized-light-C1IUL_tW.js`),[],import.meta.url))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>H(()=>import(`./synthwave-84-nFMaYfgc.js`),[],import.meta.url))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>H(()=>import(`./tokyo-night-oM2G3aXe.js`),[],import.meta.url))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>H(()=>import(`./vesper-DdrHHSXu.js`),[],import.meta.url))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>H(()=>import(`./vitesse-black-fwtXNY1n.js`),[],import.meta.url))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>H(()=>import(`./vitesse-dark-BZCL-v6S.js`),[],import.meta.url))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>H(()=>import(`./vitesse-light-VbXTXTou.js`),[],import.meta.url))}].map(e=>[e.id,e.import])),$e=s({createOnigurumaEngine:()=>Dt,getDefaultWasmLoader:()=>Et,loadWasm:()=>bt,setDefaultWasmLoader:()=>Tt}),et=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function tt(){return 2147483648}function nt(){return typeof performance<`u`?performance.now():Date.now()}var rt=(e,t)=>e+(t-e%t)%t;async function it(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=tt();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,rt(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:nt,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 at=Object.defineProperty,ot=(e,t,n)=>t in e?at(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,st=(e,t,n)=>ot(e,typeof t==`symbol`?t:t+``,n),ct=null;function lt(e){throw new et(e.UTF8ToString(e.getLastOnigError()))}var ut=class e{constructor(t){st(this,`utf16Length`),st(this,`utf8Length`),st(this,`utf16Value`),st(this,`utf8Value`),st(this,`utf16OffsetToUtf8`),st(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)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},dt=class e{constructor(t){if(st(this,`id`,++e.LAST_ID),st(this,`_onigBinding`),st(this,`content`),st(this,`utf16Length`),st(this,`utf8Length`),st(this,`utf16OffsetToUtf8`),st(this,`utf8OffsetToUtf16`),st(this,`ptr`),!ct)throw new et(`Must invoke loadWasm first.`);this._onigBinding=ct,this.content=t;let n=new ut(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=ct.omalloc(1e4),e._sharedPtrInUse=!0,ct.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(ct)}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)}};st(dt,`LAST_ID`,0),st(dt,`_sharedPtr`,0),st(dt,`_sharedPtrInUse`,!1);var ft=dt,pt=class{constructor(e){if(st(this,`_onigBinding`),st(this,`_ptr`),!ct)throw new et(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new ut(e[r]);t[r]=i.createString(ct),n[r]=i.utf8Length}let r=ct.omalloc(4*e.length);ct.HEAPU32.set(t,r/4);let i=ct.omalloc(4*e.length);ct.HEAPU32.set(n,i/4);let a=ct.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)ct.ofree(t[n]);ct.ofree(i),ct.ofree(r),a===0&&lt(ct),this._onigBinding=ct,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 ft(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 mt(e){return typeof e.instantiator==`function`}function ht(e){return typeof e.default==`function`}function gt(e){return e.data!==void 0}function _t(e){return typeof Response<`u`&&e instanceof Response}function vt(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 yt;function bt(e){if(yt)return yt;async function t(){ct=await it(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),mt(n)?n=await n.instantiator(t):ht(n)?n=await n.default(t):(gt(n)&&(n=n.data),_t(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await St(n)(t):await Ct(n)(t):vt(n)||n instanceof WebAssembly.Module?n=await xt(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await xt(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return yt=t(),yt}function xt(e){return t=>WebAssembly.instantiate(e,t)}function St(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Ct(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var wt;function Tt(e){wt=e}function Et(){return wt}async function Dt(e){return e&&await bt(e),{createScanner(e){return new pt(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new ft(e)}}}var Ot=He({});We(Ot,$e);var kt=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function At(e){return jt(e)}function jt(e){return Array.isArray(e)?Mt(e):e instanceof RegExp?e:typeof e==`object`?Nt(e):e}function Mt(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=jt(e[n]);return t}function Nt(e){let t={};for(let n in e)t[n]=jt(e[n]);return t}function Pt(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Ft(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?Ft(e.substring(0,e.length-1)):e.substr(~t+1)}var It=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Lt=class{static hasCaptures(e){return e!==null&&(It.lastIndex=0,It.test(e))}static replaceCaptures(e,t,n){return e.replace(It,(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 Rt(e,t){return e<t?-1:+(e>t)}function zt(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=Rt(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function Bt(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 Vt(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Ht=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}},Ut=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Jt(e),t)}static createFromParsedTheme(e,t){return Zt(e,t)}_cachedMatchRoot=new Ht(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=>Gt(e.parent,t.parentScopes));return n?new qt(n.fontStyle,n.foreground,n.background):null}},Wt=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||this.parent!==null&&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 Gt(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&&!Kt(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Kt(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var qt=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Jt(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}}let s=null;typeof i.settings.foreground==`string`&&Bt(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&Bt(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 Yt(l,u,e,o,s,c)}}return n}var Yt=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}},Xt=(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))(Xt||{});function Zt(e,t){e.sort((e,t)=>{let n=Rt(e.scope,t.scope);return n!==0||(n=zt(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 Qt(t),o=new qt(n,a.getId(r),a.getId(i)),s=new tn(new en(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 Ut(a,o,s)}var Qt=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)}},$t=Object.freeze([]),en=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||$t,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)}},tn=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(),en.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(zt(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 en(e,t,n,r,i))}},nn=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)}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=an(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 rn(e){return e}function an(e){return e}function on(e,t){let n=[],r=cn(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(sn(i)){let e=[];do e.push(i),i=r.next();while(sn(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 sn(e){return!!e&&!!e.match(/[\w\.:]+/)}function cn(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 ln(e){typeof e.dispose==`function`&&e.dispose()}var un=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},dn=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},fn=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))}},pn=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new un(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new fn;for(let n of e)mn(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof un){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 mn(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 un?gn({baseGrammar:a,selfGrammar:i},r):hn(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 un(e))}function hn(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];_n([r],t,n)}}function gn(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&_n(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&_n(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function _n(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?Pt({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&_n(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Cn(i);switch(a.kind){case 0:gn({...t,selfGrammar:t.baseGrammar},n);break;case 1:gn(t,n);break;case 2:hn(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?hn(a.ruleName,i,n):gn(i,n)}else a.kind===4?n.add(new dn(a.scopeName,a.ruleName)):n.add(new un(a.scopeName))}}}var vn=class{kind=0},yn=class{kind=1},bn=class{constructor(e){this.ruleName=e}kind=2},xn=class{constructor(e){this.scopeName=e}kind=3},Sn=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Cn(e){if(e===`$base`)return new vn;if(e===`$self`)return new yn;let t=e.indexOf(`#`);return t===-1?new xn(e):t===0?new bn(e.substring(1)):new Sn(e.substring(0,t),e.substring(t+1))}var wn=/\\(\d+)/,Tn=/\\(\d+)/g,En=-1,Dn=-2;function On(e){return e}function kn(e){return e}var An=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Lt.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Lt.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Ft(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:Lt.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Lt.replaceCaptures(this._contentName,e,t)}},jn=class extends An{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!`)}},Mn=class extends An{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Ln(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 Rn,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Nn=class extends An{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 Rn,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Pn=class extends An{_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 Ln(i,this.id),this.beginCaptures=a,this._end=new Ln(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 Rn;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}},Fn=class extends An{_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 Ln(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Ln(o,Dn),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 Rn;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 Rn,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},In=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new jn(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Mn(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=Pt({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Nn(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Fn(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 Pn(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=Cn(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)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof Nn||e instanceof Pn||e instanceof Fn)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Ln=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._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&wn.test(this.source)}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 Tn.lastIndex=0,this.source.replace(Tn,(e,t)=>Vt(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}},Rn=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 zn(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 zn(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},zn=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(`
3
3
  `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Bn=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Vn=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Bn(e,8),this._embeddedLanguagesMatcher=new Hn(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 Bn(0,0);_getBasicScopeAttributes=new Ht(e=>new Bn(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/},Hn=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])=>Vt(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 Un=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Wn(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Gn(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 Un(i,!0);f()}return new Un(i,!1);function f(){let o=Kn(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===En){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),Zn(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 Pn){let r=o;Zn(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 Fn){let r=o;Zn(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(Zn(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 Gn(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 Fn&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=Xn(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==Dn){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),Zn(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 Kn(e,t,n,r,i,a){let o=qn(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Jn(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 qn(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=Yn(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 Jn(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}=Yn(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 Yn(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Xn(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Zn(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));Wn(e,p,n&&d.start===0,d.start,f,i,!1,0),ln(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 Qn(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var Qn=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function $n(e,t,n,r,i,a,o,s){return new rr(e,t,n,r,i,a,o,s)}function er(e,t,n,r,i){let a=on(t,tr),o=In.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 tr(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(nr(t[r],e))return n=r+1,!0;return!1})}function nr(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 rr=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new Vn(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=ir(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=on(e,tr);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)er(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&&er(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(On(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[kn(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]=ir(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=In.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===or.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=nn.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?ar.createRootAndLookUpScopeName(a,r,this):ar.createRoot(`unknown`,r),t=new or(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
4
4
  `;let a=this.createOnigString(e),o=a.content.length,s=new cr(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Wn(this,a,i,0,t,s,!0,r);return ln(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function ir(e,t){return e=At(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 ar=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=Wt.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new Wt(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new Wt(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}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),nn.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),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}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}},or=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&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?ar.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:kn(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=ar.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,On(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,ar.fromExtension(r,n.contentNameScopesList))}},sr=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):on(e,tr).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>on(e,tr).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}},cr=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=nn.set(n,0,rn(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=nn.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}},lr=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,$n(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},ur=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new lr(Ut.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(Ut.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 sr(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new pn(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)}},dr=or.NULL;function fr(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 pr(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function mr(e){return Array.isArray(e)?e:[e]}async function hr(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function gr(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function _r(e){return e===`ansi`||gr(e)}function vr(e){return e===`none`}function yr(e){return vr(e)}var br=/(\r?\n)/g;function xr(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(br),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 Sr={light:`#333333`,dark:`#bbbbbb`},Cr={light:`#fffffe`,dark:`#1e1e1e`},wr=`__shiki_resolved`;function Tr(e){if(e?.[wr])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`?Sr.light:Sr.dark,n||=t.type===`light`?Cr.light:Cr.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,wr,{enumerable:!1,writable:!1,value:!0}),t}async function Er(e){return[...new Set((await Promise.all(e.filter(e=>!_r(e)).map(async e=>await hr(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function Dr(e){return(await Promise.all(e.map(async e=>yr(e)?null:Tr(await hr(e))))).filter(e=>!!e)}function Or(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 kt(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var kr=class extends ur{_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=Tr(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=Ut.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Or(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 kt(`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))}},Ar=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}},jr=0;function Mr(e){jr+=1,e.warnings!==!1&&jr>=10&&jr%10==0&&console.warn(`[Shiki] ${jr} 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 kt("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(Tr),i=new kr(new Ar(e.engine,n),r,n,e.langAlias),a;function o(t){return Or(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new kt(`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 kt(`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 Er(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await Dr(e))}function g(){if(t)throw new kt(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--jr)}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 Nr(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([Dr(e.themes||[]),Er(e.langs||[]),e.engine]);return Mr({...e,themes:t,langs:n,engine:r})}var Pr=new WeakMap;function Fr(e,t){Pr.set(e,t)}function Ir(e){return Pr.get(e)}var Lr=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(mr(n).map(e=>[e,dr])),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 Rr(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Rr(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 zr(e,t){if(!(e instanceof Lr))throw new kt(`Invalid grammar state`);return e.getInternalStack(t)}var Br=/,/,Vr=/ /;function Hr(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(gr(e.resolveLangAlias(n.lang||`text`))||vr(r))return xr(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 kt(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new kt(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return Wr(t,o,i,a,n)}function Ur(...e){if(e.length===2)return Ir(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(gr(i)||vr(a))throw new kt(`Plain language does not have grammar state`);if(i===`ansi`)throw new kt(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new Lr(Gr(n,c,o,s,r).stateStack,c.name,o.name)}function Wr(e,t,n,r,i){let a=Gr(e,t,n,r,i),o=new Lr(a.stateStack,t.name,n.name);return Fr(a.tokens,o),a.tokens}function Gr(e,t,n,r,i){let a=fr(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=xr(e),u=i.grammarState?zr(i.grammarState,n.name)??dr:i.grammarContextCode==null?dr:Gr(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,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]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=pr(r[nn.getForeground(s)],a),u=nn.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=nn.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(Br).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(Vr))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?Kr(t.scopes):qr(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function Kr(e){return e.map(e=>({scopeName:e}))}function qr(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:Xr(e,i,t.slice(0,r))}}return n}function Jr(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function Yr(e,t,n){if(!Jr(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Jr(e[r],n[i])&&--r,--i;return r===-1}function Xr(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(Yr(e,t,n)){r.push(a);break}return r}function Zr(e,t,n,r=Hr){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:Ir(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=Qr(...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 Lr(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&Fr(s,c),s}function Qr(...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 $r=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],ei=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};ei.prototype.normal={},ei.prototype.property={},ei.prototype.space=void 0;function ti(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ei(n,r,t)}function ni(e){return e.toLowerCase()}var ri=class{constructor(e,t){this.attribute=t,this.property=e}};ri.prototype.attribute=``,ri.prototype.booleanish=!1,ri.prototype.boolean=!1,ri.prototype.commaOrSpaceSeparated=!1,ri.prototype.commaSeparated=!1,ri.prototype.defined=!1,ri.prototype.mustUseProperty=!1,ri.prototype.number=!1,ri.prototype.overloadedBoolean=!1,ri.prototype.property=``,ri.prototype.spaceSeparated=!1,ri.prototype.space=void 0;var ii=s({boolean:()=>oi,booleanish:()=>si,commaOrSpaceSeparated:()=>di,commaSeparated:()=>ui,number:()=>U,overloadedBoolean:()=>ci,spaceSeparated:()=>li}),ai=0,oi=fi(),si=fi(),ci=fi(),U=fi(),li=fi(),ui=fi(),di=fi();function fi(){return 2**++ai}var pi=Object.keys(ii),mi=class extends ri{constructor(e,t,n,r){let i=-1;if(super(e,t),hi(this,`space`,r),typeof n==`number`)for(;++i<pi.length;){let e=pi[i];hi(this,pi[i],(n&ii[e])===ii[e])}}};mi.prototype.defined=!0;function hi(e,t,n){n&&(e[t]=n)}function gi(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new mi(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[ni(r)]=r,n[ni(a.attribute)]=r}return new ei(t,n,e.space)}var _i=gi({properties:{ariaActiveDescendant:null,ariaAtomic:si,ariaAutoComplete:null,ariaBusy:si,ariaChecked:si,ariaColCount:U,ariaColIndex:U,ariaColSpan:U,ariaControls:li,ariaCurrent:null,ariaDescribedBy:li,ariaDetails:null,ariaDisabled:si,ariaDropEffect:li,ariaErrorMessage:null,ariaExpanded:si,ariaFlowTo:li,ariaGrabbed:si,ariaHasPopup:null,ariaHidden:si,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:li,ariaLevel:U,ariaLive:null,ariaModal:si,ariaMultiLine:si,ariaMultiSelectable:si,ariaOrientation:null,ariaOwns:li,ariaPlaceholder:null,ariaPosInSet:U,ariaPressed:si,ariaReadOnly:si,ariaRelevant:null,ariaRequired:si,ariaRoleDescription:li,ariaRowCount:U,ariaRowIndex:U,ariaRowSpan:U,ariaSelected:si,ariaSetSize:U,ariaSort:null,ariaValueMax:U,ariaValueMin:U,ariaValueNow:U,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function vi(e,t){return t in e?e[t]:t}function yi(e,t){return vi(e,t.toLowerCase())}var bi=gi({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:ui,acceptCharset:li,accessKey:li,action:null,allow:null,allowFullScreen:oi,allowPaymentRequest:oi,allowUserMedia:oi,alpha:oi,alt:null,as:null,async:oi,autoCapitalize:null,autoComplete:li,autoFocus:oi,autoPlay:oi,blocking:li,capture:null,charSet:null,checked:oi,cite:null,className:li,closedBy:null,colorSpace:null,cols:U,colSpan:U,command:null,commandFor:null,content:null,contentEditable:si,controls:oi,controlsList:li,coords:U|ui,crossOrigin:null,data:null,dateTime:null,decoding:null,default:oi,defer:oi,dir:null,dirName:null,disabled:oi,download:ci,draggable:si,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:oi,formTarget:null,headers:li,height:U,hidden:ci,high:U,href:null,hrefLang:null,htmlFor:li,httpEquiv:li,id:null,imageSizes:null,imageSrcSet:null,inert:oi,inputMode:null,integrity:null,is:null,isMap:oi,itemId:null,itemProp:li,itemRef:li,itemScope:oi,itemType:li,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:oi,low:U,manifest:null,max:null,maxLength:U,media:null,method:null,min:null,minLength:U,multiple:oi,muted:oi,name:null,nonce:null,noModule:oi,noValidate:oi,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:oi,optimum:U,pattern:null,ping:li,placeholder:null,playsInline:oi,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:oi,referrerPolicy:null,rel:li,required:oi,reversed:oi,rows:U,rowSpan:U,sandbox:li,scope:null,scoped:oi,seamless:oi,selected:oi,shadowRootClonable:oi,shadowRootCustomElementRegistry:oi,shadowRootDelegatesFocus:oi,shadowRootMode:null,shadowRootSerializable:oi,shape:null,size:U,sizes:null,slot:null,span:U,spellCheck:si,src:null,srcDoc:null,srcLang:null,srcSet:null,start:U,step:null,style:null,tabIndex:U,target:null,title:null,translate:null,type:null,typeMustMatch:oi,useMap:null,value:si,width:U,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:li,axis:null,background:null,bgColor:null,border:U,borderColor:null,bottomMargin:U,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:oi,declare:oi,event:null,face:null,frame:null,frameBorder:null,hSpace:U,leftMargin:U,link:null,longDesc:null,lowSrc:null,marginHeight:U,marginWidth:U,noResize:oi,noHref:oi,noShade:oi,noWrap:oi,object:null,profile:null,prompt:null,rev:null,rightMargin:U,rules:null,scheme:null,scrolling:si,standby:null,summary:null,text:null,topMargin:U,valueType:null,version:null,vAlign:null,vLink:null,vSpace:U,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:oi,disablePictureInPicture:oi,disableRemotePlayback:oi,exportParts:ui,part:li,prefix:null,property:null,results:U,security:null,unselectable:null},space:`html`,transform:yi}),xi=gi({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:di,accentHeight:U,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:U,amplitude:U,arabicForm:null,ascent:U,attributeName:null,attributeType:null,azimuth:U,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:U,by:null,calcMode:null,capHeight:U,className:li,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:U,diffuseConstant:U,direction:null,display:null,dur:null,divisor:U,dominantBaseline:null,download:oi,dx:null,dy:null,edgeMode:null,editable:null,elevation:U,enableBackground:null,end:null,event:null,exponent:U,externalResourcesRequired:null,fill:null,fillOpacity:U,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:ui,g2:ui,glyphName:ui,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:U,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:U,horizOriginX:U,horizOriginY:U,id:null,ideographic:U,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:U,k:U,k1:U,k2:U,k3:U,k4:U,kernelMatrix:di,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:U,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:U,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:U,overlineThickness:U,paintOrder:null,panose1:null,path:null,pathLength:U,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:li,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:U,pointsAtY:U,pointsAtZ:U,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:di,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:di,rev:di,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:di,requiredFeatures:di,requiredFonts:di,requiredFormats:di,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:U,specularExponent:U,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:U,strikethroughThickness:U,string:null,stroke:null,strokeDashArray:di,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:U,strokeOpacity:U,strokeWidth:null,style:null,surfaceScale:U,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:di,tabIndex:U,tableValues:null,target:null,targetX:U,targetY:U,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:di,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:U,underlineThickness:U,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:U,values:null,vAlphabetic:U,vMathematical:U,vectorEffect:null,vHanging:U,vIdeographic:U,version:null,vertAdvY:U,vertOriginX:U,vertOriginY:U,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:U,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:vi}),Si=gi({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()}}),Ci=gi({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:yi}),wi=gi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Ti={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Ei=/[A-Z]/g,Di=/-[a-z]/g,Oi=/^data[-\w.:]+$/i;function ki(e,t){let n=ni(t),r=t,i=ri;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Oi.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Di,ji);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Di.test(e)){let n=e.replace(Ei,Ai);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=mi}return new i(r,t)}function Ai(e){return`-`+e.toLowerCase()}function ji(e){return e.charAt(1).toUpperCase()}var Mi=ti([_i,bi,Si,Ci,wi],`html`),Ni=ti([_i,xi,Si,Ci,wi],`svg`),Pi={}.hasOwnProperty;function Fi(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&Pi.call(t,e)){let n=String(t[e]);i=Pi.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 Ii=/["&'<>`]/g,Li=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ri=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,zi=/[|\\{}()[\]^$+*?.]/g,Bi=new WeakMap;function Vi(e,t){if(e=e.replace(t.subset?Hi(t.subset):Ii,r),t.subset||t.escapeOnly)return e;return e.replace(Li,n).replace(Ri,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 Hi(e){let t=Bi.get(e);return t||(t=Ui(e),Bi.set(e,t)),t}function Ui(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(zi,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var Wi=/[\dA-Fa-f]/;function Gi(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!Wi.test(String.fromCharCode(t))?r:r+`;`}var Ki=/\d/;function qi(e,t,n){let r=`&#`+String(e);return n&&t&&!Ki.test(String.fromCharCode(t))?r:r+`;`}var Ji=`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(`.`),Yi={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:`€`},Xi=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],Zi={}.hasOwnProperty,Qi={},$i;for($i in Yi)Zi.call(Yi,$i)&&(Qi[Yi[$i]]=$i);var ea=/[^\dA-Za-z]/;function ta(e,t,n,r){let i=String.fromCharCode(e);if(Zi.call(Qi,i)){let e=Qi[i],a=`&`+e;return n&&Ji.includes(e)&&!Xi.includes(e)&&(!r||t&&t!==61&&ea.test(String.fromCharCode(t)))?a:a+`;`}return``}function na(e,t,n){let r=Gi(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=ta(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=qi(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function ra(e,t){return Vi(e,Object.assign({format:na},t))}var ia=/^>|^->|<!--|-->|--!>|<!-$/g,aa=[`>`],oa=[`<`,`>`];function sa(e,t,n,r){return r.settings.bogusComments?`<?`+ra(e.value,Object.assign({},r.settings.characterReferences,{subset:aa}))+`>`:`<!--`+e.value.replace(ia,i)+`-->`;function i(e){return ra(e,Object.assign({},r.settings.characterReferences,{subset:oa}))}}function ca(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function la(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 ua(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function da(e){return e.join(` `).trim()}var fa=/[ \t\n\f\r]/g;function pa(e){return typeof e==`object`?e.type===`text`&&ma(e.value):ma(e)}function ma(e){return e.replace(fa,``)===``}var ha=va(1),ga=va(-1),_a=[];function va(e){return t;function t(t,n,r){let i=t?t.children:_a,a=(n||0)+e,o=i[a];if(!r)for(;o&&pa(o);)a+=e,o=i[a];return o}}var ya={}.hasOwnProperty;function ba(e){return t;function t(t,n,r){return ya.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var xa=ba({body:wa,caption:Sa,colgroup:Sa,dd:Oa,dt:Da,head:Sa,html:Ca,li:Ea,optgroup:Aa,option:ja,p:Ta,rp:ka,rt:ka,tbody:Na,td:Ia,tfoot:Pa,th:Ia,thead:Ma,tr:Fa});function Sa(e,t,n){let r=ha(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&pa(r.value.charAt(0)))}function Ca(e,t,n){let r=ha(n,t);return!r||r.type!==`comment`}function wa(e,t,n){let r=ha(n,t);return!r||r.type!==`comment`}function Ta(e,t,n){let r=ha(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 Ea(e,t,n){let r=ha(n,t);return!r||r.type===`element`&&r.tagName===`li`}function Da(e,t,n){let r=ha(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function Oa(e,t,n){let r=ha(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function ka(e,t,n){let r=ha(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function Aa(e,t,n){let r=ha(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function ja(e,t,n){let r=ha(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Ma(e,t,n){let r=ha(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function Na(e,t,n){let r=ha(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function Pa(e,t,n){return!ha(n,t)}function Fa(e,t,n){let r=ha(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function Ia(e,t,n){let r=ha(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var La=ba({body:Ba,colgroup:Va,head:za,html:Ra,tbody:Ha});function Ra(e){let t=ha(e,-1);return!t||t.type!==`comment`}function za(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 Ba(e){let t=ha(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&pa(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function Va(e,t,n){let r=ga(n,t),i=ha(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&xa(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Ha(e,t,n){let r=ga(n,t),i=ha(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&xa(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var Ua={name:[[`
5
5
  \f\r &/=>`.split(``),`
@@ -1591,45 +1591,46 @@ Error generating stack: `+e.message+`
1591
1591
 
1592
1592
  `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=hb,c=!dx.jitless,l=c&&gb.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?VC([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function WC(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Fb(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Bb(e,r,fx())))}),t)}var GC=G(`$ZodUnion`,(e,t)=>{HS.init(e,t),tx(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),tx(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),tx(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),tx(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>nb(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>WC(t,r,e,i)):WC(o,r,e,i)}});function KC(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var qC=G(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,GC.init(e,t);let n=e._zod.parse;tx(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||ib(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=ab(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=eb(()=>KC(t));e._zod.parse=(i,a)=>{let o=i.value;if(!hb(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),JC=G(`$ZodIntersection`,(e,t)=>{HS.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>XC(e,t,n)):XC(e,i,a)}});function YC(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(_b(e)&&_b(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=YC(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=YC(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function XC(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=YC(t.value,n.value);if(!c.valid){if(Fb(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var ZC=G(`$ZodRecord`,(e,t)=>{HS.init(e,t);let n=dx.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!_b(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>Bb(e,i,fx())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...Lb(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Lb(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&_S.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>Bb(e,i,fx())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...Lb(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Lb(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),QC=G(`$ZodEnum`,(e,t)=>{HS.init(e,t);let n=Xy(t.entries),r=new Set(n);e._zod.values=r,tx(e,`pattern`,e=>{let t=Xy(e.def.entries).filter(e=>yb.has(typeof e));return RegExp(t.length?`^(${t.map(e=>bb(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),$C=G(`$ZodLiteral`,(e,t)=>{HS.init(e,t);let n=new Set(t.values);e._zod.values=n,tx(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?bb(e):e?bb(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),ew=G(`$ZodTransform`,(e,t)=>{HS.init(e,t),e._zod.optin=`optional`,dx.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ux(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new lx;return n.value=i,n}});function tw(e,t){return e.value=t.issues.length?void 0:t.value,e}var nw=G(`$ZodOptional`,(e,t)=>{HS.init(e,t),tx(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,tx(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),tx(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${nb(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>tw(e,t)):tw(e,r)}return t.innerType._zod.run(e,n)}}),rw=G(`$ZodExactOptional`,(e,t)=>{nw.init(e,t),tx(e,`values`,e=>e.def.innerType._zod.values),tx(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),iw=G(`$ZodNullable`,(e,t)=>{HS.init(e,t),tx(e,`optin`,e=>e.def.innerType._zod.optin),tx(e,`optout`,e=>e.def.innerType._zod.optout),tx(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${nb(t.source)}|null)$`):void 0}),tx(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),aw=G(`$ZodDefault`,(e,t)=>{HS.init(e,t),e._zod.optin=`defaulted`,tx(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>ow(e,t)):ow(r,t)}});function ow(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var sw=G(`$ZodPrefault`,(e,t)=>{HS.init(e,t),e._zod.optin=`defaulted`,tx(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),cw=G(`$ZodNonOptional`,(e,t)=>{HS.init(e,t),tx(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>lw(t,e)):lw(i,e)}});function lw(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function uw(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Bb(e,r,fx()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var dw=G(`$ZodCatch`,(e,t)=>{HS.init(e,t),tx(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),tx(e,`optout`,e=>e.def.innerType._zod.optout),tx(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>uw(e,r,t,n)):uw(e,r,t,n)}}),fw=G(`$ZodPipe`,(e,t)=>{HS.init(e,t),tx(e,`values`,e=>e.def.in._zod.values),tx(e,`optin`,e=>e.def.in._zod.optin),tx(e,`optout`,e=>e.def.out._zod.optout),tx(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>pw(e,t.in,n)):pw(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>pw(e,t.out,n)):pw(r,t.out,n)}});function pw(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var mw=G(`$ZodReadonly`,(e,t)=>{HS.init(e,t),tx(e,`propValues`,e=>e.def.innerType._zod.propValues),tx(e,`values`,e=>e.def.innerType._zod.values),tx(e,`optin`,e=>e.def.innerType?._zod?.optin),tx(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(hw):hw(r)}});function hw(e){return e.memo||(e.value=Object.freeze(e.value)),e}var gw=G(`$ZodCustom`,(e,t)=>{SS.init(e,t),HS.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>_w(t,n,r,e));_w(i,n,r,e)}});function _w(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Gb(e))}}var vw=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},yw=`~memo`,bw=[];function xw(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function Sw(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Cw=new WeakMap,ww=0,Tw=1,Ew=2;function Dw(e,t,n){let r=Cw.get(e);if(r!==void 0)return r?Ew:ww;if(t.has(e))return Ew;t.add(e);let i=ww,a=e=>{if(i!==Ew&&e?._zod){let r=Dw(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=ww;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?Tw:o.value?._zod?Dw(o.value,t,n):ww;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=ab(c);s(e?o(e,!0):Tw),a(c.catchall);break}case`properties`:s(o(c.shape,!1));break;case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Dw(r,t,!1):Tw);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(!(!n||typeof n!=`object`)){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Ow(e,i)}function Ow(e,t){return t!==Tw&&Cw.set(e,t===Ew),t}function kw(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Aw,jw=[],Mw={alloc(e,t,n){let r=Aw;if(!r)return n;Aw=void 0;let i={value:n,issues:null};return r.set(t.value,i),jw.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Pw(n,e.value))throw new vw;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Dw(e,new Set,!1);if(i===ww)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Ew||r?n=!0:r=!0}let l=s.value;if(!xw(l))return t(s,c);let u=c[yw];u||(u={buckets:new WeakMap,backEdges:void 0},c[yw]=u);let d;i===c?d=a:(d=kw(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...Sw(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;Aw=d;let p=jw.length,m=t(s,c);Aw=void 0;let h=jw.length>p?jw.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Sw(e.issues):bw),e)):(h&&(h.issues=m.issues.length?Sw(m.issues):bw),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Nw(){return Mw}function Pw(e,t){let n=e[yw]?.backEdges;return n!==void 0&&xw(t)&&n.has(t)}var Fw=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Wb(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Sb(e.values[0])}`:`Invalid option: expected one of ${Zy(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${Zy(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Iw(){return{localeError:Fw()}}var Lw,Rw=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function zw(){return new Rw}(Lw=globalThis).__zod_globalRegistry??(Lw.__zod_globalRegistry=zw());var Bw=globalThis.__zod_globalRegistry;function Vw(e,t){return new e({type:`string`,...W(t)})}function Hw(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...W(t)})}function Uw(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...W(t)})}function Ww(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...W(t)})}function Gw(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...W(t)})}function Kw(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...W(t)})}function qw(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...W(t)})}function Jw(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...W(t)})}function Yw(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...W(t)})}function Xw(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...W(t)})}function Zw(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...W(t)})}function Qw(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...W(t)})}function $w(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...W(t)})}function eT(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...W(t)})}function tT(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...W(t)})}function nT(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...W(t)})}function rT(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...W(t)})}function iT(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...W(t)})}function aT(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...W(t)})}function oT(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...W(t)})}function sT(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...W(t)})}function cT(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...W(t)})}function lT(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...W(t)})}function uT(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...W(t)})}function dT(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...W(t)})}function fT(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...W(t)})}function pT(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...W(t)})}function mT(e,t){return new e({type:`number`,checks:[],...W(t)})}function hT(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...W(t)})}function gT(e,t){return new e({type:`boolean`,...W(t)})}function _T(e,t){return new e({type:`undefined`,...W(t)})}function vT(e){return new e({type:`unknown`})}function yT(e,t){return new e({type:`never`,...W(t)})}function bT(e,t){return new TS({check:`less_than`,...W(t),value:e,inclusive:!1})}function xT(e,t){return new TS({check:`less_than`,...W(t),value:e,inclusive:!0})}function ST(e,t){return new ES({check:`greater_than`,...W(t),value:e,inclusive:!1})}function CT(e,t){return new ES({check:`greater_than`,...W(t),value:e,inclusive:!0})}function wT(e,t){return new DS({check:`multiple_of`,...W(t),value:e})}function TT(e,t){return new kS({check:`max_length`,...W(t),maximum:e})}function ET(e,t){return new AS({check:`min_length`,...W(t),minimum:e})}function DT(e,t){return new jS({check:`length_equals`,...W(t),length:e})}function OT(e,t){return new NS({check:`string_format`,format:`regex`,...W(t),pattern:e})}function kT(e){return new PS({check:`string_format`,format:`lowercase`,...W(e)})}function AT(e){return new FS({check:`string_format`,format:`uppercase`,...W(e)})}function jT(e,t){return new IS({check:`string_format`,format:`includes`,...W(t),includes:e})}function MT(e,t){return new LS({check:`string_format`,format:`starts_with`,...W(t),prefix:e})}function NT(e,t){return new RS({check:`string_format`,format:`ends_with`,...W(t),suffix:e})}function PT(e){return new zS({check:`overwrite`,tx:e})}function FT(e){return PT(t=>t.normalize(e))}function IT(){return PT(e=>e.trim())}function LT(){return PT(e=>e.toLowerCase())}function RT(){return PT(e=>e.toUpperCase())}function zT(){return PT(e=>pb(e))}function BT(e,t,n){return new e({type:`array`,element:t,...W(n)})}function VT(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...W(n)})}function HT(e,t){let n=UT(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Gb(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Gb(r))}},e(t.value,t)),t);return n}function UT(e,t){let n=new SS({check:`custom`,...W(t)});return n._zod.check=e,n}function WT(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&ib(e,t,n[t]);return e}function GT(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Bw,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function KT(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function qT(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,qT(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&WT(o.schema,c),t.io===`input`&&rE(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function JT(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function YT(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${JT(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+JT(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
1593
1593
 
1594
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function XT(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;XT(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var ZT=new Set([`type`,`properties`,`required`,`additionalProperties`]),QT=[`oneOf`,`anyOf`];function $T(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function eE(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!ZT.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??$T(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}ib(n,r,e.length===1?e[0]:eE(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=$T(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function tE(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of ZT)if(t in e)return;let n=t.filter(e=>QT.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=eE(t);else{let e=n[0],i=QT.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>eE([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,WT(e,r))}function nE(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):WT(i,s),WT(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())XT(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])tE(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}WT(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,ib(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:aE(t,`input`,e.processors),output:aE(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function rE(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return rE(r.element,n);if(r.type===`set`)return rE(r.valueType,n);if(r.type===`lazy`)return rE(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return rE(r.innerType,n);if(r.type===`intersection`)return rE(r.left,n)||rE(r.right,n);if(r.type===`record`||r.type===`map`)return rE(r.keyType,n)||rE(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:rE(r.in,n)||rE(r.out,n);if(r.type===`object`){for(let e in r.shape)if(rE(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(rE(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(rE(e,n))return!0;return!!(r.rest&&rE(r.rest,n))}return!1}var iE=(e,t={})=>n=>{let r=GT({...n,processors:t});return qT(e,r),YT(r,e),nE(r,e)},aE=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=GT({...i??{},target:a,io:t,processors:n});return qT(e,o),YT(o,e),nE(o,e)},oE=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},sE=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},cE=(e,t)=>{oE(e,`minimum`,t),sE(e,`maximum`,t)},lE=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},uE=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},dE=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},fE=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},pE=(e,t)=>oE(e,`minimum`,t.minimum),mE=(e,t)=>sE(e,`maximum`,t.maximum),hE=e=>(t,n)=>{fE(t,n.format);let[r,i]=e[n.format];oE(t,`minimum`,r),sE(t,`maximum`,i)},gE={greater_than:(e,t)=>oE(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>sE(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>lE(e,t.value),number_format:hE(wb),bigint_format:hE(Tb),min_length:pE,max_length:mE,length_equals:(e,t)=>cE(e,t.length),min_size:pE,max_size:mE,size_equals:(e,t)=>cE(e,t.size),string_format:(e,t)=>{fE(e,t.format),t.pattern&&uE(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>dE(e,t.mime)};function _E(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)gE[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&oE(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&oE(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&sE(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&sE(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&lE(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&dE(t,i.mime);for(let e of i.patterns??[])uE(t,e);return t}var vE={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},yE=new Map([[SC,aS],[wC,oS]]),bE=e=>yE.get(e)??e,xE=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=_E(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=vE[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(bE);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},SE=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=_E(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):KT(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},CE=(e,t,n,r)=>{n.type=`boolean`},wE=(e,t,n,r)=>{KT(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},TE=(e,t,n,r)=>{n.not={}},EE=(e,t,n,r)=>{let i=e._zod.def,a=Xy(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},DE=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(KT(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(KT(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},OE=(e,t,n,r)=>{KT(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},kE=(e,t,n,r)=>{KT(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},AE=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=_E(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=qT(a.element,t,{...r,path:[...r.path,`items`]})};function jE(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?jE(t.out):t.type===`catch`?jE(t.innerType):e._zod.optin}var ME=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&KT(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)ib(i.properties,e,qT(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e];return t.io===`input`?jE(n)===void 0:n._zod.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=qT(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},NE=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>qT(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},PE=(e,t,n,r)=>{let i=e._zod.def,a=qT(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=qT(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function FE(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=FE(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>FE(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?_S:gS).source),p):p}var IE=new WeakMap;function LE(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of IE.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=FE(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var RE=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=_E(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=qT(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)ib(i.patternProperties,bE(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=qT(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=IE.get(t);n||(n=[],IE.set(t,n),t.deferred.push(()=>LE(t))),n.push(e)}i.additionalProperties=qT(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&jE(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},zE=(e,t,n,r)=>{let i=e._zod.def,a=qT(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},BE=(e,t,n,r)=>{let i=e._zod.def;qT(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},VE=Symbol();function HE(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(KT(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),VE):JSON.parse(o)}var UE=(e,t,n,r)=>{let i=e._zod.def;qT(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=HE(i.defaultValue,e,t,n,r);o!==VE&&(n.default=o)},WE=(e,t,n,r)=>{let i=e._zod.def;qT(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=HE(i.defaultValue,e,t,n,r);o!==VE&&(n._prefault=o)},GE=(e,t,n,r)=>{let i=e._zod.def;qT(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{KT(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},KE=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;qT(o,t,r);let s=t.seen.get(e);s.ref=o},qE=(e,t,n,r)=>{let i=e._zod.def;qT(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},JE=(e,t,n,r)=>{let i=e._zod.def;qT(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},YE=new WeakSet([Object.prototype,Error.prototype]);function XE(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var ZE=G(`ZodError`,(e,t)=>{yx.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);YE.has(n)||(YE.add(n),XE(n,`format`,e=>t=>Sx(e,t)),XE(n,`flatten`,e=>t=>xx(e,t)),XE(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Qy,2)}),XE(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Qy,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),QE=wx(ZE),$E=Tx(ZE),eD=Ex(ZE),tD=Ox(ZE),nD=Px(ZE),rD=Fx(ZE),iD=Ix(ZE),aD=Lx(ZE),oD=Rx(ZE),sD=zx(ZE),cD=Bx(ZE),lD=Vx(ZE);function uD(){dx.localeError||fx(Iw())}function dD(){dx.memoizer||fx({memoizer:Nw()})}var fD=G(`ZodType`,(e,t)=>(uD(),HS.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(db(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return xb(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(PO(e,t))},superRefine(e,t){return this.check(FO(e,t))},overwrite(e){return this.check(PT(e))},optional(){return gO(this)},exactOptional(){return vO(this)},nullable(){return bO(this)},nullish(){return gO(bO(this))},nonoptional(e){return EO(this,e)},array(){return QD(this)},or(e){return nO([this,e])},and(e){return oO(this,e)},transform(e){return AO(this,mO(e))},default(e){return SO(this,e)},prefault(e){return wO(this,e)},catch(e){return OO(this,e)},pipe(e){return AO(this,e)},readonly(){return MO(this)},describe(e){let t=this.clone();return Bw.add(t,{description:e}),t},meta(...e){if(e.length===0)return Bw.get(this);let t=this.clone();return Bw.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Jb(this,`~standard`,{...GS(this),jsonSchema:{input:aE(this,`input`),output:aE(this,`output`)}})},set"~standard"(e){qb(this,`~standard`,e)},parse:function e(t,n){return QE(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await $E(this,t,n,{callee:e})},safeParse(e,t){return eD(this,e,t)},async safeParseAsync(e,t){return tD(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){qb(this,`spa`,e)},validate(e,t){return jx(this,e,t)},validateAsync(e,t){return Nx(this,e,t)},encode:function e(t,n){return nD(this,t,n,{callee:e})},decode:function e(t,n){return rD(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await iD(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await aD(this,t,n,{callee:e})},safeEncode(e,t){return oD(this,e,t)},safeDecode(e,t){return sD(this,e,t)},async safeEncodeAsync(e,t){return cD(this,e,t)},async safeDecodeAsync(e,t){return lD(this,e,t)},toJSONSchema(e){return iE(this,{})(e)},get description(){return Bw.get(this)?.description},get _def(){return this._zod.def}}),pD=G(`_ZodString`,(e,t)=>{KS.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xE(e,t,n,r)},Yb({format:e=>_E(e).format??null,minLength:e=>_E(e).minimum??null,maxLength:e=>_E(e).maximum??null},{regex(...e){return this.check(OT(...e))},includes(...e){return this.check(jT(...e))},startsWith(...e){return this.check(MT(...e))},endsWith(...e){return this.check(NT(...e))},min(...e){return this.check(ET(...e))},max(...e){return this.check(TT(...e))},length(...e){return this.check(DT(...e))},nonempty(...e){return this.check(ET(1,...e))},lowercase(e){return this.check(kT(e))},uppercase(e){return this.check(AT(e))},trim(){return this.check(IT())},normalize(...e){return this.check(FT(...e))},toLowerCase(){return this.check(LT())},toUpperCase(){return this.check(RT())},slugify(){return this.check(zT())}})),mD=G(`ZodString`,(e,t)=>{KS.init(e,t),pD.init(e,t)},{email(e){return this.check(Hw(bD,e))},url(e){return this.check(Jw(CD,e))},jwt(e){return this.check(lT(RD,e))},emoji(e){return this.check(Yw(wD,e))},guid(e){return this.check(Uw(xD,e))},uuid(e){return this.check(Ww(SD,e))},uuidv4(e){return this.check(Gw(SD,e))},uuidv6(e){return this.check(Kw(SD,e))},uuidv7(e){return this.check(qw(SD,e))},nanoid(e){return this.check(Xw(TD,e))},cuid(e){return this.check(Zw(ED,e))},cuid2(e){return this.check(Qw(DD,e))},ulid(e){return this.check($w(OD,e))},base64(e){return this.check(oT(FD,e))},base64url(e){return this.check(sT(ID,e))},xid(e){return this.check(eT(kD,e))},ksuid(e){return this.check(tT(AD,e))},ipv4(e){return this.check(nT(jD,e))},ipv6(e){return this.check(rT(MD,e))},cidrv4(e){return this.check(iT(ND,e))},cidrv6(e){return this.check(aT(PD,e))},e164(e){return this.check(cT(LD,e))},datetime(e){return this.check(uT(gD,e))},date(e){return this.check(dT(_D,e))},time(e){return this.check(fT(vD,e))},duration(e){return this.check(pT(yD,e))}});function K(e){return Vw(mD,e)}var hD=G(`ZodStringFormat`,(e,t)=>{qS.init(e,t),pD.init(e,t)}),gD=G(`ZodISODateTime`,(e,t)=>{uC.init(e,t),hD.init(e,t)}),_D=G(`ZodISODate`,(e,t)=>{dC.init(e,t),hD.init(e,t)}),vD=G(`ZodISOTime`,(e,t)=>{fC.init(e,t),hD.init(e,t)}),yD=G(`ZodISODuration`,(e,t)=>{pC.init(e,t),hD.init(e,t)}),bD=G(`ZodEmail`,(e,t)=>{XS.init(e,t),hD.init(e,t)}),xD=G(`ZodGUID`,(e,t)=>{JS.init(e,t),hD.init(e,t)}),SD=G(`ZodUUID`,(e,t)=>{YS.init(e,t),hD.init(e,t)}),CD=G(`ZodURL`,(e,t)=>{nC.init(e,t),hD.init(e,t)}),wD=G(`ZodEmoji`,(e,t)=>{rC.init(e,t),hD.init(e,t)}),TD=G(`ZodNanoID`,(e,t)=>{iC.init(e,t),hD.init(e,t)}),ED=G(`ZodCUID`,(e,t)=>{aC.init(e,t),hD.init(e,t)}),DD=G(`ZodCUID2`,(e,t)=>{oC.init(e,t),hD.init(e,t)}),OD=G(`ZodULID`,(e,t)=>{sC.init(e,t),hD.init(e,t)}),kD=G(`ZodXID`,(e,t)=>{cC.init(e,t),hD.init(e,t)}),AD=G(`ZodKSUID`,(e,t)=>{lC.init(e,t),hD.init(e,t)}),jD=G(`ZodIPv4`,(e,t)=>{mC.init(e,t),hD.init(e,t)}),MD=G(`ZodIPv6`,(e,t)=>{_C.init(e,t),hD.init(e,t)}),ND=G(`ZodCIDRv4`,(e,t)=>{vC.init(e,t),hD.init(e,t)}),PD=G(`ZodCIDRv6`,(e,t)=>{bC.init(e,t),hD.init(e,t)}),FD=G(`ZodBase64`,(e,t)=>{CC.init(e,t),hD.init(e,t)}),ID=G(`ZodBase64URL`,(e,t)=>{EC.init(e,t),hD.init(e,t)}),LD=G(`ZodE164`,(e,t)=>{DC.init(e,t),hD.init(e,t)}),RD=G(`ZodJWT`,(e,t)=>{kC.init(e,t),hD.init(e,t)}),zD=G(`ZodNumber`,(e,t)=>{AC.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>SE(e,t,n,r),e.isFinite=!0},Yb({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=_E(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=_E(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=_E(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>_E(e).format??null},{gt(e,t){return this.check(ST(e,t))},gte(e,t){return this.check(CT(e,t))},min(e,t){return this.check(CT(e,t))},lt(e,t){return this.check(bT(e,t))},lte(e,t){return this.check(xT(e,t))},max(e,t){return this.check(xT(e,t))},int(e){return this.check(HD(e))},safe(e){return this.check(HD(e))},positive(e){return this.check(ST(0,e))},nonnegative(e){return this.check(CT(0,e))},negative(e){return this.check(bT(0,e))},nonpositive(e){return this.check(xT(0,e))},multipleOf(e,t){return this.check(wT(e,t))},step(e,t){return this.check(wT(e,t))},finite(){return this}}));function BD(e){return mT(zD,e)}var VD=G(`ZodNumberFormat`,(e,t)=>{jC.init(e,t),zD.init(e,t)});function HD(e){return hT(VD,e)}var UD=G(`ZodBoolean`,(e,t)=>{MC.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>CE(e,t,n,r)});function WD(e){return gT(UD,e)}var GD=G(`ZodUndefined`,(e,t)=>{NC.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wE(e,t,n,r)});function KD(e){return _T(GD,e)}var qD=G(`ZodUnknown`,(e,t)=>{PC.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function JD(){return vT(qD)}var YD=G(`ZodNever`,(e,t)=>{FC.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>TE(e,t,n,r)});function XD(e){return yT(YD,e)}var ZD=G(`ZodArray`,(e,t)=>{dD(),LC.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>AE(e,t,n,r),e.element=t.element},{min(e,t){return this.check(ET(e,t))},nonempty(e){return this.check(ET(1,e))},max(e,t){return this.check(TT(e,t))},length(e,t){return this.check(DT(e,t))},unwrap(){return this.element}});function QD(e,t){return BT(ZD,e,t)}var $D=G(`ZodObject`,(e,t)=>{dD(),UC.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ME(e,t,n,r),nx(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return uO(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(db(this._zod.def,{catchall:e}))},passthrough(){return this.clone(db(this._zod.def,{catchall:JD()}))},loose(){return this.clone(db(this._zod.def,{catchall:JD()}))},strict(){return this.clone(db(this._zod.def,{catchall:XD()}))},strip(){return this.clone(db(this._zod.def,{catchall:void 0}))},extend(e){return kb(this,e)},safeExtend(e){return jb(this,e)},merge(e){return Mb(this,e)},pick(e){return Eb(this,e)},omit(e){return Ob(this,e)},partial(...e){return Nb(hO,this,e[0])},exactPartial(...e){return Nb(_O,this,e[0],`exactPartial`)},required(...e){return Pb(TO,this,e[0])}});function eO(e,t){return new $D({type:`object`,shape:e??{},...W(t)})}var tO=G(`ZodUnion`,(e,t)=>{GC.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>NE(e,t,n,r),e.options=t.options});function nO(e,t){return new tO({type:`union`,options:e,...W(t)})}var rO=G(`ZodDiscriminatedUnion`,(e,t)=>{tO.init(e,t),qC.init(e,t)});function iO(e,t,n){return new rO({type:`union`,options:t,discriminator:e,...W(n)})}var aO=G(`ZodIntersection`,(e,t)=>{JC.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>PE(e,t,n,r)});function oO(e,t){return new aO({type:`intersection`,left:e,right:t})}var sO=G(`ZodRecord`,(e,t)=>{dD(),ZC.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>RE(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function cO(e,t,n){return new sO({type:`record`,keyType:e,valueType:t,...W(n),partial:!0})}var lO=G(`ZodEnum`,(e,t)=>{QC.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>EE(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new lO({...t,checks:[],...W(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new lO({...t,checks:[],...W(r),entries:i})}});function uO(e,t){return new lO({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...W(t)})}var dO=G(`ZodLiteral`,(e,t)=>{$C.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>DE(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function fO(e,t){return new dO({type:`literal`,values:Array.isArray(e)?e:[e],...W(t)})}var pO=G(`ZodTransform`,(e,t)=>{dD(),ew.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kE(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ux(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Gb(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Gb(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function mO(e){return new pO({type:`transform`,transform:e})}var hO=G(`ZodOptional`,(e,t)=>{nw.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>JE(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function gO(e){return new hO({type:`optional`,innerType:e})}var _O=G(`ZodExactOptional`,(e,t)=>{rw.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>JE(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vO(e){return new _O({type:`optional`,innerType:e})}var yO=G(`ZodNullable`,(e,t)=>{iw.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zE(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bO(e){return new yO({type:`nullable`,innerType:e})}var xO=G(`ZodDefault`,(e,t)=>{aw.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>UE(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function SO(e,t){return new xO({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():vb(t)}})}var CO=G(`ZodPrefault`,(e,t)=>{sw.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>WE(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wO(e,t){return new CO({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():vb(t)}})}var TO=G(`ZodNonOptional`,(e,t)=>{cw.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>BE(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function EO(e,t){return new TO({type:`nonoptional`,innerType:e,...W(t)})}var DO=G(`ZodCatch`,(e,t)=>{dw.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>GE(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function OO(e,t){return new DO({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:ix(t)})}var kO=G(`ZodPipe`,(e,t)=>{fw.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>KE(e,t,n,r),e.in=t.in,e.out=t.out});function AO(e,t){return new kO({type:`pipe`,in:e,out:t})}var jO=G(`ZodReadonly`,(e,t)=>{mw.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qE(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function MO(e){return new jO({type:`readonly`,innerType:e})}var NO=G(`ZodCustom`,(e,t)=>{gw.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>OE(e,t,n,r)});function PO(e,t={}){return VT(NO,e,t)}function FO(e,t){return HT(e,t)}var IO=Yy(),LO=uO([`c`,`cpp`,`go`,`haskell`,`java`,`javascript`,`javascriptreact`,`json`,`jsonc`,`lua`,`nix`,`ocaml`,`php`,`python`,`ruby`,`rust`,`shellscript`,`swift`,`terraform`,`toml`,`typescript`,`typescriptreact`,`yaml`,`zig`]),RO=uO([`old`,`new`]),zO=iO(`kind`,[eO({kind:fO(`working`)}),eO({kind:fO(`pr`),pr:K().optional()}),eO({kind:fO(`revspec`),args:K().array()})]),BO=eO({old:K(),new:K(),mergeBase:WD(),live:uO([`worktree`,`refs`,`none`]),commentKey:K()});function VO(e){let t=e=>e.replace(/^refs\/diffle\/[^/]+\/\d+\/(?:base|head)\//,``).replace(/^refs\/(?:heads|remotes)\//,``);return`${t(e.old)}${e.mergeBase?`...`:`..`}${t(e.new)}`}var HO=eO({repository:K(),number:BD(),url:K(),title:K(),state:uO([`OPEN`,`CLOSED`,`MERGED`]),isDraft:WD()}),UO=eO({version:BD(),repository:K().nullable(),pullRequest:HO.nullable(),reason:K().nullable()}),WO=uO([`A`,`M`,`D`,`R`,`C`,`T`,`U`]),GO=eO({path:K(),oldPath:K().optional(),status:WO,additions:BD(),deletions:BD(),binary:WD(),blob:K(),generated:WD(),submodule:fO(!0).optional()}),KO=eO({root:K(),mode:BO,version:BD(),oldSha:K(),newSha:K(),headSha:K(),context:BD(),changed:GO.array(),tree:K().array()}),qO=eO({paths:K().array().max(200)}),JO=eO({path:K(),contents:K(),binary:WD()}),YO=eO({path:K(),side:RO,startLine:BD(),endLine:BD(),quoted:K()}),XO=eO({id:K(),body:K(),createdAt:BD(),updatedAt:BD()}),ZO=eO({id:K(),anchor:YO,messages:XO.array().min(1),resolved:WD(),resolvedAt:BD().optional(),stale:WD(),staleFromLine:BD().optional()}),QO=eO({path:K().min(1),side:RO.optional(),startLine:BD().int().positive(),endLine:BD().int().positive().optional(),body:K().refine(e=>e.trim().length>0,`body required`),quoted:K().optional()}).refine(e=>e.endLine==null||e.endLine>=e.startLine,{path:[`endLine`],message:`endLine must be ≥ startLine`}),$O=eO({body:K().refine(e=>e.trim().length>0,`body required`)}),ek=uO([`open`,`resolved`,`all`]),tk=eO({threadIds:K().array().optional()}),nk=eO({url:K(),posted:BD(),updated:BD(),review:uO([`created`,`existing`]),skipped:eO({id:K(),reason:K()}).array()});eO({state:ek.optional(),path:K().optional()});var rk=eO({body:K()}),ik=eO({path:K(),blob:K(),viewed:WD()}),ak=eO({sha:K(),short:K(),message:K()}),ok=eO({old:ak.nullable(),new:ak.nullable()}),sk=eO({defaultBranch:K().nullable(),current:K().nullable(),branches:K().array(),remoteBranches:K().array(),tags:K().array(),recent:eO({sha:K(),short:K(),subject:K()}).array()}),ck=eO({path:K(),line:BD(),text:K()}),lk=uO([`file`,`diff`,`repo`]),uk=eO({query:K(),matches:ck.array(),truncated:WD()}),dk=eO({autoViewed:K().array(),contextLines:BD(),lspCommands:cO(LO,K())}),fk={autoViewed:[],contextLines:5,lspCommands:{}},pk=eO({path:K().min(1),line:BD().int().positive(),col:BD().int().nonnegative()}),mk=pk.extend({text:K(),external:fO(!0).optional()}),hk=eO({name:K(),command:K(),state:uO([`starting`,`ready`,`unavailable`]),message:K().optional(),activity:K().array().optional(),notice:eO({severity:uO([`warning`,`error`]),message:K()}).optional(),stderr:K().optional()}).extend({languages:LO.array()}),gk=eO({language:LO,tried:K().array()}),_k=eO({enabled:WD(),servers:hk.array(),missing:gk.array()}),vk=eO({locations:mk.array()}),yk=eO({contents:K().nullable(),range:eO({line:BD(),col:BD(),endLine:BD(),endCol:BD()}).optional()}),bk=eO({kind:K().nullable()}),xk=eO({name:K(),kind:BD(),container:K().optional(),path:K(),line:BD(),endLine:BD(),col:BD()});uO([`unviewed`,`viewed`,`restale`]);var Sk=iO(`type`,[eO({type:fO(`snapshot`),version:BD()}),eO({type:fO(`threads`)}),eO({type:fO(`viewed`)}),eO({type:fO(`config`)}),eO({type:fO(`lsp`),payload:_k})]);function Ck(e){return e.newSha===`worktree`||e.headSha!==``&&e.newSha===e.headSha}var wk={bash:`shellscript`,c:`c`,cc:`cpp`,cjs:`javascript`,cpp:`cpp`,cts:`typescript`,cxx:`cpp`,go:`go`,h:`c`,hh:`cpp`,hpp:`cpp`,hs:`haskell`,hxx:`cpp`,java:`java`,js:`javascript`,jsx:`javascriptreact`,json:`json`,jsonc:`jsonc`,lua:`lua`,mjs:`javascript`,ml:`ocaml`,mli:`ocaml`,mts:`typescript`,nix:`nix`,php:`php`,py:`python`,pyi:`python`,rb:`ruby`,rs:`rust`,sh:`shellscript`,swift:`swift`,tf:`terraform`,tfvars:`terraform`,toml:`toml`,ts:`typescript`,tsx:`typescriptreact`,yaml:`yaml`,yml:`yaml`,zig:`zig`};[...new Set(Object.values(wk))].sort();function Tk(e){let t=/\.([^./\\]+)$/.exec(e)?.[1]?.toLowerCase();return t&&wk[t]||null}function Ek(e,t){if(!e.enabled)return`Language servers are off for this run (--no-lsp)`;if(t==null)return e.servers.length?e.servers.some(e=>e.state===`ready`)?null:Dk(e.servers[0]):Ok(e);let n=Tk(t);if(!n)return`No language server for ${/(\.[^./\\]+)$/.exec(t)?.[1]??`these`} files`;let r=e.servers.find(e=>e.languages.includes(n));return r?r.state===`ready`?null:Dk(r):Ok(e,n)}function Dk(e){return e.state===`starting`?`${e.name} is starting…`:`${e.name} is unavailable: ${e.message??`unknown error`}`}function Ok(e,t){let n=t==null?e.missing:e.missing.filter(e=>e.language===t),r=n.filter(e=>e.tried.length>0),i=n.filter(e=>e.tried.length===0).map(e=>e.language);return r.length?`No language server for ${[...new Set(r.map(e=>e.language))].join(`, `)} on PATH: install one of ${[...new Set(r.flatMap(e=>e.tried))].join(`, `)}`:i.length?`The language server for ${i.join(`, `)} is off in your diffle config`:t==null?`No language server runs for this diff`:`No language server runs for ${t}`}var kk=eO({autoViewed:K().array().optional(),contextLines:BD().int().min(0).max(1e4).optional()}),Ak=eO({resolved:WD()}),jk=eO({entries:ik.array()});eO({path:K().min(1),rev:RO});var Mk=K().regex(/^[0-9]+$/).transform(Number).pipe(BD().int().nonnegative());eO({oldOffset:Mk,newOffset:Mk});var Nk=uO([`0`,`1`]).optional().transform(e=>e===`1`);eO({q:K().default(``),scope:lk.default(`diff`),path:K().optional(),word:Nk,i:Nk,re:Nk}),eO({path:K().min(1).optional(),q:K().optional()}).refine(e=>e.path!=null||e.q!=null,`path or q required`),eO({stale:fO(`1`).optional()}),eO({path:K().optional()});var Pk=eO({error:K()});function Fk(e,t){return JSON.stringify(e.parse(t))}async function Ik(e,t,n){let r=await fetch(new URL(t,location.href).href,{...n,headers:{"content-type":`application/json`,...n?.headers}});if(!r.ok)throw new zk(r.status,await Rk(r));return e.parse(r.status===204?void 0:await r.json())}async function Lk(e,t){let n=await fetch(new URL(e,location.href).href,t);if(!n.ok)throw new zk(n.status,await Rk(n));return n.text()}async function Rk(e){try{let t=Pk.safeParse(await e.json());return t.success?t.data.error:e.statusText}catch{return e.statusText}}var zk=class extends Error{status;constructor(e,t){super(t),this.status=e}},Bk=e=>new URLSearchParams(Object.entries(e).filter(e=>e[1]!=null)).toString(),Vk={github:()=>Ik(UO,`api/github`),snapshot:()=>Ik(KO,`api/snapshot`),switchMode:e=>Ik(KO,`api/mode`,{method:`POST`,body:Fk(zO,e)}),refs:()=>Ik(sk,`api/refs`),lastCommitsPreview:(e,t,n)=>Ik(ok,`api/last-commits-preview?${Bk({oldOffset:String(e),newOffset:String(t)})}`,{signal:n}),patch:e=>Lk(`api/patch?${Bk({path:e})}`),patches:e=>Lk(`api/patch`,{method:`POST`,headers:{"content-type":`application/json`},body:Fk(qO,{paths:e})}),file:(e,t,n)=>Ik(JO,`api/file?${Bk({path:e,rev:t})}`,{signal:n}),search:(e,t={})=>Ik(uk,`api/search?${Bk({q:e,word:t.word?`1`:void 0,i:t.ignoreCase?`1`:void 0,re:t.regex?`1`:void 0,scope:t.scope,path:t.path})}`),threads:(e={})=>Ik(ZO.array(),`api/threads?${Bk({state:e.state,path:e.path})}`),exportComments:()=>Lk(`api/threads/export?${Bk({state:`open`})}`),exportComment:(e,t)=>Lk(`api/threads/${encodeURIComponent(e)}/messages/${encodeURIComponent(t)}/export`),exportToGithub:e=>Ik(nk,`api/github/export`,{method:`POST`,body:Fk(tk,e)}),addThread:e=>Ik(ZO.array(),`api/threads`,{method:`POST`,body:Fk(QO,e)}),reply:(e,t)=>Ik(ZO,`api/threads/${encodeURIComponent(e)}/replies`,{method:`POST`,body:Fk($O,t)}),editMessage:(e,t,n)=>Ik(ZO,`api/threads/${encodeURIComponent(e)}/messages/${encodeURIComponent(t)}`,{method:`PATCH`,body:Fk(rk,{body:n})}),deleteMessage:(e,t)=>Ik(ZO.or(KD()),`api/threads/${encodeURIComponent(e)}/messages/${encodeURIComponent(t)}`,{method:`DELETE`}),setResolved:(e,t)=>Ik(ZO,`api/threads/${encodeURIComponent(e)}/resolved`,{method:`PUT`,body:Fk(Ak,{resolved:t})}),deleteThread:e=>Ik(KD(),`api/threads/${encodeURIComponent(e)}`,{method:`DELETE`}),clearThreads:()=>Ik(KD(),`api/threads`,{method:`DELETE`}),deleteStaleThreads:()=>Ik(KD(),`api/threads?stale=1`,{method:`DELETE`}),viewed:()=>Ik(ik.array(),`api/viewed`),setViewedBulk:e=>Ik(ik.array(),`api/viewed/bulk`,{method:`PUT`,body:Fk(jk,{entries:e})}),setViewed:(e,t,n)=>Ik(ik.array(),`api/viewed`,{method:`PUT`,body:Fk(ik,{path:e,blob:t,viewed:n})}),lspStatus:()=>Ik(_k,`api/lsp/status`),lspDefinition:e=>Ik(vk,`api/lsp/definition`,{method:`POST`,body:Fk(pk,e)}),lspTypeDefinition:e=>Ik(vk,`api/lsp/type-definition`,{method:`POST`,body:Fk(pk,e)}),lspHover:e=>Ik(yk,`api/lsp/hover`,{method:`POST`,body:Fk(pk,e)}),lspTokenKind:e=>Ik(bk,`api/lsp/token-kind`,{method:`POST`,body:Fk(pk,e)}),lspReferences:e=>Ik(vk,`api/lsp/references`,{method:`POST`,body:Fk(pk,e)}),lspSymbols:e=>Ik(xk.array(),`api/lsp/symbols?${Bk(e)}`),config:()=>Ik(dk,`api/config`),saveConfig:e=>Ik(dk,`api/config`,{method:`PUT`,body:Fk(kk,e)})};function Hk(e,t){let n=null,r=!1,i=500,a=()=>{if(r)return;let o=new URL(`ws`,location.href);o.protocol=o.protocol===`https:`?`wss:`:`ws:`,n=new WebSocket(o.href),n.onopen=()=>{i=500,t()},n.onmessage=t=>{try{e(Sk.parse(JSON.parse(String(t.data))))}catch{}},n.onclose=()=>{r||(setTimeout(a,i),i=Math.min(i*2,1e4))}};return a(),()=>{r=!0,n?.close()}}var Uk=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Wk=(e,t)=>({classGroupId:e,validator:t}),Gk=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Kk=`-`,qk=[],Jk=`arbitrary..`,Yk=e=>{let t=Qk(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Zk(e);let n=e.split(Kk);return Xk(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Uk(i,t):t:i||qk}return n[e]||qk}}},Xk=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Xk(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Kk):e.slice(t).join(Kk),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Zk=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Jk+r:void 0})(),Qk=e=>{let{theme:t,classGroups:n}=e;return $k(n,t)},$k=(e,t)=>{let n=Gk();for(let r in e){let i=e[r];eA(i,n,r,t)}return n},eA=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];tA(i,t,n,r)}},tA=(e,t,n,r)=>{if(typeof e==`string`){nA(e,t,n);return}if(typeof e==`function`){rA(e,t,n,r);return}iA(e,t,n,r)},nA=(e,t,n)=>{let r=e===``?t:aA(t,e);r.classGroupId=n},rA=(e,t,n,r)=>{if(oA(e)){eA(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Wk(n,e))},iA=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];eA(o,aA(t,a),n,r)}},aA=(e,t)=>{let n=e,r=t.split(Kk),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Gk(),n.nextPart.set(t,i)),n=i}return n},oA=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,sA=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},cA=`!`,lA=`:`,uA=[],dA=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),fA=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===lA){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(cA)?(c=s.slice(0,-1),l=!0):s.startsWith(cA)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return dA(t,l,c,u)};if(t){let e=t+lA,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):dA(uA,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},pA=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},mA=e=>({cache:sA(e.cacheSize),parseClassName:fA(e),sortModifiers:pA(e),postfixLookupClassGroupIds:hA(e),...Yk(e)}),hA=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},gA=/\s+/,_A=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(gA),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+cA:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},vA=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=yA(n))&&(i&&(i+=` `),i+=r);return i},yA=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=yA(e[r]))&&(n&&(n+=` `),n+=t);return n},bA=(e,...t)=>{let n,r,i,a,o=o=>(n=mA(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=_A(e,n);return i(e,a),a};return a=o,(...e)=>a(vA(...e))},xA=[],SA=e=>{let t=t=>t[e]||xA;return t.isThemeGetter=!0,t},CA=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,wA=/^\((?:(\w[\w-]*):)?(.+)\)$/i,TA=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,EA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,DA=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,OA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,kA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,AA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,jA=e=>TA.test(e),MA=e=>!!e&&!Number.isNaN(Number(e)),NA=e=>!!e&&Number.isInteger(Number(e)),PA=e=>e.endsWith(`%`)&&MA(e.slice(0,-1)),FA=e=>EA.test(e),IA=()=>!0,LA=e=>DA.test(e)&&!OA.test(e),RA=()=>!1,zA=e=>kA.test(e),BA=e=>AA.test(e),VA=e=>!q(e)&&!J(e),HA=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),UA=e=>ij(e,cj,RA),q=e=>CA.test(e),WA=e=>ij(e,lj,LA),GA=e=>ij(e,uj,MA),KA=e=>ij(e,fj,IA),qA=e=>ij(e,dj,RA),JA=e=>ij(e,oj,RA),YA=e=>ij(e,sj,BA),XA=e=>ij(e,pj,zA),J=e=>wA.test(e),ZA=e=>aj(e,lj),QA=e=>aj(e,dj),$A=e=>aj(e,oj),ej=e=>aj(e,cj),tj=e=>aj(e,sj),nj=e=>aj(e,pj,!0),rj=e=>aj(e,fj,!0),ij=(e,t,n)=>{let r=CA.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},aj=(e,t,n=!1)=>{let r=wA.exec(e);return r?r[1]?t(r[1]):n:!1},oj=e=>e===`position`||e===`percentage`,sj=e=>e===`image`||e===`url`,cj=e=>e===`length`||e===`size`||e===`bg-size`,lj=e=>e===`length`,uj=e=>e===`number`,dj=e=>e===`family-name`,fj=e=>e===`number`||e===`weight`,pj=e=>e===`shadow`,mj=bA(()=>{let e=SA(`color`),t=SA(`font`),n=SA(`text`),r=SA(`font-weight`),i=SA(`tracking`),a=SA(`leading`),o=SA(`breakpoint`),s=SA(`container`),c=SA(`spacing`),l=SA(`radius`),u=SA(`shadow`),d=SA(`inset-shadow`),f=SA(`text-shadow`),p=SA(`drop-shadow`),m=SA(`blur`),h=SA(`perspective`),g=SA(`aspect`),_=SA(`ease`),v=SA(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),J,q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[J,q,c],T=()=>[jA,`full`,`auto`,...w()],E=()=>[NA,`none`,`subgrid`,J,q],D=()=>[`auto`,{span:[`full`,NA,J,q]},NA,J,q],O=()=>[NA,`auto`,J,q],k=()=>[`auto`,`min`,`max`,`fr`,J,q],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[jA,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[jA,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[jA,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,J,q],L=()=>[...b(),$A,JA,{position:[J,q]}],ee=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],te=()=>[`auto`,`cover`,`contain`,ej,UA,{size:[J,q]}],ne=()=>[PA,ZA,WA],R=()=>[``,`none`,`full`,l,J,q],z=()=>[``,MA,ZA,WA],B=()=>[`solid`,`dashed`,`dotted`,`double`],re=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ie=()=>[MA,PA,$A,JA],ae=()=>[``,`none`,m,J,q],oe=()=>[`none`,MA,J,q],se=()=>[`none`,MA,J,q],ce=()=>[MA,J,q],le=()=>[jA,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[FA],breakpoint:[FA],color:[IA],container:[FA],"drop-shadow":[FA],ease:[`in`,`out`,`in-out`],font:[VA],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[FA],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[FA],shadow:[FA],spacing:[`px`,MA],text:[FA],"text-shadow":[FA],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,jA,q,J,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,J,q]}],"container-named":[HA],columns:[{columns:[MA,q,J,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[NA,`auto`,J,q]}],basis:[{basis:[jA,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[MA,jA,`auto`,`initial`,`none`,q]}],grow:[{grow:[``,MA,J,q]}],shrink:[{shrink:[``,MA,J,q]}],order:[{order:[NA,`first`,`last`,`none`,J,q]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,ZA,WA]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,rj,KA]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,PA,q]}],"font-family":[{font:[QA,qA,t]}],"font-features":[{"font-features":[q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,J,q]}],"line-clamp":[{"line-clamp":[MA,`none`,J,GA]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,J,q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,J,q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...B(),`wavy`]}],"text-decoration-thickness":[{decoration:[MA,`from-font`,`auto`,J,WA]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[MA,`auto`,J,q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[NA,J,q]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,J,q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,J,q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:te()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},NA,J,q],radial:[``,J,q],conic:[NA,J,q]},tj,YA]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:R()}],"rounded-s":[{"rounded-s":R()}],"rounded-e":[{"rounded-e":R()}],"rounded-t":[{"rounded-t":R()}],"rounded-r":[{"rounded-r":R()}],"rounded-b":[{"rounded-b":R()}],"rounded-l":[{"rounded-l":R()}],"rounded-ss":[{"rounded-ss":R()}],"rounded-se":[{"rounded-se":R()}],"rounded-ee":[{"rounded-ee":R()}],"rounded-es":[{"rounded-es":R()}],"rounded-tl":[{"rounded-tl":R()}],"rounded-tr":[{"rounded-tr":R()}],"rounded-br":[{"rounded-br":R()}],"rounded-bl":[{"rounded-bl":R()}],"border-w":[{border:z()}],"border-w-x":[{"border-x":z()}],"border-w-y":[{"border-y":z()}],"border-w-s":[{"border-s":z()}],"border-w-e":[{"border-e":z()}],"border-w-bs":[{"border-bs":z()}],"border-w-be":[{"border-be":z()}],"border-w-t":[{"border-t":z()}],"border-w-r":[{"border-r":z()}],"border-w-b":[{"border-b":z()}],"border-w-l":[{"border-l":z()}],"divide-x":[{"divide-x":z()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":z()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...B(),`hidden`,`none`]}],"divide-style":[{divide:[...B(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...B(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[MA,J,q]}],"outline-w":[{outline:[``,MA,ZA,WA]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,nj,XA]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,nj,XA]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:z()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[MA,WA]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":z()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,nj,XA]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[MA,J,q]}],"mix-blend":[{"mix-blend":[...re(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":re()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[MA]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[J,q]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[MA]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,J,q]}],filter:[{filter:[``,`none`,J,q]}],blur:[{blur:ae()}],brightness:[{brightness:[MA,J,q]}],contrast:[{contrast:[MA,J,q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,nj,XA]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,MA,J,q]}],"hue-rotate":[{"hue-rotate":[MA,J,q]}],invert:[{invert:[``,MA,J,q]}],saturate:[{saturate:[MA,J,q]}],sepia:[{sepia:[``,MA,J,q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,J,q]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[MA,J,q]}],"backdrop-contrast":[{"backdrop-contrast":[MA,J,q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,MA,J,q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[MA,J,q]}],"backdrop-invert":[{"backdrop-invert":[``,MA,J,q]}],"backdrop-opacity":[{"backdrop-opacity":[MA,J,q]}],"backdrop-saturate":[{"backdrop-saturate":[MA,J,q]}],"backdrop-sepia":[{"backdrop-sepia":[``,MA,J,q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,J,q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[MA,`initial`,J,q]}],ease:[{ease:[`linear`,`initial`,_,J,q]}],delay:[{delay:[MA,J,q]}],animate:[{animate:[`none`,v,J,q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,J,q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:oe()}],"rotate-x":[{"rotate-x":oe()}],"rotate-y":[{"rotate-y":oe()}],"rotate-z":[{"rotate-z":oe()}],scale:[{scale:se()}],"scale-x":[{"scale-x":se()}],"scale-y":[{"scale-y":se()}],"scale-z":[{"scale-z":se()}],"scale-3d":[`scale-3d`],skew:[{skew:ce()}],"skew-x":[{"skew-x":ce()}],"skew-y":[{"skew-y":ce()}],transform:[{transform:[J,q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":[`translate-none`],zoom:[{zoom:[NA,J,q]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,J,q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,J,q]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[MA,ZA,WA,GA]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function hj({label:e,onClose:t,className:n,children:r}){return(0,g.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/35`,onMouseDown:e=>e.target===e.currentTarget&&t(),children:(0,g.jsx)(`div`,{role:`dialog`,"aria-label":e,className:mj(`w-140 max-w-[95vw] rounded-[0.625rem] border border-border bg-canvas p-4 shadow-[0_1rem_3rem_rgba(0,0,0,0.3)]`,n),children:r})})}var gj=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),_j=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),vj=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),yj=e=>{let t=vj(e);return t.charAt(0).toUpperCase()+t.slice(1)},bj={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},xj=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Sj=(0,p.createContext)({}),Cj=()=>(0,p.useContext)(Sj),wj=(0,p.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:m=``}=Cj()??{},h=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,p.createElement)(`svg`,{ref:c,...bj,width:t??l??bj.width,height:t??l??bj.height,stroke:e??f,strokeWidth:h,className:gj(`lucide`,m,i),...!a&&!xj(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,p.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),Tj=(e,t)=>{let n=(0,p.forwardRef)(({className:n,...r},i)=>(0,p.createElement)(wj,{ref:i,iconNode:t,className:gj(`lucide-${_j(yj(e))}`,`lucide-${e}`,n),...r}));return n.displayName=yj(e),n},Ej=Tj(`arrow-left-right`,[[`path`,{d:`M8 3 4 7l4 4`,key:`9rb6wj`}],[`path`,{d:`M4 7h16`,key:`6tx8e3`}],[`path`,{d:`m16 21 4-4-4-4`,key:`siv7j2`}],[`path`,{d:`M20 17H4`,key:`h6l3hr`}]]),Dj=Tj(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Oj=Tj(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),kj=Tj(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Aj=Tj(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),jj=Tj(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Mj=Tj(`chevrons-down-up`,[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]),Nj=Tj(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),Pj=Tj(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Fj=Tj(`clipboard-copy`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2`,key:`4jdomd`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v4`,key:`3hqy98`}],[`path`,{d:`M21 14H11`,key:`1bme5i`}],[`path`,{d:`m15 10-4 4 4 4`,key:`5dvupr`}]]),Ij=Tj(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),Lj=Tj(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),Rj=Tj(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),zj=Tj(`crosshair`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`22`,x2:`18`,y1:`12`,y2:`12`,key:`l9bcsi`}],[`line`,{x1:`6`,x2:`2`,y1:`12`,y2:`12`,key:`13hhkx`}],[`line`,{x1:`12`,x2:`12`,y1:`6`,y2:`2`,key:`10w3f3`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`18`,key:`15g9kq`}]]),Bj=Tj(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Vj=Tj(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Hj=Tj(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Uj=Tj(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Wj=Tj(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),Gj=Tj(`file-diff`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]),Kj=Tj(`file-search`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`11.5`,cy:`14.5`,r:`2.5`,key:`1bq0ko`}],[`path`,{d:`M13.3 16.3 15 18`,key:`2quom7`}]]),qj=Tj(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Jj=Tj(`folder-search`,[[`path`,{d:`M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1`,key:`1bw5m7`}],[`path`,{d:`m21 21-1.9-1.9`,key:`1g2n9r`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}]]),Yj=Tj(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),Xj=Tj(`git-compare-arrows`,[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`M12 18H7a2 2 0 0 1-2-2V9`,key:`16sdep`}],[`path`,{d:`m9 15 3 3-3 3`,key:`1m3kbl`}]]),Zj=Tj(`git-pull-request-arrow`,[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M5 9v12`,key:`ih889a`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}]]),Qj=Tj(`git-pull-request`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]),$j=Tj(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),eM=Tj(`keyboard`,[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]),tM=Tj(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),nM=Tj(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),rM=Tj(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),iM=Tj(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),aM=Tj(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),oM=Tj(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),sM=Tj(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),cM=Tj(`pencil-ruler`,[[`path`,{d:`M13 7 8.7 2.7a2.41 2.41 0 0 0-3.4 0L2.7 5.3a2.41 2.41 0 0 0 0 3.4L7 13`,key:`orapub`}],[`path`,{d:`m8 6 2-2`,key:`115y1s`}],[`path`,{d:`m18 16 2-2`,key:`ee94s4`}],[`path`,{d:`m17 11 4.3 4.3c.94.94.94 2.46 0 3.4l-2.6 2.6c-.94.94-2.46.94-3.4 0L11 17`,key:`cfq27r`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),lM=Tj(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),uM=Tj(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),dM=Tj(`reply`,[[`path`,{d:`M20 18v-2a4 4 0 0 0-4-4H4`,key:`5vmcpk`}],[`path`,{d:`m9 17-5-5 5-5`,key:`nvlc11`}]]),fM=Tj(`rotate-ccw-clock`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),pM=Tj(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),mM=Tj(`rows-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]),hM=Tj(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),gM=Tj(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),_M=Tj(`shapes`,[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]),vM=Tj(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),yM=Tj(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),bM=Tj(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),xM=Tj(`whole-word`,[[`circle`,{cx:`7`,cy:`12`,r:`3`,key:`12clwm`}],[`path`,{d:`M10 9v6`,key:`17i7lo`}],[`circle`,{cx:`17`,cy:`12`,r:`3`,key:`gl7c2s`}],[`path`,{d:`M14 7v8`,key:`dl84cr`}],[`path`,{d:`M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1`,key:`lt2kga`}]]),SM=Tj(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function CM({done:e,children:t,size:n=`0.875rem`}){let r=`absolute inset-0 inline-flex items-center justify-center [transition:opacity_160ms_ease,transform_200ms_cubic-bezier(0.2,0.8,0.2,1)]`;return(0,g.jsxs)(`span`,{className:`relative inline-block size-3.5`,"aria-hidden":`true`,children:[(0,g.jsx)(`span`,{className:mj(r,e&&`[transform:scale(0.4)] opacity-0`),children:t}),(0,g.jsx)(`span`,{className:mj(r,e?`[transform:scale(1)_rotate(0)] opacity-100`:`[transform:scale(0.4)_rotate(-30deg)] opacity-0`),children:(0,g.jsx)(Oj,{size:n})})]})}function wM({variant:e=`default`,danger:t,icon:n,feedback:r,className:i,...a}){return(0,g.jsx)(`button`,{...a,"data-feedback":r,className:mj(`inline-flex cursor-pointer items-center gap-1.25 rounded-md border border-border bg-surface px-2.25 py-0.75 leading-[1.2] hover:bg-hover disabled:cursor-default disabled:opacity-50 [&_svg]:flex-none`,e===`primary`&&`border-transparent bg-accent text-accent-fg hover:bg-accent`,e===`ghost`&&`border-transparent bg-transparent hover:bg-hover`,t&&`text-danger`,n&&`px-1.25`,r===`confirm`&&(t?`border-transparent bg-danger text-white hover:bg-danger`:`border-transparent bg-accent text-accent-fg hover:bg-accent`),r===`posted`&&`border-transparent bg-add text-canvas hover:bg-add`,r===`copied`&&`border-transparent bg-add text-white hover:bg-add`,i)})}async function TM(e){if(navigator.clipboard&&window.isSecureContext)try{return await navigator.clipboard.writeText(e),!0}catch{}let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.top=`0`,t.style.left=`0`,t.style.opacity=`0`,document.body.appendChild(t),t.focus(),t.select(),t.setSelectionRange(0,e.length);let n=!1;try{n=document.execCommand(`copy`)}catch{n=!1}return document.body.removeChild(t),n}var EM=o(((e,t)=>{var n=`\\\\/`,r=`[^${n}]`,i=0,a=`\\.`,o=`\\+`,s=`\\?`,c=`\\/`,l=`(?=.)`,u=`[^/]`,d=`(?:${c}|$)`,f=`(?:^|${c})`,p=`${a}{1,2}${d}`,m={DOT_LITERAL:a,PLUS_LITERAL:o,QMARK_LITERAL:s,SLASH_LITERAL:c,ONE_CHAR:l,QMARK:u,END_ANCHOR:d,DOTS_SLASH:p,NO_DOT:`(?!${a})`,NO_DOTS:`(?!${f}${p})`,NO_DOT_SLASH:`(?!${a}{0,1}${d})`,NO_DOTS_SLASH:`(?!${p})`,QMARK_NO_DOT:`[^.${c}]`,STAR:`${u}*?`,START_ANCHOR:f,SEP:`/`},h={...m,SLASH_LITERAL:`[${n}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${a}{1,2}(?:[${n}]|$)`,NO_DOT:`(?!${a})`,NO_DOTS:`(?!(?:^|[${n}])${a}{1,2}(?:[${n}]|$))`,NO_DOT_SLASH:`(?!${a}{0,1}(?:[${n}]|$))`,NO_DOTS_SLASH:`(?!${a}{1,2}(?:[${n}]|$))`,QMARK_NO_DOT:`[^.${n}]`,START_ANCHOR:`(?:^|[${n}])`,END_ANCHOR:`(?:[${n}]|$)`,SEP:`\\`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:i,MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?h:m}}})),DM=o((e=>{var{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=EM();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),OM=o(((e,t)=>{var n=DM(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:_}=EM(),v=e=>e===l||e===a,y=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let b=t||{},x=e.length-1,S=b.parts===!0||b.tokens===!0||b.scanToEnd===!0,C=[],w=[],T=[],E=e,D=-1,O=0,k=0,A=!1,j=!1,M=!1,N=!1,P=!1,F=!1,I=!1,L=!1,ee=!1,te=!1,ne=0,R,z,B={value:``,depth:0,isGlob:!1},re=()=>D>=x,ie=()=>E.charCodeAt(D+1),ae=()=>(R=z,E.charCodeAt(++D));for(;D<x;){z=ae();let e;if(z===a){I=B.backslashes=!0,z=ae(),z===u&&(F=!0);continue}if(F===!0||z===u){for(ne++;re()!==!0&&(z=ae());){if(z===a){I=B.backslashes=!0,ae();continue}if(z===u){ne++;continue}if(F!==!0&&z===s&&(z=ae())===s){if(A=B.isBrace=!0,M=B.isGlob=!0,te=!0,S===!0)continue;break}if(F!==!0&&z===o){if(A=B.isBrace=!0,M=B.isGlob=!0,te=!0,S===!0)continue;break}if(z===h&&(ne--,ne===0)){F=!1,A=B.isBrace=!0,te=!0;break}}if(S===!0)continue;break}if(z===l){if(C.push(D),w.push(B),B={value:``,depth:0,isGlob:!1},te===!0)continue;if(R===s&&D===O+1){O+=2;continue}k=D+1;continue}if(b.noext!==!0&&(z===p||z===i||z===r||z===m||z===c)&&ie()===d){if(M=B.isGlob=!0,N=B.isExtglob=!0,te=!0,z===c&&D===O&&(ee=!0),S===!0){let e=0;for(;re()!==!0&&(z=ae());){if(z===a){I=B.backslashes=!0,ae();continue}if(z===d){e++;continue}if(z===g&&--e===0){te=!0;break}}continue}break}if(z===r){if(R===r&&(P=B.isGlobstar=!0),M=B.isGlob=!0,te=!0,S===!0)continue;break}if(z===m){if(M=B.isGlob=!0,te=!0,S===!0)continue;break}if(z===f){for(;re()!==!0&&(e=ae());){if(e===a){I=B.backslashes=!0,ae();continue}if(e===_){j=B.isBracket=!0,M=B.isGlob=!0,te=!0;break}}if(S===!0)continue;break}if(b.nonegate!==!0&&z===c&&D===O){L=B.negated=!0,O++;continue}if(b.noparen!==!0&&z===d){if(M=B.isGlob=!0,S===!0){let e=1;for(;re()!==!0&&(z=ae());){if(z===a){I=B.backslashes=!0,ae();continue}if(z===d){e++;continue}if(z===g&&--e===0){te=!0;break}}continue}break}if(M===!0){if(te=!0,S===!0)continue;break}}b.noext===!0&&(N=!1,M=!1);let oe=E,se=``,ce=``;O>0&&(se=E.slice(0,O),E=E.slice(O),k-=O),oe&&M===!0&&k>0?(oe=E.slice(0,k),ce=E.slice(k)):M===!0?(oe=``,ce=E):oe=E,oe&&oe!==``&&oe!==`/`&&oe!==E&&v(oe.charCodeAt(oe.length-1))&&(oe=oe.slice(0,-1)),b.unescape===!0&&(ce&&=n.removeBackslashes(ce),oe&&I===!0&&(oe=n.removeBackslashes(oe)));let le={prefix:se,input:e,start:O,base:oe,glob:ce,isBrace:A,isBracket:j,isGlob:M,isExtglob:N,isGlobstar:P,negated:L,negatedExtglob:ee};if(b.tokens===!0&&(le.maxDepth=0,v(z)||w.push(B),le.tokens=w),b.parts===!0||b.tokens===!0){let t;for(let n=0;n<C.length;n++){let r=t===void 0?O:t+1,i=C[n],a=e.slice(r,i);b.tokens&&(n===0&&O!==0?(w[n].isPrefix=!0,w[n].value=se):w[n].value=a,y(w[n]),le.maxDepth+=w[n].depth),i>=O&&(T.push(a),t=i)}let n=t===void 0?O:t+1,r=e.slice(n);T.push(r),b.tokens&&t&&t+1<e.length&&(w[w.length-1].value=r,y(w[w.length-1]),le.maxDepth+=w[w.length-1].depth),le.slashes=C,le.parts=T}return le}})),kM=o(((e,t)=>{var n=EM(),r=DM(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e){if(o===!0){a+=s,o=!1;continue}if(s===`\\`){a+=s,o=!0;continue}if(s===`"`){i=i===1?0:1,a+=s;continue}if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},f=e=>{let t=!1;for(let n of e){if(t===!0){t=!1;continue}if(n===`\\`){t=!0;continue}if(/[?*+@!()[\]{}]/.test(n))return!1}return!0},p=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(f(t))return t.replace(/\\(.)/g,`$1`)},m=e=>{let t=e.map(p).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(!(!a||r!==a.repeat(r.length)||i!==a.repeat(i.length))&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},h=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0){a=!1;continue}if(s===`\\`){a=!0;continue}if(s===`"`){i=i===1?0:1;continue}if(i!==1){if(s===`[`){n++;continue}if(s===`]`&&n>0){n--;continue}if(!(n>0)){if(s===`(`){r++;continue}if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},g=e=>`${e.length===1?r.escapeRegex(e[0]):`[${e.map(e=>r.escapeRegex(e)).join(``)}]`}*`,_=e=>{let t=0,n=[];for(;t<e.length;){let r=h(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=d(r.body).map(e=>e.trim());if(i.length!==1)return;let a=p(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return n},v=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},y=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=d(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||m(i)))return{risky:!0};let a=[],o=!1,s=!0;for(let e of i){let t=_(e);if(t){o=!0,a.push(...t);continue}let n=p(e);if(n&&n.length===1){a.push(n);continue}if(s=!1,v(e)>r)return{risky:!0}}return o?s?{risky:!0,safeOutput:g([...new Set(a)])}:{risky:!0}:{risky:!1}},b=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let d={...t},f=typeof d.maxLength==`number`?Math.min(i,d.maxLength):i,p=e.length;if(p>f)throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${f}`);let m={type:`bos`,value:``,output:d.prepend||``},h=[m],g=d.capture?``:`?:`,_=n.globChars(d.windows),v=n.extglobChars(_),{DOT_LITERAL:x,PLUS_LITERAL:S,SLASH_LITERAL:C,ONE_CHAR:w,DOTS_SLASH:T,NO_DOT:E,NO_DOT_SLASH:D,NO_DOTS_SLASH:O,QMARK:k,QMARK_NO_DOT:A,STAR:j,START_ANCHOR:M}=_,N=e=>`(${g}(?:(?!${M}${e.dot?T:x}).)*?)`,P=d.dot?``:E,F=d.dot?k:A,I=d.bash===!0?N(d):j;d.capture&&(I=`(${I})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let L={input:e,index:-1,start:0,dot:d.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};e=r.removePrefix(e,L),p=e.length;let ee=[],te=[],ne=[],R=m,z,B=()=>L.index===p-1,re=L.peek=(t=1)=>e[L.index+t],ie=L.advance=()=>e[++L.index]||``,ae=()=>e.slice(L.index+1),oe=(e=``,t=0)=>{L.consumed+=e,L.index+=t},se=e=>{L.output+=e.output==null?e.value:e.output,oe(e.value)},ce=()=>{let e=1;for(;re()===`!`&&(re(2)!==`(`||re(3)===`?`);)ie(),L.start++,e++;return e%2!=0&&(L.negated=!0,L.start++,!0)},le=e=>{L[e]++,ne.push(e)},ue=e=>{L[e]--,ne.pop()},V=e=>{if(R.type===`globstar`){let t=L.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||ee.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(L.output=L.output.slice(0,-R.output.length),R.type=`star`,R.value=`*`,R.output=I,L.output+=R.output)}if(ee.length&&e.type!==`paren`&&(ee[ee.length-1].inner+=e.value),(e.value||e.output)&&se(e),R&&R.type===`text`&&e.type===`text`){R.output=(R.output||R.value)+e.value,R.value+=e.value;return}e.prev=R,h.push(e),R=e},de=(e,t)=>{let n={...v[t],conditions:1,inner:``};n.prev=R,n.parens=L.parens,n.output=L.output,n.startIndex=L.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;le(`parens`),V({type:e,value:t,output:L.output?``:w}),V({type:`paren`,extglob:!0,value:ie(),output:r}),ee.push(n)},fe=n=>{let i=e.slice(n.startIndex,L.index+1),a=y(e.slice(n.startIndex+2,L.index),d);if((n.type===`plus`||n.type===`star`)&&a.risky){let e=a.safeOutput?(n.output?``:w)+(d.capture?`(${a.safeOutput})`:a.safeOutput):void 0,t=h[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<h.length;e++)h[e].value=``,h[e].output=``,delete h[e].suffix;L.output=n.output+t.output,L.backtrack=!0,V({type:`paren`,extglob:!0,value:z,output:``}),ue(`parens`);return}let o=n.close+(d.capture?`)`:``),s;if(n.type===`negate`){let e=I;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=N(d)),(e!==I||B()||/^\)+$/.test(ae()))&&(o=n.close=`)$))${e}`),n.inner.includes(`*`)&&(s=ae())&&/^\.[^\\/.]+$/.test(s)&&(o=n.close=`)${b(s,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(L.negatedExtglob=!0)}V({type:`paren`,extglob:!0,value:z,output:o}),ue(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?k.repeat(a.length):``):o===0?F+(a?k.repeat(a.length):``):k.repeat(r.length):i===`.`?x.repeat(r.length):i===`*`?t?t+i+(a?I:``):I:t?e:`\\${e}`);return n===!0&&(i=d.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&d.contains===!0?(L.output=e,L):(L.output=r.wrapOutput(i,L,t),L)}for(;!B();){if(z=ie(),z===`\0`)continue;if(z===`\\`){let e=re();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){z+=`\\`,V({type:`text`,value:z});continue}let t=/^\\+/.exec(ae()),n=0;if(t&&t[0].length>2&&(n=t[0].length,L.index+=n,n%2!=0&&(z+=`\\`)),d.unescape===!0?z=ie():z+=ie(),L.brackets===0){V({type:`text`,value:z});continue}}if(L.brackets>0&&(z!==`]`||R.value===`[`||R.value===`[^`)){if(d.posix!==!1&&z===`:`){let e=R.value.slice(1);if(e.includes(`[`)&&(R.posix=!0,e.includes(`:`))){let e=R.value.lastIndexOf(`[`),t=R.value.slice(0,e),n=a[R.value.slice(e+2)];if(n){R.value=t+n,L.backtrack=!0,ie(),!m.output&&h.indexOf(R)===1&&(m.output=w);continue}}}(z===`[`&&re()!==`:`||z===`-`&&re()===`]`)&&(z=`\\${z}`),z===`]`&&(R.value===`[`||R.value===`[^`)&&(z=`\\${z}`),d.posix===!0&&z===`!`&&R.value===`[`&&(z=`^`),R.value+=z,se({value:z});continue}if(L.quotes===1&&z!==`"`){z=r.escapeRegex(z),R.value+=z,se({value:z});continue}if(z===`"`){L.quotes=L.quotes===1?0:1,d.keepQuotes===!0&&V({type:`text`,value:z});continue}if(z===`(`){le(`parens`),V({type:`paren`,value:z});continue}if(z===`)`){if(L.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=ee[ee.length-1];if(e&&L.parens===e.parens+1){fe(ee.pop());continue}V({type:`paren`,value:z,output:L.parens?`)`:`\\)`}),ue(`parens`);continue}if(z===`[`){if(d.nobracket===!0||!ae().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));z=`\\${z}`}else le(`brackets`);V({type:`bracket`,value:z});continue}if(z===`]`){if(d.nobracket===!0||R&&R.type===`bracket`&&R.value.length===1){V({type:`text`,value:z,output:`\\${z}`});continue}if(L.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));V({type:`text`,value:z,output:`\\${z}`});continue}ue(`brackets`);let e=R.value.slice(1);if(R.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(z=`/${z}`),R.value+=z,se({value:z}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(R.value);if(L.output=L.output.slice(0,-R.value.length),d.literalBrackets===!0){L.output+=t,R.value=t;continue}R.value=`(${g}${t}|${R.value})`,L.output+=R.value;continue}if(z===`{`&&d.nobrace!==!0){le(`braces`);let e={type:`brace`,value:z,output:`(`,outputIndex:L.output.length,tokensIndex:L.tokens.length};te.push(e),V(e);continue}if(z===`}`){let e=te[te.length-1];if(d.nobrace===!0||!e){V({type:`text`,value:z,output:z});continue}let t=`)`;if(e.dots===!0){let e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,d),L.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=L.output.slice(0,e.outputIndex),r=L.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,z=t=`\\}`,L.output=n;for(let e of r)L.output+=e.output||e.value}V({type:`brace`,value:z,output:t}),ue(`braces`),te.pop();continue}if(z===`|`){ee.length>0&&ee[ee.length-1].conditions++,V({type:`text`,value:z});continue}if(z===`,`){let e=z,t=te[te.length-1];t&&ne[ne.length-1]===`braces`&&(t.comma=!0,e=`|`),V({type:`comma`,value:z,output:e});continue}if(z===`/`){if(R.type===`dot`&&L.index===L.start+1){L.start=L.index+1,L.consumed=``,L.output=``,h.pop(),R=m;continue}V({type:`slash`,value:z,output:C});continue}if(z===`.`){if(L.braces>0&&R.type===`dot`){R.value===`.`&&(R.output=x);let e=te[te.length-1];R.type=`dots`,R.output+=z,R.value+=z,e.dots=!0;continue}if(L.braces+L.parens===0&&R.type!==`bos`&&R.type!==`slash`){V({type:`text`,value:z,output:x});continue}V({type:`dot`,value:z,output:x});continue}if(z===`?`){if(!(R&&R.value===`(`)&&d.noextglob!==!0&&re()===`(`&&re(2)!==`?`){de(`qmark`,z);continue}if(R&&R.type===`paren`){let e=re(),t=z;(R.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(ae()))&&(t=`\\${z}`),V({type:`text`,value:z,output:t});continue}if(d.dot!==!0&&(R.type===`slash`||R.type===`bos`)){V({type:`qmark`,value:z,output:A});continue}V({type:`qmark`,value:z,output:k});continue}if(z===`!`){if(d.noextglob!==!0&&re()===`(`&&(re(2)!==`?`||!/[!=<:]/.test(re(3)))){de(`negate`,z);continue}if(d.nonegate!==!0&&L.index===0){ce();continue}}if(z===`+`){if(d.noextglob!==!0&&re()===`(`&&re(2)!==`?`){de(`plus`,z);continue}if(R&&R.value===`(`||d.regex===!1){V({type:`plus`,value:z,output:S});continue}if(R&&(R.type===`bracket`||R.type===`paren`||R.type===`brace`)||L.parens>0){V({type:`plus`,value:z});continue}V({type:`plus`,value:S});continue}if(z===`@`){if(d.noextglob!==!0&&re()===`(`&&re(2)!==`?`){V({type:`at`,extglob:!0,value:z,output:``});continue}V({type:`text`,value:z});continue}if(z!==`*`){(z===`$`||z===`^`)&&(z=`\\${z}`);let e=o.exec(ae());e&&(z+=e[0],L.index+=e[0].length),V({type:`text`,value:z});continue}if(R&&(R.type===`globstar`||R.star===!0)){R.type=`star`,R.star=!0,R.value+=z,R.output=I,L.backtrack=!0,L.globstar=!0,oe(z);continue}let t=ae();if(d.noextglob!==!0&&/^\([^?]/.test(t)){de(`star`,z);continue}if(R.type===`star`){if(d.noglobstar===!0){oe(z);continue}let n=R.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(d.bash===!0&&(!i||t[0]&&t[0]!==`/`)){V({type:`star`,value:z,output:``});continue}let o=L.braces>0&&(n.type===`comma`||n.type===`brace`),s=ee.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){V({type:`star`,value:z,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[L.index+4];if(n&&n!==`/`)break;t=t.slice(3),oe(`/**`,3)}let c=B()||L.parens>0&&t===`)`.repeat(L.parens)&&!ee.some(e=>e.type===`negate`);if(n.type===`bos`&&B()){R.type=`globstar`,R.value+=z,R.output=N(d),L.output=R.output,L.globstar=!0,oe(z);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&c){L.output=L.output.slice(0,-(n.output+R.output).length),n.output=`(?:${n.output}`,R.type=`globstar`,R.output=N(d)+(d.strictSlashes?`)`:`|$)`),R.value+=z,L.globstar=!0,L.output+=n.output+R.output,oe(z);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;L.output=L.output.slice(0,-(n.output+R.output).length),n.output=`(?:${n.output}`,R.type=`globstar`,R.output=`${N(d)}${C}|${C}${e})`,R.value+=z,L.output+=n.output+R.output,L.globstar=!0,oe(z+ie()),V({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){R.type=`globstar`,R.value+=z,R.output=`(?:^|${C}|${N(d)}${C})`,L.output=R.output,L.globstar=!0,oe(z+ie()),V({type:`slash`,value:`/`,output:``});continue}L.output=L.output.slice(0,-R.output.length),R.type=`globstar`,R.output=N(d),R.value+=z,L.output+=R.output,L.globstar=!0,oe(z);continue}let n={type:`star`,value:z,output:I};if(d.bash===!0){n.output=`.*?`,(R.type===`bos`||R.type===`slash`)&&(n.output=P+n.output),V(n);continue}if(R&&(R.type===`bracket`||R.type===`paren`)&&d.regex===!0){n.output=z,V(n);continue}(L.index===L.start||R.type===`slash`||R.type===`dot`)&&(R.type===`dot`?(L.output+=D,R.output+=D):d.dot===!0?(L.output+=O,R.output+=O):(L.output+=P,R.output+=P),re()!==`*`&&(L.output+=w,R.output+=w)),V(n)}for(;L.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));L.output=r.escapeLast(L.output,`[`),ue(`brackets`)}for(;L.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));L.output=r.escapeLast(L.output,`(`),ue(`parens`)}for(;L.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));L.output=r.escapeLast(L.output,`{`),ue(`braces`)}if(d.strictSlashes!==!0&&(R.type===`star`||R.type===`bracket`)&&V({type:`maybe_slash`,value:``,output:`${C}?`}),L.backtrack===!0){L.output=``;for(let e of L.tokens)L.output+=e.output==null?e.value:e.output,e.suffix&&(L.output+=e.suffix)}return L};b.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:_}=n.globChars(a.windows),v=a.dot?m:p,y=a.dot?h:p,b=a.capture?``:`?:`,x={negated:!1,prefix:``},S=a.bash===!0?`.*?`:g;a.capture&&(S=`(${S})`);let C=e=>e.noglobstar===!0?S:`(${b}(?:(?!${_}${e.dot?f:l}).)*?)`,w=e=>{switch(e){case`*`:return`${v}${d}${S}`;case`.*`:return`${l}${d}${S}`;case`*.*`:return`${v}${S}${l}${d}${S}`;case`*/*`:return`${v}${S}${u}${d}${y}${S}`;case`**`:return v+C(a);case`**/*`:return`(?:${v}${C(a)}${u})?${y}${d}${S}`;case`**/*.*`:return`(?:${v}${C(a)}${u})?${y}${S}${l}${d}${S}`;case`**/.*`:return`(?:${v}${C(a)}${u})?${l}${d}${S}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=w(t[1]);return n?n+l+t[2]:void 0}}},T=w(r.removePrefix(e,x));return T&&a.strictSlashes!==!0&&(T+=`${u}?`),T},t.exports=b})),AM=o(((e,t)=>{var n=OM(),r=kM(),i=DM(),a=EM(),o=e=>e&&typeof e==`object`&&!Array.isArray(e),s=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>s(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=o(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=c.state;delete c.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=s(i.ignore,e,n)}let d=(n,r=!1)=>{let{isMatch:o,match:d,output:f}=s.test(n,c,t,{glob:e,posix:a}),p={glob:e,state:l,regex:c,posix:a,input:n,output:f,match:d,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):u(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),!r||p)};return n&&(d.state=l),d};s.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},c=o.format||(a?i.toPosixSlashes:null),l=e===r,u=l&&c?c(e):e;return l===!1&&(u=c?c(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?s.matchBase(e,t,n,a):t.exec(u)),{isMatch:!!l,match:l,output:u}},s.matchBase=(e,t,n,r=n&&n.windows)=>(t instanceof RegExp?t:s.makeRe(t,n)).test(i.basename(e,{windows:r})),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map(e=>s.parse(e,t)):r(e,{...t,fastpaths:!1}),s.scan=(e,t)=>n(e,t),s.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,c=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let l=s.toRegex(c,t);return r===!0&&(l.state=e),l},s.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),s.compileRe(a,t,n,i)},s.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},s.constants=a,t.exports=s})),jM=l(o(((e,t)=>{t.exports=AM()}))(),1);function MM(e,t,n){return`${e?`diff`:`file`}:${t}@${n}`}function NM(e){return e.replace(/^(diff|file):/,``).replace(/@\d+$/,``)}function PM(e,t){return MM(e.fileView?.path!==t&&(e.snapshot?.changed.some(e=>e.path===t)??!1),t,e.gens[t]??0)}var FM=e=>e.additions+e.deletions;function IM(e,t,n,r){let i=new Map(t.map(e=>[e.path,e])),a=e=>n.includes(e)?0:(r(e)?4:2)+ +(FM(i.get(e))>4e3),o=LM(e).filter(e=>i.has(e)).sort((e,t)=>a(e)-a(t)),s=[],c=[],l=0;for(let e of o){let t=FM(i.get(e));c.length>0&&(c.length>=12||l+t>4e3)&&(s.push(c),c=[],l=0),c.push(e),l+=t}return c.length>0&&s.push(c),s}function LM(e){return e.changed.map(e=>e.path).sort(HM)}function RM(e){return e.activePath??e.fileView?.path??(e.snapshot&&LM(e.snapshot)[0])??null}var zM=[`file`,`diff`,`repo`];function BM(e){return zM[(zM.indexOf(e)+1)%zM.length]}function VM(e){return e===`file`?`diff`:e}function HM(e,t){let n=e.split(`/`),r=t.split(`/`),i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=n[e],i=r[e];if(t===i)continue;let a=e<n.length-1;if(a!==e<r.length-1)return a?-1:1;let o=t.toLowerCase(),s=i.toLowerCase(),c=UM(o,s);return c===0?o===s?t<i?-1:1:o<s?-1:1:c}return n.length-r.length}function UM(e,t){let n=WM(e),r=WM(t),i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=n[e],i=r[e];if(t===i)continue;if(typeof t==`number`&&typeof i==`number`)return t<i?-1:1;let a=String(t),o=String(i);if(a!==o)return a<o?-1:1}return n.length-r.length}function WM(e){let t=[];for(let n of e.matchAll(/\d+|\D+/g))t.push(/^\d/.test(n[0])?Number(n[0]):n[0]);return t.length===0&&t.push(``),t}function GM(e,t){let n=e.viewed.find(e=>e.path===t.path&&e.blob===t.blob);return n?n.viewed?`viewed`:`unviewed`:e.viewed.some(e=>e.path===t.path&&e.viewed&&e.blob!==t.blob)?`restale`:tN(e.config,t.path)?`viewed`:`unviewed`}function KM(e,t){return GM(e,t)===`viewed`}function qM(e,t){let n=0;for(let r of t)KM(e,r)&&n++;return n}function JM(e,t){let n=e.collapsed[t];if(n!=null)return n;let r=e.snapshot?.changed.find(e=>e.path===t);return r?KM(e,r)||r.generated:!1}function YM(e){return e.showResolved?e.threads:e.threads.filter(e=>!e.resolved)}function XM(e,t){return e.find(e=>e.messages.some(e=>e.id===t))}function ZM(e,t){if(e===t)return t;let n=new Map(e.map(e=>[e.id,e])),r=e.length===t.length,i=t.map((t,i)=>{let a=n.get(t.id),o=a&&JSON.stringify(a)===JSON.stringify(t)?a:t;return o!==e[i]&&(r=!1),o});return r?e:i}function QM(e,t,n,r){let i=e.replyTo!=null&&n.some(t=>t.id===e.replyTo)?e.replyTo:null,a=e.editingId!=null&&XM(n,e.editingId)?e.editingId:null;return[...n,e.draft?.path===t?e.draft:null,r,i,a]}function $M(e,t){return e&&e.deps.length===t.length&&e.deps.every((e,n)=>e===t[n])?e:{deps:t,version:(e?.version??0)+1}}var eN=new Map;function tN(e,t){let n=e.autoViewed.join(`
1595
- `),r=eN.get(n);if(!r){let t=e.autoViewed.filter(Boolean);r=t.length?(0,jM.default)(t,{dot:!0,basename:!0}):()=>!1,eN.set(n,r)}return r(t)}function nN(e,t){let n=t.trim().toLowerCase();if(!n)return e;let r=[];for(let t of e){let e=t.name.toLowerCase();e.startsWith(n)?r.push([0,t]):e.includes(n)?r.push([1,t]):rN(n,e)&&r.push([2,t])}return r.sort((e,t)=>e[0]-t[0]).map(e=>e[1])}function rN(e,t){let n=0;for(let r of t)if(r===e[n]&&++n===e.length)return!0;return!1}function iN(e,t){return{kind:`revspec`,args:[`HEAD~${e}..HEAD~${t}`]}}function aN(e){return e===`updated`?`Updated`:e===`unchanged`?`Already added`:`Added`}function oN(e){let t=e.root.split(/[\\/]/).filter(Boolean);return t[t.length-1]??e.root}function sN(e,t=null){let n=t?.pullRequest;return n?`diffle: ${n.repository} #${n.number}`:`diffle: ${oN(e)}`}var cN=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},lN=(e=>e?cN(e):cN),uN=e=>e;function dN(e,t=uN){let n=p.useSyncExternalStore(e.subscribe,p.useCallback(()=>t(e.getState()),[e,t]),p.useCallback(()=>t(e.getInitialState()),[e,t]));return p.useDebugValue(n),n}var fN=e=>{let t=lN(e),n=e=>dN(t,e);return Object.assign(n,t),n},pN=(e=>e?fN(e):fN);function mN(e,t){let n=gN(e),{startLine:r,endLine:i}=_N(e);if(n===`new`||!t)return{side:n,startLine:r,endLine:i};let a=[];for(let e=r;e<=i;e++){let n=hN(t,e);if(n==null)return{side:`old`,startLine:r,endLine:i};a.push(n)}return{side:`new`,startLine:a[0],endLine:a[a.length-1]}}function hN(e,t){for(let n of e.hunks){let e=n.deletionStart,r=n.additionStart;for(let i of n.hunkContent)if(i.type===`context`){if(t>=e&&t<e+i.lines)return r+(t-e);e+=i.lines,r+=i.lines}else{if(t>=e&&t<e+i.deletions)return null;e+=i.deletions,r+=i.additions}}return null}function gN(e){return(e.range.endSide??e.range.side)===`deletions`?`old`:`new`}function _N(e){let t=e.range.start,n=e.range.end;return{startLine:Math.min(t,n),endLine:Math.max(t,n)}}function vN(e,t,n){let r=e.split(`
1594
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function XT(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;XT(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var ZT=new Set([`type`,`properties`,`required`,`additionalProperties`]),QT=[`oneOf`,`anyOf`];function $T(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function eE(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!ZT.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??$T(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}ib(n,r,e.length===1?e[0]:eE(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=$T(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function tE(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of ZT)if(t in e)return;let n=t.filter(e=>QT.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=eE(t);else{let e=n[0],i=QT.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>eE([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,WT(e,r))}function nE(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):WT(i,s),WT(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())XT(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])tE(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}WT(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,ib(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:aE(t,`input`,e.processors),output:aE(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function rE(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return rE(r.element,n);if(r.type===`set`)return rE(r.valueType,n);if(r.type===`lazy`)return rE(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return rE(r.innerType,n);if(r.type===`intersection`)return rE(r.left,n)||rE(r.right,n);if(r.type===`record`||r.type===`map`)return rE(r.keyType,n)||rE(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:rE(r.in,n)||rE(r.out,n);if(r.type===`object`){for(let e in r.shape)if(rE(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(rE(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(rE(e,n))return!0;return!!(r.rest&&rE(r.rest,n))}return!1}var iE=(e,t={})=>n=>{let r=GT({...n,processors:t});return qT(e,r),YT(r,e),nE(r,e)},aE=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=GT({...i??{},target:a,io:t,processors:n});return qT(e,o),YT(o,e),nE(o,e)},oE=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},sE=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},cE=(e,t)=>{oE(e,`minimum`,t),sE(e,`maximum`,t)},lE=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},uE=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},dE=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},fE=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},pE=(e,t)=>oE(e,`minimum`,t.minimum),mE=(e,t)=>sE(e,`maximum`,t.maximum),hE=e=>(t,n)=>{fE(t,n.format);let[r,i]=e[n.format];oE(t,`minimum`,r),sE(t,`maximum`,i)},gE={greater_than:(e,t)=>oE(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>sE(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>lE(e,t.value),number_format:hE(wb),bigint_format:hE(Tb),min_length:pE,max_length:mE,length_equals:(e,t)=>cE(e,t.length),min_size:pE,max_size:mE,size_equals:(e,t)=>cE(e,t.size),string_format:(e,t)=>{fE(e,t.format),t.pattern&&uE(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>dE(e,t.mime)};function _E(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)gE[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&oE(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&oE(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&sE(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&sE(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&lE(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&dE(t,i.mime);for(let e of i.patterns??[])uE(t,e);return t}var vE={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},yE=new Map([[SC,aS],[wC,oS]]),bE=e=>yE.get(e)??e,xE=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=_E(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=vE[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(bE);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},SE=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=_E(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):KT(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},CE=(e,t,n,r)=>{n.type=`boolean`},wE=(e,t,n,r)=>{KT(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},TE=(e,t,n,r)=>{n.not={}},EE=(e,t,n,r)=>{let i=e._zod.def,a=Xy(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},DE=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(KT(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(KT(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},OE=(e,t,n,r)=>{KT(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},kE=(e,t,n,r)=>{KT(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},AE=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=_E(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=qT(a.element,t,{...r,path:[...r.path,`items`]})};function jE(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?jE(t.out):t.type===`catch`?jE(t.innerType):e._zod.optin}var ME=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&KT(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)ib(i.properties,e,qT(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e];return t.io===`input`?jE(n)===void 0:n._zod.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=qT(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},NE=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>qT(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},PE=(e,t,n,r)=>{let i=e._zod.def,a=qT(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=qT(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function FE(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=FE(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>FE(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?_S:gS).source),p):p}var IE=new WeakMap;function LE(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of IE.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=FE(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var RE=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=_E(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=qT(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)ib(i.patternProperties,bE(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=qT(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=IE.get(t);n||(n=[],IE.set(t,n),t.deferred.push(()=>LE(t))),n.push(e)}i.additionalProperties=qT(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&jE(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},zE=(e,t,n,r)=>{let i=e._zod.def,a=qT(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},BE=(e,t,n,r)=>{let i=e._zod.def;qT(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},VE=Symbol();function HE(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(KT(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),VE):JSON.parse(o)}var UE=(e,t,n,r)=>{let i=e._zod.def;qT(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=HE(i.defaultValue,e,t,n,r);o!==VE&&(n.default=o)},WE=(e,t,n,r)=>{let i=e._zod.def;qT(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=HE(i.defaultValue,e,t,n,r);o!==VE&&(n._prefault=o)},GE=(e,t,n,r)=>{let i=e._zod.def;qT(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{KT(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},KE=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;qT(o,t,r);let s=t.seen.get(e);s.ref=o},qE=(e,t,n,r)=>{let i=e._zod.def;qT(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},JE=(e,t,n,r)=>{let i=e._zod.def;qT(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},YE=new WeakSet([Object.prototype,Error.prototype]);function XE(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var ZE=G(`ZodError`,(e,t)=>{yx.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);YE.has(n)||(YE.add(n),XE(n,`format`,e=>t=>Sx(e,t)),XE(n,`flatten`,e=>t=>xx(e,t)),XE(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Qy,2)}),XE(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Qy,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),QE=wx(ZE),$E=Tx(ZE),eD=Ex(ZE),tD=Ox(ZE),nD=Px(ZE),rD=Fx(ZE),iD=Ix(ZE),aD=Lx(ZE),oD=Rx(ZE),sD=zx(ZE),cD=Bx(ZE),lD=Vx(ZE);function uD(){dx.localeError||fx(Iw())}function dD(){dx.memoizer||fx({memoizer:Nw()})}var fD=G(`ZodType`,(e,t)=>(uD(),HS.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(db(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return xb(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(PO(e,t))},superRefine(e,t){return this.check(FO(e,t))},overwrite(e){return this.check(PT(e))},optional(){return gO(this)},exactOptional(){return vO(this)},nullable(){return bO(this)},nullish(){return gO(bO(this))},nonoptional(e){return EO(this,e)},array(){return QD(this)},or(e){return nO([this,e])},and(e){return oO(this,e)},transform(e){return AO(this,mO(e))},default(e){return SO(this,e)},prefault(e){return wO(this,e)},catch(e){return OO(this,e)},pipe(e){return AO(this,e)},readonly(){return MO(this)},describe(e){let t=this.clone();return Bw.add(t,{description:e}),t},meta(...e){if(e.length===0)return Bw.get(this);let t=this.clone();return Bw.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Jb(this,`~standard`,{...GS(this),jsonSchema:{input:aE(this,`input`),output:aE(this,`output`)}})},set"~standard"(e){qb(this,`~standard`,e)},parse:function e(t,n){return QE(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await $E(this,t,n,{callee:e})},safeParse(e,t){return eD(this,e,t)},async safeParseAsync(e,t){return tD(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){qb(this,`spa`,e)},validate(e,t){return jx(this,e,t)},validateAsync(e,t){return Nx(this,e,t)},encode:function e(t,n){return nD(this,t,n,{callee:e})},decode:function e(t,n){return rD(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await iD(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await aD(this,t,n,{callee:e})},safeEncode(e,t){return oD(this,e,t)},safeDecode(e,t){return sD(this,e,t)},async safeEncodeAsync(e,t){return cD(this,e,t)},async safeDecodeAsync(e,t){return lD(this,e,t)},toJSONSchema(e){return iE(this,{})(e)},get description(){return Bw.get(this)?.description},get _def(){return this._zod.def}}),pD=G(`_ZodString`,(e,t)=>{KS.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xE(e,t,n,r)},Yb({format:e=>_E(e).format??null,minLength:e=>_E(e).minimum??null,maxLength:e=>_E(e).maximum??null},{regex(...e){return this.check(OT(...e))},includes(...e){return this.check(jT(...e))},startsWith(...e){return this.check(MT(...e))},endsWith(...e){return this.check(NT(...e))},min(...e){return this.check(ET(...e))},max(...e){return this.check(TT(...e))},length(...e){return this.check(DT(...e))},nonempty(...e){return this.check(ET(1,...e))},lowercase(e){return this.check(kT(e))},uppercase(e){return this.check(AT(e))},trim(){return this.check(IT())},normalize(...e){return this.check(FT(...e))},toLowerCase(){return this.check(LT())},toUpperCase(){return this.check(RT())},slugify(){return this.check(zT())}})),mD=G(`ZodString`,(e,t)=>{KS.init(e,t),pD.init(e,t)},{email(e){return this.check(Hw(bD,e))},url(e){return this.check(Jw(CD,e))},jwt(e){return this.check(lT(RD,e))},emoji(e){return this.check(Yw(wD,e))},guid(e){return this.check(Uw(xD,e))},uuid(e){return this.check(Ww(SD,e))},uuidv4(e){return this.check(Gw(SD,e))},uuidv6(e){return this.check(Kw(SD,e))},uuidv7(e){return this.check(qw(SD,e))},nanoid(e){return this.check(Xw(TD,e))},cuid(e){return this.check(Zw(ED,e))},cuid2(e){return this.check(Qw(DD,e))},ulid(e){return this.check($w(OD,e))},base64(e){return this.check(oT(FD,e))},base64url(e){return this.check(sT(ID,e))},xid(e){return this.check(eT(kD,e))},ksuid(e){return this.check(tT(AD,e))},ipv4(e){return this.check(nT(jD,e))},ipv6(e){return this.check(rT(MD,e))},cidrv4(e){return this.check(iT(ND,e))},cidrv6(e){return this.check(aT(PD,e))},e164(e){return this.check(cT(LD,e))},datetime(e){return this.check(uT(gD,e))},date(e){return this.check(dT(_D,e))},time(e){return this.check(fT(vD,e))},duration(e){return this.check(pT(yD,e))}});function K(e){return Vw(mD,e)}var hD=G(`ZodStringFormat`,(e,t)=>{qS.init(e,t),pD.init(e,t)}),gD=G(`ZodISODateTime`,(e,t)=>{uC.init(e,t),hD.init(e,t)}),_D=G(`ZodISODate`,(e,t)=>{dC.init(e,t),hD.init(e,t)}),vD=G(`ZodISOTime`,(e,t)=>{fC.init(e,t),hD.init(e,t)}),yD=G(`ZodISODuration`,(e,t)=>{pC.init(e,t),hD.init(e,t)}),bD=G(`ZodEmail`,(e,t)=>{XS.init(e,t),hD.init(e,t)}),xD=G(`ZodGUID`,(e,t)=>{JS.init(e,t),hD.init(e,t)}),SD=G(`ZodUUID`,(e,t)=>{YS.init(e,t),hD.init(e,t)}),CD=G(`ZodURL`,(e,t)=>{nC.init(e,t),hD.init(e,t)}),wD=G(`ZodEmoji`,(e,t)=>{rC.init(e,t),hD.init(e,t)}),TD=G(`ZodNanoID`,(e,t)=>{iC.init(e,t),hD.init(e,t)}),ED=G(`ZodCUID`,(e,t)=>{aC.init(e,t),hD.init(e,t)}),DD=G(`ZodCUID2`,(e,t)=>{oC.init(e,t),hD.init(e,t)}),OD=G(`ZodULID`,(e,t)=>{sC.init(e,t),hD.init(e,t)}),kD=G(`ZodXID`,(e,t)=>{cC.init(e,t),hD.init(e,t)}),AD=G(`ZodKSUID`,(e,t)=>{lC.init(e,t),hD.init(e,t)}),jD=G(`ZodIPv4`,(e,t)=>{mC.init(e,t),hD.init(e,t)}),MD=G(`ZodIPv6`,(e,t)=>{_C.init(e,t),hD.init(e,t)}),ND=G(`ZodCIDRv4`,(e,t)=>{vC.init(e,t),hD.init(e,t)}),PD=G(`ZodCIDRv6`,(e,t)=>{bC.init(e,t),hD.init(e,t)}),FD=G(`ZodBase64`,(e,t)=>{CC.init(e,t),hD.init(e,t)}),ID=G(`ZodBase64URL`,(e,t)=>{EC.init(e,t),hD.init(e,t)}),LD=G(`ZodE164`,(e,t)=>{DC.init(e,t),hD.init(e,t)}),RD=G(`ZodJWT`,(e,t)=>{kC.init(e,t),hD.init(e,t)}),zD=G(`ZodNumber`,(e,t)=>{AC.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>SE(e,t,n,r),e.isFinite=!0},Yb({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=_E(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=_E(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=_E(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>_E(e).format??null},{gt(e,t){return this.check(ST(e,t))},gte(e,t){return this.check(CT(e,t))},min(e,t){return this.check(CT(e,t))},lt(e,t){return this.check(bT(e,t))},lte(e,t){return this.check(xT(e,t))},max(e,t){return this.check(xT(e,t))},int(e){return this.check(HD(e))},safe(e){return this.check(HD(e))},positive(e){return this.check(ST(0,e))},nonnegative(e){return this.check(CT(0,e))},negative(e){return this.check(bT(0,e))},nonpositive(e){return this.check(xT(0,e))},multipleOf(e,t){return this.check(wT(e,t))},step(e,t){return this.check(wT(e,t))},finite(){return this}}));function BD(e){return mT(zD,e)}var VD=G(`ZodNumberFormat`,(e,t)=>{jC.init(e,t),zD.init(e,t)});function HD(e){return hT(VD,e)}var UD=G(`ZodBoolean`,(e,t)=>{MC.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>CE(e,t,n,r)});function WD(e){return gT(UD,e)}var GD=G(`ZodUndefined`,(e,t)=>{NC.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wE(e,t,n,r)});function KD(e){return _T(GD,e)}var qD=G(`ZodUnknown`,(e,t)=>{PC.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function JD(){return vT(qD)}var YD=G(`ZodNever`,(e,t)=>{FC.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>TE(e,t,n,r)});function XD(e){return yT(YD,e)}var ZD=G(`ZodArray`,(e,t)=>{dD(),LC.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>AE(e,t,n,r),e.element=t.element},{min(e,t){return this.check(ET(e,t))},nonempty(e){return this.check(ET(1,e))},max(e,t){return this.check(TT(e,t))},length(e,t){return this.check(DT(e,t))},unwrap(){return this.element}});function QD(e,t){return BT(ZD,e,t)}var $D=G(`ZodObject`,(e,t)=>{dD(),UC.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ME(e,t,n,r),nx(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return uO(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(db(this._zod.def,{catchall:e}))},passthrough(){return this.clone(db(this._zod.def,{catchall:JD()}))},loose(){return this.clone(db(this._zod.def,{catchall:JD()}))},strict(){return this.clone(db(this._zod.def,{catchall:XD()}))},strip(){return this.clone(db(this._zod.def,{catchall:void 0}))},extend(e){return kb(this,e)},safeExtend(e){return jb(this,e)},merge(e){return Mb(this,e)},pick(e){return Eb(this,e)},omit(e){return Ob(this,e)},partial(...e){return Nb(hO,this,e[0])},exactPartial(...e){return Nb(_O,this,e[0],`exactPartial`)},required(...e){return Pb(TO,this,e[0])}});function eO(e,t){return new $D({type:`object`,shape:e??{},...W(t)})}var tO=G(`ZodUnion`,(e,t)=>{GC.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>NE(e,t,n,r),e.options=t.options});function nO(e,t){return new tO({type:`union`,options:e,...W(t)})}var rO=G(`ZodDiscriminatedUnion`,(e,t)=>{tO.init(e,t),qC.init(e,t)});function iO(e,t,n){return new rO({type:`union`,options:t,discriminator:e,...W(n)})}var aO=G(`ZodIntersection`,(e,t)=>{JC.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>PE(e,t,n,r)});function oO(e,t){return new aO({type:`intersection`,left:e,right:t})}var sO=G(`ZodRecord`,(e,t)=>{dD(),ZC.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>RE(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function cO(e,t,n){return new sO({type:`record`,keyType:e,valueType:t,...W(n),partial:!0})}var lO=G(`ZodEnum`,(e,t)=>{QC.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>EE(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new lO({...t,checks:[],...W(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new lO({...t,checks:[],...W(r),entries:i})}});function uO(e,t){return new lO({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...W(t)})}var dO=G(`ZodLiteral`,(e,t)=>{$C.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>DE(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function fO(e,t){return new dO({type:`literal`,values:Array.isArray(e)?e:[e],...W(t)})}var pO=G(`ZodTransform`,(e,t)=>{dD(),ew.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kE(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ux(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Gb(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Gb(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function mO(e){return new pO({type:`transform`,transform:e})}var hO=G(`ZodOptional`,(e,t)=>{nw.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>JE(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function gO(e){return new hO({type:`optional`,innerType:e})}var _O=G(`ZodExactOptional`,(e,t)=>{rw.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>JE(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vO(e){return new _O({type:`optional`,innerType:e})}var yO=G(`ZodNullable`,(e,t)=>{iw.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zE(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bO(e){return new yO({type:`nullable`,innerType:e})}var xO=G(`ZodDefault`,(e,t)=>{aw.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>UE(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function SO(e,t){return new xO({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():vb(t)}})}var CO=G(`ZodPrefault`,(e,t)=>{sw.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>WE(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wO(e,t){return new CO({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():vb(t)}})}var TO=G(`ZodNonOptional`,(e,t)=>{cw.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>BE(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function EO(e,t){return new TO({type:`nonoptional`,innerType:e,...W(t)})}var DO=G(`ZodCatch`,(e,t)=>{dw.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>GE(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function OO(e,t){return new DO({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:ix(t)})}var kO=G(`ZodPipe`,(e,t)=>{fw.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>KE(e,t,n,r),e.in=t.in,e.out=t.out});function AO(e,t){return new kO({type:`pipe`,in:e,out:t})}var jO=G(`ZodReadonly`,(e,t)=>{mw.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qE(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function MO(e){return new jO({type:`readonly`,innerType:e})}var NO=G(`ZodCustom`,(e,t)=>{gw.init(e,t),fD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>OE(e,t,n,r)});function PO(e,t={}){return VT(NO,e,t)}function FO(e,t){return HT(e,t)}var IO=Yy(),LO=uO([`c`,`cpp`,`go`,`haskell`,`java`,`javascript`,`javascriptreact`,`json`,`jsonc`,`lua`,`nix`,`ocaml`,`php`,`python`,`ruby`,`rust`,`shellscript`,`swift`,`terraform`,`toml`,`typescript`,`typescriptreact`,`yaml`,`zig`]),RO=uO([`old`,`new`]),zO=iO(`kind`,[eO({kind:fO(`working`)}),eO({kind:fO(`pr`),pr:K().optional()}),eO({kind:fO(`revspec`),args:K().array()})]),BO=eO({old:K(),new:K(),mergeBase:WD(),live:uO([`worktree`,`refs`,`none`]),commentKey:K()});function VO(e){let t=e=>e.replace(/^refs\/diffle\/[^/]+\/\d+\/(?:base|head)\//,``).replace(/^refs\/(?:heads|remotes)\//,``);return`${t(e.old)}${e.mergeBase?`...`:`..`}${t(e.new)}`}var HO=eO({repository:K(),number:BD(),url:K(),title:K(),state:uO([`OPEN`,`CLOSED`,`MERGED`]),isDraft:WD()}),UO=eO({version:BD(),repository:K().nullable(),pullRequest:HO.nullable(),reason:K().nullable()}),WO=uO([`A`,`M`,`D`,`R`,`C`,`T`,`U`]),GO=eO({path:K(),oldPath:K().optional(),status:WO,additions:BD(),deletions:BD(),binary:WD(),blob:K(),generated:WD(),submodule:fO(!0).optional()}),KO=eO({root:K(),mode:BO,version:BD(),oldSha:K(),newSha:K(),headSha:K(),context:BD(),changed:GO.array(),tree:K().array()}),qO=eO({paths:K().array().max(200)}),JO=eO({path:K(),contents:K(),binary:WD()}),YO=iO(`kind`,[eO({kind:fO(`line`),path:K(),side:RO,startLine:BD(),endLine:BD(),quoted:K()}),eO({kind:fO(`file`),path:K()})]),XO=eO({id:K(),body:K(),createdAt:BD(),updatedAt:BD()}),ZO=eO({id:K(),anchor:YO,messages:XO.array().min(1),resolved:WD(),resolvedAt:BD().optional(),stale:WD(),staleFromLine:BD().optional()}),QO=eO({path:K().min(1),side:RO.optional(),startLine:BD().int().positive().optional(),endLine:BD().int().positive().optional(),body:K().refine(e=>e.trim().length>0,`body required`),quoted:K().optional()}).refine(e=>e.startLine==null||e.endLine==null||e.endLine>=e.startLine,{path:[`endLine`],message:`endLine must be ≥ startLine`}).refine(e=>e.startLine!=null||e.side==null&&e.endLine==null&&e.quoted==null,{path:[`startLine`],message:`side, endLine and quoted need a startLine; leave all four out for a comment on the whole file`}),$O=eO({body:K().refine(e=>e.trim().length>0,`body required`)}),ek=uO([`open`,`resolved`,`all`]),tk=eO({threadIds:K().array().optional()}),nk=eO({url:K(),posted:BD(),updated:BD(),review:uO([`created`,`existing`]),skipped:eO({id:K(),reason:K()}).array()});eO({state:ek.optional(),path:K().optional()});var rk=eO({body:K()}),ik=eO({path:K(),blob:K(),viewed:WD()}),ak=eO({sha:K(),short:K(),message:K()}),ok=eO({old:ak.nullable(),new:ak.nullable()}),sk=eO({defaultBranch:K().nullable(),current:K().nullable(),branches:K().array(),remoteBranches:K().array(),tags:K().array(),recent:eO({sha:K(),short:K(),subject:K()}).array()}),ck=eO({path:K(),line:BD(),text:K()}),lk=uO([`file`,`diff`,`repo`]),uk=uO([`diff`,`full`]),dk=eO({query:K(),matches:ck.array(),truncated:WD()}),fk=eO({autoViewed:K().array(),contextLines:BD(),lspCommands:cO(LO,K())}),pk={autoViewed:[],contextLines:5,lspCommands:{}},mk=eO({path:K().min(1),line:BD().int().positive(),col:BD().int().nonnegative()}),hk=mk.extend({text:K(),external:fO(!0).optional()}),gk=eO({name:K(),command:K(),state:uO([`starting`,`ready`,`unavailable`]),message:K().optional(),activity:K().array().optional(),notice:eO({severity:uO([`warning`,`error`]),message:K()}).optional(),stderr:K().optional()}).extend({languages:LO.array()}),_k=eO({language:LO,tried:K().array()}),vk=eO({enabled:WD(),servers:gk.array(),missing:_k.array()}),yk=eO({locations:hk.array()}),bk=eO({contents:K().nullable(),range:eO({line:BD(),col:BD(),endLine:BD(),endCol:BD()}).optional()}),xk=eO({kind:K().nullable()}),Sk=eO({name:K(),kind:BD(),container:K().optional(),path:K(),line:BD(),endLine:BD(),col:BD()});uO([`unviewed`,`viewed`,`restale`]);var Ck=iO(`type`,[eO({type:fO(`snapshot`),version:BD()}),eO({type:fO(`threads`)}),eO({type:fO(`viewed`)}),eO({type:fO(`config`)}),eO({type:fO(`lsp`),payload:vk})]);function wk(e){return e.newSha===`worktree`||e.headSha!==``&&e.newSha===e.headSha}var Tk={bash:`shellscript`,c:`c`,cc:`cpp`,cjs:`javascript`,cpp:`cpp`,cts:`typescript`,cxx:`cpp`,go:`go`,h:`c`,hh:`cpp`,hpp:`cpp`,hs:`haskell`,hxx:`cpp`,java:`java`,js:`javascript`,jsx:`javascriptreact`,json:`json`,jsonc:`jsonc`,lua:`lua`,mjs:`javascript`,ml:`ocaml`,mli:`ocaml`,mts:`typescript`,nix:`nix`,php:`php`,py:`python`,pyi:`python`,rb:`ruby`,rs:`rust`,sh:`shellscript`,swift:`swift`,tf:`terraform`,tfvars:`terraform`,toml:`toml`,ts:`typescript`,tsx:`typescriptreact`,yaml:`yaml`,yml:`yaml`,zig:`zig`};[...new Set(Object.values(Tk))].sort();function Ek(e){let t=/\.([^./\\]+)$/.exec(e)?.[1]?.toLowerCase();return t&&Tk[t]||null}function Dk(e,t){if(!e.enabled)return`Language servers are off for this run (--no-lsp)`;if(t==null)return e.servers.length?e.servers.some(e=>e.state===`ready`)?null:Ok(e.servers[0]):kk(e);let n=Ek(t);if(!n)return`No language server for ${/(\.[^./\\]+)$/.exec(t)?.[1]??`these`} files`;let r=e.servers.find(e=>e.languages.includes(n));return r?r.state===`ready`?null:Ok(r):kk(e,n)}function Ok(e){return e.state===`starting`?`${e.name} is starting…`:`${e.name} is unavailable: ${e.message??`unknown error`}`}function kk(e,t){let n=t==null?e.missing:e.missing.filter(e=>e.language===t),r=n.filter(e=>e.tried.length>0),i=n.filter(e=>e.tried.length===0).map(e=>e.language);return r.length?`No language server for ${[...new Set(r.map(e=>e.language))].join(`, `)} on PATH: install one of ${[...new Set(r.flatMap(e=>e.tried))].join(`, `)}`:i.length?`The language server for ${i.join(`, `)} is off in your diffle config`:t==null?`No language server runs for this diff`:`No language server runs for ${t}`}var Ak=eO({autoViewed:K().array().optional(),contextLines:BD().int().min(0).max(1e4).optional()}),jk=eO({resolved:WD()}),Mk=eO({entries:ik.array()});eO({path:K().min(1),rev:RO});var Nk=K().regex(/^[0-9]+$/).transform(Number).pipe(BD().int().nonnegative());eO({oldOffset:Nk,newOffset:Nk});var Pk=uO([`0`,`1`]).optional().transform(e=>e===`1`);eO({q:K().default(``),scope:lk.default(`diff`),content:uk.default(`diff`),path:K().optional(),word:Pk,i:Pk,re:Pk}),eO({path:K().min(1).optional(),q:K().optional()}).refine(e=>e.path!=null||e.q!=null,`path or q required`),eO({stale:fO(`1`).optional()}),eO({path:K().optional()});var Fk=eO({error:K()});function Ik(e,t){return JSON.stringify(e.parse(t))}async function Lk(e,t,n){let r=await fetch(new URL(t,location.href).href,{...n,headers:{"content-type":`application/json`,...n?.headers}});if(!r.ok)throw new Bk(r.status,await zk(r));return e.parse(r.status===204?void 0:await r.json())}async function Rk(e,t){let n=await fetch(new URL(e,location.href).href,t);if(!n.ok)throw new Bk(n.status,await zk(n));return n.text()}async function zk(e){try{let t=Fk.safeParse(await e.json());return t.success?t.data.error:e.statusText}catch{return e.statusText}}var Bk=class extends Error{status;constructor(e,t){super(t),this.status=e}},Vk=e=>new URLSearchParams(Object.entries(e).filter(e=>e[1]!=null)).toString(),Hk={github:()=>Lk(UO,`api/github`),snapshot:()=>Lk(KO,`api/snapshot`),switchMode:e=>Lk(KO,`api/mode`,{method:`POST`,body:Ik(zO,e)}),refs:()=>Lk(sk,`api/refs`),lastCommitsPreview:(e,t,n)=>Lk(ok,`api/last-commits-preview?${Vk({oldOffset:String(e),newOffset:String(t)})}`,{signal:n}),patch:e=>Rk(`api/patch?${Vk({path:e})}`),patches:e=>Rk(`api/patch`,{method:`POST`,headers:{"content-type":`application/json`},body:Ik(qO,{paths:e})}),file:(e,t,n)=>Lk(JO,`api/file?${Vk({path:e,rev:t})}`,{signal:n}),search:(e,t={})=>Lk(dk,`api/search?${Vk({q:e,word:t.word?`1`:void 0,i:t.ignoreCase?`1`:void 0,re:t.regex?`1`:void 0,scope:t.scope,content:t.content,path:t.path})}`),threads:(e={})=>Lk(ZO.array(),`api/threads?${Vk({state:e.state,path:e.path})}`),exportComments:()=>Rk(`api/threads/export?${Vk({state:`open`})}`),exportComment:(e,t)=>Rk(`api/threads/${encodeURIComponent(e)}/messages/${encodeURIComponent(t)}/export`),exportToGithub:e=>Lk(nk,`api/github/export`,{method:`POST`,body:Ik(tk,e)}),addThread:e=>Lk(ZO.array(),`api/threads`,{method:`POST`,body:Ik(QO,e)}),reply:(e,t)=>Lk(ZO,`api/threads/${encodeURIComponent(e)}/replies`,{method:`POST`,body:Ik($O,t)}),editMessage:(e,t,n)=>Lk(ZO,`api/threads/${encodeURIComponent(e)}/messages/${encodeURIComponent(t)}`,{method:`PATCH`,body:Ik(rk,{body:n})}),deleteMessage:(e,t)=>Lk(ZO.or(KD()),`api/threads/${encodeURIComponent(e)}/messages/${encodeURIComponent(t)}`,{method:`DELETE`}),setResolved:(e,t)=>Lk(ZO,`api/threads/${encodeURIComponent(e)}/resolved`,{method:`PUT`,body:Ik(jk,{resolved:t})}),deleteThread:e=>Lk(KD(),`api/threads/${encodeURIComponent(e)}`,{method:`DELETE`}),clearThreads:()=>Lk(KD(),`api/threads`,{method:`DELETE`}),deleteStaleThreads:()=>Lk(KD(),`api/threads?stale=1`,{method:`DELETE`}),viewed:()=>Lk(ik.array(),`api/viewed`),setViewedBulk:e=>Lk(ik.array(),`api/viewed/bulk`,{method:`PUT`,body:Ik(Mk,{entries:e})}),setViewed:(e,t,n)=>Lk(ik.array(),`api/viewed`,{method:`PUT`,body:Ik(ik,{path:e,blob:t,viewed:n})}),lspStatus:()=>Lk(vk,`api/lsp/status`),lspDefinition:e=>Lk(yk,`api/lsp/definition`,{method:`POST`,body:Ik(mk,e)}),lspTypeDefinition:e=>Lk(yk,`api/lsp/type-definition`,{method:`POST`,body:Ik(mk,e)}),lspHover:e=>Lk(bk,`api/lsp/hover`,{method:`POST`,body:Ik(mk,e)}),lspTokenKind:e=>Lk(xk,`api/lsp/token-kind`,{method:`POST`,body:Ik(mk,e)}),lspReferences:e=>Lk(yk,`api/lsp/references`,{method:`POST`,body:Ik(mk,e)}),lspSymbols:e=>Lk(Sk.array(),`api/lsp/symbols?${Vk(e)}`),config:()=>Lk(fk,`api/config`),saveConfig:e=>Lk(fk,`api/config`,{method:`PUT`,body:Ik(Ak,e)})};function Uk(e,t){let n=null,r=!1,i=500,a=()=>{if(r)return;let o=new URL(`ws`,location.href);o.protocol=o.protocol===`https:`?`wss:`:`ws:`,n=new WebSocket(o.href),n.onopen=()=>{i=500,t()},n.onmessage=t=>{try{e(Ck.parse(JSON.parse(String(t.data))))}catch{}},n.onclose=()=>{r||(setTimeout(a,i),i=Math.min(i*2,1e4))}};return a(),()=>{r=!0,n?.close()}}var Wk=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Gk=(e,t)=>({classGroupId:e,validator:t}),Kk=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),qk=`-`,Jk=[],Yk=`arbitrary..`,Xk=e=>{let t=$k(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Qk(e);let n=e.split(qk);return Zk(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Wk(i,t):t:i||Jk}return n[e]||Jk}}},Zk=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Zk(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(qk):e.slice(t).join(qk),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Qk=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Yk+r:void 0})(),$k=e=>{let{theme:t,classGroups:n}=e;return eA(n,t)},eA=(e,t)=>{let n=Kk();for(let r in e){let i=e[r];tA(i,n,r,t)}return n},tA=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];nA(i,t,n,r)}},nA=(e,t,n,r)=>{if(typeof e==`string`){rA(e,t,n);return}if(typeof e==`function`){iA(e,t,n,r);return}aA(e,t,n,r)},rA=(e,t,n)=>{let r=e===``?t:oA(t,e);r.classGroupId=n},iA=(e,t,n,r)=>{if(sA(e)){tA(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Gk(n,e))},aA=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];tA(o,oA(t,a),n,r)}},oA=(e,t)=>{let n=e,r=t.split(qk),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Kk(),n.nextPart.set(t,i)),n=i}return n},sA=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,cA=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},lA=`!`,uA=`:`,dA=[],fA=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),pA=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===uA){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(lA)?(c=s.slice(0,-1),l=!0):s.startsWith(lA)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return fA(t,l,c,u)};if(t){let e=t+uA,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):fA(dA,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},mA=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},hA=e=>({cache:cA(e.cacheSize),parseClassName:pA(e),sortModifiers:mA(e),postfixLookupClassGroupIds:gA(e),...Xk(e)}),gA=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},_A=/\s+/,vA=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(_A),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+lA:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},yA=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=bA(n))&&(i&&(i+=` `),i+=r);return i},bA=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=bA(e[r]))&&(n&&(n+=` `),n+=t);return n},xA=(e,...t)=>{let n,r,i,a,o=o=>(n=hA(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=vA(e,n);return i(e,a),a};return a=o,(...e)=>a(yA(...e))},SA=[],CA=e=>{let t=t=>t[e]||SA;return t.isThemeGetter=!0,t},wA=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,TA=/^\((?:(\w[\w-]*):)?(.+)\)$/i,EA=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,DA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,OA=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,kA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,AA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,MA=e=>EA.test(e),NA=e=>!!e&&!Number.isNaN(Number(e)),PA=e=>!!e&&Number.isInteger(Number(e)),FA=e=>e.endsWith(`%`)&&NA(e.slice(0,-1)),IA=e=>DA.test(e),LA=()=>!0,RA=e=>OA.test(e)&&!kA.test(e),zA=()=>!1,BA=e=>AA.test(e),VA=e=>jA.test(e),HA=e=>!q(e)&&!J(e),UA=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),WA=e=>aj(e,lj,zA),q=e=>wA.test(e),GA=e=>aj(e,uj,RA),KA=e=>aj(e,dj,NA),qA=e=>aj(e,pj,LA),JA=e=>aj(e,fj,zA),YA=e=>aj(e,sj,zA),XA=e=>aj(e,cj,VA),ZA=e=>aj(e,mj,BA),J=e=>TA.test(e),QA=e=>oj(e,uj),$A=e=>oj(e,fj),ej=e=>oj(e,sj),tj=e=>oj(e,lj),nj=e=>oj(e,cj),rj=e=>oj(e,mj,!0),ij=e=>oj(e,pj,!0),aj=(e,t,n)=>{let r=wA.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},oj=(e,t,n=!1)=>{let r=TA.exec(e);return r?r[1]?t(r[1]):n:!1},sj=e=>e===`position`||e===`percentage`,cj=e=>e===`image`||e===`url`,lj=e=>e===`length`||e===`size`||e===`bg-size`,uj=e=>e===`length`,dj=e=>e===`number`,fj=e=>e===`family-name`,pj=e=>e===`number`||e===`weight`,mj=e=>e===`shadow`,hj=xA(()=>{let e=CA(`color`),t=CA(`font`),n=CA(`text`),r=CA(`font-weight`),i=CA(`tracking`),a=CA(`leading`),o=CA(`breakpoint`),s=CA(`container`),c=CA(`spacing`),l=CA(`radius`),u=CA(`shadow`),d=CA(`inset-shadow`),f=CA(`text-shadow`),p=CA(`drop-shadow`),m=CA(`blur`),h=CA(`perspective`),g=CA(`aspect`),_=CA(`ease`),v=CA(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),J,q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[J,q,c],T=()=>[MA,`full`,`auto`,...w()],E=()=>[PA,`none`,`subgrid`,J,q],D=()=>[`auto`,{span:[`full`,PA,J,q]},PA,J,q],O=()=>[PA,`auto`,J,q],k=()=>[`auto`,`min`,`max`,`fr`,J,q],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[MA,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[MA,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[MA,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,J,q],L=()=>[...b(),ej,YA,{position:[J,q]}],ee=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],te=()=>[`auto`,`cover`,`contain`,tj,WA,{size:[J,q]}],ne=()=>[FA,QA,GA],R=()=>[``,`none`,`full`,l,J,q],z=()=>[``,NA,QA,GA],B=()=>[`solid`,`dashed`,`dotted`,`double`],re=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ie=()=>[NA,FA,ej,YA],ae=()=>[``,`none`,m,J,q],oe=()=>[`none`,NA,J,q],se=()=>[`none`,NA,J,q],ce=()=>[NA,J,q],le=()=>[MA,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[IA],breakpoint:[IA],color:[LA],container:[IA],"drop-shadow":[IA],ease:[`in`,`out`,`in-out`],font:[HA],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[IA],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[IA],shadow:[IA],spacing:[`px`,NA],text:[IA],"text-shadow":[IA],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,MA,q,J,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,J,q]}],"container-named":[UA],columns:[{columns:[NA,q,J,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[PA,`auto`,J,q]}],basis:[{basis:[MA,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[NA,MA,`auto`,`initial`,`none`,q]}],grow:[{grow:[``,NA,J,q]}],shrink:[{shrink:[``,NA,J,q]}],order:[{order:[PA,`first`,`last`,`none`,J,q]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,QA,GA]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,ij,qA]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,FA,q]}],"font-family":[{font:[$A,JA,t]}],"font-features":[{"font-features":[q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,J,q]}],"line-clamp":[{"line-clamp":[NA,`none`,J,KA]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,J,q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,J,q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...B(),`wavy`]}],"text-decoration-thickness":[{decoration:[NA,`from-font`,`auto`,J,GA]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[NA,`auto`,J,q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[PA,J,q]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,J,q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,J,q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:te()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},PA,J,q],radial:[``,J,q],conic:[PA,J,q]},nj,XA]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:R()}],"rounded-s":[{"rounded-s":R()}],"rounded-e":[{"rounded-e":R()}],"rounded-t":[{"rounded-t":R()}],"rounded-r":[{"rounded-r":R()}],"rounded-b":[{"rounded-b":R()}],"rounded-l":[{"rounded-l":R()}],"rounded-ss":[{"rounded-ss":R()}],"rounded-se":[{"rounded-se":R()}],"rounded-ee":[{"rounded-ee":R()}],"rounded-es":[{"rounded-es":R()}],"rounded-tl":[{"rounded-tl":R()}],"rounded-tr":[{"rounded-tr":R()}],"rounded-br":[{"rounded-br":R()}],"rounded-bl":[{"rounded-bl":R()}],"border-w":[{border:z()}],"border-w-x":[{"border-x":z()}],"border-w-y":[{"border-y":z()}],"border-w-s":[{"border-s":z()}],"border-w-e":[{"border-e":z()}],"border-w-bs":[{"border-bs":z()}],"border-w-be":[{"border-be":z()}],"border-w-t":[{"border-t":z()}],"border-w-r":[{"border-r":z()}],"border-w-b":[{"border-b":z()}],"border-w-l":[{"border-l":z()}],"divide-x":[{"divide-x":z()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":z()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...B(),`hidden`,`none`]}],"divide-style":[{divide:[...B(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...B(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[NA,J,q]}],"outline-w":[{outline:[``,NA,QA,GA]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,rj,ZA]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,rj,ZA]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:z()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[NA,GA]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":z()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,rj,ZA]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[NA,J,q]}],"mix-blend":[{"mix-blend":[...re(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":re()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[NA]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[J,q]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[NA]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,J,q]}],filter:[{filter:[``,`none`,J,q]}],blur:[{blur:ae()}],brightness:[{brightness:[NA,J,q]}],contrast:[{contrast:[NA,J,q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,rj,ZA]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,NA,J,q]}],"hue-rotate":[{"hue-rotate":[NA,J,q]}],invert:[{invert:[``,NA,J,q]}],saturate:[{saturate:[NA,J,q]}],sepia:[{sepia:[``,NA,J,q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,J,q]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[NA,J,q]}],"backdrop-contrast":[{"backdrop-contrast":[NA,J,q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,NA,J,q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[NA,J,q]}],"backdrop-invert":[{"backdrop-invert":[``,NA,J,q]}],"backdrop-opacity":[{"backdrop-opacity":[NA,J,q]}],"backdrop-saturate":[{"backdrop-saturate":[NA,J,q]}],"backdrop-sepia":[{"backdrop-sepia":[``,NA,J,q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,J,q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[NA,`initial`,J,q]}],ease:[{ease:[`linear`,`initial`,_,J,q]}],delay:[{delay:[NA,J,q]}],animate:[{animate:[`none`,v,J,q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,J,q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:oe()}],"rotate-x":[{"rotate-x":oe()}],"rotate-y":[{"rotate-y":oe()}],"rotate-z":[{"rotate-z":oe()}],scale:[{scale:se()}],"scale-x":[{"scale-x":se()}],"scale-y":[{"scale-y":se()}],"scale-z":[{"scale-z":se()}],"scale-3d":[`scale-3d`],skew:[{skew:ce()}],"skew-x":[{"skew-x":ce()}],"skew-y":[{"skew-y":ce()}],transform:[{transform:[J,q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":[`translate-none`],zoom:[{zoom:[PA,J,q]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,J,q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,J,q]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[NA,QA,GA,KA]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function gj({label:e,onClose:t,className:n,children:r}){return(0,g.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/35`,onMouseDown:e=>e.target===e.currentTarget&&t(),children:(0,g.jsx)(`div`,{role:`dialog`,"aria-label":e,className:hj(`w-140 max-w-[95vw] rounded-[0.625rem] border border-border bg-canvas p-4 shadow-[0_1rem_3rem_rgba(0,0,0,0.3)]`,n),children:r})})}var _j=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),vj=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),yj=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),bj=e=>{let t=yj(e);return t.charAt(0).toUpperCase()+t.slice(1)},xj={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Sj=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Cj=(0,p.createContext)({}),wj=()=>(0,p.useContext)(Cj),Tj=(0,p.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:m=``}=wj()??{},h=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,p.createElement)(`svg`,{ref:c,...xj,width:t??l??xj.width,height:t??l??xj.height,stroke:e??f,strokeWidth:h,className:_j(`lucide`,m,i),...!a&&!Sj(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,p.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),Ej=(e,t)=>{let n=(0,p.forwardRef)(({className:n,...r},i)=>(0,p.createElement)(Tj,{ref:i,iconNode:t,className:_j(`lucide-${vj(bj(e))}`,`lucide-${e}`,n),...r}));return n.displayName=bj(e),n},Dj=Ej(`arrow-left-right`,[[`path`,{d:`M8 3 4 7l4 4`,key:`9rb6wj`}],[`path`,{d:`M4 7h16`,key:`6tx8e3`}],[`path`,{d:`m16 21 4-4-4-4`,key:`siv7j2`}],[`path`,{d:`M20 17H4`,key:`h6l3hr`}]]),Oj=Ej(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),kj=Ej(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Aj=Ej(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),jj=Ej(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Mj=Ej(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Nj=Ej(`chevrons-down-up`,[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]),Pj=Ej(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),Fj=Ej(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Ij=Ej(`clipboard-copy`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2`,key:`4jdomd`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v4`,key:`3hqy98`}],[`path`,{d:`M21 14H11`,key:`1bme5i`}],[`path`,{d:`m15 10-4 4 4 4`,key:`5dvupr`}]]),Lj=Ej(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),Rj=Ej(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),zj=Ej(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Bj=Ej(`crosshair`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`22`,x2:`18`,y1:`12`,y2:`12`,key:`l9bcsi`}],[`line`,{x1:`6`,x2:`2`,y1:`12`,y2:`12`,key:`13hhkx`}],[`line`,{x1:`12`,x2:`12`,y1:`6`,y2:`2`,key:`10w3f3`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`18`,key:`15g9kq`}]]),Vj=Ej(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Hj=Ej(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Uj=Ej(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Wj=Ej(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Gj=Ej(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),Kj=Ej(`file-diff`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]),qj=Ej(`file-exclamation-point`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Jj=Ej(`file-search`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`11.5`,cy:`14.5`,r:`2.5`,key:`1bq0ko`}],[`path`,{d:`M13.3 16.3 15 18`,key:`2quom7`}]]),Yj=Ej(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Xj=Ej(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),Zj=Ej(`git-compare-arrows`,[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`M12 18H7a2 2 0 0 1-2-2V9`,key:`16sdep`}],[`path`,{d:`m9 15 3 3-3 3`,key:`1m3kbl`}]]),Qj=Ej(`git-pull-request-arrow`,[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M5 9v12`,key:`ih889a`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}]]),$j=Ej(`git-pull-request`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]),eM=Ej(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),tM=Ej(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),nM=Ej(`keyboard`,[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]),rM=Ej(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),iM=Ej(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),aM=Ej(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),oM=Ej(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),sM=Ej(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),cM=Ej(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),lM=Ej(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),uM=Ej(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),dM=Ej(`pencil-ruler`,[[`path`,{d:`M13 7 8.7 2.7a2.41 2.41 0 0 0-3.4 0L2.7 5.3a2.41 2.41 0 0 0 0 3.4L7 13`,key:`orapub`}],[`path`,{d:`m8 6 2-2`,key:`115y1s`}],[`path`,{d:`m18 16 2-2`,key:`ee94s4`}],[`path`,{d:`m17 11 4.3 4.3c.94.94.94 2.46 0 3.4l-2.6 2.6c-.94.94-2.46.94-3.4 0L11 17`,key:`cfq27r`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),fM=Ej(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),pM=Ej(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),mM=Ej(`reply`,[[`path`,{d:`M20 18v-2a4 4 0 0 0-4-4H4`,key:`5vmcpk`}],[`path`,{d:`m9 17-5-5 5-5`,key:`nvlc11`}]]),hM=Ej(`rotate-ccw-clock`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),gM=Ej(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),_M=Ej(`rows-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]),vM=Ej(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),yM=Ej(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),bM=Ej(`shapes`,[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]),xM=Ej(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),SM=Ej(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),CM=Ej(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),wM=Ej(`whole-word`,[[`circle`,{cx:`7`,cy:`12`,r:`3`,key:`12clwm`}],[`path`,{d:`M10 9v6`,key:`17i7lo`}],[`circle`,{cx:`17`,cy:`12`,r:`3`,key:`gl7c2s`}],[`path`,{d:`M14 7v8`,key:`dl84cr`}],[`path`,{d:`M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1`,key:`lt2kga`}]]),TM=Ej(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function EM({done:e,children:t,size:n=`0.875rem`}){let r=`absolute inset-0 inline-flex items-center justify-center [transition:opacity_160ms_ease,transform_200ms_cubic-bezier(0.2,0.8,0.2,1)]`;return(0,g.jsxs)(`span`,{className:`relative inline-block size-3.5`,"aria-hidden":`true`,children:[(0,g.jsx)(`span`,{className:hj(r,e&&`[transform:scale(0.4)] opacity-0`),children:t}),(0,g.jsx)(`span`,{className:hj(r,e?`[transform:scale(1)_rotate(0)] opacity-100`:`[transform:scale(0.4)_rotate(-30deg)] opacity-0`),children:(0,g.jsx)(kj,{size:n})})]})}function Y({variant:e=`default`,danger:t,icon:n,feedback:r,className:i,...a}){return(0,g.jsx)(`button`,{...a,"data-feedback":r,className:hj(`inline-flex cursor-pointer items-center gap-1.25 rounded-md border border-border bg-surface px-2.25 py-0.75 leading-[1.2] hover:bg-hover disabled:cursor-default disabled:opacity-50 [&_svg]:flex-none`,e===`primary`&&`border-transparent bg-accent text-accent-fg hover:bg-accent`,e===`ghost`&&`border-transparent bg-transparent hover:bg-hover`,t&&`text-danger`,n&&`px-1.25`,r===`confirm`&&(t?`border-transparent bg-danger text-white hover:bg-danger`:`border-transparent bg-accent text-accent-fg hover:bg-accent`),r===`posted`&&`border-transparent bg-add text-canvas hover:bg-add`,r===`copied`&&`border-transparent bg-add text-white hover:bg-add`,i)})}async function DM(e){if(navigator.clipboard&&window.isSecureContext)try{return await navigator.clipboard.writeText(e),!0}catch{}let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.top=`0`,t.style.left=`0`,t.style.opacity=`0`,document.body.appendChild(t),t.focus(),t.select(),t.setSelectionRange(0,e.length);let n=!1;try{n=document.execCommand(`copy`)}catch{n=!1}return document.body.removeChild(t),n}var OM=o(((e,t)=>{var n=`\\\\/`,r=`[^${n}]`,i=0,a=`\\.`,o=`\\+`,s=`\\?`,c=`\\/`,l=`(?=.)`,u=`[^/]`,d=`(?:${c}|$)`,f=`(?:^|${c})`,p=`${a}{1,2}${d}`,m={DOT_LITERAL:a,PLUS_LITERAL:o,QMARK_LITERAL:s,SLASH_LITERAL:c,ONE_CHAR:l,QMARK:u,END_ANCHOR:d,DOTS_SLASH:p,NO_DOT:`(?!${a})`,NO_DOTS:`(?!${f}${p})`,NO_DOT_SLASH:`(?!${a}{0,1}${d})`,NO_DOTS_SLASH:`(?!${p})`,QMARK_NO_DOT:`[^.${c}]`,STAR:`${u}*?`,START_ANCHOR:f,SEP:`/`},h={...m,SLASH_LITERAL:`[${n}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${a}{1,2}(?:[${n}]|$)`,NO_DOT:`(?!${a})`,NO_DOTS:`(?!(?:^|[${n}])${a}{1,2}(?:[${n}]|$))`,NO_DOT_SLASH:`(?!${a}{0,1}(?:[${n}]|$))`,NO_DOTS_SLASH:`(?!${a}{1,2}(?:[${n}]|$))`,QMARK_NO_DOT:`[^.${n}]`,START_ANCHOR:`(?:^|[${n}])`,END_ANCHOR:`(?:[${n}]|$)`,SEP:`\\`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:i,MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?h:m}}})),kM=o((e=>{var{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=OM();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),AM=o(((e,t)=>{var n=kM(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:_}=OM(),v=e=>e===l||e===a,y=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let b=t||{},x=e.length-1,S=b.parts===!0||b.tokens===!0||b.scanToEnd===!0,C=[],w=[],T=[],E=e,D=-1,O=0,k=0,A=!1,j=!1,M=!1,N=!1,P=!1,F=!1,I=!1,L=!1,ee=!1,te=!1,ne=0,R,z,B={value:``,depth:0,isGlob:!1},re=()=>D>=x,ie=()=>E.charCodeAt(D+1),ae=()=>(R=z,E.charCodeAt(++D));for(;D<x;){z=ae();let e;if(z===a){I=B.backslashes=!0,z=ae(),z===u&&(F=!0);continue}if(F===!0||z===u){for(ne++;re()!==!0&&(z=ae());){if(z===a){I=B.backslashes=!0,ae();continue}if(z===u){ne++;continue}if(F!==!0&&z===s&&(z=ae())===s){if(A=B.isBrace=!0,M=B.isGlob=!0,te=!0,S===!0)continue;break}if(F!==!0&&z===o){if(A=B.isBrace=!0,M=B.isGlob=!0,te=!0,S===!0)continue;break}if(z===h&&(ne--,ne===0)){F=!1,A=B.isBrace=!0,te=!0;break}}if(S===!0)continue;break}if(z===l){if(C.push(D),w.push(B),B={value:``,depth:0,isGlob:!1},te===!0)continue;if(R===s&&D===O+1){O+=2;continue}k=D+1;continue}if(b.noext!==!0&&(z===p||z===i||z===r||z===m||z===c)&&ie()===d){if(M=B.isGlob=!0,N=B.isExtglob=!0,te=!0,z===c&&D===O&&(ee=!0),S===!0){let e=0;for(;re()!==!0&&(z=ae());){if(z===a){I=B.backslashes=!0,ae();continue}if(z===d){e++;continue}if(z===g&&--e===0){te=!0;break}}continue}break}if(z===r){if(R===r&&(P=B.isGlobstar=!0),M=B.isGlob=!0,te=!0,S===!0)continue;break}if(z===m){if(M=B.isGlob=!0,te=!0,S===!0)continue;break}if(z===f){for(;re()!==!0&&(e=ae());){if(e===a){I=B.backslashes=!0,ae();continue}if(e===_){j=B.isBracket=!0,M=B.isGlob=!0,te=!0;break}}if(S===!0)continue;break}if(b.nonegate!==!0&&z===c&&D===O){L=B.negated=!0,O++;continue}if(b.noparen!==!0&&z===d){if(M=B.isGlob=!0,S===!0){let e=1;for(;re()!==!0&&(z=ae());){if(z===a){I=B.backslashes=!0,ae();continue}if(z===d){e++;continue}if(z===g&&--e===0){te=!0;break}}continue}break}if(M===!0){if(te=!0,S===!0)continue;break}}b.noext===!0&&(N=!1,M=!1);let oe=E,se=``,ce=``;O>0&&(se=E.slice(0,O),E=E.slice(O),k-=O),oe&&M===!0&&k>0?(oe=E.slice(0,k),ce=E.slice(k)):M===!0?(oe=``,ce=E):oe=E,oe&&oe!==``&&oe!==`/`&&oe!==E&&v(oe.charCodeAt(oe.length-1))&&(oe=oe.slice(0,-1)),b.unescape===!0&&(ce&&=n.removeBackslashes(ce),oe&&I===!0&&(oe=n.removeBackslashes(oe)));let le={prefix:se,input:e,start:O,base:oe,glob:ce,isBrace:A,isBracket:j,isGlob:M,isExtglob:N,isGlobstar:P,negated:L,negatedExtglob:ee};if(b.tokens===!0&&(le.maxDepth=0,v(z)||w.push(B),le.tokens=w),b.parts===!0||b.tokens===!0){let t;for(let n=0;n<C.length;n++){let r=t===void 0?O:t+1,i=C[n],a=e.slice(r,i);b.tokens&&(n===0&&O!==0?(w[n].isPrefix=!0,w[n].value=se):w[n].value=a,y(w[n]),le.maxDepth+=w[n].depth),i>=O&&(T.push(a),t=i)}let n=t===void 0?O:t+1,r=e.slice(n);T.push(r),b.tokens&&t&&t+1<e.length&&(w[w.length-1].value=r,y(w[w.length-1]),le.maxDepth+=w[w.length-1].depth),le.slashes=C,le.parts=T}return le}})),jM=o(((e,t)=>{var n=OM(),r=kM(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e){if(o===!0){a+=s,o=!1;continue}if(s===`\\`){a+=s,o=!0;continue}if(s===`"`){i=i===1?0:1,a+=s;continue}if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},f=e=>{let t=!1;for(let n of e){if(t===!0){t=!1;continue}if(n===`\\`){t=!0;continue}if(/[?*+@!()[\]{}]/.test(n))return!1}return!0},p=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(f(t))return t.replace(/\\(.)/g,`$1`)},m=e=>{let t=e.map(p).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(!(!a||r!==a.repeat(r.length)||i!==a.repeat(i.length))&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},h=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0){a=!1;continue}if(s===`\\`){a=!0;continue}if(s===`"`){i=i===1?0:1;continue}if(i!==1){if(s===`[`){n++;continue}if(s===`]`&&n>0){n--;continue}if(!(n>0)){if(s===`(`){r++;continue}if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},g=e=>`${e.length===1?r.escapeRegex(e[0]):`[${e.map(e=>r.escapeRegex(e)).join(``)}]`}*`,_=e=>{let t=0,n=[];for(;t<e.length;){let r=h(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=d(r.body).map(e=>e.trim());if(i.length!==1)return;let a=p(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return n},v=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},y=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=d(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||m(i)))return{risky:!0};let a=[],o=!1,s=!0;for(let e of i){let t=_(e);if(t){o=!0,a.push(...t);continue}let n=p(e);if(n&&n.length===1){a.push(n);continue}if(s=!1,v(e)>r)return{risky:!0}}return o?s?{risky:!0,safeOutput:g([...new Set(a)])}:{risky:!0}:{risky:!1}},b=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let d={...t},f=typeof d.maxLength==`number`?Math.min(i,d.maxLength):i,p=e.length;if(p>f)throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${f}`);let m={type:`bos`,value:``,output:d.prepend||``},h=[m],g=d.capture?``:`?:`,_=n.globChars(d.windows),v=n.extglobChars(_),{DOT_LITERAL:x,PLUS_LITERAL:S,SLASH_LITERAL:C,ONE_CHAR:w,DOTS_SLASH:T,NO_DOT:E,NO_DOT_SLASH:D,NO_DOTS_SLASH:O,QMARK:k,QMARK_NO_DOT:A,STAR:j,START_ANCHOR:M}=_,N=e=>`(${g}(?:(?!${M}${e.dot?T:x}).)*?)`,P=d.dot?``:E,F=d.dot?k:A,I=d.bash===!0?N(d):j;d.capture&&(I=`(${I})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let L={input:e,index:-1,start:0,dot:d.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};e=r.removePrefix(e,L),p=e.length;let ee=[],te=[],ne=[],R=m,z,B=()=>L.index===p-1,re=L.peek=(t=1)=>e[L.index+t],ie=L.advance=()=>e[++L.index]||``,ae=()=>e.slice(L.index+1),oe=(e=``,t=0)=>{L.consumed+=e,L.index+=t},se=e=>{L.output+=e.output==null?e.value:e.output,oe(e.value)},ce=()=>{let e=1;for(;re()===`!`&&(re(2)!==`(`||re(3)===`?`);)ie(),L.start++,e++;return e%2!=0&&(L.negated=!0,L.start++,!0)},le=e=>{L[e]++,ne.push(e)},ue=e=>{L[e]--,ne.pop()},V=e=>{if(R.type===`globstar`){let t=L.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||ee.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(L.output=L.output.slice(0,-R.output.length),R.type=`star`,R.value=`*`,R.output=I,L.output+=R.output)}if(ee.length&&e.type!==`paren`&&(ee[ee.length-1].inner+=e.value),(e.value||e.output)&&se(e),R&&R.type===`text`&&e.type===`text`){R.output=(R.output||R.value)+e.value,R.value+=e.value;return}e.prev=R,h.push(e),R=e},de=(e,t)=>{let n={...v[t],conditions:1,inner:``};n.prev=R,n.parens=L.parens,n.output=L.output,n.startIndex=L.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;le(`parens`),V({type:e,value:t,output:L.output?``:w}),V({type:`paren`,extglob:!0,value:ie(),output:r}),ee.push(n)},fe=n=>{let i=e.slice(n.startIndex,L.index+1),a=y(e.slice(n.startIndex+2,L.index),d);if((n.type===`plus`||n.type===`star`)&&a.risky){let e=a.safeOutput?(n.output?``:w)+(d.capture?`(${a.safeOutput})`:a.safeOutput):void 0,t=h[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<h.length;e++)h[e].value=``,h[e].output=``,delete h[e].suffix;L.output=n.output+t.output,L.backtrack=!0,V({type:`paren`,extglob:!0,value:z,output:``}),ue(`parens`);return}let o=n.close+(d.capture?`)`:``),s;if(n.type===`negate`){let e=I;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=N(d)),(e!==I||B()||/^\)+$/.test(ae()))&&(o=n.close=`)$))${e}`),n.inner.includes(`*`)&&(s=ae())&&/^\.[^\\/.]+$/.test(s)&&(o=n.close=`)${b(s,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(L.negatedExtglob=!0)}V({type:`paren`,extglob:!0,value:z,output:o}),ue(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?k.repeat(a.length):``):o===0?F+(a?k.repeat(a.length):``):k.repeat(r.length):i===`.`?x.repeat(r.length):i===`*`?t?t+i+(a?I:``):I:t?e:`\\${e}`);return n===!0&&(i=d.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&d.contains===!0?(L.output=e,L):(L.output=r.wrapOutput(i,L,t),L)}for(;!B();){if(z=ie(),z===`\0`)continue;if(z===`\\`){let e=re();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){z+=`\\`,V({type:`text`,value:z});continue}let t=/^\\+/.exec(ae()),n=0;if(t&&t[0].length>2&&(n=t[0].length,L.index+=n,n%2!=0&&(z+=`\\`)),d.unescape===!0?z=ie():z+=ie(),L.brackets===0){V({type:`text`,value:z});continue}}if(L.brackets>0&&(z!==`]`||R.value===`[`||R.value===`[^`)){if(d.posix!==!1&&z===`:`){let e=R.value.slice(1);if(e.includes(`[`)&&(R.posix=!0,e.includes(`:`))){let e=R.value.lastIndexOf(`[`),t=R.value.slice(0,e),n=a[R.value.slice(e+2)];if(n){R.value=t+n,L.backtrack=!0,ie(),!m.output&&h.indexOf(R)===1&&(m.output=w);continue}}}(z===`[`&&re()!==`:`||z===`-`&&re()===`]`)&&(z=`\\${z}`),z===`]`&&(R.value===`[`||R.value===`[^`)&&(z=`\\${z}`),d.posix===!0&&z===`!`&&R.value===`[`&&(z=`^`),R.value+=z,se({value:z});continue}if(L.quotes===1&&z!==`"`){z=r.escapeRegex(z),R.value+=z,se({value:z});continue}if(z===`"`){L.quotes=L.quotes===1?0:1,d.keepQuotes===!0&&V({type:`text`,value:z});continue}if(z===`(`){le(`parens`),V({type:`paren`,value:z});continue}if(z===`)`){if(L.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=ee[ee.length-1];if(e&&L.parens===e.parens+1){fe(ee.pop());continue}V({type:`paren`,value:z,output:L.parens?`)`:`\\)`}),ue(`parens`);continue}if(z===`[`){if(d.nobracket===!0||!ae().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));z=`\\${z}`}else le(`brackets`);V({type:`bracket`,value:z});continue}if(z===`]`){if(d.nobracket===!0||R&&R.type===`bracket`&&R.value.length===1){V({type:`text`,value:z,output:`\\${z}`});continue}if(L.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));V({type:`text`,value:z,output:`\\${z}`});continue}ue(`brackets`);let e=R.value.slice(1);if(R.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(z=`/${z}`),R.value+=z,se({value:z}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(R.value);if(L.output=L.output.slice(0,-R.value.length),d.literalBrackets===!0){L.output+=t,R.value=t;continue}R.value=`(${g}${t}|${R.value})`,L.output+=R.value;continue}if(z===`{`&&d.nobrace!==!0){le(`braces`);let e={type:`brace`,value:z,output:`(`,outputIndex:L.output.length,tokensIndex:L.tokens.length};te.push(e),V(e);continue}if(z===`}`){let e=te[te.length-1];if(d.nobrace===!0||!e){V({type:`text`,value:z,output:z});continue}let t=`)`;if(e.dots===!0){let e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,d),L.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=L.output.slice(0,e.outputIndex),r=L.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,z=t=`\\}`,L.output=n;for(let e of r)L.output+=e.output||e.value}V({type:`brace`,value:z,output:t}),ue(`braces`),te.pop();continue}if(z===`|`){ee.length>0&&ee[ee.length-1].conditions++,V({type:`text`,value:z});continue}if(z===`,`){let e=z,t=te[te.length-1];t&&ne[ne.length-1]===`braces`&&(t.comma=!0,e=`|`),V({type:`comma`,value:z,output:e});continue}if(z===`/`){if(R.type===`dot`&&L.index===L.start+1){L.start=L.index+1,L.consumed=``,L.output=``,h.pop(),R=m;continue}V({type:`slash`,value:z,output:C});continue}if(z===`.`){if(L.braces>0&&R.type===`dot`){R.value===`.`&&(R.output=x);let e=te[te.length-1];R.type=`dots`,R.output+=z,R.value+=z,e.dots=!0;continue}if(L.braces+L.parens===0&&R.type!==`bos`&&R.type!==`slash`){V({type:`text`,value:z,output:x});continue}V({type:`dot`,value:z,output:x});continue}if(z===`?`){if(!(R&&R.value===`(`)&&d.noextglob!==!0&&re()===`(`&&re(2)!==`?`){de(`qmark`,z);continue}if(R&&R.type===`paren`){let e=re(),t=z;(R.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(ae()))&&(t=`\\${z}`),V({type:`text`,value:z,output:t});continue}if(d.dot!==!0&&(R.type===`slash`||R.type===`bos`)){V({type:`qmark`,value:z,output:A});continue}V({type:`qmark`,value:z,output:k});continue}if(z===`!`){if(d.noextglob!==!0&&re()===`(`&&(re(2)!==`?`||!/[!=<:]/.test(re(3)))){de(`negate`,z);continue}if(d.nonegate!==!0&&L.index===0){ce();continue}}if(z===`+`){if(d.noextglob!==!0&&re()===`(`&&re(2)!==`?`){de(`plus`,z);continue}if(R&&R.value===`(`||d.regex===!1){V({type:`plus`,value:z,output:S});continue}if(R&&(R.type===`bracket`||R.type===`paren`||R.type===`brace`)||L.parens>0){V({type:`plus`,value:z});continue}V({type:`plus`,value:S});continue}if(z===`@`){if(d.noextglob!==!0&&re()===`(`&&re(2)!==`?`){V({type:`at`,extglob:!0,value:z,output:``});continue}V({type:`text`,value:z});continue}if(z!==`*`){(z===`$`||z===`^`)&&(z=`\\${z}`);let e=o.exec(ae());e&&(z+=e[0],L.index+=e[0].length),V({type:`text`,value:z});continue}if(R&&(R.type===`globstar`||R.star===!0)){R.type=`star`,R.star=!0,R.value+=z,R.output=I,L.backtrack=!0,L.globstar=!0,oe(z);continue}let t=ae();if(d.noextglob!==!0&&/^\([^?]/.test(t)){de(`star`,z);continue}if(R.type===`star`){if(d.noglobstar===!0){oe(z);continue}let n=R.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(d.bash===!0&&(!i||t[0]&&t[0]!==`/`)){V({type:`star`,value:z,output:``});continue}let o=L.braces>0&&(n.type===`comma`||n.type===`brace`),s=ee.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){V({type:`star`,value:z,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[L.index+4];if(n&&n!==`/`)break;t=t.slice(3),oe(`/**`,3)}let c=B()||L.parens>0&&t===`)`.repeat(L.parens)&&!ee.some(e=>e.type===`negate`);if(n.type===`bos`&&B()){R.type=`globstar`,R.value+=z,R.output=N(d),L.output=R.output,L.globstar=!0,oe(z);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&c){L.output=L.output.slice(0,-(n.output+R.output).length),n.output=`(?:${n.output}`,R.type=`globstar`,R.output=N(d)+(d.strictSlashes?`)`:`|$)`),R.value+=z,L.globstar=!0,L.output+=n.output+R.output,oe(z);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;L.output=L.output.slice(0,-(n.output+R.output).length),n.output=`(?:${n.output}`,R.type=`globstar`,R.output=`${N(d)}${C}|${C}${e})`,R.value+=z,L.output+=n.output+R.output,L.globstar=!0,oe(z+ie()),V({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){R.type=`globstar`,R.value+=z,R.output=`(?:^|${C}|${N(d)}${C})`,L.output=R.output,L.globstar=!0,oe(z+ie()),V({type:`slash`,value:`/`,output:``});continue}L.output=L.output.slice(0,-R.output.length),R.type=`globstar`,R.output=N(d),R.value+=z,L.output+=R.output,L.globstar=!0,oe(z);continue}let n={type:`star`,value:z,output:I};if(d.bash===!0){n.output=`.*?`,(R.type===`bos`||R.type===`slash`)&&(n.output=P+n.output),V(n);continue}if(R&&(R.type===`bracket`||R.type===`paren`)&&d.regex===!0){n.output=z,V(n);continue}(L.index===L.start||R.type===`slash`||R.type===`dot`)&&(R.type===`dot`?(L.output+=D,R.output+=D):d.dot===!0?(L.output+=O,R.output+=O):(L.output+=P,R.output+=P),re()!==`*`&&(L.output+=w,R.output+=w)),V(n)}for(;L.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));L.output=r.escapeLast(L.output,`[`),ue(`brackets`)}for(;L.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));L.output=r.escapeLast(L.output,`(`),ue(`parens`)}for(;L.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));L.output=r.escapeLast(L.output,`{`),ue(`braces`)}if(d.strictSlashes!==!0&&(R.type===`star`||R.type===`bracket`)&&V({type:`maybe_slash`,value:``,output:`${C}?`}),L.backtrack===!0){L.output=``;for(let e of L.tokens)L.output+=e.output==null?e.value:e.output,e.suffix&&(L.output+=e.suffix)}return L};b.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:_}=n.globChars(a.windows),v=a.dot?m:p,y=a.dot?h:p,b=a.capture?``:`?:`,x={negated:!1,prefix:``},S=a.bash===!0?`.*?`:g;a.capture&&(S=`(${S})`);let C=e=>e.noglobstar===!0?S:`(${b}(?:(?!${_}${e.dot?f:l}).)*?)`,w=e=>{switch(e){case`*`:return`${v}${d}${S}`;case`.*`:return`${l}${d}${S}`;case`*.*`:return`${v}${S}${l}${d}${S}`;case`*/*`:return`${v}${S}${u}${d}${y}${S}`;case`**`:return v+C(a);case`**/*`:return`(?:${v}${C(a)}${u})?${y}${d}${S}`;case`**/*.*`:return`(?:${v}${C(a)}${u})?${y}${S}${l}${d}${S}`;case`**/.*`:return`(?:${v}${C(a)}${u})?${l}${d}${S}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=w(t[1]);return n?n+l+t[2]:void 0}}},T=w(r.removePrefix(e,x));return T&&a.strictSlashes!==!0&&(T+=`${u}?`),T},t.exports=b})),MM=o(((e,t)=>{var n=AM(),r=jM(),i=kM(),a=OM(),o=e=>e&&typeof e==`object`&&!Array.isArray(e),s=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>s(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=o(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=c.state;delete c.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=s(i.ignore,e,n)}let d=(n,r=!1)=>{let{isMatch:o,match:d,output:f}=s.test(n,c,t,{glob:e,posix:a}),p={glob:e,state:l,regex:c,posix:a,input:n,output:f,match:d,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):u(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),!r||p)};return n&&(d.state=l),d};s.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},c=o.format||(a?i.toPosixSlashes:null),l=e===r,u=l&&c?c(e):e;return l===!1&&(u=c?c(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?s.matchBase(e,t,n,a):t.exec(u)),{isMatch:!!l,match:l,output:u}},s.matchBase=(e,t,n,r=n&&n.windows)=>(t instanceof RegExp?t:s.makeRe(t,n)).test(i.basename(e,{windows:r})),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map(e=>s.parse(e,t)):r(e,{...t,fastpaths:!1}),s.scan=(e,t)=>n(e,t),s.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,c=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let l=s.toRegex(c,t);return r===!0&&(l.state=e),l},s.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),s.compileRe(a,t,n,i)},s.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},s.constants=a,t.exports=s})),NM=l(o(((e,t)=>{t.exports=MM()}))(),1);function PM(e,t){let n=IM(e),{startLine:r,endLine:i}=LM(e);if(n===`new`||!t)return{side:n,startLine:r,endLine:i};let a=[];for(let e=r;e<=i;e++){let n=FM(t,e);if(n==null)return{side:`old`,startLine:r,endLine:i};a.push(n)}return{side:`new`,startLine:a[0],endLine:a[a.length-1]}}function FM(e,t){for(let n of e.hunks){let e=n.deletionStart,r=n.additionStart;for(let i of n.hunkContent)if(i.type===`context`){if(t>=e&&t<e+i.lines)return r+(t-e);e+=i.lines,r+=i.lines}else{if(t>=e&&t<e+i.deletions)return null;e+=i.deletions,r+=i.additions}}return null}function IM(e){return(e.range.endSide??e.range.side)===`deletions`?`old`:`new`}function LM(e){let t=e.range.start,n=e.range.end;return{startLine:Math.min(t,n),endLine:Math.max(t,n)}}function RM(e,t,n){let r=e.split(`
1596
1595
  `);return r.length&&r[r.length-1]===``&&r.pop(),r.slice(Math.max(0,t-1),Math.max(0,n)).join(`
1597
- `)}function yN(e,t,n){return{path:e,...t,quoted:vN(n,t.startLine,t.endLine)}}function bN(e,t=[],n=`unified`){let r=[],i=xN(e,t),a=0;for(let t of e.hunks){let e=t.deletionStart,o=t.additionStart;for(;a<i.length&&i[a]<o;)r.push({side:`additions`,line:i[a++],hunkStart:!1});for(let i of t.hunkContent)if(i.type===`context`){for(let e=0;e<i.lines;e++)r.push({side:`additions`,line:o+e,hunkStart:!1});e+=i.lines,o+=i.lines}else{let t=t=>({side:`deletions`,line:e+t,hunkStart:t===0&&i.additions===0}),a=e=>({side:`additions`,line:o+e,hunkStart:e===0});if(n===`split`){for(let e=0;e<i.additions;e++)r.push(a(e));for(let e=i.additions;e<i.deletions;e++)r.push(t(e))}else{for(let e=0;e<i.deletions;e++)r.push(t(e));for(let e=0;e<i.additions;e++)r.push(a(e))}e+=i.deletions,o+=i.additions}}for(;a<i.length;)r.push({side:`additions`,line:i[a++],hunkStart:!1});return r}function xN(e,t){if(t.length===0)return[];let n=new Set;for(let t of e.hunks){let e=t.additionStart;for(let r of t.hunkContent){let t=r.type===`context`?r.lines:r.additions;for(let r=0;r<t;r++)n.add(e+r);e+=t}}let r=new Set;for(let[e,i]of t)for(let t=e;t<=i;t++)n.has(t)||r.add(t);return[...r].sort((e,t)=>e-t)}function SN(e){let t=e.split(`
1598
- `);return t.length&&t[t.length-1]===``&&t.pop(),t.map((e,t)=>({side:`additions`,line:t+1,hunkStart:t===0}))}function CN(e,t,n,r,i={},a=`unified`,o=null){if(o){if(!o.item)return[];let e=MM(!1,o.path,n[o.path]??0);return[{id:e,path:o.path,collapsed:!1,rows:TN(o.item,i[e],a)}]}let s=[];for(let o of LM(e)){let e=t[o],c=MM(!0,o,n[o]??0);s.push({id:c,path:o,collapsed:r(o),rows:e?TN(e,i[c],a):[]})}return s}var wN=new WeakMap;function TN(e,t,n){let r=e.kind===`diff`?e.fileDiff:e.kind===`file`?e.file:null;if(!r)return[];let i=wN.get(r);if(i&&i.revealed===t&&i.style===n)return i.rows;let a=e.kind===`diff`?bN(e.fileDiff,t,n):SN(e.file.contents);return wN.set(r,{revealed:t,style:n,rows:a}),a}function EN(e,t){if(!t)return null;let n=e.findIndex(e=>e.id===t.id);if(n===-1)return null;let r=t.range.endSide??t.range.side??`additions`,i=e[n].rows,a=i.findIndex(e=>e.line===t.range.end&&e.side===r);if(a===-1&&(a=i.findIndex(e=>e.line===t.range.end)),a===-1){let e=1/0;if(i.forEach((n,i)=>{let o=Math.abs(n.line-t.range.end)+(n.side===r?0:.5);o<e&&(e=o,a=i)}),a===-1)return null}return{itemIndex:n,rowIndex:a}}function DN(e,t,n){if(e.length===0)return null;if(!t)return ON(e,n===1?0:e.length-1,n);if(t.rowIndex===-1){let r=e[t.itemIndex];return r&&!r.collapsed&&r.rows.length>0?{itemIndex:t.itemIndex,rowIndex:n===1?0:r.rows.length-1}:ON(e,t.itemIndex+n,n)??t}let{itemIndex:r,rowIndex:i}=t;for(i+=n;i<0||i>=(e[r]?.rows.length??0);){if(r+=n,r<0||r>=e.length)return t;let a=e[r];if(a.collapsed)return{itemIndex:r,rowIndex:-1};a.rows.length!==0&&(i=n===1?0:a.rows.length-1)}return{itemIndex:r,rowIndex:i}}function ON(e,t,n){for(let r=t;r>=0&&r<e.length;r+=n){let t=e[r];if(t.collapsed)return{itemIndex:r,rowIndex:-1};if(t.rows.length>0)return{itemIndex:r,rowIndex:n===1?0:t.rows.length-1}}return null}function kN(e,t,n){if(e.length===0)return null;let r=t?t.itemIndex+n:n===1?0:e.length-1;return r<0||r>=e.length?t:{itemIndex:r,rowIndex:e[r].collapsed?-1:0}}function AN(e,t,n){let r=[];if(e.forEach((e,t)=>{e.collapsed||e.rows.forEach((e,n)=>e.hunkStart&&r.push({itemIndex:t,rowIndex:n}))}),r.length===0)return t;if(!t)return n===1?r[0]:r[r.length-1];let i=e=>e.itemIndex*1e7+e.rowIndex,a=i(t);return n===1?r.find(e=>i(e)>a)??t:[...r].reverse().find(e=>i(e)<a)??t}function jN(e,t,n){let r=e[t.itemIndex],i=r?.rows[t.rowIndex];if(!r||!i)return null;if(n&&n.itemIndex===t.itemIndex){let e=r.rows[n.rowIndex];if(e)return{id:r.id,range:{start:e.line,side:e.side,end:i.line,endSide:i.side}}}return{id:r.id,range:{start:i.line,side:i.side,end:i.line,endSide:i.side}}}function MN(e){let t=Tk(e);return t===`json`||t===`jsonc`||t===`yaml`||t===`toml`}var NN=null,PN=null,FN=null,IN=null,LN={get:()=>FN??NN,element:()=>FN?IN:PN,set(e,t=null){NN=e,PN=e?t:null},focus(e,t=null){FN=e,IN=e?t:null}},RN={python:`python`,javascript:`javascript`,javascriptreact:`javascript`,typescript:`typescript`,typescriptreact:`tsx`,rust:`rust`,go:`go`,c:`c`,cpp:`cpp`,ruby:`ruby`,java:`java`,lua:`lua`,zig:`zig`,swift:`swift`,php:`php`,shellscript:`bash`,ocaml:`ocaml`};function zN(e){let t=Tk(e);return t&&t in RN?RN[t]:null}var BN=null,VN=!1,HN=0,UN=new Map;function WN(){VN=!0,BN?.terminate(),BN=null;for(let e of UN.values())e(!1);UN.clear()}async function GN(e,t,n,r,i){let a=zN(e);if(!a||VN||typeof Worker>`u`)return!1;try{let o=await i();if(o.length>1e6||VN)return!1;BN||(BN=new Worker(new URL(``+new URL(`syntax.worker-Cc0dIGs8.js`,import.meta.url).href,``+import.meta.url),{type:`module`}),BN.onmessage=({data:e})=>{UN.get(e.id)?.(e.blocked),UN.delete(e.id)},BN.onerror=WN,BN.onmessageerror=WN);let s=++HN;return await new Promise(i=>{let c=setTimeout(WN,5e3);UN.set(s,e=>{clearTimeout(c),i(e)});try{BN.postMessage({id:s,key:`${t}:${e}`,grammar:a,contents:o,line:n,col:r})}catch{WN()}})}catch{return!1}}var KN={light:`github-light-high-contrast`,dark:`github-dark-high-contrast`},qN=`diffle:theme`;function JN(){try{let e=localStorage.getItem(qN);if(e===`light`||e===`dark`||e===`system`)return e}catch{}return`system`}function YN(e){try{localStorage.setItem(qN,e)}catch{}}function XN(e){let t=document.documentElement;e===`system`?(delete t.dataset.theme,t.style.colorScheme=`light dark`):(t.dataset.theme=e,t.style.colorScheme=e)}function ZN(e){return e===`system`?`light`:e===`light`?`dark`:`system`}var QN=`diffle:diffStyle`,$N=3500;function eP(){try{return localStorage.getItem(QN)===`unified`?`unified`:`split`}catch{return`split`}}var tP=`diffle:layout`,nP={treeWidth:null,panelWidth:null,treeVisible:!0,panelVisible:!0};function rP(){try{let e=localStorage.getItem(tP);return e?{...nP,...JSON.parse(e)}:nP}catch{return nP}}var Y=pN((e,t)=>{let n=0,r=0,i=e=>e===n,a=0,o=0,s=null,c=()=>{s&&=(clearTimeout(s.timer),s.wake(),null)},l=new AbortController,u=new Map,d=()=>(l.abort(),l=new AbortController,u.clear(),++n),f=0,p=()=>(f++,d()),m=()=>{let e=0;return{start:()=>++e,latest:t=>t===e}},h=m(),g=m(),_=m(),v=m(),y=()=>{let e=Promise.resolve();return t=>{let n=e.then(t);return e=n.catch(()=>{}),n}},b=y(),x=y(),S=0,C=!1,w=e=>e<=S||!C&&e<=(t().snapshot?.version??0),T=()=>{let e=g.start(),t=_.start();return Promise.all([Vk.threads(),Vk.viewed()]).then(([n,r])=>({threads:n,viewed:r,tt:e,tv:t}))},E=async(t,n,r)=>{i(n)&&(_.latest(r.tv)&&e({viewed:r.viewed}),g.latest(r.tt)&&De(r.threads),await ie(t,n))},D=(e,t)=>{let r=`${n}\0${t}\0${e}`,i=u.get(r);return i||(i=Vk.file(e,t,l.signal),u.set(r,i),i.catch(()=>u.delete(r))),i},O=e=>e?.name===`AbortError`,k=async(e,t)=>{for(;;)try{return await D(e,t)}catch(e){if(!O(e))throw e}},A=e=>e instanceof Error?e.message:String(e),j=(e,n)=>t().flash(`${e} failed: ${A(n)}`),M=async(r,a)=>{let o=t().contents[r]?.[a];if(o!=null)return o;let s=n,c=await k(r,a);return i(s)&&e(e=>({contents:{...e.contents,[r]:{...e.contents[r],[a]:c.contents}}})),c.contents},N=(e,t)=>{let n={...e.gens};for(let e of t)n[e]=(n[e]??0)+1;let r=r=>{let i=NM(r.id);return t.includes(i)?{...r,id:PM({snapshot:e.snapshot,gens:n,fileView:e.fileView},i)}:r};return{gens:n,selection:e.selection&&r(e.selection),draft:e.draft&&{...e.draft,selection:r(e.draft.selection)},scrollTarget:e.scrollTarget&&r(e.scrollTarget),reveal:e.reveal&&r(e.reveal)}},P=async(n,r,a)=>{let o=new Map(n.changed.map(e=>[e.path,e])),s=r.filter(e=>o.has(e));if(s.length===0)return;let c={},l=[],u=t().loaded;for(let e of s){let t=o.get(e);t.binary?c[e]={kind:`binary`}:FM(t)>1e4&&u[e]?.kind!==`diff`?c[e]={kind:`oversized`,lines:FM(t)}:l.push(t)}Object.keys(c).length>0&&e(e=>({loaded:{...e.loaded,...c},...N(e,Object.keys(c))}));let d=t();await aP(IM(n,l,[d.fileView?.path,d.activePath,d.selection&&NM(d.selection.id)].filter(e=>e!=null),e=>JM(d,e)),2,()=>!i(a),e=>F(n,e,a))},F=async(t,n,r)=>{let a=new Map(t.changed.map(e=>[e.path,e])),o={},s=new Map;try{let e=Am(n.length===1?await Vk.patch(n[0]):await Vk.patches(n),`s${t.version}c${t.context}t${Date.now()}`);for(let t of e)for(let e of t.files)s.set(e.name,e);for(let e of n){let t=s.get(e);o[e]=t?{kind:`diff`,fileDiff:t}:{kind:`error`,message:`patch missing for file`}}}catch(e){for(let t of n)o[t]={kind:`error`,message:String(e)}}i(r)&&(e(e=>({loaded:{...e.loaded,...o},...N(e,Object.keys(o))})),ee(n.filter(e=>!a.get(e).submodule),s,o,r))},I=[],L=0,ee=(e,t,n,r)=>{for(let i of e){let e=t.get(i);e?.isPartial&&(e.type===`change`||e.type===`rename-changed`||e.type===`rename-pure`)&&I.push({path:i,file:e,replaces:n[i],g:r})}for(;L<4&&L<I.length;)L++,te()},te=async()=>{try{for(;;){let e=I.shift();if(!e)return;!i(e.g)||t().loaded[e.path]!==e.replaces||await ne(e)}}finally{L--}},ne=async({path:e,file:n,replaces:r,g:a})=>{let o=()=>!i(a)||t().loaded[e]!==r;try{let t=n.prevName??n.name,[i,s]=await Promise.all([D(t,`old`),D(n.name,`new`)]);if(o())return;let c=z_(`clone`,n,{oldFile:{name:t,contents:i.contents},newFile:{name:n.name,contents:s.contents}});B({path:e,fileDiff:c,old:i.contents,new:s.contents,replaces:r,g:a})}catch{}},R=[],z=null,B=e=>{R.push(e),!z&&(z=re,typeof requestAnimationFrame==`function`?requestAnimationFrame(re):setTimeout(re,0))},re=()=>{z=null;let n=R;R=[];let r=n.filter(e=>i(e.g)&&t().loaded[e.path]===e.replaces);r.length!==0&&e(e=>{let t={...e.loaded},n={...e.contents};for(let e of r)t[e.path]={kind:`diff`,fileDiff:e.fileDiff},n[e.path]={...n[e.path],old:e.old,new:e.new};return{loaded:t,contents:n,...N(e,r.map(e=>e.path))}})},ie=async(n,r)=>{let i=t().snapshot,a=i==null||i.mode.commentKey!==n.mode.commentKey,o=i!=null&&i.context!==n.context,s=i!=null&&(i.oldSha===`worktree`||i.oldSha!==n.oldSha),c=s||i!=null&&i.newSha!==n.newSha,l=new Map(i?.changed.map(e=>[e.path,e])??[]),u=new Map(n.changed.map(e=>[e.path,e])),d=a?{}:{...t().loaded},f=a||c?{}:{...t().contents},p=[];for(let e of n.changed){let t=l.get(e.path);if(a||o||s||!t||!iP(t,e)||d[e.path]==null){let t=d[e.path];t&&(d[e.path]={...t}),delete f[e.path],p.push(e.path)}}for(let e of l.keys())u.has(e)||(delete d[e],delete f[e]);let m=t().fileView,h=a||m==null||!m.external&&!n.tree.includes(m.path)?null:m,g=m!=null&&!m.external&&(c||l.has(m.path)!==u.has(m.path)||p.includes(m.path));h&&g&&delete f[h.path];let _={};if(!a)for(let[e,n]of Object.entries(t().collapsed))l.get(e)?.blob===u.get(e)?.blob&&(_[e]=n);let v=t().draft,y=v!=null&&!a&&(u.has(v.path)||h?.path===v.path);C=!1,e({snapshot:n,loaded:d,contents:f,fileView:h,collapsed:_,error:null,draft:y?v:null}),t().refreshGithub(),a&&e(e=>({selection:null,visualAnchor:null,replyTo:null,editingId:null,jumps:[],jumpIndex:0,revealed:{},reveal:null,scrollTarget:null,search:{...e.search,open:!1,kind:`text`,direction:1,matches:[],index:-1}})),await Promise.all([P(n,p,r),...h&&(g||!h.item)?[ae(h.path,h.external,r,!0)]:[]])},ae=async(n,r,a,o=!1)=>{let s=t().fileView?.from??{position:ce(),activePath:t().activePath};o||e({fileView:{path:n,external:r,item:null,from:s},selection:null,visualAnchor:null,draft:null,focusedThread:null});let c,l;try{let e=await D(n,`new`);l=e.contents,c=e.binary?{kind:`binary`}:{kind:`file`,file:{name:n,contents:e.contents,cacheKey:`${n}@full@${Date.now()}`}}}catch(e){c={kind:`error`,message:String(e)}}!i(a)||t().fileView?.path!==n||e(e=>({fileView:{path:n,external:r,item:c,from:e.fileView?.from??s},...N(e,[n]),contents:l==null?e.contents:{...e.contents,[n]:{...e.contents[n],new:l}}}))},oe=null,se=()=>{let e=t();if(!e.snapshot)return[];let n=[e.snapshot,e.loaded,e.gens,e.revealed,e.collapsed,e.viewed,e.config,e.diffStyle,e.fileView];if(oe&&oe.inputs.every((e,t)=>e===n[t]))return oe.items;let r=CN(e.snapshot,e.loaded,e.gens,t=>JM(e,t),e.revealed,e.diffStyle,e.fileView);return oe={inputs:n,items:r},r},ce=()=>{let e=t().selection;if(!e)return null;let n=NM(e.id),r=t().fileView;return r?.path===n?{path:n,side:gN(e),line:e.range.end,full:!0,...r.external?{external:!0}:{}}:{path:n,side:gN(e),line:e.range.end}},le=()=>{if(V)return;let n=ce();if(!n)return;let{jumps:r,jumpIndex:i}=t(),a=r.slice(0,i),o=a[a.length-1];if(o&&o.path===n.path&&o.line===n.line&&o.side===n.side&&!!o.full==!!n.full){e({jumps:a,jumpIndex:a.length});return}let s=[...a,n].slice(-100);e({jumps:s,jumpIndex:s.length})},ue=n=>{JM(t(),n)&&e(e=>({collapsed:{...e.collapsed,[n]:!1}}))},V=!1,de=e=>{V=!0;let t=()=>{V=!1},n;try{n=e()}catch(e){throw t(),e}return n instanceof Promise?n.finally(t):(t(),n)},fe=async r=>{if(r.full&&t().fileView?.path!==r.path){let e=n;if(await ae(r.path,r.external??!1,e),!i(e)||t().fileView?.path!==r.path)return}else!r.full&&t().fileView&&e({fileView:null,selection:null,visualAnchor:null,draft:null,focusedThread:null});V=!0;try{pe(r)}finally{V=!1}},pe=t=>{t.full||ue(t.path);let n=se(),r=n.findIndex(e=>e.path===t.path);if(r===-1)return;let i=n[r],a=t.side===`old`?`deletions`:`additions`,o=i.rows.findIndex(e=>e.line===t.line&&e.side===a);if(o!==-1){ge({itemIndex:r,rowIndex:o},!1,`eye`);return}e(e=>({selection:{id:i.id,range:{start:t.line,side:a,end:t.line,endSide:a}},activePath:t.path,scrollTarget:{id:i.id,line:t.line,side:t.side,align:`eye`,nonce:(e.scrollTarget?.nonce??0)+1}}))},me=t=>{let n=se(),r=n.findIndex(e=>e.path===t);if(r===-1)return;let i=n[r],a=null;for(let e=r+1;e<n.length;e++){let t=n[e];if(t.collapsed||t.rows.length===0)continue;let r=t.rows.findIndex(e=>e.hunkStart);a={itemIndex:e,rowIndex:r===-1?0:r};break}let o=a?jN(n,a):null;e(e=>({selection:o,visualAnchor:null,draft:null,activePath:a?n[a.itemIndex].path:t,scrollTarget:{id:i.id,align:`start`,nonce:(e.scrollTarget?.nonce??0)+1}}))},he=(e,t)=>{let n=e.selection;return{id:n.id,line:n.range.end,side:gN(n),align:t,nonce:(e.scrollTarget?.nonce??0)+1}},ge=(n,r=!1,i=`nearest`)=>{if(!n)return;i===`eye`&&le();let a=se(),o=jN(a,n,r?t().visualAnchor:null),s=a[n.itemIndex];if(!o||!s)return;let c=s.rows[n.rowIndex];e(e=>({selection:o,activePath:s.path,visualAnchor:r?e.visualAnchor:null,focusedThread:null,scrollTarget:{id:s.id,line:c.line,side:c.side===`deletions`?`old`:`new`,align:i,nonce:(e.scrollTarget?.nonce??0)+1}}))},_e=async(n,r,i=!1)=>{le(),await de(()=>i?t().openFullFile(n,void 0,!0):t().openFile(n)),ue(n);let a=se(),o=a.findIndex(e=>e.path===n);if(o===-1)return;let s=a[o],c=s.rows.findIndex(e=>e.side===`additions`&&e.line===r);if(c!==-1){de(()=>ge({itemIndex:o,rowIndex:c},!1,`eye`));return}e(e=>({selection:{id:s.id,range:{start:r,side:`additions`,end:r,endSide:`additions`}},activePath:n,visualAnchor:null,reveal:{id:s.id,path:n,line:r,nonce:(e.reveal?.nonce??0)+1}}))},ve=e=>{let{lsp:n,snapshot:r}=t();return n.enabled?!r||!Ck(r)?`Symbol navigation needs the new side to be the worktree or the checked-out commit`:Ek(n,e):Ek(n)},ye=e=>ve(e.path)??(e.side===`old`?`Symbol navigation works on the new side only`:t().fileView?.external?`Symbol navigation starts from a repository file`:null),be=e=>{let n=e?ye(e):ve()??`Hover a symbol first`;return n?(t().flash(n),null):{path:e.path,line:e.line,col:e.col}},xe=(t,n)=>i(t)&&h.latest(n)?!0:(h.latest(n)&&e(e=>({search:{...e.search,loading:!1}})),!1),Se=async(r,a)=>{if(t().closeSymbolMenu(),r&&MN(r.path))return t().flash(`Configuration files support schema hover (gh)`);let o=be(r);if(!o)return;let s=n;try{let n=await(a===`definition`?Vk.lspDefinition(o):Vk.lspTypeDefinition(o));if(!i(s))return;let c=n.locations[0];if(!c)return t().flash(`No ${a} found for ${r.text}`);if(a===`type definition`&&n.locations.length>1){e({references:{open:!0,kind:`types`,symbol:r.text,items:n.locations,index:0}});return}await _e(c.path,c.line,c.external)}catch(e){i(s)&&j(a===`definition`?`Go to definition`:`Go to type definition`,e)}},Ce=()=>EN(se(),t().selection),we=()=>{let e=Ce();if(e)return e;let n=se().findIndex(e=>e.path===t().activePath);return n===-1?null:{itemIndex:n,rowIndex:-1}},Te=(t,n=!1,r=`nearest`)=>{if(!t)return;if(t.rowIndex!==-1)return ge(t,n,r);let i=se()[t.itemIndex];i&&e(e=>({selection:null,activePath:i.path,visualAnchor:null,focusedThread:null,scrollTarget:{id:i.id,align:r,nonce:(e.scrollTarget?.nonce??0)+1}}))},Ee=()=>{let e=t(),n=e.selection;if(!n)return;let r=NM(n.id),i=gN(n),a=n.range.end;return YM(e).find(e=>e.anchor.path===r&&e.anchor.side===i&&a>=e.anchor.startLine&&a<=e.anchor.endLine)},De=n=>e({threads:ZM(t().threads,n)}),Oe=async(e,n)=>{try{await n()}catch(t){return j(e,t)}await t().refreshThreads()},ke=async(n,r)=>{let i=f,a=0;try{let t=await b(()=>(a=_.start(),r()));f===i&&_.latest(a)&&e({viewed:t})}catch(e){if(f!==i)return;j(n,e),t().refreshViewed()}},Ae=null;return{layout:rP(),setLayout(n){let r={...t().layout,...n};try{localStorage.setItem(tP,JSON.stringify(r))}catch{}e({layout:r})},theme:JN(),setTheme(t){YN(t),XN(t),e(e=>({theme:t,...e.selection?{scrollTarget:he(e,`eye`)}:{}}))},visualAnchor:null,editingId:null,setEditingId(t){e({editingId:t})},replyTo:null,focusedThread:null,focusThread(t){e({focusedThread:t})},openReply(n){let r=t().threads.find(e=>e.id===n);r&&e({replyTo:n,draft:null,activePath:r.anchor.path})},closeReply(){t().replyTo&&e({replyTo:null})},githubMenuOpen:!1,github:{status:`idle`},setGithubMenuOpen(n){e({githubMenuOpen:n,...n?{modeMenuOpen:!1}:{}}),n&&t().refreshGithub()},async refreshGithub(){let i=t().snapshot;if(!i)return;let a=n,o=++r,s=()=>a===n&&t().snapshot===i&&r===o;e({github:{status:`loading`}});try{let t=await Vk.github();s()&&e({github:t.version===i.version?{status:`ready`,data:t}:{status:`idle`}})}catch(t){s()&&e({github:{status:`error`,error:A(t)}})}},modeMenuOpen:!1,modePane:null,setModeMenuOpen(t){e({modeMenuOpen:t,modePane:null,...t?{githubMenuOpen:!1}:{}})},pickModeEntry(n){n===1?(e({modeMenuOpen:!1,modePane:null}),t().switchMode({kind:`working`})):n>=2&&n<=4&&e({modeMenuOpen:!0,modePane:n===2?`refs`:n===3?`commits`:`pr`})},helpOpen:!1,setHelpOpen(t){e({helpOpen:t})},treeModel:null,setTreeModel(t){e({treeModel:t})},toast:null,report:j,flash(t){e({toast:t}),Ae&&clearTimeout(Ae),Ae=setTimeout(()=>e({toast:null}),$N)},search:{open:!1,kind:`text`,direction:1,ignoreCase:!0,regex:!1,scope:`diff`,path:null,focusNonce:0,query:``,matches:[],index:-1,loading:!1,truncated:!1},openSearch(t){e(e=>({search:{...e.search,open:!0,kind:`text`,direction:1,scope:t??e.search.scope,focusNonce:e.search.focusNonce+1}}))},setSearchOptions(n){e(e=>({search:{...e.search,...n}}));let{query:r,kind:i}=t().search;i===`text`&&r&&t().runSearch(r)},closeSearch(){h.start(),e(e=>({search:{...e.search,open:!1,kind:`text`,direction:1,matches:[],index:-1,loading:!1}}))},async runSearch(r){let i=n,a=h.start(),o=t().search.scope===`file`?RM(t()):null;e(e=>({search:{...e.search,kind:`text`,direction:1,query:r,path:o,loading:!0}}));try{let{ignoreCase:n,regex:s,scope:c}=t().search;if(c===`file`&&!o)return e(e=>({search:{...e.search,matches:[],index:-1,loading:!1}})),t().flash(`No file to search in`);let l=await Vk.search(r,{ignoreCase:n,regex:s,scope:c,...o?{path:o}:{}});if(!xe(i,a))return;e(e=>({search:{...e.search,matches:l.matches,truncated:l.truncated,index:-1,loading:!1}})),l.matches.length?t().moveMatch(1):t().flash(c===`file`?`No matches for “${r}” in ${o}`:c===`diff`?`No matches for “${r}” in the diff`:`No matches for “${r}”`)}catch(t){if(!xe(i,a))return;e(e=>({search:{...e.search,loading:!1}})),j(`Search`,t)}},moveMatch(n){let{search:r}=t(),i=r.matches.length;if(!i)return;let a=n*r.direction,o=((r.index<0?a===1?-1:0:r.index)+a+i)%i,s=r.matches[o];e({search:{...r,index:o}}),_e(s.path,s.line,s.external)},async searchWord(r){let i=LN.get()?.text;if(!i)return t().flash(`Focus a word first (w / b, or hover one)`);let a=n,o=h.start();e(e=>({search:{...e.search,open:!0,kind:`word`,direction:r,query:i,matches:[],index:-1,loading:!0,truncated:!1}}));try{let n=await Vk.search(i,{word:!0,scope:`repo`});if(!xe(a,o))return;let s=n.matches,c=new Map(t().snapshot?.tree.map((e,t)=>[e,t])??[]),l=ce(),u=e=>c.get(e)??1/0,d=e=>l?u(e.path)-u(l.path)||e.line-l.line:r,f=r===1?s.findIndex(e=>d(e)>0):s.findLastIndex(e=>d(e)<0);f===-1&&s.length&&(f=r===1?0:s.length-1),e(e=>({search:{...e.search,matches:s,truncated:n.truncated,index:f,loading:!1}}));let p=s[f];p?_e(p.path,p.line):t().flash(`No other occurrence of “${i}”`)}catch(t){if(!xe(a,o))return;e(e=>({search:{...e.search,loading:!1}})),j(`Search`,t)}},lsp:{enabled:!1,servers:[],missing:[]},setLspStatus(t){e({lsp:t})},symbolMenu:null,async openSymbolMenu(r,o,s){if(MN(r.path)){t().closeSymbolMenu();return}if(!t().lsp.enabled)return;t().closeHover();let c=++a,l=n,u=await GN(r.path,r.side,r.line,r.col,()=>M(r.path,r.side));if(!(!i(l)||c!==a)){if(u){e({symbolMenu:null});return}if(!ye(r)){let e=n,t=null;try{t=(await Vk.lspTokenKind({path:r.path,line:r.line,col:r.col}))?.kind??null}catch{}if(!i(e)||c!==a||t===`keyword`)return}e({symbolMenu:{target:r,x:o,y:s}})}},closeSymbolMenu(){a++,t().symbolMenu&&e({symbolMenu:null})},hover:null,async requestHover(r,a){let s=++o;if(t().symbolMenu||ye(r))return;let c=n;try{let n=await GN(r.path,r.side,r.line,r.col,()=>M(r.path,r.side));if(!i(c)||s!==o||t().symbolMenu)return;if(n){e({hover:null});return}let l=await Vk.lspHover({path:r.path,line:r.line,col:r.col});if(!i(c)||s!==o||t().symbolMenu)return;e({hover:l.contents?{target:r,contents:l.contents,anchor:a}:null})}catch{}},async showHover(){let e=t().symbolMenu?.target??LN.get();if(!be(e))return;t().closeSymbolMenu();let n=LN.element()?.getBoundingClientRect(),r=n?{left:n.left,top:n.top,bottom:n.bottom}:{left:0,top:0,bottom:0};await new Promise(e=>setTimeout(e,0));let i=o+1;await t().requestHover(e,r),i===o&&!t().hover&&t().flash(`No hover information for ${e.text}`)},closeHover(){o++,t().hover&&e({hover:null})},async goToDefinition(e=t().symbolMenu?.target??LN.get()){await Se(e,`definition`)},async goToTypeDefinition(e=t().symbolMenu?.target??LN.get()){await Se(e,`type definition`)},async goToLink(e,n){t().closeHover(),t().closeSymbolMenu(),n==null?await t().openFile(e):await _e(e,n)},async findReferences(r=t().symbolMenu?.target??LN.get()){if(t().closeSymbolMenu(),r&&MN(r.path))return t().flash(`Configuration files support schema hover (gh)`);let a=be(r);if(!a)return;let o=n;try{let n=await Vk.lspReferences(a);if(!i(o))return;let s=n.locations;if(s.length===0)return t().flash(`No references to ${r.text}`);let c=s.findIndex(e=>e.path===a.path&&e.line===a.line),l=c===-1?0:(c+1)%s.length;e({references:{open:!0,kind:`references`,symbol:r.text,items:s,index:l}})}catch(e){i(o)&&j(`Find references`,e)}},references:{open:!1,kind:`references`,symbol:``,items:[],index:-1},moveReference(n){let r=t().references,i=r.items.length;i&&e({references:{...r,index:(Math.max(r.index,0)+n+i)%i}})},pickReference(){let n=t().references,r=n.items[n.index];t().closeReferences(),r&&(n.kind===`references`&&e(e=>({search:{...e.search,open:!0,kind:`references`,direction:1,query:n.symbol,matches:n.items,index:n.index,loading:!1,truncated:!1}})),_e(r.path,r.line,r.external))},closeReferences(){e(e=>({references:{...e.references,open:!1}}))},symbols:{open:!1,scope:`document`,path:null,query:``,all:[],items:[],index:-1,loading:!1},async openSymbols(r){let a=r===`document`?t().activePath:null;if(r===`document`&&!a)return t().flash(`Move to a file first`);let o=a?ye({path:a,side:`new`}):ve();if(o)return t().flash(o);if(e({symbols:{open:!0,scope:r,path:r===`document`?a:null,query:``,all:[],items:[],index:-1,loading:r===`document`}}),r!==`document`)return;let s=n;try{let n=await Vk.lspSymbols({path:a}),r=t().symbols;if(!r.open||r.scope!==`document`||r.path!==a)return;if(!i(s))return e({symbols:{...r,loading:!1}});e({symbols:{...r,all:n,items:nN(n,r.query),index:n.length?0:-1,loading:!1}})}catch(e){t().closeSymbols(),j(`Document symbols`,e)}},async querySymbols(r){let a=t().symbols;if(!a.open)return;if(a.scope===`document`){let t=nN(a.all,r);return e({symbols:{...a,query:r,items:t,index:t.length?0:-1}})}if(e({symbols:{...a,query:r,loading:r.trim().length>0}}),c(),!r.trim())return e(e=>({symbols:{...e.symbols,items:[],index:-1}}));if(await new Promise(e=>{s={timer:setTimeout(()=>{s=null,e()},150),wake:e}}),t().symbols.query!==r||!t().symbols.open)return;let o=n;try{let n=await Vk.lspSymbols({q:r}),a=t().symbols;if(!a.open||a.query!==r)return;if(!i(o))return e({symbols:{...a,loading:!1}});e({symbols:{...a,items:n,index:n.length?0:-1,loading:!1}})}catch(t){e(e=>({symbols:{...e.symbols,loading:!1}})),j(`Workspace symbols`,t)}},moveSymbol(n){let r=t().symbols,i=r.items.length;i&&e({symbols:{...r,index:(Math.max(r.index,0)+n+i)%i}})},pickSymbol(){let e=t().symbols,n=e.items[e.index];t().closeSymbols(),n&&_e(n.path,n.line)},closeSymbols(){e(e=>({symbols:{...e.symbols,open:!1,items:[],all:[],index:-1,loading:!1}}))},moveCursor(e){let n=se();Te(DN(n,we(),e),t().visualAnchor!=null)},jumps:[],jumpIndex:0,jumpBack(){if(t().fileView)return t().closeFullFile();let{jumps:n,jumpIndex:r}=t();if(r===0)return;let i=n,a=r;if(a===i.length){let e=ce();e&&(i=[...i,e])}--a,e({jumps:i,jumpIndex:a});let o=i[a];o&&fe(o)},jumpForward(){let{jumps:n,jumpIndex:r}=t();if(r>=n.length-1)return;let i=r+1;e({jumpIndex:i});let a=n[i];a&&fe(a)},scrollCursorTo(n){if(!t().selection)return t().flash(`No line under the cursor`);e(e=>({scrollTarget:he(e,n)}))},moveCursorBy(e){let n=se(),r=e<0?-1:1,i=we();for(let t=0;t<Math.abs(e);t++){let e=DN(n,i,r);if(!e||i&&e.itemIndex===i.itemIndex&&e.rowIndex===i.rowIndex)break;i=e}Te(i,t().visualAnchor!=null,`eye`)},async goToLine(e){let n=t(),r=RM(n);if(!r)return n.flash(`No file to jump in`);await _e(r,e)},moveFile(n){let r=se();if(!r.length)return;let i=r.findIndex(e=>e.path===t().activePath),a=we()??(i===-1?null:{itemIndex:i,rowIndex:0}),o=n===`first`?kN(r,null,1):n===`last`?kN(r,null,-1):kN(r,a,n);if(!o)return;let s=r[o.itemIndex];if(le(),s.collapsed||s.rows.length===0){e(e=>({selection:null,activePath:s.path,scrollTarget:{id:s.id,nonce:(e.scrollTarget?.nonce??0)+1}}));return}ge(o),e(e=>({scrollTarget:{id:s.id,align:`start`,nonce:(e.scrollTarget?.nonce??0)+1}}))},moveHunk(e){ge(AN(se(),Ce(),e),!1,`eye`)},toggleVisual(){let n=Ce();if(t().visualAnchor){e({visualAnchor:null}),n&&ge(n);return}if(!n){let t=DN(se(),null,1);t&&ge(t),e({visualAnchor:Ce()});return}e({visualAnchor:n})},editCommentAtCursor(){let e=Ee(),n=e?.messages[e.messages.length-1];n&&t().setEditingId(n.id)},async deleteCommentAtCursor(){let e=Ee();e&&await t().deleteThread(e.id)},async toggleResolvedAtCursor(){let e=Ee();if(!e)return t().flash(`No thread under the cursor`);await t().setResolved(e.id,!e.resolved),t().flash(e.resolved?`Thread reopened`:`Thread resolved`)},async toggleViewedAtCursor(){let e=t().activePath,n=e?t().snapshot?.changed.find(t=>t.path===e):void 0;!e||!n||await t().setViewed(e,!KM(t(),n))},setCollapsedAtCursor(n){let r=t().activePath;r&&(e(e=>({collapsed:{...e.collapsed,[r]:n}})),n?me(r):t().loadPatch(r))},setAllCollapsed(n){let r=t().snapshot?.changed.map(e=>e.path)??[],i={};for(let e of r)i[e]=n;e({collapsed:i})},escape(){let n=t();n.helpOpen?e({helpOpen:!1}):n.modeMenuOpen?e({modeMenuOpen:!1}):n.githubMenuOpen?e({githubMenuOpen:!1}):n.hover?n.closeHover():n.symbolMenu?n.closeSymbolMenu():n.references.open?n.closeReferences():n.symbols.open?n.closeSymbols():n.search.open?n.closeSearch():n.editingId?n.setEditingId(null):n.replyTo?n.closeReply():n.draft?n.closeDraft():n.visualAnchor?e({visualAnchor:null}):e({selection:null})},diffStyle:eP(),setDiffStyle(t){try{localStorage.setItem(QN,t)}catch{}e(e=>({diffStyle:t,draft:null,visualAnchor:null,...e.selection?{scrollTarget:he(e,`eye`)}:{}}))},snapshot:null,error:null,threads:[],showResolved:!1,setShowResolved(t){e({showResolved:t})},viewed:[],config:fk,fileView:null,loaded:{},gens:{},contents:{},collapsed:{},selection:null,draft:null,activePath:null,scrollTarget:null,reveal:null,revealed:{},addRevealed(t,n,r){e(e=>{let i=NM(t),a=Object.fromEntries(Object.entries(e.revealed).filter(([e])=>e===t||NM(e)!==i));return{revealed:{...a,[t]:[...a[t]??[],[n,r]]}}})},async boot(){let t=p();C=!0,S=0;try{let n=Vk.lspStatus().catch(()=>({enabled:!1,servers:[],missing:[]})),r=v.start(),[i,a,o,s]=await Promise.all([Vk.snapshot(),T(),Vk.config(),n]);e({lsp:s}),v.latest(r)&&e({config:o}),await E(i,t,a)}catch(n){i(t)&&e({error:A(n)})}},async refreshSnapshot(t){if(t!=null){if(w(t))return;S=t}let n=d();try{let[e,t]=await Promise.all([Vk.snapshot(),T()]);await E(e,n,t)}catch(t){i(n)&&e({error:A(t)})}finally{S===t&&(S=0)}},async refreshThreads(){let e=n,t=g.start();try{let n=await Vk.threads();i(e)&&g.latest(t)&&De(n)}catch(n){i(e)&&g.latest(t)&&j(`Loading threads`,n)}},async refreshViewed(){let t=n,r=_.start();try{let n=await Vk.viewed();i(t)&&_.latest(r)&&e({viewed:n})}catch(e){i(t)&&_.latest(r)&&j(`Loading viewed marks`,e)}},async refreshConfig(){let t=v.start();try{let n=await Vk.config();v.latest(t)&&e({config:n})}catch(e){v.latest(t)&&j(`Loading config`,e)}},async switchMode(n){let r=p();e({error:null});let a,o=!1;try{return a=await Vk.switchMode(n),i(r)?w(a.version)?`applied`:(S=a.version,o=!0,await E(a,r,await T()),i(r)?`applied`:`superseded`):`superseded`}catch(n){if(!i(r))return`superseded`;let a=A(n);return e({error:a}),t().refreshGithub(),{error:a}}finally{o&&a&&S===a.version&&(S=0)}},loadFile:k,async openFile(n,r,i){let a=t().snapshot;if(a){if(!a.changed.some(e=>e.path===n)||t().fileView?.path===n&&i!==`old`){await t().openFullFile(n,r);return}t().fileView&&(le(),e({fileView:null,selection:null,visualAnchor:null,draft:null,focusedThread:null})),t().jumpTo(n,r,i),e({activePath:n})}},async loadPatch(e){let r=t().snapshot;!r||t().loaded[e]?.kind!==`oversized`||await F(r,[e],n)},async openFullFile(r,a,o=!1){let s=t().snapshot;if(!s)return;let c=t().fileView,l=o||c?.path===r&&c.external;if(!l&&!s.tree.includes(r)){t().flash(`${r} no longer exists on this side`);return}let u=n;if(c?.path!==r&&(le(),await ae(r,l,u),!i(u)||t().fileView?.path!==r))return;let d=t().fileView?.item;d?.kind===`error`&&t().flash(`Cannot open ${r}: ${d.message}`),t().jumpTo(r,a),e({activePath:r})},closeFullFile(){let n=t().fileView;if(!n)return;le();let{position:r,activePath:i}=n.from,a=t().jumps,o=r?a.findLastIndex(e=>e.path===r.path&&e.line===r.line&&e.side===r.side&&!e.full):-1;e({fileView:null,selection:null,visualAnchor:null,draft:null,focusedThread:null,activePath:i,...o>=0?{jumpIndex:o}:{}}),r?fe(r):i&&e(e=>({scrollTarget:{id:PM(e,i),align:`start`,nonce:(e.scrollTarget?.nonce??0)+1}}))},setSelection(n){e({selection:n,visualAnchor:null,focusedThread:null}),n==null&&t().draft&&e({draft:null})},async openDraft(n){if(t().fileView?.external)return t().flash(`Comments go on repository files only`);let r=NM(n.id);e({draft:{path:r,selection:n},selection:n,activePath:r,replyTo:null})},closeDraft(){e({draft:null,selection:null})},async draftQuote(){let e=t().draft;if(!e)return``;let n=t().loaded[e.path],r=mN(e.selection,n?.kind===`diff`?n.fileDiff:void 0),i=await M(e.path,r.side);return yN(e.path,r,i).quoted},async submitDraft(n){let r=t().draft;if(!r||!n.trim())return;try{let e=t().loaded[r.path],i=mN(r.selection,e?.kind===`diff`?e.fileDiff:void 0),a=await M(r.path,i.side),o=yN(r.path,i,a);await Vk.addThread({...o,body:n})}catch(e){return j(`Posting the comment`,e)}let i=r.selection.range;e({draft:null,visualAnchor:null,selection:{id:r.selection.id,range:{start:i.end,side:i.endSide??i.side,end:i.end,endSide:i.endSide??i.side}}}),await t().refreshThreads()},async submitReply(n,r){if(r.trim()){try{await Vk.reply(n,{body:r})}catch(e){return j(`Posting the reply`,e)}t().replyTo===n&&e({replyTo:null}),await t().refreshThreads()}},editMessage:(e,t,n)=>Oe(`Editing the message`,()=>Vk.editMessage(e,t,n)),deleteMessage:(e,t)=>Oe(`Deleting the message`,()=>Vk.deleteMessage(e,t)),setResolved:(e,t)=>Oe(t?`Resolving`:`Reopening`,()=>Vk.setResolved(e,t)),deleteThread:e=>Oe(`Deleting the thread`,()=>Vk.deleteThread(e)),clearThreads:()=>Oe(`Deleting all threads`,()=>Vk.clearThreads()),deleteStaleThreads:()=>Oe(`Deleting stale threads`,()=>Vk.deleteStaleThreads()),async exportToGithub(e){if(!t().snapshot)return null;let n;try{n=await Vk.exportToGithub({threadIds:e})}catch(e){return j(`Adding to the GitHub review`,e),null}let r=n.skipped.filter(e=>e.reason!==`already in the review`);if(r.length){let e=n.posted+n.updated+n.skipped.length;t().flash(`Skipped ${r.length} of ${e} (${r.map(e=>e.reason).join(`, `)})`)}return n.posted>0?`added`:n.updated>0?`updated`:`unchanged`},async setViewed(n,r){let i=t().snapshot?.changed.find(e=>e.path===n);i&&(e(e=>({viewed:[...e.viewed.filter(e=>e.path!==n||e.blob!==i.blob),{path:n,blob:i.blob,viewed:r}],collapsed:{...e.collapsed,[n]:r}})),r&&me(n),await ke(`Marking viewed`,()=>Vk.setViewed(n,i.blob,r)))},async unviewAll(){let n=t().snapshot;if(!n)return;let r=n.changed.map(e=>({path:e.path,blob:e.blob,viewed:!1})),i={};for(let e of n.changed)i[e.path]=!1;e({viewed:r,collapsed:i}),await ke(`Marking all not viewed`,()=>Vk.setViewedBulk(r))},toggleCollapsed(n){let r=JM(t(),n);e(e=>({collapsed:{...e.collapsed,[n]:!r}})),r?t().loadPatch(n):me(n)},async saveConfig(t){let n=0;try{let r=await x(()=>(n=v.start(),Vk.saveConfig(t)));v.latest(n)&&e({config:r})}catch(e){v.latest(n)&&j(`Saving settings`,e)}},jumpTo(n,r,i){le(),r!=null&&ue(n);let a=PM(t(),n);if(r==null){let t=se(),n=t.findIndex(e=>e.id===a),r=t[n];r&&!r.collapsed&&r.rows.length&&e({selection:jN(t,{itemIndex:n,rowIndex:Math.max(0,r.rows.findIndex(e=>e.hunkStart))}),visualAnchor:null})}if(r!=null&&i!==`old`){let i=se().find(e=>e.id===a);if(i!=null&&t().loaded[n]?.kind===`diff`&&!i.rows.some(e=>e.side===`additions`&&e.line===r)){e(e=>({activePath:n,reveal:{id:a,path:n,line:r,nonce:(e.reveal?.nonce??0)+1}}));return}}e(e=>({scrollTarget:{id:a,line:r,side:i,align:r?`eye`:`start`,nonce:(e.scrollTarget?.nonce??0)+1},activePath:n}))},setActivePath(t){e({activePath:t})}}});function iP(e,t){return e.blob===t.blob&&e.status===t.status&&e.oldPath===t.oldPath&&e.additions===t.additions&&e.deletions===t.deletions}async function aP(e,t,n,r){let i=0,a=Array.from({length:Math.min(t,e.length)},async()=>{for(;i<e.length&&!n();)await r(e[i++])});await Promise.all(a)}function oP({path:e,className:t,nowrap:n=!1}){let r=e.lastIndexOf(`/`)+1,i=e.slice(0,r).split(`/`).filter(Boolean),a=e.slice(r);return(0,g.jsxs)(`span`,{className:mj(`font-mono break-normal wrap-anywhere`,n&&`min-w-0 truncate`,t),title:e,children:[i.length>0&&(0,g.jsx)(`span`,{className:`text-muted`,children:i.map((e,t)=>(0,g.jsxs)(p.Fragment,{children:[e,`/`,(0,g.jsx)(`wbr`,{})]},t))}),(0,g.jsx)(`span`,{className:`font-semibold text-foreground`,children:a})]})}var sP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cP=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lP={};function uP(e,t){return((t||lP).jsx?cP:sP).test(e)}var dP=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
1599
- `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),fP=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(dP());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),pP=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),mP=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(fP()),r=pP();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),hP=_P(`end`),gP=_P(`start`);function _P(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function vP(e){let t=gP(e),n=hP(e);if(t&&n)return{start:t,end:n}}function yP(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?xP(e.position):`start`in e||`end`in e?xP(e):`line`in e||`column`in e?bP(e):``}function bP(e){return SP(e&&e.line)+`:`+SP(e&&e.column)}function xP(e){return bP(e&&e.start)+`-`+bP(e&&e.end)}function SP(e){return e&&typeof e==`number`?e:1}var CP=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=yP(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};CP.prototype.file=``,CP.prototype.name=``,CP.prototype.reason=``,CP.prototype.message=``,CP.prototype.stack=``,CP.prototype.column=void 0,CP.prototype.line=void 0,CP.prototype.ancestors=void 0,CP.prototype.cause=void 0,CP.prototype.fatal=void 0,CP.prototype.place=void 0,CP.prototype.ruleId=void 0,CP.prototype.source=void 0;var wP=l(mP(),1),TP={}.hasOwnProperty,EP=new Map,DP=/[A-Z]/g,OP=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),kP=new Set([`td`,`th`]),AP=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function jP(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=HP(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=VP(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Ni:Mi,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=MP(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function MP(e,t,n){if(t.type===`element`)return NP(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return PP(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return IP(e,t,n);if(t.type===`mdxjsEsm`)return FP(e,t);if(t.type===`root`)return LP(e,t,n);if(t.type===`text`)return RP(e,t)}function NP(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Ni,e.schema=i),e.ancestors.push(t);let a=JP(e,t.tagName,!1),o=UP(e,t),s=GP(e,t);return OP.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!pa(e)})),zP(e,o,a,t),BP(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function PP(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}YP(e,t.position)}function FP(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);YP(e,t.position)}function IP(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Ni,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:JP(e,t.name,!0),o=WP(e,t),s=GP(e,t);return zP(e,o,a,t),BP(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function LP(e,t,n){let r={};return BP(r,GP(e,t)),e.create(t,e.Fragment,r,n)}function RP(e,t){return t.value}function zP(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function BP(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function VP(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function HP(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=gP(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function UP(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&TP.call(t.properties,i)){let a=KP(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&kP.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function WP(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else YP(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else YP(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function GP(e,t){let n=[],r=-1,i=e.passKeys?new Map:EP;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=MP(e,a,o);s!==void 0&&n.push(s)}return n}function KP(e,t,n){let r=ki(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?ua(n):da(n)),r.property===`style`){let t=typeof n==`object`?n:qP(e,String(n));return e.stylePropertyNameCase===`css`&&(t=XP(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Ti[r.property]||r.property:r.attribute,n]}}function qP(e,t){try{return(0,wP.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new CP("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=AP+`#cannot-parse-style-attribute`,r}}function JP(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=uP(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=uP(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return TP.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);YP(e)}function YP(e,t){let n=new CP("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=AP+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function XP(e){let t={},n;for(n in e)TP.call(e,n)&&(t[ZP(n)]=e[n]);return t}function ZP(e){let t=e.replace(DP,QP);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function QP(e){return`-`+e.toLowerCase()}var $P={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},eF={};function tF(e,t){let n=t||eF;return nF(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function nF(e,t,n){if(iF(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return rF(e.children,t,n)}return Array.isArray(e)?rF(e,t,n):``}function rF(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=nF(e[i],t,n);return r.join(``)}function iF(e){return!!(e&&typeof e==`object`)}var aF=document.createElement(`i`);function oF(e){let t=`&`+e+`;`;aF.innerHTML=t;let n=aF.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function sF(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function cF(e,t){return e.length>0?(sF(e,e.length,0,t),e):t}var lF={}.hasOwnProperty;function uF(e){let t={},n=-1;for(;++n<e.length;)dF(t,e[n]);return t}function dF(e,t){let n;for(n in t){let r=(lF.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){lF.call(r,a)||(r[a]=[]);let e=i[a];fF(r[a],Array.isArray(e)?e:e?[e]:[])}}}function fF(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);sF(e,0,0,r)}function pF(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function mF(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var hF=DF(/[A-Za-z]/),gF=DF(/[\dA-Za-z]/),_F=DF(/[#-'*+\--9=?A-Z^-~]/);function vF(e){return e!==null&&(e<32||e===127)}var yF=DF(/\d/),bF=DF(/[\dA-Fa-f]/),xF=DF(/[!-/:-@[-`{-~]/);function SF(e){return e!==null&&e<-2}function CF(e){return e!==null&&(e<0||e===32)}function wF(e){return e===-2||e===-1||e===32}var TF=DF(/\p{P}|\p{S}/u),EF=DF(/\s/);function DF(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function OF(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&gF(e.charCodeAt(n+1))&&gF(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function kF(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return wF(r)?(e.enter(n),s(r)):t(r)}function s(r){return wF(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var AF={tokenize:jF};function jF(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),kF(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return SF(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var MF={tokenize:PF},NF={tokenize:FF};function PF(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return sF(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(NF,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(NF,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return SF(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;sF(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function FF(e,t,n){return kF(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function IF(e){if(e===null||CF(e)||EF(e))return 1;if(TF(e))return 2}function LF(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var RF={name:`attention`,resolveAll:zF,tokenize:BF};function zF(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};VF(d,-c),VF(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=cF(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=cF(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=cF(l,LF(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=cF(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=cF(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,sF(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function BF(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=IF(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=IF(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function VF(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var HF={name:`autolink`,tokenize:UF};function UF(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return hF(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||gF(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||gF(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||vF(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):_F(t)?(e.consume(t),l):n(t)}function u(e){return gF(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||gF(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var WF={partial:!0,tokenize:GF};function GF(e,t,n){return r;function r(t){return wF(t)?kF(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||SF(e)?t(e):n(e)}}var KF={continuation:{tokenize:JF},exit:YF,name:`blockQuote`,tokenize:qF};function qF(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return wF(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function JF(e,t,n){let r=this;return i;function i(t){return wF(t)?kF(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(KF,t,n)(r)}}function YF(e){e.exit(`blockQuote`)}var XF={name:`characterEscape`,tokenize:ZF};function ZF(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return xF(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var QF={name:`characterReference`,tokenize:$F};function $F(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=gF,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=bF,u):(e.enter(`characterReferenceValue`),a=7,o=yF,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===gF&&!oF(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var eI={partial:!0,tokenize:rI},tI={concrete:!0,name:`codeFenced`,tokenize:nI};function nI(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),wF(t)?kF(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||SF(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(eI,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||SF(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):wF(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),kF(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||SF(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||SF(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&wF(t)?kF(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||SF(t)?e.check(eI,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||SF(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),wF(t)?kF(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),wF(t)?kF(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||SF(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function rI(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var iI={name:`codeIndented`,tokenize:oI},aI={partial:!0,tokenize:sI};function oI(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),kF(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):SF(t)?e.attempt(aI,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||SF(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function sI(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):SF(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):kF(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):SF(e)?i(e):n(e)}}var cI={name:`codeText`,previous:uI,resolve:lI,tokenize:dI};function lI(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function uI(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function dI(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):SF(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||SF(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var fI=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&pI(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),pI(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),pI(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);pI(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);pI(this.left,t.reverse())}}}};function pI(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function mI(e){let t={},n=-1,r,i,a,o,s,c,l,u=new fI(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,hI(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return sF(e,0,1/0,u.slice(0)),!l}function hI(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var gI={resolve:vI,tokenize:yI},_I={partial:!0,tokenize:bI};function vI(e){return mI(e),e}function yI(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):SF(t)?e.check(_I,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function bI(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),kF(e,a,`linePrefix`)}function a(i){if(i===null||SF(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function xI(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||vF(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||SF(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||CF(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||vF(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function SI(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):SF(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||SF(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!wF(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function CI(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):SF(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),kF(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||SF(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function wI(e,t){let n;return r;function r(i){return SF(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):wF(i)?kF(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var TI={name:`definition`,tokenize:DI},EI={partial:!0,tokenize:OI};function DI(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return SI.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=mF(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return CF(t)?wI(e,l)(t):l(t)}function l(t){return xI(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(EI,d,d)(t)}function d(t){return wF(t)?kF(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||SF(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function OI(e,t,n){return r;function r(t){return CF(t)?wI(e,i)(t):n(t)}function i(t){return CI(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return wF(t)?kF(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||SF(e)?t(e):n(e)}}var kI={name:`hardBreakEscape`,tokenize:AI};function AI(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return SF(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var jI={name:`headingAtx`,resolve:MI,tokenize:NI};function MI(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},sF(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function NI(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||CF(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||SF(n)?(e.exit(`atxHeading`),t(n)):wF(n)?kF(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||CF(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var PI=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),FI=[`pre`,`script`,`style`,`textarea`],II={concrete:!0,name:`htmlFlow`,resolveTo:zI,tokenize:BI},LI={partial:!0,tokenize:HI},RI={partial:!0,tokenize:VI};function zI(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function BI(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):hF(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):hF(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return hF(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||CF(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&FI.includes(l)?(i=1,r.interrupt?t(s):O(s)):PI.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||gF(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return wF(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||hF(t)?(e.consume(t),b):wF(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||gF(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):wF(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):wF(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||SF(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||CF(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||wF(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||SF(t)?O(t):wF(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):SF(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(LI,ee,k)(t)):t===null||SF(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(RI,A,ee)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||SF(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return FI.includes(n)?(e.consume(t),L):O(t)}return hF(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||SF(t)?(e.exit(`htmlFlowData`),ee(t)):(e.consume(t),L)}function ee(n){return e.exit(`htmlFlow`),t(n)}}function VI(e,t,n){let r=this;return i;function i(t){return SF(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function HI(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(WF,t,n)}}var UI={name:`htmlText`,tokenize:WI};function WI(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):hF(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):hF(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):SF(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):SF(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):SF(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):SF(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return hF(t)?(e.consume(t),S):n(t)}function S(t){return t===45||gF(t)?(e.consume(t),S):C(t)}function C(t){return SF(t)?(o=C,N(t)):wF(t)?(e.consume(t),C):M(t)}function w(t){return t===45||gF(t)?(e.consume(t),w):t===47||t===62||CF(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||hF(t)?(e.consume(t),E):SF(t)?(o=T,N(t)):wF(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||gF(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):SF(t)?(o=D,N(t)):wF(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):SF(t)?(o=O,N(t)):wF(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):SF(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||CF(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||CF(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return wF(t)?kF(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var GI={name:`labelEnd`,resolveAll:YI,resolveTo:XI,tokenize:ZI},KI={tokenize:QI},qI={tokenize:$I},JI={tokenize:eL};function YI(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&sF(e,0,e.length,n),e}function XI(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=cF(s,e.slice(a+1,a+r+3)),s=cF(s,[[`enter`,u,t]]),s=cF(s,LF(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=cF(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=cF(s,e.slice(o+1)),s=cF(s,[[`exit`,c,t]]),sF(e,a,e.length,s),e}function ZI(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(mF(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(KI,u,o?u:d)(t):t===91?e.attempt(qI,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(JI,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function QI(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return CF(t)?wI(e,a)(t):a(t)}function a(t){return t===41?u(t):xI(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return CF(t)?wI(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?CI(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return CF(t)?wI(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function $I(e,t,n){let r=this;return i;function i(t){return SI.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(mF(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function eL(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var tL={name:`labelStartImage`,resolveAll:GI.resolveAll,tokenize:nL};function nL(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var rL={name:`labelStartLink`,resolveAll:GI.resolveAll,tokenize:iL};function iL(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var aL={name:`lineEnding`,tokenize:oL};function oL(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),kF(e,t,`linePrefix`)}}var sL={name:`thematicBreak`,tokenize:cL};function cL(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||SF(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),wF(t)?kF(e,s,`whitespace`)(t):s(t))}}var lL={continuation:{tokenize:pL},exit:hL,name:`list`,tokenize:fL},uL={partial:!0,tokenize:gL},dL={partial:!0,tokenize:mL};function fL(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:yF(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(sL,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return yF(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(WF,r.interrupt?n:u,e.attempt(uL,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return wF(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function pL(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(WF,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,kF(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!wF(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(dL,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,kF(e,e.attempt(lL,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function mL(e,t,n){let r=this;return kF(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function hL(e){e.exit(this.containerState.type)}function gL(e,t,n){let r=this;return kF(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!wF(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var _L={name:`setextUnderline`,resolveTo:vL,tokenize:yL};function vL(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function yL(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),wF(t)?kF(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||SF(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var bL={tokenize:xL};function xL(e){let t=this,n=e.attempt(WF,r,e.attempt(this.parser.constructs.flowInitial,i,kF(e,e.attempt(this.parser.constructs.flow,i,e.attempt(gI,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var SL={resolveAll:EL()},CL=TL(`string`),wL=TL(`text`);function TL(e){return{resolveAll:EL(e===`text`?DL:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function EL(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function DL(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var OL=s({attentionMarkers:()=>IL,contentInitial:()=>AL,disable:()=>LL,document:()=>kL,flow:()=>ML,flowInitial:()=>jL,insideSpan:()=>FL,string:()=>NL,text:()=>PL}),kL={42:lL,43:lL,45:lL,48:lL,49:lL,50:lL,51:lL,52:lL,53:lL,54:lL,55:lL,56:lL,57:lL,62:KF},AL={91:TI},jL={[-2]:iI,[-1]:iI,32:iI},ML={35:jI,42:sL,45:[_L,sL],60:II,61:_L,95:sL,96:tI,126:tI},NL={38:QF,92:XF},PL={[-5]:aL,[-4]:aL,[-3]:aL,33:tL,38:QF,42:RF,60:[HF,UI],91:rL,92:[kI,XF],93:GI,95:RF,96:cI},FL={null:[RF,SL]},IL={null:[42,95]},LL={null:[]};function RL(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=cF(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=LF(a,l.events,l),l.events):[]}function f(e,t){return BL(p(e),t)}function p(e){return zL(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){SF(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&sF(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function zL(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function BL(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
1596
+ `)}function zM(e,t,n){return{kind:`line`,path:e,...t,quoted:RM(n,t.startLine,t.endLine)}}function BM(e,t,n){return`${e?`diff`:`file`}:${t}@${n}`}function VM(e){return e.replace(/^(diff|file):/,``).replace(/@\d+$/,``)}function HM(e,t){return BM(e.fileView?.path!==t&&(e.snapshot?.changed.some(e=>e.path===t)??!1),t,e.gens[t]??0)}var UM=e=>e.additions+e.deletions;function WM(e,t,n,r){let i=new Map(t.map(e=>[e.path,e])),a=e=>n.includes(e)?0:(r(e)?4:2)+ +(UM(i.get(e))>4e3),o=GM(e).filter(e=>i.has(e)).sort((e,t)=>a(e)-a(t)),s=[],c=[],l=0;for(let e of o){let t=UM(i.get(e));c.length>0&&(c.length>=12||l+t>4e3)&&(s.push(c),c=[],l=0),c.push(e),l+=t}return c.length>0&&s.push(c),s}function GM(e){return e.changed.map(e=>e.path).sort(JM)}function KM(e,t,n){let r=new Map(e.changed.map(e=>[e.path,e])),i=GM(e),a=i.indexOf(t);if(a===-1)return null;for(let e of i.slice(a+1)){let t=r.get(e);if(n(t))return t}return null}function qM(e){return e.activePath??e.fileView?.path??(e.snapshot&&GM(e.snapshot)[0])??null}function JM(e,t){let n=e.split(`/`),r=t.split(`/`),i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=n[e],i=r[e];if(t===i)continue;let a=e<n.length-1;if(a!==e<r.length-1)return a?-1:1;let o=t.toLowerCase(),s=i.toLowerCase(),c=YM(o,s);return c===0?o===s?t<i?-1:1:o<s?-1:1:c}return n.length-r.length}function YM(e,t){let n=XM(e),r=XM(t),i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=n[e],i=r[e];if(t===i)continue;if(typeof t==`number`&&typeof i==`number`)return t<i?-1:1;let a=String(t),o=String(i);if(a!==o)return a<o?-1:1}return n.length-r.length}function XM(e){let t=[];for(let n of e.matchAll(/\d+|\D+/g))t.push(/^\d/.test(n[0])?Number(n[0]):n[0]);return t.length===0&&t.push(``),t}function ZM(e,t){let n=e.viewed.find(e=>e.path===t.path&&e.blob===t.blob);return n?n.viewed?`viewed`:`unviewed`:e.viewed.some(e=>e.path===t.path&&e.viewed&&e.blob!==t.blob)?`restale`:dN(e.config,t.path)?`viewed`:`unviewed`}function QM(e,t){return ZM(e,t)===`viewed`}function $M(e,t){let n=0;for(let r of t)QM(e,r)&&n++;return n}function eN(e,t){let n=e.collapsed[t];if(n!=null)return n;let r=e.snapshot?.changed.find(e=>e.path===t);return r?QM(e,r)||r.generated:!1}function tN(e){return e.showResolved?e.threads:e.threads.filter(e=>!e.resolved)}function nN(e){return e.kind===`file`?`whole file`:rN(e)}function rN(e){let t=e.startLine===e.endLine?`${e.startLine}`:`${e.startLine}–${e.endLine}`;return`${e.side===`old`?`removed `:``}L${t}`}function iN(e,t,n){let r=e.loaded[t];return PM(n,r?.kind===`diff`?r.fileDiff:void 0)}function aN(e){let t=e.draft;return t?.selection?iN(e,t.path,t.selection):null}function oN(e,t){return e.find(e=>e.messages.some(e=>e.id===t))}function sN(e,t){if(e===t)return t;let n=new Map(e.map(e=>[e.id,e])),r=e.length===t.length,i=t.map((t,i)=>{let a=n.get(t.id),o=a&&JSON.stringify(a)===JSON.stringify(t)?a:t;return o!==e[i]&&(r=!1),o});return r?e:i}function cN(e,t,n,r){let i=e.replyTo!=null&&n.some(t=>t.id===e.replyTo)?e.replyTo:null,a=e.editingId!=null&&oN(n,e.editingId)?e.editingId:null;return[...n,e.draft?.path===t?e.draft:null,r,i,a]}function lN(e,t){return e&&e.deps.length===t.length&&e.deps.every((e,n)=>e===t[n])?e:{deps:t,version:(e?.version??0)+1}}var uN=new Map;function dN(e,t){let n=e.autoViewed.join(`
1597
+ `),r=uN.get(n);if(!r){let t=e.autoViewed.filter(Boolean);r=t.length?(0,NM.default)(t,{dot:!0,basename:!0}):()=>!1,uN.set(n,r)}return r(t)}function fN(e,t){let n=t.trim().toLowerCase();if(!n)return e;let r=[];for(let t of e){let e=t.name.toLowerCase();e.startsWith(n)?r.push([0,t]):e.includes(n)?r.push([1,t]):pN(n,e)&&r.push([2,t])}return r.sort((e,t)=>e[0]-t[0]).map(e=>e[1])}function pN(e,t){let n=0;for(let r of t)if(r===e[n]&&++n===e.length)return!0;return!1}function mN(e,t){return{kind:`revspec`,args:[`HEAD~${e}..HEAD~${t}`]}}function hN(e){return e===`updated`?`Updated`:e===`unchanged`?`Already added`:`Added`}function gN(e){let t=e.root.split(/[\\/]/).filter(Boolean);return t[t.length-1]??e.root}function _N(e,t=null){let n=t?.pullRequest;return n?`diffle: ${n.repository} #${n.number}`:`diffle: ${gN(e)}`}var vN=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},yN=(e=>e?vN(e):vN),bN=e=>e;function xN(e,t=bN){let n=p.useSyncExternalStore(e.subscribe,p.useCallback(()=>t(e.getState()),[e,t]),p.useCallback(()=>t(e.getInitialState()),[e,t]));return p.useDebugValue(n),n}var SN=e=>{let t=yN(e),n=e=>xN(t,e);return Object.assign(n,t),n},CN=(e=>e?SN(e):SN);function wN(e,t=[],n=`unified`){let r=[],i=TN(e,t),a=0;for(let t of e.hunks){let e=t.deletionStart,o=t.additionStart;for(;a<i.length&&i[a]<o;)r.push({side:`additions`,line:i[a++],hunkStart:!1});for(let i of t.hunkContent)if(i.type===`context`){for(let e=0;e<i.lines;e++)r.push({side:`additions`,line:o+e,hunkStart:!1});e+=i.lines,o+=i.lines}else{let t=t=>({side:`deletions`,line:e+t,hunkStart:t===0&&i.additions===0}),a=e=>({side:`additions`,line:o+e,hunkStart:e===0});if(n===`split`){for(let e=0;e<i.additions;e++)r.push(a(e));for(let e=i.additions;e<i.deletions;e++)r.push(t(e))}else{for(let e=0;e<i.deletions;e++)r.push(t(e));for(let e=0;e<i.additions;e++)r.push(a(e))}e+=i.deletions,o+=i.additions}}for(;a<i.length;)r.push({side:`additions`,line:i[a++],hunkStart:!1});return r}function TN(e,t){if(t.length===0)return[];let n=new Set;for(let t of e.hunks){let e=t.additionStart;for(let r of t.hunkContent){let t=r.type===`context`?r.lines:r.additions;for(let r=0;r<t;r++)n.add(e+r);e+=t}}let r=new Set;for(let[e,i]of t)for(let t=e;t<=i;t++)n.has(t)||r.add(t);return[...r].sort((e,t)=>e-t)}function EN(e){let t=e.split(`
1598
+ `);return t.length&&t[t.length-1]===``&&t.pop(),t.map((e,t)=>({side:`additions`,line:t+1,hunkStart:t===0}))}function DN(e,t,n,r,i={},a=`unified`,o=null){if(o){if(!o.item)return[];let e=BM(!1,o.path,n[o.path]??0);return[{id:e,path:o.path,collapsed:!1,rows:kN(o.item,i[e],a)}]}let s=[];for(let o of GM(e)){let e=t[o],c=BM(!0,o,n[o]??0);s.push({id:c,path:o,collapsed:r(o),rows:e?kN(e,i[c],a):[]})}return s}var ON=new WeakMap;function kN(e,t,n){let r=e.kind===`diff`?e.fileDiff:e.kind===`file`?e.file:null;if(!r)return[];let i=ON.get(r);if(i&&i.revealed===t&&i.style===n)return i.rows;let a=e.kind===`diff`?wN(e.fileDiff,t,n):EN(e.file.contents);return ON.set(r,{revealed:t,style:n,rows:a}),a}function AN(e,t){if(!t)return null;let n=e.findIndex(e=>e.id===t.id);if(n===-1)return null;let r=t.range.endSide??t.range.side??`additions`,i=e[n].rows,a=i.findIndex(e=>e.line===t.range.end&&e.side===r);if(a===-1&&(a=i.findIndex(e=>e.line===t.range.end)),a===-1){let e=1/0;if(i.forEach((n,i)=>{let o=Math.abs(n.line-t.range.end)+(n.side===r?0:.5);o<e&&(e=o,a=i)}),a===-1)return null}return{itemIndex:n,rowIndex:a}}function jN(e,t,n){if(e.length===0)return null;if(!t)return MN(e,n===1?0:e.length-1,n);if(t.rowIndex===-1){let r=e[t.itemIndex];return r&&!r.collapsed&&r.rows.length>0?{itemIndex:t.itemIndex,rowIndex:n===1?0:r.rows.length-1}:MN(e,t.itemIndex+n,n)??t}let{itemIndex:r,rowIndex:i}=t;for(i+=n;i<0||i>=(e[r]?.rows.length??0);){if(r+=n,r<0||r>=e.length)return t;let a=e[r];if(a.collapsed)return{itemIndex:r,rowIndex:-1};a.rows.length!==0&&(i=n===1?0:a.rows.length-1)}return{itemIndex:r,rowIndex:i}}function MN(e,t,n){for(let r=t;r>=0&&r<e.length;r+=n){let t=e[r];if(t.collapsed)return{itemIndex:r,rowIndex:-1};if(t.rows.length>0)return{itemIndex:r,rowIndex:n===1?0:t.rows.length-1}}return null}function NN(e,t,n){if(e.length===0)return null;let r=t?t.itemIndex+n:n===1?0:e.length-1;return r<0||r>=e.length?t:{itemIndex:r,rowIndex:e[r].collapsed?-1:0}}function PN(e,t,n){let r=[];if(e.forEach((e,t)=>{e.collapsed||e.rows.forEach((e,n)=>e.hunkStart&&r.push({itemIndex:t,rowIndex:n}))}),r.length===0)return t;if(!t)return n===1?r[0]:r[r.length-1];let i=e=>e.itemIndex*1e7+e.rowIndex,a=i(t);return n===1?r.find(e=>i(e)>a)??t:[...r].reverse().find(e=>i(e)<a)??t}function FN(e,t,n){let r=e[t.itemIndex],i=r?.rows[t.rowIndex];if(!r||!i)return null;if(n&&n.itemIndex===t.itemIndex){let e=r.rows[n.rowIndex];if(e)return{id:r.id,range:{start:e.line,side:e.side,end:i.line,endSide:i.side}}}return{id:r.id,range:{start:i.line,side:i.side,end:i.line,endSide:i.side}}}function IN(e){let t=Ek(e);return t===`json`||t===`jsonc`||t===`yaml`||t===`toml`}var LN=null,RN=null,zN=null,BN=null,VN={get:()=>zN??LN,element:()=>zN?BN:RN,set(e,t=null){LN=e,RN=e?t:null},focus(e,t=null){zN=e,BN=e?t:null}},HN={python:`python`,javascript:`javascript`,javascriptreact:`javascript`,typescript:`typescript`,typescriptreact:`tsx`,rust:`rust`,go:`go`,c:`c`,cpp:`cpp`,ruby:`ruby`,java:`java`,lua:`lua`,zig:`zig`,swift:`swift`,php:`php`,shellscript:`bash`,ocaml:`ocaml`};function UN(e){let t=Ek(e);return t&&t in HN?HN[t]:null}var WN=null,GN=!1,KN=0,qN=new Map;function JN(){GN=!0,WN?.terminate(),WN=null;for(let e of qN.values())e(!1);qN.clear()}async function YN(e,t,n,r,i){let a=UN(e);if(!a||GN||typeof Worker>`u`)return!1;try{let o=await i();if(o.length>1e6||GN)return!1;WN||(WN=new Worker(new URL(``+new URL(`syntax.worker-Cc0dIGs8.js`,import.meta.url).href,``+import.meta.url),{type:`module`}),WN.onmessage=({data:e})=>{qN.get(e.id)?.(e.blocked),qN.delete(e.id)},WN.onerror=JN,WN.onmessageerror=JN);let s=++KN;return await new Promise(i=>{let c=setTimeout(JN,5e3);qN.set(s,e=>{clearTimeout(c),i(e)});try{WN.postMessage({id:s,key:`${t}:${e}`,grammar:a,contents:o,line:n,col:r})}catch{JN()}})}catch{return!1}}var XN={light:`github-light-high-contrast`,dark:`github-dark-high-contrast`},ZN=`diffle:theme`;function QN(){try{let e=localStorage.getItem(ZN);if(e===`light`||e===`dark`||e===`system`)return e}catch{}return`system`}function $N(e){try{localStorage.setItem(ZN,e)}catch{}}function eP(e){let t=document.documentElement;e===`system`?(delete t.dataset.theme,t.style.colorScheme=`light dark`):(t.dataset.theme=e,t.style.colorScheme=e)}function tP(e){return e===`system`?`light`:e===`light`?`dark`:`system`}var nP=`diffle:diffStyle`,rP=3500;function iP(){try{return localStorage.getItem(nP)===`unified`?`unified`:`split`}catch{return`split`}}var aP=`diffle:layout`,oP={treeWidth:null,panelWidth:null,treeVisible:!0,panelVisible:!0};function sP(){try{let e=localStorage.getItem(aP);return e?{...oP,...JSON.parse(e)}:oP}catch{return oP}}var X=CN((e,t)=>{let n=0,r=0,i=e=>e===n,a=0,o=0,s=null,c=()=>{s&&=(clearTimeout(s.timer),s.wake(),null)},l=new AbortController,u=new Map,d=()=>(l.abort(),l=new AbortController,u.clear(),++n),f=0,p=()=>(f++,d()),m=()=>{let e=0;return{start:()=>++e,latest:t=>t===e}},h=m(),g=m(),_=m(),v=m(),y=()=>{let e=Promise.resolve();return t=>{let n=e.then(t);return e=n.catch(()=>{}),n}},b=y(),x=y(),S=0,C=!1,w=e=>e<=S||!C&&e<=(t().snapshot?.version??0),T=()=>{let e=g.start(),t=_.start();return Promise.all([Hk.threads(),Hk.viewed()]).then(([n,r])=>({threads:n,viewed:r,tt:e,tv:t}))},E=async(t,n,r)=>{i(n)&&(_.latest(r.tv)&&e({viewed:r.viewed}),g.latest(r.tt)&&ke(r.threads),await ie(t,n))},D=(e,t)=>{let r=`${n}\0${t}\0${e}`,i=u.get(r);return i||(i=Hk.file(e,t,l.signal),u.set(r,i),i.catch(()=>u.delete(r))),i},O=e=>e?.name===`AbortError`,k=async(e,t)=>{for(;;)try{return await D(e,t)}catch(e){if(!O(e))throw e}},A=e=>e instanceof Error?e.message:String(e),j=(e,n)=>t().flash(`${e} failed: ${A(n)}`),M=async(r,a)=>{let o=t().contents[r]?.[a];if(o!=null)return o;let s=n,c=await k(r,a);return i(s)&&e(e=>({contents:{...e.contents,[r]:{...e.contents[r],[a]:c.contents}}})),c.contents},N=(e,t)=>{let n={...e.gens};for(let e of t)n[e]=(n[e]??0)+1;let r=r=>{let i=VM(r.id);return t.includes(i)?{...r,id:HM({snapshot:e.snapshot,gens:n,fileView:e.fileView},i)}:r};return{gens:n,selection:e.selection&&r(e.selection),draft:e.draft&&{...e.draft,selection:e.draft.selection&&r(e.draft.selection)},scrollTarget:e.scrollTarget&&r(e.scrollTarget),reveal:e.reveal&&r(e.reveal)}},P=async(n,r,a)=>{let o=new Map(n.changed.map(e=>[e.path,e])),s=r.filter(e=>o.has(e));if(s.length===0)return;let c={},l=[],u=t().loaded;for(let e of s){let t=o.get(e);t.binary?c[e]={kind:`binary`}:UM(t)>1e4&&u[e]?.kind!==`diff`?c[e]={kind:`oversized`,lines:UM(t)}:l.push(t)}Object.keys(c).length>0&&e(e=>({loaded:{...e.loaded,...c},...N(e,Object.keys(c))}));let d=t();await lP(WM(n,l,[d.fileView?.path,d.activePath,d.selection&&VM(d.selection.id)].filter(e=>e!=null),e=>eN(d,e)),2,()=>!i(a),e=>F(n,e,a))},F=async(t,n,r)=>{let a=new Map(t.changed.map(e=>[e.path,e])),o={},s=new Map;try{let e=Am(n.length===1?await Hk.patch(n[0]):await Hk.patches(n),`s${t.version}c${t.context}t${Date.now()}`);for(let t of e)for(let e of t.files)s.set(e.name,e);for(let e of n){let t=s.get(e);o[e]=t?{kind:`diff`,fileDiff:t}:{kind:`error`,message:`patch missing for file`}}}catch(e){for(let t of n)o[t]={kind:`error`,message:String(e)}}i(r)&&(e(e=>({loaded:{...e.loaded,...o},...N(e,Object.keys(o))})),ee(n.filter(e=>!a.get(e).submodule),s,o,r))},I=[],L=0,ee=(e,t,n,r)=>{for(let i of e){let e=t.get(i);e?.isPartial&&e.hunks.length>0&&(e.type===`change`||e.type===`rename-changed`)&&I.push({path:i,file:e,replaces:n[i],g:r})}for(;L<4&&L<I.length;)L++,te()},te=async()=>{try{for(;;){let e=I.shift();if(!e)return;!i(e.g)||t().loaded[e.path]!==e.replaces||await ne(e)}}finally{L--}},ne=async({path:e,file:n,replaces:r,g:a})=>{let o=()=>!i(a)||t().loaded[e]!==r;try{let t=n.prevName??n.name,[i,s]=await Promise.all([D(t,`old`),D(n.name,`new`)]);if(o())return;let c=z_(`clone`,n,{oldFile:{name:t,contents:i.contents},newFile:{name:n.name,contents:s.contents}});B({path:e,fileDiff:c,old:i.contents,new:s.contents,replaces:r,g:a})}catch{}},R=[],z=null,B=e=>{R.push(e),!z&&(z=re,typeof requestAnimationFrame==`function`?requestAnimationFrame(re):setTimeout(re,0))},re=()=>{z=null;let n=R;R=[];let r=n.filter(e=>i(e.g)&&t().loaded[e.path]===e.replaces);r.length!==0&&e(e=>{let t={...e.loaded},n={...e.contents};for(let e of r)t[e.path]={kind:`diff`,fileDiff:e.fileDiff},n[e.path]={...n[e.path],old:e.old,new:e.new};return{loaded:t,contents:n,...N(e,r.map(e=>e.path))}})},ie=async(n,r)=>{let i=t().snapshot,a=i==null||i.mode.commentKey!==n.mode.commentKey,o=i!=null&&i.context!==n.context,s=i!=null&&(i.oldSha===`worktree`||i.oldSha!==n.oldSha),c=s||i!=null&&i.newSha!==n.newSha,l=new Map(i?.changed.map(e=>[e.path,e])??[]),u=new Map(n.changed.map(e=>[e.path,e])),d=a?{}:{...t().loaded},f=a||c?{}:{...t().contents},p=[];for(let e of n.changed){let t=l.get(e.path);if(a||o||s||!t||!cP(t,e)||d[e.path]==null){let t=d[e.path];t&&(d[e.path]={...t}),delete f[e.path],p.push(e.path)}}for(let e of l.keys())u.has(e)||(delete d[e],delete f[e]);let m=t().fileView,h=a||m==null||!m.external&&!n.tree.includes(m.path)?null:m,g=m!=null&&!m.external&&(c||l.has(m.path)!==u.has(m.path)||p.includes(m.path));h&&g&&delete f[h.path];let _={};if(!a)for(let[e,n]of Object.entries(t().collapsed))l.get(e)?.blob===u.get(e)?.blob&&(_[e]=n);let v=t().draft,y=v!=null&&!a&&(u.has(v.path)||h?.path===v.path);C=!1,e({snapshot:n,loaded:d,contents:f,fileView:h,collapsed:_,error:null,draft:y?v:null}),t().refreshGithub(),a&&e(e=>({selection:null,visualAnchor:null,replyTo:null,editingId:null,jumps:[],jumpIndex:0,revealed:{},reveal:null,scrollTarget:null,search:{...e.search,open:!1,kind:`text`,direction:1,matches:[],index:-1}})),await Promise.all([P(n,p,r),...h&&(g||!h.item)?[ae(h.path,h.external,r,!0)]:[]])},ae=async(n,r,a,o=!1)=>{let s=t().fileView?.from??{position:ce(),activePath:t().activePath};o||e({fileView:{path:n,external:r,item:null,from:s},selection:null,visualAnchor:null,draft:null,focusedThread:null});let c,l;try{let e=await D(n,`new`);l=e.contents,c=e.binary?{kind:`binary`}:{kind:`file`,file:{name:n,contents:e.contents,cacheKey:`${n}@full@${Date.now()}`}}}catch(e){c={kind:`error`,message:String(e)}}!i(a)||t().fileView?.path!==n||e(e=>({fileView:{path:n,external:r,item:c,from:e.fileView?.from??s},...N(e,[n]),contents:l==null?e.contents:{...e.contents,[n]:{...e.contents[n],new:l}}}))},oe=null,se=()=>{let e=t();if(!e.snapshot)return[];let n=[e.snapshot,e.loaded,e.gens,e.revealed,e.collapsed,e.viewed,e.config,e.diffStyle,e.fileView];if(oe&&oe.inputs.every((e,t)=>e===n[t]))return oe.items;let r=DN(e.snapshot,e.loaded,e.gens,t=>eN(e,t),e.revealed,e.diffStyle,e.fileView);return oe={inputs:n,items:r},r},ce=()=>{let e=t().selection;if(!e)return null;let n=VM(e.id),r=t().fileView;return r?.path===n?{path:n,side:IM(e),line:e.range.end,full:!0,...r.external?{external:!0}:{}}:{path:n,side:IM(e),line:e.range.end}},le=()=>{if(V)return;let n=ce();if(!n)return;let{jumps:r,jumpIndex:i}=t(),a=r.slice(0,i),o=a[a.length-1];if(o&&o.path===n.path&&o.line===n.line&&o.side===n.side&&!!o.full==!!n.full){e({jumps:a,jumpIndex:a.length});return}let s=[...a,n].slice(-100);e({jumps:s,jumpIndex:s.length})},ue=n=>{eN(t(),n)&&e(e=>({collapsed:{...e.collapsed,[n]:!1}}))},V=!1,de=e=>{V=!0;let t=()=>{V=!1},n;try{n=e()}catch(e){throw t(),e}return n instanceof Promise?n.finally(t):(t(),n)},fe=async r=>{if(r.full&&t().fileView?.path!==r.path){let e=n;if(await ae(r.path,r.external??!1,e),!i(e)||t().fileView?.path!==r.path)return}else!r.full&&t().fileView&&e({fileView:null,selection:null,visualAnchor:null,draft:null,focusedThread:null});V=!0;try{pe(r)}finally{V=!1}},pe=t=>{t.full||ue(t.path);let n=se(),r=n.findIndex(e=>e.path===t.path);if(r===-1)return;let i=n[r],a=t.side===`old`?`deletions`:`additions`,o=i.rows.findIndex(e=>e.line===t.line&&e.side===a);if(o!==-1){ve({itemIndex:r,rowIndex:o},!1,`eye`);return}e(e=>({selection:{id:i.id,range:{start:t.line,side:a,end:t.line,endSide:a}},activePath:t.path,scrollTarget:{id:i.id,line:t.line,side:t.side,align:`eye`,nonce:(e.scrollTarget?.nonce??0)+1}}))},me=(n,r)=>{let i=t().snapshot,a=se(),o=a.find(e=>e.path===n);if(!i||!o)return;let s=KM(i,n,r),c=s?a.findIndex(e=>e.path===s.path):-1,l=a[c],u=null;if(l&&!l.collapsed&&l.rows.length>0){let e=l.rows.findIndex(e=>e.hunkStart);u=FN(a,{itemIndex:c,rowIndex:e===-1?0:e})}e(e=>({selection:u,visualAnchor:null,draft:null,activePath:l?l.path:n,scrollTarget:{id:o.id,align:`start`,nonce:(e.scrollTarget?.nonce??0)+1}}))},he=e=>!QM(t(),e),ge=e=>!eN(t(),e.path),_e=(e,t)=>{let n=e.selection;return{id:n.id,line:n.range.end,side:IM(n),align:t,nonce:(e.scrollTarget?.nonce??0)+1}},ve=(n,r=!1,i=`nearest`)=>{if(!n)return;i===`eye`&&le();let a=se(),o=FN(a,n,r?t().visualAnchor:null),s=a[n.itemIndex];if(!o||!s)return;let c=s.rows[n.rowIndex];e(e=>({selection:o,activePath:s.path,visualAnchor:r?e.visualAnchor:null,focusedThread:null,scrollTarget:{id:s.id,line:c.line,side:c.side===`deletions`?`old`:`new`,align:i,nonce:(e.scrollTarget?.nonce??0)+1}}))},ye=async(n,r,i=!1)=>{le(),await de(()=>i?t().openFullFile(n,void 0,!0):t().openFile(n)),ue(n);let a=se(),o=a.findIndex(e=>e.path===n);if(o===-1)return;let s=a[o],c=s.rows.findIndex(e=>e.side===`additions`&&e.line===r);if(c!==-1){de(()=>ve({itemIndex:o,rowIndex:c},!1,`eye`));return}e(e=>({selection:{id:s.id,range:{start:r,side:`additions`,end:r,endSide:`additions`}},activePath:n,visualAnchor:null,reveal:{id:s.id,path:n,line:r,nonce:(e.reveal?.nonce??0)+1}}))},be=e=>{let{lsp:n,snapshot:r}=t();return n.enabled?!r||!wk(r)?`Symbol navigation needs the new side to be the worktree or the checked-out commit`:Dk(n,e):Dk(n)},xe=e=>be(e.path)??(e.side===`old`?`Symbol navigation works on the new side only`:t().fileView?.external?`Symbol navigation starts from a repository file`:null),Se=e=>{let n=e?xe(e):be()??`Hover a symbol first`;return n?(t().flash(n),null):{path:e.path,line:e.line,col:e.col}},Ce=(t,n)=>i(t)&&h.latest(n)?!0:(h.latest(n)&&e(e=>({search:{...e.search,loading:!1}})),!1),we=async(r,a)=>{if(t().closeSymbolMenu(),r&&IN(r.path))return t().flash(`Configuration files support schema hover (gh)`);let o=Se(r);if(!o)return;let s=n;try{let n=await(a===`definition`?Hk.lspDefinition(o):Hk.lspTypeDefinition(o));if(!i(s))return;let c=n.locations[0];if(!c)return t().flash(`No ${a} found for ${r.text}`);if(a===`type definition`&&n.locations.length>1){e({references:{open:!0,kind:`types`,symbol:r.text,items:n.locations,index:0}});return}await ye(c.path,c.line,c.external)}catch(e){i(s)&&j(a===`definition`?`Go to definition`:`Go to type definition`,e)}},Te=()=>AN(se(),t().selection),Ee=()=>{let e=Te();if(e)return e;let n=se().findIndex(e=>e.path===t().activePath);return n===-1?null:{itemIndex:n,rowIndex:-1}},De=(t,n=!1,r=`nearest`)=>{if(!t)return;if(t.rowIndex!==-1)return ve(t,n,r);let i=se()[t.itemIndex];i&&e(e=>({selection:null,activePath:i.path,visualAnchor:null,focusedThread:null,scrollTarget:{id:i.id,align:r,nonce:(e.scrollTarget?.nonce??0)+1}}))},Oe=()=>{let e=t(),n=e.selection;if(!n)return;let r=VM(n.id),i=IM(n),a=n.range.end;return tN(e).find(e=>e.anchor.kind===`line`&&e.anchor.path===r&&e.anchor.side===i&&a>=e.anchor.startLine&&a<=e.anchor.endLine)},ke=n=>e({threads:sN(t().threads,n)}),Ae=async(e,n)=>{try{await n()}catch(t){return j(e,t)}await t().refreshThreads()},je=async(n,r)=>{let i=f,a=0;try{let t=await b(()=>(a=_.start(),r()));f===i&&_.latest(a)&&e({viewed:t})}catch(e){if(f!==i)return;j(n,e),t().refreshViewed()}},Me=null;return{layout:sP(),setLayout(n){let r={...t().layout,...n};try{localStorage.setItem(aP,JSON.stringify(r))}catch{}e({layout:r})},theme:QN(),setTheme(t){$N(t),eP(t),e({theme:t})},visualAnchor:null,editingId:null,setEditingId(t){e({editingId:t})},replyTo:null,focusedThread:null,focusThread(t){e({focusedThread:t})},openReply(n){let r=t().threads.find(e=>e.id===n);r&&e({replyTo:n,draft:null,activePath:r.anchor.path})},closeReply(){t().replyTo&&e({replyTo:null})},githubMenuOpen:!1,github:{status:`idle`},setGithubMenuOpen(n){e({githubMenuOpen:n,...n?{modeMenuOpen:!1}:{}}),n&&t().refreshGithub()},async refreshGithub(){let i=t().snapshot;if(!i)return;let a=n,o=++r,s=()=>a===n&&t().snapshot===i&&r===o;e({github:{status:`loading`}});try{let t=await Hk.github();s()&&e({github:t.version===i.version?{status:`ready`,data:t}:{status:`idle`}})}catch(t){s()&&e({github:{status:`error`,error:A(t)}})}},modeMenuOpen:!1,modePane:null,setModeMenuOpen(t){e({modeMenuOpen:t,modePane:null,...t?{githubMenuOpen:!1}:{}})},pickModeEntry(n){n===1?(e({modeMenuOpen:!1,modePane:null}),t().switchMode({kind:`working`})):n>=2&&n<=4&&e({modeMenuOpen:!0,modePane:n===2?`refs`:n===3?`commits`:`pr`})},helpOpen:!1,setHelpOpen(t){e({helpOpen:t})},treeModel:null,setTreeModel(t){e({treeModel:t})},toast:null,report:j,flash(t){e({toast:t}),Me&&clearTimeout(Me),Me=setTimeout(()=>e({toast:null}),rP)},search:{open:!1,kind:`text`,direction:1,ignoreCase:!0,regex:!1,scope:`diff`,content:{file:`diff`,diff:`diff`},path:null,focusNonce:0,input:``,editing:!1,query:``,matches:[],index:-1,loading:!1,truncated:!1},openSearch(t){h.start(),e(e=>{let n=t??e.search.scope,r=n===`file`?qM(e):null,i=e.search.kind===`text`&&e.search.scope===n&&e.search.path===r;return{search:{...e.search,open:!0,kind:`text`,direction:1,scope:n,matches:i?e.search.matches:[],index:i?e.search.index:-1,truncated:i&&e.search.truncated,loading:!1,input:e.search.open&&e.search.kind===`text`?e.search.input:e.search.query,editing:!0,path:r,focusNonce:e.search.focusNonce+1},...r?{scrollTarget:{id:HM(e,r),align:`start`,revealSearch:!0,nonce:(e.scrollTarget?.nonce??0)+1}}:{}}})},setSearchInput(t){e(e=>({search:{...e.search,input:t,editing:!0}}))},blurSearchInput(){e(e=>({search:{...e.search,editing:!1}}))},typeSearchInput(t){e(e=>({search:{...e.search,input:t===`Backspace`?Array.from(e.search.input).slice(0,-1).join(``):e.search.input+t,editing:!0,focusNonce:e.search.focusNonce+1},...e.search.scope===`file`&&e.search.path?{scrollTarget:{id:HM(e,e.search.path),align:`start`,revealSearch:!0,nonce:(e.scrollTarget?.nonce??0)+1}}:{}}))},setSearchOptions(n){let{content:r,...i}=n;e(e=>({search:{...e.search,...i,content:r?{...e.search.content,[e.search.scope]:r}:e.search.content}}));let{query:a,kind:o}=t().search;o===`text`&&a&&t().runSearch(a)},closeSearch(){h.start(),e(e=>({search:{...e.search,open:!1,editing:!1,kind:`text`,direction:1,matches:[],index:-1,loading:!1}}))},async runSearch(r){let i=n,a=h.start(),o=t().search.scope===`file`?t().search.path:null;e(e=>({search:{...e.search,kind:`text`,direction:1,query:r,input:r,editing:!1,path:o,loading:!0}}));try{let{ignoreCase:n,regex:s,scope:c,content:l}=t().search;if(c===`file`&&!o)return e(e=>({search:{...e.search,matches:[],index:-1,loading:!1}})),t().flash(`No file to search in`);let u=await Hk.search(r,{ignoreCase:n,regex:s,scope:c,content:l[c],...o?{path:o}:{}});if(!Ce(i,a))return;e(e=>({search:{...e.search,matches:u.matches,truncated:u.truncated,index:-1,loading:!1}})),u.matches.length?t().moveMatch(1):t().flash(c===`file`?`No matches for “${r}” in ${o}`:`No matches for “${r}” in ${l[c]===`diff`?`the diff + context`:`changed files`}`)}catch(t){if(!Ce(i,a))return;e(e=>({search:{...e.search,loading:!1}})),j(`Search`,t)}},moveMatch(n){let{search:r}=t(),i=r.matches.length;if(!i)return;let a=n*r.direction,o=((r.index<0?a===1?-1:0:r.index)+a+i)%i,s=r.matches[o];e({search:{...r,index:o}}),ye(s.path,s.line,s.external)},async searchWord(r){let i=VN.get()?.text;if(!i)return t().flash(`Focus a word first (w / b, or hover one)`);let a=n,o=h.start();e(e=>({search:{...e.search,open:!0,kind:`word`,direction:r,query:i,matches:[],index:-1,loading:!0,truncated:!1}}));try{let n=await Hk.search(i,{word:!0,scope:`repo`,content:`full`});if(!Ce(a,o))return;let s=n.matches,c=new Map(t().snapshot?.tree.map((e,t)=>[e,t])??[]),l=ce(),u=e=>c.get(e)??1/0,d=e=>l?u(e.path)-u(l.path)||e.line-l.line:r,f=r===1?s.findIndex(e=>d(e)>0):s.findLastIndex(e=>d(e)<0);f===-1&&s.length&&(f=r===1?0:s.length-1),e(e=>({search:{...e.search,matches:s,truncated:n.truncated,index:f,loading:!1}}));let p=s[f];p?ye(p.path,p.line):t().flash(`No other occurrence of “${i}”`)}catch(t){if(!Ce(a,o))return;e(e=>({search:{...e.search,loading:!1}})),j(`Search`,t)}},lsp:{enabled:!1,servers:[],missing:[]},setLspStatus(t){e({lsp:t})},symbolMenu:null,async openSymbolMenu(r,o,s){if(IN(r.path)){t().closeSymbolMenu();return}if(!t().lsp.enabled)return;t().closeHover();let c=++a,l=n,u=await YN(r.path,r.side,r.line,r.col,()=>M(r.path,r.side));if(!(!i(l)||c!==a)){if(u){e({symbolMenu:null});return}if(!xe(r)){let e=n,t=null;try{t=(await Hk.lspTokenKind({path:r.path,line:r.line,col:r.col}))?.kind??null}catch{}if(!i(e)||c!==a||t===`keyword`)return}e({symbolMenu:{target:r,x:o,y:s}})}},closeSymbolMenu(){a++,t().symbolMenu&&e({symbolMenu:null})},hover:null,async requestHover(r,a){let s=++o;if(t().symbolMenu||xe(r))return;let c=n;try{let n=await YN(r.path,r.side,r.line,r.col,()=>M(r.path,r.side));if(!i(c)||s!==o||t().symbolMenu)return;if(n){e({hover:null});return}let l=await Hk.lspHover({path:r.path,line:r.line,col:r.col});if(!i(c)||s!==o||t().symbolMenu)return;e({hover:l.contents?{target:r,contents:l.contents,anchor:a}:null})}catch{}},async showHover(){let e=t().symbolMenu?.target??VN.get();if(!Se(e))return;t().closeSymbolMenu();let n=VN.element()?.getBoundingClientRect(),r=n?{left:n.left,top:n.top,bottom:n.bottom}:{left:0,top:0,bottom:0};await new Promise(e=>setTimeout(e,0));let i=o+1;await t().requestHover(e,r),i===o&&!t().hover&&t().flash(`No hover information for ${e.text}`)},closeHover(){o++,t().hover&&e({hover:null})},async goToDefinition(e=t().symbolMenu?.target??VN.get()){await we(e,`definition`)},async goToTypeDefinition(e=t().symbolMenu?.target??VN.get()){await we(e,`type definition`)},async goToLink(e,n){t().closeHover(),t().closeSymbolMenu(),n==null?await t().openFile(e):await ye(e,n)},async findReferences(r=t().symbolMenu?.target??VN.get()){if(t().closeSymbolMenu(),r&&IN(r.path))return t().flash(`Configuration files support schema hover (gh)`);let a=Se(r);if(!a)return;let o=n;try{let n=await Hk.lspReferences(a);if(!i(o))return;let s=n.locations;if(s.length===0)return t().flash(`No references to ${r.text}`);let c=s.findIndex(e=>e.path===a.path&&e.line===a.line),l=c===-1?0:(c+1)%s.length;e({references:{open:!0,kind:`references`,symbol:r.text,items:s,index:l}})}catch(e){i(o)&&j(`Find references`,e)}},references:{open:!1,kind:`references`,symbol:``,items:[],index:-1},moveReference(n){let r=t().references,i=r.items.length;i&&e({references:{...r,index:(Math.max(r.index,0)+n+i)%i}})},pickReference(){let n=t().references,r=n.items[n.index];t().closeReferences(),r&&(n.kind===`references`&&e(e=>({search:{...e.search,open:!0,kind:`references`,direction:1,query:n.symbol,matches:n.items,index:n.index,loading:!1,truncated:!1}})),ye(r.path,r.line,r.external))},closeReferences(){e(e=>({references:{...e.references,open:!1}}))},symbols:{open:!1,scope:`document`,path:null,query:``,all:[],items:[],index:-1,loading:!1},async openSymbols(r){let a=r===`document`?t().activePath:null;if(r===`document`&&!a)return t().flash(`Move to a file first`);let o=a?xe({path:a,side:`new`}):be();if(o)return t().flash(o);if(e({symbols:{open:!0,scope:r,path:r===`document`?a:null,query:``,all:[],items:[],index:-1,loading:r===`document`}}),r!==`document`)return;let s=n;try{let n=await Hk.lspSymbols({path:a}),r=t().symbols;if(!r.open||r.scope!==`document`||r.path!==a)return;if(!i(s))return e({symbols:{...r,loading:!1}});e({symbols:{...r,all:n,items:fN(n,r.query),index:n.length?0:-1,loading:!1}})}catch(e){t().closeSymbols(),j(`Document symbols`,e)}},async querySymbols(r){let a=t().symbols;if(!a.open)return;if(a.scope===`document`){let t=fN(a.all,r);return e({symbols:{...a,query:r,items:t,index:t.length?0:-1}})}if(e({symbols:{...a,query:r,loading:r.trim().length>0}}),c(),!r.trim())return e(e=>({symbols:{...e.symbols,items:[],index:-1}}));if(await new Promise(e=>{s={timer:setTimeout(()=>{s=null,e()},150),wake:e}}),t().symbols.query!==r||!t().symbols.open)return;let o=n;try{let n=await Hk.lspSymbols({q:r}),a=t().symbols;if(!a.open||a.query!==r)return;if(!i(o))return e({symbols:{...a,loading:!1}});e({symbols:{...a,items:n,index:n.length?0:-1,loading:!1}})}catch(t){e(e=>({symbols:{...e.symbols,loading:!1}})),j(`Workspace symbols`,t)}},moveSymbol(n){let r=t().symbols,i=r.items.length;i&&e({symbols:{...r,index:(Math.max(r.index,0)+n+i)%i}})},pickSymbol(){let e=t().symbols,n=e.items[e.index];t().closeSymbols(),n&&ye(n.path,n.line)},closeSymbols(){e(e=>({symbols:{...e.symbols,open:!1,items:[],all:[],index:-1,loading:!1}}))},moveCursor(e){let n=se();De(jN(n,Ee(),e),t().visualAnchor!=null)},jumps:[],jumpIndex:0,jumpBack(){if(t().fileView)return t().closeFullFile();let{jumps:n,jumpIndex:r}=t();if(r===0)return;let i=n,a=r;if(a===i.length){let e=ce();e&&(i=[...i,e])}--a,e({jumps:i,jumpIndex:a});let o=i[a];o&&fe(o)},jumpForward(){let{jumps:n,jumpIndex:r}=t();if(r>=n.length-1)return;let i=r+1;e({jumpIndex:i});let a=n[i];a&&fe(a)},scrollCursorTo(n){if(!t().selection)return t().flash(`No line under the cursor`);e(e=>({scrollTarget:_e(e,n)}))},moveCursorBy(e){let n=se(),r=e<0?-1:1,i=Ee();for(let t=0;t<Math.abs(e);t++){let e=jN(n,i,r);if(!e||i&&e.itemIndex===i.itemIndex&&e.rowIndex===i.rowIndex)break;i=e}De(i,t().visualAnchor!=null,`eye`)},async goToLine(e){let n=t(),r=qM(n);if(!r)return n.flash(`No file to jump in`);await ye(r,e)},moveFile(n){let r=se();if(!r.length)return;let i=r.findIndex(e=>e.path===t().activePath),a=Ee()??(i===-1?null:{itemIndex:i,rowIndex:0}),o=n===`first`?NN(r,null,1):n===`last`?NN(r,null,-1):NN(r,a,n);if(!o)return;let s=r[o.itemIndex];if(le(),s.collapsed||s.rows.length===0){e(e=>({selection:null,activePath:s.path,scrollTarget:{id:s.id,nonce:(e.scrollTarget?.nonce??0)+1}}));return}ve(o),e(e=>({scrollTarget:{id:s.id,align:`start`,nonce:(e.scrollTarget?.nonce??0)+1}}))},moveHunk(e){ve(PN(se(),Ee(),e),!1,`eye`)},toggleVisual(){let n=Te();if(t().visualAnchor){e({visualAnchor:null}),n&&ve(n);return}if(!n){let t=jN(se(),null,1);t&&ve(t),e({visualAnchor:Te()});return}e({visualAnchor:n})},editCommentAtCursor(){let e=Oe(),n=e?.messages[e.messages.length-1];n&&t().setEditingId(n.id)},async deleteCommentAtCursor(){let e=Oe();e&&await t().deleteThread(e.id)},async toggleResolvedAtCursor(){let e=Oe();if(!e)return t().flash(`No thread under the cursor`);await t().setResolved(e.id,!e.resolved),t().flash(e.resolved?`Thread reopened`:`Thread resolved`)},async toggleViewedAtCursor(){let e=t().activePath,n=e?t().snapshot?.changed.find(t=>t.path===e):void 0;if(!e||!n)return;let r=!QM(t(),n),i=t().setViewed(e,r);r&&me(e,he),await i},setCollapsedAtCursor(n){let r=t().activePath;r&&(e(e=>({collapsed:{...e.collapsed,[r]:n}})),n?me(r,ge):t().loadPatch(r))},setAllCollapsed(n){let r=t().snapshot?.changed.map(e=>e.path)??[],i={};for(let e of r)i[e]=n;e({collapsed:i})},escape(){let n=t();n.helpOpen?e({helpOpen:!1}):n.modeMenuOpen?e({modeMenuOpen:!1}):n.githubMenuOpen?e({githubMenuOpen:!1}):n.hover?n.closeHover():n.symbolMenu?n.closeSymbolMenu():n.references.open?n.closeReferences():n.symbols.open?n.closeSymbols():n.search.open?n.closeSearch():n.editingId?n.setEditingId(null):n.replyTo?n.closeReply():n.draft?n.closeDraft():n.visualAnchor?e({visualAnchor:null}):e({selection:null})},diffStyle:iP(),setDiffStyle(t){try{localStorage.setItem(nP,t)}catch{}e({diffStyle:t,draft:null,visualAnchor:null})},snapshot:null,error:null,threads:[],showResolved:!1,setShowResolved(t){e({showResolved:t})},viewed:[],config:pk,fileView:null,loaded:{},gens:{},contents:{},collapsed:{},selection:null,draft:null,activePath:null,scrollTarget:null,reveal:null,revealed:{},addRevealed(t,n,r){e(e=>{let i=VM(t),a=Object.fromEntries(Object.entries(e.revealed).filter(([e])=>e===t||VM(e)!==i));return{revealed:{...a,[t]:[...a[t]??[],[n,r]]}}})},async boot(){let t=p();C=!0,S=0;try{let n=Hk.lspStatus().catch(()=>({enabled:!1,servers:[],missing:[]})),r=v.start(),[i,a,o,s]=await Promise.all([Hk.snapshot(),T(),Hk.config(),n]);e({lsp:s}),v.latest(r)&&e({config:o}),await E(i,t,a)}catch(n){i(t)&&e({error:A(n)})}},async refreshSnapshot(t){if(t!=null){if(w(t))return;S=t}let n=d();try{let[e,t]=await Promise.all([Hk.snapshot(),T()]);await E(e,n,t)}catch(t){i(n)&&e({error:A(t)})}finally{S===t&&(S=0)}},async refreshThreads(){let e=n,t=g.start();try{let n=await Hk.threads();i(e)&&g.latest(t)&&ke(n)}catch(n){i(e)&&g.latest(t)&&j(`Loading threads`,n)}},async refreshViewed(){let t=n,r=_.start();try{let n=await Hk.viewed();i(t)&&_.latest(r)&&e({viewed:n})}catch(e){i(t)&&_.latest(r)&&j(`Loading viewed marks`,e)}},async refreshConfig(){let t=v.start();try{let n=await Hk.config();v.latest(t)&&e({config:n})}catch(e){v.latest(t)&&j(`Loading config`,e)}},async switchMode(n){let r=p();e({error:null});let a,o=!1;try{return a=await Hk.switchMode(n),i(r)?w(a.version)?`applied`:(S=a.version,o=!0,await E(a,r,await T()),i(r)?`applied`:`superseded`):`superseded`}catch(n){if(!i(r))return`superseded`;let a=A(n);return e({error:a}),t().refreshGithub(),{error:a}}finally{o&&a&&S===a.version&&(S=0)}},loadFile:k,async openFile(n,r,i){let a=t().snapshot;if(a){if(!a.changed.some(e=>e.path===n)||t().fileView?.path===n&&i!==`old`){await t().openFullFile(n,r);return}t().fileView&&(le(),e({fileView:null,selection:null,visualAnchor:null,draft:null,focusedThread:null})),t().jumpTo(n,r,i),e({activePath:n})}},async loadPatch(e){let r=t().snapshot;!r||t().loaded[e]?.kind!==`oversized`||await F(r,[e],n)},async openFullFile(r,a,o=!1){let s=t().snapshot;if(!s)return;let c=t().fileView,l=o||c?.path===r&&c.external;if(!l&&!s.tree.includes(r)){t().flash(`${r} no longer exists on this side`);return}let u=n;if(c?.path!==r&&(le(),await ae(r,l,u),!i(u)||t().fileView?.path!==r))return;let d=t().fileView?.item;d?.kind===`error`&&t().flash(`Cannot open ${r}: ${d.message}`),t().jumpTo(r,a),e({activePath:r})},closeFullFile(){let n=t().fileView;if(!n)return;le();let{position:r,activePath:i}=n.from,a=t().jumps,o=r?a.findLastIndex(e=>e.path===r.path&&e.line===r.line&&e.side===r.side&&!e.full):-1;e({fileView:null,selection:null,visualAnchor:null,draft:null,focusedThread:null,activePath:i,...o>=0?{jumpIndex:o}:{}}),r?fe(r):i&&e(e=>({scrollTarget:{id:HM(e,i),align:`start`,nonce:(e.scrollTarget?.nonce??0)+1}}))},setSelection(n){e({selection:n,visualAnchor:null,focusedThread:null}),n==null&&t().draft?.selection&&e({draft:null})},async openDraft(n){if(t().fileView?.external)return t().flash(`Comments go on repository files only`);let r=VM(n.id);e({draft:{path:r,selection:n},selection:n,activePath:r,replyTo:null})},openFileDraft(n){if(t().fileView?.external)return t().flash(`Comments go on repository files only`);let r=t().selection,i=r&&VM(r.id)===n?r:null;e({draft:{path:n,selection:null},selection:i,visualAnchor:null,activePath:n,replyTo:null}),ue(n)},closeDraft(){e({draft:null,selection:null})},async draftQuote(){let e=t().draft;if(!e?.selection)return``;let n=iN(t(),e.path,e.selection),r=await M(e.path,n.side);return zM(e.path,n,r).quoted},async submitDraft(n){let r=t().draft;if(!r||!n.trim())return;if(!r.selection){try{await Hk.addThread({path:r.path,body:n})}catch(e){return j(`Posting the comment`,e)}e({draft:null}),await t().refreshThreads();return}try{let e=iN(t(),r.path,r.selection),i=await M(r.path,e.side),{path:a,side:o,startLine:s,endLine:c,quoted:l}=zM(r.path,e,i);await Hk.addThread({path:a,side:o,startLine:s,endLine:c,quoted:l,body:n})}catch(e){return j(`Posting the comment`,e)}let i=r.selection.range;e({draft:null,visualAnchor:null,selection:{id:r.selection.id,range:{start:i.end,side:i.endSide??i.side,end:i.end,endSide:i.endSide??i.side}}}),await t().refreshThreads()},async submitReply(n,r){if(r.trim()){try{await Hk.reply(n,{body:r})}catch(e){return j(`Posting the reply`,e)}t().replyTo===n&&e({replyTo:null}),await t().refreshThreads()}},editMessage:(e,t,n)=>Ae(`Editing the message`,()=>Hk.editMessage(e,t,n)),deleteMessage:(e,t)=>Ae(`Deleting the message`,()=>Hk.deleteMessage(e,t)),setResolved:(e,t)=>Ae(t?`Resolving`:`Reopening`,()=>Hk.setResolved(e,t)),deleteThread:e=>Ae(`Deleting the thread`,()=>Hk.deleteThread(e)),clearThreads:()=>Ae(`Deleting all threads`,()=>Hk.clearThreads()),deleteStaleThreads:()=>Ae(`Deleting stale threads`,()=>Hk.deleteStaleThreads()),async exportToGithub(e){if(!t().snapshot)return null;let n;try{n=await Hk.exportToGithub({threadIds:e})}catch(e){return j(`Adding to the GitHub review`,e),null}let r=n.skipped.filter(e=>e.reason!==`already in the review`);if(r.length){let e=n.posted+n.updated+n.skipped.length;t().flash(`Skipped ${r.length} of ${e} (${r.map(e=>e.reason).join(`, `)})`)}return n.posted>0?`added`:n.updated>0?`updated`:`unchanged`},async setViewed(n,r){let i=t().snapshot?.changed.find(e=>e.path===n);i&&(e(e=>({viewed:[...e.viewed.filter(e=>e.path!==n||e.blob!==i.blob),{path:n,blob:i.blob,viewed:r}],collapsed:{...e.collapsed,[n]:r}})),await je(`Marking viewed`,()=>Hk.setViewed(n,i.blob,r)))},async unviewAll(){let n=t().snapshot;if(!n)return;let r=n.changed.map(e=>({path:e.path,blob:e.blob,viewed:!1})),i={};for(let e of n.changed)i[e.path]=!1;e({viewed:r,collapsed:i}),await je(`Marking all not viewed`,()=>Hk.setViewedBulk(r))},toggleCollapsed(n){let r=eN(t(),n);e(e=>({collapsed:{...e.collapsed,[n]:!r}})),r&&t().loadPatch(n)},selectFile(t){e({selection:null,visualAnchor:null,activePath:t})},async saveConfig(t){let n=0;try{let r=await x(()=>(n=v.start(),Hk.saveConfig(t)));v.latest(n)&&e({config:r})}catch(e){v.latest(n)&&j(`Saving settings`,e)}},jumpTo(n,r,i){le(),r!=null&&ue(n);let a=HM(t(),n);if(r==null){let t=se(),n=t.findIndex(e=>e.id===a),r=t[n];r&&!r.collapsed&&r.rows.length&&e({selection:FN(t,{itemIndex:n,rowIndex:Math.max(0,r.rows.findIndex(e=>e.hunkStart))}),visualAnchor:null})}if(r!=null&&i!==`old`){let i=se().find(e=>e.id===a);if(i!=null&&t().loaded[n]?.kind===`diff`&&!i.rows.some(e=>e.side===`additions`&&e.line===r)){e(e=>({activePath:n,reveal:{id:a,path:n,line:r,nonce:(e.reveal?.nonce??0)+1}}));return}}e(e=>({scrollTarget:{id:a,line:r,side:i,align:r?`eye`:`start`,nonce:(e.scrollTarget?.nonce??0)+1},activePath:n}))},setActivePath(t){e({activePath:t})}}});function cP(e,t){return e.blob===t.blob&&e.status===t.status&&e.oldPath===t.oldPath&&e.additions===t.additions&&e.deletions===t.deletions}async function lP(e,t,n,r){let i=0,a=Array.from({length:Math.min(t,e.length)},async()=>{for(;i<e.length&&!n();)await r(e[i++])});await Promise.all(a)}function uP({path:e,className:t,nowrap:n=!1}){let r=e.lastIndexOf(`/`)+1,i=e.slice(0,r).split(`/`).filter(Boolean),a=e.slice(r);return(0,g.jsxs)(`span`,{className:hj(`font-mono break-normal wrap-anywhere`,n&&`min-w-0 truncate`,t),title:e,children:[i.length>0&&(0,g.jsx)(`span`,{className:`text-muted`,children:i.map((e,t)=>(0,g.jsxs)(p.Fragment,{children:[e,`/`,(0,g.jsx)(`wbr`,{})]},t))}),(0,g.jsx)(`span`,{className:`font-semibold text-foreground`,children:a})]})}var dP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fP=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pP={};function mP(e,t){return((t||pP).jsx?fP:dP).test(e)}var hP=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
1599
+ `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),gP=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(hP());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),_P=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),vP=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(gP()),r=_P();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),yP=xP(`end`),bP=xP(`start`);function xP(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function SP(e){let t=bP(e),n=yP(e);if(t&&n)return{start:t,end:n}}function CP(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?TP(e.position):`start`in e||`end`in e?TP(e):`line`in e||`column`in e?wP(e):``}function wP(e){return EP(e&&e.line)+`:`+EP(e&&e.column)}function TP(e){return wP(e&&e.start)+`-`+wP(e&&e.end)}function EP(e){return e&&typeof e==`number`?e:1}var DP=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=CP(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};DP.prototype.file=``,DP.prototype.name=``,DP.prototype.reason=``,DP.prototype.message=``,DP.prototype.stack=``,DP.prototype.column=void 0,DP.prototype.line=void 0,DP.prototype.ancestors=void 0,DP.prototype.cause=void 0,DP.prototype.fatal=void 0,DP.prototype.place=void 0,DP.prototype.ruleId=void 0,DP.prototype.source=void 0;var OP=l(vP(),1),kP={}.hasOwnProperty,AP=new Map,jP=/[A-Z]/g,MP=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),NP=new Set([`td`,`th`]),PP=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function FP(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=KP(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=GP(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Ni:Mi,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=IP(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function IP(e,t,n){if(t.type===`element`)return LP(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return RP(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return BP(e,t,n);if(t.type===`mdxjsEsm`)return zP(e,t);if(t.type===`root`)return VP(e,t,n);if(t.type===`text`)return HP(e,t)}function LP(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Ni,e.schema=i),e.ancestors.push(t);let a=QP(e,t.tagName,!1),o=qP(e,t),s=YP(e,t);return MP.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!pa(e)})),UP(e,o,a,t),WP(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function RP(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}$P(e,t.position)}function zP(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);$P(e,t.position)}function BP(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Ni,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:QP(e,t.name,!0),o=JP(e,t),s=YP(e,t);return UP(e,o,a,t),WP(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function VP(e,t,n){let r={};return WP(r,YP(e,t)),e.create(t,e.Fragment,r,n)}function HP(e,t){return t.value}function UP(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function WP(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function GP(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function KP(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=bP(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function qP(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&kP.call(t.properties,i)){let a=XP(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&NP.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function JP(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else $P(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else $P(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function YP(e,t){let n=[],r=-1,i=e.passKeys?new Map:AP;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=IP(e,a,o);s!==void 0&&n.push(s)}return n}function XP(e,t,n){let r=ki(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?ua(n):da(n)),r.property===`style`){let t=typeof n==`object`?n:ZP(e,String(n));return e.stylePropertyNameCase===`css`&&(t=eF(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Ti[r.property]||r.property:r.attribute,n]}}function ZP(e,t){try{return(0,OP.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new DP("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=PP+`#cannot-parse-style-attribute`,r}}function QP(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=mP(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=mP(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return kP.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);$P(e)}function $P(e,t){let n=new DP("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=PP+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function eF(e){let t={},n;for(n in e)kP.call(e,n)&&(t[tF(n)]=e[n]);return t}function tF(e){let t=e.replace(jP,nF);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function nF(e){return`-`+e.toLowerCase()}var rF={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},iF={};function aF(e,t){let n=t||iF;return oF(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function oF(e,t,n){if(cF(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return sF(e.children,t,n)}return Array.isArray(e)?sF(e,t,n):``}function sF(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=oF(e[i],t,n);return r.join(``)}function cF(e){return!!(e&&typeof e==`object`)}var lF=document.createElement(`i`);function uF(e){let t=`&`+e+`;`;lF.innerHTML=t;let n=lF.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function dF(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function fF(e,t){return e.length>0?(dF(e,e.length,0,t),e):t}var pF={}.hasOwnProperty;function mF(e){let t={},n=-1;for(;++n<e.length;)hF(t,e[n]);return t}function hF(e,t){let n;for(n in t){let r=(pF.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){pF.call(r,a)||(r[a]=[]);let e=i[a];gF(r[a],Array.isArray(e)?e:e?[e]:[])}}}function gF(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);dF(e,0,0,r)}function _F(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function vF(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var yF=jF(/[A-Za-z]/),bF=jF(/[\dA-Za-z]/),xF=jF(/[#-'*+\--9=?A-Z^-~]/);function SF(e){return e!==null&&(e<32||e===127)}var CF=jF(/\d/),wF=jF(/[\dA-Fa-f]/),TF=jF(/[!-/:-@[-`{-~]/);function EF(e){return e!==null&&e<-2}function DF(e){return e!==null&&(e<0||e===32)}function OF(e){return e===-2||e===-1||e===32}var kF=jF(/\p{P}|\p{S}/u),AF=jF(/\s/);function jF(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function MF(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&bF(e.charCodeAt(n+1))&&bF(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function NF(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return OF(r)?(e.enter(n),s(r)):t(r)}function s(r){return OF(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var PF={tokenize:FF};function FF(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),NF(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return EF(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var IF={tokenize:RF},LF={tokenize:zF};function RF(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return dF(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(LF,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(LF,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return EF(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;dF(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function zF(e,t,n){return NF(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function BF(e){if(e===null||DF(e)||AF(e))return 1;if(kF(e))return 2}function VF(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var HF={name:`attention`,resolveAll:UF,tokenize:WF};function UF(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};GF(d,-c),GF(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=fF(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=fF(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=fF(l,VF(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=fF(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=fF(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,dF(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function WF(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=BF(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=BF(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function GF(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var KF={name:`autolink`,tokenize:qF};function qF(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return yF(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||bF(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||bF(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||SF(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):xF(t)?(e.consume(t),l):n(t)}function u(e){return bF(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||bF(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var JF={partial:!0,tokenize:YF};function YF(e,t,n){return r;function r(t){return OF(t)?NF(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||EF(e)?t(e):n(e)}}var XF={continuation:{tokenize:QF},exit:$F,name:`blockQuote`,tokenize:ZF};function ZF(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return OF(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function QF(e,t,n){let r=this;return i;function i(t){return OF(t)?NF(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(XF,t,n)(r)}}function $F(e){e.exit(`blockQuote`)}var eI={name:`characterEscape`,tokenize:tI};function tI(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return TF(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var nI={name:`characterReference`,tokenize:rI};function rI(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=bF,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=wF,u):(e.enter(`characterReferenceValue`),a=7,o=CF,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===bF&&!uF(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var iI={partial:!0,tokenize:sI},aI={concrete:!0,name:`codeFenced`,tokenize:oI};function oI(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),OF(t)?NF(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||EF(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(iI,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||EF(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):OF(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),NF(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||EF(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||EF(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&OF(t)?NF(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||EF(t)?e.check(iI,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||EF(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),OF(t)?NF(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),OF(t)?NF(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||EF(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function sI(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var cI={name:`codeIndented`,tokenize:uI},lI={partial:!0,tokenize:dI};function uI(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),NF(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):EF(t)?e.attempt(lI,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||EF(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function dI(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):EF(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):NF(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):EF(e)?i(e):n(e)}}var fI={name:`codeText`,previous:mI,resolve:pI,tokenize:hI};function pI(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function mI(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function hI(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):EF(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||EF(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var gI=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&_I(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),_I(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),_I(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);_I(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);_I(this.left,t.reverse())}}}};function _I(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function vI(e){let t={},n=-1,r,i,a,o,s,c,l,u=new gI(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,yI(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return dF(e,0,1/0,u.slice(0)),!l}function yI(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var bI={resolve:SI,tokenize:CI},xI={partial:!0,tokenize:wI};function SI(e){return vI(e),e}function CI(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):EF(t)?e.check(xI,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function wI(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),NF(e,a,`linePrefix`)}function a(i){if(i===null||EF(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function TI(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||SF(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||EF(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||DF(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||SF(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function EI(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):EF(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||EF(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!OF(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function DI(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):EF(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),NF(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||EF(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function OI(e,t){let n;return r;function r(i){return EF(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):OF(i)?NF(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var kI={name:`definition`,tokenize:jI},AI={partial:!0,tokenize:MI};function jI(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return EI.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=vF(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return DF(t)?OI(e,l)(t):l(t)}function l(t){return TI(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(AI,d,d)(t)}function d(t){return OF(t)?NF(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||EF(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function MI(e,t,n){return r;function r(t){return DF(t)?OI(e,i)(t):n(t)}function i(t){return DI(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return OF(t)?NF(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||EF(e)?t(e):n(e)}}var NI={name:`hardBreakEscape`,tokenize:PI};function PI(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return EF(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var FI={name:`headingAtx`,resolve:II,tokenize:LI};function II(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},dF(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function LI(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||DF(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||EF(n)?(e.exit(`atxHeading`),t(n)):OF(n)?NF(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||DF(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var RI=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),zI=[`pre`,`script`,`style`,`textarea`],BI={concrete:!0,name:`htmlFlow`,resolveTo:UI,tokenize:WI},VI={partial:!0,tokenize:KI},HI={partial:!0,tokenize:GI};function UI(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function WI(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):yF(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):yF(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return yF(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||DF(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&zI.includes(l)?(i=1,r.interrupt?t(s):O(s)):RI.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||bF(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return OF(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||yF(t)?(e.consume(t),b):OF(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||bF(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):OF(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):OF(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||EF(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||DF(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||OF(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||EF(t)?O(t):OF(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):EF(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(VI,ee,k)(t)):t===null||EF(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(HI,A,ee)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||EF(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return zI.includes(n)?(e.consume(t),L):O(t)}return yF(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||EF(t)?(e.exit(`htmlFlowData`),ee(t)):(e.consume(t),L)}function ee(n){return e.exit(`htmlFlow`),t(n)}}function GI(e,t,n){let r=this;return i;function i(t){return EF(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function KI(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(JF,t,n)}}var qI={name:`htmlText`,tokenize:JI};function JI(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):yF(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):yF(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):EF(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):EF(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):EF(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):EF(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return yF(t)?(e.consume(t),S):n(t)}function S(t){return t===45||bF(t)?(e.consume(t),S):C(t)}function C(t){return EF(t)?(o=C,N(t)):OF(t)?(e.consume(t),C):M(t)}function w(t){return t===45||bF(t)?(e.consume(t),w):t===47||t===62||DF(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||yF(t)?(e.consume(t),E):EF(t)?(o=T,N(t)):OF(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||bF(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):EF(t)?(o=D,N(t)):OF(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):EF(t)?(o=O,N(t)):OF(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):EF(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||DF(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||DF(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return OF(t)?NF(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var YI={name:`labelEnd`,resolveAll:$I,resolveTo:eL,tokenize:tL},XI={tokenize:nL},ZI={tokenize:rL},QI={tokenize:iL};function $I(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&dF(e,0,e.length,n),e}function eL(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=fF(s,e.slice(a+1,a+r+3)),s=fF(s,[[`enter`,u,t]]),s=fF(s,VF(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=fF(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=fF(s,e.slice(o+1)),s=fF(s,[[`exit`,c,t]]),dF(e,a,e.length,s),e}function tL(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(vF(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(XI,u,o?u:d)(t):t===91?e.attempt(ZI,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(QI,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function nL(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return DF(t)?OI(e,a)(t):a(t)}function a(t){return t===41?u(t):TI(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return DF(t)?OI(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?DI(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return DF(t)?OI(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function rL(e,t,n){let r=this;return i;function i(t){return EI.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(vF(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function iL(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var aL={name:`labelStartImage`,resolveAll:YI.resolveAll,tokenize:oL};function oL(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var sL={name:`labelStartLink`,resolveAll:YI.resolveAll,tokenize:cL};function cL(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var lL={name:`lineEnding`,tokenize:uL};function uL(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),NF(e,t,`linePrefix`)}}var dL={name:`thematicBreak`,tokenize:fL};function fL(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||EF(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),OF(t)?NF(e,s,`whitespace`)(t):s(t))}}var pL={continuation:{tokenize:_L},exit:yL,name:`list`,tokenize:gL},mL={partial:!0,tokenize:bL},hL={partial:!0,tokenize:vL};function gL(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:CF(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(dL,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return CF(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(JF,r.interrupt?n:u,e.attempt(mL,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return OF(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function _L(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(JF,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,NF(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!OF(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(hL,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,NF(e,e.attempt(pL,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function vL(e,t,n){let r=this;return NF(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function yL(e){e.exit(this.containerState.type)}function bL(e,t,n){let r=this;return NF(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!OF(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var xL={name:`setextUnderline`,resolveTo:SL,tokenize:CL};function SL(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function CL(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),OF(t)?NF(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||EF(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var wL={tokenize:TL};function TL(e){let t=this,n=e.attempt(JF,r,e.attempt(this.parser.constructs.flowInitial,i,NF(e,e.attempt(this.parser.constructs.flow,i,e.attempt(bI,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var EL={resolveAll:AL()},DL=kL(`string`),OL=kL(`text`);function kL(e){return{resolveAll:AL(e===`text`?jL:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function AL(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function jL(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var ML=s({attentionMarkers:()=>BL,contentInitial:()=>PL,disable:()=>VL,document:()=>NL,flow:()=>IL,flowInitial:()=>FL,insideSpan:()=>zL,string:()=>LL,text:()=>RL}),NL={42:pL,43:pL,45:pL,48:pL,49:pL,50:pL,51:pL,52:pL,53:pL,54:pL,55:pL,56:pL,57:pL,62:XF},PL={91:kI},FL={[-2]:cI,[-1]:cI,32:cI},IL={35:FI,42:dL,45:[xL,dL],60:BI,61:xL,95:dL,96:aI,126:aI},LL={38:nI,92:eI},RL={[-5]:lL,[-4]:lL,[-3]:lL,33:aL,38:nI,42:HF,60:[KF,qI],91:sL,92:[NI,eI],93:YI,95:HF,96:fI},zL={null:[HF,EL]},BL={null:[42,95]},VL={null:[]};function HL(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=fF(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=VF(a,l.events,l),l.events):[]}function f(e,t){return WL(p(e),t)}function p(e){return UL(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){EF(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&dF(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function UL(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function WL(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
1600
1600
  `;break;case-3:o=`\r
1601
- `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function VL(e){let t={constructs:uF([OL,...(e||{}).extensions||[]]),content:n(AF),defined:[],document:n(MF),flow:n(bL),lazy:{},string:n(CL),text:n(wL)};return t;function n(e){return n;function n(n){return RL(t,e,n)}}}function HL(e){for(;!mI(e););return e}var UL=/[\0\t\n\r]/g;function WL(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(UL.lastIndex=u,c=UL.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var GL=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function KL(e){return e.replace(GL,qL)}function qL(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return pF(n.slice(t?2:1),t?16:10)}return oF(n)||e}var JL={}.hasOwnProperty;function YL(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),XL(n)(HL(VL(n).document().write(WL()(e,t,!0))))}function XL(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(pe),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ue),blockQuote:a(ae),characterEscape:T,characterReference:T,codeFenced:a(oe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(oe,o),codeText:a(se,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ce),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(le),hardBreakEscape:a(V),hardBreakTrailing:a(V),htmlFlow:a(de,o),htmlFlowData:T,htmlText:a(de,o),htmlTextData:T,image:a(fe),label:o,link:a(pe),listItem:a(he),listItemValue:f,listOrdered:a(me,d),listUnordered:a(me),paragraph:a(ge),reference:te,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ue),strong:a(_e),thematicBreak:a(ye)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ie,autolinkProtocol:re,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:R,characterReferenceMarkerNumeric:R,characterReferenceValue:z,characterReference:B,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:F,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ne,resourceDestinationString:I,resourceTitleString:L,resource:ee,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};QL(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];JL.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||eR).call(a,void 0,e[0])}for(r.position={start:ZL(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:ZL(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:ZL(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||eR).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+yP({start:e.start,end:e.end})+`): it’s not open`);n.position.end=ZL(e.end)}function u(){return tF(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=mF(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ve(),n.position={start:ZL(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=ZL(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=ZL(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=KL(t),n.identifier=mF(t).toLowerCase()}function F(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function L(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ee(){this.data.inReference=void 0}function te(){this.data.referenceType=`collapsed`}function ne(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=mF(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function R(e){this.data.characterReferenceType=e.type}function z(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=pF(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=oF(t);let i=this.stack[this.stack.length-1];i.value+=r}function B(e){let t=this.stack.pop();t.position.end=ZL(e.end)}function re(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ie(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ae(){return{type:`blockquote`,children:[]}}function oe(){return{type:`code`,lang:null,meta:null,value:``}}function se(){return{type:`inlineCode`,value:``}}function ce(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function le(){return{type:`emphasis`,children:[]}}function ue(){return{type:`heading`,depth:0,children:[]}}function V(){return{type:`break`}}function de(){return{type:`html`,value:``}}function fe(){return{type:`image`,title:null,url:``,alt:null}}function pe(){return{type:`link`,title:null,url:``,children:[]}}function me(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function he(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function ge(){return{type:`paragraph`,children:[]}}function _e(){return{type:`strong`,children:[]}}function ve(){return{type:`text`,value:``}}function ye(){return{type:`thematicBreak`}}}function ZL(e){return{line:e.line,column:e.column,offset:e.offset}}function QL(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?QL(e,r):$L(e,r)}}function $L(e,t){let n;for(n in t)if(JL.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function eR(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+yP({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+yP({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+yP({start:t.start,end:t.end})+`) is still open`)}function tR(e){let t=this;t.parser=n;function n(n){return YL(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function nR(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function rR(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
1602
- `}]}function iR(e,t){let n=t.value?t.value+`
1603
- `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function aR(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oR(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sR(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=OF(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function cR(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lR(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function uR(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function dR(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return uR(e,t);let i={src:OF(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function fR(e,t){let n={src:OF(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function pR(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function mR(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return uR(e,t);let i={href:OF(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function hR(e,t){let n={href:OF(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function gR(e,t,n){let r=e.all(t),i=n?_R(n):vR(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
1601
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function GL(e){let t={constructs:mF([ML,...(e||{}).extensions||[]]),content:n(PF),defined:[],document:n(IF),flow:n(wL),lazy:{},string:n(DL),text:n(OL)};return t;function n(e){return n;function n(n){return HL(t,e,n)}}}function KL(e){for(;!vI(e););return e}var qL=/[\0\t\n\r]/g;function JL(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(qL.lastIndex=u,c=qL.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var YL=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function XL(e){return e.replace(YL,ZL)}function ZL(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return _F(n.slice(t?2:1),t?16:10)}return uF(n)||e}var QL={}.hasOwnProperty;function $L(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),eR(n)(KL(GL(n).document().write(JL()(e,t,!0))))}function eR(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(pe),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ue),blockQuote:a(ae),characterEscape:T,characterReference:T,codeFenced:a(oe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(oe,o),codeText:a(se,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ce),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(le),hardBreakEscape:a(V),hardBreakTrailing:a(V),htmlFlow:a(de,o),htmlFlowData:T,htmlText:a(de,o),htmlTextData:T,image:a(fe),label:o,link:a(pe),listItem:a(he),listItemValue:f,listOrdered:a(me,d),listUnordered:a(me),paragraph:a(ge),reference:te,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ue),strong:a(_e),thematicBreak:a(ye)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ie,autolinkProtocol:re,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:R,characterReferenceMarkerNumeric:R,characterReferenceValue:z,characterReference:B,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:F,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ne,resourceDestinationString:I,resourceTitleString:L,resource:ee,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};nR(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];QL.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||iR).call(a,void 0,e[0])}for(r.position={start:tR(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:tR(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:tR(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||iR).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+CP({start:e.start,end:e.end})+`): it’s not open`);n.position.end=tR(e.end)}function u(){return aF(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=vF(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ve(),n.position={start:tR(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=tR(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=tR(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=XL(t),n.identifier=vF(t).toLowerCase()}function F(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function L(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ee(){this.data.inReference=void 0}function te(){this.data.referenceType=`collapsed`}function ne(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=vF(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function R(e){this.data.characterReferenceType=e.type}function z(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=_F(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=uF(t);let i=this.stack[this.stack.length-1];i.value+=r}function B(e){let t=this.stack.pop();t.position.end=tR(e.end)}function re(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ie(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ae(){return{type:`blockquote`,children:[]}}function oe(){return{type:`code`,lang:null,meta:null,value:``}}function se(){return{type:`inlineCode`,value:``}}function ce(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function le(){return{type:`emphasis`,children:[]}}function ue(){return{type:`heading`,depth:0,children:[]}}function V(){return{type:`break`}}function de(){return{type:`html`,value:``}}function fe(){return{type:`image`,title:null,url:``,alt:null}}function pe(){return{type:`link`,title:null,url:``,children:[]}}function me(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function he(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function ge(){return{type:`paragraph`,children:[]}}function _e(){return{type:`strong`,children:[]}}function ve(){return{type:`text`,value:``}}function ye(){return{type:`thematicBreak`}}}function tR(e){return{line:e.line,column:e.column,offset:e.offset}}function nR(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?nR(e,r):rR(e,r)}}function rR(e,t){let n;for(n in t)if(QL.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function iR(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+CP({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+CP({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+CP({start:t.start,end:t.end})+`) is still open`)}function aR(e){let t=this;t.parser=n;function n(n){return $L(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function oR(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function sR(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
1602
+ `}]}function cR(e,t){let n=t.value?t.value+`
1603
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function lR(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function uR(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dR(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=MF(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function fR(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pR(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function mR(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function hR(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return mR(e,t);let i={src:MF(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function gR(e,t){let n={src:MF(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function _R(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function vR(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return mR(e,t);let i={href:MF(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function yR(e,t){let n={href:MF(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function bR(e,t,n){let r=e.all(t),i=n?xR(n):SR(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
1604
1604
  `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
1605
- `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function _R(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=vR(n[r])}return t}function vR(e){return e.spread??e.children.length>1}function yR(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function bR(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xR(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function SR(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function CR(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=gP(t.children[1]),o=hP(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function wR(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function TR(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var ER=9,DR=32;function OR(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(kR(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(kR(t.slice(i),i>0,!1)),a.join(``)}function kR(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===ER||t===DR;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===ER||t===DR;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function AR(e,t){let n={type:`text`,value:OR(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function jR(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var MR={blockquote:nR,break:rR,code:iR,delete:aR,emphasis:oR,footnoteReference:sR,heading:cR,html:lR,imageReference:dR,image:fR,inlineCode:pR,linkReference:mR,link:hR,listItem:gR,list:yR,paragraph:bR,root:xR,strong:SR,table:CR,tableCell:TR,tableRow:wR,text:AR,thematicBreak:jR,toml:NR,yaml:NR,definition:NR,footnoteDefinition:NR};function NR(){}var{defineProperty:PR}=Object,FR=typeof self==`object`?self:globalThis,IR=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new FR[e](t)},LR=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?PR(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof FR[e]==`function`?IR(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(IR(a,o),i)};return r},RR=e=>LR(new Map,e)(0),zR=``,{toString:BR}={},{keys:VR,is:HR}=Object,UR=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=BR.call(e).slice(8,-1);switch(n){case`Array`:return[1,zR];case`Object`:return[2,zR];case`Date`:return[3,zR];case`RegExp`:return[4,zR];case`Map`:return[5,zR];case`Set`:return[6,zR];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},WR=([e,t])=>e===0&&(t===`function`||t===`symbol`),GR=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=UR(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&HR(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of VR(o))(e||!WR(UR(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?zR:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(WR(UR(n))||WR(UR(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!WR(UR(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},KR=(e,{json:t,lossy:n}={})=>{let r=[];return GR(!(t||n),!!t,new Map,r)(e),r},qR=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?RR(KR(e,t)):structuredClone(e):(e,t)=>RR(KR(e,t));function JR(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function YR(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function XR(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||JR,r=e.options.footnoteBackLabel||YR,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=OF(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...qR(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
1605
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function xR(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=SR(n[r])}return t}function SR(e){return e.spread??e.children.length>1}function CR(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function wR(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function TR(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function ER(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DR(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=bP(t.children[1]),o=yP(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function OR(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function kR(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var AR=9,jR=32;function MR(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(NR(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(NR(t.slice(i),i>0,!1)),a.join(``)}function NR(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===AR||t===jR;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===AR||t===jR;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function PR(e,t){let n={type:`text`,value:MR(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function FR(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var IR={blockquote:oR,break:sR,code:cR,delete:lR,emphasis:uR,footnoteReference:dR,heading:fR,html:pR,imageReference:hR,image:gR,inlineCode:_R,linkReference:vR,link:yR,listItem:bR,list:CR,paragraph:wR,root:TR,strong:ER,table:DR,tableCell:kR,tableRow:OR,text:PR,thematicBreak:FR,toml:LR,yaml:LR,definition:LR,footnoteDefinition:LR};function LR(){}var{defineProperty:RR}=Object,zR=typeof self==`object`?self:globalThis,BR=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new zR[e](t)},VR=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?RR(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof zR[e]==`function`?BR(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(BR(a,o),i)};return r},HR=e=>VR(new Map,e)(0),UR=``,{toString:WR}={},{keys:GR,is:KR}=Object,qR=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=WR.call(e).slice(8,-1);switch(n){case`Array`:return[1,UR];case`Object`:return[2,UR];case`Date`:return[3,UR];case`RegExp`:return[4,UR];case`Map`:return[5,UR];case`Set`:return[6,UR];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},JR=([e,t])=>e===0&&(t===`function`||t===`symbol`),YR=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=qR(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&KR(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of GR(o))(e||!JR(qR(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?UR:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(JR(qR(n))||JR(qR(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!JR(qR(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},XR=(e,{json:t,lossy:n}={})=>{let r=[];return YR(!(t||n),!!t,new Map,r)(e),r},ZR=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?HR(XR(e,t)):structuredClone(e):(e,t)=>HR(XR(e,t));function QR(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function $R(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function ez(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||QR,r=e.options.footnoteBackLabel||$R,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=MF(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...ZR(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
1606
1606
  `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
1607
- `}]}}var ZR=(function(e){if(e==null)return nz;if(typeof e==`function`)return tz(e);if(typeof e==`object`)return Array.isArray(e)?QR(e):$R(e);if(typeof e==`string`)return ez(e);throw Error(`Expected function, string, or object as test`)});function QR(e){let t=[],n=-1;for(;++n<e.length;)t[n]=ZR(e[n]);return tz(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function $R(e){let t=e;return tz(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function ez(e){return tz(t);function t(t){return t&&t.type===e}}function tz(e){return t;function t(t,n,r){return!!(rz(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function nz(){return!0}function rz(e){return typeof e==`object`&&!!e&&`type`in e}function iz(e){return e}var az=[];function oz(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=ZR(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+iz(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=az,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=sz(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function sz(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?az:[e]}function cz(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),oz(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var lz={}.hasOwnProperty,uz={};function dz(e,t){let n=t||uz,r=new Map,i=new Map,a={all:s,applyData:pz,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...MR,...n.handlers},one:o,options:n,patch:fz,wrap:hz};return cz(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(lz.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=qR(n);return r.children=a.all(e),r}return qR(e)}return(a.options.unknownHandler||mz)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=gz(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=gz(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function fz(e,t){e.position&&(t.position=vP(e))}function pz(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,qR(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function mz(e,t){let n=t.data||{},r=`value`in t&&!(lz.call(n,`hProperties`)||lz.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function hz(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
1607
+ `}]}}var tz=(function(e){if(e==null)return oz;if(typeof e==`function`)return az(e);if(typeof e==`object`)return Array.isArray(e)?nz(e):rz(e);if(typeof e==`string`)return iz(e);throw Error(`Expected function, string, or object as test`)});function nz(e){let t=[],n=-1;for(;++n<e.length;)t[n]=tz(e[n]);return az(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function rz(e){let t=e;return az(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function iz(e){return az(t);function t(t){return t&&t.type===e}}function az(e){return t;function t(t,n,r){return!!(sz(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function oz(){return!0}function sz(e){return typeof e==`object`&&!!e&&`type`in e}function cz(e){return e}var lz=[];function uz(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=tz(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+cz(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=lz,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=dz(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function dz(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?lz:[e]}function fz(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),uz(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var pz={}.hasOwnProperty,mz={};function hz(e,t){let n=t||mz,r=new Map,i=new Map,a={all:s,applyData:_z,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...IR,...n.handlers},one:o,options:n,patch:gz,wrap:yz};return fz(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(pz.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=ZR(n);return r.children=a.all(e),r}return ZR(e)}return(a.options.unknownHandler||vz)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=bz(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=bz(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function gz(e,t){e.position&&(t.position=SP(e))}function _z(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,ZR(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function vz(e,t){let n=t.data||{},r=`value`in t&&!(pz.call(n,`hProperties`)||pz.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function yz(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
1608
1608
  `});++r<e.length;)r&&n.push({type:`text`,value:`
1609
1609
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
1610
- `}),n}function gz(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function _z(e,t){let n=dz(e,t),r=n.one(e,void 0),i=XR(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
1611
- `},i)),a}function vz(e,t){return e&&`run`in e?async function(n,r){let i=_z(n,{file:r,...t});await e.run(i,r)}:function(n,r){return _z(n,{file:r,...e||t})}}function yz(e){if(e)throw e}var bz=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function xz(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Sz(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Cz(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Cz(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var wz={basename:Tz,dirname:Ez,extname:Dz,join:Oz,sep:`/`};function Tz(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);jz(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Ez(e){if(jz(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Dz(e){jz(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Oz(...e){let t=-1,n;for(;++t<e.length;)jz(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:kz(n)}function kz(e){jz(e);let t=e.codePointAt(0)===47,n=Az(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Az(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function jz(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Mz={cwd:Nz};function Nz(){return`/`}function Pz(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Fz(e){if(typeof e==`string`)e=new URL(e);else if(!Pz(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Iz(e)}function Iz(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var Lz=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Rz=class{constructor(e){let t;t=e?Pz(e)?{path:e}:typeof e==`string`||Hz(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Mz.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Lz.length;){let e=Lz[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Lz.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?wz.basename(this.path):void 0}set basename(e){Bz(e,`basename`),zz(e,`basename`),this.path=wz.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?wz.dirname(this.path):void 0}set dirname(e){Vz(this.basename,`dirname`),this.path=wz.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?wz.extname(this.path):void 0}set extname(e){if(zz(e,`extname`),Vz(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=wz.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Pz(e)&&(e=Fz(e)),Bz(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?wz.basename(this.path,this.extname):void 0}set stem(e){Bz(e,`stem`),zz(e,`stem`),this.path=wz.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new CP(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function zz(e,t){if(e&&e.includes(wz.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+wz.sep+"`")}function Bz(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Vz(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Hz(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Uz=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Wz=l(bz(),1),Gz={}.hasOwnProperty,Kz=new class e extends Uz{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Sz()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Wz.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Yz(`data`,this.frozen),this.namespace[e]=t,this):Gz.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Yz(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=Qz(e),n=this.parser||this.Parser;return qz(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),qz(`process`,this.parser||this.Parser),Jz(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Qz(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);eB(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),qz(`processSync`,this.parser||this.Parser),Jz(`processSync`,this.compiler||this.Compiler),this.process(e,r),Zz(`processSync`,`process`,t),n;function r(e,r){t=!0,yz(e),n=r}}run(e,t,n){Xz(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=Qz(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),Zz(`runSync`,`run`,n),r;function i(e,t){yz(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Qz(t),r=this.compiler||this.Compiler;return Jz(`stringify`,r),Xz(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Yz(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,Wz.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];xz(o)&&xz(r)&&(r=(0,Wz.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function qz(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Jz(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Yz(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Xz(e){if(!xz(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Zz(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Qz(e){return $z(e)?e:new Rz(e)}function $z(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function eB(e){return typeof e==`string`||tB(e)}function tB(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var nB=[],rB={allowDangerousHtml:!0},iB=/^(https?|ircs?|mailto|xmpp)$/i,aB=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function oB(e){let t=sB(e),n=cB(e);return lB(t.runSync(t.parse(n),n),e)}function sB(e){let t=e.rehypePlugins||nB,n=e.remarkPlugins||nB,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...rB}:rB;return Kz().use(tR).use(n).use(vz,r).use(t)}function cB(e){let t=e.children||``,n=new Rz;return typeof t==`string`?n.value=t:``+t,n}function lB(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||uB;for(let e of aB)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return cz(e,l),jP(e,{Fragment:g.Fragment,components:i,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in $P)if(Object.hasOwn($P,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=$P[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function uB(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||iB.test(e.slice(0,t))?e:``}function dB(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function fB(e,t,n){let r=ZR((n||{}).ignore||[]),i=pB(t),a=-1;for(;++a<i.length;)oz(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function pB(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([mB(e[0]),hB(e[1])])}return t}function mB(e){return typeof e==`string`?new RegExp(dB(e),`g`):e}function hB(e){return typeof e==`function`?e:function(){return e}}var gB=`phrasing`,_B=[`autolink`,`link`,`image`,`label`];function vB(){return{transforms:[EB],enter:{literalAutolink:bB,literalAutolinkEmail:xB,literalAutolinkHttp:xB,literalAutolinkWww:xB},exit:{literalAutolink:TB,literalAutolinkEmail:wB,literalAutolinkHttp:SB,literalAutolinkWww:CB}}}function yB(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:gB,notInConstruct:_B},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:gB,notInConstruct:_B},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:gB,notInConstruct:_B}]}}function bB(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function xB(e){this.config.enter.autolinkProtocol.call(this,e)}function SB(e){this.config.exit.autolinkProtocol.call(this,e)}function CB(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function wB(e){this.config.exit.autolinkEmail.call(this,e)}function TB(e){this.exit(e)}function EB(e){fB(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,DB],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,OB]],{ignore:[`link`,`linkReference`]})}function DB(e,t,n,r,i){let a=``;if(!jB(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!kB(n)))return!1;let o=AB(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function OB(e,t,n,r){return!jB(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function kB(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function AB(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=la(e,`(`),a=la(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function jB(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||EF(n)||TF(n))&&(!t||n!==47)}VB.peek=BB;function MB(){this.buffer()}function NB(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function PB(){this.buffer()}function FB(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function IB(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=mF(this.sliceSerialize(e)).toLowerCase(),n.label=t}function LB(e){this.exit(e)}function RB(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=mF(this.sliceSerialize(e)).toLowerCase(),n.label=t}function zB(e){this.exit(e)}function BB(){return`[`}function VB(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function HB(){return{enter:{gfmFootnoteCallString:MB,gfmFootnoteCall:NB,gfmFootnoteDefinitionLabelString:PB,gfmFootnoteDefinition:FB},exit:{gfmFootnoteCallString:IB,gfmFootnoteCall:LB,gfmFootnoteDefinitionLabelString:RB,gfmFootnoteDefinition:zB}}}function UB(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:VB},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
1612
- `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?GB:WB))),s(),o}}function WB(e,t,n){return t===0?e:GB(e,t,n)}function GB(e,t,n){return(n?``:` `)+e}var KB=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];ZB.peek=QB;function qB(){return{canContainEols:[`delete`],enter:{strikethrough:YB},exit:{strikethrough:XB}}}function JB(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:KB}],handlers:{delete:ZB}}}function YB(e){this.enter({type:`delete`,children:[]},e)}function XB(e){this.exit(e)}function ZB(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function QB(){return`~`}function $B(e){return e.length}function eV(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||$B,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=tV(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=nV(r[d]);else{let e=nV(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
1613
- `)}function tV(e){return e==null?``:String(e)}function nV(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function rV(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),iV);return i(),o}function iV(e,t,n){return`>`+(n?``:` `)+e}function aV(e,t){return oV(e,t.inConstruct,!0)&&!oV(e,t.notInConstruct,!1)}function oV(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function sV(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
1614
- `&&aV(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
1615
- `}function cV(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function lV(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function uV(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function dV(e,t,n,r){let i=uV(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(lV(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,fV);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(cV(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
1610
+ `}),n}function bz(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function xz(e,t){let n=hz(e,t),r=n.one(e,void 0),i=ez(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
1611
+ `},i)),a}function Sz(e,t){return e&&`run`in e?async function(n,r){let i=xz(n,{file:r,...t});await e.run(i,r)}:function(n,r){return xz(n,{file:r,...e||t})}}function Cz(e){if(e)throw e}var wz=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function Tz(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Ez(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Dz(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Dz(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var Oz={basename:kz,dirname:Az,extname:jz,join:Mz,sep:`/`};function kz(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Fz(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Az(e){if(Fz(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function jz(e){Fz(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Mz(...e){let t=-1,n;for(;++t<e.length;)Fz(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Nz(n)}function Nz(e){Fz(e);let t=e.codePointAt(0)===47,n=Pz(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Pz(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Fz(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Iz={cwd:Lz};function Lz(){return`/`}function Rz(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function zz(e){if(typeof e==`string`)e=new URL(e);else if(!Rz(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Bz(e)}function Bz(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var Vz=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Hz=class{constructor(e){let t;t=e?Rz(e)?{path:e}:typeof e==`string`||Kz(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Iz.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Vz.length;){let e=Vz[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Vz.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Oz.basename(this.path):void 0}set basename(e){Wz(e,`basename`),Uz(e,`basename`),this.path=Oz.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Oz.dirname(this.path):void 0}set dirname(e){Gz(this.basename,`dirname`),this.path=Oz.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Oz.extname(this.path):void 0}set extname(e){if(Uz(e,`extname`),Gz(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=Oz.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Rz(e)&&(e=zz(e)),Wz(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Oz.basename(this.path,this.extname):void 0}set stem(e){Wz(e,`stem`),Uz(e,`stem`),this.path=Oz.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new DP(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Uz(e,t){if(e&&e.includes(Oz.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Oz.sep+"`")}function Wz(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Gz(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Kz(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var qz=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Jz=l(wz(),1),Yz={}.hasOwnProperty,Xz=new class e extends qz{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Ez()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Jz.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?($z(`data`,this.frozen),this.namespace[e]=t,this):Yz.call(this.namespace,e)&&this.namespace[e]||void 0:e?($z(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=nB(e),n=this.parser||this.Parser;return Zz(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Zz(`process`,this.parser||this.Parser),Qz(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=nB(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);iB(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),Zz(`processSync`,this.parser||this.Parser),Qz(`processSync`,this.compiler||this.Compiler),this.process(e,r),tB(`processSync`,`process`,t),n;function r(e,r){t=!0,Cz(e),n=r}}run(e,t,n){eB(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=nB(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),tB(`runSync`,`run`,n),r;function i(e,t){Cz(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=nB(t),r=this.compiler||this.Compiler;return Qz(`stringify`,r),eB(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if($z(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,Jz.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Tz(o)&&Tz(r)&&(r=(0,Jz.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Zz(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Qz(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function $z(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function eB(e){if(!Tz(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function tB(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function nB(e){return rB(e)?e:new Hz(e)}function rB(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function iB(e){return typeof e==`string`||aB(e)}function aB(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var oB=[],sB={allowDangerousHtml:!0},cB=/^(https?|ircs?|mailto|xmpp)$/i,lB=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function uB(e){let t=dB(e),n=fB(e);return pB(t.runSync(t.parse(n),n),e)}function dB(e){let t=e.rehypePlugins||oB,n=e.remarkPlugins||oB,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...sB}:sB;return Xz().use(aR).use(n).use(Sz,r).use(t)}function fB(e){let t=e.children||``,n=new Hz;return typeof t==`string`?n.value=t:``+t,n}function pB(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||mB;for(let e of lB)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return fz(e,l),FP(e,{Fragment:g.Fragment,components:i,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in rF)if(Object.hasOwn(rF,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=rF[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function mB(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||cB.test(e.slice(0,t))?e:``}function hB(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function gB(e,t,n){let r=tz((n||{}).ignore||[]),i=_B(t),a=-1;for(;++a<i.length;)uz(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function _B(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([vB(e[0]),yB(e[1])])}return t}function vB(e){return typeof e==`string`?new RegExp(hB(e),`g`):e}function yB(e){return typeof e==`function`?e:function(){return e}}var bB=`phrasing`,xB=[`autolink`,`link`,`image`,`label`];function SB(){return{transforms:[AB],enter:{literalAutolink:wB,literalAutolinkEmail:TB,literalAutolinkHttp:TB,literalAutolinkWww:TB},exit:{literalAutolink:kB,literalAutolinkEmail:OB,literalAutolinkHttp:EB,literalAutolinkWww:DB}}}function CB(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:bB,notInConstruct:xB},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:bB,notInConstruct:xB},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:bB,notInConstruct:xB}]}}function wB(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function TB(e){this.config.enter.autolinkProtocol.call(this,e)}function EB(e){this.config.exit.autolinkProtocol.call(this,e)}function DB(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function OB(e){this.config.exit.autolinkEmail.call(this,e)}function kB(e){this.exit(e)}function AB(e){gB(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,jB],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,MB]],{ignore:[`link`,`linkReference`]})}function jB(e,t,n,r,i){let a=``;if(!FB(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!NB(n)))return!1;let o=PB(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function MB(e,t,n,r){return!FB(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function NB(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function PB(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=la(e,`(`),a=la(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function FB(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||AF(n)||kF(n))&&(!t||n!==47)}GB.peek=WB;function IB(){this.buffer()}function LB(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function RB(){this.buffer()}function zB(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function BB(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=vF(this.sliceSerialize(e)).toLowerCase(),n.label=t}function VB(e){this.exit(e)}function HB(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=vF(this.sliceSerialize(e)).toLowerCase(),n.label=t}function UB(e){this.exit(e)}function WB(){return`[`}function GB(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function KB(){return{enter:{gfmFootnoteCallString:IB,gfmFootnoteCall:LB,gfmFootnoteDefinitionLabelString:RB,gfmFootnoteDefinition:zB},exit:{gfmFootnoteCallString:BB,gfmFootnoteCall:VB,gfmFootnoteDefinitionLabelString:HB,gfmFootnoteDefinition:UB}}}function qB(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:GB},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
1612
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?YB:JB))),s(),o}}function JB(e,t,n){return t===0?e:YB(e,t,n)}function YB(e,t,n){return(n?``:` `)+e}var XB=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];tV.peek=nV;function ZB(){return{canContainEols:[`delete`],enter:{strikethrough:$B},exit:{strikethrough:eV}}}function QB(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:XB}],handlers:{delete:tV}}}function $B(e){this.enter({type:`delete`,children:[]},e)}function eV(e){this.exit(e)}function tV(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function nV(){return`~`}function rV(e){return e.length}function iV(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||rV,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=aV(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=oV(r[d]);else{let e=oV(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
1613
+ `)}function aV(e){return e==null?``:String(e)}function oV(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function sV(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),cV);return i(),o}function cV(e,t,n){return`>`+(n?``:` `)+e}function lV(e,t){return uV(e,t.inConstruct,!0)&&!uV(e,t.notInConstruct,!1)}function uV(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function dV(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
1614
+ `&&lV(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
1615
+ `}function fV(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function pV(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function mV(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function hV(e,t,n,r){let i=mV(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(pV(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,gV);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(fV(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
1616
1616
  `,encode:["`"],...s.current()})),t()}return u+=s.move(`
1617
1617
  `),a&&(u+=s.move(a+`
1618
- `)),u+=s.move(c),l(),u}function fV(e,t,n){return(n?``:` `)+e}function pV(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function mV(e,t,n,r){let i=pV(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
1619
- `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function hV(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function gV(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function _V(e,t,n){let r=IF(e),i=IF(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}vV.peek=yV;function vV(e,t,n,r){let i=hV(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=_V(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=gV(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=_V(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+gV(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function yV(e,t,n){return n.options.emphasis||`*`}function bV(e,t){let n=!1;return cz(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&tF(e)&&(t.options.setext||n))}function xV(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(bV(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
1618
+ `)),u+=s.move(c),l(),u}function gV(e,t,n){return(n?``:` `)+e}function _V(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function vV(e,t,n,r){let i=_V(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
1619
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function yV(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function bV(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function xV(e,t,n){let r=BF(e),i=BF(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}SV.peek=CV;function SV(e,t,n,r){let i=yV(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=xV(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=bV(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=xV(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+bV(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function CV(e,t,n){return n.options.emphasis||`*`}function wV(e,t){let n=!1;return fz(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&aF(e)&&(t.options.setext||n))}function TV(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(wV(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
1620
1620
  `,after:`
1621
1621
  `});return r(),t(),o+`
1622
1622
  `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
1623
1623
  `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
1624
- `,...a.current()});return/^[\t ]/.test(l)&&(l=gV(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}SV.peek=CV;function SV(e){return e.value||``}function CV(){return`<`}wV.peek=TV;function wV(e,t,n,r){let i=pV(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function TV(){return`!`}EV.peek=DV;function EV(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function DV(){return`!`}OV.peek=kV;function OV(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function kV(){return"`"}function AV(e,t){let n=tF(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}jV.peek=MV;function jV(e,t,n,r){let i=pV(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(AV(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function MV(e,t,n){return AV(e,n)?`<`:`[`}NV.peek=PV;function NV(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function PV(){return`[`}function FV(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function IV(e){let t=FV(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function LV(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function RV(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function zV(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?LV(n):FV(n),s=e.ordered?o===`.`?`)`:`.`:IV(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),RV(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function BV(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function VV(e,t,n,r){let i=BV(n),a=n.bulletCurrent||FV(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function HV(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var UV=ZR([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function WV(e,t,n,r){return(e.children.some(function(e){return UV(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function GV(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}KV.peek=qV;function KV(e,t,n,r){let i=GV(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=_V(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=gV(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=_V(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+gV(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function qV(e,t,n){return n.options.strong||`*`}function JV(e,t,n,r){return n.safe(e.value,r)}function YV(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function XV(e,t,n){let r=(RV(n)+(n.options.ruleSpaces?` `:``)).repeat(YV(n));return n.options.ruleSpaces?r.slice(0,-1):r}var ZV={blockquote:rV,break:sV,code:dV,definition:mV,emphasis:vV,hardBreak:sV,heading:xV,html:SV,image:wV,imageReference:EV,inlineCode:OV,link:jV,linkReference:NV,list:zV,listItem:VV,paragraph:HV,root:WV,strong:KV,text:JV,thematicBreak:XV};function QV(){return{enter:{table:$V,tableData:rH,tableHeader:rH,tableRow:tH},exit:{codeText:iH,table:eH,tableData:nH,tableHeader:nH,tableRow:nH}}}function $V(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function eH(e){this.exit(e),this.data.inTable=void 0}function tH(e){this.enter({type:`tableRow`,children:[]},e)}function nH(e){this.exit(e)}function rH(e){this.enter({type:`tableCell`,children:[]},e)}function iH(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,aH));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function aH(e,t){return t===`|`?t:e}function oH(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
1624
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=bV(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}EV.peek=DV;function EV(e){return e.value||``}function DV(){return`<`}OV.peek=kV;function OV(e,t,n,r){let i=_V(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function kV(){return`!`}AV.peek=jV;function AV(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function jV(){return`!`}MV.peek=NV;function MV(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function NV(){return"`"}function PV(e,t){let n=aF(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}FV.peek=IV;function FV(e,t,n,r){let i=_V(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(PV(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function IV(e,t,n){return PV(e,n)?`<`:`[`}LV.peek=RV;function LV(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function RV(){return`[`}function zV(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function BV(e){let t=zV(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function VV(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function HV(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function UV(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?VV(n):zV(n),s=e.ordered?o===`.`?`)`:`.`:BV(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),HV(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function WV(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function GV(e,t,n,r){let i=WV(n),a=n.bulletCurrent||zV(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function KV(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var qV=tz([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function JV(e,t,n,r){return(e.children.some(function(e){return qV(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function YV(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}XV.peek=ZV;function XV(e,t,n,r){let i=YV(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=xV(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=bV(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=xV(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+bV(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function ZV(e,t,n){return n.options.strong||`*`}function QV(e,t,n,r){return n.safe(e.value,r)}function $V(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function eH(e,t,n){let r=(HV(n)+(n.options.ruleSpaces?` `:``)).repeat($V(n));return n.options.ruleSpaces?r.slice(0,-1):r}var tH={blockquote:sV,break:dV,code:hV,definition:vV,emphasis:SV,hardBreak:dV,heading:TV,html:EV,image:OV,imageReference:AV,inlineCode:MV,link:FV,linkReference:LV,list:UV,listItem:GV,paragraph:KV,root:JV,strong:XV,text:QV,thematicBreak:eH};function nH(){return{enter:{table:rH,tableData:sH,tableHeader:sH,tableRow:aH},exit:{codeText:cH,table:iH,tableData:oH,tableHeader:oH,tableRow:oH}}}function rH(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function iH(e){this.exit(e),this.data.inTable=void 0}function aH(e){this.enter({type:`tableRow`,children:[]},e)}function oH(e){this.exit(e)}function sH(e){this.enter({type:`tableCell`,children:[]},e)}function cH(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,lH));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function lH(e,t){return t===`|`?t:e}function uH(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
1625
1625
  `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
1626
- `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return eV(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=ZV.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function sH(){return{exit:{taskListCheckValueChecked:lH,taskListCheckValueUnchecked:lH,paragraph:uH}}}function cH(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:dH}}}function lH(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function uH(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function dH(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=ZV.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function fH(){return[vB(),HB(),qB(),QV(),sH()]}function pH(e){return{extensions:[yB(),UB(e),JB(),oH(e),cH()]}}var mH={tokenize:OH,partial:!0},hH={tokenize:kH,partial:!0},gH={tokenize:AH,partial:!0},_H={tokenize:jH,partial:!0},vH={tokenize:MH,partial:!0},yH={name:`wwwAutolink`,tokenize:EH,previous:NH},bH={name:`protocolAutolink`,tokenize:DH,previous:PH},xH={name:`emailAutolink`,tokenize:TH,previous:FH},SH={};function CH(){return{text:SH}}for(var wH=48;wH<123;)SH[wH]=xH,wH++,wH===58?wH=65:wH===91&&(wH=97);SH[43]=xH,SH[45]=xH,SH[46]=xH,SH[95]=xH,SH[72]=[xH,bH],SH[104]=[xH,bH],SH[87]=[xH,yH],SH[119]=[xH,yH];function TH(e,t,n){let r=this,i,a;return o;function o(t){return!IH(t)||!FH.call(r,r.previous)||LH(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return IH(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(vH,u,l)(t):t===45||t===95||gF(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&hF(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function EH(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!NH.call(r,r.previous)||LH(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(mH,e.attempt(hH,e.attempt(gH,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function DH(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&PH.call(r,r.previous)&&!LH(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(hF(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||vF(t)||CF(t)||EF(t)||TF(t)?n(t):e.attempt(hH,e.attempt(gH,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function OH(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function kH(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(_H,c,s)(t):t===null||CF(t)||EF(t)||t!==45&&TF(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function AH(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(_H,t,a)(o):o===null||CF(o)||EF(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function jH(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||CF(o)||EF(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||CF(e)||EF(e)?t(e):r(e)}function a(e){return hF(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):hF(t)?(e.consume(t),o):n(t)}}function MH(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return gF(e)?n(e):t(e)}}function NH(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||CF(e)}function PH(e){return!hF(e)}function FH(e){return!(e===47||IH(e))}function IH(e){return e===43||e===45||e===46||e===95||gF(e)}function LH(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var RH={tokenize:KH,partial:!0};function zH(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:UH,continuation:{tokenize:WH},exit:GH}},text:{91:{name:`gfmFootnoteCall`,tokenize:HH},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:BH,resolveTo:VH}}}}function BH(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=mF(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function VH(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function HH(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||CF(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(mF(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return CF(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function UH(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||CF(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=mF(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return CF(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),kF(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function WH(e,t,n){return e.check(WF,t,e.attempt(RH,t,n))}function GH(e){e.exit(`gfmFootnoteDefinition`)}function KH(e,t,n){let r=this;return kF(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function qH(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&sF(o,o.length,0,LF(s,e.slice(r+1,n),t)),sF(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),sF(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=IF(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=IF(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var JH=class{constructor(){this.map=[]}add(e,t,n){YH(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function YH(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function XH(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function ZH(){return{flow:{null:{name:`table`,tokenize:QH,resolveAll:$H}}}}function QH(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):SF(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):wF(t)?kF(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||CF(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,wF(t)?kF(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return wF(t)?kF(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||SF(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return wF(t)?kF(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||SF(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||SF(n)?(e.exit(`tableRow`),t(n)):wF(n)?kF(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||CF(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function $H(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new JH;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(tU(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=eU(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=eU(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=eU(f,t,o,i,n,d)):(o[0]=o[1],d=eU(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&tU(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=XH(t.events,n))}return e}function eU(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},nU(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=nU(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=nU(t.events,n[2]),a=nU(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},nU(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function tU(e,t,n,r,i){let a=[],o=nU(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function nU(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var rU={name:`tasklistCheck`,tokenize:aU};function iU(){return{text:{91:rU}}}function aU(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return CF(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return SF(r)?t(r):wF(r)?e.check({tokenize:oU},t,n)(r):n(r)}}function oU(e,t,n){return kF(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function sU(e){return uF([CH(),zH(),qH(e),ZH(),iU()])}var cU={};function lU(e){let t=this,n=e||cU,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(sU(n)),a.push(fH()),o.push(pH(n))}var uU=200;function dU(e){return e===`system`?typeof matchMedia==`function`&&matchMedia(`(prefers-color-scheme: dark)`).matches:e===`dark`}async function fU(e,t,n){return pU(e,xd(t),n)}async function pU(e,t,n){let r=dU(n)?KN.dark:KN.light,i=await fd({themes:[KN.dark,KN.light],langs:[t]});return e.map(e=>{try{let[n=[]]=i.codeToTokensBase(e,{lang:t,theme:r});return n.map(e=>({text:e.content,color:e.color}))}catch{return[{text:e}]}})}var mU=()=>new Promise(e=>setTimeout(e,0));function hU(e,t,n=0){let[r,i]=(0,p.useState)(()=>({items:e,map:new Map})),a=(0,p.useRef)(n);return a.current=n,(0,p.useEffect)(()=>{let n=!1;i(t=>t.items===e?t:{items:e,map:new Map});let r=[];e.forEach((e,t)=>{let n=r[r.length-1];n&&n.path===e.path?(n.lines.push(e.text),n.last=t):r.push({path:e.path,lines:[e.text],first:t,last:t})});let o=e=>{let t=a.current;return t<e.first?e.first-t:t>e.last?t-e.last:0};return(async()=>{let a=[...r];for(;a.length>0&&!n;){let r=0;for(let e=1;e<a.length;e++)o(a[e])<o(a[r])&&(r=e);let[s]=a.splice(r,1),{path:c,lines:l}=s,u=[];for(let e=0;e<l.length&&!n;e+=uU){let n=l.slice(e,e+uU);u.push(...await fU(n,c,t).catch(()=>n.map(e=>[{text:e}]))),await mU()}if(n)return;i(t=>{if(t.items!==e)return t;let n=new Map(t.map);return u.forEach((e,t)=>n.set(`${c}\n${l[t]}`,e)),{items:t.items,map:n}})}})(),()=>{n=!0}},[e,t]),r.items===e?r.map:new Map}function gU({code:e,lang:t,theme:n}){let[r,i]=(0,p.useState)(null),a=(0,p.useMemo)(()=>e.replace(/\n$/,``).split(`
1627
- `),[e]);return(0,p.useEffect)(()=>{let e=!0;return i(null),pU(a,t,n).then(t=>e&&i(t)).catch(()=>{}),()=>{e=!1}},[a,t,n]),(0,g.jsx)(g.Fragment,{children:a.map((e,t)=>(0,g.jsxs)(`span`,{children:[(0,g.jsx)(_U,{tokens:r?.[t],fallback:e}),`
1628
- `]},t))})}function _U({tokens:e,fallback:t}){return e?(0,g.jsx)(g.Fragment,{children:e.map((e,t)=>(0,g.jsx)(`span`,{style:e.color?{color:e.color}:void 0,children:e.text},t))}):(0,g.jsx)(g.Fragment,{children:t})}function vU({text:e,path:t,highlight:n=!1}){let r=(0,p.useMemo)(()=>({pre:e=>(0,g.jsx)(yU,{...e,path:t,highlight:n}),a:wU}),[t,n]);return(0,g.jsx)(`div`,{className:`markdown`,children:(0,g.jsx)(oB,{remarkPlugins:[lU],components:r,urlTransform:CU,disallowedElements:[`img`],unwrapDisallowed:!0,children:e})})}function yU({children:e,node:t,path:n,highlight:r,...i}){let a=Y(e=>e.theme),o=(Array.isArray(e)?e[0]:e)?.props,s=/language-(\S+)/.exec(o?.className??``)?.[1];if(r&&s!==`suggestion`){let e=s??(n?xd(n):void 0);if(e)return(0,g.jsx)(`pre`,{...i,children:(0,g.jsx)(`code`,{className:o?.className,children:(0,g.jsx)(gU,{code:xU(o?.children),lang:e,theme:a})})})}if(s===`suggestion`){let t=n?xU(o?.children).replace(/\n$/,``):void 0;return t==null?(0,g.jsxs)(`pre`,{...i,className:`suggestion`,title:`Suggested replacement for the quoted lines`,children:[(0,g.jsx)(`span`,{className:`tag`,children:`Suggestion`}),e]}):(0,g.jsxs)(`div`,{className:`suggestion highlighted`,title:`Suggested replacement for the quoted lines`,children:[(0,g.jsx)(`span`,{className:`tag`,children:`Suggestion`}),(0,g.jsx)(bU,{path:n,source:t})]})}return(0,g.jsx)(`pre`,{...i,children:e})}function bU({path:e,source:t}){let n=Y(e=>e.theme),r=Zp(),[i,a]=(0,p.useState)(0),o=(0,p.useMemo)(()=>({name:e,contents:t,cacheKey:`suggestion:${e}:${t}`}),[e,t]),s=(0,p.useMemo)(()=>({theme:KN,themeType:n,disableFileHeader:!0,disableLineNumbers:!0,overflow:`wrap`}),[n]);return(0,p.useEffect)(()=>{let e=!0;return r?.primeFileHighlightCache(o).then(()=>e&&a(e=>e+1)).catch(()=>{}),()=>{e=!1}},[r,o,n]),(0,g.jsx)(Gy,{file:o,options:s},`${n}:${i}`)}function xU(e){if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(xU).join(``);let t=e?.props?.children;return t==null?``:xU(t)}var SU=/^diffle:([^#]*)(?:#L(\d+))?$/;function CU(e){return SU.test(e)?e:uB(e)}function wU({node:e,href:t,children:n,...r}){let i=SU.exec(t??``);return i?(0,g.jsx)(`a`,{...r,href:t,onClick:e=>{e.preventDefault(),Y.getState().goToLink(decodeURI(i[1]),i[2]==null?void 0:Number(i[2]))},children:n}):(0,g.jsx)(`a`,{...r,href:t,target:`_blank`,rel:`noreferrer`,children:n})}function TU(e){let[t,n]=(0,p.useState)(!1);return(0,p.useEffect)(()=>{if(!t)return;let e=setTimeout(()=>n(!1),3e3);return()=>clearTimeout(e)},[t]),{armed:t,fire:()=>{if(!t){n(!0);return}n(!1),e()}}}function EU(){let e=Y(e=>e.threads),t=Y(e=>e.showResolved),n=Y(e=>e.setShowResolved),r=Y(e=>e.openFile),i=Y(e=>e.clearThreads),a=Y(e=>e.deleteThread),o=Y(e=>e.deleteStaleThreads),s=Y(e=>e.focusThread),c=Y(e=>e.report),l=Y(e=>e.exportToGithub),u=Y(e=>e.github.data?.reason===null),[d,f]=(0,p.useState)(!1),[m,h]=(0,p.useState)(null),[_,v]=(0,p.useState)(null);(0,p.useEffect)(()=>{if(!_)return;let e=setTimeout(()=>v(null),2e3);return()=>clearTimeout(e)},[_]);let y=TU(()=>{f(!0),l().then(v).finally(()=>f(!1))}),b=TU(()=>void i()),x=TU(()=>void o()),S=(0,p.useMemo)(()=>YM({threads:e,showResolved:t}),[e,t]),C=e.filter(e=>!e.resolved),w=e.length-C.length,T=e.filter(e=>e.stale).length,E=(0,p.useMemo)(()=>{let e=new Map;for(let t of[...S].sort(kU)){let n=e.get(t.anchor.path)??[];n.push(t),e.set(t.anchor.path,n)}return[...e.entries()]},[S]),D=async()=>{let e;try{e=await Vk.exportComments()}catch(e){return c(`Copying comments`,e),!1}return await TM(e)?!0:(h(e),!1)};return(0,g.jsxs)(`aside`,{className:`flex min-h-0 flex-col bg-surface`,children:[(0,g.jsxs)(`div`,{className:`flex min-h-10 items-center gap-1.5 border-b border-b-border px-2.5 py-1.5 [&_button]:flex-none [&_button]:px-2 [&_button]:whitespace-nowrap`,children:[(0,g.jsxs)(`span`,{className:`mr-auto inline-flex min-w-0 items-center gap-1.5 truncate font-semibold`,children:[(0,g.jsx)(rM,{size:`0.9375rem`}),` Threads`,C.length>0&&(0,g.jsx)(`span`,{className:`rounded-[0.625rem] bg-hover px-1.75 py-0 font-medium text-muted`,children:C.length})]}),(0,g.jsx)(OU,{label:`All`,icon:(0,g.jsx)(Fj,{size:`0.875rem`}),primary:!0,disabled:C.length===0,title:`Copy all open threads as a prompt (yy)`,onCopy:()=>D()}),u&&(0,g.jsxs)(wM,{variant:`ghost`,icon:!y.armed&&!_,feedback:y.armed?`confirm`:_?`posted`:void 0,disabled:d||C.length===0&&!_,title:y.armed?`Click again to add all open threads to the pending review`:`Add all open threads to a pending review on the GitHub pull request; you submit it on GitHub`,"aria-label":y.armed?`Add all open threads to the pending review? Click again to confirm`:`Add all open threads to a pending review on the GitHub pull request`,onClick:y.fire,children:[_?(0,g.jsx)(Oj,{size:`0.875rem`}):(0,g.jsx)(Zj,{size:`0.875rem`}),y.armed?`Add all?`:_?aN(_):null]}),(0,g.jsxs)(wM,{variant:`ghost`,danger:!0,icon:!b.armed,feedback:b.armed?`confirm`:void 0,disabled:e.length===0,title:b.armed?`Click again to delete all threads`:`Delete all threads for this mode`,onClick:b.fire,children:[(0,g.jsx)(yM,{size:`0.875rem`}),b.armed&&`Delete all?`]})]}),T>0&&(0,g.jsxs)(`div`,{className:`flex cursor-default items-center gap-1.5 border-b border-b-border px-2.5 py-1 text-[0.75rem] text-warn`,title:`Stale threads no longer point into the diff: their text changed or left the changed lines`,children:[(0,g.jsx)(bM,{size:`0.75rem`}),T,` stale`,(0,g.jsxs)(wM,{variant:`ghost`,danger:!0,feedback:x.armed?`confirm`:void 0,className:`ml-auto gap-1 px-1.5 py-px text-[0.75rem] leading-[1.2]`,onClick:x.fire,children:[(0,g.jsx)(yM,{size:`0.75rem`}),x.armed?`Delete stale?`:`Delete`]})]}),w>0&&(0,g.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5 border-b border-b-border px-2.5 py-1 text-[0.75rem] text-muted`,title:`Resolved threads are kept but left out of the prompt`,children:[(0,g.jsx)(`input`,{type:`checkbox`,checked:t,onChange:e=>n(e.target.checked)}),`Show `,w,` resolved`]}),(0,g.jsxs)(`div`,{className:`flex flex-1 flex-col gap-3.5 overflow-auto p-2.5`,children:[E.length===0&&(0,g.jsxs)(`div`,{className:`px-3 py-6 text-center text-muted [&>p]:mt-0 [&>p]:mr-0 [&>p]:mb-1.5 [&>p]:ml-0`,children:[(0,g.jsx)(`p`,{children:e.length?`Every thread is resolved.`:`No comments yet.`}),(0,g.jsx)(`p`,{children:`Click a line number to comment, or drag across line numbers for a block.`})]}),E.map(([e,t])=>(0,g.jsxs)(`section`,{className:`border-0 [&+section]:border-t [&+section]:border-solid [&+section]:border-border [&+section]:pt-3`,children:[(0,g.jsx)(`h4`,{className:`m-0 mb-1.5 font-mono text-[0.75rem] leading-[1.4] text-muted`,children:(0,g.jsx)(oP,{path:e})}),t.map(e=>(0,g.jsx)(DU,{thread:e,openFile:r,focusThread:s,deleteThread:a},e.id))]},e))]}),m&&(0,g.jsxs)(hj,{label:`Copy manually`,onClose:()=>h(null),children:[(0,g.jsx)(`h3`,{className:`m-0 mb-2`,children:`Copy manually`}),(0,g.jsx)(`p`,{className:`m-0 mb-2 text-muted`,children:`The browser blocked clipboard access. Select the text below and press Ctrl/⌘+c.`}),(0,g.jsx)(`textarea`,{className:`min-h-40 w-full rounded-md border border-border bg-surface p-2 font-mono text-[0.75rem]`,readOnly:!0,value:m,autoFocus:!0,onFocus:e=>e.currentTarget.select()}),(0,g.jsx)(`div`,{className:`mt-2.5 flex justify-end gap-1.5`,children:(0,g.jsx)(wM,{onClick:()=>h(null),children:`Close`})})]})]})}var DU=(0,p.memo)(function({thread:e,openFile:t,focusThread:n,deleteThread:r}){let i=e.messages[0],a=TU(()=>void r(e.id)),o=()=>{t(e.anchor.path,e.anchor.endLine,e.anchor.side),n(e.id)};return(0,g.jsxs)(`div`,{role:`button`,tabIndex:0,className:mj(`group/thread mb-2 block w-full cursor-pointer overflow-hidden rounded-md border border-border bg-card p-0 text-left font-sans text-[0.8125rem] leading-[1.4] text-foreground shadow-card [transition:border-color_120ms_ease] hover:border-accent focus-visible:outline-2 focus-visible:outline-offset-[1px] focus-visible:outline-accent focus-visible:outline-solid ${e.stale?`border-dashed`:``} ${e.resolved?`opacity-65`:``}`),onClick:o,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o())},children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-b-border bg-hover py-1 pr-1.5 pl-2.5 text-[0.75rem] text-muted [&>svg]:flex-none [&>svg]:text-accent`,children:[(0,g.jsx)(rM,{size:`0.8125rem`}),(0,g.jsxs)(`span`,{className:`font-mono font-semibold text-foreground`,children:[e.anchor.side===`old`?`removed `:``,`L`,e.anchor.startLine,e.anchor.endLine===e.anchor.startLine?``:`–${e.anchor.endLine}`]}),e.messages.length>1&&(0,g.jsxs)(`span`,{className:`text-muted`,children:[e.messages.length-1,` repl`,e.messages.length===2?`y`:`ies`]}),e.stale&&(0,g.jsxs)(`span`,{className:`inline-flex items-center gap-0.75 font-sans text-[0.6875rem] leading-[normal] text-warn`,children:[(0,g.jsx)(bM,{size:`0.6875rem`}),` stale`]}),e.resolved&&(0,g.jsxs)(`span`,{className:`inline-flex items-center gap-0.75 font-sans text-[0.6875rem] leading-[normal] text-add`,children:[(0,g.jsx)(Oj,{size:`0.6875rem`}),` resolved`]}),(0,g.jsxs)(wM,{type:`button`,variant:`ghost`,danger:!0,icon:!a.armed,feedback:a.armed?`confirm`:void 0,className:`ml-auto px-0.75 py-[1px] opacity-0 [transition:opacity_120ms_ease] group-focus-within/thread:opacity-100 group-hover/thread:opacity-100 data-[feedback=confirm]:opacity-100`,title:a.armed?`Click again to delete this thread`:`Delete this thread`,"aria-label":a.armed?`Delete this thread? Click again to confirm`:`Delete this thread`,onClick:e=>{e.stopPropagation(),a.fire()},children:[(0,g.jsx)(yM,{size:`0.75rem`}),a.armed&&`Delete?`]})]}),(0,g.jsxs)(`div`,{className:`px-2.5 pt-1.5 pb-2 [&>.markdown]:font-sans [&>.markdown]:text-[0.8125rem] [&>.markdown]:leading-[1.4] [&>.markdown]:[word-break:break-word]`,children:[(0,g.jsx)(`div`,{className:`m-0 mb-1.5 overflow-hidden font-mono text-[0.75rem] leading-[1.4] text-ellipsis whitespace-nowrap text-muted`,children:AU(e.anchor.quoted)}),(0,g.jsx)(vU,{text:i?.body??``,path:e.anchor.path})]})]})});function OU({label:e,icon:t,onCopy:n,primary:r,disabled:i,title:a}){let[o,s]=(0,p.useState)(!1),c=(0,p.useRef)(null);return(0,p.useEffect)(()=>()=>void(c.current&&clearTimeout(c.current)),[]),(0,g.jsxs)(wM,{variant:r?`primary`:`default`,feedback:o?`copied`:void 0,className:`relative [transition:background_160ms_ease,_color_160ms_ease,_border-color_160ms_ease]`,disabled:i,title:a,onClick:async()=>{await n()&&(s(!0),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>s(!1),1400))},children:[(0,g.jsx)(CM,{done:o,children:t}),o?`Copied`:e]})}function kU(e,t){return e.anchor.path===t.anchor.path?e.anchor.startLine-t.anchor.startLine||(e.messages[0]?.createdAt??0)-(t.messages[0]?.createdAt??0):e.anchor.path<t.anchor.path?-1:1}function AU(e){let[t=``]=e.split(`
1629
- `),n=t.trim();return n.length>70?n.slice(0,70)+`…`:n}function jU({selected:e,className:t,...n}){return(0,g.jsx)(wM,{...n,"aria-pressed":e,className:mj(`rounded-none border-0 bg-transparent px-2 py-[2px]`,e&&`bg-hover font-semibold`,t)})}function MU(){let e=Y(e=>e.githubMenuOpen),t=Y(e=>e.setGithubMenuOpen),n=Y(e=>e.github),r=n.data,i=r?.repository,a=(0,p.useRef)(null),o=(0,p.useRef)(null);(0,p.useEffect)(()=>{if(!e)return;let n=e=>{a.current?.contains(e.target)||t(!1)};return document.addEventListener(`mousedown`,n),()=>document.removeEventListener(`mousedown`,n)},[e,t]);let s=r?.pullRequest;return(0,g.jsxs)(`div`,{className:`relative`,ref:a,onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),t(!1),o.current?.focus())},children:[(0,g.jsxs)(wM,{ref:o,variant:`ghost`,title:`GitHub information (o)`,"aria-label":`GitHub information`,"aria-expanded":e,"aria-controls":`github-menu`,onClick:()=>t(!e),children:[(0,g.jsx)(Qj,{size:`1rem`}),` GitHub`]}),e&&(0,g.jsxs)(`section`,{id:`github-menu`,role:`dialog`,"aria-label":`GitHub information`,className:`absolute top-[calc(100%+0.375rem)] left-0 z-30 w-80 max-w-[85vw] rounded-lg border border-border bg-surface p-3 text-[0.8125rem] shadow-lg`,children:[(0,g.jsx)(`strong`,{children:`Repository`}),(0,g.jsx)(`p`,{className:`mt-1 mb-3 wrap-anywhere`,children:i?(0,g.jsxs)(`a`,{className:`inline-flex items-center gap-1 text-accent hover:underline`,href:`https://github.com/${i}`,target:`_blank`,rel:`noreferrer`,children:[i,(0,g.jsx)(Vj,{size:`0.75rem`})]}):(0,g.jsx)(`span`,{className:`text-muted`,children:n.status===`loading`?`Loading…`:r?`No GitHub origin`:`Unavailable`})}),(0,g.jsx)(`strong`,{children:`Pull request`}),(0,g.jsx)(`div`,{"aria-live":`polite`,className:`mt-1`,children:n.status===`loading`?(0,g.jsx)(`p`,{className:`text-muted`,children:`Loading…`}):n.status===`error`?(0,g.jsxs)(`p`,{className:`text-warn`,children:[`Lookup failed: `,n.error]}):s?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`a`,{className:`text-accent hover:underline`,href:s.url,target:`_blank`,rel:`noreferrer`,children:[`#`,s.number,` `,s.title]}),(0,g.jsx)(`p`,{className:`mt-1 text-muted`,children:s.state===`OPEN`?s.isDraft?`Draft`:`Open`:s.state===`MERGED`?`Merged`:`Closed`}),s.repository!==i&&(0,g.jsx)(`p`,{className:`text-muted`,children:s.repository}),r?.reason&&(0,g.jsx)(`p`,{className:`mt-2 text-muted`,children:r?.reason})]}):(0,g.jsx)(`p`,{className:`text-muted`,children:r?.reason??`No matching pull request`})})]})]})}function NU(e){return e.dataset.lineType===`change-deletion`||(e.closest(`code`)?.hasAttribute(`data-deletions`)??!1)}function PU(e,t,n){let r=n===`old`;return[...e.querySelectorAll(`[data-line="${t}"]`)].find(e=>NU(e)===r)??null}function FU(e,t,n,r,i=()=>{}){let a=0,o=new WeakSet,s=new MutationObserver(e=>{i(e),c()}),c=()=>{a||=requestAnimationFrame(()=>{a=0;let t=[];for(let n of e()?.getInstance()?.getRenderedItems()??[]){let e=n.element.shadowRoot??n.element;o.has(e)||(o.add(e),s.observe(e,{childList:!0,subtree:!0,characterData:!0})),t.push({id:n.id,root:e})}r(t)})};t.addEventListener(`scroll`,c,{passive:!0}),s.observe(t,{childList:!0,subtree:!0});let l=n(c);return c(),()=>{cancelAnimationFrame(a),s.disconnect(),t.removeEventListener(`scroll`,c),l()}}function IU(e){return[...e.matchAll(/[\p{L}\p{N}_]+/gu)].map(e=>({start:e.index,text:e[0]}))}var LU=()=>null,RU=null,zU=null,BU=!1;function VU(e){LU=e}function HU(){typeof CSS<`u`&&`highlights`in CSS&&CSS.highlights.delete(`diffle-word-focus`),RU=null,zU=null,LN.focus(null)}function UU(){if(BU){BU=!1;return}HU()}var WU=200;function GU(e){let t=Y.getState(),n=t.selection;if(!n)return;let r=NM(n.id),i=YU(r,n.range.end,gN(n)===`old`),a=i==null?[]:ZU(r,i)??[],o=a.findIndex(e=>e.el===RU&&e.col===zU),s=o===-1?e===1?0:a.length-1:o+e;if(i!=null&&s>=0&&s<a.length){JU(a[s],r,i);return}for(let n=0;n<WU;n++){let n=Y.getState().selection;BU=!0,t.moveCursor(e);let r=Y.getState().selection;if(!r||qU(n,r))break;let i=NM(r.id),a=YU(i,r.range.end,gN(r)===`old`);if(a==null)continue;let o=ZU(i,a);if(o==null)break;if(o.length>0){JU(o[e===1?0:o.length-1],i,a);return}}BU=!1,HU()}function KU(e){let t=Y.getState(),n=t.selection;if(!n)return;let r=NM(n.id),i=YU(r,n.range.end,gN(n)===`old`),a=i==null?[]:ZU(r,i)??[],o=e===`first`?a[0]:a[a.length-1];if(i==null||!o)return t.flash(`No symbol on this line`);JU(o,r,i)}function qU(e,t){return e.id===t.id&&e.range.end===t.range.end&&gN(e)===gN(t)}function JU({el:e,col:t,text:n},r,i){HU(),RU=e,zU=t;let a=e.firstChild;if(a?.nodeType===Node.TEXT_NODE&&typeof CSS<`u`&&`highlights`in CSS&&typeof Highlight<`u`){let r=t-Number(e.dataset.char),i=document.createRange();i.setStart(a,r),i.setEnd(a,r+n.length),CSS.highlights.set(`diffle-word-focus`,new Highlight(i))}LN.focus({path:r,side:`new`,line:i,col:t,text:n},e)}function YU(e,t,n){if(!n)return t;let r=XU(e),i=r&&PU(r,t,`old`);if(!i||!i.dataset.lineType?.startsWith(`context`))return null;let a=Number(i.dataset.altLine);return Number.isFinite(a)?a:null}function XU(e){let t=PM(Y.getState(),e),n=LU()?.getInstance()?.getRenderedItems().find(e=>e.id===t);return n?.element.shadowRoot??n?.element??null}function ZU(e,t){let n=XU(e),r=n&&PU(n,t,`new`);return r?[...r.querySelectorAll(`span[data-char]`)].flatMap(e=>IU(e.textContent??``).map(t=>({el:e,col:Number(e.dataset.char)+t.start,text:t.text}))):null}function QU(){if(typeof document>`u`)return 16;let e=parseFloat(getComputedStyle(document.documentElement).fontSize);return Number.isFinite(e)&&e>0?e:16}var $U=800,eW=new Set([`g`,`d`,`y`,`z`]),tW={gg:(e,t)=>void e.goToLine(t),G:(e,t)=>void e.goToLine(t),j:(e,t)=>e.moveCursorBy(t),k:(e,t)=>e.moveCursorBy(-t)},nW={w:()=>GU(1),b:()=>GU(-1),0:()=>KU(`first`),$:()=>KU(`last`),j:e=>e.moveCursor(1),k:e=>e.moveCursor(-1),J:e=>e.moveFile(1),K:e=>e.moveFile(-1),"]":e=>e.moveHunk(1),"[":e=>e.moveHunk(-1),"*":e=>e.searchWord(1),"#":e=>e.searchWord(-1),n:e=>e.search.matches.length?e.moveMatch(1):e.moveHunk(1),N:e=>e.search.matches.length?e.moveMatch(-1):e.moveHunk(-1),gg:e=>e.moveFile(`first`),G:e=>e.moveFile(`last`),V:e=>e.toggleVisual(),c:e=>e.selection&&e.openDraft(e.selection),e:e=>e.editCommentAtCursor(),dd:e=>e.deleteCommentAtCursor(),R:e=>e.toggleResolvedAtCursor(),v:e=>e.toggleViewedAtCursor(),zo:e=>e.setCollapsedAtCursor(!1),zc:e=>e.setCollapsedAtCursor(!0),zC:e=>e.setAllCollapsed(!0),zO:e=>e.setAllCollapsed(!1),zt:e=>e.scrollCursorTo(`top`),zb:e=>e.scrollCursorTo(`bottom`),zz:e=>e.scrollCursorTo(`eye`),s:e=>e.setDiffStyle(e.diffStyle===`split`?`unified`:`split`),t:e=>e.setTheme(ZN(e.theme)),yy:()=>void lW(),Y:()=>void lW(),"/":e=>e.openSearch(`file`),"g/":e=>e.openSearch(VM(e.search.scope)),gf:e=>e.treeModel?.openSearch(),gd:e=>e.goToDefinition(),gy:e=>e.goToTypeDefinition(),gh:e=>e.showHover(),gA:e=>e.findReferences(),gs:e=>e.openSymbols(`document`),gS:e=>e.openSymbols(`workspace`),F:e=>{let t=RM(e);!e.fileView&&t&&e.openFullFile(t)},o:e=>e.setGithubMenuOpen(!e.githubMenuOpen),m:e=>e.setModeMenuOpen(!e.modeMenuOpen),"?":e=>e.setHelpOpen(!e.helpOpen)};function rW(e){return e.composedPath()[0]??e.target}function iW(e){return!e.ctrlKey&&!e.altKey?!1:[...e.key].length!==1||!(e.ctrlKey&&e.altKey||e.getModifierState(`AltGraph`))}function aW(e){if(!e)return!1;let t=e.tagName;return t===`TEXTAREA`||t===`INPUT`||t===`SELECT`||e.isContentEditable}function oW(){let e=(0,p.useRef)(null),t=(0,p.useRef)(``);(0,p.useEffect)(()=>{let n=()=>{e.current&&clearTimeout(e.current.timer),e.current=null},r=r=>{if(r.key===`Shift`||r.key===`Control`||r.key===`Alt`||r.key===`Meta`||r.key===`CapsLock`)return;let i=Y.getState(),a=rW(r),o=t.current;t.current=``;let s=Number(o);if(r.key===`Escape`&&a?.getAttribute(`role`)===`combobox`&&a.getAttribute(`aria-expanded`)===`true`)return;if(r.key===`Escape`){aW(a)&&(a.blur(),i.treeModel?.isSearchOpen()&&i.treeModel.closeSearch()),requestAnimationFrame(()=>cW()),HU(),i.escape(),n();return}if(i.references.open)return r.preventDefault(),r.stopPropagation(),r.key===`j`||r.key===`ArrowDown`||r.ctrlKey&&r.key===`n`?i.moveReference(1):r.key===`k`||r.key===`ArrowUp`||r.ctrlKey&&r.key===`p`?i.moveReference(-1):r.key===`Enter`?i.pickReference():void 0;if((r.metaKey||r.ctrlKey)&&!r.altKey&&r.key.toLowerCase()===`b`){r.preventDefault();let e=i.layout;r.shiftKey?i.setLayout({panelVisible:!e.panelVisible}):i.setLayout({treeVisible:!e.treeVisible});return}if((r.metaKey||r.ctrlKey)&&r.shiftKey&&!r.altKey&&r.key.toLowerCase()===`e`){r.preventDefault(),sW();return}if(r.ctrlKey&&!r.metaKey&&!r.altKey&&(r.key===`o`||r.key===`i`)&&!aW(a)){r.preventDefault(),r.key===`o`?i.jumpBack():i.jumpForward();return}if(r.ctrlKey&&!r.metaKey&&!r.altKey&&(r.key===`d`||r.key===`u`)&&!aW(a)){r.preventDefault();let e=document.querySelector(`.codeview`)?.clientHeight??800,t=Math.max(5,Math.floor(e/2/(1.25*QU())));i.moveCursorBy(r.key===`d`?t:-t);return}if(document.activeElement?.tagName===`FILE-TREE-CONTAINER`){r.key===`ArrowRight`&&!aW(a)?(r.preventDefault(),r.stopPropagation(),cW()):r.key===`/`&&!aW(a)&&(r.preventDefault(),i.treeModel?.openSearch());return}if(aW(a)||r.metaKey||iW(r)||i.modeMenuOpen&&a?.closest(`#mode-picker`)&&!/^[1-4]$/.test(r.key))return;if(r.key===`ArrowDown`||r.key===`ArrowUp`){r.preventDefault();let e=r.key===`ArrowDown`?1:-1;s>0?i.moveCursorBy(e*s):i.moveCursor(e);return}if(r.key===`ArrowLeft`){r.preventDefault(),sW();return}if(i.helpOpen&&r.key!==`?`){i.setHelpOpen(!1);return}if(i.modeMenuOpen&&/^[1-4]$/.test(r.key)){r.preventDefault(),i.pickModeEntry(Number(r.key));return}let c=e.current?.key;if(n(),!c&&/^[0-9]$/.test(r.key)&&(o||r.key!==`0`)){r.preventDefault(),t.current=o+r.key;return}if(!c&&eW.has(r.key)){t.current=o,e.current={key:r.key,timer:setTimeout(n,$U)};return}let l=c?c+r.key:r.key,u=s>0?tW[l]:void 0,d=nW[l];!u&&!d||(r.preventDefault(),u?u(i,s):d(i))},i=e=>{r(e),e.defaultPrevented&&e.stopPropagation()},a=e=>{e.key===`Escape`&&rW(e)?.getAttribute(`role`)!==`combobox`&&setTimeout(cW,0)};return document.addEventListener(`keydown`,i,!0),document.addEventListener(`keyup`,a),()=>{document.removeEventListener(`keydown`,i,!0),document.removeEventListener(`keyup`,a),n(),t.current=``}},[])}function sW(){let e=Y.getState();e.layout.treeVisible||e.setLayout({treeVisible:!0});let t=e.treeModel,n=document.querySelector(`file-tree-container`);requestAnimationFrame(()=>{let r=e.activePath&&t?.getItem(e.activePath)?e.activePath:t?.focusNearestPath(e.activePath??null);r&&t&&t.focusPath(r),(n?.shadowRoot?.querySelector(`[role="treeitem"][tabindex="0"]`)??n?.shadowRoot?.querySelector(`[role="tree"]`)??n)?.focus()})}function cW(){document.activeElement?.blur?.(),document.querySelector(`main[tabindex]`)?.focus({preventScroll:!0})}async function lW(){let e=Y.getState(),t;try{t=await Vk.exportComments()}catch(t){return e.report(`Copying comments`,t)}let n=await TM(t);e.flash(n?`Copied all comments`:`Clipboard blocked; use the panel buttons`)}function uW({label:e,value:t,onChange:n,refs:r,autoFocus:i,inputRef:a,onAccept:o}){let s=(0,p.useId)(),[c,l]=(0,p.useState)(!1),[u,d]=(0,p.useState)(``),[f,m]=(0,p.useState)(-1),h=(0,p.useRef)(null),_=[{value:`HEAD`,detail:`Current commit`,section:`special`},{value:`worktree`,detail:`Uncommitted changes`,section:`special`},...(r?.branches??[]).map(e=>({value:e,detail:e===r?.current?`Current branch`:`Branch`,section:`branches`})),...(r?.remoteBranches??[]).map(e=>({value:e,detail:`Remote branch`,section:`remotes`})),...(r?.tags??[]).map(e=>({value:e,detail:`Tag`,section:`tags`})),...(r?.recent??[]).map(e=>({value:e.short,detail:e.subject,section:`commits`}))].filter((e,t,n)=>n.findIndex(t=>t.value===e.value)===t).filter(e=>`${e.value} ${e.detail}`.toLowerCase().includes(u.toLowerCase())),v=_[f];(0,p.useEffect)(()=>{h.current?.querySelector(`[aria-selected="true"]`)?.scrollIntoView?.({block:`nearest`})},[f]);let y=e=>{n(e),l(!1),m(-1)};return(0,g.jsxs)(`div`,{className:`group/ref relative min-w-0 flex-1`,children:[(0,g.jsx)(`input`,{className:`w-full min-w-0 rounded-md border border-transparent bg-surface px-1.5 py-1 text-foreground [font:inherit] focus:bg-hover focus:outline-none`,ref:a,role:`combobox`,"aria-label":e,"aria-autocomplete":`list`,"aria-expanded":c,"aria-controls":c?s:void 0,"aria-activedescendant":c&&v?`${s}-${f}`:void 0,autoFocus:i,autoComplete:`off`,spellCheck:!1,placeholder:e,title:t||e,value:t,onFocus:e=>{e.currentTarget.select(),d(``),m(-1)},onClick:()=>l(!0),onBlur:()=>l(!1),onChange:e=>{n(e.target.value),d(e.target.value),m(0),l(!0)},onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`)e.preventDefault(),e.stopPropagation(),l(!0),m(t=>_.length?(t+(e.key===`ArrowDown`?1:t<0?0:-1)+_.length)%_.length:-1);else if(e.key===`Enter`&&!e.nativeEvent.isComposing){e.preventDefault(),e.stopPropagation();let n=c&&v?v.value:t.trim();n&&(y(n),o())}else e.key===`Escape`&&c&&(e.preventDefault(),e.stopPropagation(),l(!1))}}),c&&(0,g.jsxs)(`div`,{className:`absolute top-[calc(100%_+_0.375rem)] left-0 z-1 max-h-120 w-68 max-w-[calc(100vw_-_2rem)] overflow-auto rounded-md border border-border bg-canvas p-1 shadow-[0_0.375rem_1rem_rgba(0,_0,_0,_0.18)] group-last/ref:right-0 group-last/ref:left-auto`,id:s,role:`listbox`,tabIndex:-1,"aria-label":`${e} suggestions`,ref:h,children:[_.map((e,t)=>(0,g.jsxs)(p.Fragment,{children:[t>0&&_[t-1].section!==e.section&&(0,g.jsx)(`div`,{className:`mx-2 my-1 border-t border-t-border`,"aria-hidden":`true`}),(0,g.jsxs)(`div`,{id:`${s}-${t}`,role:`option`,"aria-selected":t===f,className:`flex cursor-pointer flex-col gap-0.5 rounded-sm px-2 py-1.5 hover:bg-hover aria-selected:bg-hover`,onMouseDown:e=>e.preventDefault(),onClick:()=>y(e.value),children:[(0,g.jsx)(`span`,{className:`truncate`,children:e.value}),(0,g.jsx)(`span`,{className:`truncate font-sans text-[0.6875rem] leading-[1.4] text-muted`,children:e.detail})]})]},e.value)),!_.length&&(0,g.jsx)(`div`,{className:`p-2 font-sans text-[0.6875rem] leading-[1.4] text-muted`,children:`Use this revision as typed.`})]})]})}function dW(e){let t=Number(e);return/^[0-9]+$/.test(e)&&Number.isSafeInteger(t)?t:null}function fW({label:e,value:t,onChange:n,autoFocus:r}){let i=(0,p.useRef)(null),a=(0,p.useRef)(!1);(0,p.useLayoutEffect)(()=>{a.current&&=(i.current?.focus(),i.current?.select(),!1)},[t]);let o=e=>{let r=String(Math.min(2**53-1,Math.max(0,(dW(t)??0)+e)));a.current=r!==t,n(r),i.current?.focus(),i.current?.select()};return(0,g.jsxs)(`div`,{className:`mx-0.5 my-0 inline-flex items-stretch overflow-hidden rounded-md bg-surface focus-within:bg-hover`,children:[(0,g.jsx)(`input`,{className:`m-0 box-content w-full max-w-[8ch] min-w-[1ch] flex-[0_1_auto] rounded-md border border-transparent bg-transparent px-1.5 py-0.5 text-center text-foreground [font:inherit] focus:outline-none`,ref:i,type:`text`,inputMode:`numeric`,pattern:`[0-9]+`,required:!0,"aria-label":e,"aria-invalid":dW(t)===null,title:`${e} (0 is HEAD)`,autoFocus:r,onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{(e.key===`ArrowUp`||e.key===`ArrowDown`)&&(e.preventDefault(),e.stopPropagation(),o(e.key===`ArrowUp`?1:-1))},value:t,style:{width:`${Math.max(1,t.length)}ch`},onChange:e=>{/^[0-9]*$/.test(e.target.value)&&n(e.target.value)}}),(0,g.jsxs)(`div`,{className:`grid grid-rows-[1fr_1fr]`,children:[(0,g.jsx)(wM,{className:`rounded-none border-0 bg-transparent px-0.75 py-0 leading-[1] text-muted hover:bg-surface hover:text-foreground`,type:`button`,tabIndex:-1,"aria-label":`Increase ${e.toLowerCase()}`,onMouseDown:e=>e.preventDefault(),onClick:()=>o(1),children:(0,g.jsx)(jj,{size:`0.625rem`})}),(0,g.jsx)(wM,{className:`rounded-none border-0 bg-transparent px-0.75 py-0 leading-[1] text-muted hover:bg-surface hover:text-foreground`,type:`button`,tabIndex:-1,"aria-label":`Decrease ${e.toLowerCase()}`,onMouseDown:e=>e.preventDefault(),onClick:()=>o(-1),children:(0,g.jsx)(kj,{size:`0.625rem`})})]})]})}function pW({oldOffset:e,newOffset:t,version:n}){let[r,i]=(0,p.useState)(null),a=(0,p.useRef)(null),o=(0,p.useRef)(0);(0,p.useLayoutEffect)(()=>{let e=a.current;e&&(o.current=Math.max(o.current,e.getBoundingClientRect().height),e.style.minHeight=`${o.current}px`)}),(0,p.useEffect)(()=>{if(e===null||t===null)return;let r=new AbortController,a=setTimeout(()=>{Vk.lastCommitsPreview(e,t,r.signal).then(a=>{r.signal.aborted||i({oldOffset:e,newOffset:t,version:n,result:a})},a=>{r.signal.aborted||i({oldOffset:e,newOffset:t,version:n,error:a instanceof Error?a.message:String(a)})})},150);return()=>{clearTimeout(a),r.abort()}},[e,t,n]);let s=r?.oldOffset===e&&r.newOffset===t&&r.version===n?r:null,c=e!==null&&t!==null&&!s,l=e===null||t===null?`Enter nonnegative whole numbers to preview commits.`:s?.error??(c?`Loading commit messages…`:null),u=s?.result;return(0,g.jsx)(`div`,{className:`min-h-22`,ref:a,"aria-busy":c,children:l===null?u?(0,g.jsx)(`div`,{className:`mt-1 grid gap-3`,"aria-live":`polite`,children:[[`HEAD~${e}`,u.old],[`HEAD~${t}`,u.new]].map(([e,t],n)=>(0,g.jsxs)(`div`,{children:[(0,g.jsxs)(`div`,{className:`flex justify-between gap-2 font-mono text-[0.6875rem] leading-[1.5] text-muted`,children:[(0,g.jsx)(`span`,{children:e}),t&&(0,g.jsx)(`span`,{title:t.sha,children:t.short})]}),(0,g.jsx)(`p`,{className:`mt-0.5 mb-0 max-h-24 overflow-auto font-sans text-[0.75rem] leading-[1.5] wrap-anywhere whitespace-pre-wrap`,children:t?t.message||`(Empty commit message)`:`Commit unavailable at this offset.`})]},n))}):null:(0,g.jsx)(`p`,{className:mj(s?.error?`m-0 text-[0.75rem] wrap-anywhere text-del`:`m-0 p-0 text-[0.75rem] whitespace-normal text-muted`),role:`status`,children:l})})}function mW(){let e=Y(e=>e.snapshot),t=Y(e=>e.switchMode),n=Y(e=>e.modeMenuOpen),r=Y(e=>e.setModeMenuOpen),i=Y(e=>e.modePane),a=Y(e=>e.pickModeEntry),[o,s]=(0,p.useState)(null),[c,l]=(0,p.useState)(``),[u,d]=(0,p.useState)(`HEAD`),[f,m]=(0,p.useState)(`..`),[h,_]=(0,p.useState)(`1`),[v,y]=(0,p.useState)(`0`),[b,x]=(0,p.useState)(``),[S,C]=(0,p.useState)(!1),[w,T]=(0,p.useState)(null),E=(0,p.useRef)(!1),D=(0,p.useRef)(0),O=(0,p.useRef)(null),k=(0,p.useRef)(!1);(0,p.useEffect)(()=>{k.current=!1},[n,i]),(0,p.useEffect)(()=>{let e=++D.current;return()=>{D.current=e+1}},[n,i]);let A=(0,p.useRef)(null),j=(0,p.useRef)(null),M=(0,p.useRef)(null);(0,p.useEffect)(()=>{if(!n)return;let e=!0;Vk.refs().then(t=>{e&&(s(t),l(e=>e||t.defaultBranch||t.branches[0]||`HEAD`))}).catch(t=>{e&&Y.getState().report(`Loading refs`,t)});let t=e=>{A.current?.contains(e.target)||r(!1)};return document.addEventListener(`mousedown`,t),()=>{e=!1,document.removeEventListener(`mousedown`,t)}},[n,r]);let N=e=>{r(!1),cW(),t(e)},P=async()=>{if(E.current)return;E.current=!0,C(!0),T(null);let e=D.current;try{let n=await t(b.trim()?{kind:`pr`,pr:b.trim()}:{kind:`pr`});if(e!==D.current)return;n===`applied`?(r(!1),cW()):typeof n==`object`&&(T(n.error),O.current?.focus())}finally{E.current=!1,C(!1)}},F=dW(h),I=dW(v),L=F!==null&&I!==null,ee=()=>{l(u),d(c)},te=[{label:`Working`,icon:cM,pane:null},{label:`Two refs…`,icon:Yj,pane:`refs`},{label:`Last commits`,icon:fM,pane:`commits`},{label:`PR`,icon:Qj,pane:`pr`}];return(0,g.jsxs)(`div`,{className:`relative`,ref:A,children:[(0,g.jsxs)(wM,{onClick:()=>r(!n),title:`Change what is compared (m)`,"aria-expanded":n,"aria-controls":`mode-picker`,className:`font-mono`,children:[e?VO(e.mode):`…`,` `,(0,g.jsx)(kj,{size:`0.875rem`})]}),n&&(0,g.jsxs)(`div`,{className:`absolute top-[calc(100%_+_0.375rem)] left-0 z-20 flex w-max max-w-[calc(100vw_-_2rem)] min-w-60 rounded-[0.625rem] border border-border bg-canvas p-1.5 shadow-[0_0.625rem_1.875rem_rgba(0,_0,_0,_0.18)] max-[640px]:fixed max-[640px]:top-12 max-[640px]:left-2 max-[640px]:max-w-[calc(100vw_-_1rem)]`,id:`mode-picker`,role:`dialog`,"aria-label":`Compare`,children:[(0,g.jsxs)(`div`,{className:`w-60 shrink-0 max-[640px]:w-44`,children:[(0,g.jsx)(`div`,{className:`px-2.5 pt-1 pb-1.5 text-[0.6875rem] font-semibold text-muted`,children:`Compare`}),te.map((e,t)=>(0,g.jsxs)(wM,{className:mj(`grid min-h-8.5 w-full grid-cols-[1.125rem_1fr_auto_1.5rem] items-center gap-2.5 rounded-[0.4375rem] border-0 bg-transparent px-2.5 py-1.75 text-left font-sans text-[0.8125rem] leading-[1.3] text-foreground hover:bg-hover [&_kbd]:ml-1 [&_kbd]:justify-self-end [&_kbd]:text-muted [&>svg]:text-muted ${i===e.pane?`[&>span:first-of-type]:font-semibold [&>svg]:text-accent`:``}`),"aria-expanded":e.pane?i===e.pane:void 0,"aria-controls":e.pane?`mode-config`:void 0,onClick:e=>{k.current=e.detail>0,a(t+1)},children:[(0,g.jsx)(e.icon,{size:`0.875rem`}),(0,g.jsx)(`span`,{className:`whitespace-nowrap`,children:e.label}),(0,g.jsx)(`kbd`,{children:t+1}),e.pane?(0,g.jsx)(Aj,{size:`0.875rem`}):(0,g.jsx)(`span`,{})]},e.label))]}),i&&(0,g.jsxs)(`form`,{className:`ml-1.5 flex w-76 min-w-0 flex-col gap-3 border-l border-l-border px-3 pt-0 pb-2`,id:`mode-config`,"aria-label":te.find(e=>e.pane===i)?.label,onKeyDown:e=>{i!==`refs`||e.key!==`x`||e.ctrlKey||e.metaKey||e.altKey||e.target.closest(`input, textarea, select, [contenteditable]`)||(e.preventDefault(),e.stopPropagation(),e.repeat||ee())},onSubmit:e=>{e.preventDefault(),i===`refs`&&c.trim()&&u.trim()&&N({kind:`revspec`,args:[`${c.trim()}${f}${u.trim()}`]}),i===`commits`&&L&&N(iN(F,I)),i===`pr`&&P()},children:[i===`pr`&&(0,g.jsx)(`div`,{className:`pt-1 pb-1.5 text-[0.6875rem] font-semibold text-muted`,children:`Pull request`}),i===`refs`&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-1.5 pt-1.5 font-mono text-[0.8125rem] leading-[1.5]`,children:[(0,g.jsx)(uW,{label:`Base ref`,value:c,onChange:l,refs:o,autoFocus:!k.current,onAccept:()=>j.current?.focus()}),(0,g.jsx)(`span`,{children:f}),(0,g.jsx)(uW,{label:`Target ref`,value:u,onChange:d,refs:o,inputRef:j,onAccept:()=>M.current?.focus()})]}),(0,g.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,g.jsxs)(`div`,{className:`flex self-start overflow-hidden rounded-md border border-border focus-visible:outline-2 focus-visible:outline-offset-[2px] focus-visible:outline-accent focus-visible:outline-solid`,ref:M,role:`group`,"aria-label":`Comparison: ${f===`..`?`Direct`:`Merge base`}. Space to toggle.`,tabIndex:0,onKeyDown:e=>{if(e.key===`Enter`){e.preventDefault(),e.stopPropagation(),e.repeat||e.currentTarget.closest(`form`)?.requestSubmit();return}e.key===` `&&(e.preventDefault(),e.stopPropagation(),e.repeat||m(e=>e===`..`?`...`:`..`))},children:[(0,g.jsx)(jU,{type:`button`,selected:f===`..`,tabIndex:-1,onClick:()=>m(`..`),children:`Direct`}),(0,g.jsx)(jU,{type:`button`,selected:f===`...`,tabIndex:-1,onClick:()=>m(`...`),children:`Merge base`})]}),(0,g.jsx)(wM,{id:`swap-refs`,className:`border-0 bg-transparent p-0.5 text-muted hover:bg-hover hover:text-foreground`,type:`button`,tabIndex:-1,"aria-label":`Swap refs`,"aria-keyshortcuts":`x`,title:`Swap refs (x)`,onClick:ee,children:(0,g.jsx)(Ej,{size:`0.75rem`})})]}),(0,g.jsx)(`p`,{className:`m-0 p-0 text-[0.75rem] whitespace-normal text-muted`,children:f===`..`?`Compare these two revisions.`:`Compare changes since their common ancestor.`})]}),i===`commits`&&(0,g.jsxs)(`div`,{className:`flex flex-col gap-2 pt-1.5`,children:[(0,g.jsxs)(`div`,{className:`flex items-baseline font-mono text-[0.8125rem] leading-[1.5]`,children:[(0,g.jsx)(`span`,{children:`HEAD~`}),(0,g.jsx)(fW,{label:`Base offset`,value:h,onChange:_,autoFocus:!0}),(0,g.jsx)(`span`,{children:`..HEAD~`}),(0,g.jsx)(fW,{label:`Target offset`,value:v,onChange:y})]}),(0,g.jsx)(pW,{oldOffset:F,newOffset:I,version:e?.version??0})]}),i===`pr`&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,g.jsx)(`span`,{className:`text-[0.75rem] text-muted`,children:`PR number or URL`}),(0,g.jsx)(`input`,{className:`w-full min-w-0 rounded-md border border-border bg-surface px-2 py-1.5 font-mono text-[0.75rem] leading-[normal] text-foreground`,ref:O,autoFocus:!0,autoComplete:`off`,spellCheck:!1,readOnly:S,"aria-describedby":w?`pr-hint pr-error`:`pr-hint`,"aria-invalid":w?!0:void 0,value:b,onChange:e=>{x(e.target.value),T(null)},placeholder:`Current branch’s PR`})]}),(0,g.jsx)(`p`,{className:`m-0 p-0 text-[0.75rem] whitespace-normal text-muted`,id:`pr-hint`,children:`Enter a PR number or URL, or leave blank for this branch.`}),w&&(0,g.jsx)(`p`,{className:`m-0 text-[0.75rem] wrap-anywhere text-del`,id:`pr-error`,role:`alert`,children:w})]}),(0,g.jsx)(wM,{className:`mt-auto self-end`,variant:`primary`,type:`submit`,"aria-live":i===`pr`?`polite`:void 0,"aria-busy":i===`pr`&&S,disabled:i===`pr`?S:i===`refs`?!c.trim()||!u.trim():!L,children:i===`pr`?S?`Loading PR…`:`Show PR`:`Compare`})]})]})]})}function hW({onClose:e}){let t=Y(e=>e.config),n=Y(e=>e.saveConfig),[r,i]=(0,p.useState)(t.autoViewed.join(`
1626
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return iV(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=tH.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function dH(){return{exit:{taskListCheckValueChecked:pH,taskListCheckValueUnchecked:pH,paragraph:mH}}}function fH(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:hH}}}function pH(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function mH(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function hH(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=tH.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function gH(){return[SB(),KB(),ZB(),nH(),dH()]}function _H(e){return{extensions:[CB(),qB(e),QB(),uH(e),fH()]}}var vH={tokenize:MH,partial:!0},yH={tokenize:NH,partial:!0},bH={tokenize:PH,partial:!0},xH={tokenize:FH,partial:!0},SH={tokenize:IH,partial:!0},CH={name:`wwwAutolink`,tokenize:AH,previous:LH},wH={name:`protocolAutolink`,tokenize:jH,previous:RH},TH={name:`emailAutolink`,tokenize:kH,previous:zH},EH={};function DH(){return{text:EH}}for(var OH=48;OH<123;)EH[OH]=TH,OH++,OH===58?OH=65:OH===91&&(OH=97);EH[43]=TH,EH[45]=TH,EH[46]=TH,EH[95]=TH,EH[72]=[TH,wH],EH[104]=[TH,wH],EH[87]=[TH,CH],EH[119]=[TH,CH];function kH(e,t,n){let r=this,i,a;return o;function o(t){return!BH(t)||!zH.call(r,r.previous)||VH(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return BH(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(SH,u,l)(t):t===45||t===95||bF(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&yF(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function AH(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!LH.call(r,r.previous)||VH(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(vH,e.attempt(yH,e.attempt(bH,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function jH(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&RH.call(r,r.previous)&&!VH(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(yF(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||SF(t)||DF(t)||AF(t)||kF(t)?n(t):e.attempt(yH,e.attempt(bH,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function MH(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function NH(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(xH,c,s)(t):t===null||DF(t)||AF(t)||t!==45&&kF(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function PH(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(xH,t,a)(o):o===null||DF(o)||AF(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function FH(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||DF(o)||AF(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||DF(e)||AF(e)?t(e):r(e)}function a(e){return yF(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):yF(t)?(e.consume(t),o):n(t)}}function IH(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return bF(e)?n(e):t(e)}}function LH(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||DF(e)}function RH(e){return!yF(e)}function zH(e){return!(e===47||BH(e))}function BH(e){return e===43||e===45||e===46||e===95||bF(e)}function VH(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var HH={tokenize:XH,partial:!0};function UH(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:qH,continuation:{tokenize:JH},exit:YH}},text:{91:{name:`gfmFootnoteCall`,tokenize:KH},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:WH,resolveTo:GH}}}}function WH(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=vF(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function GH(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function KH(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||DF(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(vF(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return DF(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function qH(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||DF(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=vF(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return DF(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),NF(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function JH(e,t,n){return e.check(JF,t,e.attempt(HH,t,n))}function YH(e){e.exit(`gfmFootnoteDefinition`)}function XH(e,t,n){let r=this;return NF(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function ZH(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&dF(o,o.length,0,VF(s,e.slice(r+1,n),t)),dF(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),dF(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=BF(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=BF(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var QH=class{constructor(){this.map=[]}add(e,t,n){$H(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function $H(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function eU(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function tU(){return{flow:{null:{name:`table`,tokenize:nU,resolveAll:rU}}}}function nU(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):EF(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):OF(t)?NF(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||DF(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,OF(t)?NF(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return OF(t)?NF(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||EF(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return OF(t)?NF(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||EF(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||EF(n)?(e.exit(`tableRow`),t(n)):OF(n)?NF(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||DF(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function rU(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new QH;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(aU(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=iU(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=iU(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=iU(f,t,o,i,n,d)):(o[0]=o[1],d=iU(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&aU(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=eU(t.events,n))}return e}function iU(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},oU(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=oU(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=oU(t.events,n[2]),a=oU(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},oU(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function aU(e,t,n,r,i){let a=[],o=oU(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function oU(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var sU={name:`tasklistCheck`,tokenize:lU};function cU(){return{text:{91:sU}}}function lU(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return DF(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return EF(r)?t(r):OF(r)?e.check({tokenize:uU},t,n)(r):n(r)}}function uU(e,t,n){return NF(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function dU(e){return mF([DH(),UH(),ZH(e),tU(),cU()])}var fU={};function pU(e){let t=this,n=e||fU,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(dU(n)),a.push(gH()),o.push(_H(n))}var mU=200;function hU(e){return e===`system`?typeof matchMedia==`function`&&matchMedia(`(prefers-color-scheme: dark)`).matches:e===`dark`}async function gU(e,t,n){return _U(e,xd(t),n)}async function _U(e,t,n){let r=hU(n)?XN.dark:XN.light,i=await fd({themes:[XN.dark,XN.light],langs:[t]});return e.map(e=>{try{let[n=[]]=i.codeToTokensBase(e,{lang:t,theme:r});return n.map(e=>({text:e.content,color:e.color}))}catch{return[{text:e}]}})}var vU=()=>new Promise(e=>setTimeout(e,0));function yU(e,t,n=0){let[r,i]=(0,p.useState)(()=>({items:e,map:new Map})),a=(0,p.useRef)(n);return a.current=n,(0,p.useEffect)(()=>{let n=!1;i(t=>t.items===e?t:{items:e,map:new Map});let r=[];e.forEach((e,t)=>{let n=r[r.length-1];n&&n.path===e.path?(n.lines.push(e.text),n.last=t):r.push({path:e.path,lines:[e.text],first:t,last:t})});let o=e=>{let t=a.current;return t<e.first?e.first-t:t>e.last?t-e.last:0};return(async()=>{let a=[...r];for(;a.length>0&&!n;){let r=0;for(let e=1;e<a.length;e++)o(a[e])<o(a[r])&&(r=e);let[s]=a.splice(r,1),{path:c,lines:l}=s,u=[];for(let e=0;e<l.length&&!n;e+=mU){let n=l.slice(e,e+mU);u.push(...await gU(n,c,t).catch(()=>n.map(e=>[{text:e}]))),await vU()}if(n)return;i(t=>{if(t.items!==e)return t;let n=new Map(t.map);return u.forEach((e,t)=>n.set(`${c}\n${l[t]}`,e)),{items:t.items,map:n}})}})(),()=>{n=!0}},[e,t]),r.items===e?r.map:new Map}function bU({code:e,lang:t,theme:n}){let[r,i]=(0,p.useState)(null),a=(0,p.useMemo)(()=>e.replace(/\n$/,``).split(`
1627
+ `),[e]);return(0,p.useEffect)(()=>{let e=!0;return i(null),_U(a,t,n).then(t=>e&&i(t)).catch(()=>{}),()=>{e=!1}},[a,t,n]),(0,g.jsx)(g.Fragment,{children:a.map((e,t)=>(0,g.jsxs)(`span`,{children:[(0,g.jsx)(xU,{tokens:r?.[t],fallback:e}),`
1628
+ `]},t))})}function xU({tokens:e,fallback:t}){return e?(0,g.jsx)(g.Fragment,{children:e.map((e,t)=>(0,g.jsx)(`span`,{style:e.color?{color:e.color}:void 0,children:e.text},t))}):(0,g.jsx)(g.Fragment,{children:t})}function SU({text:e,path:t,highlight:n=!1}){let r=(0,p.useMemo)(()=>({pre:e=>(0,g.jsx)(CU,{...e,path:t,highlight:n}),a:OU}),[t,n]);return(0,g.jsx)(`div`,{className:`markdown`,children:(0,g.jsx)(uB,{remarkPlugins:[pU],components:r,urlTransform:DU,disallowedElements:[`img`],unwrapDisallowed:!0,children:e})})}function CU({children:e,node:t,path:n,highlight:r,...i}){let a=X(e=>e.theme),o=(Array.isArray(e)?e[0]:e)?.props,s=/language-(\S+)/.exec(o?.className??``)?.[1];if(r&&s!==`suggestion`){let e=s??(n?xd(n):void 0);if(e)return(0,g.jsx)(`pre`,{...i,children:(0,g.jsx)(`code`,{className:o?.className,children:(0,g.jsx)(bU,{code:TU(o?.children),lang:e,theme:a})})})}if(s===`suggestion`){let t=n?TU(o?.children).replace(/\n$/,``):void 0;return t==null?(0,g.jsxs)(`pre`,{...i,className:`suggestion`,title:`Suggested replacement for the quoted lines`,children:[(0,g.jsx)(`span`,{className:`tag`,children:`Suggestion`}),e]}):(0,g.jsxs)(`div`,{className:`suggestion highlighted`,title:`Suggested replacement for the quoted lines`,children:[(0,g.jsx)(`span`,{className:`tag`,children:`Suggestion`}),(0,g.jsx)(wU,{path:n,source:t})]})}return(0,g.jsx)(`pre`,{...i,children:e})}function wU({path:e,source:t}){let n=X(e=>e.theme),r=Zp(),[i,a]=(0,p.useState)(0),o=(0,p.useMemo)(()=>({name:e,contents:t,cacheKey:`suggestion:${e}:${t}`}),[e,t]),s=(0,p.useMemo)(()=>({theme:XN,themeType:n,disableFileHeader:!0,disableLineNumbers:!0,overflow:`wrap`}),[n]);return(0,p.useEffect)(()=>{let e=!0;return r?.primeFileHighlightCache(o).then(()=>e&&a(e=>e+1)).catch(()=>{}),()=>{e=!1}},[r,o,n]),(0,g.jsx)(Gy,{file:o,options:s},`${n}:${i}`)}function TU(e){if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(TU).join(``);let t=e?.props?.children;return t==null?``:TU(t)}var EU=/^diffle:([^#]*)(?:#L(\d+))?$/;function DU(e){return EU.test(e)?e:mB(e)}function OU({node:e,href:t,children:n,...r}){let i=EU.exec(t??``);return i?(0,g.jsx)(`a`,{...r,href:t,onClick:e=>{e.preventDefault(),X.getState().goToLink(decodeURI(i[1]),i[2]==null?void 0:Number(i[2]))},children:n}):(0,g.jsx)(`a`,{...r,href:t,target:`_blank`,rel:`noreferrer`,children:n})}function kU(e){let[t,n]=(0,p.useState)(!1);return(0,p.useEffect)(()=>{if(!t)return;let e=setTimeout(()=>n(!1),3e3);return()=>clearTimeout(e)},[t]),{armed:t,fire:()=>{if(!t){n(!0);return}n(!1),e()}}}function AU(){let e=X(e=>e.threads),t=X(e=>e.showResolved),n=X(e=>e.setShowResolved),r=X(e=>e.openFile),i=X(e=>e.clearThreads),a=X(e=>e.deleteThread),o=X(e=>e.deleteStaleThreads),s=X(e=>e.focusThread),c=X(e=>e.report),l=X(e=>e.exportToGithub),u=X(e=>e.github.data?.reason===null),[d,f]=(0,p.useState)(!1),[m,h]=(0,p.useState)(null),[_,v]=(0,p.useState)(null);(0,p.useEffect)(()=>{if(!_)return;let e=setTimeout(()=>v(null),2e3);return()=>clearTimeout(e)},[_]);let y=kU(()=>{f(!0),l().then(v).finally(()=>f(!1))}),b=kU(()=>void i()),x=kU(()=>void o()),S=(0,p.useMemo)(()=>tN({threads:e,showResolved:t}),[e,t]),C=e.filter(e=>!e.resolved),w=e.length-C.length,T=e.filter(e=>e.stale).length,E=(0,p.useMemo)(()=>{let e=new Map;for(let t of[...S].sort(NU)){let n=e.get(t.anchor.path)??[];n.push(t),e.set(t.anchor.path,n)}return[...e.entries()]},[S]),D=async()=>{let e;try{e=await Hk.exportComments()}catch(e){return c(`Copying comments`,e),!1}return await DM(e)?!0:(h(e),!1)};return(0,g.jsxs)(`aside`,{className:`flex min-h-0 flex-col bg-surface`,children:[(0,g.jsxs)(`div`,{className:`flex min-h-10 items-center gap-1.5 border-b border-b-border px-2.5 py-1.5 [&_button]:flex-none [&_button]:px-2 [&_button]:whitespace-nowrap`,children:[(0,g.jsxs)(`span`,{className:`mr-auto inline-flex min-w-0 items-center gap-1.5 truncate font-semibold`,children:[(0,g.jsx)(oM,{size:`0.9375rem`}),` Threads`,C.length>0&&(0,g.jsx)(`span`,{className:`rounded-[0.625rem] bg-hover px-1.75 py-0 font-medium text-muted`,children:C.length})]}),(0,g.jsx)(MU,{label:`All`,icon:(0,g.jsx)(Ij,{size:`0.875rem`}),primary:!0,disabled:C.length===0,title:`Copy all open threads as a prompt (yy)`,onCopy:()=>D()}),u&&(0,g.jsxs)(Y,{variant:`ghost`,icon:!y.armed&&!_,feedback:y.armed?`confirm`:_?`posted`:void 0,disabled:d||C.length===0&&!_,title:y.armed?`Click again to add all open threads to the pending review`:`Add all open threads to a pending review on the GitHub pull request; you submit it on GitHub`,"aria-label":y.armed?`Add all open threads to the pending review? Click again to confirm`:`Add all open threads to a pending review on the GitHub pull request`,onClick:y.fire,children:[_?(0,g.jsx)(kj,{size:`0.875rem`}):(0,g.jsx)(Qj,{size:`0.875rem`}),y.armed?`Add all?`:_?hN(_):null]}),(0,g.jsxs)(Y,{variant:`ghost`,danger:!0,icon:!b.armed,feedback:b.armed?`confirm`:void 0,disabled:e.length===0,title:b.armed?`Click again to delete all threads`:`Delete all threads for this mode`,onClick:b.fire,children:[(0,g.jsx)(SM,{size:`0.875rem`}),b.armed&&`Delete all?`]})]}),T>0&&(0,g.jsxs)(`div`,{className:`flex cursor-default items-center gap-1.5 border-b border-b-border px-2.5 py-1 text-[0.75rem] text-warn`,title:`Stale threads no longer point into the diff: their text changed or left the changed lines`,children:[(0,g.jsx)(CM,{size:`0.75rem`}),T,` stale`,(0,g.jsxs)(Y,{variant:`ghost`,danger:!0,feedback:x.armed?`confirm`:void 0,className:`ml-auto gap-1 px-1.5 py-px text-[0.75rem] leading-[1.2]`,onClick:x.fire,children:[(0,g.jsx)(SM,{size:`0.75rem`}),x.armed?`Delete stale?`:`Delete`]})]}),w>0&&(0,g.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5 border-b border-b-border px-2.5 py-1 text-[0.75rem] text-muted`,title:`Resolved threads are kept but left out of the prompt`,children:[(0,g.jsx)(`input`,{type:`checkbox`,checked:t,onChange:e=>n(e.target.checked)}),`Show `,w,` resolved`]}),(0,g.jsxs)(`div`,{className:`flex flex-1 flex-col gap-3.5 overflow-auto p-2.5`,children:[E.length===0&&(0,g.jsxs)(`div`,{className:`px-3 py-6 text-center text-muted [&>p]:mt-0 [&>p]:mr-0 [&>p]:mb-1.5 [&>p]:ml-0`,children:[(0,g.jsx)(`p`,{children:e.length?`Every thread is resolved.`:`No comments yet.`}),(0,g.jsx)(`p`,{children:`Click a line number to comment, drag across line numbers for a block, or press C for a whole file.`})]}),E.map(([e,t])=>(0,g.jsxs)(`section`,{className:`border-0 [&+section]:border-t [&+section]:border-solid [&+section]:border-border [&+section]:pt-3`,children:[(0,g.jsx)(`h4`,{className:`m-0 mb-1.5 font-mono text-[0.75rem] leading-[1.4] text-muted`,children:(0,g.jsx)(uP,{path:e})}),t.map(e=>(0,g.jsx)(jU,{thread:e,openFile:r,focusThread:s,deleteThread:a},e.id))]},e))]}),m&&(0,g.jsxs)(gj,{label:`Copy manually`,onClose:()=>h(null),children:[(0,g.jsx)(`h3`,{className:`m-0 mb-2`,children:`Copy manually`}),(0,g.jsx)(`p`,{className:`m-0 mb-2 text-muted`,children:`The browser blocked clipboard access. Select the text below and press Ctrl/⌘+c.`}),(0,g.jsx)(`textarea`,{className:`min-h-40 w-full rounded-md border border-border bg-surface p-2 font-mono text-[0.75rem]`,readOnly:!0,value:m,autoFocus:!0,onFocus:e=>e.currentTarget.select()}),(0,g.jsx)(`div`,{className:`mt-2.5 flex justify-end gap-1.5`,children:(0,g.jsx)(Y,{onClick:()=>h(null),children:`Close`})})]})]})}var jU=(0,p.memo)(function({thread:e,openFile:t,focusThread:n,deleteThread:r}){let i=e.messages[0],a=kU(()=>void r(e.id)),o=()=>{e.anchor.kind===`line`?t(e.anchor.path,e.anchor.endLine,e.anchor.side):t(e.anchor.path),n(e.id)};return(0,g.jsxs)(`div`,{role:`button`,tabIndex:0,className:hj(`group/thread mb-2 block w-full cursor-pointer overflow-hidden rounded-md border border-border bg-card p-0 text-left font-sans text-[0.8125rem] leading-[1.4] text-foreground shadow-card [transition:border-color_120ms_ease] hover:border-accent focus-visible:outline-2 focus-visible:outline-offset-[1px] focus-visible:outline-accent focus-visible:outline-solid ${e.stale?`border-dashed`:``} ${e.resolved?`opacity-65`:``}`),onClick:o,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o())},children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-b-border bg-hover py-1 pr-1.5 pl-2.5 text-[0.75rem] text-muted [&>svg]:flex-none [&>svg]:text-accent`,children:[(0,g.jsx)(oM,{size:`0.8125rem`}),(0,g.jsx)(`span`,{className:`font-mono font-semibold text-foreground`,children:nN(e.anchor)}),e.messages.length>1&&(0,g.jsxs)(`span`,{className:`text-muted`,children:[e.messages.length-1,` repl`,e.messages.length===2?`y`:`ies`]}),e.stale&&(0,g.jsxs)(`span`,{className:`inline-flex items-center gap-0.75 font-sans text-[0.6875rem] leading-[normal] text-warn`,children:[(0,g.jsx)(CM,{size:`0.6875rem`}),` stale`]}),e.resolved&&(0,g.jsxs)(`span`,{className:`inline-flex items-center gap-0.75 font-sans text-[0.6875rem] leading-[normal] text-add`,children:[(0,g.jsx)(kj,{size:`0.6875rem`}),` resolved`]}),(0,g.jsxs)(Y,{type:`button`,variant:`ghost`,danger:!0,icon:!a.armed,feedback:a.armed?`confirm`:void 0,className:`ml-auto px-0.75 py-[1px] opacity-0 [transition:opacity_120ms_ease] group-focus-within/thread:opacity-100 group-hover/thread:opacity-100 data-[feedback=confirm]:opacity-100`,title:a.armed?`Click again to delete this thread`:`Delete this thread`,"aria-label":a.armed?`Delete this thread? Click again to confirm`:`Delete this thread`,onClick:e=>{e.stopPropagation(),a.fire()},children:[(0,g.jsx)(SM,{size:`0.75rem`}),a.armed&&`Delete?`]})]}),(0,g.jsxs)(`div`,{className:`px-2.5 pt-1.5 pb-2 [&>.markdown]:font-sans [&>.markdown]:text-[0.8125rem] [&>.markdown]:leading-[1.4] [&>.markdown]:[word-break:break-word]`,children:[e.anchor.kind===`line`&&(0,g.jsx)(`div`,{className:`m-0 mb-1.5 overflow-hidden font-mono text-[0.75rem] leading-[1.4] text-ellipsis whitespace-nowrap text-muted`,children:PU(e.anchor.quoted)}),(0,g.jsx)(SU,{text:i?.body??``,path:e.anchor.path})]})]})});function MU({label:e,icon:t,onCopy:n,primary:r,disabled:i,title:a}){let[o,s]=(0,p.useState)(!1),c=(0,p.useRef)(null);return(0,p.useEffect)(()=>()=>void(c.current&&clearTimeout(c.current)),[]),(0,g.jsxs)(Y,{variant:r?`primary`:`default`,feedback:o?`copied`:void 0,className:`relative [transition:background_160ms_ease,_color_160ms_ease,_border-color_160ms_ease]`,disabled:i,title:a,onClick:async()=>{await n()&&(s(!0),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>s(!1),1400))},children:[(0,g.jsx)(EM,{done:o,children:t}),o?`Copied`:e]})}function NU(e,t){if(e.anchor.path!==t.anchor.path)return e.anchor.path<t.anchor.path?-1:1;let n=e=>e.anchor.kind===`line`?e.anchor.startLine:0;return n(e)-n(t)||(e.messages[0]?.createdAt??0)-(t.messages[0]?.createdAt??0)}function PU(e){let[t=``]=e.split(`
1629
+ `),n=t.trim();return n.length>70?n.slice(0,70)+`…`:n}function FU({className:e,...t}){return(0,g.jsx)(`div`,{...t,className:hj(`inline-flex items-center gap-0.5 rounded-md bg-hover p-0.5`,e)})}function IU({selected:e,className:t,...n}){return(0,g.jsx)(Y,{...n,"aria-pressed":e,className:hj(`rounded-[0.25rem] border-0 bg-transparent px-2 py-0.5 text-muted hover:bg-transparent hover:text-foreground`,e&&`bg-raised text-foreground shadow-[0_1px_2px_rgba(0,0,0,0.12)] hover:bg-raised`,t)})}function LU(){let e=X(e=>e.githubMenuOpen),t=X(e=>e.setGithubMenuOpen),n=X(e=>e.github),r=n.data,i=r?.repository,a=(0,p.useRef)(null),o=(0,p.useRef)(null);(0,p.useEffect)(()=>{if(!e)return;let n=e=>{a.current?.contains(e.target)||t(!1)};return document.addEventListener(`mousedown`,n),()=>document.removeEventListener(`mousedown`,n)},[e,t]);let s=r?.pullRequest;return(0,g.jsxs)(`div`,{className:`relative`,ref:a,onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),t(!1),o.current?.focus())},children:[(0,g.jsxs)(Y,{ref:o,variant:`ghost`,title:`GitHub information (o)`,"aria-label":`GitHub information`,"aria-expanded":e,"aria-controls":`github-menu`,onClick:()=>t(!e),children:[(0,g.jsx)($j,{size:`1rem`}),` GitHub`]}),e&&(0,g.jsxs)(`section`,{id:`github-menu`,role:`dialog`,"aria-label":`GitHub information`,className:`absolute top-[calc(100%+0.375rem)] left-0 z-30 w-80 max-w-[85vw] rounded-lg border border-border bg-surface p-3 text-[0.8125rem] shadow-lg`,children:[(0,g.jsx)(`strong`,{children:`Repository`}),(0,g.jsx)(`p`,{className:`mt-1 mb-3 wrap-anywhere`,children:i?(0,g.jsxs)(`a`,{className:`inline-flex items-center gap-1 text-accent hover:underline`,href:`https://github.com/${i}`,target:`_blank`,rel:`noreferrer`,children:[i,(0,g.jsx)(Hj,{size:`0.75rem`})]}):(0,g.jsx)(`span`,{className:`text-muted`,children:n.status===`loading`?`Loading…`:r?`No GitHub origin`:`Unavailable`})}),(0,g.jsx)(`strong`,{children:`Pull request`}),(0,g.jsx)(`div`,{"aria-live":`polite`,className:`mt-1`,children:n.status===`loading`?(0,g.jsx)(`p`,{className:`text-muted`,children:`Loading…`}):n.status===`error`?(0,g.jsxs)(`p`,{className:`text-warn`,children:[`Lookup failed: `,n.error]}):s?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`a`,{className:`text-accent hover:underline`,href:s.url,target:`_blank`,rel:`noreferrer`,children:[`#`,s.number,` `,s.title]}),(0,g.jsx)(`p`,{className:`mt-1 text-muted`,children:s.state===`OPEN`?s.isDraft?`Draft`:`Open`:s.state===`MERGED`?`Merged`:`Closed`}),s.repository!==i&&(0,g.jsx)(`p`,{className:`text-muted`,children:s.repository}),r?.reason&&(0,g.jsx)(`p`,{className:`mt-2 text-muted`,children:r?.reason})]}):(0,g.jsx)(`p`,{className:`text-muted`,children:r?.reason??`No matching pull request`})})]})]})}function RU(e){return e.dataset.lineType===`change-deletion`||(e.closest(`code`)?.hasAttribute(`data-deletions`)??!1)}function zU(e,t,n){let r=n===`old`;return[...e.querySelectorAll(`[data-line="${t}"]`)].find(e=>RU(e)===r)??null}function BU(e,t,n){let r=null;for(let{id:i,root:a}of e)for(let e of a.querySelectorAll(`[data-line]`)){let a=e.getBoundingClientRect();a.height===0||a.bottom<=t||a.top>=n||(!r||a.top<r.top||a.top===r.top&&RU(r.row)&&!RU(e))&&(r={id:i,row:e,top:a.top})}return r&&{id:r.id,line:Number(r.row.dataset.line),side:RU(r.row)?`old`:`new`,offset:r.top-t}}function VU(e,t,n,r,i=()=>{}){let a=0,o=new WeakSet,s=new MutationObserver(e=>{i(e),c()}),c=()=>{a||=requestAnimationFrame(()=>{a=0;let t=[];for(let n of e()?.getInstance()?.getRenderedItems()??[]){let e=n.element.shadowRoot??n.element;o.has(e)||(o.add(e),s.observe(e,{childList:!0,subtree:!0,characterData:!0})),t.push({id:n.id,root:e})}r(t)})};t.addEventListener(`scroll`,c,{passive:!0}),s.observe(t,{childList:!0,subtree:!0});let l=n(c);return c(),()=>{cancelAnimationFrame(a),s.disconnect(),t.removeEventListener(`scroll`,c),l()}}function HU(e){return[...e.matchAll(/[\p{L}\p{N}_]+/gu)].map(e=>({start:e.index,text:e[0]}))}var UU=()=>null,WU=null,GU=null,KU=!1;function qU(e){UU=e}function JU(){typeof CSS<`u`&&`highlights`in CSS&&CSS.highlights.delete(`diffle-word-focus`),WU=null,GU=null,VN.focus(null)}function YU(){if(KU){KU=!1;return}JU()}var XU=200;function ZU(e){let t=X.getState(),n=t.selection;if(!n)return;let r=VM(n.id),i=tW(r,n.range.end,IM(n)===`old`),a=i==null?[]:rW(r,i)??[],o=a.findIndex(e=>e.el===WU&&e.col===GU),s=o===-1?e===1?0:a.length-1:o+e;if(i!=null&&s>=0&&s<a.length){eW(a[s],r,i);return}for(let n=0;n<XU;n++){let n=X.getState().selection;KU=!0,t.moveCursor(e);let r=X.getState().selection;if(!r||$U(n,r))break;let i=VM(r.id),a=tW(i,r.range.end,IM(r)===`old`);if(a==null)continue;let o=rW(i,a);if(o==null)break;if(o.length>0){eW(o[e===1?0:o.length-1],i,a);return}}KU=!1,JU()}function QU(e){let t=X.getState(),n=t.selection;if(!n)return;let r=VM(n.id),i=tW(r,n.range.end,IM(n)===`old`),a=i==null?[]:rW(r,i)??[],o=e===`first`?a[0]:a[a.length-1];if(i==null||!o)return t.flash(`No symbol on this line`);eW(o,r,i)}function $U(e,t){return e.id===t.id&&e.range.end===t.range.end&&IM(e)===IM(t)}function eW({el:e,col:t,text:n},r,i){JU(),WU=e,GU=t;let a=e.firstChild;if(a?.nodeType===Node.TEXT_NODE&&typeof CSS<`u`&&`highlights`in CSS&&typeof Highlight<`u`){let r=t-Number(e.dataset.char),i=document.createRange();i.setStart(a,r),i.setEnd(a,r+n.length),CSS.highlights.set(`diffle-word-focus`,new Highlight(i))}VN.focus({path:r,side:`new`,line:i,col:t,text:n},e)}function tW(e,t,n){if(!n)return t;let r=nW(e),i=r&&zU(r,t,`old`);if(!i||!i.dataset.lineType?.startsWith(`context`))return null;let a=Number(i.dataset.altLine);return Number.isFinite(a)?a:null}function nW(e){let t=HM(X.getState(),e),n=UU()?.getInstance()?.getRenderedItems().find(e=>e.id===t);return n?.element.shadowRoot??n?.element??null}function rW(e,t){let n=nW(e),r=n&&zU(n,t,`new`);return r?[...r.querySelectorAll(`span[data-char]`)].flatMap(e=>HU(e.textContent??``).map(t=>({el:e,col:Number(e.dataset.char)+t.start,text:t.text}))):null}function iW(){if(typeof document>`u`)return 16;let e=parseFloat(getComputedStyle(document.documentElement).fontSize);return Number.isFinite(e)&&e>0?e:16}var aW=800,oW=new Set([`g`,`d`,`y`,`z`]),sW={gg:(e,t)=>void e.goToLine(t),G:(e,t)=>void e.goToLine(t),j:(e,t)=>e.moveCursorBy(t),k:(e,t)=>e.moveCursorBy(-t)},cW={w:()=>ZU(1),b:()=>ZU(-1),0:()=>QU(`first`),$:()=>QU(`last`),j:e=>e.moveCursor(1),k:e=>e.moveCursor(-1),J:e=>e.moveFile(1),K:e=>e.moveFile(-1),"]":e=>e.moveHunk(1),"[":e=>e.moveHunk(-1),"*":e=>e.searchWord(1),"#":e=>e.searchWord(-1),n:e=>e.search.matches.length?e.moveMatch(1):e.moveHunk(1),N:e=>e.search.matches.length?e.moveMatch(-1):e.moveHunk(-1),gg:e=>e.moveFile(`first`),G:e=>e.moveFile(`last`),V:e=>e.toggleVisual(),c:e=>e.selection&&e.openDraft(e.selection),C:e=>{let t=qM(e);t&&e.openFileDraft(t)},e:e=>e.editCommentAtCursor(),dd:e=>e.deleteCommentAtCursor(),R:e=>e.toggleResolvedAtCursor(),v:e=>e.toggleViewedAtCursor(),zo:e=>e.setCollapsedAtCursor(!1),zc:e=>e.setCollapsedAtCursor(!0),zC:e=>e.setAllCollapsed(!0),zO:e=>e.setAllCollapsed(!1),zt:e=>e.scrollCursorTo(`top`),zb:e=>e.scrollCursorTo(`bottom`),zz:e=>e.scrollCursorTo(`eye`),s:e=>e.setDiffStyle(e.diffStyle===`split`?`unified`:`split`),t:e=>e.setTheme(tP(e.theme)),yy:()=>void gW(),Y:()=>void gW(),"/":e=>e.openSearch(`file`),"g/":e=>e.openSearch(`diff`),gf:()=>pW(),gd:e=>e.goToDefinition(),gy:e=>e.goToTypeDefinition(),gh:e=>e.showHover(),gA:e=>e.findReferences(),gs:e=>e.openSymbols(`document`),gS:e=>e.openSymbols(`workspace`),F:e=>{let t=qM(e);!e.fileView&&t&&e.openFullFile(t)},o:e=>e.setGithubMenuOpen(!e.githubMenuOpen),m:e=>e.setModeMenuOpen(!e.modeMenuOpen),"?":e=>e.setHelpOpen(!e.helpOpen)};function lW(e){return e.composedPath()[0]??e.target}function uW(e){return!e.ctrlKey&&!e.altKey?!1:[...e.key].length!==1||!(e.ctrlKey&&e.altKey||e.getModifierState(`AltGraph`))}function dW(e){if(!e)return!1;let t=e.tagName;return t===`TEXTAREA`||t===`INPUT`||t===`SELECT`||e.isContentEditable}function fW(){let e=(0,p.useRef)(null),t=(0,p.useRef)(``);(0,p.useEffect)(()=>{let n=()=>{e.current&&clearTimeout(e.current.timer),e.current=null},r=r=>{if(r.key===`Shift`||r.key===`Control`||r.key===`Alt`||r.key===`Meta`||r.key===`CapsLock`)return;let i=X.getState(),a=lW(r),o=t.current;t.current=``;let s=Number(o);if(r.key===`Escape`&&a?.getAttribute(`role`)===`combobox`&&a.getAttribute(`aria-expanded`)===`true`)return;if(r.key===`Escape`){dW(a)&&(a.blur(),i.treeModel?.isSearchOpen()&&i.treeModel.closeSearch()),requestAnimationFrame(()=>hW()),JU(),i.escape(),n();return}if(!dW(a)&&!r.metaKey&&!uW(r)&&([...r.key].length===1||r.key===`Backspace`||r.key===`Enter`)&&i.search.open&&i.search.kind===`text`&&i.search.editing&&i.search.scope===`file`){r.preventDefault(),n(),[...r.key].length===1||r.key===`Backspace`?i.typeSearchInput(r.key):r.key===`Enter`&&i.runSearch(i.search.input);return}if((r.metaKey||r.ctrlKey)&&!r.altKey&&!r.shiftKey&&r.key.toLowerCase()===`p`){r.preventDefault(),n(),i.layout.treeVisible?pW():(i.setLayout({treeVisible:!0}),requestAnimationFrame(pW));return}if(i.references.open)return r.preventDefault(),r.stopPropagation(),r.key===`j`||r.key===`ArrowDown`||r.ctrlKey&&r.key===`n`?i.moveReference(1):r.key===`k`||r.key===`ArrowUp`||r.ctrlKey&&r.key===`p`?i.moveReference(-1):r.key===`Enter`?i.pickReference():void 0;if((r.metaKey||r.ctrlKey)&&!r.altKey&&r.key.toLowerCase()===`b`){r.preventDefault();let e=i.layout;r.shiftKey?i.setLayout({panelVisible:!e.panelVisible}):i.setLayout({treeVisible:!e.treeVisible});return}if((r.metaKey||r.ctrlKey)&&r.shiftKey&&!r.altKey&&r.key.toLowerCase()===`e`){r.preventDefault(),mW();return}if(r.ctrlKey&&!r.metaKey&&!r.altKey&&(r.key===`o`||r.key===`i`)&&!dW(a)){r.preventDefault(),r.key===`o`?i.jumpBack():i.jumpForward();return}if(r.ctrlKey&&!r.metaKey&&!r.altKey&&(r.key===`d`||r.key===`u`)&&!dW(a)){r.preventDefault();let e=document.querySelector(`.codeview`)?.clientHeight??800,t=Math.max(5,Math.floor(e/2/(1.25*iW())));i.moveCursorBy(r.key===`d`?t:-t);return}if(document.activeElement?.tagName===`FILE-TREE-CONTAINER`){r.key===`ArrowRight`&&!dW(a)&&(r.preventDefault(),r.stopPropagation(),hW());return}if(dW(a)||r.metaKey||uW(r)||i.modeMenuOpen&&a?.closest(`#mode-picker`)&&!/^[1-4]$/.test(r.key))return;if(r.key===`ArrowDown`||r.key===`ArrowUp`){r.preventDefault();let e=r.key===`ArrowDown`?1:-1;s>0?i.moveCursorBy(e*s):i.moveCursor(e);return}if(r.key===`ArrowLeft`){r.preventDefault(),mW();return}if(i.helpOpen&&r.key!==`?`){i.setHelpOpen(!1);return}if(i.modeMenuOpen&&/^[1-4]$/.test(r.key)){r.preventDefault(),i.pickModeEntry(Number(r.key));return}let c=e.current?.key;if(n(),!c&&/^[0-9]$/.test(r.key)&&(o||r.key!==`0`)){r.preventDefault(),t.current=o+r.key;return}if(!c&&oW.has(r.key)){t.current=o,e.current={key:r.key,timer:setTimeout(n,aW)};return}let l=c?c+r.key:r.key,u=s>0?sW[l]:void 0,d=cW[l];!u&&!d||(r.preventDefault(),u?u(i,s):d(i))},i=e=>{r(e),e.defaultPrevented&&e.stopPropagation()},a=e=>{if(e.button!==0||lW(e)?.closest(`[data-content-search]`))return;let r=X.getState();!r.search.open||!r.search.editing||(r.blurSearchInput(),document.querySelector(`[data-content-search]`)?.blur(),n(),t.current=``)},o=e=>{e.key===`Escape`&&lW(e)?.getAttribute(`role`)!==`combobox`&&setTimeout(hW,0)};return document.addEventListener(`keydown`,i,!0),document.addEventListener(`pointerdown`,a,!0),document.addEventListener(`keyup`,o),()=>{document.removeEventListener(`keydown`,i,!0),document.removeEventListener(`pointerdown`,a,!0),document.removeEventListener(`keyup`,o),n(),t.current=``}},[])}function pW(){let e=X.getState().treeModel;e?.openSearch(e.getSearchValue()),document.querySelector(`file-tree-container`)?.shadowRoot?.querySelector(`[data-file-tree-search-input]`)?.focus({preventScroll:!0})}function mW(){let e=X.getState();e.layout.treeVisible||e.setLayout({treeVisible:!0});let t=e.treeModel,n=document.querySelector(`file-tree-container`);requestAnimationFrame(()=>{let r=e.activePath&&t?.getItem(e.activePath)?e.activePath:t?.focusNearestPath(e.activePath??null);r&&t&&t.focusPath(r),(n?.shadowRoot?.querySelector(`[role="treeitem"][tabindex="0"]`)??n?.shadowRoot?.querySelector(`[role="tree"]`)??n)?.focus()})}function hW(){document.activeElement?.blur?.(),document.querySelector(`main[tabindex]`)?.focus({preventScroll:!0})}async function gW(){let e=X.getState(),t;try{t=await Hk.exportComments()}catch(t){return e.report(`Copying comments`,t)}let n=await DM(t);e.flash(n?`Copied all comments`:`Clipboard blocked; use the panel buttons`)}function _W({label:e,value:t,onChange:n,refs:r,autoFocus:i,inputRef:a,onAccept:o}){let s=(0,p.useId)(),[c,l]=(0,p.useState)(!1),[u,d]=(0,p.useState)(``),[f,m]=(0,p.useState)(-1),h=(0,p.useRef)(null),_=[{value:`HEAD`,detail:`Current commit`,section:`special`},{value:`worktree`,detail:`Uncommitted changes`,section:`special`},...(r?.branches??[]).map(e=>({value:e,detail:e===r?.current?`Current branch`:`Branch`,section:`branches`})),...(r?.remoteBranches??[]).map(e=>({value:e,detail:`Remote branch`,section:`remotes`})),...(r?.tags??[]).map(e=>({value:e,detail:`Tag`,section:`tags`})),...(r?.recent??[]).map(e=>({value:e.short,detail:e.subject,section:`commits`}))].filter((e,t,n)=>n.findIndex(t=>t.value===e.value)===t).filter(e=>`${e.value} ${e.detail}`.toLowerCase().includes(u.toLowerCase())),v=_[f];(0,p.useEffect)(()=>{h.current?.querySelector(`[aria-selected="true"]`)?.scrollIntoView?.({block:`nearest`})},[f]);let y=e=>{n(e),l(!1),m(-1)};return(0,g.jsxs)(`div`,{className:`group/ref relative min-w-0 flex-1`,children:[(0,g.jsx)(`input`,{className:`w-full min-w-0 rounded-md border border-transparent bg-surface px-1.5 py-1 text-foreground [font:inherit] focus:bg-hover focus:outline-none`,ref:a,role:`combobox`,"aria-label":e,"aria-autocomplete":`list`,"aria-expanded":c,"aria-controls":c?s:void 0,"aria-activedescendant":c&&v?`${s}-${f}`:void 0,autoFocus:i,autoComplete:`off`,spellCheck:!1,placeholder:e,value:t,onFocus:e=>{e.currentTarget.select(),d(``),m(-1)},onClick:()=>l(!0),onBlur:()=>l(!1),onChange:e=>{n(e.target.value),d(e.target.value),m(0),l(!0)},onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`)e.preventDefault(),e.stopPropagation(),l(!0),m(t=>_.length?(t+(e.key===`ArrowDown`?1:t<0?0:-1)+_.length)%_.length:-1);else if(e.key===`Enter`&&!e.nativeEvent.isComposing){e.preventDefault(),e.stopPropagation();let n=c&&v?v.value:t.trim();n&&(y(n),o())}else e.key===`Escape`&&c&&(e.preventDefault(),e.stopPropagation(),l(!1))}}),c&&(0,g.jsxs)(`div`,{className:`absolute top-[calc(100%_+_0.375rem)] left-0 z-1 max-h-120 w-68 max-w-[calc(100vw_-_2rem)] overflow-auto rounded-md border border-border bg-canvas p-1 shadow-[0_0.375rem_1rem_rgba(0,_0,_0,_0.18)] group-last/ref:right-0 group-last/ref:left-auto`,id:s,role:`listbox`,tabIndex:-1,"aria-label":`${e} suggestions`,ref:h,children:[_.map((e,t)=>(0,g.jsxs)(p.Fragment,{children:[t>0&&_[t-1].section!==e.section&&(0,g.jsx)(`div`,{className:`mx-2 my-1 border-t border-t-border`,"aria-hidden":`true`}),(0,g.jsxs)(`div`,{id:`${s}-${t}`,role:`option`,"aria-selected":t===f,className:`flex cursor-pointer flex-col gap-0.5 rounded-sm px-2 py-1.5 hover:bg-hover aria-selected:bg-hover`,onMouseDown:e=>e.preventDefault(),onClick:()=>y(e.value),children:[(0,g.jsx)(`span`,{className:`truncate`,children:e.value}),(0,g.jsx)(`span`,{className:`truncate font-sans text-[0.6875rem] leading-[1.4] text-muted`,children:e.detail})]})]},e.value)),!_.length&&(0,g.jsx)(`div`,{className:`p-2 font-sans text-[0.6875rem] leading-[1.4] text-muted`,children:`Use this revision as typed.`})]})]})}function vW(e){let t=Number(e);return/^[0-9]+$/.test(e)&&Number.isSafeInteger(t)?t:null}function yW({label:e,value:t,onChange:n,autoFocus:r}){let i=(0,p.useRef)(null),a=(0,p.useRef)(!1);(0,p.useLayoutEffect)(()=>{a.current&&=(i.current?.focus(),i.current?.select(),!1)},[t]);let o=e=>{let r=String(Math.min(2**53-1,Math.max(0,(vW(t)??0)+e)));a.current=r!==t,n(r),i.current?.focus(),i.current?.select()};return(0,g.jsxs)(`div`,{className:`mx-0.5 my-0 inline-flex items-stretch overflow-hidden rounded-md bg-surface focus-within:bg-hover`,children:[(0,g.jsx)(`input`,{className:`m-0 box-content w-full max-w-[8ch] min-w-[1ch] flex-[0_1_auto] rounded-md border border-transparent bg-transparent px-1.5 py-0.5 text-center text-foreground [font:inherit] focus:outline-none`,ref:i,type:`text`,inputMode:`numeric`,pattern:`[0-9]+`,required:!0,"aria-label":e,"aria-invalid":vW(t)===null,autoFocus:r,onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{(e.key===`ArrowUp`||e.key===`ArrowDown`)&&(e.preventDefault(),e.stopPropagation(),o(e.key===`ArrowUp`?1:-1))},value:t,style:{width:`${Math.max(1,t.length)}ch`},onChange:e=>{/^[0-9]*$/.test(e.target.value)&&n(e.target.value)}}),(0,g.jsxs)(`div`,{className:`grid grid-rows-[1fr_1fr]`,children:[(0,g.jsx)(Y,{className:`rounded-none border-0 bg-transparent px-0.75 py-0 leading-[1] text-muted hover:bg-surface hover:text-foreground`,type:`button`,tabIndex:-1,"aria-label":`Increase ${e.toLowerCase()}`,onMouseDown:e=>e.preventDefault(),onClick:()=>o(1),children:(0,g.jsx)(Mj,{size:`0.625rem`})}),(0,g.jsx)(Y,{className:`rounded-none border-0 bg-transparent px-0.75 py-0 leading-[1] text-muted hover:bg-surface hover:text-foreground`,type:`button`,tabIndex:-1,"aria-label":`Decrease ${e.toLowerCase()}`,onMouseDown:e=>e.preventDefault(),onClick:()=>o(-1),children:(0,g.jsx)(Aj,{size:`0.625rem`})})]})]})}function bW({oldOffset:e,newOffset:t,version:n}){let[r,i]=(0,p.useState)(null),a=(0,p.useRef)(null),o=(0,p.useRef)(0);(0,p.useLayoutEffect)(()=>{let e=a.current;e&&(o.current=Math.max(o.current,e.getBoundingClientRect().height),e.style.minHeight=`${o.current}px`)}),(0,p.useEffect)(()=>{if(e===null||t===null)return;let r=new AbortController,a=setTimeout(()=>{Hk.lastCommitsPreview(e,t,r.signal).then(a=>{r.signal.aborted||i({oldOffset:e,newOffset:t,version:n,result:a})},a=>{r.signal.aborted||i({oldOffset:e,newOffset:t,version:n,error:a instanceof Error?a.message:String(a)})})},150);return()=>{clearTimeout(a),r.abort()}},[e,t,n]);let s=r?.oldOffset===e&&r.newOffset===t&&r.version===n?r:null,c=e!==null&&t!==null&&!s,l=e===null||t===null?`Enter nonnegative whole numbers to preview commits.`:s?.error??(c?`Loading commit messages…`:null),u=s?.result;return(0,g.jsx)(`div`,{className:`min-h-22`,ref:a,"aria-busy":c,children:l===null?u?(0,g.jsx)(`div`,{className:`mt-1 grid gap-3`,"aria-live":`polite`,children:[[`HEAD~${e}`,u.old],[`HEAD~${t}`,u.new]].map(([e,t],n)=>(0,g.jsxs)(`div`,{children:[(0,g.jsxs)(`div`,{className:`flex justify-between gap-2 font-mono text-[0.6875rem] leading-[1.5] text-muted`,children:[(0,g.jsx)(`span`,{children:e}),t&&(0,g.jsx)(`span`,{title:t.sha,children:t.short})]}),(0,g.jsx)(`p`,{className:`mt-0.5 mb-0 max-h-24 overflow-auto font-sans text-[0.75rem] leading-[1.5] wrap-anywhere whitespace-pre-wrap`,children:t?t.message||`(Empty commit message)`:`Commit unavailable at this offset.`})]},n))}):null:(0,g.jsx)(`p`,{className:hj(s?.error?`m-0 text-[0.75rem] wrap-anywhere text-del`:`m-0 p-0 text-[0.75rem] whitespace-normal text-muted`),role:`status`,children:l})})}function xW(){let e=X(e=>e.snapshot),t=X(e=>e.switchMode),n=X(e=>e.modeMenuOpen),r=X(e=>e.setModeMenuOpen),i=X(e=>e.modePane),a=X(e=>e.pickModeEntry),[o,s]=(0,p.useState)(null),[c,l]=(0,p.useState)(``),[u,d]=(0,p.useState)(`HEAD`),[f,m]=(0,p.useState)(`...`),[h,_]=(0,p.useState)(`1`),[v,y]=(0,p.useState)(`0`),[b,x]=(0,p.useState)(``),[S,C]=(0,p.useState)(!1),[w,T]=(0,p.useState)(null),E=(0,p.useRef)(!1),D=(0,p.useRef)(0),O=(0,p.useRef)(null),k=(0,p.useRef)(!1);(0,p.useEffect)(()=>{k.current=!1},[n,i]),(0,p.useEffect)(()=>{let e=++D.current;return()=>{D.current=e+1}},[n,i]);let A=(0,p.useRef)(null),j=(0,p.useRef)(null),M=(0,p.useRef)(null);(0,p.useEffect)(()=>{if(!n)return;let e=!0;Hk.refs().then(t=>{e&&(s(t),l(e=>e||t.defaultBranch||t.branches[0]||`HEAD`))}).catch(t=>{e&&X.getState().report(`Loading refs`,t)});let t=e=>{A.current?.contains(e.target)||r(!1)};return document.addEventListener(`mousedown`,t),()=>{e=!1,document.removeEventListener(`mousedown`,t)}},[n,r]);let N=e=>{r(!1),hW(),t(e)},P=async()=>{if(E.current)return;E.current=!0,C(!0),T(null);let e=D.current;try{let n=await t(b.trim()?{kind:`pr`,pr:b.trim()}:{kind:`pr`});if(e!==D.current)return;n===`applied`?(r(!1),hW()):typeof n==`object`&&(T(n.error),O.current?.focus())}finally{E.current=!1,C(!1)}},F=vW(h),I=vW(v),L=F!==null&&I!==null,ee=()=>{l(u),d(c)},te=[{label:`Working`,icon:dM,pane:null},{label:`Two refs…`,icon:Xj,pane:`refs`},{label:`Last commits`,icon:hM,pane:`commits`},{label:`PR`,icon:$j,pane:`pr`}];return(0,g.jsxs)(`div`,{className:`relative`,ref:A,children:[(0,g.jsxs)(Y,{onClick:()=>r(!n),title:`Change what is compared (m)`,"aria-expanded":n,"aria-controls":`mode-picker`,className:`font-mono`,children:[e?VO(e.mode):`…`,` `,(0,g.jsx)(Aj,{size:`0.875rem`})]}),n&&(0,g.jsxs)(`div`,{className:`absolute top-[calc(100%_+_0.375rem)] left-0 z-20 flex w-max max-w-[calc(100vw_-_2rem)] min-w-60 rounded-[0.625rem] border border-border bg-canvas p-1.5 shadow-[0_0.625rem_1.875rem_rgba(0,_0,_0,_0.18)] max-[640px]:fixed max-[640px]:top-12 max-[640px]:left-2 max-[640px]:max-w-[calc(100vw_-_1rem)]`,id:`mode-picker`,role:`dialog`,"aria-label":`Compare`,children:[(0,g.jsxs)(`div`,{className:`w-60 shrink-0 max-[640px]:w-44`,children:[(0,g.jsx)(`div`,{className:`px-2.5 pt-1 pb-1.5 text-[0.6875rem] font-semibold text-muted`,children:`Compare`}),te.map((e,t)=>(0,g.jsxs)(Y,{className:hj(`grid min-h-8.5 w-full grid-cols-[1.125rem_1fr_auto_1.5rem] items-center gap-2.5 rounded-[0.4375rem] border-0 bg-transparent px-2.5 py-1.75 text-left font-sans text-[0.8125rem] leading-[1.3] text-foreground hover:bg-hover [&_kbd]:ml-1 [&_kbd]:justify-self-end [&_kbd]:text-muted [&>svg]:text-muted ${e.pane&&i===e.pane?`[&>span:first-of-type]:font-semibold [&>svg]:text-accent`:``}`),"aria-expanded":e.pane?i===e.pane:void 0,"aria-controls":e.pane?`mode-config`:void 0,onClick:e=>{k.current=e.detail>0,a(t+1)},children:[(0,g.jsx)(e.icon,{size:`0.875rem`}),(0,g.jsx)(`span`,{className:`whitespace-nowrap`,children:e.label}),(0,g.jsx)(`kbd`,{children:t+1}),e.pane?(0,g.jsx)(jj,{size:`0.875rem`}):(0,g.jsx)(`span`,{})]},e.label))]}),i&&(0,g.jsxs)(`form`,{className:`ml-1.5 flex w-76 min-w-0 flex-col gap-3 border-l border-l-border px-3 pt-0 pb-2`,id:`mode-config`,"aria-label":te.find(e=>e.pane===i)?.label,onKeyDown:e=>{i!==`refs`||e.key!==`x`||e.ctrlKey||e.metaKey||e.altKey||e.target.closest(`input, textarea, select, [contenteditable]`)||(e.preventDefault(),e.stopPropagation(),e.repeat||ee())},onSubmit:e=>{e.preventDefault(),i===`refs`&&c.trim()&&u.trim()&&N({kind:`revspec`,args:[`${c.trim()}${f}${u.trim()}`]}),i===`commits`&&L&&N(mN(F,I)),i===`pr`&&P()},children:[i===`pr`&&(0,g.jsx)(`div`,{className:`pt-1 pb-1.5 text-[0.6875rem] font-semibold text-muted`,children:`Pull request`}),i===`refs`&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-1.5 pt-1.5 font-mono text-[0.8125rem] leading-[1.5]`,children:[(0,g.jsx)(_W,{label:`Base ref`,value:c,onChange:l,refs:o,autoFocus:!k.current,onAccept:()=>j.current?.focus()}),(0,g.jsx)(`span`,{children:f}),(0,g.jsx)(_W,{label:`Target ref`,value:u,onChange:d,refs:o,inputRef:j,onAccept:()=>M.current?.focus()})]}),(0,g.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,g.jsxs)(FU,{className:`self-start focus-visible:outline-2 focus-visible:outline-offset-[2px] focus-visible:outline-accent focus-visible:outline-solid`,ref:M,role:`group`,"aria-label":`Comparison: ${f===`..`?`Direct`:`Merge base`}. Space to toggle.`,tabIndex:0,onKeyDown:e=>{if(e.key===`Enter`){e.preventDefault(),e.stopPropagation(),e.repeat||e.currentTarget.closest(`form`)?.requestSubmit();return}e.key===` `&&(e.preventDefault(),e.stopPropagation(),e.repeat||m(e=>e===`..`?`...`:`..`))},children:[(0,g.jsx)(IU,{type:`button`,selected:f===`...`,tabIndex:-1,onClick:()=>m(`...`),children:`Merge base`}),(0,g.jsx)(IU,{type:`button`,selected:f===`..`,tabIndex:-1,onClick:()=>m(`..`),children:`Direct`})]}),(0,g.jsx)(Y,{id:`swap-refs`,className:`border-0 bg-transparent p-0.5 text-muted hover:bg-hover hover:text-foreground`,type:`button`,tabIndex:-1,"aria-label":`Swap refs`,"aria-keyshortcuts":`x`,title:`Swap refs (x)`,onClick:ee,children:(0,g.jsx)(Dj,{size:`0.75rem`})})]}),(0,g.jsx)(`p`,{className:`m-0 p-0 text-[0.75rem] whitespace-normal text-muted`,children:f===`..`?`Compare these two revisions.`:`Compare changes since their common ancestor.`})]}),i===`commits`&&(0,g.jsxs)(`div`,{className:`flex flex-col gap-2 pt-1.5`,children:[(0,g.jsxs)(`div`,{className:`flex items-baseline font-mono text-[0.8125rem] leading-[1.5]`,children:[(0,g.jsx)(`span`,{children:`HEAD~`}),(0,g.jsx)(yW,{label:`Base offset`,value:h,onChange:_,autoFocus:!0}),(0,g.jsx)(`span`,{children:`..HEAD~`}),(0,g.jsx)(yW,{label:`Target offset`,value:v,onChange:y})]}),(0,g.jsx)(bW,{oldOffset:F,newOffset:I,version:e?.version??0})]}),i===`pr`&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,g.jsx)(`span`,{className:`text-[0.75rem] text-muted`,children:`PR number or URL`}),(0,g.jsx)(`input`,{className:`w-full min-w-0 rounded-md border border-border bg-surface px-2 py-1.5 font-mono text-[0.75rem] leading-[normal] text-foreground`,ref:O,autoFocus:!0,autoComplete:`off`,spellCheck:!1,readOnly:S,"aria-describedby":w?`pr-hint pr-error`:`pr-hint`,"aria-invalid":w?!0:void 0,value:b,onChange:e=>{x(e.target.value),T(null)},placeholder:`Current branch’s PR`})]}),(0,g.jsx)(`p`,{className:`m-0 p-0 text-[0.75rem] whitespace-normal text-muted`,id:`pr-hint`,children:`Enter a PR number or URL, or leave blank for this branch.`}),w&&(0,g.jsx)(`p`,{className:`m-0 text-[0.75rem] wrap-anywhere text-del`,id:`pr-error`,role:`alert`,children:w})]}),(0,g.jsx)(Y,{className:`mt-auto self-end`,variant:`primary`,type:`submit`,"aria-live":i===`pr`?`polite`:void 0,"aria-busy":i===`pr`&&S,disabled:i===`pr`?S:i===`refs`?!c.trim()||!u.trim():!L,children:i===`pr`?S?`Loading PR…`:`Show PR`:`Compare`})]})]})]})}function SW({onClose:e}){let t=X(e=>e.config),n=X(e=>e.saveConfig),[r,i]=(0,p.useState)(t.autoViewed.join(`
1630
1630
  `)),[a,o]=(0,p.useState)(String(t.contextLines)),[s,c]=(0,p.useState)(!1),l=Object.entries(t.lspCommands).sort(([e],[t])=>e.localeCompare(t)),u=async()=>{c(!0),await n({autoViewed:r.split(`
1631
- `).map(e=>e.trim()).filter(Boolean),contextLines:Math.max(0,Number.parseInt(a,10)||0)}),c(!1),e()},d=(0,p.useRef)({save:u,onClose:e,saving:s});return d.current={save:u,onClose:e,saving:s},(0,p.useEffect)(()=>{let e=e=>{if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),d.current.onClose();return}if(e.key===`Enter`&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey){if(e.target?.tagName===`TEXTAREA`)return;e.preventDefault(),e.stopPropagation(),d.current.saving||d.current.save()}};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[]),(0,g.jsxs)(hj,{label:`Settings`,onClose:e,className:`[&_code]:rounded-sm [&_code]:bg-hover [&_code]:px-1 [&_code]:font-mono`,children:[(0,g.jsx)(`h3`,{className:`m-0 mb-2`,children:`Auto-viewed patterns`}),(0,g.jsxs)(`p`,{className:`m-0 mb-2 text-muted`,children:[`Files matching these globs start collapsed and marked viewed. One per line. Patterns without a slash match the file name anywhere, e.g. `,(0,g.jsx)(`code`,{children:`*.lock`}),`; use `,(0,g.jsx)(`code`,{children:`**/generated/**`}),` for paths. Same as`,` `,(0,g.jsx)(`code`,{children:`diffle config add-auto-viewed`}),`.`]}),(0,g.jsx)(`textarea`,{className:`min-h-40 w-full rounded-md border border-border bg-surface p-2 font-mono text-[0.75rem]`,value:r,onChange:e=>i(e.target.value),spellCheck:!1,autoFocus:!0}),(0,g.jsx)(`h3`,{className:`m-0 mt-[14px] mb-2`,children:`Context lines`}),(0,g.jsxs)(`p`,{className:`m-0 mb-2 text-muted`,children:[`Unchanged lines shown around each change (`,(0,g.jsx)(`code`,{children:`git diff -U<n>`}),`). Same as `,(0,g.jsx)(`code`,{children:`--context`}),` or`,` `,(0,g.jsx)(`code`,{children:`diffle config set-context`}),`.`]}),(0,g.jsx)(`input`,{type:`number`,min:0,max:1e4,value:a,onChange:e=>o(e.target.value),className:`w-[100px]`}),(0,g.jsx)(`h3`,{className:`m-0 mt-[14px] mb-2`,children:`Language servers`}),(0,g.jsxs)(`p`,{className:`m-0 mb-2 text-muted`,children:[`Go-to-definition, references and symbols come from a language server per language, found on `,(0,g.jsx)(`code`,{children:`PATH`}),`.`,` `,(0,g.jsx)(`code`,{children:`diffle lsp`}),` lists what each language would get,`,` `,(0,g.jsx)(`code`,{children:`diffle config set-lsp <language> <command>`}),` overrides one, and `,(0,g.jsx)(`code`,{children:`--no-lsp`}),` `,`turns them off for a run. Commands are not editable here.`]}),l.length>0&&(0,g.jsxs)(`p`,{className:`m-0 mb-2 text-muted`,children:[`Overridden in your config:`,` `,l.map(([e,t],n)=>(0,g.jsxs)(`span`,{children:[n>0&&`, `,e,` `,(0,g.jsx)(`code`,{children:t||`(off)`})]},e))]}),(0,g.jsxs)(`div`,{className:`mt-2.5 flex justify-end gap-1.5`,children:[(0,g.jsx)(wM,{onClick:e,children:`Cancel`}),(0,g.jsx)(wM,{variant:`primary`,onClick:u,disabled:s,children:`Save`})]})]})}function gW(){let e=Y(e=>e.snapshot),t=Y(e=>e.lsp),[n,r]=(0,p.useState)(!1),i=Y(e=>e.theme),a=Y(e=>e.setTheme),o=Y(e=>e.layout),s=Y(e=>e.setLayout),c=Y(e=>e.diffStyle),l=Y(e=>e.setDiffStyle),u=e?.changed.length??0,d=e?.changed.reduce((e,t)=>e+t.additions,0)??0,f=e?.changed.reduce((e,t)=>e+t.deletions,0)??0;return(0,g.jsxs)(`header`,{className:`col-span-full flex items-center gap-2.5 border-b border-b-border bg-surface px-3 py-0`,children:[(0,g.jsx)(wM,{variant:`ghost`,icon:!0,className:o.treeVisible?``:`opacity-45`,onClick:()=>s({treeVisible:!o.treeVisible}),title:`Toggle file tree (⌘/Ctrl+b)`,children:(0,g.jsx)(oM,{size:`1rem`})}),(0,g.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-bold tracking-[0.02em]`,children:[(0,g.jsx)(Xj,{size:`1rem`}),` diffle`]}),(0,g.jsx)(`span`,{className:`truncate font-mono text-[0.75rem] text-muted`,title:e?.root,children:e?oN(e):``}),(0,g.jsx)(mW,{}),(0,g.jsx)(MU,{}),(0,g.jsxs)(`span`,{className:`text-muted`,children:[u,` files · `,(0,g.jsxs)(`span`,{className:`text-add`,children:[`+`,d]}),` `,(0,g.jsxs)(`span`,{className:`text-del`,children:[`−`,f]})]}),(0,g.jsx)(`span`,{className:`flex-1`}),t.enabled&&(0,g.jsx)(_W,{lsp:t}),(0,g.jsxs)(`div`,{className:`flex overflow-hidden rounded-md border border-border`,title:`Diff layout`,children:[(0,g.jsxs)(jU,{selected:c===`split`,onClick:()=>l(`split`),children:[(0,g.jsx)(Ij,{size:`0.875rem`}),` Split`]}),(0,g.jsxs)(jU,{selected:c===`unified`,onClick:()=>l(`unified`),children:[(0,g.jsx)(mM,{size:`0.875rem`}),` Unified`]})]}),(0,g.jsx)(wM,{variant:`ghost`,icon:!0,onClick:()=>a(ZN(i)),title:`Theme: ${i} (t)`,children:(0,g.jsx)(bW,{choice:i})}),(0,g.jsx)(wM,{variant:`ghost`,icon:!0,onClick:()=>Y.getState().setHelpOpen(!0),title:`Keyboard shortcuts (?)`,children:(0,g.jsx)(eM,{size:`1rem`})}),(0,g.jsxs)(wM,{variant:`ghost`,onClick:()=>r(!0),title:`Settings`,children:[(0,g.jsx)(gM,{size:`0.9375rem`}),` Settings`]}),(0,g.jsx)(wM,{variant:`ghost`,icon:!0,className:o.panelVisible?``:`opacity-45`,onClick:()=>s({panelVisible:!o.panelVisible}),title:`Toggle comments panel (⌘/Ctrl+Shift+b)`,children:(0,g.jsx)(sM,{size:`1rem`})}),n&&(0,g.jsx)(hW,{onClose:()=>r(!1)})]})}function _W({lsp:e}){let t=(0,p.useRef)(null),n=()=>{t.current&&(t.current.open=!1,t.current.querySelector(`summary`)?.focus())};(0,p.useEffect)(()=>{let e=e=>{let n=t.current;n?.open&&!n.contains(e.target)&&(n.open=!1)},r=e=>{e.key!==`Escape`||!t.current?.open||(e.preventDefault(),e.stopPropagation(),n())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,r,!0)}},[]);let r=e.servers.some(e=>e.state===`starting`),i=r||e.servers.some(e=>e.activity?.length),a=e.servers.some(e=>e.state===`unavailable`),o=e.servers.some(e=>e.notice?.severity===`error`),s=e.servers.some(e=>e.notice?.severity===`warning`),c=e.servers.some(e=>e.stderr),l=a&&`unavailable`||o&&`error`||s&&`warning`||r&&`starting`||i&&`busy`||c&&`logs`||``;return(0,g.jsxs)(`details`,{ref:t,className:`relative`,children:[(0,g.jsxs)(`summary`,{className:mj(`inline-flex cursor-pointer list-none items-center gap-1.25 text-xs whitespace-nowrap text-muted [&::-webkit-details-marker]:hidden ${o||a?`text-warn`:``}`),"aria-label":`Language servers${l?`: ${l}`:``}`,children:[i?(0,g.jsx)(nM,{size:`0.875rem`,className:`animate-spin`}):(0,g.jsx)(Lj,{size:`0.875rem`}),l]}),(0,g.jsxs)(`section`,{className:`absolute top-[calc(100%+0.75rem)] right-0 z-100 max-h-[65vh] w-[min(28rem,85vw)] overflow-auto rounded-lg border border-border bg-surface p-2.5 text-[0.8125rem] text-foreground shadow-lg`,"aria-label":`Language server status`,children:[(0,g.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,g.jsx)(`strong`,{children:`Language servers`}),(0,g.jsx)(wM,{variant:`ghost`,icon:!0,type:`button`,"aria-label":`Close language server status`,className:`border-0 p-0.5 text-muted hover:text-foreground`,onClick:n,children:(0,g.jsx)(SM,{size:`0.875rem`})})]}),e.servers.map(e=>(0,g.jsx)(vW,{server:e},e.command)),!e.servers.length&&!e.missing.length&&(0,g.jsx)(`p`,{className:`text-muted`,children:`No servers`}),e.missing.map(e=>(0,g.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-2 border-t border-border pt-1.5 text-muted`,title:e.tried.join(`, `),children:[(0,g.jsx)(SM,{size:`0.875rem`,className:`shrink-0`}),(0,g.jsx)(`span`,{className:`min-w-0 flex-1 font-medium wrap-anywhere text-foreground`,children:e.language}),(0,g.jsx)(`span`,{className:`shrink-0 text-[0.6875rem]`,children:e.tried.length?`Not on PATH`:`Disabled`})]},e.language))]})]})}function vW({server:e}){let t=e.state===`starting`||!!e.activity?.length,n=e.state===`unavailable`||!!e.notice,r=e.state===`unavailable`?`Unavailable`:e.state===`starting`?`Starting`:t?`Working`:`Connected`;return(0,g.jsxs)(`div`,{className:`mt-1.5 border-t border-border pt-1.5`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t?(0,g.jsx)(nM,{size:`0.875rem`,className:`shrink-0 animate-spin text-accent`}):n?(0,g.jsx)(Pj,{size:`0.875rem`,className:`shrink-0 text-warn`}):(0,g.jsx)(Oj,{size:`0.875rem`,className:`shrink-0 text-add`}),(0,g.jsx)(`strong`,{className:`min-w-0 flex-1 font-medium wrap-anywhere`,children:e.name}),(0,g.jsx)(`span`,{className:`shrink-0 text-[0.6875rem] text-muted`,title:r===`Connected`?`Initialized; workspace readiness is not reported by LSP`:void 0,children:r})]}),(0,g.jsx)(`div`,{className:`mt-0.5 mb-0.5 ml-5.5 text-[0.6875rem] text-muted`,children:e.languages.join(`, `)}),e.activity?.map((e,t)=>(0,g.jsx)(`p`,{className:`my-1.5 ml-5.5 wrap-anywhere`,children:e},t)),e.message&&(0,g.jsx)(`p`,{className:`my-1.5 ml-5.5 wrap-anywhere text-warn`,children:e.message}),e.notice&&(0,g.jsx)(`p`,{className:`my-1.5 ml-5.5 wrap-anywhere text-warn`,children:e.notice.message}),(0,g.jsxs)(`details`,{className:`ml-5.5 text-[0.6875rem] text-muted`,children:[(0,g.jsx)(`summary`,{className:`cursor-pointer`,children:`Details`}),(0,g.jsx)(`pre`,{className:`my-2 font-mono wrap-anywhere whitespace-pre-wrap`,children:e.command}),e.stderr&&(0,g.jsx)(yW,{text:e.stderr})]})]})}function yW({text:e}){let[t,n]=(0,p.useState)(null);return(0,p.useEffect)(()=>{if(!t)return;let e=setTimeout(()=>n(null),3e3);return()=>clearTimeout(e)},[t]),(0,g.jsxs)(`div`,{className:`my-2`,children:[(0,g.jsxs)(`div`,{className:`flex items-center justify-between py-1`,children:[(0,g.jsx)(`span`,{children:`stderr`}),(0,g.jsxs)(wM,{variant:`ghost`,type:`button`,"aria-label":`Copy stderr`,onClick:async()=>n(await TM(e)?`copied`:`failed`),children:[t===`copied`?(0,g.jsx)(Oj,{size:`0.75rem`}):(0,g.jsx)(Rj,{size:`0.75rem`}),(0,g.jsx)(`span`,{"aria-live":`polite`,children:t===`copied`?`Copied`:`Copy`})]})]}),t===`failed`&&(0,g.jsx)(`p`,{role:`status`,className:`m-2 text-warn`,children:`Copy failed. Select the log and press Ctrl/⌘+C.`}),(0,g.jsx)(`pre`,{"aria-label":`stderr log`,tabIndex:0,className:`m-0 max-h-[min(12rem,25vh)] overflow-auto overscroll-contain p-2 font-mono whitespace-pre text-foreground`,children:e})]})}function bW({choice:e}){return e===`light`?(0,g.jsx)(vM,{size:`1rem`}):e===`dark`?(0,g.jsx)(aM,{size:`1rem`}):(0,g.jsx)(iM,{size:`1rem`})}var xW=[[{title:`Move`,rows:[[`j / k or ↓ / ↑`,`next / previous line`],[`{n}j / {n}k`,`n lines down / up`],[`Ctrl+d / Ctrl+u`,`half a page down / up`],[`Ctrl+o / Ctrl+i`,`jump back / forward in history`],[`← or ⌘/Ctrl+Shift+e / →`,`focus the file tree / back to the diff`],[`V, then j / k`,`extend a block selection`]]},{title:`Files and hunks`,rows:[[`J / K`,`next / previous file`],[`gg / G`,`first / last file`],[`{n}gg / {n}G`,`line n of the current file`],[`] / [ n / N`,`next / previous hunk (n / N follow matches while searching)`],[`v`,`toggle viewed on the current file`],[`zo / zc`,`expand / collapse the current file (zo loads a large diff)`],[`zO / zC`,`open / close all files`],[`F`,`view the current file whole; Ctrl+o returns`]]},{title:`Comments`,rows:[[`c`,`comment on the current line or selection`],[`e`,`edit the newest message of the thread under the cursor`],[`dd`,`delete the thread under the cursor`],[`R`,`resolve / reopen the thread under the cursor`],[`yy or Y`,`copy all comments`]]}],[{title:`Search`,rows:[[`/`,`search the current file, then n / N between matches`],[`g/`,`search the diff (scope button: file / diff / codebase)`],[`gf`,`filter the file tree by name (or / in the tree)`],[`w / b`,`focus the next / previous symbol on the line`],[`0 / $`,`focus the first / last symbol on the line`],[`* / #`,`next / previous occurrence of the focused word`]]},{title:`Code intelligence (language server)`,rows:[[`hover a symbol or gh`,`signature and docs tooltip (gh: focused word); Esc closes`],[`click a symbol`,`definition / type definition / references popover`],[`gd or ⌘/Ctrl+click`,`go to the definition of the hovered symbol`],[`gy`,`go to the definition of the hovered symbol’s type`],[`gA`,`list references; j / k, Enter to jump, n / N to step`],[`gs / gS`,`symbols in the current file / across the repository`]]},{title:`View`,rows:[[`zz`,`scroll the current line to eye level`],[`zt / zb`,`scroll the current line to the top / bottom`],[`s`,`toggle split / unified`],[`t`,`cycle theme`],[`⌘/Ctrl+b`,`toggle the file tree (Shift: comments panel)`],[`o`,`GitHub repository and pull request`],[`m, then 1–4`,`open the mode picker and choose an entry`]]},{title:`General`,rows:[[`?`,`toggle this help`],[`Esc`,`close composer, search, or menu; clear selection`]]}]];function SW(){let e=Y(e=>e.helpOpen),t=Y(e=>e.setHelpOpen);return e?(0,g.jsxs)(hj,{label:`Keyboard shortcuts`,onClose:()=>t(!1),className:`flex max-h-[calc(100vh_-_2rem)] w-max max-w-[96vw] flex-col overflow-hidden p-0`,children:[(0,g.jsxs)(`div`,{className:`flex items-center justify-between border-b border-b-border px-4.5 pt-3 pb-2.5`,children:[(0,g.jsx)(`h3`,{className:`m-0 text-[0.9375rem]`,children:`Keyboard shortcuts`}),(0,g.jsx)(wM,{onClick:()=>t(!1),children:`Close`})]}),(0,g.jsx)(`div`,{className:`grid grid-cols-[auto_auto] items-start gap-x-10 overflow-auto px-4.5 pt-2.5 pb-3.5 text-[0.75rem] whitespace-nowrap`,children:xW.map((e,t)=>(0,g.jsx)(`div`,{className:`grid grid-cols-[max-content_1fr] content-start gap-x-3`,children:e.map(e=>(0,g.jsxs)(`section`,{className:`col-span-full mb-2.5 grid grid-cols-subgrid last:mb-0`,children:[(0,g.jsx)(`h4`,{className:`col-span-full m-0 mb-0.5 text-[0.75rem] font-semibold text-muted`,children:e.title}),e.rows.map(([e,t])=>(0,g.jsxs)(`div`,{className:`col-span-full grid grid-cols-subgrid items-baseline leading-[1.7]`,children:[(0,g.jsx)(`span`,{className:`inline-flex gap-1.5`,children:e.split(/\s{2,}/).map((e,t)=>(0,g.jsx)(`kbd`,{children:e},t))}),(0,g.jsx)(`span`,{children:t})]},e))]},e.title))},t))})]}):null}var CW={file:`the current file`,diff:`only the diff`,repo:`the full codebase`},wW={file:Kj,diff:Gj,repo:Jj};function TW(){let e=Y(e=>e.search),t=Y(e=>e.runSearch),n=Y(e=>e.closeSearch),r=Y(e=>e.setSearchOptions),[i,a]=(0,p.useState)(e.query),o=(0,p.useRef)(null);if((0,p.useEffect)(()=>{e.open&&o.current?.focus()},[e.open,e.focusNonce]),!e.open)return null;let s=e.matches.length;if(e.kind!==`text`)return(0,g.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-b-border bg-surface px-2.5 py-1.5`,children:[e.kind===`references`?(0,g.jsx)(tM,{size:`0.875rem`}):(0,g.jsx)(xM,{size:`0.875rem`}),(0,g.jsxs)(`span`,{className:`flex-1 font-mono text-[0.75rem] leading-[normal] text-muted [&_code]:text-foreground`,children:[e.kind===`references`?`references to`:e.direction===1?`occurrences of`:`occurrences (upwards) of`,` `,(0,g.jsx)(`code`,{children:e.query})]}),(0,g.jsx)(`span`,{className:`min-w-17.5 text-right font-mono text-[0.75rem] leading-[normal] text-muted`,children:e.loading?`searching…`:s?`${e.index+1} / ${s}${e.truncated?`+`:``}`:`none`}),(0,g.jsx)(wM,{type:`button`,variant:`ghost`,icon:!0,onClick:n,title:`Close (Esc)`,children:(0,g.jsx)(SM,{size:`0.875rem`})})]});let c=wW[e.scope];return(0,g.jsxs)(`form`,{className:`flex items-center gap-2 border-b border-b-border bg-surface px-2.5 py-1.5`,onSubmit:e=>{e.preventDefault(),t(i).then(()=>{o.current?.blur(),document.querySelector(`main[tabindex]`)?.focus({preventScroll:!0})})},children:[(0,g.jsx)(hM,{size:`0.875rem`}),(0,g.jsx)(`input`,{className:`flex-1 rounded-md border border-border bg-canvas px-2 py-1 font-mono text-[0.75rem]`,ref:o,value:i,onChange:e=>a(e.target.value),placeholder:e.scope===`file`?`Search this file… (Enter, then n / N)`:`Search file contents… (Enter, then n / N)`,spellCheck:!1}),(0,g.jsx)(wM,{type:`button`,variant:`ghost`,className:mj(`rounded-sm border border-transparent px-1.5 py-[2px] font-mono text-[0.6875rem] leading-[normal] text-muted ${e.ignoreCase?``:`border-accent bg-[color-mix(in_srgb,_var(--accent)_12%,_transparent)] text-accent`}`),"aria-pressed":!e.ignoreCase,onClick:()=>r({ignoreCase:!e.ignoreCase}),title:e.ignoreCase?`Ignoring case; click to match case`:`Matching case; click to ignore case`,children:`Aa`}),(0,g.jsx)(wM,{type:`button`,variant:`ghost`,className:mj(`rounded-sm border border-transparent px-1.5 py-[2px] font-mono text-[0.6875rem] leading-[normal] text-muted ${e.regex?`border-accent bg-[color-mix(in_srgb,_var(--accent)_12%,_transparent)] text-accent`:``}`),"aria-pressed":e.regex,onClick:()=>r({regex:!e.regex}),title:e.regex?`Extended regex; click for plain text`:`Plain text; click for extended regex`,children:`.*`}),(0,g.jsx)(wM,{type:`button`,variant:`ghost`,className:mj(`rounded-sm border border-transparent px-1.5 py-[2px] font-mono text-[0.6875rem] leading-[normal] text-muted ${e.scope===`diff`?``:`border-accent bg-[color-mix(in_srgb,_var(--accent)_12%,_transparent)] text-accent`}`),"aria-label":`Searching ${CW[e.scope]}`,"data-scope":e.scope,onClick:()=>r({scope:BM(e.scope)}),title:`Searching ${CW[e.scope]}; click to search ${CW[BM(e.scope)]}`,children:(0,g.jsx)(c,{size:`0.75rem`})}),(0,g.jsx)(`span`,{className:`min-w-17.5 text-right font-mono text-[0.75rem] leading-[normal] text-muted`,children:e.loading?`searching…`:s===0&&e.query?e.scope===`file`?`none in file`:e.scope===`diff`?`none in diff`:`no matches`:s?`${e.index+1} / ${s}${e.truncated?`+`:``}`:``}),(0,g.jsx)(wM,{type:`button`,variant:`ghost`,icon:!0,onClick:n,title:`Close (Esc)`,children:(0,g.jsx)(SM,{size:`0.875rem`})})]})}var EW=250,DW=6,OW=`fixed z-40 rounded-lg border border-border bg-canvas px-3 py-2 text-[0.75rem] shadow-[0_0.5rem_1.5rem_rgba(0,_0,_0,_0.18)]`;function kW({boxRef:e,anchor:t,className:n,children:r,onPointerEnter:i,onPointerLeave:a}){let o=(0,p.useRef)(null),s=e??o;return(0,p.useLayoutEffect)(()=>{let e=s.current;if(!e)return;let{width:n,height:r}=e.getBoundingClientRect(),i=t.bottom+DW+r<=window.innerHeight;e.style.left=`${Math.max(8,Math.min(t.left,window.innerWidth-n-8))}px`,e.style.top=`${i?t.bottom+DW:Math.max(8,t.top-DW-r)}px`},[t,s]),(0,g.jsx)(`div`,{ref:s,role:`tooltip`,className:mj(OW,n),onPointerEnter:i,onPointerLeave:a,children:r})}function AW(){let[e,t]=(0,p.useState)(null);return(0,p.useEffect)(()=>{let e=null,n=null,r=null,i=()=>{e!==null&&clearTimeout(e),e=null},a=()=>{i(),n&&r!==null&&!n.hasAttribute(`title`)&&n.setAttribute(`title`,r),n=null,r=null,t(null)},o=(r,a,o)=>{i();let s=()=>{let e=r.getBoundingClientRect();t({text:a,anchor:{left:e.left,top:e.top,bottom:e.bottom}})};o===0?s():e=setTimeout(()=>{e=null,n===r&&s()},o)},s=(e,t)=>{if(e===n)return;let i=e.getAttribute(`title`);a(),i&&(n=e,r=i,e.removeAttribute(`title`),o(e,i,t))},c=e=>e instanceof Element?e.closest(`[title]`):null,l=e=>!(e instanceof Node)||!n?.contains(e),u=e=>{let t=c(e.target);t&&s(t,EW)},d=e=>{n&&l(e.relatedTarget)&&a()},f=e=>{let t=c(e.target);t?.matches(`:focus-visible`)&&s(t,0)},p=e=>{n&&l(e.relatedTarget)&&a()},m=e=>{e.key===`Escape`&&a()},h=()=>{if(!n)return;let e=n.getAttribute(`title`);e!==null&&(r=e,n.removeAttribute(`title`),o(n,e,0))},g=()=>a(),_=()=>a();return document.addEventListener(`pointerover`,u),document.addEventListener(`pointerout`,d),document.addEventListener(`pointermove`,h),document.addEventListener(`focusin`,f),document.addEventListener(`focusout`,p),document.addEventListener(`keydown`,m,!0),document.addEventListener(`pointerdown`,g,!0),document.addEventListener(`scroll`,_,!0),()=>{i(),document.removeEventListener(`pointerover`,u),document.removeEventListener(`pointerout`,d),document.removeEventListener(`pointermove`,h),document.removeEventListener(`focusin`,f),document.removeEventListener(`focusout`,p),document.removeEventListener(`keydown`,m,!0),document.removeEventListener(`pointerdown`,g,!0),document.removeEventListener(`scroll`,_,!0)}},[]),e?(0,g.jsx)(kW,{anchor:e.anchor,className:`pointer-events-none max-w-[min(28rem,_90vw)] wrap-anywhere whitespace-pre-line`,children:e.text}):null}var jW=300,MW=150,NW=null,PW=null,FW=()=>{NW&&clearTimeout(NW),PW&&clearTimeout(PW),NW=PW=null},IW={enter(e,t){FW(),NW=setTimeout(()=>{NW=null;let n=t.getBoundingClientRect();Y.getState().requestHover(e,{left:n.left,top:n.top,bottom:n.bottom})},jW)},leave(){FW(),PW=setTimeout(()=>{PW=null,Y.getState().closeHover()},MW)},hold(){FW()},cancel(){FW(),Y.getState().closeHover()}};function LW(){let e=Y(e=>e.hover),t=(0,p.useRef)(null);return(0,p.useEffect)(()=>{let e=new Set([`Shift`,`Control`,`Alt`,`Meta`,`CapsLock`]),n=t=>{t.key!==`Escape`&&!e.has(t.key)&&IW.cancel()},r=e=>e.target instanceof Node&&!!t.current?.contains(e.target),i=e=>{r(e)||IW.cancel()};return document.addEventListener(`keydown`,n,!0),document.addEventListener(`scroll`,i,!0),document.addEventListener(`pointerdown`,i,!0),()=>{document.removeEventListener(`keydown`,n,!0),document.removeEventListener(`scroll`,i,!0),document.removeEventListener(`pointerdown`,i,!0)}},[]),e?(0,g.jsx)(RW,{hover:e,boxRef:t}):null}function RW({hover:e,boxRef:t}){return(0,g.jsx)(kW,{boxRef:t,anchor:e.anchor,className:`hover-markdown max-h-[45vh] max-w-[min(40rem,_90vw)] overflow-auto`,onPointerEnter:IW.hold,onPointerLeave:IW.leave,children:(0,g.jsx)(vU,{text:e.contents,path:e.target.path,highlight:!0})})}function zW(){let e=Y(e=>e.references),t=Y(e=>e.theme),n=Y(e=>e.closeReferences),r=Y(e=>e.pickReference),i=(0,p.useRef)(null),a=(0,p.useMemo)(()=>e.items.map(e=>({...e,text:e.text.trim()})),[e.items]),o=hU(a,t,e.index),s=(0,p.useMemo)(()=>{let e=[];return a.forEach((t,n)=>{let r=e[e.length-1];r&&r.path===t.path?r.rows.push({i:n,line:t.line,text:t.text}):e.push({path:t.path,rows:[{i:n,line:t.line,text:t.text}]})}),e},[a]),c=(0,p.useCallback)(e=>{Y.setState(t=>({references:{...t.references,index:e}})),r()},[r]);return(0,p.useEffect)(()=>{i.current?.querySelector(`[data-active="true"]`)?.scrollIntoView({block:`nearest`})},[e.index,e.open]),e.open?(0,g.jsxs)(hj,{label:`References`,onClose:n,className:`flex max-h-[80vh] w-[min(60rem,_92vw)] flex-col overflow-hidden p-0`,children:[(0,g.jsxs)(`div`,{className:`flex items-baseline gap-3.5 border-b border-b-border px-4.5 pt-3.5 pb-2.5`,children:[(0,g.jsx)(`h3`,{className:`m-0 text-[0.9375rem]`,children:e.kind===`types`?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`code`,{className:`rounded-[0.3125rem] bg-hover px-1.5 py-[1px] font-mono text-foreground`,children:e.symbol}),` `,`has `,a.length,` types in its signature; pick one`]}):(0,g.jsxs)(g.Fragment,{children:[a.length,` reference`,a.length===1?``:`s`,` to`,` `,(0,g.jsx)(`code`,{className:`rounded-[0.3125rem] bg-hover px-1.5 py-[1px] font-mono text-foreground`,children:e.symbol})]})}),(0,g.jsxs)(`span`,{className:`ml-auto text-[0.6875rem] whitespace-nowrap text-muted`,children:[(0,g.jsx)(`kbd`,{children:`j`}),` `,(0,g.jsx)(`kbd`,{children:`k`}),` move · `,(0,g.jsx)(`kbd`,{children:`Enter`}),` jump · `,(0,g.jsx)(`kbd`,{children:`Esc`}),` close`]})]}),(0,g.jsx)(`div`,{className:`overflow-auto px-2.5 pt-2 pb-3`,ref:i,children:s.map(t=>(0,g.jsxs)(`section`,{className:`[&+section]:mt-2.5`,children:[(0,g.jsxs)(`header`,{className:`sticky top-0 z-1 mb-[2px] flex items-center gap-2 rounded-lg border border-border bg-hover px-2.5 py-1.5 font-mono text-[0.75rem] leading-[normal] [&>svg]:flex-none [&>svg]:text-muted`,children:[(0,g.jsx)(Wj,{size:`0.875rem`}),(0,g.jsx)(oP,{path:t.path,nowrap:!0,className:`flex-1`}),(0,g.jsx)(`span`,{className:`ml-auto rounded-[0.625rem] border border-border bg-canvas px-1.75 py-0 text-[0.6875rem] text-muted`,children:t.rows.length})]}),t.rows.map(n=>(0,g.jsx)(BW,{row:n,on:n.i===e.index,tokens:o.get(`${t.path}\n${n.text}`),onPick:c},`${n.line}:${n.i}`))]},t.path))})]}):null}var BW=(0,p.memo)(function({row:e,on:t,tokens:n,onPick:r}){return(0,g.jsxs)(`div`,{"data-active":t,className:mj(`grid cursor-pointer grid-cols-[3.25rem_1fr] gap-3 rounded-md px-2.5 py-0.75 font-mono text-[0.75rem] leading-[1.6] hover:bg-surface ${t?`bg-hover hover:bg-hover`:``}`),onMouseDown:e=>e.preventDefault(),onClick:()=>r(e.i),children:[(0,g.jsx)(`span`,{className:`text-right text-muted`,children:e.line}),(0,g.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-pre`,children:(0,g.jsx)(_U,{tokens:n,fallback:e.text})})]})});function VW(){let e=Y(e=>e.symbolMenu),t=Y(e=>e.theme),n=Y(e=>e.closeSymbolMenu),r=Y(e=>e.goToDefinition),i=Y(e=>e.goToTypeDefinition),a=Y(e=>e.findReferences),o=hU((0,p.useMemo)(()=>e?[{path:e.target.path,text:e.target.text}]:[],[e]),t);if((0,p.useEffect)(()=>{if(!e)return;let t=e=>{e.composedPath().some(e=>e instanceof HTMLElement&&e.hasAttribute(`data-symbol-menu`))||n()};return document.addEventListener(`pointerdown`,t,!0),document.addEventListener(`scroll`,n,!0),()=>{document.removeEventListener(`pointerdown`,t,!0),document.removeEventListener(`scroll`,n,!0)}},[e,n]),!e)return null;let s=QU(),c=28.75*s,l=2.75*s,u=Math.max(8,Math.min(e.x,window.innerWidth-c-8)),d=e.y+l<window.innerHeight?{left:u,top:e.y+12}:{left:u,top:e.y-l};return(0,g.jsxs)(`div`,{className:`fixed z-40 flex gap-[2px] rounded-lg border border-border bg-canvas p-0.75 shadow-[0_0.5rem_1.5rem_rgba(0,_0,_0,_0.18)]`,style:d,role:`menu`,"data-symbol-menu":!0,children:[(0,g.jsxs)(wM,{className:`flex cursor-pointer items-center gap-1.5 rounded-md border-0 bg-transparent px-2 py-1 font-sans text-[0.75rem] leading-[normal] text-foreground hover:bg-hover`,onClick:()=>void r(e.target),title:`Go to definition (gd)`,children:[(0,g.jsx)(zj,{size:`0.8125rem`}),` Definition `,(0,g.jsx)(`kbd`,{className:`ml-[2px]`,children:`gd`})]}),(0,g.jsxs)(wM,{className:`flex cursor-pointer items-center gap-1.5 rounded-md border-0 bg-transparent px-2 py-1 font-sans text-[0.75rem] leading-[normal] text-foreground hover:bg-hover`,onClick:()=>void a(e.target),title:`Find references (gA)`,children:[(0,g.jsx)(tM,{size:`0.8125rem`}),` References `,(0,g.jsx)(`kbd`,{className:`ml-[2px]`,children:`gA`})]}),(0,g.jsxs)(wM,{className:`flex cursor-pointer items-center gap-1.5 rounded-md border-0 bg-transparent px-2 py-1 font-sans text-[0.75rem] leading-[normal] text-foreground hover:bg-hover`,onClick:()=>void i(e.target),title:`Go to type definition (gy)`,children:[(0,g.jsx)(_M,{size:`0.8125rem`}),` Type `,(0,g.jsx)(`kbd`,{className:`ml-[2px]`,children:`gy`})]}),(0,g.jsx)(`span`,{className:`ml-1 max-w-55 self-center truncate border-l border-l-border px-2 py-0.75 font-mono text-[0.75rem] leading-[normal] text-foreground`,title:e.target.text,children:(0,g.jsx)(_U,{tokens:o.get(`${e.target.path}\n${e.target.text}`),fallback:e.target.text})})]})}var HW={1:`file`,2:`module`,3:`namespace`,4:`package`,5:`class`,6:`method`,7:`property`,8:`field`,9:`ctor`,10:`enum`,11:`interface`,12:`function`,13:`variable`,14:`constant`,15:`string`,16:`number`,17:`boolean`,18:`array`,19:`object`,20:`key`,21:`null`,22:`member`,23:`struct`,24:`event`,25:`operator`,26:`type param`};function UW(e){return[5,10,11,23,26].includes(e)?`type`:[6,9,12].includes(e)?`callable`:[7,8,13,14,20,22,24].includes(e)?`value`:e<=4?`scope`:`other`}function WW(){let e=Y(e=>e.symbols),t=Y(e=>e.querySymbols),n=Y(e=>e.moveSymbol),r=Y(e=>e.pickSymbol),i=Y(e=>e.closeSymbols),[a,o]=(0,p.useState)(``),s=(0,p.useRef)(null),c=(0,p.useRef)(null);if((0,p.useEffect)(()=>{e.open&&(o(``),s.current?.focus())},[e.open,e.scope]),(0,p.useEffect)(()=>{c.current?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`})},[e.index]),!e.open)return null;let l=e=>{o(e),t(e)},u=e=>{let t=e.key===`ArrowDown`||e.ctrlKey&&e.key===`n`,i=e.key===`ArrowUp`||e.ctrlKey&&e.key===`p`;t||i?(e.preventDefault(),n(t?1:-1)):e.key===`Enter`&&(e.preventDefault(),r())},d=e.scope===`document`?`Symbols in ${e.path??`file`}…`:`Search symbols across the repository…`,f={type:`text-kind-type`,callable:`text-kind-callable`,value:`text-kind-value`,scope:`text-muted`,other:`text-muted`},m=e.loading?`loading…`:e.items.length?`${e.index+1} / ${e.items.length}`:``;return(0,g.jsxs)(`div`,{className:`absolute top-0 right-0 left-0 z-30 flex max-h-[60%] flex-col border-b border-b-border bg-surface shadow-[0_0.625rem_1.875rem_rgba(0,_0,_0,_0.18)]`,role:`dialog`,"aria-label":`Symbols`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-b-border bg-surface px-2.5 py-1.5`,children:[(0,g.jsx)($j,{size:`0.875rem`}),(0,g.jsx)(`input`,{className:`flex-1 rounded-md border border-border bg-canvas px-2 py-1 font-mono text-[0.75rem]`,ref:s,value:a,onChange:e=>l(e.target.value),onKeyDown:u,placeholder:d,spellCheck:!1}),(0,g.jsx)(`span`,{className:`min-w-17.5 text-right font-mono text-[0.75rem] leading-[normal] text-muted`,children:m}),(0,g.jsx)(wM,{type:`button`,variant:`ghost`,icon:!0,onClick:i,title:`Close (Esc)`,children:(0,g.jsx)(SM,{size:`0.875rem`})})]}),e.items.length>0?(0,g.jsx)(`ul`,{role:`listbox`,"aria-label":`Symbols`,className:`m-0 list-none overflow-auto p-1`,ref:c,children:e.items.map((t,n)=>(0,g.jsxs)(`li`,{role:`option`,"aria-selected":n===e.index,className:mj(`grid cursor-pointer grid-cols-[4rem_1fr_auto] items-baseline gap-2.5 rounded-md px-2 py-1 font-mono text-[0.75rem] leading-[normal]`,n===e.index?`bg-hover`:``),onMouseDown:e=>e.preventDefault(),onClick:()=>{Y.setState(e=>({symbols:{...e.symbols,index:n}})),r()},children:[(0,g.jsx)(`span`,{className:mj(`text-[0.6875rem] text-muted lowercase ${f[UW(t.kind)]}`),children:HW[t.kind]??`symbol`}),(0,g.jsxs)(`span`,{children:[t.name,t.container&&(0,g.jsxs)(`span`,{className:`text-muted`,children:[` · `,t.container]})]}),(0,g.jsxs)(`span`,{className:`text-[0.6875rem] whitespace-nowrap text-muted`,children:[e.scope===`workspace`&&(0,g.jsx)(oP,{path:t.path,nowrap:!0}),e.scope===`workspace`?`:`:``,t.line]})]},`${t.path}:${t.line}:${t.col}:${t.name}`))}):(0,g.jsx)(`div`,{className:`p-3`,children:e.loading?``:e.scope===`workspace`&&!a.trim()?`Type to search`:`No symbols`})]})}function GW(e){let t=t=>Math.round(t*e),n=t(1.25),r=t(.5),i=n+3*r,a=t(2);return{itemMetrics:{lineHeight:n,spacing:r,diffHeaderHeight:i,hunkSeparatorHeight:a},layout:{paddingTop:t(.75),paddingBottom:t(12.5),gap:t(1)},css:`
1631
+ `).map(e=>e.trim()).filter(Boolean),contextLines:Math.max(0,Number.parseInt(a,10)||0)}),c(!1),e()},d=(0,p.useRef)({save:u,onClose:e,saving:s});return d.current={save:u,onClose:e,saving:s},(0,p.useEffect)(()=>{let e=e=>{if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),d.current.onClose();return}if(e.key===`Enter`&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey){if(e.target?.tagName===`TEXTAREA`)return;e.preventDefault(),e.stopPropagation(),d.current.saving||d.current.save()}};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[]),(0,g.jsxs)(gj,{label:`Settings`,onClose:e,className:`[&_code]:rounded-sm [&_code]:bg-hover [&_code]:px-1 [&_code]:font-mono`,children:[(0,g.jsx)(`h3`,{className:`m-0 mb-2`,children:`Auto-viewed patterns`}),(0,g.jsxs)(`p`,{className:`m-0 mb-2 text-muted`,children:[`Files matching these globs start collapsed and marked viewed. One per line. Patterns without a slash match the file name anywhere, e.g. `,(0,g.jsx)(`code`,{children:`*.lock`}),`; use `,(0,g.jsx)(`code`,{children:`**/generated/**`}),` for paths. Same as`,` `,(0,g.jsx)(`code`,{children:`diffle config add-auto-viewed`}),`.`]}),(0,g.jsx)(`textarea`,{className:`min-h-40 w-full rounded-md border border-border bg-surface p-2 font-mono text-[0.75rem]`,value:r,onChange:e=>i(e.target.value),spellCheck:!1,autoFocus:!0}),(0,g.jsx)(`h3`,{className:`m-0 mt-[14px] mb-2`,children:`Context lines`}),(0,g.jsxs)(`p`,{className:`m-0 mb-2 text-muted`,children:[`Unchanged lines shown around each change (`,(0,g.jsx)(`code`,{children:`git diff -U<n>`}),`). Same as `,(0,g.jsx)(`code`,{children:`--context`}),` or`,` `,(0,g.jsx)(`code`,{children:`diffle config set-context`}),`.`]}),(0,g.jsx)(`input`,{type:`number`,min:0,max:1e4,value:a,onChange:e=>o(e.target.value),className:`w-[100px]`}),(0,g.jsx)(`h3`,{className:`m-0 mt-[14px] mb-2`,children:`Language servers`}),(0,g.jsxs)(`p`,{className:`m-0 mb-2 text-muted`,children:[`Go-to-definition, references and symbols come from a language server per language, found on `,(0,g.jsx)(`code`,{children:`PATH`}),`.`,` `,(0,g.jsx)(`code`,{children:`diffle lsp`}),` lists what each language would get,`,` `,(0,g.jsx)(`code`,{children:`diffle config set-lsp <language> <command>`}),` overrides one, and `,(0,g.jsx)(`code`,{children:`--no-lsp`}),` `,`turns them off for a run. Commands are not editable here.`]}),l.length>0&&(0,g.jsxs)(`p`,{className:`m-0 mb-2 text-muted`,children:[`Overridden in your config:`,` `,l.map(([e,t],n)=>(0,g.jsxs)(`span`,{children:[n>0&&`, `,e,` `,(0,g.jsx)(`code`,{children:t||`(off)`})]},e))]}),(0,g.jsxs)(`div`,{className:`mt-2.5 flex items-center gap-1.5`,children:[(0,g.jsxs)(`span`,{className:`text-[0.75rem] text-muted`,title:`Installed diffle version`,children:[`diffle v`,`0.1.6`]}),(0,g.jsx)(`span`,{className:`flex-1`}),(0,g.jsx)(Y,{onClick:e,children:`Cancel`}),(0,g.jsx)(Y,{variant:`primary`,onClick:u,disabled:s,children:`Save`})]})]})}function CW(){let e=X(e=>e.snapshot),t=X(e=>e.lsp),[n,r]=(0,p.useState)(!1),i=X(e=>e.theme),a=X(e=>e.setTheme),o=X(e=>e.layout),s=X(e=>e.setLayout),c=X(e=>e.diffStyle),l=X(e=>e.setDiffStyle),u=e?.changed.length??0,d=e?.changed.reduce((e,t)=>e+t.additions,0)??0,f=e?.changed.reduce((e,t)=>e+t.deletions,0)??0;return(0,g.jsxs)(`header`,{className:`col-span-full flex items-center gap-2.5 border-b border-b-border bg-surface px-3 py-0`,children:[(0,g.jsx)(Y,{variant:`ghost`,icon:!0,className:o.treeVisible?``:`opacity-45`,onClick:()=>s({treeVisible:!o.treeVisible}),title:`Toggle file tree (⌘/Ctrl+b)`,children:(0,g.jsx)(lM,{size:`1rem`})}),(0,g.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-bold tracking-[0.02em]`,children:[(0,g.jsx)(Zj,{size:`1rem`}),` diffle`]}),(0,g.jsx)(`span`,{className:`truncate font-mono text-[0.75rem] text-muted`,title:e?.root,children:e?gN(e):``}),(0,g.jsx)(xW,{}),(0,g.jsx)(LU,{}),(0,g.jsxs)(`span`,{className:`text-muted`,children:[u,` files · `,(0,g.jsxs)(`span`,{className:`text-add`,children:[`+`,d]}),` `,(0,g.jsxs)(`span`,{className:`text-del`,children:[`−`,f]})]}),(0,g.jsx)(`span`,{className:`flex-1`}),t.enabled&&(0,g.jsx)(wW,{lsp:t}),(0,g.jsxs)(FU,{title:`Diff layout`,children:[(0,g.jsxs)(IU,{selected:c===`split`,onClick:()=>l(`split`),children:[(0,g.jsx)(Lj,{size:`0.875rem`}),` Split`]}),(0,g.jsxs)(IU,{selected:c===`unified`,onClick:()=>l(`unified`),children:[(0,g.jsx)(_M,{size:`0.875rem`}),` Unified`]})]}),(0,g.jsx)(Y,{variant:`ghost`,icon:!0,onClick:()=>a(tP(i)),title:`Theme: ${i} (t)`,children:(0,g.jsx)(DW,{choice:i})}),(0,g.jsx)(Y,{variant:`ghost`,icon:!0,onClick:()=>X.getState().setHelpOpen(!0),title:`Keyboard shortcuts (?)`,children:(0,g.jsx)(nM,{size:`1rem`})}),(0,g.jsxs)(Y,{variant:`ghost`,onClick:()=>r(!0),title:`Settings`,children:[(0,g.jsx)(yM,{size:`0.9375rem`}),` Settings`]}),(0,g.jsx)(Y,{variant:`ghost`,icon:!0,className:o.panelVisible?``:`opacity-45`,onClick:()=>s({panelVisible:!o.panelVisible}),title:`Toggle comments panel (⌘/Ctrl+Shift+b)`,children:(0,g.jsx)(uM,{size:`1rem`})}),n&&(0,g.jsx)(SW,{onClose:()=>r(!1)})]})}function wW({lsp:e}){let t=(0,p.useRef)(null),n=()=>{t.current&&(t.current.open=!1,t.current.querySelector(`summary`)?.focus())};(0,p.useEffect)(()=>{let e=e=>{let n=t.current;n?.open&&!n.contains(e.target)&&(n.open=!1)},r=e=>{e.key!==`Escape`||!t.current?.open||(e.preventDefault(),e.stopPropagation(),n())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,r,!0)}},[]);let r=e.servers.some(e=>e.state===`starting`),i=r||e.servers.some(e=>e.activity?.length),a=e.servers.some(e=>e.state===`unavailable`),o=e.servers.some(e=>e.notice?.severity===`error`),s=e.servers.some(e=>e.notice?.severity===`warning`),c=e.servers.some(e=>e.stderr),l=a&&`unavailable`||o&&`error`||s&&`warning`||r&&`starting`||i&&`busy`||c&&`logs`||``;return(0,g.jsxs)(`details`,{ref:t,className:`relative`,children:[(0,g.jsxs)(`summary`,{className:hj(`flex cursor-pointer list-none items-center gap-1.25 text-xs whitespace-nowrap text-muted [&::-webkit-details-marker]:hidden ${o||a?`text-warn`:``}`),"aria-label":`Language servers${l?`: ${l}`:``}`,children:[i?(0,g.jsx)(iM,{size:`0.875rem`,className:`animate-spin`}):(0,g.jsx)(Rj,{size:`0.875rem`}),l]}),(0,g.jsxs)(`section`,{className:`absolute top-[calc(100%+0.75rem)] right-0 z-100 max-h-[65vh] w-[min(28rem,85vw)] overflow-auto rounded-lg border border-border bg-surface p-2.5 text-[0.8125rem] text-foreground shadow-lg`,"aria-label":`Language server status`,children:[(0,g.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,g.jsx)(`strong`,{children:`Language servers`}),(0,g.jsx)(Y,{variant:`ghost`,icon:!0,type:`button`,"aria-label":`Close language server status`,className:`border-0 p-0.5 text-muted hover:text-foreground`,onClick:n,children:(0,g.jsx)(TM,{size:`0.875rem`})})]}),e.servers.map(e=>(0,g.jsx)(TW,{server:e},e.command)),!e.servers.length&&!e.missing.length&&(0,g.jsx)(`p`,{className:`text-muted`,children:`No servers`}),e.missing.map(e=>(0,g.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-2 border-t border-border pt-1.5 text-muted`,title:e.tried.join(`, `),children:[(0,g.jsx)(TM,{size:`0.875rem`,className:`shrink-0`}),(0,g.jsx)(`span`,{className:`min-w-0 flex-1 font-medium wrap-anywhere text-foreground`,children:e.language}),(0,g.jsx)(`span`,{className:`shrink-0 text-[0.6875rem]`,children:e.tried.length?`Not on PATH`:`Disabled`})]},e.language))]})]})}function TW({server:e}){let t=e.state===`starting`||!!e.activity?.length,n=e.state===`unavailable`||!!e.notice,r=e.state===`unavailable`?`Unavailable`:e.state===`starting`?`Starting`:t?`Working`:`Connected`;return(0,g.jsxs)(`div`,{className:`mt-1.5 border-t border-border pt-1.5`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t?(0,g.jsx)(iM,{size:`0.875rem`,className:`shrink-0 animate-spin text-accent`}):n?(0,g.jsx)(Fj,{size:`0.875rem`,className:`shrink-0 text-warn`}):(0,g.jsx)(kj,{size:`0.875rem`,className:`shrink-0 text-add`}),(0,g.jsx)(`strong`,{className:`min-w-0 flex-1 font-medium wrap-anywhere`,children:e.name}),(0,g.jsx)(`span`,{className:`shrink-0 text-[0.6875rem] text-muted`,title:r===`Connected`?`Initialized; workspace readiness is not reported by LSP`:void 0,children:r})]}),(0,g.jsx)(`div`,{className:`mt-0.5 mb-0.5 ml-5.5 text-[0.6875rem] text-muted`,children:e.languages.join(`, `)}),e.activity?.map((e,t)=>(0,g.jsx)(`p`,{className:`my-1.5 ml-5.5 wrap-anywhere`,children:e},t)),e.message&&(0,g.jsx)(`p`,{className:`my-1.5 ml-5.5 wrap-anywhere text-warn`,children:e.message}),e.notice&&(0,g.jsx)(`p`,{className:`my-1.5 ml-5.5 wrap-anywhere text-warn`,children:e.notice.message}),(0,g.jsxs)(`details`,{className:`ml-5.5 text-[0.6875rem] text-muted`,children:[(0,g.jsx)(`summary`,{className:`cursor-pointer`,children:`Details`}),(0,g.jsx)(`pre`,{className:`my-2 font-mono wrap-anywhere whitespace-pre-wrap`,children:e.command}),e.stderr&&(0,g.jsx)(EW,{text:e.stderr})]})]})}function EW({text:e}){let[t,n]=(0,p.useState)(null);return(0,p.useEffect)(()=>{if(!t)return;let e=setTimeout(()=>n(null),3e3);return()=>clearTimeout(e)},[t]),(0,g.jsxs)(`div`,{className:`my-2`,children:[(0,g.jsxs)(`div`,{className:`flex items-center justify-between py-1`,children:[(0,g.jsx)(`span`,{children:`stderr`}),(0,g.jsxs)(Y,{variant:`ghost`,type:`button`,"aria-label":`Copy stderr`,onClick:async()=>n(await DM(e)?`copied`:`failed`),children:[t===`copied`?(0,g.jsx)(kj,{size:`0.75rem`}):(0,g.jsx)(zj,{size:`0.75rem`}),(0,g.jsx)(`span`,{"aria-live":`polite`,children:t===`copied`?`Copied`:`Copy`})]})]}),t===`failed`&&(0,g.jsx)(`p`,{role:`status`,className:`m-2 text-warn`,children:`Copy failed. Select the log and press Ctrl/⌘+C.`}),(0,g.jsx)(`pre`,{"aria-label":`stderr log`,tabIndex:0,className:`m-0 max-h-[min(12rem,25vh)] overflow-auto overscroll-contain p-2 font-mono whitespace-pre text-foreground`,children:e})]})}function DW({choice:e}){return e===`light`?(0,g.jsx)(xM,{size:`1rem`}):e===`dark`?(0,g.jsx)(cM,{size:`1rem`}):(0,g.jsx)(sM,{size:`1rem`})}var OW=[[{title:`Move`,rows:[[`j / k or ↓ / ↑`,`next / previous line`],[`{n}j / {n}k`,`n lines down / up`],[`Ctrl+d / Ctrl+u`,`half a page down / up`],[`Ctrl+o / Ctrl+i`,`jump back / forward in history`],[`← or ⌘/Ctrl+Shift+e / →`,`focus the file tree / back to the diff`],[`V, then j / k`,`extend a block selection`]]},{title:`Files and hunks`,rows:[[`J / K`,`next / previous file`],[`gg / G`,`first / last file`],[`{n}gg / {n}G`,`line n of the current file`],[`] / [ n / N`,`next / previous hunk (n / N follow matches while searching)`],[`v`,`toggle viewed on the current file`],[`zo / zc`,`expand / collapse the current file (zo loads a large diff)`],[`zO / zC`,`open / close all files`],[`F`,`view the current file whole; Ctrl+o returns`]]},{title:`Comments`,rows:[[`c`,`comment on the current line or selection`],[`C`,`comment on the current file as a whole`],[`e`,`edit the newest message of the thread under the cursor`],[`dd`,`delete the thread under the cursor`],[`R`,`resolve / reopen the thread under the cursor`],[`yy or Y`,`copy all comments`]]}],[{title:`Search`,rows:[[`/`,`search the current file, then n / N between matches`],[`g/`,`search changed files (toggle: diff + context / full file)`],[`⌘/Ctrl+p or gf`,`search files by name`],[`w / b`,`focus the next / previous symbol on the line`],[`0 / $`,`focus the first / last symbol on the line`],[`* / #`,`next / previous occurrence of the focused word`]]},{title:`Code intelligence (language server)`,rows:[[`hover a symbol or gh`,`signature and docs tooltip (gh: focused word); Esc closes`],[`click a symbol`,`definition / type definition / references popover`],[`gd or ⌘/Ctrl+click`,`go to the definition of the hovered symbol`],[`gy`,`go to the definition of the hovered symbol’s type`],[`gA`,`list references; j / k, Enter to jump, n / N to step`],[`gs / gS`,`symbols in the current file / across the repository`]]},{title:`View`,rows:[[`zz`,`scroll the current line to eye level`],[`zt / zb`,`scroll the current line to the top / bottom`],[`s`,`toggle split / unified`],[`t`,`cycle theme`],[`⌘/Ctrl+b`,`toggle the file tree (Shift: comments panel)`],[`o`,`GitHub repository and pull request`],[`m, then 1–4`,`open the mode picker and choose an entry`]]},{title:`General`,rows:[[`?`,`toggle this help`],[`Esc`,`close composer, search, or menu; clear selection`]]}]];function kW(){let e=X(e=>e.helpOpen),t=X(e=>e.setHelpOpen);return e?(0,g.jsxs)(gj,{label:`Keyboard shortcuts`,onClose:()=>t(!1),className:`flex max-h-[calc(100vh_-_2rem)] w-max max-w-[96vw] flex-col overflow-hidden p-0`,children:[(0,g.jsxs)(`div`,{className:`flex items-center justify-between border-b border-b-border px-4.5 pt-3 pb-2.5`,children:[(0,g.jsx)(`h3`,{className:`m-0 text-[0.9375rem]`,children:`Keyboard shortcuts`}),(0,g.jsx)(Y,{onClick:()=>t(!1),children:`Close`})]}),(0,g.jsx)(`div`,{className:`grid grid-cols-[auto_auto] items-start gap-x-10 overflow-auto px-4.5 pt-2.5 pb-3.5 text-[0.75rem] whitespace-nowrap`,children:OW.map((e,t)=>(0,g.jsx)(`div`,{className:`grid grid-cols-[max-content_1fr] content-start gap-x-3`,children:e.map(e=>(0,g.jsxs)(`section`,{className:`col-span-full mb-2.5 grid grid-cols-subgrid last:mb-0`,children:[(0,g.jsx)(`h4`,{className:`col-span-full m-0 mb-0.5 text-[0.75rem] font-semibold text-muted`,children:e.title}),e.rows.map(([e,t])=>(0,g.jsxs)(`div`,{className:`col-span-full grid grid-cols-subgrid items-baseline leading-[1.7]`,children:[(0,g.jsx)(`span`,{className:`inline-flex gap-1.5`,children:e.split(/\s{2,}/).map((e,t)=>(0,g.jsx)(`kbd`,{children:e},t))}),(0,g.jsx)(`span`,{children:t})]},e))]},e.title))},t))})]}):null}function AW({path:e}){return X(t=>{let n=t.search.kind===`text`&&t.search.scope===`file`;return t.search.open&&(n?t.search.path===e:e===void 0)})?(0,g.jsx)(jW,{}):null}function jW(){let e=X(e=>e.search),t=X(e=>e.runSearch),n=X(e=>e.closeSearch),r=X(e=>e.setSearchOptions),i=X(e=>e.setSearchInput),a=(0,p.useRef)(null);(0,p.useEffect)(()=>{e.editing&&a.current?.focus({preventScroll:!0})},[e.editing,e.focusNonce]);let o=e.matches.length;if(e.kind!==`text`)return(0,g.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-b-border bg-surface px-2.5 py-1.5`,children:[e.kind===`references`?(0,g.jsx)(rM,{size:`0.875rem`}):(0,g.jsx)(wM,{size:`0.875rem`}),(0,g.jsxs)(`span`,{className:`flex-1 font-mono text-[0.75rem] leading-[normal] text-muted [&_code]:text-foreground`,children:[e.kind===`references`?`references to`:e.direction===1?`occurrences of`:`occurrences (upwards) of`,` `,(0,g.jsx)(`code`,{children:e.query})]}),(0,g.jsx)(`span`,{className:`min-w-17.5 text-right font-mono text-[0.75rem] leading-[normal] text-muted`,children:e.loading?`searching…`:o?`${e.index+1} / ${o}${e.truncated?`+`:``}`:`none`}),(0,g.jsx)(Y,{type:`button`,variant:`ghost`,icon:!0,onClick:n,title:`Close (Esc)`,children:(0,g.jsx)(TM,{size:`0.875rem`})})]});let s=e.content[e.scope]===`full`,c=s?Jj:Kj;return(0,g.jsxs)(`form`,{className:`flex items-center gap-2 border-b border-b-border bg-surface px-2.5 py-1.5`,onClick:e=>e.stopPropagation(),onSubmit:n=>{n.preventDefault(),t(e.input).then(()=>{a.current?.blur(),document.querySelector(`main[tabindex]`)?.focus({preventScroll:!0})})},children:[(0,g.jsx)(vM,{size:`0.875rem`}),(0,g.jsx)(`input`,{"data-content-search":``,className:`min-w-0 flex-1 rounded-md border border-border bg-canvas px-2 py-1 font-mono text-[0.75rem]`,ref:a,value:e.input,onFocus:()=>{e.editing||i(e.input)},onChange:e=>i(e.target.value),placeholder:e.scope===`file`?`Search this file… (Enter, then n / N)`:`Search all files… (Enter, then n / N)`,spellCheck:!1}),(0,g.jsx)(Y,{type:`button`,variant:`ghost`,className:hj(`rounded-sm border border-transparent px-1.5 py-[2px] font-mono text-[0.6875rem] leading-[normal] text-muted ${e.ignoreCase?``:`border-accent bg-[color-mix(in_srgb,_var(--accent)_12%,_transparent)] text-accent`}`),"aria-pressed":!e.ignoreCase,onClick:()=>r({ignoreCase:!e.ignoreCase}),title:e.ignoreCase?`Ignoring case; click to match case`:`Matching case; click to ignore case`,children:`Aa`}),(0,g.jsx)(Y,{type:`button`,variant:`ghost`,className:hj(`rounded-sm border border-transparent px-1.5 py-[2px] font-mono text-[0.6875rem] leading-[normal] text-muted ${e.regex?`border-accent bg-[color-mix(in_srgb,_var(--accent)_12%,_transparent)] text-accent`:``}`),"aria-pressed":e.regex,onClick:()=>r({regex:!e.regex}),title:e.regex?`Extended regex; click for plain text`:`Plain text; click for extended regex`,children:`.*`}),(0,g.jsx)(Y,{type:`button`,variant:`ghost`,className:hj(`rounded-sm border border-transparent px-1.5 py-[2px] font-mono text-[0.6875rem] leading-[normal] text-muted ${s?`border-accent bg-[color-mix(in_srgb,_var(--accent)_12%,_transparent)] text-accent`:``}`),"aria-label":`Search full file`,"aria-pressed":s,onClick:()=>r({content:s?`diff`:`full`}),title:s?`Searching full file; click to search diff + context`:`Searching diff + context; click to search full file`,children:(0,g.jsx)(c,{size:`0.75rem`})}),(0,g.jsx)(`span`,{className:`min-w-17.5 text-right font-mono text-[0.75rem] leading-[normal] text-muted`,children:e.loading?`searching…`:o===0&&e.query?e.scope===`file`?`none in file`:s?`no matches`:`none in diff`:o?`${e.index+1} / ${o}${e.truncated?`+`:``}`:``}),(0,g.jsx)(Y,{type:`button`,variant:`ghost`,icon:!0,onClick:n,title:`Close (Esc)`,children:(0,g.jsx)(TM,{size:`0.875rem`})})]})}var MW=250,NW=6,PW=`fixed z-40 rounded-lg border border-border bg-canvas px-3 py-2 text-[0.75rem] shadow-[0_0.5rem_1.5rem_rgba(0,_0,_0,_0.18)]`;function FW({boxRef:e,anchor:t,className:n,children:r,onPointerEnter:i,onPointerLeave:a}){let o=(0,p.useRef)(null),s=e??o;return(0,p.useLayoutEffect)(()=>{let e=s.current;if(!e)return;let{width:n,height:r}=e.getBoundingClientRect(),i=t.bottom+NW+r<=window.innerHeight;e.style.left=`${Math.max(8,Math.min(t.left,window.innerWidth-n-8))}px`,e.style.top=`${i?t.bottom+NW:Math.max(8,t.top-NW-r)}px`},[t,s]),(0,g.jsx)(`div`,{ref:s,role:`tooltip`,className:hj(PW,n),onPointerEnter:i,onPointerLeave:a,children:r})}function IW(){let[e,t]=(0,p.useState)(null);return(0,p.useEffect)(()=>{let e=null,n=null,r=null,i=()=>{e!==null&&clearTimeout(e),e=null},a=()=>{i(),n&&r!==null&&!n.hasAttribute(`title`)&&n.setAttribute(`title`,r),n=null,r=null,t(null)},o=(r,a,o)=>{i();let s=()=>{let e=r.getBoundingClientRect();t({text:a,anchor:{left:e.left,top:e.top,bottom:e.bottom}})};o===0?s():e=setTimeout(()=>{e=null,n===r&&s()},o)},s=(e,t)=>{if(e===n)return;let i=e.getAttribute(`title`);a(),i&&(n=e,r=i,e.removeAttribute(`title`),o(e,i,t))},c=e=>{let t=e.composedPath()[0];return t instanceof Element?t.closest(`[title]`):null},l=e=>!(e instanceof Node)||!n?.contains(e),u=new Set,d=e=>{for(let e of u)e.host.isConnected||(x(e),u.delete(e));for(let t of e.composedPath())!(t instanceof ShadowRoot)||u.has(t)||(u.add(t),b(t))},f=e=>{d(e);let t=c(e);t&&s(t,MW)},p=e=>{n&&l(e.relatedTarget)&&a()},m=e=>{d(e);let t=c(e);t?.matches(`:focus-visible`)&&s(t,0)},h=e=>{n&&l(e.relatedTarget)&&a()},g=e=>{e.key===`Escape`&&a()},_=()=>{if(!n)return;let e=n.getAttribute(`title`);e!==null&&(r=e,n.removeAttribute(`title`),o(n,e,0))},v=()=>a(),y=()=>a(),b=e=>{e.addEventListener(`pointerover`,f),e.addEventListener(`pointerout`,p),e.addEventListener(`focusin`,m),e.addEventListener(`focusout`,h),e.addEventListener(`scroll`,y,!0)},x=e=>{e.removeEventListener(`pointerover`,f),e.removeEventListener(`pointerout`,p),e.removeEventListener(`focusin`,m),e.removeEventListener(`focusout`,h),e.removeEventListener(`scroll`,y,!0)};return b(document),document.addEventListener(`pointermove`,_),document.addEventListener(`keydown`,g,!0),document.addEventListener(`pointerdown`,v,!0),()=>{i(),x(document);for(let e of u)x(e);document.removeEventListener(`pointermove`,_),document.removeEventListener(`keydown`,g,!0),document.removeEventListener(`pointerdown`,v,!0)}},[]),e?(0,g.jsx)(FW,{anchor:e.anchor,className:`pointer-events-none max-w-[min(28rem,_90vw)] wrap-anywhere whitespace-pre-line`,children:e.text}):null}var LW=300,RW=!1,zW=!1,BW=null,VW=null,HW=()=>{BW&&clearTimeout(BW),BW=null},UW=()=>{VW&&clearTimeout(VW),VW=null},WW=()=>{UW(),!(RW||zW)&&(VW=setTimeout(()=>{VW=null,X.getState().closeHover()},150))},GW={enter(e,t){RW=!0,HW(),WW(),BW=setTimeout(()=>{BW=null;let n=t.getBoundingClientRect();X.getState().requestHover(e,{left:n.left,top:n.top,bottom:n.bottom})},LW)},leave(){RW=!1,HW(),WW()},tipEnter(){zW=!0,WW()},tipLeave(){zW&&(zW=!1,WW())},cancel(){HW(),UW(),X.getState().closeHover()}};function KW(){let e=X(e=>e.hover),t=(0,p.useRef)(null);return(0,p.useEffect)(()=>{let e=new Set([`Shift`,`Control`,`Alt`,`Meta`,`CapsLock`]),n=t=>{t.key!==`Escape`&&!e.has(t.key)&&GW.cancel()},r=e=>e.target instanceof Node&&!!t.current?.contains(e.target),i=e=>{r(e)||GW.cancel()};return document.addEventListener(`keydown`,n,!0),document.addEventListener(`scroll`,i,!0),document.addEventListener(`pointerdown`,i,!0),()=>{document.removeEventListener(`keydown`,n,!0),document.removeEventListener(`scroll`,i,!0),document.removeEventListener(`pointerdown`,i,!0)}},[]),e?(0,g.jsx)(qW,{hover:e,boxRef:t}):null}function qW({hover:e,boxRef:t}){return(0,p.useEffect)(()=>GW.tipLeave,[]),(0,g.jsx)(FW,{boxRef:t,anchor:e.anchor,className:`hover-markdown max-h-[45vh] max-w-[min(40rem,_90vw)] overflow-auto`,onPointerEnter:GW.tipEnter,onPointerLeave:GW.tipLeave,children:(0,g.jsx)(SU,{text:e.contents,path:e.target.path,highlight:!0})})}function JW(e){let t=t=>Math.round(t*e),n=t(1.25),r=t(.5),i=n+3*r,a=t(2);return{itemMetrics:{lineHeight:n,spacing:r,diffHeaderHeight:i,hunkSeparatorHeight:a},layout:{paddingTop:t(.75),paddingBottom:t(12.5),gap:t(1)},css:`
1632
1632
  :host {
1633
+ --diffle-header-height: ${i}px;
1633
1634
  --diffs-font-size: ${t(.8125)}px;
1634
1635
  --diffs-line-height: ${n}px;
1635
1636
  --diffs-gap-block: ${r}px;
@@ -1641,8 +1642,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1641
1642
  height: ${i}px;
1642
1643
  min-height: ${i}px;
1643
1644
  }
1645
+ [data-diffs-header='custom'] { height: auto; }
1644
1646
  [data-separator='line-info'] { height: ${a}px; }
1645
- `,edge:t(3)}}var KW=`diffle-search`,qW=`diffle-search-current`;function JW(e){if(!e.open||!e.query||e.matches.length===0)return null;let t=e.query.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);try{if(e.kind===`word`)return RegExp(`(?<![\\p{L}\\p{N}_])${t}(?![\\p{L}\\p{N}_])`,`gu`);if(e.kind===`text`)return new RegExp(e.regex?e.query:t,e.ignoreCase?`gi`:`g`)}catch{return null}return null}function YW(e,t){let n=[],r=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),i=``,a=[];for(let e=r.nextNode();e;e=r.nextNode())n.push(e),a.push(i.length),i+=e.data;if(!i)return[];let o=[];t.lastIndex=0;for(let r=t.exec(i);r;r=t.exec(i)){if(r[0].length===0){t.lastIndex++;continue}let i=e.ownerDocument.createRange(),[s,c]=XW(n,a,r.index),[l,u]=XW(n,a,r.index+r[0].length,!0);i.setStart(s,c),i.setEnd(l,u),o.push(i)}return o}function XW(e,t,n,r=!1){let i=t.length-1;for(;i>0&&(r?t[i]>=n:t[i]>n);)i--;return[e[i],n-t[i]]}var ZW=class{scan;key=``;rows=new WeakMap;constructor(e=YW){this.scan=e}rangesFor(e,t){let n=`${t.flags}/${t.source}`;n!==this.key&&(this.key=n,this.rows=new WeakMap);let r=this.rows.get(e);return r||(r=this.scan(e,t),this.rows.set(e,r)),r}invalidate(e){let t=(e instanceof Element?e:e.parentElement)?.closest(`[data-line]`);t&&this.rows.delete(t)}},QW=()=>typeof CSS<`u`&&`highlights`in CSS&&typeof Highlight<`u`;function $W(e,t){if(!QW())return()=>{};let n=new ZW,r=FU(e,t,e=>Y.subscribe((t,n)=>{(t.search!==n.search||t.loaded!==n.loaded||t.collapsed!==n.collapsed)&&e()}),e=>{let t=Y.getState().search,r=JW(t);if(!r){CSS.highlights.delete(KW),CSS.highlights.delete(qW);return}let i=t.matches[t.index],a=[],o=[];for(let{id:t,root:s}of e){let e=NM(t);for(let t of s.querySelectorAll(`[data-line]`)){if(NU(t))continue;let s=i!=null&&i.path===e&&Number(t.dataset.line)===i.line;for(let e of n.rangesFor(t,r))(s?o:a).push(e)}}CSS.highlights.set(KW,new Highlight(...a)),CSS.highlights.set(qW,new Highlight(...o))},e=>{for(let t of e)n.invalidate(t.target)});return()=>{r(),CSS.highlights.delete(KW),CSS.highlights.delete(qW)}}var eG=`data-thread-line`;function tG(e,t){for(let n of e.querySelectorAll(`code`)){let[e,r]=n.children;if(!(!e||!r))for(let n=0;n<r.children.length;n++){let i=r.children[n];if(!(i instanceof HTMLElement)||i.dataset.line==null)continue;let a=Number(i.dataset.line),o=NU(i)?`old`:`new`,s=t.some(e=>e.side===o&&a>=e.startLine&&a<=e.endLine);i.toggleAttribute(eG,s),e.children[n]?.toggleAttribute(eG,s)}}}function nG(e,t){return YM(e).filter(e=>e.anchor.path===t).map(e=>e.anchor)}function rG(e,t){return FU(e,t,e=>Y.subscribe((t,n)=>{(t.threads!==n.threads||t.showResolved!==n.showResolved||t.loaded!==n.loaded||t.collapsed!==n.collapsed)&&e()}),e=>{let t=Y.getState();for(let{id:n,root:r}of e)tG(r,nG(t,NM(n)))})}function iG({thread:e}){let t=Y(e=>e.deleteThread),n=Y(e=>e.setResolved),r=Y(t=>t.replyTo===e.id),i=Y(e=>e.openReply),a=Y(e=>e.closeReply),o=Y(e=>e.editingId),s=Y(e=>e.setEditingId),c=Y(t=>t.focusedThread===e.id),l=Y(e=>e.exportToGithub),u=Y(e=>e.github.data?.reason===null),[d,f]=(0,p.useState)(!1),[m,h]=(0,p.useState)(null),_=TU(()=>void t(e.id)),v=TU(()=>{f(!0),l([e.id]).then(h).finally(()=>f(!1))});(0,p.useEffect)(()=>{if(!m)return;let e=setTimeout(()=>h(null),2e3);return()=>clearTimeout(e)},[m]);let y=e.messages.length===1?e.messages[0]:null,b=y!=null&&o===y.id,x=e.anchor,S=x.startLine===x.endLine?`${x.startLine}`:`${x.startLine}–${x.endLine}`;return(0,g.jsxs)(`div`,{className:mj(`mx-2 my-1 overflow-hidden rounded-md border border-border bg-card p-0 font-sans text-[0.8125rem] shadow-card [&_.markdown]:[word-break:break-word] ${e.stale?`border-dashed`:``} ${e.resolved?`opacity-70`:``} ${c?`border-accent shadow-[0_0_0_1px_var(--accent),_var(--review-card-shadow)]`:``}`),children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-b-border bg-hover py-1 pr-1.5 pl-2.5 text-[0.75rem] text-muted [&>svg]:flex-none [&>svg]:text-accent`,children:[(0,g.jsx)(rM,{size:`0.8125rem`}),(0,g.jsxs)(`span`,{className:`font-mono font-semibold text-foreground`,children:[x.side===`old`?`removed `:``,`L`,S]}),e.stale&&(0,g.jsxs)(`span`,{className:`inline-flex items-center gap-0.75 text-warn`,title:`Not found in the current diff: the text changed or left the changed lines`,children:[(0,g.jsx)(bM,{size:`0.75rem`}),` stale`]}),e.resolved&&(0,g.jsxs)(`span`,{className:`inline-flex items-center gap-0.75 text-add`,children:[(0,g.jsx)(Oj,{size:`0.75rem`}),` resolved`]}),(0,g.jsx)(`span`,{className:`flex-1`}),y&&(0,g.jsx)(oG,{threadId:e.id,messageId:y.id,size:`0.875rem`}),y&&(0,g.jsx)(wM,{variant:`ghost`,icon:!0,onClick:()=>s(b?null:y.id),title:b?`Cancel`:`Edit (e)`,children:b?(0,g.jsx)(SM,{size:`0.875rem`}):(0,g.jsx)(lM,{size:`0.875rem`})}),u&&(0,g.jsxs)(wM,{variant:`ghost`,icon:!v.armed&&!m,feedback:v.armed?`confirm`:m?`posted`:void 0,disabled:d||e.stale,onClick:v.fire,title:e.stale?`Stale threads cannot be added to a GitHub review`:v.armed?`Click again to add this thread to the pending review`:`Add this thread to a pending review on the GitHub pull request; you submit it on GitHub`,children:[m?(0,g.jsx)(Oj,{size:`0.875rem`}):(0,g.jsx)(Zj,{size:`0.875rem`}),v.armed?`Add?`:m?aN(m):null]}),(0,g.jsx)(wM,{variant:`ghost`,icon:!0,onClick:()=>r?a():i(e.id),title:r?`Cancel reply`:`Reply`,children:r?(0,g.jsx)(SM,{size:`0.875rem`}):(0,g.jsx)(dM,{size:`0.875rem`})}),(0,g.jsx)(wM,{variant:`ghost`,icon:!0,onClick:()=>void n(e.id,!e.resolved),title:e.resolved?`Reopen (R)`:`Resolve (R)`,children:e.resolved?(0,g.jsx)(pM,{size:`0.875rem`}):(0,g.jsx)(Oj,{size:`0.875rem`})}),(0,g.jsxs)(wM,{variant:`ghost`,danger:!0,icon:!_.armed,feedback:_.armed?`confirm`:void 0,onClick:_.fire,title:_.armed?`Click again to delete this thread`:`Delete thread (dd)`,children:[(0,g.jsx)(yM,{size:`0.875rem`}),_.armed&&`Delete?`]})]}),e.messages.map((t,n)=>(0,g.jsx)(aG,{thread:e,message:t,first:n===0},t.id)),r&&(0,g.jsx)(sG,{threadId:e.id})]})}function aG({thread:e,message:t,first:n}){let r=Y(e=>e.editMessage),i=Y(e=>e.deleteMessage),a=Y(e=>e.editingId===t.id),o=Y(e=>e.setEditingId),[s,c]=(0,p.useState)(t.body),l=TU(()=>void i(e.id,t.id));(0,p.useEffect)(()=>{a&&c(t.body)},[a,t.body]);let u=e.messages.length>1,d=()=>{r(e.id,t.id,s),o(null)};return(0,g.jsxs)(`div`,{className:`px-2.5 py-2 data-[first=false]:border-t data-[first=false]:border-border`,"data-first":n,children:[u&&(0,g.jsxs)(`div`,{className:`mb-[2px] flex items-center gap-1.5 text-[0.6875rem] text-muted`,children:[(0,g.jsx)(`span`,{className:`flex-1`}),(0,g.jsx)(oG,{threadId:e.id,messageId:t.id,size:`0.75rem`}),(0,g.jsx)(wM,{variant:`ghost`,icon:!0,onClick:()=>o(a?null:t.id),title:a?`Cancel`:`Edit (e)`,children:a?(0,g.jsx)(SM,{size:`0.75rem`}):(0,g.jsx)(lM,{size:`0.75rem`})}),!n&&(0,g.jsxs)(wM,{variant:`ghost`,danger:!0,icon:!l.armed,feedback:l.armed?`confirm`:void 0,onClick:l.fire,title:l.armed?`Click again to delete this reply`:`Delete this reply`,children:[(0,g.jsx)(yM,{size:`0.75rem`}),l.armed&&`Delete?`]})]}),a?(0,g.jsxs)(`div`,{className:`rounded-md border-0 bg-surface p-0`,children:[(0,g.jsx)(`textarea`,{className:`min-h-17.5 w-full resize-y rounded-sm border border-border bg-canvas p-1.5 font-mono text-[0.75rem] leading-[1.5]`,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Escape`&&o(null),e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&d()},autoFocus:!0}),(0,g.jsx)(`div`,{className:`mt-1.5 flex items-center justify-end gap-1.5`,children:(0,g.jsx)(wM,{variant:`primary`,onClick:d,children:`Save`})})]}):(0,g.jsx)(vU,{text:t.body,path:e.anchor.path})]})}function oG({threadId:e,messageId:t,size:n}){let r=Y(e=>e.flash),i=Y(e=>e.report),[a,o]=(0,p.useState)(!1),s=(0,p.useRef)(null);return(0,p.useEffect)(()=>()=>void(s.current&&clearTimeout(s.current)),[]),(0,g.jsx)(wM,{variant:`ghost`,icon:!0,feedback:a?`copied`:void 0,className:`relative [transition:background_160ms_ease,_color_160ms_ease,_border-color_160ms_ease]`,title:`Copy this comment as a prompt`,onClick:async()=>{let n;try{n=await Vk.exportComment(e,t)}catch(e){i(`Copying comment`,e);return}if(!await TM(n))return r(`The browser blocked clipboard access`);o(!0),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>o(!1),1400)},children:(0,g.jsx)(CM,{done:a,size:n,children:(0,g.jsx)(Rj,{size:n})})})}function sG({threadId:e}){let t=Y(e=>e.submitReply),n=Y(e=>e.closeReply),[r,i]=(0,p.useState)(``),[a,o]=(0,p.useState)(!1),s=(0,p.useRef)(null);(0,p.useEffect)(()=>{s.current?.focus()},[]);let c=async()=>{if(!(!r.trim()||a)){o(!0);try{await t(e,r)}finally{o(!1)}}};return(0,g.jsxs)(`div`,{className:`mx-2.5 mt-0 mb-2.5 rounded-md border border-accent bg-surface p-2`,children:[(0,g.jsx)(`textarea`,{className:`min-h-17.5 w-full resize-y rounded-sm border border-border bg-canvas p-1.5 font-mono text-[0.75rem] leading-[1.5]`,ref:s,value:r,placeholder:`Reply…`,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Escape`&&n(),e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&c()}}),(0,g.jsxs)(`div`,{className:`mt-1.5 flex items-center justify-end gap-1.5`,children:[(0,g.jsxs)(`span`,{className:`mr-auto text-[0.75rem] text-muted`,children:[(0,g.jsx)(`kbd`,{children:`⌘/Ctrl`}),`+`,(0,g.jsx)(`kbd`,{children:`Enter`}),` to send · `,(0,g.jsx)(`kbd`,{children:`Esc`}),` to cancel`]}),(0,g.jsx)(wM,{onClick:n,children:`Cancel`}),(0,g.jsx)(wM,{variant:`primary`,onClick:()=>void c(),disabled:!r.trim()||a,children:`Reply`})]})]})}function cG({lines:e}){let t=Y(e=>e.submitDraft),n=Y(e=>e.closeDraft),r=Y(e=>e.draftQuote),[i,a]=(0,p.useState)(``),[o,s]=(0,p.useState)(!1),c=(0,p.useRef)(null);(0,p.useLayoutEffect)(()=>{let e=c.current;if(!e)return;e.style.height=`auto`;let t=getComputedStyle(e),n=parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth);e.style.height=`${e.scrollHeight+n}px`},[i]),(0,p.useEffect)(()=>{c.current?.focus()},[]);let l=async()=>{if(!(!i.trim()||o)){s(!0);try{await t(i)}finally{s(!1)}}},u=async()=>{let e=`\`\`\`suggestion\n${await r()}\n\`\`\``;a(t=>t.trim()?`${t.replace(/\s+$/,``)}\n\n${e}\n`:`${e}\n`),c.current?.focus()};return(0,g.jsxs)(`div`,{className:`mx-2 my-1 rounded-md border border-accent bg-surface p-2 font-sans text-[0.8125rem]`,children:[(0,g.jsx)(`textarea`,{className:`max-h-[60vh] min-h-17.5 w-full resize-y rounded-sm border border-border bg-canvas p-1.5 font-mono text-[0.75rem] leading-[1.5]`,ref:c,value:i,placeholder:`Comment on ${e}…`,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Escape`&&n(),e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&l()}}),(0,g.jsxs)(`div`,{className:`mt-1.5 flex items-center justify-end gap-1.5`,children:[(0,g.jsxs)(`span`,{className:`mr-auto text-[0.75rem] text-muted`,children:[(0,g.jsx)(`kbd`,{children:`⌘/Ctrl`}),`+`,(0,g.jsx)(`kbd`,{children:`Enter`}),` to save · `,(0,g.jsx)(`kbd`,{children:`Esc`}),` to cancel`]}),(0,g.jsxs)(wM,{variant:`ghost`,onClick:()=>void u(),title:`Insert the selected lines as a suggestion block to edit`,children:[(0,g.jsx)(Gj,{size:`0.8125rem`}),` Suggest change`]}),(0,g.jsx)(wM,{onClick:n,children:`Cancel`}),(0,g.jsx)(wM,{variant:`primary`,onClick:()=>void l(),disabled:!i.trim()||o,children:`Comment`})]})]})}var lG=.5;async function uG(e){let t=e.name,n=e.prevName??t,{loadFile:r}=Y.getState(),[i,a]=await Promise.all([r(n,`old`).catch(()=>null),r(t,`new`).catch(()=>null)]);if(!a)throw Error(`cannot load ${t}`);let o={name:t,contents:a.contents,cacheKey:`${t}@new@${Date.now()}`};return i?{oldFile:{name:n,contents:i.contents,cacheKey:`${n}@old@${Date.now()}`},newFile:o}:{oldFile:null,newFile:o}}var dG=`
1647
+ `,edge:t(3)}}function YW(e,t,n=0){return t.top<e.top+n?t.top-(e.top+n):t.bottom>e.bottom?t.bottom-e.bottom:0}function XW(){let e=X(e=>e.references),t=X(e=>e.theme),n=X(e=>e.closeReferences),r=X(e=>e.pickReference),i=(0,p.useRef)(null),a=(0,p.useMemo)(()=>e.items.map(e=>({...e,text:e.text.trim()})),[e.items]),o=yU(a,t,e.index),s=(0,p.useMemo)(()=>{let e=[];return a.forEach((t,n)=>{let r=e[e.length-1];r&&r.path===t.path?r.rows.push({i:n,line:t.line,text:t.text}):e.push({path:t.path,rows:[{i:n,line:t.line,text:t.text}]})}),e},[a]),c=(0,p.useCallback)(e=>{X.setState(t=>({references:{...t.references,index:e}})),r()},[r]);return(0,p.useEffect)(()=>{let e=i.current,t=e?.querySelector(`[data-active="true"]`);if(!e||!t)return;let n=t.parentElement?.querySelector(`header`),r=e.getBoundingClientRect(),a=n?n.getBoundingClientRect().bottom+(parseFloat(getComputedStyle(n).marginBottom)||0)-r.top:0;e.scrollTop+=YW(r,t.getBoundingClientRect(),Math.max(0,a))},[e.index,e.open]),e.open?(0,g.jsxs)(gj,{label:`References`,onClose:n,className:`flex max-h-[80vh] w-[min(60rem,_92vw)] flex-col overflow-hidden p-0`,children:[(0,g.jsxs)(`div`,{className:`flex items-baseline gap-3.5 border-b border-b-border px-4.5 pt-3.5 pb-2.5`,children:[(0,g.jsx)(`h3`,{className:`m-0 text-[0.9375rem]`,children:e.kind===`types`?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`code`,{className:`rounded-[0.3125rem] bg-hover px-1.5 py-[1px] font-mono text-foreground`,children:e.symbol}),` `,`has `,a.length,` types in its signature; pick one`]}):(0,g.jsxs)(g.Fragment,{children:[a.length,` reference`,a.length===1?``:`s`,` to`,` `,(0,g.jsx)(`code`,{className:`rounded-[0.3125rem] bg-hover px-1.5 py-[1px] font-mono text-foreground`,children:e.symbol})]})}),(0,g.jsxs)(`span`,{className:`ml-auto text-[0.6875rem] whitespace-nowrap text-muted`,children:[(0,g.jsx)(`kbd`,{children:`j`}),` `,(0,g.jsx)(`kbd`,{children:`k`}),` move · `,(0,g.jsx)(`kbd`,{children:`Enter`}),` jump · `,(0,g.jsx)(`kbd`,{children:`Esc`}),` close`]})]}),(0,g.jsx)(`div`,{className:`overflow-auto px-2.5 pt-2 pb-3`,ref:i,children:s.map(t=>(0,g.jsxs)(`section`,{className:`[&+section]:mt-2.5`,children:[(0,g.jsxs)(`header`,{className:`sticky top-0 z-1 mb-[2px] flex items-center gap-2 rounded-lg border border-border bg-hover px-2.5 py-1.5 font-mono text-[0.75rem] leading-[normal] [&>svg]:flex-none [&>svg]:text-muted`,children:[(0,g.jsx)(Gj,{size:`0.875rem`}),(0,g.jsx)(uP,{path:t.path,nowrap:!0,className:`flex-1`}),(0,g.jsx)(`span`,{className:`ml-auto rounded-[0.625rem] border border-border bg-canvas px-1.75 py-0 text-[0.6875rem] text-muted`,children:t.rows.length})]}),t.rows.map(n=>(0,g.jsx)(ZW,{row:n,on:n.i===e.index,tokens:o.get(`${t.path}\n${n.text}`),onPick:c},`${n.line}:${n.i}`))]},t.path))})]}):null}var ZW=(0,p.memo)(function({row:e,on:t,tokens:n,onPick:r}){return(0,g.jsxs)(`div`,{"data-active":t,className:hj(`grid cursor-pointer grid-cols-[3.25rem_1fr] gap-3 rounded-md px-2.5 py-0.75 font-mono text-[0.75rem] leading-[1.6] hover:bg-surface ${t?`bg-hover hover:bg-hover`:``}`),onMouseDown:e=>e.preventDefault(),onClick:()=>r(e.i),children:[(0,g.jsx)(`span`,{className:`text-right text-muted`,children:e.line}),(0,g.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-pre`,children:(0,g.jsx)(xU,{tokens:n,fallback:e.text})})]})});function QW(){let e=X(e=>e.symbolMenu),t=X(e=>e.theme),n=X(e=>e.closeSymbolMenu),r=X(e=>e.goToDefinition),i=X(e=>e.goToTypeDefinition),a=X(e=>e.findReferences),o=yU((0,p.useMemo)(()=>e?[{path:e.target.path,text:e.target.text}]:[],[e]),t);if((0,p.useEffect)(()=>{if(!e)return;let t=e=>{e.composedPath().some(e=>e instanceof HTMLElement&&e.hasAttribute(`data-symbol-menu`))||n()};return document.addEventListener(`pointerdown`,t,!0),document.addEventListener(`scroll`,n,!0),()=>{document.removeEventListener(`pointerdown`,t,!0),document.removeEventListener(`scroll`,n,!0)}},[e,n]),!e)return null;let s=iW(),c=28.75*s,l=2.75*s,u=Math.max(8,Math.min(e.x,window.innerWidth-c-8)),d=e.y+l<window.innerHeight?{left:u,top:e.y+12}:{left:u,top:e.y-l};return(0,g.jsxs)(`div`,{className:`fixed z-40 flex gap-[2px] rounded-lg border border-border bg-canvas p-0.75 shadow-[0_0.5rem_1.5rem_rgba(0,_0,_0,_0.18)]`,style:d,role:`menu`,"data-symbol-menu":!0,children:[(0,g.jsxs)(Y,{className:`flex cursor-pointer items-center gap-1.5 rounded-md border-0 bg-transparent px-2 py-1 font-sans text-[0.75rem] leading-[normal] text-foreground hover:bg-hover`,onClick:()=>void r(e.target),title:`Go to definition (gd)`,children:[(0,g.jsx)(Bj,{size:`0.8125rem`}),` Definition `,(0,g.jsx)(`kbd`,{className:`ml-[2px]`,children:`gd`})]}),(0,g.jsxs)(Y,{className:`flex cursor-pointer items-center gap-1.5 rounded-md border-0 bg-transparent px-2 py-1 font-sans text-[0.75rem] leading-[normal] text-foreground hover:bg-hover`,onClick:()=>void a(e.target),title:`Find references (gA)`,children:[(0,g.jsx)(rM,{size:`0.8125rem`}),` References `,(0,g.jsx)(`kbd`,{className:`ml-[2px]`,children:`gA`})]}),(0,g.jsxs)(Y,{className:`flex cursor-pointer items-center gap-1.5 rounded-md border-0 bg-transparent px-2 py-1 font-sans text-[0.75rem] leading-[normal] text-foreground hover:bg-hover`,onClick:()=>void i(e.target),title:`Go to type definition (gy)`,children:[(0,g.jsx)(bM,{size:`0.8125rem`}),` Type `,(0,g.jsx)(`kbd`,{className:`ml-[2px]`,children:`gy`})]}),(0,g.jsx)(`span`,{className:`ml-1 max-w-55 self-center truncate border-l border-l-border px-2 py-0.75 font-mono text-[0.75rem] leading-[normal] text-foreground`,title:e.target.text,children:(0,g.jsx)(xU,{tokens:o.get(`${e.target.path}\n${e.target.text}`),fallback:e.target.text})})]})}var $W={1:`file`,2:`module`,3:`namespace`,4:`package`,5:`class`,6:`method`,7:`property`,8:`field`,9:`ctor`,10:`enum`,11:`interface`,12:`function`,13:`variable`,14:`constant`,15:`string`,16:`number`,17:`boolean`,18:`array`,19:`object`,20:`key`,21:`null`,22:`member`,23:`struct`,24:`event`,25:`operator`,26:`type param`};function eG(e){return[5,10,11,23,26].includes(e)?`type`:[6,9,12].includes(e)?`callable`:[7,8,13,14,20,22,24].includes(e)?`value`:e<=4?`scope`:`other`}function tG(){let e=X(e=>e.symbols),t=X(e=>e.querySymbols),n=X(e=>e.moveSymbol),r=X(e=>e.pickSymbol),i=X(e=>e.closeSymbols),[a,o]=(0,p.useState)(``),s=(0,p.useRef)(null),c=(0,p.useRef)(null);if((0,p.useEffect)(()=>{e.open&&(o(``),s.current?.focus())},[e.open,e.scope]),(0,p.useEffect)(()=>{c.current?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`})},[e.index]),!e.open)return null;let l=e=>{o(e),t(e)},u=e=>{let t=e.key===`ArrowDown`||e.ctrlKey&&e.key===`n`,i=e.key===`ArrowUp`||e.ctrlKey&&e.key===`p`;t||i?(e.preventDefault(),n(t?1:-1)):e.key===`Enter`&&(e.preventDefault(),r())},d=e.scope===`document`?`Symbols in ${e.path??`file`}…`:`Search symbols across the repository…`,f={type:`text-kind-type`,callable:`text-kind-callable`,value:`text-kind-value`,scope:`text-muted`,other:`text-muted`},m=e.loading?`loading…`:e.items.length?`${e.index+1} / ${e.items.length}`:``;return(0,g.jsxs)(`div`,{className:`absolute top-0 right-0 left-0 z-30 flex max-h-[60%] flex-col border-b border-b-border bg-surface shadow-[0_0.625rem_1.875rem_rgba(0,_0,_0,_0.18)]`,role:`dialog`,"aria-label":`Symbols`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-b-border bg-surface px-2.5 py-1.5`,children:[(0,g.jsx)(eM,{size:`0.875rem`}),(0,g.jsx)(`input`,{className:`flex-1 rounded-md border border-border bg-canvas px-2 py-1 font-mono text-[0.75rem]`,ref:s,value:a,onChange:e=>l(e.target.value),onKeyDown:u,placeholder:d,spellCheck:!1}),(0,g.jsx)(`span`,{className:`min-w-17.5 text-right font-mono text-[0.75rem] leading-[normal] text-muted`,children:m}),(0,g.jsx)(Y,{type:`button`,variant:`ghost`,icon:!0,onClick:i,title:`Close (Esc)`,children:(0,g.jsx)(TM,{size:`0.875rem`})})]}),e.items.length>0?(0,g.jsx)(`ul`,{role:`listbox`,"aria-label":`Symbols`,className:`m-0 list-none overflow-auto p-1`,ref:c,children:e.items.map((t,n)=>(0,g.jsxs)(`li`,{role:`option`,"aria-selected":n===e.index,className:hj(`grid cursor-pointer grid-cols-[4rem_1fr_auto] items-baseline gap-2.5 rounded-md px-2 py-1 font-mono text-[0.75rem] leading-[normal]`,n===e.index?`bg-hover`:``),onMouseDown:e=>e.preventDefault(),onClick:()=>{X.setState(e=>({symbols:{...e.symbols,index:n}})),r()},children:[(0,g.jsx)(`span`,{className:hj(`text-[0.6875rem] text-muted lowercase ${f[eG(t.kind)]}`),children:$W[t.kind]??`symbol`}),(0,g.jsxs)(`span`,{children:[t.name,t.container&&(0,g.jsxs)(`span`,{className:`text-muted`,children:[` · `,t.container]})]}),(0,g.jsxs)(`span`,{className:`text-[0.6875rem] whitespace-nowrap text-muted`,children:[e.scope===`workspace`&&(0,g.jsx)(uP,{path:t.path,nowrap:!0}),e.scope===`workspace`?`:`:``,t.line]})]},`${t.path}:${t.line}:${t.col}:${t.name}`))}):(0,g.jsx)(`div`,{className:`p-3`,children:e.loading?``:e.scope===`workspace`&&!a.trim()?`Type to search`:`No symbols`})]})}var nG=`diffle-search`,rG=`diffle-search-current`;function iG(e){if(!e.open||!e.query||e.matches.length===0)return null;let t=e.query.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);try{if(e.kind===`word`)return RegExp(`(?<![\\p{L}\\p{N}_])${t}(?![\\p{L}\\p{N}_])`,`gu`);if(e.kind===`text`)return new RegExp(e.regex?e.query:t,e.ignoreCase?`gi`:`g`)}catch{return null}return null}function aG(e,t){let n=[],r=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),i=``,a=[];for(let e=r.nextNode();e;e=r.nextNode())n.push(e),a.push(i.length),i+=e.data;if(!i)return[];let o=[];t.lastIndex=0;for(let r=t.exec(i);r;r=t.exec(i)){if(r[0].length===0){t.lastIndex++;continue}let i=e.ownerDocument.createRange(),[s,c]=oG(n,a,r.index),[l,u]=oG(n,a,r.index+r[0].length,!0);i.setStart(s,c),i.setEnd(l,u),o.push(i)}return o}function oG(e,t,n,r=!1){let i=t.length-1;for(;i>0&&(r?t[i]>=n:t[i]>n);)i--;return[e[i],n-t[i]]}var sG=class{scan;key=``;rows=new WeakMap;constructor(e=aG){this.scan=e}rangesFor(e,t){let n=`${t.flags}/${t.source}`;n!==this.key&&(this.key=n,this.rows=new WeakMap);let r=this.rows.get(e);return r||(r=this.scan(e,t),this.rows.set(e,r)),r}invalidate(e){let t=(e instanceof Element?e:e.parentElement)?.closest(`[data-line]`);t&&this.rows.delete(t)}},cG=()=>typeof CSS<`u`&&`highlights`in CSS&&typeof Highlight<`u`;function lG(e,t){if(!cG())return()=>{};let n=new sG,r=VU(e,t,e=>X.subscribe((t,n)=>{(t.search!==n.search||t.loaded!==n.loaded||t.collapsed!==n.collapsed)&&e()}),e=>{let t=X.getState().search,r=iG(t);if(!r){CSS.highlights.delete(nG),CSS.highlights.delete(rG);return}let i=t.matches[t.index],a=[],o=[];for(let{id:t,root:s}of e){let e=VM(t);for(let t of s.querySelectorAll(`[data-line]`)){if(RU(t))continue;let s=i!=null&&i.path===e&&Number(t.dataset.line)===i.line;for(let e of n.rangesFor(t,r))(s?o:a).push(e)}}CSS.highlights.set(nG,new Highlight(...a)),CSS.highlights.set(rG,new Highlight(...o))},e=>{for(let t of e)n.invalidate(t.target)});return()=>{r(),CSS.highlights.delete(nG),CSS.highlights.delete(rG)}}var uG=`data-comment-line`;function dG(e,t){for(let n of e.querySelectorAll(`code`)){let[e,r]=n.children;if(!(!e||!r))for(let n=0;n<r.children.length;n++){let i=r.children[n];if(!(i instanceof HTMLElement)||i.dataset.line==null)continue;let a=Number(i.dataset.line),o=RU(i)?`old`:`new`,s=t.some(e=>e.side===o&&a>=e.startLine&&a<=e.endLine);i.toggleAttribute(uG,s),e.children[n]?.toggleAttribute(uG,s)}}}function fG(e,t){let n=tN(e).map(e=>e.anchor).filter(e=>e.kind===`line`&&e.path===t),r=e.draft?.path===t?aN(e):null;return r&&n.push(r),n}function pG(e,t){return VU(e,t,e=>X.subscribe((t,n)=>{(t.threads!==n.threads||t.showResolved!==n.showResolved||t.draft!==n.draft||t.loaded!==n.loaded||t.collapsed!==n.collapsed)&&e()}),e=>{let t=X.getState();for(let{id:n,root:r}of e)dG(r,fG(t,VM(n)))})}function mG({thread:e}){let t=X(e=>e.deleteThread),n=X(e=>e.setResolved),r=X(t=>t.replyTo===e.id),i=X(e=>e.openReply),a=X(e=>e.closeReply),o=X(e=>e.editingId),s=X(e=>e.setEditingId),c=X(t=>t.focusedThread===e.id),l=X(e=>e.exportToGithub),u=X(e=>e.github.data?.reason===null),[d,f]=(0,p.useState)(!1),[m,h]=(0,p.useState)(null),_=kU(()=>void t(e.id)),v=kU(()=>{f(!0),l([e.id]).then(h).finally(()=>f(!1))});(0,p.useEffect)(()=>{if(!m)return;let e=setTimeout(()=>h(null),2e3);return()=>clearTimeout(e)},[m]);let y=e.messages.length===1?e.messages[0]:null,b=y!=null&&o===y.id,x=e.anchor;return(0,g.jsxs)(`div`,{className:hj(`mx-2 my-1 overflow-hidden rounded-md border border-border bg-card p-0 font-sans text-[0.8125rem] shadow-card [&_.markdown]:[word-break:break-word] ${e.stale?`border-dashed`:``} ${e.resolved?`opacity-70`:``} ${c?`border-accent shadow-[0_0_0_1px_var(--accent),_var(--review-card-shadow)]`:``}`),children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-b-border bg-hover py-1 pr-1.5 pl-2.5 text-[0.75rem] text-muted [&>svg]:flex-none [&>svg]:text-accent`,children:[(0,g.jsx)(oM,{size:`0.8125rem`}),(0,g.jsx)(`span`,{className:`font-mono font-semibold text-foreground`,children:nN(x)}),e.stale&&(0,g.jsxs)(`span`,{className:`inline-flex items-center gap-0.75 text-warn`,title:x.kind===`file`?`Not in the current diff: the file left the review`:`Not found in the current diff: the text changed or left the changed lines`,children:[(0,g.jsx)(CM,{size:`0.75rem`}),` stale`]}),e.resolved&&(0,g.jsxs)(`span`,{className:`inline-flex items-center gap-0.75 text-add`,children:[(0,g.jsx)(kj,{size:`0.75rem`}),` resolved`]}),(0,g.jsx)(`span`,{className:`flex-1`}),y&&(0,g.jsx)(gG,{threadId:e.id,messageId:y.id,size:`0.875rem`}),y&&(0,g.jsx)(Y,{variant:`ghost`,icon:!0,onClick:()=>s(b?null:y.id),title:b?`Cancel`:`Edit (e)`,children:b?(0,g.jsx)(TM,{size:`0.875rem`}):(0,g.jsx)(fM,{size:`0.875rem`})}),u&&(0,g.jsxs)(Y,{variant:`ghost`,icon:!v.armed&&!m,feedback:v.armed?`confirm`:m?`posted`:void 0,disabled:d||e.stale,onClick:v.fire,title:e.stale?`Stale threads cannot be added to a GitHub review`:v.armed?`Click again to add this thread to the pending review`:`Add this thread to a pending review on the GitHub pull request; you submit it on GitHub`,children:[m?(0,g.jsx)(kj,{size:`0.875rem`}):(0,g.jsx)(Qj,{size:`0.875rem`}),v.armed?`Add?`:m?hN(m):null]}),(0,g.jsx)(Y,{variant:`ghost`,icon:!0,onClick:()=>r?a():i(e.id),title:r?`Cancel reply`:`Reply`,children:r?(0,g.jsx)(TM,{size:`0.875rem`}):(0,g.jsx)(mM,{size:`0.875rem`})}),(0,g.jsx)(Y,{variant:`ghost`,icon:!0,onClick:()=>void n(e.id,!e.resolved),title:e.resolved?`Reopen (R)`:`Resolve (R)`,children:e.resolved?(0,g.jsx)(gM,{size:`0.875rem`}):(0,g.jsx)(kj,{size:`0.875rem`})}),(0,g.jsxs)(Y,{variant:`ghost`,danger:!0,icon:!_.armed,feedback:_.armed?`confirm`:void 0,onClick:_.fire,title:_.armed?`Click again to delete this thread`:`Delete thread (dd)`,children:[(0,g.jsx)(SM,{size:`0.875rem`}),_.armed&&`Delete?`]})]}),e.messages.map((t,n)=>(0,g.jsx)(hG,{thread:e,message:t,first:n===0},t.id)),r&&(0,g.jsx)(_G,{threadId:e.id})]})}function hG({thread:e,message:t,first:n}){let r=X(e=>e.editMessage),i=X(e=>e.deleteMessage),a=X(e=>e.editingId===t.id),o=X(e=>e.setEditingId),[s,c]=(0,p.useState)(t.body),l=kU(()=>void i(e.id,t.id));(0,p.useEffect)(()=>{a&&c(t.body)},[a,t.body]);let u=e.messages.length>1,d=()=>{r(e.id,t.id,s),o(null)};return(0,g.jsxs)(`div`,{className:`px-2.5 py-2 data-[first=false]:border-t data-[first=false]:border-border`,"data-first":n,children:[u&&(0,g.jsxs)(`div`,{className:`mb-[2px] flex items-center gap-1.5 text-[0.6875rem] text-muted`,children:[(0,g.jsx)(`span`,{className:`flex-1`}),(0,g.jsx)(gG,{threadId:e.id,messageId:t.id,size:`0.75rem`}),(0,g.jsx)(Y,{variant:`ghost`,icon:!0,onClick:()=>o(a?null:t.id),title:a?`Cancel`:`Edit (e)`,children:a?(0,g.jsx)(TM,{size:`0.75rem`}):(0,g.jsx)(fM,{size:`0.75rem`})}),!n&&(0,g.jsxs)(Y,{variant:`ghost`,danger:!0,icon:!l.armed,feedback:l.armed?`confirm`:void 0,onClick:l.fire,title:l.armed?`Click again to delete this reply`:`Delete this reply`,children:[(0,g.jsx)(SM,{size:`0.75rem`}),l.armed&&`Delete?`]})]}),a?(0,g.jsxs)(`div`,{className:`rounded-md border-0 bg-surface p-0`,children:[(0,g.jsx)(`textarea`,{className:`min-h-17.5 w-full resize-y rounded-sm border border-border bg-canvas p-1.5 font-mono text-[0.75rem] leading-[1.5]`,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Escape`&&o(null),e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&d()},autoFocus:!0}),(0,g.jsx)(`div`,{className:`mt-1.5 flex items-center justify-end gap-1.5`,children:(0,g.jsx)(Y,{variant:`primary`,onClick:d,children:`Save`})})]}):(0,g.jsx)(SU,{text:t.body,path:e.anchor.path})]})}function gG({threadId:e,messageId:t,size:n}){let r=X(e=>e.flash),i=X(e=>e.report),[a,o]=(0,p.useState)(!1),s=(0,p.useRef)(null);return(0,p.useEffect)(()=>()=>void(s.current&&clearTimeout(s.current)),[]),(0,g.jsx)(Y,{variant:`ghost`,icon:!0,feedback:a?`copied`:void 0,className:`relative [transition:background_160ms_ease,_color_160ms_ease,_border-color_160ms_ease]`,title:`Copy this comment as a prompt`,onClick:async()=>{let n;try{n=await Hk.exportComment(e,t)}catch(e){i(`Copying comment`,e);return}if(!await DM(n))return r(`The browser blocked clipboard access`);o(!0),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>o(!1),1400)},children:(0,g.jsx)(EM,{done:a,size:n,children:(0,g.jsx)(zj,{size:n})})})}function _G({threadId:e}){let t=X(e=>e.submitReply),n=X(e=>e.closeReply),[r,i]=(0,p.useState)(``),[a,o]=(0,p.useState)(!1),s=(0,p.useRef)(null);(0,p.useEffect)(()=>{s.current?.focus()},[]);let c=async()=>{if(!(!r.trim()||a)){o(!0);try{await t(e,r)}finally{o(!1)}}};return(0,g.jsxs)(`div`,{className:`mx-2.5 mt-0 mb-2.5 rounded-md border border-accent bg-surface p-2`,children:[(0,g.jsx)(`textarea`,{className:`min-h-17.5 w-full resize-y rounded-sm border border-border bg-canvas p-1.5 font-mono text-[0.75rem] leading-[1.5]`,ref:s,value:r,placeholder:`Reply…`,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Escape`&&n(),e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&c()}}),(0,g.jsxs)(`div`,{className:`mt-1.5 flex items-center justify-end gap-1.5`,children:[(0,g.jsxs)(`span`,{className:`mr-auto text-[0.75rem] text-muted`,children:[(0,g.jsx)(`kbd`,{children:`⌘/Ctrl`}),`+`,(0,g.jsx)(`kbd`,{children:`Enter`}),` to send · `,(0,g.jsx)(`kbd`,{children:`Esc`}),` to cancel`]}),(0,g.jsx)(Y,{onClick:n,children:`Cancel`}),(0,g.jsx)(Y,{variant:`primary`,onClick:()=>void c(),disabled:!r.trim()||a,children:`Reply`})]})]})}function vG({label:e}){let t=X(e=>e.submitDraft),n=X(e=>e.closeDraft),r=X(e=>e.draftQuote),i=X(e=>e.draft!=null&&e.draft.selection==null),[a,o]=(0,p.useState)(``),[s,c]=(0,p.useState)(!1),l=(0,p.useRef)(null);(0,p.useLayoutEffect)(()=>{let e=l.current;if(!e)return;e.style.height=`auto`;let t=getComputedStyle(e),n=parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth);e.style.height=`${e.scrollHeight+n}px`},[a]),(0,p.useEffect)(()=>{l.current?.focus()},[]);let u=async()=>{if(!(!a.trim()||s)){c(!0);try{await t(a)}finally{c(!1)}}},d=async()=>{let e=`\`\`\`suggestion\n${await r()}\n\`\`\``;o(t=>t.trim()?`${t.replace(/\s+$/,``)}\n\n${e}\n`:`${e}\n`),l.current?.focus()};return(0,g.jsxs)(`div`,{className:`mx-2 my-1 overflow-hidden rounded-md border border-accent bg-surface font-sans text-[0.8125rem]`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-b-border bg-hover px-2.5 py-1 text-[0.75rem] text-muted [&>svg]:flex-none [&>svg]:text-accent`,children:[(0,g.jsx)(oM,{size:`0.8125rem`}),(0,g.jsx)(`span`,{className:`font-mono font-semibold text-foreground`,children:e})]}),(0,g.jsxs)(`div`,{className:`p-2`,children:[(0,g.jsx)(`textarea`,{className:`max-h-[60vh] min-h-17.5 w-full resize-y rounded-sm border border-border bg-canvas p-1.5 font-mono text-[0.75rem] leading-[1.5]`,ref:l,value:a,placeholder:`Leave a comment…`,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Escape`&&n(),e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&u()}}),(0,g.jsxs)(`div`,{className:`mt-1.5 flex items-center justify-end gap-1.5`,children:[(0,g.jsxs)(`span`,{className:`mr-auto text-[0.75rem] text-muted`,children:[(0,g.jsx)(`kbd`,{children:`⌘/Ctrl`}),`+`,(0,g.jsx)(`kbd`,{children:`Enter`}),` to save · `,(0,g.jsx)(`kbd`,{children:`Esc`}),` to cancel`]}),!i&&(0,g.jsxs)(Y,{variant:`ghost`,onClick:()=>void d(),title:`Insert the selected lines as a suggestion block to edit`,children:[(0,g.jsx)(Kj,{size:`0.8125rem`}),` Suggest change`]}),(0,g.jsx)(Y,{onClick:n,children:`Cancel`}),(0,g.jsx)(Y,{variant:`primary`,onClick:()=>void u(),disabled:!a.trim()||s,children:`Comment`})]})]})]})}function yG(e){let t=e.getRootNode();if(t instanceof ShadowRoot)return t.host;for(let t=e.parentElement;t;t=t.parentElement)if(t.shadowRoot)return t;return null}var bG={binary:tM,empty:qj,oversized:qj,loading:iM,error:CM};function xG({kind:e,message:t}){let n=bG[e],r=(0,p.useRef)(null);return(0,p.useLayoutEffect)(()=>{let t=r.current&&yG(r.current);if(t)return t.setAttribute(`data-placeholder`,e),()=>t.removeAttribute(`data-placeholder`)},[e]),(0,g.jsxs)(`div`,{ref:r,className:`flex items-center gap-2 bg-hover px-4 py-2 text-[0.8125rem] ${e===`error`?`text-danger`:`text-muted`}`,"data-placeholder":e,children:[(0,g.jsx)(n,{size:`0.875rem`,className:e===`loading`?`animate-spin`:void 0}),(0,g.jsx)(`span`,{children:t})]})}var SG=.5;async function CG(e){let t=e.name,n=e.prevName??t,{loadFile:r}=X.getState(),[i,a]=await Promise.all([r(n,`old`).catch(()=>null),r(t,`new`).catch(()=>null)]);if(!a)throw Error(`cannot load ${t}`);let o={name:t,contents:a.contents,cacheKey:`${t}@new@${Date.now()}`};return i?{oldFile:{name:n,contents:i.contents,cacheKey:`${n}@old@${Date.now()}`},newFile:o}:{oldFile:null,newFile:o}}var wG=`
1646
1648
  [data-diffs-header] {
1647
1649
  --diffs-header-font-family: var(--mono);
1648
1650
  font-size: 0.75rem;
@@ -1693,9 +1695,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1693
1695
  /* Collapsed-context bars run edge to edge: inset rounded pills next to a full-width file header read as misaligned. */
1694
1696
  [data-separator='line-info'] [data-separator-wrapper] { padding-inline: 0 !important; margin-inline: 0 !important; }
1695
1697
  [data-separator='line-info'] :is([data-separator-wrapper], [data-separator-content], [data-expand-up], [data-expand-down], [data-expand-both]) { border-radius: 0 !important; }
1696
- /* Lines a saved comment refers to (see threadHighlights.ts): the selection tint, fainter, so the cursor's
1697
- own selection still stands out on top of it. Feeds the library's line-background chain like its own rule. */
1698
- [data-thread-line]:not([data-selected-line]):is([data-line], [data-column-number]) {
1698
+ /* Lines a saved or draft comment refers to (see commentHighlights.ts): the selection tint, fainter, so the
1699
+ cursor's own selection still stands out on top of it. Feeds the library's line-background chain like its own rule. */
1700
+ [data-comment-line]:not([data-selected-line]):is([data-line], [data-column-number]) {
1699
1701
  --diffs-computed-selected-line-bg: light-dark(
1700
1702
  color-mix(in lab, var(--diffs-computed-diff-line-bg) 90%, var(--diffs-selection-base)),
1701
1703
  color-mix(in lab, var(--diffs-computed-diff-line-bg) 84%, var(--diffs-selection-base))
@@ -1703,7 +1705,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1703
1705
  }
1704
1706
  ::highlight(diffle-search) { background: var(--search-match); }
1705
1707
  ::highlight(diffle-search-current) { background: var(--search-current); color: var(--search-current-fg); }
1706
- `;function fG(e,t,n){let r=NM(t);if(!pG(r))return null;let i=MN(r),a=n==null?null:mG(e.tokenElement,n,i);if(n!=null&&!a)return null;let o=`side`in e&&e.side===`deletions`?`old`:`new`,s=e.lineNumber;if(o===`old`){let t=e.tokenElement.closest(`[data-line]`),n=t?.dataset.lineType?.startsWith(`context`)?Number(t.dataset.altLine):NaN;Number.isFinite(n)&&(o=`new`,s=n)}return a?{path:r,side:o,line:s,col:e.lineCharStart+a.start,text:a.text}:{path:r,side:o,line:s,col:e.lineCharStart,text:e.tokenText}}function pG(e){let t=Tk(e),{lsp:n}=Y.getState();return t!=null&&n.enabled&&n.servers.some(e=>e.languages.includes(t))}function mG(e,t,n=!1){let r=e.firstChild;if(!r||r.nodeType!==Node.TEXT_NODE||e.childNodes.length!==1)return null;let i=r.textContent??``,a=document.createRange(),o=-1;for(let e=0;e<i.length;e++){a.setStart(r,e),a.setEnd(r,e+1);let n=a.getBoundingClientRect();if(t>=n.left&&t<=n.right){o=e;break}}return n?o>=0&&/\S/.test(i[o])?{start:o,text:i}:null:IU(i).find(e=>o>=e.start&&o<e.start+e.text.length)??null}function hG(e,t){e.classList.toggle(`lsp-hover`,t)}var gG={theme:KN,loadDiffFiles:uG,stickyHeaders:!0,enableLineSelection:!0,useTokenTransformer:!0,lineHoverHighlight:`number`,overflow:`wrap`},_G={kind:`loading`};function vG(){let e=QU(),t=(0,p.useMemo)(()=>GW(e),[e]),n=Y(e=>e.snapshot),r=Y(e=>e.error),i=Y(e=>e.loaded),a=Y(e=>e.gens),o=Y(e=>e.fileView),s=Y(e=>e.threads),c=Y(e=>e.showResolved),l=Y(e=>e.replyTo),u=Y(e=>e.editingId),d=Y(e=>e.draft),f=Y(e=>e.collapsed),m=Y(e=>e.viewed),h=Y(e=>e.config),_=Y(e=>e.selection),v=Y(e=>e.setSelection),y=Y(e=>e.openDraft),b=Y(e=>e.goToDefinition),x=Y(e=>e.openSymbolMenu),S=Y(e=>e.scrollTarget),C=Y(e=>e.reveal),w=Y(e=>e.setActivePath),T=(0,p.useRef)(null),E=Y(e=>e.theme),D=Y(e=>e.diffStyle),O=(0,p.useRef)(new Map),k=(0,p.useMemo)(()=>{if(!n)return[];let e=new Map(n.changed.map(e=>[e.path,e])),t={collapsed:f,viewed:m,config:h,snapshot:n},r=new Map;for(let e of YM({threads:s,showResolved:c})){let t=r.get(e.anchor.path);t?t.push(e):r.set(e.anchor.path,[e])}let p=(e,t,n)=>{let r=$M(O.current.get(e),QM({draft:d,replyTo:l,editingId:u},e,t,n));return O.current.set(e,r),r.version};if(o){let{path:e,item:t}=o,n=r.get(e)??[],i=t&&bG(e,t,void 0,n,d,p(e,n,!1),a[e]??0,!1);return i?[i]:[]}let g=[];for(let o of LM(n)){let n=i[o]??_G,s=r.get(o)??[],c=JM(t,o),l=bG(o,n,e.get(o),s,d,p(o,s,c),a[o]??0,c);l&&g.push(l)}return g},[n,i,a,o,s,c,l,u,d,f,m,h]),[A,j]=(0,p.useState)(null),M=(0,p.useRef)(null),N=(0,p.useCallback)(e=>{M.current=e,j(e)},[]),P=(0,p.useRef)(!1),F=(0,p.useRef)(o);(F.current==null!=(o==null)||F.current?.path!==o?.path)&&(F.current=o,P.current=!0),(0,p.useEffect)(()=>{P.current=!1},[k]),(0,p.useEffect)(()=>(VU(()=>T.current),()=>VU(()=>null)),[]),(0,p.useEffect)(()=>{if(A)return $W(()=>T.current,A)},[A]),(0,p.useEffect)(()=>{if(A)return rG(()=>T.current,A)},[A]),(0,p.useEffect)(()=>{UU()},[_]);let I=(0,p.useRef)(!1);(0,p.useEffect)(()=>{if(!A)return;let e=0,n=()=>{if(e=0,I.current||Y.getState().selection)return;let n=T.current?.getInstance()?.getRenderedItems()??[],r=A.getBoundingClientRect(),i=t.itemMetrics.diffHeaderHeight,a=r.top+r.height*lG,o=n.map(e=>({id:e.id,rect:e.element.getBoundingClientRect()})).filter(e=>e.rect.bottom>r.top+i+1&&e.rect.top<r.bottom&&e.rect.height>0);if(o.length===0)return;let s=Y.getState(),c=NM((o.find(e=>NM(e.id)===s.activePath)??o.filter(e=>e.rect.top<=a).sort((e,t)=>t.rect.top-e.rect.top)[0]??o[0]).id);c!==s.activePath&&s.setActivePath(c)},r=()=>{e||=requestAnimationFrame(n)};return A.addEventListener(`scroll`,r,{passive:!0}),()=>{A.removeEventListener(`scroll`,r),e&&cancelAnimationFrame(e)}},[A,t]),(0,p.useEffect)(()=>{if(!C||!T.current)return;let e=T.current;e.scrollTo({type:`item`,id:C.id,align:`start`,behavior:`instant`});let t=0,n=!1,r=()=>{if(n)return;let i=e.getInstance()?.getRenderedItems().find(e=>e.id===C.id);if(i?.type===`diff`){i.instance.revealLine(C.line);let e=i.instance,t=C.line,r=C.line;for(;t>1&&C.line-t<1e4&&e.isLineRenderable(t-1);)t--;for(;r-t<1e4&&e.isLineRenderable(r+1);)r++;Y.getState().addRevealed(C.id,t,r),setTimeout(()=>{n||Y.setState(e=>({scrollTarget:{id:C.id,line:C.line,side:`new`,align:`eye`,nonce:(e.scrollTarget?.nonce??0)+1}}))},30);return}t++<40&&setTimeout(r,50)};return r(),()=>{n=!0}},[C]);let L=(0,p.useCallback)(e=>{let n=e.align??`center`,r=n===`eye`||n===`top`||n===`bottom`,i=M.current?.clientHeight??800,a=t.itemMetrics.diffHeaderHeight,o=t.edge,s=n===`eye`?i*lG-a:n===`top`?o:n===`bottom`?Math.max(o,i-a-o-t.itemMetrics.lineHeight):0,c=r?`start`:n;return{eye:r,offset:s,header:a,target:e.line?{type:`line`,id:e.id,lineNumber:e.line,side:e.side===`old`?`deletions`:`additions`,align:c,offset:s,behavior:r?`instant`:void 0}:{type:`item`,id:e.id,align:`start`,behavior:`instant`}}},[t]),ee=e=>{let t=T.current?.getInstance()?.getRenderedItems().find(t=>t.id===e.id),n=t?.element.shadowRoot??t?.element;return n&&e.line?PU(n,e.line,e.side??`new`):null},te=(0,p.useRef)(E),ne=(0,p.useRef)(S);(0,p.useLayoutEffect)(()=>{let e=P.current||te.current!==E,t=S!==ne.current;te.current=E,ne.current=S;let n=M.current;n&&(n.style.visibility=e&&t&&S?.line&&!ee(S)?`hidden`:``)},[S,E]),(0,p.useEffect)(()=>{if(!S||!T.current)return;let{eye:e,offset:n,header:r,target:i}=L(S),a=e&&S.line!=null;I.current=!0;let o,s=()=>{o=setTimeout(()=>{I.current=!1},150)},c=()=>{M.current&&(M.current.style.visibility=``)},l=()=>{let e=M.current;if(!e)return NaN;let a=e.getBoundingClientRect().top;if(i.type===`item`){let e=T.current?.getInstance()?.getRenderedItems().find(e=>e.id===S.id)?.element;return e?e.getBoundingClientRect().top-(a+t.layout.paddingTop):NaN}return(ee(S)?.getBoundingClientRect().top??NaN)-(a+n+r)},u=a||i.type===`item`,d=()=>{let e=M.current,t=ee(S);if(!e||!t)return NaN;let n=e.getBoundingClientRect(),i=t.getBoundingClientRect();return i.top<n.top+r?i.top-(n.top+r):i.bottom>n.bottom?i.bottom-n.bottom:0},f=()=>{let e=T.current,t=e?.getInstance();if(!e||!t||!e.getItem(S.id))return!1;if(e.scrollTo(i),t.render(!0),!u){let e=i.type===`line`?d():NaN;return!Number.isNaN(e)&&Math.abs(e)>1&&M.current&&(M.current.scrollTop+=e,t.render(!0)),!0}for(let n=0;n<4;n++){let n=l();if(Number.isNaN(n)){e.scrollTo(i),t.render(!0);continue}if(Math.abs(n)<=1)break;e.scrollTo({...i,offset:(i.offset??0)-n}),t.render(!0)}return!0},p=!1,m=0,h=()=>{setTimeout(()=>{if(p)return;let e=l();!Number.isNaN(e)&&Math.abs(e)>1&&M.current&&(M.current.scrollTop+=e),m++<2&&h()},100)},g=0,_=()=>{if(!p){if(!f()){g++<20?setTimeout(_,100):(c(),s());return}c(),s(),u&&h()}};return _(),()=>{p=!0,o&&clearTimeout(o)}},[S,t,L]);let R=(0,p.useCallback)(e=>{e==null&&P.current||(v(e),e&&w(NM(e.id)))},[v,w]),z=(0,p.useMemo)(()=>({...gG,unsafeCSS:dG+t.css,layout:t.layout,itemMetrics:t.itemMetrics,hunkSeparators:`line-info`,themeType:E,diffStyle:D,onLineSelectionEnd:()=>{let e=T.current?.getSelectedLines();e&&y(e)},onTokenEnter:(e,t,n)=>{let r=fG(e,n.item.id,t.clientX)??fG(e,n.item.id);LN.set(r,e.tokenElement),r?IW.enter(r,e.tokenElement):IW.leave(),r&&!MN(r.path)&&(t.ctrlKey||t.metaKey)&&hG(e.tokenElement,!0)},onTokenLeave:e=>{LN.set(null),IW.leave(),hG(e.tokenElement,!1)},onLineClick:(e,t)=>{if(e.numberColumn)return;let n=`annotationSide`in e?e.annotationSide:`additions`,r={start:e.lineNumber,side:n,end:e.lineNumber,endSide:n};v({id:t.item.id,range:r}),w(NM(t.item.id))},onTokenClick:(e,t,n)=>{let r=fG(e,n.item.id,t.clientX);if(!(!r||MN(r.path))){if(hG(e.tokenElement,!1),IW.cancel(),t.ctrlKey||t.metaKey){t.preventDefault(),b(r);return}x(r,t.clientX,t.clientY)}}}),[y,b,x,v,w,E,D,t]),B=(0,p.useCallback)(e=>{let t=e.metadata;if(t.kind===`draft`){let e=Y.getState().draft;return(0,g.jsx)(cG,{lines:e?xG(e):``})}return(0,g.jsx)(iG,{thread:t.thread})},[]),re=(0,p.useCallback)(e=>(0,g.jsx)(CG,{path:NM(e.id)}),[]);return r?(0,g.jsx)(`main`,{className:`relative flex min-h-0 min-w-0 flex-col outline-none`,children:(0,g.jsx)(`div`,{className:`border-b border-b-border bg-hover px-3 py-2 text-danger`,children:r})}):n?n.changed.length===0&&!o?(0,g.jsx)(`main`,{className:`relative flex min-h-0 min-w-0 flex-col outline-none`,children:(0,g.jsxs)(`div`,{className:`p-10 text-center text-muted`,children:[`No changes for `,(0,g.jsx)(`code`,{children:VO(n.mode)}),`. Open any file from the tree to comment on it.`]})}):(0,g.jsxs)(`main`,{className:`relative flex min-h-0 min-w-0 flex-col outline-none`,tabIndex:-1,children:[(0,g.jsx)(TW,{}),(0,g.jsx)(WW,{}),(0,g.jsx)(VW,{}),(0,g.jsx)(LW,{}),(0,g.jsx)(zW,{}),o&&(0,g.jsx)(yG,{path:o.path}),o?!o.item&&(0,g.jsxs)(`div`,{className:`border-b border-b-border bg-hover px-3 py-2 text-muted`,children:[`Loading `,o.path,`…`]}):n.changed.some(e=>!i[e.path])&&(0,g.jsx)(`div`,{className:`border-b border-b-border bg-hover px-3 py-2 text-muted`,children:`Loading diffs…`}),(0,g.jsx)(Ay,{ref:T,containerRef:N,className:`codeview min-h-0 flex-1 overflow-auto bg-surface outline-none`,items:k,options:z,selectedLines:_,onSelectedLinesChange:R,renderAnnotation:B,renderHeaderMetadata:re},E)]}):(0,g.jsx)(`main`,{className:`relative flex min-h-0 min-w-0 flex-col outline-none`,children:(0,g.jsx)(`div`,{className:`p-10 text-center text-muted`,children:`Loading snapshot…`})})}function yG({path:e}){let t=Y(e=>e.closeFullFile),n=Y(e=>e.fileView?.external??!1),r=Y(t=>t.snapshot?.changed.find(t=>t.path===e));return(0,g.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-b-border bg-hover px-3 py-1.5 text-[0.75rem]`,children:[(0,g.jsxs)(wM,{variant:`ghost`,onClick:t,title:`Back to the diff (Ctrl+o)`,children:[(0,g.jsx)(Dj,{size:`0.875rem`}),` Back to diff`]}),(0,g.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono`,children:(0,g.jsx)(oP,{path:e})}),r&&(0,g.jsxs)(`span`,{className:`inline-flex items-center gap-2.5 font-mono text-[0.75rem]`,children:[r.additions>0&&(0,g.jsxs)(`span`,{className:`text-add`,children:[`+`,r.additions]}),r.deletions>0&&(0,g.jsxs)(`span`,{className:`text-del`,children:[`−`,r.deletions]})]}),n&&(0,g.jsx)(`span`,{className:`inline-flex items-center gap-2.5 font-mono text-[0.75rem]`,children:`outside the repository, read-only`}),(0,g.jsx)(`kbd`,{children:`Ctrl+o`})]})}function bG(e,t,n,r,i,a,o,s){let c=MM(n!=null,e,o);if(n){let n=r.map(e=>({side:e.anchor.side===`old`?`deletions`:`additions`,lineNumber:e.anchor.endLine,metadata:{kind:`thread`,thread:e}}));if(i?.path===e){let{endLine:e}=_N(i.selection),t=i.selection.range.endSide??i.selection.range.side??`additions`;n.push({side:t,lineNumber:e,metadata:{kind:`draft`}})}return t.kind===`diff`?{id:c,type:`diff`,fileDiff:t.fileDiff,annotations:n,version:a,collapsed:s}:{id:c,type:`file`,file:{name:e,contents:t.kind===`oversized`?`// ${t.lines.toLocaleString()} changed lines: not loaded. Press zo or the header's load button to load the diff.`:t.kind===`error`?`// ${t.message}`:t.kind===`loading`?`// loading…`:``},version:a,collapsed:t.kind===`binary`||s}}if(t.kind!==`file`)return{id:c,type:`file`,file:{name:e,contents:t.kind===`binary`?`// binary file`:t.kind===`error`?`// ${t.message}`:``},version:a,collapsed:s};let l=r.filter(e=>e.anchor.side!==`old`).map(e=>({lineNumber:e.anchor.endLine,metadata:{kind:`thread`,thread:e}}));return i?.path===e&&gN(i.selection)===`new`&&l.push({lineNumber:_N(i.selection).endLine,metadata:{kind:`draft`}}),{id:c,type:`file`,file:t.file,annotations:l,version:a,collapsed:s}}function xG(e){let{startLine:t,endLine:n}=_N(e.selection);return`${gN(e.selection)===`old`?`removed `:``}L${t}${n===t?``:`–${n}`}`}function SG(e){let t=e.getRootNode();if(t instanceof ShadowRoot)return t.host;for(let t=e.parentElement;t;t=t.parentElement)if(t.shadowRoot)return t;return null}function CG({path:e}){let t=Y(t=>t.snapshot?.changed.find(t=>t.path===e)),n=Y(t=>t.activePath===e),r=(0,p.useRef)(null);(0,p.useEffect)(()=>{let e=r.current&&SG(r.current);if(e)return e.toggleAttribute(`data-active`,n),()=>e.removeAttribute(`data-active`)},[n]);let i=Y(e=>e.toggleCollapsed),a=Y(t=>t.fileView?.path===e);(0,p.useEffect)(()=>{let t=r.current,n=(t&&SG(t))?.shadowRoot?.querySelector(`[data-diffs-header]`)??t?.closest(`[data-diffs-header]`);if(!n)return;if(a)return n.style.cursor=`auto`,()=>{n.style.cursor=``};let o=t=>{let n=t.target;n instanceof Element&&n.closest(`button, input, label, a, [role="button"]`)||i(e)};return n.addEventListener(`click`,o),()=>n.removeEventListener(`click`,o)},[e,i,a]);let o=Y(e=>t?GM(e,t):`unviewed`),s=Y(e=>e.setViewed),c=Y(t=>t.threads.filter(t=>t.anchor.path===e&&!t.resolved).length),l=Y(t=>JM(t,e)),u=Y(e=>e.openFullFile),d=Y(t=>t.loaded[e]?.kind===`oversized`),f=Y(e=>e.loadPatch);return(0,g.jsxs)(`span`,{ref:r,className:`inline-flex items-center gap-2.5 font-mono text-[0.75rem]`,children:[c>0&&(0,g.jsxs)(`span`,{className:`inline-flex items-center gap-0.75 rounded-[0.625rem] bg-hover px-1.75 py-0`,children:[(0,g.jsx)(rM,{size:`0.75rem`}),` `,c]}),t?.generated&&(0,g.jsx)(`span`,{className:`inline-flex items-center gap-0.75 rounded-[0.625rem] bg-hover px-1.75 py-0 font-sans text-muted`,title:`Detected as generated: starts collapsed and ranks low`,children:`generated`}),t?.submodule&&(0,g.jsx)(`span`,{className:`inline-flex items-center gap-0.75 rounded-[0.625rem] bg-hover px-1.75 py-0 font-sans text-muted`,title:`Submodule: only the recorded commit changes`,children:`submodule`}),d&&(0,g.jsxs)(wM,{variant:`ghost`,onClick:()=>void f(e),title:`Large diff, not loaded yet (zo)`,children:[(0,g.jsx)(Bj,{size:`0.875rem`}),` Load diff`]}),t&&o===`restale`&&(0,g.jsxs)(`span`,{className:`inline-flex items-center gap-0.75 rounded-[0.625rem] bg-hover px-1.75 py-0 font-sans text-warn`,title:`You marked this viewed, then its contents changed`,children:[(0,g.jsx)(uM,{size:`0.75rem`}),` changed since viewed`]}),!a&&(!t||!t.binary&&!t.submodule&&t.status!==`D`)&&(0,g.jsx)(wM,{variant:`ghost`,icon:!0,onClick:()=>void u(e),title:`View full file (F)`,children:(0,g.jsx)(qj,{size:`0.875rem`})}),t&&!a&&(0,g.jsx)(g.Fragment,{children:(0,g.jsxs)(`label`,{className:`inline-flex cursor-pointer items-center gap-1 font-sans`,title:o===`restale`?`Mark viewed again and collapse the file (v)`:`Mark as viewed and collapse the file (v)`,children:[(0,g.jsx)(`input`,{type:`checkbox`,checked:o===`viewed`,onChange:t=>void s(e,t.target.checked)}),`Viewed`]})}),!a&&(0,g.jsx)(wM,{variant:`ghost`,icon:!0,onClick:()=>i(e),title:`Collapse / expand`,children:l?(0,g.jsx)(Aj,{size:`0.875rem`}):(0,g.jsx)(kj,{size:`0.875rem`})})]})}var wG=`file-tree-container`,TG=`data-file-tree-style`,EG=`data-file-tree-unsafe-css`,DG=`data-file-tree-scrollbar-measure`,OG=`data-file-tree-scrollbar-gutter-measured`,kG=`--trees-scrollbar-gutter-measured`,AG=`header`,jG=`context-menu`,MG=`context-menu-trigger`,NG=typeof window>`u`?p.useEffect:p.useLayoutEffect;function PG(e,t,n){let r=e==null?null:(0,g.jsx)(`div`,{slot:AG,children:e}),i=t!=null&&n!=null?(0,g.jsx)(`div`,{slot:jG,children:t(n.item,n.context)}):null;return r==null&&i==null?null:(0,g.jsxs)(g.Fragment,{children:[r,i]})}function FG(e,t){return typeof window>`u`&&t!=null?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t.shadowHtml}}),e]}):(0,g.jsx)(g.Fragment,{children:e})}function IG(e){let t=e.shadowRoot;return t?.querySelector(`[data-file-tree-id]`)instanceof HTMLElement||t?.querySelector(`[data-file-tree-id]`)instanceof SVGElement||e.querySelector(`template[shadowrootmode="open"]`)instanceof HTMLTemplateElement}function LG(e,t,n,r,i){let a={...e??{}};if(t!=null&&delete a.header,n){let t=e?.contextMenu,n=t?.onClose,o=t?.onOpen;a.contextMenu={...t??{},enabled:!0,onClose:()=>{n?.(),r()},onOpen:(e,t)=>{i(e,t),o?.(e,t)}},delete a.contextMenu.render}return a.header!=null||a.contextMenu!=null?a:void 0}function RG({header:e,id:t,model:n,preloadedData:r,renderContextMenu:i,...a}){let[o,s]=(0,p.useState)(null),[c,l]=(0,p.useState)(null),u=(0,p.useRef)(n.getComposition()),d=(0,p.useRef)(n);d.current!==n&&(d.current=n,u.current=n.getComposition());let f=i!=null,m=(0,p.useCallback)(()=>{s(null)},[]),h=(0,p.useCallback)((e,t)=>{s({context:t,item:e})},[]),_=u.current,v=(0,p.useMemo)(()=>LG(_,e,f,m,h),[_,m,h,f,e]),y=(0,p.useCallback)(e=>{l(e)},[]);(0,p.useEffect)(()=>{f||s(null)},[f]),NG(()=>{n.setComposition(v)},[v,n]),NG(()=>{if(c!=null)return r!=null&&IG(c)?n.hydrate({fileTreeContainer:c}):n.render({fileTreeContainer:c}),()=>{n.unmount(),n.setComposition(_)}},[_,c,n,r]);let b=FG(PG(e,i,o),r),x=t??r?.id,S={"--trees-item-height":`${String(n.getItemHeight())}px`,"--trees-density-override":n.getDensityFactor(),...a.style};return(0,g.jsx)(wG,{...a,id:x,ref:y,style:S,suppressHydrationWarning:r!=null,children:b})}var zG=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
1708
+ /* A placeholder replaces the body (binary, empty, moved, oversized, failed): the banner alone fills the width.
1709
+ The viewer still lays out a gutter, an empty row and, in split view, an old-side column; drop them all.
1710
+ The banner marks its host (see PlaceholderBanner). */
1711
+ :host([data-placeholder]) :is(pre, [data-code]) { grid-template-columns: minmax(0, 1fr); padding-block: 0; }
1712
+ :host([data-placeholder]) :is([data-gutter], [data-deletions], [data-line], [data-column-number]) { display: none; }
1713
+ :host([data-placeholder]) [data-content] { grid-column: 1; }
1714
+ `;function TG(e,t,n){let r=VM(t);if(!EG(r))return null;let i=DG(e.tokenElement,n,IN(r));if(!i)return null;let a=`side`in e&&e.side===`deletions`?`old`:`new`,o=e.lineNumber;if(a===`old`){let t=e.tokenElement.closest(`[data-line]`),n=t?.dataset.lineType?.startsWith(`context`)?Number(t.dataset.altLine):NaN;Number.isFinite(n)&&(a=`new`,o=n)}return{path:r,side:a,line:o,col:e.lineCharStart+i.start,text:i.text}}function EG(e){let t=Ek(e),{lsp:n}=X.getState();return t!=null&&n.enabled&&n.servers.some(e=>e.languages.includes(t))}function DG(e,t,n=!1){let r=e.firstChild;if(!r||r.nodeType!==Node.TEXT_NODE||e.childNodes.length!==1)return null;let i=r.textContent??``,a=document.createRange(),o=-1;for(let e=0;e<i.length;e++){a.setStart(r,e),a.setEnd(r,e+1);let n=a.getBoundingClientRect();if(t>=n.left&&t<=n.right){o=e;break}}return n?o>=0&&/\S/.test(i[o])?{start:o,text:i}:null:HU(i).find(e=>o>=e.start&&o<e.start+e.text.length)??null}function OG(e,t){e.classList.toggle(`lsp-hover`,t)}var kG={theme:XN,loadDiffFiles:CG,stickyHeaders:!0,enableLineSelection:!0,useTokenTransformer:!0,lineHoverHighlight:`number`,overflow:`wrap`},AG={kind:`loading`};function jG(){let e=iW(),t=(0,p.useMemo)(()=>JW(e),[e]),n=X(e=>e.snapshot),r=X(e=>e.error),i=X(e=>e.loaded),a=X(e=>e.gens),o=X(e=>e.fileView),s=X(e=>e.threads),c=X(e=>e.showResolved),l=X(e=>e.replyTo),u=X(e=>e.editingId),d=X(e=>e.draft),f=X(e=>e.collapsed),m=X(e=>e.viewed),h=X(e=>e.config),_=X(e=>e.selection),v=X(e=>e.setSelection),y=X(e=>e.openDraft),b=X(e=>e.goToDefinition),x=X(e=>e.openSymbolMenu),S=X(e=>e.scrollTarget),C=X(e=>e.reveal),w=X(e=>e.setActivePath),T=(0,p.useRef)(null),E=X(e=>e.theme),D=X(e=>e.diffStyle),O=(0,p.useRef)(new Map),k=(0,p.useMemo)(()=>{if(!n)return[];let e=new Map(n.changed.map(e=>[e.path,e])),t={collapsed:f,viewed:m,config:h,snapshot:n},r=new Map;for(let e of tN({threads:s,showResolved:c})){let t=r.get(e.anchor.path);t?t.push(e):r.set(e.anchor.path,[e])}let p=(e,t,n)=>{let r=lN(O.current.get(e),cN({draft:d,replyTo:l,editingId:u},e,t,n));return O.current.set(e,r),r.version};if(o){let{path:e,item:t}=o,n=r.get(e)??[],i=t&&NG(e,t,void 0,n,d,p(e,n,!1),a[e]??0,!1);return i?[i]:[]}let g=[];for(let o of GM(n)){let n=i[o]??AG,s=r.get(o)??[],c=eN(t,o),l=NG(o,n,e.get(o),s,d,p(o,s,c),a[o]??0,c);l&&g.push(l)}return g},[n,i,a,o,s,c,l,u,d,f,m,h]),[A,j]=(0,p.useState)(null),M=(0,p.useRef)(null),N=(0,p.useCallback)(e=>{M.current=e,j(e)},[]),P=(0,p.useRef)(!1),F=(0,p.useRef)(o);(F.current==null!=(o==null)||F.current?.path!==o?.path)&&(F.current=o,P.current=!0),(0,p.useEffect)(()=>{P.current=!1},[k]),(0,p.useEffect)(()=>(qU(()=>T.current),()=>qU(()=>null)),[]),(0,p.useEffect)(()=>{if(A)return lG(()=>T.current,A)},[A]),(0,p.useEffect)(()=>{if(A)return pG(()=>T.current,A)},[A]),(0,p.useEffect)(()=>{YU()},[_]);let I=(0,p.useRef)(!1);(0,p.useEffect)(()=>{if(!A)return;let e=0,n=()=>{if(e=0,I.current||X.getState().selection)return;let n=T.current?.getInstance()?.getRenderedItems()??[],r=A.getBoundingClientRect(),i=t.itemMetrics.diffHeaderHeight,a=r.top+r.height*SG,o=n.map(e=>({id:e.id,rect:e.element.getBoundingClientRect()})).filter(e=>e.rect.bottom>r.top+i+1&&e.rect.top<r.bottom&&e.rect.height>0);if(o.length===0)return;let s=X.getState(),c=VM((o.find(e=>VM(e.id)===s.activePath)??o.filter(e=>e.rect.top<=a).sort((e,t)=>t.rect.top-e.rect.top)[0]??o[0]).id);c!==s.activePath&&s.setActivePath(c)},r=()=>{e||=requestAnimationFrame(n)};return A.addEventListener(`scroll`,r,{passive:!0}),()=>{A.removeEventListener(`scroll`,r),e&&cancelAnimationFrame(e)}},[A,t]),(0,p.useEffect)(()=>X.subscribe((e,n)=>{if(e.theme===n.theme&&e.diffStyle===n.diffStyle)return;let r=M.current,i=T.current?.getInstance()?.getRenderedItems();if(!r||!i)return;let a=r.getBoundingClientRect(),o=BU(i.map(e=>({id:e.id,root:e.element.shadowRoot??e.element})),a.top+t.itemMetrics.diffHeaderHeight,a.bottom);o&&X.setState(e=>({scrollTarget:{...o,align:`keep`,nonce:(e.scrollTarget?.nonce??0)+1}}))}),[t]),(0,p.useEffect)(()=>{if(!C||!T.current)return;let e=T.current;e.scrollTo({type:`item`,id:C.id,align:`start`,behavior:`instant`});let t=0,n=!1,r=()=>{if(n)return;let i=e.getInstance()?.getRenderedItems().find(e=>e.id===C.id);if(i?.type===`diff`){i.instance.revealLine(C.line);let e=i.instance,t=C.line,r=C.line;for(;t>1&&C.line-t<1e4&&e.isLineRenderable(t-1);)t--;for(;r-t<1e4&&e.isLineRenderable(r+1);)r++;X.getState().addRevealed(C.id,t,r),setTimeout(()=>{n||X.setState(e=>({scrollTarget:{id:C.id,line:C.line,side:`new`,align:`eye`,nonce:(e.scrollTarget?.nonce??0)+1}}))},30);return}t++<40&&setTimeout(r,50)};return r(),()=>{n=!0}},[C]);let L=(0,p.useCallback)(e=>{let n=e.align??`center`,r=n===`eye`||n===`top`||n===`bottom`||n===`keep`,i=M.current?.clientHeight??800,a=(T.current?.getInstance()?.getRenderedItems().find(t=>t.id===e.id))?.element.shadowRoot?.querySelector(`[data-diffs-header]`)?.getBoundingClientRect().height??t.itemMetrics.diffHeaderHeight,o=t.edge,s=n===`eye`?i*SG-a:n===`top`?o:n===`bottom`?Math.max(o,i-a-o-t.itemMetrics.lineHeight):n===`keep`?e.offset??0:0,c=r?`start`:n;return{eye:r,offset:s,header:a,target:e.line?{type:`line`,id:e.id,lineNumber:e.line,side:e.side===`old`?`deletions`:`additions`,align:c,offset:s,behavior:r?`instant`:void 0}:{type:`item`,id:e.id,align:`start`,behavior:`instant`}}},[t]),ee=e=>{let t=T.current?.getInstance()?.getRenderedItems().find(t=>t.id===e.id),n=t?.element.shadowRoot??t?.element;return n&&e.line?zU(n,e.line,e.side??`new`):null},te=(0,p.useRef)(E),ne=(0,p.useRef)(S);(0,p.useLayoutEffect)(()=>{let e=P.current||te.current!==E,t=S!==ne.current;te.current=E,ne.current=S;let n=M.current;n&&(n.style.visibility=e&&t&&S?.line&&!ee(S)?`hidden`:``)},[S,E]),(0,p.useEffect)(()=>{if(!S||!T.current)return;if(S.revealSearch&&M.current){let e=((T.current.getInstance()?.getRenderedItems().find(e=>e.id===S.id))?.element.querySelector(`[data-content-search]`)?.closest(`form`))?.getBoundingClientRect(),t=M.current.getBoundingClientRect();if(e&&e.height>0&&e.top>=t.top&&e.bottom<=t.bottom)return}let{eye:e,offset:n,header:r,target:i}=L(S),a=e&&S.line!=null;I.current=!0;let o,s=()=>{o=setTimeout(()=>{I.current=!1},150)},c=()=>{M.current&&(M.current.style.visibility=``)},l=()=>{let e=M.current;if(!e)return NaN;let a=e.getBoundingClientRect().top;if(i.type===`item`){let e=T.current?.getInstance()?.getRenderedItems().find(e=>e.id===S.id)?.element;return e?e.getBoundingClientRect().top-(a+t.layout.paddingTop):NaN}return(ee(S)?.getBoundingClientRect().top??NaN)-(a+n+r)},u=a||i.type===`item`,d=()=>{let e=M.current,t=ee(S);if(!e||!t)return NaN;let n=(T.current?.getInstance()?.getRenderedItems().find(e=>e.id===S.id))?.element.shadowRoot?.querySelector(`[data-diffs-header]`)?.getBoundingClientRect().height;return YW(e.getBoundingClientRect(),t.getBoundingClientRect(),n??r)},f=()=>{let e=T.current,t=e?.getInstance();if(!e||!t||!e.getItem(S.id))return!1;if(e.scrollTo(i),t.render(!0),!u){let e=i.type===`line`?d():NaN;return!Number.isNaN(e)&&Math.abs(e)>1&&M.current&&(M.current.scrollTop+=e,t.render(!0)),!0}for(let n=0;n<4;n++){let n=l();if(Number.isNaN(n)){e.scrollTo(i),t.render(!0);continue}if(Math.abs(n)<=1||(e.scrollTo({...i,offset:(i.offset??0)-n}),t.render(!0),!(l()!==n||!M.current)&&(M.current.scrollTop+=n,t.render(!0),l()===n)))break}return!0},p=!1,m=0,h=()=>{setTimeout(()=>{if(p)return;let e=l();!Number.isNaN(e)&&Math.abs(e)>1&&M.current&&(M.current.scrollTop+=e),m++<2&&h()},100)},g=0,_=()=>{if(!p){if(!f()){g++<20?setTimeout(_,100):(c(),s());return}c(),s(),u&&h()}};return _(),()=>{p=!0,o&&clearTimeout(o)}},[S,t,L]);let R=(0,p.useCallback)(e=>{e==null&&P.current||(v(e),e&&w(VM(e.id)))},[v,w]),z=(0,p.useRef)(()=>{}),B=(0,p.useMemo)(()=>({...kG,unsafeCSS:wG+t.css,layout:t.layout,itemMetrics:t.itemMetrics,hunkSeparators:`line-info`,themeType:E,diffStyle:D,onLineSelectionEnd:()=>{let e=T.current?.getSelectedLines();e&&y(e)},onTokenEnter:(e,t,n)=>{let r=null,i=t=>{let i=TG(e,n.item.id,t.clientX);i?.col!==r?.col&&(r=i,VN.set(i,e.tokenElement),i?GW.enter(i,e.tokenElement):GW.leave(),OG(e.tokenElement,!!i&&!IN(i.path)&&(t.ctrlKey||t.metaKey)))};i(t),e.tokenElement.addEventListener(`pointermove`,i),z.current=()=>e.tokenElement.removeEventListener(`pointermove`,i)},onTokenLeave:e=>{z.current(),z.current=()=>{},VN.set(null),GW.leave(),OG(e.tokenElement,!1)},onLineClick:(e,t)=>{if(e.numberColumn)return;let n=`annotationSide`in e?e.annotationSide:`additions`,r={start:e.lineNumber,side:n,end:e.lineNumber,endSide:n};v({id:t.item.id,range:r}),w(VM(t.item.id))},onTokenClick:(e,t,n)=>{let r=TG(e,n.item.id,t.clientX);if(!(!r||IN(r.path))){if(OG(e.tokenElement,!1),GW.cancel(),t.ctrlKey||t.metaKey){t.preventDefault(),b(r);return}x(r,t.clientX,t.clientY)}}}),[y,b,x,v,w,E,D,t]),re=(0,p.useCallback)(e=>{let t=e.metadata;if(t.kind===`placeholder`)return(0,g.jsx)(xG,{kind:t.placeholder,message:t.message});if(t.kind===`draft`){let e=aN(X.getState());return(0,g.jsx)(vG,{label:e?rN(e):`whole file`})}return(0,g.jsx)(mG,{thread:t.thread})},[]),ie=(0,p.useCallback)((e,n)=>{let r=T.current?.getInstance(),i=r?.getRenderedItems().find(t=>t.id===e);if(!r||!i)return;let a=M.current,o=a?.scrollTop;i.instance.setMetrics({...t.itemMetrics,diffHeaderHeight:n}),r.instanceChanged(i.instance,!0),r.render(!0),a&&o!==void 0&&a.scrollTop!==o&&(a.scrollTop=o,a.dispatchEvent(new Event(`scroll`)),r.render(!0))},[t]),ae=(0,p.useCallback)(e=>(0,g.jsx)(FG,{id:e.id,resizeHeader:ie}),[ie]);return r?(0,g.jsx)(`main`,{className:`relative flex min-h-0 min-w-0 flex-col outline-none`,children:(0,g.jsx)(`div`,{className:`border-b border-b-border bg-hover px-3 py-2 text-danger`,children:r})}):n?n.changed.length===0&&!o?(0,g.jsx)(`main`,{className:`relative flex min-h-0 min-w-0 flex-col outline-none`,children:(0,g.jsxs)(`div`,{className:`p-10 text-center text-muted`,children:[`No changes for `,(0,g.jsx)(`code`,{children:VO(n.mode)}),`. Open any file from the tree to comment on it.`]})}):(0,g.jsxs)(`main`,{className:`relative flex min-h-0 min-w-0 flex-col outline-none`,tabIndex:-1,children:[(0,g.jsx)(AW,{}),(0,g.jsx)(tG,{}),(0,g.jsx)(QW,{}),(0,g.jsx)(KW,{}),(0,g.jsx)(XW,{}),o&&(0,g.jsx)(MG,{path:o.path}),o?!o.item&&(0,g.jsxs)(`div`,{className:`border-b border-b-border bg-hover px-3 py-2 text-muted`,children:[`Loading `,o.path,`…`]}):n.changed.some(e=>!i[e.path])&&(0,g.jsx)(`div`,{className:`border-b border-b-border bg-hover px-3 py-2 text-muted`,children:`Loading diffs…`}),(0,g.jsx)(Ay,{ref:T,containerRef:N,className:`codeview min-h-0 flex-1 overflow-auto bg-surface outline-none`,items:k,options:B,selectedLines:_,onSelectedLinesChange:R,renderAnnotation:re,renderCustomHeader:ae},E)]}):(0,g.jsx)(`main`,{className:`relative flex min-h-0 min-w-0 flex-col outline-none`,children:(0,g.jsx)(`div`,{className:`p-10 text-center text-muted`,children:`Loading snapshot…`})})}function MG({path:e}){let t=X(e=>e.closeFullFile),n=X(e=>e.fileView?.external??!1),r=X(t=>t.snapshot?.changed.find(t=>t.path===e));return(0,g.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-b-border bg-hover px-3 py-1.5 text-[0.75rem]`,children:[(0,g.jsxs)(Y,{variant:`ghost`,onClick:t,title:`Back to the diff (Ctrl+o)`,children:[(0,g.jsx)(Oj,{size:`0.875rem`}),` Back to diff`]}),(0,g.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono`,children:(0,g.jsx)(uP,{path:e})}),r&&(0,g.jsxs)(`span`,{className:`inline-flex items-center gap-2.5 font-mono text-[0.75rem]`,children:[r.additions>0&&(0,g.jsxs)(`span`,{className:`text-add`,children:[`+`,r.additions]}),r.deletions>0&&(0,g.jsxs)(`span`,{className:`text-del`,children:[`−`,r.deletions]})]}),n&&(0,g.jsx)(`span`,{className:`inline-flex items-center gap-2.5 font-mono text-[0.75rem]`,children:`outside the repository, read-only`}),(0,g.jsx)(`kbd`,{children:`Ctrl+o`})]})}function NG(e,t,n,r,i,a,o,s){let c=BM(n!=null,e,o),l=r.filter(e=>e.anchor.kind===`file`).map(e=>({lineNumber:PG,metadata:{kind:`thread`,thread:e}}));if(i?.path===e&&i.selection==null&&l.push({lineNumber:PG,metadata:{kind:`draft`}}),n){let o=n.status===`D`?`deletions`:`additions`,u=l.map(e=>({...e,side:o}));for(let e of r)e.anchor.kind===`line`&&u.push({side:e.anchor.side===`old`?`deletions`:`additions`,lineNumber:e.anchor.endLine,metadata:{kind:`thread`,thread:e}});if(i?.path===e&&i.selection){let{endLine:e}=LM(i.selection),t=i.selection.range.endSide??i.selection.range.side??`additions`;u.push({side:t,lineNumber:e,metadata:{kind:`draft`}})}if(t.kind===`diff`&&t.fileDiff.hunks.length>0)return{id:c,type:`diff`,fileDiff:t.fileDiff,annotations:u,version:a,collapsed:s};let[d,f]=t.kind===`diff`?n.status===`R`?[`empty`,`No content changes`]:[`empty`,`No changed lines`]:t.kind===`oversized`?[`oversized`,`${t.lines.toLocaleString()} changed lines: not loaded. Press zo or the header's load button to load the diff.`]:t.kind===`error`?[`error`,t.message]:t.kind===`loading`?[`loading`,`Loading…`]:[`binary`,`Binary file`];return l.unshift({lineNumber:PG,metadata:{kind:`placeholder`,placeholder:d,message:f}}),{id:c,type:`file`,file:{name:e,contents:``,prevName:n.status===`R`?n.oldPath:void 0},annotations:l,version:a,collapsed:s}}if(t.kind!==`file`){let[n,r]=t.kind===`binary`?[`binary`,`Binary file`]:t.kind===`error`?[`error`,t.message]:[`loading`,`Loading…`];return l.unshift({lineNumber:PG,metadata:{kind:`placeholder`,placeholder:n,message:r}}),{id:c,type:`file`,file:{name:e,contents:``},annotations:l,version:a,collapsed:s}}let u=l;for(let e of r)e.anchor.kind===`line`&&e.anchor.side!==`old`&&u.push({lineNumber:e.anchor.endLine,metadata:{kind:`thread`,thread:e}});return i?.path===e&&i.selection&&IM(i.selection)===`new`&&u.push({lineNumber:LM(i.selection).endLine,metadata:{kind:`draft`}}),{id:c,type:`file`,file:t.file,annotations:u,version:a,collapsed:s}}var PG=0;function FG({id:e,resizeHeader:t}){let n=VM(e),r=(0,p.useRef)(null),i=X(e=>e.search.open&&e.search.kind===`text`&&e.search.scope===`file`&&e.search.path===n);(0,p.useLayoutEffect)(()=>{let n=r.current;if(!n)return;let i=0,a=()=>{let r=n.getBoundingClientRect().height+1;r<=1||r===i||(i=r,t(e,r))};a();let o=new ResizeObserver(a);return o.observe(n),()=>o.disconnect()},[e,t,i]);let a=X(e=>e.snapshot?.changed.find(e=>e.path===n));return(0,g.jsxs)(`div`,{ref:r,children:[(0,g.jsxs)(`div`,{className:`flex h-[calc(var(--diffle-header-height)-1px)] items-center gap-2 px-2.5 py-1.5`,children:[(0,g.jsx)(Yj,{size:`0.875rem`,className:`shrink-0 text-muted`}),a?.oldPath&&a.oldPath!==n&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(uP,{path:a.oldPath,nowrap:!0}),(0,g.jsx)(`span`,{className:`text-muted`,children:`→`})]}),(0,g.jsx)(uP,{path:n,nowrap:!0,className:`mr-auto`}),a&&(0,g.jsxs)(`span`,{className:`flex shrink-0 gap-2 font-mono text-[0.75rem]`,children:[(0,g.jsxs)(`span`,{className:`text-del`,children:[`−`,a.deletions]}),(0,g.jsxs)(`span`,{className:`text-add`,children:[`+`,a.additions]})]}),(0,g.jsx)(IG,{path:n})]}),(0,g.jsx)(AW,{path:n})]})}function IG({path:e}){let t=X(t=>t.snapshot?.changed.find(t=>t.path===e)),n=X(t=>t.activePath===e),r=(0,p.useRef)(null);(0,p.useEffect)(()=>{let e=r.current&&yG(r.current);if(e)return e.toggleAttribute(`data-active`,n),()=>e.removeAttribute(`data-active`)},[n]);let i=X(e=>e.toggleCollapsed),a=X(e=>e.selectFile),o=X(t=>t.fileView?.path===e);(0,p.useEffect)(()=>{let t=r.current,n=(t&&yG(t))?.shadowRoot?.querySelector(`[data-diffs-header]`)??t?.closest(`[data-diffs-header]`);if(!n)return;if(o)return n.style.cursor=`auto`,()=>{n.style.cursor=``};let s=t=>{let n=t.target;n instanceof Element&&n.closest(`button, input, label, a, form, [role="button"]`)||(a(e),i(e))};return n.addEventListener(`click`,s),()=>n.removeEventListener(`click`,s)},[e,i,a,o]);let s=X(e=>t?ZM(e,t):`unviewed`),c=X(e=>e.setViewed),l=X(t=>t.threads.filter(t=>t.anchor.path===e&&!t.resolved).length),u=X(t=>eN(t,e)),d=X(e=>e.openFullFile),f=X(t=>t.loaded[e]?.kind===`oversized`),m=X(e=>e.loadPatch),h=X(e=>e.openFileDraft),_=X(t=>t.fileView?.external===!0&&t.fileView.path===e);return(0,g.jsxs)(`span`,{ref:r,className:`inline-flex items-center gap-2.5 font-mono text-[0.75rem]`,children:[l>0&&(0,g.jsxs)(`span`,{className:`inline-flex items-center gap-0.75 rounded-[0.625rem] bg-hover px-1.75 py-0`,children:[(0,g.jsx)(oM,{size:`0.75rem`}),` `,l]}),t?.generated&&(0,g.jsx)(`span`,{className:`inline-flex items-center gap-0.75 rounded-[0.625rem] bg-hover px-1.75 py-0 font-sans text-muted`,title:`Detected as generated: starts collapsed and ranks low`,children:`generated`}),t?.submodule&&(0,g.jsx)(`span`,{className:`inline-flex items-center gap-0.75 rounded-[0.625rem] bg-hover px-1.75 py-0 font-sans text-muted`,title:`Submodule: only the recorded commit changes`,children:`submodule`}),f&&(0,g.jsxs)(Y,{variant:`ghost`,onClick:()=>void m(e),title:`Large diff, not loaded yet (zo)`,children:[(0,g.jsx)(Vj,{size:`0.875rem`}),` Load diff`]}),t&&s===`restale`&&(0,g.jsxs)(`span`,{className:`inline-flex items-center gap-0.75 rounded-[0.625rem] bg-hover px-1.75 py-0 font-sans text-warn`,title:`You marked this viewed, then its contents changed`,children:[(0,g.jsx)(pM,{size:`0.75rem`}),` changed since viewed`]}),!_&&(0,g.jsx)(Y,{variant:`ghost`,icon:!0,onClick:()=>h(e),title:`Comment on this file as a whole (C)`,children:(0,g.jsx)(aM,{size:`0.875rem`})}),!o&&(!t||!t.binary&&!t.submodule&&t.status!==`D`)&&(0,g.jsx)(Y,{variant:`ghost`,icon:!0,onClick:()=>void d(e),title:`View full file (F)`,children:(0,g.jsx)(Yj,{size:`0.875rem`})}),t&&!o&&(0,g.jsx)(g.Fragment,{children:(0,g.jsxs)(`label`,{className:`inline-flex cursor-pointer items-center gap-1 font-sans`,title:s===`restale`?`Mark viewed again and collapse the file (v)`:`Mark as viewed and collapse the file (v)`,children:[(0,g.jsx)(`input`,{type:`checkbox`,checked:s===`viewed`,onChange:t=>void c(e,t.target.checked)}),`Viewed`]})}),!o&&(0,g.jsx)(Y,{variant:`ghost`,icon:!0,onClick:()=>i(e),title:`Collapse / expand`,children:u?(0,g.jsx)(jj,{size:`0.875rem`}):(0,g.jsx)(Aj,{size:`0.875rem`})})]})}var LG=`file-tree-container`,RG=`data-file-tree-style`,zG=`data-file-tree-unsafe-css`,BG=`data-file-tree-scrollbar-measure`,VG=`data-file-tree-scrollbar-gutter-measured`,HG=`--trees-scrollbar-gutter-measured`,UG=`header`,WG=`context-menu`,GG=`context-menu-trigger`,KG=typeof window>`u`?p.useEffect:p.useLayoutEffect;function qG(e,t,n){let r=e==null?null:(0,g.jsx)(`div`,{slot:UG,children:e}),i=t!=null&&n!=null?(0,g.jsx)(`div`,{slot:WG,children:t(n.item,n.context)}):null;return r==null&&i==null?null:(0,g.jsxs)(g.Fragment,{children:[r,i]})}function JG(e,t){return typeof window>`u`&&t!=null?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t.shadowHtml}}),e]}):(0,g.jsx)(g.Fragment,{children:e})}function YG(e){let t=e.shadowRoot;return t?.querySelector(`[data-file-tree-id]`)instanceof HTMLElement||t?.querySelector(`[data-file-tree-id]`)instanceof SVGElement||e.querySelector(`template[shadowrootmode="open"]`)instanceof HTMLTemplateElement}function XG(e,t,n,r,i){let a={...e??{}};if(t!=null&&delete a.header,n){let t=e?.contextMenu,n=t?.onClose,o=t?.onOpen;a.contextMenu={...t??{},enabled:!0,onClose:()=>{n?.(),r()},onOpen:(e,t)=>{i(e,t),o?.(e,t)}},delete a.contextMenu.render}return a.header!=null||a.contextMenu!=null?a:void 0}function ZG({header:e,id:t,model:n,preloadedData:r,renderContextMenu:i,...a}){let[o,s]=(0,p.useState)(null),[c,l]=(0,p.useState)(null),u=(0,p.useRef)(n.getComposition()),d=(0,p.useRef)(n);d.current!==n&&(d.current=n,u.current=n.getComposition());let f=i!=null,m=(0,p.useCallback)(()=>{s(null)},[]),h=(0,p.useCallback)((e,t)=>{s({context:t,item:e})},[]),_=u.current,v=(0,p.useMemo)(()=>XG(_,e,f,m,h),[_,m,h,f,e]),y=(0,p.useCallback)(e=>{l(e)},[]);(0,p.useEffect)(()=>{f||s(null)},[f]),KG(()=>{n.setComposition(v)},[v,n]),KG(()=>{if(c!=null)return r!=null&&YG(c)?n.hydrate({fileTreeContainer:c}):n.render({fileTreeContainer:c}),()=>{n.unmount(),n.setComposition(_)}},[_,c,n,r]);let b=JG(qG(e,i,o),r),x=t??r?.id,S={"--trees-item-height":`${String(n.getItemHeight())}px`,"--trees-density-override":n.getDensityFactor(),...a.style};return(0,g.jsx)(LG,{...a,id:x,ref:y,style:S,suppressHydrationWarning:r!=null,children:b})}var QG=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
1707
1715
  <symbol id="file-tree-icon-chevron" viewBox="0 0 16 16">
1708
1716
  <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"/>
1709
1717
  </symbol>
@@ -1720,72 +1728,72 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1720
1728
  <symbol id="file-tree-icon-ellipsis" viewBox="0 0 16 16">
1721
1729
  <path d="M5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M9.5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M14 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0" />
1722
1730
  </symbol>
1723
- </svg>`,BG=`<symbol id="file-tree-builtin-astro" viewBox="0 0 16 16">
1731
+ </svg>`,$G=`<symbol id="file-tree-builtin-astro" viewBox="0 0 16 16">
1724
1732
  <path fill="currentColor" d="M6.08 13.92c-.63-.57-.81-1.79-.55-2.67.45.56 1.08.73 1.73.83 1 .15 1.99.1 2.92-.37l.32-.19q.13.38.08.78a2.1 2.1 0 0 1-.9 1.5q-.3.24-.61.43c-.64.44-.81.95-.57 1.69l.02.08a1.7 1.7 0 0 1-.74-.64 2 2 0 0 1-.3-.98q0-.27-.02-.52-.07-.61-.61-.62a.7.7 0 0 0-.75.6z" class="bg" opacity=".6"/>
1725
1733
  <path fill="currentColor" d="M2.5 11.1s1.86-.9 3.72-.9l1.4-4.39c.05-.21.2-.36.38-.36s.33.15.38.36l1.4 4.38c2.2 0 3.72.92 3.72.92l-3.16-8.69q-.13-.4-.45-.42H6.11q-.3.02-.45.42z" class="fg"/>
1726
- </symbol>`,VG=`<symbol id="file-tree-builtin-babel" viewBox="0 0 16 16">
1734
+ </symbol>`,eK=`<symbol id="file-tree-builtin-babel" viewBox="0 0 16 16">
1727
1735
  <path fill="currentColor" fill-rule="evenodd" d="M9.49.5q1.92.05 2.66.54 1.27.6 1.35 1.52v.23a4 4 0 0 1-.53 1.9l-1.38 1.24q-.74.38-.72.63c.77.82 1.33 1.29.85 2.42q-.47 1.1-2.04 2.28c-.5.32-1.88 1.35-2.96 1.86-1.64.77-3.1 1.4-4.65 1.89-.51.16-1.5.16-1.5.16L.5 15A76 76 0 0 0 5.76 3.49q-.1-.08-.1-.2.1 0 .32-.35l-.03-.09q-1.17.39-2.38 1.3l-.13.03q0-.1-.21-.16-.46.31-.82.7l-.13-.19.16-.06-.03-.16-.34.29L2 4.5q.36-.48.72-.54l.04-.1V3.8q.16 0 .15-.06l.13-.06a6 6 0 0 0 1.13-.9v-.03H4.1l-.12.07q0-.1-.1-.1l-.15.07-.04-.1q.93-.52 1.63-1.05Q7.89.65 9.5.5M8.46 7.83l-.32.04c-1.31.54-2.31.82-2.91.88a71 71 0 0 0-2.2 4.54h.07q.58-.04 3.04-1.42.13 0 1.66-1.05L9.18 9.7v.03q.45-.2.81-1.3v-.2q-.5-.46-1.53-.4m.28-5.75c-.5.1-.75.19-.72.38l-1.16 2.6q-.17.1-.34.95-.3.48-.25.77v.1l.22.05A15 15 0 0 1 8.86 6c1.1-.71 2.12-1.38 2.8-2.54q.24-.33.21-.54-.02-.33-.4-.54c-.54 0-1.07-.34-1.63-.28l-.94-.03z" clip-rule="evenodd"/>
1728
- </symbol>`,HG=`<symbol id="file-tree-builtin-bash" viewBox="0 0 16 16">
1736
+ </symbol>`,tK=`<symbol id="file-tree-builtin-bash" viewBox="0 0 16 16">
1729
1737
  <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
1730
1738
  <path fill="currentColor" d="M11.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zM7 6.75C7 6.42 6.64 6 6 6s-1 .42-1 .75q-.01.25.22.41.26.21.89.35.74.14 1.28.53c.37.29.61.7.61 1.21 0 .87-.68 1.5-1.5 1.7v.55a.5.5 0 0 1-1 0v-.56c-.82-.18-1.5-.82-1.5-1.69a.5.5 0 0 1 1 0c0 .33.36.75 1 .75s1-.42 1-.75q.01-.25-.22-.41a2 2 0 0 0-.89-.35q-.74-.14-1.28-.53A1.5 1.5 0 0 1 4 6.75c0-.87.68-1.5 1.5-1.7V4.5a.5.5 0 0 1 1 0v.56c.82.18 1.5.82 1.5 1.69a.5.5 0 0 1-1 0" class="fg-stroke"/>
1731
- </symbol>`,UG=`<symbol id="file-tree-builtin-biome" viewBox="0 0 16 16">
1739
+ </symbol>`,nK=`<symbol id="file-tree-builtin-biome" viewBox="0 0 16 16">
1732
1740
  <path fill="currentColor" d="M8 2 4.88 7.35a7 7 0 0 1 3.7-.13l1.04.25-.99 4.16-1.05-.25a2.7 2.7 0 0 0-3.07 1.45l-.98-.47a4 4 0 0 1 1.07-1.31 3.8 3.8 0 0 1 3.23-.71l.5-2.08a6 6 0 0 0-5.07 1.12A5.9 5.9 0 0 0 1 14h14z"/>
1733
- </symbol>`,WG=`<symbol id="file-tree-builtin-bootstrap" viewBox="0 0 16 16">
1741
+ </symbol>`,rK=`<symbol id="file-tree-builtin-bootstrap" viewBox="0 0 16 16">
1734
1742
  <path fill="currentColor" fill-rule="evenodd" d="M11.72 1.5A2.5 2.5 0 0 1 14.2 4q.02 1.08.3 2.09c.22.73.56 1.24 1.08 1.45.22.08.4.27.4.5s-.18.43-.4.51q-.76.34-1.08 1.45c-.2.65-.27 1.32-.3 2a2.5 2.5 0 0 1-2.48 2.5H4.25A2.6 2.6 0 0 1 1.7 12c-.04-.85-.1-1.68-.22-2.04C1.26 9.23.92 8.7.4 8.5.18 8.42 0 8.23 0 8s.18-.42.4-.5q.77-.35 1.09-1.46c.1-.36.17-1.19.2-2.04a2.6 2.6 0 0 1 2.56-2.5z" class="bg" clip-rule="evenodd" opacity=".2"/>
1735
1743
  <path fill="currentColor" fill-rule="evenodd" d="M8.47 4.54c1.23 0 2.04.68 2.04 1.73 0 .73-.55 1.39-1.24 1.5v.04c.94.1 1.58.77 1.58 1.7 0 1.2-.9 1.95-2.37 1.95H5.97a.3.3 0 0 1-.2-.08.3.3 0 0 1-.08-.2V4.82a.3.3 0 0 1 .08-.2.3.3 0 0 1 .2-.08zm-1.7 6.04h1.49q1.47-.01 1.49-1.15Q9.74 8.31 8.2 8.3H6.77zm0-5.16v2.06h1.21c.93 0 1.45-.38 1.45-1.06 0-.65-.44-1-1.22-1z" class="fg" clip-rule="evenodd"/>
1736
- </symbol>`,GG=`<symbol id="file-tree-builtin-browserslist" viewBox="0 0 16 16">
1744
+ </symbol>`,iK=`<symbol id="file-tree-builtin-browserslist" viewBox="0 0 16 16">
1737
1745
  <path fill="currentColor" d="M8.88 6.96c0 3.82 3.72 4.7 5.7 3.74-.23.9-1.04 1.67-2.35 1.93-.02.4.42 1.28.82 1.63-.9.35-1.94-.12-2.51-.48a5 5 0 0 0-.32 1.87c-.68 0-1.57-1-1.8-1.37-.3.18-.85 1.15-.96 1.72a2.4 2.4 0 0 1-.81-.86 2.4 2.4 0 0 1-.3-1.15c-.38.27-1.48.95-1.99 1.18-.25-.58-.15-1.3 0-2.06-.21.12-1.8.27-2.43.12.32-.36.75-1.19.94-1.57A4.5 4.5 0 0 1 .44 10.6c.48-.22.97-.53 1.49-1.06C1.26 9.17.24 8.64 0 7.7a6 6 0 0 0 1.79-.32C1.28 7.08.44 6.15.6 5.01c.42.21 1.3.37 1.73.3a3.4 3.4 0 0 1-.25-2.75 5 5 0 0 0 1.48 1c-.08-.8.3-2.31.8-2.71.2.46.73 1.21 1.08 1.4.09-.61.87-2.06 1.57-2.25 0 .5.27 1.4.5 1.67.51-.54 2.25-1.44 3.64-1.13-.43.45-.75.61-.86.98 1.05 0 2.78.34 4.27 1.93-2.34-.89-5.69.56-5.69 3.5" class="bg" opacity=".5"/>
1738
1746
  <path fill="currentColor" d="M11.21 3.59a4.1 4.1 0 0 0 2.47 2.89c.24-.22.61-.38.95-.19.76.44.2 1.26-.34 1.66l-.07.06a13 13 0 0 1-4.49 1.61l-.3-.43a10.5 10.5 0 0 0 4.13-1.31 1 1 0 0 0 .23-.25.5.5 0 0 0-.21-.69l-.15-.06a4.5 4.5 0 0 1-1.77-1.31 4.5 4.5 0 0 1-.88-1.77q.2-.12.43-.21"/>
1739
1747
  <path fill="currentColor" d="M10.36 5.18a.4.4 0 0 0-.03.38c.09.2.3.3.46.23s.24-.3.15-.5l-.01-.02q.23.13.34.39a.83.83 0 0 1-.43 1.08.8.8 0 0 1-1.08-.43.83.83 0 0 1 .6-1.13"/>
1740
- </symbol>`,KG=`<symbol id="file-tree-builtin-bun" viewBox="0 0 16 16">
1748
+ </symbol>`,aK=`<symbol id="file-tree-builtin-bun" viewBox="0 0 16 16">
1741
1749
  <path fill="currentColor" d="M8 14c3.87 0 7-2.46 7-5.49 0-1.88-1.2-3.53-3.04-4.52q-1.1-.61-1.84-1.07C9.2 2.35 8.64 2 8 2s-1.36.45-2.31 1.03A29 29 0 0 1 4.04 4C2.2 4.98 1 6.63 1 8.51 1 11.54 4.13 14 8 14M7.18 3.88q.3-.66.3-1.37c0-.08.11-.1.13-.01.38 1.57-.53 2.35-1.2 2.61-.08.03-.12-.07-.06-.12a3 3 0 0 0 .83-1.12m1.2-.05a3 3 0 0 0-.45-1.3V2.5c-.04-.07.05-.15.1-.1 1.15 1.2.77 2.3.33 2.87-.05.05-.13 0-.11-.08q.21-.67.13-1.37m1.04-.32a3 3 0 0 0-.94-1.02v-.01c-.06-.05-.01-.16.07-.12 1.51.61 1.61 1.8 1.43 2.5l-.03.03a.07.07 0 0 1-.1-.06 3 3 0 0 0-.43-1.32m-2.97.32c-.36.3-.74.43-1.2.56q-.11 0-.1-.1a3.5 3.5 0 0 0 1.76-1.57s.09-.07.1.04c0 .18-.2.76-.56 1.07m2.89 6.36q-.13.52-.55.88a1.3 1.3 0 0 1-.75.35 1.3 1.3 0 0 1-.77-.35 1.7 1.7 0 0 1-.54-.88.13.13 0 0 1 .15-.15h2.31a.14.14 0 0 1 .15.15M6.15 8.95a1.1 1.1 0 0 1-1.39-.14A1.1 1.1 0 0 1 5.12 7a1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1-.17 1.69m4.96 0a1.1 1.1 0 0 1-1.4-.14 1.1 1.1 0 0 1 .37-1.8 1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1 .24 1.2 1 1 0 0 1-.41.5"/>
1742
- </symbol>`,qG=`<symbol id="file-tree-builtin-c" viewBox="0 0 16 16">
1750
+ </symbol>`,oK=`<symbol id="file-tree-builtin-c" viewBox="0 0 16 16">
1743
1751
  <path fill="currentColor" fill-rule="evenodd" d="M8 1q.084 0 .166.021.098.023.186.075c1.055.624 4.22 2.486 5.277 3.11.085.05.15.112.209.192h-.002l.028.037a.5.5 0 0 1 .103.21q.031.102.033.21v6.29a.71.71 0 0 1-.347.616l-5.307 3.144a.68.68 0 0 1-.693 0l-5.307-3.144A.72.72 0 0 1 2 11.145V4.832a.71.71 0 0 1 .346-.612l5.288-3.126A.7.7 0 0 1 7.992 1zm2.901 4.349a3.75 3.75 0 1 0 0 5.302l-1.06-1.06a2.25 2.25 0 1 1 0-3.182z" clip-rule="evenodd"/>
1744
- </symbol>`,JG=`<symbol id="file-tree-builtin-claude" viewBox="0 0 16 16">
1752
+ </symbol>`,sK=`<symbol id="file-tree-builtin-claude" viewBox="0 0 16 16">
1745
1753
  <path fill="currentColor" d="M3.75 10.31 6.5 8.77l.04-.14-.04-.07h-.14l-.46-.03-1.57-.04-1.38-.07-1.33-.07-.34-.07L1 7.86l.03-.21.28-.18.4.03.89.07 1.33.08.97.06 1.43.16h.22l.03-.1-.07-.05-.06-.06-1.39-.92-1.48-.98-.79-.57-.42-.28-.2-.28-.1-.6.39-.41.52.04.12.03.52.4 1.12.86L6.2 6.04l.2.17.09-.06.01-.04-.1-.15-.76-1.46-.85-1.46-.37-.6-.1-.36a1 1 0 0 1-.06-.42l.42-.59.25-.07.6.08.22.2.36.84.58 1.3.9 1.77.29.53.14.47.04.14h.1v-.07l.07-1 .14-1.22.14-1.57.04-.45.23-.53.42-.28.36.15.28.41-.04.25-.16 1.08-.36 1.7-.21 1.14h.12l.14-.15.58-.76.97-1.2.42-.5.5-.51.32-.25h.6l.44.66-.2.68-.61.79-.52.65-.74 1-.45.8.04.05h.1l1.68-.36.9-.16 1.06-.18.5.23.05.22-.2.48-1.15.28-1.34.28-2 .46-.04.01.03.04.9.09.4.03h.94l1.77.14.46.28.27.37-.04.28-.72.37-.95-.23-2.24-.53-.76-.18h-.11v.06l.64.63L12 10.86l1.48 1.35.07.34-.18.28-.2-.03-1.29-.98-.5-.42-1.12-.95h-.07v.1l.25.38 1.37 2.05.07.63-.1.2-.36.14-.38-.08-.8-1.12-.85-1.26-.66-1.15-.07.05-.4 4.23-.19.21-.42.17-.35-.28-.2-.42.2-.87.23-1.12.18-.9.17-1.1.1-.36v-.03h-.1l-.84 1.16-1.27 1.72-1 1.07-.24.1-.42-.22.04-.39.22-.32 1.4-1.8.84-1.1.57-.64-.02-.07h-.04l-3.7 2.4-.66.09-.28-.28.03-.42.14-.14 1.12-.77z"/>
1746
- </symbol>`,YG=`<symbol id="file-tree-builtin-cpp" viewBox="0 0 16 16">
1754
+ </symbol>`,cK=`<symbol id="file-tree-builtin-cpp" viewBox="0 0 16 16">
1747
1755
  <path fill="currentColor" fill-rule="evenodd" d="M8 1q.084 0 .166.021.098.023.186.075c1.055.624 4.22 2.486 5.277 3.11.085.05.15.112.209.192h-.002l.028.037a.5.5 0 0 1 .103.21q.031.102.033.21v6.29a.71.71 0 0 1-.347.616l-5.307 3.144a.68.68 0 0 1-.693 0l-5.307-3.144A.72.72 0 0 1 2 11.145V4.832a.71.71 0 0 1 .346-.612l5.288-3.126A.7.7 0 0 1 7.992 1zm2.901 4.349a3.75 3.75 0 1 0 0 5.302l-1.06-1.06a2.25 2.25 0 1 1 0-3.182z" clip-rule="evenodd"/>
1748
- </symbol>`,XG=`<symbol id="file-tree-builtin-css" viewBox="0 0 16 16">
1756
+ </symbol>`,lK=`<symbol id="file-tree-builtin-css" viewBox="0 0 16 16">
1749
1757
  <path fill="currentColor" d="M8 15c-5.76 0-7-1.24-7-7V2a1 1 0 0 1 1-1h6c5.77 0 7 1.24 7 7s-1.24 7-7 7" class="vector" opacity=".2"/>
1750
1758
  <path fill="currentColor" d="M10.1 9.19h.73c.03.49.22.6 1 .6.76 0 .93-.12.93-.68 0-.52-.17-.67-.94-.85-1.38-.3-1.68-.56-1.68-1.47 0-1.05.3-1.29 1.67-1.29 1.29 0 1.57.2 1.6 1.13h-.74c-.01-.34-.17-.42-.85-.42-.77 0-.94.1-.94.58 0 .42.17.55.96.73 1.36.3 1.66.58 1.66 1.59 0 1.14-.31 1.39-1.73 1.39-1.39 0-1.69-.24-1.67-1.31m-3.9 0h.74c.03.49.21.6.99.6.76 0 .93-.12.93-.68 0-.52-.17-.67-.93-.85-1.39-.3-1.69-.56-1.69-1.47 0-1.05.3-1.29 1.67-1.29 1.3 0 1.58.2 1.6 1.13h-.73c-.02-.34-.18-.42-.85-.42-.78 0-.95.1-.95.58 0 .42.17.55.96.73 1.37.3 1.67.58 1.67 1.59 0 1.14-.32 1.39-1.74 1.39-1.38 0-1.68-.24-1.66-1.31m-1.22 0h.75c-.09 1.07-.37 1.31-1.56 1.31-1.37 0-1.68-.45-1.68-2.5 0-1.96.36-2.5 1.68-2.5 1.16 0 1.44.25 1.52 1.35h-.76c-.08-.52-.22-.64-.76-.64-.74 0-.9.33-.9 1.78 0 1.47.16 1.8.9 1.8.58 0 .74-.11.8-.6"/>
1751
- </symbol>`,ZG=`<symbol id="file-tree-builtin-database" viewBox="0 0 16 16">
1759
+ </symbol>`,uK=`<symbol id="file-tree-builtin-database" viewBox="0 0 16 16">
1752
1760
  <path fill="currentColor" d="M14.953 9.733a12.4 12.4 0 0 1-.244 1.936c-.207.933-.532 1.58-.996 2.044s-1.11.789-2.044.996C10.73 14.918 9.533 15 8 15s-2.73-.082-3.669-.291c-.933-.207-1.58-.532-2.044-.996s-.789-1.11-.996-2.044c-.122-.547-.2-1.182-.244-1.92q.23.364.532.667c.64.639 1.482 1.031 2.533 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265a4 4 0 0 0 .541-.683"/>
1753
1761
  <path fill="currentColor" d="M14.93 5.924c-.046.663-.118 1.24-.23 1.743-.207.932-.532 1.579-.995 2.042s-1.11.789-2.042.996c-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997s-.789-1.11-.996-2.042a12 12 0 0 1-.227-1.683l.016-.188a4 4 0 0 0 .5.62c.638.639 1.48 1.031 2.532 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265.192-.192.357-.404.506-.633z"/>
1754
1762
  <path fill="currentColor" d="M8 1c1.533 0 2.73.082 3.669.291.933.207 1.58.533 2.044.996.403.404.904.944.91 1.695.004.764-.509 1.318-.918 1.727-.463.463-1.11.789-2.042.996-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997-.406-.406-.915-.953-.915-1.71 0-.758.509-1.305.915-1.712.464-.463 1.11-.789 2.044-.996C5.27 1.082 6.467 1 8 1"/>
1755
- </symbol>`,QG=`<symbol id="file-tree-builtin-default" viewBox="0 0 16 16">
1763
+ </symbol>`,dK=`<symbol id="file-tree-builtin-default" viewBox="0 0 16 16">
1756
1764
  <path fill="currentColor" d="M8 1v3a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1z" class="bg" opacity=".4"/>
1757
1765
  <path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
1758
- </symbol>`,$G=`<symbol id="file-tree-builtin-docker" viewBox="0 0 16 16">
1766
+ </symbol>`,fK=`<symbol id="file-tree-builtin-docker" viewBox="0 0 16 16">
1759
1767
  <path fill="currentColor" d="M15.85 6.54c-.05-.04-.45-.36-1.31-.36q-.34 0-.68.06a2.7 2.7 0 0 0-1.14-1.79l-.23-.14-.15.23a3 3 0 0 0-.4 1q-.24 1.01.26 1.84c-.4.24-1.03.3-1.17.3H.5a.5.5 0 0 0-.5.52q-.01 1.46.46 2.83.55 1.5 1.6 2.18c.79.5 2.08.79 3.54.79q.96 0 1.94-.18a8 8 0 0 0 2.55-.97 7 7 0 0 0 1.73-1.5 10 10 0 0 0 1.7-3.06h.15a2.4 2.4 0 0 0 1.8-.7 2 2 0 0 0 .47-.74l.06-.2z"/>
1760
1768
  <path fill="currentColor" d="M1.48 7.36h1.4a.14.14 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H1.48a.13.13 0 0 0-.13.14v1.32q.02.13.13.13m1.94 0h1.41a.14.14 0 0 0 .13-.13V5.91q-.01-.12-.13-.14h-1.4a.13.13 0 0 0-.13.14v1.32q0 .13.12.13m1.98 0h1.4q.13 0 .14-.13V5.91a.13.13 0 0 0-.14-.14H5.4q-.1.01-.12.14v1.32q0 .13.12.13m1.95 0h1.42q.1 0 .12-.13V5.91q0-.12-.12-.14H7.35q-.1.01-.12.14v1.32q.01.13.12.13M3.42 5.5h1.41c.07 0 .13-.08.13-.15V4.03a.13.13 0 0 0-.13-.14h-1.4q-.12 0-.13.14v1.31q0 .13.12.15m1.98 0h1.4c.08 0 .14-.08.14-.15V4.03q0-.13-.14-.14H5.4q-.1 0-.12.14v1.31q0 .13.12.15m1.95 0h1.42c.06 0 .12-.08.12-.15V4.03q-.01-.13-.12-.14H7.35q-.1 0-.12.14v1.31q.01.13.12.15m0-1.9h1.42q.1-.02.12-.14v-1.3Q8.88 2 8.77 2H7.35q-.1 0-.12.14v1.3q.01.13.12.14m1.97 3.78h1.4a.13.13 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H9.32q-.1.01-.12.14v1.32q.01.13.12.13" opacity=".5"/>
1761
- </symbol>`,eK=`<symbol id="file-tree-builtin-eslint" viewBox="0 0 16 16">
1769
+ </symbol>`,pK=`<symbol id="file-tree-builtin-eslint" viewBox="0 0 16 16">
1762
1770
  <path fill="currentColor" d="M11.16 6.1 8.12 4.35a.3.3 0 0 0-.24 0L4.84 6.1a.3.3 0 0 0-.12.2v3.5q0 .14.12.22l3.04 1.74q.12.08.24 0l3.04-1.74a.2.2 0 0 0 .13-.22V6.3a.3.3 0 0 0-.13-.2" opacity=".5"/>
1763
1771
  <path fill="currentColor" d="m.1 7.69 3.63-6.3A.8.8 0 0 1 4.37 1h7.26c.26 0 .5.17.64.4l3.63 6.27a.8.8 0 0 1 0 .75l-3.63 6.24a.7.7 0 0 1-.64.34H4.37a.7.7 0 0 1-.64-.34L.1 8.41a.7.7 0 0 1 0-.72m3 3.02q.01.15.14.23l4.63 2.66q.13.06.26 0l4.63-2.66a.3.3 0 0 0 .14-.23V5.4a.3.3 0 0 0-.14-.23L8.13 2.52a.3.3 0 0 0-.26 0L3.24 5.17a.3.3 0 0 0-.14.23z"/>
1764
- </symbol>`,tK=`<symbol id="file-tree-builtin-font" viewBox="0 0 16 16">
1772
+ </symbol>`,mK=`<symbol id="file-tree-builtin-font" viewBox="0 0 16 16">
1765
1773
  <path fill="currentColor" d="M12.3 13c-1.59 0-2.68-.99-2.68-2.5 0-1.43 1-2.34 2.88-2.35h2.16v-.83c0-1.08-.62-1.68-1.73-1.68-1.05 0-1.66.54-1.73 1.36H9.93c.09-1.43 1.06-2.48 3.05-2.48 1.75 0 3.02.95 3.02 2.68v5.66h-1.29v-1.02h-.04c-.41.66-1.16 1.16-2.37 1.16m.36-1.12c1.14 0 2-.72 2-1.74v-.96H12.6c-1.12 0-1.6.54-1.6 1.28 0 .97.8 1.42 1.66 1.42m-11.24.98H0L3.8 2h1.39l3.8 10.86H7.54l-1.08-3.2H2.5zm3.09-9.25h-.04l-1.6 4.95H6.1z"/>
1766
- </symbol>`,nK=`<symbol id="file-tree-builtin-git" viewBox="0 0 16 16">
1774
+ </symbol>`,hK=`<symbol id="file-tree-builtin-git" viewBox="0 0 16 16">
1767
1775
  <path fill="currentColor" d="M14.74 7.38 8.62 1.26a.9.9 0 0 0-1.27 0L6.08 2.53l1.61 1.61a1.07 1.07 0 0 1 1.36 1.37l1.55 1.55a1.07 1.07 0 0 1 1.1 1.77 1.07 1.07 0 0 1-1.74-1.16L8.5 6.22v3.8a1.07 1.07 0 1 1-.89-.02V6.15a1.07 1.07 0 0 1-.58-1.4l-1.58-1.6-4.2 4.2a.9.9 0 0 0 0 1.27l6.12 6.12a.9.9 0 0 0 1.27 0l6.09-6.09a.9.9 0 0 0 0-1.27"/>
1768
- </symbol>`,rK=`<symbol id="file-tree-builtin-go" viewBox="0 0 16 16">
1776
+ </symbol>`,gK=`<symbol id="file-tree-builtin-go" viewBox="0 0 16 16">
1769
1777
  <path fill="currentColor" fill-rule="evenodd" d="M4.41 4.57A3.2 3.2 0 0 1 6.87 5q.74.49 1.08 1.29.08.12-.1.16l-1.55.4c-.14.03-.15.04-.27-.1a1 1 0 0 0-.44-.34 1.6 1.6 0 0 0-1.68.14q-.95.61-.94 1.73c0 .73.52 1.33 1.25 1.43q.95.1 1.58-.6l.25-.34h-1.8c-.19 0-.24-.12-.17-.27.12-.28.34-.76.47-1a.3.3 0 0 1 .24-.14h2.98a4 4 0 0 1 .64-1.19 4 4 0 0 1 2.6-1.52 3.5 3.5 0 0 1 2.64.46q1.13.73 1.31 2.04a3.5 3.5 0 0 1-1.06 3.09q-.93.92-2.23 1.17l-.74.08a3.5 3.5 0 0 1-2.27-.8 3 3 0 0 1-.93-1.42 4 4 0 0 1-.39.61 4 4 0 0 1-2.64 1.56 3.3 3.3 0 0 1-2.5-.6 3 3 0 0 1-1.18-2.03 3.5 3.5 0 0 1 .8-2.67 4 4 0 0 1 2.6-1.58M13.1 7.5a1.53 1.53 0 0 0-1.9-1.21q-1.3.3-1.62 1.59a1.5 1.5 0 0 0 .85 1.72q.77.33 1.52-.05a2 2 0 0 0 1.18-1.74q0-.17-.03-.3" clip-rule="evenodd"/>
1770
- </symbol>`,iK=`<symbol id="file-tree-builtin-graphql" viewBox="0 0 16 16">
1778
+ </symbol>`,_K=`<symbol id="file-tree-builtin-graphql" viewBox="0 0 16 16">
1771
1779
  <path fill="currentColor" fill-rule="evenodd" d="M8 1a1.25 1.25 0 0 1 1.18 1.65l2.8 1.61q.33-.25.77-.26a1.25 1.25 0 0 1 .48 2.4v3.2a1.25 1.25 0 1 1-1.25 2.13l-2.8 1.62A1.25 1.25 0 0 1 8 15a1.25 1.25 0 0 1-1.18-1.65l-2.8-1.62q-.33.26-.77.27a1.25 1.25 0 0 1-.48-2.4V6.4a1.25 1.25 0 1 1 1.25-2.14l2.8-1.61A1.25 1.25 0 0 1 8 1M4.44 11.14l-.06.13 2.75 1.58a1.25 1.25 0 0 1 1.74 0l2.74-1.58-.05-.13zm3.89-7.68a1.3 1.3 0 0 1-.66 0L4.03 9.77q.37.3.45.78h7.04q.08-.48.45-.78zM4.38 4.73a1.24 1.24 0 0 1-1.02 1.76v3.02l.13.01 3.67-6.35-.03-.02zm4.46-1.56 3.67 6.35.13-.01V6.49a1.25 1.25 0 0 1-1.03-1.76L8.87 3.15z" clip-rule="evenodd"/>
1772
- </symbol>`,aK=`<symbol id="file-tree-builtin-html" viewBox="0 0 16 16">
1780
+ </symbol>`,vK=`<symbol id="file-tree-builtin-html" viewBox="0 0 16 16">
1773
1781
  <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
1774
1782
  <path fill="currentColor" d="M10.48 3.76a.5.5 0 0 1 .4.58L10.6 5.8h1.14a.5.5 0 0 1 0 1h-1.32L10 9.2h1.08a.5.5 0 0 1 0 1H9.8l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H6.4l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H4.25a.5.5 0 0 1 0-1h1.32L6 6.8H4.93a.5.5 0 0 1 0-1H6.2l.3-1.64a.5.5 0 1 1 .98.18L7.2 5.8h2.4l.3-1.64a.5.5 0 0 1 .58-.4M6.58 9.2h2.4l.44-2.4h-2.4z" class="fg"/>
1775
- </symbol>`,oK=`<symbol id="file-tree-builtin-image" viewBox="0 0 16 16">
1783
+ </symbol>`,yK=`<symbol id="file-tree-builtin-image" viewBox="0 0 16 16">
1776
1784
  <path fill="currentColor" d="M12.5 2A2.5 2.5 0 0 1 15 4.5v4.67l-4.05-3.54-4.08 4.08-3-2L1 10.6V4.5A2.5 2.5 0 0 1 3.5 2z" opacity=".3"/>
1777
1785
  <path fill="currentColor" d="M15 10.5v1a2.5 2.5 0 0 1-2.5 2.5h-9a2.5 2.5 0 0 1-2.46-2.04L4 9l3 2 4-4zm-7-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"/>
1778
- </symbol>`,sK=`<symbol id="file-tree-builtin-javascript" viewBox="0 0 16 16">
1786
+ </symbol>`,bK=`<symbol id="file-tree-builtin-javascript" viewBox="0 0 16 16">
1779
1787
  <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
1780
1788
  <path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66M3.5 9.5h.98c0 .76.15.92.85.92.77 0 .94-.18.94-1.02V5.1h1v4.34c0 1.54-.35 1.87-1.92 1.87-1.55 0-1.89-.32-1.86-1.8"/>
1781
- </symbol>`,cK=`<symbol id="file-tree-builtin-json" viewBox="0 0 16 16">
1789
+ </symbol>`,xK=`<symbol id="file-tree-builtin-json" viewBox="0 0 16 16">
1782
1790
  <path fill="currentColor" d="M13.25 11.5V9.75a.5.5 0 0 1 .36-.48l.55-.15a1.16 1.16 0 0 0 0-2.24l-.55-.15a.5.5 0 0 1-.36-.48V4.5a2.5 2.5 0 0 0-2.5-2.5h-.25a.5.5 0 0 0 0 1h.25a1.5 1.5 0 0 1 1.5 1.5v1.75a1.5 1.5 0 0 0 1.09 1.44l.54.15a.16.16 0 0 1 0 .32l-.54.15a1.5 1.5 0 0 0-1.09 1.44v1.75a1.5 1.5 0 0 1-1.5 1.5h-.25a.5.5 0 0 0 0 1h.25a2.5 2.5 0 0 0 2.5-2.5m-10.5 0V9.75a.5.5 0 0 0-.36-.48l-.55-.15a1.16 1.16 0 0 1 0-2.24l.55-.15a.5.5 0 0 0 .36-.48V4.5A2.5 2.5 0 0 1 5.25 2h.25a.5.5 0 0 1 0 1h-.25a1.5 1.5 0 0 0-1.5 1.5v1.75a1.5 1.5 0 0 1-1.09 1.44l-.54.15a.16.16 0 0 0 0 .32l.54.15a1.5 1.5 0 0 1 1.09 1.45v1.74a1.5 1.5 0 0 0 1.5 1.5h.25a.5.5 0 0 1 0 1h-.25a2.5 2.5 0 0 1-2.5-2.5"/>
1783
- </symbol>`,lK=`<symbol id="file-tree-builtin-markdown" viewBox="0 0 16 16">
1791
+ </symbol>`,SK=`<symbol id="file-tree-builtin-markdown" viewBox="0 0 16 16">
1784
1792
  <path fill="currentColor" d="M1 12V4h2l2 2.5L7 4h2v8H7V7.5l-2 2-2-2V12zm9-3 3 3.5L16 9h-2V4h-2v5z"/>
1785
- </symbol>`,uK=`<symbol id="file-tree-builtin-mcp" viewBox="0 0 16 16">
1793
+ </symbol>`,CK=`<symbol id="file-tree-builtin-mcp" viewBox="0 0 16 16">
1786
1794
  <path fill="currentColor" d="M9.26-.04a3 3 0 0 1 2 .82 2.8 2.8 0 0 1 .8 2.35 2.9 2.9 0 0 1 2.41.8l.03.02a2.74 2.74 0 0 1 0 3.94l-5.8 5.69-.04.06-.02.07q0 .04.02.07.01.04.04.06l1.2 1.17a.55.55 0 0 1 0 .79.6.6 0 0 1-.81 0l-1.2-1.17a1.3 1.3 0 0 1 0-1.84L13.7 7.1a1.65 1.65 0 0 0 .37-1.82 2 2 0 0 0-.37-.54l-.03-.03a1.73 1.73 0 0 0-2.4 0L6.47 9.4l-.07.06a.58.58 0 0 1-.92-.18.6.6 0 0 1 .12-.6l4.85-4.76a1.65 1.65 0 0 0 0-2.36 1.73 1.73 0 0 0-2.4 0l-6.43 6.3a.6.6 0 0 1-.8 0 .55.55 0 0 1 0-.8L7.25.79a3 3 0 0 1 2-.82"/>
1787
1795
  <path fill="currentColor" d="M9.26 2.19a.6.6 0 0 1 .52.34.6.6 0 0 1 0 .43l-.12.18L4.9 7.79a1.65 1.65 0 0 0 0 2.36 1.73 1.73 0 0 0 2.4 0l4.75-4.66a.58.58 0 0 1 .93.18.6.6 0 0 1-.12.61l-4.75 4.66a2.9 2.9 0 0 1-4.01 0 2.75 2.75 0 0 1-.62-3.04A3 3 0 0 1 4.1 7l4.74-4.65a.6.6 0 0 1 .4-.16"/>
1788
- </symbol>`,dK=`<symbol id="file-tree-builtin-nextjs" viewBox="0 0 16 16">
1796
+ </symbol>`,wK=`<symbol id="file-tree-builtin-nextjs" viewBox="0 0 16 16">
1789
1797
  <defs>
1790
1798
  <linearGradient id="a" x1="4.522" x2="14" y1="3.943" y2="16" gradientUnits="userSpaceOnUse">
1791
1799
  <stop stop-color="currentColor"/>
@@ -1795,82 +1803,82 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1795
1803
  <path fill="currentColor" d="M3 2h1.522v9.09H3z"/>
1796
1804
  <path fill="url(#a)" d="M4.903 2 15 15.075q-.565.5-1.195.925L4.522 3.943z"/>
1797
1805
  <path fill="currentColor" d="M12.172 2h-1.508v9.094h1.508z"/>
1798
- </symbol>`,fK=`<symbol id="file-tree-builtin-npm" viewBox="0 0 16 16">
1806
+ </symbol>`,TK=`<symbol id="file-tree-builtin-npm" viewBox="0 0 16 16">
1799
1807
  <path fill="currentColor" d="M2 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z" class="vector" opacity=".2"/>
1800
1808
  <path fill="currentColor" d="M10.5 13H13V3H3v10h5V5.5h2.5z"/>
1801
- </symbol>`,pK=`<symbol id="file-tree-builtin-oxc" viewBox="0 0 16 16">
1809
+ </symbol>`,EK=`<symbol id="file-tree-builtin-oxc" viewBox="0 0 16 16">
1802
1810
  <path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .5.5V3h3.5a.5.5 0 0 1 .38.83L10.5 7.69v1.44q.41.04.95-.16a4 4 0 0 0 .72-.35l.04-.03h.01a.5.5 0 0 1 .67.1l2 2.5a.5.5 0 0 1 0 .62c-.76.96-3.14 2.69-6.89 2.69s-6.13-1.73-6.89-2.69a.5.5 0 0 1 0-.62l2-2.5a.5.5 0 0 1 .67-.1l.05.03.16.09q.22.13.56.26.54.2.95.16V7.69L2.12 3.83A.5.5 0 0 1 2.5 3H6V1.5a.5.5 0 0 1 .5-.5zM7 3.5a.5.5 0 0 1-.5.5H3.6l2.78 3.17a.5.5 0 0 1 .12.33v2a.5.5 0 0 1-.28.45c-.7.35-1.5.15-2.02-.05a5 5 0 0 1-.58-.26l-1.46 1.84c.82.78 2.8 2.02 5.84 2.02s5.02-1.24 5.84-2.02l-1.46-1.83a5 5 0 0 1-.58.26c-.52.2-1.33.39-2.02.04a.5.5 0 0 1-.28-.45v-2a.5.5 0 0 1 .12-.33L12.4 4H9.5a.5.5 0 0 1-.5-.5V2H7z"/>
1803
- </symbol>`,mK=`<symbol id="file-tree-builtin-postcss" viewBox="0 0 16 16">
1811
+ </symbol>`,DK=`<symbol id="file-tree-builtin-postcss" viewBox="0 0 16 16">
1804
1812
  <path fill="currentColor" d="M14.5 8a6.5 6.5 0 0 0-5.9-6.47l5.42 8.93A7 7 0 0 0 14.5 8M2.88 12A6.5 6.5 0 0 0 8 14.5c2.08 0 3.93-.98 5.12-2.5zm8.62-1h1.68L11.5 8.24zm-1-.55a4 4 0 0 1-.7.55h.7zM8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M5.5 11h.7a4 4 0 0 1-.7-.55zm-2.68 0H4.5V8.24zm3.76-6.2A4 4 0 0 1 8 4.5q.76 0 1.42.3L8 2.46zM1.5 8q0 1.31.48 2.46L7.4 1.53A6.5 6.5 0 0 0 1.5 8m14 0a7.5 7.5 0 0 1-.99 3.72l-.01.03-.02.03A7.5 7.5 0 0 1 8 15.5a7.5 7.5 0 0 1-6.5-3.75l-.01-.03A7.5 7.5 0 1 1 15.5 8"/>
1805
- </symbol>`,hK=`<symbol id="file-tree-builtin-prettier" viewBox="0 0 16 16">
1813
+ </symbol>`,OK=`<symbol id="file-tree-builtin-prettier" viewBox="0 0 16 16">
1806
1814
  <path fill="currentColor" d="M6 12v1H4.93v-1zm1-2v1H2v-1zm6-4v1h-3V6zm-1-4v1H9V2z"/>
1807
1815
  <path fill="currentColor" d="M11.5 10v1H8v-1zM5 6v1H2V6zm5-2v1H9V4z" opacity=".8"/>
1808
1816
  <path fill="currentColor" d="M6 14v1H2v-1zm-.5-6v1H2V8zM13 4v1h-3V4zM4.93 2v1H2V2z" opacity=".6"/>
1809
1817
  <path fill="currentColor" d="M4.93 12v1H2v-1zM13 8v1H9V8zM5.5 4v1H2V4zM9 2v1H4.93V2z" opacity=".4"/>
1810
- </symbol>`,gK=`<symbol id="file-tree-builtin-python" viewBox="0 0 16 16">
1818
+ </symbol>`,kK=`<symbol id="file-tree-builtin-python" viewBox="0 0 16 16">
1811
1819
  <path fill="currentColor" d="M8.33 8.4H10c1.16 0 1.9-.73 1.9-1.86V5.08q0-.24.25-.24h.74c.75 0 1.33.32 1.66.97q.4.73.41 1.46c.09.9.09 1.78-.24 2.67-.25.73-.75 1.3-1.58 1.46h-4.8c-.08 0-.25 0-.25.08v.4s.17.09.25.09h2.82q.34-.02.33.32v1.06c0 .56-.25.97-.75 1.13-.41.16-.83.33-1.24.4a7 7 0 0 1-2.98-.07 3 3 0 0 1-1.16-.49c-.33-.32-.58-.65-.5-1.14v-2.91c0-1.13.67-1.78 1.82-1.78q.89-.1 1.66-.08m2.32 4.86a.65.65 0 0 0-.66-.65c-.34 0-.67.33-.67.65s.33.57.67.65a.65.65 0 0 0 .66-.65" class="bg" opacity=".8"/>
1812
1820
  <path fill="currentColor" d="M7.67 7.6H6c-1.16 0-1.9.73-1.9 1.86v1.46q0 .24-.25.24h-.74c-.75 0-1.33-.32-1.66-.97a3 3 0 0 1-.41-1.46 6 6 0 0 1 .24-2.67c.25-.73.75-1.3 1.58-1.46h4.8c.08 0 .25 0 .25-.08v-.4s-.17-.09-.25-.09H4.85c-.24 0-.33-.08-.33-.32V2.65c0-.56.25-.97.75-1.13.41-.16.83-.33 1.24-.4a7 7 0 0 1 2.98.07c.41.09.83.25 1.16.49.33.32.58.65.5 1.13v2.92c0 1.14-.67 1.78-1.82 1.78-.58.08-1.16.08-1.66.08M5.35 2.73c0 .33.25.65.66.65.33 0 .66-.32.66-.65 0-.32-.33-.56-.66-.64a.65.65 0 0 0-.66.64" class="fg"/>
1813
- </symbol>`,_K=`<symbol id="file-tree-builtin-react" viewBox="0 0 16 16">
1821
+ </symbol>`,AK=`<symbol id="file-tree-builtin-react" viewBox="0 0 16 16">
1814
1822
  <path fill="currentColor" d="M8 6.65c.73 0 1.31.6 1.31 1.35S8.73 9.35 8 9.35 6.69 8.75 6.69 8 7.27 6.65 8 6.65"/>
1815
1823
  <path fill="currentColor" fill-rule="evenodd" d="M8 2.55c1.3-.99 2.59-1.34 3.5-.8.92.55 1.27 1.87 1.08 3.53C14.06 5.94 15 6.9 15 8s-.94 2.06-2.42 2.72c.19 1.65-.16 2.98-1.08 3.52-.91.55-2.2.2-3.5-.8-1.3 1-2.58 1.35-3.5.8-.91-.54-1.27-1.87-1.08-3.52C1.94 10.06 1 9.1 1 8s.94-2.06 2.42-2.72c-.19-1.66.17-2.98 1.08-3.52s2.2-.2 3.5.8M4.26 11.2c-.08 1.34.28 2.03.68 2.26s1.15.22 2.25-.52l.11-.09a12 12 0 0 1-1.24-1.39 11 11 0 0 1-1.8-.41zm7.47-.15q-.83.27-1.79.41-.6.8-1.24 1.4l.11.08c1.1.74 1.86.76 2.25.52.4-.23.76-.92.68-2.26zm-3.04.54a14 14 0 0 1-1.38 0q.34.38.69.7.35-.32.7-.7M8 5.29q-.76 0-1.47.1A13 13 0 0 0 5.07 8a14 14 0 0 0 1.46 2.62 13 13 0 0 0 2.94 0A13 13 0 0 0 10.93 8a14 14 0 0 0-1.46-2.62A13 13 0 0 0 8 5.3M4.64 9.18q-.15.5-.25.96.44.16.94.27a15 15 0 0 1-.7-1.23m6.73 0a15 15 0 0 1-.7 1.23q.5-.11.95-.27a10 10 0 0 0-.25-.96M3.44 6.26C2.27 6.86 1.87 7.53 1.87 8s.4 1.14 1.57 1.74l.13.07q.18-.88.55-1.81a12 12 0 0 1-.55-1.8q-.07.02-.13.06m8.99-.07A12 12 0 0 1 11.88 8q.36.94.55 1.8l.13-.06c1.17-.6 1.56-1.27 1.56-1.74s-.39-1.14-1.56-1.74zm-7.1-.6q-.5.11-.94.27.1.46.25.96a15 15 0 0 1 .69-1.23m5.34 0a15 15 0 0 1 .7 1.23q.14-.5.24-.96-.44-.15-.94-.27M7.18 3.06c-1.09-.74-1.85-.76-2.24-.52s-.76.92-.69 2.26l.01.15a11 11 0 0 1 1.8-.41q.6-.8 1.24-1.4zm3.88-.52c-.4-.24-1.15-.22-2.25.52l-.12.08q.65.6 1.25 1.4.96.15 1.8.41v-.14c.08-1.35-.28-2.04-.68-2.27M8 3.7a10 10 0 0 0-.7.7 14 14 0 0 1 1.4 0 10 10 0 0 0-.7-.7" clip-rule="evenodd"/>
1816
- </symbol>`,vK=`<symbol id="file-tree-builtin-ruby" viewBox="0 0 16 16">
1824
+ </symbol>`,jK=`<symbol id="file-tree-builtin-ruby" viewBox="0 0 16 16">
1817
1825
  <path fill="currentColor" fill-rule="evenodd" d="M11.04 2c.48 0 .92.23 1.18.6l2.54 3.65c.37.52.3 1.23-.15 1.69l-5.58 5.64a1.47 1.47 0 0 1-2.06 0L1.39 7.94a1.3 1.3 0 0 1-.15-1.7l2.54-3.63q.2-.3.5-.45.33-.16.68-.16zm.84 2.17a.5.5 0 0 0-.7-.05L8 6.84 4.83 4.12a.5.5 0 0 0-.65.76L6.65 7H3.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1H9.35l2.48-2.12a.5.5 0 0 0 .05-.7" clip-rule="evenodd"/>
1818
- </symbol>`,yK=`<symbol id="file-tree-builtin-rust" viewBox="0 0 16 16">
1826
+ </symbol>`,MK=`<symbol id="file-tree-builtin-rust" viewBox="0 0 16 16">
1819
1827
  <path fill="currentColor" fill-rule="evenodd" d="M8 .8a.2.2 0 0 1 .18.1l.38.6.16.02.5-.53.01-.01a.2.2 0 0 1 .33.08l.25.68.16.05.59-.43h.02a.2.2 0 0 1 .3.14l.12.71.15.08.65-.3a.2.2 0 0 1 .2.02.2.2 0 0 1 .1.18l-.03.72.12.1.71-.16a.2.2 0 0 1 .25.25l-.17.7q.06.06.1.13l.73-.03A.2.2 0 0 1 14 4a.2.2 0 0 1 .02.2l-.3.66.08.14.71.12a.2.2 0 0 1 .14.32l-.43.59.05.16.68.25a.2.2 0 0 1 .07.35l-.53.49.01.16.62.38a.2.2 0 0 1 0 .36l-.62.38-.01.16.53.5a.2.2 0 0 1-.07.34l-.68.25-.05.16.43.59a.2.2 0 0 1-.14.32l-.72.12-.07.15.3.65a.2.2 0 0 1-.02.2.2.2 0 0 1-.18.1l-.72-.03-.1.13.16.7a.2.2 0 0 1-.25.25l-.7-.17-.13.1.03.73a.2.2 0 0 1-.1.18.2.2 0 0 1-.2.02l-.66-.3-.14.08-.12.71a.2.2 0 0 1-.32.14l-.59-.43-.16.05-.25.68a.2.2 0 0 1-.34.07l-.5-.53-.16.01-.38.62a.2.2 0 0 1-.36 0l-.38-.62-.16-.01-.5.53a.2.2 0 0 1-.34-.07l-.25-.68-.16-.05-.59.43a.2.2 0 0 1-.32-.14L5 13.78l-.15-.07-.65.3a.2.2 0 0 1-.2-.02.2.2 0 0 1-.1-.18l.03-.72-.13-.1-.7.16a.2.2 0 0 1-.25-.25l.17-.7-.1-.13-.73.03a.2.2 0 0 1-.2-.3l.3-.66-.08-.14-.71-.12a.2.2 0 0 1-.14-.32l.43-.59-.05-.16-.68-.25A.2.2 0 0 1 1 9.22l.53-.5-.02-.16-.6-.38A.2.2 0 0 1 .8 8a.2.2 0 0 1 .1-.18l.6-.38.02-.16-.53-.5a.2.2 0 0 1 .07-.34l.68-.25.05-.16-.43-.59a.2.2 0 0 1 .14-.32L2.2 5l.08-.15L2 4.2a.2.2 0 0 1 .2-.3l.72.03.1-.13-.16-.7a.2.2 0 0 1 .25-.25l.7.16.13-.1-.03-.72A.2.2 0 0 1 4 2a.2.2 0 0 1 .2-.02l.65.3L5 2.2l.12-.71v-.03a.2.2 0 0 1 .32-.1l.59.41.16-.04.25-.68.01-.02A.2.2 0 0 1 6.8.99l.49.53.16-.02.38-.61.02-.02A.2.2 0 0 1 8 .79M6.8 9.45h1.26l.06.01q.03.01.03.05v1.52q0 .07-.09.06h-4.5A5.4 5.4 0 0 0 8 13.42a5.4 5.4 0 0 0 4.45-2.33h-2.42c-.36 0-.68-.5-.77-.75-.08-.22-.2-.91-.25-1.12-.15-.61-.59-.71-.78-.73H6.8zM8 2.58a5.4 5.4 0 0 0-4.07 1.85h5.74l.17.02c.23.03.6.12.96.35.34.23.83.68.83 1.4 0 .66-.55 1.16-1.08 1.5.42.33.7.53.86 1.44.04.17.34.32.62.29.29-.03.62-.16.62-.75v-.24q0-.1.07-.1h.68A5.43 5.43 0 0 0 8 2.59M2.96 6.03a5.4 5.4 0 0 0-.19 3.37h1.66V6.03zM6.8 7.06h1.66c.35 0 .77-.12.77-.47 0-.42-.55-.53-.65-.53H6.8z" clip-rule="evenodd"/>
1820
- </symbol>`,bK=`<symbol id="file-tree-builtin-sass" viewBox="0 0 16 16">
1828
+ </symbol>`,NK=`<symbol id="file-tree-builtin-sass" viewBox="0 0 16 16">
1821
1829
  <path fill="currentColor" fill-rule="evenodd" d="M8.08 1.44c2.41-.91 4.96-.37 5.35 1.27.39 1.62-.92 3.56-2.6 4.25a5 5 0 0 1-3.26.35c-.58-.2-.92-.62-1-.85-.03-.09-.09-.24 0-.3.05-.03.08-.02.22.15s.7.6 1.75.48c2.78-.34 4.45-2.64 3.92-3.88-.37-.87-2.5-1.26-5.18.16C4.03 4.81 3.85 6.24 3.82 6.8c-.08 1.5 1.73 2.28 2.7 3.4q.04.03.07.08c.3-.12.7-.19 1.35-.2 1.58-.03 2.47 1.08 2.43 2.08-.03.78-.7 1.1-.82 1.13-.1.01-.14.02-.15-.06q-.03-.06.13-.15c.16-.09.42-.3.48-.72.05-.43-.24-1.44-1.76-1.63a3 3 0 0 0-1.33.08c.27.62.32 1.87-.29 2.83-.63 1-1.8 1.61-2.93 1.27-.37-.1-.93-.92-.45-2.05.46-1.07 2.4-2.12 2.66-2.26-.9-.83-3.08-1.95-3.4-3.65-.08-.49.13-1.65 1.46-2.98a12 12 0 0 1 4.11-2.52m-1.88 9.7c-.01.01-.9.47-1.52 1.17-.59.66-.75 1.48-.43 1.69.3.18 1-.04 1.51-.62a3 3 0 0 0 .5-.9q.2-.64.02-1.39z" clip-rule="evenodd"/>
1822
- </symbol>`,xK=`<symbol id="file-tree-builtin-stylelint" viewBox="0 0 16 16">
1830
+ </symbol>`,PK=`<symbol id="file-tree-builtin-stylelint" viewBox="0 0 16 16">
1823
1831
  <path fill="currentColor" d="M4 3v3.5l1.5-1L7 15 .5 6l1-1.5L0 3l2.5-2h1zm12 0-1.5 1.5 1 1.5L9 15l1.5-9.5 1.5 1V3l.5-2h1zm-8 8.5a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1"/>
1824
1832
  <path fill="currentColor" d="M6.5 2.5V4l-2 1.5v-4zm5 3L9.5 4V2.5l2-1zM9 4H7V2.5h2z"/>
1825
- </symbol>`,SK=`<symbol id="file-tree-builtin-svelte" viewBox="0 0 16 16">
1833
+ </symbol>`,FK=`<symbol id="file-tree-builtin-svelte" viewBox="0 0 16 16">
1826
1834
  <path fill="currentColor" d="m3.98 3.7 3.36-2.08a4.5 4.5 0 0 1 5.9 1.23 4 4 0 0 1 .7 3.02q-.16.75-.58 1.4c.42.77.56 1.66.4 2.52a3.7 3.7 0 0 1-1.57 2.4l-.17.1-3.36 2.09a4.5 4.5 0 0 1-5.9-1.23 4 4 0 0 1-.66-1.44 4 4 0 0 1-.04-1.58 4 4 0 0 1 .58-1.4 4 4 0 0 1-.4-2.52 3.7 3.7 0 0 1 1.57-2.4zl3.36-2.08zm7.87 0a2.7 2.7 0 0 0-1.26-.95 2.7 2.7 0 0 0-1.6-.07 3 3 0 0 0-.52.2l-.16.09-3.36 2.08a2 2 0 0 0-.69.64 2 2 0 0 0-.36.86 2.3 2.3 0 0 0 .42 1.81A2.7 2.7 0 0 0 7.18 9.4q.28-.06.53-.2l.16-.09 1.28-.79.2-.09a.8.8 0 0 1 .87.31.7.7 0 0 1 .13.55.7.7 0 0 1-.24.4l-.08.05-3.36 2.08-.2.09a1 1 0 0 1-.49-.02 1 1 0 0 1-.38-.3 1 1 0 0 1-.13-.37v-.1l.01-.13-.13-.03a4 4 0 0 1-1.1-.5l-.2-.14-.18-.12-.07.18-.08.3a2.3 2.3 0 0 0 .43 1.82q.45.64 1.19.93.73.28 1.51.14l.16-.04q.27-.07.52-.2l.16-.09 3.36-2.08q.4-.25.69-.64.27-.4.36-.86a2.3 2.3 0 0 0-.42-1.82 2.7 2.7 0 0 0-1.27-.95 2.7 2.7 0 0 0-1.6-.08q-.27.07-.52.2l-.16.1-1.28.79-.2.09a1 1 0 0 1-.49-.03 1 1 0 0 1-.38-.29.7.7 0 0 1-.13-.54.7.7 0 0 1 .24-.4l.08-.06L9.33 4.4l.2-.1a.8.8 0 0 1 .87.32 1 1 0 0 1 .13.38v.22l.11.04q.6.18 1.12.5l.2.14.17.12.06-.19.08-.3a2.3 2.3 0 0 0-.42-1.81z"/>
1827
- </symbol>`,CK=`<symbol id="file-tree-builtin-svg" viewBox="0 0 16 16">
1835
+ </symbol>`,IK=`<symbol id="file-tree-builtin-svg" viewBox="0 0 16 16">
1828
1836
  <path fill="currentColor" d="M5 7a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2z"/>
1829
1837
  <path fill="currentColor" d="M6 1a5 5 0 0 1 4.58 3H7a3 3 0 0 0-3 3v3.58A5 5 0 0 1 6 1" opacity=".5"/>
1830
- </symbol>`,wK=`<symbol id="file-tree-builtin-svgo" viewBox="0 0 16 16">
1838
+ </symbol>`,LK=`<symbol id="file-tree-builtin-svgo" viewBox="0 0 16 16">
1831
1839
  <path fill="currentColor" d="M9.43 4.8A.6.6 0 1 1 9.19 6l-.56.96a1.2 1.2 0 0 1 .32 1.58l.7.53a.89.89 0 1 1-.17.22l-.7-.52a1.2 1.2 0 0 1-1.4.25l-.56.87a.75.75 0 1 1-.57-.2 1 1 0 0 1 .32.05l.56-.87a1.2 1.2 0 0 1-.4-1.24l-1.2-.47a.56.56 0 1 1 .1-.28v.02l1.2.47a1.2 1.2 0 0 1 1.56-.55l.56-.97a.6.6 0 0 1-.15-.64.6.6 0 0 1 .63-.4"/>
1832
1840
  <path fill="currentColor" fill-rule="evenodd" d="M9.17 1q.16.63.27 1.26a6 6 0 0 1 1.61.67q.52-.38 1.08-.71l1.65 1.64q-.32.56-.68 1.05.48.78.72 1.67.6.09 1.18.25v2.32q-.55.15-1.11.24a6 6 0 0 1-.7 1.82q.31.44.59.91l-1.65 1.65-.85-.55a6 6 0 0 1-1.9.83q-.08.47-.2.95H6.84q-.12-.46-.2-.93a6 6 0 0 1-1.96-.81q-.39.27-.8.51l-1.65-1.65q.25-.43.53-.84a6 6 0 0 1-.75-1.9L1 9.16V6.83q.54-.14 1.09-.24a6 6 0 0 1 .77-1.74q-.33-.47-.63-.98l1.65-1.65q.54.32 1.03.68a6 6 0 0 1 1.66-.66q.1-.61.26-1.24zM7.96 3.73a4 4 0 0 0-1.74.36 4.5 4.5 0 0 0-2.3 2.3 4.4 4.4 0 0 0-.1 3.29l.03.06a4.4 4.4 0 0 0 2.4 2.47 4.4 4.4 0 0 0 3.48-.02l.03-.02a4.4 4.4 0 0 0 2.3-2.42l.06-.14a4.4 4.4 0 0 0-.2-3.4 4.4 4.4 0 0 0-2.13-2.07L9.47 4a4 4 0 0 0-1.51-.27" clip-rule="evenodd"/>
1833
- </symbol>`,TK=`<symbol id="file-tree-builtin-swift" viewBox="0 0 16 16">
1841
+ </symbol>`,RK=`<symbol id="file-tree-builtin-swift" viewBox="0 0 16 16">
1834
1842
  <path fill="currentColor" d="M9.63 1c6.15 4.35 4.16 9.15 4.16 9.15s1.75 2.05 1.04 3.85c0 0-.72-1.26-1.93-1.26-1.17 0-1.85 1.26-4.2 1.26C3.47 14 1 9.46 1 9.46c4.71 3.22 7.93.94 7.93.94C6.8 9.12 2.29 3 2.29 3c3.93 3.47 5.63 4.39 5.63 4.39-1.01-.87-3.86-5.13-3.86-5.13C6.34 4.66 10.86 8 10.86 8c1.28-3.7-1.23-7-1.23-7"/>
1835
- </symbol>`,EK=`<symbol id="file-tree-builtin-table" viewBox="0 0 16 16">
1843
+ </symbol>`,zK=`<symbol id="file-tree-builtin-table" viewBox="0 0 16 16">
1836
1844
  <path fill="currentColor" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" opacity=".4"/>
1837
1845
  <path fill="currentColor" d="M11.5 8a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5zM5 12h2.5v-1H5zm3.5 0H11v-1H8.5zM5 10h2.5V9H5zm3.5 0H11V9H8.5zm1-9a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
1838
- </symbol>`,DK=`<symbol id="file-tree-builtin-tailwind" viewBox="0 0 16 16">
1846
+ </symbol>`,BK=`<symbol id="file-tree-builtin-tailwind" viewBox="0 0 16 16">
1839
1847
  <path fill="currentColor" fill-rule="evenodd" d="M8 4Q5.2 4 4.5 6.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C8.98 7.23 9.77 8 11.5 8q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C10.52 4.77 9.73 4 8 4M4.5 8Q1.7 8 1 10.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C5.48 11.23 6.26 12 8 12q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C7.02 8.77 6.24 8 4.5 8" clip-rule="evenodd"/>
1840
- </symbol>`,OK=`<symbol id="file-tree-builtin-terraform" viewBox="0 0 16 16">
1848
+ </symbol>`,VK=`<symbol id="file-tree-builtin-terraform" viewBox="0 0 16 16">
1841
1849
  <path fill="currentColor" d="M1 0v5.05l4.35 2.53V2.53zm9.18 5.34L5.83 2.82v5.05l4.35 2.53zm.47 5.06V5.34L15 2.82v5.05zm-.48 5.6-4.35-2.53V8.42l4.35 2.53z"/>
1842
- </symbol>`,kK=`<symbol id="file-tree-builtin-text" viewBox="0 0 16 16">
1850
+ </symbol>`,HK=`<symbol id="file-tree-builtin-text" viewBox="0 0 16 16">
1843
1851
  <path fill="currentColor" fill-rule="evenodd" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" clip-rule="evenodd" opacity=".4"/>
1844
1852
  <path fill="currentColor" d="M8.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zm2-2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1zm-1-8a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z"/>
1845
- </symbol>`,AK=`<symbol id="file-tree-builtin-typescript" viewBox="0 0 16 16">
1853
+ </symbol>`,UK=`<symbol id="file-tree-builtin-typescript" viewBox="0 0 16 16">
1846
1854
  <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
1847
1855
  <path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66m-3 1.57V5.99H3.5v-.9h4.21v.9H6.1v5.22z"/>
1848
- </symbol>`,jK=`<symbol id="file-tree-builtin-vite" viewBox="0 0 16 16">
1856
+ </symbol>`,WK=`<symbol id="file-tree-builtin-vite" viewBox="0 0 16 16">
1849
1857
  <path fill="currentColor" d="M8.57 14.87c-.18.26-.55.11-.55-.22v-3.18l-.05-.27-.13-.22-.2-.15-.24-.06H4.29c-.26 0-.4-.32-.26-.55L6.08 7c.3-.46 0-1.1-.5-1.1H1.8c-.25 0-.4-.32-.25-.56l2.65-4.2A.3.3 0 0 1 4.46 1h7.9c.26 0 .4.32.26.55l-2.05 3.23c-.29.46 0 1.1.5 1.1h3.12c.26 0 .4.34.24.57z"/>
1850
- </symbol>`,MK=`<symbol id="file-tree-builtin-vscode" viewBox="0 0 16 16">
1858
+ </symbol>`,GK=`<symbol id="file-tree-builtin-vscode" viewBox="0 0 16 16">
1851
1859
  <path fill="currentColor" d="m5.11 9.68-2.4 1.84a.6.6 0 0 1-.75-.04l-.77-.7a.6.6 0 0 1 0-.87L3.28 8zm5.52-8.42a.51.51 0 0 1 .87.36V4.8L7.32 8 5.1 6.32z" opacity=".75"/>
1852
1860
  <path fill="currentColor" d="M11.1 14.99h.03zM1.96 4.52a.6.6 0 0 1 .75-.04l8.8 6.71v3.19a.51.51 0 0 1-.88.36L1.19 6.1a.6.6 0 0 1 0-.87z" opacity=".65"/>
1853
1861
  <path fill="currentColor" d="M11.62 14.91a.9.9 0 0 1-1-.17.51.51 0 0 0 .88-.36V1.62a.51.51 0 0 0-.87-.36.9.9 0 0 1 1-.17l2.87 1.39a.9.9 0 0 1 .5.8v9.44a.9.9 0 0 1-.5.8z"/>
1854
- </symbol>`,NK=`<symbol id="file-tree-builtin-vue" viewBox="0 0 16 16">
1862
+ </symbol>`,KK=`<symbol id="file-tree-builtin-vue" viewBox="0 0 16 16">
1855
1863
  <path fill="currentColor" d="M9.62 2.25 8 5.02 6.38 2.25H1l7 12 7-12z" opacity=".5"/>
1856
1864
  <path fill="currentColor" d="M9.54 2.25 8 4.95l-1.54-2.7H4l4 7 4-7z"/>
1857
- </symbol>`,PK=`<symbol id="file-tree-builtin-wasm" viewBox="0 0 16 16">
1865
+ </symbol>`,qK=`<symbol id="file-tree-builtin-wasm" viewBox="0 0 16 16">
1858
1866
  <path fill="currentColor" d="M13 1a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h3a2 2 0 1 0 4 0z" class="subtract" opacity=".2"/>
1859
1867
  <path fill="currentColor" d="M4.64 11.4h.02l.8-3.4h.91l.73 3.45L7.88 8h.96l-1.25 5h-.97L5.9 9.6 5.1 13h-1L3 8h.98z"/>
1860
1868
  <path fill="currentColor" fill-rule="evenodd" d="M13 13h-1.02l-.33-1.11H9.9L9.64 13h-.97l1.26-5h1.54zm-2.49-3.77-.42 1.84h1.32l-.49-1.84z" clip-rule="evenodd"/>
1861
- </symbol>`,FK=`<symbol id="file-tree-builtin-webpack" viewBox="0 0 16 16">
1869
+ </symbol>`,JK=`<symbol id="file-tree-builtin-webpack" viewBox="0 0 16 16">
1862
1870
  <path fill="currentColor" d="M14.1 11.79 8.26 15v-2.5l3.64-1.94zm.4-.35V4.73l-2.14 1.2v4.3zm-12.6.35L7.74 15v-2.5L4.1 10.56zm-.4-.35V4.73l2.14 1.2v4.3zm.25-7.15 6-3.29v2.42L3.9 5.47l-.03.01zm12.5 0L8.25 1v2.42l3.85 2.05.03.01z" class="bg" opacity=".4"/>
1863
1871
  <path fill="currentColor" d="m7.74 11.93-3.59-1.92v-3.8l3.6 2.02zm.52 0 3.59-1.92v-3.8l-3.6 2.02zM4.4 5.77 8 3.85l3.6 1.93L8 7.8z" class="fg"/>
1864
- </symbol>`,IK=`<symbol id="file-tree-builtin-yml" viewBox="0 0 16 16">
1872
+ </symbol>`,YK=`<symbol id="file-tree-builtin-yml" viewBox="0 0 16 16">
1865
1873
  <path fill="currentColor" d="M7.5 2A1.5 1.5 0 0 1 9 3.5v3A1.5 1.5 0 0 1 7.5 8h-2v2A1.5 1.5 0 0 0 7 11.5v-1A1.5 1.5 0 0 1 8.5 9h5a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-5A1.5 1.5 0 0 1 7 13.5v-1A2.5 2.5 0 0 1 4.5 10V8h-2A1.5 1.5 0 0 1 1 6.5v-3A1.5 1.5 0 0 1 2.5 2zm1 8a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5zm-6-7a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5z"/>
1866
- </symbol>`,LK=`<symbol id="file-tree-builtin-zig" viewBox="0 0 16 16">
1874
+ </symbol>`,XK=`<symbol id="file-tree-builtin-zig" viewBox="0 0 16 16">
1867
1875
  <path fill="currentColor" d="m14.73 1.5-7.29 8.82h4.17l-1.73 2.04H5.76L1.27 14.5l7.3-8.91H4.39l1.73-2.05h4.12z"/>
1868
1876
  <path fill="currentColor" d="M5.21 3.54 3.56 5.6h-.55v4.73h.83L2.1 12.36H1V3.54zm9.79 0v8.82h-4.3l1.74-2.04h.55V5.68h-.83l1.74-2.14z"/>
1869
- </symbol>`,RK=[HG,qG,YG,XG,ZG,QG,tK,nK,rK,aK,oK,sK,cK,lK,uK,gK,vK,yK,TK,EK,kK,AK,`<symbol id="file-tree-builtin-zip" viewBox="0 0 16 16">
1877
+ </symbol>`,ZK=[tK,oK,cK,lK,uK,dK,mK,hK,gK,vK,yK,bK,xK,SK,CK,kK,jK,MK,RK,zK,HK,UK,`<symbol id="file-tree-builtin-zip" viewBox="0 0 16 16">
1870
1878
  <path fill="currentColor" d="M4.585 2a2 2 0 0 1 1.028.285l1.788 1.072a1 1 0 0 0 .514.143H12A2 2 0 0 1 13.935 5H0V4a2 2 0 0 1 2-2z" class="bg" opacity=".5"/>
1871
1879
  <path fill="currentColor" fill-rule="evenodd" d="M14 12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-1.25h1v-1H0V6h14zM9.9 8.25c-.883 0-1.9.5-1.9.5H7v1h1v1s1.017.5 1.9.5c.884 0 1.6-.672 1.6-1.5s-.716-1.5-1.6-1.5M2 9.75v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1zm-5-1v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1z" class="fg" clip-rule="evenodd"/>
1872
- </symbol>`],zK=[BG,VG,UG,WG,GG,KG,JG,$G,eK,iK,dK,fK,pK,mK,hK,_K,bK,xK,SK,CK,wK,DK,OK,jK,MK,NK,PK,FK,IK,LK];function BK(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
1873
- `)}\n</svg>`)}var VK=BK(zG,RK),HK={minimal:zG,standard:VK,complete:BK(VK,zK)},UK={".babelrc":`babel`,".babelrc.json":`babel`,".bash_profile":`bash`,".bashrc":`bash`,".browserslistrc":`browserslist`,".dockerignore":`docker`,".eslintignore":`eslint`,".eslintrc":`eslint`,".eslintrc.cjs":`eslint`,".eslintrc.js":`eslint`,".eslintrc.json":`eslint`,".eslintrc.yaml":`eslint`,".eslintrc.yml":`eslint`,".gitattributes":`git`,".gitignore":`git`,".gitkeep":`git`,".gitmodules":`git`,".oxlintrc.json":`oxc`,".postcssrc":`postcss`,".postcssrc.json":`postcss`,".postcssrc.yaml":`postcss`,".postcssrc.yml":`postcss`,".prettierignore":`prettier`,".prettierrc":`prettier`,".prettierrc.cjs":`prettier`,".prettierrc.js":`prettier`,".prettierrc.json":`prettier`,".prettierrc.mjs":`prettier`,".prettierrc.toml":`prettier`,".prettierrc.yaml":`prettier`,".prettierrc.yml":`prettier`,".stylelintignore":`stylelint`,".stylelintrc":`stylelint`,".stylelintrc.cjs":`stylelint`,".stylelintrc.js":`stylelint`,".stylelintrc.json":`stylelint`,".stylelintrc.mjs":`stylelint`,".stylelintrc.yaml":`stylelint`,".stylelintrc.yml":`stylelint`,".terraform.lock.hcl":`terraform`,".zprofile":`bash`,".zshenv":`bash`,".zshrc":`bash`,"babel.config.cjs":`babel`,"babel.config.js":`babel`,"babel.config.json":`babel`,"babel.config.mjs":`babel`,"biome.json":`biome`,"biome.jsonc":`biome`,"bootstrap.bundle.js":`bootstrap`,"bootstrap.bundle.min.js":`bootstrap`,"bootstrap.css":`bootstrap`,"bootstrap.js":`bootstrap`,"bootstrap.min.css":`bootstrap`,"bootstrap.min.js":`bootstrap`,"bun.lock":`bun`,"bun.lockb":`bun`,"bunfig.toml":`bun`,"claude.md":`claude`,"compose.yaml":`docker`,"compose.yml":`docker`,"docker-compose.override.yml":`docker`,"docker-compose.yaml":`docker`,"docker-compose.yml":`docker`,dockerfile:`docker`,"eslint.config.cjs":`eslint`,"eslint.config.js":`eslint`,"eslint.config.mjs":`eslint`,"eslint.config.mts":`eslint`,"eslint.config.ts":`eslint`,gemfile:`ruby`,"next.config.js":`nextjs`,"next.config.mjs":`nextjs`,"next.config.mts":`nextjs`,"next.config.ts":`nextjs`,"postcss.config.cjs":`postcss`,"postcss.config.js":`postcss`,"postcss.config.mjs":`postcss`,"postcss.config.ts":`postcss`,"prettier.config.cjs":`prettier`,"prettier.config.js":`prettier`,"prettier.config.mjs":`prettier`,rakefile:`ruby`,"readme.md":`markdown`,"stylelint.config.cjs":`stylelint`,"stylelint.config.js":`stylelint`,"stylelint.config.mjs":`stylelint`,"svgo.config.cjs":`svgo`,"svgo.config.js":`svgo`,"svgo.config.mjs":`svgo`,"svgo.config.ts":`svgo`,"tailwind.config.cjs":`tailwind`,"tailwind.config.js":`tailwind`,"tailwind.config.mjs":`tailwind`,"tailwind.config.ts":`tailwind`,"vite.config.js":`vite`,"vite.config.mjs":`vite`,"vite.config.mts":`vite`,"vite.config.ts":`vite`,"webpack.config.babel.js":`webpack`,"webpack.config.cjs":`webpack`,"webpack.config.js":`webpack`,"webpack.config.mjs":`webpack`,"webpack.config.ts":`webpack`},WK={"7z":`zip`,astro:`astro`,AUTHORS:`text`,avif:`image`,bash:`bash`,bmp:`image`,bz2:`zip`,c:`c`,cc:`cpp`,cfg:`text`,CHANGELOG:`text`,cjs:`javascript`,"code-workspace":`vscode`,conf:`text`,CONTRIBUTORS:`text`,cpp:`cpp`,csh:`bash`,css:`css`,csv:`table`,cts:`typescript`,cxx:`cpp`,db:`database`,editorconfig:`text`,env:`text`,"env.development":`text`,"env.local":`text`,"env.production":`text`,eot:`font`,erb:`ruby`,fish:`bash`,gemspec:`ruby`,gif:`image`,go:`go`,gql:`graphql`,graphql:`graphql`,gz:`zip`,h:`c`,hh:`cpp`,hpp:`cpp`,htm:`html`,html:`html`,hxx:`cpp`,icns:`image`,ico:`image`,ini:`text`,inl:`cpp`,jar:`zip`,jpeg:`image`,jpg:`image`,js:`javascript`,json:`json`,json5:`json`,jsonc:`json`,jsonl:`json`,jsx:`javascript`,ksh:`bash`,less:`css`,LICENSE:`text`,log:`text`,markdown:`markdown`,mcp:`mcp`,md:`markdown`,mdx:`markdown`,"mdx.tsx":`markdown`,mjs:`javascript`,mm:`cpp`,mts:`typescript`,ods:`table`,otf:`font`,png:`image`,postcss:`css`,py:`python`,pyi:`python`,pyw:`python`,pyx:`python`,rake:`ruby`,rar:`zip`,rb:`ruby`,rs:`rust`,rst:`text`,rtf:`text`,sass:`css`,scss:`css`,sh:`bash`,sql:`database`,sqlite:`database`,sqlite3:`database`,styl:`css`,svelte:`svelte`,svg:`svg`,swift:`swift`,tar:`zip`,tf:`terraform`,tfstate:`terraform`,tfvars:`terraform`,tgz:`zip`,tif:`image`,tiff:`image`,ts:`typescript`,tsv:`table`,tsx:`typescript`,ttf:`font`,txt:`text`,vue:`vue`,war:`zip`,wasm:`wasm`,wast:`wasm`,wat:`wasm`,webp:`image`,woff:`font`,woff2:`font`,xhtml:`html`,xls:`table`,xlsx:`table`,xz:`zip`,yaml:`yml`,yml:`yml`,zig:`zig`,zip:`zip`,zsh:`bash`},GK={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},KK=new Set([`bash`,`c`,`cpp`,`css`,`database`,`default`,`font`,`git`,`go`,`html`,`image`,`javascript`,`json`,`markdown`,`mcp`,`python`,`ruby`,`rust`,`swift`,`table`,`text`,`typescript`,`zip`]),qK=new Set([`complete`]);function JK(e){return HK[e===`none`?`minimal`:e]}function YK(e){return`file-tree-builtin-${e}`}function XK(e){return e!==`none`&&qK.has(e)}function ZK(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=UK[t.toLowerCase()];if(i!=null&&(r||KK.has(i)))return i;for(let e of n){if(r){let t=GK[e];if(t!=null)return t}let t=WK[e];if(t!=null&&(r||KK.has(t)))return t}return`default`}function QK(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function $K(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(QK(e)?`none`:`complete`),colored:e.colored??!0}}var eq={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function tq(e,t){if(typeof e==`number`)return{itemHeight:t??eq.default.itemHeight,factor:e};let n=eq[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var nq=eq.default.itemHeight,rq=`@layer base {
1880
+ </symbol>`],QK=[$G,eK,nK,rK,iK,aK,sK,fK,pK,_K,wK,TK,EK,DK,OK,AK,NK,PK,FK,IK,LK,BK,VK,WK,GK,KK,qK,JK,YK,XK];function $K(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
1881
+ `)}\n</svg>`)}var eq=$K(QG,ZK),tq={minimal:QG,standard:eq,complete:$K(eq,QK)},nq={".babelrc":`babel`,".babelrc.json":`babel`,".bash_profile":`bash`,".bashrc":`bash`,".browserslistrc":`browserslist`,".dockerignore":`docker`,".eslintignore":`eslint`,".eslintrc":`eslint`,".eslintrc.cjs":`eslint`,".eslintrc.js":`eslint`,".eslintrc.json":`eslint`,".eslintrc.yaml":`eslint`,".eslintrc.yml":`eslint`,".gitattributes":`git`,".gitignore":`git`,".gitkeep":`git`,".gitmodules":`git`,".oxlintrc.json":`oxc`,".postcssrc":`postcss`,".postcssrc.json":`postcss`,".postcssrc.yaml":`postcss`,".postcssrc.yml":`postcss`,".prettierignore":`prettier`,".prettierrc":`prettier`,".prettierrc.cjs":`prettier`,".prettierrc.js":`prettier`,".prettierrc.json":`prettier`,".prettierrc.mjs":`prettier`,".prettierrc.toml":`prettier`,".prettierrc.yaml":`prettier`,".prettierrc.yml":`prettier`,".stylelintignore":`stylelint`,".stylelintrc":`stylelint`,".stylelintrc.cjs":`stylelint`,".stylelintrc.js":`stylelint`,".stylelintrc.json":`stylelint`,".stylelintrc.mjs":`stylelint`,".stylelintrc.yaml":`stylelint`,".stylelintrc.yml":`stylelint`,".terraform.lock.hcl":`terraform`,".zprofile":`bash`,".zshenv":`bash`,".zshrc":`bash`,"babel.config.cjs":`babel`,"babel.config.js":`babel`,"babel.config.json":`babel`,"babel.config.mjs":`babel`,"biome.json":`biome`,"biome.jsonc":`biome`,"bootstrap.bundle.js":`bootstrap`,"bootstrap.bundle.min.js":`bootstrap`,"bootstrap.css":`bootstrap`,"bootstrap.js":`bootstrap`,"bootstrap.min.css":`bootstrap`,"bootstrap.min.js":`bootstrap`,"bun.lock":`bun`,"bun.lockb":`bun`,"bunfig.toml":`bun`,"claude.md":`claude`,"compose.yaml":`docker`,"compose.yml":`docker`,"docker-compose.override.yml":`docker`,"docker-compose.yaml":`docker`,"docker-compose.yml":`docker`,dockerfile:`docker`,"eslint.config.cjs":`eslint`,"eslint.config.js":`eslint`,"eslint.config.mjs":`eslint`,"eslint.config.mts":`eslint`,"eslint.config.ts":`eslint`,gemfile:`ruby`,"next.config.js":`nextjs`,"next.config.mjs":`nextjs`,"next.config.mts":`nextjs`,"next.config.ts":`nextjs`,"postcss.config.cjs":`postcss`,"postcss.config.js":`postcss`,"postcss.config.mjs":`postcss`,"postcss.config.ts":`postcss`,"prettier.config.cjs":`prettier`,"prettier.config.js":`prettier`,"prettier.config.mjs":`prettier`,rakefile:`ruby`,"readme.md":`markdown`,"stylelint.config.cjs":`stylelint`,"stylelint.config.js":`stylelint`,"stylelint.config.mjs":`stylelint`,"svgo.config.cjs":`svgo`,"svgo.config.js":`svgo`,"svgo.config.mjs":`svgo`,"svgo.config.ts":`svgo`,"tailwind.config.cjs":`tailwind`,"tailwind.config.js":`tailwind`,"tailwind.config.mjs":`tailwind`,"tailwind.config.ts":`tailwind`,"vite.config.js":`vite`,"vite.config.mjs":`vite`,"vite.config.mts":`vite`,"vite.config.ts":`vite`,"webpack.config.babel.js":`webpack`,"webpack.config.cjs":`webpack`,"webpack.config.js":`webpack`,"webpack.config.mjs":`webpack`,"webpack.config.ts":`webpack`},rq={"7z":`zip`,astro:`astro`,AUTHORS:`text`,avif:`image`,bash:`bash`,bmp:`image`,bz2:`zip`,c:`c`,cc:`cpp`,cfg:`text`,CHANGELOG:`text`,cjs:`javascript`,"code-workspace":`vscode`,conf:`text`,CONTRIBUTORS:`text`,cpp:`cpp`,csh:`bash`,css:`css`,csv:`table`,cts:`typescript`,cxx:`cpp`,db:`database`,editorconfig:`text`,env:`text`,"env.development":`text`,"env.local":`text`,"env.production":`text`,eot:`font`,erb:`ruby`,fish:`bash`,gemspec:`ruby`,gif:`image`,go:`go`,gql:`graphql`,graphql:`graphql`,gz:`zip`,h:`c`,hh:`cpp`,hpp:`cpp`,htm:`html`,html:`html`,hxx:`cpp`,icns:`image`,ico:`image`,ini:`text`,inl:`cpp`,jar:`zip`,jpeg:`image`,jpg:`image`,js:`javascript`,json:`json`,json5:`json`,jsonc:`json`,jsonl:`json`,jsx:`javascript`,ksh:`bash`,less:`css`,LICENSE:`text`,log:`text`,markdown:`markdown`,mcp:`mcp`,md:`markdown`,mdx:`markdown`,"mdx.tsx":`markdown`,mjs:`javascript`,mm:`cpp`,mts:`typescript`,ods:`table`,otf:`font`,png:`image`,postcss:`css`,py:`python`,pyi:`python`,pyw:`python`,pyx:`python`,rake:`ruby`,rar:`zip`,rb:`ruby`,rs:`rust`,rst:`text`,rtf:`text`,sass:`css`,scss:`css`,sh:`bash`,sql:`database`,sqlite:`database`,sqlite3:`database`,styl:`css`,svelte:`svelte`,svg:`svg`,swift:`swift`,tar:`zip`,tf:`terraform`,tfstate:`terraform`,tfvars:`terraform`,tgz:`zip`,tif:`image`,tiff:`image`,ts:`typescript`,tsv:`table`,tsx:`typescript`,ttf:`font`,txt:`text`,vue:`vue`,war:`zip`,wasm:`wasm`,wast:`wasm`,wat:`wasm`,webp:`image`,woff:`font`,woff2:`font`,xhtml:`html`,xls:`table`,xlsx:`table`,xz:`zip`,yaml:`yml`,yml:`yml`,zig:`zig`,zip:`zip`,zsh:`bash`},iq={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},aq=new Set([`bash`,`c`,`cpp`,`css`,`database`,`default`,`font`,`git`,`go`,`html`,`image`,`javascript`,`json`,`markdown`,`mcp`,`python`,`ruby`,`rust`,`swift`,`table`,`text`,`typescript`,`zip`]),oq=new Set([`complete`]);function sq(e){return tq[e===`none`?`minimal`:e]}function cq(e){return`file-tree-builtin-${e}`}function lq(e){return e!==`none`&&oq.has(e)}function uq(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=nq[t.toLowerCase()];if(i!=null&&(r||aq.has(i)))return i;for(let e of n){if(r){let t=iq[e];if(t!=null)return t}let t=rq[e];if(t!=null&&(r||aq.has(t)))return t}return`default`}function dq(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function fq(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(dq(e)?`none`:`complete`),colored:e.colored??!0}}var pq={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function mq(e,t){if(typeof e==`number`)return{itemHeight:t??pq.default.itemHeight,factor:e};let n=pq[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var hq=pq.default.itemHeight,gq=`@layer base {
1874
1882
  :host {
1875
1883
  --trees-accent: var(--trees-accent-override, #009fff);
1876
1884
  --trees-fg: var(--trees-fg-override, var(--trees-theme-sidebar-fg, light-dark(#6c6c71, #adadb1)));
@@ -2962,17 +2970,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
2962
2970
  }
2963
2971
 
2964
2972
  @layer theme, unsafe;
2965
- `,iq=`@layer base, unsafe;`;function aq(e){return`${iq}
2973
+ `,_q=`@layer base, unsafe;`;function vq(e){return`${_q}
2966
2974
  @layer base {
2967
2975
  ${e}
2968
- }`}function oq(e){return`${iq}
2976
+ }`}function yq(e){return`${_q}
2969
2977
  @layer unsafe {
2970
2978
  ${e}
2971
- }`}var sq=new WeakMap;function cq(e){let t=sq.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(DG,`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(),sq.set(e,i),i}function lq(e,t){if(!e.isConnected)return;let n=cq(t);if(n==null)return;let r=t.querySelector(`style[${OG}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(OG,``),t.appendChild(i)),i.textContent=`:host { ${kG}: ${n}px; }`}var uq;function dq(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){uq??(uq=new CSSStyleSheet,uq.replaceSync(aq(rq)));let t=!1;try{e.adoptedStyleSheets=[uq],t=!0}catch{}if(t){e.querySelector(`style[${TG}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(TG,``),t.textContent=aq(rq),e.prepend(t)}}function fq(e,t){pq(e,t),dq(t),lq(e,t)}function pq(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`});fq(this,e)}}if(customElements.define(wG,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(wG)))e instanceof HTMLElement&&fq(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var mq=5,hq=32,gq=128;function _q(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function vq(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function yq(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 bq(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 xq(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function Sq(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 Cq(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,Dq(e,t)}function wq(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=bq(e).get(t);if(i===void 0)return;let a=i>>mq;e.childVisibleChunkSums[a]+=r}function Tq(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=Oq(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=hq}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 Eq(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>mq;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<mq}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 Dq(e,t){if(t.childIds.length<gq){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/hq),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>>mq]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function Oq(e,t,n,r){let i=Math.min(t.childIds.length,n+hq),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 kq=7,Aq=3,jq=8,Mq=4;function Nq(e,t,n=0){return e<<Mq|n<<Aq|t}function Pq(e){return e.depthAndFlags>>>Mq}function Fq(e){return(e.depthAndFlags&jq)>>Aq}function X(e){return(e.depthAndFlags&jq)!==0}function Iq(e){return e.depthAndFlags&kq}function Lq(e,t){return(Iq(e)&t)!==0}function Rq(e,t){e.depthAndFlags|=t}function zq(e,t){e.depthAndFlags=Nq(t,Iq(e),Fq(e))}var Bq=Symbol(`benchmarkInstrumentation`);function Vq(e,t){return t==null||Object.defineProperty(e,Bq,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function Hq(e){return e==null?null:e[Bq]??null}function Z(e,t,n){return e==null?n():e.measurePhase(t,n)}function Uq(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function Wq(e){return e>=48&&e<=57}function Gq(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!Wq(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&&Wq(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 Kq(e){let t=e.toLowerCase();return{lowerValue:t,tokens:Gq(t)}}function qq(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 Jq(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=qq(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function Yq(e,t,n){let r=Jq(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function Xq(e,t){return Yq(e,t,Kq)}function Zq(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function Qq(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=Zq(e,r);return a===Zq(t,r)?Xq(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 $q(e,t){return Qq(e,t)}function eJ(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=Kq(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=Zq(e,n);return o===Zq(t,n)?Yq(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 tJ(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=Kq(r);return e.sortKeyById[t]=i,i}function nJ(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function rJ(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 iJ(e){let{hasTrailingSlash:t,segments:n}=rJ(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function aJ(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=rJ(e);return{requiresDirectory:t,segments:n}}function oJ(){let e=new Map;return e.set(``,0),{idByValue:e,valueById:[``],sortKeyById:[Kq(``)]}}function sJ(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 cJ(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var lJ=Symbol(`pathStorePreparedInputKind`);function uJ(e,t){return e[lJ]=t,e}function dJ(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function fJ(e,t,n){return n==="default"?$q(e,t):n(dJ(e),dJ(t))}function pJ(){return{depthAndFlags:Nq(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function mJ(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 hJ(e){return e.isDirectory?e.segments.length:e.segments.length-1}function gJ(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 _J(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function vJ(e,t={}){return wJ(e,t).map(e=>e.path)}function yJ(e,t={}){let n=wJ(e,t);return uJ({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function bJ(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 uJ({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function xJ(e){let t=e,n=t.preparedPaths;if(t[lJ]===`prepared`&&n!=null)return n;if(!gJ(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function SJ(e){let t=e;return t[lJ]===`presorted`&&t.presortedPaths!=null||_J(t.presortedPaths)?t.presortedPaths:null}function CJ(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function wJ(e,t={}){let n=nJ(t),r=Hq(t);Uq(r,`workload.inputFiles`,e.length);let i=Z(r,`store.preparePathEntries.parse`,()=>e.map(e=>iJ(e)));return Z(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>fJ(e,t,n.sort))),i}var TJ=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[pJ()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=oJ();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=Hq(e),this.options=nJ(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,_q())}appendPaths(e){return Z(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>iJ(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,Z(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return Z(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:Nq(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:Nq(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d,m=a+1}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:Nq(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=iJ(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:Nq(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:Nq(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=iJ(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(Z(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||Z(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"?eJ(this.lastPreparedPath,e,this.segmentSortKeyCache):fJ(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=hJ(e),i=n==null?0:hJ(n),a=n==null?0:mJ(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=sJ(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:Nq(Pq(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),xq(i,s),s}createFileChildUnchecked(e,t){let n=sJ(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:Nq(Pq(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),xq(r,a),a}getOrCreateDirectoryChild(e,t){let n=sJ(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&&!X(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:Nq(Pq(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),xq(r,a),this.directories.set(a,_q()),a}createDirectoryChild(e,t){let n=sJ(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:Nq(Pq(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),xq(r,a),this.directories.set(a,_q()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!X(n))throw Error(`Path is not a directory: "${t}"`);if(Lq(n,1))throw Error(`Duplicate path: "${t}"`);Rq(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,vq());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(X(a)){let t=vq();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;X(n)&&this.directories.set(t,_q());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),xq(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!X(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 Cq(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function EJ(e,t=`closed`,n=null){let r=OJ(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 DJ(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function OJ(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 kJ(e,t){return Lq(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion!==`closed`&&Pq(t)<=e.defaultExpansion}function AJ(e,t,n=e.snapshot.nodes[t]){return n==null||!X(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:kJ(e,n)}function jJ(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!X(r))return;let i=kJ(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 MJ(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 NJ(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function PJ(e,t){let n=MJ(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 FJ(e,t){let n=MJ(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function IJ(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 LJ(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function RJ(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 zJ(e,t){e.directoryLoadInfoById.delete(t)}function BJ(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 VJ(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function HJ(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function UJ(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function WJ(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function GJ(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function KJ(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function qJ(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 JJ(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 YJ(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 XJ(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 ZJ(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 QJ(e,t,n){return{...n,visibleCountDelta:lY(e)-t}}function $J(e,t){let n=lY(e),r=DJ();e.transactionStack.push(r);try{t()}catch(t){throw nY(e,r,!1),t}nY(e,r,!0,lY(e)-n)}function eY(e,t){let n=e.instrumentation;if(n==null){tY(e,t);return}Z(n,`store.events.record`,()=>tY(e,t))}function tY(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){sY(e,t);return}n.events.push(t),oY(n,t)}function nY(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?aY(i,t):Z(n,`store.events.batch.merge`,()=>aY(i,t));return}let a=rY(t,r),o=e.instrumentation;if(o==null){sY(e,a);return}Z(o,`store.events.batch.commit`,()=>sY(e,a))}function rY(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 iY(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function aY(e,t){for(let n of t.events)e.events.push(n);iY(e,t)}function oY(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function sY(e,t){let n=e.instrumentation;if(n==null){cY(e,t);return}Z(n,`store.events.emit`,()=>cY(e,t))}function cY(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function lY(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function uY(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!X(n)||Lq(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||!X(a)?null:i}function dY(e,t){let n=t;for(;;){let t=uY(e,n);if(t==null)return n;n=t}}function fY(e,t){let n=[t],r=t;for(;;){let t=uY(e,r);if(t==null)return n;n.push(t),r=t}}function pY(e,t){let n=t==null?e.snapshot.rootId:CY(e,t);return n==null?[]:EY(e,n)}function mY(e,t){let n=iJ(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=VY(e,BY(e,r)),{createdNodeIds:a,directoryId:o}=DY(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=Q(e,o);if(Lq(n,1))throw Error(`Path already exists: "${t}"`);Rq(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=kY(e,o,n.basename),s.add(c);bY(e,o);let l=VY(e,o);return VJ({affectedAncestorIds:SY(e,c),affectedNodeIds:[...s],path:t,projectionChanged:HY(i,l)})}function hY(e,t,n){let r=CY(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=Q(e,r);if(Lq(i,2))throw Error(`The root node cannot be removed`);if(X(i)&&TY(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=VY(e,a),s=RY(e,r);MY(e,a,r,i.nameId),zY(e,a),bY(e,a);let c=VY(e,a);return HJ({affectedAncestorIds:SY(e,a),affectedNodeIds:s,path:t,projectionChanged:HY(o,c),recursive:n.recursive===!0})}function gY(e,t,n,r){let i=CY(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=Q(e,i);if(Lq(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=IY(e,i,n),c=VY(e,a.parentId),l=VY(e,s.parentId),u=cJ(e.snapshot.segmentTable,a.nameId),d=sJ(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(X(a)&&KY(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=yq(e.snapshot.nodes,TY(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&LY(e,p,o,Fq(a))===`skip`)return null;let m=a.parentId;MY(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),GY(e,i),jY(e,s.parentId,i),zY(e,m),e.pathCacheVersion++,bY(e,m),s.parentId!==m&&bY(e,s.parentId);let h=VY(e,m),g=VY(e,s.parentId);return UJ({affectedAncestorIds:[...new Set([...SY(e,m),...SY(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:UY([c,l],[h,g]),to:yY(e,i)})}function _Y(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function vY(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function yY(e,t){let n=Q(e,t),r=_Y(e,t);if(r!=null)return r;if(Lq(n,2))return vY(e,t,``);let i=yY(e,n.parentId),a=cJ(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return vY(e,t,X(n)?`${o}/`:o)}function bY(e,t){let n=e.instrumentation;if(n==null){JY(e,t);return}Z(n,`store.recomputeCountsUpwardFrom`,()=>JY(e,t))}function xY(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||!X(o)){qY(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){qY(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function SY(e,t){let n=[],r=t;for(;r!=null;){let t=Q(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function CY(e,t){if(t.length===0)return e.snapshot.rootId;let n=aJ(t);return wY(e,n.segments,n.requiresDirectory)}function wY(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=TY(e,r),a=yq(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=Q(e,r);return n&&!X(i)?null:r}function TY(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 Q(e,t){let n=e.snapshot.nodes[t];if(n===void 0||Lq(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function EY(e,t){let n=e.snapshot.nodes[t];if(n===void 0||Lq(n,4))return[];if(!X(n))return[yY(e,t)];if(TY(e,t).childIds.length===0)return Lq(n,1)&&!Lq(n,2)?[yY(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||Lq(n,4)){i.pop();continue}if(!X(n)){r.push(yY(e,t.nodeId)),i.pop();continue}let a=TY(e,t.nodeId);if(a.childIds.length===0){Lq(n,1)&&!Lq(n,2)&&r.push(yY(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 DY(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=sJ(e.snapshot.segmentTable,i),a=TY(e,r),o=yq(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!X(Q(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=OY(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function OY(e,t,n){let r=Q(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:Nq(Pq(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,_q()),jY(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function kY(e,t,n){let r=sJ(e.snapshot.segmentTable,n),i=TY(e,t);if(yq(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${XY(e,t,n)}"`);let a=Q(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:Nq(Pq(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),jY(e,t,o),e.activeNodeCount++,o}function AY(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}NY(e,n,o)<0?i=a:r=a+1}return r}function jY(e,t,n){let r=TY(e,t),i=Q(e,n);yq(e.snapshot.nodes,r).set(i.nameId,n),wq(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=AY(e,r,n);r.childIds.splice(a,0,n),Sq(r,a),Dq(e.snapshot.nodes,r)}function MY(e,t,n,r){let i=TY(e,t),a=bq(i),o=a.get(n)??-1;yq(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&wq(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),Sq(i,o),Dq(e.snapshot.nodes,i))}function NY(e,t,n){let r=e.snapshot.options.sort;return r==="default"?PY(e,t,n):r(FY(e,t),FY(e,n))}function PY(e,t,n){let r=Q(e,t),i=Q(e,n),a=X(r);if(a!==X(i))return a?-1:1;let o=Jq(tJ(e.snapshot.segmentTable,r.nameId),tJ(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=cJ(e.snapshot.segmentTable,r.nameId),c=cJ(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function FY(e,t){let n=Q(e,t),r=yY(e,t),i=X(n),a=i?r.slice(0,-1):r;return{basename:cJ(e.snapshot.segmentTable,n.nameId),depth:Pq(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function IY(e,t,n){let r=Q(e,t),i=CY(e,n);if(i!=null){let t=Q(e,i);if(X(t))return{basename:cJ(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=aJ(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=aJ(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:wY(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function LY(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${yY(e,t)}"`);let i=Q(e,t);if(Fq(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(X(i)&&TY(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return RY(e,t),MY(e,a,t,o),zY(e,a),bY(e,a),`handled`}function RY(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=Q(e,t.nodeId);if(t.visitedChildren||!X(i)){X(i)&&e.snapshot.directories.delete(t.nodeId),Rq(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),zJ(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=TY(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 zY(e,t){let n=t;for(;n!=null;){let t=Q(e,n);if(!X(t)||Lq(t,2)||TY(e,n).childIds.length>0)return;Rq(t,1),n=t.parentId===n?null:t.parentId}}function BY(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=yq(e.snapshot.nodes,TY(e,n)).get(t);if(i==null||!X(Q(e,i)))break;n=i}return n}function VY(e,t){let n=WY(e,t);if(n==null)return null;let r=dY(e,n),i=Q(e,r),a=n===r?null:fY(e,n).map(t=>yY(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:TY(e,r).childIds.length>0,path:yY(e,r),terminalKind:Fq(i)})}function HY(e,t){return UY([e],[t])}function UY(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 WY(e,t){let n=t;for(;n!=null;){let t=Q(e,n);if(!X(t)||Lq(t,2))return null;if(!AJ(e,n,t))return n;n=t.parentId}return null}function GY(e,t){let n=Q(e,t);if(zq(n,(t===e.snapshot.rootId?-1:Pq(Q(e,n.parentId)))+1),!X(n))return;let r=TY(e,t);for(let t of r.childIds)GY(e,t)}function KY(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=Q(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function qY(e,t,n=Q(e,t),r=!1){let i=e.instrumentation;if(i==null){YY(e,t,n,r);return}Z(i,`store.recomputeNodeCounts`,()=>YY(e,t,n,r))}function JY(e,t){let n=t;for(;n!=null;){let t=Q(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(qY(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&wq(TY(e,s),n,a,o),n=s}}function YY(e,t,n,r){if(!X(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=TY(e,t);if(r){let t=e.instrumentation;t==null?Cq(e.snapshot.nodes,i):Z(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>Cq(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,Lq(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=uY(e,t)==null?AJ(e,t,n)?1+o:1:o}function XY(e,t,n){let r=yY(e,t);return r.length===0?n:`${r}${n}`}function ZY(e){return e!=null&&!Lq(e,4)}function QY(e,t){let n=e.snapshot.nodes[t];return!ZY(n)||!X(n)||Lq(n,2)?null:n}function $Y(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&ZY(e.snapshot.nodes[n])&&(t+=1);return t}function eX(e){return Math.max(0,e.valueById.length-1)}function tX(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:$Y(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:eX(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function nX(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 rX(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)QY(e,n)!=null&&t.push(yY(e,n));for(let t of e.expandedDirectoryIds)QY(e,t)!=null&&n.push(yY(e,t));return{collapsedPaths:t,expandedPaths:n}}function iX(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)QY(e,n)!=null&&NJ(e,n)!==`loaded`&&t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:yY(e,n)});return t}function aX(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=CY(e,n);t!=null&&jJ(e,t,!0,Q(e,t))}for(let n of t.collapsedPaths){let t=CY(e,n);t!=null&&jJ(e,t,!1,Q(e,t))}}function oX(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=CY(e,n.path);t!=null&&QY(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function sX(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function cX(e){let t=e.snapshot.segmentTable,n=oJ();for(let r of e.snapshot.nodes)if(ZY(r)){if(Lq(r,2)){r.nameId=0;continue}r.nameId=sJ(n,cJ(t,r.nameId))}e.snapshot.segmentTable=n}function lX(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!ZY(r)||!X(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return ZY(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[Q(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),Cq(e.snapshot.nodes,n)}}function uX(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(ZY(n))break;--t}e.snapshot.nodes.length=t+1}function dX(e){let t=rX(e),n=iX(e);Z(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>sX(e)),Z(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>cX(e)),Z(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>lX(e)),Z(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>uX(e)),Z(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>aX(e,t)),Z(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>oX(e,n)),Z(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>xY(e,e.snapshot.rootId))}function fX(e){let t=rX(e),n=iX(e),r=Z(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>pY(e)),i=Vq({...e.snapshot.options},e.instrumentation),a=Z(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new TJ(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,Z(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>aX(e,t)),Z(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>oX(e,n)),Z(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>xY(e,e.snapshot.rootId))}function pX(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function mX(e,t){let n=tX(e);t===`stable`?Z(e.instrumentation,`store.cleanup.stable`,()=>dX(e)):Z(e.instrumentation,`store.cleanup.aggressive`,()=>fX(e));let r=tX(e);return nX(t,t===`stable`,n,r)}var hX=64;function gX(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 _X(e){return Q(e,e.snapshot.rootId).visibleSubtreeCount}function vX(e,t,n,r){let i=Q(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function yX(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:RX(e,t.cursor),setSize:t.setSize,subtreeEndIndex:vX(e,t.cursor,t.index,n)}}function bX(e,t,n,r,i,a){let o=TY(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=Tq(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return xX(e,u,l,r+c,i+1,s,o.childIds.length,a)}function xX(e,t,n,r,i,a,o,s){if(!X(Q(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=MX(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=Q(e,c.terminalNodeId);if(!X(l)||!AJ(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return bX(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function SX(e,t){let n=_X(e);if(t<0||t>=n)return null;let r=bX(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>yY(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=yX(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:RX(e,r.cursor),setSize:r.setSize,subtreeEndIndex:vX(e,r.cursor,r.index,n)}}function CX(e,t,n){let r=e.instrumentation,i=_X(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 LX(e,o+1);let t=[],n=kX(e,a);for(let r=a;r<=o&&n!=null;r++){let r=RX(e,n);t.push(r),n=PX(e,n)}return t}let s=[],c=0,l=0,u=Z(r,`store.getVisibleSlice.selectFirstRow`,()=>kX(e,a));for(let t=a;t<=o&&u!=null;t++){let t=Z(r,`store.getVisibleSlice.materializeRow`,()=>RX(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=Z(r,`store.getVisibleSlice.advanceCursor`,()=>PX(e,u))}return Uq(r,`workload.visibleRowsRead`,s.length),Uq(r,`workload.flattenedRowsRead`,c),Uq(r,`workload.flattenedSegmentsRead`,l),s}function wX(e,t=_X(e)){let n=e.instrumentation;return n==null?IX(e,t):Z(n,`store.getVisibleTreeProjection`,()=>IX(e,t))}function TX(e){return FX(wX(e))}function EX(e,t){let n=CY(e,t);if(n==null||n===e.snapshot.rootId||X(Q(e,n))&&dY(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=Q(e,i).parentId,n=TY(e,t),s=bq(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=Eq(a,n,s),t!==o){let n=Q(e,t),a=uY(e,t);if(!AJ(e,t,n)&&a!==i)return null;dY(e,t)===t&&(r+=1)}i=t}return r}function DX(e,t){let n=CY(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=Q(e,n);if(!X(r))throw Error(`Path is not a directory: "${t}"`);return AJ(e,n,r)?null:(jJ(e,n,!0,r),bY(e,n),WJ({affectedAncestorIds:SY(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function OX(e,t){let n=CY(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=Q(e,n);if(!X(r))throw Error(`Path is not a directory: "${t}"`);return AJ(e,n,r)?(jJ(e,n,!1,r),bY(e,n),GJ({affectedAncestorIds:SY(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function kX(e,t){return t<0||t>=_X(e)?null:AX(e,e.snapshot.rootId,t,-1)}function AX(e,t,n,r){let i=TY(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?Tq(e.snapshot.nodes,i,n):Z(a,`store.getVisibleSlice.selectChildIndex`,()=>Tq(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return jX(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function jX(e,t,n,r){if(!X(Q(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=MX(e,t,r);if(n===0)return i;let a=Q(e,i.terminalNodeId);if(!X(a)||!AJ(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return AX(e,i.terminalNodeId,n-1,i.visibleDepth)}function MX(e,t,n){return X(Q(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:dY(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:Z(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>dY(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function NX(e,t){let n=Q(e,t);if(!X(n))return!0;let r=n.parentId;return r===e.snapshot.rootId||uY(e,r)!==t}function PX(e,t){let n=Q(e,t.terminalNodeId);if(X(n)){let r=TY(e,t.terminalNodeId);if(AJ(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:jX(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=Q(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=TY(e,n),o=bq(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 jX(e,s,0,i);NX(e,r)&&i--,r=n}}function FX(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 IX(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(hX);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=gX(o,y);let x,S=_;if(X(v))S=f?dY(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:yY(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&&X(C)&&AJ(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 LX(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(!X(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:yY(e,f)};continue}let h=l?dY(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=RX(e,g);let _=i[h];_!=null&&X(_)&&AJ(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function RX(e,t){let n=Q(e,t.terminalNodeId),r=X(n)?zX(e,t):null,i=yY(e,t.terminalNodeId),a=cJ(e.snapshot.segmentTable,n.nameId),o=X(n)&&TY(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?fY(e,t.headNodeId).map(n=>{let r=Q(e,n);return{isTerminal:n===t.terminalNodeId,name:cJ(e.snapshot.segmentTable,r.nameId),nodeId:n,path:yY(e,n)}}):Z(c,`store.getVisibleSlice.flatten.collectSegments`,()=>fY(e,t.headNodeId).map(n=>{let r=Q(e,n);return{isTerminal:n===t.terminalNodeId,name:cJ(e.snapshot.segmentTable,r.nameId),nodeId:n,path:yY(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:X(n)&&AJ(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:X(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function zX(e,t){if(t.headNodeId===t.terminalNodeId)return NJ(e,t.terminalNodeId);let n=fY(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=NJ(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}var BX=8;function VX(e){let{nodes:t,directories:n,rootId:r,options:i}=e,a=t.length,o=new Int32Array(a),s=new Int32Array(a),c=new Int32Array(a),l=new Int32Array(a),u=new Int32Array(a),d=new Int32Array(a),f=new Int32Array(a);for(let e=0;e<a;e+=1){let n=t[e];n!=null&&(o[e]=n.parentId,s[e]=n.nameId,c[e]=n.depthAndFlags,l[e]=n.subtreeNodeCount,u[e]=n.visibleSubtreeCount)}let p=0;for(let e of n.values())p+=e.childIds.length;let m=new Int32Array(p),h=0;for(let[e,t]of n){let n=t.childIds;d[e]=h,f[e]=n.length;for(let e=0;e<n.length;e+=1)m[h]=n[e],h+=1}return{nodeCount:a,rootId:r,flattenEmptyDirectories:i.flattenEmptyDirectories===!0,parentId:o,nameId:s,depthAndFlags:c,subtreeNodeCount:l,visibleSubtreeCount:u,childStart:d,childCount:f,childIdsFlat:m}}function HX(e){let{nodeCount:t,rootId:n,flattenEmptyDirectories:r,depthAndFlags:i,subtreeNodeCount:a,visibleSubtreeCount:o,childStart:s,childCount:c,childIdsFlat:l}=e;for(let e=t-1;e>=1;--e){if((i[e]&BX)===0)continue;let t=s[e],n=c[e],u=0,d=0;for(let e=0;e<n;e+=1){let n=l[t+e];u+=a[n],d+=o[n]}a[e]=1+u;let f;f=r&&n===1?(i[l[t]]&BX)===0?1+d:d:1+d,o[e]=f}let u=s[n],d=c[n],f=0,p=0;for(let e=0;e<d;e+=1){let t=l[u+e];f+=a[t],p+=o[t]}a[n]=1+f,o[n]=p}function UX(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||!X(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&&Dq(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&X(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,Dq(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function WX(e){let{directories:t,nodes:n,rootId:r}=e.snapshot,i=VX(e.snapshot);HX(i);let a=i.subtreeNodeCount,o=i.visibleSubtreeCount;for(let e=0;e<n.length;e+=1){let t=n[e];t!=null&&(t.subtreeNodeCount=a[e],t.visibleSubtreeCount=o[e])}for(let[e,i]of t){let t=i.childIds,a=t.length,o=0,s=0;for(let e=0;e<a;e++){let r=t[e];if(r==null)continue;let i=n[r];o+=i.subtreeNodeCount,s+=i.visibleSubtreeCount}i.totalChildSubtreeNodeCount=o,i.totalChildVisibleSubtreeCount=s,(e===r||a>=128)&&Dq(n,i)}}function GX(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var KX=class e{#e;constructor(e={}){let t=Hq(e),n=Z(t,`store.builder.create`,()=>new TJ(e));if(e.preparedInput!=null){let t=SJ(e.preparedInput);t==null?n.appendPreparedPaths(xJ(e.preparedInput),!1):n.appendPresortedPaths(t,CJ(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(Z(t,`store.preparePathEntries`,()=>wJ(r,e)))}let r=Z(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=Z(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=Z(t,`store.state.create`,()=>EJ(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:Z(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||GX(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&Z(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?e.useSoaCountSweep===!0?Z(t,`store.state.initializeOpenVisibleCountsViaSoa`,()=>WX(this.#e)):Z(t,`store.state.initializeOpenVisibleCounts`,()=>UX(this.#e)):Z(t,`store.state.recomputeCounts`,()=>xY(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return vJ(e,t)}static prepareInput(e,t={}){return yJ(e,t)}static preparePresortedInput(e){return bJ(e)}list(e){return Z(this.#e.instrumentation,`store.list`,()=>pY(this.#e,e))}add(e){Z(this.#e.instrumentation,`store.add`,()=>{let t=_X(this.#e);eY(this.#e,QJ(this.#e,t,mY(this.#e,e)))})}remove(e,t={}){Z(this.#e.instrumentation,`store.remove`,()=>{let n=_X(this.#e);eY(this.#e,QJ(this.#e,n,hY(this.#e,e,t)))})}move(e,t,n={}){Z(this.#e.instrumentation,`store.move`,()=>{let r=_X(this.#e),i=gY(this.#e,e,t,n);i!=null&&eY(this.#e,QJ(this.#e,r,i))})}batch(e){$J(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})}})}getVisibleCount(){return Z(this.#e.instrumentation,`store.getVisibleCount`,()=>_X(this.#e))}getVisibleSlice(e,t){return Z(this.#e.instrumentation,`store.getVisibleSlice`,()=>CX(this.#e,e,t))}getVisibleRowContext(e){return Z(this.#e.instrumentation,`store.getVisibleRowContext`,()=>SX(this.#e,e))}getVisibleTreeProjection(){return TX(this.#e)}getVisibleTreeProjectionData(e){return wX(this.#e,e)}getVisibleIndex(e){return Z(this.#e.instrumentation,`store.getVisibleIndex`,()=>EX(this.#e,e))}getPathInfo(e){return Z(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=CY(this.#e,e);if(t==null)return null;let n=Q(this.#e,t);return{depth:Pq(n),kind:X(n)?`directory`:`file`,path:yY(this.#e,t)}})}isExpanded(e){return Z(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=Q(this.#e,t);return AJ(this.#e,t,n)})}expand(e){Z(this.#e.instrumentation,`store.expand`,()=>{let t=_X(this.#e),n=DX(this.#e,e);n!=null&&eY(this.#e,QJ(this.#e,t,n))})}collapse(e){Z(this.#e.instrumentation,`store.collapse`,()=>{let t=_X(this.#e),n=OX(this.#e,e);n!=null&&eY(this.#e,QJ(this.#e,t,n))})}on(e,t){return BJ(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return NJ(this.#e,t)}markDirectoryUnloaded(e){Z(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(TY(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=_X(this.#e);FJ(this.#e,t),eY(this.#e,QJ(this.#e,n,KJ({affectedAncestorIds:SY(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return Z(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=_X(this.#e),r=PJ(this.#e,t);return eY(this.#e,QJ(this.#e,n,qJ({affectedAncestorIds:SY(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return Z(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||NJ(this.#e,n)!==`loading`||!LJ(this.#e,n,e.attemptId))return!1;let r=yY(this.#e,n);this.validateChildPatch(r,t);let i=_X(this.#e),a=[];for(let e of t.operations){qX(r,e);let t=_X(this.#e);switch(e.type){case`add`:a.push(QJ(this.#e,t,mY(this.#e,e.path)));break;case`remove`:a.push(QJ(this.#e,t,hY(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=gY(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(QJ(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return eY(this.#e,QJ(this.#e,i,JJ({affectedAncestorIds:SY(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:yY(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return Z(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=_X(this.#e),r=IJ(this.#e,t,e.attemptId);return eY(this.#e,QJ(this.#e,n,YJ({affectedAncestorIds:SY(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:yY(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return Z(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=_X(this.#e),i=RJ(this.#e,n,e.attemptId,t);return eY(this.#e,QJ(this.#e,r,XJ({affectedAncestorIds:SY(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:yY(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return Z(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(pX(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=_X(this.#e),n=mX(this.#e,e.mode??`stable`);return eY(this.#e,QJ(this.#e,t,ZJ({...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=TY(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??Kq(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=Jq(tJ(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(!X(Q(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=Q(this.#e,n);AJ(this.#e,n,i)||(jJ(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=Q(this.#e,e);if(!AJ(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=CY(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!X(Q(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!X(Q(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=Q(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=Q(this.#e,e),r=uY(this.#e,e);if(!AJ(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 qX(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}"`)}}var JX=e=>e.startsWith(`f::`)?e.slice(3):e;function YX(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function XX(e,t){return e===``?t:`${e}/${t}`}function ZX({files:e,path:t,isFolder:n,nextBasename:r}){let i=JX(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}=YX(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=XX(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 QX(e){return e.endsWith(`/`)}function $X(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 eZ(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 tZ(e,t){return t.includes(e)?eZ(t):[e]}function nZ(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 rZ(e,t){return{draggedPaths:e,target:t}}function iZ(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(QX(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function aZ(e,t){return t.kind===`root`||t.directoryPath==null?$X(e):t.directoryPath}function oZ(e,t){let n=e.map(e=>{let n=aZ(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 sZ(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 cZ(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(!sZ(KX.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 lZ(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function uZ(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 dZ(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function fZ(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 dZ(e,t.path)?n?e:null:e;case`move`:return uZ(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=fZ(r,e,n),r==null)return null;return r}}}function pZ(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function mZ(e){switch(e.operation){case`add`:return{...pZ(e),operation:`add`,path:e.path};case`remove`:return{...pZ(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...pZ(e),from:e.from,operation:`move`,to:e.to}}}function hZ(e){return{...pZ(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>mZ(e)),operation:`batch`}}function gZ(e){switch(e.operation){case`add`:case`remove`:case`move`:return mZ(e);case`batch`:return hZ(e);default:return null}}function _Z(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function vZ(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 yZ(e){return vZ(e).at(-1)??null}function bZ(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function xZ(e){return e.endsWith(`/`)}var SZ=e=>e.toLowerCase();function CZ(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function wZ(e){return e.endsWith(`/`)?e.slice(0,-1):e}function TZ(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var EZ=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},DZ=Symbol(`FILE_TREE_RENAME_VIEW`),OZ=512,kZ=512;function AZ(e){return e===`top`||e===`center`?e:`nearest`}function jZ(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=vZ(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 MZ(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:jZ(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var NZ=class e{static{Object.defineProperty(e.prototype,DZ,{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=cZ({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=yZ(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:AZ(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<=kZ){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=tZ(t,n);return this.#r.canDrag?.(r)!==!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=rZ(t.draggedPaths,n);(iZ(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}nZ(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=rZ(e.draggedPaths,t);if(iZ(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=oZ(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=xZ(r),a=wZ(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of vZ(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=CZ(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,xZ(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,xZ(e)?{recursive:!0}:void 0);return}let t=xZ(e),n=ZX({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:wZ(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(TZ(n.sourcePath,t),TZ(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=cZ({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=!_Z(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=yZ(e),n=bZ(e,t),r=null,i=null;for(let e of this.#be()){if(yZ(e)!==t)continue;let a=bZ(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=vZ(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=!_Z(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 KX({...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 vZ(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(SZ),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(SZ),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 vZ(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:EZ(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 vZ(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 vZ(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=MZ(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,OZ)),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=fZ(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=fZ(this.#c,e,!0),r=[...this.#B].map(t=>fZ(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=fZ(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return _Z(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&&lZ(e)&&(this.#i=null);let t=lZ(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=gZ(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},PZ=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 FZ(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 IZ(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 LZ(e,t){return t?`${e}/`:e}function RZ(e,t=null){let n=PZ(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=BZ(t);e!=null&&UZ({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 zZ(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=VZ(e);t!=null&&(c=HZ({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,statusByPath:i})||c)}for(let e of r){let t=BZ(e);t!=null&&(c=UZ({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:KZ(i),statusByPath:i}:e}function BZ(e){return VZ(e.path)}function VZ(e){let t=FZ(e);if(t!=null)return{canonicalPath:LZ(t.path,t.isDirectory),isDirectory:t.isDirectory}}function HZ({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,statusByPath:i}){let a=i.get(e);return a!=null&&(i.delete(e),a===`ignored`&&e.endsWith(`/`)&&r.delete(e),GZ(t,n,e),!0)}function UZ({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,isDirectory:i,status:a,statusByPath:o}){let s=o.get(e);return s!==a&&(s??WZ(t,n,e),o.set(e,a),a===`ignored`&&i?r.add(e):i&&r.delete(e),!0)}function WZ(e,t,n){for(let r of IZ(n))e.set(r,(e.get(r)??0)+1),t.add(r)}function GZ(e,t,n){for(let r of IZ(n)){let n=(e.get(r)??0)-1;n>0?e.set(r,n):(e.delete(r),t.delete(r))}}function KZ(e){let t=`${e.size}`;for(let[n,r]of e)t+=`\0${n}\0${r}`;return t}var qZ=e=>e.trim().toLowerCase(),JZ=e=>e.split(`/`).at(-1)??e,YZ=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 XZ(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function ZZ(e){let t=$K(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(qZ(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=JZ(o),c=s.toLowerCase(),l=r.get(c);if(l!=null)return XZ(l,e);for(let[t,n]of a)if(c.includes(t))return XZ(n,e);let u=YZ(s);for(let t of u){let n=i.get(t);if(n!=null)return XZ(n,e)}let d=ZK(t.set,s,u);if(d!=null&&t.set!==`none`){if(d==="default"){let t=n?.[e];if(t!=null)return XZ(t,e)}return{name:YK(d),remappedFrom:e,token:d}}}let s=n?.[e];return s==null?{name:e}:XZ(s,e)}}}var QZ,$Z,eQ,tQ,nQ,rQ,iQ,aQ,oQ,sQ,cQ={},lQ=[],uQ=Array.isArray,dQ=lQ.slice,fQ=Object.assign;function pQ(e){e&&e.parentNode&&e.remove()}function mQ(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?dQ.call(arguments,2):n),hQ(e,o,r,i,null)}function hQ(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??++$Z,__i:-1,__u:0};return i==null&&QZ.vnode!=null&&QZ.vnode(a),a}function gQ(e){return e.children}function _Q(e,t){this.props=e,this.context=t,this.__g=0}function vQ(e,t){if(t==null)return e.__?vQ(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`?vQ(e):null}function yQ(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 yQ(e)}}function bQ(e){(8&e.__g||!(e.__g|=8)||!eQ.push(e)||nQ++)&&tQ==QZ.debounceRendering||((tQ=QZ.debounceRendering)||queueMicrotask)(xQ)}function xQ(){for(var e,t,n,r,i,a,o,s,c=1;eQ.length;)eQ.length>c&&eQ.sort(rQ),e=eQ.shift(),c=eQ.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=fQ({},r)).__v=r.__v+1,QZ.vnode&&QZ.vnode(n),kQ(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??vQ(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,jQ(a,n,o),n.__e!=i&&yQ(n)));nQ=0}function SQ(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||lQ,b=t.length;for(c=CQ(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?cQ:y[m.__i]||cQ,m.__i=f,_=kQ(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&PQ(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=wQ(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function CQ(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?hQ(null,o,null,null,null):uQ(o)?hQ(gQ,{children:o},null,null,null):o.constructor==null&&o.__b>0?hQ(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=TQ(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=vQ(s)),FQ(s,s));return r}function wQ(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=wQ(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=vQ(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function TQ(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);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 EQ(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function DQ(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||EQ(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||EQ(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(iQ,`$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=aQ,e.addEventListener(t,a?sQ:oQ,a)):e.removeEventListener(t,a?sQ:oQ,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 OQ(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=aQ++;else if(t.u<n.l)return;return n(QZ.event?QZ.event(t):t)}}}function kQ(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,O,k,A,j,M=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=QZ.__b)&&d(t);n:if(typeof M==`function`)try{if(v=t.props,y=`prototype`in M&&M.prototype.render,b=(d=M.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 M(v,x):(t.__c=f=new _Q(v,x),f.constructor=M,f.render=IQ),b&&b.sub(f),f.props=v,f.state||(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&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=fQ({},f.__s)),fQ(f.__s,M.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&M.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&M.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=QZ.__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=fQ({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===gQ&&d.key==null&&(E=MQ(d.props.children)),s=SQ(e,uQ(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,O=!1,t.__u|=c?160:128,t.__c.__z=[],k=0;k<a.length;k++)(A=a[k])==null||O||(A.nodeType==8&&A.data==`$s`?(D>0&&t.__c.__z.push(A),D++,a[k]=null):A.nodeType==8&&A.data==`/$s`?(--D>0&&t.__c.__z.push(A),O=D===0,s=a[k],a[k]=null):D>0&&(t.__c.__z.push(A),a[k]=null));if(!O){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(j=a.length;j--;)pQ(a[j]);AQ(t)}}else t.__e=n.__e,t.__k=n.__k,e.then||AQ(t);QZ.__e(e,t,n)}else s=t.__e=NQ(n.__e,t,n,r,i,a,o,c,l,u);return(d=QZ.diffed)&&d(t),128&t.__u?void 0:s}function AQ(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(AQ)}function jQ(e,t,n){for(var r=0;r<n.length;r++)PQ(n[r],n[++r],n[++r]);QZ.__c&&QZ.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){QZ.__e(e,t.__v)}})}function MQ(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:uQ(e)?e.map(MQ):fQ({},e)}function NQ(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&&=(QZ.__m&&QZ.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=dQ.call(e.childNodes),v=n.props||cQ,!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;DQ(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&&!_||DQ(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=``),SQ(b==`template`?e.content:e,uQ(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&vQ(n,0),s,c,l),a!=null)for(u=a.length;u--;)pQ(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||DQ(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&DQ(e,u,g,v[u],i))}return e}function PQ(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){QZ.__e(e,n)}}function FQ(e,t,n){var r,i;if(QZ.unmount&&QZ.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||PQ(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){QZ.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&FQ(r[i],t,n||typeof e.type!=`function`);n||pQ(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function IQ(e,t,n){return this.constructor(e,n)}function LQ(e,t){var n,r,i,a;t==document&&(t=document.documentElement),QZ.__&&QZ.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=mQ(gQ,null,[e]),i=[],a=[],kQ(t,e,r||cQ,cQ,t.namespaceURI,r?null:t.firstChild?dQ.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),jQ(i,e,a)}function RQ(e,t){e.__u|=32,LQ(e,t)}QZ={__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 nQ=0,e}},$Z=0,_Q.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=fQ({},this.state);typeof e==`function`&&(e=e(fQ({},n),this.props)),e&&fQ(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),bQ(this))},_Q.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),bQ(this))},_Q.prototype.render=gQ,eQ=[],nQ=0,rQ=function(e,t){return e.__v.__b-t.__v.__b},iQ=/(PointerCapture)$|Capture$/i,aQ=0,oQ=OQ(!1),sQ=OQ(!0);var zQ=0;Array.isArray;function $(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:--zQ,__i:-1,__u:0,__source:i,__self:a};return QZ.vnode&&QZ.vnode(l),l}var BQ=16,VQ=16,HQ={};function UQ({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}=HQ[e]??{width:BQ,height:VQ},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return $(`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:$(`use`,{href:c})})}var WQ=e=>e!==void 0&&/\s/.test(e),GQ=(e,t)=>{let n=t=>WQ(e[t-1])||WQ(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},KQ=e=>GQ(e,Math.ceil(e.length/2)),qQ=e=>{if(e.length<2)return[e,``];let t=KQ(e);return[e.slice(0,t),e.slice(t)]},JQ=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:KQ(e);return[e.slice(0,r),e.slice(r)]},YQ=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)]},XQ=(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)]},ZQ=(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)]},QQ=(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 $Q({children:e,marker:t,variant:n=`default`}){"use no memo";return $(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:$(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?$(`span`,{"data-truncate-fade":!0}):t})})}function e$(e){"use no memo";let{mode:t,children:n}=e;return $(`div`,{children:[$(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?$(`span`,{children:n}):n}),$(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?$(`span`,{children:n}):n})]})}function t$({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=$(e$,{mode:t,children:e},`content`),o=$($Q,{marker:n,mode:t,variant:r},`marker`),s=$(`div`,{"data-truncate-fill":!0},`fill`);return $(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:$(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function n$({children:e,...t}){"use no memo";return $(t$,{mode:`truncate`,...t,children:e})}function r$({children:e,...t}){"use no memo";return $(t$,{mode:`fruncate`,...t,children:e})}function i$({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=$(n$,{...s,children:t[0]}),l=$(r$,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return $(`div`,{className:a,style:o});if(e.length<i)return $(n===`end`?r$:n$,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=qQ:r===`extension`?t=JQ:r===`leaf-path`&&(t=YQ);else if(typeof r==`number`)t=XQ,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=ZQ:e===`first`&&(t=QQ)}else typeof r==`function`&&(t=r);t??=qQ;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=$(n$,{...s,..._,children:f}),l=$(r$,{...s,...v,children:p})}return $(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[$(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),$(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var a$={endIndex:-1,startIndex:-1};function o$(e,t,n){return Math.min(Math.max(e,t),n)}function s$(e,t){return e<0||t<e?a$:{endIndex:t,startIndex:e}}function c$(e){return e.startIndex<0||e.endIndex<e.startIndex}function l$(e,t){return c$(e)?0:(e.endIndex-e.startIndex+1)*t}function u$(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function d$(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function f$(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 p$(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 m$(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 h$(e,t,n){if(e.length===0||t<=0)return[];let r=m$(e),i=f$(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=p$(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 g$(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=o$(t.scrollTop,0,o),c=t.stickyRows??h$(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=u$(s,n,t.itemHeight),m=u$(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?a$:s$(m,d$(u+d,n,t.itemHeight)),y=g+1,b=c$(v)?a$:s$(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=l$(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:c$(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var _$={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},v$={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},y$=`Contains git status items`;function b$(e){return e.current?!0:(e.current=!0,!1)}function x$(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 S$(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return x$({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 C$(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 w$(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 T$(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 E$(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function D$(e,t){return e!=null&&e>0?e:t}function O$(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 k$(e,t,n,r,i=0){let a=x$({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a!=null&&(e.scrollTop=a,!0)}function A$(e,t,n,r,i,a,o=0){let s=S$({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s!=null&&(e.scrollTop=s,!0)}function j$(e,t,n,r,i,a){let o=C$({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o!=null&&(e.scrollTop=o,!0)}function M$(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function N$(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function P$({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return $(`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 F$(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 I$(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 L$,R$,z$,B$,V$=Object.is,H$=0,U$=[],W$=QZ,G$=W$.__b,K$=W$.__r,q$=W$.diffed,J$=W$.__c,Y$=W$.unmount,X$=W$.__;function Z$(e,t){W$.__h&&W$.__h(R$,e,H$||t),H$=0;var n=R$.__H||(R$.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Q$(e){return H$=1,$$(d1,e)}function $$(e,t,n){var r=Z$(L$++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):d1(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);V$(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=R$,!R$.__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,V$(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};R$.__f=!0;var a=R$.shouldComponentUpdate,o=R$.componentWillUpdate;R$.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)},R$.shouldComponentUpdate=i}return r.__N||r.__}function e1(e,t){var n=Z$(L$++,3);!W$.__s&&u1(n.__H,t)&&(n.__=e,n.u=t,R$.__H.__h.push(n))}function t1(e,t){var n=Z$(L$++,4);!W$.__s&&u1(n.__H,t)&&(n.__=e,n.u=t,R$.__h.push(n))}function n1(e){return H$=5,r1(function(){return{current:e}},[])}function r1(e,t){var n=Z$(L$++,7);return u1(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function i1(e,t){return H$=8,r1(function(){return e},t)}function a1(){for(var e;e=U$.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(c1),e.__H.__h.forEach(l1),e.__H.__h=[]}catch(t){e.__H.__h=[],W$.__e(t,e.__v)}}W$.__b=function(e){R$=null,G$&&G$(e)},W$.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),X$&&X$(e,t)},W$.__r=function(e){K$&&K$(e),L$=0;var t=(R$=e.__c).__H;t&&(z$===R$?(t.__h=[],R$.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(c1),t.__h.forEach(l1),t.__h=[],L$=0)),z$=R$},W$.diffed=function(e){q$&&q$(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(U$.push(t)!==1&&B$===W$.requestAnimationFrame||((B$=W$.requestAnimationFrame)||s1)(a1)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),z$=R$=null},W$.__c=function(e,t){t.some(function(e){try{e.__h.forEach(c1),e.__h=e.__h.filter(function(e){return!e.__||l1(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],W$.__e(n,e.__v)}}),J$&&J$(e,t)},W$.unmount=function(e){Y$&&Y$(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{c1(e)}catch(e){t=e}}),n.__H=void 0,t&&W$.__e(t,n.__v))};var o1=typeof requestAnimationFrame==`function`;function s1(e){var t,n=function(){clearTimeout(r),o1&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);o1&&(t=requestAnimationFrame(n))}function c1(e){var t=R$,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),R$=t}function l1(e){var t=R$;e.__c=e.__(),R$=t}function u1(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!V$(t,e[n])})}function d1(e,t){return typeof t==`function`?t(e):t}function f1(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:$(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return $(gQ,{children:[$(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:$(n$,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function p1(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function m1(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function h1(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 g1({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=g$(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:h1(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?h1(u,1,t,o):i&&r<=0&&c.length>0?h$(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 _1=400,v1=40,y1=18;function b1(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))?x1(e,t,n):a instanceof HTMLElement?a:null}function x1(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 S1(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 C1(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 w1(){return navigator.vendor!==`Apple Computer, Inc.`}function T1(e,t){let n=e-t.top;if(n<v1)return-Math.ceil((v1-Math.max(0,n))/v1*y1);let r=t.bottom-e;return r<v1?Math.ceil((v1-Math.max(0,r))/v1*y1):0}function E1(e,t){if(e!=null){let t=_$[e];return t==null?null:{text:t,title:v$[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:y$}:null}function D1(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 O1(e){return e!=null&&`toggle`in e}function k1(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function A1(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function j1(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function M1(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function N1(e,t){return t&&M1(e)||(e.ctrlKey||e.metaKey)&&k1(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var P1=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function F1(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 I1(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 L1(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function R1(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function z1(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function B1(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 V1(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 H1(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 U1(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=H1(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 W1(e,t){return{kind:e.kind,name:m1(e),path:t}}function G1(e){return e==null?void 0:`${e}__tree`}function K1(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function q1(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function J1(e,t){if(e==null)return null;if(`text`in e)return e.parts==null?$(`span`,{title:e.title,children:e.text}):$(`span`,{title:e.title,children:e.parts.map((e,t)=>$(`span`,{style:{color:e.color},children:e.text},t))});let n=typeof e.icon==`string`?q1(e.icon)?t(e.icon):{name:e.icon}:q1(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return $(`span`,{title:e.title,children:$(UQ,{...n})})}function Y1(e){e!=null&&w$(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function X1(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=p1(e);return $(gQ,{children:[e.depth>0?$(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>$(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,$(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?$(UQ,{...t(`file-tree-icon-chevron`)}):$(UQ,{...t(`file-tree-icon-file`,u)})}),$(`div`,{"data-item-section":`content`,children:e.isFlattened?f1(e,c,a):c??$(i$,{minimumLength:5,split:`extension`,children:e.name})}),i?$(`div`,{"data-item-section":`decoration`,children:r==null?null:J1(r,t)}):null,s?$(`div`,{"data-item-section":`git`,children:J1(o,t)}):null,n?$(`div`,{"data-item-section":`action`,children:l?$(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:$(UQ,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function Z1(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:O,resolveIcon:k,renderDecorationForRow:A,openContextMenuForRow:j,onRowClick:M,onKeyDown:N}=e,P=p1(t),{isParked:F=!1,mode:I=`flow`,style:L}=r,ee=I===`sticky`,te=_?.get(P)??null??D1(t.ancestorPaths,v,y),ne=t.kind===`directory`&&(b?.has(P)??!1),R=A(t,P),z=E1(te,ne),B=S&&w,re=R!=null||x||B,ie=B&&T===`always`,ae=a.getPath()===P,oe=ae?a.getValue():``,se=ee||!ae?null:$(P$,{ref:D,ariaLabel:`Rename ${m1(t)}`,isFlattened:t.isFlattened,value:oe,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),ce=X1(t,k,{actionLaneEnabled:B,customDecoration:R,decorationLaneEnabled:re,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:z,gitLaneActive:x,renameInput:se,showDecorativeActionAffordance:ie}),le={...F$({ariaLabel:m1(t),domId:t.isFocused?K1(h,P,F):void 0,extraStyle:L,features:{actionLaneEnabled:B,contextMenuButtonVisibility:B?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:F,itemHeight:g,mode:I,row:t,state:{containsGitChange:ne,effectiveGitStatus:te,isContextHovered:s===P,isDragTarget:l?.kind===`directory`&&l.directoryPath===P,isDragging:c?.has(P)===!0,isFocusRinged:t.isFocused&&o===P},targetPath:P}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),E&&(i.focusMountedPathFromInput(P),j(t,P,{anchorRect:L1(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:ee?void 0:()=>{i.focusMountedPathFromInput(P)},onKeyDown:ee?void 0:N,ref:e=>{O(P,e)}};return!ee&&ae?$(`div`,{...le,children:ce}):$(`button`,{...le,type:`button`,draggable:u&&!F,onDragEnd:u&&!F?p:void 0,onDragStart:u&&!F?e=>{f(e,t,P)}:void 0,onMouseDown:e=>{if(ee){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!F?e=>{m(e,t,P)}:void 0,onClick:e=>{M(e,t,P,I)},children:ce})}function Q1(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(p1(e))).map((n,r)=>Z1(e,n,t.start+r))}function $1({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=nq,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 _=n1(null),v=n1(null),y=n1(!1),b=n1(null),x=n1(null),S=n1(null),C=n1(null),w=n1(null),T=n1(new Map),E=n1(new Map),D=n1(()=>{}),O=n1(null),k=n1(0),A=n1(!1),j=n1(null);j.current!==t&&(A.current=!1,j.current=t);let M=n1(!1),N=n1(null),P=n1(null),F=n1(!1),I=n1(null),L=n1(null),ee=n1(null),te=n1(null),ne=n1(null),R=n1(null),z=n1(null),B=n1(null),re=n1(!1),ie=n1(null),ae=n1(null),oe=n1(null),se=n1(null),ce=r1(()=>new Map,[]),[,le]=Q$(0),ue=n1(!1),[V,de]=Q$(null),[fe,pe]=Q$(null),[me,he]=Q$(null),[ge,_e]=Q$(null),[ve,ye]=Q$(0),[be,xe]=Q$(null),Se=n1(be);Se.current=be;let Ce=n1(null),we=n1(null),Te=n1(null),Ee=n1(null),De=n1(null),Oe=n1(!1),ke=()=>{we.current=null,Te.current=null,Ee.current=null},Ae=(e,t)=>{we.current=e,Te.current=null,Ee.current=t==null?null:{path:e,scrollTop:t}},je=(e,t)=>{we.current=null,Te.current={path:e,viewportOffset:t},Ee.current=null},Me=n1(d===`retain`&&t.isSearchOpen()),[Ne,Pe]=Q$(p);e1(()=>{p||Pe(!1)},[p]);let Fe=n1(!1),Ie=i1(()=>{Fe.current=!0,Pe(e=>e&&!1)},[]),[Le,Re]=Q$(()=>g1({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[ze,Be]=Q$(!1);e1(()=>{Be(!0)},[]);let Ve=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,He=e?.contextMenu?.triggerMode??(Ve?`right-click`:`both`),Ue=He===`both`||He===`button`,We=e?.contextMenu?.buttonVisibility??`when-needed`,Ge=He===`both`||He===`right-click`;t1(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;De.current=t,pe(t),_e(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(Oe.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 Ke=i1((e,t)=>{z1(T.current,e,t)},[]),qe=i1((e,t)=>{z1(E.current,e,t)},[]),H=i1(e=>{x.current=e},[]),Je=i1(e=>B1(e,E.current,T.current),[]),Ye=n!=null||r!=null||i!=null,{resolveIcon:Xe}=r1(()=>ZZ(a),[a]),Ze=t[DZ](),Qe=Ze.getPath(),$e=Qe!=null,et=t.isSearchOpen(),tt=t.getSearchValue(),nt=t.getFocusedPath(),rt=t.getFocusedIndex(),it=t.getScrollRequest(),at=t.isDragAndDropEnabled(),ot=t.getDragSession(),st=r1(()=>ot==null?null:new Set(ot.draggedPaths),[ot]),ct=ot?.target??null,lt=ot?.primaryPath??null,ut=G1(o),{overlayHeight:dt,overlayRows:ft,snapshot:pt,visibleRows:mt}=Le,ht=pt.physical.viewportHeight,gt=r1(()=>({end:pt.window.endIndex,start:pt.window.startIndex}),[pt.window.endIndex,pt.window.startIndex]),_t=ft,vt=pt.sticky.rows,yt=pt.physical.totalHeight,bt=pt.sticky.height,xt=r1(()=>new Set(vt.map(e=>p1(e.row))),[vt]),St=rt>=0&&rt>=gt.start&&rt<=gt.end,Ct=i1((e,t)=>u?.({item:W1(e,t),row:e})??null,[u]),wt=i1(e=>w$(e==null?null:T.current.get(e)??null)?!0:w$(S.current),[]),Tt=i1(e=>{wt(t.focusNearestPath(e))},[t,wt]),Et=n1(Tt);Et.current=Tt;let Dt=n1(!0),Ot=n1(()=>{}),kt=i1((t=!0)=>{let n=Se.current;n!=null&&(Dt.current=Dt.current&&t,xe(null),e?.contextMenu?.onClose?.(),Dt.current&&Tt(n.path))},[e?.contextMenu,Tt]);Ot.current=kt;let At=i1(e=>{let t=e==null?null:R1(S.current,e);he(e=>e===t?e:t)},[]),jt=i1((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=Je(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Ae(n,e?.scrollTop??null),M.current=!0,de(e=>e===n?e:n)}i.focus(),At(a),Dt.current=!0,xe({anchorRect:r?.anchorRect??null,item:W1(e,n),path:n,source:r?.source??`keyboard`})},[t,Je,At]),Mt=i1(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=E$(e,ht);I.current=rt<0||e==null?null:Math.max(0,Math.min(rt*s-e.scrollTop,Math.max(0,t-s))),F.current=!0}t.startRenaming(e)!==!1&&(_e(`focus`),le(e=>e+1))}},[t,rt,s,l,ht]),Nt=i1((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=E$(i,ht),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:g1({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return M.current=!0,j$(i,a,s,l,u,d),D.current(),Ce.current=n?e:null,!0},[t,s,c,ht,h]),Pt=()=>y.current===!0||se.current!=null||re.current===!0,Ft=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),It=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Lt=()=>{te.current!=null&&(clearTimeout(te.current),te.current=null),ee.current=null},Rt=()=>{R.current?.remove(),R.current=null},zt=()=>{It(L.current),L.current=null,ne.current=null},Bt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},Vt=()=>{B.current?.(),B.current=null,se.current!=null&&(clearTimeout(se.current),se.current=null),re.current=!1,ie.current=null,oe.current=null,ae.current!=null&&(ae.current.setAttribute(`draggable`,`true`),ae.current.style.removeProperty(`touch-action`),ae.current=null),Rt(),Lt(),zt(),z.current=null},Ht=(e,n)=>{let r=S.current?.getRootNode(),i=S1(b1(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Ut=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Lt();return}let r=t.getItem(e.directoryPath),i=O1(r)?r:null;if(i==null||i.isExpanded()){Lt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;ee.current!==a&&(Lt(),ee.current=a,te.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind===`directory`&&n.directoryPath===e.directoryPath&&n.flattenedSegmentPath===e.flattenedSegmentPath&&i.expand()},n))},Wt=()=>{L.current=null;let e=ne.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=T1(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()),Ut(Ht(e.clientX,e.clientY)),L.current=Ft(Wt)},Gt=(e,t)=>{ne.current={clientX:e,clientY:t},L.current??=Ft(Wt)},Kt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(Vt(),Rt(),Lt(),zt(),t.startDrag(r)===!1){e.preventDefault();return}if(z.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),w1())){let t=C1(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Bt(t),R.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},qt=()=>{Rt(),Lt(),zt(),z.current=null,t.cancelDrag()},Jt=(e,n,r)=>{if(se.current!=null||re.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;oe.current={clientX:i.clientX,clientY:i.clientY},ae.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!re.current;se.current!=null&&(clearTimeout(se.current),se.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),B.current===o&&(B.current=null),t&&(a.setAttribute(`draggable`,`true`),ae.current===a&&(ae.current=null),oe.current=null)},s=e=>{let t=e.touches[0],n=oe.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=100||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),B.current=o,se.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),ae.current===a&&(ae.current=null),oe.current=null;return}re.current=!0,ae.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),z.current=n;let e=a.getBoundingClientRect(),s=C1(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`}),Bt(s),R.current=s,ie.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=ie.current;n!=null&&R.current!=null&&(R.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Ut(Ht(t.clientX,t.clientY)),Gt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Ht(n.clientX,n.clientY),t.completeDrag(),Vt()},u=()=>{t.cancelDrag(),Vt()};B.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)},_1)},Yt=e=>{if(be!=null){if(e.key===`Escape`){kt(),e.preventDefault(),e.stopPropagation();return}P1.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(Ze.isActive()){if(e.isComposing||e.keyCode===229)return;if(e.key===`Escape`)Ze.cancel();else if(e.key===`Enter`)Ze.commit();else return;_e(`focus`),le(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Mt(nt??void 0),e.preventDefault(),e.stopPropagation();return}if(et){if(e.key===`Escape`)F.current=!1,I.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=E$(n,ht);I.current=rt<0||n==null?null:Math.max(0,Math.min(rt*s-n.scrollTop,Math.max(0,r-s))),F.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;_e(`focus`),le(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&A1(e)){t.openSearch(e.key),le(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Ve&&M1(e),r=N1(e,Ve),i=r&&S.current!=null?T$(S.current):null,a=r?new Set(V1(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==nt&&a.has(o)){let e=C.current;Ae(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=O1(p)?p:null,h=u!=null&&(xt.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=B1(u,E.current,T.current);e==null||n==null?y=!1:jt(e,u)}else if((e.ctrlKey||e.metaKey)&&k1(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;_e(`focus`);let b=t.getFocusedPath(),x=b!=null&&(xt.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))Ae(b,v?.scrollTop??null),M.current=!0,de(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(je(b,U1(S.current,v,i,u,s,bt,ht)),M.current=!0,de(e=>e===b?e:b)):ke()}le(e=>e+1),e.preventDefault(),e.stopPropagation()};t1(()=>{if(!(!f||!et)){if(Me.current){Me.current=!1;return}w$(w.current)}},[et,f]),t1(()=>{let e=x.current;switch(N$({hasRenderedInput:e!=null,previousRenamingPath:P.current,renamingPath:Qe})){case`reset`:P.current=null;return;case`reveal-canonical`:Qe!=null&&Nt(Qe,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(Ce.current=null,P.current=Qe,w$(e),e.select());return}},[gt.end,gt.start,Qe,Nt,xt]),t1(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=T$(e)?.dataset.itemPath??null;de(e=>e===t?e:t)},i=()=>{n(),M.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,T$(e)!=null){r();return}M.current=!1,de(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),M.current=!1,de(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;de(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),t1(()=>{let e=S.current;e!=null&&(pt.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[pt.physical.scrollTop]),t1(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=E$(n,g);let a=()=>{let e=t.getVisibleCount(),r=D$(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Re(g1({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!A.current){A.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=D$(O.current,g),i=t.getVisibleRows(e,e)[0]??null;k$(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(()=>{b$(ue)&&le(e=>e+1),a()}),l=()=>{Oe.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,ye(e=>e+1),e=null},50))},u=null,d=()=>{i!=null&&delete i.dataset.overlayReveal,u!=null&&(clearTimeout(u),u=null)},f=()=>{i!=null&&Oe.current!==!0&&(n.scrollTop>0||(i.dataset.overlayReveal=`true`,u!=null&&clearTimeout(u),u=setTimeout(()=>{d()},200)))},p=()=>{if(a(),n.scrollTop>0&&d(),Se.current!=null&&y.current&&Ot.current(),Oe.current===!0){y.current=!1;return}pe(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=>{O.current=(e[0]==null?null:O$(e[0]))??E$(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,O.current=null,x?.disconnect()}},[t,g,s,c,h]),t1(()=>{Ve||be==null||kt(!1)},[kt,Ve,be]);let Xt=r1(()=>be==null?null:`${be.path}::${be.source}`,[be]);t1(()=>{if(Xt==null){m?.clearSlotContent(jG);return}let t=Se.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??I1(n.getBoundingClientRect()),close:e=>{Ot.current(e?.restoreFocus??!0)},restoreFocus:()=>{Dt.current&&Et.current(Se.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(jG,i),e?.contextMenu?.onOpen?.(t.item,r),Y1(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&Y1(i)}),()=>{m?.clearSlotContent(jG)}},[Xt,e?.contextMenu,m]),t1(()=>{be!=null&&t.getItem(be.path)==null&&kt()},[kt,be,t]),t1(()=>{if(be==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(F1(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&kt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),kt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[kt,be]),t1(()=>{let e=C.current,n=S.current;if(e==null||n==null){N.current=nt;return}let r=nt==null?null:T.current.get(nt)??null,i=T$(n),a=i?.dataset.itemPath??null,o=$e&&x.current===i,c=f&&w.current===i,l=F.current&&!et,u=I.current??0,d=Ce.current,p=we.current,m=Te.current,g=Ee.current,_=i!=null,v=M.current||_,y=N.current!==nt,b=p!=null&&p===nt&&nt!=null,E=!1,O=!1;if(it!=null&&it.id!==k.current){k.current=it.id;let n=it.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,ht-s))):bt;E=!0,O=A$(e,n,s,ht,yt,it.offset,t)}t.clearScrollRequest(it.id)}let A=!E&&l&&j$(e,rt,s,ht,yt,u),j=!E&&d!=null&&d===nt&&j$(e,rt,s,ht,yt,bt),P=!E&&m!=null&&m.path===nt&&j$(e,rt,s,ht,yt,m.viewportOffset),L=!E&&g!=null&&g.path===nt&&e.scrollTop!==g.scrollTop;if(L&&(e.scrollTop=g.scrollTop),(L||O||j||P||A||v&&y&&d!==nt&&!b&&k$(e,rt,s,ht,bt))&&D.current(),E){N.current=nt;return}if(!v){N.current=nt;return}if(o){N.current=nt;return}if(c&&!l){N.current=nt;return}if(r==null){l&&rt>=0&&(j$(e,rt,s,ht,yt,u),D.current()),N.current=nt;return}(y||l||d===nt||p===nt||m?.path===nt||g?.path===nt||a==null||a!==nt)&&(w$(r),d===nt&&(Ce.current=null),p===nt&&(we.current=null),m?.path===nt&&(Te.current=null),g?.path===nt&&(Ee.current=null),F.current=!1,I.current=null),N.current=nt},[t,rt,nt,St,s,$e,et,gt,ht,f,it,h,bt,yt,mt]);let Zt=rt>=0&&rt>=pt.visible.startIndex&&rt<=pt.visible.endIndex,Qt=nt!=null&&_t.some(e=>p1(e.row)===nt),$t=Zt||Qt,en=Ue&&M.current===!0&&$t?nt:null,tn=ge===`pointer`?fe:null,nn=be?.path??De.current??tn??en??fe,rn=be?.source===`right-click`;t1(()=>{y.current&&be==null||At(Je(nn))},[be,Je,gt,ht,ve,_t,nn,At,mt]);let an=i1(e=>{if(y.current||F1(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&&_e(e=>e===`pointer`?e:`pointer`),pe(e=>e===i?e:i)},[]),on=i1(()=>{pe(null)},[]);t1(()=>{if(!at)return;let e=()=>{Vt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Vt(),t.cancelDrag()}},[t,at]);let sn=e=>{if(!at||t.getDragSession()==null||re.current)return;let n=S1(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Ut(t.getDragSession()?.target??null),Gt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},cn=e=>{if(!at||t.getDragSession()==null||re.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Lt(),zt(),t.setDragTarget(null))},ln=e=>{!at||t.getDragSession()==null||re.current||(e.preventDefault(),Ht(e.clientX,e.clientY),t.completeDrag(),Rt(),Lt(),zt(),z.current=null)},un=pt.window.height,dn=pt.window.offsetTop,fn=Math.min(0,ht-un),pn=Math.min(0,ht-un-bt),mn=V===nt||F.current,hn=nt!=null&&mn&&!St&&rt>=0?mt[rt]??t.getVisibleRows(rt,rt)[0]??null:null,gn=hn==null?null:M$(rt,s,gt,un),_n=z.current,vn=lt!=null&&_n!=null&&_n.path===lt&&_n.index>=gt.start&&_n.index<=gt.end,yn=lt!=null&&_n!=null&&_n.path===lt&&!vn&&_n.path!==hn?.path?_n:null,bn=yn==null?null:M$(yn.index,s,gt,un),xn=j1((rt>=0?mt[rt]??t.getVisibleRows(rt,rt)[0]??null:null)?.ancestorPaths.at(-1)??null),Sn=et&&nt!=null?K1(o,nt,!St):void 0,Cn=be?.path??(et?nt:V),wn=be?.path??fe,Tn=Je(nn),En=Ve&&Ue&&!rn&&!$e&&Tn!=null&&me!=null&&nn!=null,Dn=Ve&&(En||be!=null),On=be?.anchorRect,kn=On==null&&Tn!=null&&me!=null&&(be!=null||En)?me:null,An=On==null?kn==null?void 0:{top:`${kn}px`}:{left:`${On.left}px`,position:`fixed`,right:`auto`,top:`${On.top}px`},jn=rn?{opacity:`0`}:void 0,Mn=i1((e,n,r,i)=>{let a=I$({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:et,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)}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=pt.visible.startIndex&&n.index<=pt.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(M.current=!0,de(e=>e===c?e:c),_e(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&Nt(c,{targetOffset:`sticky-parents`})},[t,et,pt.visible.endIndex,pt.visible.startIndex,Nt]),Nn=()=>{if(y.current||!Ue||nn==null||Tn==null)return;let e=t.getItem(nn);e!=null&&(At(Tn),Dt.current=!0,xe({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:Tn.getAttribute(`aria-label`)??nn,path:e.getPath()},path:e.getPath(),source:`button`}))},Pn={contextHoverPath:wn,contextMenuButtonTriggerEnabled:Ue,contextMenuButtonVisibility:We,contextMenuEnabled:Ve,contextMenuRightClickEnabled:Ge,contextMenuTriggerMode:He,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:at,draggedPathSet:st,dragTarget:ct,gitLaneActive:Ye,gitStatusByPath:n,handleRowDragEnd:qt,handleRowDragStart:Kt,handleRowTouchStart:Jt,ignoredGitDirectories:r,ignoredInheritanceCache:ce,instanceId:o,itemHeight:s,onKeyDown:Yt,onRowClick:Mn,openContextMenuForRow:jt,registerButton:Ke,registerRenameInput:H,renameView:Ze,renderDecorationForRow:Ct,resolveIcon:Xe,shouldSuppressContextMenu:Pt,visualFocusPath:Cn},Fn={...Pn,registerButton:qe};return $(`div`,{ref:S,id:ut,"data-file-tree-context-menu-button-visibility":Ve&&Ue?We:void 0,"data-file-tree-context-menu-trigger-mode":Ve?He:void 0,"data-file-tree-has-context-menu-action-lane":Ve&&Ue?`true`:void 0,"data-file-tree-has-git-lane":Ye?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:at?cn:void 0,onDragOver:at?sn:void 0,onDrop:at?ln:void 0,onKeyDown:Yt,onPointerLeave:Ve?on:void 0,onPointerOver:Ve?an:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[$(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:xn}}),$(`slot`,{name:AG,"data-type":`header-slot`}),f?$(`div`,{"data-file-tree-search-container":!0,"data-open":et?`true`:`false`,children:$(`input`,{ref:w,"aria-activedescendant":Sn,"aria-controls":ut,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ne?`true`:void 0,value:tt,onBlur:()=>{d===`retain`&&!Fe.current||t.closeSearch()},onFocus:Ie,onPointerDown:Ie,onInput:e=>{Ie();let n=e.currentTarget;t.setSearch(n.value)}})}):null,$(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&ze&&_t.length>0?$(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:$(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${dt}px`},children:_t.map((e,t)=>Z1(Fn,e.row,`sticky:${p1(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${_t.length-t}`}}))})}):null,$(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${yt}px`},children:[$(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${dn}px`}}),$(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${un}px`,top:`${fn}px`,bottom:`${pn}px`},children:[Q1(Pn,gt,xt),hn!=null&&gn!=null?Z1(Pn,hn,`parked:${hn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:lt===hn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${gn}px`}}):null,yn!=null&&bn!=null?Z1(Pn,yn,`parked-drag:${yn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${bn}px`}}):null]})]})]}),Ve?$(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":Dn?`true`:`false`,style:An,children:[$(`button`,{ref:v,type:`button`,"data-type":MG,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":be==null?`false`:`true`,"data-visible":En?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),be!=null){kt();return}Nn()},tabIndex:-1,style:jn,children:$(UQ,{...Xe(`file-tree-icon-ellipsis`)})}),be==null?null:$(`slot`,{name:jG})]}):null,be==null?null:$(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),kt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),kt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var e0={hydrateRoot:(e,t)=>{RQ(mQ($1,t),e)},renderRoot:(e,t)=>{LQ(mQ($1,t),e)},unmountRoot:e=>{LQ(null,e)}};function t0(e,t){e0.renderRoot(e,t)}function n0(e,t){e0.hydrateRoot(e,t)}function r0(e){e0.unmountRoot(e)}var i0=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)}}};Array.isArray;var a0=0;function o0(e){return e!=null&&e.length>0?e:(a0+=1,`pst_ft_${a0}`)}function s0({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??nq)}function c0(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 l0(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 u0(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var d0=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new i0;#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=o0(a),this.#p=RZ(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=tq(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new NZ({...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&&(r0(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()}getFocusedIndex(){return this.#t.getFocusedIndex()}getVisibleCount(){return this.#t.getVisibleCount()}getVisibleRows(e,t){return this.#t.getVisibleRows(e,t)}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)}focusFirstItem(){this.#t.focusFirstItem()}focusLastItem(){this.#t.focusLastItem()}focusNextItem(){this.#t.focusNextItem()}focusPreviousItem(){this.#t.focusPreviousItem()}focusParentItem(){this.#t.focusParentItem()}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=zZ(this.#p,e);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&t0(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(),t0(t.wrapper,this.#w()))}setGitStatus(e){let t=RZ(e,this.#p);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&t0(n.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),t0(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),n0(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),t0(r,this.#w())}#C(){return{initialViewportHeight:s0({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(AG,e());return}this.#l.setSlotHtml(AG,this.#e?.header?.html??null)}#k(e){let t=u0(e).find(e=>l0(e)),n=c0(JK($K(this.#m).set));n!=null&&(t==null||t.outerHTML!==n.outerHTML)&&(t==null?e.prepend(n):t.replaceWith(n))}#A(e){let t=u0(e),n=t.find(e=>l0(e)),r=t.filter(e=>e!==n),i=$K(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=c0(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=$K(this.#m);t.colored&&XK(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${EG}]`);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(EG,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=oq(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 fq(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 f0(e){let[t]=(0,p.useState)(()=>new d0(e)),n=(0,p.useRef)({timeout:null,model:t});return(0,p.useEffect)(()=>{let{current:e}=n;return e.timeout!=null&&(clearTimeout(e.timeout),e.timeout=null),()=>{e.timeout=setTimeout(()=>e.model.cleanUp(),1)}},[]),{model:t}}function p0(e){let t=new Set;for(let n of e)for(let e=n.indexOf(`/`);e!==-1;e=n.indexOf(`/`,e+1))t.add(n.slice(0,e));return[...t]}function m0(e,t){let n=[];for(let r of p0(t)){let t=e.getItem(r);(!t||!t.isDirectory()||t.isExpanded())&&n.push(r)}return n}function h0(e){let t=e.status===`A`?`added`:e.status===`D`?`deleted`:e.status===`R`||e.status===`C`?`renamed`:`modified`;return{path:e.path,status:t}}function g0(e){return e.map(e=>`${e.path}\0${h0(e).status}`).join(`
2972
- `)}function _0(e,t){return t.map(t=>`${t.path}\0${t.additions}\0${t.deletions}\0${+!!t.binary}\0${GM(e,t)}`).join(`
2973
- `)}function v0(e,t){return e?e.paths===t.paths?e.status===t.status?e.decoration===t.decoration?`none`:`decoration`:`status`:`reset`:`none`}var y0={viewed:{glyph:`✓`,color:`var(--add)`,title:`Viewed · click or v to toggle`},unviewed:{glyph:`○`,color:`var(--fg-2)`,title:`Not viewed · click or v to toggle`},restale:{glyph:`◐`,color:`var(--warn)`,title:`Changed since you viewed it · click or v to mark viewed again`}},b0=`
2979
+ }`}var bq=new WeakMap;function xq(e){let t=bq.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(BG,`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(),bq.set(e,i),i}function Sq(e,t){if(!e.isConnected)return;let n=xq(t);if(n==null)return;let r=t.querySelector(`style[${VG}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(VG,``),t.appendChild(i)),i.textContent=`:host { ${HG}: ${n}px; }`}var Cq;function wq(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){Cq??(Cq=new CSSStyleSheet,Cq.replaceSync(vq(gq)));let t=!1;try{e.adoptedStyleSheets=[Cq],t=!0}catch{}if(t){e.querySelector(`style[${RG}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(RG,``),t.textContent=vq(gq),e.prepend(t)}}function Tq(e,t){Eq(e,t),wq(t),Sq(e,t)}function Eq(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`});Tq(this,e)}}if(customElements.define(LG,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(LG)))e instanceof HTMLElement&&Tq(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var Dq=5,Oq=32,kq=128;function Aq(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function jq(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function Mq(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 Nq(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 Pq(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function Fq(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 Iq(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,Bq(e,t)}function Lq(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=Nq(e).get(t);if(i===void 0)return;let a=i>>Dq;e.childVisibleChunkSums[a]+=r}function Rq(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=Vq(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=Oq}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 zq(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>Dq;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<Dq}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 Bq(e,t){if(t.childIds.length<kq){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/Oq),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>>Dq]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function Vq(e,t,n,r){let i=Math.min(t.childIds.length,n+Oq),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 Hq=7,Uq=3,Wq=8,Gq=4;function Kq(e,t,n=0){return e<<Gq|n<<Uq|t}function qq(e){return e.depthAndFlags>>>Gq}function Jq(e){return(e.depthAndFlags&Wq)>>Uq}function Yq(e){return(e.depthAndFlags&Wq)!==0}function Xq(e){return e.depthAndFlags&Hq}function Zq(e,t){return(Xq(e)&t)!==0}function Qq(e,t){e.depthAndFlags|=t}function $q(e,t){e.depthAndFlags=Kq(t,Xq(e),Jq(e))}var eJ=Symbol(`benchmarkInstrumentation`);function tJ(e,t){return t==null||Object.defineProperty(e,eJ,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function nJ(e){return e==null?null:e[eJ]??null}function Z(e,t,n){return e==null?n():e.measurePhase(t,n)}function rJ(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function iJ(e){return e>=48&&e<=57}function aJ(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!iJ(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&&iJ(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 oJ(e){let t=e.toLowerCase();return{lowerValue:t,tokens:aJ(t)}}function sJ(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 cJ(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=sJ(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function lJ(e,t,n){let r=cJ(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function uJ(e,t){return lJ(e,t,oJ)}function dJ(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function fJ(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=dJ(e,r);return a===dJ(t,r)?uJ(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 pJ(e,t){return fJ(e,t)}function mJ(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=oJ(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=dJ(e,n);return o===dJ(t,n)?lJ(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 hJ(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=oJ(r);return e.sortKeyById[t]=i,i}function gJ(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function _J(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 vJ(e){let{hasTrailingSlash:t,segments:n}=_J(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function yJ(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=_J(e);return{requiresDirectory:t,segments:n}}function bJ(){let e=new Map;return e.set(``,0),{idByValue:e,valueById:[``],sortKeyById:[oJ(``)]}}function xJ(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 SJ(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var CJ=Symbol(`pathStorePreparedInputKind`);function wJ(e,t){return e[CJ]=t,e}function TJ(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function EJ(e,t,n){return n==="default"?pJ(e,t):n(TJ(e),TJ(t))}function DJ(){return{depthAndFlags:Kq(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function OJ(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 kJ(e){return e.isDirectory?e.segments.length:e.segments.length-1}function AJ(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 jJ(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function MJ(e,t={}){return RJ(e,t).map(e=>e.path)}function NJ(e,t={}){let n=RJ(e,t);return wJ({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function PJ(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 wJ({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function FJ(e){let t=e,n=t.preparedPaths;if(t[CJ]===`prepared`&&n!=null)return n;if(!AJ(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function IJ(e){let t=e;return t[CJ]===`presorted`&&t.presortedPaths!=null||jJ(t.presortedPaths)?t.presortedPaths:null}function LJ(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function RJ(e,t={}){let n=gJ(t),r=nJ(t);rJ(r,`workload.inputFiles`,e.length);let i=Z(r,`store.preparePathEntries.parse`,()=>e.map(e=>vJ(e)));return Z(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>EJ(e,t,n.sort))),i}var zJ=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[DJ()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=bJ();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=nJ(e),this.options=gJ(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,Aq())}appendPaths(e){return Z(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>vJ(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,Z(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return Z(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:Kq(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:Kq(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d,m=a+1}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:Kq(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=vJ(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:Kq(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:Kq(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=vJ(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(Z(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||Z(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"?mJ(this.lastPreparedPath,e,this.segmentSortKeyCache):EJ(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=kJ(e),i=n==null?0:kJ(n),a=n==null?0:OJ(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=xJ(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:Kq(qq(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),Pq(i,s),s}createFileChildUnchecked(e,t){let n=xJ(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:Kq(qq(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),Pq(r,a),a}getOrCreateDirectoryChild(e,t){let n=xJ(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&&!Yq(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:Kq(qq(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),Pq(r,a),this.directories.set(a,Aq()),a}createDirectoryChild(e,t){let n=xJ(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:Kq(qq(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),Pq(r,a),this.directories.set(a,Aq()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!Yq(n))throw Error(`Path is not a directory: "${t}"`);if(Zq(n,1))throw Error(`Duplicate path: "${t}"`);Qq(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,jq());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(Yq(a)){let t=jq();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;Yq(n)&&this.directories.set(t,Aq());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),Pq(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!Yq(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 Iq(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function BJ(e,t=`closed`,n=null){let r=HJ(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 VJ(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function HJ(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 UJ(e,t){return Zq(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion!==`closed`&&qq(t)<=e.defaultExpansion}function WJ(e,t,n=e.snapshot.nodes[t]){return n==null||!Yq(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:UJ(e,n)}function GJ(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!Yq(r))return;let i=UJ(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 KJ(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 qJ(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function JJ(e,t){let n=KJ(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 YJ(e,t){let n=KJ(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function XJ(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 ZJ(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function QJ(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 $J(e,t){e.directoryLoadInfoById.delete(t)}function eY(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 tY(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function nY(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function rY(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function iY(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function aY(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function oY(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function sY(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 cY(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 lY(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 uY(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 dY(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 fY(e,t,n){return{...n,visibleCountDelta:CY(e)-t}}function pY(e,t){let n=CY(e),r=VJ();e.transactionStack.push(r);try{t()}catch(t){throw gY(e,r,!1),t}gY(e,r,!0,CY(e)-n)}function mY(e,t){let n=e.instrumentation;if(n==null){hY(e,t);return}Z(n,`store.events.record`,()=>hY(e,t))}function hY(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){xY(e,t);return}n.events.push(t),bY(n,t)}function gY(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?yY(i,t):Z(n,`store.events.batch.merge`,()=>yY(i,t));return}let a=_Y(t,r),o=e.instrumentation;if(o==null){xY(e,a);return}Z(o,`store.events.batch.commit`,()=>xY(e,a))}function _Y(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 vY(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function yY(e,t){for(let n of t.events)e.events.push(n);vY(e,t)}function bY(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function xY(e,t){let n=e.instrumentation;if(n==null){SY(e,t);return}Z(n,`store.events.emit`,()=>SY(e,t))}function SY(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function CY(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function wY(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!Yq(n)||Zq(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||!Yq(a)?null:i}function TY(e,t){let n=t;for(;;){let t=wY(e,n);if(t==null)return n;n=t}}function EY(e,t){let n=[t],r=t;for(;;){let t=wY(e,r);if(t==null)return n;n.push(t),r=t}}function DY(e,t){let n=t==null?e.snapshot.rootId:LY(e,t);return n==null?[]:BY(e,n)}function OY(e,t){let n=vJ(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=tX(e,eX(e,r)),{createdNodeIds:a,directoryId:o}=VY(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=Q(e,o);if(Zq(n,1))throw Error(`Path already exists: "${t}"`);Qq(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=UY(e,o,n.basename),s.add(c);PY(e,o);let l=tX(e,o);return tY({affectedAncestorIds:IY(e,c),affectedNodeIds:[...s],path:t,projectionChanged:nX(i,l)})}function kY(e,t,n){let r=LY(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=Q(e,r);if(Zq(i,2))throw Error(`The root node cannot be removed`);if(Yq(i)&&zY(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=tX(e,a),s=QY(e,r);KY(e,a,r,i.nameId),$Y(e,a),PY(e,a);let c=tX(e,a);return nY({affectedAncestorIds:IY(e,a),affectedNodeIds:s,path:t,projectionChanged:nX(o,c),recursive:n.recursive===!0})}function AY(e,t,n,r){let i=LY(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=Q(e,i);if(Zq(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=XY(e,i,n),c=tX(e,a.parentId),l=tX(e,s.parentId),u=SJ(e.snapshot.segmentTable,a.nameId),d=xJ(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(Yq(a)&&oX(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=Mq(e.snapshot.nodes,zY(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&ZY(e,p,o,Jq(a))===`skip`)return null;let m=a.parentId;KY(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),aX(e,i),GY(e,s.parentId,i),$Y(e,m),e.pathCacheVersion++,PY(e,m),s.parentId!==m&&PY(e,s.parentId);let h=tX(e,m),g=tX(e,s.parentId);return rY({affectedAncestorIds:[...new Set([...IY(e,m),...IY(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:rX([c,l],[h,g]),to:NY(e,i)})}function jY(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function MY(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function NY(e,t){let n=Q(e,t),r=jY(e,t);if(r!=null)return r;if(Zq(n,2))return MY(e,t,``);let i=NY(e,n.parentId),a=SJ(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return MY(e,t,Yq(n)?`${o}/`:o)}function PY(e,t){let n=e.instrumentation;if(n==null){cX(e,t);return}Z(n,`store.recomputeCountsUpwardFrom`,()=>cX(e,t))}function FY(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||!Yq(o)){sX(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){sX(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function IY(e,t){let n=[],r=t;for(;r!=null;){let t=Q(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function LY(e,t){if(t.length===0)return e.snapshot.rootId;let n=yJ(t);return RY(e,n.segments,n.requiresDirectory)}function RY(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=zY(e,r),a=Mq(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=Q(e,r);return n&&!Yq(i)?null:r}function zY(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 Q(e,t){let n=e.snapshot.nodes[t];if(n===void 0||Zq(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function BY(e,t){let n=e.snapshot.nodes[t];if(n===void 0||Zq(n,4))return[];if(!Yq(n))return[NY(e,t)];if(zY(e,t).childIds.length===0)return Zq(n,1)&&!Zq(n,2)?[NY(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||Zq(n,4)){i.pop();continue}if(!Yq(n)){r.push(NY(e,t.nodeId)),i.pop();continue}let a=zY(e,t.nodeId);if(a.childIds.length===0){Zq(n,1)&&!Zq(n,2)&&r.push(NY(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 VY(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=xJ(e.snapshot.segmentTable,i),a=zY(e,r),o=Mq(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!Yq(Q(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=HY(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function HY(e,t,n){let r=Q(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:Kq(qq(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,Aq()),GY(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function UY(e,t,n){let r=xJ(e.snapshot.segmentTable,n),i=zY(e,t);if(Mq(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${uX(e,t,n)}"`);let a=Q(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:Kq(qq(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),GY(e,t,o),e.activeNodeCount++,o}function WY(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}qY(e,n,o)<0?i=a:r=a+1}return r}function GY(e,t,n){let r=zY(e,t),i=Q(e,n);Mq(e.snapshot.nodes,r).set(i.nameId,n),Lq(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=WY(e,r,n);r.childIds.splice(a,0,n),Fq(r,a),Bq(e.snapshot.nodes,r)}function KY(e,t,n,r){let i=zY(e,t),a=Nq(i),o=a.get(n)??-1;Mq(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&Lq(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),Fq(i,o),Bq(e.snapshot.nodes,i))}function qY(e,t,n){let r=e.snapshot.options.sort;return r==="default"?JY(e,t,n):r(YY(e,t),YY(e,n))}function JY(e,t,n){let r=Q(e,t),i=Q(e,n),a=Yq(r);if(a!==Yq(i))return a?-1:1;let o=cJ(hJ(e.snapshot.segmentTable,r.nameId),hJ(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=SJ(e.snapshot.segmentTable,r.nameId),c=SJ(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function YY(e,t){let n=Q(e,t),r=NY(e,t),i=Yq(n),a=i?r.slice(0,-1):r;return{basename:SJ(e.snapshot.segmentTable,n.nameId),depth:qq(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function XY(e,t,n){let r=Q(e,t),i=LY(e,n);if(i!=null){let t=Q(e,i);if(Yq(t))return{basename:SJ(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=yJ(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=yJ(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:RY(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function ZY(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${NY(e,t)}"`);let i=Q(e,t);if(Jq(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(Yq(i)&&zY(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return QY(e,t),KY(e,a,t,o),$Y(e,a),PY(e,a),`handled`}function QY(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=Q(e,t.nodeId);if(t.visitedChildren||!Yq(i)){Yq(i)&&e.snapshot.directories.delete(t.nodeId),Qq(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),$J(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=zY(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 $Y(e,t){let n=t;for(;n!=null;){let t=Q(e,n);if(!Yq(t)||Zq(t,2)||zY(e,n).childIds.length>0)return;Qq(t,1),n=t.parentId===n?null:t.parentId}}function eX(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=Mq(e.snapshot.nodes,zY(e,n)).get(t);if(i==null||!Yq(Q(e,i)))break;n=i}return n}function tX(e,t){let n=iX(e,t);if(n==null)return null;let r=TY(e,n),i=Q(e,r),a=n===r?null:EY(e,n).map(t=>NY(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:zY(e,r).childIds.length>0,path:NY(e,r),terminalKind:Jq(i)})}function nX(e,t){return rX([e],[t])}function rX(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 iX(e,t){let n=t;for(;n!=null;){let t=Q(e,n);if(!Yq(t)||Zq(t,2))return null;if(!WJ(e,n,t))return n;n=t.parentId}return null}function aX(e,t){let n=Q(e,t);if($q(n,(t===e.snapshot.rootId?-1:qq(Q(e,n.parentId)))+1),!Yq(n))return;let r=zY(e,t);for(let t of r.childIds)aX(e,t)}function oX(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=Q(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function sX(e,t,n=Q(e,t),r=!1){let i=e.instrumentation;if(i==null){lX(e,t,n,r);return}Z(i,`store.recomputeNodeCounts`,()=>lX(e,t,n,r))}function cX(e,t){let n=t;for(;n!=null;){let t=Q(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(sX(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&Lq(zY(e,s),n,a,o),n=s}}function lX(e,t,n,r){if(!Yq(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=zY(e,t);if(r){let t=e.instrumentation;t==null?Iq(e.snapshot.nodes,i):Z(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>Iq(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,Zq(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=wY(e,t)==null?WJ(e,t,n)?1+o:1:o}function uX(e,t,n){let r=NY(e,t);return r.length===0?n:`${r}${n}`}function dX(e){return e!=null&&!Zq(e,4)}function fX(e,t){let n=e.snapshot.nodes[t];return!dX(n)||!Yq(n)||Zq(n,2)?null:n}function pX(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&dX(e.snapshot.nodes[n])&&(t+=1);return t}function mX(e){return Math.max(0,e.valueById.length-1)}function hX(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:pX(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:mX(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function gX(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 _X(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)fX(e,n)!=null&&t.push(NY(e,n));for(let t of e.expandedDirectoryIds)fX(e,t)!=null&&n.push(NY(e,t));return{collapsedPaths:t,expandedPaths:n}}function vX(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)fX(e,n)!=null&&qJ(e,n)!==`loaded`&&t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:NY(e,n)});return t}function yX(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=LY(e,n);t!=null&&GJ(e,t,!0,Q(e,t))}for(let n of t.collapsedPaths){let t=LY(e,n);t!=null&&GJ(e,t,!1,Q(e,t))}}function bX(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=LY(e,n.path);t!=null&&fX(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function xX(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function SX(e){let t=e.snapshot.segmentTable,n=bJ();for(let r of e.snapshot.nodes)if(dX(r)){if(Zq(r,2)){r.nameId=0;continue}r.nameId=xJ(n,SJ(t,r.nameId))}e.snapshot.segmentTable=n}function CX(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!dX(r)||!Yq(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return dX(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[Q(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),Iq(e.snapshot.nodes,n)}}function wX(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(dX(n))break;--t}e.snapshot.nodes.length=t+1}function TX(e){let t=_X(e),n=vX(e);Z(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>xX(e)),Z(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>SX(e)),Z(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>CX(e)),Z(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>wX(e)),Z(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>yX(e,t)),Z(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>bX(e,n)),Z(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>FY(e,e.snapshot.rootId))}function EX(e){let t=_X(e),n=vX(e),r=Z(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>DY(e)),i=tJ({...e.snapshot.options},e.instrumentation),a=Z(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new zJ(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,Z(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>yX(e,t)),Z(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>bX(e,n)),Z(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>FY(e,e.snapshot.rootId))}function DX(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function OX(e,t){let n=hX(e);t===`stable`?Z(e.instrumentation,`store.cleanup.stable`,()=>TX(e)):Z(e.instrumentation,`store.cleanup.aggressive`,()=>EX(e));let r=hX(e);return gX(t,t===`stable`,n,r)}var kX=64;function AX(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 jX(e){return Q(e,e.snapshot.rootId).visibleSubtreeCount}function MX(e,t,n,r){let i=Q(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function NX(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:QX(e,t.cursor),setSize:t.setSize,subtreeEndIndex:MX(e,t.cursor,t.index,n)}}function PX(e,t,n,r,i,a){let o=zY(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=Rq(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return FX(e,u,l,r+c,i+1,s,o.childIds.length,a)}function FX(e,t,n,r,i,a,o,s){if(!Yq(Q(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=KX(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=Q(e,c.terminalNodeId);if(!Yq(l)||!WJ(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return PX(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function IX(e,t){let n=jX(e);if(t<0||t>=n)return null;let r=PX(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>NY(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=NX(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:QX(e,r.cursor),setSize:r.setSize,subtreeEndIndex:MX(e,r.cursor,r.index,n)}}function LX(e,t,n){let r=e.instrumentation,i=jX(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 ZX(e,o+1);let t=[],n=UX(e,a);for(let r=a;r<=o&&n!=null;r++){let r=QX(e,n);t.push(r),n=JX(e,n)}return t}let s=[],c=0,l=0,u=Z(r,`store.getVisibleSlice.selectFirstRow`,()=>UX(e,a));for(let t=a;t<=o&&u!=null;t++){let t=Z(r,`store.getVisibleSlice.materializeRow`,()=>QX(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=Z(r,`store.getVisibleSlice.advanceCursor`,()=>JX(e,u))}return rJ(r,`workload.visibleRowsRead`,s.length),rJ(r,`workload.flattenedRowsRead`,c),rJ(r,`workload.flattenedSegmentsRead`,l),s}function RX(e,t=jX(e)){let n=e.instrumentation;return n==null?XX(e,t):Z(n,`store.getVisibleTreeProjection`,()=>XX(e,t))}function zX(e){return YX(RX(e))}function BX(e,t){let n=LY(e,t);if(n==null||n===e.snapshot.rootId||Yq(Q(e,n))&&TY(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=Q(e,i).parentId,n=zY(e,t),s=Nq(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=zq(a,n,s),t!==o){let n=Q(e,t),a=wY(e,t);if(!WJ(e,t,n)&&a!==i)return null;TY(e,t)===t&&(r+=1)}i=t}return r}function VX(e,t){let n=LY(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=Q(e,n);if(!Yq(r))throw Error(`Path is not a directory: "${t}"`);return WJ(e,n,r)?null:(GJ(e,n,!0,r),PY(e,n),iY({affectedAncestorIds:IY(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function HX(e,t){let n=LY(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=Q(e,n);if(!Yq(r))throw Error(`Path is not a directory: "${t}"`);return WJ(e,n,r)?(GJ(e,n,!1,r),PY(e,n),aY({affectedAncestorIds:IY(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function UX(e,t){return t<0||t>=jX(e)?null:WX(e,e.snapshot.rootId,t,-1)}function WX(e,t,n,r){let i=zY(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?Rq(e.snapshot.nodes,i,n):Z(a,`store.getVisibleSlice.selectChildIndex`,()=>Rq(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return GX(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function GX(e,t,n,r){if(!Yq(Q(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=KX(e,t,r);if(n===0)return i;let a=Q(e,i.terminalNodeId);if(!Yq(a)||!WJ(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return WX(e,i.terminalNodeId,n-1,i.visibleDepth)}function KX(e,t,n){return Yq(Q(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:TY(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:Z(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>TY(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function qX(e,t){let n=Q(e,t);if(!Yq(n))return!0;let r=n.parentId;return r===e.snapshot.rootId||wY(e,r)!==t}function JX(e,t){let n=Q(e,t.terminalNodeId);if(Yq(n)){let r=zY(e,t.terminalNodeId);if(WJ(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:GX(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=Q(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=zY(e,n),o=Nq(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 GX(e,s,0,i);qX(e,r)&&i--,r=n}}function YX(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 XX(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(kX);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=AX(o,y);let x,S=_;if(Yq(v))S=f?TY(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:NY(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&&Yq(C)&&WJ(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 ZX(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(!Yq(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:NY(e,f)};continue}let h=l?TY(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=QX(e,g);let _=i[h];_!=null&&Yq(_)&&WJ(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function QX(e,t){let n=Q(e,t.terminalNodeId),r=Yq(n)?$X(e,t):null,i=NY(e,t.terminalNodeId),a=SJ(e.snapshot.segmentTable,n.nameId),o=Yq(n)&&zY(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?EY(e,t.headNodeId).map(n=>{let r=Q(e,n);return{isTerminal:n===t.terminalNodeId,name:SJ(e.snapshot.segmentTable,r.nameId),nodeId:n,path:NY(e,n)}}):Z(c,`store.getVisibleSlice.flatten.collectSegments`,()=>EY(e,t.headNodeId).map(n=>{let r=Q(e,n);return{isTerminal:n===t.terminalNodeId,name:SJ(e.snapshot.segmentTable,r.nameId),nodeId:n,path:NY(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:Yq(n)&&WJ(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:Yq(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function $X(e,t){if(t.headNodeId===t.terminalNodeId)return qJ(e,t.terminalNodeId);let n=EY(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=qJ(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}var eZ=8;function tZ(e){let{nodes:t,directories:n,rootId:r,options:i}=e,a=t.length,o=new Int32Array(a),s=new Int32Array(a),c=new Int32Array(a),l=new Int32Array(a),u=new Int32Array(a),d=new Int32Array(a),f=new Int32Array(a);for(let e=0;e<a;e+=1){let n=t[e];n!=null&&(o[e]=n.parentId,s[e]=n.nameId,c[e]=n.depthAndFlags,l[e]=n.subtreeNodeCount,u[e]=n.visibleSubtreeCount)}let p=0;for(let e of n.values())p+=e.childIds.length;let m=new Int32Array(p),h=0;for(let[e,t]of n){let n=t.childIds;d[e]=h,f[e]=n.length;for(let e=0;e<n.length;e+=1)m[h]=n[e],h+=1}return{nodeCount:a,rootId:r,flattenEmptyDirectories:i.flattenEmptyDirectories===!0,parentId:o,nameId:s,depthAndFlags:c,subtreeNodeCount:l,visibleSubtreeCount:u,childStart:d,childCount:f,childIdsFlat:m}}function nZ(e){let{nodeCount:t,rootId:n,flattenEmptyDirectories:r,depthAndFlags:i,subtreeNodeCount:a,visibleSubtreeCount:o,childStart:s,childCount:c,childIdsFlat:l}=e;for(let e=t-1;e>=1;--e){if((i[e]&eZ)===0)continue;let t=s[e],n=c[e],u=0,d=0;for(let e=0;e<n;e+=1){let n=l[t+e];u+=a[n],d+=o[n]}a[e]=1+u;let f;f=r&&n===1?(i[l[t]]&eZ)===0?1+d:d:1+d,o[e]=f}let u=s[n],d=c[n],f=0,p=0;for(let e=0;e<d;e+=1){let t=l[u+e];f+=a[t],p+=o[t]}a[n]=1+f,o[n]=p}function rZ(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||!Yq(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&&Bq(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&Yq(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,Bq(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function iZ(e){let{directories:t,nodes:n,rootId:r}=e.snapshot,i=tZ(e.snapshot);nZ(i);let a=i.subtreeNodeCount,o=i.visibleSubtreeCount;for(let e=0;e<n.length;e+=1){let t=n[e];t!=null&&(t.subtreeNodeCount=a[e],t.visibleSubtreeCount=o[e])}for(let[e,i]of t){let t=i.childIds,a=t.length,o=0,s=0;for(let e=0;e<a;e++){let r=t[e];if(r==null)continue;let i=n[r];o+=i.subtreeNodeCount,s+=i.visibleSubtreeCount}i.totalChildSubtreeNodeCount=o,i.totalChildVisibleSubtreeCount=s,(e===r||a>=128)&&Bq(n,i)}}function aZ(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var oZ=class e{#e;constructor(e={}){let t=nJ(e),n=Z(t,`store.builder.create`,()=>new zJ(e));if(e.preparedInput!=null){let t=IJ(e.preparedInput);t==null?n.appendPreparedPaths(FJ(e.preparedInput),!1):n.appendPresortedPaths(t,LJ(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(Z(t,`store.preparePathEntries`,()=>RJ(r,e)))}let r=Z(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=Z(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=Z(t,`store.state.create`,()=>BJ(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:Z(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||aZ(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&Z(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?e.useSoaCountSweep===!0?Z(t,`store.state.initializeOpenVisibleCountsViaSoa`,()=>iZ(this.#e)):Z(t,`store.state.initializeOpenVisibleCounts`,()=>rZ(this.#e)):Z(t,`store.state.recomputeCounts`,()=>FY(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return MJ(e,t)}static prepareInput(e,t={}){return NJ(e,t)}static preparePresortedInput(e){return PJ(e)}list(e){return Z(this.#e.instrumentation,`store.list`,()=>DY(this.#e,e))}add(e){Z(this.#e.instrumentation,`store.add`,()=>{let t=jX(this.#e);mY(this.#e,fY(this.#e,t,OY(this.#e,e)))})}remove(e,t={}){Z(this.#e.instrumentation,`store.remove`,()=>{let n=jX(this.#e);mY(this.#e,fY(this.#e,n,kY(this.#e,e,t)))})}move(e,t,n={}){Z(this.#e.instrumentation,`store.move`,()=>{let r=jX(this.#e),i=AY(this.#e,e,t,n);i!=null&&mY(this.#e,fY(this.#e,r,i))})}batch(e){pY(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})}})}getVisibleCount(){return Z(this.#e.instrumentation,`store.getVisibleCount`,()=>jX(this.#e))}getVisibleSlice(e,t){return Z(this.#e.instrumentation,`store.getVisibleSlice`,()=>LX(this.#e,e,t))}getVisibleRowContext(e){return Z(this.#e.instrumentation,`store.getVisibleRowContext`,()=>IX(this.#e,e))}getVisibleTreeProjection(){return zX(this.#e)}getVisibleTreeProjectionData(e){return RX(this.#e,e)}getVisibleIndex(e){return Z(this.#e.instrumentation,`store.getVisibleIndex`,()=>BX(this.#e,e))}getPathInfo(e){return Z(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=LY(this.#e,e);if(t==null)return null;let n=Q(this.#e,t);return{depth:qq(n),kind:Yq(n)?`directory`:`file`,path:NY(this.#e,t)}})}isExpanded(e){return Z(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=Q(this.#e,t);return WJ(this.#e,t,n)})}expand(e){Z(this.#e.instrumentation,`store.expand`,()=>{let t=jX(this.#e),n=VX(this.#e,e);n!=null&&mY(this.#e,fY(this.#e,t,n))})}collapse(e){Z(this.#e.instrumentation,`store.collapse`,()=>{let t=jX(this.#e),n=HX(this.#e,e);n!=null&&mY(this.#e,fY(this.#e,t,n))})}on(e,t){return eY(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return qJ(this.#e,t)}markDirectoryUnloaded(e){Z(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(zY(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=jX(this.#e);YJ(this.#e,t),mY(this.#e,fY(this.#e,n,oY({affectedAncestorIds:IY(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return Z(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=jX(this.#e),r=JJ(this.#e,t);return mY(this.#e,fY(this.#e,n,sY({affectedAncestorIds:IY(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return Z(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||qJ(this.#e,n)!==`loading`||!ZJ(this.#e,n,e.attemptId))return!1;let r=NY(this.#e,n);this.validateChildPatch(r,t);let i=jX(this.#e),a=[];for(let e of t.operations){sZ(r,e);let t=jX(this.#e);switch(e.type){case`add`:a.push(fY(this.#e,t,OY(this.#e,e.path)));break;case`remove`:a.push(fY(this.#e,t,kY(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=AY(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(fY(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return mY(this.#e,fY(this.#e,i,cY({affectedAncestorIds:IY(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:NY(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return Z(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=jX(this.#e),r=XJ(this.#e,t,e.attemptId);return mY(this.#e,fY(this.#e,n,lY({affectedAncestorIds:IY(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:NY(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return Z(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=jX(this.#e),i=QJ(this.#e,n,e.attemptId,t);return mY(this.#e,fY(this.#e,r,uY({affectedAncestorIds:IY(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:NY(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return Z(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(DX(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=jX(this.#e),n=OX(this.#e,e.mode??`stable`);return mY(this.#e,fY(this.#e,t,dY({...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=zY(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??oJ(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=cJ(hJ(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(!Yq(Q(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=Q(this.#e,n);WJ(this.#e,n,i)||(GJ(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=Q(this.#e,e);if(!WJ(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=LY(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!Yq(Q(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!Yq(Q(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=Q(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=Q(this.#e,e),r=wY(this.#e,e);if(!WJ(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 sZ(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}"`)}}var cZ=e=>e.startsWith(`f::`)?e.slice(3):e;function lZ(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function uZ(e,t){return e===``?t:`${e}/${t}`}function dZ({files:e,path:t,isFolder:n,nextBasename:r}){let i=cZ(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}=lZ(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=uZ(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 fZ(e){return e.endsWith(`/`)}function pZ(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 mZ(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 hZ(e,t){return t.includes(e)?mZ(t):[e]}function gZ(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 _Z(e,t){return{draggedPaths:e,target:t}}function vZ(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(fZ(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function yZ(e,t){return t.kind===`root`||t.directoryPath==null?pZ(e):t.directoryPath}function bZ(e,t){let n=e.map(e=>{let n=yZ(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 xZ(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 SZ(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(!xZ(oZ.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 CZ(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function wZ(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 TZ(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function EZ(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 TZ(e,t.path)?n?e:null:e;case`move`:return wZ(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=EZ(r,e,n),r==null)return null;return r}}}function DZ(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function OZ(e){switch(e.operation){case`add`:return{...DZ(e),operation:`add`,path:e.path};case`remove`:return{...DZ(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...DZ(e),from:e.from,operation:`move`,to:e.to}}}function kZ(e){return{...DZ(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>OZ(e)),operation:`batch`}}function AZ(e){switch(e.operation){case`add`:case`remove`:case`move`:return OZ(e);case`batch`:return kZ(e);default:return null}}function jZ(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function MZ(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 NZ(e){return MZ(e).at(-1)??null}function PZ(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function FZ(e){return e.endsWith(`/`)}var IZ=e=>e.toLowerCase();function LZ(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function RZ(e){return e.endsWith(`/`)?e.slice(0,-1):e}function zZ(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var BZ=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},VZ=Symbol(`FILE_TREE_RENAME_VIEW`),HZ=512,UZ=512;function WZ(e){return e===`top`||e===`center`?e:`nearest`}function GZ(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=MZ(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 KZ(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:GZ(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var qZ=class e{static{Object.defineProperty(e.prototype,VZ,{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=SZ({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=NZ(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:WZ(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<=UZ){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=hZ(t,n);return this.#r.canDrag?.(r)!==!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=_Z(t.draggedPaths,n);(vZ(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}gZ(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=_Z(e.draggedPaths,t);if(vZ(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=bZ(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=FZ(r),a=RZ(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of MZ(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=LZ(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,FZ(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,FZ(e)?{recursive:!0}:void 0);return}let t=FZ(e),n=dZ({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:RZ(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(zZ(n.sourcePath,t),zZ(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=SZ({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=!jZ(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=NZ(e),n=PZ(e,t),r=null,i=null;for(let e of this.#be()){if(NZ(e)!==t)continue;let a=PZ(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=MZ(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=!jZ(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 oZ({...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 MZ(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(IZ),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(IZ),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 MZ(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:BZ(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 MZ(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 MZ(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=KZ(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,HZ)),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=EZ(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=EZ(this.#c,e,!0),r=[...this.#B].map(t=>EZ(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=EZ(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return jZ(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&&CZ(e)&&(this.#i=null);let t=CZ(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=AZ(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},JZ=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 YZ(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 XZ(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 ZZ(e,t){return t?`${e}/`:e}function QZ(e,t=null){let n=JZ(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=eQ(t);e!=null&&rQ({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 $Z(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=tQ(e);t!=null&&(c=nQ({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,statusByPath:i})||c)}for(let e of r){let t=eQ(e);t!=null&&(c=rQ({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:oQ(i),statusByPath:i}:e}function eQ(e){return tQ(e.path)}function tQ(e){let t=YZ(e);if(t!=null)return{canonicalPath:ZZ(t.path,t.isDirectory),isDirectory:t.isDirectory}}function nQ({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,statusByPath:i}){let a=i.get(e);return a!=null&&(i.delete(e),a===`ignored`&&e.endsWith(`/`)&&r.delete(e),aQ(t,n,e),!0)}function rQ({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,isDirectory:i,status:a,statusByPath:o}){let s=o.get(e);return s!==a&&(s??iQ(t,n,e),o.set(e,a),a===`ignored`&&i?r.add(e):i&&r.delete(e),!0)}function iQ(e,t,n){for(let r of XZ(n))e.set(r,(e.get(r)??0)+1),t.add(r)}function aQ(e,t,n){for(let r of XZ(n)){let n=(e.get(r)??0)-1;n>0?e.set(r,n):(e.delete(r),t.delete(r))}}function oQ(e){let t=`${e.size}`;for(let[n,r]of e)t+=`\0${n}\0${r}`;return t}var sQ=e=>e.trim().toLowerCase(),cQ=e=>e.split(`/`).at(-1)??e,lQ=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 uQ(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function dQ(e){let t=fq(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(sQ(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=cQ(o),c=s.toLowerCase(),l=r.get(c);if(l!=null)return uQ(l,e);for(let[t,n]of a)if(c.includes(t))return uQ(n,e);let u=lQ(s);for(let t of u){let n=i.get(t);if(n!=null)return uQ(n,e)}let d=uq(t.set,s,u);if(d!=null&&t.set!==`none`){if(d==="default"){let t=n?.[e];if(t!=null)return uQ(t,e)}return{name:cq(d),remappedFrom:e,token:d}}}let s=n?.[e];return s==null?{name:e}:uQ(s,e)}}}var fQ,pQ,mQ,hQ,gQ,_Q,vQ,yQ,bQ,xQ,SQ={},CQ=[],wQ=Array.isArray,TQ=CQ.slice,EQ=Object.assign;function DQ(e){e&&e.parentNode&&e.remove()}function OQ(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?TQ.call(arguments,2):n),kQ(e,o,r,i,null)}function kQ(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??++pQ,__i:-1,__u:0};return i==null&&fQ.vnode!=null&&fQ.vnode(a),a}function AQ(e){return e.children}function jQ(e,t){this.props=e,this.context=t,this.__g=0}function MQ(e,t){if(t==null)return e.__?MQ(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`?MQ(e):null}function NQ(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 NQ(e)}}function PQ(e){(8&e.__g||!(e.__g|=8)||!mQ.push(e)||gQ++)&&hQ==fQ.debounceRendering||((hQ=fQ.debounceRendering)||queueMicrotask)(FQ)}function FQ(){for(var e,t,n,r,i,a,o,s,c=1;mQ.length;)mQ.length>c&&mQ.sort(_Q),e=mQ.shift(),c=mQ.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=EQ({},r)).__v=r.__v+1,fQ.vnode&&fQ.vnode(n),UQ(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??MQ(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,GQ(a,n,o),n.__e!=i&&NQ(n)));gQ=0}function IQ(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||CQ,b=t.length;for(c=LQ(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?SQ:y[m.__i]||SQ,m.__i=f,_=UQ(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&JQ(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=RQ(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function LQ(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?kQ(null,o,null,null,null):wQ(o)?kQ(AQ,{children:o},null,null,null):o.constructor==null&&o.__b>0?kQ(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=zQ(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=MQ(s)),YQ(s,s));return r}function RQ(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=RQ(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=MQ(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function zQ(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);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 BQ(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function VQ(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||BQ(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||BQ(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(vQ,`$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=yQ,e.addEventListener(t,a?xQ:bQ,a)):e.removeEventListener(t,a?xQ:bQ,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 HQ(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=yQ++;else if(t.u<n.l)return;return n(fQ.event?fQ.event(t):t)}}}function UQ(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,O,k,A,j,M=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=fQ.__b)&&d(t);n:if(typeof M==`function`)try{if(v=t.props,y=`prototype`in M&&M.prototype.render,b=(d=M.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 M(v,x):(t.__c=f=new jQ(v,x),f.constructor=M,f.render=XQ),b&&b.sub(f),f.props=v,f.state||(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&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=EQ({},f.__s)),EQ(f.__s,M.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&M.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&M.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=fQ.__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=EQ({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===AQ&&d.key==null&&(E=KQ(d.props.children)),s=IQ(e,wQ(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,O=!1,t.__u|=c?160:128,t.__c.__z=[],k=0;k<a.length;k++)(A=a[k])==null||O||(A.nodeType==8&&A.data==`$s`?(D>0&&t.__c.__z.push(A),D++,a[k]=null):A.nodeType==8&&A.data==`/$s`?(--D>0&&t.__c.__z.push(A),O=D===0,s=a[k],a[k]=null):D>0&&(t.__c.__z.push(A),a[k]=null));if(!O){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(j=a.length;j--;)DQ(a[j]);WQ(t)}}else t.__e=n.__e,t.__k=n.__k,e.then||WQ(t);fQ.__e(e,t,n)}else s=t.__e=qQ(n.__e,t,n,r,i,a,o,c,l,u);return(d=fQ.diffed)&&d(t),128&t.__u?void 0:s}function WQ(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(WQ)}function GQ(e,t,n){for(var r=0;r<n.length;r++)JQ(n[r],n[++r],n[++r]);fQ.__c&&fQ.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){fQ.__e(e,t.__v)}})}function KQ(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:wQ(e)?e.map(KQ):EQ({},e)}function qQ(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&&=(fQ.__m&&fQ.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=TQ.call(e.childNodes),v=n.props||SQ,!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;VQ(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&&!_||VQ(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=``),IQ(b==`template`?e.content:e,wQ(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&MQ(n,0),s,c,l),a!=null)for(u=a.length;u--;)DQ(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||VQ(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&VQ(e,u,g,v[u],i))}return e}function JQ(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){fQ.__e(e,n)}}function YQ(e,t,n){var r,i;if(fQ.unmount&&fQ.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||JQ(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){fQ.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&YQ(r[i],t,n||typeof e.type!=`function`);n||DQ(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function XQ(e,t,n){return this.constructor(e,n)}function ZQ(e,t){var n,r,i,a;t==document&&(t=document.documentElement),fQ.__&&fQ.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=OQ(AQ,null,[e]),i=[],a=[],UQ(t,e,r||SQ,SQ,t.namespaceURI,r?null:t.firstChild?TQ.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),GQ(i,e,a)}function QQ(e,t){e.__u|=32,ZQ(e,t)}fQ={__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 gQ=0,e}},pQ=0,jQ.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=EQ({},this.state);typeof e==`function`&&(e=e(EQ({},n),this.props)),e&&EQ(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),PQ(this))},jQ.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),PQ(this))},jQ.prototype.render=AQ,mQ=[],gQ=0,_Q=function(e,t){return e.__v.__b-t.__v.__b},vQ=/(PointerCapture)$|Capture$/i,yQ=0,bQ=HQ(!1),xQ=HQ(!0);var $Q=0;Array.isArray;function $(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:--$Q,__i:-1,__u:0,__source:i,__self:a};return fQ.vnode&&fQ.vnode(l),l}var e$=16,t$=16,n$={};function r$({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}=n$[e]??{width:e$,height:t$},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return $(`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:$(`use`,{href:c})})}var i$=e=>e!==void 0&&/\s/.test(e),a$=(e,t)=>{let n=t=>i$(e[t-1])||i$(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},o$=e=>a$(e,Math.ceil(e.length/2)),s$=e=>{if(e.length<2)return[e,``];let t=o$(e);return[e.slice(0,t),e.slice(t)]},c$=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:o$(e);return[e.slice(0,r),e.slice(r)]},l$=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)]},u$=(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)]},d$=(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)]},f$=(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 p$({children:e,marker:t,variant:n=`default`}){"use no memo";return $(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:$(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?$(`span`,{"data-truncate-fade":!0}):t})})}function m$(e){"use no memo";let{mode:t,children:n}=e;return $(`div`,{children:[$(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?$(`span`,{children:n}):n}),$(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?$(`span`,{children:n}):n})]})}function h$({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=$(m$,{mode:t,children:e},`content`),o=$(p$,{marker:n,mode:t,variant:r},`marker`),s=$(`div`,{"data-truncate-fill":!0},`fill`);return $(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:$(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function g$({children:e,...t}){"use no memo";return $(h$,{mode:`truncate`,...t,children:e})}function _$({children:e,...t}){"use no memo";return $(h$,{mode:`fruncate`,...t,children:e})}function v$({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$,{...s,children:t[0]}),l=$(_$,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return $(`div`,{className:a,style:o});if(e.length<i)return $(n===`end`?_$:g$,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=s$:r===`extension`?t=c$:r===`leaf-path`&&(t=l$);else if(typeof r==`number`)t=u$,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=d$:e===`first`&&(t=f$)}else typeof r==`function`&&(t=r);t??=s$;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$,{...s,..._,children:f}),l=$(_$,{...s,...v,children:p})}return $(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[$(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),$(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var y$={endIndex:-1,startIndex:-1};function b$(e,t,n){return Math.min(Math.max(e,t),n)}function x$(e,t){return e<0||t<e?y$:{endIndex:t,startIndex:e}}function S$(e){return e.startIndex<0||e.endIndex<e.startIndex}function C$(e,t){return S$(e)?0:(e.endIndex-e.startIndex+1)*t}function w$(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function T$(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function E$(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 D$(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 O$(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 k$(e,t,n){if(e.length===0||t<=0)return[];let r=O$(e),i=E$(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=D$(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 A$(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=b$(t.scrollTop,0,o),c=t.stickyRows??k$(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=w$(s,n,t.itemHeight),m=w$(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?y$:x$(m,T$(u+d,n,t.itemHeight)),y=g+1,b=S$(v)?y$:x$(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=C$(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:S$(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var j$={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},M$={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},N$=`Contains git status items`;function P$(e){return e.current?!0:(e.current=!0,!1)}function F$(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 I$(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return F$({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 L$(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 R$(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 z$(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 B$(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function V$(e,t){return e!=null&&e>0?e:t}function H$(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 U$(e,t,n,r,i=0){let a=F$({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a!=null&&(e.scrollTop=a,!0)}function W$(e,t,n,r,i,a,o=0){let s=I$({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s!=null&&(e.scrollTop=s,!0)}function G$(e,t,n,r,i,a){let o=L$({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o!=null&&(e.scrollTop=o,!0)}function K$(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function q$(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function J$({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return $(`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 Y$(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 X$(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 Z$,Q$,$$,e1,t1=Object.is,n1=0,r1=[],i1=fQ,a1=i1.__b,o1=i1.__r,s1=i1.diffed,c1=i1.__c,l1=i1.unmount,u1=i1.__;function d1(e,t){i1.__h&&i1.__h(Q$,e,n1||t),n1=0;var n=Q$.__H||(Q$.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function f1(e){return n1=1,p1(T1,e)}function p1(e,t,n){var r=d1(Z$++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):T1(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t1(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Q$,!Q$.__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,t1(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};Q$.__f=!0;var a=Q$.shouldComponentUpdate,o=Q$.componentWillUpdate;Q$.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)},Q$.shouldComponentUpdate=i}return r.__N||r.__}function m1(e,t){var n=d1(Z$++,3);!i1.__s&&w1(n.__H,t)&&(n.__=e,n.u=t,Q$.__H.__h.push(n))}function h1(e,t){var n=d1(Z$++,4);!i1.__s&&w1(n.__H,t)&&(n.__=e,n.u=t,Q$.__h.push(n))}function g1(e){return n1=5,_1(function(){return{current:e}},[])}function _1(e,t){var n=d1(Z$++,7);return w1(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function v1(e,t){return n1=8,_1(function(){return e},t)}function y1(){for(var e;e=r1.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(S1),e.__H.__h.forEach(C1),e.__H.__h=[]}catch(t){e.__H.__h=[],i1.__e(t,e.__v)}}i1.__b=function(e){Q$=null,a1&&a1(e)},i1.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),u1&&u1(e,t)},i1.__r=function(e){o1&&o1(e),Z$=0;var t=(Q$=e.__c).__H;t&&($$===Q$?(t.__h=[],Q$.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(S1),t.__h.forEach(C1),t.__h=[],Z$=0)),$$=Q$},i1.diffed=function(e){s1&&s1(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(r1.push(t)!==1&&e1===i1.requestAnimationFrame||((e1=i1.requestAnimationFrame)||x1)(y1)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),$$=Q$=null},i1.__c=function(e,t){t.some(function(e){try{e.__h.forEach(S1),e.__h=e.__h.filter(function(e){return!e.__||C1(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],i1.__e(n,e.__v)}}),c1&&c1(e,t)},i1.unmount=function(e){l1&&l1(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{S1(e)}catch(e){t=e}}),n.__H=void 0,t&&i1.__e(t,n.__v))};var b1=typeof requestAnimationFrame==`function`;function x1(e){var t,n=function(){clearTimeout(r),b1&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);b1&&(t=requestAnimationFrame(n))}function S1(e){var t=Q$,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),Q$=t}function C1(e){var t=Q$;e.__c=e.__(),Q$=t}function w1(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!t1(t,e[n])})}function T1(e,t){return typeof t==`function`?t(e):t}function E1(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:$(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return $(AQ,{children:[$(`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$,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function D1(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function O1(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function k1(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 A1({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=A$(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:k1(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?k1(u,1,t,o):i&&r<=0&&c.length>0?k$(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 j1=400,M1=40,N1=18;function P1(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))?F1(e,t,n):a instanceof HTMLElement?a:null}function F1(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 I1(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 L1(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 R1(){return navigator.vendor!==`Apple Computer, Inc.`}function z1(e,t){let n=e-t.top;if(n<M1)return-Math.ceil((M1-Math.max(0,n))/M1*N1);let r=t.bottom-e;return r<M1?Math.ceil((M1-Math.max(0,r))/M1*N1):0}function B1(e,t){if(e!=null){let t=j$[e];return t==null?null:{text:t,title:M$[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:N$}:null}function V1(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 H1(e){return e!=null&&`toggle`in e}function U1(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function W1(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function G1(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function K1(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function q1(e,t){return t&&K1(e)||(e.ctrlKey||e.metaKey)&&U1(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var J1=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function Y1(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 X1(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 Z1(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function Q1(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function $1(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function e0(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 t0(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 n0(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 r0(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=n0(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 i0(e,t){return{kind:e.kind,name:O1(e),path:t}}function a0(e){return e==null?void 0:`${e}__tree`}function o0(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function s0(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function c0(e,t){if(e==null)return null;if(`text`in e)return e.parts==null?$(`span`,{title:e.title,children:e.text}):$(`span`,{title:e.title,children:e.parts.map((e,t)=>$(`span`,{style:{color:e.color},children:e.text},t))});let n=typeof e.icon==`string`?s0(e.icon)?t(e.icon):{name:e.icon}:s0(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return $(`span`,{title:e.title,children:$(r$,{...n})})}function l0(e){e!=null&&R$(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function u0(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=D1(e);return $(AQ,{children:[e.depth>0?$(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>$(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,$(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?$(r$,{...t(`file-tree-icon-chevron`)}):$(r$,{...t(`file-tree-icon-file`,u)})}),$(`div`,{"data-item-section":`content`,children:e.isFlattened?E1(e,c,a):c??$(v$,{minimumLength:5,split:`extension`,children:e.name})}),i?$(`div`,{"data-item-section":`decoration`,children:r==null?null:c0(r,t)}):null,s?$(`div`,{"data-item-section":`git`,children:c0(o,t)}):null,n?$(`div`,{"data-item-section":`action`,children:l?$(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:$(r$,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function d0(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:O,resolveIcon:k,renderDecorationForRow:A,openContextMenuForRow:j,onRowClick:M,onKeyDown:N}=e,P=D1(t),{isParked:F=!1,mode:I=`flow`,style:L}=r,ee=I===`sticky`,te=_?.get(P)??null??V1(t.ancestorPaths,v,y),ne=t.kind===`directory`&&(b?.has(P)??!1),R=A(t,P),z=B1(te,ne),B=S&&w,re=R!=null||x||B,ie=B&&T===`always`,ae=a.getPath()===P,oe=ae?a.getValue():``,se=ee||!ae?null:$(J$,{ref:D,ariaLabel:`Rename ${O1(t)}`,isFlattened:t.isFlattened,value:oe,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),ce=u0(t,k,{actionLaneEnabled:B,customDecoration:R,decorationLaneEnabled:re,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:z,gitLaneActive:x,renameInput:se,showDecorativeActionAffordance:ie}),le={...Y$({ariaLabel:O1(t),domId:t.isFocused?o0(h,P,F):void 0,extraStyle:L,features:{actionLaneEnabled:B,contextMenuButtonVisibility:B?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:F,itemHeight:g,mode:I,row:t,state:{containsGitChange:ne,effectiveGitStatus:te,isContextHovered:s===P,isDragTarget:l?.kind===`directory`&&l.directoryPath===P,isDragging:c?.has(P)===!0,isFocusRinged:t.isFocused&&o===P},targetPath:P}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),E&&(i.focusMountedPathFromInput(P),j(t,P,{anchorRect:Z1(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:ee?void 0:()=>{i.focusMountedPathFromInput(P)},onKeyDown:ee?void 0:N,ref:e=>{O(P,e)}};return!ee&&ae?$(`div`,{...le,children:ce}):$(`button`,{...le,type:`button`,draggable:u&&!F,onDragEnd:u&&!F?p:void 0,onDragStart:u&&!F?e=>{f(e,t,P)}:void 0,onMouseDown:e=>{if(ee){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!F?e=>{m(e,t,P)}:void 0,onClick:e=>{M(e,t,P,I)},children:ce})}function f0(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(D1(e))).map((n,r)=>d0(e,n,t.start+r))}function p0({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=hq,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 _=g1(null),v=g1(null),y=g1(!1),b=g1(null),x=g1(null),S=g1(null),C=g1(null),w=g1(null),T=g1(new Map),E=g1(new Map),D=g1(()=>{}),O=g1(null),k=g1(0),A=g1(!1),j=g1(null);j.current!==t&&(A.current=!1,j.current=t);let M=g1(!1),N=g1(null),P=g1(null),F=g1(!1),I=g1(null),L=g1(null),ee=g1(null),te=g1(null),ne=g1(null),R=g1(null),z=g1(null),B=g1(null),re=g1(!1),ie=g1(null),ae=g1(null),oe=g1(null),se=g1(null),ce=_1(()=>new Map,[]),[,le]=f1(0),ue=g1(!1),[V,de]=f1(null),[fe,pe]=f1(null),[me,he]=f1(null),[ge,_e]=f1(null),[ve,ye]=f1(0),[be,xe]=f1(null),Se=g1(be);Se.current=be;let Ce=g1(null),we=g1(null),Te=g1(null),Ee=g1(null),De=g1(null),Oe=g1(!1),ke=()=>{we.current=null,Te.current=null,Ee.current=null},Ae=(e,t)=>{we.current=e,Te.current=null,Ee.current=t==null?null:{path:e,scrollTop:t}},je=(e,t)=>{we.current=null,Te.current={path:e,viewportOffset:t},Ee.current=null},Me=g1(d===`retain`&&t.isSearchOpen()),[Ne,Pe]=f1(p);m1(()=>{p||Pe(!1)},[p]);let Fe=g1(!1),Ie=v1(()=>{Fe.current=!0,Pe(e=>e&&!1)},[]),[Le,Re]=f1(()=>A1({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[ze,Be]=f1(!1);m1(()=>{Be(!0)},[]);let Ve=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,He=e?.contextMenu?.triggerMode??(Ve?`right-click`:`both`),Ue=He===`both`||He===`button`,We=e?.contextMenu?.buttonVisibility??`when-needed`,Ge=He===`both`||He===`right-click`;h1(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;De.current=t,pe(t),_e(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(Oe.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 Ke=v1((e,t)=>{$1(T.current,e,t)},[]),qe=v1((e,t)=>{$1(E.current,e,t)},[]),H=v1(e=>{x.current=e},[]),Je=v1(e=>e0(e,E.current,T.current),[]),Ye=n!=null||r!=null||i!=null,{resolveIcon:Xe}=_1(()=>dQ(a),[a]),Ze=t[VZ](),Qe=Ze.getPath(),$e=Qe!=null,et=t.isSearchOpen(),tt=t.getSearchValue(),nt=t.getFocusedPath(),rt=t.getFocusedIndex(),it=t.getScrollRequest(),at=t.isDragAndDropEnabled(),ot=t.getDragSession(),st=_1(()=>ot==null?null:new Set(ot.draggedPaths),[ot]),ct=ot?.target??null,lt=ot?.primaryPath??null,ut=a0(o),{overlayHeight:dt,overlayRows:ft,snapshot:pt,visibleRows:mt}=Le,ht=pt.physical.viewportHeight,gt=_1(()=>({end:pt.window.endIndex,start:pt.window.startIndex}),[pt.window.endIndex,pt.window.startIndex]),_t=ft,vt=pt.sticky.rows,yt=pt.physical.totalHeight,bt=pt.sticky.height,xt=_1(()=>new Set(vt.map(e=>D1(e.row))),[vt]),St=rt>=0&&rt>=gt.start&&rt<=gt.end,Ct=v1((e,t)=>u?.({item:i0(e,t),row:e})??null,[u]),wt=v1(e=>R$(e==null?null:T.current.get(e)??null)?!0:R$(S.current),[]),Tt=v1(e=>{wt(t.focusNearestPath(e))},[t,wt]),Et=g1(Tt);Et.current=Tt;let Dt=g1(!0),Ot=g1(()=>{}),kt=v1((t=!0)=>{let n=Se.current;n!=null&&(Dt.current=Dt.current&&t,xe(null),e?.contextMenu?.onClose?.(),Dt.current&&Tt(n.path))},[e?.contextMenu,Tt]);Ot.current=kt;let At=v1(e=>{let t=e==null?null:Q1(S.current,e);he(e=>e===t?e:t)},[]),jt=v1((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=Je(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Ae(n,e?.scrollTop??null),M.current=!0,de(e=>e===n?e:n)}i.focus(),At(a),Dt.current=!0,xe({anchorRect:r?.anchorRect??null,item:i0(e,n),path:n,source:r?.source??`keyboard`})},[t,Je,At]),Mt=v1(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=B$(e,ht);I.current=rt<0||e==null?null:Math.max(0,Math.min(rt*s-e.scrollTop,Math.max(0,t-s))),F.current=!0}t.startRenaming(e)!==!1&&(_e(`focus`),le(e=>e+1))}},[t,rt,s,l,ht]),Nt=v1((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=B$(i,ht),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:A1({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return M.current=!0,G$(i,a,s,l,u,d),D.current(),Ce.current=n?e:null,!0},[t,s,c,ht,h]),Pt=()=>y.current===!0||se.current!=null||re.current===!0,Ft=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),It=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Lt=()=>{te.current!=null&&(clearTimeout(te.current),te.current=null),ee.current=null},Rt=()=>{R.current?.remove(),R.current=null},zt=()=>{It(L.current),L.current=null,ne.current=null},Bt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},Vt=()=>{B.current?.(),B.current=null,se.current!=null&&(clearTimeout(se.current),se.current=null),re.current=!1,ie.current=null,oe.current=null,ae.current!=null&&(ae.current.setAttribute(`draggable`,`true`),ae.current.style.removeProperty(`touch-action`),ae.current=null),Rt(),Lt(),zt(),z.current=null},Ht=(e,n)=>{let r=S.current?.getRootNode(),i=I1(P1(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Ut=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Lt();return}let r=t.getItem(e.directoryPath),i=H1(r)?r:null;if(i==null||i.isExpanded()){Lt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;ee.current!==a&&(Lt(),ee.current=a,te.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind===`directory`&&n.directoryPath===e.directoryPath&&n.flattenedSegmentPath===e.flattenedSegmentPath&&i.expand()},n))},Wt=()=>{L.current=null;let e=ne.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=z1(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()),Ut(Ht(e.clientX,e.clientY)),L.current=Ft(Wt)},Gt=(e,t)=>{ne.current={clientX:e,clientY:t},L.current??=Ft(Wt)},Kt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(Vt(),Rt(),Lt(),zt(),t.startDrag(r)===!1){e.preventDefault();return}if(z.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),R1())){let t=L1(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Bt(t),R.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},qt=()=>{Rt(),Lt(),zt(),z.current=null,t.cancelDrag()},Jt=(e,n,r)=>{if(se.current!=null||re.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;oe.current={clientX:i.clientX,clientY:i.clientY},ae.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!re.current;se.current!=null&&(clearTimeout(se.current),se.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),B.current===o&&(B.current=null),t&&(a.setAttribute(`draggable`,`true`),ae.current===a&&(ae.current=null),oe.current=null)},s=e=>{let t=e.touches[0],n=oe.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=100||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),B.current=o,se.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),ae.current===a&&(ae.current=null),oe.current=null;return}re.current=!0,ae.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),z.current=n;let e=a.getBoundingClientRect(),s=L1(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`}),Bt(s),R.current=s,ie.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=ie.current;n!=null&&R.current!=null&&(R.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Ut(Ht(t.clientX,t.clientY)),Gt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Ht(n.clientX,n.clientY),t.completeDrag(),Vt()},u=()=>{t.cancelDrag(),Vt()};B.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)},j1)},Yt=e=>{if(be!=null){if(e.key===`Escape`){kt(),e.preventDefault(),e.stopPropagation();return}J1.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(Ze.isActive()){if(e.isComposing||e.keyCode===229)return;if(e.key===`Escape`)Ze.cancel();else if(e.key===`Enter`)Ze.commit();else return;_e(`focus`),le(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Mt(nt??void 0),e.preventDefault(),e.stopPropagation();return}if(et){if(e.key===`Escape`)F.current=!1,I.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=B$(n,ht);I.current=rt<0||n==null?null:Math.max(0,Math.min(rt*s-n.scrollTop,Math.max(0,r-s))),F.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;_e(`focus`),le(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&W1(e)){t.openSearch(e.key),le(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Ve&&K1(e),r=q1(e,Ve),i=r&&S.current!=null?z$(S.current):null,a=r?new Set(t0(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==nt&&a.has(o)){let e=C.current;Ae(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=H1(p)?p:null,h=u!=null&&(xt.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=e0(u,E.current,T.current);e==null||n==null?y=!1:jt(e,u)}else if((e.ctrlKey||e.metaKey)&&U1(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;_e(`focus`);let b=t.getFocusedPath(),x=b!=null&&(xt.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))Ae(b,v?.scrollTop??null),M.current=!0,de(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(je(b,r0(S.current,v,i,u,s,bt,ht)),M.current=!0,de(e=>e===b?e:b)):ke()}le(e=>e+1),e.preventDefault(),e.stopPropagation()};h1(()=>{if(!(!f||!et)){if(Me.current){Me.current=!1;return}R$(w.current)}},[et,f]),h1(()=>{let e=x.current;switch(q$({hasRenderedInput:e!=null,previousRenamingPath:P.current,renamingPath:Qe})){case`reset`:P.current=null;return;case`reveal-canonical`:Qe!=null&&Nt(Qe,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(Ce.current=null,P.current=Qe,R$(e),e.select());return}},[gt.end,gt.start,Qe,Nt,xt]),h1(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=z$(e)?.dataset.itemPath??null;de(e=>e===t?e:t)},i=()=>{n(),M.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,z$(e)!=null){r();return}M.current=!1,de(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),M.current=!1,de(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;de(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),h1(()=>{let e=S.current;e!=null&&(pt.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[pt.physical.scrollTop]),h1(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=B$(n,g);let a=()=>{let e=t.getVisibleCount(),r=V$(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Re(A1({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!A.current){A.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=V$(O.current,g),i=t.getVisibleRows(e,e)[0]??null;U$(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(()=>{P$(ue)&&le(e=>e+1),a()}),l=()=>{Oe.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,ye(e=>e+1),e=null},50))},u=null,d=()=>{i!=null&&delete i.dataset.overlayReveal,u!=null&&(clearTimeout(u),u=null)},f=()=>{i!=null&&Oe.current!==!0&&(n.scrollTop>0||(i.dataset.overlayReveal=`true`,u!=null&&clearTimeout(u),u=setTimeout(()=>{d()},200)))},p=()=>{if(a(),n.scrollTop>0&&d(),Se.current!=null&&y.current&&Ot.current(),Oe.current===!0){y.current=!1;return}pe(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=>{O.current=(e[0]==null?null:H$(e[0]))??B$(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,O.current=null,x?.disconnect()}},[t,g,s,c,h]),h1(()=>{Ve||be==null||kt(!1)},[kt,Ve,be]);let Xt=_1(()=>be==null?null:`${be.path}::${be.source}`,[be]);h1(()=>{if(Xt==null){m?.clearSlotContent(WG);return}let t=Se.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??X1(n.getBoundingClientRect()),close:e=>{Ot.current(e?.restoreFocus??!0)},restoreFocus:()=>{Dt.current&&Et.current(Se.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(WG,i),e?.contextMenu?.onOpen?.(t.item,r),l0(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&l0(i)}),()=>{m?.clearSlotContent(WG)}},[Xt,e?.contextMenu,m]),h1(()=>{be!=null&&t.getItem(be.path)==null&&kt()},[kt,be,t]),h1(()=>{if(be==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(Y1(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&kt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),kt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[kt,be]),h1(()=>{let e=C.current,n=S.current;if(e==null||n==null){N.current=nt;return}let r=nt==null?null:T.current.get(nt)??null,i=z$(n),a=i?.dataset.itemPath??null,o=$e&&x.current===i,c=f&&w.current===i,l=F.current&&!et,u=I.current??0,d=Ce.current,p=we.current,m=Te.current,g=Ee.current,_=i!=null,v=M.current||_,y=N.current!==nt,b=p!=null&&p===nt&&nt!=null,E=!1,O=!1;if(it!=null&&it.id!==k.current){k.current=it.id;let n=it.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,ht-s))):bt;E=!0,O=W$(e,n,s,ht,yt,it.offset,t)}t.clearScrollRequest(it.id)}let A=!E&&l&&G$(e,rt,s,ht,yt,u),j=!E&&d!=null&&d===nt&&G$(e,rt,s,ht,yt,bt),P=!E&&m!=null&&m.path===nt&&G$(e,rt,s,ht,yt,m.viewportOffset),L=!E&&g!=null&&g.path===nt&&e.scrollTop!==g.scrollTop;if(L&&(e.scrollTop=g.scrollTop),(L||O||j||P||A||v&&y&&d!==nt&&!b&&U$(e,rt,s,ht,bt))&&D.current(),E){N.current=nt;return}if(!v){N.current=nt;return}if(o){N.current=nt;return}if(c&&!l){N.current=nt;return}if(r==null){l&&rt>=0&&(G$(e,rt,s,ht,yt,u),D.current()),N.current=nt;return}(y||l||d===nt||p===nt||m?.path===nt||g?.path===nt||a==null||a!==nt)&&(R$(r),d===nt&&(Ce.current=null),p===nt&&(we.current=null),m?.path===nt&&(Te.current=null),g?.path===nt&&(Ee.current=null),F.current=!1,I.current=null),N.current=nt},[t,rt,nt,St,s,$e,et,gt,ht,f,it,h,bt,yt,mt]);let Zt=rt>=0&&rt>=pt.visible.startIndex&&rt<=pt.visible.endIndex,Qt=nt!=null&&_t.some(e=>D1(e.row)===nt),$t=Zt||Qt,en=Ue&&M.current===!0&&$t?nt:null,tn=ge===`pointer`?fe:null,nn=be?.path??De.current??tn??en??fe,rn=be?.source===`right-click`;h1(()=>{y.current&&be==null||At(Je(nn))},[be,Je,gt,ht,ve,_t,nn,At,mt]);let an=v1(e=>{if(y.current||Y1(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&&_e(e=>e===`pointer`?e:`pointer`),pe(e=>e===i?e:i)},[]),on=v1(()=>{pe(null)},[]);h1(()=>{if(!at)return;let e=()=>{Vt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Vt(),t.cancelDrag()}},[t,at]);let sn=e=>{if(!at||t.getDragSession()==null||re.current)return;let n=I1(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Ut(t.getDragSession()?.target??null),Gt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},cn=e=>{if(!at||t.getDragSession()==null||re.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Lt(),zt(),t.setDragTarget(null))},ln=e=>{!at||t.getDragSession()==null||re.current||(e.preventDefault(),Ht(e.clientX,e.clientY),t.completeDrag(),Rt(),Lt(),zt(),z.current=null)},un=pt.window.height,dn=pt.window.offsetTop,fn=Math.min(0,ht-un),pn=Math.min(0,ht-un-bt),mn=V===nt||F.current,hn=nt!=null&&mn&&!St&&rt>=0?mt[rt]??t.getVisibleRows(rt,rt)[0]??null:null,gn=hn==null?null:K$(rt,s,gt,un),_n=z.current,vn=lt!=null&&_n!=null&&_n.path===lt&&_n.index>=gt.start&&_n.index<=gt.end,yn=lt!=null&&_n!=null&&_n.path===lt&&!vn&&_n.path!==hn?.path?_n:null,bn=yn==null?null:K$(yn.index,s,gt,un),xn=G1((rt>=0?mt[rt]??t.getVisibleRows(rt,rt)[0]??null:null)?.ancestorPaths.at(-1)??null),Sn=et&&nt!=null?o0(o,nt,!St):void 0,Cn=be?.path??(et?nt:V),wn=be?.path??fe,Tn=Je(nn),En=Ve&&Ue&&!rn&&!$e&&Tn!=null&&me!=null&&nn!=null,Dn=Ve&&(En||be!=null),On=be?.anchorRect,kn=On==null&&Tn!=null&&me!=null&&(be!=null||En)?me:null,An=On==null?kn==null?void 0:{top:`${kn}px`}:{left:`${On.left}px`,position:`fixed`,right:`auto`,top:`${On.top}px`},jn=rn?{opacity:`0`}:void 0,Mn=v1((e,n,r,i)=>{let a=X$({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:et,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)}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=pt.visible.startIndex&&n.index<=pt.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(M.current=!0,de(e=>e===c?e:c),_e(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&Nt(c,{targetOffset:`sticky-parents`})},[t,et,pt.visible.endIndex,pt.visible.startIndex,Nt]),Nn=()=>{if(y.current||!Ue||nn==null||Tn==null)return;let e=t.getItem(nn);e!=null&&(At(Tn),Dt.current=!0,xe({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:Tn.getAttribute(`aria-label`)??nn,path:e.getPath()},path:e.getPath(),source:`button`}))},Pn={contextHoverPath:wn,contextMenuButtonTriggerEnabled:Ue,contextMenuButtonVisibility:We,contextMenuEnabled:Ve,contextMenuRightClickEnabled:Ge,contextMenuTriggerMode:He,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:at,draggedPathSet:st,dragTarget:ct,gitLaneActive:Ye,gitStatusByPath:n,handleRowDragEnd:qt,handleRowDragStart:Kt,handleRowTouchStart:Jt,ignoredGitDirectories:r,ignoredInheritanceCache:ce,instanceId:o,itemHeight:s,onKeyDown:Yt,onRowClick:Mn,openContextMenuForRow:jt,registerButton:Ke,registerRenameInput:H,renameView:Ze,renderDecorationForRow:Ct,resolveIcon:Xe,shouldSuppressContextMenu:Pt,visualFocusPath:Cn},Fn={...Pn,registerButton:qe};return $(`div`,{ref:S,id:ut,"data-file-tree-context-menu-button-visibility":Ve&&Ue?We:void 0,"data-file-tree-context-menu-trigger-mode":Ve?He:void 0,"data-file-tree-has-context-menu-action-lane":Ve&&Ue?`true`:void 0,"data-file-tree-has-git-lane":Ye?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:at?cn:void 0,onDragOver:at?sn:void 0,onDrop:at?ln:void 0,onKeyDown:Yt,onPointerLeave:Ve?on:void 0,onPointerOver:Ve?an:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[$(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:xn}}),$(`slot`,{name:UG,"data-type":`header-slot`}),f?$(`div`,{"data-file-tree-search-container":!0,"data-open":et?`true`:`false`,children:$(`input`,{ref:w,"aria-activedescendant":Sn,"aria-controls":ut,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ne?`true`:void 0,value:tt,onBlur:()=>{d===`retain`&&!Fe.current||t.closeSearch()},onFocus:Ie,onPointerDown:Ie,onInput:e=>{Ie();let n=e.currentTarget;t.setSearch(n.value)}})}):null,$(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&ze&&_t.length>0?$(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:$(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${dt}px`},children:_t.map((e,t)=>d0(Fn,e.row,`sticky:${D1(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${_t.length-t}`}}))})}):null,$(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${yt}px`},children:[$(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${dn}px`}}),$(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${un}px`,top:`${fn}px`,bottom:`${pn}px`},children:[f0(Pn,gt,xt),hn!=null&&gn!=null?d0(Pn,hn,`parked:${hn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:lt===hn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${gn}px`}}):null,yn!=null&&bn!=null?d0(Pn,yn,`parked-drag:${yn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${bn}px`}}):null]})]})]}),Ve?$(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":Dn?`true`:`false`,style:An,children:[$(`button`,{ref:v,type:`button`,"data-type":GG,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":be==null?`false`:`true`,"data-visible":En?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),be!=null){kt();return}Nn()},tabIndex:-1,style:jn,children:$(r$,{...Xe(`file-tree-icon-ellipsis`)})}),be==null?null:$(`slot`,{name:WG})]}):null,be==null?null:$(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),kt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),kt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var m0={hydrateRoot:(e,t)=>{QQ(OQ(p0,t),e)},renderRoot:(e,t)=>{ZQ(OQ(p0,t),e)},unmountRoot:e=>{ZQ(null,e)}};function h0(e,t){m0.renderRoot(e,t)}function g0(e,t){m0.hydrateRoot(e,t)}function _0(e){m0.unmountRoot(e)}var v0=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)}}};Array.isArray;var y0=0;function b0(e){return e!=null&&e.length>0?e:(y0+=1,`pst_ft_${y0}`)}function x0({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??hq)}function S0(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 C0(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 w0(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var T0=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new v0;#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=b0(a),this.#p=QZ(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=mq(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new qZ({...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&&(_0(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()}getFocusedIndex(){return this.#t.getFocusedIndex()}getVisibleCount(){return this.#t.getVisibleCount()}getVisibleRows(e,t){return this.#t.getVisibleRows(e,t)}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)}focusFirstItem(){this.#t.focusFirstItem()}focusLastItem(){this.#t.focusLastItem()}focusNextItem(){this.#t.focusNextItem()}focusPreviousItem(){this.#t.focusPreviousItem()}focusParentItem(){this.#t.focusParentItem()}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=$Z(this.#p,e);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&h0(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(),h0(t.wrapper,this.#w()))}setGitStatus(e){let t=QZ(e,this.#p);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&h0(n.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),h0(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),g0(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),h0(r,this.#w())}#C(){return{initialViewportHeight:x0({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(UG,e());return}this.#l.setSlotHtml(UG,this.#e?.header?.html??null)}#k(e){let t=w0(e).find(e=>C0(e)),n=S0(sq(fq(this.#m).set));n!=null&&(t==null||t.outerHTML!==n.outerHTML)&&(t==null?e.prepend(n):t.replaceWith(n))}#A(e){let t=w0(e),n=t.find(e=>C0(e)),r=t.filter(e=>e!==n),i=fq(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=S0(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=fq(this.#m);t.colored&&lq(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${zG}]`);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(zG,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=yq(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 Tq(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 E0(e){let[t]=(0,p.useState)(()=>new T0(e)),n=(0,p.useRef)({timeout:null,model:t});return(0,p.useEffect)(()=>{let{current:e}=n;return e.timeout!=null&&(clearTimeout(e.timeout),e.timeout=null),()=>{e.timeout=setTimeout(()=>e.model.cleanUp(),1)}},[]),{model:t}}function D0(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!Object.is(e[n],t[n]))return!1;return!0}function O0(e,t,n){return Object.is(e,t)||n?.(e,t)===!0}function k0(e,t,n){let r=(0,p.useRef)({hasValue:!1,model:null,selector:null,value:void 0}),i=(0,p.useCallback)(t=>e.subscribe(t),[e]),a=(0,p.useCallback)(()=>{let i=r.current,a=t(e);if(i.model!==e||i.selector!==t||!i.hasValue)return i.hasValue=!0,i.model=e,i.selector=t,i.value=a,a;let o=i.value;return O0(o,a,n)?o:(i.value=a,a)},[n,e,t]);return(0,p.useSyncExternalStore)(i,a,a)}function A0(e,t){return e.isOpen===t.isOpen&&e.value===t.value&&D0(e.matchingPaths,t.matchingPaths)}function j0(e){let t=k0(e,e=>({isOpen:e.isSearchOpen(),matchingPaths:e.getSearchMatchingPaths(),value:e.getSearchValue()}),A0);return(0,p.useMemo)(()=>({...t,close:()=>{e.closeSearch()},focusNextMatch:()=>{e.focusNextSearchMatch()},focusPreviousMatch:()=>{e.focusPreviousSearchMatch()},open:t=>{e.openSearch(t)},setValue:t=>{e.setSearch(t)}}),[e,t])}function M0(e){let t=new Set;for(let n of e)for(let e=n.indexOf(`/`);e!==-1;e=n.indexOf(`/`,e+1))t.add(n.slice(0,e));return[...t]}function N0(e,t){let n=[];for(let r of M0(t)){let t=e.getItem(r);(!t||!t.isDirectory()||t.isExpanded())&&n.push(r)}return n}function P0(e){let t=e.status===`A`?`added`:e.status===`D`?`deleted`:e.status===`R`||e.status===`C`?`renamed`:`modified`;return{path:e.path,status:t}}function F0(e){return e.map(e=>`${e.path}\0${P0(e).status}`).join(`
2980
+ `)}function I0(e,t){return t.map(t=>`${t.path}\0${t.additions}\0${t.deletions}\0${+!!t.binary}\0${ZM(e,t)}`).join(`
2981
+ `)}function L0(e,t){return e?e.paths===t.paths?e.status===t.status?e.decoration===t.decoration?`none`:`decoration`:`status`:`reset`:`none`}var R0={viewed:{glyph:`✓`,color:`var(--add)`,title:`Viewed · click or v to toggle`},unviewed:{glyph:`○`,color:`var(--fg-2)`,title:`Not viewed · click or v to toggle`},restale:{glyph:`◐`,color:`var(--warn)`,title:`Changed since you viewed it · click or v to mark viewed again`}},z0=`
2974
2982
  [data-item-section="decoration"] { flex: 1 0 auto; overflow: visible; }
2975
2983
  [data-item-section="decoration"] > span { gap: 0.375rem; overflow: visible; font-variant-numeric: tabular-nums; }
2976
2984
  [data-item-section="decoration"] > span > span:last-child { min-width: 1ch; text-align: center; }
2977
- `;function x0(e,t){let n=[];e.additions>0&&n.push({text:`+${e.additions}`,color:`var(--add)`}),e.deletions>0&&n.push({text:`−${e.deletions}`,color:`var(--del)`});let r=y0[t];n.push({text:r.glyph,color:r.color});let i=e.binary?`binary`:`+${e.additions} −${e.deletions}`;return{text:n.map(e=>e.text).join(` `),parts:n,title:`${i} · ${r.title}`}}function S0(){let e=Y(e=>e.snapshot),t=Y(e=>e.openFile),[n,r]=(0,p.useState)(`changed`),i=Y(e=>e.unviewAll),a=Y(e=>e.viewed),o=Y(e=>e.config),s=(0,p.useMemo)(()=>e?qM({viewed:a,config:o},e.changed):0,[e,a,o]),c=TU(()=>void i()),l=(0,p.useMemo)(()=>e?n===`changed`?e.changed.map(e=>e.path):e.tree:[],[e,n]),u=(0,p.useMemo)(()=>e?.changed.map(h0)??[],[e]),d=(0,p.useRef)(t);d.current=t;let{model:f}=f0({paths:l,gitStatus:u,initialExpansion:`closed`,initialExpandedPaths:p0(l),search:!0,itemHeight:Math.round(1.875*QU()),density:QU()/16,icons:{set:`standard`},unsafeCSS:b0,onSelectionChange:e=>{let t=e[0];t&&!t.endsWith(`/`)&&t!==Y.getState().activePath&&d.current(t)},renderRowDecoration:({item:e})=>{if(e.kind!==`file`)return null;let t=Y.getState(),n=t.snapshot?.changed.find(t=>t.path===e.path);return n?x0(n,GM(t,n)):null}}),m=(0,p.useRef)(null);(0,p.useEffect)(()=>{let e=m.current;if(!e)return;let t=e=>{let t=e.composedPath();return t.findIndex(e=>e instanceof HTMLElement&&e.dataset.itemSection===`decoration`)<=0?null:t.find(e=>e instanceof HTMLElement&&e.dataset.itemPath!=null&&e.dataset.itemType===`file`)?.dataset.itemPath??null},n=e=>{e.button!==0||!t(e)||(e.preventDefault(),e.stopPropagation())},r=e=>{let n=t(e);if(!n){let t=e.composedPath().find(e=>e instanceof HTMLElement&&e.dataset.itemType===`file`)?.dataset.itemPath;if(!t)return;requestAnimationFrame(cW);let n=Y.getState();JM(n,t)&&n.toggleCollapsed(t),t===n.activePath&&d.current(t);return}e.preventDefault(),e.stopPropagation();let r=Y.getState(),i=r.snapshot?.changed.find(e=>e.path===n);i&&r.setViewed(n,!KM(r,i))};return e.addEventListener(`pointerdown`,n,!0),e.addEventListener(`click`,r,!0),()=>{e.removeEventListener(`pointerdown`,n,!0),e.removeEventListener(`click`,r,!0)}},[]);let h=Y(e=>e.activePath);(0,p.useEffect)(()=>{let e=f.getItem(h??``);if(!(!h||!e)){for(let e of f.getSelectedPaths())e!==h&&f.getItem(e)?.deselect();e.select(),f.scrollToPath(h)}},[f,h,l]);let _=Y(e=>e.setTreeModel);(0,p.useEffect)(()=>(_(f),()=>_(null)),[f,_]);let v=(0,p.useMemo)(()=>({paths:l.join(`
2978
- `),status:g0(e?.changed??[]),decoration:e?_0({viewed:a,config:o},e.changed):``}),[l,e,a,o]),y=(0,p.useRef)(null);return(0,p.useEffect)(()=>{let e=v0(y.current,v);switch(y.current=v,e){case`reset`:f.resetPaths(l,{initialExpandedPaths:m0(f,l)}),f.setGitStatus(u);break;case`status`:f.setGitStatus(u);break;case`decoration`:f.setComposition(f.getComposition())}},[f,v,l,u]),(0,g.jsxs)(`aside`,{className:`tree-theme flex min-h-0 flex-col bg-surface`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-b-border px-2.5 py-1.5 text-muted [&_button]:flex-none [&_button]:whitespace-nowrap`,children:[(0,g.jsxs)(`div`,{className:`flex overflow-hidden rounded-md border border-border`,children:[(0,g.jsx)(jU,{selected:n===`changed`,onClick:()=>r(`changed`),children:`Changed`}),(0,g.jsx)(jU,{selected:n===`all`,onClick:()=>r(`all`),children:`All files`})]}),(0,g.jsx)(`span`,{className:`ml-auto`,children:l.length}),(0,g.jsxs)(wM,{variant:`ghost`,danger:c.armed,icon:!c.armed,feedback:c.armed?`confirm`:void 0,disabled:s===0,title:c.armed?`Click again to mark all files not viewed`:`Mark all ${s} viewed file(s) not viewed`,onClick:c.fire,children:[(0,g.jsx)(Hj,{size:`0.875rem`}),c.armed&&`Un-view all?`]})]}),(0,g.jsx)(`div`,{className:`min-h-0 flex-1`,ref:m,children:(0,g.jsx)(RG,{model:f,className:`h-full`,renderContextMenu:(e,t)=>(0,g.jsx)(C0,{path:e.path,kind:e.kind,close:t.close})})})]})}function C0({path:e,kind:t,close:n}){let r=Y(t=>t.snapshot?.changed.find(t=>t.path===e)),i=Y(e=>r?KM(e,r):!1),a=Y(t=>JM(t,e)),o=Y(e=>e.setViewed),s=Y(e=>e.toggleCollapsed),c=Y(e=>e.openFile);return t===`file`?(0,g.jsx)(`div`,{className:`static top-[calc(100%_+_0.375rem)] left-0 z-20 min-w-95 rounded-[0.625rem] border border-border bg-canvas p-1.5 shadow-[0_0.625rem_1.875rem_rgba(0,_0,_0,_0.18)]`,children:r?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(wM,{className:`grid min-h-8.5 w-full grid-cols-[1.125rem_1fr_auto_1.5rem] items-center gap-2.5 rounded-[0.4375rem] border-0 bg-transparent px-2.5 py-1.75 text-left font-sans text-[0.8125rem] leading-[1.3] text-foreground hover:bg-hover [&_kbd]:ml-1 [&_kbd]:justify-self-end [&_kbd]:text-muted [&>svg]:text-muted`,onClick:()=>{o(e,!i),n()},children:[i?(0,g.jsx)(Hj,{size:`0.875rem`}):(0,g.jsx)(Uj,{size:`0.875rem`}),(0,g.jsx)(`span`,{className:`whitespace-nowrap`,children:i?`Mark not viewed`:`Mark viewed`}),(0,g.jsx)(`span`,{className:`inline-flex items-center justify-self-end font-mono text-[0.75rem] leading-[normal] text-muted`,children:i?``:(0,g.jsx)(Oj,{size:`0.75rem`})}),(0,g.jsx)(`kbd`,{children:`v`})]}),(0,g.jsxs)(wM,{className:`grid min-h-8.5 w-full grid-cols-[1.125rem_1fr_auto_1.5rem] items-center gap-2.5 rounded-[0.4375rem] border-0 bg-transparent px-2.5 py-1.75 text-left font-sans text-[0.8125rem] leading-[1.3] text-foreground hover:bg-hover [&_kbd]:ml-1 [&_kbd]:justify-self-end [&_kbd]:text-muted [&>svg]:text-muted`,onClick:()=>{s(e),n()},children:[a?(0,g.jsx)(Nj,{size:`0.875rem`}):(0,g.jsx)(Mj,{size:`0.875rem`}),(0,g.jsx)(`span`,{className:`whitespace-nowrap`,children:a?`Expand`:`Collapse`}),(0,g.jsx)(`span`,{className:`inline-flex items-center justify-self-end font-mono text-[0.75rem] leading-[normal] text-muted`}),(0,g.jsx)(`kbd`,{children:a?`zo`:`zc`})]})]}):(0,g.jsxs)(wM,{className:`grid min-h-8.5 w-full grid-cols-[1.125rem_1fr_auto_1.5rem] items-center gap-2.5 rounded-[0.4375rem] border-0 bg-transparent px-2.5 py-1.75 text-left font-sans text-[0.8125rem] leading-[1.3] text-foreground hover:bg-hover [&_kbd]:ml-1 [&_kbd]:justify-self-end [&_kbd]:text-muted [&>svg]:text-muted`,onClick:()=>{c(e),n()},children:[(0,g.jsx)(Uj,{size:`0.875rem`}),(0,g.jsx)(`span`,{className:`whitespace-nowrap`,children:`Open`}),(0,g.jsx)(`span`,{className:`inline-flex items-center justify-self-end font-mono text-[0.75rem] leading-[normal] text-muted`}),(0,g.jsx)(`span`,{})]})}):null}function w0(){let e=Y(e=>e.boot),t=Y(e=>e.refreshSnapshot),n=Y(e=>e.refreshThreads),r=Y(e=>e.refreshViewed),i=Y(e=>e.refreshConfig),a=Y(e=>e.setLspStatus),o=Y(e=>e.toast),s=Y(e=>e.layout),c=Y(e=>e.setLayout),l=Y(e=>e.snapshot?sN(e.snapshot,e.github.data):`diffle`);oW(),(0,p.useEffect)(()=>{document.title=l},[l]);let u=(0,p.useCallback)(e=>t=>{t.preventDefault();let n=t.currentTarget,r=t.clientX,i=e===`tree`?t.currentTarget.previousElementSibling:t.currentTarget.nextElementSibling,a=(e===`tree`?s.treeWidth:s.panelWidth)??i?.getBoundingClientRect().width??0,o=t=>{let n=e===`tree`?t.clientX-r:r-t.clientX,i=Math.max(180,Math.min(800,a+n));c(e===`tree`?{treeWidth:i}:{panelWidth:i})},l=()=>{document.removeEventListener(`pointermove`,o),document.removeEventListener(`pointerup`,l),document.removeEventListener(`pointercancel`,l),delete document.body.dataset.resizing,n.removeAttribute(`data-resizing`)};document.body.dataset.resizing=``,n.setAttribute(`data-resizing`,``),document.addEventListener(`pointermove`,o),document.addEventListener(`pointerup`,l),document.addEventListener(`pointercancel`,l)},[s.treeWidth,s.panelWidth,c]),d=[s.treeVisible?`${s.treeWidth==null?`17.5rem`:`${s.treeWidth}px`} 4px`:``,`minmax(0, 1fr)`,s.panelVisible?`4px ${s.panelWidth==null?`21.25rem`:`${s.panelWidth}px`}`:``].filter(Boolean).join(` `);return(0,p.useEffect)(()=>Hk(e=>{switch(e.type){case`snapshot`:t(e.version);break;case`threads`:n();break;case`viewed`:r();break;case`config`:i();break;case`lsp`:a(e.payload)}},()=>void e().then(()=>performance.mark(`diffle:snapshot`))),[e,t,n,r,i,a]),(0,g.jsxs)(`div`,{className:`grid h-full grid-rows-[2.5rem_1fr]`,style:{gridTemplateColumns:d},children:[(0,g.jsx)(gW,{}),s.treeVisible&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(S0,{}),(0,g.jsx)(`div`,{className:`cursor-col-resize bg-border opacity-60 [transition:opacity_120ms_ease,_background_120ms_ease] hover:bg-accent hover:opacity-100 data-resizing:bg-accent data-resizing:opacity-100`,onPointerDown:u(`tree`),title:`Drag to resize`})]}),(0,g.jsx)(vG,{}),s.panelVisible&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`div`,{className:`cursor-col-resize bg-border opacity-60 [transition:opacity_120ms_ease,_background_120ms_ease] hover:bg-accent hover:opacity-100 data-resizing:bg-accent data-resizing:opacity-100`,onPointerDown:u(`panel`),title:`Drag to resize`}),(0,g.jsx)(EU,{})]}),(0,g.jsx)(SW,{}),(0,g.jsx)(AW,{}),o&&(0,g.jsx)(`div`,{className:`fixed bottom-6 left-[50%] z-60 max-w-[min(48rem,_90vw)] [transform:translateX(-50%)] [animation:flash-in_160ms_ease] rounded-lg bg-foreground px-5 py-3 text-[1rem] leading-[1.4] wrap-anywhere text-canvas shadow-[0_0.5rem_1.5rem_rgba(0,_0,_0,_0.35)]`,children:o})]})}XN(JN()),performance.mark(`diffle:boot`);var T0=Math.max(1,Math.min(4,(navigator.hardwareConcurrency||4)-1));(0,IO.createRoot)(document.getElementById(`root`)).render((0,g.jsx)(p.StrictMode,{children:(0,g.jsx)(Xp,{poolOptions:{poolSize:T0,workerFactory:()=>new u},highlighterOptions:{preferredHighlighter:`shiki-js`,useTokenTransformer:!0,theme:KN},children:(0,g.jsx)(w0,{})})}));export{s as t};
2985
+ /* The library butts the search box against the toolbar above; give it the toolbar's own vertical rhythm. */
2986
+ [data-file-tree-search-container] { padding-top: 0.5rem; }
2987
+ :host([data-search-empty]) [data-file-tree-virtualized-scroll] { display: none; }
2988
+ `;function B0(e,t){let n=[];e.additions>0&&n.push({text:`+${e.additions}`,color:`var(--add)`}),e.deletions>0&&n.push({text:`−${e.deletions}`,color:`var(--del)`});let r=R0[t];n.push({text:r.glyph,color:r.color});let i=e.binary?`binary`:`+${e.additions} −${e.deletions}`;return{text:n.map(e=>e.text).join(` `),parts:n,title:`${i} · ${r.title}`}}function V0(){let e=X(e=>e.snapshot),t=X(e=>e.openFile),[n,r]=(0,p.useState)(`changed`),i=X(e=>e.unviewAll),a=X(e=>e.viewed),o=X(e=>e.config),s=(0,p.useMemo)(()=>e?$M({viewed:a,config:o},e.changed):0,[e,a,o]),c=kU(()=>void i()),l=(0,p.useMemo)(()=>e?n===`changed`?e.changed.map(e=>e.path):e.tree:[],[e,n]),u=(0,p.useMemo)(()=>e?.changed.map(P0)??[],[e]),d=(0,p.useRef)(t);d.current=t;let{model:f}=E0({paths:l,gitStatus:u,initialExpansion:`closed`,initialExpandedPaths:M0(l),search:!0,itemHeight:Math.round(1.875*iW()),density:iW()/16,icons:{set:`standard`},unsafeCSS:z0,onSelectionChange:e=>{let t=e[0];t&&!t.endsWith(`/`)&&t!==X.getState().activePath&&d.current(t)},renderRowDecoration:({item:e})=>{if(e.kind!==`file`)return null;let t=X.getState(),n=t.snapshot?.changed.find(t=>t.path===e.path);return n?B0(n,ZM(t,n)):null}}),m=j0(f),h=m.value.trim().length>0&&m.matchingPaths.length===0,_=(0,p.useRef)(null);(0,p.useEffect)(()=>{_.current?.firstElementChild?.toggleAttribute(`data-search-empty`,h)},[h]),(0,p.useEffect)(()=>{let e=_.current;if(!e)return;let t=e=>{let t=e.composedPath()[0];t instanceof Element&&t.matches(`[data-file-tree-search-input]`)&&e.stopPropagation()},n=e=>{if(f.getSearchValue().trim()&&f.getSearchMatchingPaths().length===0&&[`Enter`,`ArrowUp`,`ArrowDown`].includes(e.key)){e.preventDefault(),e.stopPropagation();return}if(e.key!==`Enter`||e.isComposing||!f.isSearchOpen())return;let t=f.getFocusedPath();if(!t||t.endsWith(`/`))return;e.preventDefault(),e.stopPropagation();let n=X.getState();eN(n,t)&&n.toggleCollapsed(t),d.current(t),requestAnimationFrame(hW)};return e.addEventListener(`blur`,t,!0),e.addEventListener(`keydown`,n,!0),()=>{e.removeEventListener(`blur`,t,!0),e.removeEventListener(`keydown`,n,!0)}},[f]),(0,p.useEffect)(()=>{let e=_.current;if(!e)return;let t=e=>{let t=e.composedPath();return t.findIndex(e=>e instanceof HTMLElement&&e.dataset.itemSection===`decoration`)<=0?null:t.find(e=>e instanceof HTMLElement&&e.dataset.itemPath!=null&&e.dataset.itemType===`file`)?.dataset.itemPath??null},n=e=>{e.button!==0||!t(e)||(e.preventDefault(),e.stopPropagation())},r=e=>{let n=t(e);if(!n){let t=e.composedPath().find(e=>e instanceof HTMLElement&&e.dataset.itemType===`file`)?.dataset.itemPath;if(!t)return;requestAnimationFrame(hW);let n=X.getState();eN(n,t)&&n.toggleCollapsed(t),t===n.activePath&&d.current(t);return}e.preventDefault(),e.stopPropagation();let r=X.getState(),i=r.snapshot?.changed.find(e=>e.path===n);i&&r.setViewed(n,!QM(r,i))};return e.addEventListener(`pointerdown`,n,!0),e.addEventListener(`click`,r,!0),()=>{e.removeEventListener(`pointerdown`,n,!0),e.removeEventListener(`click`,r,!0)}},[]),(0,p.useEffect)(()=>{let e=_.current?.firstElementChild?.shadowRoot;if(!e)return;let t=e.querySelector(`[data-file-tree-search-input]`);t&&(t.placeholder=`Search files…`);let n=e=>{let t=e.composedPath().find(e=>e instanceof HTMLElement&&e.dataset.itemPath!=null),n=e.relatedTarget;!t||n instanceof Node&&t.contains(n)||(Array.from(t.querySelectorAll(`[data-truncate-marker]`)).some(e=>getComputedStyle(e).opacity!==`0`)?t.title=t.getAttribute(`aria-label`)??``:t.removeAttribute(`title`))};return e.addEventListener(`pointerover`,n,!0),e.addEventListener(`focusin`,n,!0),()=>{e.removeEventListener(`pointerover`,n,!0),e.removeEventListener(`focusin`,n,!0)}},[]);let v=X(e=>e.activePath);(0,p.useEffect)(()=>{let e=f.getItem(v??``);if(!(!v||!e)){for(let e of f.getSelectedPaths())e!==v&&f.getItem(e)?.deselect();e.select(),f.scrollToPath(v)}},[f,v,l]);let y=X(e=>e.setTreeModel);(0,p.useEffect)(()=>(y(f),()=>y(null)),[f,y]);let b=(0,p.useMemo)(()=>({paths:l.join(`
2989
+ `),status:F0(e?.changed??[]),decoration:e?I0({viewed:a,config:o},e.changed):``}),[l,e,a,o]),x=(0,p.useRef)(null);return(0,p.useEffect)(()=>{let e=L0(x.current,b);switch(x.current=b,e){case`reset`:f.resetPaths(l,{initialExpandedPaths:N0(f,l)}),f.setGitStatus(u);break;case`status`:f.setGitStatus(u);break;case`decoration`:f.setComposition(f.getComposition())}},[f,b,l,u]),(0,g.jsxs)(`aside`,{className:`tree-theme flex min-h-0 flex-col bg-surface`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-b-border px-2.5 py-1.5 text-muted [&_button]:flex-none [&_button]:whitespace-nowrap`,children:[(0,g.jsxs)(FU,{children:[(0,g.jsx)(IU,{selected:n===`changed`,onClick:()=>r(`changed`),children:`Changed`}),(0,g.jsx)(IU,{selected:n===`all`,onClick:()=>r(`all`),children:`All files`})]}),(0,g.jsx)(`span`,{className:`ml-auto`,children:l.length}),(0,g.jsxs)(Y,{variant:`ghost`,danger:c.armed,icon:!c.armed,feedback:c.armed?`confirm`:void 0,disabled:s===0,title:c.armed?`Click again to mark all files not viewed`:`Mark all ${s} viewed file(s) not viewed`,onClick:c.fire,children:[(0,g.jsx)(Uj,{size:`0.875rem`}),c.armed&&`Un-view all?`]})]}),(0,g.jsxs)(`div`,{className:`relative min-h-0 flex-1`,ref:_,children:[(0,g.jsx)(ZG,{model:f,className:`h-full`,renderContextMenu:(e,t)=>(0,g.jsx)(H0,{path:e.path,kind:e.kind,close:t.close})}),h&&(0,g.jsx)(`div`,{role:`status`,className:`absolute inset-x-0 top-14 pr-2.5 pl-[calc(1.5rem+1px)] text-muted`,children:`No matching files`})]})]})}function H0({path:e,kind:t,close:n}){let r=X(t=>t.snapshot?.changed.find(t=>t.path===e)),i=X(e=>r?QM(e,r):!1),a=X(t=>eN(t,e)),o=X(e=>e.setViewed),s=X(e=>e.toggleCollapsed),c=X(e=>e.openFile);return t===`file`?(0,g.jsx)(`div`,{className:`static top-[calc(100%_+_0.375rem)] left-0 z-20 min-w-95 rounded-[0.625rem] border border-border bg-canvas p-1.5 shadow-[0_0.625rem_1.875rem_rgba(0,_0,_0,_0.18)]`,children:r?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(Y,{className:`grid min-h-8.5 w-full grid-cols-[1.125rem_1fr_auto_1.5rem] items-center gap-2.5 rounded-[0.4375rem] border-0 bg-transparent px-2.5 py-1.75 text-left font-sans text-[0.8125rem] leading-[1.3] text-foreground hover:bg-hover [&_kbd]:ml-1 [&_kbd]:justify-self-end [&_kbd]:text-muted [&>svg]:text-muted`,onClick:()=>{o(e,!i),n()},children:[i?(0,g.jsx)(Uj,{size:`0.875rem`}):(0,g.jsx)(Wj,{size:`0.875rem`}),(0,g.jsx)(`span`,{className:`whitespace-nowrap`,children:i?`Mark not viewed`:`Mark viewed`}),(0,g.jsx)(`span`,{className:`inline-flex items-center justify-self-end font-mono text-[0.75rem] leading-[normal] text-muted`,children:i?``:(0,g.jsx)(kj,{size:`0.75rem`})}),(0,g.jsx)(`kbd`,{children:`v`})]}),(0,g.jsxs)(Y,{className:`grid min-h-8.5 w-full grid-cols-[1.125rem_1fr_auto_1.5rem] items-center gap-2.5 rounded-[0.4375rem] border-0 bg-transparent px-2.5 py-1.75 text-left font-sans text-[0.8125rem] leading-[1.3] text-foreground hover:bg-hover [&_kbd]:ml-1 [&_kbd]:justify-self-end [&_kbd]:text-muted [&>svg]:text-muted`,onClick:()=>{s(e),n()},children:[a?(0,g.jsx)(Pj,{size:`0.875rem`}):(0,g.jsx)(Nj,{size:`0.875rem`}),(0,g.jsx)(`span`,{className:`whitespace-nowrap`,children:a?`Expand`:`Collapse`}),(0,g.jsx)(`span`,{className:`inline-flex items-center justify-self-end font-mono text-[0.75rem] leading-[normal] text-muted`}),(0,g.jsx)(`kbd`,{children:a?`zo`:`zc`})]})]}):(0,g.jsxs)(Y,{className:`grid min-h-8.5 w-full grid-cols-[1.125rem_1fr_auto_1.5rem] items-center gap-2.5 rounded-[0.4375rem] border-0 bg-transparent px-2.5 py-1.75 text-left font-sans text-[0.8125rem] leading-[1.3] text-foreground hover:bg-hover [&_kbd]:ml-1 [&_kbd]:justify-self-end [&_kbd]:text-muted [&>svg]:text-muted`,onClick:()=>{c(e),n()},children:[(0,g.jsx)(Wj,{size:`0.875rem`}),(0,g.jsx)(`span`,{className:`whitespace-nowrap`,children:`Open`}),(0,g.jsx)(`span`,{className:`inline-flex items-center justify-self-end font-mono text-[0.75rem] leading-[normal] text-muted`}),(0,g.jsx)(`span`,{})]})}):null}function U0(){let e=X(e=>e.boot),t=X(e=>e.refreshSnapshot),n=X(e=>e.refreshThreads),r=X(e=>e.refreshViewed),i=X(e=>e.refreshConfig),a=X(e=>e.setLspStatus),o=X(e=>e.toast),s=X(e=>e.layout),c=X(e=>e.setLayout),l=X(e=>e.snapshot?_N(e.snapshot,e.github.data):`diffle`);fW(),(0,p.useEffect)(()=>{document.title=l},[l]);let u=(0,p.useCallback)(e=>t=>{t.preventDefault();let n=t.currentTarget,r=t.clientX,i=e===`tree`?t.currentTarget.previousElementSibling:t.currentTarget.nextElementSibling,a=(e===`tree`?s.treeWidth:s.panelWidth)??i?.getBoundingClientRect().width??0,o=t=>{let n=e===`tree`?t.clientX-r:r-t.clientX,i=Math.max(180,Math.min(800,a+n));c(e===`tree`?{treeWidth:i}:{panelWidth:i})},l=()=>{document.removeEventListener(`pointermove`,o),document.removeEventListener(`pointerup`,l),document.removeEventListener(`pointercancel`,l),delete document.body.dataset.resizing,n.removeAttribute(`data-resizing`)};document.body.dataset.resizing=``,n.setAttribute(`data-resizing`,``),document.addEventListener(`pointermove`,o),document.addEventListener(`pointerup`,l),document.addEventListener(`pointercancel`,l)},[s.treeWidth,s.panelWidth,c]),d=[s.treeVisible?`${s.treeWidth==null?`17.5rem`:`${s.treeWidth}px`} 4px`:``,`minmax(0, 1fr)`,s.panelVisible?`4px ${s.panelWidth==null?`21.25rem`:`${s.panelWidth}px`}`:``].filter(Boolean).join(` `);return(0,p.useEffect)(()=>Uk(e=>{switch(e.type){case`snapshot`:t(e.version);break;case`threads`:n();break;case`viewed`:r();break;case`config`:i();break;case`lsp`:a(e.payload)}},()=>void e().then(()=>performance.mark(`diffle:snapshot`))),[e,t,n,r,i,a]),(0,g.jsxs)(`div`,{className:`grid h-full grid-rows-[2.5rem_1fr]`,style:{gridTemplateColumns:d},children:[(0,g.jsx)(CW,{}),s.treeVisible&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(V0,{}),(0,g.jsx)(`div`,{className:`cursor-col-resize bg-border opacity-60 [transition:opacity_120ms_ease,_background_120ms_ease] hover:bg-accent hover:opacity-100 data-resizing:bg-accent data-resizing:opacity-100`,onPointerDown:u(`tree`),title:`Drag to resize`})]}),(0,g.jsx)(jG,{}),s.panelVisible&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`div`,{className:`cursor-col-resize bg-border opacity-60 [transition:opacity_120ms_ease,_background_120ms_ease] hover:bg-accent hover:opacity-100 data-resizing:bg-accent data-resizing:opacity-100`,onPointerDown:u(`panel`),title:`Drag to resize`}),(0,g.jsx)(AU,{})]}),(0,g.jsx)(kW,{}),(0,g.jsx)(IW,{}),o&&(0,g.jsx)(`div`,{className:`fixed bottom-6 left-[50%] z-60 max-w-[min(48rem,_90vw)] [transform:translateX(-50%)] [animation:flash-in_160ms_ease] rounded-lg bg-foreground px-5 py-3 text-[1rem] leading-[1.4] wrap-anywhere text-canvas shadow-[0_0.5rem_1.5rem_rgba(0,_0,_0,_0.35)]`,children:o})]})}eP(QN()),performance.mark(`diffle:boot`);var W0=Math.max(1,Math.min(4,(navigator.hardwareConcurrency||4)-1));(0,IO.createRoot)(document.getElementById(`root`)).render((0,g.jsx)(p.StrictMode,{children:(0,g.jsx)(Xp,{poolOptions:{poolSize:W0,workerFactory:()=>new u},highlighterOptions:{preferredHighlighter:`shiki-js`,useTokenTransformer:!0,theme:XN},children:(0,g.jsx)(U0,{})})}));export{s as t};