diffing 0.1.2 → 0.2.1

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 (95) hide show
  1. package/README.md +103 -7
  2. package/dist/cli-agent-BLPX3oOP.mjs +443 -0
  3. package/dist/cli-agent-BNwY5lZE.mjs +446 -0
  4. package/dist/cli-agent-CbzXDSSF.mjs +446 -0
  5. package/dist/cli-agent-DsqbS3n7.mjs +443 -0
  6. package/dist/cli-agent-Vbs-ePHv.mjs +443 -0
  7. package/dist/cli-agent-ZAkixf4c.mjs +446 -0
  8. package/dist/cli.mjs +954 -36
  9. package/dist/client/assets/{angular-html-BABKYppC.js → angular-html-DsssUIMZ.js} +1 -1
  10. package/dist/client/assets/{angular-ts-CtXLuOQb.js → angular-ts-dTg-sJ77.js} +1 -1
  11. package/dist/client/assets/{apl-DOi69evI.js → apl-C1yUKbqz.js} +1 -1
  12. package/dist/client/assets/{astro-J8Em2tfW.js → astro-BI07ha2y.js} +1 -1
  13. package/dist/client/assets/{blade-B_tOnqRD.js → blade-DkzUGffS.js} +1 -1
  14. package/dist/client/assets/{c-C0tRZWSi.js → c-KkuqqOvW.js} +1 -1
  15. package/dist/client/assets/{cobol-Dj_rkgIY.js → cobol-DRh7-jLi.js} +1 -1
  16. package/dist/client/assets/{coffee-C6Vq4BFF.js → coffee-wR_ZAh9a.js} +1 -1
  17. package/dist/client/assets/{cpp-Cno48fgF.js → cpp-OD_qyywn.js} +1 -1
  18. package/dist/client/assets/{crystal-C7tmDnU1.js → crystal-E4ahAddE.js} +1 -1
  19. package/dist/client/assets/{css-0v4o-iNQ.js → css-2NgE_uxz.js} +1 -1
  20. package/dist/client/assets/{edge-CvULxRem.js → edge-8mbscxxD.js} +1 -1
  21. package/dist/client/assets/{elixir-vRTauEw-.js → elixir-CJv1b3Q6.js} +1 -1
  22. package/dist/client/assets/{elm-fLFTu1xn.js → elm-DUPzqZ9H.js} +1 -1
  23. package/dist/client/assets/{erb-CtItcikB.js → erb-ssvEF26z.js} +1 -1
  24. package/dist/client/assets/{git-rebase-5MeRBXZD.js → git-rebase-DiWIK1Oa.js} +1 -1
  25. package/dist/client/assets/{glimmer-js-B7yA-u8_.js → glimmer-js-DrHg6AuA.js} +1 -1
  26. package/dist/client/assets/{glimmer-ts-B2g1OaHc.js → glimmer-ts-wQSGOa8A.js} +1 -1
  27. package/dist/client/assets/{glsl-CqNPWp5Y.js → glsl-OY27QGY0.js} +1 -1
  28. package/dist/client/assets/{graphql-CF78KbfF.js → graphql-CSWSqe6f.js} +1 -1
  29. package/dist/client/assets/{hack-Dz8fQ8O9.js → hack-Bi1v624Q.js} +1 -1
  30. package/dist/client/assets/{haml-3Gbl257r.js → haml-CX94zV9m.js} +1 -1
  31. package/dist/client/assets/{handlebars-5UZnh5L7.js → handlebars-C1j6wnjG.js} +1 -1
  32. package/dist/client/assets/{html-JOaQiIkL.js → html-BcAjMlB7.js} +1 -1
  33. package/dist/client/assets/{html-derivative-GyX6oYy3.js → html-derivative-DcEpOzdx.js} +1 -1
  34. package/dist/client/assets/{http-t6uVAxgS.js → http-BBxxSc6S.js} +1 -1
  35. package/dist/client/assets/{hurl-OLQZpg0E.js → hurl-CpKRNTz4.js} +1 -1
  36. package/dist/client/assets/{index-CghVgrAF.js → index-Bwv7BWUp.js} +181 -78
  37. package/dist/client/assets/index-CoZyJYkw.css +1 -0
  38. package/dist/client/assets/{java-BqL_yaya.js → java-CFUlLvAA.js} +1 -1
  39. package/dist/client/assets/{javascript-CxBNAxR5.js → javascript-C-HnT3sE.js} +1 -1
  40. package/dist/client/assets/{jinja-CuaK033Z.js → jinja-CPU8RwNP.js} +1 -1
  41. package/dist/client/assets/{jison-aL_w2vvo.js → jison-CW0TBQOs.js} +1 -1
  42. package/dist/client/assets/{json-Byruj-EC.js → json-qUjlNuEJ.js} +1 -1
  43. package/dist/client/assets/{jsx-CosY06uG.js → jsx-KWeo60kf.js} +1 -1
  44. package/dist/client/assets/{julia-u1y7fV63.js → julia-CnJB8y2e.js} +1 -1
  45. package/dist/client/assets/{just-DS4T9P_K.js → just-Do22d9PP.js} +1 -1
  46. package/dist/client/assets/{latex-C9c2IWW4.js → latex-CCPgzvKn.js} +1 -1
  47. package/dist/client/assets/{liquid-DcXQgkEV.js → liquid-B9btdZoI.js} +1 -1
  48. package/dist/client/assets/{lua-DWe0hUn1.js → lua-IFRifurW.js} +1 -1
  49. package/dist/client/assets/{marko-CIW7o2up.js → marko-CCaVBFq1.js} +1 -1
  50. package/dist/client/assets/{mdc-DKjGzb4k.js → mdc-BtbnOLUc.js} +1 -1
  51. package/dist/client/assets/{nginx-CBXzDlkk.js → nginx-BkbFZHVt.js} +1 -1
  52. package/dist/client/assets/{nim-CBf_vdee.js → nim-2uCd5j65.js} +1 -1
  53. package/dist/client/assets/{perl-xC9qc39I.js → perl-C4ixqSNT.js} +1 -1
  54. package/dist/client/assets/{php-n4vnn5oz.js → php-DJ8WOtcI.js} +1 -1
  55. package/dist/client/assets/{pug-Db536lA_.js → pug-BOaafhT5.js} +1 -1
  56. package/dist/client/assets/{qml-CrATLnNN.js → qml-CURE-1y4.js} +1 -1
  57. package/dist/client/assets/{r-DBQ-dydl.js → r-CPWmgzo3.js} +1 -1
  58. package/dist/client/assets/{razor-C_wvK1iP.js → razor-DH83VP_d.js} +1 -1
  59. package/dist/client/assets/{regexp-DowFj0Xd.js → regexp-BXVWi-t_.js} +1 -1
  60. package/dist/client/assets/{rst-rY4UPiwe.js → rst-Bbxxs6E2.js} +1 -1
  61. package/dist/client/assets/{ruby-C4cISY4u.js → ruby-C-TuWES4.js} +1 -1
  62. package/dist/client/assets/{sas-ui1PNNkD.js → sas-njzNYNOq.js} +1 -1
  63. package/dist/client/assets/{scss-BZrs95TC.js → scss-D2i6rHB8.js} +1 -1
  64. package/dist/client/assets/{shellscript-D9YVFS67.js → shellscript-D6Bxi40C.js} +1 -1
  65. package/dist/client/assets/{shellsession-DK7LMzYg.js → shellsession-Defxq-I6.js} +1 -1
  66. package/dist/client/assets/{soy-CNkc-Oji.js → soy-D0GKXrtT.js} +1 -1
  67. package/dist/client/assets/{sql-BvRdqBMa.js → sql-BRW_ADkU.js} +1 -1
  68. package/dist/client/assets/{stata-Bawjgtiz.js → stata-w7w59F48.js} +1 -1
  69. package/dist/client/assets/{surrealql-7v7lT5jp.js → surrealql-O-lLuqz7.js} +1 -1
  70. package/dist/client/assets/{svelte-p7w_kluv.js → svelte-DN3DR5-t.js} +1 -1
  71. package/dist/client/assets/{templ-0Gi_yZZr.js → templ-CJ2JFoia.js} +1 -1
  72. package/dist/client/assets/{tex-nZ_J3lks.js → tex-CpWrf5g9.js} +1 -1
  73. package/dist/client/assets/{ts-tags-CuG-Aj5j.js → ts-tags-CZ6Af6Pe.js} +1 -1
  74. package/dist/client/assets/{tsx-Cc7GNb_V.js → tsx-gIUSpRih.js} +1 -1
  75. package/dist/client/assets/{twig-BBlmihVM.js → twig-DwZINhmw.js} +1 -1
  76. package/dist/client/assets/{typescript-aiXwsZhm.js → typescript-Dj2aMECR.js} +1 -1
  77. package/dist/client/assets/{vue-Cs5tk2kn.js → vue-B5K0aWrP.js} +1 -1
  78. package/dist/client/assets/{vue-html-BEI_B8Ml.js → vue-html-DKGgrypd.js} +1 -1
  79. package/dist/client/assets/{vue-vine-CpWdOkP4.js → vue-vine-B5iDYTCh.js} +1 -1
  80. package/dist/client/assets/{xml-madLQSkS.js → xml-CbTzxfc-.js} +1 -1
  81. package/dist/client/assets/{xsl-CqZR37V9.js → xsl-Dj-Be6nx.js} +1 -1
  82. package/dist/client/assets/{yaml-DHr9ndbK.js → yaml-rTK8uEjh.js} +1 -1
  83. package/dist/client/index.html +2 -5
  84. package/dist/mcp-CE77qfjx.mjs +254 -0
  85. package/dist/mcp-CFeE13n-.mjs +254 -0
  86. package/dist/mcp-DKlThflu.mjs +253 -0
  87. package/dist/mcp-SGCrfYGo.mjs +254 -0
  88. package/dist/server-lock-B4crz9-_.mjs +708 -0
  89. package/dist/server-lock-CAdqFSfl.mjs +691 -0
  90. package/dist/server-lock-DpCrvL-Z.mjs +714 -0
  91. package/dist/update-check-DJuFE9w6.mjs +128 -0
  92. package/dist/update-check-DSC02MWQ.mjs +129 -0
  93. package/dist/update-check-KL-2sGxE.mjs +129 -0
  94. package/package.json +12 -14
  95. package/dist/client/assets/index-CmfB2R-C.css +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-BABKYppC.js","assets/html-JOaQiIkL.js","assets/css-0v4o-iNQ.js","assets/javascript-CxBNAxR5.js","assets/angular-ts-CtXLuOQb.js","assets/scss-BZrs95TC.js","assets/apl-DOi69evI.js","assets/json-Byruj-EC.js","assets/xml-madLQSkS.js","assets/java-BqL_yaya.js","assets/astro-J8Em2tfW.js","assets/postcss-8kqfa9f0.js","assets/tsx-Cc7GNb_V.js","assets/typescript-aiXwsZhm.js","assets/blade-B_tOnqRD.js","assets/html-derivative-GyX6oYy3.js","assets/sql-BvRdqBMa.js","assets/bsl-Dx5tFn3i.js","assets/sdbl-Be_XWc3n.js","assets/cairo-wCCQTdA9.js","assets/python-CqTCsi7P.js","assets/cobol-Dj_rkgIY.js","assets/coffee-C6Vq4BFF.js","assets/cpp-Cno48fgF.js","assets/glsl-CqNPWp5Y.js","assets/c-C0tRZWSi.js","assets/regexp-DowFj0Xd.js","assets/crystal-C7tmDnU1.js","assets/shellscript-D9YVFS67.js","assets/edge-CvULxRem.js","assets/elixir-vRTauEw-.js","assets/elm-fLFTu1xn.js","assets/erb-CtItcikB.js","assets/ruby-C4cISY4u.js","assets/graphql-CF78KbfF.js","assets/jsx-CosY06uG.js","assets/haml-3Gbl257r.js","assets/lua-DWe0hUn1.js","assets/yaml-DHr9ndbK.js","assets/erlang-CtK0kQ6z.js","assets/markdown-CS4LI6sN.js","assets/fortran-fixed-form-DBM4e0_k.js","assets/fortran-free-form-BIQEK2Jw.js","assets/fsharp-CmzzGQLe.js","assets/gdresource-B_wbPqHd.js","assets/gdscript-B5JQPh_-.js","assets/gdshader-vVjJ_Qr8.js","assets/git-commit-1z4D6NzL.js","assets/diff-togOXQX6.js","assets/git-rebase-5MeRBXZD.js","assets/glimmer-js-B7yA-u8_.js","assets/glimmer-ts-B2g1OaHc.js","assets/hack-Dz8fQ8O9.js","assets/handlebars-5UZnh5L7.js","assets/http-t6uVAxgS.js","assets/hurl-OLQZpg0E.js","assets/csv-Dr8ri5Nd.js","assets/hxml-DC4KwKt2.js","assets/haxe-BRbuo5UO.js","assets/jinja-CuaK033Z.js","assets/jison-aL_w2vvo.js","assets/julia-u1y7fV63.js","assets/r-DBQ-dydl.js","assets/just-DS4T9P_K.js","assets/perl-xC9qc39I.js","assets/latex-C9c2IWW4.js","assets/tex-nZ_J3lks.js","assets/liquid-DcXQgkEV.js","assets/marko-CIW7o2up.js","assets/less-Dj0T9pWC.js","assets/mdc-DKjGzb4k.js","assets/nextflow-CApkvBGW.js","assets/nextflow-groovy-eDLuZ_oi.js","assets/nginx-CBXzDlkk.js","assets/nim-CBf_vdee.js","assets/php-n4vnn5oz.js","assets/pug-Db536lA_.js","assets/qml-CrATLnNN.js","assets/razor-C_wvK1iP.js","assets/csharp-kfNshAa7.js","assets/rst-rY4UPiwe.js","assets/cmake-CCpZLdLI.js","assets/sas-ui1PNNkD.js","assets/shaderlab-DXAhMdPo.js","assets/hlsl-C8Wes1nf.js","assets/shellsession-DK7LMzYg.js","assets/soy-CNkc-Oji.js","assets/sparql-BdcL8cbr.js","assets/turtle-Dpr8zLlw.js","assets/stata-Bawjgtiz.js","assets/surrealql-7v7lT5jp.js","assets/svelte-p7w_kluv.js","assets/templ-0Gi_yZZr.js","assets/go-toi-uWvg.js","assets/ts-tags-CuG-Aj5j.js","assets/twig-BBlmihVM.js","assets/vue-Cs5tk2kn.js","assets/vue-html-BEI_B8Ml.js","assets/vue-vine-CpWdOkP4.js","assets/stylus-tqAsmugv.js","assets/xsl-CqZR37V9.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-DsssUIMZ.js","assets/html-BcAjMlB7.js","assets/css-2NgE_uxz.js","assets/javascript-C-HnT3sE.js","assets/angular-ts-dTg-sJ77.js","assets/scss-D2i6rHB8.js","assets/apl-C1yUKbqz.js","assets/json-qUjlNuEJ.js","assets/xml-CbTzxfc-.js","assets/java-CFUlLvAA.js","assets/astro-BI07ha2y.js","assets/postcss-8kqfa9f0.js","assets/tsx-gIUSpRih.js","assets/typescript-Dj2aMECR.js","assets/blade-DkzUGffS.js","assets/html-derivative-DcEpOzdx.js","assets/sql-BRW_ADkU.js","assets/bsl-Dx5tFn3i.js","assets/sdbl-Be_XWc3n.js","assets/cairo-wCCQTdA9.js","assets/python-CqTCsi7P.js","assets/cobol-DRh7-jLi.js","assets/coffee-wR_ZAh9a.js","assets/cpp-OD_qyywn.js","assets/glsl-OY27QGY0.js","assets/c-KkuqqOvW.js","assets/regexp-BXVWi-t_.js","assets/crystal-E4ahAddE.js","assets/shellscript-D6Bxi40C.js","assets/edge-8mbscxxD.js","assets/elixir-CJv1b3Q6.js","assets/elm-DUPzqZ9H.js","assets/erb-ssvEF26z.js","assets/ruby-C-TuWES4.js","assets/graphql-CSWSqe6f.js","assets/jsx-KWeo60kf.js","assets/haml-CX94zV9m.js","assets/lua-IFRifurW.js","assets/yaml-rTK8uEjh.js","assets/erlang-CtK0kQ6z.js","assets/markdown-CS4LI6sN.js","assets/fortran-fixed-form-DBM4e0_k.js","assets/fortran-free-form-BIQEK2Jw.js","assets/fsharp-CmzzGQLe.js","assets/gdresource-B_wbPqHd.js","assets/gdscript-B5JQPh_-.js","assets/gdshader-vVjJ_Qr8.js","assets/git-commit-1z4D6NzL.js","assets/diff-togOXQX6.js","assets/git-rebase-DiWIK1Oa.js","assets/glimmer-js-DrHg6AuA.js","assets/glimmer-ts-wQSGOa8A.js","assets/hack-Bi1v624Q.js","assets/handlebars-C1j6wnjG.js","assets/http-BBxxSc6S.js","assets/hurl-CpKRNTz4.js","assets/csv-Dr8ri5Nd.js","assets/hxml-DC4KwKt2.js","assets/haxe-BRbuo5UO.js","assets/jinja-CPU8RwNP.js","assets/jison-CW0TBQOs.js","assets/julia-CnJB8y2e.js","assets/r-CPWmgzo3.js","assets/just-Do22d9PP.js","assets/perl-C4ixqSNT.js","assets/latex-CCPgzvKn.js","assets/tex-CpWrf5g9.js","assets/liquid-B9btdZoI.js","assets/marko-CCaVBFq1.js","assets/less-Dj0T9pWC.js","assets/mdc-BtbnOLUc.js","assets/nextflow-CApkvBGW.js","assets/nextflow-groovy-eDLuZ_oi.js","assets/nginx-BkbFZHVt.js","assets/nim-2uCd5j65.js","assets/php-DJ8WOtcI.js","assets/pug-BOaafhT5.js","assets/qml-CURE-1y4.js","assets/razor-DH83VP_d.js","assets/csharp-kfNshAa7.js","assets/rst-Bbxxs6E2.js","assets/cmake-CCpZLdLI.js","assets/sas-njzNYNOq.js","assets/shaderlab-DXAhMdPo.js","assets/hlsl-C8Wes1nf.js","assets/shellsession-Defxq-I6.js","assets/soy-D0GKXrtT.js","assets/sparql-BdcL8cbr.js","assets/turtle-Dpr8zLlw.js","assets/stata-w7w59F48.js","assets/surrealql-O-lLuqz7.js","assets/svelte-DN3DR5-t.js","assets/templ-CJ2JFoia.js","assets/go-toi-uWvg.js","assets/ts-tags-CZ6Af6Pe.js","assets/twig-DwZINhmw.js","assets/vue-B5K0aWrP.js","assets/vue-html-DKGgrypd.js","assets/vue-vine-B5iDYTCh.js","assets/stylus-tqAsmugv.js","assets/xsl-Dj-Be6nx.js"])))=>i.map(i=>d[i]);
2
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),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,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),d=o(((e,t)=>{t.exports=u()})),f=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.4`})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=p();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.4`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=d(),n=p(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function P(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?P(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return P(e(t))}catch{}}return null}var F=Array.isArray,I=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R={pending:!1,data:null,method:null,action:null},z=[],ee=-1;function te(e){return{current:e}}function B(e){0>ee||(e.current=z[ee],z[ee]=null,ee--)}function V(e,t){ee++,z[ee]=e.current,e.current=t}var H=te(null),ne=te(null),re=te(null),ie=te(null);function ae(e,t){switch(V(re,t),V(ne,e),V(H,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Kd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Kd(t),e=qd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}B(H),V(H,e)}function oe(){B(H),B(ne),B(re)}function se(e){e.memoizedState!==null&&V(ie,e);var t=H.current,n=qd(t,e.type);t!==n&&(V(ne,e),V(H,n))}function ce(e){ne.current===e&&(B(H),B(ne)),ie.current===e&&(B(ie),rp._currentValue=R)}var le,ue;function U(e){if(le===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);le=t&&t[1]||``,ue=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+le+e+ue}var de=!1;function fe(e,t){if(!e||de)return``;de=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
@@ -18,7 +18,7 @@ Error generating stack: `+e.message+`
18
18
  \f\r "&'<=>\``.split(``)],[`\0
19
19
  \f\r "&'<=>\``.split(``),`\0
20
20
  \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function Do(e,t,n,r){let i=r.schema,a=i.space===`svg`?!1:r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=ha);let l=Oo(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!bo(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!ro(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Oo(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=ko(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function ko(e,t,n){let r=da(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=e.settings.allowDangerousCharacters?0:1,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=za(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Eo.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Ka:qa)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=za(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Eo.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&Ga(n,o)>Ga(n,e.alternative)&&(o=e.alternative),s=o+za(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Eo.single:Eo.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var Ao=[`<`,`&`];function jo(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:za(e.value,Object.assign({},r.settings.characterReferences,{subset:Ao}))}function Mo(e,t,n,r){return r.settings.allowDangerousHtml?e.value:jo(e,t,n,r)}function No(e,t,n,r){return r.all(e)}var Po=_a(`type`,{invalid:Fo,unknown:Io,handlers:{comment:Ua,doctype:Wa,element:Do,raw:Mo,root:No,text:jo}});function Fo(e){throw Error("Expected node, not `"+e+"`")}function Io(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Lo={},Ro={},zo=[];function Bo(e,t){let n=t||Lo,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Vo,all:Ho,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Ii,characterReferences:n.characterReferences||Ro,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?ha:ma,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function Vo(e,t,n){return Po(e,t,n,this)}function Ho(e){let t=[],n=e&&e.children||zo,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}function Uo(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 Wo(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Go(e){return Array.isArray(e)?e:[e]}async function Ko(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function qo(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function Jo(e){return e===`ansi`||qo(e)}function Yo(e){return e===`none`}function Xo(e){return Yo(e)}function Zo(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(/\s+/g);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function Qo(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(/(\r?\n)/g),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}function $o(e){let t=Qo(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t[t.length-1].length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function es(e,t,n){let r=new Set;for(let t of e.matchAll(/:?lang=["']([^"']+)["']/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/(?:```|~~~)([\w-]+)/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/\\begin\{([\w-]+)\}/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(!n)return Array.from(r);let i=n.getBundledLanguages();return Array.from(r).filter(e=>e&&i[e])}var ts=`light-dark()`,ns=[`color`,`background-color`];function rs(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function is(e,t){let n=Array.from(t instanceof Set?t:new Set(t)).sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?rs(e,t):e})):e}function as(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>os(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&ns.includes(a))if(r===ts&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new Qn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');c[a]=`light-dark(${o[e][a]||`inherit`}, ${o[r][a]||`inherit`})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s;else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function os(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&yr.Italic&&(t[`font-style`]=`italic`),e.fontStyle&yr.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&yr.Underline&&n.push(`underline`),e.fontStyle&yr.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function ss(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}var cs=new WeakMap;function ls(e,t){cs.set(e,t)}function us(e){return cs.get(e)}var ds=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(Go(n).map(e=>[e,Fi])),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 fs(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function fs(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 ps(e,t){if(!(e instanceof ds))throw new Qn(`Invalid grammar state`);return e.getInternalStack(t)}function ms(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=function(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new Qn(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...r.indexToPos(e),offset:e}}else{let t=r.lines[e.line];if(t===void 0)throw new Qn(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${r.lines.length}`);let n=e.character;if(n<0&&(n=t.length+n),n<0||n>t.length)throw new Qn(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:n,offset:r.posToIndex(e.line,n)}}},r=$o(t.source),i=(t.options.decorations||[]).map(e=>({...e,start:n(e.start),end:n(e.end)}));hs(i),e.set(t.meta,{decorations:i,converter:r,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return is(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=Array.from(e.children).filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new Qn(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=gs(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new Qn(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new Qn(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&Zo(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function hs(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new Qn(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new Qn(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function gs(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(gs).join(``):``}var _s=[ms()];function vs(e){let t=ys(e.transformers||[]);return[...t.pre,...t.normal,...t.post,..._s]}function ys(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var bs=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],xs={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function Ss(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function Cs(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}else if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function ws(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:`resetAll`});else if(r<=9)xs[r]&&t.push({type:`setDecoration`,value:xs[r]});else if(r<=29){let e=xs[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:bs[r-30]}});else if(r===38){let n=Cs(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:bs[r-40]}});else if(r===48){let n=Cs(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:bs[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:bs[r-100+8]}})}return t}function Ts(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=Ss(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=ws(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var Es={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function Ds(e=Es){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<bs.length;e++)r.push(t(bs[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var Os={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function ks(e,t,n){let r=Uo(e,n),i=Qo(t),a=Ds(Object.fromEntries(bs.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Os[t]]}))),o=Ts();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=Wo(i,r),o=Wo(o,r),n.decorations.has(`dim`)&&(i=As(i));let s=yr.None;return n.decorations.has(`bold`)&&(s|=yr.Bold),n.decorations.has(`italic`)&&(s|=yr.Italic),n.decorations.has(`underline`)&&(s|=yr.Underline),n.decorations.has(`strikethrough`)&&(s|=yr.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function As(e){let t=e.match(/#([0-9a-f]{3,8})/i);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}else if(e.length===6)return`#${e}80`;else if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}else if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function js(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n,i=e.resolveLangAlias(n.lang||`text`);if(qo(i)||Yo(r))return Qo(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:a,colorMap:o}=e.setTheme(r);if(i===`ansi`)return ks(a,t,n);let s=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==s.name)throw new Qn(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${s.name}"`);if(!n.grammarState.themes.includes(a.name))throw new Qn(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return Ns(t,s,a,o,n)}function Ms(...e){if(e.length===2)return us(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(qo(i)||Yo(a))throw new Qn(`Plain language does not have grammar state`);if(i===`ansi`)throw new Qn(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new ds(Ps(n,c,o,s,r).stateStack,c.name,o.name)}function Ns(e,t,n,r,i){let a=Ps(e,t,n,r,i),o=new ds(a.stateStack,t.name,n.name);return ls(a.tokens,o),a.tokens}function Ps(e,t,n,r,i){let a=Uo(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500}=i,c=Qo(e),l=i.grammarState?ps(i.grammarState,n.name)??Fi:i.grammarContextCode==null?Fi:Ps(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,u=[],d=[];for(let e=0,f=c.length;e<f;e++){let[f,p]=c[e];if(f===``){u=[],d.push([]);continue}if(o>0&&f.length>=o){u=[],d.push([{content:f,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;i.includeExplanation&&(m=t.tokenizeLine(f,l,s),h=m.tokens,g=0);let _=t.tokenizeLine2(f,l,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:f.length;if(t===o)continue;let s=_.tokens[2*e+1],c=Wo(r[Tr.getForeground(s)],a),l=Tr.getFontStyle(s),d={content:f.substring(t,o),offset:p+t,color:c,fontStyle:l};if(i.includeExplanation){let e=[];if(i.includeExplanation!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(/,/).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(/ /))})}d.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=f.substring(t.startIndex,t.endIndex);r+=n.length,d.explanation.push({content:n,scopes:i.includeExplanation===`scopeName`?Fs(t.scopes):Is(e,t.scopes)}),g+=1}}u.push(d)}d.push(u),u=[],l=_.ruleStack}return{tokens:d,stateStack:l}}function Fs(e){return e.map(e=>({scopeName:e}))}function Is(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:zs(e,i,t.slice(0,r))}}return n}function Ls(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function Rs(e,t,n){if(!Ls(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Ls(e[r],n[i])&&--r,--i;return r===-1}function zs(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(Rs(e,t,n)){r.push(a);break}return r}function Bs(e,t,n){let r=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),i=r.map(r=>{let i=js(e,t,{...n,theme:r.theme});return{tokens:i,state:us(i),theme:typeof r.theme==`string`?r.theme:r.theme.name}}),a=Vs(...i.map(e=>e.tokens)),o=a[0].map((e,t)=>e.map((e,i)=>{let o={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(o.explanation=e.explanation),a.forEach((e,n)=>{let{content:a,explanation:s,offset:c,...l}=e[t][i];o.variants[r[n].color]=l}),o})),s=i[0].state?new ds(Object.fromEntries(i.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),i[0].state.lang):void 0;return s&&ls(o,s),o}function Vs(...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}function Hs(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:t.color===l?1:0);if(f.length===0)throw new Qn("`themes` option must not be empty");let p=Bs(e,t,n);if(c=us(p),l&&ts!==l&&!f.find(e=>e.color===l))throw new Qn(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>as(e,h,u,l,d))),c&&ls(a,c);let g=f.map(e=>Uo(e.theme,n));i=Us(f,m,g,u,l,`fg`,d),r=Us(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=Uo(n.theme,n);a=js(e,t,n);let l=e.getTheme(n.theme);r=Wo(l.bg,s),i=Wo(l.fg,s),o=l.name,c=us(a)}else throw new Qn("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function Us(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=Wo(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===ts&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new Qn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${Wo(t[r][a],n[r])||`inherit`}, ${Wo(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}function Ws(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>Ws(e,t,n),codeToTokens:(t,n)=>Hs(e,t,n)}){let i=t;for(let e of vs(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=Hs(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=Ks(a):d===`never`&&(a=qs(a)),f&&(a=Js(a));let p={...r,get source(){return i}};for(let e of vs(n))a=e.tokens?.call(p,a)||a;return Gs(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function Gs(e,t,n,r=us(e)){let i=vs(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(t.rootStyle==null?l.style=`background-color:${t.bg};color:${t.fg}`:l.style=t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:Zo,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
21
- `}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=ss(a.htmlStyle||os(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&ls(m,r),m}function Ks(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&yr.Underline||i.fontStyle&yr.Strikethrough));o&&i.content.match(/^\s+$/)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function qs(e){return e.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;let t=e.content.match(/^(\s*)(.*?)(\s*)$/);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function Js(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t[t.length-1],r=ss(e.htmlStyle||os(e)),i=ss(n.htmlStyle||os(n)),a=e.fontStyle&&(e.fontStyle&yr.Underline||e.fontStyle&yr.Strikethrough),o=n.fontStyle&&(n.fontStyle&yr.Underline||n.fontStyle&yr.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Ys=Bo;function Xs(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>Ws(e,t,n),codeToTokens:(t,n)=>Hs(e,t,n)},i=Ys(Ws(e,t,n,r));for(let e of vs(n))i=e.postprocess?.call(r,i,n)||i;return i}var Zs={light:`#333333`,dark:`#bbbbbb`},Qs={light:`#fffffe`,dark:`#1e1e1e`},$s=`__shiki_resolved`;function ec(e){if(e?.[$s])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`?Zs.light:Zs.dark,n||=t.type===`light`?Qs.light:Qs.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,$s,{enumerable:!1,writable:!1,value:!0}),t}async function tc(e){return Array.from(new Set((await Promise.all(e.filter(e=>!Jo(e)).map(async e=>await Ko(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function nc(e){return(await Promise.all(e.map(async e=>Xo(e)?null:ec(await Ko(e))))).filter(e=>!!e)}var rc=3,ic=!1;function ac(e,t=3){if(rc&&!(typeof rc==`number`&&t>rc)){if(ic)throw Error(`[SHIKI DEPRECATE]: ${e}`);console.trace(`[SHIKI DEPRECATE]: ${e}`)}}var oc=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function sc(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 oc(`Circular alias \`${Array.from(n).join(` -> `)} -> ${e}\``);n.add(e)}}return e}var cc=class extends Pi{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)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=ec(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=fr.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=sc(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=Array.from(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 oc(`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))}},lc=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}},uc=0;function dc(e){uc+=1,e.warnings!==!1&&uc>=10&&uc%10==0&&console.warn(`[Shiki] ${uc} 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 oc("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(ec),i=new cc(new lc(e.engine,n),r,n,e.langAlias),a;function o(t){return sc(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new oc(`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 oc(`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 tc(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await nc(e))}function g(){if(t)throw new oc(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--uc)}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 fc(e){e.engine||ac("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([nc(e.themes||[]),tc(e.langs||[]),e.engine]);return dc({...e,themes:t,langs:n,engine:r})}async function pc(e){let t=await fc(e);return{getLastGrammarState:(...e)=>Ms(t,...e),codeToTokensBase:(e,n)=>js(t,e,n),codeToTokensWithThemes:(e,n)=>Bs(t,e,n),codeToTokens:(e,n)=>Hs(t,e,n),codeToHast:(e,n)=>Ws(t,e,n),codeToHtml:(e,n)=>Xs(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function mc(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,Jo(n))return[];let r=t[n];if(!r)throw new Qn(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(Xo(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new Qn(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await pc({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function hc(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}else{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function gc(e,t){let n=hc(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var _c=`modulepreload`,vc=function(e){return`/`+e},yc={},J=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}))))}r=o(t.map(t=>{if(t=vc(t,n),t in yc)return;yc[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:_c,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.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)})},bc=[{id:`abap`,name:`ABAP`,import:(()=>J(()=>import(`./abap-CkQ0tsz-.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,import:(()=>J(()=>import(`./actionscript-3-DHm0ZfF4.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>J(()=>import(`./ada-DK_ua92Z.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>J(()=>import(`./angular-html-BABKYppC.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>J(()=>import(`./angular-ts-CtXLuOQb.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>J(()=>import(`./apache-DXtpFu7o.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>J(()=>import(`./apex-DlnRRWpl.js`),[]))},{id:`apl`,name:`APL`,import:(()=>J(()=>import(`./apl-DOi69evI.js`),__vite__mapDeps([6,2,1,3,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>J(()=>import(`./applescript-CShk62ad.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>J(()=>import(`./ara-CWN-FDkm.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>J(()=>import(`./asciidoc-Bg-PM9Vn.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>J(()=>import(`./asm-DKOhR24S.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>J(()=>import(`./astro-J8Em2tfW.js`),__vite__mapDeps([10,2,3,7,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>J(()=>import(`./awk-3ibKHffv.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>J(()=>import(`./ballerina-xx7VNGxs.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`],import:(()=>J(()=>import(`./bat-DGYsZ5wR.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>J(()=>import(`./beancount-D_ATR1UV.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>J(()=>import(`./berry-BqYMORfH.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>J(()=>import(`./bibtex-CQTBDajW.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>J(()=>import(`./bicep-CfNtxPrK.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>J(()=>import(`./bird2-C0dUPe3I.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>J(()=>import(`./blade-B_tOnqRD.js`),__vite__mapDeps([14,2,15,1,3,7,16,8,9])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>J(()=>import(`./bsl-Dx5tFn3i.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>J(()=>import(`./c-C0tRZWSi.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>J(()=>import(`./c3-BUwZ5e3k.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>J(()=>import(`./cadence-C3OKDYrr.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>J(()=>import(`./cairo-wCCQTdA9.js`),__vite__mapDeps([19,20])))},{id:`clarity`,name:`Clarity`,import:(()=>J(()=>import(`./clarity-Crxe8gSr.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>J(()=>import(`./clojure-BuzOUPMr.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>J(()=>import(`./cmake-CCpZLdLI.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>J(()=>import(`./cobol-Dj_rkgIY.js`),__vite__mapDeps([21,1,2,3,9])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>J(()=>import(`./codeowners-Bo1VYpHz.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>J(()=>import(`./codeql-Db01hzHE.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>J(()=>import(`./coffee-C6Vq4BFF.js`),__vite__mapDeps([22,3])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>J(()=>import(`./common-lisp-CMlJIc6Y.js`),[]))},{id:`coq`,name:`Coq`,import:(()=>J(()=>import(`./coq-BlzBYp3f.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>J(()=>import(`./cpp-Cno48fgF.js`).then(e=>e.n),__vite__mapDeps([23,24,25,26,16])))},{id:`crystal`,name:`Crystal`,import:(()=>J(()=>import(`./crystal-C7tmDnU1.js`),__vite__mapDeps([27,25,2,1,3,28,16])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>J(()=>import(`./csharp-kfNshAa7.js`),[]))},{id:`css`,name:`CSS`,import:(()=>J(()=>import(`./css-0v4o-iNQ.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>J(()=>import(`./csv-Dr8ri5Nd.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>J(()=>import(`./cue-jXfhyOwY.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>J(()=>import(`./cypher-CayLeiaR.js`),[]))},{id:`d`,name:`D`,import:(()=>J(()=>import(`./d-BMZQ0mAy.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>J(()=>import(`./dart-gMOEMyuz.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>J(()=>import(`./dax-C3t5LadU.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>J(()=>import(`./desktop-DmhXLwLR.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>J(()=>import(`./diff-togOXQX6.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>J(()=>import(`./docker--6N01olR.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>J(()=>import(`./dotenv-Bq930Yx8.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>J(()=>import(`./dream-maker-BiMf3DHl.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>J(()=>import(`./edge-CvULxRem.js`),__vite__mapDeps([29,15,1,2,3,13])))},{id:`elixir`,name:`Elixir`,import:(()=>J(()=>import(`./elixir-vRTauEw-.js`),__vite__mapDeps([30,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>J(()=>import(`./elm-fLFTu1xn.js`),__vite__mapDeps([31,24,25])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>J(()=>import(`./emacs-lisp-Dhht7he2.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>J(()=>import(`./erb-CtItcikB.js`),__vite__mapDeps([32,1,2,3,33,25,23,24,26,16,34,35,12,13,36,37,28,8,9,38])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>J(()=>import(`./erlang-CtK0kQ6z.js`),__vite__mapDeps([39,40])))},{id:`fennel`,name:`Fennel`,import:(()=>J(()=>import(`./fennel-BExc9TZf.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>J(()=>import(`./fish-C2p-AJmZ.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>J(()=>import(`./fluent-CeYzs8Qy.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>J(()=>import(`./fortran-fixed-form-DBM4e0_k.js`),__vite__mapDeps([41,42])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>J(()=>import(`./fortran-free-form-BIQEK2Jw.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>J(()=>import(`./fsharp-CmzzGQLe.js`),__vite__mapDeps([43,40])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>J(()=>import(`./gdresource-B_wbPqHd.js`),__vite__mapDeps([44,45,46])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>J(()=>import(`./gdscript-B5JQPh_-.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>J(()=>import(`./gdshader-vVjJ_Qr8.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>J(()=>import(`./genie-DGl5rqC8.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>J(()=>import(`./gherkin-CY_VLUnD.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>J(()=>import(`./git-commit-1z4D6NzL.js`),__vite__mapDeps([47,48])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>J(()=>import(`./git-rebase-5MeRBXZD.js`),__vite__mapDeps([49,28])))},{id:`gleam`,name:`Gleam`,import:(()=>J(()=>import(`./gleam-BarIG9kQ.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>J(()=>import(`./glimmer-js-B7yA-u8_.js`),__vite__mapDeps([50,2,1,3,13])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>J(()=>import(`./glimmer-ts-B2g1OaHc.js`),__vite__mapDeps([51,2,1,3,13])))},{id:`glsl`,name:`GLSL`,import:(()=>J(()=>import(`./glsl-CqNPWp5Y.js`).then(e=>e.n),__vite__mapDeps([24,25])))},{id:`gn`,name:`GN`,import:(()=>J(()=>import(`./gn-DhYsTPYc.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>J(()=>import(`./gnuplot-CucLlTBc.js`),[]))},{id:`go`,name:`Go`,import:(()=>J(()=>import(`./go-toi-uWvg.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>J(()=>import(`./graphql-CF78KbfF.js`).then(e=>e.n),__vite__mapDeps([34,3,35,12,13])))},{id:`groovy`,name:`Groovy`,import:(()=>J(()=>import(`./groovy-Ds4dis_k.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>J(()=>import(`./hack-Dz8fQ8O9.js`),__vite__mapDeps([52,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>J(()=>import(`./haml-3Gbl257r.js`).then(e=>e.n),__vite__mapDeps([36,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>J(()=>import(`./handlebars-5UZnh5L7.js`),__vite__mapDeps([53,2,1,3,38])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>J(()=>import(`./haskell-B_jvz5Po.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>J(()=>import(`./haxe-BRbuo5UO.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>J(()=>import(`./hcl-BzNUCtsK.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>J(()=>import(`./hjson-BxVo3sS2.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>J(()=>import(`./hlsl-C8Wes1nf.js`),[]))},{id:`html`,name:`HTML`,import:(()=>J(()=>import(`./html-JOaQiIkL.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>J(()=>import(`./html-derivative-GyX6oYy3.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>J(()=>import(`./http-t6uVAxgS.js`),__vite__mapDeps([54,34,3,35,12,13,7,28,8,9])))},{id:`hurl`,name:`Hurl`,import:(()=>J(()=>import(`./hurl-OLQZpg0E.js`),__vite__mapDeps([55,56,34,3,35,12,13,8,9])))},{id:`hxml`,name:`HXML`,import:(()=>J(()=>import(`./hxml-DC4KwKt2.js`),__vite__mapDeps([57,58])))},{id:`hy`,name:`Hy`,import:(()=>J(()=>import(`./hy-dMrJKKU_.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>J(()=>import(`./imba-DG_oO8tg.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>J(()=>import(`./ini-geHw79Aj.js`),[]))},{id:`java`,name:`Java`,import:(()=>J(()=>import(`./java-BqL_yaya.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>J(()=>import(`./javascript-CxBNAxR5.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>J(()=>import(`./jinja-CuaK033Z.js`),__vite__mapDeps([59,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>J(()=>import(`./jison-aL_w2vvo.js`),__vite__mapDeps([60,3])))},{id:`json`,name:`JSON`,import:(()=>J(()=>import(`./json-Byruj-EC.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>J(()=>import(`./json5-CDUsNqz6.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>J(()=>import(`./jsonc-D48xcwyD.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>J(()=>import(`./jsonl-cpIYDXEe.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>J(()=>import(`./jsonnet-Da1lhszN.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>J(()=>import(`./jssm-B8BLrEGL.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>J(()=>import(`./jsx-CosY06uG.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>J(()=>import(`./julia-u1y7fV63.js`),__vite__mapDeps([61,23,24,25,26,16,3,20,62])))},{id:`just`,name:`Just`,import:(()=>J(()=>import(`./just-DS4T9P_K.js`),__vite__mapDeps([63,3,64,2,1,16,8,9,20,33,25,23,24,26,34,35,12,13,36,37,28,38])))},{id:`kdl`,name:`KDL`,import:(()=>J(()=>import(`./kdl-B-2tSRmp.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>J(()=>import(`./kotlin-DepsEzh3.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>J(()=>import(`./kusto-BcCtXIb8.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>J(()=>import(`./latex-C9c2IWW4.js`),__vite__mapDeps([65,66,62])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>J(()=>import(`./lean-CNO9ffpX.js`),[]))},{id:`less`,name:`Less`,import:(()=>J(()=>import(`./less-Dj0T9pWC.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>J(()=>import(`./liquid-DcXQgkEV.js`),__vite__mapDeps([67,2,1,3,7])))},{id:`llvm`,name:`LLVM IR`,import:(()=>J(()=>import(`./llvm-DbV9b66l.js`),[]))},{id:`log`,name:`Log file`,import:(()=>J(()=>import(`./log-BMblmPyH.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>J(()=>import(`./logo-B78qMxws.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>J(()=>import(`./lua-DWe0hUn1.js`).then(e=>e.n),__vite__mapDeps([37,25])))},{id:`luau`,name:`Luau`,import:(()=>J(()=>import(`./luau-BUd8xsdE.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>J(()=>import(`./make-Ev-6cJrd.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>J(()=>import(`./markdown-CS4LI6sN.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>J(()=>import(`./marko-CIW7o2up.js`),__vite__mapDeps([68,2,69,5,13])))},{id:`matlab`,name:`MATLAB`,import:(()=>J(()=>import(`./matlab-C0qEtAx9.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>J(()=>import(`./mdc-DKjGzb4k.js`),__vite__mapDeps([70,15,1,2,3,40,38])))},{id:`mdx`,name:`MDX`,import:(()=>J(()=>import(`./mdx-CzvnbLXb.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>J(()=>import(`./mermaid-BPquZaKt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>J(()=>import(`./mipsasm-k5DQoS6j.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>J(()=>import(`./mojo-sTTDuNnR.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>J(()=>import(`./moonbit-j5ChFtBC.js`),[]))},{id:`move`,name:`Move`,import:(()=>J(()=>import(`./move-Dj0Gmn6R.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>J(()=>import(`./narrat-DJgMz2oW.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>J(()=>import(`./nextflow-CApkvBGW.js`),__vite__mapDeps([71,72])))},{id:`nextflow-groovy`,name:`nextflow-groovy`,import:(()=>J(()=>import(`./nextflow-groovy-eDLuZ_oi.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>J(()=>import(`./nginx-CBXzDlkk.js`),__vite__mapDeps([73,37,25])))},{id:`nim`,name:`Nim`,import:(()=>J(()=>import(`./nim-CBf_vdee.js`),__vite__mapDeps([74,25,2,24,1,3,40,8,9])))},{id:`nix`,name:`Nix`,import:(()=>J(()=>import(`./nix-CxIPS3pb.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>J(()=>import(`./nushell-GDfBmoBU.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>J(()=>import(`./objective-c-MFQ_MGUa.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>J(()=>import(`./objective-cpp-Y83LcBE7.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>J(()=>import(`./ocaml-FxYfaJxu.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>J(()=>import(`./odin-CprihY3z.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>J(()=>import(`./openscad-Bc1FbpOi.js`),[]))},{id:`pascal`,name:`Pascal`,import:(()=>J(()=>import(`./pascal-Bb4d8cUL.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>J(()=>import(`./perl-xC9qc39I.js`),__vite__mapDeps([64,2,1,3,16,8,9])))},{id:`php`,name:`PHP`,import:(()=>J(()=>import(`./php-n4vnn5oz.js`),__vite__mapDeps([75,2,1,3,7,16,8,9])))},{id:`pkl`,name:`Pkl`,import:(()=>J(()=>import(`./pkl-tM25Sq0w.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>J(()=>import(`./plsql-CLEfFhSj.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>J(()=>import(`./po-CaAzdrrh.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>J(()=>import(`./polar-TG7aTGdK.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>J(()=>import(`./postcss-8kqfa9f0.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>J(()=>import(`./powerquery-CtSu1Nfd.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`],import:(()=>J(()=>import(`./powershell-87lLBHMy.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>J(()=>import(`./prisma-Dnf694DZ.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>J(()=>import(`./prolog-C0XbHTWa.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>J(()=>import(`./proto-BZP-HLIb.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>J(()=>import(`./pug-Db536lA_.js`),__vite__mapDeps([76,2,1,3])))},{id:`puppet`,name:`Puppet`,import:(()=>J(()=>import(`./puppet-CJYWgYC5.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>J(()=>import(`./purescript-B95Q6BAd.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>J(()=>import(`./python-CqTCsi7P.js`),[]))},{id:`qml`,name:`QML`,import:(()=>J(()=>import(`./qml-CrATLnNN.js`),__vite__mapDeps([77,3])))},{id:`qmldir`,name:`QML Directory`,import:(()=>J(()=>import(`./qmldir-DlIL4hls.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>J(()=>import(`./qss-BW72E0q_.js`),[]))},{id:`r`,name:`R`,import:(()=>J(()=>import(`./r-DBQ-dydl.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>J(()=>import(`./racket-CCAimEsC.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>J(()=>import(`./raku-mSuqElkM.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>J(()=>import(`./razor-C_wvK1iP.js`),__vite__mapDeps([78,79,1,2,3])))},{id:`reg`,name:`Windows Registry Script`,import:(()=>J(()=>import(`./reg-CGwMBJ2c.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>J(()=>import(`./regexp-DowFj0Xd.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>J(()=>import(`./rel-JwrbYgX4.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>J(()=>import(`./riscv-CoYyE75b.js`),[]))},{id:`ron`,name:`RON`,import:(()=>J(()=>import(`./ron-C5wrhnmJ.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>J(()=>import(`./rosmsg-DlimTR9t.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>J(()=>import(`./rst-rY4UPiwe.js`),__vite__mapDeps([80,81,23,24,25,26,16,15,1,2,3,20,33,34,35,12,13,36,37,28,8,9,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>J(()=>import(`./ruby-C4cISY4u.js`),__vite__mapDeps([33,25,23,24,26,16,2,34,3,35,12,13,36,1,37,28,8,9,38])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>J(()=>import(`./rust-Cxnkxx3h.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>J(()=>import(`./sas-ui1PNNkD.js`),__vite__mapDeps([82,16])))},{id:`sass`,name:`Sass`,import:(()=>J(()=>import(`./sass-DEyqUIpU.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>J(()=>import(`./scala-i3RN3yAN.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>J(()=>import(`./scheme-BcKdjYkO.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>J(()=>import(`./scss-BZrs95TC.js`).then(e=>e.n),__vite__mapDeps([5,2])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>J(()=>import(`./sdbl-Be_XWc3n.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>J(()=>import(`./shaderlab-DXAhMdPo.js`),__vite__mapDeps([83,84])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>J(()=>import(`./shellscript-D9YVFS67.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>J(()=>import(`./shellsession-DK7LMzYg.js`),__vite__mapDeps([85,28])))},{id:`smalltalk`,name:`Smalltalk`,import:(()=>J(()=>import(`./smalltalk-BdBlL6ks.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>J(()=>import(`./solidity-DH-yUSWc.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>J(()=>import(`./soy-CNkc-Oji.js`),__vite__mapDeps([86,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>J(()=>import(`./sparql-BdcL8cbr.js`),__vite__mapDeps([87,88])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>J(()=>import(`./splunk-CIjc4kxs.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>J(()=>import(`./sql-BvRdqBMa.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>J(()=>import(`./ssh-config-BKVd4drG.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>J(()=>import(`./stata-Bawjgtiz.js`),__vite__mapDeps([89,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>J(()=>import(`./stylus-tqAsmugv.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>J(()=>import(`./surrealql-7v7lT5jp.js`),__vite__mapDeps([90,3])))},{id:`svelte`,name:`Svelte`,import:(()=>J(()=>import(`./svelte-p7w_kluv.js`),__vite__mapDeps([91,2,3,11,13])))},{id:`swift`,name:`Swift`,import:(()=>J(()=>import(`./swift-CdDBQ3_Z.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>J(()=>import(`./system-verilog-CBqEY-9v.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>J(()=>import(`./systemd-khRP5zwK.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>J(()=>import(`./talonscript-D_lneH-6.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>J(()=>import(`./tasl-CLymawGe.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>J(()=>import(`./tcl-BRY1S87U.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>J(()=>import(`./templ-0Gi_yZZr.js`),__vite__mapDeps([92,2,93,3])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>J(()=>import(`./terraform-BqohMo2f.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>J(()=>import(`./tex-nZ_J3lks.js`),__vite__mapDeps([66,62])))},{id:`toml`,name:`TOML`,import:(()=>J(()=>import(`./toml-C4c85Lwg.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>J(()=>import(`./ts-tags-CuG-Aj5j.js`),__vite__mapDeps([94,2,24,25,1,3,16,13,8,9])))},{id:`tsv`,name:`TSV`,import:(()=>J(()=>import(`./tsv-DsZq9HBQ.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>J(()=>import(`./tsx-Cc7GNb_V.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>J(()=>import(`./turtle-Dpr8zLlw.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>J(()=>import(`./twig-BBlmihVM.js`),__vite__mapDeps([95,2,3,75,1,7,16,8,9,20,33,25,23,24,26,34,35,12,13,36,37,28,38,5])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>J(()=>import(`./typescript-aiXwsZhm.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>J(()=>import(`./typespec-DcqgATB-.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>J(()=>import(`./typst-CeVxmuPg.js`),[]))},{id:`v`,name:`V`,import:(()=>J(()=>import(`./v-C2Qsh2-1.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>J(()=>import(`./vala-CvZ3yL7c.js`),[]))},{id:`vb`,name:`Visual Basic`,aliases:[`cmd`],import:(()=>J(()=>import(`./vb-B_p4qDw4.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>J(()=>import(`./verilog-D8MGjxD7.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>J(()=>import(`./vhdl-MLyYh_Gz.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>J(()=>import(`./viml-BuYIArcz.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>J(()=>import(`./vue-Cs5tk2kn.js`),__vite__mapDeps([96,2,15,1,3,7,13])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>J(()=>import(`./vue-html-BEI_B8Ml.js`),__vite__mapDeps([97,3])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>J(()=>import(`./vue-vine-CpWdOkP4.js`),__vite__mapDeps([98,2,3,69,11,5,99])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>J(()=>import(`./vyper-CNqG09-_.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>J(()=>import(`./wasm-BsQDV7Y0.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>J(()=>import(`./wenyan-BmOQge13.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>J(()=>import(`./wgsl-CgWrmvIg.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>J(()=>import(`./wikitext-DkwckXCk.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>J(()=>import(`./wit-CtyVFGe7.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>J(()=>import(`./wolfram-CXE4FrKz.js`),[]))},{id:`xml`,name:`XML`,import:(()=>J(()=>import(`./xml-madLQSkS.js`).then(e=>e.n),__vite__mapDeps([8,9])))},{id:`xsl`,name:`XSL`,import:(()=>J(()=>import(`./xsl-CqZR37V9.js`),__vite__mapDeps([100,8,9])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>J(()=>import(`./yaml-DHr9ndbK.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>J(()=>import(`./zenscript-DH15wJt0.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>J(()=>import(`./zig-CqXN9brD.js`),[]))}],xc=Object.fromEntries(bc.map(e=>[e.id,e.import])),Sc=Object.fromEntries(bc.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Cc={...xc,...Sc},wc=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>J(()=>import(`./andromeeda-D2ccw8v4.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>J(()=>import(`./aurora-x-DpaEirL8.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>J(()=>import(`./ayu-dark-ursiSH5k.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>J(()=>import(`./ayu-light-DMjlrKmx.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>J(()=>import(`./ayu-mirage-DZEMb75h.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-frappe-CMnRXVZP.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>J(()=>import(`./catppuccin-latte-CqhXSjCC.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-macchiato-B6kneE0C.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-mocha-CP8YZpvj.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>J(()=>import(`./dark-plus-B__q47Nr.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>J(()=>import(`./dracula-CBkSghcw.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>J(()=>import(`./dracula-soft-CCSYeoxL.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>J(()=>import(`./everforest-dark-NqSz4oHS.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>J(()=>import(`./everforest-light-a3Yzs_lT.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>J(()=>import(`./github-dark-ClO4AStc.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>J(()=>import(`./github-dark-default-CM0dPco8.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>J(()=>import(`./github-dark-dimmed-Cb6xxpXY.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>J(()=>import(`./github-dark-high-contrast-BpYtx2-M.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>J(()=>import(`./github-light-CeOVFgf_.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>J(()=>import(`./github-light-default-BmnCWL6x.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>J(()=>import(`./github-light-high-contrast-rpagNF5O.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-hard-aPiW8pQh.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-medium-2HJCvzsS.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-soft-Da97ODX9.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-hard-BXlEipFe.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-medium-Cun-GjGk.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-soft-Bd3qiiSw.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>J(()=>import(`./horizon-D54PjLAY.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`dark`,import:(()=>J(()=>import(`./horizon-bright-D9RccdIr.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>J(()=>import(`./houston-CMu1N_4K.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>J(()=>import(`./kanagawa-dragon-2Sk8Rx83.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>J(()=>import(`./kanagawa-lotus-CQVSWfJp.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>J(()=>import(`./kanagawa-wave-BKWNioLX.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>J(()=>import(`./laserwave-BUqkO46F.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>J(()=>import(`./light-plus-C9Hnuc1T.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>J(()=>import(`./material-theme-5rA1zn0D.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>J(()=>import(`./material-theme-darker-DGOEiL65.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>J(()=>import(`./material-theme-lighter-CULfFRX0.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>J(()=>import(`./material-theme-ocean-LQZ9CleP.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>J(()=>import(`./material-theme-palenight-Di_f5oks.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>J(()=>import(`./min-dark-rkuIbtJV.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>J(()=>import(`./min-light-Dj_HOGsr.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>J(()=>import(`./monokai-D5p-u2ij.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>J(()=>import(`./night-owl-CEdtPl3A.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>J(()=>import(`./night-owl-light-GdSldewm.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>J(()=>import(`./nord-3WFAz5H9.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>J(()=>import(`./one-dark-pro-BB6mpmmA.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>J(()=>import(`./one-light-BYLoxNtg.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>J(()=>import(`./plastic-D3k2Xp_5.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>J(()=>import(`./poimandres-bPTvT4Da.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>J(()=>import(`./red-C-DA4yBI.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>J(()=>import(`./rose-pine-DlrMPYYd.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>J(()=>import(`./rose-pine-dawn-DBHFtZD2.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>J(()=>import(`./rose-pine-moon-BBfrpe5q.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>J(()=>import(`./slack-dark-3PDtm74m.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>J(()=>import(`./slack-ochin-CwiuFRJD.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>J(()=>import(`./snazzy-light-Dyqc8Is2.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>J(()=>import(`./solarized-dark-DZiTscIX.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>J(()=>import(`./solarized-light-DBcfxrfG.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>J(()=>import(`./synthwave-84-CbbRs73K.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>J(()=>import(`./tokyo-night-BWUONxad.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>J(()=>import(`./vesper-DossXiE1.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>J(()=>import(`./vitesse-black-C3kc1227.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>J(()=>import(`./vitesse-dark-kWOu5V36.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>J(()=>import(`./vitesse-light-DMtiL8bK.js`),[]))}].map(e=>[e.id,e.import])),Tc=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Ec(){return 2147483648}function Dc(){return typeof performance<`u`?performance.now():Date.now()}var Oc=(e,t)=>e+(t-e%t)%t;async function kc(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=Ec();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,Oc(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:Dc,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 Ac=Object.defineProperty,jc=(e,t,n)=>t in e?Ac(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mc=(e,t,n)=>jc(e,typeof t==`symbol`?t:t+``,n),Nc=null;function Pc(e){throw new Tc(e.UTF8ToString(e.getLastOnigError()))}var Fc=class e{constructor(t){Mc(this,`utf16Length`),Mc(this,`utf8Length`),Mc(this,`utf16Value`),Mc(this,`utf8Value`),Mc(this,`utf16OffsetToUtf8`),Mc(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}a<=127?t+=1:a<=2047?t+=2:a<=65535?t+=3:t+=4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},Ic=class e{constructor(t){if(Mc(this,`id`,++e.LAST_ID),Mc(this,`_onigBinding`),Mc(this,`content`),Mc(this,`utf16Length`),Mc(this,`utf8Length`),Mc(this,`utf16OffsetToUtf8`),Mc(this,`utf8OffsetToUtf16`),Mc(this,`ptr`),!Nc)throw new Tc(`Must invoke loadWasm first.`);this._onigBinding=Nc,this.content=t;let n=new Fc(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=Nc.omalloc(1e4),e._sharedPtrInUse=!0,Nc.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(Nc)}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)}};Mc(Ic,`LAST_ID`,0),Mc(Ic,`_sharedPtr`,0),Mc(Ic,`_sharedPtrInUse`,!1);var Lc=Ic,Rc=class{constructor(e){if(Mc(this,`_onigBinding`),Mc(this,`_ptr`),!Nc)throw new Tc(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new Fc(e[r]);t[r]=i.createString(Nc),n[r]=i.utf8Length}let r=Nc.omalloc(4*e.length);Nc.HEAPU32.set(t,r/4);let i=Nc.omalloc(4*e.length);Nc.HEAPU32.set(n,i/4);let a=Nc.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)Nc.ofree(t[n]);Nc.ofree(i),Nc.ofree(r),a===0&&Pc(Nc),this._onigBinding=Nc,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 Lc(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 zc(e){return typeof e.instantiator==`function`}function Bc(e){return typeof e.default==`function`}function Vc(e){return e.data!==void 0}function Hc(e){return typeof Response<`u`&&e instanceof Response}function Uc(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 Wc;function Gc(e){if(Wc)return Wc;async function t(){Nc=await kc(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),zc(n)?n=await n.instantiator(t):Bc(n)?n=await n.default(t):(Vc(n)&&(n=n.data),Hc(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await qc(n)(t):await Jc(n)(t):Uc(n)||n instanceof WebAssembly.Module?n=await Kc(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await Kc(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return Wc=t(),Wc}function Kc(e){return t=>WebAssembly.instantiate(e,t)}function qc(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Jc(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function Yc(e){return e&&await Gc(e),{createScanner(e){return new Rc(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new Lc(e)}}}var Xc=mc({langs:Cc,themes:wc,engine:()=>Yc(J(()=>import(`./wasm-DFVlQlgd.js`),[]))}),{codeToHtml:Zc,codeToHast:Qc,codeToTokens:$c,codeToTokensBase:el,codeToTokensWithThemes:tl,getSingletonHighlighter:nl,getLastGrammarState:rl}=gc(Xc,{guessEmbeddedLanguages:es});function il(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function al(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var ol=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),sl=String.raw;function cl(e,t){if(e==null)throw Error(t??`Value expected`);return e}var ll=sl`\[\^?`,ul=`c.? | C(?:-.?)?|${sl`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${sl`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${sl`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${sl`o\{[^\}]*\}?`}|${sl`\d{1,3}`}`,dl=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,fl=new RegExp(sl`
21
+ `}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=ss(a.htmlStyle||os(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&ls(m,r),m}function Ks(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&yr.Underline||i.fontStyle&yr.Strikethrough));o&&i.content.match(/^\s+$/)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function qs(e){return e.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;let t=e.content.match(/^(\s*)(.*?)(\s*)$/);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function Js(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t[t.length-1],r=ss(e.htmlStyle||os(e)),i=ss(n.htmlStyle||os(n)),a=e.fontStyle&&(e.fontStyle&yr.Underline||e.fontStyle&yr.Strikethrough),o=n.fontStyle&&(n.fontStyle&yr.Underline||n.fontStyle&yr.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Ys=Bo;function Xs(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>Ws(e,t,n),codeToTokens:(t,n)=>Hs(e,t,n)},i=Ys(Ws(e,t,n,r));for(let e of vs(n))i=e.postprocess?.call(r,i,n)||i;return i}var Zs={light:`#333333`,dark:`#bbbbbb`},Qs={light:`#fffffe`,dark:`#1e1e1e`},$s=`__shiki_resolved`;function ec(e){if(e?.[$s])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`?Zs.light:Zs.dark,n||=t.type===`light`?Qs.light:Qs.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,$s,{enumerable:!1,writable:!1,value:!0}),t}async function tc(e){return Array.from(new Set((await Promise.all(e.filter(e=>!Jo(e)).map(async e=>await Ko(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function nc(e){return(await Promise.all(e.map(async e=>Xo(e)?null:ec(await Ko(e))))).filter(e=>!!e)}var rc=3,ic=!1;function ac(e,t=3){if(rc&&!(typeof rc==`number`&&t>rc)){if(ic)throw Error(`[SHIKI DEPRECATE]: ${e}`);console.trace(`[SHIKI DEPRECATE]: ${e}`)}}var oc=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function sc(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 oc(`Circular alias \`${Array.from(n).join(` -> `)} -> ${e}\``);n.add(e)}}return e}var cc=class extends Pi{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)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=ec(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=fr.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=sc(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=Array.from(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 oc(`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))}},lc=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}},uc=0;function dc(e){uc+=1,e.warnings!==!1&&uc>=10&&uc%10==0&&console.warn(`[Shiki] ${uc} 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 oc("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(ec),i=new cc(new lc(e.engine,n),r,n,e.langAlias),a;function o(t){return sc(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new oc(`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 oc(`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 tc(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await nc(e))}function g(){if(t)throw new oc(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--uc)}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 fc(e){e.engine||ac("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([nc(e.themes||[]),tc(e.langs||[]),e.engine]);return dc({...e,themes:t,langs:n,engine:r})}async function pc(e){let t=await fc(e);return{getLastGrammarState:(...e)=>Ms(t,...e),codeToTokensBase:(e,n)=>js(t,e,n),codeToTokensWithThemes:(e,n)=>Bs(t,e,n),codeToTokens:(e,n)=>Hs(t,e,n),codeToHast:(e,n)=>Ws(t,e,n),codeToHtml:(e,n)=>Xs(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function mc(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,Jo(n))return[];let r=t[n];if(!r)throw new Qn(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(Xo(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new Qn(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await pc({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function hc(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}else{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function gc(e,t){let n=hc(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var _c=`modulepreload`,vc=function(e){return`/`+e},yc={},J=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}))))}r=o(t.map(t=>{if(t=vc(t,n),t in yc)return;yc[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:_c,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.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)})},bc=[{id:`abap`,name:`ABAP`,import:(()=>J(()=>import(`./abap-CkQ0tsz-.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,import:(()=>J(()=>import(`./actionscript-3-DHm0ZfF4.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>J(()=>import(`./ada-DK_ua92Z.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>J(()=>import(`./angular-html-DsssUIMZ.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>J(()=>import(`./angular-ts-dTg-sJ77.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>J(()=>import(`./apache-DXtpFu7o.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>J(()=>import(`./apex-DlnRRWpl.js`),[]))},{id:`apl`,name:`APL`,import:(()=>J(()=>import(`./apl-C1yUKbqz.js`),__vite__mapDeps([6,2,1,3,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>J(()=>import(`./applescript-CShk62ad.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>J(()=>import(`./ara-CWN-FDkm.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>J(()=>import(`./asciidoc-Bg-PM9Vn.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>J(()=>import(`./asm-DKOhR24S.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>J(()=>import(`./astro-BI07ha2y.js`),__vite__mapDeps([10,2,3,7,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>J(()=>import(`./awk-3ibKHffv.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>J(()=>import(`./ballerina-xx7VNGxs.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`],import:(()=>J(()=>import(`./bat-DGYsZ5wR.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>J(()=>import(`./beancount-D_ATR1UV.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>J(()=>import(`./berry-BqYMORfH.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>J(()=>import(`./bibtex-CQTBDajW.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>J(()=>import(`./bicep-CfNtxPrK.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>J(()=>import(`./bird2-C0dUPe3I.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>J(()=>import(`./blade-DkzUGffS.js`),__vite__mapDeps([14,2,15,1,3,7,16,8,9])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>J(()=>import(`./bsl-Dx5tFn3i.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>J(()=>import(`./c-KkuqqOvW.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>J(()=>import(`./c3-BUwZ5e3k.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>J(()=>import(`./cadence-C3OKDYrr.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>J(()=>import(`./cairo-wCCQTdA9.js`),__vite__mapDeps([19,20])))},{id:`clarity`,name:`Clarity`,import:(()=>J(()=>import(`./clarity-Crxe8gSr.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>J(()=>import(`./clojure-BuzOUPMr.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>J(()=>import(`./cmake-CCpZLdLI.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>J(()=>import(`./cobol-DRh7-jLi.js`),__vite__mapDeps([21,1,2,3,9])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>J(()=>import(`./codeowners-Bo1VYpHz.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>J(()=>import(`./codeql-Db01hzHE.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>J(()=>import(`./coffee-wR_ZAh9a.js`),__vite__mapDeps([22,3])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>J(()=>import(`./common-lisp-CMlJIc6Y.js`),[]))},{id:`coq`,name:`Coq`,import:(()=>J(()=>import(`./coq-BlzBYp3f.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>J(()=>import(`./cpp-OD_qyywn.js`).then(e=>e.n),__vite__mapDeps([23,24,25,26,16])))},{id:`crystal`,name:`Crystal`,import:(()=>J(()=>import(`./crystal-E4ahAddE.js`),__vite__mapDeps([27,25,2,1,3,28,16])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>J(()=>import(`./csharp-kfNshAa7.js`),[]))},{id:`css`,name:`CSS`,import:(()=>J(()=>import(`./css-2NgE_uxz.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>J(()=>import(`./csv-Dr8ri5Nd.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>J(()=>import(`./cue-jXfhyOwY.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>J(()=>import(`./cypher-CayLeiaR.js`),[]))},{id:`d`,name:`D`,import:(()=>J(()=>import(`./d-BMZQ0mAy.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>J(()=>import(`./dart-gMOEMyuz.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>J(()=>import(`./dax-C3t5LadU.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>J(()=>import(`./desktop-DmhXLwLR.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>J(()=>import(`./diff-togOXQX6.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>J(()=>import(`./docker--6N01olR.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>J(()=>import(`./dotenv-Bq930Yx8.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>J(()=>import(`./dream-maker-BiMf3DHl.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>J(()=>import(`./edge-8mbscxxD.js`),__vite__mapDeps([29,15,1,2,3,13])))},{id:`elixir`,name:`Elixir`,import:(()=>J(()=>import(`./elixir-CJv1b3Q6.js`),__vite__mapDeps([30,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>J(()=>import(`./elm-DUPzqZ9H.js`),__vite__mapDeps([31,24,25])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>J(()=>import(`./emacs-lisp-Dhht7he2.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>J(()=>import(`./erb-ssvEF26z.js`),__vite__mapDeps([32,1,2,3,33,25,23,24,26,16,34,35,12,13,36,37,28,8,9,38])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>J(()=>import(`./erlang-CtK0kQ6z.js`),__vite__mapDeps([39,40])))},{id:`fennel`,name:`Fennel`,import:(()=>J(()=>import(`./fennel-BExc9TZf.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>J(()=>import(`./fish-C2p-AJmZ.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>J(()=>import(`./fluent-CeYzs8Qy.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>J(()=>import(`./fortran-fixed-form-DBM4e0_k.js`),__vite__mapDeps([41,42])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>J(()=>import(`./fortran-free-form-BIQEK2Jw.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>J(()=>import(`./fsharp-CmzzGQLe.js`),__vite__mapDeps([43,40])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>J(()=>import(`./gdresource-B_wbPqHd.js`),__vite__mapDeps([44,45,46])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>J(()=>import(`./gdscript-B5JQPh_-.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>J(()=>import(`./gdshader-vVjJ_Qr8.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>J(()=>import(`./genie-DGl5rqC8.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>J(()=>import(`./gherkin-CY_VLUnD.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>J(()=>import(`./git-commit-1z4D6NzL.js`),__vite__mapDeps([47,48])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>J(()=>import(`./git-rebase-DiWIK1Oa.js`),__vite__mapDeps([49,28])))},{id:`gleam`,name:`Gleam`,import:(()=>J(()=>import(`./gleam-BarIG9kQ.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>J(()=>import(`./glimmer-js-DrHg6AuA.js`),__vite__mapDeps([50,2,1,3,13])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>J(()=>import(`./glimmer-ts-wQSGOa8A.js`),__vite__mapDeps([51,2,1,3,13])))},{id:`glsl`,name:`GLSL`,import:(()=>J(()=>import(`./glsl-OY27QGY0.js`).then(e=>e.n),__vite__mapDeps([24,25])))},{id:`gn`,name:`GN`,import:(()=>J(()=>import(`./gn-DhYsTPYc.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>J(()=>import(`./gnuplot-CucLlTBc.js`),[]))},{id:`go`,name:`Go`,import:(()=>J(()=>import(`./go-toi-uWvg.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>J(()=>import(`./graphql-CSWSqe6f.js`).then(e=>e.n),__vite__mapDeps([34,3,35,12,13])))},{id:`groovy`,name:`Groovy`,import:(()=>J(()=>import(`./groovy-Ds4dis_k.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>J(()=>import(`./hack-Bi1v624Q.js`),__vite__mapDeps([52,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>J(()=>import(`./haml-CX94zV9m.js`).then(e=>e.n),__vite__mapDeps([36,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>J(()=>import(`./handlebars-C1j6wnjG.js`),__vite__mapDeps([53,2,1,3,38])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>J(()=>import(`./haskell-B_jvz5Po.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>J(()=>import(`./haxe-BRbuo5UO.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>J(()=>import(`./hcl-BzNUCtsK.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>J(()=>import(`./hjson-BxVo3sS2.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>J(()=>import(`./hlsl-C8Wes1nf.js`),[]))},{id:`html`,name:`HTML`,import:(()=>J(()=>import(`./html-BcAjMlB7.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>J(()=>import(`./html-derivative-DcEpOzdx.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>J(()=>import(`./http-BBxxSc6S.js`),__vite__mapDeps([54,34,3,35,12,13,7,28,8,9])))},{id:`hurl`,name:`Hurl`,import:(()=>J(()=>import(`./hurl-CpKRNTz4.js`),__vite__mapDeps([55,56,34,3,35,12,13,8,9])))},{id:`hxml`,name:`HXML`,import:(()=>J(()=>import(`./hxml-DC4KwKt2.js`),__vite__mapDeps([57,58])))},{id:`hy`,name:`Hy`,import:(()=>J(()=>import(`./hy-dMrJKKU_.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>J(()=>import(`./imba-DG_oO8tg.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>J(()=>import(`./ini-geHw79Aj.js`),[]))},{id:`java`,name:`Java`,import:(()=>J(()=>import(`./java-CFUlLvAA.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>J(()=>import(`./javascript-C-HnT3sE.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>J(()=>import(`./jinja-CPU8RwNP.js`),__vite__mapDeps([59,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>J(()=>import(`./jison-CW0TBQOs.js`),__vite__mapDeps([60,3])))},{id:`json`,name:`JSON`,import:(()=>J(()=>import(`./json-qUjlNuEJ.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>J(()=>import(`./json5-CDUsNqz6.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>J(()=>import(`./jsonc-D48xcwyD.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>J(()=>import(`./jsonl-cpIYDXEe.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>J(()=>import(`./jsonnet-Da1lhszN.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>J(()=>import(`./jssm-B8BLrEGL.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>J(()=>import(`./jsx-KWeo60kf.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>J(()=>import(`./julia-CnJB8y2e.js`),__vite__mapDeps([61,23,24,25,26,16,3,20,62])))},{id:`just`,name:`Just`,import:(()=>J(()=>import(`./just-Do22d9PP.js`),__vite__mapDeps([63,3,64,2,1,16,8,9,20,33,25,23,24,26,34,35,12,13,36,37,28,38])))},{id:`kdl`,name:`KDL`,import:(()=>J(()=>import(`./kdl-B-2tSRmp.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>J(()=>import(`./kotlin-DepsEzh3.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>J(()=>import(`./kusto-BcCtXIb8.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>J(()=>import(`./latex-CCPgzvKn.js`),__vite__mapDeps([65,66,62])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>J(()=>import(`./lean-CNO9ffpX.js`),[]))},{id:`less`,name:`Less`,import:(()=>J(()=>import(`./less-Dj0T9pWC.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>J(()=>import(`./liquid-B9btdZoI.js`),__vite__mapDeps([67,2,1,3,7])))},{id:`llvm`,name:`LLVM IR`,import:(()=>J(()=>import(`./llvm-DbV9b66l.js`),[]))},{id:`log`,name:`Log file`,import:(()=>J(()=>import(`./log-BMblmPyH.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>J(()=>import(`./logo-B78qMxws.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>J(()=>import(`./lua-IFRifurW.js`).then(e=>e.n),__vite__mapDeps([37,25])))},{id:`luau`,name:`Luau`,import:(()=>J(()=>import(`./luau-BUd8xsdE.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>J(()=>import(`./make-Ev-6cJrd.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>J(()=>import(`./markdown-CS4LI6sN.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>J(()=>import(`./marko-CCaVBFq1.js`),__vite__mapDeps([68,2,69,5,13])))},{id:`matlab`,name:`MATLAB`,import:(()=>J(()=>import(`./matlab-C0qEtAx9.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>J(()=>import(`./mdc-BtbnOLUc.js`),__vite__mapDeps([70,15,1,2,3,40,38])))},{id:`mdx`,name:`MDX`,import:(()=>J(()=>import(`./mdx-CzvnbLXb.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>J(()=>import(`./mermaid-BPquZaKt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>J(()=>import(`./mipsasm-k5DQoS6j.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>J(()=>import(`./mojo-sTTDuNnR.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>J(()=>import(`./moonbit-j5ChFtBC.js`),[]))},{id:`move`,name:`Move`,import:(()=>J(()=>import(`./move-Dj0Gmn6R.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>J(()=>import(`./narrat-DJgMz2oW.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>J(()=>import(`./nextflow-CApkvBGW.js`),__vite__mapDeps([71,72])))},{id:`nextflow-groovy`,name:`nextflow-groovy`,import:(()=>J(()=>import(`./nextflow-groovy-eDLuZ_oi.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>J(()=>import(`./nginx-BkbFZHVt.js`),__vite__mapDeps([73,37,25])))},{id:`nim`,name:`Nim`,import:(()=>J(()=>import(`./nim-2uCd5j65.js`),__vite__mapDeps([74,25,2,24,1,3,40,8,9])))},{id:`nix`,name:`Nix`,import:(()=>J(()=>import(`./nix-CxIPS3pb.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>J(()=>import(`./nushell-GDfBmoBU.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>J(()=>import(`./objective-c-MFQ_MGUa.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>J(()=>import(`./objective-cpp-Y83LcBE7.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>J(()=>import(`./ocaml-FxYfaJxu.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>J(()=>import(`./odin-CprihY3z.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>J(()=>import(`./openscad-Bc1FbpOi.js`),[]))},{id:`pascal`,name:`Pascal`,import:(()=>J(()=>import(`./pascal-Bb4d8cUL.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>J(()=>import(`./perl-C4ixqSNT.js`),__vite__mapDeps([64,2,1,3,16,8,9])))},{id:`php`,name:`PHP`,import:(()=>J(()=>import(`./php-DJ8WOtcI.js`),__vite__mapDeps([75,2,1,3,7,16,8,9])))},{id:`pkl`,name:`Pkl`,import:(()=>J(()=>import(`./pkl-tM25Sq0w.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>J(()=>import(`./plsql-CLEfFhSj.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>J(()=>import(`./po-CaAzdrrh.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>J(()=>import(`./polar-TG7aTGdK.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>J(()=>import(`./postcss-8kqfa9f0.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>J(()=>import(`./powerquery-CtSu1Nfd.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`],import:(()=>J(()=>import(`./powershell-87lLBHMy.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>J(()=>import(`./prisma-Dnf694DZ.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>J(()=>import(`./prolog-C0XbHTWa.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>J(()=>import(`./proto-BZP-HLIb.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>J(()=>import(`./pug-BOaafhT5.js`),__vite__mapDeps([76,2,1,3])))},{id:`puppet`,name:`Puppet`,import:(()=>J(()=>import(`./puppet-CJYWgYC5.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>J(()=>import(`./purescript-B95Q6BAd.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>J(()=>import(`./python-CqTCsi7P.js`),[]))},{id:`qml`,name:`QML`,import:(()=>J(()=>import(`./qml-CURE-1y4.js`),__vite__mapDeps([77,3])))},{id:`qmldir`,name:`QML Directory`,import:(()=>J(()=>import(`./qmldir-DlIL4hls.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>J(()=>import(`./qss-BW72E0q_.js`),[]))},{id:`r`,name:`R`,import:(()=>J(()=>import(`./r-CPWmgzo3.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>J(()=>import(`./racket-CCAimEsC.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>J(()=>import(`./raku-mSuqElkM.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>J(()=>import(`./razor-DH83VP_d.js`),__vite__mapDeps([78,79,1,2,3])))},{id:`reg`,name:`Windows Registry Script`,import:(()=>J(()=>import(`./reg-CGwMBJ2c.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>J(()=>import(`./regexp-BXVWi-t_.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>J(()=>import(`./rel-JwrbYgX4.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>J(()=>import(`./riscv-CoYyE75b.js`),[]))},{id:`ron`,name:`RON`,import:(()=>J(()=>import(`./ron-C5wrhnmJ.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>J(()=>import(`./rosmsg-DlimTR9t.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>J(()=>import(`./rst-Bbxxs6E2.js`),__vite__mapDeps([80,81,23,24,25,26,16,15,1,2,3,20,33,34,35,12,13,36,37,28,8,9,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>J(()=>import(`./ruby-C-TuWES4.js`),__vite__mapDeps([33,25,23,24,26,16,2,34,3,35,12,13,36,1,37,28,8,9,38])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>J(()=>import(`./rust-Cxnkxx3h.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>J(()=>import(`./sas-njzNYNOq.js`),__vite__mapDeps([82,16])))},{id:`sass`,name:`Sass`,import:(()=>J(()=>import(`./sass-DEyqUIpU.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>J(()=>import(`./scala-i3RN3yAN.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>J(()=>import(`./scheme-BcKdjYkO.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>J(()=>import(`./scss-D2i6rHB8.js`).then(e=>e.n),__vite__mapDeps([5,2])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>J(()=>import(`./sdbl-Be_XWc3n.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>J(()=>import(`./shaderlab-DXAhMdPo.js`),__vite__mapDeps([83,84])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>J(()=>import(`./shellscript-D6Bxi40C.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>J(()=>import(`./shellsession-Defxq-I6.js`),__vite__mapDeps([85,28])))},{id:`smalltalk`,name:`Smalltalk`,import:(()=>J(()=>import(`./smalltalk-BdBlL6ks.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>J(()=>import(`./solidity-DH-yUSWc.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>J(()=>import(`./soy-D0GKXrtT.js`),__vite__mapDeps([86,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>J(()=>import(`./sparql-BdcL8cbr.js`),__vite__mapDeps([87,88])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>J(()=>import(`./splunk-CIjc4kxs.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>J(()=>import(`./sql-BRW_ADkU.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>J(()=>import(`./ssh-config-BKVd4drG.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>J(()=>import(`./stata-w7w59F48.js`),__vite__mapDeps([89,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>J(()=>import(`./stylus-tqAsmugv.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>J(()=>import(`./surrealql-O-lLuqz7.js`),__vite__mapDeps([90,3])))},{id:`svelte`,name:`Svelte`,import:(()=>J(()=>import(`./svelte-DN3DR5-t.js`),__vite__mapDeps([91,2,3,11,13])))},{id:`swift`,name:`Swift`,import:(()=>J(()=>import(`./swift-CdDBQ3_Z.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>J(()=>import(`./system-verilog-CBqEY-9v.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>J(()=>import(`./systemd-khRP5zwK.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>J(()=>import(`./talonscript-D_lneH-6.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>J(()=>import(`./tasl-CLymawGe.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>J(()=>import(`./tcl-BRY1S87U.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>J(()=>import(`./templ-CJ2JFoia.js`),__vite__mapDeps([92,2,93,3])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>J(()=>import(`./terraform-BqohMo2f.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>J(()=>import(`./tex-CpWrf5g9.js`),__vite__mapDeps([66,62])))},{id:`toml`,name:`TOML`,import:(()=>J(()=>import(`./toml-C4c85Lwg.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>J(()=>import(`./ts-tags-CZ6Af6Pe.js`),__vite__mapDeps([94,2,24,25,1,3,16,13,8,9])))},{id:`tsv`,name:`TSV`,import:(()=>J(()=>import(`./tsv-DsZq9HBQ.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>J(()=>import(`./tsx-gIUSpRih.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>J(()=>import(`./turtle-Dpr8zLlw.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>J(()=>import(`./twig-DwZINhmw.js`),__vite__mapDeps([95,2,3,75,1,7,16,8,9,20,33,25,23,24,26,34,35,12,13,36,37,28,38,5])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>J(()=>import(`./typescript-Dj2aMECR.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>J(()=>import(`./typespec-DcqgATB-.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>J(()=>import(`./typst-CeVxmuPg.js`),[]))},{id:`v`,name:`V`,import:(()=>J(()=>import(`./v-C2Qsh2-1.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>J(()=>import(`./vala-CvZ3yL7c.js`),[]))},{id:`vb`,name:`Visual Basic`,aliases:[`cmd`],import:(()=>J(()=>import(`./vb-B_p4qDw4.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>J(()=>import(`./verilog-D8MGjxD7.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>J(()=>import(`./vhdl-MLyYh_Gz.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>J(()=>import(`./viml-BuYIArcz.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>J(()=>import(`./vue-B5K0aWrP.js`),__vite__mapDeps([96,2,15,1,3,7,13])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>J(()=>import(`./vue-html-DKGgrypd.js`),__vite__mapDeps([97,3])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>J(()=>import(`./vue-vine-B5iDYTCh.js`),__vite__mapDeps([98,2,3,69,11,5,99])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>J(()=>import(`./vyper-CNqG09-_.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>J(()=>import(`./wasm-BsQDV7Y0.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>J(()=>import(`./wenyan-BmOQge13.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>J(()=>import(`./wgsl-CgWrmvIg.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>J(()=>import(`./wikitext-DkwckXCk.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>J(()=>import(`./wit-CtyVFGe7.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>J(()=>import(`./wolfram-CXE4FrKz.js`),[]))},{id:`xml`,name:`XML`,import:(()=>J(()=>import(`./xml-CbTzxfc-.js`).then(e=>e.n),__vite__mapDeps([8,9])))},{id:`xsl`,name:`XSL`,import:(()=>J(()=>import(`./xsl-Dj-Be6nx.js`),__vite__mapDeps([100,8,9])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>J(()=>import(`./yaml-rTK8uEjh.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>J(()=>import(`./zenscript-DH15wJt0.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>J(()=>import(`./zig-CqXN9brD.js`),[]))}],xc=Object.fromEntries(bc.map(e=>[e.id,e.import])),Sc=Object.fromEntries(bc.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Cc={...xc,...Sc},wc=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>J(()=>import(`./andromeeda-D2ccw8v4.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>J(()=>import(`./aurora-x-DpaEirL8.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>J(()=>import(`./ayu-dark-ursiSH5k.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>J(()=>import(`./ayu-light-DMjlrKmx.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>J(()=>import(`./ayu-mirage-DZEMb75h.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-frappe-CMnRXVZP.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>J(()=>import(`./catppuccin-latte-CqhXSjCC.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-macchiato-B6kneE0C.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-mocha-CP8YZpvj.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>J(()=>import(`./dark-plus-B__q47Nr.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>J(()=>import(`./dracula-CBkSghcw.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>J(()=>import(`./dracula-soft-CCSYeoxL.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>J(()=>import(`./everforest-dark-NqSz4oHS.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>J(()=>import(`./everforest-light-a3Yzs_lT.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>J(()=>import(`./github-dark-ClO4AStc.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>J(()=>import(`./github-dark-default-CM0dPco8.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>J(()=>import(`./github-dark-dimmed-Cb6xxpXY.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>J(()=>import(`./github-dark-high-contrast-BpYtx2-M.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>J(()=>import(`./github-light-CeOVFgf_.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>J(()=>import(`./github-light-default-BmnCWL6x.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>J(()=>import(`./github-light-high-contrast-rpagNF5O.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-hard-aPiW8pQh.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-medium-2HJCvzsS.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-soft-Da97ODX9.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-hard-BXlEipFe.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-medium-Cun-GjGk.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-soft-Bd3qiiSw.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>J(()=>import(`./horizon-D54PjLAY.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`dark`,import:(()=>J(()=>import(`./horizon-bright-D9RccdIr.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>J(()=>import(`./houston-CMu1N_4K.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>J(()=>import(`./kanagawa-dragon-2Sk8Rx83.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>J(()=>import(`./kanagawa-lotus-CQVSWfJp.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>J(()=>import(`./kanagawa-wave-BKWNioLX.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>J(()=>import(`./laserwave-BUqkO46F.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>J(()=>import(`./light-plus-C9Hnuc1T.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>J(()=>import(`./material-theme-5rA1zn0D.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>J(()=>import(`./material-theme-darker-DGOEiL65.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>J(()=>import(`./material-theme-lighter-CULfFRX0.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>J(()=>import(`./material-theme-ocean-LQZ9CleP.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>J(()=>import(`./material-theme-palenight-Di_f5oks.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>J(()=>import(`./min-dark-rkuIbtJV.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>J(()=>import(`./min-light-Dj_HOGsr.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>J(()=>import(`./monokai-D5p-u2ij.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>J(()=>import(`./night-owl-CEdtPl3A.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>J(()=>import(`./night-owl-light-GdSldewm.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>J(()=>import(`./nord-3WFAz5H9.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>J(()=>import(`./one-dark-pro-BB6mpmmA.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>J(()=>import(`./one-light-BYLoxNtg.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>J(()=>import(`./plastic-D3k2Xp_5.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>J(()=>import(`./poimandres-bPTvT4Da.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>J(()=>import(`./red-C-DA4yBI.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>J(()=>import(`./rose-pine-DlrMPYYd.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>J(()=>import(`./rose-pine-dawn-DBHFtZD2.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>J(()=>import(`./rose-pine-moon-BBfrpe5q.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>J(()=>import(`./slack-dark-3PDtm74m.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>J(()=>import(`./slack-ochin-CwiuFRJD.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>J(()=>import(`./snazzy-light-Dyqc8Is2.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>J(()=>import(`./solarized-dark-DZiTscIX.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>J(()=>import(`./solarized-light-DBcfxrfG.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>J(()=>import(`./synthwave-84-CbbRs73K.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>J(()=>import(`./tokyo-night-BWUONxad.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>J(()=>import(`./vesper-DossXiE1.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>J(()=>import(`./vitesse-black-C3kc1227.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>J(()=>import(`./vitesse-dark-kWOu5V36.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>J(()=>import(`./vitesse-light-DMtiL8bK.js`),[]))}].map(e=>[e.id,e.import])),Tc=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Ec(){return 2147483648}function Dc(){return typeof performance<`u`?performance.now():Date.now()}var Oc=(e,t)=>e+(t-e%t)%t;async function kc(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=Ec();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,Oc(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:Dc,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 Ac=Object.defineProperty,jc=(e,t,n)=>t in e?Ac(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mc=(e,t,n)=>jc(e,typeof t==`symbol`?t:t+``,n),Nc=null;function Pc(e){throw new Tc(e.UTF8ToString(e.getLastOnigError()))}var Fc=class e{constructor(t){Mc(this,`utf16Length`),Mc(this,`utf8Length`),Mc(this,`utf16Value`),Mc(this,`utf8Value`),Mc(this,`utf16OffsetToUtf8`),Mc(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}a<=127?t+=1:a<=2047?t+=2:a<=65535?t+=3:t+=4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},Ic=class e{constructor(t){if(Mc(this,`id`,++e.LAST_ID),Mc(this,`_onigBinding`),Mc(this,`content`),Mc(this,`utf16Length`),Mc(this,`utf8Length`),Mc(this,`utf16OffsetToUtf8`),Mc(this,`utf8OffsetToUtf16`),Mc(this,`ptr`),!Nc)throw new Tc(`Must invoke loadWasm first.`);this._onigBinding=Nc,this.content=t;let n=new Fc(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=Nc.omalloc(1e4),e._sharedPtrInUse=!0,Nc.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(Nc)}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)}};Mc(Ic,`LAST_ID`,0),Mc(Ic,`_sharedPtr`,0),Mc(Ic,`_sharedPtrInUse`,!1);var Lc=Ic,Rc=class{constructor(e){if(Mc(this,`_onigBinding`),Mc(this,`_ptr`),!Nc)throw new Tc(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new Fc(e[r]);t[r]=i.createString(Nc),n[r]=i.utf8Length}let r=Nc.omalloc(4*e.length);Nc.HEAPU32.set(t,r/4);let i=Nc.omalloc(4*e.length);Nc.HEAPU32.set(n,i/4);let a=Nc.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)Nc.ofree(t[n]);Nc.ofree(i),Nc.ofree(r),a===0&&Pc(Nc),this._onigBinding=Nc,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 Lc(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 zc(e){return typeof e.instantiator==`function`}function Bc(e){return typeof e.default==`function`}function Vc(e){return e.data!==void 0}function Hc(e){return typeof Response<`u`&&e instanceof Response}function Uc(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 Wc;function Gc(e){if(Wc)return Wc;async function t(){Nc=await kc(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),zc(n)?n=await n.instantiator(t):Bc(n)?n=await n.default(t):(Vc(n)&&(n=n.data),Hc(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await qc(n)(t):await Jc(n)(t):Uc(n)||n instanceof WebAssembly.Module?n=await Kc(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await Kc(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return Wc=t(),Wc}function Kc(e){return t=>WebAssembly.instantiate(e,t)}function qc(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Jc(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function Yc(e){return e&&await Gc(e),{createScanner(e){return new Rc(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new Lc(e)}}}var Xc=mc({langs:Cc,themes:wc,engine:()=>Yc(J(()=>import(`./wasm-DFVlQlgd.js`),[]))}),{codeToHtml:Zc,codeToHast:Qc,codeToTokens:$c,codeToTokensBase:el,codeToTokensWithThemes:tl,getSingletonHighlighter:nl,getLastGrammarState:rl}=gc(Xc,{guessEmbeddedLanguages:es});function il(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function al(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var ol=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),sl=String.raw;function cl(e,t){if(e==null)throw Error(t??`Value expected`);return e}var ll=sl`\[\^?`,ul=`c.? | C(?:-.?)?|${sl`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${sl`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${sl`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${sl`o\{[^\}]*\}?`}|${sl`\d{1,3}`}`,dl=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,fl=new RegExp(sl`
22
22
  \\ (?:
23
23
  ${ul}
24
24
  | [gk]<[^>]*>?
@@ -1947,11 +1947,16 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
1947
1947
  ]*?"'`},{begin:`"[^\r
1948
1948
  "]*"`}]},{className:`built_in`,variants:[{begin:`\\b(abs|acos|asin|atan|atan2|atanh|ceil|cloglog|comb|cos|digamma|exp|floor|invcloglog|invlogit|ln|lnfact|lnfactorial|lngamma|log|log10|max|min|mod|reldif|round|sign|sin|sqrt|sum|tan|tanh|trigamma|trunc|betaden|Binomial|binorm|binormal|chi2|chi2tail|dgammapda|dgammapdada|dgammapdadx|dgammapdx|dgammapdxdx|F|Fden|Ftail|gammaden|gammap|ibeta|invbinomial|invchi2|invchi2tail|invF|invFtail|invgammap|invibeta|invnchi2|invnFtail|invnibeta|invnorm|invnormal|invttail|nbetaden|nchi2|nFden|nFtail|nibeta|norm|normal|normalden|normd|npnchi2|tden|ttail|uniform|abbrev|char|index|indexnot|length|lower|ltrim|match|plural|proper|real|regexm|regexr|regexs|reverse|rtrim|string|strlen|strlower|strltrim|strmatch|strofreal|strpos|strproper|strreverse|strrtrim|strtrim|strupper|subinstr|subinword|substr|trim|upper|word|wordcount|_caller|autocode|byteorder|chop|clip|cond|e|epsdouble|epsfloat|group|inlist|inrange|irecode|matrix|maxbyte|maxdouble|maxfloat|maxint|maxlong|mi|minbyte|mindouble|minfloat|minint|minlong|missing|r|recode|replay|return|s|scalar|d|date|day|dow|doy|halfyear|mdy|month|quarter|week|year|d|daily|dofd|dofh|dofm|dofq|dofw|dofy|h|halfyearly|hofd|m|mofd|monthly|q|qofd|quarterly|tin|twithin|w|weekly|wofd|y|yearly|yh|ym|yofd|yq|yw|cholesky|colnumb|colsof|corr|det|diag|diag0cnt|el|get|hadamard|I|inv|invsym|issym|issymmetric|J|matmissing|matuniform|mreldif|nullmat|rownumb|rowsof|sweep|syminv|trace|vec|vecdiag)(?=\\()`}]},e.COMMENT(`^[ ]*\\*.*$`,!1),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]}}t.exports=n})),LA=o(((e,t)=>{function n(e){return{name:`STEP Part 21`,aliases:[`p21`,`step`,`stp`],case_insensitive:!0,keywords:{$pattern:`[A-Z_][A-Z0-9_.]*`,keyword:[`HEADER`,`ENDSEC`,`DATA`]},contains:[{className:`meta`,begin:`ISO-10303-21;`,relevance:10},{className:`meta`,begin:`END-ISO-10303-21;`,relevance:10},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.COMMENT(`/\\*\\*!`,`\\*/`),e.C_NUMBER_MODE,e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:`string`,begin:`'`,end:`'`},{className:`symbol`,variants:[{begin:`#`,end:`\\d+`,illegal:`\\W`}]}]}}t.exports=n})),RA=o(((e,t)=>{var n=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),r=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),i=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),a=[...r,...i],o=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),s=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),c=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),l=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function u(e){let t=n(e),r={className:`variable`,begin:`\\$`+e.IDENT_RE},i=[`charset`,`css`,`debug`,`extend`,`font-face`,`for`,`import`,`include`,`keyframes`,`media`,`mixin`,`page`,`warn`,`while`],u=`(?=[.\\s\\n[:,(])`;return{name:`Stylus`,aliases:[`styl`],case_insensitive:!1,keywords:`if else for in`,illegal:`(`+[`\\?`,`(\\bReturn\\b)`,`(\\bEnd\\b)`,`(\\bend\\b)`,`(\\bdef\\b)`,`;`,`#\\s`,`\\*\\s`,`===\\s`,`\\|`,`%`].join(`|`)+`)`,contains:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.HEXCOLOR,{begin:`\\.[a-zA-Z][a-zA-Z0-9_-]*`+u,className:`selector-class`},{begin:`#[a-zA-Z][a-zA-Z0-9_-]*`+u,className:`selector-id`},{begin:`\\b(`+a.join(`|`)+`)(?=[.\\s\\n[:,(])`,className:`selector-tag`},{className:`selector-pseudo`,begin:`&?:(`+s.join(`|`)+`)(?=[.\\s\\n[:,(])`},{className:`selector-pseudo`,begin:`&?:(:)?(`+c.join(`|`)+`)(?=[.\\s\\n[:,(])`},t.ATTRIBUTE_SELECTOR_MODE,{className:`keyword`,begin:/@media/,starts:{end:/[{;}]/,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:o.join(` `)},contains:[t.CSS_NUMBER_MODE]}},{className:`keyword`,begin:`@((-(o|moz|ms|webkit)-)?(`+i.join(`|`)+`))\\b`},r,t.CSS_NUMBER_MODE,{className:`function`,begin:`^[a-zA-Z][a-zA-Z0-9_-]*\\(.*\\)`,illegal:`[\\n]`,returnBegin:!0,contains:[{className:`title`,begin:`\\b[a-zA-Z][a-zA-Z0-9_-]*`},{className:`params`,begin:/\(/,end:/\)/,contains:[t.HEXCOLOR,r,e.APOS_STRING_MODE,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE]}]},t.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+l.join(`|`)+`)\\b`,starts:{end:/;|$/,contains:[t.HEXCOLOR,r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,t.CSS_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH],illegal:/\./,relevance:0}},t.FUNCTION_DISPATCH]}}t.exports=u})),zA=o(((e,t)=>{function n(e){return{name:`SubUnit`,case_insensitive:!0,contains:[{className:`string`,begin:`\\[
1949
1949
  (multipart)?`,end:`\\]
1950
- `},{className:`string`,begin:`\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}.\\d+Z`},{className:`string`,begin:`(\\+|-)\\d+`},{className:`keyword`,relevance:10,variants:[{begin:`^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?`},{begin:`^progress(:?)(\\s+)?(pop|push)?`},{begin:`^tags:`},{begin:`^time:`}]}]}}t.exports=n})),BA=o(((e,t)=>{function n(e){return e?typeof e==`string`?e:e.source:null}function r(e){return i(`(?=`,e,`)`)}function i(...e){return e.map(e=>n(e)).join(``)}function a(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function o(...e){return`(`+(a(e).capture?``:`?:`)+e.map(e=>n(e)).join(`|`)+`)`}var s=e=>i(/\b/,e,/\w$/.test(e)?/\b/:/\B/),c=[`Protocol`,`Type`].map(s),l=[`init`,`self`].map(s),u=[`Any`,`Self`],d=[`actor`,`any`,`associatedtype`,`async`,`await`,/as\?/,/as!/,`as`,`borrowing`,`break`,`case`,`catch`,`class`,`consume`,`consuming`,`continue`,`convenience`,`copy`,`default`,`defer`,`deinit`,`didSet`,`distributed`,`do`,`dynamic`,`each`,`else`,`enum`,`extension`,`fallthrough`,/fileprivate\(set\)/,`fileprivate`,`final`,`for`,`func`,`get`,`guard`,`if`,`import`,`indirect`,`infix`,/init\?/,/init!/,`inout`,/internal\(set\)/,`internal`,`in`,`is`,`isolated`,`nonisolated`,`lazy`,`let`,`macro`,`mutating`,`nonmutating`,/open\(set\)/,`open`,`operator`,`optional`,`override`,`package`,`postfix`,`precedencegroup`,`prefix`,/private\(set\)/,`private`,`protocol`,/public\(set\)/,`public`,`repeat`,`required`,`rethrows`,`return`,`set`,`some`,`static`,`struct`,`subscript`,`super`,`switch`,`throws`,`throw`,/try\?/,/try!/,`try`,`typealias`,/unowned\(safe\)/,/unowned\(unsafe\)/,`unowned`,`var`,`weak`,`where`,`while`,`willSet`],f=[`false`,`nil`,`true`],p=[`assignment`,`associativity`,`higherThan`,`left`,`lowerThan`,`none`,`right`],m=[`#colorLiteral`,`#column`,`#dsohandle`,`#else`,`#elseif`,`#endif`,`#error`,`#file`,`#fileID`,`#fileLiteral`,`#filePath`,`#function`,`#if`,`#imageLiteral`,`#keyPath`,`#line`,`#selector`,`#sourceLocation`,`#warning`],h=`abs.all.any.assert.assertionFailure.debugPrint.dump.fatalError.getVaList.isKnownUniquelyReferenced.max.min.numericCast.pointwiseMax.pointwiseMin.precondition.preconditionFailure.print.readLine.repeatElement.sequence.stride.swap.swift_unboxFromSwiftValueWithType.transcode.type.unsafeBitCast.unsafeDowncast.withExtendedLifetime.withUnsafeMutablePointer.withUnsafePointer.withVaList.withoutActuallyEscaping.zip`.split(`.`),g=o(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),_=o(g,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),v=i(g,_,`*`),y=o(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),b=o(y,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),x=i(y,b,`*`),S=i(/[A-Z]/,b,`*`),C=[`attached`,`autoclosure`,i(/convention\(/,o(`swift`,`block`,`c`),/\)/),`discardableResult`,`dynamicCallable`,`dynamicMemberLookup`,`escaping`,`freestanding`,`frozen`,`GKInspectable`,`IBAction`,`IBDesignable`,`IBInspectable`,`IBOutlet`,`IBSegueAction`,`inlinable`,`main`,`nonobjc`,`NSApplicationMain`,`NSCopying`,`NSManaged`,i(/objc\(/,x,/\)/),`objc`,`objcMembers`,`propertyWrapper`,`requires_stored_property_inits`,`resultBuilder`,`Sendable`,`testable`,`UIApplicationMain`,`unchecked`,`unknown`,`usableFromInline`,`warn_unqualified_access`],w=[`iOS`,`iOSApplicationExtension`,`macOS`,`macOSApplicationExtension`,`macCatalyst`,`macCatalystApplicationExtension`,`watchOS`,`watchOSApplicationExtension`,`tvOS`,`tvOSApplicationExtension`,`swift`];function T(e){let t={match:/\s+/,relevance:0},n=e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),a=[e.C_LINE_COMMENT_MODE,n],g={match:[/\./,o(...c,...l)],className:{2:`keyword`}},y={match:i(/\./,o(...d)),relevance:0},T=d.filter(e=>typeof e==`string`).concat([`_|0`]),E={variants:[{className:`keyword`,match:o(...d.filter(e=>typeof e!=`string`).concat(u).map(s),...l)}]},D={$pattern:o(/\b\w+/,/#\w+/),keyword:T.concat(m),literal:f},O=[g,y,E],k=[{match:i(/\./,o(...h)),relevance:0},{className:`built_in`,match:i(/\b/,o(...h),/(?=\()/)}],A={match:/->/,relevance:0},j=[A,{className:`operator`,relevance:0,variants:[{match:v},{match:`\\.(\\.|${_})+`}]}],M=`([0-9]_*)+`,N=`([0-9a-fA-F]_*)+`,P={className:`number`,relevance:0,variants:[{match:`\\b(${M})(\\.(${M}))?([eE][+-]?(${M}))?\\b`},{match:`\\b0x(${N})(\\.(${N}))?([pP][+-]?(${M}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},F=(e=``)=>({className:`subst`,variants:[{match:i(/\\/,e,/[0\\tnr"']/)},{match:i(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),I=(e=``)=>({className:`subst`,match:i(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),L=(e=``)=>({className:`subst`,label:`interpol`,begin:i(/\\/,e,/\(/),end:/\)/}),R=(e=``)=>({begin:i(e,/"""/),end:i(/"""/,e),contains:[F(e),I(e),L(e)]}),z=(e=``)=>({begin:i(e,/"/),end:i(/"/,e),contains:[F(e),L(e)]}),ee={className:`string`,variants:[R(),R(`#`),R(`##`),R(`###`),z(),z(`#`),z(`##`),z(`###`)]},te=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],B={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:te},V=e=>{let t=i(e,/\//),n=i(/\//,e);return{begin:t,end:n,contains:[...te,{scope:`comment`,begin:`#(?!.*${n})`,end:/$/}]}},H={scope:`regexp`,variants:[V(`###`),V(`##`),V(`#`),B]},ne={match:i(/`/,x,/`/)},re=[ne,{className:`variable`,match:/\$\d+/},{className:`variable`,match:`\\$${b}+`}],ie=[{match:/(@|#(un)?)available/,scope:`keyword`,starts:{contains:[{begin:/\(/,end:/\)/,keywords:w,contains:[...j,P,ee]}]}},{scope:`keyword`,match:i(/@/,o(...C),r(o(/\(/,/\s+/)))},{scope:`meta`,match:i(/@/,x)}],ae={match:r(/\b[A-Z]/),relevance:0,contains:[{className:`type`,match:i(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,b,`+`)},{className:`type`,match:S,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:i(/\s+&\s+/,r(S)),relevance:0}]},oe={begin:/</,end:/>/,keywords:D,contains:[...a,...O,...ie,A,ae]};ae.contains.push(oe);let se={begin:/\(/,end:/\)/,relevance:0,keywords:D,contains:[`self`,{match:i(x,/\s*:/),keywords:`_|0`,relevance:0},...a,H,...O,...k,...j,P,ee,...re,...ie,ae]},ce={begin:/</,end:/>/,keywords:`repeat each`,contains:[...a,ae]},le={begin:/\(/,end:/\)/,keywords:D,contains:[{begin:o(r(i(x,/\s*:/)),r(i(x,/\s+/,x,/\s*:/))),end:/:/,relevance:0,contains:[{className:`keyword`,match:/\b_\b/},{className:`params`,match:x}]},...a,...O,...j,P,ee,...ie,ae,se],endsParent:!0,illegal:/["']/},ue={match:[/(func|macro)/,/\s+/,o(ne.match,x,v)],className:{1:`keyword`,3:`title.function`},contains:[ce,le,t],illegal:[/\[/,/%/]},U={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:`keyword`},contains:[ce,le,t],illegal:/\[|%/},de={match:[/operator/,/\s+/,v],className:{1:`keyword`,3:`title`}},fe={begin:[/precedencegroup/,/\s+/,S],className:{1:`keyword`,3:`title`},contains:[ae],keywords:[...p,...f],end:/}/},pe={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:`keyword`,3:`keyword`,5:`title.function`}},me={match:[/class\b/,/\s+/,/var\b/],scope:{1:`keyword`,3:`keyword`}},he={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,x,/\s*/],beginScope:{1:`keyword`,3:`title.class`},keywords:D,contains:[ce,...O,{begin:/:/,end:/\{/,keywords:D,contains:[{scope:`title.class.inherited`,match:S},...O],relevance:0}]};for(let e of ee.variants){let t=e.contains.find(e=>e.label===`interpol`);t.keywords=D;let n=[...O,...k,...j,P,ee,...re];t.contains=[...n,{begin:/\(/,end:/\)/,contains:[`self`,...n]}]}return{name:`Swift`,keywords:D,contains:[...a,ue,U,pe,me,he,de,fe,{beginKeywords:`import`,end:/$/,contains:[...a],relevance:0},H,...O,...k,...j,P,ee,...re,...ie,ae,se]}}t.exports=T})),VA=o(((e,t)=>{function n(e){return{name:`Tagger Script`,contains:[{className:`comment`,begin:/\$noop\(/,end:/\)/,contains:[{begin:/\\[()]/},{begin:/\(/,end:/\)/,contains:[{begin:/\\[()]/},`self`]}],relevance:10},{className:`keyword`,begin:/\$[_a-zA-Z0-9]+(?=\()/},{className:`variable`,begin:/%[_a-zA-Z0-9:]+%/},{className:`symbol`,begin:/\\[\\nt$%,()]/},{className:`symbol`,begin:/\\u[a-fA-F0-9]{4}/}]}}t.exports=n})),HA=o(((e,t)=>{function n(e){let t=`true false yes no null`,n=`[\\w#;/?:@&=+$,.~*'()[\\]]+`,r={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},o={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},l={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:`\\n`,relevance:0},d={begin:`\\[`,end:`\\]`,contains:[l],illegal:`\\n`,relevance:0},f=[r,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+!`+n},{className:`type`,begin:`!<`+n+`>`},{className:`type`,begin:`!`+n},{className:`type`,begin:`!!`+n},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},c,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:f}}t.exports=n})),UA=o(((e,t)=>{function n(e){return{name:`Test Anything Protocol`,case_insensitive:!0,contains:[e.HASH_COMMENT_MODE,{className:`meta`,variants:[{begin:`^TAP version (\\d+)$`},{begin:`^1\\.\\.(\\d+)$`}]},{begin:/---$/,end:`\\.\\.\\.$`,subLanguage:`yaml`,relevance:0},{className:`number`,begin:` (\\d+) `},{className:`symbol`,variants:[{begin:`^ok`},{begin:`^not ok`}]}]}}t.exports=n})),WA=o(((e,t)=>{function n(e){let t=e.regex,n=/[a-zA-Z_][a-zA-Z0-9_]*/,r={className:`number`,variants:[e.BINARY_NUMBER_MODE,e.C_NUMBER_MODE]};return{name:`Tcl`,aliases:[`tk`],keywords:`after.append.apply.array.auto_execok.auto_import.auto_load.auto_mkindex.auto_mkindex_old.auto_qualify.auto_reset.bgerror.binary.break.catch.cd.chan.clock.close.concat.continue.dde.dict.encoding.eof.error.eval.exec.exit.expr.fblocked.fconfigure.fcopy.file.fileevent.filename.flush.for.foreach.format.gets.glob.global.history.http.if.incr.info.interp.join.lappend|10.lassign|10.lindex|10.linsert|10.list.llength|10.load.lrange|10.lrepeat|10.lreplace|10.lreverse|10.lsearch|10.lset|10.lsort|10.mathfunc.mathop.memory.msgcat.namespace.open.package.parray.pid.pkg::create.pkg_mkIndex.platform.platform::shell.proc.puts.pwd.read.refchan.regexp.registry.regsub|10.rename.return.safe.scan.seek.set.socket.source.split.string.subst.switch.tcl_endOfWord.tcl_findLibrary.tcl_startOfNextWord.tcl_startOfPreviousWord.tcl_wordBreakAfter.tcl_wordBreakBefore.tcltest.tclvars.tell.time.tm.trace.unknown.unload.unset.update.uplevel.upvar.variable.vwait.while`.split(`.`),contains:[e.COMMENT(`;[ \\t]*#`,`$`),e.COMMENT(`^[ \\t]*#`,`$`),{beginKeywords:`proc`,end:`[\\{]`,excludeEnd:!0,contains:[{className:`title`,begin:`[ \\t\\n\\r]+(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*`,end:`[ \\t\\n\\r]`,endsWithParent:!0,excludeEnd:!0}]},{className:`variable`,variants:[{begin:t.concat(/\$/,t.optional(/::/),n,`(::`,n,`)*`)},{begin:`\\$\\{(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*`,end:`\\}`,contains:[r]}]},{className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[e.inherit(e.QUOTE_STRING_MODE,{illegal:null})]},r]}}t.exports=n})),GA=o(((e,t)=>{function n(e){let t=[`bool`,`byte`,`i16`,`i32`,`i64`,`double`,`string`,`binary`];return{name:`Thrift`,keywords:{keyword:[`namespace`,`const`,`typedef`,`struct`,`enum`,`service`,`exception`,`void`,`oneway`,`set`,`list`,`map`,`required`,`optional`],type:t,literal:`true false`},contains:[e.QUOTE_STRING_MODE,e.NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`class`,beginKeywords:`struct enum service exception`,end:/\{/,illegal:/\n/,contains:[e.inherit(e.TITLE_MODE,{starts:{endsWithParent:!0,excludeEnd:!0}})]},{begin:`\\b(set|list|map)\\s*<`,keywords:{type:[...t,`set`,`list`,`map`]},end:`>`,contains:[`self`]}]}}t.exports=n})),KA=o(((e,t)=>{function n(e){let t={className:`number`,begin:`[1-9][0-9]*`,relevance:0},n={className:`symbol`,begin:`:[^\\]]+`};return{name:`TP`,keywords:{keyword:`ABORT.ACC.ADJUST.AND.AP_LD.BREAK.CALL.CNT.COL.CONDITION.CONFIG.DA.DB.DIV.DETECT.ELSE.END.ENDFOR.ERR_NUM.ERROR_PROG.FINE.FOR.GP.GUARD.INC.IF.JMP.LINEAR_MAX_SPEED.LOCK.MOD.MONITOR.OFFSET.Offset.OR.OVERRIDE.PAUSE.PREG.PTH.RT_LD.RUN.SELECT.SKIP.Skip.TA.TB.TO.TOOL_OFFSET.Tool_Offset.UF.UT.UFRAME_NUM.UTOOL_NUM.UNLOCK.WAIT.X.Y.Z.W.P.R.STRLEN.SUBSTR.FINDSTR.VOFFSET.PROG.ATTR.MN.POS`.split(`.`),literal:[`ON`,`OFF`,`max_speed`,`LPOS`,`JPOS`,`ENABLE`,`DISABLE`,`START`,`STOP`,`RESET`]},contains:[{className:`built_in`,begin:`(AR|P|PAYLOAD|PR|R|SR|RSR|LBL|VR|UALM|MESSAGE|UTOOL|UFRAME|TIMER|TIMER_OVERFLOW|JOINT_MAX_SPEED|RESUME_PROG|DIAG_REC)\\[`,end:`\\]`,contains:[`self`,t,n]},{className:`built_in`,begin:`(AI|AO|DI|DO|F|RI|RO|UI|UO|GI|GO|SI|SO)\\[`,end:`\\]`,contains:[`self`,t,e.QUOTE_STRING_MODE,n]},{className:`keyword`,begin:`/(PROG|ATTR|MN|POS|END)\\b`},{className:`keyword`,begin:`(CALL|RUN|POINT_LOGIC|LBL)\\b`},{className:`keyword`,begin:`\\b(ACC|CNT|Skip|Offset|PSPD|RT_LD|AP_LD|Tool_Offset)`},{className:`number`,begin:`\\d+(sec|msec|mm/sec|cm/min|inch/min|deg/sec|mm|in|cm)?\\b`,relevance:0},e.COMMENT(`//`,`[;$]`),e.COMMENT(`!`,`[;$]`),e.COMMENT(`--eg:`,`$`),e.QUOTE_STRING_MODE,{className:`string`,begin:`'`,end:`'`},e.C_NUMBER_MODE,{className:`variable`,begin:`\\$[A-Za-z0-9_]+`}]}}t.exports=n})),qA=o(((e,t)=>{function n(e){let t=e.regex,n=`absolute_url.asset|0.asset_version.attribute.block.constant.controller|0.country_timezones.csrf_token.cycle.date.dump.expression.form|0.form_end.form_errors.form_help.form_label.form_rest.form_row.form_start.form_widget.html_classes.include.is_granted.logout_path.logout_url.max.min.parent.path|0.random.range.relative_path.render.render_esi.source.template_from_string.url|0`.split(`.`),r=`abs.abbr_class.abbr_method.batch.capitalize.column.convert_encoding.country_name.currency_name.currency_symbol.data_uri.date.date_modify.default.escape.file_excerpt.file_link.file_relative.filter.first.format.format_args.format_args_as_text.format_currency.format_date.format_datetime.format_file.format_file_from_text.format_number.format_time.html_to_markdown.humanize.inky_to_html.inline_css.join.json_encode.keys.language_name.last.length.locale_name.lower.map.markdown.markdown_to_html.merge.nl2br.number_format.raw.reduce.replace.reverse.round.slice.slug.sort.spaceless.split.striptags.timezone_name.title.trans.transchoice.trim.u|0.upper.url_encode.yaml_dump.yaml_encode`.split(`.`),i=`apply.autoescape.block.cache.deprecated.do.embed.extends.filter.flush.for.form_theme.from.if.import.include.macro.sandbox.set.stopwatch.trans.trans_default_domain.transchoice.use.verbatim.with`.split(`.`);i=i.concat(i.map(e=>`end${e}`));let a={scope:`string`,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/}]},o={scope:`number`,match:/\d+/},s={begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,contains:[a,o]},c={beginKeywords:n.join(` `),keywords:{name:n},relevance:0,contains:[s]},l={match:/\|(?=[A-Za-z_]+:?)/,beginScope:`punctuation`,relevance:0,contains:[{match:/[A-Za-z_]+:?/,keywords:r}]},u=(e,{relevance:n})=>({beginScope:{1:`template-tag`,3:`name`},relevance:n||2,endScope:`template-tag`,begin:[/\{%/,/\s*/,t.either(...e)],end:/%\}/,keywords:`in`,contains:[l,c,a,o]}),d=/[a-z_]+/,f=u(i,{relevance:2}),p=u([d],{relevance:1});return{name:`Twig`,aliases:[`craftcms`],case_insensitive:!0,subLanguage:`xml`,contains:[e.COMMENT(/\{#/,/#\}/),f,p,{className:`template-variable`,begin:/\{\{/,end:/\}\}/,contains:[`self`,l,c,a,o]}]}}t.exports=n})),JA=o(((e,t)=>{var n=`[A-Za-z$_][0-9A-Za-z$_]*`,r=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),i=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],a=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),o=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],s=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],c=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],l=[].concat(s,a,o);function u(e){let t=e.regex,u=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},d=n,f={begin:`<>`,end:`</>`},p=/<[A-Za-z0-9\\._:-]+\s*\/>/,m={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let n=e[0].length+e.index,r=e.input[n];if(r===`<`||r===`,`){t.ignoreMatch();return}r===`>`&&(u(e,{after:n})||t.ignoreMatch());let i,a=e.input.substring(n);if(i=a.match(/^\s*=/)){t.ignoreMatch();return}if((i=a.match(/^\s+extends\s+/))&&i.index===0){t.ignoreMatch();return}}},h={$pattern:n,keyword:r,literal:i,built_in:l,"variable.language":c},g=`[0-9](_?[0-9])*`,_=`\\.(${g})`,v=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,y={className:`number`,variants:[{begin:`(\\b(${v})((${_})|\\.)?|(${_}))[eE][+-]?(${g})\\b`},{begin:`\\b(${v})\\b((${_})\\b|\\.)?|(${_})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},b={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:h,contains:[]},x={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:`xml`}},S={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:`css`}},C={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:`graphql`}},w={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,b]},T={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:d+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},E=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,S,C,w,{match:/\$\d+/},y];b.contains=E.concat({begin:/\{/,end:/\}/,keywords:h,contains:[`self`].concat(E)});let D=[].concat(T,b.contains),O=D.concat([{begin:/(\s*)\(/,end:/\)/,keywords:h,contains:[`self`].concat(D)}]),k={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:O},A={variants:[{match:[/class/,/\s+/,d,/\s+/,/extends/,/\s+/,t.concat(d,`(`,t.concat(/\./,d),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,d],scope:{1:`keyword`,3:`title.class`}}]},j={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...a,...o]}},M={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},N={variants:[{match:[/function/,/\s+/,d,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[k],illegal:/%/},P={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function F(e){return t.concat(`(?!`,e.join(`|`),`)`)}let I={match:t.concat(/\b/,F([...s,`super`,`import`].map(e=>`${e}\\s*\\(`)),d,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(d,/(?![0-9A-Za-z$_(])/))),end:d,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},R={match:[/get|set/,/\s+/,d,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},k]},z=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,ee={match:[/const|var|let/,/\s+/,d,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[k]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:h,exports:{PARAMS_CONTAINS:O,CLASS_REFERENCE:j},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),M,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,S,C,w,T,{match:/\$\d+/},y,j,{scope:`attr`,match:d+t.lookahead(`:`),relevance:0},ee,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[T,e.REGEXP_MODE,{className:`function`,begin:z,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:O}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:f.begin,end:f.end},{match:p},{begin:m.begin,"on:begin":m.isTrulyOpeningTag,end:m.end}],subLanguage:`xml`,contains:[{begin:m.begin,end:m.end,skip:!0,contains:[`self`]}]}]},N,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[k,e.inherit(e.TITLE_MODE,{begin:d,className:`title.function`})]},{match:/\.\.\./,relevance:0},L,{match:`\\$`+d,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[k]},I,P,A,R,{match:/\$[(.]/}]}}function d(e){let t=e.regex,a=u(e),o=n,s=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],d={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},f={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:s},contains:[a.exports.CLASS_REFERENCE]},p={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},m={$pattern:n,keyword:r.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:i,built_in:l.concat(s),"variable.language":c},h={className:`meta`,begin:`@`+o},g=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(a.keywords,m),a.exports.PARAMS_CONTAINS.push(h);let _=a.contains.find(e=>e.scope===`attr`),v=Object.assign({},_,{match:t.concat(o,t.lookahead(/\s*\?:/))});a.exports.PARAMS_CONTAINS.push([a.exports.CLASS_REFERENCE,_,v]),a.contains=a.contains.concat([h,d,f,v]),g(a,`shebang`,e.SHEBANG()),g(a,`use_strict`,p);let y=a.contains.find(e=>e.label===`func.def`);return y.relevance=0,Object.assign(a,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),a}t.exports=d})),YA=o(((e,t)=>{function n(e){return{name:`Vala`,keywords:{keyword:`char uchar unichar int uint long ulong short ushort int8 int16 int32 int64 uint8 uint16 uint32 uint64 float double bool struct enum string void weak unowned owned async signal static abstract interface override virtual delegate if while do for foreach else switch case break default return try catch public private protected internal using new this get set const stdout stdin stderr var`,built_in:`DBus GLib CCode Gee Object Gtk Posix`,literal:`false true null`},contains:[{className:`class`,beginKeywords:`class interface namespace`,end:/\{/,excludeEnd:!0,illegal:`[^,:\\n\\s\\.]`,contains:[e.UNDERSCORE_TITLE_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`string`,begin:`"""`,end:`"""`,relevance:5},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.C_NUMBER_MODE,{className:`meta`,begin:`^#`,end:`$`}]}}t.exports=n})),XA=o(((e,t)=>{function n(e){let t=e.regex,n={className:`string`,begin:/"(""|[^/n])"C\b/},r={className:`string`,begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,s=/\d{1,2}(:\d{1,2}){1,2}/,c={className:`literal`,variants:[{begin:t.concat(/# */,t.either(a,i),/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(a,i),/ +/,t.either(o,s),/ *#/)}]},l={className:`number`,relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:`label`,begin:/^\w+:/},d=e.COMMENT(/'''/,/$/,{contains:[{className:`doctag`,begin:/<\/?/,end:/>/}]}),f=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:`Visual Basic .NET`,aliases:[`vb`],case_insensitive:!0,classNameAliases:{label:`symbol`},keywords:{keyword:`addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield`,built_in:`addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort`,type:`boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort`,literal:`true false nothing`},illegal:`//|\\{|\\}|endif|gosub|variant|wend|^\\$ `,contains:[n,r,c,l,u,d,f,{className:`meta`,begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:`const disable else elseif enable end externalsource if region then`},contains:[f]}]}}t.exports=n})),ZA=o(((e,t)=>{function n(e){let t=e.regex,n=`lcase.month.vartype.instrrev.ubound.setlocale.getobject.rgb.getref.string.weekdayname.rnd.dateadd.monthname.now.day.minute.isarray.cbool.round.formatcurrency.conversions.csng.timevalue.second.year.space.abs.clng.timeserial.fixs.len.asc.isempty.maths.dateserial.atn.timer.isobject.filter.weekday.datevalue.ccur.isdate.instr.datediff.formatdatetime.replace.isnull.right.sgn.array.snumeric.log.cdbl.hex.chr.lbound.msgbox.ucase.getlocale.cos.cdate.cbyte.rtrim.join.hour.oct.typename.trim.strcomp.int.createobject.loadpicture.tan.formatnumber.mid.split.cint.sin.datepart.ltrim.sqr.time.derived.eval.date.formatpercent.exp.inputbox.left.ascw.chrw.regexp.cstr.err`.split(`.`),r=[`server`,`response`,`request`,`scriptengine`,`scriptenginebuildversion`,`scriptengineminorversion`,`scriptenginemajorversion`],i={begin:t.concat(t.either(...n),`\\s*\\(`),relevance:0,keywords:{built_in:n}};return{name:`VBScript`,aliases:[`vbs`],case_insensitive:!0,keywords:{keyword:`call.class.const.dim.do.loop.erase.execute.executeglobal.exit.for.each.next.function.if.then.else.on.error.option.explicit.new.private.property.let.get.public.randomize.redim.rem.select.case.set.stop.sub.while.wend.with.end.to.elseif.is.or.xor.and.not.class_initialize.class_terminate.default.preserve.in.me.byval.byref.step.resume.goto`.split(`.`),built_in:r,literal:[`true`,`false`,`null`,`nothing`,`empty`]},illegal:`//`,contains:[i,e.inherit(e.QUOTE_STRING_MODE,{contains:[{begin:`""`}]}),e.COMMENT(/'/,/$/,{relevance:0}),e.C_NUMBER_MODE]}}t.exports=n})),QA=o(((e,t)=>{function n(e){return{name:`VBScript in HTML`,subLanguage:`xml`,contains:[{begin:`<%`,end:`%>`,subLanguage:`vbscript`}]}}t.exports=n})),$A=o(((e,t)=>{function n(e){let t=e.regex,n={$pattern:/\$?[\w]+(\$[\w]+)*/,keyword:`accept_on.alias.always.always_comb.always_ff.always_latch.and.assert.assign.assume.automatic.before.begin.bind.bins.binsof.bit.break.buf|0.bufif0.bufif1.byte.case.casex.casez.cell.chandle.checker.class.clocking.cmos.config.const.constraint.context.continue.cover.covergroup.coverpoint.cross.deassign.default.defparam.design.disable.dist.do.edge.else.end.endcase.endchecker.endclass.endclocking.endconfig.endfunction.endgenerate.endgroup.endinterface.endmodule.endpackage.endprimitive.endprogram.endproperty.endspecify.endsequence.endtable.endtask.enum.event.eventually.expect.export.extends.extern.final.first_match.for.force.foreach.forever.fork.forkjoin.function.generate|5.genvar.global.highz0.highz1.if.iff.ifnone.ignore_bins.illegal_bins.implements.implies.import.incdir.include.initial.inout.input.inside.instance.int.integer.interconnect.interface.intersect.join.join_any.join_none.large.let.liblist.library.local.localparam.logic.longint.macromodule.matches.medium.modport.module.nand.negedge.nettype.new.nexttime.nmos.nor.noshowcancelled.not.notif0.notif1.or.output.package.packed.parameter.pmos.posedge.primitive.priority.program.property.protected.pull0.pull1.pulldown.pullup.pulsestyle_ondetect.pulsestyle_onevent.pure.rand.randc.randcase.randsequence.rcmos.real.realtime.ref.reg.reject_on.release.repeat.restrict.return.rnmos.rpmos.rtran.rtranif0.rtranif1.s_always.s_eventually.s_nexttime.s_until.s_until_with.scalared.sequence.shortint.shortreal.showcancelled.signed.small.soft.solve.specify.specparam.static.string.strong.strong0.strong1.struct.super.supply0.supply1.sync_accept_on.sync_reject_on.table.tagged.task.this.throughout.time.timeprecision.timeunit.tran.tranif0.tranif1.tri.tri0.tri1.triand.trior.trireg.type.typedef.union.unique.unique0.unsigned.until.until_with.untyped.use.uwire.var.vectored.virtual.void.wait.wait_order.wand.weak.weak0.weak1.while.wildcard.wire.with.within.wor.xnor.xor`.split(`.`),literal:[`null`],built_in:`$finish.$stop.$exit.$fatal.$error.$warning.$info.$realtime.$time.$printtimescale.$bitstoreal.$bitstoshortreal.$itor.$signed.$cast.$bits.$stime.$timeformat.$realtobits.$shortrealtobits.$rtoi.$unsigned.$asserton.$assertkill.$assertpasson.$assertfailon.$assertnonvacuouson.$assertoff.$assertcontrol.$assertpassoff.$assertfailoff.$assertvacuousoff.$isunbounded.$sampled.$fell.$changed.$past_gclk.$fell_gclk.$changed_gclk.$rising_gclk.$steady_gclk.$coverage_control.$coverage_get.$coverage_save.$set_coverage_db_name.$rose.$stable.$past.$rose_gclk.$stable_gclk.$future_gclk.$falling_gclk.$changing_gclk.$display.$coverage_get_max.$coverage_merge.$get_coverage.$load_coverage_db.$typename.$unpacked_dimensions.$left.$low.$increment.$clog2.$ln.$log10.$exp.$sqrt.$pow.$floor.$ceil.$sin.$cos.$tan.$countbits.$onehot.$isunknown.$fatal.$warning.$dimensions.$right.$high.$size.$asin.$acos.$atan.$atan2.$hypot.$sinh.$cosh.$tanh.$asinh.$acosh.$atanh.$countones.$onehot0.$error.$info.$random.$dist_chi_square.$dist_erlang.$dist_exponential.$dist_normal.$dist_poisson.$dist_t.$dist_uniform.$q_initialize.$q_remove.$q_exam.$async$and$array.$async$nand$array.$async$or$array.$async$nor$array.$sync$and$array.$sync$nand$array.$sync$or$array.$sync$nor$array.$q_add.$q_full.$psprintf.$async$and$plane.$async$nand$plane.$async$or$plane.$async$nor$plane.$sync$and$plane.$sync$nand$plane.$sync$or$plane.$sync$nor$plane.$system.$display.$displayb.$displayh.$displayo.$strobe.$strobeb.$strobeh.$strobeo.$write.$readmemb.$readmemh.$writememh.$value$plusargs.$dumpvars.$dumpon.$dumplimit.$dumpports.$dumpportson.$dumpportslimit.$writeb.$writeh.$writeo.$monitor.$monitorb.$monitorh.$monitoro.$writememb.$dumpfile.$dumpoff.$dumpall.$dumpflush.$dumpportsoff.$dumpportsall.$dumpportsflush.$fclose.$fdisplay.$fdisplayb.$fdisplayh.$fdisplayo.$fstrobe.$fstrobeb.$fstrobeh.$fstrobeo.$swrite.$swriteb.$swriteh.$swriteo.$fscanf.$fread.$fseek.$fflush.$feof.$fopen.$fwrite.$fwriteb.$fwriteh.$fwriteo.$fmonitor.$fmonitorb.$fmonitorh.$fmonitoro.$sformat.$sformatf.$fgetc.$ungetc.$fgets.$sscanf.$rewind.$ftell.$ferror`.split(`.`)},r=[`__FILE__`,`__LINE__`],i=`begin_keywords.celldefine.default_nettype.default_decay_time.default_trireg_strength.define.delay_mode_distributed.delay_mode_path.delay_mode_unit.delay_mode_zero.else.elsif.end_keywords.endcelldefine.endif.ifdef.ifndef.include.line.nounconnected_drive.pragma.resetall.timescale.unconnected_drive.undef.undefineall`.split(`.`);return{name:`Verilog`,aliases:[`v`,`sv`,`svh`],case_insensitive:!1,keywords:n,contains:[e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.QUOTE_STRING_MODE,{scope:`number`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/\b((\d+'([bhodBHOD]))[0-9xzXZa-fA-F_]+)/},{begin:/\B(('([bhodBHOD]))[0-9xzXZa-fA-F_]+)/},{begin:/\b[0-9][0-9_]*/,relevance:0}]},{scope:`variable`,variants:[{begin:`#\\((?!parameter).+\\)`},{begin:`\\.\\w+`,relevance:0}]},{scope:`variable.constant`,match:t.concat(/`/,t.either(...r))},{scope:`meta`,begin:t.concat(/`/,t.either(...i)),end:/$|\/\/|\/\*/,returnEnd:!0,keywords:i}]}}t.exports=n})),ej=o(((e,t)=>{function n(e){let t=`\\d(_|\\d)*`;return``+t,t+``,t+``,{name:`VHDL`,case_insensitive:!0,keywords:{keyword:`abs.access.after.alias.all.and.architecture.array.assert.assume.assume_guarantee.attribute.begin.block.body.buffer.bus.case.component.configuration.constant.context.cover.disconnect.downto.default.else.elsif.end.entity.exit.fairness.file.for.force.function.generate.generic.group.guarded.if.impure.in.inertial.inout.is.label.library.linkage.literal.loop.map.mod.nand.new.next.nor.not.null.of.on.open.or.others.out.package.parameter.port.postponed.procedure.process.property.protected.pure.range.record.register.reject.release.rem.report.restrict.restrict_guarantee.return.rol.ror.select.sequence.severity.shared.signal.sla.sll.sra.srl.strong.subtype.then.to.transport.type.unaffected.units.until.use.variable.view.vmode.vprop.vunit.wait.when.while.with.xnor.xor`.split(`.`),built_in:`boolean.bit.character.integer.time.delay_length.natural.positive.string.bit_vector.file_open_kind.file_open_status.std_logic.std_logic_vector.unsigned.signed.boolean_vector.integer_vector.std_ulogic.std_ulogic_vector.unresolved_unsigned.u_unsigned.unresolved_signed.u_signed.real_vector.time_vector`.split(`.`),literal:[`false`,`true`,`note`,`warning`,`error`,`failure`,`line`,`text`,`side`,`width`]},illegal:/\{/,contains:[e.C_BLOCK_COMMENT_MODE,e.COMMENT(`--`,`$`),e.QUOTE_STRING_MODE,{className:`number`,begin:`\\b(\\d(_|\\d)*#\\w+(\\.\\w+)?#([eE][-+]?\\d(_|\\d)*)?|\\d(_|\\d)*(\\.\\d(_|\\d)*)?([eE][-+]?\\d(_|\\d)*)?)`,relevance:0},{className:`string`,begin:`'(U|X|0|1|Z|W|L|H|-)'`,contains:[e.BACKSLASH_ESCAPE]},{className:`symbol`,begin:`'[A-Za-z](_?[A-Za-z0-9])*`,contains:[e.BACKSLASH_ESCAPE]}]}}t.exports=n})),tj=o(((e,t)=>{function n(e){return{name:`Vim Script`,keywords:{$pattern:/[!#@\w]+/,keyword:`N|0 P|0 X|0 a|0 ab abc abo al am an|0 ar arga argd arge argdo argg argl argu as au aug aun b|0 bN ba bad bd be bel bf bl bm bn bo bp br brea breaka breakd breakl bro bufdo buffers bun bw c|0 cN cNf ca cabc caddb cad caddf cal cat cb cc ccl cd ce cex cf cfir cgetb cgete cg changes chd che checkt cl cla clo cm cmapc cme cn cnew cnf cno cnorea cnoreme co col colo com comc comp con conf cope cp cpf cq cr cs cst cu cuna cunme cw delm deb debugg delc delf dif diffg diffo diffp diffpu diffs diffthis dig di dl dell dj dli do doautoa dp dr ds dsp e|0 ea ec echoe echoh echom echon el elsei em en endfo endf endt endw ene ex exe exi exu f|0 files filet fin fina fini fir fix fo foldc foldd folddoc foldo for fu go gr grepa gu gv ha helpf helpg helpt hi hid his ia iabc if ij il im imapc ime ino inorea inoreme int is isp iu iuna iunme j|0 ju k|0 keepa kee keepj lN lNf l|0 lad laddb laddf la lan lat lb lc lch lcl lcs le lefta let lex lf lfir lgetb lgete lg lgr lgrepa lh ll lla lli lmak lm lmapc lne lnew lnf ln loadk lo loc lockv lol lope lp lpf lr ls lt lu lua luad luaf lv lvimgrepa lw m|0 ma mak map mapc marks mat me menut mes mk mks mksp mkv mkvie mod mz mzf nbc nb nbs new nm nmapc nme nn nnoreme noa no noh norea noreme norm nu nun nunme ol o|0 om omapc ome on ono onoreme opt ou ounme ow p|0 profd prof pro promptr pc ped pe perld po popu pp pre prev ps pt ptN ptf ptj ptl ptn ptp ptr pts pu pw py3 python3 py3d py3f py pyd pyf quita qa rec red redi redr redraws reg res ret retu rew ri rightb rub rubyd rubyf rund ru rv sN san sa sal sav sb sbN sba sbf sbl sbm sbn sbp sbr scrip scripte scs se setf setg setl sf sfir sh sim sig sil sl sla sm smap smapc sme sn sni sno snor snoreme sor so spelld spe spelli spellr spellu spellw sp spr sre st sta startg startr star stopi stj sts sun sunm sunme sus sv sw sy synti sync tN tabN tabc tabdo tabe tabf tabfir tabl tabm tabnew tabn tabo tabp tabr tabs tab ta tags tc tcld tclf te tf th tj tl tm tn to tp tr try ts tu u|0 undoj undol una unh unl unlo unm unme uns up ve verb vert vim vimgrepa vi viu vie vm vmapc vme vne vn vnoreme vs vu vunme windo w|0 wN wa wh wi winc winp wn wp wq wqa ws wu wv x|0 xa xmapc xm xme xn xnoreme xu xunme y|0 z|0 ~ Next Print append abbreviate abclear aboveleft all amenu anoremenu args argadd argdelete argedit argglobal arglocal argument ascii autocmd augroup aunmenu buffer bNext ball badd bdelete behave belowright bfirst blast bmodified bnext botright bprevious brewind break breakadd breakdel breaklist browse bunload bwipeout change cNext cNfile cabbrev cabclear caddbuffer caddexpr caddfile call catch cbuffer cclose center cexpr cfile cfirst cgetbuffer cgetexpr cgetfile chdir checkpath checktime clist clast close cmap cmapclear cmenu cnext cnewer cnfile cnoremap cnoreabbrev cnoremenu copy colder colorscheme command comclear compiler continue confirm copen cprevious cpfile cquit crewind cscope cstag cunmap cunabbrev cunmenu cwindow delete delmarks debug debuggreedy delcommand delfunction diffupdate diffget diffoff diffpatch diffput diffsplit digraphs display deletel djump dlist doautocmd doautoall deletep drop dsearch dsplit edit earlier echo echoerr echohl echomsg else elseif emenu endif endfor endfunction endtry endwhile enew execute exit exusage file filetype find finally finish first fixdel fold foldclose folddoopen folddoclosed foldopen function global goto grep grepadd gui gvim hardcopy help helpfind helpgrep helptags highlight hide history insert iabbrev iabclear ijump ilist imap imapclear imenu inoremap inoreabbrev inoremenu intro isearch isplit iunmap iunabbrev iunmenu join jumps keepalt keepmarks keepjumps lNext lNfile list laddexpr laddbuffer laddfile last language later lbuffer lcd lchdir lclose lcscope left leftabove lexpr lfile lfirst lgetbuffer lgetexpr lgetfile lgrep lgrepadd lhelpgrep llast llist lmake lmap lmapclear lnext lnewer lnfile lnoremap loadkeymap loadview lockmarks lockvar lolder lopen lprevious lpfile lrewind ltag lunmap luado luafile lvimgrep lvimgrepadd lwindow move mark make mapclear match menu menutranslate messages mkexrc mksession mkspell mkvimrc mkview mode mzscheme mzfile nbclose nbkey nbsart next nmap nmapclear nmenu nnoremap nnoremenu noautocmd noremap nohlsearch noreabbrev noremenu normal number nunmap nunmenu oldfiles open omap omapclear omenu only onoremap onoremenu options ounmap ounmenu ownsyntax print profdel profile promptfind promptrepl pclose pedit perl perldo pop popup ppop preserve previous psearch ptag ptNext ptfirst ptjump ptlast ptnext ptprevious ptrewind ptselect put pwd py3do py3file python pydo pyfile quit quitall qall read recover redo redir redraw redrawstatus registers resize retab return rewind right rightbelow ruby rubydo rubyfile rundo runtime rviminfo substitute sNext sandbox sargument sall saveas sbuffer sbNext sball sbfirst sblast sbmodified sbnext sbprevious sbrewind scriptnames scriptencoding scscope set setfiletype setglobal setlocal sfind sfirst shell simalt sign silent sleep slast smagic smapclear smenu snext sniff snomagic snoremap snoremenu sort source spelldump spellgood spellinfo spellrepall spellundo spellwrong split sprevious srewind stop stag startgreplace startreplace startinsert stopinsert stjump stselect sunhide sunmap sunmenu suspend sview swapname syntax syntime syncbind tNext tabNext tabclose tabedit tabfind tabfirst tablast tabmove tabnext tabonly tabprevious tabrewind tag tcl tcldo tclfile tearoff tfirst throw tjump tlast tmenu tnext topleft tprevious trewind tselect tunmenu undo undojoin undolist unabbreviate unhide unlet unlockvar unmap unmenu unsilent update vglobal version verbose vertical vimgrep vimgrepadd visual viusage view vmap vmapclear vmenu vnew vnoremap vnoremenu vsplit vunmap vunmenu write wNext wall while winsize wincmd winpos wnext wprevious wqall wsverb wundo wviminfo xit xall xmapclear xmap xmenu xnoremap xnoremenu xunmap xunmenu yank`,built_in:`synIDtrans atan2 range matcharg did_filetype asin feedkeys xor argv complete_check add getwinposx getqflist getwinposy screencol clearmatches empty extend getcmdpos mzeval garbagecollect setreg ceil sqrt diff_hlID inputsecret get getfperm getpid filewritable shiftwidth max sinh isdirectory synID system inputrestore winline atan visualmode inputlist tabpagewinnr round getregtype mapcheck hasmapto histdel argidx findfile sha256 exists toupper getcmdline taglist string getmatches bufnr strftime winwidth bufexists strtrans tabpagebuflist setcmdpos remote_read printf setloclist getpos getline bufwinnr float2nr len getcmdtype diff_filler luaeval resolve libcallnr foldclosedend reverse filter has_key bufname str2float strlen setline getcharmod setbufvar index searchpos shellescape undofile foldclosed setqflist buflisted strchars str2nr virtcol floor remove undotree remote_expr winheight gettabwinvar reltime cursor tabpagenr finddir localtime acos getloclist search tanh matchend rename gettabvar strdisplaywidth type abs py3eval setwinvar tolower wildmenumode log10 spellsuggest bufloaded synconcealed nextnonblank server2client complete settabwinvar executable input wincol setmatches getftype hlID inputsave searchpair or screenrow line settabvar histadd deepcopy strpart remote_peek and eval getftime submatch screenchar winsaveview matchadd mkdir screenattr getfontname libcall reltimestr getfsize winnr invert pow getbufline byte2line soundfold repeat fnameescape tagfiles sin strwidth spellbadword trunc maparg log lispindent hostname setpos globpath remote_foreground getchar synIDattr fnamemodify cscope_connection stridx winbufnr indent min complete_add nr2char searchpairpos inputdialog values matchlist items hlexists strridx browsedir expand fmod pathshorten line2byte argc count getwinvar glob foldtextresult getreg foreground cosh matchdelete has char2nr simplify histget searchdecl iconv winrestcmd pumvisible writefile foldlevel haslocaldir keys cos matchstr foldtext histnr tan tempname getcwd byteidx getbufvar islocked escape eventhandler remote_send serverlist winrestview synstack pyeval prevnonblank readfile cindent filereadable changenr exp`},illegal:/;/,contains:[e.NUMBER_MODE,{className:`string`,begin:`'`,end:`'`,illegal:`\\n`},{className:`string`,begin:/"(\\"|\n\\|[^"\n])*"/},e.COMMENT(`"`,`$`),{className:`variable`,begin:/[bwtglsav]:[\w\d_]+/},{begin:[/\b(?:function|function!)/,/\s+/,e.IDENT_RE],className:{1:`keyword`,3:`title`},end:`$`,relevance:0,contains:[{className:`params`,begin:`\\(`,end:`\\)`}]},{className:`symbol`,begin:/<[\w-]+>/}]}}t.exports=n})),nj=o(((e,t)=>{function n(e){e.regex;let t=e.COMMENT(/\(;/,/;\)/);t.contains.push(`self`);let n=e.COMMENT(/;;/,/$/),r=`anyfunc,block,br,br_if,br_table,call,call_indirect,data,drop,elem,else,end,export,func,global.get,global.set,local.get,local.set,local.tee,get_global,get_local,global,if,import,local,loop,memory,memory.grow,memory.size,module,mut,nop,offset,param,result,return,select,set_global,set_local,start,table,tee_local,then,type,unreachable`.split(`,`),i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:`keyword`,3:`title.function`}},a={className:`variable`,begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:`punctuation`,relevance:0},s={className:`number`,relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:`type`},l={className:`keyword`,match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:`WebAssembly`,keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:`keyword`,3:`operator`}},a,o,i,e.QUOTE_STRING_MODE,c,l,s]}}t.exports=n})),rj=o(((e,t)=>{function n(e){let t=e.regex,n=/[a-zA-Z]\w*/,r=[`as`,`break`,`class`,`construct`,`continue`,`else`,`for`,`foreign`,`if`,`import`,`in`,`is`,`return`,`static`,`var`,`while`],i=[`true`,`false`,`null`],a=[`this`,`super`],o=[`Bool`,`Class`,`Fiber`,`Fn`,`List`,`Map`,`Null`,`Num`,`Object`,`Range`,`Sequence`,`String`,`System`],s=[`-`,`~`,/\*/,`%`,/\.\.\./,/\.\./,/\+/,`<<`,`>>`,`>=`,`<=`,`<`,`>`,/\^/,/!=/,/!/,/\bis\b/,`==`,`&&`,`&`,/\|\|/,/\|/,/\?:/,`=`],c={relevance:0,match:t.concat(/\b(?!(if|while|for|else|super)\b)/,n,/(?=\s*[({])/),className:`title.function`},l={match:t.concat(t.either(t.concat(/\b(?!(if|while|for|else|super)\b)/,n),t.either(...s)),/(?=\s*\([^)]+\)\s*\{)/),className:`title.function`,starts:{contains:[{begin:/\(/,end:/\)/,contains:[{relevance:0,scope:`params`,match:n}]}]}},u={variants:[{match:[/class\s+/,n,/\s+is\s+/,n]},{match:[/class\s+/,n]}],scope:{2:`title.class`,4:`title.class.inherited`},keywords:r},d={relevance:0,match:t.either(...s),className:`operator`},f={className:`string`,begin:/"""/,end:/"""/},p={className:`property`,begin:t.concat(/\./,t.lookahead(n)),end:n,excludeBegin:!0,relevance:0},m={relevance:0,match:t.concat(/\b_/,n),scope:`variable`},h={relevance:0,match:/\b[A-Z]+[a-z]+([A-Z]+[a-z]+)*/,scope:`title.class`,keywords:{_:o}},g=e.C_NUMBER_MODE,_={match:[n,/\s*/,/=/,/\s*/,/\(/,n,/\)\s*\{/],scope:{1:`title.function`,3:`operator`,6:`params`}},v=e.COMMENT(/\/\*\*/,/\*\//,{contains:[{match:/@[a-z]+/,scope:`doctag`},`self`]}),y={scope:`subst`,begin:/%\(/,end:/\)/,contains:[g,h,c,m,d]},b={scope:`string`,begin:/"/,end:/"/,contains:[y,{scope:`char.escape`,variants:[{match:/\\\\|\\["0%abefnrtv]/},{match:/\\x[0-9A-F]{2}/},{match:/\\u[0-9A-F]{4}/},{match:/\\U[0-9A-F]{8}/}]}]};y.contains.push(b);let x=[...r,...a,...i],S={relevance:0,match:t.concat(`\\b(?!`,x.join(`|`),`\\b)`,/[a-zA-Z_]\w*(?:[?!]|\b)/),className:`variable`},C={scope:`comment`,variants:[{begin:[/#!?/,/[A-Za-z_]+(?=\()/],beginScope:{},keywords:{literal:i},contains:[],end:/\)/},{begin:[/#!?/,/[A-Za-z_]+/],beginScope:{},end:/$/}]};return{name:`Wren`,keywords:{keyword:r,"variable.language":a,literal:i},contains:[C,g,b,f,v,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,h,u,_,l,c,d,m,p,S]}}t.exports=n})),ij=o(((e,t)=>{function n(e){return{name:`Intel x86 Assembly`,case_insensitive:!0,keywords:{$pattern:`[.%]?`+e.IDENT_RE,keyword:`lock rep repe repz repne repnz xaquire xrelease bnd nobnd aaa aad aam aas adc add and arpl bb0_reset bb1_reset bound bsf bsr bswap bt btc btr bts call cbw cdq cdqe clc cld cli clts cmc cmp cmpsb cmpsd cmpsq cmpsw cmpxchg cmpxchg486 cmpxchg8b cmpxchg16b cpuid cpu_read cpu_write cqo cwd cwde daa das dec div dmint emms enter equ f2xm1 fabs fadd faddp fbld fbstp fchs fclex fcmovb fcmovbe fcmove fcmovnb fcmovnbe fcmovne fcmovnu fcmovu fcom fcomi fcomip fcomp fcompp fcos fdecstp fdisi fdiv fdivp fdivr fdivrp femms feni ffree ffreep fiadd ficom ficomp fidiv fidivr fild fimul fincstp finit fist fistp fisttp fisub fisubr fld fld1 fldcw fldenv fldl2e fldl2t fldlg2 fldln2 fldpi fldz fmul fmulp fnclex fndisi fneni fninit fnop fnsave fnstcw fnstenv fnstsw fpatan fprem fprem1 fptan frndint frstor fsave fscale fsetpm fsin fsincos fsqrt fst fstcw fstenv fstp fstsw fsub fsubp fsubr fsubrp ftst fucom fucomi fucomip fucomp fucompp fxam fxch fxtract fyl2x fyl2xp1 hlt ibts icebp idiv imul in inc incbin insb insd insw int int01 int1 int03 int3 into invd invpcid invlpg invlpga iret iretd iretq iretw jcxz jecxz jrcxz jmp jmpe lahf lar lds lea leave les lfence lfs lgdt lgs lidt lldt lmsw loadall loadall286 lodsb lodsd lodsq lodsw loop loope loopne loopnz loopz lsl lss ltr mfence monitor mov movd movq movsb movsd movsq movsw movsx movsxd movzx mul mwait neg nop not or out outsb outsd outsw packssdw packsswb packuswb paddb paddd paddsb paddsiw paddsw paddusb paddusw paddw pand pandn pause paveb pavgusb pcmpeqb pcmpeqd pcmpeqw pcmpgtb pcmpgtd pcmpgtw pdistib pf2id pfacc pfadd pfcmpeq pfcmpge pfcmpgt pfmax pfmin pfmul pfrcp pfrcpit1 pfrcpit2 pfrsqit1 pfrsqrt pfsub pfsubr pi2fd pmachriw pmaddwd pmagw pmulhriw pmulhrwa pmulhrwc pmulhw pmullw pmvgezb pmvlzb pmvnzb pmvzb pop popa popad popaw popf popfd popfq popfw por prefetch prefetchw pslld psllq psllw psrad psraw psrld psrlq psrlw psubb psubd psubsb psubsiw psubsw psubusb psubusw psubw punpckhbw punpckhdq punpckhwd punpcklbw punpckldq punpcklwd push pusha pushad pushaw pushf pushfd pushfq pushfw pxor rcl rcr rdshr rdmsr rdpmc rdtsc rdtscp ret retf retn rol ror rdm rsdc rsldt rsm rsts sahf sal salc sar sbb scasb scasd scasq scasw sfence sgdt shl shld shr shrd sidt sldt skinit smi smint smintold smsw stc std sti stosb stosd stosq stosw str sub svdc svldt svts swapgs syscall sysenter sysexit sysret test ud0 ud1 ud2b ud2 ud2a umov verr verw fwait wbinvd wrshr wrmsr xadd xbts xchg xlatb xlat xor cmove cmovz cmovne cmovnz cmova cmovnbe cmovae cmovnb cmovb cmovnae cmovbe cmovna cmovg cmovnle cmovge cmovnl cmovl cmovnge cmovle cmovng cmovc cmovnc cmovo cmovno cmovs cmovns cmovp cmovpe cmovnp cmovpo je jz jne jnz ja jnbe jae jnb jb jnae jbe jna jg jnle jge jnl jl jnge jle jng jc jnc jo jno js jns jpo jnp jpe jp sete setz setne setnz seta setnbe setae setnb setnc setb setnae setcset setbe setna setg setnle setge setnl setl setnge setle setng sets setns seto setno setpe setp setpo setnp addps addss andnps andps cmpeqps cmpeqss cmpleps cmpless cmpltps cmpltss cmpneqps cmpneqss cmpnleps cmpnless cmpnltps cmpnltss cmpordps cmpordss cmpunordps cmpunordss cmpps cmpss comiss cvtpi2ps cvtps2pi cvtsi2ss cvtss2si cvttps2pi cvttss2si divps divss ldmxcsr maxps maxss minps minss movaps movhps movlhps movlps movhlps movmskps movntps movss movups mulps mulss orps rcpps rcpss rsqrtps rsqrtss shufps sqrtps sqrtss stmxcsr subps subss ucomiss unpckhps unpcklps xorps fxrstor fxrstor64 fxsave fxsave64 xgetbv xsetbv xsave xsave64 xsaveopt xsaveopt64 xrstor xrstor64 prefetchnta prefetcht0 prefetcht1 prefetcht2 maskmovq movntq pavgb pavgw pextrw pinsrw pmaxsw pmaxub pminsw pminub pmovmskb pmulhuw psadbw pshufw pf2iw pfnacc pfpnacc pi2fw pswapd maskmovdqu clflush movntdq movnti movntpd movdqa movdqu movdq2q movq2dq paddq pmuludq pshufd pshufhw pshuflw pslldq psrldq psubq punpckhqdq punpcklqdq addpd addsd andnpd andpd cmpeqpd cmpeqsd cmplepd cmplesd cmpltpd cmpltsd cmpneqpd cmpneqsd cmpnlepd cmpnlesd cmpnltpd cmpnltsd cmpordpd cmpordsd cmpunordpd cmpunordsd cmppd comisd cvtdq2pd cvtdq2ps cvtpd2dq cvtpd2pi cvtpd2ps cvtpi2pd cvtps2dq cvtps2pd cvtsd2si cvtsd2ss cvtsi2sd cvtss2sd cvttpd2pi cvttpd2dq cvttps2dq cvttsd2si divpd divsd maxpd maxsd minpd minsd movapd movhpd movlpd movmskpd movupd mulpd mulsd orpd shufpd sqrtpd sqrtsd subpd subsd ucomisd unpckhpd unpcklpd xorpd addsubpd addsubps haddpd haddps hsubpd hsubps lddqu movddup movshdup movsldup clgi stgi vmcall vmclear vmfunc vmlaunch vmload vmmcall vmptrld vmptrst vmread vmresume vmrun vmsave vmwrite vmxoff vmxon invept invvpid pabsb pabsw pabsd palignr phaddw phaddd phaddsw phsubw phsubd phsubsw pmaddubsw pmulhrsw pshufb psignb psignw psignd extrq insertq movntsd movntss lzcnt blendpd blendps blendvpd blendvps dppd dpps extractps insertps movntdqa mpsadbw packusdw pblendvb pblendw pcmpeqq pextrb pextrd pextrq phminposuw pinsrb pinsrd pinsrq pmaxsb pmaxsd pmaxud pmaxuw pminsb pminsd pminud pminuw pmovsxbw pmovsxbd pmovsxbq pmovsxwd pmovsxwq pmovsxdq pmovzxbw pmovzxbd pmovzxbq pmovzxwd pmovzxwq pmovzxdq pmuldq pmulld ptest roundpd roundps roundsd roundss crc32 pcmpestri pcmpestrm pcmpistri pcmpistrm pcmpgtq popcnt getsec pfrcpv pfrsqrtv movbe aesenc aesenclast aesdec aesdeclast aesimc aeskeygenassist vaesenc vaesenclast vaesdec vaesdeclast vaesimc vaeskeygenassist vaddpd vaddps vaddsd vaddss vaddsubpd vaddsubps vandpd vandps vandnpd vandnps vblendpd vblendps vblendvpd vblendvps vbroadcastss vbroadcastsd vbroadcastf128 vcmpeq_ospd vcmpeqpd vcmplt_ospd vcmpltpd vcmple_ospd vcmplepd vcmpunord_qpd vcmpunordpd vcmpneq_uqpd vcmpneqpd vcmpnlt_uspd vcmpnltpd vcmpnle_uspd vcmpnlepd vcmpord_qpd vcmpordpd vcmpeq_uqpd vcmpnge_uspd vcmpngepd vcmpngt_uspd vcmpngtpd vcmpfalse_oqpd vcmpfalsepd vcmpneq_oqpd vcmpge_ospd vcmpgepd vcmpgt_ospd vcmpgtpd vcmptrue_uqpd vcmptruepd vcmplt_oqpd vcmple_oqpd vcmpunord_spd vcmpneq_uspd vcmpnlt_uqpd vcmpnle_uqpd vcmpord_spd vcmpeq_uspd vcmpnge_uqpd vcmpngt_uqpd vcmpfalse_ospd vcmpneq_ospd vcmpge_oqpd vcmpgt_oqpd vcmptrue_uspd vcmppd vcmpeq_osps vcmpeqps vcmplt_osps vcmpltps vcmple_osps vcmpleps vcmpunord_qps vcmpunordps vcmpneq_uqps vcmpneqps vcmpnlt_usps vcmpnltps vcmpnle_usps vcmpnleps vcmpord_qps vcmpordps vcmpeq_uqps vcmpnge_usps vcmpngeps vcmpngt_usps vcmpngtps vcmpfalse_oqps vcmpfalseps vcmpneq_oqps vcmpge_osps vcmpgeps vcmpgt_osps vcmpgtps vcmptrue_uqps vcmptrueps vcmplt_oqps vcmple_oqps vcmpunord_sps vcmpneq_usps vcmpnlt_uqps vcmpnle_uqps vcmpord_sps vcmpeq_usps vcmpnge_uqps vcmpngt_uqps vcmpfalse_osps vcmpneq_osps vcmpge_oqps vcmpgt_oqps vcmptrue_usps vcmpps vcmpeq_ossd vcmpeqsd vcmplt_ossd vcmpltsd vcmple_ossd vcmplesd vcmpunord_qsd vcmpunordsd vcmpneq_uqsd vcmpneqsd vcmpnlt_ussd vcmpnltsd vcmpnle_ussd vcmpnlesd vcmpord_qsd vcmpordsd vcmpeq_uqsd vcmpnge_ussd vcmpngesd vcmpngt_ussd vcmpngtsd vcmpfalse_oqsd vcmpfalsesd vcmpneq_oqsd vcmpge_ossd vcmpgesd vcmpgt_ossd vcmpgtsd vcmptrue_uqsd vcmptruesd vcmplt_oqsd vcmple_oqsd vcmpunord_ssd vcmpneq_ussd vcmpnlt_uqsd vcmpnle_uqsd vcmpord_ssd vcmpeq_ussd vcmpnge_uqsd vcmpngt_uqsd vcmpfalse_ossd vcmpneq_ossd vcmpge_oqsd vcmpgt_oqsd vcmptrue_ussd vcmpsd vcmpeq_osss vcmpeqss vcmplt_osss vcmpltss vcmple_osss vcmpless vcmpunord_qss vcmpunordss vcmpneq_uqss vcmpneqss vcmpnlt_usss vcmpnltss vcmpnle_usss vcmpnless vcmpord_qss vcmpordss vcmpeq_uqss vcmpnge_usss vcmpngess vcmpngt_usss vcmpngtss vcmpfalse_oqss vcmpfalsess vcmpneq_oqss vcmpge_osss vcmpgess vcmpgt_osss vcmpgtss vcmptrue_uqss vcmptruess vcmplt_oqss vcmple_oqss vcmpunord_sss vcmpneq_usss vcmpnlt_uqss vcmpnle_uqss vcmpord_sss vcmpeq_usss vcmpnge_uqss vcmpngt_uqss vcmpfalse_osss vcmpneq_osss vcmpge_oqss vcmpgt_oqss vcmptrue_usss vcmpss vcomisd vcomiss vcvtdq2pd vcvtdq2ps vcvtpd2dq vcvtpd2ps vcvtps2dq vcvtps2pd vcvtsd2si vcvtsd2ss vcvtsi2sd vcvtsi2ss vcvtss2sd vcvtss2si vcvttpd2dq vcvttps2dq vcvttsd2si vcvttss2si vdivpd vdivps vdivsd vdivss vdppd vdpps vextractf128 vextractps vhaddpd vhaddps vhsubpd vhsubps vinsertf128 vinsertps vlddqu vldqqu vldmxcsr vmaskmovdqu vmaskmovps vmaskmovpd vmaxpd vmaxps vmaxsd vmaxss vminpd vminps vminsd vminss vmovapd vmovaps vmovd vmovq vmovddup vmovdqa vmovqqa vmovdqu vmovqqu vmovhlps vmovhpd vmovhps vmovlhps vmovlpd vmovlps vmovmskpd vmovmskps vmovntdq vmovntqq vmovntdqa vmovntpd vmovntps vmovsd vmovshdup vmovsldup vmovss vmovupd vmovups vmpsadbw vmulpd vmulps vmulsd vmulss vorpd vorps vpabsb vpabsw vpabsd vpacksswb vpackssdw vpackuswb vpackusdw vpaddb vpaddw vpaddd vpaddq vpaddsb vpaddsw vpaddusb vpaddusw vpalignr vpand vpandn vpavgb vpavgw vpblendvb vpblendw vpcmpestri vpcmpestrm vpcmpistri vpcmpistrm vpcmpeqb vpcmpeqw vpcmpeqd vpcmpeqq vpcmpgtb vpcmpgtw vpcmpgtd vpcmpgtq vpermilpd vpermilps vperm2f128 vpextrb vpextrw vpextrd vpextrq vphaddw vphaddd vphaddsw vphminposuw vphsubw vphsubd vphsubsw vpinsrb vpinsrw vpinsrd vpinsrq vpmaddwd vpmaddubsw vpmaxsb vpmaxsw vpmaxsd vpmaxub vpmaxuw vpmaxud vpminsb vpminsw vpminsd vpminub vpminuw vpminud vpmovmskb vpmovsxbw vpmovsxbd vpmovsxbq vpmovsxwd vpmovsxwq vpmovsxdq vpmovzxbw vpmovzxbd vpmovzxbq vpmovzxwd vpmovzxwq vpmovzxdq vpmulhuw vpmulhrsw vpmulhw vpmullw vpmulld vpmuludq vpmuldq vpor vpsadbw vpshufb vpshufd vpshufhw vpshuflw vpsignb vpsignw vpsignd vpslldq vpsrldq vpsllw vpslld vpsllq vpsraw vpsrad vpsrlw vpsrld vpsrlq vptest vpsubb vpsubw vpsubd vpsubq vpsubsb vpsubsw vpsubusb vpsubusw vpunpckhbw vpunpckhwd vpunpckhdq vpunpckhqdq vpunpcklbw vpunpcklwd vpunpckldq vpunpcklqdq vpxor vrcpps vrcpss vrsqrtps vrsqrtss vroundpd vroundps vroundsd vroundss vshufpd vshufps vsqrtpd vsqrtps vsqrtsd vsqrtss vstmxcsr vsubpd vsubps vsubsd vsubss vtestps vtestpd vucomisd vucomiss vunpckhpd vunpckhps vunpcklpd vunpcklps vxorpd vxorps vzeroall vzeroupper pclmullqlqdq pclmulhqlqdq pclmullqhqdq pclmulhqhqdq pclmulqdq vpclmullqlqdq vpclmulhqlqdq vpclmullqhqdq vpclmulhqhqdq vpclmulqdq vfmadd132ps vfmadd132pd vfmadd312ps vfmadd312pd vfmadd213ps vfmadd213pd vfmadd123ps vfmadd123pd vfmadd231ps vfmadd231pd vfmadd321ps vfmadd321pd vfmaddsub132ps vfmaddsub132pd vfmaddsub312ps vfmaddsub312pd vfmaddsub213ps vfmaddsub213pd vfmaddsub123ps vfmaddsub123pd vfmaddsub231ps vfmaddsub231pd vfmaddsub321ps vfmaddsub321pd vfmsub132ps vfmsub132pd vfmsub312ps vfmsub312pd vfmsub213ps vfmsub213pd vfmsub123ps vfmsub123pd vfmsub231ps vfmsub231pd vfmsub321ps vfmsub321pd vfmsubadd132ps vfmsubadd132pd vfmsubadd312ps vfmsubadd312pd vfmsubadd213ps vfmsubadd213pd vfmsubadd123ps vfmsubadd123pd vfmsubadd231ps vfmsubadd231pd vfmsubadd321ps vfmsubadd321pd vfnmadd132ps vfnmadd132pd vfnmadd312ps vfnmadd312pd vfnmadd213ps vfnmadd213pd vfnmadd123ps vfnmadd123pd vfnmadd231ps vfnmadd231pd vfnmadd321ps vfnmadd321pd vfnmsub132ps vfnmsub132pd vfnmsub312ps vfnmsub312pd vfnmsub213ps vfnmsub213pd vfnmsub123ps vfnmsub123pd vfnmsub231ps vfnmsub231pd vfnmsub321ps vfnmsub321pd vfmadd132ss vfmadd132sd vfmadd312ss vfmadd312sd vfmadd213ss vfmadd213sd vfmadd123ss vfmadd123sd vfmadd231ss vfmadd231sd vfmadd321ss vfmadd321sd vfmsub132ss vfmsub132sd vfmsub312ss vfmsub312sd vfmsub213ss vfmsub213sd vfmsub123ss vfmsub123sd vfmsub231ss vfmsub231sd vfmsub321ss vfmsub321sd vfnmadd132ss vfnmadd132sd vfnmadd312ss vfnmadd312sd vfnmadd213ss vfnmadd213sd vfnmadd123ss vfnmadd123sd vfnmadd231ss vfnmadd231sd vfnmadd321ss vfnmadd321sd vfnmsub132ss vfnmsub132sd vfnmsub312ss vfnmsub312sd vfnmsub213ss vfnmsub213sd vfnmsub123ss vfnmsub123sd vfnmsub231ss vfnmsub231sd vfnmsub321ss vfnmsub321sd rdfsbase rdgsbase rdrand wrfsbase wrgsbase vcvtph2ps vcvtps2ph adcx adox rdseed clac stac xstore xcryptecb xcryptcbc xcryptctr xcryptcfb xcryptofb montmul xsha1 xsha256 llwpcb slwpcb lwpval lwpins vfmaddpd vfmaddps vfmaddsd vfmaddss vfmaddsubpd vfmaddsubps vfmsubaddpd vfmsubaddps vfmsubpd vfmsubps vfmsubsd vfmsubss vfnmaddpd vfnmaddps vfnmaddsd vfnmaddss vfnmsubpd vfnmsubps vfnmsubsd vfnmsubss vfrczpd vfrczps vfrczsd vfrczss vpcmov vpcomb vpcomd vpcomq vpcomub vpcomud vpcomuq vpcomuw vpcomw vphaddbd vphaddbq vphaddbw vphadddq vphaddubd vphaddubq vphaddubw vphaddudq vphadduwd vphadduwq vphaddwd vphaddwq vphsubbw vphsubdq vphsubwd vpmacsdd vpmacsdqh vpmacsdql vpmacssdd vpmacssdqh vpmacssdql vpmacsswd vpmacssww vpmacswd vpmacsww vpmadcsswd vpmadcswd vpperm vprotb vprotd vprotq vprotw vpshab vpshad vpshaq vpshaw vpshlb vpshld vpshlq vpshlw vbroadcasti128 vpblendd vpbroadcastb vpbroadcastw vpbroadcastd vpbroadcastq vpermd vpermpd vpermps vpermq vperm2i128 vextracti128 vinserti128 vpmaskmovd vpmaskmovq vpsllvd vpsllvq vpsravd vpsrlvd vpsrlvq vgatherdpd vgatherqpd vgatherdps vgatherqps vpgatherdd vpgatherqd vpgatherdq vpgatherqq xabort xbegin xend xtest andn bextr blci blcic blsi blsic blcfill blsfill blcmsk blsmsk blsr blcs bzhi mulx pdep pext rorx sarx shlx shrx tzcnt tzmsk t1mskc valignd valignq vblendmpd vblendmps vbroadcastf32x4 vbroadcastf64x4 vbroadcasti32x4 vbroadcasti64x4 vcompresspd vcompressps vcvtpd2udq vcvtps2udq vcvtsd2usi vcvtss2usi vcvttpd2udq vcvttps2udq vcvttsd2usi vcvttss2usi vcvtudq2pd vcvtudq2ps vcvtusi2sd vcvtusi2ss vexpandpd vexpandps vextractf32x4 vextractf64x4 vextracti32x4 vextracti64x4 vfixupimmpd vfixupimmps vfixupimmsd vfixupimmss vgetexppd vgetexpps vgetexpsd vgetexpss vgetmantpd vgetmantps vgetmantsd vgetmantss vinsertf32x4 vinsertf64x4 vinserti32x4 vinserti64x4 vmovdqa32 vmovdqa64 vmovdqu32 vmovdqu64 vpabsq vpandd vpandnd vpandnq vpandq vpblendmd vpblendmq vpcmpltd vpcmpled vpcmpneqd vpcmpnltd vpcmpnled vpcmpd vpcmpltq vpcmpleq vpcmpneqq vpcmpnltq vpcmpnleq vpcmpq vpcmpequd vpcmpltud vpcmpleud vpcmpnequd vpcmpnltud vpcmpnleud vpcmpud vpcmpequq vpcmpltuq vpcmpleuq vpcmpnequq vpcmpnltuq vpcmpnleuq vpcmpuq vpcompressd vpcompressq vpermi2d vpermi2pd vpermi2ps vpermi2q vpermt2d vpermt2pd vpermt2ps vpermt2q vpexpandd vpexpandq vpmaxsq vpmaxuq vpminsq vpminuq vpmovdb vpmovdw vpmovqb vpmovqd vpmovqw vpmovsdb vpmovsdw vpmovsqb vpmovsqd vpmovsqw vpmovusdb vpmovusdw vpmovusqb vpmovusqd vpmovusqw vpord vporq vprold vprolq vprolvd vprolvq vprord vprorq vprorvd vprorvq vpscatterdd vpscatterdq vpscatterqd vpscatterqq vpsraq vpsravq vpternlogd vpternlogq vptestmd vptestmq vptestnmd vptestnmq vpxord vpxorq vrcp14pd vrcp14ps vrcp14sd vrcp14ss vrndscalepd vrndscaleps vrndscalesd vrndscaless vrsqrt14pd vrsqrt14ps vrsqrt14sd vrsqrt14ss vscalefpd vscalefps vscalefsd vscalefss vscatterdpd vscatterdps vscatterqpd vscatterqps vshuff32x4 vshuff64x2 vshufi32x4 vshufi64x2 kandnw kandw kmovw knotw kortestw korw kshiftlw kshiftrw kunpckbw kxnorw kxorw vpbroadcastmb2q vpbroadcastmw2d vpconflictd vpconflictq vplzcntd vplzcntq vexp2pd vexp2ps vrcp28pd vrcp28ps vrcp28sd vrcp28ss vrsqrt28pd vrsqrt28ps vrsqrt28sd vrsqrt28ss vgatherpf0dpd vgatherpf0dps vgatherpf0qpd vgatherpf0qps vgatherpf1dpd vgatherpf1dps vgatherpf1qpd vgatherpf1qps vscatterpf0dpd vscatterpf0dps vscatterpf0qpd vscatterpf0qps vscatterpf1dpd vscatterpf1dps vscatterpf1qpd vscatterpf1qps prefetchwt1 bndmk bndcl bndcu bndcn bndmov bndldx bndstx sha1rnds4 sha1nexte sha1msg1 sha1msg2 sha256rnds2 sha256msg1 sha256msg2 hint_nop0 hint_nop1 hint_nop2 hint_nop3 hint_nop4 hint_nop5 hint_nop6 hint_nop7 hint_nop8 hint_nop9 hint_nop10 hint_nop11 hint_nop12 hint_nop13 hint_nop14 hint_nop15 hint_nop16 hint_nop17 hint_nop18 hint_nop19 hint_nop20 hint_nop21 hint_nop22 hint_nop23 hint_nop24 hint_nop25 hint_nop26 hint_nop27 hint_nop28 hint_nop29 hint_nop30 hint_nop31 hint_nop32 hint_nop33 hint_nop34 hint_nop35 hint_nop36 hint_nop37 hint_nop38 hint_nop39 hint_nop40 hint_nop41 hint_nop42 hint_nop43 hint_nop44 hint_nop45 hint_nop46 hint_nop47 hint_nop48 hint_nop49 hint_nop50 hint_nop51 hint_nop52 hint_nop53 hint_nop54 hint_nop55 hint_nop56 hint_nop57 hint_nop58 hint_nop59 hint_nop60 hint_nop61 hint_nop62 hint_nop63`,built_in:`ip eip rip al ah bl bh cl ch dl dh sil dil bpl spl r8b r9b r10b r11b r12b r13b r14b r15b ax bx cx dx si di bp sp r8w r9w r10w r11w r12w r13w r14w r15w eax ebx ecx edx esi edi ebp esp eip r8d r9d r10d r11d r12d r13d r14d r15d rax rbx rcx rdx rsi rdi rbp rsp r8 r9 r10 r11 r12 r13 r14 r15 cs ds es fs gs ss st st0 st1 st2 st3 st4 st5 st6 st7 mm0 mm1 mm2 mm3 mm4 mm5 mm6 mm7 xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8 xmm9 xmm10 xmm11 xmm12 xmm13 xmm14 xmm15 xmm16 xmm17 xmm18 xmm19 xmm20 xmm21 xmm22 xmm23 xmm24 xmm25 xmm26 xmm27 xmm28 xmm29 xmm30 xmm31 ymm0 ymm1 ymm2 ymm3 ymm4 ymm5 ymm6 ymm7 ymm8 ymm9 ymm10 ymm11 ymm12 ymm13 ymm14 ymm15 ymm16 ymm17 ymm18 ymm19 ymm20 ymm21 ymm22 ymm23 ymm24 ymm25 ymm26 ymm27 ymm28 ymm29 ymm30 ymm31 zmm0 zmm1 zmm2 zmm3 zmm4 zmm5 zmm6 zmm7 zmm8 zmm9 zmm10 zmm11 zmm12 zmm13 zmm14 zmm15 zmm16 zmm17 zmm18 zmm19 zmm20 zmm21 zmm22 zmm23 zmm24 zmm25 zmm26 zmm27 zmm28 zmm29 zmm30 zmm31 k0 k1 k2 k3 k4 k5 k6 k7 bnd0 bnd1 bnd2 bnd3 cr0 cr1 cr2 cr3 cr4 cr8 dr0 dr1 dr2 dr3 dr8 tr3 tr4 tr5 tr6 tr7 r0 r1 r2 r3 r4 r5 r6 r7 r0b r1b r2b r3b r4b r5b r6b r7b r0w r1w r2w r3w r4w r5w r6w r7w r0d r1d r2d r3d r4d r5d r6d r7d r0h r1h r2h r3h r0l r1l r2l r3l r4l r5l r6l r7l r8l r9l r10l r11l r12l r13l r14l r15l db dw dd dq dt ddq do dy dz resb resw resd resq rest resdq reso resy resz incbin equ times byte word dword qword nosplit rel abs seg wrt strict near far a32 ptr`,meta:`%define %xdefine %+ %undef %defstr %deftok %assign %strcat %strlen %substr %rotate %elif %else %endif %if %ifmacro %ifctx %ifidn %ifidni %ifid %ifnum %ifstr %iftoken %ifempty %ifenv %error %warning %fatal %rep %endrep %include %push %pop %repl %pathsearch %depend %use %arg %stacksize %local %line %comment %endcomment .nolist __FILE__ __LINE__ __SECT__ __BITS__ __OUTPUT_FORMAT__ __DATE__ __TIME__ __DATE_NUM__ __TIME_NUM__ __UTC_DATE__ __UTC_TIME__ __UTC_DATE_NUM__ __UTC_TIME_NUM__ __PASS__ struc endstruc istruc at iend align alignb sectalign daz nodaz up down zero default option assume public bits use16 use32 use64 default section segment absolute extern global common cpu float __utf16__ __utf16le__ __utf16be__ __utf32__ __utf32le__ __utf32be__ __float8__ __float16__ __float32__ __float64__ __float80m__ __float80e__ __float128l__ __float128h__ __Infinity__ __QNaN__ __SNaN__ Inf NaN QNaN SNaN float8 float16 float32 float64 float80m float80e float128l float128h __FLOAT_DAZ__ __FLOAT_ROUND__ __FLOAT__`},contains:[e.COMMENT(`;`,`$`,{relevance:0}),{className:`number`,variants:[{begin:`\\b(?:([0-9][0-9_]*)?\\.[0-9_]*(?:[eE][+-]?[0-9_]+)?|(0[Xx])?[0-9][0-9_]*(\\.[0-9_]*)?(?:[pP](?:[+-]?[0-9_]+)?)?)\\b`,relevance:0},{begin:`\\$[0-9][0-9A-Fa-f]*`,relevance:0},{begin:`\\b(?:[0-9A-Fa-f][0-9A-Fa-f_]*[Hh]|[0-9][0-9_]*[DdTt]?|[0-7][0-7_]*[QqOo]|[0-1][0-1_]*[BbYy])\\b`},{begin:`\\b(?:0[Xx][0-9A-Fa-f_]+|0[DdTt][0-9_]+|0[QqOo][0-7_]+|0[BbYy][0-1_]+)\\b`}]},e.QUOTE_STRING_MODE,{className:`string`,variants:[{begin:`'`,end:`[^\\\\]'`},{begin:"`",end:"[^\\\\]`"}],relevance:0},{className:`symbol`,variants:[{begin:`^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)`},{begin:`^\\s*%%[A-Za-z0-9_$#@~.?]*:`}],relevance:0},{className:`subst`,begin:`%[0-9]+`,relevance:0},{className:`subst`,begin:`%!S+`,relevance:0},{className:`meta`,begin:/^\s*\.[\w_-]+/}]}}t.exports=n})),aj=o(((e,t)=>{function n(e){let t={$pattern:/[a-zA-Z][a-zA-Z0-9_?]*/,keyword:`if.then.else.do.while.until.for.loop.import.with.is.as.where.when.by.data.constant.integer.real.text.name.boolean.symbol.infix.prefix.postfix.block.tree`.split(`.`),literal:[`true`,`false`,`nil`],built_in:`in.mod.rem.and.or.xor.not.abs.sign.floor.ceil.sqrt.sin.cos.tan.asin.acos.atan.exp.expm1.log.log2.log10.log1p.pi.at.text_length.text_range.text_find.text_replace.contains.page.slide.basic_slide.title_slide.title.subtitle.fade_in.fade_out.fade_at.clear_color.color.line_color.line_width.texture_wrap.texture_transform.texture.scale_?x.scale_?y.scale_?z?.translate_?x.translate_?y.translate_?z?.rotate_?x.rotate_?y.rotate_?z?.rectangle.circle.ellipse.sphere.path.line_to.move_to.quad_to.curve_to.theme.background.contents.locally.time.mouse_?x.mouse_?y.mouse_buttons`.split(`.`).concat([`ObjectLoader`,`Animate`,`MovieCredits`,`Slides`,`Filters`,`Shading`,`Materials`,`LensFlare`,`Mapping`,`VLCAudioVideo`,`StereoDecoder`,`PointCloud`,`NetworkAccess`,`RemoteControl`,`RegExp`,`ChromaKey`,`Snowfall`,`NodeJS`,`Speech`,`Charts`])},n={className:`string`,begin:`"`,end:`"`,illegal:`\\n`},r={className:`string`,begin:`'`,end:`'`,illegal:`\\n`},i={className:`string`,begin:`<<`,end:`>>`},a={className:`number`,begin:`[0-9]+#[0-9A-Z_]+(\\.[0-9-A-Z_]+)?#?([Ee][+-]?[0-9]+)?`},o={beginKeywords:`import`,end:`$`,keywords:t,contains:[n]},s={className:`function`,begin:/[a-z][^\n]*->/,returnBegin:!0,end:/->/,contains:[e.inherit(e.TITLE_MODE,{starts:{endsWithParent:!0,keywords:t}})]};return{name:`XL`,aliases:[`tao`],keywords:t,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,n,r,i,s,o,a,e.NUMBER_MODE]}}t.exports=n})),oj=o(((e,t)=>{function n(e){return{name:`XQuery`,aliases:[`xpath`,`xq`,`xqm`],case_insensitive:!1,illegal:/(proc)|(abstract)|(extends)|(until)|(#)/,keywords:{$pattern:/[a-zA-Z$][a-zA-Z0-9_:-]*/,keyword:`module.schema.namespace.boundary-space.preserve.no-preserve.strip.default.collation.base-uri.ordering.context.decimal-format.decimal-separator.copy-namespaces.empty-sequence.except.exponent-separator.external.grouping-separator.inherit.no-inherit.lax.minus-sign.per-mille.percent.schema-attribute.schema-element.strict.unordered.zero-digit.declare.import.option.function.validate.variable.for.at.in.let.where.order.group.by.return.if.then.else.tumbling.sliding.window.start.when.only.end.previous.next.stable.ascending.descending.allowing.empty.greatest.least.some.every.satisfies.switch.case.typeswitch.try.catch.and.or.to.union.intersect.instance.of.treat.as.castable.cast.map.array.delete.insert.into.replace.value.rename.copy.modify.update`.split(`.`),type:`item.document-node.node.attribute.document.element.comment.namespace.namespace-node.processing-instruction.text.construction.xs:anyAtomicType.xs:untypedAtomic.xs:duration.xs:time.xs:decimal.xs:float.xs:double.xs:gYearMonth.xs:gYear.xs:gMonthDay.xs:gMonth.xs:gDay.xs:boolean.xs:base64Binary.xs:hexBinary.xs:anyURI.xs:QName.xs:NOTATION.xs:dateTime.xs:dateTimeStamp.xs:date.xs:string.xs:normalizedString.xs:token.xs:language.xs:NMTOKEN.xs:Name.xs:NCName.xs:ID.xs:IDREF.xs:ENTITY.xs:integer.xs:nonPositiveInteger.xs:negativeInteger.xs:long.xs:int.xs:short.xs:byte.xs:nonNegativeInteger.xs:unisignedLong.xs:unsignedInt.xs:unsignedShort.xs:unsignedByte.xs:positiveInteger.xs:yearMonthDuration.xs:dayTimeDuration`.split(`.`),literal:[`eq`,`ne`,`lt`,`le`,`gt`,`ge`,`is`,`self::`,`child::`,`descendant::`,`descendant-or-self::`,`attribute::`,`following::`,`following-sibling::`,`parent::`,`ancestor::`,`ancestor-or-self::`,`preceding::`,`preceding-sibling::`,`NaN`]},contains:[{className:`variable`,begin:/[$][\w\-:]+/},{className:`built_in`,variants:[{begin:/\barray:/,end:/(?:append|filter|flatten|fold-(?:left|right)|for-each(?:-pair)?|get|head|insert-before|join|put|remove|reverse|size|sort|subarray|tail)\b/},{begin:/\bmap:/,end:/(?:contains|entry|find|for-each|get|keys|merge|put|remove|size)\b/},{begin:/\bmath:/,end:/(?:a(?:cos|sin|tan[2]?)|cos|exp(?:10)?|log(?:10)?|pi|pow|sin|sqrt|tan)\b/},{begin:/\bop:/,end:/\(/,excludeEnd:!0},{begin:/\bfn:/,end:/\(/,excludeEnd:!0},{begin:/[^</$:'"-]\b(?:abs|accumulator-(?:after|before)|adjust-(?:date(?:Time)?|time)-to-timezone|analyze-string|apply|available-(?:environment-variables|system-properties)|avg|base-uri|boolean|ceiling|codepoints?-(?:equal|to-string)|collation-key|collection|compare|concat|contains(?:-token)?|copy-of|count|current(?:-)?(?:date(?:Time)?|time|group(?:ing-key)?|output-uri|merge-(?:group|key))?data|dateTime|days?-from-(?:date(?:Time)?|duration)|deep-equal|default-(?:collation|language)|distinct-values|document(?:-uri)?|doc(?:-available)?|element-(?:available|with-id)|empty|encode-for-uri|ends-with|environment-variable|error|escape-html-uri|exactly-one|exists|false|filter|floor|fold-(?:left|right)|for-each(?:-pair)?|format-(?:date(?:Time)?|time|integer|number)|function-(?:arity|available|lookup|name)|generate-id|has-children|head|hours-from-(?:dateTime|duration|time)|id(?:ref)?|implicit-timezone|in-scope-prefixes|index-of|innermost|insert-before|iri-to-uri|json-(?:doc|to-xml)|key|lang|last|load-xquery-module|local-name(?:-from-QName)?|(?:lower|upper)-case|matches|max|minutes-from-(?:dateTime|duration|time)|min|months?-from-(?:date(?:Time)?|duration)|name(?:space-uri-?(?:for-prefix|from-QName)?)?|nilled|node-name|normalize-(?:space|unicode)|not|number|one-or-more|outermost|parse-(?:ietf-date|json)|path|position|(?:prefix-from-)?QName|random-number-generator|regex-group|remove|replace|resolve-(?:QName|uri)|reverse|root|round(?:-half-to-even)?|seconds-from-(?:dateTime|duration|time)|snapshot|sort|starts-with|static-base-uri|stream-available|string-?(?:join|length|to-codepoints)?|subsequence|substring-?(?:after|before)?|sum|system-property|tail|timezone-from-(?:date(?:Time)?|time)|tokenize|trace|trans(?:form|late)|true|type-available|unordered|unparsed-(?:entity|text)?-?(?:public-id|uri|available|lines)?|uri-collection|xml-to-json|years?-from-(?:date(?:Time)?|duration)|zero-or-one)\b/},{begin:/\blocal:/,end:/\(/,excludeEnd:!0},{begin:/\bzip:/,end:/(?:zip-file|(?:xml|html|text|binary)-entry| (?:update-)?entries)\b/},{begin:/\b(?:util|db|functx|app|xdmp|xmldb):/,end:/\(/,excludeEnd:!0}]},{className:`string`,variants:[{begin:/"/,end:/"/,contains:[{begin:/""/,relevance:0}]},{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]}]},{className:`number`,begin:/(\b0[0-7_]+)|(\b0x[0-9a-fA-F_]+)|(\b[1-9][0-9_]*(\.[0-9_]+)?)|[0_]\b/,relevance:0},{className:`comment`,begin:/\(:/,end:/:\)/,relevance:10,contains:[{className:`doctag`,begin:/@\w+/}]},{className:`meta`,begin:/%[\w\-:]+/},{className:`title`,begin:/\bxquery version "[13]\.[01]"\s?(?:encoding ".+")?/,end:/;/},{beginKeywords:`element attribute comment document processing-instruction`,end:/\{/,excludeEnd:!0},{begin:/<([\w._:-]+)(\s+\S*=('|").*('|"))?>/,end:/(\/[\w._:-]+>)/,subLanguage:`xml`,contains:[{begin:/\{/,end:/\}/,subLanguage:`xquery`},`self`]}]}}t.exports=n})),sj=o(((e,t)=>{function n(e){let t={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null})]},n=e.UNDERSCORE_TITLE_MODE,r={variants:[e.BINARY_NUMBER_MODE,e.C_NUMBER_MODE]},i=`namespace class interface use extends function return abstract final public protected private static deprecated throw try catch Exception echo empty isset instanceof unset let var new const self require if else elseif switch case default do while loop for continue break likely unlikely __LINE__ __FILE__ __DIR__ __FUNCTION__ __CLASS__ __TRAIT__ __METHOD__ __NAMESPACE__ array boolean float double integer object resource string char long unsigned bool int uint ulong uchar true false null undefined`;return{name:`Zephir`,aliases:[`zep`],keywords:i,contains:[e.C_LINE_COMMENT_MODE,e.COMMENT(/\/\*/,/\*\//,{contains:[{className:`doctag`,begin:/@[A-Za-z]+/}]}),{className:`string`,begin:/<<<['"]?\w+['"]?$/,end:/^\w+;/,contains:[e.BACKSLASH_ESCAPE]},{begin:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{className:`function`,beginKeywords:`function fn`,end:/[;{]/,excludeEnd:!0,illegal:/\$|\[|%/,contains:[n,{className:`params`,begin:/\(/,end:/\)/,keywords:i,contains:[`self`,e.C_BLOCK_COMMENT_MODE,t,r]}]},{className:`class`,beginKeywords:`class interface`,end:/\{/,excludeEnd:!0,illegal:/[:($"]/,contains:[{beginKeywords:`extends implements`},n]},{beginKeywords:`namespace`,end:/;/,illegal:/[.']/,contains:[n]},{beginKeywords:`use`,end:/;/,contains:[n]},{begin:/=>/},t,r]}}t.exports=n})),cj=l(o(((e,t)=>{var n=jD();n.registerLanguage(`1c`,MD()),n.registerLanguage(`abnf`,ND()),n.registerLanguage(`accesslog`,PD()),n.registerLanguage(`actionscript`,FD()),n.registerLanguage(`ada`,ID()),n.registerLanguage(`angelscript`,LD()),n.registerLanguage(`apache`,RD()),n.registerLanguage(`applescript`,zD()),n.registerLanguage(`arcade`,BD()),n.registerLanguage(`arduino`,VD()),n.registerLanguage(`armasm`,HD()),n.registerLanguage(`xml`,UD()),n.registerLanguage(`asciidoc`,WD()),n.registerLanguage(`aspectj`,GD()),n.registerLanguage(`autohotkey`,KD()),n.registerLanguage(`autoit`,qD()),n.registerLanguage(`avrasm`,JD()),n.registerLanguage(`awk`,YD()),n.registerLanguage(`axapta`,XD()),n.registerLanguage(`bash`,ZD()),n.registerLanguage(`basic`,QD()),n.registerLanguage(`bnf`,$D()),n.registerLanguage(`brainfuck`,eO()),n.registerLanguage(`c`,tO()),n.registerLanguage(`cal`,nO()),n.registerLanguage(`capnproto`,rO()),n.registerLanguage(`ceylon`,iO()),n.registerLanguage(`clean`,aO()),n.registerLanguage(`clojure`,oO()),n.registerLanguage(`clojure-repl`,sO()),n.registerLanguage(`cmake`,cO()),n.registerLanguage(`coffeescript`,lO()),n.registerLanguage(`coq`,uO()),n.registerLanguage(`cos`,dO()),n.registerLanguage(`cpp`,fO()),n.registerLanguage(`crmsh`,pO()),n.registerLanguage(`crystal`,mO()),n.registerLanguage(`csharp`,hO()),n.registerLanguage(`csp`,gO()),n.registerLanguage(`css`,_O()),n.registerLanguage(`d`,vO()),n.registerLanguage(`markdown`,yO()),n.registerLanguage(`dart`,bO()),n.registerLanguage(`delphi`,xO()),n.registerLanguage(`diff`,SO()),n.registerLanguage(`django`,CO()),n.registerLanguage(`dns`,wO()),n.registerLanguage(`dockerfile`,TO()),n.registerLanguage(`dos`,EO()),n.registerLanguage(`dsconfig`,DO()),n.registerLanguage(`dts`,OO()),n.registerLanguage(`dust`,kO()),n.registerLanguage(`ebnf`,AO()),n.registerLanguage(`elixir`,jO()),n.registerLanguage(`elm`,MO()),n.registerLanguage(`ruby`,NO()),n.registerLanguage(`erb`,PO()),n.registerLanguage(`erlang-repl`,FO()),n.registerLanguage(`erlang`,IO()),n.registerLanguage(`excel`,LO()),n.registerLanguage(`fix`,RO()),n.registerLanguage(`flix`,zO()),n.registerLanguage(`fortran`,BO()),n.registerLanguage(`fsharp`,VO()),n.registerLanguage(`gams`,HO()),n.registerLanguage(`gauss`,UO()),n.registerLanguage(`gcode`,WO()),n.registerLanguage(`gherkin`,GO()),n.registerLanguage(`glsl`,KO()),n.registerLanguage(`gml`,qO()),n.registerLanguage(`go`,JO()),n.registerLanguage(`golo`,YO()),n.registerLanguage(`gradle`,XO()),n.registerLanguage(`graphql`,ZO()),n.registerLanguage(`groovy`,QO()),n.registerLanguage(`haml`,$O()),n.registerLanguage(`handlebars`,ek()),n.registerLanguage(`haskell`,tk()),n.registerLanguage(`haxe`,nk()),n.registerLanguage(`hsp`,rk()),n.registerLanguage(`http`,ik()),n.registerLanguage(`hy`,ak()),n.registerLanguage(`inform7`,ok()),n.registerLanguage(`ini`,sk()),n.registerLanguage(`irpf90`,ck()),n.registerLanguage(`isbl`,lk()),n.registerLanguage(`java`,uk()),n.registerLanguage(`javascript`,dk()),n.registerLanguage(`jboss-cli`,fk()),n.registerLanguage(`json`,pk()),n.registerLanguage(`julia`,mk()),n.registerLanguage(`julia-repl`,hk()),n.registerLanguage(`kotlin`,gk()),n.registerLanguage(`lasso`,_k()),n.registerLanguage(`latex`,vk()),n.registerLanguage(`ldif`,yk()),n.registerLanguage(`leaf`,bk()),n.registerLanguage(`less`,xk()),n.registerLanguage(`lisp`,Sk()),n.registerLanguage(`livecodeserver`,Ck()),n.registerLanguage(`livescript`,wk()),n.registerLanguage(`llvm`,Tk()),n.registerLanguage(`lsl`,Ek()),n.registerLanguage(`lua`,Dk()),n.registerLanguage(`makefile`,Ok()),n.registerLanguage(`mathematica`,kk()),n.registerLanguage(`matlab`,Ak()),n.registerLanguage(`maxima`,jk()),n.registerLanguage(`mel`,Mk()),n.registerLanguage(`mercury`,Nk()),n.registerLanguage(`mipsasm`,Pk()),n.registerLanguage(`mizar`,Fk()),n.registerLanguage(`perl`,Ik()),n.registerLanguage(`mojolicious`,Lk()),n.registerLanguage(`monkey`,Rk()),n.registerLanguage(`moonscript`,zk()),n.registerLanguage(`n1ql`,Bk()),n.registerLanguage(`nestedtext`,Vk()),n.registerLanguage(`nginx`,Hk()),n.registerLanguage(`nim`,Uk()),n.registerLanguage(`nix`,Wk()),n.registerLanguage(`node-repl`,Gk()),n.registerLanguage(`nsis`,Kk()),n.registerLanguage(`objectivec`,qk()),n.registerLanguage(`ocaml`,Jk()),n.registerLanguage(`openscad`,Yk()),n.registerLanguage(`oxygene`,Xk()),n.registerLanguage(`parser3`,Zk()),n.registerLanguage(`pf`,Qk()),n.registerLanguage(`pgsql`,$k()),n.registerLanguage(`php`,eA()),n.registerLanguage(`php-template`,tA()),n.registerLanguage(`plaintext`,nA()),n.registerLanguage(`pony`,rA()),n.registerLanguage(`powershell`,iA()),n.registerLanguage(`processing`,aA()),n.registerLanguage(`profile`,oA()),n.registerLanguage(`prolog`,sA()),n.registerLanguage(`properties`,cA()),n.registerLanguage(`protobuf`,lA()),n.registerLanguage(`puppet`,uA()),n.registerLanguage(`purebasic`,dA()),n.registerLanguage(`python`,fA()),n.registerLanguage(`python-repl`,pA()),n.registerLanguage(`q`,mA()),n.registerLanguage(`qml`,hA()),n.registerLanguage(`r`,gA()),n.registerLanguage(`reasonml`,_A()),n.registerLanguage(`rib`,vA()),n.registerLanguage(`roboconf`,yA()),n.registerLanguage(`routeros`,bA()),n.registerLanguage(`rsl`,xA()),n.registerLanguage(`ruleslanguage`,SA()),n.registerLanguage(`rust`,CA()),n.registerLanguage(`sas`,wA()),n.registerLanguage(`scala`,TA()),n.registerLanguage(`scheme`,EA()),n.registerLanguage(`scilab`,DA()),n.registerLanguage(`scss`,OA()),n.registerLanguage(`shell`,kA()),n.registerLanguage(`smali`,AA()),n.registerLanguage(`smalltalk`,jA()),n.registerLanguage(`sml`,MA()),n.registerLanguage(`sqf`,NA()),n.registerLanguage(`sql`,PA()),n.registerLanguage(`stan`,FA()),n.registerLanguage(`stata`,IA()),n.registerLanguage(`step21`,LA()),n.registerLanguage(`stylus`,RA()),n.registerLanguage(`subunit`,zA()),n.registerLanguage(`swift`,BA()),n.registerLanguage(`taggerscript`,VA()),n.registerLanguage(`yaml`,HA()),n.registerLanguage(`tap`,UA()),n.registerLanguage(`tcl`,WA()),n.registerLanguage(`thrift`,GA()),n.registerLanguage(`tp`,KA()),n.registerLanguage(`twig`,qA()),n.registerLanguage(`typescript`,JA()),n.registerLanguage(`vala`,YA()),n.registerLanguage(`vbnet`,XA()),n.registerLanguage(`vbscript`,ZA()),n.registerLanguage(`vbscript-html`,QA()),n.registerLanguage(`verilog`,$A()),n.registerLanguage(`vhdl`,ej()),n.registerLanguage(`vim`,tj()),n.registerLanguage(`wasm`,nj()),n.registerLanguage(`wren`,rj()),n.registerLanguage(`x86asm`,ij()),n.registerLanguage(`xl`,aj()),n.registerLanguage(`xquery`,oj()),n.registerLanguage(`zephir`,sj()),n.HighlightJS=n,n.default=n,t.exports=n}))()).default;function lj(e){return e.replace(/&amp;/g,`&`).replace(/&lt;/g,`<`).replace(/&gt;/g,`>`).replace(/&quot;/g,`"`).replace(/&#039;/g,`'`)}var uj=new AD.Renderer;uj.code=function({text:e,lang:t}){let n=t||``,r=cj.getLanguage(n)?n:`plaintext`,i=lj(e),a=cj.highlight(i,{language:r}).value;return`<pre><code class="hljs language-${t||r}">${a}</code></pre>`},AD.use({renderer:uj});function dj(e){let t=Math.floor((Date.now()-e)/1e3);if(t<5)return`just now`;if(t<60)return`${t}s ago`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function fj(e){let t=e.split(`/`);return t[t.length-1]}var pj={nord:{themeName:`nord`,type:`dark`},"github-dark":{themeName:`github-dark`,type:`dark`},"github-dark-dimmed":{themeName:`github-dark-dimmed`,type:`dark`},"github-dark-high-contrast":{themeName:`github-dark-high-contrast`,type:`dark`},"github-light":{themeName:`github-light`,type:`light`},"github-light-high-contrast":{themeName:`github-light-high-contrast`,type:`light`},dracula:{themeName:`dracula`,type:`dark`},"one-dark":{themeName:`one-dark-pro`,type:`dark`},"synthwave-84":{themeName:`synthwave-84`,type:`dark`},"tokyo-night":{themeName:`tokyo-night`,type:`dark`},"catppuccin-mocha":{themeName:`catppuccin-mocha`,type:`dark`},"catppuccin-frappe":{themeName:`catppuccin-frappe`,type:`dark`},"catppuccin-macchiato":{themeName:`catppuccin-macchiato`,type:`dark`},"catppuccin-latte":{themeName:`catppuccin-latte`,type:`light`},"solarized-dark":{themeName:`solarized-dark`,type:`dark`},"solarized-light":{themeName:`solarized-light`,type:`light`},monokai:{themeName:`monokai`,type:`dark`},"ayu-dark":{themeName:`ayu-dark`,type:`dark`},"ayu-light":{themeName:`ayu-light`,type:`light`},andromeeda:{themeName:`andromeeda`,type:`dark`},"aurora-x":{themeName:`aurora-x`,type:`dark`},"dark-plus":{themeName:`dark-plus`,type:`dark`},"light-plus":{themeName:`light-plus`,type:`light`},houston:{themeName:`houston`,type:`dark`},laserwave:{themeName:`laserwave`,type:`dark`},"material-theme":{themeName:`material-theme`,type:`dark`},"material-theme-darker":{themeName:`material-theme-darker`,type:`dark`},"material-theme-lighter":{themeName:`material-theme-lighter`,type:`light`},"material-theme-ocean":{themeName:`material-theme-ocean`,type:`dark`},"material-theme-palenight":{themeName:`material-theme-palenight`,type:`dark`},"min-dark":{themeName:`min-dark`,type:`dark`},"min-light":{themeName:`min-light`,type:`light`},"night-owl":{themeName:`night-owl`,type:`dark`},"one-light":{themeName:`one-light`,type:`light`},plastic:{themeName:`plastic`,type:`dark`},poimandres:{themeName:`poimandres`,type:`dark`},"rose-pine":{themeName:`rose-pine`,type:`dark`},"rose-pine-moon":{themeName:`rose-pine-moon`,type:`dark`},"rose-pine-dawn":{themeName:`rose-pine-dawn`,type:`light`},"slack-dark":{themeName:`slack-dark`,type:`dark`},"slack-ochre":{themeName:`slack-ochre`,type:`dark`},vesper:{themeName:`vesper`,type:`dark`},"vitesse-black":{themeName:`vitesse-black`,type:`dark`},"vitesse-dark":{themeName:`vitesse-dark`,type:`dark`},"vitesse-light":{themeName:`vitesse-light`,type:`light`},nightfox:{themeName:`nightfox`,type:`dark`},nordfox:{themeName:`nordfox`,type:`dark`},duskfox:{themeName:`duskfox`,type:`dark`},terafox:{themeName:`terafox`,type:`dark`},carbonfox:{themeName:`carbonfox`,type:`dark`},dayfox:{themeName:`dayfox`,type:`light`},dawnfox:{themeName:`dawnfox`,type:`light`}};function mj(e){if(!e)return``;let t=e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#039;`);try{return AD.parse(t,{gfm:!0,breaks:!0})}catch(e){return console.error(`Failed to parse markdown:`,e),t}}function hj(e,t){let n=[];return e.querySelectorAll(t).forEach(e=>n.push(e)),e.querySelectorAll(`*`).forEach(e=>{e.shadowRoot&&n.push(...hj(e.shadowRoot,t))}),n}function gj(e,t){let n=e;if(t&&t.trim()){let r=t.trim(),i=e.querySelectorAll(`span, code, pre`);for(let e of i)if(e.textContent?.trim()===r){n=e;break}if(n===e){for(let e of i)if(e.textContent?.trim().includes(r)){n=e;break}}}let r=n.style.borderRadius,i=n.style.padding;n.style.setProperty(`transition`,`none`,`important`),n.style.setProperty(`background-color`,`rgba(235, 186, 0, 0.55)`,`important`),n.style.setProperty(`box-shadow`,`0 0 0 2.5px rgba(235, 186, 0, 0.85)`,`important`),n.style.setProperty(`border-radius`,`4px`,`important`),n!==e&&n.style.setProperty(`padding`,`1px 5px`,`important`),n.offsetHeight,setTimeout(()=>{n.style.setProperty(`transition`,`background-color 2.5s ease-out, box-shadow 2.5s ease-out`,`important`),n.style.removeProperty(`background-color`),n.style.removeProperty(`box-shadow`),setTimeout(()=>{n.style.removeProperty(`transition`),r||n.style.removeProperty(`border-radius`),i||n.style.removeProperty(`padding`)},2500)},2e3)}function _j(e,t,n){let r=i=>{let a=hj(e,`[data-line]`),o=null;for(let e of a){let n=e.getAttribute(`data-line`);if(n&&parseInt(n,10)===t){o=e;break}}o?(o.scrollIntoView({block:`center`,behavior:`auto`}),gj(o,n)):i>0&&setTimeout(()=>r(i-1),50)};r(20)}function vj(e,t,n,r){let i=document.getElementById(`file-${e}`);if(!i)return;let a=i.querySelector(`input[type="checkbox"]`);a&&a.checked&&a.click(),i.scrollIntoView({block:`start`,behavior:`auto`});let o=n===`additions`||n===`addition`?`addition`:`deletion`,s=e=>{let n=hj(i,`[data-line]`),a=null;for(let e of n){let n=e.getAttribute(`data-line`),r=e.getAttribute(`data-line-type`);if(n&&parseInt(n,10)===t&&r===o){a=e;break}}if(!a)for(let e of n){let n=e.getAttribute(`data-line`);if(n&&parseInt(n,10)===t){a=e;break}}a?(a.scrollIntoView({block:`center`,behavior:`auto`}),gj(a,r)):e>0&&setTimeout(()=>s(e-1),50)};s(12);let c=i.querySelector(`.file-diff-card-header, .file-diff-placeholder-header`);c&&(c.classList.add(`symbol-flash`),setTimeout(()=>c.classList.remove(`symbol-flash`),1200))}var yj=new Map,bj=null;function xj(){if(!(bj||typeof EventSource>`u`)){bj=new EventSource(`/api/live`);for(let e of yj.keys())Sj(e)}}function Sj(e){bj?.addEventListener(e,t=>{let n=t.data;for(let t of yj.get(e)??[])try{t(n)}catch(t){console.error(`live channel handler for "${e}" threw:`,t)}})}function Cj(){[...yj.values()].every(e=>e.size===0)&&bj&&(bj.close(),bj=null)}function wj(e,t){let n=yj.get(e);return n||(n=new Set,yj.set(e,n),bj&&Sj(e)),n.add(t),xj(),()=>{n.delete(t),Cj()}}var Tj=[],Ej={};function Dj(e,t=!0){let[n,r]=(0,W.useState)(null),[i,a]=(0,W.useState)(!0),[o,s]=(0,W.useState)(!1),[c,l]=(0,W.useState)(null),[u,d]=(0,W.useState)(0),f=(0,W.useRef)(!1);return(0,W.useEffect)(()=>{if(!t)return;let n=!1;return f.current?s(!0):a(!0),l(null),fetch(`/api/diff?staged=${e.staged}&untracked=${e.untracked}`).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{n||(f.current=!0,r(e))}).catch(e=>{n||l(e.message)}).finally(()=>{n||(a(!1),s(!1))}),()=>{n=!0}},[e.staged,e.untracked,t,u]),(0,W.useEffect)(()=>{if(!t)return;let e=null,n=wj(`change`,()=>{e&&clearTimeout(e),e=setTimeout(()=>d(e=>e+1),150)});return()=>{e&&clearTimeout(e),n()}},[t]),{patch:n?.patch??null,repoName:n?.repoName??``,branch:n?.branch??``,customMode:n?.customMode??!1,binaryFiles:n?.binaryFiles??Tj,tabSizeMap:n?.tabSizeMap??Ej,untrackedFiles:n?.untrackedFiles??Tj,loading:i,refreshing:o,error:c}}function Oj(e,t){if(e.length===0)return``;let n=new Map;for(let t of e){let e=n.get(t.filePath)??[];e.push(t),n.set(t.filePath,e)}let r=[];r.push(`<code-review-comments>`),r.push(` <instructions>`),r.push(` You are an AI coding assistant. You are receiving a structured list of code review comments to address in the repository.`),r.push(` For each file, review the inline comments and apply the changes requested.`),r.push(` - Target lines are specified by the "line" attribute (e.g. line="10" or line="10-15").`),r.push(` - "side" indicates whether the comment is on "additions" (added/modified lines) or "deletions" (deleted/old lines).`),r.push(` - "status" indicates whether the comment is "open" or "resolved". Only address comments with status="open".`),r.push(` - The <code> block contains the specific code context at the reviewed lines, prefixed with "+" or "-".`),r.push(` - The <body> tag contains the review feedback or request.`),r.push(` - If developers have replied to the comment, their discussion is captured under the <replies> element.`),r.push(` - The comment "id" attribute can be used to reference or update the comment via API if available.`),r.push(``),r.push(` HOW TO REPLY OR ASK FOR CLARIFICATION:`),r.push(` If you need to ask for clarification, explain what you did, or reply to any comment:`),r.push(``),r.push(` Option A: Via the diffing CLI or MCP (Preferred — port-agnostic, no copy-paste)`),r.push(` diffing reply <comment-id> --body "Your response" --model "<your-model-name>"`),r.push(` diffing resolve <comment-id>`),r.push(` (Or the equivalent MCP tools: reply_to_comment, resolve_comment.)`),r.push(``),r.push(` Option B: Via the local HTTP API (if you know the running port)`),r.push(` POST http://localhost:<port>/api/comments/<comment-id>/replies`),r.push(` Payload: { "body": "Your response or clarification request here", "model": "<your-model-name>" }`),r.push(` PUT http://localhost:<port>/api/comments/<comment-id> Payload: { "status": "resolved" }`),r.push(``),r.push(` Option C: Via Text Response (Offline / Chat Copy-Paste)`),r.push(` If you do not have local API access, output your comments/replies inside a structured XML block at the end of your response:`),r.push(` <comment-replies>`),r.push(` <reply to="<comment-id>" model="<your-model-name>"><![CDATA[Your reply or clarification request here]]></reply>`),r.push(` </comment-replies>`),r.push(` </instructions>`);let i=t?.trim();i&&(r.push(` <general-comment>`),r.push(` <![CDATA[${i}]]>`),r.push(` </general-comment>`));for(let[e,t]of n){r.push(` <file path="${e}">`);for(let e of t){let t=e.lineNumber===0?`file`:e.startLineNumber&&e.startLineNumber!==e.lineNumber?`${e.startLineNumber}-${e.lineNumber}`:`${e.lineNumber}`,n=new Date(e.createdAt).toISOString();if(r.push(` <comment id="${e.id}" line="${t}" side="${e.side}" status="${e.status}" created-at="${n}">`),e.lineNumber!==0){let t=e.side===`additions`?`+`:`-`,n=e.lineContent&&e.lineContent.includes(`
1951
- `),i=``;i=n?`\n${e.lineContent.split(`
1950
+ `},{className:`string`,begin:`\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}.\\d+Z`},{className:`string`,begin:`(\\+|-)\\d+`},{className:`keyword`,relevance:10,variants:[{begin:`^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?`},{begin:`^progress(:?)(\\s+)?(pop|push)?`},{begin:`^tags:`},{begin:`^time:`}]}]}}t.exports=n})),BA=o(((e,t)=>{function n(e){return e?typeof e==`string`?e:e.source:null}function r(e){return i(`(?=`,e,`)`)}function i(...e){return e.map(e=>n(e)).join(``)}function a(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function o(...e){return`(`+(a(e).capture?``:`?:`)+e.map(e=>n(e)).join(`|`)+`)`}var s=e=>i(/\b/,e,/\w$/.test(e)?/\b/:/\B/),c=[`Protocol`,`Type`].map(s),l=[`init`,`self`].map(s),u=[`Any`,`Self`],d=[`actor`,`any`,`associatedtype`,`async`,`await`,/as\?/,/as!/,`as`,`borrowing`,`break`,`case`,`catch`,`class`,`consume`,`consuming`,`continue`,`convenience`,`copy`,`default`,`defer`,`deinit`,`didSet`,`distributed`,`do`,`dynamic`,`each`,`else`,`enum`,`extension`,`fallthrough`,/fileprivate\(set\)/,`fileprivate`,`final`,`for`,`func`,`get`,`guard`,`if`,`import`,`indirect`,`infix`,/init\?/,/init!/,`inout`,/internal\(set\)/,`internal`,`in`,`is`,`isolated`,`nonisolated`,`lazy`,`let`,`macro`,`mutating`,`nonmutating`,/open\(set\)/,`open`,`operator`,`optional`,`override`,`package`,`postfix`,`precedencegroup`,`prefix`,/private\(set\)/,`private`,`protocol`,/public\(set\)/,`public`,`repeat`,`required`,`rethrows`,`return`,`set`,`some`,`static`,`struct`,`subscript`,`super`,`switch`,`throws`,`throw`,/try\?/,/try!/,`try`,`typealias`,/unowned\(safe\)/,/unowned\(unsafe\)/,`unowned`,`var`,`weak`,`where`,`while`,`willSet`],f=[`false`,`nil`,`true`],p=[`assignment`,`associativity`,`higherThan`,`left`,`lowerThan`,`none`,`right`],m=[`#colorLiteral`,`#column`,`#dsohandle`,`#else`,`#elseif`,`#endif`,`#error`,`#file`,`#fileID`,`#fileLiteral`,`#filePath`,`#function`,`#if`,`#imageLiteral`,`#keyPath`,`#line`,`#selector`,`#sourceLocation`,`#warning`],h=`abs.all.any.assert.assertionFailure.debugPrint.dump.fatalError.getVaList.isKnownUniquelyReferenced.max.min.numericCast.pointwiseMax.pointwiseMin.precondition.preconditionFailure.print.readLine.repeatElement.sequence.stride.swap.swift_unboxFromSwiftValueWithType.transcode.type.unsafeBitCast.unsafeDowncast.withExtendedLifetime.withUnsafeMutablePointer.withUnsafePointer.withVaList.withoutActuallyEscaping.zip`.split(`.`),g=o(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),_=o(g,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),v=i(g,_,`*`),y=o(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),b=o(y,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),x=i(y,b,`*`),S=i(/[A-Z]/,b,`*`),C=[`attached`,`autoclosure`,i(/convention\(/,o(`swift`,`block`,`c`),/\)/),`discardableResult`,`dynamicCallable`,`dynamicMemberLookup`,`escaping`,`freestanding`,`frozen`,`GKInspectable`,`IBAction`,`IBDesignable`,`IBInspectable`,`IBOutlet`,`IBSegueAction`,`inlinable`,`main`,`nonobjc`,`NSApplicationMain`,`NSCopying`,`NSManaged`,i(/objc\(/,x,/\)/),`objc`,`objcMembers`,`propertyWrapper`,`requires_stored_property_inits`,`resultBuilder`,`Sendable`,`testable`,`UIApplicationMain`,`unchecked`,`unknown`,`usableFromInline`,`warn_unqualified_access`],w=[`iOS`,`iOSApplicationExtension`,`macOS`,`macOSApplicationExtension`,`macCatalyst`,`macCatalystApplicationExtension`,`watchOS`,`watchOSApplicationExtension`,`tvOS`,`tvOSApplicationExtension`,`swift`];function T(e){let t={match:/\s+/,relevance:0},n=e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),a=[e.C_LINE_COMMENT_MODE,n],g={match:[/\./,o(...c,...l)],className:{2:`keyword`}},y={match:i(/\./,o(...d)),relevance:0},T=d.filter(e=>typeof e==`string`).concat([`_|0`]),E={variants:[{className:`keyword`,match:o(...d.filter(e=>typeof e!=`string`).concat(u).map(s),...l)}]},D={$pattern:o(/\b\w+/,/#\w+/),keyword:T.concat(m),literal:f},O=[g,y,E],k=[{match:i(/\./,o(...h)),relevance:0},{className:`built_in`,match:i(/\b/,o(...h),/(?=\()/)}],A={match:/->/,relevance:0},j=[A,{className:`operator`,relevance:0,variants:[{match:v},{match:`\\.(\\.|${_})+`}]}],M=`([0-9]_*)+`,N=`([0-9a-fA-F]_*)+`,P={className:`number`,relevance:0,variants:[{match:`\\b(${M})(\\.(${M}))?([eE][+-]?(${M}))?\\b`},{match:`\\b0x(${N})(\\.(${N}))?([pP][+-]?(${M}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},F=(e=``)=>({className:`subst`,variants:[{match:i(/\\/,e,/[0\\tnr"']/)},{match:i(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),I=(e=``)=>({className:`subst`,match:i(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),L=(e=``)=>({className:`subst`,label:`interpol`,begin:i(/\\/,e,/\(/),end:/\)/}),R=(e=``)=>({begin:i(e,/"""/),end:i(/"""/,e),contains:[F(e),I(e),L(e)]}),z=(e=``)=>({begin:i(e,/"/),end:i(/"/,e),contains:[F(e),L(e)]}),ee={className:`string`,variants:[R(),R(`#`),R(`##`),R(`###`),z(),z(`#`),z(`##`),z(`###`)]},te=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],B={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:te},V=e=>{let t=i(e,/\//),n=i(/\//,e);return{begin:t,end:n,contains:[...te,{scope:`comment`,begin:`#(?!.*${n})`,end:/$/}]}},H={scope:`regexp`,variants:[V(`###`),V(`##`),V(`#`),B]},ne={match:i(/`/,x,/`/)},re=[ne,{className:`variable`,match:/\$\d+/},{className:`variable`,match:`\\$${b}+`}],ie=[{match:/(@|#(un)?)available/,scope:`keyword`,starts:{contains:[{begin:/\(/,end:/\)/,keywords:w,contains:[...j,P,ee]}]}},{scope:`keyword`,match:i(/@/,o(...C),r(o(/\(/,/\s+/)))},{scope:`meta`,match:i(/@/,x)}],ae={match:r(/\b[A-Z]/),relevance:0,contains:[{className:`type`,match:i(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,b,`+`)},{className:`type`,match:S,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:i(/\s+&\s+/,r(S)),relevance:0}]},oe={begin:/</,end:/>/,keywords:D,contains:[...a,...O,...ie,A,ae]};ae.contains.push(oe);let se={begin:/\(/,end:/\)/,relevance:0,keywords:D,contains:[`self`,{match:i(x,/\s*:/),keywords:`_|0`,relevance:0},...a,H,...O,...k,...j,P,ee,...re,...ie,ae]},ce={begin:/</,end:/>/,keywords:`repeat each`,contains:[...a,ae]},le={begin:/\(/,end:/\)/,keywords:D,contains:[{begin:o(r(i(x,/\s*:/)),r(i(x,/\s+/,x,/\s*:/))),end:/:/,relevance:0,contains:[{className:`keyword`,match:/\b_\b/},{className:`params`,match:x}]},...a,...O,...j,P,ee,...ie,ae,se],endsParent:!0,illegal:/["']/},ue={match:[/(func|macro)/,/\s+/,o(ne.match,x,v)],className:{1:`keyword`,3:`title.function`},contains:[ce,le,t],illegal:[/\[/,/%/]},U={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:`keyword`},contains:[ce,le,t],illegal:/\[|%/},de={match:[/operator/,/\s+/,v],className:{1:`keyword`,3:`title`}},fe={begin:[/precedencegroup/,/\s+/,S],className:{1:`keyword`,3:`title`},contains:[ae],keywords:[...p,...f],end:/}/},pe={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:`keyword`,3:`keyword`,5:`title.function`}},me={match:[/class\b/,/\s+/,/var\b/],scope:{1:`keyword`,3:`keyword`}},he={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,x,/\s*/],beginScope:{1:`keyword`,3:`title.class`},keywords:D,contains:[ce,...O,{begin:/:/,end:/\{/,keywords:D,contains:[{scope:`title.class.inherited`,match:S},...O],relevance:0}]};for(let e of ee.variants){let t=e.contains.find(e=>e.label===`interpol`);t.keywords=D;let n=[...O,...k,...j,P,ee,...re];t.contains=[...n,{begin:/\(/,end:/\)/,contains:[`self`,...n]}]}return{name:`Swift`,keywords:D,contains:[...a,ue,U,pe,me,he,de,fe,{beginKeywords:`import`,end:/$/,contains:[...a],relevance:0},H,...O,...k,...j,P,ee,...re,...ie,ae,se]}}t.exports=T})),VA=o(((e,t)=>{function n(e){return{name:`Tagger Script`,contains:[{className:`comment`,begin:/\$noop\(/,end:/\)/,contains:[{begin:/\\[()]/},{begin:/\(/,end:/\)/,contains:[{begin:/\\[()]/},`self`]}],relevance:10},{className:`keyword`,begin:/\$[_a-zA-Z0-9]+(?=\()/},{className:`variable`,begin:/%[_a-zA-Z0-9:]+%/},{className:`symbol`,begin:/\\[\\nt$%,()]/},{className:`symbol`,begin:/\\u[a-fA-F0-9]{4}/}]}}t.exports=n})),HA=o(((e,t)=>{function n(e){let t=`true false yes no null`,n=`[\\w#;/?:@&=+$,.~*'()[\\]]+`,r={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},o={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},l={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:`\\n`,relevance:0},d={begin:`\\[`,end:`\\]`,contains:[l],illegal:`\\n`,relevance:0},f=[r,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+!`+n},{className:`type`,begin:`!<`+n+`>`},{className:`type`,begin:`!`+n},{className:`type`,begin:`!!`+n},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},c,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:f}}t.exports=n})),UA=o(((e,t)=>{function n(e){return{name:`Test Anything Protocol`,case_insensitive:!0,contains:[e.HASH_COMMENT_MODE,{className:`meta`,variants:[{begin:`^TAP version (\\d+)$`},{begin:`^1\\.\\.(\\d+)$`}]},{begin:/---$/,end:`\\.\\.\\.$`,subLanguage:`yaml`,relevance:0},{className:`number`,begin:` (\\d+) `},{className:`symbol`,variants:[{begin:`^ok`},{begin:`^not ok`}]}]}}t.exports=n})),WA=o(((e,t)=>{function n(e){let t=e.regex,n=/[a-zA-Z_][a-zA-Z0-9_]*/,r={className:`number`,variants:[e.BINARY_NUMBER_MODE,e.C_NUMBER_MODE]};return{name:`Tcl`,aliases:[`tk`],keywords:`after.append.apply.array.auto_execok.auto_import.auto_load.auto_mkindex.auto_mkindex_old.auto_qualify.auto_reset.bgerror.binary.break.catch.cd.chan.clock.close.concat.continue.dde.dict.encoding.eof.error.eval.exec.exit.expr.fblocked.fconfigure.fcopy.file.fileevent.filename.flush.for.foreach.format.gets.glob.global.history.http.if.incr.info.interp.join.lappend|10.lassign|10.lindex|10.linsert|10.list.llength|10.load.lrange|10.lrepeat|10.lreplace|10.lreverse|10.lsearch|10.lset|10.lsort|10.mathfunc.mathop.memory.msgcat.namespace.open.package.parray.pid.pkg::create.pkg_mkIndex.platform.platform::shell.proc.puts.pwd.read.refchan.regexp.registry.regsub|10.rename.return.safe.scan.seek.set.socket.source.split.string.subst.switch.tcl_endOfWord.tcl_findLibrary.tcl_startOfNextWord.tcl_startOfPreviousWord.tcl_wordBreakAfter.tcl_wordBreakBefore.tcltest.tclvars.tell.time.tm.trace.unknown.unload.unset.update.uplevel.upvar.variable.vwait.while`.split(`.`),contains:[e.COMMENT(`;[ \\t]*#`,`$`),e.COMMENT(`^[ \\t]*#`,`$`),{beginKeywords:`proc`,end:`[\\{]`,excludeEnd:!0,contains:[{className:`title`,begin:`[ \\t\\n\\r]+(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*`,end:`[ \\t\\n\\r]`,endsWithParent:!0,excludeEnd:!0}]},{className:`variable`,variants:[{begin:t.concat(/\$/,t.optional(/::/),n,`(::`,n,`)*`)},{begin:`\\$\\{(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*`,end:`\\}`,contains:[r]}]},{className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[e.inherit(e.QUOTE_STRING_MODE,{illegal:null})]},r]}}t.exports=n})),GA=o(((e,t)=>{function n(e){let t=[`bool`,`byte`,`i16`,`i32`,`i64`,`double`,`string`,`binary`];return{name:`Thrift`,keywords:{keyword:[`namespace`,`const`,`typedef`,`struct`,`enum`,`service`,`exception`,`void`,`oneway`,`set`,`list`,`map`,`required`,`optional`],type:t,literal:`true false`},contains:[e.QUOTE_STRING_MODE,e.NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`class`,beginKeywords:`struct enum service exception`,end:/\{/,illegal:/\n/,contains:[e.inherit(e.TITLE_MODE,{starts:{endsWithParent:!0,excludeEnd:!0}})]},{begin:`\\b(set|list|map)\\s*<`,keywords:{type:[...t,`set`,`list`,`map`]},end:`>`,contains:[`self`]}]}}t.exports=n})),KA=o(((e,t)=>{function n(e){let t={className:`number`,begin:`[1-9][0-9]*`,relevance:0},n={className:`symbol`,begin:`:[^\\]]+`};return{name:`TP`,keywords:{keyword:`ABORT.ACC.ADJUST.AND.AP_LD.BREAK.CALL.CNT.COL.CONDITION.CONFIG.DA.DB.DIV.DETECT.ELSE.END.ENDFOR.ERR_NUM.ERROR_PROG.FINE.FOR.GP.GUARD.INC.IF.JMP.LINEAR_MAX_SPEED.LOCK.MOD.MONITOR.OFFSET.Offset.OR.OVERRIDE.PAUSE.PREG.PTH.RT_LD.RUN.SELECT.SKIP.Skip.TA.TB.TO.TOOL_OFFSET.Tool_Offset.UF.UT.UFRAME_NUM.UTOOL_NUM.UNLOCK.WAIT.X.Y.Z.W.P.R.STRLEN.SUBSTR.FINDSTR.VOFFSET.PROG.ATTR.MN.POS`.split(`.`),literal:[`ON`,`OFF`,`max_speed`,`LPOS`,`JPOS`,`ENABLE`,`DISABLE`,`START`,`STOP`,`RESET`]},contains:[{className:`built_in`,begin:`(AR|P|PAYLOAD|PR|R|SR|RSR|LBL|VR|UALM|MESSAGE|UTOOL|UFRAME|TIMER|TIMER_OVERFLOW|JOINT_MAX_SPEED|RESUME_PROG|DIAG_REC)\\[`,end:`\\]`,contains:[`self`,t,n]},{className:`built_in`,begin:`(AI|AO|DI|DO|F|RI|RO|UI|UO|GI|GO|SI|SO)\\[`,end:`\\]`,contains:[`self`,t,e.QUOTE_STRING_MODE,n]},{className:`keyword`,begin:`/(PROG|ATTR|MN|POS|END)\\b`},{className:`keyword`,begin:`(CALL|RUN|POINT_LOGIC|LBL)\\b`},{className:`keyword`,begin:`\\b(ACC|CNT|Skip|Offset|PSPD|RT_LD|AP_LD|Tool_Offset)`},{className:`number`,begin:`\\d+(sec|msec|mm/sec|cm/min|inch/min|deg/sec|mm|in|cm)?\\b`,relevance:0},e.COMMENT(`//`,`[;$]`),e.COMMENT(`!`,`[;$]`),e.COMMENT(`--eg:`,`$`),e.QUOTE_STRING_MODE,{className:`string`,begin:`'`,end:`'`},e.C_NUMBER_MODE,{className:`variable`,begin:`\\$[A-Za-z0-9_]+`}]}}t.exports=n})),qA=o(((e,t)=>{function n(e){let t=e.regex,n=`absolute_url.asset|0.asset_version.attribute.block.constant.controller|0.country_timezones.csrf_token.cycle.date.dump.expression.form|0.form_end.form_errors.form_help.form_label.form_rest.form_row.form_start.form_widget.html_classes.include.is_granted.logout_path.logout_url.max.min.parent.path|0.random.range.relative_path.render.render_esi.source.template_from_string.url|0`.split(`.`),r=`abs.abbr_class.abbr_method.batch.capitalize.column.convert_encoding.country_name.currency_name.currency_symbol.data_uri.date.date_modify.default.escape.file_excerpt.file_link.file_relative.filter.first.format.format_args.format_args_as_text.format_currency.format_date.format_datetime.format_file.format_file_from_text.format_number.format_time.html_to_markdown.humanize.inky_to_html.inline_css.join.json_encode.keys.language_name.last.length.locale_name.lower.map.markdown.markdown_to_html.merge.nl2br.number_format.raw.reduce.replace.reverse.round.slice.slug.sort.spaceless.split.striptags.timezone_name.title.trans.transchoice.trim.u|0.upper.url_encode.yaml_dump.yaml_encode`.split(`.`),i=`apply.autoescape.block.cache.deprecated.do.embed.extends.filter.flush.for.form_theme.from.if.import.include.macro.sandbox.set.stopwatch.trans.trans_default_domain.transchoice.use.verbatim.with`.split(`.`);i=i.concat(i.map(e=>`end${e}`));let a={scope:`string`,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/}]},o={scope:`number`,match:/\d+/},s={begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,contains:[a,o]},c={beginKeywords:n.join(` `),keywords:{name:n},relevance:0,contains:[s]},l={match:/\|(?=[A-Za-z_]+:?)/,beginScope:`punctuation`,relevance:0,contains:[{match:/[A-Za-z_]+:?/,keywords:r}]},u=(e,{relevance:n})=>({beginScope:{1:`template-tag`,3:`name`},relevance:n||2,endScope:`template-tag`,begin:[/\{%/,/\s*/,t.either(...e)],end:/%\}/,keywords:`in`,contains:[l,c,a,o]}),d=/[a-z_]+/,f=u(i,{relevance:2}),p=u([d],{relevance:1});return{name:`Twig`,aliases:[`craftcms`],case_insensitive:!0,subLanguage:`xml`,contains:[e.COMMENT(/\{#/,/#\}/),f,p,{className:`template-variable`,begin:/\{\{/,end:/\}\}/,contains:[`self`,l,c,a,o]}]}}t.exports=n})),JA=o(((e,t)=>{var n=`[A-Za-z$_][0-9A-Za-z$_]*`,r=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),i=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],a=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),o=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],s=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],c=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],l=[].concat(s,a,o);function u(e){let t=e.regex,u=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},d=n,f={begin:`<>`,end:`</>`},p=/<[A-Za-z0-9\\._:-]+\s*\/>/,m={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let n=e[0].length+e.index,r=e.input[n];if(r===`<`||r===`,`){t.ignoreMatch();return}r===`>`&&(u(e,{after:n})||t.ignoreMatch());let i,a=e.input.substring(n);if(i=a.match(/^\s*=/)){t.ignoreMatch();return}if((i=a.match(/^\s+extends\s+/))&&i.index===0){t.ignoreMatch();return}}},h={$pattern:n,keyword:r,literal:i,built_in:l,"variable.language":c},g=`[0-9](_?[0-9])*`,_=`\\.(${g})`,v=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,y={className:`number`,variants:[{begin:`(\\b(${v})((${_})|\\.)?|(${_}))[eE][+-]?(${g})\\b`},{begin:`\\b(${v})\\b((${_})\\b|\\.)?|(${_})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},b={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:h,contains:[]},x={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:`xml`}},S={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:`css`}},C={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:`graphql`}},w={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,b]},T={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:d+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},E=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,S,C,w,{match:/\$\d+/},y];b.contains=E.concat({begin:/\{/,end:/\}/,keywords:h,contains:[`self`].concat(E)});let D=[].concat(T,b.contains),O=D.concat([{begin:/(\s*)\(/,end:/\)/,keywords:h,contains:[`self`].concat(D)}]),k={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:O},A={variants:[{match:[/class/,/\s+/,d,/\s+/,/extends/,/\s+/,t.concat(d,`(`,t.concat(/\./,d),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,d],scope:{1:`keyword`,3:`title.class`}}]},j={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...a,...o]}},M={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},N={variants:[{match:[/function/,/\s+/,d,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[k],illegal:/%/},P={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function F(e){return t.concat(`(?!`,e.join(`|`),`)`)}let I={match:t.concat(/\b/,F([...s,`super`,`import`].map(e=>`${e}\\s*\\(`)),d,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(d,/(?![0-9A-Za-z$_(])/))),end:d,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},R={match:[/get|set/,/\s+/,d,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},k]},z=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,ee={match:[/const|var|let/,/\s+/,d,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[k]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:h,exports:{PARAMS_CONTAINS:O,CLASS_REFERENCE:j},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),M,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,S,C,w,T,{match:/\$\d+/},y,j,{scope:`attr`,match:d+t.lookahead(`:`),relevance:0},ee,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[T,e.REGEXP_MODE,{className:`function`,begin:z,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:O}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:f.begin,end:f.end},{match:p},{begin:m.begin,"on:begin":m.isTrulyOpeningTag,end:m.end}],subLanguage:`xml`,contains:[{begin:m.begin,end:m.end,skip:!0,contains:[`self`]}]}]},N,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[k,e.inherit(e.TITLE_MODE,{begin:d,className:`title.function`})]},{match:/\.\.\./,relevance:0},L,{match:`\\$`+d,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[k]},I,P,A,R,{match:/\$[(.]/}]}}function d(e){let t=e.regex,a=u(e),o=n,s=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],d={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},f={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:s},contains:[a.exports.CLASS_REFERENCE]},p={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},m={$pattern:n,keyword:r.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:i,built_in:l.concat(s),"variable.language":c},h={className:`meta`,begin:`@`+o},g=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(a.keywords,m),a.exports.PARAMS_CONTAINS.push(h);let _=a.contains.find(e=>e.scope===`attr`),v=Object.assign({},_,{match:t.concat(o,t.lookahead(/\s*\?:/))});a.exports.PARAMS_CONTAINS.push([a.exports.CLASS_REFERENCE,_,v]),a.contains=a.contains.concat([h,d,f,v]),g(a,`shebang`,e.SHEBANG()),g(a,`use_strict`,p);let y=a.contains.find(e=>e.label===`func.def`);return y.relevance=0,Object.assign(a,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),a}t.exports=d})),YA=o(((e,t)=>{function n(e){return{name:`Vala`,keywords:{keyword:`char uchar unichar int uint long ulong short ushort int8 int16 int32 int64 uint8 uint16 uint32 uint64 float double bool struct enum string void weak unowned owned async signal static abstract interface override virtual delegate if while do for foreach else switch case break default return try catch public private protected internal using new this get set const stdout stdin stderr var`,built_in:`DBus GLib CCode Gee Object Gtk Posix`,literal:`false true null`},contains:[{className:`class`,beginKeywords:`class interface namespace`,end:/\{/,excludeEnd:!0,illegal:`[^,:\\n\\s\\.]`,contains:[e.UNDERSCORE_TITLE_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`string`,begin:`"""`,end:`"""`,relevance:5},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.C_NUMBER_MODE,{className:`meta`,begin:`^#`,end:`$`}]}}t.exports=n})),XA=o(((e,t)=>{function n(e){let t=e.regex,n={className:`string`,begin:/"(""|[^/n])"C\b/},r={className:`string`,begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,s=/\d{1,2}(:\d{1,2}){1,2}/,c={className:`literal`,variants:[{begin:t.concat(/# */,t.either(a,i),/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(a,i),/ +/,t.either(o,s),/ *#/)}]},l={className:`number`,relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:`label`,begin:/^\w+:/},d=e.COMMENT(/'''/,/$/,{contains:[{className:`doctag`,begin:/<\/?/,end:/>/}]}),f=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:`Visual Basic .NET`,aliases:[`vb`],case_insensitive:!0,classNameAliases:{label:`symbol`},keywords:{keyword:`addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield`,built_in:`addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort`,type:`boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort`,literal:`true false nothing`},illegal:`//|\\{|\\}|endif|gosub|variant|wend|^\\$ `,contains:[n,r,c,l,u,d,f,{className:`meta`,begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:`const disable else elseif enable end externalsource if region then`},contains:[f]}]}}t.exports=n})),ZA=o(((e,t)=>{function n(e){let t=e.regex,n=`lcase.month.vartype.instrrev.ubound.setlocale.getobject.rgb.getref.string.weekdayname.rnd.dateadd.monthname.now.day.minute.isarray.cbool.round.formatcurrency.conversions.csng.timevalue.second.year.space.abs.clng.timeserial.fixs.len.asc.isempty.maths.dateserial.atn.timer.isobject.filter.weekday.datevalue.ccur.isdate.instr.datediff.formatdatetime.replace.isnull.right.sgn.array.snumeric.log.cdbl.hex.chr.lbound.msgbox.ucase.getlocale.cos.cdate.cbyte.rtrim.join.hour.oct.typename.trim.strcomp.int.createobject.loadpicture.tan.formatnumber.mid.split.cint.sin.datepart.ltrim.sqr.time.derived.eval.date.formatpercent.exp.inputbox.left.ascw.chrw.regexp.cstr.err`.split(`.`),r=[`server`,`response`,`request`,`scriptengine`,`scriptenginebuildversion`,`scriptengineminorversion`,`scriptenginemajorversion`],i={begin:t.concat(t.either(...n),`\\s*\\(`),relevance:0,keywords:{built_in:n}};return{name:`VBScript`,aliases:[`vbs`],case_insensitive:!0,keywords:{keyword:`call.class.const.dim.do.loop.erase.execute.executeglobal.exit.for.each.next.function.if.then.else.on.error.option.explicit.new.private.property.let.get.public.randomize.redim.rem.select.case.set.stop.sub.while.wend.with.end.to.elseif.is.or.xor.and.not.class_initialize.class_terminate.default.preserve.in.me.byval.byref.step.resume.goto`.split(`.`),built_in:r,literal:[`true`,`false`,`null`,`nothing`,`empty`]},illegal:`//`,contains:[i,e.inherit(e.QUOTE_STRING_MODE,{contains:[{begin:`""`}]}),e.COMMENT(/'/,/$/,{relevance:0}),e.C_NUMBER_MODE]}}t.exports=n})),QA=o(((e,t)=>{function n(e){return{name:`VBScript in HTML`,subLanguage:`xml`,contains:[{begin:`<%`,end:`%>`,subLanguage:`vbscript`}]}}t.exports=n})),$A=o(((e,t)=>{function n(e){let t=e.regex,n={$pattern:/\$?[\w]+(\$[\w]+)*/,keyword:`accept_on.alias.always.always_comb.always_ff.always_latch.and.assert.assign.assume.automatic.before.begin.bind.bins.binsof.bit.break.buf|0.bufif0.bufif1.byte.case.casex.casez.cell.chandle.checker.class.clocking.cmos.config.const.constraint.context.continue.cover.covergroup.coverpoint.cross.deassign.default.defparam.design.disable.dist.do.edge.else.end.endcase.endchecker.endclass.endclocking.endconfig.endfunction.endgenerate.endgroup.endinterface.endmodule.endpackage.endprimitive.endprogram.endproperty.endspecify.endsequence.endtable.endtask.enum.event.eventually.expect.export.extends.extern.final.first_match.for.force.foreach.forever.fork.forkjoin.function.generate|5.genvar.global.highz0.highz1.if.iff.ifnone.ignore_bins.illegal_bins.implements.implies.import.incdir.include.initial.inout.input.inside.instance.int.integer.interconnect.interface.intersect.join.join_any.join_none.large.let.liblist.library.local.localparam.logic.longint.macromodule.matches.medium.modport.module.nand.negedge.nettype.new.nexttime.nmos.nor.noshowcancelled.not.notif0.notif1.or.output.package.packed.parameter.pmos.posedge.primitive.priority.program.property.protected.pull0.pull1.pulldown.pullup.pulsestyle_ondetect.pulsestyle_onevent.pure.rand.randc.randcase.randsequence.rcmos.real.realtime.ref.reg.reject_on.release.repeat.restrict.return.rnmos.rpmos.rtran.rtranif0.rtranif1.s_always.s_eventually.s_nexttime.s_until.s_until_with.scalared.sequence.shortint.shortreal.showcancelled.signed.small.soft.solve.specify.specparam.static.string.strong.strong0.strong1.struct.super.supply0.supply1.sync_accept_on.sync_reject_on.table.tagged.task.this.throughout.time.timeprecision.timeunit.tran.tranif0.tranif1.tri.tri0.tri1.triand.trior.trireg.type.typedef.union.unique.unique0.unsigned.until.until_with.untyped.use.uwire.var.vectored.virtual.void.wait.wait_order.wand.weak.weak0.weak1.while.wildcard.wire.with.within.wor.xnor.xor`.split(`.`),literal:[`null`],built_in:`$finish.$stop.$exit.$fatal.$error.$warning.$info.$realtime.$time.$printtimescale.$bitstoreal.$bitstoshortreal.$itor.$signed.$cast.$bits.$stime.$timeformat.$realtobits.$shortrealtobits.$rtoi.$unsigned.$asserton.$assertkill.$assertpasson.$assertfailon.$assertnonvacuouson.$assertoff.$assertcontrol.$assertpassoff.$assertfailoff.$assertvacuousoff.$isunbounded.$sampled.$fell.$changed.$past_gclk.$fell_gclk.$changed_gclk.$rising_gclk.$steady_gclk.$coverage_control.$coverage_get.$coverage_save.$set_coverage_db_name.$rose.$stable.$past.$rose_gclk.$stable_gclk.$future_gclk.$falling_gclk.$changing_gclk.$display.$coverage_get_max.$coverage_merge.$get_coverage.$load_coverage_db.$typename.$unpacked_dimensions.$left.$low.$increment.$clog2.$ln.$log10.$exp.$sqrt.$pow.$floor.$ceil.$sin.$cos.$tan.$countbits.$onehot.$isunknown.$fatal.$warning.$dimensions.$right.$high.$size.$asin.$acos.$atan.$atan2.$hypot.$sinh.$cosh.$tanh.$asinh.$acosh.$atanh.$countones.$onehot0.$error.$info.$random.$dist_chi_square.$dist_erlang.$dist_exponential.$dist_normal.$dist_poisson.$dist_t.$dist_uniform.$q_initialize.$q_remove.$q_exam.$async$and$array.$async$nand$array.$async$or$array.$async$nor$array.$sync$and$array.$sync$nand$array.$sync$or$array.$sync$nor$array.$q_add.$q_full.$psprintf.$async$and$plane.$async$nand$plane.$async$or$plane.$async$nor$plane.$sync$and$plane.$sync$nand$plane.$sync$or$plane.$sync$nor$plane.$system.$display.$displayb.$displayh.$displayo.$strobe.$strobeb.$strobeh.$strobeo.$write.$readmemb.$readmemh.$writememh.$value$plusargs.$dumpvars.$dumpon.$dumplimit.$dumpports.$dumpportson.$dumpportslimit.$writeb.$writeh.$writeo.$monitor.$monitorb.$monitorh.$monitoro.$writememb.$dumpfile.$dumpoff.$dumpall.$dumpflush.$dumpportsoff.$dumpportsall.$dumpportsflush.$fclose.$fdisplay.$fdisplayb.$fdisplayh.$fdisplayo.$fstrobe.$fstrobeb.$fstrobeh.$fstrobeo.$swrite.$swriteb.$swriteh.$swriteo.$fscanf.$fread.$fseek.$fflush.$feof.$fopen.$fwrite.$fwriteb.$fwriteh.$fwriteo.$fmonitor.$fmonitorb.$fmonitorh.$fmonitoro.$sformat.$sformatf.$fgetc.$ungetc.$fgets.$sscanf.$rewind.$ftell.$ferror`.split(`.`)},r=[`__FILE__`,`__LINE__`],i=`begin_keywords.celldefine.default_nettype.default_decay_time.default_trireg_strength.define.delay_mode_distributed.delay_mode_path.delay_mode_unit.delay_mode_zero.else.elsif.end_keywords.endcelldefine.endif.ifdef.ifndef.include.line.nounconnected_drive.pragma.resetall.timescale.unconnected_drive.undef.undefineall`.split(`.`);return{name:`Verilog`,aliases:[`v`,`sv`,`svh`],case_insensitive:!1,keywords:n,contains:[e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.QUOTE_STRING_MODE,{scope:`number`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/\b((\d+'([bhodBHOD]))[0-9xzXZa-fA-F_]+)/},{begin:/\B(('([bhodBHOD]))[0-9xzXZa-fA-F_]+)/},{begin:/\b[0-9][0-9_]*/,relevance:0}]},{scope:`variable`,variants:[{begin:`#\\((?!parameter).+\\)`},{begin:`\\.\\w+`,relevance:0}]},{scope:`variable.constant`,match:t.concat(/`/,t.either(...r))},{scope:`meta`,begin:t.concat(/`/,t.either(...i)),end:/$|\/\/|\/\*/,returnEnd:!0,keywords:i}]}}t.exports=n})),ej=o(((e,t)=>{function n(e){let t=`\\d(_|\\d)*`;return``+t,t+``,t+``,{name:`VHDL`,case_insensitive:!0,keywords:{keyword:`abs.access.after.alias.all.and.architecture.array.assert.assume.assume_guarantee.attribute.begin.block.body.buffer.bus.case.component.configuration.constant.context.cover.disconnect.downto.default.else.elsif.end.entity.exit.fairness.file.for.force.function.generate.generic.group.guarded.if.impure.in.inertial.inout.is.label.library.linkage.literal.loop.map.mod.nand.new.next.nor.not.null.of.on.open.or.others.out.package.parameter.port.postponed.procedure.process.property.protected.pure.range.record.register.reject.release.rem.report.restrict.restrict_guarantee.return.rol.ror.select.sequence.severity.shared.signal.sla.sll.sra.srl.strong.subtype.then.to.transport.type.unaffected.units.until.use.variable.view.vmode.vprop.vunit.wait.when.while.with.xnor.xor`.split(`.`),built_in:`boolean.bit.character.integer.time.delay_length.natural.positive.string.bit_vector.file_open_kind.file_open_status.std_logic.std_logic_vector.unsigned.signed.boolean_vector.integer_vector.std_ulogic.std_ulogic_vector.unresolved_unsigned.u_unsigned.unresolved_signed.u_signed.real_vector.time_vector`.split(`.`),literal:[`false`,`true`,`note`,`warning`,`error`,`failure`,`line`,`text`,`side`,`width`]},illegal:/\{/,contains:[e.C_BLOCK_COMMENT_MODE,e.COMMENT(`--`,`$`),e.QUOTE_STRING_MODE,{className:`number`,begin:`\\b(\\d(_|\\d)*#\\w+(\\.\\w+)?#([eE][-+]?\\d(_|\\d)*)?|\\d(_|\\d)*(\\.\\d(_|\\d)*)?([eE][-+]?\\d(_|\\d)*)?)`,relevance:0},{className:`string`,begin:`'(U|X|0|1|Z|W|L|H|-)'`,contains:[e.BACKSLASH_ESCAPE]},{className:`symbol`,begin:`'[A-Za-z](_?[A-Za-z0-9])*`,contains:[e.BACKSLASH_ESCAPE]}]}}t.exports=n})),tj=o(((e,t)=>{function n(e){return{name:`Vim Script`,keywords:{$pattern:/[!#@\w]+/,keyword:`N|0 P|0 X|0 a|0 ab abc abo al am an|0 ar arga argd arge argdo argg argl argu as au aug aun b|0 bN ba bad bd be bel bf bl bm bn bo bp br brea breaka breakd breakl bro bufdo buffers bun bw c|0 cN cNf ca cabc caddb cad caddf cal cat cb cc ccl cd ce cex cf cfir cgetb cgete cg changes chd che checkt cl cla clo cm cmapc cme cn cnew cnf cno cnorea cnoreme co col colo com comc comp con conf cope cp cpf cq cr cs cst cu cuna cunme cw delm deb debugg delc delf dif diffg diffo diffp diffpu diffs diffthis dig di dl dell dj dli do doautoa dp dr ds dsp e|0 ea ec echoe echoh echom echon el elsei em en endfo endf endt endw ene ex exe exi exu f|0 files filet fin fina fini fir fix fo foldc foldd folddoc foldo for fu go gr grepa gu gv ha helpf helpg helpt hi hid his ia iabc if ij il im imapc ime ino inorea inoreme int is isp iu iuna iunme j|0 ju k|0 keepa kee keepj lN lNf l|0 lad laddb laddf la lan lat lb lc lch lcl lcs le lefta let lex lf lfir lgetb lgete lg lgr lgrepa lh ll lla lli lmak lm lmapc lne lnew lnf ln loadk lo loc lockv lol lope lp lpf lr ls lt lu lua luad luaf lv lvimgrepa lw m|0 ma mak map mapc marks mat me menut mes mk mks mksp mkv mkvie mod mz mzf nbc nb nbs new nm nmapc nme nn nnoreme noa no noh norea noreme norm nu nun nunme ol o|0 om omapc ome on ono onoreme opt ou ounme ow p|0 profd prof pro promptr pc ped pe perld po popu pp pre prev ps pt ptN ptf ptj ptl ptn ptp ptr pts pu pw py3 python3 py3d py3f py pyd pyf quita qa rec red redi redr redraws reg res ret retu rew ri rightb rub rubyd rubyf rund ru rv sN san sa sal sav sb sbN sba sbf sbl sbm sbn sbp sbr scrip scripte scs se setf setg setl sf sfir sh sim sig sil sl sla sm smap smapc sme sn sni sno snor snoreme sor so spelld spe spelli spellr spellu spellw sp spr sre st sta startg startr star stopi stj sts sun sunm sunme sus sv sw sy synti sync tN tabN tabc tabdo tabe tabf tabfir tabl tabm tabnew tabn tabo tabp tabr tabs tab ta tags tc tcld tclf te tf th tj tl tm tn to tp tr try ts tu u|0 undoj undol una unh unl unlo unm unme uns up ve verb vert vim vimgrepa vi viu vie vm vmapc vme vne vn vnoreme vs vu vunme windo w|0 wN wa wh wi winc winp wn wp wq wqa ws wu wv x|0 xa xmapc xm xme xn xnoreme xu xunme y|0 z|0 ~ Next Print append abbreviate abclear aboveleft all amenu anoremenu args argadd argdelete argedit argglobal arglocal argument ascii autocmd augroup aunmenu buffer bNext ball badd bdelete behave belowright bfirst blast bmodified bnext botright bprevious brewind break breakadd breakdel breaklist browse bunload bwipeout change cNext cNfile cabbrev cabclear caddbuffer caddexpr caddfile call catch cbuffer cclose center cexpr cfile cfirst cgetbuffer cgetexpr cgetfile chdir checkpath checktime clist clast close cmap cmapclear cmenu cnext cnewer cnfile cnoremap cnoreabbrev cnoremenu copy colder colorscheme command comclear compiler continue confirm copen cprevious cpfile cquit crewind cscope cstag cunmap cunabbrev cunmenu cwindow delete delmarks debug debuggreedy delcommand delfunction diffupdate diffget diffoff diffpatch diffput diffsplit digraphs display deletel djump dlist doautocmd doautoall deletep drop dsearch dsplit edit earlier echo echoerr echohl echomsg else elseif emenu endif endfor endfunction endtry endwhile enew execute exit exusage file filetype find finally finish first fixdel fold foldclose folddoopen folddoclosed foldopen function global goto grep grepadd gui gvim hardcopy help helpfind helpgrep helptags highlight hide history insert iabbrev iabclear ijump ilist imap imapclear imenu inoremap inoreabbrev inoremenu intro isearch isplit iunmap iunabbrev iunmenu join jumps keepalt keepmarks keepjumps lNext lNfile list laddexpr laddbuffer laddfile last language later lbuffer lcd lchdir lclose lcscope left leftabove lexpr lfile lfirst lgetbuffer lgetexpr lgetfile lgrep lgrepadd lhelpgrep llast llist lmake lmap lmapclear lnext lnewer lnfile lnoremap loadkeymap loadview lockmarks lockvar lolder lopen lprevious lpfile lrewind ltag lunmap luado luafile lvimgrep lvimgrepadd lwindow move mark make mapclear match menu menutranslate messages mkexrc mksession mkspell mkvimrc mkview mode mzscheme mzfile nbclose nbkey nbsart next nmap nmapclear nmenu nnoremap nnoremenu noautocmd noremap nohlsearch noreabbrev noremenu normal number nunmap nunmenu oldfiles open omap omapclear omenu only onoremap onoremenu options ounmap ounmenu ownsyntax print profdel profile promptfind promptrepl pclose pedit perl perldo pop popup ppop preserve previous psearch ptag ptNext ptfirst ptjump ptlast ptnext ptprevious ptrewind ptselect put pwd py3do py3file python pydo pyfile quit quitall qall read recover redo redir redraw redrawstatus registers resize retab return rewind right rightbelow ruby rubydo rubyfile rundo runtime rviminfo substitute sNext sandbox sargument sall saveas sbuffer sbNext sball sbfirst sblast sbmodified sbnext sbprevious sbrewind scriptnames scriptencoding scscope set setfiletype setglobal setlocal sfind sfirst shell simalt sign silent sleep slast smagic smapclear smenu snext sniff snomagic snoremap snoremenu sort source spelldump spellgood spellinfo spellrepall spellundo spellwrong split sprevious srewind stop stag startgreplace startreplace startinsert stopinsert stjump stselect sunhide sunmap sunmenu suspend sview swapname syntax syntime syncbind tNext tabNext tabclose tabedit tabfind tabfirst tablast tabmove tabnext tabonly tabprevious tabrewind tag tcl tcldo tclfile tearoff tfirst throw tjump tlast tmenu tnext topleft tprevious trewind tselect tunmenu undo undojoin undolist unabbreviate unhide unlet unlockvar unmap unmenu unsilent update vglobal version verbose vertical vimgrep vimgrepadd visual viusage view vmap vmapclear vmenu vnew vnoremap vnoremenu vsplit vunmap vunmenu write wNext wall while winsize wincmd winpos wnext wprevious wqall wsverb wundo wviminfo xit xall xmapclear xmap xmenu xnoremap xnoremenu xunmap xunmenu yank`,built_in:`synIDtrans atan2 range matcharg did_filetype asin feedkeys xor argv complete_check add getwinposx getqflist getwinposy screencol clearmatches empty extend getcmdpos mzeval garbagecollect setreg ceil sqrt diff_hlID inputsecret get getfperm getpid filewritable shiftwidth max sinh isdirectory synID system inputrestore winline atan visualmode inputlist tabpagewinnr round getregtype mapcheck hasmapto histdel argidx findfile sha256 exists toupper getcmdline taglist string getmatches bufnr strftime winwidth bufexists strtrans tabpagebuflist setcmdpos remote_read printf setloclist getpos getline bufwinnr float2nr len getcmdtype diff_filler luaeval resolve libcallnr foldclosedend reverse filter has_key bufname str2float strlen setline getcharmod setbufvar index searchpos shellescape undofile foldclosed setqflist buflisted strchars str2nr virtcol floor remove undotree remote_expr winheight gettabwinvar reltime cursor tabpagenr finddir localtime acos getloclist search tanh matchend rename gettabvar strdisplaywidth type abs py3eval setwinvar tolower wildmenumode log10 spellsuggest bufloaded synconcealed nextnonblank server2client complete settabwinvar executable input wincol setmatches getftype hlID inputsave searchpair or screenrow line settabvar histadd deepcopy strpart remote_peek and eval getftime submatch screenchar winsaveview matchadd mkdir screenattr getfontname libcall reltimestr getfsize winnr invert pow getbufline byte2line soundfold repeat fnameescape tagfiles sin strwidth spellbadword trunc maparg log lispindent hostname setpos globpath remote_foreground getchar synIDattr fnamemodify cscope_connection stridx winbufnr indent min complete_add nr2char searchpairpos inputdialog values matchlist items hlexists strridx browsedir expand fmod pathshorten line2byte argc count getwinvar glob foldtextresult getreg foreground cosh matchdelete has char2nr simplify histget searchdecl iconv winrestcmd pumvisible writefile foldlevel haslocaldir keys cos matchstr foldtext histnr tan tempname getcwd byteidx getbufvar islocked escape eventhandler remote_send serverlist winrestview synstack pyeval prevnonblank readfile cindent filereadable changenr exp`},illegal:/;/,contains:[e.NUMBER_MODE,{className:`string`,begin:`'`,end:`'`,illegal:`\\n`},{className:`string`,begin:/"(\\"|\n\\|[^"\n])*"/},e.COMMENT(`"`,`$`),{className:`variable`,begin:/[bwtglsav]:[\w\d_]+/},{begin:[/\b(?:function|function!)/,/\s+/,e.IDENT_RE],className:{1:`keyword`,3:`title`},end:`$`,relevance:0,contains:[{className:`params`,begin:`\\(`,end:`\\)`}]},{className:`symbol`,begin:/<[\w-]+>/}]}}t.exports=n})),nj=o(((e,t)=>{function n(e){e.regex;let t=e.COMMENT(/\(;/,/;\)/);t.contains.push(`self`);let n=e.COMMENT(/;;/,/$/),r=`anyfunc,block,br,br_if,br_table,call,call_indirect,data,drop,elem,else,end,export,func,global.get,global.set,local.get,local.set,local.tee,get_global,get_local,global,if,import,local,loop,memory,memory.grow,memory.size,module,mut,nop,offset,param,result,return,select,set_global,set_local,start,table,tee_local,then,type,unreachable`.split(`,`),i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:`keyword`,3:`title.function`}},a={className:`variable`,begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:`punctuation`,relevance:0},s={className:`number`,relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:`type`},l={className:`keyword`,match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:`WebAssembly`,keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:`keyword`,3:`operator`}},a,o,i,e.QUOTE_STRING_MODE,c,l,s]}}t.exports=n})),rj=o(((e,t)=>{function n(e){let t=e.regex,n=/[a-zA-Z]\w*/,r=[`as`,`break`,`class`,`construct`,`continue`,`else`,`for`,`foreign`,`if`,`import`,`in`,`is`,`return`,`static`,`var`,`while`],i=[`true`,`false`,`null`],a=[`this`,`super`],o=[`Bool`,`Class`,`Fiber`,`Fn`,`List`,`Map`,`Null`,`Num`,`Object`,`Range`,`Sequence`,`String`,`System`],s=[`-`,`~`,/\*/,`%`,/\.\.\./,/\.\./,/\+/,`<<`,`>>`,`>=`,`<=`,`<`,`>`,/\^/,/!=/,/!/,/\bis\b/,`==`,`&&`,`&`,/\|\|/,/\|/,/\?:/,`=`],c={relevance:0,match:t.concat(/\b(?!(if|while|for|else|super)\b)/,n,/(?=\s*[({])/),className:`title.function`},l={match:t.concat(t.either(t.concat(/\b(?!(if|while|for|else|super)\b)/,n),t.either(...s)),/(?=\s*\([^)]+\)\s*\{)/),className:`title.function`,starts:{contains:[{begin:/\(/,end:/\)/,contains:[{relevance:0,scope:`params`,match:n}]}]}},u={variants:[{match:[/class\s+/,n,/\s+is\s+/,n]},{match:[/class\s+/,n]}],scope:{2:`title.class`,4:`title.class.inherited`},keywords:r},d={relevance:0,match:t.either(...s),className:`operator`},f={className:`string`,begin:/"""/,end:/"""/},p={className:`property`,begin:t.concat(/\./,t.lookahead(n)),end:n,excludeBegin:!0,relevance:0},m={relevance:0,match:t.concat(/\b_/,n),scope:`variable`},h={relevance:0,match:/\b[A-Z]+[a-z]+([A-Z]+[a-z]+)*/,scope:`title.class`,keywords:{_:o}},g=e.C_NUMBER_MODE,_={match:[n,/\s*/,/=/,/\s*/,/\(/,n,/\)\s*\{/],scope:{1:`title.function`,3:`operator`,6:`params`}},v=e.COMMENT(/\/\*\*/,/\*\//,{contains:[{match:/@[a-z]+/,scope:`doctag`},`self`]}),y={scope:`subst`,begin:/%\(/,end:/\)/,contains:[g,h,c,m,d]},b={scope:`string`,begin:/"/,end:/"/,contains:[y,{scope:`char.escape`,variants:[{match:/\\\\|\\["0%abefnrtv]/},{match:/\\x[0-9A-F]{2}/},{match:/\\u[0-9A-F]{4}/},{match:/\\U[0-9A-F]{8}/}]}]};y.contains.push(b);let x=[...r,...a,...i],S={relevance:0,match:t.concat(`\\b(?!`,x.join(`|`),`\\b)`,/[a-zA-Z_]\w*(?:[?!]|\b)/),className:`variable`},C={scope:`comment`,variants:[{begin:[/#!?/,/[A-Za-z_]+(?=\()/],beginScope:{},keywords:{literal:i},contains:[],end:/\)/},{begin:[/#!?/,/[A-Za-z_]+/],beginScope:{},end:/$/}]};return{name:`Wren`,keywords:{keyword:r,"variable.language":a,literal:i},contains:[C,g,b,f,v,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,h,u,_,l,c,d,m,p,S]}}t.exports=n})),ij=o(((e,t)=>{function n(e){return{name:`Intel x86 Assembly`,case_insensitive:!0,keywords:{$pattern:`[.%]?`+e.IDENT_RE,keyword:`lock rep repe repz repne repnz xaquire xrelease bnd nobnd aaa aad aam aas adc add and arpl bb0_reset bb1_reset bound bsf bsr bswap bt btc btr bts call cbw cdq cdqe clc cld cli clts cmc cmp cmpsb cmpsd cmpsq cmpsw cmpxchg cmpxchg486 cmpxchg8b cmpxchg16b cpuid cpu_read cpu_write cqo cwd cwde daa das dec div dmint emms enter equ f2xm1 fabs fadd faddp fbld fbstp fchs fclex fcmovb fcmovbe fcmove fcmovnb fcmovnbe fcmovne fcmovnu fcmovu fcom fcomi fcomip fcomp fcompp fcos fdecstp fdisi fdiv fdivp fdivr fdivrp femms feni ffree ffreep fiadd ficom ficomp fidiv fidivr fild fimul fincstp finit fist fistp fisttp fisub fisubr fld fld1 fldcw fldenv fldl2e fldl2t fldlg2 fldln2 fldpi fldz fmul fmulp fnclex fndisi fneni fninit fnop fnsave fnstcw fnstenv fnstsw fpatan fprem fprem1 fptan frndint frstor fsave fscale fsetpm fsin fsincos fsqrt fst fstcw fstenv fstp fstsw fsub fsubp fsubr fsubrp ftst fucom fucomi fucomip fucomp fucompp fxam fxch fxtract fyl2x fyl2xp1 hlt ibts icebp idiv imul in inc incbin insb insd insw int int01 int1 int03 int3 into invd invpcid invlpg invlpga iret iretd iretq iretw jcxz jecxz jrcxz jmp jmpe lahf lar lds lea leave les lfence lfs lgdt lgs lidt lldt lmsw loadall loadall286 lodsb lodsd lodsq lodsw loop loope loopne loopnz loopz lsl lss ltr mfence monitor mov movd movq movsb movsd movsq movsw movsx movsxd movzx mul mwait neg nop not or out outsb outsd outsw packssdw packsswb packuswb paddb paddd paddsb paddsiw paddsw paddusb paddusw paddw pand pandn pause paveb pavgusb pcmpeqb pcmpeqd pcmpeqw pcmpgtb pcmpgtd pcmpgtw pdistib pf2id pfacc pfadd pfcmpeq pfcmpge pfcmpgt pfmax pfmin pfmul pfrcp pfrcpit1 pfrcpit2 pfrsqit1 pfrsqrt pfsub pfsubr pi2fd pmachriw pmaddwd pmagw pmulhriw pmulhrwa pmulhrwc pmulhw pmullw pmvgezb pmvlzb pmvnzb pmvzb pop popa popad popaw popf popfd popfq popfw por prefetch prefetchw pslld psllq psllw psrad psraw psrld psrlq psrlw psubb psubd psubsb psubsiw psubsw psubusb psubusw psubw punpckhbw punpckhdq punpckhwd punpcklbw punpckldq punpcklwd push pusha pushad pushaw pushf pushfd pushfq pushfw pxor rcl rcr rdshr rdmsr rdpmc rdtsc rdtscp ret retf retn rol ror rdm rsdc rsldt rsm rsts sahf sal salc sar sbb scasb scasd scasq scasw sfence sgdt shl shld shr shrd sidt sldt skinit smi smint smintold smsw stc std sti stosb stosd stosq stosw str sub svdc svldt svts swapgs syscall sysenter sysexit sysret test ud0 ud1 ud2b ud2 ud2a umov verr verw fwait wbinvd wrshr wrmsr xadd xbts xchg xlatb xlat xor cmove cmovz cmovne cmovnz cmova cmovnbe cmovae cmovnb cmovb cmovnae cmovbe cmovna cmovg cmovnle cmovge cmovnl cmovl cmovnge cmovle cmovng cmovc cmovnc cmovo cmovno cmovs cmovns cmovp cmovpe cmovnp cmovpo je jz jne jnz ja jnbe jae jnb jb jnae jbe jna jg jnle jge jnl jl jnge jle jng jc jnc jo jno js jns jpo jnp jpe jp sete setz setne setnz seta setnbe setae setnb setnc setb setnae setcset setbe setna setg setnle setge setnl setl setnge setle setng sets setns seto setno setpe setp setpo setnp addps addss andnps andps cmpeqps cmpeqss cmpleps cmpless cmpltps cmpltss cmpneqps cmpneqss cmpnleps cmpnless cmpnltps cmpnltss cmpordps cmpordss cmpunordps cmpunordss cmpps cmpss comiss cvtpi2ps cvtps2pi cvtsi2ss cvtss2si cvttps2pi cvttss2si divps divss ldmxcsr maxps maxss minps minss movaps movhps movlhps movlps movhlps movmskps movntps movss movups mulps mulss orps rcpps rcpss rsqrtps rsqrtss shufps sqrtps sqrtss stmxcsr subps subss ucomiss unpckhps unpcklps xorps fxrstor fxrstor64 fxsave fxsave64 xgetbv xsetbv xsave xsave64 xsaveopt xsaveopt64 xrstor xrstor64 prefetchnta prefetcht0 prefetcht1 prefetcht2 maskmovq movntq pavgb pavgw pextrw pinsrw pmaxsw pmaxub pminsw pminub pmovmskb pmulhuw psadbw pshufw pf2iw pfnacc pfpnacc pi2fw pswapd maskmovdqu clflush movntdq movnti movntpd movdqa movdqu movdq2q movq2dq paddq pmuludq pshufd pshufhw pshuflw pslldq psrldq psubq punpckhqdq punpcklqdq addpd addsd andnpd andpd cmpeqpd cmpeqsd cmplepd cmplesd cmpltpd cmpltsd cmpneqpd cmpneqsd cmpnlepd cmpnlesd cmpnltpd cmpnltsd cmpordpd cmpordsd cmpunordpd cmpunordsd cmppd comisd cvtdq2pd cvtdq2ps cvtpd2dq cvtpd2pi cvtpd2ps cvtpi2pd cvtps2dq cvtps2pd cvtsd2si cvtsd2ss cvtsi2sd cvtss2sd cvttpd2pi cvttpd2dq cvttps2dq cvttsd2si divpd divsd maxpd maxsd minpd minsd movapd movhpd movlpd movmskpd movupd mulpd mulsd orpd shufpd sqrtpd sqrtsd subpd subsd ucomisd unpckhpd unpcklpd xorpd addsubpd addsubps haddpd haddps hsubpd hsubps lddqu movddup movshdup movsldup clgi stgi vmcall vmclear vmfunc vmlaunch vmload vmmcall vmptrld vmptrst vmread vmresume vmrun vmsave vmwrite vmxoff vmxon invept invvpid pabsb pabsw pabsd palignr phaddw phaddd phaddsw phsubw phsubd phsubsw pmaddubsw pmulhrsw pshufb psignb psignw psignd extrq insertq movntsd movntss lzcnt blendpd blendps blendvpd blendvps dppd dpps extractps insertps movntdqa mpsadbw packusdw pblendvb pblendw pcmpeqq pextrb pextrd pextrq phminposuw pinsrb pinsrd pinsrq pmaxsb pmaxsd pmaxud pmaxuw pminsb pminsd pminud pminuw pmovsxbw pmovsxbd pmovsxbq pmovsxwd pmovsxwq pmovsxdq pmovzxbw pmovzxbd pmovzxbq pmovzxwd pmovzxwq pmovzxdq pmuldq pmulld ptest roundpd roundps roundsd roundss crc32 pcmpestri pcmpestrm pcmpistri pcmpistrm pcmpgtq popcnt getsec pfrcpv pfrsqrtv movbe aesenc aesenclast aesdec aesdeclast aesimc aeskeygenassist vaesenc vaesenclast vaesdec vaesdeclast vaesimc vaeskeygenassist vaddpd vaddps vaddsd vaddss vaddsubpd vaddsubps vandpd vandps vandnpd vandnps vblendpd vblendps vblendvpd vblendvps vbroadcastss vbroadcastsd vbroadcastf128 vcmpeq_ospd vcmpeqpd vcmplt_ospd vcmpltpd vcmple_ospd vcmplepd vcmpunord_qpd vcmpunordpd vcmpneq_uqpd vcmpneqpd vcmpnlt_uspd vcmpnltpd vcmpnle_uspd vcmpnlepd vcmpord_qpd vcmpordpd vcmpeq_uqpd vcmpnge_uspd vcmpngepd vcmpngt_uspd vcmpngtpd vcmpfalse_oqpd vcmpfalsepd vcmpneq_oqpd vcmpge_ospd vcmpgepd vcmpgt_ospd vcmpgtpd vcmptrue_uqpd vcmptruepd vcmplt_oqpd vcmple_oqpd vcmpunord_spd vcmpneq_uspd vcmpnlt_uqpd vcmpnle_uqpd vcmpord_spd vcmpeq_uspd vcmpnge_uqpd vcmpngt_uqpd vcmpfalse_ospd vcmpneq_ospd vcmpge_oqpd vcmpgt_oqpd vcmptrue_uspd vcmppd vcmpeq_osps vcmpeqps vcmplt_osps vcmpltps vcmple_osps vcmpleps vcmpunord_qps vcmpunordps vcmpneq_uqps vcmpneqps vcmpnlt_usps vcmpnltps vcmpnle_usps vcmpnleps vcmpord_qps vcmpordps vcmpeq_uqps vcmpnge_usps vcmpngeps vcmpngt_usps vcmpngtps vcmpfalse_oqps vcmpfalseps vcmpneq_oqps vcmpge_osps vcmpgeps vcmpgt_osps vcmpgtps vcmptrue_uqps vcmptrueps vcmplt_oqps vcmple_oqps vcmpunord_sps vcmpneq_usps vcmpnlt_uqps vcmpnle_uqps vcmpord_sps vcmpeq_usps vcmpnge_uqps vcmpngt_uqps vcmpfalse_osps vcmpneq_osps vcmpge_oqps vcmpgt_oqps vcmptrue_usps vcmpps vcmpeq_ossd vcmpeqsd vcmplt_ossd vcmpltsd vcmple_ossd vcmplesd vcmpunord_qsd vcmpunordsd vcmpneq_uqsd vcmpneqsd vcmpnlt_ussd vcmpnltsd vcmpnle_ussd vcmpnlesd vcmpord_qsd vcmpordsd vcmpeq_uqsd vcmpnge_ussd vcmpngesd vcmpngt_ussd vcmpngtsd vcmpfalse_oqsd vcmpfalsesd vcmpneq_oqsd vcmpge_ossd vcmpgesd vcmpgt_ossd vcmpgtsd vcmptrue_uqsd vcmptruesd vcmplt_oqsd vcmple_oqsd vcmpunord_ssd vcmpneq_ussd vcmpnlt_uqsd vcmpnle_uqsd vcmpord_ssd vcmpeq_ussd vcmpnge_uqsd vcmpngt_uqsd vcmpfalse_ossd vcmpneq_ossd vcmpge_oqsd vcmpgt_oqsd vcmptrue_ussd vcmpsd vcmpeq_osss vcmpeqss vcmplt_osss vcmpltss vcmple_osss vcmpless vcmpunord_qss vcmpunordss vcmpneq_uqss vcmpneqss vcmpnlt_usss vcmpnltss vcmpnle_usss vcmpnless vcmpord_qss vcmpordss vcmpeq_uqss vcmpnge_usss vcmpngess vcmpngt_usss vcmpngtss vcmpfalse_oqss vcmpfalsess vcmpneq_oqss vcmpge_osss vcmpgess vcmpgt_osss vcmpgtss vcmptrue_uqss vcmptruess vcmplt_oqss vcmple_oqss vcmpunord_sss vcmpneq_usss vcmpnlt_uqss vcmpnle_uqss vcmpord_sss vcmpeq_usss vcmpnge_uqss vcmpngt_uqss vcmpfalse_osss vcmpneq_osss vcmpge_oqss vcmpgt_oqss vcmptrue_usss vcmpss vcomisd vcomiss vcvtdq2pd vcvtdq2ps vcvtpd2dq vcvtpd2ps vcvtps2dq vcvtps2pd vcvtsd2si vcvtsd2ss vcvtsi2sd vcvtsi2ss vcvtss2sd vcvtss2si vcvttpd2dq vcvttps2dq vcvttsd2si vcvttss2si vdivpd vdivps vdivsd vdivss vdppd vdpps vextractf128 vextractps vhaddpd vhaddps vhsubpd vhsubps vinsertf128 vinsertps vlddqu vldqqu vldmxcsr vmaskmovdqu vmaskmovps vmaskmovpd vmaxpd vmaxps vmaxsd vmaxss vminpd vminps vminsd vminss vmovapd vmovaps vmovd vmovq vmovddup vmovdqa vmovqqa vmovdqu vmovqqu vmovhlps vmovhpd vmovhps vmovlhps vmovlpd vmovlps vmovmskpd vmovmskps vmovntdq vmovntqq vmovntdqa vmovntpd vmovntps vmovsd vmovshdup vmovsldup vmovss vmovupd vmovups vmpsadbw vmulpd vmulps vmulsd vmulss vorpd vorps vpabsb vpabsw vpabsd vpacksswb vpackssdw vpackuswb vpackusdw vpaddb vpaddw vpaddd vpaddq vpaddsb vpaddsw vpaddusb vpaddusw vpalignr vpand vpandn vpavgb vpavgw vpblendvb vpblendw vpcmpestri vpcmpestrm vpcmpistri vpcmpistrm vpcmpeqb vpcmpeqw vpcmpeqd vpcmpeqq vpcmpgtb vpcmpgtw vpcmpgtd vpcmpgtq vpermilpd vpermilps vperm2f128 vpextrb vpextrw vpextrd vpextrq vphaddw vphaddd vphaddsw vphminposuw vphsubw vphsubd vphsubsw vpinsrb vpinsrw vpinsrd vpinsrq vpmaddwd vpmaddubsw vpmaxsb vpmaxsw vpmaxsd vpmaxub vpmaxuw vpmaxud vpminsb vpminsw vpminsd vpminub vpminuw vpminud vpmovmskb vpmovsxbw vpmovsxbd vpmovsxbq vpmovsxwd vpmovsxwq vpmovsxdq vpmovzxbw vpmovzxbd vpmovzxbq vpmovzxwd vpmovzxwq vpmovzxdq vpmulhuw vpmulhrsw vpmulhw vpmullw vpmulld vpmuludq vpmuldq vpor vpsadbw vpshufb vpshufd vpshufhw vpshuflw vpsignb vpsignw vpsignd vpslldq vpsrldq vpsllw vpslld vpsllq vpsraw vpsrad vpsrlw vpsrld vpsrlq vptest vpsubb vpsubw vpsubd vpsubq vpsubsb vpsubsw vpsubusb vpsubusw vpunpckhbw vpunpckhwd vpunpckhdq vpunpckhqdq vpunpcklbw vpunpcklwd vpunpckldq vpunpcklqdq vpxor vrcpps vrcpss vrsqrtps vrsqrtss vroundpd vroundps vroundsd vroundss vshufpd vshufps vsqrtpd vsqrtps vsqrtsd vsqrtss vstmxcsr vsubpd vsubps vsubsd vsubss vtestps vtestpd vucomisd vucomiss vunpckhpd vunpckhps vunpcklpd vunpcklps vxorpd vxorps vzeroall vzeroupper pclmullqlqdq pclmulhqlqdq pclmullqhqdq pclmulhqhqdq pclmulqdq vpclmullqlqdq vpclmulhqlqdq vpclmullqhqdq vpclmulhqhqdq vpclmulqdq vfmadd132ps vfmadd132pd vfmadd312ps vfmadd312pd vfmadd213ps vfmadd213pd vfmadd123ps vfmadd123pd vfmadd231ps vfmadd231pd vfmadd321ps vfmadd321pd vfmaddsub132ps vfmaddsub132pd vfmaddsub312ps vfmaddsub312pd vfmaddsub213ps vfmaddsub213pd vfmaddsub123ps vfmaddsub123pd vfmaddsub231ps vfmaddsub231pd vfmaddsub321ps vfmaddsub321pd vfmsub132ps vfmsub132pd vfmsub312ps vfmsub312pd vfmsub213ps vfmsub213pd vfmsub123ps vfmsub123pd vfmsub231ps vfmsub231pd vfmsub321ps vfmsub321pd vfmsubadd132ps vfmsubadd132pd vfmsubadd312ps vfmsubadd312pd vfmsubadd213ps vfmsubadd213pd vfmsubadd123ps vfmsubadd123pd vfmsubadd231ps vfmsubadd231pd vfmsubadd321ps vfmsubadd321pd vfnmadd132ps vfnmadd132pd vfnmadd312ps vfnmadd312pd vfnmadd213ps vfnmadd213pd vfnmadd123ps vfnmadd123pd vfnmadd231ps vfnmadd231pd vfnmadd321ps vfnmadd321pd vfnmsub132ps vfnmsub132pd vfnmsub312ps vfnmsub312pd vfnmsub213ps vfnmsub213pd vfnmsub123ps vfnmsub123pd vfnmsub231ps vfnmsub231pd vfnmsub321ps vfnmsub321pd vfmadd132ss vfmadd132sd vfmadd312ss vfmadd312sd vfmadd213ss vfmadd213sd vfmadd123ss vfmadd123sd vfmadd231ss vfmadd231sd vfmadd321ss vfmadd321sd vfmsub132ss vfmsub132sd vfmsub312ss vfmsub312sd vfmsub213ss vfmsub213sd vfmsub123ss vfmsub123sd vfmsub231ss vfmsub231sd vfmsub321ss vfmsub321sd vfnmadd132ss vfnmadd132sd vfnmadd312ss vfnmadd312sd vfnmadd213ss vfnmadd213sd vfnmadd123ss vfnmadd123sd vfnmadd231ss vfnmadd231sd vfnmadd321ss vfnmadd321sd vfnmsub132ss vfnmsub132sd vfnmsub312ss vfnmsub312sd vfnmsub213ss vfnmsub213sd vfnmsub123ss vfnmsub123sd vfnmsub231ss vfnmsub231sd vfnmsub321ss vfnmsub321sd rdfsbase rdgsbase rdrand wrfsbase wrgsbase vcvtph2ps vcvtps2ph adcx adox rdseed clac stac xstore xcryptecb xcryptcbc xcryptctr xcryptcfb xcryptofb montmul xsha1 xsha256 llwpcb slwpcb lwpval lwpins vfmaddpd vfmaddps vfmaddsd vfmaddss vfmaddsubpd vfmaddsubps vfmsubaddpd vfmsubaddps vfmsubpd vfmsubps vfmsubsd vfmsubss vfnmaddpd vfnmaddps vfnmaddsd vfnmaddss vfnmsubpd vfnmsubps vfnmsubsd vfnmsubss vfrczpd vfrczps vfrczsd vfrczss vpcmov vpcomb vpcomd vpcomq vpcomub vpcomud vpcomuq vpcomuw vpcomw vphaddbd vphaddbq vphaddbw vphadddq vphaddubd vphaddubq vphaddubw vphaddudq vphadduwd vphadduwq vphaddwd vphaddwq vphsubbw vphsubdq vphsubwd vpmacsdd vpmacsdqh vpmacsdql vpmacssdd vpmacssdqh vpmacssdql vpmacsswd vpmacssww vpmacswd vpmacsww vpmadcsswd vpmadcswd vpperm vprotb vprotd vprotq vprotw vpshab vpshad vpshaq vpshaw vpshlb vpshld vpshlq vpshlw vbroadcasti128 vpblendd vpbroadcastb vpbroadcastw vpbroadcastd vpbroadcastq vpermd vpermpd vpermps vpermq vperm2i128 vextracti128 vinserti128 vpmaskmovd vpmaskmovq vpsllvd vpsllvq vpsravd vpsrlvd vpsrlvq vgatherdpd vgatherqpd vgatherdps vgatherqps vpgatherdd vpgatherqd vpgatherdq vpgatherqq xabort xbegin xend xtest andn bextr blci blcic blsi blsic blcfill blsfill blcmsk blsmsk blsr blcs bzhi mulx pdep pext rorx sarx shlx shrx tzcnt tzmsk t1mskc valignd valignq vblendmpd vblendmps vbroadcastf32x4 vbroadcastf64x4 vbroadcasti32x4 vbroadcasti64x4 vcompresspd vcompressps vcvtpd2udq vcvtps2udq vcvtsd2usi vcvtss2usi vcvttpd2udq vcvttps2udq vcvttsd2usi vcvttss2usi vcvtudq2pd vcvtudq2ps vcvtusi2sd vcvtusi2ss vexpandpd vexpandps vextractf32x4 vextractf64x4 vextracti32x4 vextracti64x4 vfixupimmpd vfixupimmps vfixupimmsd vfixupimmss vgetexppd vgetexpps vgetexpsd vgetexpss vgetmantpd vgetmantps vgetmantsd vgetmantss vinsertf32x4 vinsertf64x4 vinserti32x4 vinserti64x4 vmovdqa32 vmovdqa64 vmovdqu32 vmovdqu64 vpabsq vpandd vpandnd vpandnq vpandq vpblendmd vpblendmq vpcmpltd vpcmpled vpcmpneqd vpcmpnltd vpcmpnled vpcmpd vpcmpltq vpcmpleq vpcmpneqq vpcmpnltq vpcmpnleq vpcmpq vpcmpequd vpcmpltud vpcmpleud vpcmpnequd vpcmpnltud vpcmpnleud vpcmpud vpcmpequq vpcmpltuq vpcmpleuq vpcmpnequq vpcmpnltuq vpcmpnleuq vpcmpuq vpcompressd vpcompressq vpermi2d vpermi2pd vpermi2ps vpermi2q vpermt2d vpermt2pd vpermt2ps vpermt2q vpexpandd vpexpandq vpmaxsq vpmaxuq vpminsq vpminuq vpmovdb vpmovdw vpmovqb vpmovqd vpmovqw vpmovsdb vpmovsdw vpmovsqb vpmovsqd vpmovsqw vpmovusdb vpmovusdw vpmovusqb vpmovusqd vpmovusqw vpord vporq vprold vprolq vprolvd vprolvq vprord vprorq vprorvd vprorvq vpscatterdd vpscatterdq vpscatterqd vpscatterqq vpsraq vpsravq vpternlogd vpternlogq vptestmd vptestmq vptestnmd vptestnmq vpxord vpxorq vrcp14pd vrcp14ps vrcp14sd vrcp14ss vrndscalepd vrndscaleps vrndscalesd vrndscaless vrsqrt14pd vrsqrt14ps vrsqrt14sd vrsqrt14ss vscalefpd vscalefps vscalefsd vscalefss vscatterdpd vscatterdps vscatterqpd vscatterqps vshuff32x4 vshuff64x2 vshufi32x4 vshufi64x2 kandnw kandw kmovw knotw kortestw korw kshiftlw kshiftrw kunpckbw kxnorw kxorw vpbroadcastmb2q vpbroadcastmw2d vpconflictd vpconflictq vplzcntd vplzcntq vexp2pd vexp2ps vrcp28pd vrcp28ps vrcp28sd vrcp28ss vrsqrt28pd vrsqrt28ps vrsqrt28sd vrsqrt28ss vgatherpf0dpd vgatherpf0dps vgatherpf0qpd vgatherpf0qps vgatherpf1dpd vgatherpf1dps vgatherpf1qpd vgatherpf1qps vscatterpf0dpd vscatterpf0dps vscatterpf0qpd vscatterpf0qps vscatterpf1dpd vscatterpf1dps vscatterpf1qpd vscatterpf1qps prefetchwt1 bndmk bndcl bndcu bndcn bndmov bndldx bndstx sha1rnds4 sha1nexte sha1msg1 sha1msg2 sha256rnds2 sha256msg1 sha256msg2 hint_nop0 hint_nop1 hint_nop2 hint_nop3 hint_nop4 hint_nop5 hint_nop6 hint_nop7 hint_nop8 hint_nop9 hint_nop10 hint_nop11 hint_nop12 hint_nop13 hint_nop14 hint_nop15 hint_nop16 hint_nop17 hint_nop18 hint_nop19 hint_nop20 hint_nop21 hint_nop22 hint_nop23 hint_nop24 hint_nop25 hint_nop26 hint_nop27 hint_nop28 hint_nop29 hint_nop30 hint_nop31 hint_nop32 hint_nop33 hint_nop34 hint_nop35 hint_nop36 hint_nop37 hint_nop38 hint_nop39 hint_nop40 hint_nop41 hint_nop42 hint_nop43 hint_nop44 hint_nop45 hint_nop46 hint_nop47 hint_nop48 hint_nop49 hint_nop50 hint_nop51 hint_nop52 hint_nop53 hint_nop54 hint_nop55 hint_nop56 hint_nop57 hint_nop58 hint_nop59 hint_nop60 hint_nop61 hint_nop62 hint_nop63`,built_in:`ip eip rip al ah bl bh cl ch dl dh sil dil bpl spl r8b r9b r10b r11b r12b r13b r14b r15b ax bx cx dx si di bp sp r8w r9w r10w r11w r12w r13w r14w r15w eax ebx ecx edx esi edi ebp esp eip r8d r9d r10d r11d r12d r13d r14d r15d rax rbx rcx rdx rsi rdi rbp rsp r8 r9 r10 r11 r12 r13 r14 r15 cs ds es fs gs ss st st0 st1 st2 st3 st4 st5 st6 st7 mm0 mm1 mm2 mm3 mm4 mm5 mm6 mm7 xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8 xmm9 xmm10 xmm11 xmm12 xmm13 xmm14 xmm15 xmm16 xmm17 xmm18 xmm19 xmm20 xmm21 xmm22 xmm23 xmm24 xmm25 xmm26 xmm27 xmm28 xmm29 xmm30 xmm31 ymm0 ymm1 ymm2 ymm3 ymm4 ymm5 ymm6 ymm7 ymm8 ymm9 ymm10 ymm11 ymm12 ymm13 ymm14 ymm15 ymm16 ymm17 ymm18 ymm19 ymm20 ymm21 ymm22 ymm23 ymm24 ymm25 ymm26 ymm27 ymm28 ymm29 ymm30 ymm31 zmm0 zmm1 zmm2 zmm3 zmm4 zmm5 zmm6 zmm7 zmm8 zmm9 zmm10 zmm11 zmm12 zmm13 zmm14 zmm15 zmm16 zmm17 zmm18 zmm19 zmm20 zmm21 zmm22 zmm23 zmm24 zmm25 zmm26 zmm27 zmm28 zmm29 zmm30 zmm31 k0 k1 k2 k3 k4 k5 k6 k7 bnd0 bnd1 bnd2 bnd3 cr0 cr1 cr2 cr3 cr4 cr8 dr0 dr1 dr2 dr3 dr8 tr3 tr4 tr5 tr6 tr7 r0 r1 r2 r3 r4 r5 r6 r7 r0b r1b r2b r3b r4b r5b r6b r7b r0w r1w r2w r3w r4w r5w r6w r7w r0d r1d r2d r3d r4d r5d r6d r7d r0h r1h r2h r3h r0l r1l r2l r3l r4l r5l r6l r7l r8l r9l r10l r11l r12l r13l r14l r15l db dw dd dq dt ddq do dy dz resb resw resd resq rest resdq reso resy resz incbin equ times byte word dword qword nosplit rel abs seg wrt strict near far a32 ptr`,meta:`%define %xdefine %+ %undef %defstr %deftok %assign %strcat %strlen %substr %rotate %elif %else %endif %if %ifmacro %ifctx %ifidn %ifidni %ifid %ifnum %ifstr %iftoken %ifempty %ifenv %error %warning %fatal %rep %endrep %include %push %pop %repl %pathsearch %depend %use %arg %stacksize %local %line %comment %endcomment .nolist __FILE__ __LINE__ __SECT__ __BITS__ __OUTPUT_FORMAT__ __DATE__ __TIME__ __DATE_NUM__ __TIME_NUM__ __UTC_DATE__ __UTC_TIME__ __UTC_DATE_NUM__ __UTC_TIME_NUM__ __PASS__ struc endstruc istruc at iend align alignb sectalign daz nodaz up down zero default option assume public bits use16 use32 use64 default section segment absolute extern global common cpu float __utf16__ __utf16le__ __utf16be__ __utf32__ __utf32le__ __utf32be__ __float8__ __float16__ __float32__ __float64__ __float80m__ __float80e__ __float128l__ __float128h__ __Infinity__ __QNaN__ __SNaN__ Inf NaN QNaN SNaN float8 float16 float32 float64 float80m float80e float128l float128h __FLOAT_DAZ__ __FLOAT_ROUND__ __FLOAT__`},contains:[e.COMMENT(`;`,`$`,{relevance:0}),{className:`number`,variants:[{begin:`\\b(?:([0-9][0-9_]*)?\\.[0-9_]*(?:[eE][+-]?[0-9_]+)?|(0[Xx])?[0-9][0-9_]*(\\.[0-9_]*)?(?:[pP](?:[+-]?[0-9_]+)?)?)\\b`,relevance:0},{begin:`\\$[0-9][0-9A-Fa-f]*`,relevance:0},{begin:`\\b(?:[0-9A-Fa-f][0-9A-Fa-f_]*[Hh]|[0-9][0-9_]*[DdTt]?|[0-7][0-7_]*[QqOo]|[0-1][0-1_]*[BbYy])\\b`},{begin:`\\b(?:0[Xx][0-9A-Fa-f_]+|0[DdTt][0-9_]+|0[QqOo][0-7_]+|0[BbYy][0-1_]+)\\b`}]},e.QUOTE_STRING_MODE,{className:`string`,variants:[{begin:`'`,end:`[^\\\\]'`},{begin:"`",end:"[^\\\\]`"}],relevance:0},{className:`symbol`,variants:[{begin:`^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)`},{begin:`^\\s*%%[A-Za-z0-9_$#@~.?]*:`}],relevance:0},{className:`subst`,begin:`%[0-9]+`,relevance:0},{className:`subst`,begin:`%!S+`,relevance:0},{className:`meta`,begin:/^\s*\.[\w_-]+/}]}}t.exports=n})),aj=o(((e,t)=>{function n(e){let t={$pattern:/[a-zA-Z][a-zA-Z0-9_?]*/,keyword:`if.then.else.do.while.until.for.loop.import.with.is.as.where.when.by.data.constant.integer.real.text.name.boolean.symbol.infix.prefix.postfix.block.tree`.split(`.`),literal:[`true`,`false`,`nil`],built_in:`in.mod.rem.and.or.xor.not.abs.sign.floor.ceil.sqrt.sin.cos.tan.asin.acos.atan.exp.expm1.log.log2.log10.log1p.pi.at.text_length.text_range.text_find.text_replace.contains.page.slide.basic_slide.title_slide.title.subtitle.fade_in.fade_out.fade_at.clear_color.color.line_color.line_width.texture_wrap.texture_transform.texture.scale_?x.scale_?y.scale_?z?.translate_?x.translate_?y.translate_?z?.rotate_?x.rotate_?y.rotate_?z?.rectangle.circle.ellipse.sphere.path.line_to.move_to.quad_to.curve_to.theme.background.contents.locally.time.mouse_?x.mouse_?y.mouse_buttons`.split(`.`).concat([`ObjectLoader`,`Animate`,`MovieCredits`,`Slides`,`Filters`,`Shading`,`Materials`,`LensFlare`,`Mapping`,`VLCAudioVideo`,`StereoDecoder`,`PointCloud`,`NetworkAccess`,`RemoteControl`,`RegExp`,`ChromaKey`,`Snowfall`,`NodeJS`,`Speech`,`Charts`])},n={className:`string`,begin:`"`,end:`"`,illegal:`\\n`},r={className:`string`,begin:`'`,end:`'`,illegal:`\\n`},i={className:`string`,begin:`<<`,end:`>>`},a={className:`number`,begin:`[0-9]+#[0-9A-Z_]+(\\.[0-9-A-Z_]+)?#?([Ee][+-]?[0-9]+)?`},o={beginKeywords:`import`,end:`$`,keywords:t,contains:[n]},s={className:`function`,begin:/[a-z][^\n]*->/,returnBegin:!0,end:/->/,contains:[e.inherit(e.TITLE_MODE,{starts:{endsWithParent:!0,keywords:t}})]};return{name:`XL`,aliases:[`tao`],keywords:t,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,n,r,i,s,o,a,e.NUMBER_MODE]}}t.exports=n})),oj=o(((e,t)=>{function n(e){return{name:`XQuery`,aliases:[`xpath`,`xq`,`xqm`],case_insensitive:!1,illegal:/(proc)|(abstract)|(extends)|(until)|(#)/,keywords:{$pattern:/[a-zA-Z$][a-zA-Z0-9_:-]*/,keyword:`module.schema.namespace.boundary-space.preserve.no-preserve.strip.default.collation.base-uri.ordering.context.decimal-format.decimal-separator.copy-namespaces.empty-sequence.except.exponent-separator.external.grouping-separator.inherit.no-inherit.lax.minus-sign.per-mille.percent.schema-attribute.schema-element.strict.unordered.zero-digit.declare.import.option.function.validate.variable.for.at.in.let.where.order.group.by.return.if.then.else.tumbling.sliding.window.start.when.only.end.previous.next.stable.ascending.descending.allowing.empty.greatest.least.some.every.satisfies.switch.case.typeswitch.try.catch.and.or.to.union.intersect.instance.of.treat.as.castable.cast.map.array.delete.insert.into.replace.value.rename.copy.modify.update`.split(`.`),type:`item.document-node.node.attribute.document.element.comment.namespace.namespace-node.processing-instruction.text.construction.xs:anyAtomicType.xs:untypedAtomic.xs:duration.xs:time.xs:decimal.xs:float.xs:double.xs:gYearMonth.xs:gYear.xs:gMonthDay.xs:gMonth.xs:gDay.xs:boolean.xs:base64Binary.xs:hexBinary.xs:anyURI.xs:QName.xs:NOTATION.xs:dateTime.xs:dateTimeStamp.xs:date.xs:string.xs:normalizedString.xs:token.xs:language.xs:NMTOKEN.xs:Name.xs:NCName.xs:ID.xs:IDREF.xs:ENTITY.xs:integer.xs:nonPositiveInteger.xs:negativeInteger.xs:long.xs:int.xs:short.xs:byte.xs:nonNegativeInteger.xs:unisignedLong.xs:unsignedInt.xs:unsignedShort.xs:unsignedByte.xs:positiveInteger.xs:yearMonthDuration.xs:dayTimeDuration`.split(`.`),literal:[`eq`,`ne`,`lt`,`le`,`gt`,`ge`,`is`,`self::`,`child::`,`descendant::`,`descendant-or-self::`,`attribute::`,`following::`,`following-sibling::`,`parent::`,`ancestor::`,`ancestor-or-self::`,`preceding::`,`preceding-sibling::`,`NaN`]},contains:[{className:`variable`,begin:/[$][\w\-:]+/},{className:`built_in`,variants:[{begin:/\barray:/,end:/(?:append|filter|flatten|fold-(?:left|right)|for-each(?:-pair)?|get|head|insert-before|join|put|remove|reverse|size|sort|subarray|tail)\b/},{begin:/\bmap:/,end:/(?:contains|entry|find|for-each|get|keys|merge|put|remove|size)\b/},{begin:/\bmath:/,end:/(?:a(?:cos|sin|tan[2]?)|cos|exp(?:10)?|log(?:10)?|pi|pow|sin|sqrt|tan)\b/},{begin:/\bop:/,end:/\(/,excludeEnd:!0},{begin:/\bfn:/,end:/\(/,excludeEnd:!0},{begin:/[^</$:'"-]\b(?:abs|accumulator-(?:after|before)|adjust-(?:date(?:Time)?|time)-to-timezone|analyze-string|apply|available-(?:environment-variables|system-properties)|avg|base-uri|boolean|ceiling|codepoints?-(?:equal|to-string)|collation-key|collection|compare|concat|contains(?:-token)?|copy-of|count|current(?:-)?(?:date(?:Time)?|time|group(?:ing-key)?|output-uri|merge-(?:group|key))?data|dateTime|days?-from-(?:date(?:Time)?|duration)|deep-equal|default-(?:collation|language)|distinct-values|document(?:-uri)?|doc(?:-available)?|element-(?:available|with-id)|empty|encode-for-uri|ends-with|environment-variable|error|escape-html-uri|exactly-one|exists|false|filter|floor|fold-(?:left|right)|for-each(?:-pair)?|format-(?:date(?:Time)?|time|integer|number)|function-(?:arity|available|lookup|name)|generate-id|has-children|head|hours-from-(?:dateTime|duration|time)|id(?:ref)?|implicit-timezone|in-scope-prefixes|index-of|innermost|insert-before|iri-to-uri|json-(?:doc|to-xml)|key|lang|last|load-xquery-module|local-name(?:-from-QName)?|(?:lower|upper)-case|matches|max|minutes-from-(?:dateTime|duration|time)|min|months?-from-(?:date(?:Time)?|duration)|name(?:space-uri-?(?:for-prefix|from-QName)?)?|nilled|node-name|normalize-(?:space|unicode)|not|number|one-or-more|outermost|parse-(?:ietf-date|json)|path|position|(?:prefix-from-)?QName|random-number-generator|regex-group|remove|replace|resolve-(?:QName|uri)|reverse|root|round(?:-half-to-even)?|seconds-from-(?:dateTime|duration|time)|snapshot|sort|starts-with|static-base-uri|stream-available|string-?(?:join|length|to-codepoints)?|subsequence|substring-?(?:after|before)?|sum|system-property|tail|timezone-from-(?:date(?:Time)?|time)|tokenize|trace|trans(?:form|late)|true|type-available|unordered|unparsed-(?:entity|text)?-?(?:public-id|uri|available|lines)?|uri-collection|xml-to-json|years?-from-(?:date(?:Time)?|duration)|zero-or-one)\b/},{begin:/\blocal:/,end:/\(/,excludeEnd:!0},{begin:/\bzip:/,end:/(?:zip-file|(?:xml|html|text|binary)-entry| (?:update-)?entries)\b/},{begin:/\b(?:util|db|functx|app|xdmp|xmldb):/,end:/\(/,excludeEnd:!0}]},{className:`string`,variants:[{begin:/"/,end:/"/,contains:[{begin:/""/,relevance:0}]},{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]}]},{className:`number`,begin:/(\b0[0-7_]+)|(\b0x[0-9a-fA-F_]+)|(\b[1-9][0-9_]*(\.[0-9_]+)?)|[0_]\b/,relevance:0},{className:`comment`,begin:/\(:/,end:/:\)/,relevance:10,contains:[{className:`doctag`,begin:/@\w+/}]},{className:`meta`,begin:/%[\w\-:]+/},{className:`title`,begin:/\bxquery version "[13]\.[01]"\s?(?:encoding ".+")?/,end:/;/},{beginKeywords:`element attribute comment document processing-instruction`,end:/\{/,excludeEnd:!0},{begin:/<([\w._:-]+)(\s+\S*=('|").*('|"))?>/,end:/(\/[\w._:-]+>)/,subLanguage:`xml`,contains:[{begin:/\{/,end:/\}/,subLanguage:`xquery`},`self`]}]}}t.exports=n})),sj=o(((e,t)=>{function n(e){let t={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null})]},n=e.UNDERSCORE_TITLE_MODE,r={variants:[e.BINARY_NUMBER_MODE,e.C_NUMBER_MODE]},i=`namespace class interface use extends function return abstract final public protected private static deprecated throw try catch Exception echo empty isset instanceof unset let var new const self require if else elseif switch case default do while loop for continue break likely unlikely __LINE__ __FILE__ __DIR__ __FUNCTION__ __CLASS__ __TRAIT__ __METHOD__ __NAMESPACE__ array boolean float double integer object resource string char long unsigned bool int uint ulong uchar true false null undefined`;return{name:`Zephir`,aliases:[`zep`],keywords:i,contains:[e.C_LINE_COMMENT_MODE,e.COMMENT(/\/\*/,/\*\//,{contains:[{className:`doctag`,begin:/@[A-Za-z]+/}]}),{className:`string`,begin:/<<<['"]?\w+['"]?$/,end:/^\w+;/,contains:[e.BACKSLASH_ESCAPE]},{begin:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{className:`function`,beginKeywords:`function fn`,end:/[;{]/,excludeEnd:!0,illegal:/\$|\[|%/,contains:[n,{className:`params`,begin:/\(/,end:/\)/,keywords:i,contains:[`self`,e.C_BLOCK_COMMENT_MODE,t,r]}]},{className:`class`,beginKeywords:`class interface`,end:/\{/,excludeEnd:!0,illegal:/[:($"]/,contains:[{beginKeywords:`extends implements`},n]},{beginKeywords:`namespace`,end:/;/,illegal:/[.']/,contains:[n]},{beginKeywords:`use`,end:/;/,contains:[n]},{begin:/=>/},t,r]}}t.exports=n})),cj=l(o(((e,t)=>{var n=jD();n.registerLanguage(`1c`,MD()),n.registerLanguage(`abnf`,ND()),n.registerLanguage(`accesslog`,PD()),n.registerLanguage(`actionscript`,FD()),n.registerLanguage(`ada`,ID()),n.registerLanguage(`angelscript`,LD()),n.registerLanguage(`apache`,RD()),n.registerLanguage(`applescript`,zD()),n.registerLanguage(`arcade`,BD()),n.registerLanguage(`arduino`,VD()),n.registerLanguage(`armasm`,HD()),n.registerLanguage(`xml`,UD()),n.registerLanguage(`asciidoc`,WD()),n.registerLanguage(`aspectj`,GD()),n.registerLanguage(`autohotkey`,KD()),n.registerLanguage(`autoit`,qD()),n.registerLanguage(`avrasm`,JD()),n.registerLanguage(`awk`,YD()),n.registerLanguage(`axapta`,XD()),n.registerLanguage(`bash`,ZD()),n.registerLanguage(`basic`,QD()),n.registerLanguage(`bnf`,$D()),n.registerLanguage(`brainfuck`,eO()),n.registerLanguage(`c`,tO()),n.registerLanguage(`cal`,nO()),n.registerLanguage(`capnproto`,rO()),n.registerLanguage(`ceylon`,iO()),n.registerLanguage(`clean`,aO()),n.registerLanguage(`clojure`,oO()),n.registerLanguage(`clojure-repl`,sO()),n.registerLanguage(`cmake`,cO()),n.registerLanguage(`coffeescript`,lO()),n.registerLanguage(`coq`,uO()),n.registerLanguage(`cos`,dO()),n.registerLanguage(`cpp`,fO()),n.registerLanguage(`crmsh`,pO()),n.registerLanguage(`crystal`,mO()),n.registerLanguage(`csharp`,hO()),n.registerLanguage(`csp`,gO()),n.registerLanguage(`css`,_O()),n.registerLanguage(`d`,vO()),n.registerLanguage(`markdown`,yO()),n.registerLanguage(`dart`,bO()),n.registerLanguage(`delphi`,xO()),n.registerLanguage(`diff`,SO()),n.registerLanguage(`django`,CO()),n.registerLanguage(`dns`,wO()),n.registerLanguage(`dockerfile`,TO()),n.registerLanguage(`dos`,EO()),n.registerLanguage(`dsconfig`,DO()),n.registerLanguage(`dts`,OO()),n.registerLanguage(`dust`,kO()),n.registerLanguage(`ebnf`,AO()),n.registerLanguage(`elixir`,jO()),n.registerLanguage(`elm`,MO()),n.registerLanguage(`ruby`,NO()),n.registerLanguage(`erb`,PO()),n.registerLanguage(`erlang-repl`,FO()),n.registerLanguage(`erlang`,IO()),n.registerLanguage(`excel`,LO()),n.registerLanguage(`fix`,RO()),n.registerLanguage(`flix`,zO()),n.registerLanguage(`fortran`,BO()),n.registerLanguage(`fsharp`,VO()),n.registerLanguage(`gams`,HO()),n.registerLanguage(`gauss`,UO()),n.registerLanguage(`gcode`,WO()),n.registerLanguage(`gherkin`,GO()),n.registerLanguage(`glsl`,KO()),n.registerLanguage(`gml`,qO()),n.registerLanguage(`go`,JO()),n.registerLanguage(`golo`,YO()),n.registerLanguage(`gradle`,XO()),n.registerLanguage(`graphql`,ZO()),n.registerLanguage(`groovy`,QO()),n.registerLanguage(`haml`,$O()),n.registerLanguage(`handlebars`,ek()),n.registerLanguage(`haskell`,tk()),n.registerLanguage(`haxe`,nk()),n.registerLanguage(`hsp`,rk()),n.registerLanguage(`http`,ik()),n.registerLanguage(`hy`,ak()),n.registerLanguage(`inform7`,ok()),n.registerLanguage(`ini`,sk()),n.registerLanguage(`irpf90`,ck()),n.registerLanguage(`isbl`,lk()),n.registerLanguage(`java`,uk()),n.registerLanguage(`javascript`,dk()),n.registerLanguage(`jboss-cli`,fk()),n.registerLanguage(`json`,pk()),n.registerLanguage(`julia`,mk()),n.registerLanguage(`julia-repl`,hk()),n.registerLanguage(`kotlin`,gk()),n.registerLanguage(`lasso`,_k()),n.registerLanguage(`latex`,vk()),n.registerLanguage(`ldif`,yk()),n.registerLanguage(`leaf`,bk()),n.registerLanguage(`less`,xk()),n.registerLanguage(`lisp`,Sk()),n.registerLanguage(`livecodeserver`,Ck()),n.registerLanguage(`livescript`,wk()),n.registerLanguage(`llvm`,Tk()),n.registerLanguage(`lsl`,Ek()),n.registerLanguage(`lua`,Dk()),n.registerLanguage(`makefile`,Ok()),n.registerLanguage(`mathematica`,kk()),n.registerLanguage(`matlab`,Ak()),n.registerLanguage(`maxima`,jk()),n.registerLanguage(`mel`,Mk()),n.registerLanguage(`mercury`,Nk()),n.registerLanguage(`mipsasm`,Pk()),n.registerLanguage(`mizar`,Fk()),n.registerLanguage(`perl`,Ik()),n.registerLanguage(`mojolicious`,Lk()),n.registerLanguage(`monkey`,Rk()),n.registerLanguage(`moonscript`,zk()),n.registerLanguage(`n1ql`,Bk()),n.registerLanguage(`nestedtext`,Vk()),n.registerLanguage(`nginx`,Hk()),n.registerLanguage(`nim`,Uk()),n.registerLanguage(`nix`,Wk()),n.registerLanguage(`node-repl`,Gk()),n.registerLanguage(`nsis`,Kk()),n.registerLanguage(`objectivec`,qk()),n.registerLanguage(`ocaml`,Jk()),n.registerLanguage(`openscad`,Yk()),n.registerLanguage(`oxygene`,Xk()),n.registerLanguage(`parser3`,Zk()),n.registerLanguage(`pf`,Qk()),n.registerLanguage(`pgsql`,$k()),n.registerLanguage(`php`,eA()),n.registerLanguage(`php-template`,tA()),n.registerLanguage(`plaintext`,nA()),n.registerLanguage(`pony`,rA()),n.registerLanguage(`powershell`,iA()),n.registerLanguage(`processing`,aA()),n.registerLanguage(`profile`,oA()),n.registerLanguage(`prolog`,sA()),n.registerLanguage(`properties`,cA()),n.registerLanguage(`protobuf`,lA()),n.registerLanguage(`puppet`,uA()),n.registerLanguage(`purebasic`,dA()),n.registerLanguage(`python`,fA()),n.registerLanguage(`python-repl`,pA()),n.registerLanguage(`q`,mA()),n.registerLanguage(`qml`,hA()),n.registerLanguage(`r`,gA()),n.registerLanguage(`reasonml`,_A()),n.registerLanguage(`rib`,vA()),n.registerLanguage(`roboconf`,yA()),n.registerLanguage(`routeros`,bA()),n.registerLanguage(`rsl`,xA()),n.registerLanguage(`ruleslanguage`,SA()),n.registerLanguage(`rust`,CA()),n.registerLanguage(`sas`,wA()),n.registerLanguage(`scala`,TA()),n.registerLanguage(`scheme`,EA()),n.registerLanguage(`scilab`,DA()),n.registerLanguage(`scss`,OA()),n.registerLanguage(`shell`,kA()),n.registerLanguage(`smali`,AA()),n.registerLanguage(`smalltalk`,jA()),n.registerLanguage(`sml`,MA()),n.registerLanguage(`sqf`,NA()),n.registerLanguage(`sql`,PA()),n.registerLanguage(`stan`,FA()),n.registerLanguage(`stata`,IA()),n.registerLanguage(`step21`,LA()),n.registerLanguage(`stylus`,RA()),n.registerLanguage(`subunit`,zA()),n.registerLanguage(`swift`,BA()),n.registerLanguage(`taggerscript`,VA()),n.registerLanguage(`yaml`,HA()),n.registerLanguage(`tap`,UA()),n.registerLanguage(`tcl`,WA()),n.registerLanguage(`thrift`,GA()),n.registerLanguage(`tp`,KA()),n.registerLanguage(`twig`,qA()),n.registerLanguage(`typescript`,JA()),n.registerLanguage(`vala`,YA()),n.registerLanguage(`vbnet`,XA()),n.registerLanguage(`vbscript`,ZA()),n.registerLanguage(`vbscript-html`,QA()),n.registerLanguage(`verilog`,$A()),n.registerLanguage(`vhdl`,ej()),n.registerLanguage(`vim`,tj()),n.registerLanguage(`wasm`,nj()),n.registerLanguage(`wren`,rj()),n.registerLanguage(`x86asm`,ij()),n.registerLanguage(`xl`,aj()),n.registerLanguage(`xquery`,oj()),n.registerLanguage(`zephir`,sj()),n.HighlightJS=n,n.default=n,t.exports=n}))()).default;function lj(e){return e.replace(/&amp;/g,`&`).replace(/&lt;/g,`<`).replace(/&gt;/g,`>`).replace(/&quot;/g,`"`).replace(/&#039;/g,`'`)}var uj=new AD.Renderer;uj.code=function({text:e,lang:t}){let n=t||``,r=cj.getLanguage(n)?n:`plaintext`,i=lj(e),a=cj.highlight(i,{language:r}).value;return`<pre><code class="hljs language-${t||r}">${a}</code></pre>`},AD.use({renderer:uj});function dj(e){let t=Math.floor((Date.now()-e)/1e3);if(t<5)return`just now`;if(t<60)return`${t}s ago`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function fj(e){let t=e.split(`/`);return t[t.length-1]}var pj={nord:{themeName:`nord`,type:`dark`},"github-dark":{themeName:`github-dark`,type:`dark`},"github-dark-dimmed":{themeName:`github-dark-dimmed`,type:`dark`},"github-dark-high-contrast":{themeName:`github-dark-high-contrast`,type:`dark`},"github-light":{themeName:`github-light`,type:`light`},"github-light-high-contrast":{themeName:`github-light-high-contrast`,type:`light`},dracula:{themeName:`dracula`,type:`dark`},"one-dark":{themeName:`one-dark-pro`,type:`dark`},"synthwave-84":{themeName:`synthwave-84`,type:`dark`},"tokyo-night":{themeName:`tokyo-night`,type:`dark`},"catppuccin-mocha":{themeName:`catppuccin-mocha`,type:`dark`},"catppuccin-frappe":{themeName:`catppuccin-frappe`,type:`dark`},"catppuccin-macchiato":{themeName:`catppuccin-macchiato`,type:`dark`},"catppuccin-latte":{themeName:`catppuccin-latte`,type:`light`},"solarized-dark":{themeName:`solarized-dark`,type:`dark`},"solarized-light":{themeName:`solarized-light`,type:`light`},monokai:{themeName:`monokai`,type:`dark`},"ayu-dark":{themeName:`ayu-dark`,type:`dark`},"ayu-light":{themeName:`ayu-light`,type:`light`},andromeeda:{themeName:`andromeeda`,type:`dark`},"aurora-x":{themeName:`aurora-x`,type:`dark`},"dark-plus":{themeName:`dark-plus`,type:`dark`},"light-plus":{themeName:`light-plus`,type:`light`},houston:{themeName:`houston`,type:`dark`},laserwave:{themeName:`laserwave`,type:`dark`},"material-theme":{themeName:`material-theme`,type:`dark`},"material-theme-darker":{themeName:`material-theme-darker`,type:`dark`},"material-theme-lighter":{themeName:`material-theme-lighter`,type:`light`},"material-theme-ocean":{themeName:`material-theme-ocean`,type:`dark`},"material-theme-palenight":{themeName:`material-theme-palenight`,type:`dark`},"min-dark":{themeName:`min-dark`,type:`dark`},"min-light":{themeName:`min-light`,type:`light`},"night-owl":{themeName:`night-owl`,type:`dark`},"one-light":{themeName:`one-light`,type:`light`},plastic:{themeName:`plastic`,type:`dark`},poimandres:{themeName:`poimandres`,type:`dark`},"rose-pine":{themeName:`rose-pine`,type:`dark`},"rose-pine-moon":{themeName:`rose-pine-moon`,type:`dark`},"rose-pine-dawn":{themeName:`rose-pine-dawn`,type:`light`},"slack-dark":{themeName:`slack-dark`,type:`dark`},"slack-ochre":{themeName:`slack-ochre`,type:`dark`},vesper:{themeName:`vesper`,type:`dark`},"vitesse-black":{themeName:`vitesse-black`,type:`dark`},"vitesse-dark":{themeName:`vitesse-dark`,type:`dark`},"vitesse-light":{themeName:`vitesse-light`,type:`light`},nightfox:{themeName:`nightfox`,type:`dark`},nordfox:{themeName:`nordfox`,type:`dark`},duskfox:{themeName:`duskfox`,type:`dark`},terafox:{themeName:`terafox`,type:`dark`},carbonfox:{themeName:`carbonfox`,type:`dark`},dayfox:{themeName:`dayfox`,type:`light`},dawnfox:{themeName:`dawnfox`,type:`light`}};function mj(e){if(!e)return``;let t=e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#039;`);try{return AD.parse(t,{gfm:!0,breaks:!0})}catch(e){return console.error(`Failed to parse markdown:`,e),t}}function hj(e,t){let n=[];return e.querySelectorAll(t).forEach(e=>n.push(e)),e.querySelectorAll(`*`).forEach(e=>{e.shadowRoot&&n.push(...hj(e.shadowRoot,t))}),n}function gj(e,t){let n=e;if(t&&t.trim()){let r=t.trim(),i=e.querySelectorAll(`span, code, pre`);for(let e of i)if(e.textContent?.trim()===r){n=e;break}if(n===e){for(let e of i)if(e.textContent?.trim().includes(r)){n=e;break}}}let r=n.style.borderRadius,i=n.style.padding;n.style.setProperty(`transition`,`none`,`important`),n.style.setProperty(`background-color`,`rgba(235, 186, 0, 0.55)`,`important`),n.style.setProperty(`box-shadow`,`0 0 0 2.5px rgba(235, 186, 0, 0.85)`,`important`),n.style.setProperty(`border-radius`,`4px`,`important`),n!==e&&n.style.setProperty(`padding`,`1px 5px`,`important`),n.offsetHeight,setTimeout(()=>{n.style.setProperty(`transition`,`background-color 2.5s ease-out, box-shadow 2.5s ease-out`,`important`),n.style.removeProperty(`background-color`),n.style.removeProperty(`box-shadow`),setTimeout(()=>{n.style.removeProperty(`transition`),r||n.style.removeProperty(`border-radius`),i||n.style.removeProperty(`padding`)},2500)},2e3)}function _j(e,t,n){let r=i=>{let a=hj(e,`[data-line]`),o=null;for(let e of a){let n=e.getAttribute(`data-line`);if(n&&parseInt(n,10)===t){o=e;break}}o?(o.scrollIntoView({block:`center`,behavior:`auto`}),gj(o,n)):i>0&&setTimeout(()=>r(i-1),50)};r(20)}function vj(e,t,n,r){let i=document.getElementById(`file-${e}`);if(!i)return;let a=i.querySelector(`input[type="checkbox"]`);a&&a.checked&&a.click(),i.scrollIntoView({block:`start`,behavior:`auto`});let o=n===`additions`||n===`addition`?`addition`:`deletion`,s=e=>{let n=hj(i,`[data-line]`),a=null;for(let e of n){let n=e.getAttribute(`data-line`),r=e.getAttribute(`data-line-type`);if(n&&parseInt(n,10)===t&&r===o){a=e;break}}if(!a)for(let e of n){let n=e.getAttribute(`data-line`);if(n&&parseInt(n,10)===t){a=e;break}}a?(a.scrollIntoView({block:`center`,behavior:`auto`}),gj(a,r)):e>0&&setTimeout(()=>s(e-1),50)};s(12);let c=i.querySelector(`.file-diff-card-header, .file-diff-placeholder-header`);c&&(c.classList.add(`symbol-flash`),setTimeout(()=>c.classList.remove(`symbol-flash`),1200))}var yj=new Map,bj=null;function xj(){if(!(bj||typeof EventSource>`u`)){bj=new EventSource(`/api/live`);for(let e of yj.keys())Sj(e)}}function Sj(e){bj?.addEventListener(e,t=>{let n=t.data;for(let t of yj.get(e)??[])try{t(n)}catch(t){console.error(`live channel handler for "${e}" threw:`,t)}})}function Cj(){[...yj.values()].every(e=>e.size===0)&&bj&&(bj.close(),bj=null)}function wj(e,t){let n=yj.get(e);return n||(n=new Set,yj.set(e,n),bj&&Sj(e)),n.add(t),xj(),()=>{n.delete(t),Cj()}}var Tj=[],Ej={};function Dj(e,t=!0){let[n,r]=(0,W.useState)(null),[i,a]=(0,W.useState)(!0),[o,s]=(0,W.useState)(!1),[c,l]=(0,W.useState)(null),[u,d]=(0,W.useState)(0),f=(0,W.useRef)(!1);return(0,W.useEffect)(()=>{if(!t)return;let n=!1;return f.current?s(!0):a(!0),l(null),fetch(`/api/diff?staged=${e.staged}&untracked=${e.untracked}`).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{n||(f.current=!0,r(e))}).catch(e=>{n||l(e.message)}).finally(()=>{n||(a(!1),s(!1))}),()=>{n=!0}},[e.staged,e.untracked,t,u]),(0,W.useEffect)(()=>{if(!t)return;let e=null,n=wj(`change`,()=>{e&&clearTimeout(e),e=setTimeout(()=>d(e=>e+1),150)});return()=>{e&&clearTimeout(e),n()}},[t]),{patch:n?.patch??null,repoName:n?.repoName??``,branch:n?.branch??``,customMode:n?.customMode??!1,binaryFiles:n?.binaryFiles??Tj,tabSizeMap:n?.tabSizeMap??Ej,untrackedFiles:n?.untrackedFiles??Tj,loading:i,refreshing:o,error:c}}function Oj(e){switch(e){case`approved`:return`The reviewer APPROVED these changes. Address any open comments below, then proceed — the overall direction is good.`;case`changes-requested`:return`The reviewer REQUESTED EDITS. Address every open comment below and apply the requested changes before considering this review done.`;case`rejected`:return`The reviewer REJECTED these changes. Do NOT keep building on this approach; reconsider it in light of the comments below before continuing.`}}function kj(e,t,n){let r=t?.trim();if(e.length===0&&!n&&!r)return``;let i=new Map;for(let t of e){let e=i.get(t.filePath)??[];e.push(t),i.set(t.filePath,e)}let a=[];a.push(n?`<code-review-comments decision="${n}">`:`<code-review-comments>`),a.push(` <instructions>`),a.push(` You are an AI coding assistant. You are receiving a structured list of code review comments to address in the repository.`),a.push(` For each file, review the inline comments and apply the changes requested.`),n&&(a.push(` - The "decision" attribute on the root element is the reviewer's headline verdict: "approved", "changes-requested", or "rejected".`),a.push(` - <decision-summary> tells you, in plain language, what to do next based on that verdict.`)),a.push(` - Target lines are specified by the "line" attribute (e.g. line="10" or line="10-15").`),a.push(` - "side" indicates whether the comment is on "additions" (added/modified lines) or "deletions" (deleted/old lines).`),a.push(` - "status" indicates whether the comment is "open" or "resolved". Only address comments with status="open".`),a.push(` - The <code> block contains the specific code context at the reviewed lines, prefixed with "+" or "-".`),a.push(` - The <body> tag contains the review feedback or request.`),a.push(` - If developers have replied to the comment, their discussion is captured under the <replies> element.`),a.push(` - The comment "id" attribute can be used to reference or update the comment via API if available.`),a.push(``),a.push(` HOW TO REPLY OR ASK FOR CLARIFICATION:`),a.push(` If you need to ask for clarification, explain what you did, or reply to any comment:`),a.push(``),a.push(` Option A: Via the diffing CLI or MCP (Preferred — port-agnostic, no copy-paste)`),a.push(` diffing reply <comment-id> --body "Your response" --model "<your-model-name>"`),a.push(` diffing resolve <comment-id>`),a.push(` (Or the equivalent MCP tools: reply_to_comment, resolve_comment.)`),a.push(``),a.push(` Option B: Via the local HTTP API (if you know the running port)`),a.push(` POST http://localhost:<port>/api/comments/<comment-id>/replies`),a.push(` Payload: { "body": "Your response or clarification request here", "model": "<your-model-name>" }`),a.push(` PUT http://localhost:<port>/api/comments/<comment-id> Payload: { "status": "resolved" }`),a.push(``),a.push(` Option C: Via Text Response (Offline / Chat Copy-Paste)`),a.push(` If you do not have local API access, output your comments/replies inside a structured XML block at the end of your response:`),a.push(` <comment-replies>`),a.push(` <reply to="<comment-id>" model="<your-model-name>"><![CDATA[Your reply or clarification request here]]></reply>`),a.push(` </comment-replies>`),a.push(` </instructions>`),n&&a.push(` <decision-summary><![CDATA[${Oj(n)}]]></decision-summary>`),r&&(a.push(` <general-comment>`),a.push(` <![CDATA[${r}]]>`),a.push(` </general-comment>`));for(let[e,t]of i){a.push(` <file path="${e}">`);for(let e of t){let t=e.lineNumber===0?`file`:e.startLineNumber&&e.startLineNumber!==e.lineNumber?`${e.startLineNumber}-${e.lineNumber}`:`${e.lineNumber}`,n=new Date(e.createdAt).toISOString();if(a.push(` <comment id="${e.id}" line="${t}" side="${e.side}" status="${e.status}" created-at="${n}">`),e.lineNumber!==0){let t=e.side===`additions`?`+`:`-`,n=e.lineContent&&e.lineContent.includes(`
1951
+ `),r=``;r=n?`\n${e.lineContent.split(`
1952
1952
  `).map(e=>`${t} ${e}`).join(`
1953
- `)}\n`:`${t} ${e.lineContent}`,r.push(` <code><![CDATA[${i}]]></code>`)}if(r.push(` <body><![CDATA[${e.body}]]></body>`),e.replies&&e.replies.length>0){r.push(` <replies>`);for(let t of e.replies){let e=new Date(t.createdAt).toISOString(),n=t.role?` role="${t.role}"`:` role="agent"`,i=t.model?` model="${t.model}"`:``;r.push(` <reply id="${t.id}" created-at="${e}"${n}${i}>`),r.push(` <![CDATA[${t.body}]]>`),r.push(` </reply>`)}r.push(` </replies>`)}r.push(` </comment>`)}r.push(` </file>`)}return r.push(`</code-review-comments>`),r.join(`
1954
- `)}var kj=[`comments`];async function Aj(){return(await fetch(`/api/comments`)).json()}function jj(){let e=Ve(),{data:t=[]}=nt({queryKey:kj,queryFn:Aj});(0,W.useEffect)(()=>wj(`comments`,()=>{e.invalidateQueries({queryKey:kj})}),[e]);let[n,r]=(0,W.useState)({round:0,waiters:0,lastSentAt:null});(0,W.useEffect)(()=>{let e=!1;fetch(`/api/review/status`).then(e=>e.json()).then(t=>{e||r(t)}).catch(()=>{});let t=wj(`agent-status`,e=>{try{r(JSON.parse(e))}catch{}});return()=>{e=!0,t()}},[]);let i=(0,W.useRef)(null),[a,o]=(0,W.useState)(null);(0,W.useEffect)(()=>{let e=i.current===null;i.current===null&&(i.current=new Set);let n=i.current,r=null;for(let i of t)for(let t of i.replies??[]){if(n.has(t.id))continue;n.add(t.id);let a=t.role===`agent`||t.role==null&&!!t.model;!e&&a&&(!r||t.createdAt>r.at)&&(r={at:t.createdAt,commentId:i.id,filePath:i.filePath,model:t.model,body:t.body})}r&&o(r)},[t]);let s=rt({mutationFn:async e=>(await fetch(`/api/comments`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})).json(),onSuccess:t=>{e.setQueryData(kj,(e=[])=>[...e,t])}}),c=rt({mutationFn:async e=>(await fetch(`/api/comments/${e}`,{method:`DELETE`}),e),onSuccess:t=>{e.setQueryData(kj,(e=[])=>e.filter(e=>e.id!==t))}}),l=rt({mutationFn:async({id:e,body:t,status:n})=>(await fetch(`/api/comments/${e}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({body:t,status:n})})).json(),onSuccess:t=>{e.setQueryData(kj,(e=[])=>e.map(e=>e.id===t.id?t:e))}}),u=rt({mutationFn:async({id:e,body:t})=>(await fetch(`/api/comments/${e}/replies`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({body:t,role:`user`})})).json(),onSuccess:t=>{e.setQueryData(kj,(e=[])=>e.map(e=>e.id===t.id?t:e))}}),d=rt({mutationFn:async({commentId:e,replyId:t})=>(await fetch(`/api/comments/${e}/replies/${t}`,{method:`DELETE`})).json(),onSuccess:t=>{e.setQueryData(kj,(e=[])=>e.map(e=>e.id===t.id?t:e))}}),f=rt({mutationFn:async({commentId:e,replyId:t,body:n})=>(await fetch(`/api/comments/${e}/replies/${t}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({body:n})})).json(),onSuccess:t=>{e.setQueryData(kj,(e=[])=>e.map(e=>e.id===t.id?t:e))}}),p=rt({mutationFn:async e=>{let t=await fetch(`/api/review/send`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({generalComment:e?.trim()||void 0})});if(!t.ok)throw Error(`Failed to send to agent`);return t.json()}}),m=rt({mutationFn:async e=>{let t=await fetch(`/api/comments/${e}/apply-suggestion`,{method:`POST`});if(!t.ok){let e=await t.json();throw Error(e.error||`Failed to apply suggestion`)}return t.json()},onSuccess:()=>{e.invalidateQueries({queryKey:kj})}}),h=(0,W.useCallback)((e,t,n,r,i,a)=>{s.mutate({filePath:e,side:t,lineNumber:n,startLineNumber:a,lineContent:r,body:i})},[s.mutate]),g=(0,W.useCallback)(e=>{c.mutate(e)},[c.mutate]),_=(0,W.useCallback)((e,t)=>{l.mutate({id:e,body:t})},[l.mutate]),v=(0,W.useCallback)(e=>{l.mutate({id:e,status:`resolved`})},[l.mutate]),y=(0,W.useCallback)(e=>{l.mutate({id:e,status:`open`})},[l.mutate]),b=(0,W.useCallback)((e,t)=>{u.mutate({id:e,body:t})},[u.mutate]),x=(0,W.useCallback)((e,t)=>{d.mutate({commentId:e,replyId:t})},[d.mutate]),S=(0,W.useCallback)((e,t,n)=>{f.mutate({commentId:e,replyId:t,body:n})},[f.mutate]),C=(0,W.useCallback)(async e=>{await m.mutateAsync(e)},[m.mutateAsync]),w=(0,W.useCallback)(()=>Oj(t),[t]),T=(0,W.useCallback)(e=>t.filter(t=>t.filePath===e).map(e=>({side:e.side,lineNumber:e.lineNumber,metadata:e})),[t]),E=(0,W.useCallback)(async()=>{let e=w();await navigator.clipboard.writeText(e)},[w]),D=(0,W.useCallback)(e=>p.mutateAsync(e),[p.mutateAsync]);return{comments:t,addComment:h,removeComment:g,editComment:_,resolveComment:v,unresolveComment:y,addReply:b,removeReply:x,editReply:S,applySuggestion:C,getAnnotationsForFile:T,formatAllComments:w,copyAllComments:E,agentActivity:a,clearAgentActivity:(0,W.useCallback)(()=>o(null),[]),sendToAgent:D,sending:p.isPending,agentWaiting:n.waiters>0}}function Mj(e){let[t,n]=(0,W.useState)({inMerge:!1,conflicts:[]}),r=(0,W.useCallback)(()=>{fetch(`/api/merge-status`).then(e=>e.ok?e.json():{inMerge:!1,conflicts:[]}).then(n).catch(()=>n({inMerge:!1,conflicts:[]}))},[]);return(0,W.useEffect)(()=>{r()},[r,e]),{status:t,refresh:r}}var Nj={staged:!0,untracked:!0,diffStyle:`split`,defaultTabSize:4,theme:`nord`,editorIDE:`default`,lineDiffType:`word`,lineWrap:!1,diffIndicators:`classic`,showLineNumbers:!0,hunkSeparators:`line-info`,lineHoverHighlight:`both`,fontSize:13,expandContextByDefault:!1,collapsedContextThreshold:10,expansionLineCount:20,haptics:!0,sounds:!0};function Pj(){let[e,t]=(0,W.useState)(Nj),[n,r]=(0,W.useState)(!1),i=(0,W.useRef)(!0);return(0,W.useEffect)(()=>{fetch(`/api/settings`).then(e=>e.json()).then(e=>{i.current=!0,t({...Nj,...e}),r(!0)}).catch(()=>r(!0))},[]),(0,W.useEffect)(()=>{if(i.current){i.current=!1;return}let t=setTimeout(()=>{fetch(`/api/settings`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}).catch(()=>{})},300);return()=>clearTimeout(t)},[e]),{settings:e,loaded:n,updateSettings:(0,W.useCallback)(e=>{t(t=>({...t,...e}))},[])}}var Fj=[`viewed`];async function Ij(){return(await fetch(`/api/viewed`)).json()}function Lj(){let e=Ve(),{data:t=[]}=nt({queryKey:Fj,queryFn:Ij});return{viewedFiles:(0,W.useMemo)(()=>new Set(t),[t]),setViewed:(0,W.useCallback)(async(t,n)=>{e.setQueryData(Fj,(e=[])=>n?e.includes(t)?e:[...e,t]:e.filter(e=>e!==t)),await fetch(`/api/viewed`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:t,viewed:n})})},[e])}}var Rj={success:{pattern:[{duration:30,intensity:.5},{delay:60,duration:40,intensity:1}]},warning:{pattern:[{duration:40,intensity:.8},{delay:100,duration:40,intensity:.6}]},error:{pattern:[{duration:40,intensity:.9},{delay:40,duration:40,intensity:.9},{delay:40,duration:40,intensity:.9}]},light:{pattern:[{duration:15,intensity:.4}]},medium:{pattern:[{duration:25,intensity:.7}]},heavy:{pattern:[{duration:35,intensity:1}]},soft:{pattern:[{duration:40,intensity:.5}]},rigid:{pattern:[{duration:10,intensity:1}]},selection:{pattern:[{duration:8,intensity:.3}]},nudge:{pattern:[{duration:80,intensity:.8},{delay:80,duration:50,intensity:.3}]},buzz:{pattern:[{duration:1e3,intensity:1}]}},zj=16,Bj=184,Vj=1e3,Hj=20;function Uj(e){if(typeof e==`number`)return{vibrations:[{duration:e}]};if(typeof e==`string`){let t=Rj[e];return t?{vibrations:t.pattern.map(e=>({...e}))}:(console.warn(`[web-haptics] Unknown preset: "${e}"`),null)}if(Array.isArray(e)){if(e.length===0)return{vibrations:[]};if(typeof e[0]==`number`){let t=e,n=[];for(let e=0;e<t.length;e+=2){let r=e>0?t[e-1]:0;n.push({...r>0&&{delay:r},duration:t[e]})}return{vibrations:n}}return{vibrations:e.map(e=>({...e}))}}return{vibrations:e.pattern.map(e=>({...e}))}}function Wj(e,t){if(t>=1)return[e];if(t<=0)return[];let n=Math.max(1,Math.round(Hj*t)),r=Hj-n,i=[],a=e;for(;a>=Hj;)i.push(n),i.push(r),a-=Hj;if(a>0){let e=Math.max(1,Math.round(a*t));i.push(e);let n=a-e;n>0&&i.push(n)}return i}function Gj(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=Math.max(0,Math.min(1,i.intensity??t)),o=i.delay??0;o>0&&(n.length>0&&n.length%2==0?n[n.length-1]+=o:(n.length===0&&n.push(0),n.push(o)));let s=Wj(i.duration,a);if(s.length===0){n.length>0&&n.length%2==0?n[n.length-1]+=i.duration:i.duration>0&&(n.push(0),n.push(i.duration));continue}for(let e of s)n.push(e)}return n}var Kj=0,qj=class e{hapticLabel=null;domInitialized=!1;instanceId;debug;showSwitch;rafId=null;patternResolve=null;audioCtx=null;audioFilter=null;audioGain=null;audioBuffer=null;constructor(e){this.instanceId=++Kj,this.debug=e?.debug??!1,this.showSwitch=e?.showSwitch??!1}static isSupported=typeof navigator<`u`&&typeof navigator.vibrate==`function`;async trigger(t=[{duration:25,intensity:.7}],n){let r=Uj(t);if(!r)return;let{vibrations:i}=r;if(i.length===0)return;let a=Math.max(0,Math.min(1,n?.intensity??.5));for(let e of i)if(e.duration>Vj&&(e.duration=Vj),!Number.isFinite(e.duration)||e.duration<0||e.delay!==void 0&&(!Number.isFinite(e.delay)||e.delay<0)){console.warn(`[web-haptics] Invalid vibration values. Durations and delays must be finite non-negative numbers.`);return}if(e.isSupported&&navigator.vibrate(Gj(i,a)),!e.isSupported||this.debug){if(this.ensureDOM(),!this.hapticLabel)return;this.debug&&await this.ensureAudio(),this.stopPattern();let e=(i[0]?.delay??0)===0;if(e&&(this.hapticLabel.click(),this.debug&&this.audioCtx)){let e=Math.max(0,Math.min(1,i[0].intensity??a));this.playClick(e)}await this.runPattern(i,a,e)}}cancel(){this.stopPattern(),e.isSupported&&navigator.vibrate(0)}destroy(){this.stopPattern(),this.hapticLabel&&(this.hapticLabel.remove(),this.hapticLabel=null,this.domInitialized=!1),this.audioCtx&&(this.audioCtx.close(),this.audioCtx=null,this.audioFilter=null,this.audioGain=null,this.audioBuffer=null)}setDebug(e){this.debug=e,!e&&this.audioCtx&&(this.audioCtx.close(),this.audioCtx=null,this.audioFilter=null,this.audioGain=null,this.audioBuffer=null)}setShowSwitch(e){if(this.showSwitch=e,this.hapticLabel){let t=this.hapticLabel.querySelector(`input`);this.hapticLabel.style.display=e?``:`none`,t&&(t.style.display=e?``:`none`)}}stopPattern(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.patternResolve?.(),this.patternResolve=null}runPattern(e,t,n){return new Promise(r=>{this.patternResolve=r;let i=[],a=0;for(let n of e){let e=Math.max(0,Math.min(1,n.intensity??t)),r=n.delay??0;r>0&&(a+=r,i.push({end:a,isOn:!1,intensity:0})),a+=n.duration,i.push({end:a,isOn:!0,intensity:e})}let o=a,s=0,c=-1,l=e=>{s===0&&(s=e);let t=e-s;if(t>=o){this.rafId=null,this.patternResolve=null,r();return}let a=i[0];for(let e of i)if(t<e.end){a=e;break}if(a.isOn){let t=zj+(1-a.intensity)*Bj;c===-1?(c=e,n||=(this.hapticLabel?.click(),this.debug&&this.audioCtx&&this.playClick(a.intensity),!0)):e-c>=t&&(this.hapticLabel?.click(),this.debug&&this.audioCtx&&this.playClick(a.intensity),c=e)}this.rafId=requestAnimationFrame(l)};this.rafId=requestAnimationFrame(l)})}playClick(e){if(!this.audioCtx||!this.audioFilter||!this.audioGain||!this.audioBuffer)return;let t=this.audioBuffer.getChannelData(0);for(let e=0;e<t.length;e++)t[e]=(Math.random()*2-1)*Math.exp(-e/25);this.audioGain.gain.value=.5*e;let n=2e3+e*2e3,r=1+(Math.random()-.5)*.3;this.audioFilter.frequency.value=n*r;let i=this.audioCtx.createBufferSource();i.buffer=this.audioBuffer,i.connect(this.audioFilter),i.onended=()=>i.disconnect(),i.start()}async ensureAudio(){if(!this.audioCtx&&typeof AudioContext<`u`){this.audioCtx=new AudioContext,this.audioFilter=this.audioCtx.createBiquadFilter(),this.audioFilter.type=`bandpass`,this.audioFilter.frequency.value=4e3,this.audioFilter.Q.value=8,this.audioGain=this.audioCtx.createGain(),this.audioFilter.connect(this.audioGain),this.audioGain.connect(this.audioCtx.destination),this.audioBuffer=this.audioCtx.createBuffer(1,this.audioCtx.sampleRate*.004,this.audioCtx.sampleRate);let e=this.audioBuffer.getChannelData(0);for(let t=0;t<e.length;t++)e[t]=(Math.random()*2-1)*Math.exp(-t/25)}this.audioCtx?.state===`suspended`&&await this.audioCtx.resume()}ensureDOM(){if(this.domInitialized||typeof document>`u`)return;let e=`web-haptics-${this.instanceId}`,t=document.createElement(`label`);t.setAttribute(`for`,e),t.textContent=`Haptic feedback`,t.style.position=`fixed`,t.style.bottom=`10px`,t.style.left=`10px`,t.style.padding=`5px 10px`,t.style.backgroundColor=`rgba(0, 0, 0, 0.7)`,t.style.color=`white`,t.style.fontFamily=`sans-serif`,t.style.fontSize=`14px`,t.style.borderRadius=`4px`,t.style.zIndex=`9999`,t.style.userSelect=`none`,this.hapticLabel=t;let n=document.createElement(`input`);n.type=`checkbox`,n.setAttribute(`switch`,``),n.id=e,n.style.all=`initial`,n.style.appearance=`auto`,this.showSwitch||(t.style.display=`none`,n.style.display=`none`),t.appendChild(n),document.body.appendChild(t),this.domInitialized=!0}};function Jj(e){let t=(0,W.useRef)(null);return(0,W.useEffect)(()=>(t.current=new qj(e),()=>{t.current?.destroy(),t.current=null}),[]),(0,W.useEffect)(()=>{t.current?.setDebug(e?.debug??!1)},[e?.debug]),(0,W.useEffect)(()=>{t.current?.setShowSwitch(e?.showSwitch??!1)},[e?.showSwitch]),{trigger:(0,W.useCallback)((e,n)=>t.current?.trigger(e,n),[]),cancel:(0,W.useCallback)(()=>t.current?.cancel(),[]),isSupported:qj.isSupported}}var Yj=(0,W.createContext)({hapticsEnabled:!1,soundsEnabled:!1,haptic:()=>{},sound:()=>{}}),Xj=null;function Zj(){if(typeof window>`u`)return null;if(Xj)return Xj;try{Xj=new(window.AudioContext||window.webkitAudioContext)}catch{Xj=null}return Xj}function Qj(e,t){let n=e.currentTime,r=e.destination,i=(t,i,a,o,s,c)=>{let l=e.createOscillator(),u=e.createGain();l.connect(u),u.connect(r),l.type=i,l.frequency.setValueAtTime(t,n+o),c!==void 0&&l.frequency.exponentialRampToValueAtTime(c,n+o+s),u.gain.setValueAtTime(a,n+o),u.gain.exponentialRampToValueAtTime(.001,n+o+s),l.start(n+o),l.stop(n+o+s)};switch(t){case`click`:i(700,`sine`,.16,0,.03,350);break;case`toggle`:i(460,`square`,.06,0,.04,230);break;case`navigate`:i(520,`sine`,.07,0,.02);break;case`open`:i(210,`sine`,.12,0,.13,560);break;case`close`:i(560,`sine`,.1,0,.11,210);break;case`success`:i(523,`sine`,.17,0,.1),i(784,`sine`,.17,.09,.13);break;case`resolve`:i(659,`sine`,.15,0,.1),i(988,`sine`,.15,.09,.13);break;case`send`:i(523,`sine`,.15,0,.1),i(659,`sine`,.15,.07,.1),i(784,`sine`,.15,.14,.14);break;case`error`:i(280,`sawtooth`,.16,0,.15,80);break;case`warning`:i(330,`sine`,.13,0,.09),i(330,`sine`,.09,.12,.09);break;case`remove`:i(380,`sine`,.13,0,.08,140);break}}var $j={current:!1},eM={current:!1},tM=null;function nM(e=`click`){if(!$j.current)return;let t=Zj();t&&(t.state===`suspended`?t.resume():Promise.resolve()).then(()=>{try{Qj(t,e)}catch{}}).catch(()=>{})}function rM(e=`selection`){if(!(!eM.current||!tM))try{tM(e)}catch{}}function iM(e=`selection`,t=`click`){rM(e),nM(t)}function aM({enabled:e,soundsEnabled:t,children:n}){let{trigger:r,isSupported:i}=Jj({showSwitch:!1}),a=(0,W.useRef)(e);a.current=e;let o=(0,W.useRef)(t);o.current=t;let s=(0,W.useRef)(r);s.current=r,(0,W.useEffect)(()=>{eM.current=e&&i,tM=r}),(0,W.useEffect)(()=>{$j.current=t});let c=(0,W.useMemo)(()=>(e=`selection`)=>{if(a.current)try{s.current(e)}catch{}},[]),l=(0,W.useMemo)(()=>(e=`click`)=>{if(!o.current)return;let t=Zj();t&&(t.state===`suspended`?t.resume():Promise.resolve()).then(()=>{try{Qj(t,e)}catch{}}).catch(()=>{})},[]);(0,W.useEffect)(()=>{if(!e&&!t)return;let n=e=>{let t=e.target?.closest(`button, a[href], [role="button"], input[type="checkbox"], [role="option"]`);if(!t||t.disabled)return;let n=t.tagName===`INPUT`&&t.type===`checkbox`;if(a.current)try{s.current(`selection`)}catch{}if(o.current){let e=Zj();e&&(e.state===`suspended`?e.resume():Promise.resolve()).then(()=>{try{Qj(e,n?`toggle`:`click`)}catch{}}).catch(()=>{})}};return document.addEventListener(`click`,n,!0),()=>document.removeEventListener(`click`,n,!0)},[e,t]);let u=(0,W.useMemo)(()=>({hapticsEnabled:e&&i,soundsEnabled:t,haptic:c,sound:l}),[e,i,t,c,l]);return(0,G.jsx)(Yj.Provider,{value:u,children:n})}function oM(){let{haptic:e,sound:t}=(0,W.useContext)(Yj);return{haptic:e,sound:t}}function sM(e){return(0,W.useMemo)(()=>{let t=[];for(let n of e)for(let e of n.hunks)for(let r of e.hunkContent)if(r.type===`change`){if(r.additions>0){let i=r.additionLineIndex,a=r.additions;for(let r=0;r<a;r++){let a=i+r,o=n.additionLines[a];o&&o.trim()&&t.push({filePath:n.name,lineNumber:e.additionStart+(a-e.additionLineIndex),side:`additions`,content:o})}}if(r.deletions>0){let i=r.deletionLineIndex,a=r.deletions;for(let r=0;r<a;r++){let a=i+r,o=n.deletionLines[a];o&&o.trim()&&t.push({filePath:n.name,lineNumber:e.deletionStart+(a-e.deletionLineIndex),side:`deletions`,content:o})}}}return t},[e])}var cM=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),lM=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),uM=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),dM=e=>{let t=uM(e);return t.charAt(0).toUpperCase()+t.slice(1)},fM={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`},pM=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},mM=(0,W.createContext)({}),hM=()=>(0,W.useContext)(mM),gM=(0,W.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:p=``}=hM()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,W.createElement)(`svg`,{ref:c,...fM,width:t??l??fM.width,height:t??l??fM.height,stroke:e??f,strokeWidth:m,className:cM(`lucide`,p,i),...!a&&!pM(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,W.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),_M=(e,t)=>{let n=(0,W.forwardRef)(({className:n,...r},i)=>(0,W.createElement)(gM,{ref:i,iconNode:t,className:cM(`lucide-${lM(dM(e))}`,`lucide-${e}`,n),...r}));return n.displayName=dM(e),n},vM=_M(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),yM=_M(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),bM=_M(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),xM=_M(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),SM=_M(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),CM=_M(`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`}]]),wM=_M(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),TM=_M(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),EM=_M(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),DM=_M(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),OM=_M(`corner-up-left`,[[`path`,{d:`M20 20v-7a4 4 0 0 0-4-4H4`,key:`1nkjon`}],[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}]]),kM=_M(`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`}]]),AM=_M(`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`}]]),jM=_M(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),MM=_M(`git-compare`,[[`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`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]),NM=_M(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),PM=_M(`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`}]]),FM=_M(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),IM=_M(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),LM=_M(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),RM=_M(`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`}]]),zM=_M(`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`}]]),BM=_M(`navigation`,[[`polygon`,{points:`3 11 22 2 13 21 11 13 3 11`,key:`1ltx0t`}]]),VM=_M(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),HM=_M(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),UM=_M(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),WM=_M(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`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`}]]),GM=_M(`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`}]]),KM=_M(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),qM=_M(`reply`,[[`path`,{d:`M20 18v-2a4 4 0 0 0-4-4H4`,key:`5vmcpk`}],[`path`,{d:`m9 17-5-5 5-5`,key:`nvlc11`}]]),JM=_M(`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`}]]),YM=_M(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),XM=_M(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),ZM=_M(`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`}]]),QM=_M(`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`}]]),$M=_M(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),eN=_M(`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`}]]),tN=_M(`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`}]]),nN=_M(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),rN=_M(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),iN=_M(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),aN=_M(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),oN={},sN={},cN=``;function lN(e){if(typeof document>`u`)return!1;let t=Sx(e);return H_(t).innerWidth-t.documentElement.clientWidth>0}function uN(e){let t=Sx(e),n=t.documentElement,r=t.body,i=J_(n)?n:r,a=i.style.overflow;return i.style.overflow=`hidden`,()=>{i.style.overflow=a}}function dN(e){let t=Sx(e),n=t.documentElement,r=t.body,i=H_(n),a=0,o=0,s=bx.create(),c=typeof CSS<`u`&&CSS.supports?.(`scrollbar-gutter`,`stable`);if(xv&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let e=i.getComputedStyle(n),t=i.getComputedStyle(r),s=(e.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,oN={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},cN=n.style.scrollBehavior,sN={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let l=n.scrollHeight>n.clientHeight,u=n.scrollWidth>n.clientWidth,d=e.overflowY===`scroll`||t.overflowY===`scroll`,f=e.overflowX===`scroll`||t.overflowX===`scroll`,p=Math.max(0,i.innerWidth-n.clientWidth),m=Math.max(0,i.innerHeight-n.clientHeight),h=parseFloat(t.marginTop)+parseFloat(t.marginBottom),g=parseFloat(t.marginLeft)+parseFloat(t.marginRight),_=J_(n)?n:r;if(c){n.style.scrollbarGutter=s,_.style.overflowY=`hidden`,_.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:s,overflowY:`hidden`,overflowX:`hidden`}),(l||d)&&(n.style.overflowY=`scroll`),(u||f)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:h||m?`calc(100dvh - ${h+m}px)`:`100dvh`,width:g||p?`calc(100vw - ${g+p}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,oN),Object.assign(r.style,sN),c||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=cN)}function d(){u(),s.request(l)}return l(),i.addEventListener(`resize`,d),()=>{s.cancel(),u(),typeof i.removeEventListener==`function`&&i.removeEventListener(`resize`,d)}}var fN=new class{lockCount=0;restore=null;timeoutLock=R_.create();timeoutUnlock=R_.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Sx(e).documentElement,n=H_(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=Rb;return}this.restore=Sv||!lN(e)?uN(e):dN(e)}};function pN(e=!0,t=null){Y(()=>{if(e)return fN.acquire(t)},[e,t])}var mN=W.createContext(void 0);function hN(e){let t=W.useContext(mN);if(t===void 0&&!e)throw Error(A_(47));return t}function gN(){return{...xw(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0}}var _N={...Sw,disabled:Z(e=>e.disabled),instantType:Z(e=>e.instantType),openMethod:Z(e=>e.openMethod),openChangeReason:Z(e=>e.openChangeReason),modal:Z(e=>e.modal),stickIfOpen:Z(e=>e.stickIfOpen),titleElementId:Z(e=>e.titleElementId),descriptionElementId:Z(e=>e.descriptionElementId),openOnHover:Z(e=>e.openOnHover),closeDelay:Z(e=>e.closeDelay)},vN=class e extends lw{constructor(e){let t={...gN(),...e};t.open&&e?.mounted===void 0&&(t.mounted=!0),super(t,{popupRef:W.createRef(),backdropRef:W.createRef(),internalBackdropRef:W.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:W.createRef(),beforeContentFocusGuardRef:W.createRef(),stickIfOpenTimeout:new R_,triggerElements:new yw},_N)}setOpen=(e,t)=>{let n=t.reason===Jb,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let a={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested,triggerElement:t.trigger};this.state.floatingRootContext.context.events?.emit(`openchange`,a);let o=()=>{let n={open:e,openChangeReason:t.reason},r=t.trigger?.id??null;(r||e)&&(n.activeTriggerId=r,n.activeTriggerElement=t.trigger??null),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),iS.flushSync(o)):o(),r||i?this.set(`instantType`,r?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)};static useStore(t,n){let r=P_(()=>t??new e(n)).current;return I_(r.disposeEffect),r}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()};function yN(e){let t=W.useRef(``),n=W.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:W.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n&&e(n,n.pointerType),e(n,t.current),t.current=``},[e]),onPointerDown:n}}function bN(e){let[t,n]=W.useState(null),r=X((t,r)=>{e||n(r)}),i=W.useCallback(()=>{n(null)},[]),{onClick:a,onPointerDown:o}=yN(r);return W.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:a,onPointerDown:o}}),[t,i,a,o])}function xN({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=vN.useStore(s?.store,{open:n??r,modal:o,activeTriggerId:c===void 0?l:c});u.useControlledProp(`open`,n,r),u.useControlledProp(`activeTriggerId`,c,l);let d=u.useState(`open`),f=u.useState(`positionerElement`),p=u.useState(`payload`),m=u.useState(`openChangeReason`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a);let{openMethod:h,triggerProps:g,reset:_}=bN(d);_w(u);let{forceUnmount:v}=vw(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null}),_()});pN(d&&o===!0&&m!==`trigger-hover`&&h!==`touch`,f),W.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]);let y=W.useCallback(e=>{let t=ax(e);return t.preventUnmountOnClose=()=>{u.set(`preventUnmountingOnClose`,!0)},t},[u]),b=W.useCallback(()=>{u.setOpen(!1,y(rx))},[u,y]);W.useImperativeHandle(e.actionsRef,()=>({unmount:v,close:b}),[v,b]);let x=Tw({popupStore:u,onOpenChange:u.setOpen}),{getReferenceProps:S,getFloatingProps:C,getTriggerProps:w}=Rw([IC(x,{outsidePressEvent:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),Yw(x)]),T=W.useMemo(()=>S(g),[S,g]),E=W.useMemo(()=>w(g),[w,g]),D=W.useMemo(()=>C(),[C]);u.useSyncedValues({modal:o,openMethod:h,activeTriggerProps:T,inactiveTriggerProps:E,popupProps:D,floatingRootContext:x,nested:Nb()!=null});let O=W.useMemo(()=>({store:u}),[u]);return(0,G.jsx)(mN.Provider,{value:O,children:typeof t==`function`?t({payload:p}):t})}function SN(e){return hN(!0)?(0,G.jsx)(xN,{props:e}):(0,G.jsx)(Lb,{children:(0,G.jsx)(xN,{props:e})})}var CN=W.createContext(void 0);function wN(e=!1){let t=W.useContext(CN);if(t===void 0&&!e)throw Error(A_(16));return t}function TN(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:W.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function EN(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0}=e,a=W.useRef(null),o=wN(!0)!==void 0,s=X(()=>{let e=a.current;return!!(e?.tagName===`A`&&e?.href)}),{props:c}=TN({focusableWhenDisabled:n,disabled:t,composite:o,tabIndex:r,isNativeButton:i}),l=W.useCallback(()=>{let e=a.current;DN(e)&&o&&t&&c.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,c.disabled,o]);return Y(l,[l]),{getButtonProps:W.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:l,...u}=e;return Ux({type:i?`button`:void 0,onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Zx(e),o?.(e)),e.baseUIHandlerPrevented)return;let r=e.target===e.currentTarget&&!i&&!s()&&!t,a=e.key===`Enter`,c=e.key===` `;r&&((c||a)&&e.preventDefault(),a&&n?.(e))},onKeyUp(e){t||(Zx(e),a?.(e)),!e.baseUIHandlerPrevented&&e.target===e.currentTarget&&!i&&!t&&e.key===` `&&n?.(e)},onPointerDown(e){if(t){e.preventDefault();return}l?.(e)}},i?void 0:{role:`button`},c,u)},[t,c,i,s]),buttonRef:X(e=>{a.current=e,l()})}}function DN(e){return K_(e)&&e.tagName===`BUTTON`}var ON=W.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,handle:o,payload:s,openOnHover:c=!1,delay:l=300,closeDelay:u=0,id:d,...f}=e,p=hN(!0),m=o?.store??p?.store;if(!m)throw Error(A_(74));let h=yT(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`floatingRootContext`),v=m.useState(`isOpenedByTrigger`,h),y=W.useRef(null),{registerTrigger:b,isMountedByThisTrigger:x}=gw(h,y,m,{payload:s,disabled:i,openOnHover:c,closeDelay:u}),S=m.useState(`openChangeReason`),C=m.useState(`stickIfOpen`),w=m.useState(`openMethod`),T=Lw(_,{enabled:_!=null&&c&&(w!==`touch`||S!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:$w(),restMs:l,delay:{close:u},triggerElementRef:y,isActiveTrigger:g}),E=Rw([xS(_,{enabled:_!=null,stickIfOpen:C})]),D=m.useState(`triggerProps`,x),O=W.useMemo(()=>({disabled:i,open:v}),[i,v]),{getButtonProps:k,buttonRef:A}=EN({disabled:i,native:a}),j=W.useMemo(()=>({open(e){return e&&S===`trigger-press`?_T.open(e):gT.open(e)}}),[S]),M=eS(`button`,e,{state:O,ref:[A,t,b,y],props:[E.getReferenceProps(),T,D,{[Hb]:``,id:h},f,k],stateAttributesMapping:j}),N=W.useRef(null),P=X(e=>{iS.flushSync(()=>{m.setOpen(!1,ax(Qb,e.nativeEvent,e.currentTarget))}),bb(N.current)?.focus()}),F=X(e=>{let t=m.select(`positionerElement`);if(t&&xb(e,t))m.context.beforeContentFocusGuardRef.current?.focus();else{iS.flushSync(()=>{m.setOpen(!1,ax(Qb,e.nativeEvent,e.currentTarget))});let n=yb(y.current);for(;n!==null&&Lv(t,n)||n?.hasAttribute(`aria-hidden`);){let e=n;if(n=gb(n),n===e)break}n?.focus()}});return g?(0,G.jsxs)(W.Fragment,{children:[(0,G.jsx)(Cx,{ref:N,onFocus:P}),(0,G.jsx)(W.Fragment,{children:M},h),(0,G.jsx)(Cx,{ref:m.context.triggerFocusTargetRef,onFocus:F})]}):(0,G.jsx)(W.Fragment,{children:M},h)}),kN=W.createContext(void 0);function AN(){let e=W.useContext(kN);if(e===void 0)throw Error(A_(45));return e}var jN=W.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=hN();return i.useState(`mounted`)||n?(0,G.jsx)(kN.Provider,{value:n,children:(0,G.jsx)(lS,{ref:t,...r,renderGuards:!1})}):null}),MN=W.createContext(void 0);function NN(){let e=W.useContext(MN);if(!e)throw Error(A_(46));return e}var PN=W.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n?.getBoundingClientRect();i=`polygon(
1953
+ `)}\n`:`${t} ${e.lineContent}`,a.push(` <code><![CDATA[${r}]]></code>`)}if(a.push(` <body><![CDATA[${e.body}]]></body>`),e.replies&&e.replies.length>0){a.push(` <replies>`);for(let t of e.replies){let e=new Date(t.createdAt).toISOString(),n=t.role?` role="${t.role}"`:` role="agent"`,r=t.model?` model="${t.model}"`:``;a.push(` <reply id="${t.id}" created-at="${e}"${n}${r}>`),a.push(` <![CDATA[${t.body}]]>`),a.push(` </reply>`)}a.push(` </replies>`)}a.push(` </comment>`)}a.push(` </file>`)}return a.push(`</code-review-comments>`),a.join(`
1954
+ `)}var Aj=[`comments`];async function jj(){return(await fetch(`/api/comments`)).json()}function Mj(){let e=Ve(),{data:t=[]}=nt({queryKey:Aj,queryFn:jj});(0,W.useEffect)(()=>wj(`comments`,()=>{e.invalidateQueries({queryKey:Aj})}),[e]);let[n,r]=(0,W.useState)({round:0,waiters:0,lastSentAt:null});(0,W.useEffect)(()=>{let e=!1;fetch(`/api/review/status`).then(e=>e.json()).then(t=>{e||r(t)}).catch(()=>{});let t=wj(`agent-status`,e=>{try{r(JSON.parse(e))}catch{}});return()=>{e=!0,t()}},[]);let i=(0,W.useRef)(null),[a,o]=(0,W.useState)(null);(0,W.useEffect)(()=>{let e=i.current===null;i.current===null&&(i.current=new Set);let n=i.current,r=null;for(let i of t)for(let t of i.replies??[]){if(n.has(t.id))continue;n.add(t.id);let a=t.role===`agent`||t.role==null&&!!t.model;!e&&a&&(!r||t.createdAt>r.at)&&(r={at:t.createdAt,commentId:i.id,filePath:i.filePath,model:t.model,body:t.body})}r&&o(r)},[t]);let s=rt({mutationFn:async e=>(await fetch(`/api/comments`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})).json(),onSuccess:t=>{e.setQueryData(Aj,(e=[])=>[...e,t])}}),c=rt({mutationFn:async e=>(await fetch(`/api/comments/${e}`,{method:`DELETE`}),e),onSuccess:t=>{e.setQueryData(Aj,(e=[])=>e.filter(e=>e.id!==t))}}),l=rt({mutationFn:async({id:e,body:t,status:n})=>(await fetch(`/api/comments/${e}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({body:t,status:n})})).json(),onSuccess:t=>{e.setQueryData(Aj,(e=[])=>e.map(e=>e.id===t.id?t:e))}}),u=rt({mutationFn:async({id:e,body:t})=>(await fetch(`/api/comments/${e}/replies`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({body:t,role:`user`})})).json(),onSuccess:t=>{e.setQueryData(Aj,(e=[])=>e.map(e=>e.id===t.id?t:e))}}),d=rt({mutationFn:async({commentId:e,replyId:t})=>(await fetch(`/api/comments/${e}/replies/${t}`,{method:`DELETE`})).json(),onSuccess:t=>{e.setQueryData(Aj,(e=[])=>e.map(e=>e.id===t.id?t:e))}}),f=rt({mutationFn:async({commentId:e,replyId:t,body:n})=>(await fetch(`/api/comments/${e}/replies/${t}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({body:n})})).json(),onSuccess:t=>{e.setQueryData(Aj,(e=[])=>e.map(e=>e.id===t.id?t:e))}}),p=rt({mutationFn:async({decision:e,generalComment:t})=>{let n=await fetch(`/api/review/send`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({decision:e,generalComment:t?.trim()||void 0})});if(!n.ok)throw Error(`Failed to send to agent`);return n.json()}}),m=rt({mutationFn:async e=>{let t=await fetch(`/api/comments/${e}/apply-suggestion`,{method:`POST`});if(!t.ok){let e=await t.json();throw Error(e.error||`Failed to apply suggestion`)}return t.json()},onSuccess:()=>{e.invalidateQueries({queryKey:Aj})}}),h=(0,W.useCallback)((e,t,n,r,i,a)=>{s.mutate({filePath:e,side:t,lineNumber:n,startLineNumber:a,lineContent:r,body:i})},[s.mutate]),g=(0,W.useCallback)(e=>{c.mutate(e)},[c.mutate]),_=(0,W.useCallback)((e,t)=>{l.mutate({id:e,body:t})},[l.mutate]),v=(0,W.useCallback)(e=>{l.mutate({id:e,status:`resolved`})},[l.mutate]),y=(0,W.useCallback)(e=>{l.mutate({id:e,status:`open`})},[l.mutate]),b=(0,W.useCallback)((e,t)=>{u.mutate({id:e,body:t})},[u.mutate]),x=(0,W.useCallback)((e,t)=>{d.mutate({commentId:e,replyId:t})},[d.mutate]),S=(0,W.useCallback)((e,t,n)=>{f.mutate({commentId:e,replyId:t,body:n})},[f.mutate]),C=(0,W.useCallback)(async e=>{await m.mutateAsync(e)},[m.mutateAsync]),w=(0,W.useCallback)(()=>kj(t),[t]),T=(0,W.useCallback)(e=>t.filter(t=>t.filePath===e).map(e=>({side:e.side,lineNumber:e.lineNumber,metadata:e})),[t]),E=(0,W.useCallback)(async()=>{let e=w();await navigator.clipboard.writeText(e)},[w]),D=(0,W.useCallback)((e,t)=>p.mutateAsync({decision:e,generalComment:t}),[p.mutateAsync]);return{comments:t,addComment:h,removeComment:g,editComment:_,resolveComment:v,unresolveComment:y,addReply:b,removeReply:x,editReply:S,applySuggestion:C,getAnnotationsForFile:T,formatAllComments:w,copyAllComments:E,agentActivity:a,clearAgentActivity:(0,W.useCallback)(()=>o(null),[]),sendToAgent:D,sending:p.isPending,agentWaiting:n.waiters>0}}var Nj=[`plans`];async function Pj(){return(await fetch(`/api/plans`)).json()}function Fj(){let e=Ve(),{data:t=[],isLoading:n}=nt({queryKey:Nj,queryFn:Pj});(0,W.useEffect)(()=>wj(`plans`,()=>{e.invalidateQueries({queryKey:Nj})}),[e]);let[r,i]=(0,W.useState)({round:0,waiters:0,lastDecidedAt:null});(0,W.useEffect)(()=>{let e=!1;fetch(`/api/plan-review/status`).then(e=>e.json()).then(t=>{e||i(t)}).catch(()=>{});let t=wj(`plan-review-status`,e=>{try{i(JSON.parse(e))}catch{}});return()=>{e=!0,t()}},[]);let a=(0,W.useRef)(null),[o,s]=(0,W.useState)(null);(0,W.useEffect)(()=>{let e=a.current===null;a.current===null&&(a.current=new Set);let n=a.current,r=null;for(let i of t)for(let t of i.comments??[])for(let a of t.replies??[]){if(n.has(a.id))continue;n.add(a.id);let o=a.role===`agent`||a.role==null&&!!a.model;!e&&o&&(!r||a.createdAt>r.at)&&(r={at:a.createdAt,planId:i.id,commentId:t.id,model:a.model,body:a.body})}r&&s(r)},[t]);let c=(0,W.useCallback)(t=>{e.setQueryData(Nj,(e=[])=>e.some(e=>e.id===t.id)?e.map(e=>e.id===t.id?t:e):[...e,t])},[e]),l=rt({mutationFn:async({planId:e,...t})=>(await fetch(`/api/plans/${e}/comments`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)})).json(),onSuccess:c}),u=rt({mutationFn:async({planId:e,commentId:t,body:n,status:r})=>(await fetch(`/api/plans/${e}/comments/${t}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({body:n,status:r})})).json(),onSuccess:c}),d=rt({mutationFn:async({planId:e,commentId:t})=>(await fetch(`/api/plans/${e}/comments/${t}`,{method:`DELETE`})).json(),onSuccess:c}),f=rt({mutationFn:async({planId:e,commentId:t,body:n})=>(await fetch(`/api/plans/${e}/comments/${t}/replies`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({body:n,role:`user`})})).json(),onSuccess:c}),p=rt({mutationFn:async({planId:e,commentId:t,replyId:n,body:r})=>(await fetch(`/api/plans/${e}/comments/${t}/replies/${n}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({body:r})})).json(),onSuccess:c}),m=rt({mutationFn:async({planId:e,commentId:t,replyId:n})=>(await fetch(`/api/plans/${e}/comments/${t}/replies/${n}`,{method:`DELETE`})).json(),onSuccess:c}),h=rt({mutationFn:async({planId:e,decision:t,decisionComment:n})=>{let r=await fetch(`/api/plans/${e}/decision`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({decision:t,decisionComment:n?.trim()||void 0})});if(!r.ok)throw Error(`Failed to submit plan decision`);return r.json()},onSuccess:()=>e.invalidateQueries({queryKey:Nj})}),g=rt({mutationFn:async e=>(await fetch(`/api/plans/${e}`,{method:`DELETE`}),e),onSuccess:t=>{e.setQueryData(Nj,(e=[])=>e.filter(e=>e.id!==t))}});return{plans:t,getPlan:(0,W.useCallback)(e=>t.find(t=>t.id===e)??null,[t]),addPlanComment:(0,W.useCallback)(e=>l.mutate(e),[l.mutate]),editPlanComment:(0,W.useCallback)((e,t,n)=>u.mutate({planId:e,commentId:t,body:n}),[u.mutate]),resolvePlanComment:(0,W.useCallback)((e,t)=>u.mutate({planId:e,commentId:t,status:`resolved`}),[u.mutate]),unresolvePlanComment:(0,W.useCallback)((e,t)=>u.mutate({planId:e,commentId:t,status:`open`}),[u.mutate]),removePlanComment:(0,W.useCallback)((e,t)=>d.mutate({planId:e,commentId:t}),[d.mutate]),addPlanReply:(0,W.useCallback)((e,t,n)=>f.mutate({planId:e,commentId:t,body:n}),[f.mutate]),editPlanReply:(0,W.useCallback)((e,t,n,r)=>p.mutate({planId:e,commentId:t,replyId:n,body:r}),[p.mutate]),removePlanReply:(0,W.useCallback)((e,t,n)=>m.mutate({planId:e,commentId:t,replyId:n}),[m.mutate]),removePlan:(0,W.useCallback)(e=>g.mutate(e),[g.mutate]),submitDecision:(0,W.useCallback)((e,t,n)=>h.mutateAsync({planId:e,decision:t,decisionComment:n}),[h.mutateAsync]),submitting:h.isPending,agentWaiting:r.waiters>0,agentActivity:o,clearAgentActivity:(0,W.useCallback)(()=>s(null),[]),isLoading:n}}var Ij=new Set;function Lj(){for(let e of Ij)e()}function Rj(e,t={}){e!==window.location.pathname+window.location.search&&(t.replace?window.history.replaceState(null,``,e):window.history.pushState(null,``,e),Lj())}function zj(e){return Ij.add(e),window.addEventListener(`popstate`,e),()=>{Ij.delete(e),window.removeEventListener(`popstate`,e)}}function Bj(){return window.location.pathname}function Vj(){return`/`}function Hj(){return(0,W.useSyncExternalStore)(zj,Bj,Vj)}function Uj(e){let[t,n]=(0,W.useState)({inMerge:!1,conflicts:[]}),r=(0,W.useCallback)(()=>{fetch(`/api/merge-status`).then(e=>e.ok?e.json():{inMerge:!1,conflicts:[]}).then(n).catch(()=>n({inMerge:!1,conflicts:[]}))},[]);return(0,W.useEffect)(()=>{r()},[r,e]),{status:t,refresh:r}}var Wj={staged:!0,untracked:!0,diffStyle:`split`,defaultTabSize:4,theme:`nord`,editorIDE:`default`,lineDiffType:`word`,lineWrap:!1,diffIndicators:`classic`,showLineNumbers:!0,hunkSeparators:`line-info`,lineHoverHighlight:`both`,fontSize:13,expandContextByDefault:!1,collapsedContextThreshold:10,expansionLineCount:20,haptics:!0,sounds:!0,uiFont:null,monoFont:null},Gj=`ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace`;function Kj(e){return e?`"${e}", ${Gj}`:`"JetBrains Mono", ${Gj}`}function qj(){let[e,t]=(0,W.useState)(Wj),[n,r]=(0,W.useState)(!1),i=(0,W.useRef)(!0);return(0,W.useEffect)(()=>{fetch(`/api/settings`).then(e=>e.json()).then(e=>{i.current=!0,t({...Wj,...e}),r(!0)}).catch(()=>r(!0))},[]),(0,W.useEffect)(()=>{if(i.current){i.current=!1;return}let t=setTimeout(()=>{fetch(`/api/settings`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}).catch(()=>{})},300);return()=>clearTimeout(t)},[e]),{settings:e,loaded:n,updateSettings:(0,W.useCallback)(e=>{t(t=>({...t,...e}))},[])}}function Jj(e,t,n){(0,W.useEffect)(()=>{let r=`, ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace`;if(!e)return;let i=!t,a=!n,o=`gfonts-preconnect`,s=`gfonts-preconnect-static`,c=`gfonts-link`,l=`diffing-fonts-override`,u=()=>{if(!document.getElementById(o)){let e=document.createElement(`link`);e.id=o,e.rel=`preconnect`,e.href=`https://fonts.googleapis.com`,document.head.appendChild(e)}if(!document.getElementById(s)){let e=document.createElement(`link`);e.id=s,e.rel=`preconnect`,e.href=`https://fonts.gstatic.com`,e.crossOrigin=`anonymous`,document.head.appendChild(e)}},d=()=>{document.getElementById(o)?.remove(),document.getElementById(s)?.remove()};if(i||a){u();let e=[];i&&e.push(`Geist+Mono:ital,wght@0,100..900;1,100..900`),a&&e.push(`JetBrains+Mono:ital,wght@0,100..800;1,100..800`);let t=`https://fonts.googleapis.com/css2?family=${e.join(`&family=`)}&display=swap`,n=document.getElementById(c);n||(n=document.createElement(`link`),n.id=c,n.rel=`stylesheet`,document.head.appendChild(n)),n.getAttribute(`href`)!==t&&n.setAttribute(`href`,t)}else document.getElementById(c)?.remove(),d();let f=document.getElementById(l);f||(f=document.createElement(`style`),f.id=l,document.head.appendChild(f));let p=t?`"${t}"`:`"Geist Mono"`,m=n?`"${n}"`:`"JetBrains Mono"`;return f.innerHTML=`
1955
+ :root {
1956
+ --font-sans: ${p}${r} !important;
1957
+ --font-mono: ${m}${r} !important;
1958
+ }
1959
+ `,()=>{f?.remove()}},[e,t,n])}var Yj=[`viewed`];async function Xj(){return(await fetch(`/api/viewed`)).json()}function Zj(){let e=Ve(),{data:t=[]}=nt({queryKey:Yj,queryFn:Xj});return{viewedFiles:(0,W.useMemo)(()=>new Set(t),[t]),setViewed:(0,W.useCallback)(async(t,n)=>{e.setQueryData(Yj,(e=[])=>n?e.includes(t)?e:[...e,t]:e.filter(e=>e!==t)),await fetch(`/api/viewed`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:t,viewed:n})})},[e])}}var Qj={success:{pattern:[{duration:30,intensity:.5},{delay:60,duration:40,intensity:1}]},warning:{pattern:[{duration:40,intensity:.8},{delay:100,duration:40,intensity:.6}]},error:{pattern:[{duration:40,intensity:.9},{delay:40,duration:40,intensity:.9},{delay:40,duration:40,intensity:.9}]},light:{pattern:[{duration:15,intensity:.4}]},medium:{pattern:[{duration:25,intensity:.7}]},heavy:{pattern:[{duration:35,intensity:1}]},soft:{pattern:[{duration:40,intensity:.5}]},rigid:{pattern:[{duration:10,intensity:1}]},selection:{pattern:[{duration:8,intensity:.3}]},nudge:{pattern:[{duration:80,intensity:.8},{delay:80,duration:50,intensity:.3}]},buzz:{pattern:[{duration:1e3,intensity:1}]}},$j=16,eM=184,tM=1e3,nM=20;function rM(e){if(typeof e==`number`)return{vibrations:[{duration:e}]};if(typeof e==`string`){let t=Qj[e];return t?{vibrations:t.pattern.map(e=>({...e}))}:(console.warn(`[web-haptics] Unknown preset: "${e}"`),null)}if(Array.isArray(e)){if(e.length===0)return{vibrations:[]};if(typeof e[0]==`number`){let t=e,n=[];for(let e=0;e<t.length;e+=2){let r=e>0?t[e-1]:0;n.push({...r>0&&{delay:r},duration:t[e]})}return{vibrations:n}}return{vibrations:e.map(e=>({...e}))}}return{vibrations:e.pattern.map(e=>({...e}))}}function iM(e,t){if(t>=1)return[e];if(t<=0)return[];let n=Math.max(1,Math.round(nM*t)),r=nM-n,i=[],a=e;for(;a>=nM;)i.push(n),i.push(r),a-=nM;if(a>0){let e=Math.max(1,Math.round(a*t));i.push(e);let n=a-e;n>0&&i.push(n)}return i}function aM(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=Math.max(0,Math.min(1,i.intensity??t)),o=i.delay??0;o>0&&(n.length>0&&n.length%2==0?n[n.length-1]+=o:(n.length===0&&n.push(0),n.push(o)));let s=iM(i.duration,a);if(s.length===0){n.length>0&&n.length%2==0?n[n.length-1]+=i.duration:i.duration>0&&(n.push(0),n.push(i.duration));continue}for(let e of s)n.push(e)}return n}var oM=0,sM=class e{hapticLabel=null;domInitialized=!1;instanceId;debug;showSwitch;rafId=null;patternResolve=null;audioCtx=null;audioFilter=null;audioGain=null;audioBuffer=null;constructor(e){this.instanceId=++oM,this.debug=e?.debug??!1,this.showSwitch=e?.showSwitch??!1}static isSupported=typeof navigator<`u`&&typeof navigator.vibrate==`function`;async trigger(t=[{duration:25,intensity:.7}],n){let r=rM(t);if(!r)return;let{vibrations:i}=r;if(i.length===0)return;let a=Math.max(0,Math.min(1,n?.intensity??.5));for(let e of i)if(e.duration>tM&&(e.duration=tM),!Number.isFinite(e.duration)||e.duration<0||e.delay!==void 0&&(!Number.isFinite(e.delay)||e.delay<0)){console.warn(`[web-haptics] Invalid vibration values. Durations and delays must be finite non-negative numbers.`);return}if(e.isSupported&&navigator.vibrate(aM(i,a)),!e.isSupported||this.debug){if(this.ensureDOM(),!this.hapticLabel)return;this.debug&&await this.ensureAudio(),this.stopPattern();let e=(i[0]?.delay??0)===0;if(e&&(this.hapticLabel.click(),this.debug&&this.audioCtx)){let e=Math.max(0,Math.min(1,i[0].intensity??a));this.playClick(e)}await this.runPattern(i,a,e)}}cancel(){this.stopPattern(),e.isSupported&&navigator.vibrate(0)}destroy(){this.stopPattern(),this.hapticLabel&&(this.hapticLabel.remove(),this.hapticLabel=null,this.domInitialized=!1),this.audioCtx&&(this.audioCtx.close(),this.audioCtx=null,this.audioFilter=null,this.audioGain=null,this.audioBuffer=null)}setDebug(e){this.debug=e,!e&&this.audioCtx&&(this.audioCtx.close(),this.audioCtx=null,this.audioFilter=null,this.audioGain=null,this.audioBuffer=null)}setShowSwitch(e){if(this.showSwitch=e,this.hapticLabel){let t=this.hapticLabel.querySelector(`input`);this.hapticLabel.style.display=e?``:`none`,t&&(t.style.display=e?``:`none`)}}stopPattern(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.patternResolve?.(),this.patternResolve=null}runPattern(e,t,n){return new Promise(r=>{this.patternResolve=r;let i=[],a=0;for(let n of e){let e=Math.max(0,Math.min(1,n.intensity??t)),r=n.delay??0;r>0&&(a+=r,i.push({end:a,isOn:!1,intensity:0})),a+=n.duration,i.push({end:a,isOn:!0,intensity:e})}let o=a,s=0,c=-1,l=e=>{s===0&&(s=e);let t=e-s;if(t>=o){this.rafId=null,this.patternResolve=null,r();return}let a=i[0];for(let e of i)if(t<e.end){a=e;break}if(a.isOn){let t=$j+(1-a.intensity)*eM;c===-1?(c=e,n||=(this.hapticLabel?.click(),this.debug&&this.audioCtx&&this.playClick(a.intensity),!0)):e-c>=t&&(this.hapticLabel?.click(),this.debug&&this.audioCtx&&this.playClick(a.intensity),c=e)}this.rafId=requestAnimationFrame(l)};this.rafId=requestAnimationFrame(l)})}playClick(e){if(!this.audioCtx||!this.audioFilter||!this.audioGain||!this.audioBuffer)return;let t=this.audioBuffer.getChannelData(0);for(let e=0;e<t.length;e++)t[e]=(Math.random()*2-1)*Math.exp(-e/25);this.audioGain.gain.value=.5*e;let n=2e3+e*2e3,r=1+(Math.random()-.5)*.3;this.audioFilter.frequency.value=n*r;let i=this.audioCtx.createBufferSource();i.buffer=this.audioBuffer,i.connect(this.audioFilter),i.onended=()=>i.disconnect(),i.start()}async ensureAudio(){if(!this.audioCtx&&typeof AudioContext<`u`){this.audioCtx=new AudioContext,this.audioFilter=this.audioCtx.createBiquadFilter(),this.audioFilter.type=`bandpass`,this.audioFilter.frequency.value=4e3,this.audioFilter.Q.value=8,this.audioGain=this.audioCtx.createGain(),this.audioFilter.connect(this.audioGain),this.audioGain.connect(this.audioCtx.destination),this.audioBuffer=this.audioCtx.createBuffer(1,this.audioCtx.sampleRate*.004,this.audioCtx.sampleRate);let e=this.audioBuffer.getChannelData(0);for(let t=0;t<e.length;t++)e[t]=(Math.random()*2-1)*Math.exp(-t/25)}this.audioCtx?.state===`suspended`&&await this.audioCtx.resume()}ensureDOM(){if(this.domInitialized||typeof document>`u`)return;let e=`web-haptics-${this.instanceId}`,t=document.createElement(`label`);t.setAttribute(`for`,e),t.textContent=`Haptic feedback`,t.style.position=`fixed`,t.style.bottom=`10px`,t.style.left=`10px`,t.style.padding=`5px 10px`,t.style.backgroundColor=`rgba(0, 0, 0, 0.7)`,t.style.color=`white`,t.style.fontFamily=`sans-serif`,t.style.fontSize=`14px`,t.style.borderRadius=`4px`,t.style.zIndex=`9999`,t.style.userSelect=`none`,this.hapticLabel=t;let n=document.createElement(`input`);n.type=`checkbox`,n.setAttribute(`switch`,``),n.id=e,n.style.all=`initial`,n.style.appearance=`auto`,this.showSwitch||(t.style.display=`none`,n.style.display=`none`),t.appendChild(n),document.body.appendChild(t),this.domInitialized=!0}};function cM(e){let t=(0,W.useRef)(null);return(0,W.useEffect)(()=>(t.current=new sM(e),()=>{t.current?.destroy(),t.current=null}),[]),(0,W.useEffect)(()=>{t.current?.setDebug(e?.debug??!1)},[e?.debug]),(0,W.useEffect)(()=>{t.current?.setShowSwitch(e?.showSwitch??!1)},[e?.showSwitch]),{trigger:(0,W.useCallback)((e,n)=>t.current?.trigger(e,n),[]),cancel:(0,W.useCallback)(()=>t.current?.cancel(),[]),isSupported:sM.isSupported}}var lM=(0,W.createContext)({hapticsEnabled:!1,soundsEnabled:!1,haptic:()=>{},sound:()=>{}}),uM=null;function dM(){if(typeof window>`u`)return null;if(uM)return uM;try{uM=new(window.AudioContext||window.webkitAudioContext)}catch{uM=null}return uM}function fM(e,t){let n=e.currentTime,r=e.destination,i=(t,i,a,o,s,c)=>{let l=e.createOscillator(),u=e.createGain();l.connect(u),u.connect(r),l.type=i,l.frequency.setValueAtTime(t,n+o),c!==void 0&&l.frequency.exponentialRampToValueAtTime(c,n+o+s),u.gain.setValueAtTime(a,n+o),u.gain.exponentialRampToValueAtTime(.001,n+o+s),l.start(n+o),l.stop(n+o+s)};switch(t){case`click`:i(700,`sine`,.16,0,.03,350);break;case`toggle`:i(460,`square`,.06,0,.04,230);break;case`navigate`:i(520,`sine`,.07,0,.02);break;case`open`:i(210,`sine`,.12,0,.13,560);break;case`close`:i(560,`sine`,.1,0,.11,210);break;case`success`:i(523,`sine`,.17,0,.1),i(784,`sine`,.17,.09,.13);break;case`resolve`:i(659,`sine`,.15,0,.1),i(988,`sine`,.15,.09,.13);break;case`send`:i(523,`sine`,.15,0,.1),i(659,`sine`,.15,.07,.1),i(784,`sine`,.15,.14,.14);break;case`error`:i(280,`sawtooth`,.16,0,.15,80);break;case`warning`:i(330,`sine`,.13,0,.09),i(330,`sine`,.09,.12,.09);break;case`remove`:i(380,`sine`,.13,0,.08,140);break}}var pM={current:!1},mM={current:!1},hM=null;function gM(e=`click`){if(!pM.current)return;let t=dM();t&&(t.state===`suspended`?t.resume():Promise.resolve()).then(()=>{try{fM(t,e)}catch{}}).catch(()=>{})}function _M(e=`selection`){if(!(!mM.current||!hM))try{hM(e)}catch{}}function vM(e=`selection`,t=`click`){_M(e),gM(t)}function yM({enabled:e,soundsEnabled:t,children:n}){let{trigger:r,isSupported:i}=cM({showSwitch:!1}),a=(0,W.useRef)(e);a.current=e;let o=(0,W.useRef)(t);o.current=t;let s=(0,W.useRef)(r);s.current=r,(0,W.useEffect)(()=>{mM.current=e&&i,hM=r}),(0,W.useEffect)(()=>{pM.current=t});let c=(0,W.useMemo)(()=>(e=`selection`)=>{if(a.current)try{s.current(e)}catch{}},[]),l=(0,W.useMemo)(()=>(e=`click`)=>{if(!o.current)return;let t=dM();t&&(t.state===`suspended`?t.resume():Promise.resolve()).then(()=>{try{fM(t,e)}catch{}}).catch(()=>{})},[]);(0,W.useEffect)(()=>{if(!e&&!t)return;let n=e=>{let t=e.target?.closest(`button, a[href], [role="button"], input[type="checkbox"], [role="option"]`);if(!t||t.disabled)return;let n=t.tagName===`INPUT`&&t.type===`checkbox`;if(a.current)try{s.current(`selection`)}catch{}if(o.current){let e=dM();e&&(e.state===`suspended`?e.resume():Promise.resolve()).then(()=>{try{fM(e,n?`toggle`:`click`)}catch{}}).catch(()=>{})}};return document.addEventListener(`click`,n,!0),()=>document.removeEventListener(`click`,n,!0)},[e,t]);let u=(0,W.useMemo)(()=>({hapticsEnabled:e&&i,soundsEnabled:t,haptic:c,sound:l}),[e,i,t,c,l]);return(0,G.jsx)(lM.Provider,{value:u,children:n})}function bM(){let{haptic:e,sound:t}=(0,W.useContext)(lM);return{haptic:e,sound:t}}var xM={};async function SM(){try{let e=await fetch(`/api/ui-state`);e.ok&&(xM=await e.json())}catch(e){console.error(`Failed to load UI state:`,e)}}function CM(e){let t=xM[e];return t==null?null:String(t)}var wM={},TM=null;function EM(){TM&&=(clearTimeout(TM),null);let e={...wM};wM={},fetch(`/api/ui-state`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}).catch(e=>{console.error(`Failed to save UI state:`,e)})}function DM(e,t){xM[e]=t,wM[e]=t,TM||=setTimeout(EM,200)}function OM(e){delete xM[e],wM[e]=null,TM||=setTimeout(EM,200)}function kM(e){return(0,W.useMemo)(()=>{let t=[];for(let n of e)for(let e of n.hunks)for(let r of e.hunkContent)if(r.type===`change`){if(r.additions>0){let i=r.additionLineIndex,a=r.additions;for(let r=0;r<a;r++){let a=i+r,o=n.additionLines[a];o&&o.trim()&&t.push({filePath:n.name,lineNumber:e.additionStart+(a-e.additionLineIndex),side:`additions`,content:o})}}if(r.deletions>0){let i=r.deletionLineIndex,a=r.deletions;for(let r=0;r<a;r++){let a=i+r,o=n.deletionLines[a];o&&o.trim()&&t.push({filePath:n.name,lineNumber:e.deletionStart+(a-e.deletionLineIndex),side:`deletions`,content:o})}}}return t},[e])}var AM=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),jM=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),MM=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),NM=e=>{let t=MM(e);return t.charAt(0).toUpperCase()+t.slice(1)},PM={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`},FM=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},IM=(0,W.createContext)({}),LM=()=>(0,W.useContext)(IM),RM=(0,W.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:p=``}=LM()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,W.createElement)(`svg`,{ref:c,...PM,width:t??l??PM.width,height:t??l??PM.height,stroke:e??f,strokeWidth:m,className:AM(`lucide`,p,i),...!a&&!FM(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,W.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),zM=(e,t)=>{let n=(0,W.forwardRef)(({className:n,...r},i)=>(0,W.createElement)(RM,{ref:i,iconNode:t,className:AM(`lucide-${jM(NM(e))}`,`lucide-${e}`,n),...r}));return n.displayName=NM(e),n},BM=zM(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),VM=zM(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),HM=zM(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),UM=zM(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),WM=zM(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),GM=zM(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),KM=zM(`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`}]]),qM=zM(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),JM=zM(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),YM=zM(`clipboard-check`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`m9 14 2 2 4-4`,key:`df797q`}]]),XM=zM(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),ZM=zM(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),QM=zM(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),$M=zM(`corner-up-left`,[[`path`,{d:`M20 20v-7a4 4 0 0 0-4-4H4`,key:`1nkjon`}],[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}]]),eN=zM(`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`}]]),tN=zM(`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`}]]),nN=zM(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),rN=zM(`git-compare`,[[`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`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]),iN=zM(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),aN=zM(`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`}]]),oN=zM(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),sN=zM(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),cN=zM(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),lN=zM(`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`}]]),uN=zM(`message-square-warning`,[[`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 15h.01`,key:`q59x07`}],[`path`,{d:`M12 7v4`,key:`xawao1`}]]),dN=zM(`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`}]]),fN=zM(`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`}]]),pN=zM(`navigation`,[[`polygon`,{points:`3 11 22 2 13 21 11 13 3 11`,key:`1ltx0t`}]]),mN=zM(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),hN=zM(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),gN=zM(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),_N=zM(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`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`}]]),vN=zM(`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`}]]),yN=zM(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),bN=zM(`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`}]]),xN=zM(`reply`,[[`path`,{d:`M20 18v-2a4 4 0 0 0-4-4H4`,key:`5vmcpk`}],[`path`,{d:`m9 17-5-5 5-5`,key:`nvlc11`}]]),SN=zM(`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`}]]),CN=zM(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),wN=zM(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),TN=zM(`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`}]]),EN=zM(`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`}]]),DN=zM(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),ON=zM(`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`}]]),kN=zM(`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`}]]),AN=zM(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),jN=zM(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),MN=zM(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),NN=zM(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),PN={},FN={},IN=``;function LN(e){if(typeof document>`u`)return!1;let t=Sx(e);return H_(t).innerWidth-t.documentElement.clientWidth>0}function RN(e){let t=Sx(e),n=t.documentElement,r=t.body,i=J_(n)?n:r,a=i.style.overflow;return i.style.overflow=`hidden`,()=>{i.style.overflow=a}}function zN(e){let t=Sx(e),n=t.documentElement,r=t.body,i=H_(n),a=0,o=0,s=bx.create(),c=typeof CSS<`u`&&CSS.supports?.(`scrollbar-gutter`,`stable`);if(xv&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let e=i.getComputedStyle(n),t=i.getComputedStyle(r),s=(e.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,PN={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},IN=n.style.scrollBehavior,FN={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let l=n.scrollHeight>n.clientHeight,u=n.scrollWidth>n.clientWidth,d=e.overflowY===`scroll`||t.overflowY===`scroll`,f=e.overflowX===`scroll`||t.overflowX===`scroll`,p=Math.max(0,i.innerWidth-n.clientWidth),m=Math.max(0,i.innerHeight-n.clientHeight),h=parseFloat(t.marginTop)+parseFloat(t.marginBottom),g=parseFloat(t.marginLeft)+parseFloat(t.marginRight),_=J_(n)?n:r;if(c){n.style.scrollbarGutter=s,_.style.overflowY=`hidden`,_.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:s,overflowY:`hidden`,overflowX:`hidden`}),(l||d)&&(n.style.overflowY=`scroll`),(u||f)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:h||m?`calc(100dvh - ${h+m}px)`:`100dvh`,width:g||p?`calc(100vw - ${g+p}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,PN),Object.assign(r.style,FN),c||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=IN)}function d(){u(),s.request(l)}return l(),i.addEventListener(`resize`,d),()=>{s.cancel(),u(),typeof i.removeEventListener==`function`&&i.removeEventListener(`resize`,d)}}var BN=new class{lockCount=0;restore=null;timeoutLock=R_.create();timeoutUnlock=R_.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Sx(e).documentElement,n=H_(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=Rb;return}this.restore=Sv||!LN(e)?RN(e):zN(e)}};function VN(e=!0,t=null){Y(()=>{if(e)return BN.acquire(t)},[e,t])}var HN=W.createContext(void 0);function UN(e){let t=W.useContext(HN);if(t===void 0&&!e)throw Error(A_(47));return t}function WN(){return{...xw(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0}}var GN={...Sw,disabled:Z(e=>e.disabled),instantType:Z(e=>e.instantType),openMethod:Z(e=>e.openMethod),openChangeReason:Z(e=>e.openChangeReason),modal:Z(e=>e.modal),stickIfOpen:Z(e=>e.stickIfOpen),titleElementId:Z(e=>e.titleElementId),descriptionElementId:Z(e=>e.descriptionElementId),openOnHover:Z(e=>e.openOnHover),closeDelay:Z(e=>e.closeDelay)},KN=class e extends lw{constructor(e){let t={...WN(),...e};t.open&&e?.mounted===void 0&&(t.mounted=!0),super(t,{popupRef:W.createRef(),backdropRef:W.createRef(),internalBackdropRef:W.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:W.createRef(),beforeContentFocusGuardRef:W.createRef(),stickIfOpenTimeout:new R_,triggerElements:new yw},GN)}setOpen=(e,t)=>{let n=t.reason===Jb,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let a={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested,triggerElement:t.trigger};this.state.floatingRootContext.context.events?.emit(`openchange`,a);let o=()=>{let n={open:e,openChangeReason:t.reason},r=t.trigger?.id??null;(r||e)&&(n.activeTriggerId=r,n.activeTriggerElement=t.trigger??null),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),iS.flushSync(o)):o(),r||i?this.set(`instantType`,r?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)};static useStore(t,n){let r=P_(()=>t??new e(n)).current;return I_(r.disposeEffect),r}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()};function qN(e){let t=W.useRef(``),n=W.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:W.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n&&e(n,n.pointerType),e(n,t.current),t.current=``},[e]),onPointerDown:n}}function JN(e){let[t,n]=W.useState(null),r=X((t,r)=>{e||n(r)}),i=W.useCallback(()=>{n(null)},[]),{onClick:a,onPointerDown:o}=qN(r);return W.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:a,onPointerDown:o}}),[t,i,a,o])}function YN({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=KN.useStore(s?.store,{open:n??r,modal:o,activeTriggerId:c===void 0?l:c});u.useControlledProp(`open`,n,r),u.useControlledProp(`activeTriggerId`,c,l);let d=u.useState(`open`),f=u.useState(`positionerElement`),p=u.useState(`payload`),m=u.useState(`openChangeReason`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a);let{openMethod:h,triggerProps:g,reset:_}=JN(d);_w(u);let{forceUnmount:v}=vw(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null}),_()});VN(d&&o===!0&&m!==`trigger-hover`&&h!==`touch`,f),W.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]);let y=W.useCallback(e=>{let t=ax(e);return t.preventUnmountOnClose=()=>{u.set(`preventUnmountingOnClose`,!0)},t},[u]),b=W.useCallback(()=>{u.setOpen(!1,y(rx))},[u,y]);W.useImperativeHandle(e.actionsRef,()=>({unmount:v,close:b}),[v,b]);let x=Tw({popupStore:u,onOpenChange:u.setOpen}),{getReferenceProps:S,getFloatingProps:C,getTriggerProps:w}=Rw([IC(x,{outsidePressEvent:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),Yw(x)]),T=W.useMemo(()=>S(g),[S,g]),E=W.useMemo(()=>w(g),[w,g]),D=W.useMemo(()=>C(),[C]);u.useSyncedValues({modal:o,openMethod:h,activeTriggerProps:T,inactiveTriggerProps:E,popupProps:D,floatingRootContext:x,nested:Nb()!=null});let O=W.useMemo(()=>({store:u}),[u]);return(0,G.jsx)(HN.Provider,{value:O,children:typeof t==`function`?t({payload:p}):t})}function XN(e){return UN(!0)?(0,G.jsx)(YN,{props:e}):(0,G.jsx)(Lb,{children:(0,G.jsx)(YN,{props:e})})}var ZN=W.createContext(void 0);function QN(e=!1){let t=W.useContext(ZN);if(t===void 0&&!e)throw Error(A_(16));return t}function $N(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:W.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function eP(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0}=e,a=W.useRef(null),o=QN(!0)!==void 0,s=X(()=>{let e=a.current;return!!(e?.tagName===`A`&&e?.href)}),{props:c}=$N({focusableWhenDisabled:n,disabled:t,composite:o,tabIndex:r,isNativeButton:i}),l=W.useCallback(()=>{let e=a.current;tP(e)&&o&&t&&c.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,c.disabled,o]);return Y(l,[l]),{getButtonProps:W.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:l,...u}=e;return Ux({type:i?`button`:void 0,onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Zx(e),o?.(e)),e.baseUIHandlerPrevented)return;let r=e.target===e.currentTarget&&!i&&!s()&&!t,a=e.key===`Enter`,c=e.key===` `;r&&((c||a)&&e.preventDefault(),a&&n?.(e))},onKeyUp(e){t||(Zx(e),a?.(e)),!e.baseUIHandlerPrevented&&e.target===e.currentTarget&&!i&&!t&&e.key===` `&&n?.(e)},onPointerDown(e){if(t){e.preventDefault();return}l?.(e)}},i?void 0:{role:`button`},c,u)},[t,c,i,s]),buttonRef:X(e=>{a.current=e,l()})}}function tP(e){return K_(e)&&e.tagName===`BUTTON`}var nP=W.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,handle:o,payload:s,openOnHover:c=!1,delay:l=300,closeDelay:u=0,id:d,...f}=e,p=UN(!0),m=o?.store??p?.store;if(!m)throw Error(A_(74));let h=yT(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`floatingRootContext`),v=m.useState(`isOpenedByTrigger`,h),y=W.useRef(null),{registerTrigger:b,isMountedByThisTrigger:x}=gw(h,y,m,{payload:s,disabled:i,openOnHover:c,closeDelay:u}),S=m.useState(`openChangeReason`),C=m.useState(`stickIfOpen`),w=m.useState(`openMethod`),T=Lw(_,{enabled:_!=null&&c&&(w!==`touch`||S!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:$w(),restMs:l,delay:{close:u},triggerElementRef:y,isActiveTrigger:g}),E=Rw([xS(_,{enabled:_!=null,stickIfOpen:C})]),D=m.useState(`triggerProps`,x),O=W.useMemo(()=>({disabled:i,open:v}),[i,v]),{getButtonProps:k,buttonRef:A}=eP({disabled:i,native:a}),j=W.useMemo(()=>({open(e){return e&&S===`trigger-press`?_T.open(e):gT.open(e)}}),[S]),M=eS(`button`,e,{state:O,ref:[A,t,b,y],props:[E.getReferenceProps(),T,D,{[Hb]:``,id:h},f,k],stateAttributesMapping:j}),N=W.useRef(null),P=X(e=>{iS.flushSync(()=>{m.setOpen(!1,ax(Qb,e.nativeEvent,e.currentTarget))}),bb(N.current)?.focus()}),F=X(e=>{let t=m.select(`positionerElement`);if(t&&xb(e,t))m.context.beforeContentFocusGuardRef.current?.focus();else{iS.flushSync(()=>{m.setOpen(!1,ax(Qb,e.nativeEvent,e.currentTarget))});let n=yb(y.current);for(;n!==null&&Lv(t,n)||n?.hasAttribute(`aria-hidden`);){let e=n;if(n=gb(n),n===e)break}n?.focus()}});return g?(0,G.jsxs)(W.Fragment,{children:[(0,G.jsx)(Cx,{ref:N,onFocus:P}),(0,G.jsx)(W.Fragment,{children:M},h),(0,G.jsx)(Cx,{ref:m.context.triggerFocusTargetRef,onFocus:F})]}):(0,G.jsx)(W.Fragment,{children:M},h)}),rP=W.createContext(void 0);function iP(){let e=W.useContext(rP);if(e===void 0)throw Error(A_(45));return e}var aP=W.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=UN();return i.useState(`mounted`)||n?(0,G.jsx)(rP.Provider,{value:n,children:(0,G.jsx)(lS,{ref:t,...r,renderGuards:!1})}):null}),oP=W.createContext(void 0);function sP(){let e=W.useContext(oP);if(!e)throw Error(A_(46));return e}var cP=W.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n?.getBoundingClientRect();i=`polygon(
1955
1960
  0% 0%,
1956
1961
  100% 0%,
1957
1962
  100% 100%,
@@ -1962,19 +1967,19 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
1962
1967
  ${e.right}px ${e.bottom}px,
1963
1968
  ${e.right}px ${e.top}px,
1964
1969
  ${e.left}px ${e.top}px
1965
- )`}return(0,G.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),FN=W.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Wb,...g}=e,{store:_}=hN(),v=AN(),y=Fb(),b=_.useState(`floatingRootContext`),x=_.useState(`mounted`),S=_.useState(`open`),C=_.useState(`openChangeReason`),w=_.useState(`activeTriggerElement`),T=_.useState(`modal`),E=_.useState(`positionerElement`),D=_.useState(`instantType`),O=_.useState(`transitionStatus`),k=W.useRef(null),A=pw(E,!1,!1),j=RT({anchor:i,floatingRootContext:b,positionMethod:a,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:v,nodeId:y,collisionAvoidance:h,adaptiveOrigin:FT}),M=W.useMemo(()=>{let e={};return S||(e.pointerEvents=`none`),{role:`presentation`,hidden:!x,style:{...j.positionerStyles,...e}}},[S,x,j.positionerStyles]),N=W.useMemo(()=>({props:M,...j}),[M,j]),P=b?.select(`domReferenceElement`);Y(()=>{let e=P,t=k.current;if(e&&(k.current=e),t&&e&&e!==t){_.set(`instantType`,void 0);let e=new AbortController;return A(()=>{_.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[P,A,_]);let F=W.useMemo(()=>({open:S,side:N.side,align:N.align,anchorHidden:N.anchorHidden,instant:D}),[S,N.side,N.align,N.anchorHidden,D]),I=W.useCallback(e=>{_.set(`positionerElement`,e)},[_]),L=eS(`div`,e,{state:F,props:[N.props,BT(O),g],ref:[t,I],stateAttributesMapping:vT});return(0,G.jsxs)(MN.Provider,{value:N,children:[x&&T===!0&&C!==`trigger-hover`&&(0,G.jsx)(PN,{ref:_.context.internalBackdropRef,inert:XT(!S),cutout:w}),(0,G.jsx)(Ib,{id:y,children:L})]})}),IN=`ArrowUp`,LN=`ArrowDown`,RN=`ArrowLeft`,zN=`ArrowRight`,BN=`Home`,VN=new Set([RN,zN]),HN=new Set([IN,LN]),UN=new Set([...VN,...HN]);new Set([...UN,BN,`End`]);var WN=new Set([IN,LN,RN,zN,BN,`End`]),GN=W.createContext(void 0);function KN(e){let t=W.useContext(GN);if(t===void 0&&!e)throw Error(A_(69));return t}var qN={...vT,...cT},JN=W.forwardRef(function(e,t){let{className:n,render:r,initialFocus:i,finalFocus:a,...o}=e,{store:s}=hN(),c=NN(),l=KN(!0)!=null,u=AT(),d=s.useState(`open`),f=s.useState(`openMethod`),p=s.useState(`instantType`),m=s.useState(`transitionStatus`),h=s.useState(`popupProps`),g=s.useState(`titleElementId`),_=s.useState(`descriptionElementId`),v=s.useState(`modal`),y=s.useState(`mounted`),b=s.useState(`openChangeReason`),x=s.useState(`popupElement`),S=s.useState(`payload`),C=s.useState(`positionerElement`),w=s.useState(`activeTriggerElement`),T=s.useState(`floatingRootContext`);mw({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}});let E=s.useState(`disabled`),D=s.useState(`openOnHover`),O=s.useState(`closeDelay`);Nw(T,{enabled:D&&!E,closeDelay:O});function k(e){return e===`touch`?s.context.popupRef.current:!0}let A=i===void 0?k:i,j=W.useMemo(()=>({open:d,side:c.side,align:c.align,instant:p,transitionStatus:m}),[d,c.side,c.align,p,m]),M=W.useCallback(e=>{s.set(`popupElement`,e)},[s]);function N(){T.context.events.emit(`measure-layout`)}function P(e,t){T.context.events.emit(`measure-layout-complete`,{previousDimensions:e,nextDimensions:t})}GT({popupElement:x,positionerElement:C,mounted:y,content:S,enabled:W.useCallback(()=>s.context.triggerElements.size>1,[s]),onMeasureLayout:N,onMeasureLayoutComplete:P,side:c.side,direction:u});let F=eS(`div`,e,{state:j,ref:[t,s.context.popupRef,M],props:[h,{"aria-labelledby":g,"aria-describedby":_,onKeyDown(e){l&&WN.has(e.key)&&e.stopPropagation()}},BT(m),o],stateAttributesMapping:qN});return(0,G.jsx)(bS,{context:T,openInteractionType:f,modal:v===`trap-focus`,disabled:!y||b===`trigger-hover`,initialFocus:A,returnFocus:a,restoreFocus:`popup`,previousFocusableElement:K_(w)?w:void 0,nextFocusableElement:s.context.triggerFocusTargetRef,beforeContentFocusGuardRef:s.context.beforeContentFocusGuardRef,children:F})});function YN({trigger:e,children:t,open:n,onOpenChange:r,side:i=`bottom`,align:a=`end`,className:o,ariaLabel:s}){return(0,G.jsxs)(SN,{open:n,onOpenChange:r,children:[(0,G.jsx)(ON,{render:e}),(0,G.jsx)(jN,{children:(0,G.jsx)(FN,{className:`ui-popover-positioner`,side:i,align:a,sideOffset:8,children:(0,G.jsx)(JN,{className:`ui-popover ${o??``}`,"aria-label":s,children:t})})})]})}function XN(e){let t=W.useRef(!0);t.current&&(t.current=!1,e())}function ZN({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=W.useRef(e!==void 0),[a,o]=W.useState(t);return[i?e:a,W.useCallback(e=>{i||o(e)},[])]}var QN=W.createContext(null),$N=W.createContext(null);function eP(){let e=W.useContext(QN);if(e===null)throw Error(A_(60));return e}function tP(){let e=W.useContext($N);if(e===null)throw Error(A_(61));return e}var nP=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),rP={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},iP={valid(e){return e===null?null:e?{[nP.valid]:``}:{[nP.invalid]:``}}},aP=W.createContext({invalid:void 0,name:void 0,validityData:{state:rP,errors:[],error:``,value:``,initialValue:null},setValidityData:Rb,disabled:void 0,touched:!1,setTouched:Rb,dirty:!1,setDirty:Rb,filled:!1,setFilled:Rb,focused:!1,setFocused:Rb,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=Bb)=>e,getInputValidationProps:(e=Bb)=>e,inputRef:{current:null},commit:async()=>{}}});function oP(e=!0){let t=W.useContext(aP);if(t.setValidityData===Rb&&!e)throw Error(A_(28));return t}var sP=W.createContext({controlId:void 0,setControlId:Rb,labelId:void 0,setLabelId:Rb,messageIds:[],setMessageIds:Rb,getDescriptionProps:e=>e});function cP(){return W.useContext(sP)}function lP(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,setControlId:a}=cP(),o=yT(t);return Y(()=>{if(!(!n&&!t||a===Rb)){if(n){let e=r?.current;G_(e)&&e.closest(`label`)!=null?a(t??null):a(i??o)}else t&&a(t);return()=>{t&&a(void 0)}}},[t,r,i,a,n,o]),i??o}var uP=(e,t)=>Object.is(e,t);function dP(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function fP(e,t,n){return!e||e.length===0?!1:e.some(e=>e===void 0?!1:dP(e,t,n))}function pP(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e===void 0?!1:dP(e,t,n))}function mP(e,t,n){return e.filter(e=>!dP(e,t,n))}function hP(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function gP(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function _P(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return hP(e)}function vP(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?hP(e.value):hP(e)}function yP(e,t,n){if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??_P(e,n);if(Array.isArray(t)){let r=gP(t)?t.flatMap(e=>e.items):t;if(e==null){let t=r.find(e=>e.value==null);return t&&t.label!=null?t.label:_P(e,n)}if(typeof e!=`object`){let t=r.find(t=>t&&t.value===e);return t&&t.label!=null?t.label:_P(e,n)}if(`value`in e){let t=r.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return _P(e,n)}function bP(e,t){return!Array.isArray(e)||e.length===0?``:e.map(e=>_P(e,t)).join(`, `)}var xP={id:Z(e=>e.id),modal:Z(e=>e.modal),multiple:Z(e=>e.multiple),items:Z(e=>e.items),itemToStringLabel:Z(e=>e.itemToStringLabel),itemToStringValue:Z(e=>e.itemToStringValue),isItemEqualToValue:Z(e=>e.isItemEqualToValue),value:Z(e=>e.value),open:Z(e=>e.open),mounted:Z(e=>e.mounted),forceMount:Z(e=>e.forceMount),transitionStatus:Z(e=>e.transitionStatus),touchModality:Z(e=>e.touchModality),activeIndex:Z(e=>e.activeIndex),selectedIndex:Z(e=>e.selectedIndex),isActive:Z((e,t)=>e.activeIndex===t),isSelected:Z((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>dP(e,n,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:dP(i,n,r)}),isSelectedByFocus:Z((e,t)=>e.selectedIndex===t),popupProps:Z(e=>e.popupProps),triggerProps:Z(e=>e.triggerProps),triggerElement:Z(e=>e.triggerElement),positionerElement:Z(e=>e.positionerElement),listElement:Z(e=>e.listElement),scrollUpArrowVisible:Z(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Z(e=>e.scrollDownArrowVisible),hasScrollArrows:Z(e=>e.hasScrollArrows),serializedValue:Z(e=>{let{multiple:t,value:n,itemToStringValue:r}=e;return t&&Array.isArray(n)&&n.length===0?``:vP(n,r)})},SP=W.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Rb,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function CP(){return W.useContext(SP)}function wP(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function TP(e){let{enabled:t=!0,value:n,id:r,name:i,controlRef:a,commit:o}=e,{formRef:s}=CP(),{invalid:c,markedDirtyRef:l,validityData:u,setValidityData:d}=oP(),f=X(e.getValue);Y(()=>{if(!t)return;let e=n;e===void 0&&(e=f()),u.initialValue===null&&e!==null&&d(t=>({...t,initialValue:e}))},[t,d,n,u.initialValue,f]),Y(()=>{!t||!r||s.current.fields.set(r,{getValue:f,name:i,controlRef:a,validityData:wP(u,c),validate(){let e=n;e===void 0&&(e=f()),l.current=!0,iS.flushSync(()=>o(e))}})},[o,a,t,s,f,r,c,l,i,u,n]),Y(()=>{let e=s.current.fields;return()=>{r&&e.delete(r)}},[s,r])}function EP(e,t){let n=W.useRef(e),r=X(t);Y(()=>{n.current!==e&&r(n.current)},[e,r]),Y(()=>{n.current=e},[e])}function DP(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,disabled:l=!1,readOnly:u=!1,required:d=!1,modal:f=!0,actionsRef:p,inputRef:m,onOpenChangeComplete:h,items:g,multiple:_=!1,itemToStringLabel:v,itemToStringValue:y,isItemEqualToValue:b=uP,highlightItemOnHover:x=!0,children:S}=e,{clearErrors:C}=CP(),{setDirty:w,shouldValidateOnChange:T,validityData:E,setFilled:D,name:O,disabled:k,validation:A}=oP(),{controlId:j}=cP(),M=lP({id:t}),N=k||l,P=O??c,[F,I]=ZN({controlled:n,default:_?r??zb:r,name:`Select`,state:`value`}),[L,R]=ZN({controlled:a,default:o,name:`Select`,state:`open`}),z=W.useRef([]),ee=W.useRef([]),te=W.useRef(null),B=W.useRef(null),V=W.useRef(0),H=W.useRef(null),ne=W.useRef([]),re=W.useRef(!1),ie=W.useRef(!1),ae=W.useRef(null),oe=W.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),se=W.useRef(!1),{mounted:ce,setMounted:le,transitionStatus:ue}=fw(L),U=P_(()=>new cw({id:M,modal:f,multiple:_,itemToStringLabel:v,itemToStringValue:y,isItemEqualToValue:b,value:F,open:L,mounted:ce,transitionStatus:ue,items:g,forceMount:!1,touchModality:!1,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,de=aw(U,xP.activeIndex),fe=aw(U,xP.selectedIndex),pe=aw(U,xP.triggerElement),me=aw(U,xP.positionerElement),he=W.useMemo(()=>_&&Array.isArray(F)&&F.length===0?``:vP(F,y),[_,F,y]),ge=dv(U.state.triggerElement);TP({id:M,commit:A.commit,value:F,controlRef:ge,name:P,getValue:()=>F});let _e=W.useRef(F);Y(()=>{F!==_e.current&&U.set(`forceMount`,!0)},[U,F]),Y(()=>{D(F!==null)},[F,D]),Y(function(){if(L)return;let e=ne.current;if(_){let t=Array.isArray(F)?F:[];if(t.length===0){U.set(`selectedIndex`,null);return}let n=t[t.length-1],r=pP(e,n,b);U.set(`selectedIndex`,r===-1?null:r);return}let t=pP(e,F,b);U.set(`selectedIndex`,t===-1?null:t)},[_,L,F,ne,b,U]),EP(F,()=>{C(P),w(F!==E.initialValue),T()?A.commit(F):A.commit(F,!0)});let ve=X((e,t)=>{if(s?.(e,t),!t.isCanceled&&(R(e),!e&&U.state.activeIndex!==null)){let e=z.current[U.state.activeIndex];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}}),ye=X(()=>{le(!1),U.set(`activeIndex`,null),h?.(!1)});mw({enabled:!p,open:L,ref:te,onComplete(){L||ye()}}),W.useImperativeHandle(p,()=>({unmount:ye}),[ye]);let be=X((e,t)=>{i?.(e,t),!t.isCanceled&&I(e)}),xe=X(()=>{let e=U.state.listElement||te.current;if(!e)return;let t=e.scrollTop,n=e.scrollTop+e.clientHeight,r=t>1,i=n<e.scrollHeight-1;U.state.scrollUpArrowVisible!==r&&U.set(`scrollUpArrowVisible`,r),U.state.scrollDownArrowVisible!==i&&U.set(`scrollDownArrowVisible`,i)}),Se=Cw({open:L,onOpenChange:ve,elements:{reference:pe,floating:me}}),{getReferenceProps:Ce,getFloatingProps:we,getItemProps:Te}=Rw([xS(Se,{enabled:!u&&!N,event:`mousedown`}),IC(Se,{bubbles:!1}),qw(Se,{enabled:!u&&!N,listRef:z,activeIndex:de,selectedIndex:fe,disabledIndices:zb,onNavigate(e){e===null&&!L||U.set(`activeIndex`,e)},focusItemOnHover:!1}),Xw(Se,{enabled:!u&&!N&&(L||!_),listRef:ee,activeIndex:de,selectedIndex:fe,onMatch(e){L?U.set(`activeIndex`,e):be(ne.current[e],ax(`none`))},onTypingChange(e){re.current=e}})]);XN(()=>{U.update({popupProps:we(),triggerProps:Ce()})}),Y(()=>{U.update({id:M,modal:f,multiple:_,value:F,open:L,mounted:ce,transitionStatus:ue,popupProps:we(),triggerProps:Ce(),items:g,itemToStringLabel:v,itemToStringValue:y,isItemEqualToValue:b})},[U,M,f,_,F,L,ce,ue,we,Ce,g,v,y,b]);let Ee=W.useMemo(()=>({store:U,name:P,required:d,disabled:N,readOnly:u,multiple:_,itemToStringLabel:v,itemToStringValue:y,highlightItemOnHover:x,setValue:be,setOpen:ve,listRef:z,popupRef:te,scrollHandlerRef:B,handleScrollArrowVisibility:xe,scrollArrowsMountedCountRef:V,getItemProps:Te,events:Se.context.events,valueRef:H,valuesRef:ne,labelsRef:ee,typingRef:re,selectionRef:oe,selectedItemTextRef:ae,validation:A,onOpenChangeComplete:h,keyboardActiveRef:ie,alignItemWithTriggerActiveRef:se,initialValueRef:_e}),[U,P,d,N,u,_,v,y,x,be,ve,Te,Se.context.events,A,h,xe]),De=dx(m,A.inputRef),Oe=_&&Array.isArray(F)&&F.length>0,ke=W.useMemo(()=>!_||!Array.isArray(F)||!P?null:F.map(e=>{let t=vP(e,y);return(0,G.jsx)(`input`,{type:`hidden`,name:P,value:t},t)}),[_,F,P,y]);return(0,G.jsx)(QN.Provider,{value:Ee,children:(0,G.jsxs)($N.Provider,{value:Se,children:[S,(0,G.jsx)(`input`,{...A.getInputValidationProps({onFocus(){U.state.triggerElement?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.value,n=ax(Kb,e.nativeEvent);function r(){if(_)return;let e=ne.current.find(e=>vP(e,y).toLowerCase()===t.toLowerCase());e!=null&&(w(e!==E.initialValue),be(e,n),T()&&A.commit(e))}U.set(`forceMount`,!0),queueMicrotask(r)}}),id:t||j||void 0,name:_?void 0:P,value:he,disabled:N,required:d&&!Oe,readOnly:u,ref:De,style:_x,tabIndex:-1,"aria-hidden":!0}),ke]})})}function OP(e){let t=e.getBoundingClientRect(),n=window.getComputedStyle(e,`::before`),r=window.getComputedStyle(e,`::after`);if(!(n.content!==`none`||r.content!==`none`))return t;let i=parseFloat(n.width)||0,a=parseFloat(n.height)||0,o=parseFloat(r.width)||0,s=parseFloat(r.height)||0,c=Math.max(t.width,i,o),l=Math.max(t.height,a,s),u=c-t.width,d=l-t.height;return{left:t.left-u/2,right:t.right+u/2,top:t.top-d/2,bottom:t.bottom+d/2}}var kP=2,AP={..._T,...iP,value:()=>null},jP=W.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,...o}=e,{setTouched:s,setFocused:c,validationMode:l,state:u,disabled:d}=oP(),{labelId:f}=cP(),{store:p,setOpen:m,selectionRef:h,validation:g,readOnly:_,alignItemWithTriggerActiveRef:v,disabled:y,keyboardActiveRef:b}=eP(),x=d||y||i,S=aw(p,xP.open),C=aw(p,xP.value),w=aw(p,xP.triggerProps),T=aw(p,xP.positionerElement),E=aw(p,xP.listElement),D=aw(p,xP.serializedValue),O=dv(T),k=W.useRef(null),A=z_(),j=z_(),{getButtonProps:M,buttonRef:N}=EN({disabled:x,native:a}),P=dx(t,k,N,X(e=>{p.set(`triggerElement`,e)})),F=z_(),I=z_();W.useEffect(()=>{if(S)return I.start(200,()=>{h.current.allowUnselectedMouseUp=!0,F.start(200,()=>{h.current.allowSelectedMouseUp=!0})}),()=>{F.clear(),I.clear()};h.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},j.clear()},[S,h,j,F,I]);let L=W.useMemo(()=>E?.id??Gv(T)?.id,[E,T]),R=Ux(w,{role:`combobox`,"aria-expanded":S?`true`:`false`,"aria-haspopup":`listbox`,"aria-controls":S?L:void 0,"aria-labelledby":f,"aria-readonly":_||void 0,tabIndex:x?-1:0,ref:P,onFocus(e){c(!0),S&&v.current&&m(!1,ax(Qb,e.nativeEvent)),A.start(0,()=>{p.set(`forceMount`,!0)})},onBlur(){s(!0),c(!1),l===`onBlur`&&g.commit(C)},onPointerMove({pointerType:e}){b.current=!1,p.set(`touchModality`,e===`touch`)},onPointerDown({pointerType:e}){p.set(`touchModality`,e===`touch`)},onKeyDown(){b.current=!0},onMouseDown(e){if(S)return;let t=Sx(e.currentTarget);function n(e){if(!k.current)return;let t=e.target;if(Lv(k.current,t)||Lv(O.current,t)||t===k.current)return;let n=OP(k.current);e.clientX>=n.left-kP&&e.clientX<=n.right+kP&&e.clientY>=n.top-kP&&e.clientY<=n.bottom+kP||m(!1,ax(tx,e))}j.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},g.getValidationProps,o,M);R.role=`combobox`;let z=W.useMemo(()=>({...u,open:S,disabled:x,value:C,readOnly:_,placeholder:!D}),[u,S,x,C,_,D]);return eS(`button`,e,{ref:[t,k],state:z,stateAttributesMapping:AP,props:R})}),MP={value:()=>null},NP=W.forwardRef(function(e,t){let{className:n,render:r,children:i,...a}=e,{store:o,valueRef:s}=eP(),c=aw(o,xP.value),l=aw(o,xP.items),u=aw(o,xP.itemToStringLabel),d=aw(o,xP.serializedValue),f=W.useMemo(()=>({value:c,placeholder:!d}),[c,d]),p=typeof i==`function`?i(c):i??(Array.isArray(c)?bP(c,u):yP(c,l,u));return eS(`span`,e,{state:f,ref:[t,s],props:[{children:p},a],stateAttributesMapping:MP})}),PP=W.forwardRef(function(e,t){let{className:n,render:r,...i}=e,{store:a}=eP(),o=aw(a,xP.open);return eS(`span`,e,{state:W.useMemo(()=>({open:o}),[o]),ref:t,props:[{"aria-hidden":!0,children:`▼`},i],stateAttributesMapping:gT})}),FP=W.createContext(void 0),IP=W.forwardRef(function(e,t){let{store:n}=eP(),r=aw(n,xP.mounted),i=aw(n,xP.forceMount);return r||i?(0,G.jsx)(FP.Provider,{value:!0,children:(0,G.jsx)(lS,{ref:t,...e})}):null}),LP=W.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function RP(){return W.useContext(LP)}function zP(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=X(i),o=W.useRef(0),s=P_(VP).current,c=P_(BP).current,[l,u]=W.useState(0),d=W.useRef(l),f=X((e,t)=>{c.set(e,t??null),d.current+=1,u(d.current)}),p=X(e=>{c.delete(e),d.current+=1,u(d.current)}),m=W.useMemo(()=>{let e=new Map;return Array.from(c.keys()).filter(e=>e.isConnected).sort(HP).forEach((t,n)=>{let r=c.get(t)??{};e.set(t,{...r,index:n})}),e},[c,l]);Y(()=>{if(typeof MutationObserver!=`function`||m.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(d.current+=1,u(d.current))});return m.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[m]),Y(()=>{d.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),o.current=m.size),a(m)},[a,m,n,r,l]),Y(()=>()=>{n.current=[]},[n]),Y(()=>()=>{r&&(r.current=[])},[r]);let h=X(e=>(s.add(e),()=>{s.delete(e)}));Y(()=>{s.forEach(e=>e(m))},[s,m]);let g=W.useMemo(()=>({register:f,unregister:p,subscribeMapChange:h,elementsRef:n,labelsRef:r,nextIndexRef:o}),[f,p,h,n,r,o]);return(0,G.jsx)(LP.Provider,{value:g,children:t})}function BP(){return new Map}function VP(){return new Set}function HP(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}var UP=W.createContext(void 0);function WP(){let e=W.useContext(UP);if(!e)throw Error(A_(59));return e}function GP(e,t){e&&Object.assign(e.style,t)}var KP={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},qP={position:`fixed`},JP=W.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=Ub,..._}=e,{store:v,listRef:y,labelsRef:b,alignItemWithTriggerActiveRef:x,selectedItemTextRef:S,valuesRef:C,initialValueRef:w,popupRef:T,setValue:E}=eP(),D=tP(),O=aw(v,xP.open),k=aw(v,xP.mounted),A=aw(v,xP.modal),j=aw(v,xP.value),M=aw(v,xP.touchModality),N=aw(v,xP.positionerElement),P=aw(v,xP.triggerElement),F=aw(v,xP.isItemEqualToValue),I=W.useRef(null),L=W.useRef(null),[R,z]=W.useState(h),ee=k&&R&&!M;!k&&R!==h&&z(h),Y(()=>{k||(xP.scrollUpArrowVisible(v.state)&&v.set(`scrollUpArrowVisible`,!1),xP.scrollDownArrowVisible(v.state)&&v.set(`scrollDownArrowVisible`,!1))},[v,k]),W.useImperativeHandle(x,()=>ee),pN((ee||A)&&O&&!M,P);let te=RT({anchor:n,floatingRootContext:D,positionMethod:r,mounted:k,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??ee,collisionAvoidance:g,keepMounted:!0}),B=ee?`none`:te.side,V=ee?qP:te.positionerStyles,H=W.useMemo(()=>{let e={};return O||(e.pointerEvents=`none`),{role:`presentation`,hidden:!k,style:{...V,...e}}},[O,k,V]),ne=W.useMemo(()=>({open:O,side:B,align:te.align,anchorHidden:te.anchorHidden}),[O,B,te.align,te.anchorHidden]),re=eS(`div`,e,{ref:[t,X(e=>{v.set(`positionerElement`,e)})],state:ne,stateAttributesMapping:vT,props:[H,_]}),ie=W.useRef(0),ae=X(e=>{if(e.size===0&&ie.current===0||C.current.length===0)return;let t=ie.current;if(ie.current=e.size,e.size===t)return;let n=ax(Kb);if(t!==0&&!v.state.multiple&&j!==null&&pP(C.current,j,F)===-1){let e=w.current,t=e!=null&&fP(C.current,e,F)?e:null;E(t,n),t===null&&(v.set(`selectedIndex`,null),S.current=null)}if(t!==0&&v.state.multiple&&Array.isArray(j)){let e=j.filter(e=>fP(C.current,e,F));(e.length!==j.length||e.some(e=>!fP(j,e,F)))&&(E(e,n),e.length===0&&(v.set(`selectedIndex`,null),S.current=null))}if(O&&ee){v.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};GP(N,e),GP(T.current,e)}}),oe=W.useMemo(()=>({...te,side:B,alignItemWithTriggerActive:ee,setControlledAlignItemWithTrigger:z,scrollUpArrowRef:I,scrollDownArrowRef:L}),[te,B,ee,z]);return(0,G.jsx)(zP,{elementsRef:y,labelsRef:b,onMapChange:ae,children:(0,G.jsxs)(UP.Provider,{value:oe,children:[k&&A&&(0,G.jsx)(PN,{inert:XT(!O),cutout:P}),re]})})});function YP(e){let t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}var XP=`base-ui-disable-scrollbar`,ZP={className:XP,element:(0,G.jsx)(`style`,{href:XP,precedence:`base-ui:low`,children:`.${XP}{scrollbar-width:none}.${XP}::-webkit-scrollbar{display:none}`})},QP={...vT,...cT},$P=W.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{store:a,popupRef:o,onOpenChangeComplete:s,setOpen:c,valueRef:l,selectedItemTextRef:u,keyboardActiveRef:d,multiple:f,handleScrollArrowVisibility:p,scrollHandlerRef:m}=eP(),{side:h,align:g,alignItemWithTriggerActive:_,setControlledAlignItemWithTrigger:v,scrollDownArrowRef:y,scrollUpArrowRef:b}=WP(),x=KN(!0)!=null,S=tP(),C=z_(),w=aw(a,xP.id),T=aw(a,xP.open),E=aw(a,xP.mounted),D=aw(a,xP.popupProps),O=aw(a,xP.transitionStatus),k=aw(a,xP.triggerElement),A=aw(a,xP.positionerElement),j=aw(a,xP.listElement),M=W.useRef(0),N=W.useRef(!1),P=W.useRef(0),F=W.useRef(!1),I=W.useRef({}),L=xx(),R=X(e=>{if(!A||!o.current||!F.current)return;if(N.current||!_){p();return}let t=A.style.top===`0px`,n=A.style.bottom===`0px`,r=A.getBoundingClientRect().height,i=Sx(A),a=getComputedStyle(A),s=parseFloat(a.marginTop),c=parseFloat(a.marginBottom),l=i.documentElement.clientHeight-s-c,u=e.scrollTop,d=e.scrollHeight-e.clientHeight,f=null,m=null,h=!1;if(t){let e=r+(d-u),t=Math.min(e,l);f=t,t===l?h=!0:m=d}else if(n){let e=u-0,t=r+e,n=Math.min(t,l),i=t-l;f=n,n===l?(h=!0,u<d&&(m=u-(e-i))):m=0}f!=null&&(A.style.height=`${f}px`),m!=null&&(e.scrollTop=m),h&&(N.current=!0),p()});W.useImperativeHandle(m,()=>R,[R]),mw({open:T,ref:o,onComplete(){T&&s?.(!0)}});let z=W.useMemo(()=>({open:T,transitionStatus:O,side:h,align:g}),[T,O,h,g]);Y(()=>{!A||!o.current||Object.keys(I.current).length||(I.current={top:A.style.top||`0`,left:A.style.left||`0`,right:A.style.right,height:A.style.height,bottom:A.style.bottom,minHeight:A.style.minHeight,maxHeight:A.style.maxHeight,marginTop:A.style.marginTop,marginBottom:A.style.marginBottom})},[o,A]),Y(()=>{E||_||(F.current=!1,N.current=!1,M.current=0,P.current=0,GP(A,I.current))},[E,_,A,o]),Y(()=>{let e=o.current;if(!(!E||!k||!A||!e)){if(!_){F.current=!0,L.request(p);return}queueMicrotask(()=>{let t=getComputedStyle(A),n=getComputedStyle(e),r=Sx(k),i=H_(A),a=k.getBoundingClientRect(),o=A.getBoundingClientRect(),s=a.left,c=a.height,d=j||e,f=d.scrollHeight,m=parseFloat(n.borderBottomWidth),h=parseFloat(t.marginTop)||10,g=parseFloat(t.marginBottom)||10,_=parseFloat(t.minHeight)||100,y=r.documentElement.clientHeight-h-g,b=r.documentElement.clientWidth,x=y-a.bottom+c,S=u.current,C=l.current,w=0,T=0;if(S&&C){let e=C.getBoundingClientRect(),t=S.getBoundingClientRect(),n=e.left-s,r=t.left-o.left,i=e.top-a.top+e.height/2,c=t.top-o.top+t.height/2;w=n-r,T=c-i}let E=x+T+g+m,D=Math.min(y,E),O=y-h-g,P=E-D,L=Math.max(5,s+w),R=b-5,z=Math.max(0,L+o.width-R);A.style.left=`${L-z}px`,A.style.height=`${D}px`,A.style.maxHeight=`auto`,A.style.marginTop=`${h}px`,A.style.marginBottom=`${g}px`,e.style.height=`100%`;let ee=d.scrollHeight-d.clientHeight,te=P>=ee;te&&(D=Math.min(y,o.height)-(P-ee));let B=a.top<20||a.bottom>y-20||D<Math.min(f,_),V=(i.visualViewport?.scale??1)!==1&&xv;if(B||V){F.current=!0,GP(A,I.current),iS.flushSync(()=>v(!1));return}if(te){let e=Math.max(0,y-E);A.style.top=o.height>=O?`0`:`${e}px`,A.style.height=`${D}px`,d.scrollTop=d.scrollHeight-d.clientHeight,M.current=Math.max(_,D)}else A.style.bottom=`0`,M.current=Math.max(_,D),d.scrollTop=P;M.current===y&&(N.current=!0),p(),setTimeout(()=>{F.current=!0})})}},[a,E,A,k,l,u,o,p,_,v,L,y,b,j]),W.useEffect(()=>{if(!_||!A||!E)return;let e=H_(A);function t(e){c(!1,ax(ix,e))}return e.addEventListener(`resize`,t),()=>{e.removeEventListener(`resize`,t)}},[c,_,A,E]);let ee={...j?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":f||void 0,id:`${w}-list`},onKeyDown(e){d.current=!0,x&&WN.has(e.key)&&e.stopPropagation()},onMouseMove(){d.current=!1},onPointerLeave(e){if(YP(e)||e.pointerType===`touch`)return;let t=e.currentTarget;C.start(0,()=>{a.set(`activeIndex`,null),t.focus({preventScroll:!0})})},onScroll(e){j||m.current?.(e.currentTarget)},..._&&{style:j?{height:`100%`}:KP}},te=eS(`div`,e,{ref:[t,o],state:z,stateAttributesMapping:QP,props:[D,ee,BT(O),{className:!j&&_?ZP.className:void 0},i]});return(0,G.jsxs)(W.Fragment,{children:[ZP.element,(0,G.jsx)(bS,{context:S,modal:!1,disabled:!E,restoreFocus:!0,children:te})]})}),eF=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function tF(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=RP(),f=W.useRef(-1),[p,m]=W.useState(a??(i===eF.GuessFromOrder?()=>{if(f.current===-1){let e=d.current;d.current+=1,f.current=e}return f.current}:-1)),h=W.useRef(null),g=W.useCallback(e=>{if(h.current=e,p!==-1&&e!==null&&(l.current[p]=e,u)){let n=t!==void 0;u.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,l,u,t,r]);return Y(()=>{if(a!=null)return;let e=h.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),Y(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&m(t)})},[a,c,m]),W.useMemo(()=>({ref:g,index:p}),[p,g])}var nF=W.createContext(void 0);function rF(){let e=W.useContext(nF);if(!e)throw Error(A_(57));return e}var iF=W.memo(W.forwardRef(function(e,t){let{render:n,className:r,value:i=null,label:a,disabled:o=!1,nativeButton:s=!1,...c}=e,l=W.useRef(null),u=tF({label:a,textRef:l,indexGuessBehavior:eF.GuessFromOrder}),{store:d,getItemProps:f,setOpen:p,setValue:m,selectionRef:h,typingRef:g,valuesRef:_,keyboardActiveRef:v,multiple:y,highlightItemOnHover:b}=eP(),x=z_(),S=aw(d,xP.isActive,u.index),C=aw(d,xP.isSelected,u.index,i),w=aw(d,xP.isSelectedByFocus,u.index),T=aw(d,xP.isItemEqualToValue),E=u.index,D=E!==-1,O=W.useRef(null),k=dv(E);Y(()=>{if(!D)return;let e=_.current;return e[E]=i,()=>{delete e[E]}},[D,E,i,_]),Y(()=>{if(!D)return;let e=d.state.value,t=e;y&&Array.isArray(e)&&e.length>0&&(t=e[e.length-1]),t!==void 0&&dP(t,i,T)&&d.set(`selectedIndex`,E)},[D,E,y,T,d,i]);let A=W.useMemo(()=>({disabled:o,selected:C,highlighted:S}),[o,C,S]),j=f({active:S,selected:C});j.onFocus=void 0,j.id=void 0;let M=W.useRef(null),N=W.useRef(`mouse`),P=W.useRef(!1),{getButtonProps:F,buttonRef:I}=EN({disabled:o,focusableWhenDisabled:!0,native:s});function L(e){let t=d.state.value;if(y){let n=Array.isArray(t)?t:[];m(C?mP(n,i,T):[...n,i],ax(Zb,e))}else m(i,ax(Zb,e)),p(!1,ax(Zb,e))}let R={role:`option`,"aria-selected":C,"aria-disabled":o||void 0,tabIndex:S?0:-1,onFocus(){d.set(`activeIndex`,E)},onMouseEnter(){!v.current&&d.state.selectedIndex===null&&d.set(`activeIndex`,E)},onMouseMove(){b&&d.set(`activeIndex`,E)},onMouseLeave(e){!b||v.current||YP(e)||x.start(0,()=>{d.state.activeIndex===E&&d.set(`activeIndex`,null)})},onTouchStart(){h.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(e){M.current=e.key,d.set(`activeIndex`,E)},onClick(e){P.current=!1,!(e.type===`keydown`&&M.current===null)&&(o||M.current===` `&&g.current||N.current!==`touch`&&!S||(M.current=null,L(e.nativeEvent)))},onPointerEnter(e){N.current=e.pointerType},onPointerDown(e){N.current=e.pointerType,P.current=!0},onMouseUp(e){if(o)return;if(P.current){P.current=!1;return}let t=!h.current.allowSelectedMouseUp&&C,n=!h.current.allowUnselectedMouseUp&&!C;t||n||N.current!==`touch`&&!S||L(e.nativeEvent)}},z=eS(`div`,e,{ref:[I,t,u.ref,O],state:A,props:[j,R,c,F]}),ee=W.useMemo(()=>({selected:C,indexRef:k,textRef:l,selectedByFocus:w,hasRegistered:D}),[C,k,l,w,D]);return(0,G.jsx)(nF.Provider,{value:ee,children:z})})),aF=W.forwardRef(function(e,t){let n=e.keepMounted??!1,{selected:r}=rF();return n||r?(0,G.jsx)(oF,{...e,ref:t}):null}),oF=W.memo(W.forwardRef((e,t)=>{let{render:n,className:r,keepMounted:i,...a}=e,{selected:o}=rF(),s=W.useRef(null),{transitionStatus:c,setMounted:l}=fw(o),u=W.useMemo(()=>({selected:o,transitionStatus:c}),[o,c]),d=eS(`span`,e,{ref:[t,s],state:u,props:[{"aria-hidden":!0,children:`✔️`},a],stateAttributesMapping:cT});return mw({open:o,ref:s,onComplete(){o||l(!1)}}),d})),sF=W.memo(W.forwardRef(function(e,t){let{indexRef:n,textRef:r,selectedByFocus:i,hasRegistered:a}=rF(),{selectedItemTextRef:o}=eP(),{className:s,render:c,...l}=e;return eS(`div`,e,{ref:[W.useCallback(e=>{if(!e||!a)return;let t=o.current===null||!o.current.isConnected;(i||t&&n.current===0)&&(o.current=e)},[o,n,i,a]),t,r],props:l})}));function cF({value:e,onValueChange:t,options:n,ariaLabel:r,className:i}){return(0,G.jsxs)(DP,{value:e,onValueChange:e=>t(e),modal:!1,children:[(0,G.jsxs)(jP,{className:`ui-select-trigger ${i??``}`,"aria-label":r,children:[(0,G.jsx)(NP,{children:e=>n.find(t=>t.value===e)?.label??e}),(0,G.jsx)(PP,{className:`ui-select-icon`,children:(0,G.jsx)(SM,{size:12})})]}),(0,G.jsx)(IP,{children:(0,G.jsx)(JP,{className:`ui-select-positioner`,sideOffset:4,align:`end`,side:`bottom`,alignItemWithTrigger:!1,children:(0,G.jsx)($P,{className:`ui-select-popup`,children:n.map(e=>(0,G.jsxs)(iF,{value:e.value,className:`ui-select-item`,children:[(0,G.jsx)(sF,{children:e.label}),(0,G.jsx)(aF,{className:`ui-select-indicator`,children:(0,G.jsx)(yM,{size:13})})]},e.value))})})})]})}function lF({comments:e,onEditComment:t,onDeleteComment:n,onSend:r,sending:i,agentWaiting:a}){let{haptic:o,sound:s}=oM(),[c,l]=(0,W.useState)(!1),[u,d]=(0,W.useState)(``),f=e.length,p=(0,W.useMemo)(()=>[...e].sort((e,t)=>e.createdAt-t.createdAt),[e]);(0,W.useEffect)(()=>{c&&f===0&&l(!1)},[c,f]);let m=async()=>{o(`heavy`),s(`send`),await r(u),d(``),l(!1)};return(0,G.jsx)(YN,{open:c,onOpenChange:l,ariaLabel:`Review comments before sending to agent`,className:`send-review-popover`,trigger:(0,G.jsxs)(`button`,{className:`btn btn-primary btn-sm`,disabled:f===0||i,title:a?`An agent is connected and waiting`:`Review and send comments to a waiting agent`,children:[a&&(0,G.jsx)(`span`,{className:`agent-waiting-dot`,"aria-hidden":`true`}),i?`Sending…`:`Send to agent (${f})`]}),children:(0,G.jsxs)(`div`,{className:`srp`,children:[(0,G.jsxs)(`div`,{className:`srp-head`,children:[(0,G.jsx)(vM,{size:15,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`srp-title`,children:`Send review to agent`}),(0,G.jsxs)(`span`,{className:`srp-count`,children:[f,` comment`,f===1?``:`s`]})]}),(0,G.jsx)(`ul`,{className:`srp-list`,"aria-label":`Comments to send`,children:p.map(e=>(0,G.jsx)(uF,{comment:e,onEdit:t,onDelete:n},e.id))}),(0,G.jsxs)(`div`,{className:`srp-general`,children:[(0,G.jsxs)(`label`,{className:`srp-general-label`,htmlFor:`srp-general-input`,children:[`Overall comment `,(0,G.jsx)(`span`,{className:`srp-optional`,children:`(optional)`})]}),(0,G.jsx)(`textarea`,{id:`srp-general-input`,className:`srp-general-input`,value:u,placeholder:`Add an overall note for the agent that applies to the whole review…`,rows:3,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),m())}})]}),(0,G.jsxs)(`div`,{className:`srp-footer`,children:[(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>l(!1),disabled:i,children:`Cancel`}),(0,G.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:m,disabled:f===0||i,children:i?`Sending…`:`Send ${f} comment${f===1?``:`s`}`})]})]})})}function uF({comment:e,onEdit:t,onDelete:n}){let[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(e.body),s=(0,W.useRef)(null);(0,W.useEffect)(()=>{r&&(s.current?.focus(),s.current?.select())},[r]);let c=e.lineNumber>0?e.startLineNumber&&e.startLineNumber!==e.lineNumber?`:${e.startLineNumber}-${e.lineNumber}`:`:${e.lineNumber}`:` · file`,l=()=>{let n=a.trim();n&&n!==e.body&&t(e.id,n),i(!1)};return(0,G.jsxs)(`li`,{className:`srp-item`,children:[(0,G.jsxs)(`div`,{className:`srp-item-top`,children:[(0,G.jsxs)(`span`,{className:`srp-item-loc`,children:[(0,G.jsx)(`span`,{className:`srp-item-file`,children:fj(e.filePath)}),(0,G.jsx)(`span`,{className:`srp-item-line`,children:c})]}),e.status===`resolved`&&(0,G.jsx)(`span`,{className:`srp-item-resolved`,children:`resolved`}),(0,G.jsxs)(`span`,{className:`srp-item-actions`,children:[r?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`button`,{className:`srp-icon-btn`,onClick:l,title:`Save edit`,children:(0,G.jsx)(yM,{size:13,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`srp-icon-btn`,onClick:()=>{o(e.body),i(!1)},title:`Cancel edit`,children:(0,G.jsx)(aN,{size:13,"aria-hidden":`true`})})]}):(0,G.jsx)(`button`,{className:`srp-icon-btn`,onClick:()=>i(!0),title:`Edit comment`,children:(0,G.jsx)(GM,{size:13,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`srp-icon-btn srp-icon-btn-danger`,onClick:()=>n(e.id),title:`Remove from review`,children:(0,G.jsx)(eN,{size:13,"aria-hidden":`true`})})]})]}),e.lineContent?.trim()&&(0,G.jsx)(`code`,{className:`srp-item-code`,children:e.lineContent.trim().slice(0,160)}),r?(0,G.jsx)(`textarea`,{ref:s,className:`srp-item-edit`,value:a,rows:2,onChange:e=>o(e.target.value),onKeyDown:t=>{t.key===`Enter`&&(t.metaKey||t.ctrlKey)?(t.preventDefault(),l()):t.key===`Escape`&&(t.preventDefault(),o(e.body),i(!1))}}):(0,G.jsx)(`p`,{className:`srp-item-body`,children:e.body})]})}var dF=[{value:`word`,label:`Word`},{value:`word-alt`,label:`Word (alt)`},{value:`char`,label:`Character`},{value:`none`,label:`None`}],fF=[{value:`classic`,label:`Classic (+/−)`},{value:`bars`,label:`Bars`},{value:`none`,label:`None`}],pF=[{value:`line-info`,label:`Line info + context`},{value:`line-info-basic`,label:`Line info`},{value:`metadata`,label:`Metadata only`},{value:`simple`,label:`Simple`}],mF=[{value:`both`,label:`Both`},{value:`line`,label:`Line only`},{value:`number`,label:`Number only`},{value:`disabled`,label:`Disabled`}],hF=[11,12,13,14,15,16].map(e=>({value:String(e),label:`${e}px`})),gF=[2,4,8].map(e=>({value:String(e),label:String(e)})),_F=[{value:``,label:`Default`},{value:`chrome`,label:`Chrome`},{value:`firefox`,label:`Firefox`},{value:`edge`,label:`Edge`},{value:`brave`,label:`Brave`}],vF=[{value:`default`,label:`Default / System`},{value:`vscode`,label:`VS Code`},{value:`zed`,label:`Zed`},{value:`vim`,label:`Vim`},{value:`neovim`,label:`Neovim`}],yF=(0,W.memo)(function({repoName:e,branch:t,fileCount:n,additions:r,deletions:i,commentCount:a,diffStyle:o,diffOptions:s,defaultTabSize:c,browser:l,theme:u,editorIDE:d,customMode:f,lineDiffType:p,lineWrap:m,diffIndicators:h,showLineNumbers:g,hunkSeparators:_,lineHoverHighlight:v,fontSize:y,haptics:b,sounds:x,onDiffStyleChange:S,onDiffOptionsChange:C,onDefaultTabSizeChange:w,onBrowserChange:T,onOpenThemeModal:E,onEditorIDEChange:D,onLineDiffTypeChange:O,onLineWrapChange:k,onDiffIndicatorsChange:A,onShowLineNumbersChange:j,onHunkSeparatorsChange:M,onLineHoverHighlightChange:N,onFontSizeChange:P,onHapticsChange:F,onSoundsChange:I,onOpenSearch:L,onCopyComments:R,onSendToAgent:z,agentWaiting:ee,sending:te,comments:B,onEditComment:V,onDeleteComment:H}){let[ne,re]=(0,W.useState)(!1),[ie,ae]=(0,W.useState)(!1);return(0,W.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`,`&&(e.preventDefault(),ae(e=>!e))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,G.jsxs)(`div`,{className:`toolbar`,children:[(0,G.jsxs)(`div`,{className:`toolbar-left`,children:[(0,G.jsx)(`h1`,{className:`toolbar-title`,children:e}),t&&(0,G.jsxs)(`span`,{className:`toolbar-branch`,children:[(0,G.jsx)(jM,{size:12}),t]}),(0,G.jsxs)(`span`,{className:`toolbar-stat`,children:[n,` file`,n===1?``:`s`,` changed`,r>0&&(0,G.jsxs)(`span`,{className:`stat-additions`,children:[` +`,r]}),i>0&&(0,G.jsxs)(`span`,{className:`stat-deletions`,children:[` -`,i]})]})]}),(0,G.jsxs)(`div`,{className:`toolbar-right`,children:[(0,G.jsxs)(`button`,{className:`btn btn-sm toolbar-search-btn`,onClick:L,title:`Search (⌘K)`,children:[(0,G.jsx)(XM,{size:14,style:{marginRight:`6px`}}),(0,G.jsx)(`span`,{children:`Search`}),(0,G.jsx)(`kbd`,{className:`toolbar-search-kbd`,children:`⌘K`})]}),(0,G.jsxs)(`div`,{className:`toolbar-toggle`,children:[(0,G.jsx)(`button`,{className:`btn btn-sm ${o===`split`?`btn-active`:``}`,onClick:()=>S(`split`),children:`Split`}),(0,G.jsx)(`button`,{className:`btn btn-sm ${o===`unified`?`btn-active`:``}`,onClick:()=>S(`unified`),children:`Unified`})]}),(0,G.jsxs)(`button`,{className:`btn btn-sm settings-btn flex-1`,title:`Switch Theme`,onClick:E,children:[(0,G.jsx)(VM,{size:14,style:{marginRight:`6px`}}),(0,G.jsx)(`span`,{children:`Theme`})]}),(0,G.jsx)(YN,{open:ie,onOpenChange:ae,ariaLabel:`Settings`,className:`settings-popover`,trigger:(0,G.jsx)(`button`,{className:`btn btn-sm settings-btn ${ie?`btn-active`:``}`,title:`Settings`,children:(0,G.jsx)(ZM,{size:14})}),children:(0,G.jsxs)(`div`,{className:`popover-scroll settings-panel`,children:[!f&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Source`}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:s.staged,onChange:e=>C({...s,staged:e.target.checked})}),`Show staged`]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:s.untracked,onChange:e=>C({...s,untracked:e.target.checked})}),`Show untracked`]})]}),(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Display`}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Inline diff`}),(0,G.jsx)(cF,{value:p,onValueChange:e=>O(e),options:dF,ariaLabel:`Inline diff style`})]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>k(e.target.checked)}),`Wrap long lines`]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Diff indicators`}),(0,G.jsx)(cF,{value:h,onValueChange:e=>A(e),options:fF,ariaLabel:`Diff indicators`})]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:g,onChange:e=>j(e.target.checked)}),`Show line numbers`]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Hunk separator`}),(0,G.jsx)(cF,{value:_,onValueChange:e=>M(e),options:pF,ariaLabel:`Hunk separator style`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Hover highlight`}),(0,G.jsx)(cF,{value:v,onValueChange:e=>N(e),options:mF,ariaLabel:`Hover highlight`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Font size`}),(0,G.jsx)(cF,{value:String(y),onValueChange:e=>P(Number(e)),options:hF,ariaLabel:`Font size`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Default tab size`}),(0,G.jsx)(cF,{value:String(c),onValueChange:e=>w(Number(e)),options:gF,ariaLabel:`Default tab size`})]}),(0,G.jsx)(`div`,{className:`settings-section-label`,children:`External tools`}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Browser`}),(0,G.jsx)(cF,{value:l||``,onValueChange:T,options:_F,ariaLabel:`Browser`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Preferred IDE`}),(0,G.jsx)(cF,{value:d||`default`,onValueChange:D,options:vF,ariaLabel:`Preferred IDE`})]}),(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Feedback`}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:b,onChange:e=>F(e.target.checked)}),`Haptic feedback`]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:x,onChange:e=>I(e.target.checked)}),`Sound effects`]})]})}),(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:async()=>{await R(),re(!0),setTimeout(()=>re(!1),2e3)},disabled:a===0,children:ne?`Copied!`:`Copy comments (${a})`}),(0,G.jsx)(lF,{comments:B,onEditComment:V,onDeleteComment:H,onSend:z,sending:te,agentWaiting:ee})]})]})}),bF=W.createContext(void 0);function xF(e){let t=W.useContext(bF);if(e===!1&&t===void 0)throw Error(A_(27));return t}var SF={...vT,...cT},CF=W.forwardRef(function(e,t){let{render:n,className:r,forceRender:i=!1,...a}=e,{store:o}=xF(),s=o.useState(`open`),c=o.useState(`nested`),l=o.useState(`mounted`),u=o.useState(`transitionStatus`);return eS(`div`,e,{state:W.useMemo(()=>({open:s,transitionStatus:u}),[s,u]),ref:[o.context.backdropRef,t],stateAttributesMapping:SF,props:[{role:`presentation`,hidden:!l,style:{userSelect:`none`,WebkitUserSelect:`none`}},a],enabled:i||!c})}),wF=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),TF=function(e){return e[e.open=lT.open]=`open`,e[e.closed=lT.closed]=`closed`,e[e.startingStyle=lT.startingStyle]=`startingStyle`,e[e.endingStyle=lT.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),EF=W.createContext(void 0);function DF(){let e=W.useContext(EF);if(e===void 0)throw Error(A_(26));return e}var OF={...vT,...cT,nestedDialogOpen(e){return e?{[TF.nestedDialogOpen]:``}:null}},kF=W.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,...o}=e,{store:s}=xF(),c=s.useState(`descriptionElementId`),l=s.useState(`disablePointerDismissal`),u=s.useState(`floatingRootContext`),d=s.useState(`popupProps`),f=s.useState(`modal`),p=s.useState(`mounted`),m=s.useState(`nested`),h=s.useState(`nestedOpenDialogCount`),g=s.useState(`open`),_=s.useState(`openMethod`),v=s.useState(`titleElementId`),y=s.useState(`transitionStatus`),b=s.useState(`role`);DF(),mw({open:g,ref:s.context.popupRef,onComplete(){g&&s.context.onOpenChangeComplete?.(!0)}});function x(e){return e===`touch`?s.context.popupRef.current:!0}let S=i===void 0?x:i,C=h>0,w=eS(`div`,e,{state:W.useMemo(()=>({open:g,nested:m,transitionStatus:y,nestedDialogOpen:C}),[g,m,y,C]),props:[d,{"aria-labelledby":v??void 0,"aria-describedby":c??void 0,role:b,tabIndex:-1,hidden:!p,onKeyDown(e){WN.has(e.key)&&e.stopPropagation()},style:{[wF.nestedDialogs]:h}},o],ref:[t,s.context.popupRef,s.useStateSetter(`popupElement`)],stateAttributesMapping:OF});return(0,G.jsx)(bS,{context:u,openInteractionType:_,disabled:!p,closeOnFocusOut:!l,initialFocus:S,returnFocus:r,modal:f!==!1,restoreFocus:`popup`,children:w})}),AF=W.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=xF(),a=i.useState(`mounted`),o=i.useState(`modal`);return a||n?(0,G.jsx)(EF.Provider,{value:n,children:(0,G.jsxs)(lS,{ref:t,...r,children:[a&&o===!0&&(0,G.jsx)(PN,{ref:i.context.internalBackdropRef,inert:XT(!open)}),e.children]})}):null});function jF(e){let{store:t,parentContext:n,actionsRef:r}=e,i=t.useState(`open`),a=t.useState(`disablePointerDismissal`),o=t.useState(`modal`),s=t.useState(`popupElement`),{openMethod:c,triggerProps:l,reset:u}=bN(i);_w(t);let{forceUnmount:d}=vw(i,t,()=>{u()}),f=X(e=>{let n=ax(e);return n.preventUnmountOnClose=()=>{t.set(`preventUnmountingOnClose`,!0)},n}),p=W.useCallback(()=>{t.setOpen(!1,f(rx))},[t,f]);W.useImperativeHandle(r,()=>({unmount:d,close:p}),[d,p]);let m=Tw({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[h,g]=W.useState(0),_=h===0,v=Yw(m),y=IC(m,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=Rv(e);if(_&&!a){let e=n;return o&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||Lv(e,s)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:_});pN(i&&o===!0,s);let{getReferenceProps:b,getFloatingProps:x,getTriggerProps:S}=Rw([v,y]);t.useContextCallback(`onNestedDialogOpen`,e=>{g(e+1)}),t.useContextCallback(`onNestedDialogClose`,()=>{g(0)}),W.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(h),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,h]);let C=W.useMemo(()=>b(l),[b,l]),w=W.useMemo(()=>S(l),[S,l]),T=W.useMemo(()=>x(),[x]);t.useSyncedValues({openMethod:c,activeTriggerProps:C,inactiveTriggerProps:w,popupProps:T,floatingRootContext:m,nestedOpenDialogCount:h})}var MF={...Sw,modal:Z(e=>e.modal),nested:Z(e=>e.nested),nestedOpenDialogCount:Z(e=>e.nestedOpenDialogCount),disablePointerDismissal:Z(e=>e.disablePointerDismissal),openMethod:Z(e=>e.openMethod),descriptionElementId:Z(e=>e.descriptionElementId),titleElementId:Z(e=>e.titleElementId),viewportElement:Z(e=>e.viewportElement),role:Z(e=>e.role)},NF=class extends lw{constructor(e){super(PF(e),{popupRef:W.createRef(),backdropRef:W.createRef(),internalBackdropRef:W.createRef(),triggerElements:new yw,onOpenChange:void 0,onOpenChangeComplete:void 0},MF)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;let n={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit(`openchange`,n);let r={open:e},i=t.trigger?.id??null;(i||e)&&(r.activeTriggerId=i,r.activeTriggerElement=t.trigger??null),this.update(r)}};function PF(e={}){return{...xw(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:`dialog`,...e}}function FF(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=xF(!0),p=!!f,m=P_(()=>l?.store??new NF({open:n??r,activeTriggerId:u===void 0?d:u,modal:s,disablePointerDismissal:o,nested:p})).current;m.useControlledProp(`open`,n,r),m.useControlledProp(`activeTriggerId`,u,d),m.useSyncedValues({disablePointerDismissal:o,nested:p,modal:s}),m.useContextCallback(`onOpenChange`,i),m.useContextCallback(`onOpenChangeComplete`,a);let h=m.useState(`payload`);jF({store:m,actionsRef:c,parentContext:f?.store.context,onOpenChange:i,triggerIdProp:u});let g=W.useMemo(()=>({store:m}),[m]);return(0,G.jsx)(bF.Provider,{value:g,children:typeof t==`function`?t({payload:h}):t})}function IF({open:e,onClose:t,className:n,ariaLabel:r,initialFocus:i,onKeyDown:a,children:o}){return(0,G.jsx)(FF,{open:e,onOpenChange:e=>{e||t()},children:(0,G.jsxs)(AF,{children:[(0,G.jsx)(CF,{className:`ui-modal-backdrop`}),(0,G.jsx)(kF,{className:`ui-modal-popup ${n??``}`,"aria-label":r,initialFocus:i,onKeyDown:a,children:o})]})})}async function LF(e,t){let n=await fetch(`/api/file-text?path=${encodeURIComponent(e)}&version=${t}`);if(!n.ok){if(n.status===404)return null;throw Error(`HTTP ${n.status} fetching ${t} ${e}`)}let r=await n.json();if(r.missing)return null;if(r.error)throw Error(r.error);return r.content??``}function RF(e,t){let[n,r]=(0,W.useState)({loading:!1,error:null,oldContent:null,newContent:null});return(0,W.useEffect)(()=>{if(!t||!e)return;let n=!1;return r(e=>({...e,loading:!0,error:null})),Promise.all([LF(e,`old`),LF(e,`new`)]).then(([e,t])=>{n||r({loading:!1,error:null,oldContent:e,newContent:t})}).catch(e=>{n||r({loading:!1,error:e.message,oldContent:null,newContent:null})}),()=>{n=!0}},[e,t]),n}var zF=`diffing-draft-`,BF=10080*60*1e3;function VF(...e){return zF+e.join(`:`)}function HF(...e){try{let t=localStorage.getItem(VF(...e));if(!t)return null;let n=JSON.parse(t);return Date.now()-n.timestamp>BF?(localStorage.removeItem(VF(...e)),null):n.body}catch{return null}}var UF={};function WF(e,...t){let n=VF(...t);UF[n]&&clearTimeout(UF[n]),UF[n]=setTimeout(()=>{GF(e,...t),delete UF[n]},500)}function GF(e,...t){let n=VF(...t);try{e.trim()?localStorage.setItem(n,JSON.stringify({body:e,timestamp:Date.now()})):localStorage.removeItem(n)}catch{}}function KF(...e){try{localStorage.removeItem(VF(...e))}catch{}}function qF({initialBody:e,lineContent:t,draftKey:n,onSubmit:r,onCancel:i}){let{haptic:a,sound:o}=oM(),[s,c]=(0,W.useState)(()=>{if(n){let e=HF(n);if(e)return e}return e||``}),[l,u]=(0,W.useState)(`write`),d=(0,W.useRef)(null);(0,W.useEffect)(()=>{l===`write`&&d.current?.focus()},[l]),(0,W.useEffect)(()=>{n&&WF(s,n)},[s,n]);let f=()=>{let e=s.trim();e&&(n&&KF(n),a(`success`),o(`success`),r(e))},p=e=>{if(e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),f()),e.key===`Escape`){if(s.includes(`
1966
- `))return;i()}},m=async e=>{let t=e.clipboardData.items,n=null;for(let e=0;e<t.length;e++){let r=t[e];if(r.kind===`file`&&r.type.startsWith(`image/`)){n=r.getAsFile();break}}if(!n)return;e.preventDefault();let r=d.current;if(!r)return;let i=r.selectionStart,a=r.selectionEnd,o=Math.random().toString(36).slice(2,8),s=`![Uploading image… ${o}]()`,l=r.value;c(l.slice(0,i)+s+l.slice(a));try{let e=new FormData;e.append(`file`,n,n.name||`pasted-${o}.png`);let t=await fetch(`/api/attachments`,{method:`POST`,body:e});if(!t.ok)throw Error(`HTTP ${t.status}`);let r=await t.json();if(!r.url)throw Error(r.error||`Upload failed`);let i=`![pasted image](${r.url})`;c(e=>e.replace(s,i))}catch(e){console.error(`Image upload failed:`,e),c(e=>e.replace(s,`![upload failed]()`))}};return(0,G.jsxs)(`div`,{className:`comment-form`,style:{padding:`16px`},role:`form`,"aria-label":`Comment form`,children:[(0,G.jsxs)(`div`,{className:`comment-form-tabs`,role:`tablist`,"aria-label":`Comment form mode`,children:[(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":l===`write`,"aria-controls":`comment-write-panel`,onClick:()=>u(`write`),onKeyDown:e=>{e.key===`ArrowRight`&&(e.preventDefault(),u(`preview`))},className:`comment-form-tab-btn ${l===`write`?`comment-form-tab-btn-active`:`comment-form-tab-btn-inactive`}`,children:`Write`}),(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":l===`preview`,"aria-controls":`comment-preview-panel`,onClick:()=>u(`preview`),onKeyDown:e=>{e.key===`ArrowLeft`&&(e.preventDefault(),u(`write`))},className:`comment-form-tab-btn ${l===`preview`?`comment-form-tab-btn-active`:`comment-form-tab-btn-inactive`}`,children:`Preview`})]}),l===`write`?(0,G.jsx)(`textarea`,{id:`comment-write-panel`,ref:d,value:s,onChange:e=>c(e.target.value),onKeyDown:p,onPaste:m,placeholder:`Leave a review comment (supports Markdown and Pasting Clipboard Images)...`,rows:4,"aria-label":`Comment body`,style:{minHeight:`100px`}}):(0,G.jsxs)(`div`,{id:`comment-preview-panel`,role:`tabpanel`,"aria-label":`Preview`,style:{display:`flex`,flexDirection:`column`,gap:`12px`},children:[(()=>{let e=!!s.match(/```suggestion\n([\s\S]*?)```/);return s.replace(/```suggestion\n([\s\S]*?)```/g,``).trim().length>0||!e?(0,G.jsx)(`div`,{className:`comment-preview markdown-body`,style:{minHeight:`100px`,padding:`12px 16px`,border:`1px solid var(--border-normal)`,borderRadius:`var(--radius-md)`,background:`var(--bg-primary)`,fontSize:`14px`,lineHeight:1.6,color:`var(--text-primary)`,overflowY:`auto`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,overflowWrap:`break-word`},dangerouslySetInnerHTML:{__html:s.trim()?mj(s):`<span style="color: var(--text-muted); font-style: italic;">Nothing to preview</span>`}}):null})(),(()=>{let e=s.match(/```suggestion\n([\s\S]*?)```/),n=!!e,r=e?e[1].trimEnd():``;return n?(0,G.jsxs)(`div`,{className:`suggestion-card`,style:{border:`1px solid var(--border-normal)`,borderRadius:`var(--radius-md)`,overflow:`hidden`,background:`var(--bg-primary)`,boxShadow:`var(--shadow-sm)`},children:[(0,G.jsx)(`div`,{className:`suggestion-header`,style:{padding:`8px 12px`,background:`var(--bg-secondary)`,borderBottom:`1px solid var(--border-normal)`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,fontSize:`12px`,fontWeight:600},children:(0,G.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Suggested Change Preview`})}),(0,G.jsxs)(`div`,{className:`suggestion-diff`,style:{display:`flex`,flexDirection:`column`,fontSize:`12px`,fontFamily:`var(--font-mono)`,overflowX:`auto`},children:[t&&(0,G.jsxs)(`div`,{style:{display:`flex`,padding:`8px 12px`,background:`var(--feedback-danger-bg)`,borderBottom:`1px dashed var(--border-color)`,color:`var(--feedback-danger-text)`,minWidth:`max-content`},children:[(0,G.jsx)(`span`,{style:{width:`20px`,userSelect:`none`,opacity:.5},children:`-`}),(0,G.jsx)(`span`,{style:{whiteSpace:`pre`},children:t})]}),(0,G.jsxs)(`div`,{style:{display:`flex`,padding:`8px 12px`,background:`var(--feedback-success-bg)`,color:`var(--feedback-success-text)`,minWidth:`max-content`},children:[(0,G.jsx)(`span`,{style:{width:`20px`,userSelect:`none`,opacity:.5},children:`+`}),(0,G.jsx)(`span`,{style:{whiteSpace:`pre`},children:r})]})]})]}):null})()]}),(0,G.jsxs)(`div`,{className:`comment-form-actions`,style:{display:`flex`,justifyContent:`flex-end`,gap:`8px`,marginTop:`12px`},children:[(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:i,children:`Cancel`}),(0,G.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:f,disabled:!s.trim(),children:e?`Save`:`Comment`})]})]})}function JF(e,t,n){if(t===`agent`)return{bg:`var(--primary)`,initial:n?n.charAt(0).toUpperCase():`A`};let r=[`#ff5858`,`#11998e`,`#ff9966`,`#7f00ff`,`#00c6ff`,`#f12711`,`#0575e6`],i=e.split(``).reduce((e,t)=>e+t.charCodeAt(0),0);return{bg:r[Math.abs(i)%r.length],initial:`U`}}function YF({comment:e,onDelete:t}){let[,n]=(0,W.useState)(0),{resolveComment:r,unresolveComment:i,addReply:a,removeReply:o,editReply:s,applySuggestion:c,editComment:l}=jj(),u=e.status===`resolved`,[d,f]=(0,W.useState)(u),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(!1),[_,v]=(0,W.useState)(!1),[y,b]=(0,W.useState)(null),x=(0,W.useRef)(null),S=e.body.replace(/```suggestion\n([\s\S]*?)```/g,``).trim().length>0;(0,W.useEffect)(()=>{f(e.status===`resolved`)},[e.status]),(0,W.useEffect)(()=>{let e=setInterval(()=>n(e=>e+1),3e4);return()=>clearInterval(e)},[]);let C=()=>r(e.id),w=()=>i(e.id),T=e=>{b(e)},E=t=>{o(e.id,t)};if(u&&d)return(0,G.jsxs)(`div`,{className:`comment-resolved-collapsed`,style:{padding:`12px 18px`,margin:`14px 20px`,background:`var(--bg-secondary)`,border:`1px solid var(--border-color)`,borderRadius:`var(--radius-md)`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,opacity:.85,boxShadow:`var(--shadow-sm)`},children:[(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`,fontSize:`13px`,color:`var(--text-muted)`},children:[(0,G.jsx)(wM,{size:16,style:{color:`var(--success)`}}),(0,G.jsx)(`span`,{style:{fontWeight:600},children:`Conversation resolved`}),e.lineNumber===0&&(0,G.jsx)(`span`,{style:{padding:`2px 6px`,background:`var(--accent-subtle)`,border:`1px solid var(--primary)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:700,color:`var(--primary)`,textTransform:`uppercase`,letterSpacing:`0.5px`},children:`File Comment`}),e.startLineNumber&&e.startLineNumber!==e.lineNumber&&(0,G.jsxs)(`span`,{style:{padding:`2px 6px`,background:`var(--bg-primary)`,border:`1px solid var(--border-color)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:600,fontFamily:`var(--font-mono)`,color:`var(--text-secondary)`},children:[`L`,e.startLineNumber,`-`,e.lineNumber]}),(0,G.jsx)(`span`,{children:`•`}),(0,G.jsx)(`span`,{children:e.replies?.length>0?`${e.replies.length+1} comments`:`1 comment`})]}),(0,G.jsx)(`button`,{style:{background:`none`,border:`none`,color:`var(--primary)`,fontSize:`12px`,fontWeight:600,cursor:`pointer`},onClick:()=>f(!1),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),f(!1))},"aria-label":`Show resolved conversation`,children:`Show resolved`})]});let D=JF(e.id,`user`);return h?(0,G.jsx)(`div`,{className:`comment-bubble-canvas`,id:`comment-${e.id}`,role:`article`,"aria-label":`Edit comment`,children:(0,G.jsxs)(`div`,{className:`comment-node`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:(0,G.jsx)(`div`,{className:`comment-avatar-circle`,style:{background:D.bg},children:D.initial})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge comment-node-badge-user`,children:`User`}),(0,G.jsxs)(`span`,{className:`comment-node-time`,style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[dj(e.createdAt),e.lineNumber===0&&(0,G.jsx)(`span`,{style:{padding:`1px 5px`,background:`var(--accent-subtle)`,border:`1px solid var(--primary)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:700,color:`var(--primary)`,textTransform:`uppercase`,letterSpacing:`0.5px`},children:`File Comment`}),e.startLineNumber&&e.startLineNumber!==e.lineNumber&&(0,G.jsxs)(`span`,{style:{padding:`1px 5px`,background:`var(--bg-primary)`,border:`1px solid var(--border-color)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:600,fontFamily:`var(--font-mono)`,color:`var(--text-secondary)`},children:[`L`,e.startLineNumber,`-`,e.lineNumber]})]})]}),(0,G.jsx)(`div`,{style:{marginTop:`8px`},children:(0,G.jsx)(qF,{draftKey:`edit:${e.id}`,initialBody:e.body,lineContent:e.lineContent,onSubmit:t=>{l(e.id,t),g(!1)},onCancel:()=>g(!1)})})]})]})}):(0,G.jsxs)(`div`,{className:`comment-bubble-canvas ${u?`comment-bubble-canvas-resolved`:``}`,id:`comment-${e.id}`,role:`article`,"aria-label":e.lineNumber===0?`File-level comment`:`Comment by user on line ${e.lineNumber}`,children:[(0,G.jsxs)(`div`,{className:`comment-node ${u?`comment-node-resolved`:``}`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:(0,G.jsx)(`div`,{className:`comment-avatar-circle`,style:{background:D.bg},children:D.initial})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge comment-node-badge-user`,children:`User`}),(0,G.jsxs)(`span`,{className:`comment-node-time`,style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[dj(e.createdAt),e.lineNumber===0&&(0,G.jsx)(`span`,{style:{padding:`1px 5px`,background:`var(--accent-subtle)`,border:`1px solid var(--primary)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:700,color:`var(--primary)`,textTransform:`uppercase`,letterSpacing:`0.5px`},children:`File Comment`}),e.startLineNumber&&e.startLineNumber!==e.lineNumber&&(0,G.jsxs)(`span`,{style:{padding:`1px 5px`,background:`var(--bg-primary)`,border:`1px solid var(--border-color)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:600,fontFamily:`var(--font-mono)`,color:`var(--text-secondary)`},children:[`L`,e.startLineNumber,`-`,e.lineNumber]})]}),u&&(0,G.jsxs)(`span`,{className:`comment-canvas-resolved-banner`,style:{marginLeft:`8px`},children:[(0,G.jsx)(wM,{size:13}),`Resolved`]}),!u&&(0,G.jsxs)(`div`,{className:`comment-node-actions`,children:[(0,G.jsx)(`button`,{ref:x,className:`comment-node-btn`,onClick:()=>g(!0),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),g(!0))},title:`Edit comment`,"aria-label":`Edit comment`,tabIndex:0,children:(0,G.jsx)(GM,{size:13,"aria-hidden":`true`})}),_?(0,G.jsxs)(`div`,{className:`comment-delete-confirm`,style:{display:`flex`,alignItems:`center`,gap:`4px`},children:[(0,G.jsxs)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>t(e.id),title:`Confirm delete`,"aria-label":`Confirm delete comment`,style:{color:`var(--danger)`,background:`var(--feedback-danger-bg)`,fontWeight:600,fontSize:`11px`,borderRadius:`var(--radius-sm)`,border:`1px solid var(--feedback-danger-border)`,padding:`2px 6px`,cursor:`pointer`,display:`flex`,alignItems:`center`,gap:`2px`,width:`auto`,height:`auto`},children:[(0,G.jsx)(tN,{size:11}),`Delete?`]}),(0,G.jsx)(`button`,{className:`comment-node-btn`,onClick:()=>v(!1),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),v(!1))},title:`Cancel delete`,"aria-label":`Cancel delete`,style:{fontSize:`11px`,padding:`2px 6px`,width:`auto`,height:`auto`},children:`Cancel`})]}):(0,G.jsx)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>v(!0),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),v(!0))},title:`Delete comment`,"aria-label":`Delete comment`,tabIndex:0,children:(0,G.jsx)(eN,{size:13,"aria-hidden":`true`})})]})]}),S&&(0,G.jsx)(`div`,{className:`comment-node-body markdown-body ${u?`comment-resolved-line`:``}`,dangerouslySetInnerHTML:{__html:mj(e.body)}}),(()=>{let t=e.body.match(/```suggestion\n([\s\S]*?)```/),n=!!t&&e.side===`additions`,r=t?t[1].trimEnd():``;return n?(0,G.jsxs)(`div`,{className:`suggestion-card`,style:{marginTop:`12px`,marginBottom:`4px`,border:`1px solid var(--border-normal)`,borderRadius:`var(--radius-md)`,overflow:`hidden`,background:`var(--bg-primary)`,boxShadow:`var(--shadow-sm)`},children:[(0,G.jsxs)(`div`,{className:`suggestion-header`,style:{padding:`8px 12px`,background:`var(--bg-secondary)`,borderBottom:`1px solid var(--border-normal)`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,fontSize:`12px`,fontWeight:600},children:[(0,G.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Suggested Change`}),u?(0,G.jsxs)(`span`,{style:{color:`var(--feedback-success-text)`,display:`inline-flex`,alignItems:`center`,gap:`4px`},children:[(0,G.jsx)(wM,{size:12}),` Applied`]}):(0,G.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:async()=>{try{await c(e.id)}catch(e){alert(e.message)}},style:{fontSize:`11px`,padding:`2px 8px`,borderRadius:`var(--radius-sm)`,height:`24px`},children:`Apply Suggestion`})]}),(0,G.jsxs)(`div`,{className:`suggestion-diff`,style:{display:`flex`,flexDirection:`column`,fontSize:`12px`,fontFamily:`var(--font-mono)`,overflowX:`auto`},children:[(0,G.jsxs)(`div`,{style:{display:`flex`,padding:`8px 12px`,background:`var(--feedback-danger-bg)`,borderBottom:`1px dashed var(--border-color)`,color:`var(--feedback-danger-text)`,minWidth:`max-content`},children:[(0,G.jsx)(`span`,{style:{width:`20px`,userSelect:`none`,opacity:.5},children:`-`}),(0,G.jsx)(`span`,{style:{whiteSpace:`pre`},children:e.lineContent})]}),(0,G.jsxs)(`div`,{style:{display:`flex`,padding:`8px 12px`,background:`var(--feedback-success-bg)`,color:`var(--feedback-success-text)`,minWidth:`max-content`},children:[(0,G.jsx)(`span`,{style:{width:`20px`,userSelect:`none`,opacity:.5},children:`+`}),(0,G.jsx)(`span`,{style:{whiteSpace:`pre`},children:r})]})]})]}):null})()]})]}),e.replies?.length>0&&(0,G.jsx)(`div`,{className:`comment-replies`,role:`list`,"aria-label":`Replies`,children:e.replies.map((t,n)=>{let r=t.role===`agent`,i=y===t.id,a=JF(t.id,t.role,t.model);return(0,G.jsxs)(`div`,{className:`comment-node ${r?`comment-node-agent`:`comment-node-user`} ${u?`comment-node-resolved`:``}`,role:`listitem`,"aria-label":`${r?`Agent`:`User`} reply ${n+1}`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:r?(0,G.jsx)(`div`,{className:`comment-avatar-circle`,style:{background:a.bg,width:`28px`,height:`28px`,fontSize:`11px`},children:a.initial}):(0,G.jsx)(`div`,{style:{width:`28px`}})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:r?`Agent`:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge ${r?`comment-node-badge-agent`:`comment-node-badge-user`}`,children:r?`Agent`:`User`}),r&&t.model&&(0,G.jsx)(`span`,{style:{fontSize:`10px`,fontWeight:600,padding:`1px 5px`,borderRadius:`4px`,background:`var(--bg-tertiary)`,color:`var(--text-secondary)`,fontFamily:`var(--font-mono)`},children:t.model}),(0,G.jsx)(`span`,{className:`comment-node-time`,children:dj(t.createdAt)}),!u&&(0,G.jsxs)(`div`,{className:`comment-node-actions`,children:[(0,G.jsx)(`button`,{className:`comment-node-btn`,onClick:()=>T(t.id),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),T(t.id))},title:`Edit reply`,"aria-label":`Edit reply`,tabIndex:0,children:(0,G.jsx)(GM,{size:12,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>E(t.id),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),E(t.id))},title:`Delete reply`,"aria-label":`Delete reply`,tabIndex:0,children:(0,G.jsx)(eN,{size:12,"aria-hidden":`true`})})]})]}),i?(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`var(--radius-md)`,border:`1px solid var(--border-color)`,marginTop:`6px`},children:(0,G.jsx)(qF,{draftKey:`reply-edit:${e.id}:${t.id}`,initialBody:t.body,onSubmit:n=>{s(e.id,t.id,n),b(null)},onCancel:()=>b(null)})}):(0,G.jsx)(`div`,{className:`comment-node-body markdown-body`,dangerouslySetInnerHTML:{__html:mj(t.body)}})]})]},t.id)})}),(0,G.jsxs)(`div`,{className:`comment-canvas-footer`,children:[!p&&(0,G.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,G.jsxs)(`button`,{onClick:()=>m(!0),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),m(!0))},className:`comment-reply-trigger`,"aria-label":`Write a reply`,tabIndex:0,style:{width:`100%`,maxWidth:`320px`},children:[(0,G.jsx)(qM,{size:14,"aria-hidden":`true`}),`Reply...`]}),u?(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:w,style:{fontSize:`12px`,padding:`4px 10px`,marginLeft:`12px`},"aria-label":`Unresolve conversation`,children:`Unresolve conversation`}):(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:C,style:{fontSize:`12px`,padding:`4px 10px`,marginLeft:`12px`},"aria-label":`Resolve conversation`,children:`Resolve conversation`})]}),p&&(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`var(--radius-md)`,border:`1px solid var(--border-color)`,marginTop:`4px`},children:(0,G.jsx)(qF,{draftKey:`reply:${e.id}`,onSubmit:t=>{a(e.id,t),m(!1)},onCancel:()=>{m(!1),x.current?.focus()}})})]})]})}var XF=(0,W.memo)(function({id:e,fileDiff:t,filePath:n,annotations:r,diffStyle:i,tabSize:a,viewed:o,theme:s,editorIDE:c,lineDiffType:l,lineWrap:u,diffIndicators:d,showLineNumbers:f,hunkSeparators:p,lineHoverHighlight:m,fontSize:h,expandContextByDefault:g,collapsedContextThreshold:_,expansionLineCount:v,onViewedChange:y,onAddComment:b,onDeleteComment:x}){let[S,C]=(0,W.useState)(null),[w,T]=(0,W.useState)(null),[E,D]=(0,W.useState)(0),[O,k]=(0,W.useState)(null),[A,j]=(0,W.useState)(o),[M,N]=(0,W.useState)(!1),[P,F]=(0,W.useState)(!1),[I,L]=(0,W.useState)(g),[R,z]=(0,W.useState)(null),[ee,te]=(0,W.useState)(null),[B,V]=(0,W.useState)(null),H=(0,W.useRef)(null),ne=async(e,t=!1)=>{if(R===null&&!(!t&&typeof window<`u`&&!window.confirm(`Revert hunk #${e+1} in ${n}? This rewrites the file via "git apply --reverse".`))){z(e),te(null);try{let t=await fetch(`/api/revert-hunk`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:n,hunkIndex:e})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`HTTP ${t.status}`)}}catch(e){te(e.message)}finally{z(null)}}},re=t.type===`change`||t.type===`rename-changed`,ie=!A&&re,{loading:ae,oldContent:oe,newContent:se}=RF(n,I&&ie),ce=I&&oe!==null&&se!==null,le=t.prevName??n;(0,W.useEffect)(()=>{j(o)},[o]);let ue=pj[s]||pj.nord,U=(0,W.useMemo)(()=>QF(a,h),[a,h]),de=(e,n,r)=>{let i=r&&r!==n?r:n,a=n,o=[];for(let n=i;n<=a;n++){let r=e===`additions`?t.additionLines:t.deletionLines,i=e===`additions`?`additionStart`:`deletionStart`,a=e===`additions`?`additionCount`:`deletionCount`,s=e===`additions`?`additionLineIndex`:`deletionLineIndex`,c=!1;for(let e of t.hunks){let t=e[i],l=e[a];if(n>=t&&n<t+l){let i=e[s]+(n-t);o.push(r[i]??``),c=!0;break}}c||o.push(``)}return o.join(`
1967
- `)},fe=async e=>{if(e.stopPropagation(),t.type!==`deleted`){N(!0);try{await fetch(`/api/open-file`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:n,editor:c})})}catch(e){console.error(`Failed to open file in IDE editor:`,e)}finally{N(!1)}}},pe=()=>{switch(t.type){case`new`:return(0,G.jsx)(`span`,{className:`diff-status-badge diff-status-new`,children:`Added`});case`deleted`:return(0,G.jsx)(`span`,{className:`diff-status-badge diff-status-deleted`,children:`Deleted`});case`rename-pure`:case`rename-changed`:return(0,G.jsx)(`span`,{className:`diff-status-badge diff-status-renamed`,children:`Renamed`});default:return(0,G.jsx)(`span`,{className:`diff-status-badge diff-status-modified`,children:`Modified`})}},me=r.filter(e=>e.lineNumber===0),he=r.filter(e=>e.lineNumber>0),ge=e=>`_pending`in e.metadata?(0,G.jsx)(qF,{draftKey:`new:${n}:${S.side}:${S.startLineNumber||S.lineNumber}:${S.lineNumber}`,lineContent:de(S.side,S.lineNumber,S.startLineNumber),onSubmit:e=>{let t=de(S.side,S.lineNumber,S.startLineNumber);b(n,S.side,S.lineNumber,t,e,S.startLineNumber),C(null),T(null)},onCancel:()=>{C(null),T(null)}}):(0,G.jsx)(YF,{comment:e.metadata,onDelete:x}),_e=e=>(0,G.jsx)(`button`,{className:`gutter-add-btn`,onClick:()=>{let t=e();t&&C({side:t.side,lineNumber:t.lineNumber})},children:`+`}),ve=[...he,...S?[{side:S.side,lineNumber:S.lineNumber,metadata:{_pending:!0}}]:[]];return(0,G.jsxs)(`div`,{ref:H,className:`file-diff-card ${o?`file-diff-viewed`:``} ${A?`file-diff-collapsed`:``}`,id:e,children:[(0,G.jsxs)(`div`,{className:`file-diff-card-header`,onClick:()=>j(!A),children:[(0,G.jsxs)(`div`,{className:`file-diff-header-left`,children:[(0,G.jsx)(`span`,{className:`file-diff-collapse-indicator`,children:A?(0,G.jsx)(xM,{size:14}):(0,G.jsx)(bM,{size:14})}),(0,G.jsx)(`span`,{className:`file-diff-name`,title:n,children:n}),pe(),he.length>0&&(0,G.jsxs)(`span`,{className:`file-diff-comment-badge`,title:`${he.length} inline comment${he.length===1?``:`s`}`,children:[(0,G.jsx)(RM,{size:10}),he.length]}),E>0&&(0,G.jsxs)(`span`,{className:`file-diff-selection-badge`,"aria-live":`polite`,children:[E,` line`,E===1?``:`s`,` selected`]}),O&&(0,G.jsxs)(`span`,{className:`file-diff-permalink-flash`,role:`status`,children:[`Copied `,O]})]}),(0,G.jsxs)(`div`,{className:`file-diff-header-right`,onClick:e=>e.stopPropagation(),children:[ie&&(0,G.jsxs)(`button`,{className:`file-diff-edit-btn ${I?`btn-active`:``}`,onClick:()=>L(e=>!e),disabled:ae,title:I?`Hide unchanged context (use original patch render)`:`Load full file so unchanged context becomes expandable`,children:[ae?(0,G.jsx)(IM,{size:11,className:`spin`}):(0,G.jsx)(LM,{size:11}),(0,G.jsx)(`span`,{children:ae?`Loading…`:I?`Hide Context`:`Expand Context`})]}),t.type!==`deleted`&&(0,G.jsxs)(`button`,{className:`file-diff-edit-btn`,onClick:fe,disabled:M,title:`Open and edit full file locally`,children:[(0,G.jsx)(WM,{size:11}),(0,G.jsx)(`span`,{children:M?`Opening...`:`Edit File`})]}),(0,G.jsxs)(`button`,{className:`file-diff-edit-btn`,onClick:()=>{j(!1),F(!0)},title:`Comment on this entire file`,children:[(0,G.jsx)(RM,{size:11}),(0,G.jsx)(`span`,{children:`Add Comment`})]}),(0,G.jsxs)(`label`,{className:`viewed-label ${o?`viewed-checked`:``}`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>y(n,e.target.checked)}),`Viewed`]})]})]}),!A&&t.hunks.length>0&&(0,G.jsxs)(`div`,{className:`file-diff-hunk-actions`,onClick:e=>e.stopPropagation(),children:[(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`6px`},children:[(0,G.jsx)(`span`,{className:`file-diff-hunk-actions-label`,style:{display:`inline-flex`,alignItems:`center`,gap:`4px`},children:`Selective Revert`}),(0,G.jsx)(QT,{content:`Selective Revert lets you preview and undo specific blocks of changes (hunks) in this file using 'git apply --reverse'.`,side:`top`,children:(0,G.jsx)(TM,{size:12,style:{color:`var(--text-muted)`,cursor:`help`}})}),(0,G.jsx)(`span`,{style:{color:`var(--text-muted)`,fontSize:`11px`,margin:`0 4px`},children:`·`}),(0,G.jsxs)(`span`,{style:{color:`var(--text-secondary)`,fontSize:`11px`},children:[t.hunks.length,` block`,t.hunks.length===1?``:`s`,` available`]})]}),(0,G.jsx)(`div`,{className:`file-diff-hunk-actions-buttons`,children:t.hunks.map((e,t)=>(0,G.jsxs)(`button`,{type:`button`,className:`file-diff-hunk-revert-btn`,onClick:()=>V(t),disabled:R!==null,title:`Preview and revert hunk #${t+1} (lines @${e.additionStart}+${e.additionLines??e.additionCount})`,children:[R===t?(0,G.jsx)(IM,{size:10,className:`spin`}):(0,G.jsx)(rN,{size:10}),(0,G.jsxs)(`span`,{children:[`Hunk #`,t+1]})]},t))}),ee&&(0,G.jsxs)(`span`,{className:`file-diff-hunk-error`,role:`alert`,children:[(0,G.jsx)(CM,{size:11}),ee]})]}),B!==null&&(()=>{let e=t.hunks[B];if(!e)return null;let r=t.deletionLines.slice(e.deletionLineIndex,e.deletionLineIndex+(e.deletionCount??e.deletionLines??0)),i=t.additionLines.slice(e.additionLineIndex,e.additionLineIndex+(e.additionStart!==void 0&&e.additionLines!==void 0?e.additionLines:e.additionCount??0));return(0,G.jsxs)(IF,{open:B!==null,onClose:()=>V(null),className:`hunk-revert-modal`,ariaLabel:`Selective Revert Preview Hunk #${B+1}`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header-title`,children:[(0,G.jsx)(rN,{size:18,className:`shortcuts-icon`}),(0,G.jsxs)(`h2`,{children:[`Revert Hunk #`,B+1]})]}),(0,G.jsx)(`button`,{className:`shortcuts-close-btn`,onClick:()=>V(null),"aria-label":`Close dialog`,children:(0,G.jsx)(aN,{size:16})})]}),(0,G.jsxs)(`div`,{className:`shortcuts-body`,children:[(0,G.jsxs)(`div`,{className:`hunk-preview-intro`,children:[`Reverting this hunk will restore the deleted (`,(0,G.jsx)(`span`,{style:{color:`var(--feedback-danger-text)`,fontWeight:600},children:`red`}),`) lines and remove the added (`,(0,G.jsx)(`span`,{style:{color:`var(--feedback-success-text)`,fontWeight:600},children:`green`}),`) lines from `,(0,G.jsx)(`strong`,{children:n.split(`/`).pop()}),`.`]}),(0,G.jsxs)(`div`,{className:`hunk-preview-container`,children:[(0,G.jsxs)(`div`,{className:`hunk-preview-header`,children:[(0,G.jsx)(`span`,{children:n}),(0,G.jsxs)(`span`,{children:[`Lines: @-`,e.deletionStart,`,`,e.deletionCount??e.deletionLines??0,` @+`,e.additionStart,`,`,e.additionLines??e.additionCount??0]})]}),(0,G.jsxs)(`div`,{className:`hunk-preview-code`,children:[r.map((e,t)=>(0,G.jsxs)(`div`,{className:`hunk-preview-line hunk-preview-line-deletion`,children:[(0,G.jsx)(`span`,{className:`hunk-preview-sign`,children:`-`}),(0,G.jsx)(`span`,{className:`hunk-preview-text`,children:e})]},`del-${t}`)),i.map((e,t)=>(0,G.jsxs)(`div`,{className:`hunk-preview-line hunk-preview-line-addition`,children:[(0,G.jsx)(`span`,{className:`hunk-preview-sign`,children:`+`}),(0,G.jsx)(`span`,{className:`hunk-preview-text`,children:e})]},`add-${t}`)),r.length===0&&i.length===0&&(0,G.jsx)(`div`,{className:`hunk-preview-line`,style:{fontStyle:`italic`,color:`var(--text-muted)`},children:`No changes in this hunk.`})]})]}),(0,G.jsx)(ZF,{filePath:n,deletionStart:e.deletionStart,deletionCount:e.deletionCount??e.deletionLines??0})]}),(0,G.jsxs)(`div`,{className:`modal-footer`,children:[(0,G.jsx)(`button`,{className:`hunk-revert-btn-secondary`,onClick:()=>V(null),children:`Cancel`}),(0,G.jsx)(`button`,{className:`hunk-revert-btn-primary`,onClick:async()=>{let e=B;V(null),await ne(e,!0)},children:`Revert Changes`})]})]})})(),!A&&(0,G.jsxs)(`div`,{className:`file-diff-card-body`,children:[(me.length>0||P)&&(0,G.jsxs)(`div`,{className:`file-level-comments-section`,style:{margin:`16px 20px`,padding:`12px`,background:`rgba(255,255,255,0.02)`,border:`1px solid var(--border-color)`,borderRadius:`8px`,display:`flex`,flexDirection:`column`,gap:`12px`},children:[(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`6px`,fontSize:`13px`,fontWeight:600,color:`var(--text-secondary)`},children:[(0,G.jsx)(RM,{size:14}),(0,G.jsxs)(`span`,{children:[`File-Level Comments (`,me.length,`)`]})]}),me.length>0&&(0,G.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`12px`},children:me.map(e=>(0,G.jsx)(YF,{comment:e.metadata,onDelete:x},e.metadata.id))}),P&&(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`6px`,border:`1px solid var(--border-color)`},children:(0,G.jsx)(qF,{draftKey:`file-comment:${n}`,lineContent:``,onSubmit:e=>{b(n,`additions`,0,``,e),F(!1)},onCancel:()=>F(!1)})})]}),ce?(0,G.jsx)(Yg,{oldFile:{name:le,contents:oe??``},newFile:{name:n,contents:se??``},options:{diffStyle:i,enableGutterUtility:!0,enableLineSelection:!0,disableFileHeader:!0,lineDiffType:l,overflow:u?`wrap`:`scroll`,diffIndicators:d,disableLineNumbers:!f,hunkSeparators:p,lineHoverHighlight:m,expandUnchanged:!1,collapsedContextThreshold:_,expansionLineCount:v,onLineSelectionStart:()=>{T(null),D(0)},onLineSelectionChange:e=>{D(e?Math.abs(e.end-e.start)+1:0)},onLineSelectionEnd:e=>{D(0),e&&(T(e),C({side:e.endSide||`additions`,lineNumber:e.end,startLineNumber:e.start}))},onLineNumberClick:e=>{let t=`${n}:${e.annotationSide===`deletions`?`-`:`+`}${e.lineNumber}`;navigator.clipboard?.writeText(t).then(()=>{k(t),setTimeout(()=>k(null),1600)},()=>{})},theme:{dark:ue.type===`dark`?ue.themeName:`nord`,light:ue.type===`light`?ue.themeName:`github-light`},themeType:ue.type,unsafeCSS:U},selectedLines:w,lineAnnotations:ve,renderHeaderMetadata:()=>null,renderAnnotation:ge,renderGutterUtility:_e}):(0,G.jsx)(Jg,{fileDiff:t,options:{diffStyle:i,enableGutterUtility:!0,enableLineSelection:!0,disableFileHeader:!0,lineDiffType:l,overflow:u?`wrap`:`scroll`,diffIndicators:d,disableLineNumbers:!f,hunkSeparators:p,lineHoverHighlight:m,onLineSelectionStart:()=>{T(null),D(0)},onLineSelectionChange:e=>{D(e?Math.abs(e.end-e.start)+1:0)},onLineSelectionEnd:e=>{D(0),e&&(T(e),C({side:e.endSide||`additions`,lineNumber:e.end,startLineNumber:e.start}))},onLineNumberClick:e=>{let t=`${n}:${e.annotationSide===`deletions`?`-`:`+`}${e.lineNumber}`;navigator.clipboard?.writeText(t).then(()=>{k(t),setTimeout(()=>k(null),1600)},()=>{})},theme:{dark:ue.type===`dark`?ue.themeName:`nord`,light:ue.type===`light`?ue.themeName:`github-light`},themeType:ue.type,unsafeCSS:U},selectedLines:w,lineAnnotations:ve,renderHeaderMetadata:()=>null,renderAnnotation:e=>`_pending`in e.metadata?(0,G.jsx)(qF,{draftKey:`new:${n}:${S.side}:${S.startLineNumber||S.lineNumber}:${S.lineNumber}`,lineContent:de(S.side,S.lineNumber,S.startLineNumber),onSubmit:e=>{let t=de(S.side,S.lineNumber,S.startLineNumber);b(n,S.side,S.lineNumber,t,e,S.startLineNumber),C(null),T(null)},onCancel:()=>{C(null),T(null)}}):(0,G.jsx)(YF,{comment:e.metadata,onDelete:x}),renderGutterUtility:e=>(0,G.jsx)(`button`,{className:`gutter-add-btn`,onClick:()=>{let t=e();t&&C({side:t.side,lineNumber:t.lineNumber})},children:`+`})})]})]})});function ZF({filePath:e,deletionStart:t,deletionCount:n}){let[r,i]=(0,W.useState)(null),[a,o]=(0,W.useState)(!1),[s,c]=(0,W.useState)(null);if((0,W.useEffect)(()=>{let r=!0;return(async()=>{o(!0),c(null);try{let a=new URLSearchParams({filePath:e,deletionStart:String(t),deletionCount:String(n)}),o=await fetch(`/api/hunk-history?${a}`);if(!o.ok)throw Error(`HTTP ${o.status}`);let s=await o.json();r&&i(s)}catch(e){r&&c(e.message||`Failed to fetch hunk history`)}finally{r&&o(!1)}})(),()=>{r=!1}},[e,t,n]),a)return(0,G.jsxs)(`div`,{className:`hunk-history-loading`,children:[(0,G.jsx)(IM,{size:14,className:`spin`,style:{marginRight:`8px`}}),(0,G.jsx)(`span`,{children:`Loading git history & origin blame…`})]});if(s)return(0,G.jsxs)(`div`,{className:`hunk-history-error`,children:[(0,G.jsx)(CM,{size:14,style:{color:`var(--feedback-danger-text)`,marginRight:`8px`}}),(0,G.jsxs)(`span`,{children:[`Failed to load git history: `,s]})]});if(!r)return null;let l=Array.from(new Map(r.blame.map(e=>[e.commit,e])).values());return(0,G.jsxs)(`div`,{className:`hunk-history-section`,children:[l.length>0&&(0,G.jsxs)(`div`,{className:`hunk-history-block`,children:[(0,G.jsx)(`h3`,{className:`hunk-history-title`,children:`Commit(s) introducing deleted lines`}),(0,G.jsx)(`div`,{className:`hunk-history-commits`,children:l.map(e=>(0,G.jsxs)(`div`,{className:`hunk-history-commit-card`,children:[(0,G.jsxs)(`div`,{className:`hunk-history-commit-header`,children:[(0,G.jsx)(`span`,{className:`hunk-history-commit-hash`,children:e.commit}),(0,G.jsxs)(`span`,{className:`hunk-history-commit-author`,children:[(0,G.jsx)(iN,{size:11}),(0,G.jsx)(`span`,{children:e.author})]}),(0,G.jsxs)(`span`,{className:`hunk-history-commit-date`,children:[(0,G.jsx)(EM,{size:11}),(0,G.jsx)(`span`,{children:e.date})]})]}),(0,G.jsx)(`div`,{className:`hunk-history-commit-msg`,children:e.summary})]},e.commit))})]}),r.recentCommits.length>0&&(0,G.jsxs)(`div`,{className:`hunk-history-block`,children:[(0,G.jsx)(`h3`,{className:`hunk-history-title`,children:`Recent File Modification History`}),(0,G.jsx)(`div`,{className:`hunk-history-log`,children:r.recentCommits.map(e=>(0,G.jsxs)(`div`,{className:`hunk-history-log-row`,children:[(0,G.jsx)(`span`,{className:`hunk-history-log-hash`,children:e.hash}),(0,G.jsx)(`span`,{className:`hunk-history-log-msg`,title:e.summary,children:e.summary}),(0,G.jsx)(`span`,{className:`hunk-history-log-author`,children:e.author}),(0,G.jsx)(`span`,{className:`hunk-history-log-date`,children:e.date})]},e.hash))})]})]})}function QF(e,t){return`
1970
+ )`}return(0,G.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),lP=W.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Wb,...g}=e,{store:_}=UN(),v=iP(),y=Fb(),b=_.useState(`floatingRootContext`),x=_.useState(`mounted`),S=_.useState(`open`),C=_.useState(`openChangeReason`),w=_.useState(`activeTriggerElement`),T=_.useState(`modal`),E=_.useState(`positionerElement`),D=_.useState(`instantType`),O=_.useState(`transitionStatus`),k=W.useRef(null),A=pw(E,!1,!1),j=RT({anchor:i,floatingRootContext:b,positionMethod:a,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:v,nodeId:y,collisionAvoidance:h,adaptiveOrigin:FT}),M=W.useMemo(()=>{let e={};return S||(e.pointerEvents=`none`),{role:`presentation`,hidden:!x,style:{...j.positionerStyles,...e}}},[S,x,j.positionerStyles]),N=W.useMemo(()=>({props:M,...j}),[M,j]),P=b?.select(`domReferenceElement`);Y(()=>{let e=P,t=k.current;if(e&&(k.current=e),t&&e&&e!==t){_.set(`instantType`,void 0);let e=new AbortController;return A(()=>{_.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[P,A,_]);let F=W.useMemo(()=>({open:S,side:N.side,align:N.align,anchorHidden:N.anchorHidden,instant:D}),[S,N.side,N.align,N.anchorHidden,D]),I=W.useCallback(e=>{_.set(`positionerElement`,e)},[_]),L=eS(`div`,e,{state:F,props:[N.props,BT(O),g],ref:[t,I],stateAttributesMapping:vT});return(0,G.jsxs)(oP.Provider,{value:N,children:[x&&T===!0&&C!==`trigger-hover`&&(0,G.jsx)(cP,{ref:_.context.internalBackdropRef,inert:XT(!S),cutout:w}),(0,G.jsx)(Ib,{id:y,children:L})]})}),uP=`ArrowUp`,dP=`ArrowDown`,fP=`ArrowLeft`,pP=`ArrowRight`,mP=`Home`,hP=new Set([fP,pP]),gP=new Set([uP,dP]),_P=new Set([...hP,...gP]);new Set([..._P,mP,`End`]);var vP=new Set([uP,dP,fP,pP,mP,`End`]),yP=W.createContext(void 0);function bP(e){let t=W.useContext(yP);if(t===void 0&&!e)throw Error(A_(69));return t}var xP={...vT,...cT},SP=W.forwardRef(function(e,t){let{className:n,render:r,initialFocus:i,finalFocus:a,...o}=e,{store:s}=UN(),c=sP(),l=bP(!0)!=null,u=AT(),d=s.useState(`open`),f=s.useState(`openMethod`),p=s.useState(`instantType`),m=s.useState(`transitionStatus`),h=s.useState(`popupProps`),g=s.useState(`titleElementId`),_=s.useState(`descriptionElementId`),v=s.useState(`modal`),y=s.useState(`mounted`),b=s.useState(`openChangeReason`),x=s.useState(`popupElement`),S=s.useState(`payload`),C=s.useState(`positionerElement`),w=s.useState(`activeTriggerElement`),T=s.useState(`floatingRootContext`);mw({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}});let E=s.useState(`disabled`),D=s.useState(`openOnHover`),O=s.useState(`closeDelay`);Nw(T,{enabled:D&&!E,closeDelay:O});function k(e){return e===`touch`?s.context.popupRef.current:!0}let A=i===void 0?k:i,j=W.useMemo(()=>({open:d,side:c.side,align:c.align,instant:p,transitionStatus:m}),[d,c.side,c.align,p,m]),M=W.useCallback(e=>{s.set(`popupElement`,e)},[s]);function N(){T.context.events.emit(`measure-layout`)}function P(e,t){T.context.events.emit(`measure-layout-complete`,{previousDimensions:e,nextDimensions:t})}GT({popupElement:x,positionerElement:C,mounted:y,content:S,enabled:W.useCallback(()=>s.context.triggerElements.size>1,[s]),onMeasureLayout:N,onMeasureLayoutComplete:P,side:c.side,direction:u});let F=eS(`div`,e,{state:j,ref:[t,s.context.popupRef,M],props:[h,{"aria-labelledby":g,"aria-describedby":_,onKeyDown(e){l&&vP.has(e.key)&&e.stopPropagation()}},BT(m),o],stateAttributesMapping:xP});return(0,G.jsx)(bS,{context:T,openInteractionType:f,modal:v===`trap-focus`,disabled:!y||b===`trigger-hover`,initialFocus:A,returnFocus:a,restoreFocus:`popup`,previousFocusableElement:K_(w)?w:void 0,nextFocusableElement:s.context.triggerFocusTargetRef,beforeContentFocusGuardRef:s.context.beforeContentFocusGuardRef,children:F})});function CP({trigger:e,children:t,open:n,onOpenChange:r,side:i=`bottom`,align:a=`end`,className:o,ariaLabel:s}){return(0,G.jsxs)(XN,{open:n,onOpenChange:r,children:[(0,G.jsx)(nP,{render:e}),(0,G.jsx)(aP,{children:(0,G.jsx)(lP,{className:`ui-popover-positioner`,side:i,align:a,sideOffset:8,children:(0,G.jsx)(SP,{className:`ui-popover ${o??``}`,"aria-label":s,children:t})})})]})}function wP(e){let t=W.useRef(!0);t.current&&(t.current=!1,e())}function TP({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=W.useRef(e!==void 0),[a,o]=W.useState(t);return[i?e:a,W.useCallback(e=>{i||o(e)},[])]}var EP=W.createContext(null),DP=W.createContext(null);function OP(){let e=W.useContext(EP);if(e===null)throw Error(A_(60));return e}function kP(){let e=W.useContext(DP);if(e===null)throw Error(A_(61));return e}var AP=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),jP={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},MP={valid(e){return e===null?null:e?{[AP.valid]:``}:{[AP.invalid]:``}}},NP=W.createContext({invalid:void 0,name:void 0,validityData:{state:jP,errors:[],error:``,value:``,initialValue:null},setValidityData:Rb,disabled:void 0,touched:!1,setTouched:Rb,dirty:!1,setDirty:Rb,filled:!1,setFilled:Rb,focused:!1,setFocused:Rb,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=Bb)=>e,getInputValidationProps:(e=Bb)=>e,inputRef:{current:null},commit:async()=>{}}});function PP(e=!0){let t=W.useContext(NP);if(t.setValidityData===Rb&&!e)throw Error(A_(28));return t}var FP=W.createContext({controlId:void 0,setControlId:Rb,labelId:void 0,setLabelId:Rb,messageIds:[],setMessageIds:Rb,getDescriptionProps:e=>e});function IP(){return W.useContext(FP)}function LP(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,setControlId:a}=IP(),o=yT(t);return Y(()=>{if(!(!n&&!t||a===Rb)){if(n){let e=r?.current;G_(e)&&e.closest(`label`)!=null?a(t??null):a(i??o)}else t&&a(t);return()=>{t&&a(void 0)}}},[t,r,i,a,n,o]),i??o}var RP=(e,t)=>Object.is(e,t);function zP(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function BP(e,t,n){return!e||e.length===0?!1:e.some(e=>e===void 0?!1:zP(e,t,n))}function VP(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e===void 0?!1:zP(e,t,n))}function HP(e,t,n){return e.filter(e=>!zP(e,t,n))}function UP(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function WP(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function GP(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return UP(e)}function KP(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?UP(e.value):UP(e)}function qP(e,t,n){if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??GP(e,n);if(Array.isArray(t)){let r=WP(t)?t.flatMap(e=>e.items):t;if(e==null){let t=r.find(e=>e.value==null);return t&&t.label!=null?t.label:GP(e,n)}if(typeof e!=`object`){let t=r.find(t=>t&&t.value===e);return t&&t.label!=null?t.label:GP(e,n)}if(`value`in e){let t=r.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return GP(e,n)}function JP(e,t){return!Array.isArray(e)||e.length===0?``:e.map(e=>GP(e,t)).join(`, `)}var YP={id:Z(e=>e.id),modal:Z(e=>e.modal),multiple:Z(e=>e.multiple),items:Z(e=>e.items),itemToStringLabel:Z(e=>e.itemToStringLabel),itemToStringValue:Z(e=>e.itemToStringValue),isItemEqualToValue:Z(e=>e.isItemEqualToValue),value:Z(e=>e.value),open:Z(e=>e.open),mounted:Z(e=>e.mounted),forceMount:Z(e=>e.forceMount),transitionStatus:Z(e=>e.transitionStatus),touchModality:Z(e=>e.touchModality),activeIndex:Z(e=>e.activeIndex),selectedIndex:Z(e=>e.selectedIndex),isActive:Z((e,t)=>e.activeIndex===t),isSelected:Z((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>zP(e,n,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:zP(i,n,r)}),isSelectedByFocus:Z((e,t)=>e.selectedIndex===t),popupProps:Z(e=>e.popupProps),triggerProps:Z(e=>e.triggerProps),triggerElement:Z(e=>e.triggerElement),positionerElement:Z(e=>e.positionerElement),listElement:Z(e=>e.listElement),scrollUpArrowVisible:Z(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Z(e=>e.scrollDownArrowVisible),hasScrollArrows:Z(e=>e.hasScrollArrows),serializedValue:Z(e=>{let{multiple:t,value:n,itemToStringValue:r}=e;return t&&Array.isArray(n)&&n.length===0?``:KP(n,r)})},XP=W.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Rb,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function ZP(){return W.useContext(XP)}function QP(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function $P(e){let{enabled:t=!0,value:n,id:r,name:i,controlRef:a,commit:o}=e,{formRef:s}=ZP(),{invalid:c,markedDirtyRef:l,validityData:u,setValidityData:d}=PP(),f=X(e.getValue);Y(()=>{if(!t)return;let e=n;e===void 0&&(e=f()),u.initialValue===null&&e!==null&&d(t=>({...t,initialValue:e}))},[t,d,n,u.initialValue,f]),Y(()=>{!t||!r||s.current.fields.set(r,{getValue:f,name:i,controlRef:a,validityData:QP(u,c),validate(){let e=n;e===void 0&&(e=f()),l.current=!0,iS.flushSync(()=>o(e))}})},[o,a,t,s,f,r,c,l,i,u,n]),Y(()=>{let e=s.current.fields;return()=>{r&&e.delete(r)}},[s,r])}function eF(e,t){let n=W.useRef(e),r=X(t);Y(()=>{n.current!==e&&r(n.current)},[e,r]),Y(()=>{n.current=e},[e])}function tF(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,disabled:l=!1,readOnly:u=!1,required:d=!1,modal:f=!0,actionsRef:p,inputRef:m,onOpenChangeComplete:h,items:g,multiple:_=!1,itemToStringLabel:v,itemToStringValue:y,isItemEqualToValue:b=RP,highlightItemOnHover:x=!0,children:S}=e,{clearErrors:C}=ZP(),{setDirty:w,shouldValidateOnChange:T,validityData:E,setFilled:D,name:O,disabled:k,validation:A}=PP(),{controlId:j}=IP(),M=LP({id:t}),N=k||l,P=O??c,[F,I]=TP({controlled:n,default:_?r??zb:r,name:`Select`,state:`value`}),[L,R]=TP({controlled:a,default:o,name:`Select`,state:`open`}),z=W.useRef([]),ee=W.useRef([]),te=W.useRef(null),B=W.useRef(null),V=W.useRef(0),H=W.useRef(null),ne=W.useRef([]),re=W.useRef(!1),ie=W.useRef(!1),ae=W.useRef(null),oe=W.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),se=W.useRef(!1),{mounted:ce,setMounted:le,transitionStatus:ue}=fw(L),U=P_(()=>new cw({id:M,modal:f,multiple:_,itemToStringLabel:v,itemToStringValue:y,isItemEqualToValue:b,value:F,open:L,mounted:ce,transitionStatus:ue,items:g,forceMount:!1,touchModality:!1,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,de=aw(U,YP.activeIndex),fe=aw(U,YP.selectedIndex),pe=aw(U,YP.triggerElement),me=aw(U,YP.positionerElement),he=W.useMemo(()=>_&&Array.isArray(F)&&F.length===0?``:KP(F,y),[_,F,y]),ge=dv(U.state.triggerElement);$P({id:M,commit:A.commit,value:F,controlRef:ge,name:P,getValue:()=>F});let _e=W.useRef(F);Y(()=>{F!==_e.current&&U.set(`forceMount`,!0)},[U,F]),Y(()=>{D(F!==null)},[F,D]),Y(function(){if(L)return;let e=ne.current;if(_){let t=Array.isArray(F)?F:[];if(t.length===0){U.set(`selectedIndex`,null);return}let n=t[t.length-1],r=VP(e,n,b);U.set(`selectedIndex`,r===-1?null:r);return}let t=VP(e,F,b);U.set(`selectedIndex`,t===-1?null:t)},[_,L,F,ne,b,U]),eF(F,()=>{C(P),w(F!==E.initialValue),T()?A.commit(F):A.commit(F,!0)});let ve=X((e,t)=>{if(s?.(e,t),!t.isCanceled&&(R(e),!e&&U.state.activeIndex!==null)){let e=z.current[U.state.activeIndex];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}}),ye=X(()=>{le(!1),U.set(`activeIndex`,null),h?.(!1)});mw({enabled:!p,open:L,ref:te,onComplete(){L||ye()}}),W.useImperativeHandle(p,()=>({unmount:ye}),[ye]);let be=X((e,t)=>{i?.(e,t),!t.isCanceled&&I(e)}),xe=X(()=>{let e=U.state.listElement||te.current;if(!e)return;let t=e.scrollTop,n=e.scrollTop+e.clientHeight,r=t>1,i=n<e.scrollHeight-1;U.state.scrollUpArrowVisible!==r&&U.set(`scrollUpArrowVisible`,r),U.state.scrollDownArrowVisible!==i&&U.set(`scrollDownArrowVisible`,i)}),Se=Cw({open:L,onOpenChange:ve,elements:{reference:pe,floating:me}}),{getReferenceProps:Ce,getFloatingProps:we,getItemProps:Te}=Rw([xS(Se,{enabled:!u&&!N,event:`mousedown`}),IC(Se,{bubbles:!1}),qw(Se,{enabled:!u&&!N,listRef:z,activeIndex:de,selectedIndex:fe,disabledIndices:zb,onNavigate(e){e===null&&!L||U.set(`activeIndex`,e)},focusItemOnHover:!1}),Xw(Se,{enabled:!u&&!N&&(L||!_),listRef:ee,activeIndex:de,selectedIndex:fe,onMatch(e){L?U.set(`activeIndex`,e):be(ne.current[e],ax(`none`))},onTypingChange(e){re.current=e}})]);wP(()=>{U.update({popupProps:we(),triggerProps:Ce()})}),Y(()=>{U.update({id:M,modal:f,multiple:_,value:F,open:L,mounted:ce,transitionStatus:ue,popupProps:we(),triggerProps:Ce(),items:g,itemToStringLabel:v,itemToStringValue:y,isItemEqualToValue:b})},[U,M,f,_,F,L,ce,ue,we,Ce,g,v,y,b]);let Ee=W.useMemo(()=>({store:U,name:P,required:d,disabled:N,readOnly:u,multiple:_,itemToStringLabel:v,itemToStringValue:y,highlightItemOnHover:x,setValue:be,setOpen:ve,listRef:z,popupRef:te,scrollHandlerRef:B,handleScrollArrowVisibility:xe,scrollArrowsMountedCountRef:V,getItemProps:Te,events:Se.context.events,valueRef:H,valuesRef:ne,labelsRef:ee,typingRef:re,selectionRef:oe,selectedItemTextRef:ae,validation:A,onOpenChangeComplete:h,keyboardActiveRef:ie,alignItemWithTriggerActiveRef:se,initialValueRef:_e}),[U,P,d,N,u,_,v,y,x,be,ve,Te,Se.context.events,A,h,xe]),De=dx(m,A.inputRef),Oe=_&&Array.isArray(F)&&F.length>0,ke=W.useMemo(()=>!_||!Array.isArray(F)||!P?null:F.map(e=>{let t=KP(e,y);return(0,G.jsx)(`input`,{type:`hidden`,name:P,value:t},t)}),[_,F,P,y]);return(0,G.jsx)(EP.Provider,{value:Ee,children:(0,G.jsxs)(DP.Provider,{value:Se,children:[S,(0,G.jsx)(`input`,{...A.getInputValidationProps({onFocus(){U.state.triggerElement?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.value,n=ax(Kb,e.nativeEvent);function r(){if(_)return;let e=ne.current.find(e=>KP(e,y).toLowerCase()===t.toLowerCase());e!=null&&(w(e!==E.initialValue),be(e,n),T()&&A.commit(e))}U.set(`forceMount`,!0),queueMicrotask(r)}}),id:t||j||void 0,name:_?void 0:P,value:he,disabled:N,required:d&&!Oe,readOnly:u,ref:De,style:_x,tabIndex:-1,"aria-hidden":!0}),ke]})})}function nF(e){let t=e.getBoundingClientRect(),n=window.getComputedStyle(e,`::before`),r=window.getComputedStyle(e,`::after`);if(!(n.content!==`none`||r.content!==`none`))return t;let i=parseFloat(n.width)||0,a=parseFloat(n.height)||0,o=parseFloat(r.width)||0,s=parseFloat(r.height)||0,c=Math.max(t.width,i,o),l=Math.max(t.height,a,s),u=c-t.width,d=l-t.height;return{left:t.left-u/2,right:t.right+u/2,top:t.top-d/2,bottom:t.bottom+d/2}}var rF=2,iF={..._T,...MP,value:()=>null},aF=W.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,...o}=e,{setTouched:s,setFocused:c,validationMode:l,state:u,disabled:d}=PP(),{labelId:f}=IP(),{store:p,setOpen:m,selectionRef:h,validation:g,readOnly:_,alignItemWithTriggerActiveRef:v,disabled:y,keyboardActiveRef:b}=OP(),x=d||y||i,S=aw(p,YP.open),C=aw(p,YP.value),w=aw(p,YP.triggerProps),T=aw(p,YP.positionerElement),E=aw(p,YP.listElement),D=aw(p,YP.serializedValue),O=dv(T),k=W.useRef(null),A=z_(),j=z_(),{getButtonProps:M,buttonRef:N}=eP({disabled:x,native:a}),P=dx(t,k,N,X(e=>{p.set(`triggerElement`,e)})),F=z_(),I=z_();W.useEffect(()=>{if(S)return I.start(200,()=>{h.current.allowUnselectedMouseUp=!0,F.start(200,()=>{h.current.allowSelectedMouseUp=!0})}),()=>{F.clear(),I.clear()};h.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},j.clear()},[S,h,j,F,I]);let L=W.useMemo(()=>E?.id??Gv(T)?.id,[E,T]),R=Ux(w,{role:`combobox`,"aria-expanded":S?`true`:`false`,"aria-haspopup":`listbox`,"aria-controls":S?L:void 0,"aria-labelledby":f,"aria-readonly":_||void 0,tabIndex:x?-1:0,ref:P,onFocus(e){c(!0),S&&v.current&&m(!1,ax(Qb,e.nativeEvent)),A.start(0,()=>{p.set(`forceMount`,!0)})},onBlur(){s(!0),c(!1),l===`onBlur`&&g.commit(C)},onPointerMove({pointerType:e}){b.current=!1,p.set(`touchModality`,e===`touch`)},onPointerDown({pointerType:e}){p.set(`touchModality`,e===`touch`)},onKeyDown(){b.current=!0},onMouseDown(e){if(S)return;let t=Sx(e.currentTarget);function n(e){if(!k.current)return;let t=e.target;if(Lv(k.current,t)||Lv(O.current,t)||t===k.current)return;let n=nF(k.current);e.clientX>=n.left-rF&&e.clientX<=n.right+rF&&e.clientY>=n.top-rF&&e.clientY<=n.bottom+rF||m(!1,ax(tx,e))}j.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},g.getValidationProps,o,M);R.role=`combobox`;let z=W.useMemo(()=>({...u,open:S,disabled:x,value:C,readOnly:_,placeholder:!D}),[u,S,x,C,_,D]);return eS(`button`,e,{ref:[t,k],state:z,stateAttributesMapping:iF,props:R})}),oF={value:()=>null},sF=W.forwardRef(function(e,t){let{className:n,render:r,children:i,...a}=e,{store:o,valueRef:s}=OP(),c=aw(o,YP.value),l=aw(o,YP.items),u=aw(o,YP.itemToStringLabel),d=aw(o,YP.serializedValue),f=W.useMemo(()=>({value:c,placeholder:!d}),[c,d]),p=typeof i==`function`?i(c):i??(Array.isArray(c)?JP(c,u):qP(c,l,u));return eS(`span`,e,{state:f,ref:[t,s],props:[{children:p},a],stateAttributesMapping:oF})}),cF=W.forwardRef(function(e,t){let{className:n,render:r,...i}=e,{store:a}=OP(),o=aw(a,YP.open);return eS(`span`,e,{state:W.useMemo(()=>({open:o}),[o]),ref:t,props:[{"aria-hidden":!0,children:`▼`},i],stateAttributesMapping:gT})}),lF=W.createContext(void 0),uF=W.forwardRef(function(e,t){let{store:n}=OP(),r=aw(n,YP.mounted),i=aw(n,YP.forceMount);return r||i?(0,G.jsx)(lF.Provider,{value:!0,children:(0,G.jsx)(lS,{ref:t,...e})}):null}),dF=W.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function fF(){return W.useContext(dF)}function pF(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=X(i),o=W.useRef(0),s=P_(hF).current,c=P_(mF).current,[l,u]=W.useState(0),d=W.useRef(l),f=X((e,t)=>{c.set(e,t??null),d.current+=1,u(d.current)}),p=X(e=>{c.delete(e),d.current+=1,u(d.current)}),m=W.useMemo(()=>{let e=new Map;return Array.from(c.keys()).filter(e=>e.isConnected).sort(gF).forEach((t,n)=>{let r=c.get(t)??{};e.set(t,{...r,index:n})}),e},[c,l]);Y(()=>{if(typeof MutationObserver!=`function`||m.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(d.current+=1,u(d.current))});return m.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[m]),Y(()=>{d.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),o.current=m.size),a(m)},[a,m,n,r,l]),Y(()=>()=>{n.current=[]},[n]),Y(()=>()=>{r&&(r.current=[])},[r]);let h=X(e=>(s.add(e),()=>{s.delete(e)}));Y(()=>{s.forEach(e=>e(m))},[s,m]);let g=W.useMemo(()=>({register:f,unregister:p,subscribeMapChange:h,elementsRef:n,labelsRef:r,nextIndexRef:o}),[f,p,h,n,r,o]);return(0,G.jsx)(dF.Provider,{value:g,children:t})}function mF(){return new Map}function hF(){return new Set}function gF(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}var _F=W.createContext(void 0);function vF(){let e=W.useContext(_F);if(!e)throw Error(A_(59));return e}function yF(e,t){e&&Object.assign(e.style,t)}var bF={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},xF={position:`fixed`},SF=W.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=Ub,..._}=e,{store:v,listRef:y,labelsRef:b,alignItemWithTriggerActiveRef:x,selectedItemTextRef:S,valuesRef:C,initialValueRef:w,popupRef:T,setValue:E}=OP(),D=kP(),O=aw(v,YP.open),k=aw(v,YP.mounted),A=aw(v,YP.modal),j=aw(v,YP.value),M=aw(v,YP.touchModality),N=aw(v,YP.positionerElement),P=aw(v,YP.triggerElement),F=aw(v,YP.isItemEqualToValue),I=W.useRef(null),L=W.useRef(null),[R,z]=W.useState(h),ee=k&&R&&!M;!k&&R!==h&&z(h),Y(()=>{k||(YP.scrollUpArrowVisible(v.state)&&v.set(`scrollUpArrowVisible`,!1),YP.scrollDownArrowVisible(v.state)&&v.set(`scrollDownArrowVisible`,!1))},[v,k]),W.useImperativeHandle(x,()=>ee),VN((ee||A)&&O&&!M,P);let te=RT({anchor:n,floatingRootContext:D,positionMethod:r,mounted:k,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??ee,collisionAvoidance:g,keepMounted:!0}),B=ee?`none`:te.side,V=ee?xF:te.positionerStyles,H=W.useMemo(()=>{let e={};return O||(e.pointerEvents=`none`),{role:`presentation`,hidden:!k,style:{...V,...e}}},[O,k,V]),ne=W.useMemo(()=>({open:O,side:B,align:te.align,anchorHidden:te.anchorHidden}),[O,B,te.align,te.anchorHidden]),re=eS(`div`,e,{ref:[t,X(e=>{v.set(`positionerElement`,e)})],state:ne,stateAttributesMapping:vT,props:[H,_]}),ie=W.useRef(0),ae=X(e=>{if(e.size===0&&ie.current===0||C.current.length===0)return;let t=ie.current;if(ie.current=e.size,e.size===t)return;let n=ax(Kb);if(t!==0&&!v.state.multiple&&j!==null&&VP(C.current,j,F)===-1){let e=w.current,t=e!=null&&BP(C.current,e,F)?e:null;E(t,n),t===null&&(v.set(`selectedIndex`,null),S.current=null)}if(t!==0&&v.state.multiple&&Array.isArray(j)){let e=j.filter(e=>BP(C.current,e,F));(e.length!==j.length||e.some(e=>!BP(j,e,F)))&&(E(e,n),e.length===0&&(v.set(`selectedIndex`,null),S.current=null))}if(O&&ee){v.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};yF(N,e),yF(T.current,e)}}),oe=W.useMemo(()=>({...te,side:B,alignItemWithTriggerActive:ee,setControlledAlignItemWithTrigger:z,scrollUpArrowRef:I,scrollDownArrowRef:L}),[te,B,ee,z]);return(0,G.jsx)(pF,{elementsRef:y,labelsRef:b,onMapChange:ae,children:(0,G.jsxs)(_F.Provider,{value:oe,children:[k&&A&&(0,G.jsx)(cP,{inert:XT(!O),cutout:P}),re]})})});function CF(e){let t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}var wF=`base-ui-disable-scrollbar`,TF={className:wF,element:(0,G.jsx)(`style`,{href:wF,precedence:`base-ui:low`,children:`.${wF}{scrollbar-width:none}.${wF}::-webkit-scrollbar{display:none}`})},EF={...vT,...cT},DF=W.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{store:a,popupRef:o,onOpenChangeComplete:s,setOpen:c,valueRef:l,selectedItemTextRef:u,keyboardActiveRef:d,multiple:f,handleScrollArrowVisibility:p,scrollHandlerRef:m}=OP(),{side:h,align:g,alignItemWithTriggerActive:_,setControlledAlignItemWithTrigger:v,scrollDownArrowRef:y,scrollUpArrowRef:b}=vF(),x=bP(!0)!=null,S=kP(),C=z_(),w=aw(a,YP.id),T=aw(a,YP.open),E=aw(a,YP.mounted),D=aw(a,YP.popupProps),O=aw(a,YP.transitionStatus),k=aw(a,YP.triggerElement),A=aw(a,YP.positionerElement),j=aw(a,YP.listElement),M=W.useRef(0),N=W.useRef(!1),P=W.useRef(0),F=W.useRef(!1),I=W.useRef({}),L=xx(),R=X(e=>{if(!A||!o.current||!F.current)return;if(N.current||!_){p();return}let t=A.style.top===`0px`,n=A.style.bottom===`0px`,r=A.getBoundingClientRect().height,i=Sx(A),a=getComputedStyle(A),s=parseFloat(a.marginTop),c=parseFloat(a.marginBottom),l=i.documentElement.clientHeight-s-c,u=e.scrollTop,d=e.scrollHeight-e.clientHeight,f=null,m=null,h=!1;if(t){let e=r+(d-u),t=Math.min(e,l);f=t,t===l?h=!0:m=d}else if(n){let e=u-0,t=r+e,n=Math.min(t,l),i=t-l;f=n,n===l?(h=!0,u<d&&(m=u-(e-i))):m=0}f!=null&&(A.style.height=`${f}px`),m!=null&&(e.scrollTop=m),h&&(N.current=!0),p()});W.useImperativeHandle(m,()=>R,[R]),mw({open:T,ref:o,onComplete(){T&&s?.(!0)}});let z=W.useMemo(()=>({open:T,transitionStatus:O,side:h,align:g}),[T,O,h,g]);Y(()=>{!A||!o.current||Object.keys(I.current).length||(I.current={top:A.style.top||`0`,left:A.style.left||`0`,right:A.style.right,height:A.style.height,bottom:A.style.bottom,minHeight:A.style.minHeight,maxHeight:A.style.maxHeight,marginTop:A.style.marginTop,marginBottom:A.style.marginBottom})},[o,A]),Y(()=>{E||_||(F.current=!1,N.current=!1,M.current=0,P.current=0,yF(A,I.current))},[E,_,A,o]),Y(()=>{let e=o.current;if(!(!E||!k||!A||!e)){if(!_){F.current=!0,L.request(p);return}queueMicrotask(()=>{let t=getComputedStyle(A),n=getComputedStyle(e),r=Sx(k),i=H_(A),a=k.getBoundingClientRect(),o=A.getBoundingClientRect(),s=a.left,c=a.height,d=j||e,f=d.scrollHeight,m=parseFloat(n.borderBottomWidth),h=parseFloat(t.marginTop)||10,g=parseFloat(t.marginBottom)||10,_=parseFloat(t.minHeight)||100,y=r.documentElement.clientHeight-h-g,b=r.documentElement.clientWidth,x=y-a.bottom+c,S=u.current,C=l.current,w=0,T=0;if(S&&C){let e=C.getBoundingClientRect(),t=S.getBoundingClientRect(),n=e.left-s,r=t.left-o.left,i=e.top-a.top+e.height/2,c=t.top-o.top+t.height/2;w=n-r,T=c-i}let E=x+T+g+m,D=Math.min(y,E),O=y-h-g,P=E-D,L=Math.max(5,s+w),R=b-5,z=Math.max(0,L+o.width-R);A.style.left=`${L-z}px`,A.style.height=`${D}px`,A.style.maxHeight=`auto`,A.style.marginTop=`${h}px`,A.style.marginBottom=`${g}px`,e.style.height=`100%`;let ee=d.scrollHeight-d.clientHeight,te=P>=ee;te&&(D=Math.min(y,o.height)-(P-ee));let B=a.top<20||a.bottom>y-20||D<Math.min(f,_),V=(i.visualViewport?.scale??1)!==1&&xv;if(B||V){F.current=!0,yF(A,I.current),iS.flushSync(()=>v(!1));return}if(te){let e=Math.max(0,y-E);A.style.top=o.height>=O?`0`:`${e}px`,A.style.height=`${D}px`,d.scrollTop=d.scrollHeight-d.clientHeight,M.current=Math.max(_,D)}else A.style.bottom=`0`,M.current=Math.max(_,D),d.scrollTop=P;M.current===y&&(N.current=!0),p(),setTimeout(()=>{F.current=!0})})}},[a,E,A,k,l,u,o,p,_,v,L,y,b,j]),W.useEffect(()=>{if(!_||!A||!E)return;let e=H_(A);function t(e){c(!1,ax(ix,e))}return e.addEventListener(`resize`,t),()=>{e.removeEventListener(`resize`,t)}},[c,_,A,E]);let ee={...j?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":f||void 0,id:`${w}-list`},onKeyDown(e){d.current=!0,x&&vP.has(e.key)&&e.stopPropagation()},onMouseMove(){d.current=!1},onPointerLeave(e){if(CF(e)||e.pointerType===`touch`)return;let t=e.currentTarget;C.start(0,()=>{a.set(`activeIndex`,null),t.focus({preventScroll:!0})})},onScroll(e){j||m.current?.(e.currentTarget)},..._&&{style:j?{height:`100%`}:bF}},te=eS(`div`,e,{ref:[t,o],state:z,stateAttributesMapping:EF,props:[D,ee,BT(O),{className:!j&&_?TF.className:void 0},i]});return(0,G.jsxs)(W.Fragment,{children:[TF.element,(0,G.jsx)(bS,{context:S,modal:!1,disabled:!E,restoreFocus:!0,children:te})]})}),OF=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function kF(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=fF(),f=W.useRef(-1),[p,m]=W.useState(a??(i===OF.GuessFromOrder?()=>{if(f.current===-1){let e=d.current;d.current+=1,f.current=e}return f.current}:-1)),h=W.useRef(null),g=W.useCallback(e=>{if(h.current=e,p!==-1&&e!==null&&(l.current[p]=e,u)){let n=t!==void 0;u.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,l,u,t,r]);return Y(()=>{if(a!=null)return;let e=h.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),Y(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&m(t)})},[a,c,m]),W.useMemo(()=>({ref:g,index:p}),[p,g])}var AF=W.createContext(void 0);function jF(){let e=W.useContext(AF);if(!e)throw Error(A_(57));return e}var MF=W.memo(W.forwardRef(function(e,t){let{render:n,className:r,value:i=null,label:a,disabled:o=!1,nativeButton:s=!1,...c}=e,l=W.useRef(null),u=kF({label:a,textRef:l,indexGuessBehavior:OF.GuessFromOrder}),{store:d,getItemProps:f,setOpen:p,setValue:m,selectionRef:h,typingRef:g,valuesRef:_,keyboardActiveRef:v,multiple:y,highlightItemOnHover:b}=OP(),x=z_(),S=aw(d,YP.isActive,u.index),C=aw(d,YP.isSelected,u.index,i),w=aw(d,YP.isSelectedByFocus,u.index),T=aw(d,YP.isItemEqualToValue),E=u.index,D=E!==-1,O=W.useRef(null),k=dv(E);Y(()=>{if(!D)return;let e=_.current;return e[E]=i,()=>{delete e[E]}},[D,E,i,_]),Y(()=>{if(!D)return;let e=d.state.value,t=e;y&&Array.isArray(e)&&e.length>0&&(t=e[e.length-1]),t!==void 0&&zP(t,i,T)&&d.set(`selectedIndex`,E)},[D,E,y,T,d,i]);let A=W.useMemo(()=>({disabled:o,selected:C,highlighted:S}),[o,C,S]),j=f({active:S,selected:C});j.onFocus=void 0,j.id=void 0;let M=W.useRef(null),N=W.useRef(`mouse`),P=W.useRef(!1),{getButtonProps:F,buttonRef:I}=eP({disabled:o,focusableWhenDisabled:!0,native:s});function L(e){let t=d.state.value;if(y){let n=Array.isArray(t)?t:[];m(C?HP(n,i,T):[...n,i],ax(Zb,e))}else m(i,ax(Zb,e)),p(!1,ax(Zb,e))}let R={role:`option`,"aria-selected":C,"aria-disabled":o||void 0,tabIndex:S?0:-1,onFocus(){d.set(`activeIndex`,E)},onMouseEnter(){!v.current&&d.state.selectedIndex===null&&d.set(`activeIndex`,E)},onMouseMove(){b&&d.set(`activeIndex`,E)},onMouseLeave(e){!b||v.current||CF(e)||x.start(0,()=>{d.state.activeIndex===E&&d.set(`activeIndex`,null)})},onTouchStart(){h.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(e){M.current=e.key,d.set(`activeIndex`,E)},onClick(e){P.current=!1,!(e.type===`keydown`&&M.current===null)&&(o||M.current===` `&&g.current||N.current!==`touch`&&!S||(M.current=null,L(e.nativeEvent)))},onPointerEnter(e){N.current=e.pointerType},onPointerDown(e){N.current=e.pointerType,P.current=!0},onMouseUp(e){if(o)return;if(P.current){P.current=!1;return}let t=!h.current.allowSelectedMouseUp&&C,n=!h.current.allowUnselectedMouseUp&&!C;t||n||N.current!==`touch`&&!S||L(e.nativeEvent)}},z=eS(`div`,e,{ref:[I,t,u.ref,O],state:A,props:[j,R,c,F]}),ee=W.useMemo(()=>({selected:C,indexRef:k,textRef:l,selectedByFocus:w,hasRegistered:D}),[C,k,l,w,D]);return(0,G.jsx)(AF.Provider,{value:ee,children:z})})),NF=W.forwardRef(function(e,t){let n=e.keepMounted??!1,{selected:r}=jF();return n||r?(0,G.jsx)(PF,{...e,ref:t}):null}),PF=W.memo(W.forwardRef((e,t)=>{let{render:n,className:r,keepMounted:i,...a}=e,{selected:o}=jF(),s=W.useRef(null),{transitionStatus:c,setMounted:l}=fw(o),u=W.useMemo(()=>({selected:o,transitionStatus:c}),[o,c]),d=eS(`span`,e,{ref:[t,s],state:u,props:[{"aria-hidden":!0,children:`✔️`},a],stateAttributesMapping:cT});return mw({open:o,ref:s,onComplete(){o||l(!1)}}),d})),FF=W.memo(W.forwardRef(function(e,t){let{indexRef:n,textRef:r,selectedByFocus:i,hasRegistered:a}=jF(),{selectedItemTextRef:o}=OP(),{className:s,render:c,...l}=e;return eS(`div`,e,{ref:[W.useCallback(e=>{if(!e||!a)return;let t=o.current===null||!o.current.isConnected;(i||t&&n.current===0)&&(o.current=e)},[o,n,i,a]),t,r],props:l})}));function IF({value:e,onValueChange:t,options:n,ariaLabel:r,className:i}){return(0,G.jsxs)(tF,{value:e,onValueChange:e=>t(e),modal:!1,children:[(0,G.jsxs)(aF,{className:`ui-select-trigger ${i??``}`,"aria-label":r,children:[(0,G.jsx)(sF,{children:e=>n.find(t=>t.value===e)?.label??e}),(0,G.jsx)(cF,{className:`ui-select-icon`,children:(0,G.jsx)(GM,{size:12})})]}),(0,G.jsx)(uF,{children:(0,G.jsx)(SF,{className:`ui-select-positioner`,sideOffset:4,align:`end`,side:`bottom`,alignItemWithTrigger:!1,children:(0,G.jsx)(DF,{className:`ui-select-popup`,children:n.map(e=>(0,G.jsxs)(MF,{value:e.value,className:`ui-select-item`,children:[(0,G.jsx)(FF,{children:e.label}),(0,G.jsx)(NF,{className:`ui-select-indicator`,children:(0,G.jsx)(HM,{size:13})})]},e.value))})})})]})}function LF({id:e,value:t,onChange:n,placeholder:r,rows:i=3,ariaLabel:a,textareaClassName:o,onSubmitShortcut:s}){let[c,l]=(0,W.useState)(`write`),u=(0,W.useRef)(null),d=(0,W.useRef)(t);(0,W.useEffect)(()=>{d.current=t},[t]);let f=async e=>{let r=e.clipboardData.items,i=null;for(let e=0;e<r.length;e++){let t=r[e];if(t.kind===`file`&&t.type.startsWith(`image/`)){i=t.getAsFile();break}}if(!i)return;e.preventDefault();let a=u.current;if(!a)return;let o=a.selectionStart,s=a.selectionEnd,c=Math.random().toString(36).slice(2,8),l=`![Uploading image… ${c}]()`,f=t.slice(0,o)+l+t.slice(s);n(f),d.current=f;try{let e=new FormData;e.append(`file`,i,i.name||`pasted-${c}.png`);let t=await fetch(`/api/attachments`,{method:`POST`,body:e});if(!t.ok)throw Error(`HTTP ${t.status}`);let r=await t.json();if(!r.url)throw Error(r.error||`Upload failed`);n(d.current.replace(l,`![pasted image](${r.url})`))}catch(e){console.error(`Image upload failed:`,e),n(d.current.replace(l,`![upload failed]()`))}};return(0,G.jsxs)(`div`,{className:`md-field`,children:[(0,G.jsxs)(`div`,{className:`comment-form-tabs`,role:`tablist`,"aria-label":`Markdown editor mode`,children:[(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":c===`write`,onClick:()=>l(`write`),onKeyDown:e=>{e.key===`ArrowRight`&&(e.preventDefault(),l(`preview`))},className:`comment-form-tab-btn ${c===`write`?`comment-form-tab-btn-active`:`comment-form-tab-btn-inactive`}`,children:`Write`}),(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":c===`preview`,onClick:()=>l(`preview`),onKeyDown:e=>{e.key===`ArrowLeft`&&(e.preventDefault(),l(`write`))},className:`comment-form-tab-btn ${c===`preview`?`comment-form-tab-btn-active`:`comment-form-tab-btn-inactive`}`,children:`Preview`})]}),c===`write`?(0,G.jsx)(`textarea`,{id:e,ref:u,className:o,value:t,rows:i,placeholder:r,"aria-label":a,onChange:e=>n(e.target.value),onPaste:f,onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),s?.())}}):(0,G.jsx)(`div`,{className:`md-field-preview markdown-body`,role:`tabpanel`,"aria-label":`Markdown preview`,dangerouslySetInnerHTML:{__html:t.trim()?mj(t):`<span class="md-field-empty">Nothing to preview</span>`}})]})}var RF=[{value:`approved`,label:`Approve`,description:`The changes look good — the agent can proceed.`,icon:HM,className:`plan-verdict-approve`},{value:`changes-requested`,label:`Request edits`,description:`The agent should address the comments and apply edits.`,icon:uN,className:`plan-verdict-changes`},{value:`rejected`,label:`Reject`,description:`Don't keep building on this — the approach needs rethinking.`,icon:NN,className:`plan-verdict-reject`}];function zF({comments:e,onEditComment:t,onDeleteComment:n,onSend:r,sending:i,agentWaiting:a,onCopyComments:o}){let{haptic:s,sound:c}=bM(),[l,u]=(0,W.useState)(!1),[d,f]=(0,W.useState)(``),[p,m]=(0,W.useState)(null),[h,g]=(0,W.useState)(!1),_=async()=>{o&&(await o(),g(!0),setTimeout(()=>g(!1),2e3))},v=e.length,y=(0,W.useMemo)(()=>[...e].sort((e,t)=>e.createdAt-t.createdAt),[e]),b=async()=>{p&&(s(`heavy`),c(`send`),await r(p,d),f(``),m(null),u(!1))};return(0,G.jsx)(CP,{open:l,onOpenChange:u,ariaLabel:`Submit your review to the agent`,className:`send-review-popover`,trigger:(0,G.jsxs)(`button`,{className:`btn btn-primary btn-sm`,disabled:i,title:a?`An agent is connected and waiting`:`Submit your review to a waiting agent`,style:{display:`inline-flex`,alignItems:`center`,gap:`6px`},children:[a&&(0,G.jsx)(`span`,{className:`agent-waiting-dot`,"aria-hidden":`true`}),(0,G.jsx)(VM,{size:14}),(0,G.jsx)(`span`,{children:i?`Sending…`:v>0?`Send to agent (${v})`:`Send to agent`})]}),children:(0,G.jsxs)(`div`,{className:`srp`,children:[(0,G.jsxs)(`div`,{className:`srp-head`,children:[(0,G.jsx)(VM,{size:15,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`srp-title`,children:`Send review to agent`}),(0,G.jsxs)(`span`,{className:`srp-count`,children:[v,` comment`,v===1?``:`s`]})]}),(0,G.jsx)(`div`,{className:`plan-verdict-options`,role:`radiogroup`,"aria-label":`Verdict`,children:RF.map(e=>{let t=e.icon,n=p===e.value;return(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":n,className:`plan-verdict-option ${e.className} ${n?`plan-verdict-option-selected`:``}`,onClick:()=>m(e.value),children:[(0,G.jsx)(`span`,{className:`plan-verdict-icon`,children:(0,G.jsx)(t,{size:15,"aria-hidden":`true`})}),(0,G.jsxs)(`span`,{className:`plan-verdict-text`,children:[(0,G.jsx)(`span`,{className:`plan-verdict-label`,children:e.label}),(0,G.jsx)(`span`,{className:`plan-verdict-desc`,children:e.description})]}),(0,G.jsx)(`span`,{className:`plan-verdict-radio`,"aria-hidden":`true`})]},e.value)})}),v>0?(0,G.jsx)(`ul`,{className:`srp-list`,"aria-label":`Comments to send`,children:y.map(e=>(0,G.jsx)(BF,{comment:e,onEdit:t,onDelete:n},e.id))}):(0,G.jsx)(`p`,{className:`srp-empty`,children:`No inline comments — your verdict and overall note will be sent on their own.`}),(0,G.jsxs)(`div`,{className:`srp-general`,children:[(0,G.jsxs)(`label`,{className:`srp-general-label`,htmlFor:`srp-general-input`,children:[`Overall comment `,(0,G.jsx)(`span`,{className:`srp-optional`,children:`(optional · Markdown)`})]}),(0,G.jsx)(LF,{id:`srp-general-input`,value:d,onChange:f,textareaClassName:`srp-general-input`,placeholder:`Add an overall note for the agent that applies to the whole review…`,rows:3,ariaLabel:`Overall review comment`,onSubmitShortcut:b})]}),(0,G.jsxs)(`div`,{className:`srp-footer`,children:[o&&(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:_,disabled:v===0,style:{marginRight:`auto`},children:h?`Copied!`:`Copy comments`}),(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>u(!1),disabled:i,children:`Cancel`}),(0,G.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:b,disabled:!p||i,children:i?`Sending…`:`Send review`})]})]})})}function BF({comment:e,onEdit:t,onDelete:n}){let[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(e.body),s=(0,W.useRef)(null);(0,W.useEffect)(()=>{r&&(s.current?.focus(),s.current?.select())},[r]);let c=e.lineNumber>0?e.startLineNumber&&e.startLineNumber!==e.lineNumber?`:${e.startLineNumber}-${e.lineNumber}`:`:${e.lineNumber}`:` · file`,l=()=>{let n=a.trim();n&&n!==e.body&&t(e.id,n),i(!1)};return(0,G.jsxs)(`li`,{className:`srp-item`,children:[(0,G.jsxs)(`div`,{className:`srp-item-top`,children:[(0,G.jsxs)(`span`,{className:`srp-item-loc`,children:[(0,G.jsx)(`span`,{className:`srp-item-file`,children:fj(e.filePath)}),(0,G.jsx)(`span`,{className:`srp-item-line`,children:c})]}),e.status===`resolved`&&(0,G.jsx)(`span`,{className:`srp-item-resolved`,children:`resolved`}),(0,G.jsxs)(`span`,{className:`srp-item-actions`,children:[r?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`button`,{className:`srp-icon-btn`,onClick:l,title:`Save edit`,children:(0,G.jsx)(HM,{size:13,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`srp-icon-btn`,onClick:()=>{o(e.body),i(!1)},title:`Cancel edit`,children:(0,G.jsx)(NN,{size:13,"aria-hidden":`true`})})]}):(0,G.jsx)(`button`,{className:`srp-icon-btn`,onClick:()=>i(!0),title:`Edit comment`,children:(0,G.jsx)(vN,{size:13,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`srp-icon-btn srp-icon-btn-danger`,onClick:()=>n(e.id),title:`Remove from review`,children:(0,G.jsx)(ON,{size:13,"aria-hidden":`true`})})]})]}),e.lineContent?.trim()&&(0,G.jsx)(`code`,{className:`srp-item-code`,children:e.lineContent.trim().slice(0,160)}),r?(0,G.jsx)(`textarea`,{ref:s,className:`srp-item-edit`,value:a,rows:2,onChange:e=>o(e.target.value),onKeyDown:t=>{t.key===`Enter`&&(t.metaKey||t.ctrlKey)?(t.preventDefault(),l()):t.key===`Escape`&&(t.preventDefault(),o(e.body),i(!1))}}):(0,G.jsx)(`p`,{className:`srp-item-body`,children:e.body})]})}var VF=[{value:`word`,label:`Word`},{value:`word-alt`,label:`Word (alt)`},{value:`char`,label:`Character`},{value:`none`,label:`None`}],HF=[{value:`classic`,label:`Classic (+/−)`},{value:`bars`,label:`Bars`},{value:`none`,label:`None`}],UF=[{value:`line-info`,label:`Line info + context`},{value:`line-info-basic`,label:`Line info`},{value:`metadata`,label:`Metadata only`},{value:`simple`,label:`Simple`}],WF=[{value:`both`,label:`Both`},{value:`line`,label:`Line only`},{value:`number`,label:`Number only`},{value:`disabled`,label:`Disabled`}],GF=[11,12,13,14,15,16].map(e=>({value:String(e),label:`${e}px`})),KF=[2,4,8].map(e=>({value:String(e),label:String(e)})),qF=[{value:``,label:`Default`},{value:`chrome`,label:`Chrome`},{value:`firefox`,label:`Firefox`},{value:`edge`,label:`Edge`},{value:`brave`,label:`Brave`}],JF=[{value:`default`,label:`Default / System`},{value:`vscode`,label:`VS Code`},{value:`zed`,label:`Zed`},{value:`vim`,label:`Vim`},{value:`neovim`,label:`Neovim`}],YF=(0,W.memo)(function({repoName:e,branch:t,fileCount:n,additions:r,deletions:i,commentCount:a,planCount:o,pendingPlanCount:s,onOpenPlans:c,diffStyle:l,diffOptions:u,defaultTabSize:d,browser:f,theme:p,editorIDE:m,customMode:h,lineDiffType:g,lineWrap:_,diffIndicators:v,showLineNumbers:y,hunkSeparators:b,lineHoverHighlight:x,fontSize:S,haptics:C,sounds:w,uiFont:T,monoFont:E,onDiffStyleChange:D,onDiffOptionsChange:O,onDefaultTabSizeChange:k,onBrowserChange:A,onOpenThemeModal:j,onEditorIDEChange:M,onLineDiffTypeChange:N,onLineWrapChange:P,onDiffIndicatorsChange:F,onShowLineNumbersChange:I,onHunkSeparatorsChange:L,onLineHoverHighlightChange:R,onFontSizeChange:z,onHapticsChange:ee,onSoundsChange:te,onOpenUiFontModal:B,onOpenMonoFontModal:V,onOpenSearch:H,onCopyComments:ne,onSendToAgent:re,agentWaiting:ie,sending:ae,comments:oe,onEditComment:se,onDeleteComment:ce}){let[le,ue]=(0,W.useState)(!1);return(0,W.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&(e.key===`,`||e.code===`Comma`)&&(e.preventDefault(),ue(e=>!e))};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[]),(0,G.jsxs)(`div`,{className:`toolbar`,children:[(0,G.jsxs)(`div`,{className:`toolbar-left`,children:[(0,G.jsx)(`h1`,{className:`toolbar-title`,children:e}),t&&(0,G.jsxs)(`span`,{className:`toolbar-branch`,children:[(0,G.jsx)(nN,{size:12}),t]}),(0,G.jsxs)(`span`,{className:`toolbar-stat`,children:[n,` file`,n===1?``:`s`,` changed`,r>0&&(0,G.jsxs)(`span`,{className:`stat-additions`,children:[` +`,r]}),i>0&&(0,G.jsxs)(`span`,{className:`stat-deletions`,children:[` -`,i]})]})]}),(0,G.jsxs)(`div`,{className:`toolbar-right`,children:[(0,G.jsxs)(`button`,{className:`btn btn-sm toolbar-search-btn`,onClick:H,title:`Search (⌘K)`,children:[(0,G.jsx)(wN,{size:14,style:{marginRight:`6px`}}),(0,G.jsx)(`span`,{children:`Search`}),(0,G.jsx)(`kbd`,{className:`toolbar-search-kbd`,children:`⌘K`})]}),o>0&&(0,G.jsxs)(`button`,{className:`btn btn-sm toolbar-plans-btn ${s>0?`toolbar-plans-btn-pending`:``}`,onClick:c,title:s>0?`${s} plan${s===1?``:`s`} awaiting your review`:`Review agent plans`,children:[s>0&&(0,G.jsx)(`span`,{className:`agent-waiting-dot`,"aria-hidden":`true`}),(0,G.jsx)(XM,{size:14,style:{marginRight:`6px`}}),(0,G.jsx)(`span`,{children:`Plans`}),s>0&&(0,G.jsx)(`span`,{className:`toolbar-plans-badge`,children:s})]}),(0,G.jsx)(CP,{open:le,onOpenChange:ue,ariaLabel:`Settings`,className:`settings-popover`,trigger:(0,G.jsxs)(`button`,{className:`btn btn-sm settings-btn ${le?`btn-active`:``}`,title:`Settings`,children:[(0,G.jsx)(TN,{size:14}),` Settings`]}),children:(0,G.jsxs)(`div`,{className:`popover-scroll settings-panel`,children:[!h&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Source`}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:u.staged,onChange:e=>O({...u,staged:e.target.checked})}),`Show staged`]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:u.untracked,onChange:e=>O({...u,untracked:e.target.checked})}),`Show untracked`]})]}),(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Display`}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Inline diff`}),(0,G.jsx)(IF,{value:g,onValueChange:e=>N(e),options:VF,ariaLabel:`Inline diff style`})]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:_,onChange:e=>P(e.target.checked)}),`Wrap long lines`]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Diff indicators`}),(0,G.jsx)(IF,{value:v,onValueChange:e=>F(e),options:HF,ariaLabel:`Diff indicators`})]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:y,onChange:e=>I(e.target.checked)}),`Show line numbers`]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Hunk separator`}),(0,G.jsx)(IF,{value:b,onValueChange:e=>L(e),options:UF,ariaLabel:`Hunk separator style`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Hover highlight`}),(0,G.jsx)(IF,{value:x,onValueChange:e=>R(e),options:WF,ariaLabel:`Hover highlight`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Font size`}),(0,G.jsx)(IF,{value:String(S),onValueChange:e=>z(Number(e)),options:GF,ariaLabel:`Font size`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Default tab size`}),(0,G.jsx)(IF,{value:String(d),onValueChange:e=>k(Number(e)),options:KF,ariaLabel:`Default tab size`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`UI font`}),(0,G.jsxs)(`button`,{className:`btn btn-sm settings-btn`,onClick:()=>{ue(!1),B()},style:{display:`inline-flex`,alignItems:`center`},title:T??`Default (Geist Mono)`,children:[(0,G.jsx)(AN,{size:13,style:{marginRight:`4px`}}),(0,G.jsx)(`span`,{style:{maxWidth:`120px`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:T??`Default…`})]})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Code font`}),(0,G.jsxs)(`button`,{className:`btn btn-sm settings-btn`,onClick:()=>{ue(!1),V()},style:{display:`inline-flex`,alignItems:`center`},title:E??`Default (JetBrains Mono)`,children:[(0,G.jsx)(AN,{size:13,style:{marginRight:`4px`}}),(0,G.jsx)(`span`,{style:{maxWidth:`120px`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:E??`Default…`})]})]}),(0,G.jsx)(`div`,{className:`settings-section-label`,children:`External tools`}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Browser`}),(0,G.jsx)(IF,{value:f||``,onValueChange:A,options:qF,ariaLabel:`Browser`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Preferred IDE`}),(0,G.jsx)(IF,{value:m||`default`,onValueChange:M,options:JF,ariaLabel:`Preferred IDE`})]}),(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Review Options`}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Diff style`}),(0,G.jsx)(IF,{value:l,onValueChange:e=>D(e),options:[{value:`split`,label:`Split`},{value:`unified`,label:`Unified`}],ariaLabel:`Diff style`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Theme`}),(0,G.jsxs)(`button`,{className:`btn btn-sm settings-btn`,onClick:()=>{ue(!1),j()},style:{display:`inline-flex`,alignItems:`center`},children:[(0,G.jsx)(mN,{size:14,style:{marginRight:`4px`}}),(0,G.jsx)(`span`,{children:`Switch Theme...`})]})]}),(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Feedback`}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:C,onChange:e=>ee(e.target.checked)}),`Haptic feedback`]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:w,onChange:e=>te(e.target.checked)}),`Sound effects`]})]})}),(0,G.jsx)(zF,{comments:oe,onEditComment:se,onDeleteComment:ce,onSend:re,sending:ae,agentWaiting:ie,onCopyComments:ne})]})]})}),XF=W.createContext(void 0);function ZF(e){let t=W.useContext(XF);if(e===!1&&t===void 0)throw Error(A_(27));return t}var QF={...vT,...cT},$F=W.forwardRef(function(e,t){let{render:n,className:r,forceRender:i=!1,...a}=e,{store:o}=ZF(),s=o.useState(`open`),c=o.useState(`nested`),l=o.useState(`mounted`),u=o.useState(`transitionStatus`);return eS(`div`,e,{state:W.useMemo(()=>({open:s,transitionStatus:u}),[s,u]),ref:[o.context.backdropRef,t],stateAttributesMapping:QF,props:[{role:`presentation`,hidden:!l,style:{userSelect:`none`,WebkitUserSelect:`none`}},a],enabled:i||!c})}),eI=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),tI=function(e){return e[e.open=lT.open]=`open`,e[e.closed=lT.closed]=`closed`,e[e.startingStyle=lT.startingStyle]=`startingStyle`,e[e.endingStyle=lT.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),nI=W.createContext(void 0);function rI(){let e=W.useContext(nI);if(e===void 0)throw Error(A_(26));return e}var iI={...vT,...cT,nestedDialogOpen(e){return e?{[tI.nestedDialogOpen]:``}:null}},aI=W.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,...o}=e,{store:s}=ZF(),c=s.useState(`descriptionElementId`),l=s.useState(`disablePointerDismissal`),u=s.useState(`floatingRootContext`),d=s.useState(`popupProps`),f=s.useState(`modal`),p=s.useState(`mounted`),m=s.useState(`nested`),h=s.useState(`nestedOpenDialogCount`),g=s.useState(`open`),_=s.useState(`openMethod`),v=s.useState(`titleElementId`),y=s.useState(`transitionStatus`),b=s.useState(`role`);rI(),mw({open:g,ref:s.context.popupRef,onComplete(){g&&s.context.onOpenChangeComplete?.(!0)}});function x(e){return e===`touch`?s.context.popupRef.current:!0}let S=i===void 0?x:i,C=h>0,w=eS(`div`,e,{state:W.useMemo(()=>({open:g,nested:m,transitionStatus:y,nestedDialogOpen:C}),[g,m,y,C]),props:[d,{"aria-labelledby":v??void 0,"aria-describedby":c??void 0,role:b,tabIndex:-1,hidden:!p,onKeyDown(e){vP.has(e.key)&&e.stopPropagation()},style:{[eI.nestedDialogs]:h}},o],ref:[t,s.context.popupRef,s.useStateSetter(`popupElement`)],stateAttributesMapping:iI});return(0,G.jsx)(bS,{context:u,openInteractionType:_,disabled:!p,closeOnFocusOut:!l,initialFocus:S,returnFocus:r,modal:f!==!1,restoreFocus:`popup`,children:w})}),oI=W.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=ZF(),a=i.useState(`mounted`),o=i.useState(`modal`);return a||n?(0,G.jsx)(nI.Provider,{value:n,children:(0,G.jsxs)(lS,{ref:t,...r,children:[a&&o===!0&&(0,G.jsx)(cP,{ref:i.context.internalBackdropRef,inert:XT(!open)}),e.children]})}):null});function sI(e){let{store:t,parentContext:n,actionsRef:r}=e,i=t.useState(`open`),a=t.useState(`disablePointerDismissal`),o=t.useState(`modal`),s=t.useState(`popupElement`),{openMethod:c,triggerProps:l,reset:u}=JN(i);_w(t);let{forceUnmount:d}=vw(i,t,()=>{u()}),f=X(e=>{let n=ax(e);return n.preventUnmountOnClose=()=>{t.set(`preventUnmountingOnClose`,!0)},n}),p=W.useCallback(()=>{t.setOpen(!1,f(rx))},[t,f]);W.useImperativeHandle(r,()=>({unmount:d,close:p}),[d,p]);let m=Tw({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[h,g]=W.useState(0),_=h===0,v=Yw(m),y=IC(m,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=Rv(e);if(_&&!a){let e=n;return o&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||Lv(e,s)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:_});VN(i&&o===!0,s);let{getReferenceProps:b,getFloatingProps:x,getTriggerProps:S}=Rw([v,y]);t.useContextCallback(`onNestedDialogOpen`,e=>{g(e+1)}),t.useContextCallback(`onNestedDialogClose`,()=>{g(0)}),W.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(h),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,h]);let C=W.useMemo(()=>b(l),[b,l]),w=W.useMemo(()=>S(l),[S,l]),T=W.useMemo(()=>x(),[x]);t.useSyncedValues({openMethod:c,activeTriggerProps:C,inactiveTriggerProps:w,popupProps:T,floatingRootContext:m,nestedOpenDialogCount:h})}var cI={...Sw,modal:Z(e=>e.modal),nested:Z(e=>e.nested),nestedOpenDialogCount:Z(e=>e.nestedOpenDialogCount),disablePointerDismissal:Z(e=>e.disablePointerDismissal),openMethod:Z(e=>e.openMethod),descriptionElementId:Z(e=>e.descriptionElementId),titleElementId:Z(e=>e.titleElementId),viewportElement:Z(e=>e.viewportElement),role:Z(e=>e.role)},lI=class extends lw{constructor(e){super(uI(e),{popupRef:W.createRef(),backdropRef:W.createRef(),internalBackdropRef:W.createRef(),triggerElements:new yw,onOpenChange:void 0,onOpenChangeComplete:void 0},cI)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;let n={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit(`openchange`,n);let r={open:e},i=t.trigger?.id??null;(i||e)&&(r.activeTriggerId=i,r.activeTriggerElement=t.trigger??null),this.update(r)}};function uI(e={}){return{...xw(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:`dialog`,...e}}function dI(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=ZF(!0),p=!!f,m=P_(()=>l?.store??new lI({open:n??r,activeTriggerId:u===void 0?d:u,modal:s,disablePointerDismissal:o,nested:p})).current;m.useControlledProp(`open`,n,r),m.useControlledProp(`activeTriggerId`,u,d),m.useSyncedValues({disablePointerDismissal:o,nested:p,modal:s}),m.useContextCallback(`onOpenChange`,i),m.useContextCallback(`onOpenChangeComplete`,a);let h=m.useState(`payload`);sI({store:m,actionsRef:c,parentContext:f?.store.context,onOpenChange:i,triggerIdProp:u});let g=W.useMemo(()=>({store:m}),[m]);return(0,G.jsx)(XF.Provider,{value:g,children:typeof t==`function`?t({payload:h}):t})}function fI({open:e,onClose:t,className:n,ariaLabel:r,initialFocus:i,onKeyDown:a,children:o}){return(0,G.jsx)(dI,{open:e,onOpenChange:e=>{e||t()},children:(0,G.jsxs)(oI,{children:[(0,G.jsx)($F,{className:`ui-modal-backdrop`}),(0,G.jsx)(aI,{className:`ui-modal-popup ${n??``}`,"aria-label":r,initialFocus:i,onKeyDown:a,children:o})]})})}async function pI(e,t){let n=await fetch(`/api/file-text?path=${encodeURIComponent(e)}&version=${t}`);if(!n.ok){if(n.status===404)return null;throw Error(`HTTP ${n.status} fetching ${t} ${e}`)}let r=await n.json();if(r.missing)return null;if(r.error)throw Error(r.error);return r.content??``}function mI(e,t){let[n,r]=(0,W.useState)({loading:!1,error:null,oldContent:null,newContent:null});return(0,W.useEffect)(()=>{if(!t||!e)return;let n=!1;return r(e=>({...e,loading:!0,error:null})),Promise.all([pI(e,`old`),pI(e,`new`)]).then(([e,t])=>{n||r({loading:!1,error:null,oldContent:e,newContent:t})}).catch(e=>{n||r({loading:!1,error:e.message,oldContent:null,newContent:null})}),()=>{n=!0}},[e,t]),n}var hI=`diffing-draft-`,gI=10080*60*1e3;function _I(...e){return hI+e.join(`:`)}function vI(...e){try{let t=CM(_I(...e));if(!t)return null;let n=JSON.parse(t);return Date.now()-n.timestamp>gI?(OM(_I(...e)),null):n.body}catch{return null}}var yI={};function bI(e,...t){let n=_I(...t);yI[n]&&clearTimeout(yI[n]),yI[n]=setTimeout(()=>{xI(e,...t),delete yI[n]},500)}function xI(e,...t){let n=_I(...t);try{e.trim()?DM(n,JSON.stringify({body:e,timestamp:Date.now()})):OM(n)}catch{}}function SI(...e){try{OM(_I(...e))}catch{}}function CI({initialBody:e,lineContent:t,draftKey:n,onSubmit:r,onCancel:i}){let{haptic:a,sound:o}=bM(),[s,c]=(0,W.useState)(()=>{if(n){let e=vI(n);if(e)return e}return e||``}),[l,u]=(0,W.useState)(`write`),d=(0,W.useRef)(null);(0,W.useEffect)(()=>{l===`write`&&d.current?.focus()},[l]),(0,W.useEffect)(()=>{n&&bI(s,n)},[s,n]);let f=()=>{let e=s.trim();e&&(n&&SI(n),a(`success`),o(`success`),r(e))},p=e=>{if(e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),f()),e.key===`Escape`){if(s.includes(`
1971
+ `))return;i()}},m=async e=>{let t=e.clipboardData.items,n=null;for(let e=0;e<t.length;e++){let r=t[e];if(r.kind===`file`&&r.type.startsWith(`image/`)){n=r.getAsFile();break}}if(!n)return;e.preventDefault();let r=d.current;if(!r)return;let i=r.selectionStart,a=r.selectionEnd,o=Math.random().toString(36).slice(2,8),s=`![Uploading image… ${o}]()`,l=r.value;c(l.slice(0,i)+s+l.slice(a));try{let e=new FormData;e.append(`file`,n,n.name||`pasted-${o}.png`);let t=await fetch(`/api/attachments`,{method:`POST`,body:e});if(!t.ok)throw Error(`HTTP ${t.status}`);let r=await t.json();if(!r.url)throw Error(r.error||`Upload failed`);let i=`![pasted image](${r.url})`;c(e=>e.replace(s,i))}catch(e){console.error(`Image upload failed:`,e),c(e=>e.replace(s,`![upload failed]()`))}};return(0,G.jsxs)(`div`,{className:`comment-form`,style:{padding:`16px`},role:`form`,"aria-label":`Comment form`,children:[(0,G.jsxs)(`div`,{className:`comment-form-tabs`,role:`tablist`,"aria-label":`Comment form mode`,children:[(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":l===`write`,"aria-controls":`comment-write-panel`,onClick:()=>u(`write`),onKeyDown:e=>{e.key===`ArrowRight`&&(e.preventDefault(),u(`preview`))},className:`comment-form-tab-btn ${l===`write`?`comment-form-tab-btn-active`:`comment-form-tab-btn-inactive`}`,children:`Write`}),(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":l===`preview`,"aria-controls":`comment-preview-panel`,onClick:()=>u(`preview`),onKeyDown:e=>{e.key===`ArrowLeft`&&(e.preventDefault(),u(`write`))},className:`comment-form-tab-btn ${l===`preview`?`comment-form-tab-btn-active`:`comment-form-tab-btn-inactive`}`,children:`Preview`})]}),l===`write`?(0,G.jsx)(`textarea`,{id:`comment-write-panel`,ref:d,value:s,onChange:e=>c(e.target.value),onKeyDown:p,onPaste:m,placeholder:`Leave a review comment (supports Markdown and Pasting Clipboard Images)...`,rows:4,"aria-label":`Comment body`,style:{minHeight:`100px`}}):(0,G.jsxs)(`div`,{id:`comment-preview-panel`,role:`tabpanel`,"aria-label":`Preview`,style:{display:`flex`,flexDirection:`column`,gap:`12px`},children:[(()=>{let e=!!s.match(/```suggestion\n([\s\S]*?)```/);return s.replace(/```suggestion\n([\s\S]*?)```/g,``).trim().length>0||!e?(0,G.jsx)(`div`,{className:`comment-preview markdown-body`,style:{minHeight:`100px`,padding:`12px 16px`,border:`1px solid var(--border-normal)`,borderRadius:`var(--radius-md)`,background:`var(--bg-primary)`,fontSize:`14px`,lineHeight:1.6,color:`var(--text-primary)`,overflowY:`auto`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,overflowWrap:`break-word`},dangerouslySetInnerHTML:{__html:s.trim()?mj(s):`<span style="color: var(--text-muted); font-style: italic;">Nothing to preview</span>`}}):null})(),(()=>{let e=s.match(/```suggestion\n([\s\S]*?)```/),n=!!e,r=e?e[1].trimEnd():``;return n?(0,G.jsxs)(`div`,{className:`suggestion-card`,style:{border:`1px solid var(--border-normal)`,borderRadius:`var(--radius-md)`,overflow:`hidden`,background:`var(--bg-primary)`,boxShadow:`var(--shadow-sm)`},children:[(0,G.jsx)(`div`,{className:`suggestion-header`,style:{padding:`8px 12px`,background:`var(--bg-secondary)`,borderBottom:`1px solid var(--border-normal)`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,fontSize:`12px`,fontWeight:600},children:(0,G.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Suggested Change Preview`})}),(0,G.jsxs)(`div`,{className:`suggestion-diff`,style:{display:`flex`,flexDirection:`column`,fontSize:`12px`,fontFamily:`var(--font-mono)`,overflowX:`auto`},children:[t&&(0,G.jsxs)(`div`,{style:{display:`flex`,padding:`8px 12px`,background:`var(--feedback-danger-bg)`,borderBottom:`1px dashed var(--border-color)`,color:`var(--feedback-danger-text)`,minWidth:`max-content`},children:[(0,G.jsx)(`span`,{style:{width:`20px`,userSelect:`none`,opacity:.5},children:`-`}),(0,G.jsx)(`span`,{style:{whiteSpace:`pre`},children:t})]}),(0,G.jsxs)(`div`,{style:{display:`flex`,padding:`8px 12px`,background:`var(--feedback-success-bg)`,color:`var(--feedback-success-text)`,minWidth:`max-content`},children:[(0,G.jsx)(`span`,{style:{width:`20px`,userSelect:`none`,opacity:.5},children:`+`}),(0,G.jsx)(`span`,{style:{whiteSpace:`pre`},children:r})]})]})]}):null})()]}),(0,G.jsxs)(`div`,{className:`comment-form-actions`,style:{display:`flex`,justifyContent:`flex-end`,gap:`8px`,marginTop:`12px`},children:[(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:i,children:`Cancel`}),(0,G.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:f,disabled:!s.trim(),children:e?`Save`:`Comment`})]})]})}function wI({role:e,size:t=16}){return e===`agent`?(0,G.jsx)(`div`,{className:`comment-avatar-circle comment-avatar-agent`,style:{width:`${t*2}px`,height:`${t*2}px`},children:(0,G.jsx)(VM,{size:t,"aria-hidden":`true`})}):(0,G.jsx)(`div`,{className:`comment-avatar-circle comment-avatar-user`,style:{width:`${t*2}px`,height:`${t*2}px`},children:(0,G.jsx)(MN,{size:t,"aria-hidden":`true`})})}function TI({comment:e,onDelete:t}){let[,n]=(0,W.useState)(0),{resolveComment:r,unresolveComment:i,addReply:a,removeReply:o,editReply:s,applySuggestion:c,editComment:l}=Mj(),u=e.status===`resolved`,[d,f]=(0,W.useState)(u),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(!1),[_,v]=(0,W.useState)(!1),[y,b]=(0,W.useState)(null),x=(0,W.useRef)(null),S=e.body.replace(/```suggestion\n([\s\S]*?)```/g,``).trim().length>0;(0,W.useEffect)(()=>{f(e.status===`resolved`)},[e.status]),(0,W.useEffect)(()=>{let e=setInterval(()=>n(e=>e+1),3e4);return()=>clearInterval(e)},[]);let C=()=>r(e.id),w=()=>i(e.id),T=e=>{b(e)},E=t=>{o(e.id,t)};return u&&d?(0,G.jsxs)(`div`,{className:`comment-resolved-collapsed`,style:{padding:`12px 18px`,margin:`14px 20px`,background:`var(--bg-secondary)`,border:`1px solid var(--border-color)`,borderRadius:`var(--radius-md)`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,opacity:.85,boxShadow:`var(--shadow-sm)`},children:[(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`,fontSize:`13px`,color:`var(--text-muted)`},children:[(0,G.jsx)(qM,{size:16,style:{color:`var(--success)`}}),(0,G.jsx)(`span`,{style:{fontWeight:600},children:`Conversation resolved`}),e.lineNumber===0&&(0,G.jsx)(`span`,{style:{padding:`2px 6px`,background:`var(--accent-subtle)`,border:`1px solid var(--primary)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:700,color:`var(--primary)`,textTransform:`uppercase`,letterSpacing:`0.5px`},children:`File Comment`}),e.startLineNumber&&e.startLineNumber!==e.lineNumber&&(0,G.jsxs)(`span`,{style:{padding:`2px 6px`,background:`var(--bg-primary)`,border:`1px solid var(--border-color)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:600,fontFamily:`var(--font-mono)`,color:`var(--text-secondary)`},children:[`L`,e.startLineNumber,`-`,e.lineNumber]}),(0,G.jsx)(`span`,{children:`•`}),(0,G.jsx)(`span`,{children:e.replies?.length>0?`${e.replies.length+1} comments`:`1 comment`})]}),(0,G.jsx)(`button`,{style:{background:`none`,border:`none`,color:`var(--primary)`,fontSize:`12px`,fontWeight:600,cursor:`pointer`},onClick:()=>f(!1),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),f(!1))},"aria-label":`Show resolved conversation`,children:`Show resolved`})]}):h?(0,G.jsx)(`div`,{className:`comment-bubble-canvas`,id:`comment-${e.id}`,role:`article`,"aria-label":`Edit comment`,children:(0,G.jsxs)(`div`,{className:`comment-node`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:(0,G.jsx)(wI,{role:`user`,size:16})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge comment-node-badge-user`,children:`User`}),(0,G.jsxs)(`span`,{className:`comment-node-time`,style:{display:`flex`,alignItems:`center`,gap:`8px`,flexWrap:`wrap`},children:[dj(e.createdAt),e.lineNumber===0&&(0,G.jsx)(`span`,{style:{padding:`1px 5px`,background:`var(--accent-subtle)`,border:`1px solid var(--primary)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:700,color:`var(--primary)`,textTransform:`uppercase`,letterSpacing:`0.5px`},children:`File Comment`}),e.startLineNumber&&e.startLineNumber!==e.lineNumber&&(0,G.jsxs)(`span`,{style:{padding:`1px 5px`,background:`var(--bg-primary)`,border:`1px solid var(--border-color)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:600,fontFamily:`var(--font-mono)`,color:`var(--text-secondary)`},children:[`L`,e.startLineNumber,`-`,e.lineNumber]})]})]}),(0,G.jsx)(`div`,{style:{marginTop:`8px`},children:(0,G.jsx)(CI,{draftKey:`edit:${e.id}`,initialBody:e.body,lineContent:e.lineContent,onSubmit:t=>{l(e.id,t),g(!1)},onCancel:()=>g(!1)})})]})]})}):(0,G.jsxs)(`div`,{className:`comment-bubble-canvas ${u?`comment-bubble-canvas-resolved`:``}`,id:`comment-${e.id}`,role:`article`,"aria-label":e.lineNumber===0?`File-level comment`:`Comment by user on line ${e.lineNumber}`,children:[(0,G.jsxs)(`div`,{className:`comment-node ${u?`comment-node-resolved`:``}`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:(0,G.jsx)(wI,{role:`user`,size:16})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge comment-node-badge-user`,children:`User`}),(0,G.jsxs)(`span`,{className:`comment-node-time`,style:{display:`flex`,alignItems:`center`,gap:`8px`,flexWrap:`wrap`},children:[dj(e.createdAt),e.lineNumber===0&&(0,G.jsx)(`span`,{style:{padding:`1px 5px`,background:`var(--accent-subtle)`,border:`1px solid var(--primary)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:700,color:`var(--primary)`,textTransform:`uppercase`,letterSpacing:`0.5px`},children:`File Comment`}),e.startLineNumber&&e.startLineNumber!==e.lineNumber&&(0,G.jsxs)(`span`,{style:{padding:`1px 5px`,background:`var(--bg-primary)`,border:`1px solid var(--border-color)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:600,fontFamily:`var(--font-mono)`,color:`var(--text-secondary)`},children:[`L`,e.startLineNumber,`-`,e.lineNumber]})]}),u&&(0,G.jsxs)(`span`,{className:`comment-canvas-resolved-banner`,style:{marginLeft:`8px`},children:[(0,G.jsx)(qM,{size:13}),`Resolved`]}),!u&&(0,G.jsxs)(`div`,{className:`comment-node-actions`,children:[(0,G.jsx)(`button`,{ref:x,className:`comment-node-btn`,onClick:()=>g(!0),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),g(!0))},title:`Edit comment`,"aria-label":`Edit comment`,tabIndex:0,children:(0,G.jsx)(vN,{size:13,"aria-hidden":`true`})}),_?(0,G.jsxs)(`div`,{className:`comment-delete-confirm`,style:{display:`flex`,alignItems:`center`,gap:`4px`},children:[(0,G.jsxs)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>t(e.id),title:`Confirm delete`,"aria-label":`Confirm delete comment`,style:{color:`var(--danger)`,background:`var(--feedback-danger-bg)`,fontWeight:600,fontSize:`11px`,borderRadius:`var(--radius-sm)`,border:`1px solid var(--feedback-danger-border)`,padding:`2px 6px`,cursor:`pointer`,display:`flex`,alignItems:`center`,gap:`2px`,width:`auto`,height:`auto`},children:[(0,G.jsx)(kN,{size:11}),`Delete?`]}),(0,G.jsx)(`button`,{className:`comment-node-btn`,onClick:()=>v(!1),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),v(!1))},title:`Cancel delete`,"aria-label":`Cancel delete`,style:{fontSize:`11px`,padding:`2px 6px`,width:`auto`,height:`auto`},children:`Cancel`})]}):(0,G.jsx)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>v(!0),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),v(!0))},title:`Delete comment`,"aria-label":`Delete comment`,tabIndex:0,children:(0,G.jsx)(ON,{size:13,"aria-hidden":`true`})})]})]}),S&&(0,G.jsx)(`div`,{className:`comment-node-body markdown-body ${u?`comment-resolved-line`:``}`,dangerouslySetInnerHTML:{__html:mj(e.body)}}),(()=>{let t=e.body.match(/```suggestion\n([\s\S]*?)```/),n=!!t&&e.side===`additions`,r=t?t[1].trimEnd():``;return n?(0,G.jsxs)(`div`,{className:`suggestion-card`,style:{marginTop:`12px`,marginBottom:`4px`,border:`1px solid var(--border-normal)`,borderRadius:`var(--radius-md)`,overflow:`hidden`,background:`var(--bg-primary)`,boxShadow:`var(--shadow-sm)`},children:[(0,G.jsxs)(`div`,{className:`suggestion-header`,style:{padding:`8px 12px`,background:`var(--bg-secondary)`,borderBottom:`1px solid var(--border-normal)`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,fontSize:`12px`,fontWeight:600},children:[(0,G.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Suggested Change`}),u?(0,G.jsxs)(`span`,{style:{color:`var(--feedback-success-text)`,display:`inline-flex`,alignItems:`center`,gap:`4px`},children:[(0,G.jsx)(qM,{size:12}),` Applied`]}):(0,G.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:async()=>{try{await c(e.id)}catch(e){alert(e.message)}},style:{fontSize:`11px`,padding:`2px 8px`,borderRadius:`var(--radius-sm)`,height:`24px`},children:`Apply Suggestion`})]}),(0,G.jsxs)(`div`,{className:`suggestion-diff`,style:{display:`flex`,flexDirection:`column`,fontSize:`12px`,fontFamily:`var(--font-mono)`,overflowX:`auto`},children:[(0,G.jsxs)(`div`,{style:{display:`flex`,padding:`8px 12px`,background:`var(--feedback-danger-bg)`,borderBottom:`1px dashed var(--border-color)`,color:`var(--feedback-danger-text)`,minWidth:`max-content`},children:[(0,G.jsx)(`span`,{style:{width:`20px`,userSelect:`none`,opacity:.5},children:`-`}),(0,G.jsx)(`span`,{style:{whiteSpace:`pre`},children:e.lineContent})]}),(0,G.jsxs)(`div`,{style:{display:`flex`,padding:`8px 12px`,background:`var(--feedback-success-bg)`,color:`var(--feedback-success-text)`,minWidth:`max-content`},children:[(0,G.jsx)(`span`,{style:{width:`20px`,userSelect:`none`,opacity:.5},children:`+`}),(0,G.jsx)(`span`,{style:{whiteSpace:`pre`},children:r})]})]})]}):null})()]})]}),e.replies?.length>0&&(0,G.jsx)(`div`,{className:`comment-replies`,role:`list`,"aria-label":`Replies`,children:e.replies.map((t,n)=>{let r=t.role===`agent`,i=y===t.id;return(0,G.jsxs)(`div`,{className:`comment-node ${r?`comment-node-agent`:`comment-node-user`} ${u?`comment-node-resolved`:``}`,role:`listitem`,"aria-label":`${r?`Agent`:`User`} reply ${n+1}`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:(0,G.jsx)(wI,{role:r?`agent`:`user`,size:14})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:r?`Agent`:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge ${r?`comment-node-badge-agent`:`comment-node-badge-user`}`,children:r?`Agent`:`User`}),r&&t.model&&(0,G.jsx)(`span`,{style:{fontSize:`10px`,fontWeight:600,padding:`1px 5px`,borderRadius:`4px`,background:`var(--bg-tertiary)`,color:`var(--text-secondary)`,fontFamily:`var(--font-mono)`},children:t.model}),(0,G.jsx)(`span`,{className:`comment-node-time`,children:dj(t.createdAt)}),!u&&(0,G.jsxs)(`div`,{className:`comment-node-actions`,children:[(0,G.jsx)(`button`,{className:`comment-node-btn`,onClick:()=>T(t.id),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),T(t.id))},title:`Edit reply`,"aria-label":`Edit reply`,tabIndex:0,children:(0,G.jsx)(vN,{size:12,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>E(t.id),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),E(t.id))},title:`Delete reply`,"aria-label":`Delete reply`,tabIndex:0,children:(0,G.jsx)(ON,{size:12,"aria-hidden":`true`})})]})]}),i?(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`var(--radius-md)`,border:`1px solid var(--border-color)`,marginTop:`6px`},children:(0,G.jsx)(CI,{draftKey:`reply-edit:${e.id}:${t.id}`,initialBody:t.body,onSubmit:n=>{s(e.id,t.id,n),b(null)},onCancel:()=>b(null)})}):(0,G.jsx)(`div`,{className:`comment-node-body markdown-body`,dangerouslySetInnerHTML:{__html:mj(t.body)}})]})]},t.id)})}),(0,G.jsxs)(`div`,{className:`comment-canvas-footer`,children:[!p&&(0,G.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,G.jsxs)(`button`,{onClick:()=>m(!0),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),m(!0))},className:`comment-reply-trigger`,"aria-label":`Write a reply`,tabIndex:0,style:{width:`100%`,maxWidth:`320px`},children:[(0,G.jsx)(xN,{size:14,"aria-hidden":`true`}),`Reply...`]}),u?(0,G.jsxs)(`div`,{style:{display:`flex`,gap:`6px`,marginLeft:`12px`},children:[(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:()=>f(!0),style:{fontSize:`12px`,padding:`4px 10px`},"aria-label":`Hide resolved conversation`,children:`Hide`}),(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:w,style:{fontSize:`12px`,padding:`4px 10px`},"aria-label":`Unresolve conversation`,children:`Unresolve`})]}):(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:C,style:{fontSize:`12px`,padding:`4px 10px`,marginLeft:`12px`},"aria-label":`Resolve conversation`,children:`Resolve conversation`})]}),p&&(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`var(--radius-md)`,border:`1px solid var(--border-color)`,marginTop:`4px`},children:(0,G.jsx)(CI,{draftKey:`reply:${e.id}`,onSubmit:t=>{a(e.id,t),m(!1)},onCancel:()=>{m(!1),x.current?.focus()}})})]})]})}var EI=(0,W.memo)(function({id:e,fileDiff:t,filePath:n,annotations:r,diffStyle:i,tabSize:a,viewed:o,theme:s,editorIDE:c,lineDiffType:l,lineWrap:u,diffIndicators:d,showLineNumbers:f,hunkSeparators:p,lineHoverHighlight:m,fontSize:h,monoFontFamily:g,expandContextByDefault:_,collapsedContextThreshold:v,expansionLineCount:y,onViewedChange:b,onAddComment:x,onDeleteComment:S}){let[C,w]=(0,W.useState)(null),[T,E]=(0,W.useState)(null),[D,O]=(0,W.useState)(0),[k,A]=(0,W.useState)(null),[j,M]=(0,W.useState)(o),[N,P]=(0,W.useState)(!1),[F,I]=(0,W.useState)(!1),[L,R]=(0,W.useState)(_),[z,ee]=(0,W.useState)(null),[te,B]=(0,W.useState)(null),[V,H]=(0,W.useState)(null),ne=(0,W.useRef)(null),re=async(e,t=!1)=>{if(z===null&&!(!t&&typeof window<`u`&&!window.confirm(`Revert hunk #${e+1} in ${n}? This rewrites the file via "git apply --reverse".`))){ee(e),B(null);try{let t=await fetch(`/api/revert-hunk`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:n,hunkIndex:e})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`HTTP ${t.status}`)}}catch(e){B(e.message)}finally{ee(null)}}},ie=t.type===`change`||t.type===`rename-changed`,ae=!j&&ie,{loading:oe,oldContent:se,newContent:ce}=mI(n,L&&ae),le=L&&se!==null&&ce!==null,ue=t.prevName??n;(0,W.useEffect)(()=>{M(o)},[o]);let U=pj[s]||pj.nord,de=(0,W.useMemo)(()=>OI(a,h,g),[a,h,g]),fe=(e,n,r)=>{let i=r&&r!==n?r:n,a=n,o=[];for(let n=i;n<=a;n++){let r=e===`additions`?t.additionLines:t.deletionLines,i=e===`additions`?`additionStart`:`deletionStart`,a=e===`additions`?`additionCount`:`deletionCount`,s=e===`additions`?`additionLineIndex`:`deletionLineIndex`,c=!1;for(let e of t.hunks){let t=e[i],l=e[a];if(n>=t&&n<t+l){let i=e[s]+(n-t);o.push(r[i]??``),c=!0;break}}c||o.push(``)}return o.join(`
1972
+ `)},pe=async e=>{if(e.stopPropagation(),t.type!==`deleted`){P(!0);try{await fetch(`/api/open-file`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:n,editor:c})})}catch(e){console.error(`Failed to open file in IDE editor:`,e)}finally{P(!1)}}},me=()=>{switch(t.type){case`new`:return(0,G.jsx)(`span`,{className:`diff-status-badge diff-status-new`,children:`Added`});case`deleted`:return(0,G.jsx)(`span`,{className:`diff-status-badge diff-status-deleted`,children:`Deleted`});case`rename-pure`:case`rename-changed`:return(0,G.jsx)(`span`,{className:`diff-status-badge diff-status-renamed`,children:`Renamed`});default:return(0,G.jsx)(`span`,{className:`diff-status-badge diff-status-modified`,children:`Modified`})}},he=r.filter(e=>e.lineNumber===0),ge=r.filter(e=>e.lineNumber>0),_e=e=>`_pending`in e.metadata?(0,G.jsx)(CI,{draftKey:`new:${n}:${C.side}:${C.startLineNumber||C.lineNumber}:${C.lineNumber}`,lineContent:fe(C.side,C.lineNumber,C.startLineNumber),onSubmit:e=>{let t=fe(C.side,C.lineNumber,C.startLineNumber);x(n,C.side,C.lineNumber,t,e,C.startLineNumber),w(null),E(null)},onCancel:()=>{w(null),E(null)}}):(0,G.jsx)(TI,{comment:e.metadata,onDelete:S}),ve=e=>(0,G.jsx)(`button`,{className:`gutter-add-btn`,onClick:()=>{let t=e();t&&w({side:t.side,lineNumber:t.lineNumber})},children:`+`}),ye=[...ge,...C?[{side:C.side,lineNumber:C.lineNumber,metadata:{_pending:!0}}]:[]];return(0,G.jsxs)(`div`,{ref:ne,className:`file-diff-card ${o?`file-diff-viewed`:``} ${j?`file-diff-collapsed`:``}`,id:e,children:[(0,G.jsxs)(`div`,{className:`file-diff-card-header`,onClick:()=>M(!j),children:[(0,G.jsxs)(`div`,{className:`file-diff-header-left`,children:[(0,G.jsx)(`span`,{className:`file-diff-collapse-indicator`,children:j?(0,G.jsx)(WM,{size:14}):(0,G.jsx)(UM,{size:14})}),(0,G.jsx)(`span`,{className:`file-diff-name`,title:n,children:n}),me(),ge.length>0&&(0,G.jsxs)(`span`,{className:`file-diff-comment-badge`,title:`${ge.length} inline comment${ge.length===1?``:`s`}`,children:[(0,G.jsx)(dN,{size:10}),ge.length]}),D>0&&(0,G.jsxs)(`span`,{className:`file-diff-selection-badge`,"aria-live":`polite`,children:[D,` line`,D===1?``:`s`,` selected`]}),k&&(0,G.jsxs)(`span`,{className:`file-diff-permalink-flash`,role:`status`,children:[`Copied `,k]})]}),(0,G.jsxs)(`div`,{className:`file-diff-header-right`,onClick:e=>e.stopPropagation(),children:[ae&&(0,G.jsxs)(`button`,{className:`file-diff-edit-btn ${L?`btn-active`:``}`,onClick:()=>R(e=>!e),disabled:oe,title:L?`Hide unchanged context (use original patch render)`:`Load full file so unchanged context becomes expandable`,children:[oe?(0,G.jsx)(sN,{size:11,className:`spin`}):(0,G.jsx)(cN,{size:11}),(0,G.jsx)(`span`,{children:oe?`Loading…`:L?`Hide Context`:`Expand Context`})]}),t.type!==`deleted`&&(0,G.jsxs)(`button`,{className:`file-diff-edit-btn`,onClick:pe,disabled:N,title:`Open and edit full file locally`,children:[(0,G.jsx)(_N,{size:11}),(0,G.jsx)(`span`,{children:N?`Opening...`:`Edit File`})]}),(0,G.jsxs)(`button`,{className:`file-diff-edit-btn`,onClick:()=>{M(!1),I(!0)},title:`Comment on this entire file`,children:[(0,G.jsx)(dN,{size:11}),(0,G.jsx)(`span`,{children:`Add Comment`})]}),(0,G.jsxs)(`label`,{className:`viewed-label ${o?`viewed-checked`:``}`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>b(n,e.target.checked)}),`Viewed`]})]})]}),!j&&t.hunks.length>0&&(0,G.jsxs)(`div`,{className:`file-diff-hunk-actions`,onClick:e=>e.stopPropagation(),children:[(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`6px`},children:[(0,G.jsx)(`span`,{className:`file-diff-hunk-actions-label`,style:{display:`inline-flex`,alignItems:`center`,gap:`4px`},children:`Selective Revert`}),(0,G.jsx)(QT,{content:`Selective Revert lets you preview and undo specific blocks of changes (hunks) in this file using 'git apply --reverse'.`,side:`top`,children:(0,G.jsx)(JM,{size:12,style:{color:`var(--text-muted)`,cursor:`help`}})}),(0,G.jsx)(`span`,{style:{color:`var(--text-muted)`,fontSize:`11px`,margin:`0 4px`},children:`·`}),(0,G.jsxs)(`span`,{style:{color:`var(--text-secondary)`,fontSize:`11px`},children:[t.hunks.length,` block`,t.hunks.length===1?``:`s`,` available`]})]}),(0,G.jsx)(`div`,{className:`file-diff-hunk-actions-buttons`,children:t.hunks.map((e,t)=>(0,G.jsxs)(`button`,{type:`button`,className:`file-diff-hunk-revert-btn`,onClick:()=>H(t),disabled:z!==null,title:`Preview and revert hunk #${t+1} (lines @${e.additionStart}+${e.additionLines??e.additionCount})`,children:[z===t?(0,G.jsx)(sN,{size:10,className:`spin`}):(0,G.jsx)(jN,{size:10}),(0,G.jsxs)(`span`,{children:[`Hunk #`,t+1]})]},t))}),te&&(0,G.jsxs)(`span`,{className:`file-diff-hunk-error`,role:`alert`,children:[(0,G.jsx)(KM,{size:11}),te]})]}),V!==null&&(()=>{let e=t.hunks[V];if(!e)return null;let r=t.deletionLines.slice(e.deletionLineIndex,e.deletionLineIndex+(e.deletionCount??e.deletionLines??0)),i=t.additionLines.slice(e.additionLineIndex,e.additionLineIndex+(e.additionStart!==void 0&&e.additionLines!==void 0?e.additionLines:e.additionCount??0));return(0,G.jsxs)(fI,{open:V!==null,onClose:()=>H(null),className:`hunk-revert-modal`,ariaLabel:`Selective Revert Preview Hunk #${V+1}`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header-title`,children:[(0,G.jsx)(jN,{size:18,className:`shortcuts-icon`}),(0,G.jsxs)(`h2`,{children:[`Revert Hunk #`,V+1]})]}),(0,G.jsx)(`button`,{className:`shortcuts-close-btn`,onClick:()=>H(null),"aria-label":`Close dialog`,children:(0,G.jsx)(NN,{size:16})})]}),(0,G.jsxs)(`div`,{className:`shortcuts-body`,children:[(0,G.jsxs)(`div`,{className:`hunk-preview-intro`,children:[`Reverting this hunk will restore the deleted (`,(0,G.jsx)(`span`,{style:{color:`var(--feedback-danger-text)`,fontWeight:600},children:`red`}),`) lines and remove the added (`,(0,G.jsx)(`span`,{style:{color:`var(--feedback-success-text)`,fontWeight:600},children:`green`}),`) lines from `,(0,G.jsx)(`strong`,{children:n.split(`/`).pop()}),`.`]}),(0,G.jsxs)(`div`,{className:`hunk-preview-container`,children:[(0,G.jsxs)(`div`,{className:`hunk-preview-header`,children:[(0,G.jsx)(`span`,{children:n}),(0,G.jsxs)(`span`,{children:[`Lines: @-`,e.deletionStart,`,`,e.deletionCount??e.deletionLines??0,` @+`,e.additionStart,`,`,e.additionLines??e.additionCount??0]})]}),(0,G.jsxs)(`div`,{className:`hunk-preview-code`,children:[r.map((e,t)=>(0,G.jsxs)(`div`,{className:`hunk-preview-line hunk-preview-line-deletion`,children:[(0,G.jsx)(`span`,{className:`hunk-preview-sign`,children:`-`}),(0,G.jsx)(`span`,{className:`hunk-preview-text`,children:e})]},`del-${t}`)),i.map((e,t)=>(0,G.jsxs)(`div`,{className:`hunk-preview-line hunk-preview-line-addition`,children:[(0,G.jsx)(`span`,{className:`hunk-preview-sign`,children:`+`}),(0,G.jsx)(`span`,{className:`hunk-preview-text`,children:e})]},`add-${t}`)),r.length===0&&i.length===0&&(0,G.jsx)(`div`,{className:`hunk-preview-line`,style:{fontStyle:`italic`,color:`var(--text-muted)`},children:`No changes in this hunk.`})]})]}),(0,G.jsx)(DI,{filePath:n,deletionStart:e.deletionStart,deletionCount:e.deletionCount??e.deletionLines??0})]}),(0,G.jsxs)(`div`,{className:`modal-footer`,children:[(0,G.jsx)(`button`,{className:`hunk-revert-btn-secondary`,onClick:()=>H(null),children:`Cancel`}),(0,G.jsx)(`button`,{className:`hunk-revert-btn-primary`,onClick:async()=>{let e=V;H(null),await re(e,!0)},children:`Revert Changes`})]})]})})(),!j&&(0,G.jsxs)(`div`,{className:`file-diff-card-body`,children:[(he.length>0||F)&&(0,G.jsxs)(`div`,{className:`file-level-comments-section`,style:{margin:`16px 20px`,padding:`12px`,background:`rgba(255,255,255,0.02)`,border:`1px solid var(--border-color)`,borderRadius:`8px`,display:`flex`,flexDirection:`column`,gap:`12px`},children:[(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`6px`,fontSize:`13px`,fontWeight:600,color:`var(--text-secondary)`},children:[(0,G.jsx)(dN,{size:14}),(0,G.jsxs)(`span`,{children:[`File-Level Comments (`,he.length,`)`]})]}),he.length>0&&(0,G.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`12px`},children:he.map(e=>(0,G.jsx)(TI,{comment:e.metadata,onDelete:S},e.metadata.id))}),F&&(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`6px`,border:`1px solid var(--border-color)`},children:(0,G.jsx)(CI,{draftKey:`file-comment:${n}`,lineContent:``,onSubmit:e=>{x(n,`additions`,0,``,e),I(!1)},onCancel:()=>I(!1)})})]}),le?(0,G.jsx)(Yg,{oldFile:{name:ue,contents:se??``},newFile:{name:n,contents:ce??``},options:{diffStyle:i,enableGutterUtility:!0,enableLineSelection:!0,disableFileHeader:!0,lineDiffType:l,overflow:u?`wrap`:`scroll`,diffIndicators:d,disableLineNumbers:!f,hunkSeparators:p,lineHoverHighlight:m,expandUnchanged:!1,collapsedContextThreshold:v,expansionLineCount:y,onLineSelectionStart:()=>{E(null),O(0)},onLineSelectionChange:e=>{O(e?Math.abs(e.end-e.start)+1:0)},onLineSelectionEnd:e=>{O(0),e&&(E(e),w({side:e.endSide||`additions`,lineNumber:e.end,startLineNumber:e.start}))},onLineNumberClick:e=>{let t=`${n}:${e.annotationSide===`deletions`?`-`:`+`}${e.lineNumber}`;navigator.clipboard?.writeText(t).then(()=>{A(t),setTimeout(()=>A(null),1600)},()=>{})},theme:{dark:U.type===`dark`?U.themeName:`nord`,light:U.type===`light`?U.themeName:`github-light`},themeType:U.type,unsafeCSS:de},selectedLines:T,lineAnnotations:ye,renderHeaderMetadata:()=>null,renderAnnotation:_e,renderGutterUtility:ve}):(0,G.jsx)(Jg,{fileDiff:t,options:{diffStyle:i,enableGutterUtility:!0,enableLineSelection:!0,disableFileHeader:!0,lineDiffType:l,overflow:u?`wrap`:`scroll`,diffIndicators:d,disableLineNumbers:!f,hunkSeparators:p,lineHoverHighlight:m,onLineSelectionStart:()=>{E(null),O(0)},onLineSelectionChange:e=>{O(e?Math.abs(e.end-e.start)+1:0)},onLineSelectionEnd:e=>{O(0),e&&(E(e),w({side:e.endSide||`additions`,lineNumber:e.end,startLineNumber:e.start}))},onLineNumberClick:e=>{let t=`${n}:${e.annotationSide===`deletions`?`-`:`+`}${e.lineNumber}`;navigator.clipboard?.writeText(t).then(()=>{A(t),setTimeout(()=>A(null),1600)},()=>{})},theme:{dark:U.type===`dark`?U.themeName:`nord`,light:U.type===`light`?U.themeName:`github-light`},themeType:U.type,unsafeCSS:de},selectedLines:T,lineAnnotations:ye,renderHeaderMetadata:()=>null,renderAnnotation:e=>`_pending`in e.metadata?(0,G.jsx)(CI,{draftKey:`new:${n}:${C.side}:${C.startLineNumber||C.lineNumber}:${C.lineNumber}`,lineContent:fe(C.side,C.lineNumber,C.startLineNumber),onSubmit:e=>{let t=fe(C.side,C.lineNumber,C.startLineNumber);x(n,C.side,C.lineNumber,t,e,C.startLineNumber),w(null),E(null)},onCancel:()=>{w(null),E(null)}}):(0,G.jsx)(TI,{comment:e.metadata,onDelete:S}),renderGutterUtility:e=>(0,G.jsx)(`button`,{className:`gutter-add-btn`,onClick:()=>{let t=e();t&&w({side:t.side,lineNumber:t.lineNumber})},children:`+`})})]})]})});function DI({filePath:e,deletionStart:t,deletionCount:n}){let[r,i]=(0,W.useState)(null),[a,o]=(0,W.useState)(!1),[s,c]=(0,W.useState)(null);if((0,W.useEffect)(()=>{let r=!0;return(async()=>{o(!0),c(null);try{let a=new URLSearchParams({filePath:e,deletionStart:String(t),deletionCount:String(n)}),o=await fetch(`/api/hunk-history?${a}`);if(!o.ok)throw Error(`HTTP ${o.status}`);let s=await o.json();r&&i(s)}catch(e){r&&c(e.message||`Failed to fetch hunk history`)}finally{r&&o(!1)}})(),()=>{r=!1}},[e,t,n]),a)return(0,G.jsxs)(`div`,{className:`hunk-history-loading`,children:[(0,G.jsx)(sN,{size:14,className:`spin`,style:{marginRight:`8px`}}),(0,G.jsx)(`span`,{children:`Loading git history & origin blame…`})]});if(s)return(0,G.jsxs)(`div`,{className:`hunk-history-error`,children:[(0,G.jsx)(KM,{size:14,style:{color:`var(--feedback-danger-text)`,marginRight:`8px`}}),(0,G.jsxs)(`span`,{children:[`Failed to load git history: `,s]})]});if(!r)return null;let l=Array.from(new Map(r.blame.map(e=>[e.commit,e])).values());return(0,G.jsxs)(`div`,{className:`hunk-history-section`,children:[l.length>0&&(0,G.jsxs)(`div`,{className:`hunk-history-block`,children:[(0,G.jsx)(`h3`,{className:`hunk-history-title`,children:`Commit(s) introducing deleted lines`}),(0,G.jsx)(`div`,{className:`hunk-history-commits`,children:l.map(e=>(0,G.jsxs)(`div`,{className:`hunk-history-commit-card`,children:[(0,G.jsxs)(`div`,{className:`hunk-history-commit-header`,children:[(0,G.jsx)(`span`,{className:`hunk-history-commit-hash`,children:e.commit}),(0,G.jsxs)(`span`,{className:`hunk-history-commit-author`,children:[(0,G.jsx)(MN,{size:11}),(0,G.jsx)(`span`,{children:e.author})]}),(0,G.jsxs)(`span`,{className:`hunk-history-commit-date`,children:[(0,G.jsx)(ZM,{size:11}),(0,G.jsx)(`span`,{children:e.date})]})]}),(0,G.jsx)(`div`,{className:`hunk-history-commit-msg`,children:e.summary})]},e.commit))})]}),r.recentCommits.length>0&&(0,G.jsxs)(`div`,{className:`hunk-history-block`,children:[(0,G.jsx)(`h3`,{className:`hunk-history-title`,children:`Recent File Modification History`}),(0,G.jsx)(`div`,{className:`hunk-history-log`,children:r.recentCommits.map(e=>(0,G.jsxs)(`div`,{className:`hunk-history-log-row`,children:[(0,G.jsx)(`span`,{className:`hunk-history-log-hash`,children:e.hash}),(0,G.jsx)(`span`,{className:`hunk-history-log-msg`,title:e.summary,children:e.summary}),(0,G.jsx)(`span`,{className:`hunk-history-log-author`,children:e.author}),(0,G.jsx)(`span`,{className:`hunk-history-log-date`,children:e.date})]},e.hash))})]})]})}function OI(e,t,n){return`
1968
1973
  :host {
1969
1974
  --diffs-tab-size: ${e} !important;
1970
- --diffs-font-family: var(--font-mono) !important;
1975
+ --diffs-font-family: ${n} !important;
1971
1976
  --diffs-font-size: ${t}px !important;
1972
1977
  --diffs-border: var(--border-normal) !important;
1973
1978
  --diffs-bg: var(--bg-secondary) !important;
1974
1979
  --diffs-line-height: ${Math.round(t*1.7)}px !important;
1975
1980
  }
1976
- [data-column-number], [data-line] {
1977
- font-family: var(--font-mono) !important;
1981
+ [data-column-number], [data-line], [data-line] * {
1982
+ font-family: ${n} !important;
1978
1983
  font-size: ${t}px !important;
1979
1984
  font-variant-ligatures: common-ligatures !important;
1980
1985
  font-feature-settings: "liga" on, "calt" on !important;
@@ -2001,14 +2006,45 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
2001
2006
  [data-line].selected-line {
2002
2007
  background-color: var(--accent-subtle) !important;
2003
2008
  }
2004
- `}var $F=new Set([`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.bmp`,`.svg`,`.ico`,`.avif`]);function eI(e){let t=e.slice(e.lastIndexOf(`.`)).toLowerCase();return $F.has(t)}function tI({filePath:e,info:t,viewed:n,onViewedChange:r}){let i=eI(e);return(0,G.jsxs)(`div`,{className:`file-diff-card ${n?`file-diff-viewed`:``}`,id:`file-${e}`,children:[(0,G.jsxs)(`div`,{className:`binary-diff-header`,children:[(0,G.jsx)(`span`,{className:`binary-diff-name`,children:e}),(0,G.jsxs)(`label`,{className:`viewed-label`,onClick:e=>e.stopPropagation(),children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:n,onChange:t=>r(e,t.target.checked)}),`Viewed`]})]}),!n&&(0,G.jsx)(`div`,{className:`binary-diff-body`,children:i?(0,G.jsx)(nI,{filePath:e,changeType:t.type}):(0,G.jsxs)(`div`,{className:`binary-diff-message`,children:[`Binary file `,t.type===`added`?`added`:t.type===`untracked`?`untracked`:t.type===`deleted`?`deleted`:`changed`]})})]})}function nI({filePath:e,changeType:t}){let n=`/api/file-content?path=${encodeURIComponent(e)}&version=old`,r=`/api/file-content?path=${encodeURIComponent(e)}&version=new`;return t===`added`||t===`untracked`?(0,G.jsx)(`div`,{className:`image-preview`,children:(0,G.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,G.jsx)(`div`,{className:`image-preview-label image-preview-label-added`,children:`Added`}),(0,G.jsx)(`img`,{src:r,alt:e,className:`image-preview-img`})]})}):t===`deleted`?(0,G.jsx)(`div`,{className:`image-preview`,children:(0,G.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,G.jsx)(`div`,{className:`image-preview-label image-preview-label-deleted`,children:`Deleted`}),(0,G.jsx)(`img`,{src:n,alt:e,className:`image-preview-img image-preview-deleted`})]})}):(0,G.jsxs)(`div`,{className:`image-preview image-preview-compare`,children:[(0,G.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,G.jsx)(`div`,{className:`image-preview-label`,children:`Before`}),(0,G.jsx)(`img`,{src:n,alt:`${e} (before)`,className:`image-preview-img`})]}),(0,G.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,G.jsx)(`div`,{className:`image-preview-label`,children:`After`}),(0,G.jsx)(`img`,{src:r,alt:`${e} (after)`,className:`image-preview-img`})]})]})}var rI=[],iI=(0,W.memo)(function({files:e,diffStyle:t,tabSizeMap:n,defaultTabSize:r,viewedFiles:i,binaryFiles:a,theme:o,editorIDE:s,lineDiffType:c,lineWrap:l,diffIndicators:u,showLineNumbers:d,hunkSeparators:f,lineHoverHighlight:p,fontSize:m,expandContextByDefault:h,collapsedContextThreshold:g,expansionLineCount:_,onViewedChange:v,fileAnnotationsMap:y,onAddComment:b,onDeleteComment:x}){let S=(0,W.useMemo)(()=>[...e].sort((e,t)=>{let n=e.name.split(`/`),r=t.name.split(`/`),i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=e<n.length-1;if(t!==e<r.length-1)return t?-1:1;let i=n[e].localeCompare(r[e]);if(i!==0)return i}return n.length-r.length}),[e]);return S.length===0?(0,G.jsx)(`div`,{className:`empty-state`,children:(0,G.jsx)(`p`,{children:`No changes found.`})}):(0,G.jsx)(`div`,{className:`diff-viewer`,children:S.map((e,S)=>{let C=e.name,w=a.get(C);return w?(0,G.jsx)(tI,{filePath:C,info:w,viewed:i.has(C),onViewedChange:v},`${C}-${S}`):(0,G.jsx)(XF,{id:`file-${C}`,fileDiff:e,filePath:C,annotations:y.get(C)??rI,diffStyle:t,tabSize:n[C]??r,viewed:i.has(C),theme:o,editorIDE:s,lineDiffType:c,lineWrap:l,diffIndicators:u,showLineNumbers:d,hunkSeparators:f,lineHoverHighlight:p,fontSize:m,expandContextByDefault:h,collapsedContextThreshold:g,expansionLineCount:_,onViewedChange:v,onAddComment:b,onDeleteComment:x},`${C}-${S}`)})})}),aI={current:{label:`Current`,icon:yM,title:`Keep the current/HEAD side`},incoming:{label:`Incoming`,icon:aN,title:`Keep the incoming side`},both:{label:`Both`,icon:KM,title:`Keep both sides (current then incoming)`}},oI=(0,W.memo)(function({filePath:e,theme:t,fontSize:n,tabSize:r,onSaved:i}){let a=pj[t]||pj.nord,[o,s]=(0,W.useState)({loading:!0,error:null,file:null}),[c,l]=(0,W.useState)(null),[u,d]=(0,W.useState)(0),[f,p]=(0,W.useState)(!1),[m,h]=(0,W.useState)(null),[g,_]=(0,W.useState)(!1),v=(0,W.useRef)(null);(0,W.useEffect)(()=>{let t=!1;return s({loading:!0,error:null,file:null}),l(null),d(0),_(!1),h(null),fetch(`/api/file-text?path=${encodeURIComponent(e)}&version=new`).then(e=>e.json()).then(n=>{if(!t){if(n.error){s({loading:!1,error:n.error,file:null});return}s({loading:!1,error:null,file:{name:e,contents:n.content??``}})}}).catch(e=>{t||s({loading:!1,error:e.message,file:null})}),()=>{t=!0}},[e]);let y=(e,t)=>{let n=v.current;if(!n)return;let r=n.resolveConflict(e,t);r&&r.file&&(l(r.file),d(e=>e+1))};return o.loading?(0,G.jsxs)(`div`,{className:`merge-conflict-card merge-conflict-card-loading`,children:[(0,G.jsx)(IM,{size:14,className:`spin`}),(0,G.jsxs)(`span`,{children:[`Loading `,e,`…`]})]}):o.error||!o.file?(0,G.jsxs)(`div`,{className:`merge-conflict-card merge-conflict-card-error`,children:[(0,G.jsx)(CM,{size:14}),(0,G.jsxs)(`span`,{children:[`Could not load `,e,`: `,o.error??`unknown error`]})]}):(0,G.jsxs)(`div`,{className:`merge-conflict-card`,children:[(0,G.jsxs)(`div`,{className:`merge-conflict-header`,children:[(0,G.jsxs)(`div`,{className:`merge-conflict-title`,children:[(0,G.jsx)(NM,{size:14}),(0,G.jsx)(`span`,{className:`merge-conflict-name`,title:e,children:e})]}),(0,G.jsxs)(`div`,{className:`merge-conflict-actions`,children:[u>0&&(0,G.jsxs)(`span`,{className:`merge-conflict-status`,children:[u,` resolution`,u===1?``:`s`,` pending`]}),(0,G.jsxs)(`button`,{className:`file-diff-edit-btn`,onClick:async()=>{let t=c??o.file;if(t){p(!0),h(null);try{let n=await fetch(`/api/save-file`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:e,content:t.contents,gitAdd:!0})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??`HTTP ${n.status}`)}_(!0),i()}catch(e){h(e.message)}finally{p(!1)}}},disabled:f||g,title:"Write the resolved file to disk and `git add` it",children:[f?(0,G.jsx)(IM,{size:11,className:`spin`}):g?(0,G.jsx)(wM,{size:11}):(0,G.jsx)(YM,{size:11}),(0,G.jsx)(`span`,{children:f?`Saving…`:g?`Saved + staged`:`Save & stage`})]})]})]}),m&&(0,G.jsxs)(`div`,{className:`merge-conflict-card-error`,role:`alert`,children:[(0,G.jsx)(CM,{size:14}),(0,G.jsx)(`span`,{children:m})]}),(0,G.jsx)(O_,{file:c??o.file,options:{disableFileHeader:!0,enableGutterUtility:!1,mergeConflictActionsType:`custom`,theme:{dark:a.type===`dark`?a.themeName:`nord`,light:a.type===`light`?a.themeName:`github-light`},themeType:a.type,unsafeCSS:`
2009
+ .comment-bubble-canvas {
2010
+ width: calc(100% - 40px) !important;
2011
+ max-width: min(720px, calc(100% - 40px)) !important;
2012
+ margin: 14px 20px !important;
2013
+ min-width: 0 !important;
2014
+ box-sizing: border-box !important;
2015
+ }
2016
+ .comment-replies {
2017
+ min-width: 0 !important;
2018
+ }
2019
+ .comment-node {
2020
+ min-width: 0 !important;
2021
+ }
2022
+ .comment-content-col {
2023
+ min-width: 0 !important;
2024
+ }
2025
+ .comment-node-header {
2026
+ flex-wrap: wrap !important;
2027
+ min-width: 0 !important;
2028
+ }
2029
+ .comment-node-body {
2030
+ word-break: break-word !important;
2031
+ overflow-wrap: break-word !important;
2032
+ min-width: 0 !important;
2033
+ }
2034
+ `}var kI=new Set([`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.bmp`,`.svg`,`.ico`,`.avif`]);function AI(e){let t=e.slice(e.lastIndexOf(`.`)).toLowerCase();return kI.has(t)}function jI({filePath:e,info:t,viewed:n,onViewedChange:r}){let i=AI(e);return(0,G.jsxs)(`div`,{className:`file-diff-card ${n?`file-diff-viewed`:``}`,id:`file-${e}`,children:[(0,G.jsxs)(`div`,{className:`binary-diff-header`,children:[(0,G.jsx)(`span`,{className:`binary-diff-name`,children:e}),(0,G.jsxs)(`label`,{className:`viewed-label`,onClick:e=>e.stopPropagation(),children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:n,onChange:t=>r(e,t.target.checked)}),`Viewed`]})]}),!n&&(0,G.jsx)(`div`,{className:`binary-diff-body`,children:i?(0,G.jsx)(MI,{filePath:e,changeType:t.type}):(0,G.jsxs)(`div`,{className:`binary-diff-message`,children:[`Binary file `,t.type===`added`?`added`:t.type===`untracked`?`untracked`:t.type===`deleted`?`deleted`:`changed`]})})]})}function MI({filePath:e,changeType:t}){let n=`/api/file-content?path=${encodeURIComponent(e)}&version=old`,r=`/api/file-content?path=${encodeURIComponent(e)}&version=new`;return t===`added`||t===`untracked`?(0,G.jsx)(`div`,{className:`image-preview`,children:(0,G.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,G.jsx)(`div`,{className:`image-preview-label image-preview-label-added`,children:`Added`}),(0,G.jsx)(`img`,{src:r,alt:e,className:`image-preview-img`})]})}):t===`deleted`?(0,G.jsx)(`div`,{className:`image-preview`,children:(0,G.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,G.jsx)(`div`,{className:`image-preview-label image-preview-label-deleted`,children:`Deleted`}),(0,G.jsx)(`img`,{src:n,alt:e,className:`image-preview-img image-preview-deleted`})]})}):(0,G.jsxs)(`div`,{className:`image-preview image-preview-compare`,children:[(0,G.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,G.jsx)(`div`,{className:`image-preview-label`,children:`Before`}),(0,G.jsx)(`img`,{src:n,alt:`${e} (before)`,className:`image-preview-img`})]}),(0,G.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,G.jsx)(`div`,{className:`image-preview-label`,children:`After`}),(0,G.jsx)(`img`,{src:r,alt:`${e} (after)`,className:`image-preview-img`})]})]})}var NI=[],PI=(0,W.memo)(function({files:e,diffStyle:t,tabSizeMap:n,defaultTabSize:r,viewedFiles:i,binaryFiles:a,theme:o,editorIDE:s,lineDiffType:c,lineWrap:l,diffIndicators:u,showLineNumbers:d,hunkSeparators:f,lineHoverHighlight:p,fontSize:m,monoFontFamily:h,expandContextByDefault:g,collapsedContextThreshold:_,expansionLineCount:v,onViewedChange:y,fileAnnotationsMap:b,onAddComment:x,onDeleteComment:S}){let C=(0,W.useMemo)(()=>[...e].sort((e,t)=>{let n=e.name.split(`/`),r=t.name.split(`/`),i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=e<n.length-1;if(t!==e<r.length-1)return t?-1:1;let i=n[e].localeCompare(r[e]);if(i!==0)return i}return n.length-r.length}),[e]);return C.length===0?(0,G.jsx)(`div`,{className:`empty-state`,children:(0,G.jsx)(`p`,{children:`No changes found.`})}):(0,G.jsx)(`div`,{className:`diff-viewer`,children:C.map((e,C)=>{let w=e.name,T=a.get(w);return T?(0,G.jsx)(jI,{filePath:w,info:T,viewed:i.has(w),onViewedChange:y},`${w}-${C}`):(0,G.jsx)(EI,{id:`file-${w}`,fileDiff:e,filePath:w,annotations:b.get(w)??NI,diffStyle:t,tabSize:n[w]??r,viewed:i.has(w),theme:o,editorIDE:s,lineDiffType:c,lineWrap:l,diffIndicators:u,showLineNumbers:d,hunkSeparators:f,lineHoverHighlight:p,fontSize:m,monoFontFamily:h,expandContextByDefault:g,collapsedContextThreshold:_,expansionLineCount:v,onViewedChange:y,onAddComment:x,onDeleteComment:S},`${w}-${C}`)})})}),FI={current:{label:`Current`,icon:HM,title:`Keep the current/HEAD side`},incoming:{label:`Incoming`,icon:NN,title:`Keep the incoming side`},both:{label:`Both`,icon:yN,title:`Keep both sides (current then incoming)`}},II=(0,W.memo)(function({filePath:e,theme:t,fontSize:n,monoFontFamily:r,tabSize:i,onSaved:a}){let o=pj[t]||pj.nord,[s,c]=(0,W.useState)({loading:!0,error:null,file:null}),[l,u]=(0,W.useState)(null),[d,f]=(0,W.useState)(0),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(null),[_,v]=(0,W.useState)(!1),y=(0,W.useRef)(null);(0,W.useEffect)(()=>{let t=!1;return c({loading:!0,error:null,file:null}),u(null),f(0),v(!1),g(null),fetch(`/api/file-text?path=${encodeURIComponent(e)}&version=new`).then(e=>e.json()).then(n=>{if(!t){if(n.error){c({loading:!1,error:n.error,file:null});return}c({loading:!1,error:null,file:{name:e,contents:n.content??``}})}}).catch(e=>{t||c({loading:!1,error:e.message,file:null})}),()=>{t=!0}},[e]);let b=(e,t)=>{let n=y.current;if(!n)return;let r=n.resolveConflict(e,t);r&&r.file&&(u(r.file),f(e=>e+1))};return s.loading?(0,G.jsxs)(`div`,{className:`merge-conflict-card merge-conflict-card-loading`,children:[(0,G.jsx)(sN,{size:14,className:`spin`}),(0,G.jsxs)(`span`,{children:[`Loading `,e,`…`]})]}):s.error||!s.file?(0,G.jsxs)(`div`,{className:`merge-conflict-card merge-conflict-card-error`,children:[(0,G.jsx)(KM,{size:14}),(0,G.jsxs)(`span`,{children:[`Could not load `,e,`: `,s.error??`unknown error`]})]}):(0,G.jsxs)(`div`,{className:`merge-conflict-card`,children:[(0,G.jsxs)(`div`,{className:`merge-conflict-header`,children:[(0,G.jsxs)(`div`,{className:`merge-conflict-title`,children:[(0,G.jsx)(iN,{size:14}),(0,G.jsx)(`span`,{className:`merge-conflict-name`,title:e,children:e})]}),(0,G.jsxs)(`div`,{className:`merge-conflict-actions`,children:[d>0&&(0,G.jsxs)(`span`,{className:`merge-conflict-status`,children:[d,` resolution`,d===1?``:`s`,` pending`]}),(0,G.jsxs)(`button`,{className:`file-diff-edit-btn`,onClick:async()=>{let t=l??s.file;if(t){m(!0),g(null);try{let n=await fetch(`/api/save-file`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:e,content:t.contents,gitAdd:!0})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??`HTTP ${n.status}`)}v(!0),a()}catch(e){g(e.message)}finally{m(!1)}}},disabled:p||_,title:"Write the resolved file to disk and `git add` it",children:[p?(0,G.jsx)(sN,{size:11,className:`spin`}):_?(0,G.jsx)(qM,{size:11}):(0,G.jsx)(CN,{size:11}),(0,G.jsx)(`span`,{children:p?`Saving…`:_?`Saved + staged`:`Save & stage`})]})]})]}),h&&(0,G.jsxs)(`div`,{className:`merge-conflict-card-error`,role:`alert`,children:[(0,G.jsx)(KM,{size:14}),(0,G.jsx)(`span`,{children:h})]}),(0,G.jsx)(O_,{file:l??s.file,options:{disableFileHeader:!0,enableGutterUtility:!1,mergeConflictActionsType:`custom`,theme:{dark:o.type===`dark`?o.themeName:`nord`,light:o.type===`light`?o.themeName:`github-light`},themeType:o.type,unsafeCSS:`
2005
2035
  :host {
2006
- --diffs-tab-size: ${r} !important;
2007
- --diffs-font-family: var(--font-mono) !important;
2036
+ --diffs-tab-size: ${i} !important;
2037
+ --diffs-font-family: ${r} !important;
2008
2038
  --diffs-font-size: ${n}px !important;
2009
2039
  --diffs-line-height: ${Math.round(n*1.7)}px !important;
2010
2040
  }
2011
- `},renderMergeConflictUtility:(e,t)=>{let n=t();return n&&(v.current=n),(0,G.jsx)(`div`,{className:`merge-conflict-buttons`,children:[`current`,`incoming`,`both`].map(t=>{let{label:n,icon:r,title:i}=aI[t];return(0,G.jsxs)(`button`,{type:`button`,className:`merge-conflict-btn merge-conflict-btn-${t}`,title:i,onClick:()=>y(e.conflictIndex,t),children:[(0,G.jsx)(r,{size:11}),(0,G.jsx)(`span`,{children:n})]},t)})})}})]})}),sI=`file-tree-container`,cI=`data-file-tree-style`,lI=`data-file-tree-unsafe-css`,uI=`data-file-tree-scrollbar-measure`,dI=`data-file-tree-scrollbar-gutter-measured`,fI=`--trees-scrollbar-gutter-measured`,pI=`header`,mI=`context-menu`,hI=`context-menu-trigger`,gI=typeof window>`u`?W.useEffect:W.useLayoutEffect;function _I(e,t,n){let r=e==null?null:(0,G.jsx)(`div`,{slot:pI,children:e}),i=t!=null&&n!=null?(0,G.jsx)(`div`,{slot:mI,children:t(n.item,n.context)}):null;return r==null&&i==null?null:(0,G.jsxs)(G.Fragment,{children:[r,i]})}function vI(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 yI(e){let t=e.shadowRoot;return t?.querySelector(`[data-file-tree-id]`)instanceof HTMLElement||t?.querySelector(`[data-file-tree-id]`)instanceof SVGElement?!0:e.querySelector(`template[shadowrootmode="open"]`)instanceof HTMLTemplateElement}function bI(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 xI({header:e,id:t,model:n,preloadedData:r,renderContextMenu:i,...a}){let[o,s]=(0,W.useState)(null),[c,l]=(0,W.useState)(null),u=(0,W.useRef)(n.getComposition()),d=(0,W.useRef)(n);d.current!==n&&(d.current=n,u.current=n.getComposition());let f=i!=null,p=(0,W.useCallback)(()=>{s(null)},[]),m=(0,W.useCallback)((e,t)=>{s({context:t,item:e})},[]),h=u.current,g=(0,W.useMemo)(()=>bI(h,e,f,p,m),[h,p,m,f,e]),_=(0,W.useCallback)(e=>{l(e)},[]);(0,W.useEffect)(()=>{f||s(null)},[f]),gI(()=>{n.setComposition(g)},[g,n]),gI(()=>{if(c!=null)return r!=null&&yI(c)?n.hydrate({fileTreeContainer:c}):n.render({fileTreeContainer:c}),()=>{n.unmount(),n.setComposition(h)}},[h,c,n,r]);let v=vI(_I(e,i,o),r),y=t??r?.id,b={"--trees-item-height":`${String(n.getItemHeight())}px`,"--trees-density-override":n.getDensityFactor(),...a.style};return(0,G.jsx)(sI,{...a,id:y,ref:_,style:b,suppressHydrationWarning:r!=null,children:v})}var SI=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
2041
+ [data-column-number], [data-line], [data-line] * {
2042
+ font-family: ${r} !important;
2043
+ font-size: ${n}px !important;
2044
+ font-variant-ligatures: common-ligatures !important;
2045
+ font-feature-settings: "liga" on, "calt" on !important;
2046
+ }
2047
+ `},renderMergeConflictUtility:(e,t)=>{let n=t();return n&&(y.current=n),(0,G.jsx)(`div`,{className:`merge-conflict-buttons`,children:[`current`,`incoming`,`both`].map(t=>{let{label:n,icon:r,title:i}=FI[t];return(0,G.jsxs)(`button`,{type:`button`,className:`merge-conflict-btn merge-conflict-btn-${t}`,title:i,onClick:()=>b(e.conflictIndex,t),children:[(0,G.jsx)(r,{size:11}),(0,G.jsx)(`span`,{children:n})]},t)})})}})]})}),LI=`file-tree-container`,RI=`data-file-tree-style`,zI=`data-file-tree-unsafe-css`,BI=`data-file-tree-scrollbar-measure`,VI=`data-file-tree-scrollbar-gutter-measured`,HI=`--trees-scrollbar-gutter-measured`,UI=`header`,WI=`context-menu`,GI=`context-menu-trigger`,KI=typeof window>`u`?W.useEffect:W.useLayoutEffect;function qI(e,t,n){let r=e==null?null:(0,G.jsx)(`div`,{slot:UI,children:e}),i=t!=null&&n!=null?(0,G.jsx)(`div`,{slot:WI,children:t(n.item,n.context)}):null;return r==null&&i==null?null:(0,G.jsxs)(G.Fragment,{children:[r,i]})}function JI(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 YI(e){let t=e.shadowRoot;return t?.querySelector(`[data-file-tree-id]`)instanceof HTMLElement||t?.querySelector(`[data-file-tree-id]`)instanceof SVGElement?!0:e.querySelector(`template[shadowrootmode="open"]`)instanceof HTMLTemplateElement}function XI(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 ZI({header:e,id:t,model:n,preloadedData:r,renderContextMenu:i,...a}){let[o,s]=(0,W.useState)(null),[c,l]=(0,W.useState)(null),u=(0,W.useRef)(n.getComposition()),d=(0,W.useRef)(n);d.current!==n&&(d.current=n,u.current=n.getComposition());let f=i!=null,p=(0,W.useCallback)(()=>{s(null)},[]),m=(0,W.useCallback)((e,t)=>{s({context:t,item:e})},[]),h=u.current,g=(0,W.useMemo)(()=>XI(h,e,f,p,m),[h,p,m,f,e]),_=(0,W.useCallback)(e=>{l(e)},[]);(0,W.useEffect)(()=>{f||s(null)},[f]),KI(()=>{n.setComposition(g)},[g,n]),KI(()=>{if(c!=null)return r!=null&&YI(c)?n.hydrate({fileTreeContainer:c}):n.render({fileTreeContainer:c}),()=>{n.unmount(),n.setComposition(h)}},[h,c,n,r]);let v=JI(qI(e,i,o),r),y=t??r?.id,b={"--trees-item-height":`${String(n.getItemHeight())}px`,"--trees-density-override":n.getDensityFactor(),...a.style};return(0,G.jsx)(LI,{...a,id:y,ref:_,style:b,suppressHydrationWarning:r!=null,children:v})}var QI=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
2012
2048
  <symbol id="file-tree-icon-chevron" viewBox="0 0 16 16">
2013
2049
  <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"/>
2014
2050
  </symbol>
@@ -2025,72 +2061,72 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
2025
2061
  <symbol id="file-tree-icon-ellipsis" viewBox="0 0 16 16">
2026
2062
  <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" />
2027
2063
  </symbol>
2028
- </svg>`,CI=`<symbol id="file-tree-builtin-astro" viewBox="0 0 16 16">
2064
+ </svg>`,$I=`<symbol id="file-tree-builtin-astro" viewBox="0 0 16 16">
2029
2065
  <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"/>
2030
2066
  <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"/>
2031
- </symbol>`,wI=`<symbol id="file-tree-builtin-babel" viewBox="0 0 16 16">
2067
+ </symbol>`,eL=`<symbol id="file-tree-builtin-babel" viewBox="0 0 16 16">
2032
2068
  <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"/>
2033
- </symbol>`,TI=`<symbol id="file-tree-builtin-bash" viewBox="0 0 16 16">
2069
+ </symbol>`,tL=`<symbol id="file-tree-builtin-bash" viewBox="0 0 16 16">
2034
2070
  <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"/>
2035
2071
  <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"/>
2036
- </symbol>`,EI=`<symbol id="file-tree-builtin-biome" viewBox="0 0 16 16">
2072
+ </symbol>`,nL=`<symbol id="file-tree-builtin-biome" viewBox="0 0 16 16">
2037
2073
  <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"/>
2038
- </symbol>`,DI=`<symbol id="file-tree-builtin-bootstrap" viewBox="0 0 16 16">
2074
+ </symbol>`,rL=`<symbol id="file-tree-builtin-bootstrap" viewBox="0 0 16 16">
2039
2075
  <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"/>
2040
2076
  <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"/>
2041
- </symbol>`,OI=`<symbol id="file-tree-builtin-browserslist" viewBox="0 0 16 16">
2077
+ </symbol>`,iL=`<symbol id="file-tree-builtin-browserslist" viewBox="0 0 16 16">
2042
2078
  <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"/>
2043
2079
  <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"/>
2044
2080
  <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"/>
2045
- </symbol>`,kI=`<symbol id="file-tree-builtin-bun" viewBox="0 0 16 16">
2081
+ </symbol>`,aL=`<symbol id="file-tree-builtin-bun" viewBox="0 0 16 16">
2046
2082
  <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"/>
2047
- </symbol>`,AI=`<symbol id="file-tree-builtin-c" viewBox="0 0 16 16">
2083
+ </symbol>`,oL=`<symbol id="file-tree-builtin-c" viewBox="0 0 16 16">
2048
2084
  <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"/>
2049
- </symbol>`,jI=`<symbol id="file-tree-builtin-claude" viewBox="0 0 16 16">
2085
+ </symbol>`,sL=`<symbol id="file-tree-builtin-claude" viewBox="0 0 16 16">
2050
2086
  <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"/>
2051
- </symbol>`,MI=`<symbol id="file-tree-builtin-cpp" viewBox="0 0 16 16">
2087
+ </symbol>`,cL=`<symbol id="file-tree-builtin-cpp" viewBox="0 0 16 16">
2052
2088
  <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"/>
2053
- </symbol>`,NI=`<symbol id="file-tree-builtin-css" viewBox="0 0 16 16">
2089
+ </symbol>`,lL=`<symbol id="file-tree-builtin-css" viewBox="0 0 16 16">
2054
2090
  <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"/>
2055
2091
  <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"/>
2056
- </symbol>`,PI=`<symbol id="file-tree-builtin-database" viewBox="0 0 16 16">
2092
+ </symbol>`,uL=`<symbol id="file-tree-builtin-database" viewBox="0 0 16 16">
2057
2093
  <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"/>
2058
2094
  <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"/>
2059
2095
  <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"/>
2060
- </symbol>`,FI=`<symbol id="file-tree-builtin-default" viewBox="0 0 16 16">
2096
+ </symbol>`,dL=`<symbol id="file-tree-builtin-default" viewBox="0 0 16 16">
2061
2097
  <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"/>
2062
2098
  <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"/>
2063
- </symbol>`,II=`<symbol id="file-tree-builtin-docker" viewBox="0 0 16 16">
2099
+ </symbol>`,fL=`<symbol id="file-tree-builtin-docker" viewBox="0 0 16 16">
2064
2100
  <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"/>
2065
2101
  <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"/>
2066
- </symbol>`,LI=`<symbol id="file-tree-builtin-eslint" viewBox="0 0 16 16">
2102
+ </symbol>`,pL=`<symbol id="file-tree-builtin-eslint" viewBox="0 0 16 16">
2067
2103
  <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"/>
2068
2104
  <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"/>
2069
- </symbol>`,RI=`<symbol id="file-tree-builtin-font" viewBox="0 0 16 16">
2105
+ </symbol>`,mL=`<symbol id="file-tree-builtin-font" viewBox="0 0 16 16">
2070
2106
  <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"/>
2071
- </symbol>`,zI=`<symbol id="file-tree-builtin-git" viewBox="0 0 16 16">
2107
+ </symbol>`,hL=`<symbol id="file-tree-builtin-git" viewBox="0 0 16 16">
2072
2108
  <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"/>
2073
- </symbol>`,BI=`<symbol id="file-tree-builtin-go" viewBox="0 0 16 16">
2109
+ </symbol>`,gL=`<symbol id="file-tree-builtin-go" viewBox="0 0 16 16">
2074
2110
  <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"/>
2075
- </symbol>`,VI=`<symbol id="file-tree-builtin-graphql" viewBox="0 0 16 16">
2111
+ </symbol>`,_L=`<symbol id="file-tree-builtin-graphql" viewBox="0 0 16 16">
2076
2112
  <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"/>
2077
- </symbol>`,HI=`<symbol id="file-tree-builtin-html" viewBox="0 0 16 16">
2113
+ </symbol>`,vL=`<symbol id="file-tree-builtin-html" viewBox="0 0 16 16">
2078
2114
  <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"/>
2079
2115
  <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"/>
2080
- </symbol>`,UI=`<symbol id="file-tree-builtin-image" viewBox="0 0 16 16">
2116
+ </symbol>`,yL=`<symbol id="file-tree-builtin-image" viewBox="0 0 16 16">
2081
2117
  <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"/>
2082
2118
  <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"/>
2083
- </symbol>`,WI=`<symbol id="file-tree-builtin-javascript" viewBox="0 0 16 16">
2119
+ </symbol>`,bL=`<symbol id="file-tree-builtin-javascript" viewBox="0 0 16 16">
2084
2120
  <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"/>
2085
2121
  <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"/>
2086
- </symbol>`,GI=`<symbol id="file-tree-builtin-json" viewBox="0 0 16 16">
2122
+ </symbol>`,xL=`<symbol id="file-tree-builtin-json" viewBox="0 0 16 16">
2087
2123
  <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"/>
2088
- </symbol>`,KI=`<symbol id="file-tree-builtin-markdown" viewBox="0 0 16 16">
2124
+ </symbol>`,SL=`<symbol id="file-tree-builtin-markdown" viewBox="0 0 16 16">
2089
2125
  <path fill="currentColor" d="M1 12V4h2l2 2.5L7 4h2v8H7V7.5l-2 2-2-2V12zm9-3 3 3.5L16 9h-2V4h-2v5z"/>
2090
- </symbol>`,qI=`<symbol id="file-tree-builtin-mcp" viewBox="0 0 16 16">
2126
+ </symbol>`,CL=`<symbol id="file-tree-builtin-mcp" viewBox="0 0 16 16">
2091
2127
  <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"/>
2092
2128
  <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"/>
2093
- </symbol>`,JI=`<symbol id="file-tree-builtin-nextjs" viewBox="0 0 16 16">
2129
+ </symbol>`,wL=`<symbol id="file-tree-builtin-nextjs" viewBox="0 0 16 16">
2094
2130
  <defs>
2095
2131
  <linearGradient id="a" x1="4.522" x2="14" y1="3.943" y2="16" gradientUnits="userSpaceOnUse">
2096
2132
  <stop stop-color="currentColor"/>
@@ -2100,82 +2136,82 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
2100
2136
  <path fill="currentColor" d="M3 2h1.522v9.09H3z"/>
2101
2137
  <path fill="url(#a)" d="M4.903 2 15 15.075q-.565.5-1.195.925L4.522 3.943z"/>
2102
2138
  <path fill="currentColor" d="M12.172 2h-1.508v9.094h1.508z"/>
2103
- </symbol>`,YI=`<symbol id="file-tree-builtin-npm" viewBox="0 0 16 16">
2139
+ </symbol>`,TL=`<symbol id="file-tree-builtin-npm" viewBox="0 0 16 16">
2104
2140
  <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"/>
2105
2141
  <path fill="currentColor" d="M10.5 13H13V3H3v10h5V5.5h2.5z"/>
2106
- </symbol>`,XI=`<symbol id="file-tree-builtin-oxc" viewBox="0 0 16 16">
2142
+ </symbol>`,EL=`<symbol id="file-tree-builtin-oxc" viewBox="0 0 16 16">
2107
2143
  <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"/>
2108
- </symbol>`,ZI=`<symbol id="file-tree-builtin-postcss" viewBox="0 0 16 16">
2144
+ </symbol>`,DL=`<symbol id="file-tree-builtin-postcss" viewBox="0 0 16 16">
2109
2145
  <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"/>
2110
- </symbol>`,QI=`<symbol id="file-tree-builtin-prettier" viewBox="0 0 16 16">
2146
+ </symbol>`,OL=`<symbol id="file-tree-builtin-prettier" viewBox="0 0 16 16">
2111
2147
  <path fill="currentColor" d="M6 12v1H4.93v-1zm1-2v1H2v-1zm6-4v1h-3V6zm-1-4v1H9V2z"/>
2112
2148
  <path fill="currentColor" d="M11.5 10v1H8v-1zM5 6v1H2V6zm5-2v1H9V4z" opacity=".8"/>
2113
2149
  <path fill="currentColor" d="M6 14v1H2v-1zm-.5-6v1H2V8zM13 4v1h-3V4zM4.93 2v1H2V2z" opacity=".6"/>
2114
2150
  <path fill="currentColor" d="M4.93 12v1H2v-1zM13 8v1H9V8zM5.5 4v1H2V4zM9 2v1H4.93V2z" opacity=".4"/>
2115
- </symbol>`,$I=`<symbol id="file-tree-builtin-python" viewBox="0 0 16 16">
2151
+ </symbol>`,kL=`<symbol id="file-tree-builtin-python" viewBox="0 0 16 16">
2116
2152
  <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"/>
2117
2153
  <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"/>
2118
- </symbol>`,eL=`<symbol id="file-tree-builtin-react" viewBox="0 0 16 16">
2154
+ </symbol>`,AL=`<symbol id="file-tree-builtin-react" viewBox="0 0 16 16">
2119
2155
  <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"/>
2120
2156
  <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"/>
2121
- </symbol>`,tL=`<symbol id="file-tree-builtin-ruby" viewBox="0 0 16 16">
2157
+ </symbol>`,jL=`<symbol id="file-tree-builtin-ruby" viewBox="0 0 16 16">
2122
2158
  <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"/>
2123
- </symbol>`,nL=`<symbol id="file-tree-builtin-rust" viewBox="0 0 16 16">
2159
+ </symbol>`,ML=`<symbol id="file-tree-builtin-rust" viewBox="0 0 16 16">
2124
2160
  <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"/>
2125
- </symbol>`,rL=`<symbol id="file-tree-builtin-sass" viewBox="0 0 16 16">
2161
+ </symbol>`,NL=`<symbol id="file-tree-builtin-sass" viewBox="0 0 16 16">
2126
2162
  <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"/>
2127
- </symbol>`,iL=`<symbol id="file-tree-builtin-stylelint" viewBox="0 0 16 16">
2163
+ </symbol>`,PL=`<symbol id="file-tree-builtin-stylelint" viewBox="0 0 16 16">
2128
2164
  <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"/>
2129
2165
  <path fill="currentColor" d="M6.5 2.5V4l-2 1.5v-4zm5 3L9.5 4V2.5l2-1zM9 4H7V2.5h2z"/>
2130
- </symbol>`,aL=`<symbol id="file-tree-builtin-svelte" viewBox="0 0 16 16">
2166
+ </symbol>`,FL=`<symbol id="file-tree-builtin-svelte" viewBox="0 0 16 16">
2131
2167
  <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"/>
2132
- </symbol>`,oL=`<symbol id="file-tree-builtin-svg" viewBox="0 0 16 16">
2168
+ </symbol>`,IL=`<symbol id="file-tree-builtin-svg" viewBox="0 0 16 16">
2133
2169
  <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"/>
2134
2170
  <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"/>
2135
- </symbol>`,sL=`<symbol id="file-tree-builtin-svgo" viewBox="0 0 16 16">
2171
+ </symbol>`,LL=`<symbol id="file-tree-builtin-svgo" viewBox="0 0 16 16">
2136
2172
  <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"/>
2137
2173
  <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"/>
2138
- </symbol>`,cL=`<symbol id="file-tree-builtin-swift" viewBox="0 0 16 16">
2174
+ </symbol>`,RL=`<symbol id="file-tree-builtin-swift" viewBox="0 0 16 16">
2139
2175
  <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"/>
2140
- </symbol>`,lL=`<symbol id="file-tree-builtin-table" viewBox="0 0 16 16">
2176
+ </symbol>`,zL=`<symbol id="file-tree-builtin-table" viewBox="0 0 16 16">
2141
2177
  <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"/>
2142
2178
  <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"/>
2143
- </symbol>`,uL=`<symbol id="file-tree-builtin-tailwind" viewBox="0 0 16 16">
2179
+ </symbol>`,BL=`<symbol id="file-tree-builtin-tailwind" viewBox="0 0 16 16">
2144
2180
  <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"/>
2145
- </symbol>`,dL=`<symbol id="file-tree-builtin-terraform" viewBox="0 0 16 16">
2181
+ </symbol>`,VL=`<symbol id="file-tree-builtin-terraform" viewBox="0 0 16 16">
2146
2182
  <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"/>
2147
- </symbol>`,fL=`<symbol id="file-tree-builtin-text" viewBox="0 0 16 16">
2183
+ </symbol>`,HL=`<symbol id="file-tree-builtin-text" viewBox="0 0 16 16">
2148
2184
  <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"/>
2149
2185
  <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"/>
2150
- </symbol>`,pL=`<symbol id="file-tree-builtin-typescript" viewBox="0 0 16 16">
2186
+ </symbol>`,UL=`<symbol id="file-tree-builtin-typescript" viewBox="0 0 16 16">
2151
2187
  <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"/>
2152
2188
  <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"/>
2153
- </symbol>`,mL=`<symbol id="file-tree-builtin-vite" viewBox="0 0 16 16">
2189
+ </symbol>`,WL=`<symbol id="file-tree-builtin-vite" viewBox="0 0 16 16">
2154
2190
  <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"/>
2155
- </symbol>`,hL=`<symbol id="file-tree-builtin-vscode" viewBox="0 0 16 16">
2191
+ </symbol>`,GL=`<symbol id="file-tree-builtin-vscode" viewBox="0 0 16 16">
2156
2192
  <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"/>
2157
2193
  <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"/>
2158
2194
  <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"/>
2159
- </symbol>`,gL=`<symbol id="file-tree-builtin-vue" viewBox="0 0 16 16">
2195
+ </symbol>`,KL=`<symbol id="file-tree-builtin-vue" viewBox="0 0 16 16">
2160
2196
  <path fill="currentColor" d="M9.62 2.25 8 5.02 6.38 2.25H1l7 12 7-12z" opacity=".5"/>
2161
2197
  <path fill="currentColor" d="M9.54 2.25 8 4.95l-1.54-2.7H4l4 7 4-7z"/>
2162
- </symbol>`,_L=`<symbol id="file-tree-builtin-wasm" viewBox="0 0 16 16">
2198
+ </symbol>`,qL=`<symbol id="file-tree-builtin-wasm" viewBox="0 0 16 16">
2163
2199
  <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"/>
2164
2200
  <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"/>
2165
2201
  <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"/>
2166
- </symbol>`,vL=`<symbol id="file-tree-builtin-webpack" viewBox="0 0 16 16">
2202
+ </symbol>`,JL=`<symbol id="file-tree-builtin-webpack" viewBox="0 0 16 16">
2167
2203
  <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"/>
2168
2204
  <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"/>
2169
- </symbol>`,yL=`<symbol id="file-tree-builtin-yml" viewBox="0 0 16 16">
2205
+ </symbol>`,YL=`<symbol id="file-tree-builtin-yml" viewBox="0 0 16 16">
2170
2206
  <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"/>
2171
- </symbol>`,bL=`<symbol id="file-tree-builtin-zig" viewBox="0 0 16 16">
2207
+ </symbol>`,XL=`<symbol id="file-tree-builtin-zig" viewBox="0 0 16 16">
2172
2208
  <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"/>
2173
2209
  <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"/>
2174
- </symbol>`,xL=[TI,AI,MI,NI,PI,FI,RI,zI,BI,HI,UI,WI,GI,KI,qI,$I,tL,nL,cL,lL,fL,pL,`<symbol id="file-tree-builtin-zip" viewBox="0 0 16 16">
2210
+ </symbol>`,ZL=[tL,oL,cL,lL,uL,dL,mL,hL,gL,vL,yL,bL,xL,SL,CL,kL,jL,ML,RL,zL,HL,UL,`<symbol id="file-tree-builtin-zip" viewBox="0 0 16 16">
2175
2211
  <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"/>
2176
2212
  <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"/>
2177
- </symbol>`],SL=[CI,wI,EI,DI,OI,kI,jI,II,LI,VI,JI,YI,XI,ZI,QI,eL,rL,iL,aL,oL,sL,uL,dL,mL,hL,gL,_L,vL,yL,bL];function CL(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
2178
- `)}\n</svg>`)}var wL=CL(SI,xL),TL={minimal:SI,standard:wL,complete:CL(wL,SL)},EL={".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`},DL={"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`},OL={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},kL=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`]),AL=new Set([`complete`]);function jL(e){return TL[e===`none`?`minimal`:e]}function ML(e){return`file-tree-builtin-${e}`}function NL(e){return e!==`none`&&AL.has(e)}function PL(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=EL[t.toLowerCase()];if(i!=null&&(r||kL.has(i)))return i;for(let e of n){if(r){let t=OL[e];if(t!=null)return t}let t=DL[e];if(t!=null&&(r||kL.has(t)))return t}return`default`}function FL(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function IL(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(FL(e)?`none`:`complete`),colored:e.colored??!0}}var LL={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function RL(e,t){if(typeof e==`number`)return{itemHeight:t??LL.default.itemHeight,factor:e};let n=LL[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var zL=LL.default.itemHeight,BL=`@layer base, theme, unsafe;
2213
+ </symbol>`],QL=[$I,eL,nL,rL,iL,aL,sL,fL,pL,_L,wL,TL,EL,DL,OL,AL,NL,PL,FL,IL,LL,BL,VL,WL,GL,KL,qL,JL,YL,XL];function $L(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
2214
+ `)}\n</svg>`)}var eR=$L(QI,ZL),tR={minimal:QI,standard:eR,complete:$L(eR,QL)},nR={".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`},rR={"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`},iR={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},aR=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`]),oR=new Set([`complete`]);function sR(e){return tR[e===`none`?`minimal`:e]}function cR(e){return`file-tree-builtin-${e}`}function lR(e){return e!==`none`&&oR.has(e)}function uR(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=nR[t.toLowerCase()];if(i!=null&&(r||aR.has(i)))return i;for(let e of n){if(r){let t=iR[e];if(t!=null)return t}let t=rR[e];if(t!=null&&(r||aR.has(t)))return t}return`default`}function dR(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function fR(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(dR(e)?`none`:`complete`),colored:e.colored??!0}}var pR={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function mR(e,t){if(typeof e==`number`)return{itemHeight:t??pR.default.itemHeight,factor:e};let n=pR[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var hR=pR.default.itemHeight,gR=`@layer base, theme, unsafe;
2179
2215
 
2180
2216
  @layer base {
2181
2217
  :host {
@@ -3839,18 +3875,85 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
3839
3875
  }
3840
3876
  }
3841
3877
  }
3842
- `,VL=`@layer base, unsafe;`;function HL(e){return`${VL}
3878
+ `,_R=`@layer base, unsafe;`;function vR(e){return`${_R}
3843
3879
  @layer base {
3844
3880
  ${e}
3845
- }`}function UL(e){return`${VL}
3881
+ }`}function yR(e){return`${_R}
3846
3882
  @layer unsafe {
3847
3883
  ${e}
3848
- }`}var WL=new WeakMap;function GL(e){let t=WL.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(uI,`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(),WL.set(e,i),i}function KL(e,t){if(!e.isConnected)return;let n=GL(t);if(n==null)return;let r=t.querySelector(`style[${dI}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(dI,``),t.appendChild(i)),i.textContent=`:host { ${fI}: ${n}px; }`}var qL;function JL(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){qL??(qL=new CSSStyleSheet,qL.replaceSync(HL(BL)));let t=!1;try{e.adoptedStyleSheets=[qL],t=!0}catch{}if(t){e.querySelector(`style[${cI}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(cI,``),t.textContent=HL(BL),e.prepend(t)}}function YL(e,t){XL(e,t),JL(t),KL(e,t)}function XL(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`});YL(this,e)}}if(customElements.define(sI,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(sI)))e instanceof HTMLElement&&YL(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var ZL=5,QL=1<<ZL,$L=QL*4;function eR(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function tR(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function nR(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 rR(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 iR(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function aR(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 oR(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,uR(e,t)}function sR(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=rR(e).get(t);if(i===void 0)return;let a=i>>ZL;e.childVisibleChunkSums[a]+=r}function cR(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=dR(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=QL}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 lR(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>ZL;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<ZL}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 uR(e,t){if(t.childIds.length<$L){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/QL),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>>ZL]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function dR(e,t,n,r){let i=Math.min(t.childIds.length,n+QL),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 fR=7,pR=3,mR=1<<pR,hR=4;function gR(e,t,n=0){return e<<hR|n<<pR|t}function _R(e){return e.depthAndFlags>>>hR}function vR(e){return(e.depthAndFlags&mR)>>pR}function yR(e){return(e.depthAndFlags&mR)!==0}function bR(e){return e.depthAndFlags&fR}function xR(e,t){return(bR(e)&t)!==0}function SR(e,t){e.depthAndFlags|=t}function CR(e,t){e.depthAndFlags=gR(t,bR(e),vR(e))}var wR=Symbol(`benchmarkInstrumentation`);function TR(e,t){return t==null||Object.defineProperty(e,wR,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function ER(e){return e==null?null:e[wR]??null}function Q(e,t,n){return e==null?n():e.measurePhase(t,n)}function DR(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function OR(e){return e>=48&&e<=57}function kR(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!OR(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&&OR(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 AR(e){let t=e.toLowerCase();return{lowerValue:t,tokens:kR(t)}}function jR(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 MR(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=jR(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function NR(e,t,n){let r=MR(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function PR(e,t){return NR(e,t,AR)}function FR(e,t){return t===e.segments.length-1?e.isDirectory?1:0:1}function IR(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=FR(e,r);return a===FR(t,r)?PR(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 LR(e,t){return IR(e,t)}function RR(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=AR(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=FR(e,n);return o===FR(t,n)?NR(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 zR(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=AR(r);return e.sortKeyById[t]=i,i}function BR(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function VR(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 HR(e){let{hasTrailingSlash:t,segments:n}=VR(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function UR(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=VR(e);return{requiresDirectory:t,segments:n}}var WR=``;function GR(){let e=new Map;return e.set(WR,0),{idByValue:e,valueById:[WR],sortKeyById:[AR(WR)]}}function KR(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 qR(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var JR=Symbol(`pathStorePreparedInputKind`);function YR(e,t){return e[JR]=t,e}function XR(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function ZR(e,t,n){return n===`default`?LR(e,t):n(XR(e),XR(t))}function QR(){return{depthAndFlags:gR(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function $R(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 ez(e){return e.isDirectory?e.segments.length:e.segments.length-1}function tz(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 nz(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function rz(e,t={}){return lz(e,t).map(e=>e.path)}function iz(e,t={}){let n=lz(e,t);return YR({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function az(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return YR({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function oz(e){let t=e,n=t.preparedPaths;if(t[JR]===`prepared`&&n!=null)return n;if(!tz(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function sz(e){let t=e;return t[JR]===`presorted`&&t.presortedPaths!=null||nz(t.presortedPaths)?t.presortedPaths:null}function cz(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function lz(e,t={}){let n=BR(t),r=ER(t);DR(r,`workload.inputFiles`,e.length);let i=Q(r,`store.preparePathEntries.parse`,()=>e.map(e=>HR(e)));return Q(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>ZR(e,t,n.sort))),i}var uz=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[QR()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=GR();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=ER(e),this.options=BR(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,eR())}appendPaths(e){return Q(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>HR(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,Q(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return Q(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:gR(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:gR(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:gR(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=HR(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:gR(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:gR(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=HR(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(Q(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||Q(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`?RR(this.lastPreparedPath,e,this.segmentSortKeyCache):ZR(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=ez(e),i=n==null?0:ez(n),a=n==null?0:$R(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=KR(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:gR(_R(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),iR(i,s),s}createFileChildUnchecked(e,t){let n=KR(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:gR(_R(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),iR(r,a),a}getOrCreateDirectoryChild(e,t){let n=KR(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&&!yR(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:gR(_R(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),iR(r,a),this.directories.set(a,eR()),a}createDirectoryChild(e,t){let n=KR(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:gR(_R(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),iR(r,a),this.directories.set(a,eR()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!yR(n))throw Error(`Path is not a directory: "${t}"`);if(xR(n,1))throw Error(`Duplicate path: "${t}"`);SR(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,tR());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(yR(a)){let t=tR();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;yR(n)&&this.directories.set(t,eR());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),iR(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!yR(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 oR(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function dz(e,t=`closed`,n=null){let r=pz(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 fz(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function pz(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 mz(e,t){return xR(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion===`closed`?!1:_R(t)<=e.defaultExpansion}function hz(e,t,n=e.snapshot.nodes[t]){return n==null||!yR(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:mz(e,n)}function gz(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!yR(r))return;let i=mz(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 _z(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 vz(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function yz(e,t){let n=_z(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 bz(e,t){let n=_z(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function xz(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 Sz(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function Cz(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 wz(e,t){e.directoryLoadInfoById.delete(t)}function Tz(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 Ez(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Dz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function Oz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function kz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Az(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function jz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Mz(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 Nz(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 Pz(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 Fz(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 Iz(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 Lz(e,t,n){return{...n,visibleCountDelta:Jz(e)-t}}function Rz(e,t){let n=Jz(e),r=fz();e.transactionStack.push(r);try{t()}catch(t){throw Vz(e,r,!1),t}Vz(e,r,!0,Jz(e)-n)}function zz(e,t){let n=e.instrumentation;if(n==null){Bz(e,t);return}Q(n,`store.events.record`,()=>Bz(e,t))}function Bz(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){Kz(e,t);return}n.events.push(t),Gz(n,t)}function Vz(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?Wz(i,t):Q(n,`store.events.batch.merge`,()=>Wz(i,t));return}let a=Hz(t,r),o=e.instrumentation;if(o==null){Kz(e,a);return}Q(o,`store.events.batch.commit`,()=>Kz(e,a))}function Hz(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 Uz(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function Wz(e,t){for(let n of t.events)e.events.push(n);Uz(e,t)}function Gz(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function Kz(e,t){let n=e.instrumentation;if(n==null){qz(e,t);return}Q(n,`store.events.emit`,()=>qz(e,t))}function qz(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function Jz(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function Yz(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!yR(n)||xR(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||!yR(a)?null:i}function Xz(e,t){let n=t;for(;;){let t=Yz(e,n);if(t==null)return n;n=t}}function Zz(e,t){let n=[t],r=t;for(;;){let t=Yz(e,r);if(t==null)return n;n.push(t),r=t}}function Qz(e,t){let n=t==null?e.snapshot.rootId:cB(e,t);return n==null?[]:fB(e,n)}function $z(e,t){let n=HR(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=DB(e,EB(e,r)),{createdNodeIds:a,directoryId:o}=pB(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=dB(e,o);if(xR(n,1))throw Error(`Path already exists: "${t}"`);SR(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=hB(e,o,n.basename),s.add(c);aB(e,o);let l=DB(e,o);return Ez({affectedAncestorIds:sB(e,c),affectedNodeIds:[...s],path:t,projectionChanged:OB(i,l)})}function eB(e,t,n){let r=cB(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=dB(e,r);if(xR(i,2))throw Error(`The root node cannot be removed`);if(yR(i)&&uB(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=DB(e,a),s=wB(e,r);vB(e,a,r,i.nameId),TB(e,a),aB(e,a);let c=DB(e,a);return Dz({affectedAncestorIds:sB(e,a),affectedNodeIds:s,path:t,projectionChanged:OB(o,c),recursive:n.recursive===!0})}function tB(e,t,n,r){let i=cB(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=dB(e,i);if(xR(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=SB(e,i,n),c=DB(e,a.parentId),l=DB(e,s.parentId),u=qR(e.snapshot.segmentTable,a.nameId),d=KR(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(yR(a)&&MB(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=nR(e.snapshot.nodes,uB(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&CB(e,p,o,vR(a))===`skip`)return null;let m=a.parentId;vB(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),jB(e,i),_B(e,s.parentId,i),TB(e,m),e.pathCacheVersion++,aB(e,m),s.parentId!==m&&aB(e,s.parentId);let h=DB(e,m),g=DB(e,s.parentId);return Oz({affectedAncestorIds:[...new Set([...sB(e,m),...sB(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:kB([c,l],[h,g]),to:iB(e,i)})}function nB(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function rB(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function iB(e,t){let n=dB(e,t),r=nB(e,t);if(r!=null)return r;if(xR(n,2))return rB(e,t,``);let i=iB(e,n.parentId),a=qR(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return rB(e,t,yR(n)?`${o}/`:o)}function aB(e,t){let n=e.instrumentation;if(n==null){PB(e,t);return}Q(n,`store.recomputeCountsUpwardFrom`,()=>PB(e,t))}function oB(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||!yR(o)){NB(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){NB(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function sB(e,t){let n=[],r=t;for(;r!=null;){let t=dB(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function cB(e,t){if(t.length===0)return e.snapshot.rootId;let n=UR(t);return lB(e,n.segments,n.requiresDirectory)}function lB(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=uB(e,r),a=nR(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=dB(e,r);return n&&!yR(i)?null:r}function uB(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 dB(e,t){let n=e.snapshot.nodes[t];if(n===void 0||xR(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function fB(e,t){let n=e.snapshot.nodes[t];if(n===void 0||xR(n,4))return[];if(!yR(n))return[iB(e,t)];if(uB(e,t).childIds.length===0)return xR(n,1)&&!xR(n,2)?[iB(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||xR(n,4)){i.pop();continue}if(!yR(n)){r.push(iB(e,t.nodeId)),i.pop();continue}let a=uB(e,t.nodeId);if(a.childIds.length===0){xR(n,1)&&!xR(n,2)&&r.push(iB(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 pB(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=KR(e.snapshot.segmentTable,i),a=uB(e,r),o=nR(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!yR(dB(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=mB(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function mB(e,t,n){let r=dB(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:gR(_R(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,eR()),_B(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function hB(e,t,n){let r=KR(e.snapshot.segmentTable,n),i=uB(e,t);if(nR(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${IB(e,t,n)}"`);let a=dB(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:gR(_R(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),_B(e,t,o),e.activeNodeCount++,o}function gB(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}yB(e,n,o)<0?i=a:r=a+1}return r}function _B(e,t,n){let r=uB(e,t),i=dB(e,n);nR(e.snapshot.nodes,r).set(i.nameId,n),sR(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=gB(e,r,n);r.childIds.splice(a,0,n),aR(r,a),uR(e.snapshot.nodes,r)}function vB(e,t,n,r){let i=uB(e,t),a=rR(i),o=a.get(n)??-1;nR(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&sR(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),aR(i,o),uR(e.snapshot.nodes,i))}function yB(e,t,n){let r=e.snapshot.options.sort;return r===`default`?bB(e,t,n):r(xB(e,t),xB(e,n))}function bB(e,t,n){let r=dB(e,t),i=dB(e,n),a=yR(r);if(a!==yR(i))return a?-1:1;let o=MR(zR(e.snapshot.segmentTable,r.nameId),zR(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=qR(e.snapshot.segmentTable,r.nameId),c=qR(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function xB(e,t){let n=dB(e,t),r=iB(e,t),i=yR(n),a=i?r.slice(0,-1):r;return{basename:qR(e.snapshot.segmentTable,n.nameId),depth:_R(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function SB(e,t,n){let r=dB(e,t),i=cB(e,n);if(i!=null){let t=dB(e,i);if(yR(t))return{basename:qR(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=UR(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=UR(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:lB(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function CB(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${iB(e,t)}"`);let i=dB(e,t);if(vR(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(yR(i)&&uB(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return wB(e,t),vB(e,a,t,o),TB(e,a),aB(e,a),`handled`}function wB(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=dB(e,t.nodeId);if(t.visitedChildren||!yR(i)){yR(i)&&e.snapshot.directories.delete(t.nodeId),SR(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),wz(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=uB(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 TB(e,t){let n=t;for(;n!=null;){let t=dB(e,n);if(!yR(t)||xR(t,2)||uB(e,n).childIds.length>0)return;SR(t,1),n=t.parentId===n?null:t.parentId}}function EB(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=nR(e.snapshot.nodes,uB(e,n)).get(t);if(i==null||!yR(dB(e,i)))break;n=i}return n}function DB(e,t){let n=AB(e,t);if(n==null)return null;let r=Xz(e,n),i=dB(e,r),a=n===r?null:Zz(e,n).map(t=>iB(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:uB(e,r).childIds.length>0,path:iB(e,r),terminalKind:vR(i)})}function OB(e,t){return kB([e],[t])}function kB(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 AB(e,t){let n=t;for(;n!=null;){let t=dB(e,n);if(!yR(t)||xR(t,2))return null;if(!hz(e,n,t))return n;n=t.parentId}return null}function jB(e,t){let n=dB(e,t);if(CR(n,(t===e.snapshot.rootId?-1:_R(dB(e,n.parentId)))+1),!yR(n))return;let r=uB(e,t);for(let t of r.childIds)jB(e,t)}function MB(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=dB(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function NB(e,t,n=dB(e,t),r=!1){let i=e.instrumentation;if(i==null){FB(e,t,n,r);return}Q(i,`store.recomputeNodeCounts`,()=>FB(e,t,n,r))}function PB(e,t){let n=t;for(;n!=null;){let t=dB(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(NB(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&sR(uB(e,s),n,a,o),n=s}}function FB(e,t,n,r){if(!yR(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=uB(e,t);if(r){let t=e.instrumentation;t==null?oR(e.snapshot.nodes,i):Q(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>oR(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,xR(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=Yz(e,t)==null?hz(e,t,n)?1+o:1:o}function IB(e,t,n){let r=iB(e,t);return r.length===0?n:`${r}${n}`}function LB(e){return e!=null&&!xR(e,4)}function RB(e,t){let n=e.snapshot.nodes[t];return!LB(n)||!yR(n)||xR(n,2)?null:n}function zB(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&LB(e.snapshot.nodes[n])&&(t+=1);return t}function BB(e){return Math.max(0,e.valueById.length-1)}function VB(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:zB(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:BB(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function HB(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 UB(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)RB(e,n)!=null&&t.push(iB(e,n));for(let t of e.expandedDirectoryIds)RB(e,t)!=null&&n.push(iB(e,t));return{collapsedPaths:t,expandedPaths:n}}function WB(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)RB(e,n)==null||vz(e,n)===`loaded`||t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:iB(e,n)});return t}function GB(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=cB(e,n);t!=null&&gz(e,t,!0,dB(e,t))}for(let n of t.collapsedPaths){let t=cB(e,n);t!=null&&gz(e,t,!1,dB(e,t))}}function KB(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=cB(e,n.path);t!=null&&RB(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function qB(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function JB(e){let t=e.snapshot.segmentTable,n=GR();for(let r of e.snapshot.nodes)if(LB(r)){if(xR(r,2)){r.nameId=0;continue}r.nameId=KR(n,qR(t,r.nameId))}e.snapshot.segmentTable=n}function YB(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!LB(r)||!yR(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return LB(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[dB(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),oR(e.snapshot.nodes,n)}}function XB(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(LB(n))break;--t}e.snapshot.nodes.length=t+1}function ZB(e){let t=UB(e),n=WB(e);Q(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>qB(e)),Q(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>JB(e)),Q(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>YB(e)),Q(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>XB(e)),Q(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>GB(e,t)),Q(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>KB(e,n)),Q(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>oB(e,e.snapshot.rootId))}function QB(e){let t=UB(e),n=WB(e),r=Q(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>Qz(e)),i=TR({...e.snapshot.options},e.instrumentation),a=Q(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new uz(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,Q(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>GB(e,t)),Q(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>KB(e,n)),Q(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>oB(e,e.snapshot.rootId))}function $B(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function eV(e,t){let n=VB(e);t===`stable`?Q(e.instrumentation,`store.cleanup.stable`,()=>ZB(e)):Q(e.instrumentation,`store.cleanup.aggressive`,()=>QB(e));let r=VB(e);return HB(t,t===`stable`,n,r)}var tV=64;function nV(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 rV(e){return dB(e,e.snapshot.rootId).visibleSubtreeCount}function iV(e,t,n,r){let i=dB(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function aV(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:wV(e,t.cursor),setSize:t.setSize,subtreeEndIndex:iV(e,t.cursor,t.index,n)}}function oV(e,t,n,r,i,a){let o=uB(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=cR(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return sV(e,u,l,r+c,i+1,s,o.childIds.length,a)}function sV(e,t,n,r,i,a,o,s){if(!yR(dB(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=vV(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=dB(e,c.terminalNodeId);if(!yR(l)||!hz(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return oV(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function cV(e,t){let n=rV(e);if(t<0||t>=n)return null;let r=oV(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>iB(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=aV(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:wV(e,r.cursor),setSize:r.setSize,subtreeEndIndex:iV(e,r.cursor,r.index,n)}}function lV(e,t,n){let r=e.instrumentation,i=rV(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 CV(e,o+1);let t=[],n=hV(e,a);for(let r=a;r<=o&&n!=null;r++){let r=wV(e,n);t.push(r),n=bV(e,n)}return t}let s=[],c=0,l=0,u=Q(r,`store.getVisibleSlice.selectFirstRow`,()=>hV(e,a));for(let t=a;t<=o&&u!=null;t++){let t=Q(r,`store.getVisibleSlice.materializeRow`,()=>wV(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=Q(r,`store.getVisibleSlice.advanceCursor`,()=>bV(e,u))}return DR(r,`workload.visibleRowsRead`,s.length),DR(r,`workload.flattenedRowsRead`,c),DR(r,`workload.flattenedSegmentsRead`,l),s}function uV(e,t=rV(e)){let n=e.instrumentation;return n==null?SV(e,t):Q(n,`store.getVisibleTreeProjection`,()=>SV(e,t))}function dV(e){return xV(uV(e))}function fV(e,t){let n=cB(e,t);if(n==null||n===e.snapshot.rootId||yR(dB(e,n))&&Xz(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=dB(e,i).parentId,n=uB(e,t),s=rR(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=lR(a,n,s),t!==o){let n=dB(e,t),a=Yz(e,t);if(!hz(e,t,n)&&a!==i)return null;Xz(e,t)===t&&(r+=1)}i=t}return r}function pV(e,t){let n=cB(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=dB(e,n);if(!yR(r))throw Error(`Path is not a directory: "${t}"`);return hz(e,n,r)?null:(gz(e,n,!0,r),aB(e,n),kz({affectedAncestorIds:sB(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function mV(e,t){let n=cB(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=dB(e,n);if(!yR(r))throw Error(`Path is not a directory: "${t}"`);return hz(e,n,r)?(gz(e,n,!1,r),aB(e,n),Az({affectedAncestorIds:sB(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function hV(e,t){return t<0||t>=rV(e)?null:gV(e,e.snapshot.rootId,t,-1)}function gV(e,t,n,r){let i=uB(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?cR(e.snapshot.nodes,i,n):Q(a,`store.getVisibleSlice.selectChildIndex`,()=>cR(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return _V(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function _V(e,t,n,r){if(!yR(dB(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=vV(e,t,r);if(n===0)return i;let a=dB(e,i.terminalNodeId);if(!yR(a)||!hz(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return gV(e,i.terminalNodeId,n-1,i.visibleDepth)}function vV(e,t,n){return yR(dB(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:Xz(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:Q(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>Xz(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function yV(e,t){let n=dB(e,t);if(!yR(n))return!0;let r=n.parentId;return r===e.snapshot.rootId?!0:Yz(e,r)!==t}function bV(e,t){let n=dB(e,t.terminalNodeId);if(yR(n)){let r=uB(e,t.terminalNodeId);if(hz(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:_V(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=dB(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=uB(e,n),o=rR(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 _V(e,s,0,i);yV(e,r)&&i--,r=n}}function xV(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 SV(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(tV);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=nV(o,y);let x,S=_;if(yR(v))S=f?Xz(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:iB(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&&yR(C)&&hz(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 CV(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(!yR(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:iB(e,f)};continue}let h=l?Xz(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=wV(e,g);let _=i[h];_!=null&&yR(_)&&hz(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function wV(e,t){let n=dB(e,t.terminalNodeId),r=yR(n)?TV(e,t):null,i=iB(e,t.terminalNodeId),a=qR(e.snapshot.segmentTable,n.nameId),o=yR(n)&&uB(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?Zz(e,t.headNodeId).map(n=>{let r=dB(e,n);return{isTerminal:n===t.terminalNodeId,name:qR(e.snapshot.segmentTable,r.nameId),nodeId:n,path:iB(e,n)}}):Q(c,`store.getVisibleSlice.flatten.collectSegments`,()=>Zz(e,t.headNodeId).map(n=>{let r=dB(e,n);return{isTerminal:n===t.terminalNodeId,name:qR(e.snapshot.segmentTable,r.nameId),nodeId:n,path:iB(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:yR(n)&&hz(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:yR(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function TV(e,t){if(t.headNodeId===t.terminalNodeId)return vz(e,t.terminalNodeId);let n=Zz(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=vz(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}function EV(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||!yR(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&&uR(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&yR(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,uR(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function DV(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var OV=class e{#e;constructor(e={}){let t=ER(e),n=Q(t,`store.builder.create`,()=>new uz(e));if(e.preparedInput!=null){let t=sz(e.preparedInput);t==null?n.appendPreparedPaths(oz(e.preparedInput),!1):n.appendPresortedPaths(t,cz(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(Q(t,`store.preparePathEntries`,()=>lz(r,e)))}let r=Q(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=Q(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=Q(t,`store.state.create`,()=>dz(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:Q(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||DV(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&Q(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?Q(t,`store.state.initializeOpenVisibleCounts`,()=>EV(this.#e)):Q(t,`store.state.recomputeCounts`,()=>oB(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return rz(e,t)}static prepareInput(e,t={}){return iz(e,t)}static preparePresortedInput(e){return az(e)}list(e){return Q(this.#e.instrumentation,`store.list`,()=>Qz(this.#e,e))}add(e){Q(this.#e.instrumentation,`store.add`,()=>{let t=rV(this.#e);zz(this.#e,Lz(this.#e,t,$z(this.#e,e)))})}remove(e,t={}){Q(this.#e.instrumentation,`store.remove`,()=>{let n=rV(this.#e);zz(this.#e,Lz(this.#e,n,eB(this.#e,e,t)))})}move(e,t,n={}){Q(this.#e.instrumentation,`store.move`,()=>{let r=rV(this.#e),i=tB(this.#e,e,t,n);i!=null&&zz(this.#e,Lz(this.#e,r,i))})}batch(e){Rz(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision});break}})}getVisibleCount(){return Q(this.#e.instrumentation,`store.getVisibleCount`,()=>rV(this.#e))}getVisibleSlice(e,t){return Q(this.#e.instrumentation,`store.getVisibleSlice`,()=>lV(this.#e,e,t))}getVisibleRowContext(e){return Q(this.#e.instrumentation,`store.getVisibleRowContext`,()=>cV(this.#e,e))}getVisibleTreeProjection(){return dV(this.#e)}getVisibleTreeProjectionData(e){return uV(this.#e,e)}getVisibleIndex(e){return Q(this.#e.instrumentation,`store.getVisibleIndex`,()=>fV(this.#e,e))}getPathInfo(e){return Q(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=cB(this.#e,e);if(t==null)return null;let n=dB(this.#e,t);return{depth:_R(n),kind:yR(n)?`directory`:`file`,path:iB(this.#e,t)}})}isExpanded(e){return Q(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=dB(this.#e,t);return hz(this.#e,t,n)})}expand(e){Q(this.#e.instrumentation,`store.expand`,()=>{let t=rV(this.#e),n=pV(this.#e,e);n!=null&&zz(this.#e,Lz(this.#e,t,n))})}collapse(e){Q(this.#e.instrumentation,`store.collapse`,()=>{let t=rV(this.#e),n=mV(this.#e,e);n!=null&&zz(this.#e,Lz(this.#e,t,n))})}on(e,t){return Tz(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return vz(this.#e,t)}markDirectoryUnloaded(e){Q(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(uB(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=rV(this.#e);bz(this.#e,t),zz(this.#e,Lz(this.#e,n,jz({affectedAncestorIds:sB(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return Q(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=rV(this.#e),r=yz(this.#e,t);return zz(this.#e,Lz(this.#e,n,Mz({affectedAncestorIds:sB(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return Q(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||vz(this.#e,n)!==`loading`||!Sz(this.#e,n,e.attemptId))return!1;let r=iB(this.#e,n);this.validateChildPatch(r,t);let i=rV(this.#e),a=[];for(let e of t.operations){kV(r,e);let t=rV(this.#e);switch(e.type){case`add`:a.push(Lz(this.#e,t,$z(this.#e,e.path)));break;case`remove`:a.push(Lz(this.#e,t,eB(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=tB(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(Lz(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return zz(this.#e,Lz(this.#e,i,Nz({affectedAncestorIds:sB(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:iB(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return Q(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=rV(this.#e),r=xz(this.#e,t,e.attemptId);return zz(this.#e,Lz(this.#e,n,Pz({affectedAncestorIds:sB(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:iB(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return Q(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=rV(this.#e),i=Cz(this.#e,n,e.attemptId,t);return zz(this.#e,Lz(this.#e,r,Fz({affectedAncestorIds:sB(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:iB(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return Q(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if($B(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=rV(this.#e),n=eV(this.#e,e.mode??`stable`);return zz(this.#e,Lz(this.#e,t,Iz({...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=uB(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??AR(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=MR(zR(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(!yR(dB(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=dB(this.#e,n);hz(this.#e,n,i)||(gz(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=dB(this.#e,e);if(!hz(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=cB(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!yR(dB(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!yR(dB(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=dB(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=dB(this.#e,e),r=Yz(this.#e,e);if(!hz(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 kV(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`);break}}var AV=e=>e.startsWith(`f::`)?e.slice(3):e;function jV(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function MV(e,t){return e===``?t:`${e}/${t}`}function NV({files:e,path:t,isFolder:n,nextBasename:r}){let i=AV(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}=jV(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=MV(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 PV(e){return e.endsWith(`/`)}function FV(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 IV(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 LV(e,t){return t.includes(e)?IV(t):[e]}function RV(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 zV(e,t){return{draggedPaths:e,target:t}}function BV(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(PV(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function VV(e,t){return t.kind===`root`||t.directoryPath==null?FV(e):t.directoryPath}function HV(e,t){let n=e.map(e=>{let n=VV(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 UV(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 WV(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(!UV(OV.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 GV(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function KV(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 qV(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function JV(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 qV(e,t.path)?n?e:null:e;case`move`:return KV(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=JV(r,e,n),r==null)return null;return r}}}function YV(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function XV(e){switch(e.operation){case`add`:return{...YV(e),operation:`add`,path:e.path};case`remove`:return{...YV(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...YV(e),from:e.from,operation:`move`,to:e.to}}}function ZV(e){return{...YV(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>XV(e)),operation:`batch`}}function QV(e){switch(e.operation){case`add`:case`remove`:case`move`:return XV(e);case`batch`:return ZV(e);default:return null}}function $V(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function eH(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 tH(e){return eH(e).at(-1)??null}function nH(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function rH(e){return e.endsWith(`/`)}var iH=e=>e.toLowerCase();function aH(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function oH(e){return e.endsWith(`/`)?e.slice(0,-1):e}function sH(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var cH=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},lH=Symbol(`FILE_TREE_RENAME_VIEW`),uH=512,dH=512;function fH(e){return e===`top`||e===`center`?e:`nearest`}function pH(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=eH(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 mH(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:pH(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var hH=class{#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=WV({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=tH(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:fH(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<=dH){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=LV(t,n);return this.#r.canDrag?.(r)===!1?!1:(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=zV(t.draggedPaths,n);(BV(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}RV(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=zV(e.draggedPaths,t);if(BV(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=HV(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=rH(r),a=oH(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of eH(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=aH(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}[lH](){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}}#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,rH(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,rH(e)?{recursive:!0}:void 0);return}let t=rH(e),n=NV({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:oH(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(sH(n.sourcePath,t),sH(n.destinationPath,t))}#Y(e){this.#T==null||this.#E===e||(this.#E=e,this.#De())}resetPaths(e,t={}){let n=this.#H.list().length,r=this.#G,i=WV({paths:e,preparedInput:t.preparedInput},`resetPaths`,this.#e.sort),a=this.#le(i.paths,i.preparedInput,t.initialExpandedPaths),o=this.#c,s=this.#T,c=this.getSelectedPaths(),l=this.#z;this.#K?.(),this.#H=a,this.#d.clear(),this.#he();let u=c.map(e=>a.getPathInfo(e)?.path??null).filter(e=>e!=null),d=!$V(this.#B,u);this.#B=new Set(u),d&&(this.#V+=1),this.#z=l==null?null:a.getPathInfo(l)?.path??null,this.#T=s==null?null:a.getPathInfo(s)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(o,o!=null||u.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:i.paths.length,pathCountBefore:n,projectionChanged:!0,usedPreparedInput:t.preparedInput!=null,visibleCountDelta:this.#G-r})}#X(e){this.#Ie();let t=tH(e),n=nH(e,t),r=null,i=null;for(let e of this.#be()){if(tH(e)!==t)continue;let a=nH(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=eH(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=!$V(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 OV({...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 eH(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(iH),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(iH),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 eH(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:cH(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 eH(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 eH(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=mH(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,uH)),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=JV(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=JV(this.#c,e,!0),r=[...this.#B].map(t=>JV(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=JV(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return $V(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&&GV(e)&&(this.#i=null);let t=GV(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=QV(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},gH=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 _H(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 vH(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 yH(e,t){return t?`${e}/`:e}function bH(e,t=null){let n=gH(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;for(let t of e??[]){let e=_H(t.path);if(e==null)continue;let n=yH(e.path,e.isDirectory);r.set(n,t.status),t.status===`ignored`&&e.isDirectory?a.add(n):e.isDirectory&&a.delete(n);for(let t of vH(e.path))i.add(t)}return{directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}var xH=e=>e.trim().toLowerCase(),SH=e=>e.split(`/`).at(-1)??e,CH=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 wH(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function TH(e){let t=IL(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(xH(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 n=SH(o),s=n.toLowerCase(),c=r.get(s);if(c!=null)return wH(c,e);for(let[t,n]of a)if(s.includes(t))return wH(n,e);let l=CH(n);for(let t of l){let n=i.get(t);if(n!=null)return wH(n,e)}let u=PL(t.set,n,l);if(u!=null&&t.set!==`none`)return{name:ML(u),remappedFrom:e,token:u}}let s=n?.[e];return s==null?{name:e}:wH(s,e)}}}var EH,DH,OH,kH,AH,jH,MH,NH,PH,FH,IH={},LH=[],RH=Array.isArray,zH=LH.slice,BH=Object.assign;function VH(e){e&&e.parentNode&&e.remove()}function HH(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?zH.call(arguments,2):n),UH(e,o,r,i,null)}function UH(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??++DH,__i:-1,__u:0};return i==null&&EH.vnode!=null&&EH.vnode(a),a}function WH(e){return e.children}function GH(e,t){this.props=e,this.context=t,this.__g=0}function KH(e,t){if(t==null)return e.__?KH(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`?KH(e):null}function qH(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 qH(e)}}function JH(e){(8&e.__g||!(e.__g|=8)||!OH.push(e)||AH++)&&kH==EH.debounceRendering||((kH=EH.debounceRendering)||queueMicrotask)(YH)}function YH(){for(var e,t,n,r,i,a,o,s,c=1;OH.length;)OH.length>c&&OH.sort(jH),e=OH.shift(),c=OH.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=BH({},r)).__v=r.__v+1,EH.vnode&&EH.vnode(n),rU(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??KH(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,aU(a,n,o),n.__e!=i&&qH(n)));AH=0}function XH(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||LH,b=t.length;for(c=ZH(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?IH:y[m.__i]||IH,m.__i=f,_=rU(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&cU(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=QH(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function ZH(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?UH(null,o,null,null,null):RH(o)?UH(WH,{children:o},null,null,null):o.constructor==null&&o.__b>0?UH(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=$H(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=KH(s)),lU(s,s));return r}function QH(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=QH(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=KH(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function $H(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>(u?1:0)){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 eU(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function tU(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||eU(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||eU(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(MH,`$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=NH,e.addEventListener(t,a?FH:PH,a)):e.removeEventListener(t,a?FH:PH,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 nU(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=NH++;else if(t.u<n.l)return;return n(EH.event?EH.event(t):t)}}}function rU(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=EH.__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 GH(v,x),f.constructor=M,f.render=uU),b&&b.sub(f),f.props=v,f.state||={},f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=BH({},f.__s)),BH(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=EH.__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=BH({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===WH&&d.key==null&&(E=oU(d.props.children)),s=XH(e,RH(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--;)VH(a[j]);iU(t)}else t.__e=n.__e,t.__k=n.__k,e.then||iU(t);EH.__e(e,t,n)}else s=t.__e=sU(n.__e,t,n,r,i,a,o,c,l,u);return(d=EH.diffed)&&d(t),128&t.__u?void 0:s}function iU(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(iU)}function aU(e,t,n){for(var r=0;r<n.length;r++)cU(n[r],n[++r],n[++r]);EH.__c&&EH.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){EH.__e(e,t.__v)}})}function oU(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:RH(e)?e.map(oU):BH({},e)}function sU(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&&=(EH.__m&&EH.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=zH.call(e.childNodes),v=n.props||IH,!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;tU(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&&!_||tU(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=``),XH(b==`template`?e.content:e,RH(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&KH(n,0),s,c,l),a!=null)for(u=a.length;u--;)VH(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||tU(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&tU(e,u,g,v[u],i))}return e}function cU(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){EH.__e(e,n)}}function lU(e,t,n){var r,i;if(EH.unmount&&EH.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||cU(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){EH.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&lU(r[i],t,n||typeof e.type!=`function`);n||VH(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function uU(e,t,n){return this.constructor(e,n)}function dU(e,t){var n,r,i,a;t==document&&(t=document.documentElement),EH.__&&EH.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=HH(WH,null,[e]),i=[],a=[],rU(t,e,r||IH,IH,t.namespaceURI,r?null:t.firstChild?zH.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),aU(i,e,a)}function fU(e,t){e.__u|=32,dU(e,t)}EH={__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 AH=0,e}},DH=0,GH.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=BH({},this.state);typeof e==`function`&&(e=e(BH({},n),this.props)),e&&BH(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),JH(this))},GH.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),JH(this))},GH.prototype.render=WH,OH=[],AH=0,jH=function(e,t){return e.__v.__b-t.__v.__b},MH=/(PointerCapture)$|Capture$/i,NH=0,PH=nU(!1),FH=nU(!0);var pU=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:--pU,__i:-1,__u:0,__source:i,__self:a};return EH.vnode&&EH.vnode(l),l}var mU=16,hU=16,gU={};function _U({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}=gU[e]??{width:mU,height:hU},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`,h=o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`};return $(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...h,viewBox:m,width:f,height:p,children:$(`use`,{href:c})})}var vU=e=>{if(e.length<2)return[e,``];let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]},yU=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},bU=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)]},xU=(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)]},SU=(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)]},CU=(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 wU({children:e,marker:t,variant:n=`default`}){"use no memo";let r=n===`fade`;return $(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:$(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):r?$(`span`,{"data-truncate-fade":!0}):t})})}function TU(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 EU({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=$(TU,{mode:t,children:e},`content`),o=$(wU,{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 DU({children:e,...t}){"use no memo";return $(EU,{mode:`truncate`,...t,children:e})}function OU({children:e,...t}){"use no memo";return $(EU,{mode:`fruncate`,...t,children:e})}function kU({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=$(DU,{...s,children:t[0]}),l=$(OU,{...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`?OU:DU,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=vU:r===`extension`?t=yU:r===`leaf-path`&&(t=bU);else if(typeof r==`number`)t=xU,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=SU:e===`first`&&(t=CU)}else typeof r==`function`&&(t=r);t??=vU;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=$(DU,{...s,..._,children:f}),l=$(OU,{...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 AU={endIndex:-1,startIndex:-1};function jU(e,t,n){return Math.min(Math.max(e,t),n)}function MU(e,t){return e<0||t<e?AU:{endIndex:t,startIndex:e}}function NU(e){return e.startIndex<0||e.endIndex<e.startIndex}function PU(e,t){return NU(e)?0:(e.endIndex-e.startIndex+1)*t}function FU(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function IU(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function LU(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 RU(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 zU(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 BU(e,t,n){if(e.length===0||t<=0)return[];let r=zU(e),i=LU(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=RU(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 VU(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=jU(t.scrollTop,0,o),c=t.stickyRows??BU(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=FU(s,n,t.itemHeight),m=FU(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?AU:MU(m,IU(u+d,n,t.itemHeight)),y=g+1,b=NU(v)?AU:MU(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=PU(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:NU(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var HU={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},UU={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},WU=`Contains git status items`;function GU(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 KU(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return GU({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 qU(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 JU(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 YU(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 XU(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function ZU(e,t){return e!=null&&e>0?e:t}function QU(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=GU({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a==null?!1:(e.scrollTop=a,!0)}function eW(e,t,n,r,i,a,o=0){let s=KU({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s==null?!1:(e.scrollTop=s,!0)}function tW(e,t,n,r,i,a){let o=qU({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o==null?!1:(e.scrollTop=o,!0)}function nW(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function rW(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function iW({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 aW(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 oW(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 sW,cW,lW,uW,dW=Object.is,fW=0,pW=[],mW=EH,hW=mW.__b,gW=mW.__r,_W=mW.diffed,vW=mW.__c,yW=mW.unmount,bW=mW.__;function xW(e,t){mW.__h&&mW.__h(cW,e,fW||t),fW=0;var n=cW.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function SW(e){return fW=1,CW(FW,e)}function CW(e,t,n){var r=xW(sW++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):FW(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);dW(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=cW,!cW.__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,dW(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};cW.__f=!0;var a=cW.shouldComponentUpdate,o=cW.componentWillUpdate;cW.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)},cW.shouldComponentUpdate=i}return r.__N||r.__}function wW(e,t){var n=xW(sW++,3);!mW.__s&&PW(n.__H,t)&&(n.__=e,n.u=t,cW.__H.__h.push(n))}function TW(e,t){var n=xW(sW++,4);!mW.__s&&PW(n.__H,t)&&(n.__=e,n.u=t,cW.__h.push(n))}function EW(e){return fW=5,DW(function(){return{current:e}},[])}function DW(e,t){var n=xW(sW++,7);return PW(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function OW(e,t){return fW=8,DW(function(){return e},t)}function kW(){for(var e;e=pW.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(MW),e.__H.__h.forEach(NW),e.__H.__h=[]}catch(t){e.__H.__h=[],mW.__e(t,e.__v)}}mW.__b=function(e){cW=null,hW&&hW(e)},mW.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),bW&&bW(e,t)},mW.__r=function(e){gW&&gW(e),sW=0;var t=(cW=e.__c).__H;t&&(lW===cW?(t.__h=[],cW.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(MW),t.__h.forEach(NW),t.__h=[],sW=0)),lW=cW},mW.diffed=function(e){_W&&_W(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(pW.push(t)!==1&&uW===mW.requestAnimationFrame||((uW=mW.requestAnimationFrame)||jW)(kW)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),lW=cW=null},mW.__c=function(e,t){t.some(function(e){try{e.__h.forEach(MW),e.__h=e.__h.filter(function(e){return!e.__||NW(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],mW.__e(n,e.__v)}}),vW&&vW(e,t)},mW.unmount=function(e){yW&&yW(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{MW(e)}catch(e){t=e}}),n.__H=void 0,t&&mW.__e(t,n.__v))};var AW=typeof requestAnimationFrame==`function`;function jW(e){var t,n=function(){clearTimeout(r),AW&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);AW&&(t=requestAnimationFrame(n))}function MW(e){var t=cW,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),cW=t}function NW(e){var t=cW;e.__c=e.__(),cW=t}function PW(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!dW(t,e[n])})}function FW(e,t){return typeof t==`function`?t(e):t}function IW(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 $(WH,{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:$(DU,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function LW(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function RW(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function zW(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 BW({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=VU(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:zW(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?zW(u,1,t,o):i&&r<=0&&c.length>0?BU(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 VW=400,HW=10,UW=40,WW=18;function GW(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))?KW(e,t,n):a instanceof HTMLElement?a:null}function KW(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 qW(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 JW(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 YW(){return navigator.vendor!==`Apple Computer, Inc.`}function XW(e,t){let n=e-t.top;if(n<UW)return-Math.ceil((UW-Math.max(0,n))/UW*WW);let r=t.bottom-e;return r<UW?Math.ceil((UW-Math.max(0,r))/UW*WW):0}function ZW(e,t){if(e!=null){let t=HU[e];return t==null?null:{text:t,title:UU[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:WU}:null}function QW(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 $W(e){return e!=null&&`toggle`in e}function eG(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function tG(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function nG(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function rG(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function iG(e,t){return t&&rG(e)||(e.ctrlKey||e.metaKey)&&eG(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var aG=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function oG(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 sG(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 cG(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function lG(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function uG(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function dG(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 fG(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 pG(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 mG(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=pG(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 hG(e,t){return{kind:e.kind,name:RW(e),path:t}}function gG(e){return e==null?void 0:`${e}__tree`}function _G(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function vG(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function yG(e,t){if(e==null)return null;if(`text`in e)return $(`span`,{title:e.title,children:e.text});let n=typeof e.icon==`string`?vG(e.icon)?t(e.icon):{name:e.icon}:vG(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:$(_U,{...n})})}function bG(e){e!=null&&JU(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function xG(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=LW(e);return $(WH,{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`?$(_U,{...t(`file-tree-icon-chevron`)}):$(_U,{...t(`file-tree-icon-file`,u)})}),$(`div`,{"data-item-section":`content`,children:e.isFlattened?IW(e,c,a):c??$(kU,{minimumLength:5,split:`extension`,children:e.name})}),i?$(`div`,{"data-item-section":`decoration`,children:r==null?null:yG(r,t)}):null,s?$(`div`,{"data-item-section":`git`,children:yG(o,t)}):null,n?$(`div`,{"data-item-section":`action`,children:l?$(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:$(_U,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function SG(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=LW(t),{isParked:F=!1,mode:I=`flow`,style:L}=r,R=I===`sticky`,z=_?.get(P)??null??QW(t.ancestorPaths,v,y),ee=t.kind===`directory`&&(b?.has(P)??!1),te=A(t,P),B=ZW(z,ee),V=S&&w,H=te!=null||x||V,ne=V&&T===`always`,re=a.getPath()===P,ie=re?a.getValue():``,ae=R||!re?null:$(iW,{ref:D,ariaLabel:`Rename ${RW(t)}`,isFlattened:t.isFlattened,value:ie,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),oe=xG(t,k,{actionLaneEnabled:V,customDecoration:te,decorationLaneEnabled:H,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:B,gitLaneActive:x,renameInput:ae,showDecorativeActionAffordance:ne}),se={...aW({ariaLabel:RW(t),domId:t.isFocused?_G(h,P,F):void 0,extraStyle:L,features:{actionLaneEnabled:V,contextMenuButtonVisibility:V?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:F,itemHeight:g,mode:I,row:t,state:{containsGitChange:ee,effectiveGitStatus:z,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:cG(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:R?void 0:()=>{i.focusMountedPathFromInput(P)},onKeyDown:R?void 0:N,ref:e=>{O(P,e)}};return!R&&re?$(`div`,{...se,children:oe}):$(`button`,{...se,type:`button`,draggable:u&&!F,onDragEnd:u&&!F?p:void 0,onDragStart:u&&!F?e=>{f(e,t,P)}:void 0,onMouseDown:e=>{if(R){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:oe})}function CG(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(LW(e))).map((n,r)=>SG(e,n,t.start+r))}function wG({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=zL,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 _=EW(null),v=EW(null),y=EW(!1),b=EW(null),x=EW(null),S=EW(null),C=EW(null),w=EW(null),T=EW(new Map),E=EW(new Map),D=EW(()=>{}),O=EW(null),k=EW(0),A=EW(!1),j=EW(null);j.current!==t&&(A.current=!1,j.current=t);let M=EW(!1),N=EW(null),P=EW(null),F=EW(!1),I=EW(null),L=EW(null),R=EW(null),z=EW(null),ee=EW(null),te=EW(null),B=EW(null),V=EW(null),H=EW(!1),ne=EW(null),re=EW(null),ie=EW(null),ae=EW(null),oe=DW(()=>new Map,[]),[,se]=SW(0),[ce,le]=SW(null),[ue,U]=SW(null),[de,fe]=SW(null),[pe,me]=SW(null),[he,ge]=SW(0),[_e,ve]=SW(null),ye=EW(_e);ye.current=_e;let be=EW(null),xe=EW(null),Se=EW(null),Ce=EW(null),we=EW(null),Te=EW(!1),Ee=()=>{xe.current=null,Se.current=null,Ce.current=null},De=(e,t)=>{xe.current=e,Se.current=null,Ce.current=t==null?null:{path:e,scrollTop:t}},Oe=(e,t)=>{xe.current=null,Se.current={path:e,viewportOffset:t},Ce.current=null},ke=EW(d===`retain`&&t.isSearchOpen()),[Ae,je]=SW(p);wW(()=>{p||je(!1)},[p]);let Me=EW(!1),Ne=OW(()=>{Me.current=!0,je(e=>e&&!1)},[]),[Pe,Fe]=SW(()=>BW({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[Ie,Le]=SW(!1);wW(()=>{Le(!0)},[]);let Re=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,ze=e?.contextMenu?.triggerMode??(Re?`right-click`:`both`),W=ze===`both`||ze===`button`,G=e?.contextMenu?.buttonVisibility??`when-needed`,Be=ze===`both`||ze===`right-click`;TW(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;we.current=t,U(t),me(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(Te.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 Ve=OW((e,t)=>{uG(T.current,e,t)},[]),He=OW((e,t)=>{uG(E.current,e,t)},[]),Ue=OW(e=>{x.current=e},[]),We=OW(e=>dG(e,E.current,T.current),[]),Ge=n!=null||r!=null||i!=null,{resolveIcon:Ke}=DW(()=>TH(a),[a]),qe=t[lH](),Je=qe.getPath(),Ye=Je!=null,Xe=t.isSearchOpen(),Ze=t.getSearchValue(),Qe=t.getFocusedPath(),$e=t.getFocusedIndex(),et=t.getScrollRequest(),tt=t.isDragAndDropEnabled(),nt=t.getDragSession(),rt=DW(()=>nt==null?null:new Set(nt.draggedPaths),[nt]),it=nt?.target??null,at=nt?.primaryPath??null,ot=gG(o),{overlayHeight:st,overlayRows:ct,snapshot:lt,visibleRows:ut}=Pe,dt=lt.physical.viewportHeight,ft=DW(()=>({end:lt.window.endIndex,start:lt.window.startIndex}),[lt.window.endIndex,lt.window.startIndex]),pt=ct,mt=lt.sticky.rows,ht=lt.physical.totalHeight,gt=lt.sticky.height,_t=DW(()=>new Set(mt.map(e=>LW(e.row))),[mt]),vt=$e>=0&&$e>=ft.start&&$e<=ft.end,yt=OW((e,t)=>u?.({item:hG(e,t),row:e})??null,[u]),bt=OW(e=>JU(e==null?null:T.current.get(e)??null)?!0:JU(S.current),[]),xt=OW(e=>{bt(t.focusNearestPath(e))},[t,bt]),St=EW(xt);St.current=xt;let Ct=EW(!0),wt=EW(()=>{}),Tt=OW((t=!0)=>{let n=ye.current;n!=null&&(Ct.current=Ct.current&&t,ve(null),e?.contextMenu?.onClose?.(),Ct.current&&xt(n.path))},[e?.contextMenu,xt]);wt.current=Tt;let Et=OW(e=>{let t=e==null?null:lG(S.current,e);fe(e=>e===t?e:t)},[]),Dt=OW((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=We(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;De(n,e?.scrollTop??null),M.current=!0,le(e=>e===n?e:n)}i.focus(),Et(a),Ct.current=!0,ve({anchorRect:r?.anchorRect??null,item:hG(e,n),path:n,source:r?.source??`keyboard`})},[t,We,Et]),Ot=OW(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=XU(e,dt);I.current=$e<0||e==null?null:Math.max(0,Math.min($e*s-e.scrollTop,Math.max(0,t-s))),F.current=!0}t.startRenaming(e)!==!1&&(me(`focus`),se(e=>e+1))}},[t,$e,s,l,dt]),kt=OW((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=XU(i,dt),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:BW({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return M.current=!0,tW(i,a,s,l,u,d),D.current(),be.current=n?e:null,!0},[t,s,c,dt,h]),At=()=>y.current===!0||ae.current!=null||H.current===!0,jt=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Mt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Nt=()=>{z.current!=null&&(clearTimeout(z.current),z.current=null),R.current=null},K=()=>{te.current?.remove(),te.current=null},Pt=()=>{Mt(L.current),L.current=null,ee.current=null},Ft=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},It=()=>{V.current?.(),V.current=null,ae.current!=null&&(clearTimeout(ae.current),ae.current=null),H.current=!1,ne.current=null,ie.current=null,re.current!=null&&(re.current.setAttribute(`draggable`,`true`),re.current.style.removeProperty(`touch-action`),re.current=null),K(),Nt(),Pt(),B.current=null},Lt=(e,n)=>{let r=S.current?.getRootNode(),i=qW(GW(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Rt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Nt();return}let r=t.getItem(e.directoryPath),i=$W(r)?r:null;if(i==null||i.isExpanded()){Nt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;R.current!==a&&(Nt(),R.current=a,z.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind!==`directory`||n.directoryPath!==e.directoryPath||n.flattenedSegmentPath!==e.flattenedSegmentPath||i.expand()},n))},zt=()=>{L.current=null;let e=ee.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=XW(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()),Rt(Lt(e.clientX,e.clientY)),L.current=jt(zt)},Bt=(e,t)=>{ee.current={clientX:e,clientY:t},L.current??=jt(zt)},Vt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(It(),K(),Nt(),Pt(),t.startDrag(r)===!1){e.preventDefault();return}if(B.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),YW())){let t=JW(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Ft(t),te.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Ht=()=>{K(),Nt(),Pt(),B.current=null,t.cancelDrag()},Ut=(e,n,r)=>{if(ae.current!=null||H.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;ie.current={clientX:i.clientX,clientY:i.clientY},re.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!H.current;ae.current!=null&&(clearTimeout(ae.current),ae.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),V.current===o&&(V.current=null),t&&(a.setAttribute(`draggable`,`true`),re.current===a&&(re.current=null),ie.current=null)},s=e=>{let t=e.touches[0],n=ie.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=HW*HW||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),V.current=o,ae.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),re.current===a&&(re.current=null),ie.current=null;return}H.current=!0,re.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),B.current=n;let e=a.getBoundingClientRect(),s=JW(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`}),Ft(s),te.current=s,ne.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=ne.current;n!=null&&te.current!=null&&(te.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Rt(Lt(t.clientX,t.clientY)),Bt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Lt(n.clientX,n.clientY),t.completeDrag(),It()},u=()=>{t.cancelDrag(),It()};V.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)},VW)},Wt=e=>{if(_e!=null){if(e.key===`Escape`){Tt(),e.preventDefault(),e.stopPropagation();return}aG.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(qe.isActive()){if(e.key===`Escape`)qe.cancel();else if(e.key===`Enter`)qe.commit();else return;me(`focus`),se(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Ot(Qe??void 0),e.preventDefault(),e.stopPropagation();return}if(Xe){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=XU(n,dt);I.current=$e<0||n==null?null:Math.max(0,Math.min($e*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;me(`focus`),se(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&tG(e)){t.openSearch(e.key),se(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Re&&rG(e),r=iG(e,Re),i=r&&S.current!=null?YU(S.current):null,a=r?new Set(fG(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==Qe&&a.has(o)){let e=C.current;De(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=$W(p)?p:null,h=u!=null&&(_t.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=dG(u,E.current,T.current);e==null||n==null?y=!1:Dt(e,u)}else if((e.ctrlKey||e.metaKey)&&eG(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;me(`focus`);let b=t.getFocusedPath(),x=b!=null&&(_t.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))De(b,v?.scrollTop??null),M.current=!0,le(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(Oe(b,mG(S.current,v,i,u,s,gt,dt)),M.current=!0,le(e=>e===b?e:b)):Ee()}se(e=>e+1),e.preventDefault(),e.stopPropagation()};TW(()=>{if(!(!f||!Xe)){if(ke.current){ke.current=!1;return}JU(w.current)}},[Xe,f]),TW(()=>{let e=x.current;switch(rW({hasRenderedInput:e!=null,previousRenamingPath:P.current,renamingPath:Je})){case`reset`:P.current=null;return;case`reveal-canonical`:Je!=null&&kt(Je,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(be.current=null,P.current=Je,JU(e),e.select());return}},[ft.end,ft.start,Je,kt,_t]),TW(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=YU(e)?.dataset.itemPath??null;le(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,YU(e)!=null){r();return}M.current=!1,le(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),M.current=!1,le(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;le(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),TW(()=>{let e=S.current;e!=null&&(lt.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[lt.physical.scrollTop]),TW(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=XU(n,g);let a=()=>{let e=t.getVisibleCount(),r=ZU(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Fe(BW({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=ZU(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=!1,l=t.subscribe(()=>{o?se(e=>e+1):o=!0,a()}),u=()=>{Te.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,ge(e=>e+1),e=null},50))},d=null,f=()=>{i!=null&&delete i.dataset.overlayReveal,d!=null&&(clearTimeout(d),d=null)},p=()=>{i==null||Te.current===!0||n.scrollTop>0||(i.dataset.overlayReveal=`true`,d!=null&&clearTimeout(d),d=setTimeout(()=>{f()},200))},m=()=>{if(a(),n.scrollTop>0&&f(),ye.current!=null&&y.current&&wt.current(),Te.current===!0){y.current=!1;return}U(e=>e==null?e:null),u()},_=()=>{u(),p()},v=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),x=e=>{v.has(e.key)&&_()};n.addEventListener(`scroll`,m,{passive:!0}),n.addEventListener(`wheel`,_,{passive:!0}),n.addEventListener(`touchmove`,_,{passive:!0}),n.addEventListener(`keydown`,x);let w=typeof ResizeObserver<`u`?new ResizeObserver(e=>{O.current=(e[0]==null?null:QU(e[0]))??XU(n,g),a()}):null;return w?.observe(n),()=>{D.current=()=>{},l(),n.removeEventListener(`scroll`,m),n.removeEventListener(`wheel`,_),n.removeEventListener(`touchmove`,_),n.removeEventListener(`keydown`,x),e!=null&&clearTimeout(e),d!=null&&clearTimeout(d),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,O.current=null,w?.disconnect()}},[t,g,s,c,h]),TW(()=>{Re||_e==null||Tt(!1)},[Tt,Re,_e]);let Gt=DW(()=>_e==null?null:`${_e.path}::${_e.source}`,[_e]);TW(()=>{if(Gt==null){m?.clearSlotContent(mI);return}let t=ye.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??sG(n.getBoundingClientRect()),close:e=>{wt.current(e?.restoreFocus??!0)},restoreFocus:()=>{Ct.current&&St.current(ye.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(mI,i),e?.contextMenu?.onOpen?.(t.item,r),bG(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&bG(i)}),()=>{m?.clearSlotContent(mI)}},[Gt,e?.contextMenu,m]),TW(()=>{_e!=null&&t.getItem(_e.path)==null&&Tt()},[Tt,_e,t]),TW(()=>{if(_e==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(oG(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Tt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Tt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Tt,_e]),TW(()=>{let e=C.current,n=S.current;if(e==null||n==null){N.current=Qe;return}let r=Qe==null?null:T.current.get(Qe)??null,i=YU(n),a=i?.dataset.itemPath??null,o=Ye&&x.current===i,c=f&&w.current===i,l=F.current&&!Xe,u=I.current??0,d=be.current,p=xe.current,m=Se.current,g=Ce.current,_=i!=null,v=M.current||_,y=N.current!==Qe,b=p!=null&&p===Qe&&Qe!=null,E=!1,O=!1;if(et!=null&&et.id!==k.current){k.current=et.id;let n=et.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,dt-s))):gt;E=!0,O=eW(e,n,s,dt,ht,et.offset,t)}t.clearScrollRequest(et.id)}let A=!E&&l&&tW(e,$e,s,dt,ht,u),j=!E&&d!=null&&d===Qe&&tW(e,$e,s,dt,ht,gt),P=!E&&m!=null&&m.path===Qe&&tW(e,$e,s,dt,ht,m.viewportOffset),L=!E&&g!=null&&g.path===Qe&&e.scrollTop!==g.scrollTop;if(L&&(e.scrollTop=g.scrollTop),(L||O||j||P||A||v&&y&&d!==Qe&&!b&&$U(e,$e,s,dt,gt))&&D.current(),E){N.current=Qe;return}if(!v){N.current=Qe;return}if(o){N.current=Qe;return}if(c&&!l){N.current=Qe;return}if(r==null){l&&$e>=0&&(tW(e,$e,s,dt,ht,u),D.current()),N.current=Qe;return}(y||l||d===Qe||p===Qe||m?.path===Qe||g?.path===Qe||a==null||a!==Qe)&&(JU(r),d===Qe&&(be.current=null),p===Qe&&(xe.current=null),m?.path===Qe&&(Se.current=null),g?.path===Qe&&(Ce.current=null),F.current=!1,I.current=null),N.current=Qe},[t,$e,Qe,vt,s,Ye,Xe,ft,dt,f,et,h,gt,ht,ut]);let Kt=$e>=0&&$e>=lt.visible.startIndex&&$e<=lt.visible.endIndex,qt=Qe!=null&&pt.some(e=>LW(e.row)===Qe),Jt=Kt||qt,Yt=W&&M.current===!0&&Jt?Qe:null,Xt=pe===`pointer`?ue:null,Zt=_e?.path??we.current??Xt??Yt??ue,Qt=_e?.source===`right-click`;TW(()=>{y.current&&_e==null||Et(We(Zt))},[_e,We,ft,dt,he,pt,Zt,Et,ut]);let $t=OW(e=>{if(y.current||oG(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&&me(e=>e===`pointer`?e:`pointer`),U(e=>e===i?e:i)},[]),en=OW(()=>{U(null)},[]);TW(()=>{if(!tt)return;let e=()=>{It(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),It(),t.cancelDrag()}},[t,tt]);let tn=e=>{if(!tt||t.getDragSession()==null||H.current)return;let n=qW(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Rt(t.getDragSession()?.target??null),Bt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},nn=e=>{if(!tt||t.getDragSession()==null||H.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Nt(),Pt(),t.setDragTarget(null))},rn=e=>{!tt||t.getDragSession()==null||H.current||(e.preventDefault(),Lt(e.clientX,e.clientY),t.completeDrag(),K(),Nt(),Pt(),B.current=null)},an=lt.window.height,on=lt.window.offsetTop,sn=Math.min(0,dt-an),cn=Math.min(0,dt-an-gt),ln=ce===Qe||F.current,un=Qe!=null&&ln&&!vt&&$e>=0?ut[$e]??t.getVisibleRows($e,$e)[0]??null:null,dn=un==null?null:nW($e,s,ft,an),fn=B.current,pn=at!=null&&fn!=null&&fn.path===at&&fn.index>=ft.start&&fn.index<=ft.end,mn=at!=null&&fn!=null&&fn.path===at&&!pn&&fn.path!==un?.path?fn:null,hn=mn==null?null:nW(mn.index,s,ft,an),gn=nG(($e>=0?ut[$e]??t.getVisibleRows($e,$e)[0]??null:null)?.ancestorPaths.at(-1)??null),_n=Xe&&Qe!=null?_G(o,Qe,!vt):void 0,vn=_e?.path??(Xe?Qe:ce),yn=_e?.path??ue,bn=We(Zt),xn=Re&&W&&!Qt&&!Ye&&bn!=null&&de!=null&&Zt!=null,Sn=Re&&(xn||_e!=null),Cn=_e?.anchorRect,wn=Cn==null&&bn!=null&&de!=null&&(_e!=null||xn)?de:null,Tn=Cn==null?wn==null?void 0:{top:`${wn}px`}:{left:`${Cn.left}px`,position:`fixed`,right:`auto`,top:`${Cn.top}px`},En=Qt?{opacity:`0`}:void 0,Dn=OW((e,n,r,i)=>{let a=oW({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:Xe,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c);break}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=lt.visible.startIndex&&n.index<=lt.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(M.current=!0,le(e=>e===c?e:c),me(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&kt(c,{targetOffset:`sticky-parents`})},[t,Xe,lt.visible.endIndex,lt.visible.startIndex,kt]),On=()=>{if(y.current||!W||Zt==null||bn==null)return;let e=t.getItem(Zt);e!=null&&(Et(bn),Ct.current=!0,ve({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:bn.getAttribute(`aria-label`)??Zt,path:e.getPath()},path:e.getPath(),source:`button`}))},kn={contextHoverPath:yn,contextMenuButtonTriggerEnabled:W,contextMenuButtonVisibility:G,contextMenuEnabled:Re,contextMenuRightClickEnabled:Be,contextMenuTriggerMode:ze,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:tt,draggedPathSet:rt,dragTarget:it,gitLaneActive:Ge,gitStatusByPath:n,handleRowDragEnd:Ht,handleRowDragStart:Vt,handleRowTouchStart:Ut,ignoredGitDirectories:r,ignoredInheritanceCache:oe,instanceId:o,itemHeight:s,onKeyDown:Wt,onRowClick:Dn,openContextMenuForRow:Dt,registerButton:Ve,registerRenameInput:Ue,renameView:qe,renderDecorationForRow:yt,resolveIcon:Ke,shouldSuppressContextMenu:At,visualFocusPath:vn},An={...kn,registerButton:He};return $(`div`,{ref:S,id:ot,"data-file-tree-context-menu-button-visibility":Re&&W?G:void 0,"data-file-tree-context-menu-trigger-mode":Re?ze:void 0,"data-file-tree-has-context-menu-action-lane":Re&&W?`true`:void 0,"data-file-tree-has-git-lane":Ge?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:tt?nn:void 0,onDragOver:tt?tn:void 0,onDrop:tt?rn:void 0,onKeyDown:Wt,onPointerLeave:Re?en:void 0,onPointerOver:Re?$t:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[$(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:gn}}),$(`slot`,{name:pI,"data-type":`header-slot`}),f?$(`div`,{"data-file-tree-search-container":!0,"data-open":Xe?`true`:`false`,children:$(`input`,{ref:w,"aria-activedescendant":_n,"aria-controls":ot,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ae?`true`:void 0,value:Ze,onBlur:()=>{d===`retain`&&!Me.current||t.closeSearch()},onFocus:Ne,onPointerDown:Ne,onInput:e=>{Ne();let n=e.currentTarget;t.setSearch(n.value)}})}):null,$(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&Ie&&pt.length>0?$(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:$(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${st}px`},children:pt.map((e,t)=>SG(An,e.row,`sticky:${LW(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${pt.length-t}`}}))})}):null,$(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${ht}px`},children:[$(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${on}px`}}),$(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${an}px`,top:`${sn}px`,bottom:`${cn}px`},children:[CG(kn,ft,_t),un!=null&&dn!=null?SG(kn,un,`parked:${un.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:at===un.path?`none`:void 0,position:`absolute`,right:`0`,top:`${dn}px`}}):null,mn!=null&&hn!=null?SG(kn,mn,`parked-drag:${mn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${hn}px`}}):null]})]})]}),Re?$(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":Sn?`true`:`false`,style:Tn,children:[$(`button`,{ref:v,type:`button`,"data-type":hI,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":_e==null?`false`:`true`,"data-visible":xn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),_e!=null){Tt();return}On()},tabIndex:-1,style:En,children:$(_U,{...Ke(`file-tree-icon-ellipsis`)})}),_e==null?null:$(`slot`,{name:mI})]}):null,_e==null?null:$(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Tt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Tt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var TG={hydrateRoot:(e,t)=>{fU(HH(wG,t),e)},renderRoot:(e,t)=>{dU(HH(wG,t),e)},unmountRoot:e=>{dU(null,e)}};function EG(e,t){TG.renderRoot(e,t)}function DG(e,t){TG.hydrateRoot(e,t)}function OG(e){TG.unmountRoot(e)}var kG=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)}}},AG=`__c`,jG=`__k`,MG=`__d`,NG=`__s`,PG=/[\s\n\\/='"\0<>]/,FG=/^(xlink|xmlns|xml)([A-Z])/,IG=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,LG=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,RG=new Set([`draggable`,`spellcheck`]);function zG(e){e.__g===void 0?e[MG]=!0:e.__g|=8}function BG(e){e.__g===void 0?e[MG]=!1:e.__g&=-9}function VG(e){return e.__g===void 0?!0===e[MG]:!!(8&e.__g)}var HG=/["&<]/;function UG(e){if(e.length===0||!1===HG.test(e))return e;for(var t=0,n=0,r=``,i=``;n<e.length;n++){switch(e.charCodeAt(n)){case 34:i=`&quot;`;break;case 38:i=`&amp;`;break;case 60:i=`&lt;`;break;default:continue}n!==t&&(r+=e.slice(t,n)),r+=i,t=n+1}return n!==t&&(r+=e.slice(t,n)),r}var WG={},GG=new Set(`animation-iteration-count.border-image-outset.border-image-slice.border-image-width.box-flex.box-flex-group.box-ordinal-group.column-count.fill-opacity.flex.flex-grow.flex-negative.flex-order.flex-positive.flex-shrink.flood-opacity.font-weight.grid-column.grid-row.line-clamp.line-height.opacity.order.orphans.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.widows.z-index.zoom`.split(`.`)),KG=/[A-Z]/g;function qG(e){var t=``;for(var n in e){var r=e[n];if(r!=null&&r!==``){var i=n[0]==`-`?n:WG[n]||(WG[n]=n.replace(KG,`-$&`).toLowerCase()),a=`;`;typeof r!=`number`||i.startsWith(`--`)||GG.has(i)||(a=`px;`),t=t+i+`:`+r+a}}return t||void 0}function JG(){this.__d=!0}function YG(e,t){return{__v:e,context:t,props:e.props,setState:JG,forceUpdate:JG,__d:!0,__h:[]}}function XG(e,t,n){if(!e.s){if(n instanceof ZG){if(!n.s)return void(n.o=XG.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(XG.bind(null,e,t),XG.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var ZG=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{XG(r,1,a(this.v))}catch(e){XG(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?XG(r,1,t?t(i):i):n?XG(r,1,n(i)):XG(r,2,i)}catch(e){XG(r,2,e)}},r},e}(),QG,$G,eK,tK,nK={},rK=Array.isArray,iK=Object.assign,aK=``,oK=`<!--$s-->`,sK=`<!--/$s-->`;function cK(e,t){var n,r=e.type,i=!0;return e[AG]?(i=!1,(n=e[AG]).state=n[NG]):n=new r(e.props,t),e[AG]=n,n.__v=e,n.props=e.props,n.context=t,zG(n),n.state??=nK,n[NG]??(n[NG]=n.state),r.getDerivedStateFromProps?n.state=iK({},n.state,r.getDerivedStateFromProps(n.props,n.state)):i&&n.componentWillMount?(n.componentWillMount(),n.state=n[NG]===n.state?n.state:n[NG]):!i&&n.componentWillUpdate&&n.componentWillUpdate(),eK&&eK(e),n.render(n.props,n.state,t)}function lK(e,t,n,r,i,a,o){if(e==null||!0===e||!1===e||e===aK)return aK;var s=typeof e;if(s!=`object`)return s==`function`?aK:s==`string`?UG(e):e+aK;if(rK(e)){var c,l=aK;i[jG]=e;for(var u=e.length,d=0;d<u;d++){var f=e[d];if(f!=null&&typeof f!=`boolean`){var p,m=lK(f,t,n,r,i,a,o);typeof m==`string`?l+=m:(c||=Array(u),l&&c.push(l),l=aK,rK(m)?(p=c).push.apply(p,m):c.push(m))}}return c?(l&&c.push(l),c):l}if(e.constructor!==void 0)return aK;e.__=i,QG&&QG(e);var h=e.type,g=e.props;if(typeof h==`function`){var _,v,y,b=t;if(h===WH){if(`tpl`in g){for(var x=aK,S=0;S<g.tpl.length;S++)if(x+=g.tpl[S],g.exprs&&S<g.exprs.length){var C=g.exprs[S];if(C==null)continue;typeof C!=`object`||C.constructor!==void 0&&!rK(C)?x+=C:x+=lK(C,t,n,r,e,a,o)}return x}if(`UNSTABLE_comment`in g)return`<!--`+UG(g.UNSTABLE_comment)+`-->`;v=g.children}else{if((_=h.contextType)!=null){var w=t[_.__c];b=w?w.props.value:_.__}var T=h.prototype&&typeof h.prototype.render==`function`;if(T)v=cK(e,b),y=e[AG];else{e[AG]=y=YG(e,b);for(var E=0;VG(y)&&E++<25;){BG(y),eK&&eK(e);try{v=h.call(y,g,b)}catch(t){throw a&&t&&typeof t.then==`function`&&(e._suspended=!0),t}}zG(y)}if(y.getChildContext!=null&&(t=iK({},t,y.getChildContext())),T&&EH.errorBoundaries&&(h.getDerivedStateFromError||y.componentDidCatch)){v=v!=null&&v.type===WH&&v.key==null&&v.props.tpl==null?v.props.children:v;try{return lK(v,t,n,r,e,a,!1)}catch(i){return h.getDerivedStateFromError&&(y[NG]=h.getDerivedStateFromError(i)),y.componentDidCatch&&y.componentDidCatch(i,nK),VG(y)?(v=cK(e,t),(y=e[AG]).getChildContext!=null&&(t=iK({},t,y.getChildContext())),lK(v=v!=null&&v.type===WH&&v.key==null&&v.props.tpl==null?v.props.children:v,t,n,r,e,a,o)):aK}finally{$G&&$G(e),tK&&tK(e)}}}v=v!=null&&v.type===WH&&v.key==null&&v.props.tpl==null?v.props.children:v;try{var D=lK(v,t,n,r,e,a,o);return $G&&$G(e),EH.unmount&&EH.unmount(e),e._suspended?typeof D==`string`?oK+D+sK:rK(D)?(D.unshift(oK),D.push(sK),D):D.then(function(e){return oK+e+sK}):D}catch(i){if(!a&&o&&o.onError){var O=function i(s){return o.onError(s,e,function(e,s){try{return lK(e,t,n,r,s,a,o)}catch(e){return i(e)}})}(i);if(O!==void 0)return O;var k=EH.__e;return k&&k(i,e),aK}if(!a||!i||typeof i.then!=`function`)throw i;return i.then(function i(){try{var s=lK(v,t,n,r,e,a,o);return e._suspended?oK+s+sK:s}catch(e){if(!e||typeof e.then!=`function`)throw e;return e.then(i)}})}}var A,j=`<`+h,M=aK;for(var N in g){var P=g[N];if(typeof(P=dK(P)?P.value:P)!=`function`||N===`class`||N===`className`){switch(N){case`children`:A=P;continue;case`key`:case`ref`:case`__self`:case`__source`:continue;case`htmlFor`:if(`for`in g)continue;N=`for`;break;case`className`:if(`class`in g)continue;N=`class`;break;case`defaultChecked`:N=`checked`;break;case`defaultSelected`:N=`selected`;break;case`defaultValue`:case`value`:switch(N=`value`,h){case`textarea`:A=P;continue;case`select`:r=P;continue;case`option`:r!=P||`selected`in g||(j+=` selected`)}break;case`dangerouslySetInnerHTML`:M=P&&P.__html;continue;case`style`:typeof P==`object`&&(P=qG(P));break;case`acceptCharset`:N=`accept-charset`;break;case`httpEquiv`:N=`http-equiv`;break;default:if(FG.test(N))N=N.replace(FG,`$1:$2`).toLowerCase();else{if(PG.test(N))continue;N[4]!==`-`&&!RG.has(N)||P==null?n?LG.test(N)&&(N=N===`panose1`?`panose-1`:N.replace(/([A-Z])/g,`-$1`).toLowerCase()):IG.test(N)&&(N=N.toLowerCase()):P+=aK}}P!=null&&!1!==P&&(j=!0===P||P===aK?j+` `+N:j+` `+N+`="`+(typeof P==`string`?UG(P):P+aK)+`"`)}}if(PG.test(h))throw Error(h+` is not a valid HTML tag name in `+j+`>`);if(M||(typeof A==`string`?M=UG(A):A!=null&&!1!==A&&!0!==A&&(M=lK(A,t,h===`svg`||h!==`foreignObject`&&n,r,e,a,o))),$G&&$G(e),tK&&tK(e),!M&&uK.has(h))return j+`/>`;var F=`</`+h+`>`,I=j+`>`;return rK(M)?[I].concat(M,[F]):typeof M==`string`?I+M+F:[I,M,F]}var uK=new Set([`area`,`base`,`br`,`col`,`command`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function dK(e){return typeof e==`object`&&!!e&&typeof e.peek==`function`&&`value`in e}var fK=0;function pK(e){return e!=null&&e.length>0?e:(fK+=1,`pst_ft_${fK}`)}function mK({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??zL)}function hK(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 gK(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 _K(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var vK=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new kG;#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=pK(a),this.#p=bH(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=RL(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new hH({...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&&(OG(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}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){this.#t.resetPaths(e,t)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),EG(t.wrapper,this.#w()))}setGitStatus(e){this.#p=bH(e,this.#p);let t=this.#T();t!=null&&EG(t.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),EG(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),DG(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),EG(r,this.#w())}#C(){return{initialViewportHeight:mK({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(pI,e());return}this.#l.setSlotHtml(pI,this.#e?.header?.html??null)}#k(e){let t=_K(e).find(e=>gK(e)),n=hK(jL(IL(this.#m).set));n!=null&&(t!=null&&t.outerHTML===n.outerHTML||(t==null?e.prepend(n):t.replaceWith(n)))}#A(e){let t=_K(e),n=t.find(e=>gK(e)),r=t.filter(e=>e!==n),i=IL(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=hK(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=IL(this.#m);t.colored&&NL(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${lI}]`);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(lI,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=UL(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 YL(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 yK(e){let[t]=(0,W.useState)(()=>new vK(e)),n=(0,W.useRef)({timeout:null,model:t});return(0,W.useEffect)(()=>{let{current:e}=n;return e.timeout!=null&&(clearTimeout(e.timeout),e.timeout=null),()=>{e.timeout=setTimeout(()=>e.model.cleanUp(),1)}},[]),{model:t}}var bK=(0,W.memo)(function({files:e,activeFile:t,commentCounts:n,viewedFiles:r,untrackedFiles:i,onFileClick:a,collapsed:o,onToggleCollapse:s}){let[c,l]=(0,W.useState)(``),u=(0,W.useMemo)(()=>e.map(e=>e.name),[e]),d=(0,W.useMemo)(()=>{let e=new Set;return u.forEach(t=>{let n=t.split(`/`);for(let t=1;t<n.length;t++)e.add(n.slice(0,t).join(`/`))}),Array.from(e)},[u]),f=(0,W.useMemo)(()=>e.map(e=>{let t=`modified`;if(i.has(e.name))t=`untracked`;else if(e.prevName)t=`renamed`;else{let n=e.prevObjectId,r=e.newObjectId;n===`0000000`||n===`0000000000000000000000000000000000000000`?t=`added`:(r===`0000000`||r===`0000000000000000000000000000000000000000`)&&(t=`deleted`)}return{path:e.name,status:t}}),[e,i]),p=(0,W.useRef)({commentCounts:n,viewedFiles:r});p.current={commentCounts:n,viewedFiles:r};let{model:m}=yK({paths:u,fileTreeSearchMode:`hide-non-matches`,gitStatus:f,renderRowDecoration:(0,W.useCallback)(e=>{let t=e.item.path,{commentCounts:n,viewedFiles:r}=p.current,i=r.has(t),a=n[t]??0;return i&&a>0?{text:`✓ 💬 ${a}`,title:`Viewed, ${a} comment${a>1?`s`:``}`}:i?{text:`✓`,title:`Viewed`}:a>0?{text:`💬 ${a}`,title:`${a} comment${a>1?`s`:``}`}:null},[]),initialSelectedPaths:t?[t]:[],initialExpandedPaths:d,onSelectionChange:e=>{e.length>0&&e[0]!==t&&a(e[0])}});return(0,W.useEffect)(()=>{m.resetPaths(u,{initialExpandedPaths:d})},[u,d,m]),(0,W.useEffect)(()=>{m.setGitStatus(f)},[f,n,r,m]),(0,W.useEffect)(()=>{if(t)try{m.focusPath(t),m.scrollToPath(t,{focus:!0,offset:`nearest`})}catch(e){console.error(`Failed to scroll to active file:`,e)}},[t,m]),(0,W.useEffect)(()=>{m.setSearch(c||null)},[c,m]),o?(0,G.jsx)(`div`,{className:`ft`,children:(0,G.jsx)(`div`,{className:`ft-search`,children:s&&(0,G.jsx)(QT,{content:`Expand sidebar`,side:`right`,children:(0,G.jsx)(`button`,{className:`sidebar-toggle`,onClick:s,"aria-label":`Expand sidebar`,children:(0,G.jsx)(UM,{size:16})})})})}):(0,G.jsxs)(`div`,{className:`ft`,style:{display:`flex`,flexDirection:`column`,height:`100%`},children:[(0,G.jsxs)(`div`,{className:`ft-search`,children:[s&&(0,G.jsx)(QT,{content:`Collapse sidebar`,side:`right`,children:(0,G.jsx)(`button`,{className:`sidebar-toggle`,onClick:s,"aria-label":`Collapse sidebar`,children:(0,G.jsx)(HM,{size:16})})}),(0,G.jsxs)(`div`,{className:`ft-search-wrapper`,children:[(0,G.jsx)(XM,{size:14,className:`ft-search-icon`}),(0,G.jsx)(`input`,{type:`text`,placeholder:`Filter files...`,value:c,onChange:e=>l(e.target.value),className:`ft-search-input`})]})]}),(0,G.jsx)(`div`,{style:{flex:1,minHeight:0,overflow:`auto`},children:(0,G.jsx)(xI,{model:m,className:`ft-pierre-tree`})})]})});function xK(e){return e.status===`resolved`?`resolved`:e.replies?.length?`replied`:`open`}var SK=[{key:`all`,label:`All`},{key:`open`,label:`Open`},{key:`replied`,label:`Replied`},{key:`resolved`,label:`Resolved`}];function CK({comments:e,resolveComment:t,unresolveComment:n,removeComment:r,addReply:i,editComment:a,editReply:o,removeReply:s}){let[c,l]=(0,W.useState)(`all`),u=(0,W.useMemo)(()=>{let t={all:e.length,open:0,replied:0,resolved:0};for(let n of e)t[xK(n)]++;return t},[e]),d=(0,W.useMemo)(()=>[...e].sort((e,t)=>t.createdAt-e.createdAt),[e]),f=(0,W.useMemo)(()=>c===`all`?d:d.filter(e=>xK(e)===c),[d,c]);return e.length===0?null:(0,G.jsxs)(`div`,{className:`cmt`,role:`complementary`,"aria-label":`Review comments`,children:[(0,G.jsxs)(`div`,{className:`cmt-head`,children:[(0,G.jsxs)(`div`,{className:`cmt-title`,children:[(0,G.jsx)(RM,{size:14,"aria-hidden":`true`}),(0,G.jsx)(`span`,{children:`Comments`}),(0,G.jsx)(`span`,{className:`cmt-total`,children:e.length})]}),(0,G.jsx)(`div`,{className:`cmt-filters`,role:`tablist`,"aria-label":`Filter comments`,children:SK.map(e=>(0,G.jsxs)(`button`,{role:`tab`,"aria-selected":c===e.key,className:`cmt-filter ${c===e.key?`cmt-filter-active`:``}`,onClick:()=>l(e.key),disabled:e.key!==`all`&&u[e.key]===0,children:[e.label,(0,G.jsx)(`span`,{className:`cmt-filter-count`,children:u[e.key]})]},e.key))})]}),(0,G.jsx)(`ul`,{className:`cmt-list`,"aria-label":`Comment threads`,children:f.length===0?(0,G.jsxs)(`li`,{className:`cmt-empty`,children:[`No `,c,` comments`]}):f.map(e=>(0,G.jsx)(wK,{comment:e,resolveComment:t,unresolveComment:n,removeComment:r,addReply:i,editComment:a,editReply:o,removeReply:s},e.id))})]})}function wK({comment:e,resolveComment:t,unresolveComment:n,removeComment:r,addReply:i,editComment:a,editReply:o,removeReply:s}){let c=xK(e),l=e.status===`resolved`,u=e.replies?.length??0,{haptic:d,sound:f}=oM(),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(!1),[_,v]=(0,W.useState)(!1),[y,b]=(0,W.useState)(!1),x=(0,W.useCallback)(()=>{e.lineNumber>0?vj(e.filePath,e.lineNumber,e.side):document.getElementById(`file-${e.filePath}`)?.scrollIntoView({block:`start`})},[e.filePath,e.lineNumber,e.side]),S=e.lineNumber>0?`:${e.lineNumber}`:` · file`;return(0,G.jsxs)(`li`,{className:`cmt-card cmt-card-${c} ${l?`cmt-card-resolved`:``}`,children:[(0,G.jsxs)(`div`,{className:`cmt-card-top`,children:[(0,G.jsx)(`span`,{className:`cmt-dot cmt-dot-${c}`,"aria-hidden":`true`}),(0,G.jsxs)(`button`,{className:`cmt-loc`,onClick:x,title:`Jump to ${e.filePath}${S}`,children:[(0,G.jsx)(`span`,{className:`cmt-loc-file`,children:fj(e.filePath)}),(0,G.jsx)(`span`,{className:`cmt-loc-line`,children:S})]}),(0,G.jsx)(`span`,{className:`cmt-time`,children:dj(e.createdAt)})]}),e.lineContent?.trim()&&(0,G.jsx)(`button`,{className:`cmt-codeline`,onClick:x,title:`Jump to line`,children:(0,G.jsx)(`code`,{children:e.lineContent.trim().slice(0,160)})}),_?(0,G.jsx)(qF,{draftKey:`tracker-edit:${e.id}`,initialBody:e.body,onCancel:()=>v(!1),onSubmit:t=>{a(e.id,t),v(!1)}}):(0,G.jsx)(`div`,{className:`cmt-body markdown-body`,dangerouslySetInnerHTML:{__html:mj(e.body)}}),(0,G.jsxs)(`div`,{className:`cmt-actions`,children:[(0,G.jsxs)(`button`,{className:`cmt-act`,onClick:()=>{g(e=>!e),m(!0)},title:`Reply`,children:[(0,G.jsx)(OM,{size:13,"aria-hidden":`true`}),(0,G.jsx)(`span`,{children:`Reply`})]}),(0,G.jsx)(`button`,{className:`cmt-act`,onClick:()=>v(e=>!e),title:`Edit comment`,children:(0,G.jsx)(GM,{size:13,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`cmt-act ${l?`cmt-act-resolved`:``}`,onClick:()=>{l?(n(e.id),d(`light`),f(`toggle`)):(t(e.id),d(`success`),f(`resolve`))},title:l?`Reopen`:`Resolve`,children:l?(0,G.jsx)(JM,{size:13,"aria-hidden":`true`}):(0,G.jsx)(yM,{size:13,"aria-hidden":`true`})}),y?(0,G.jsxs)(`span`,{className:`cmt-confirm`,children:[(0,G.jsx)(`button`,{className:`cmt-act cmt-act-danger`,onClick:()=>{r(e.id),d(`medium`),f(`remove`)},title:`Confirm delete`,children:`Delete?`}),(0,G.jsx)(`button`,{className:`cmt-act`,onClick:()=>b(!1),title:`Cancel`,children:(0,G.jsx)(aN,{size:13,"aria-hidden":`true`})})]}):(0,G.jsx)(`button`,{className:`cmt-act cmt-act-del`,onClick:()=>b(!0),title:`Delete comment`,children:(0,G.jsx)(eN,{size:13,"aria-hidden":`true`})})]}),u>0&&(0,G.jsxs)(`button`,{className:`cmt-thread-toggle`,onClick:()=>m(e=>!e),"aria-expanded":p,children:[(0,G.jsx)(xM,{size:12,className:`cmt-chev ${p?`cmt-chev-open`:``}`,"aria-hidden":`true`}),u,` `,u===1?`reply`:`replies`]}),p&&u>0&&(0,G.jsx)(`ul`,{className:`cmt-replies`,children:e.replies.map(t=>(0,G.jsx)(TK,{reply:t,onEdit:n=>o(e.id,t.id,n),onRemove:()=>s(e.id,t.id)},t.id))}),h&&(0,G.jsx)(qF,{draftKey:`reply:${e.id}`,onCancel:()=>g(!1),onSubmit:t=>{i(e.id,t),d(`light`),f(`success`),g(!1),m(!0)}})]})}function TK({reply:e,onEdit:t,onRemove:n}){let r=e.role===`agent`||e.role==null&&!!e.model,[i,a]=(0,W.useState)(!1);return(0,G.jsxs)(`li`,{className:`cmt-reply ${r?`cmt-reply-agent`:``}`,children:[(0,G.jsxs)(`div`,{className:`cmt-reply-head`,children:[(0,G.jsxs)(`span`,{className:`cmt-reply-who ${r?`cmt-reply-who-agent`:``}`,children:[r?(0,G.jsx)(vM,{size:11,"aria-hidden":`true`}):null,r?e.model||`Agent`:`You`]}),(0,G.jsx)(`span`,{className:`cmt-time`,children:dj(e.createdAt)}),!r&&(0,G.jsx)(`button`,{className:`cmt-reply-act`,onClick:()=>a(e=>!e),title:`Edit reply`,children:(0,G.jsx)(GM,{size:11,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`cmt-reply-act cmt-act-del`,onClick:n,title:`Delete reply`,children:(0,G.jsx)(eN,{size:11,"aria-hidden":`true`})})]}),i?(0,G.jsx)(qF,{draftKey:`tracker-reply-edit:${e.id}`,initialBody:e.body,onCancel:()=>a(!1),onSubmit:e=>{t(e),a(!1)}}):(0,G.jsx)(`div`,{className:`cmt-reply-body markdown-body`,dangerouslySetInnerHTML:{__html:mj(e.body)}})]})}function EK(e,t){let[n,r]=(0,W.useState)(e);return(0,W.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function DK(e){return e===`symbols`?2:e===`text`?1:0}function OK({scope:e,query:t,regex:n,changedOnly:r,changedPaths:i,open:a}){let o=EK(t,130).trim(),s=a&&o.length>=DK(e);return{...nt({queryKey:[`search`,e,o,e===`text`?n:!1,r,r?i:null],enabled:s,placeholderData:V,staleTime:5e3,queryFn:async({signal:t})=>{let a=await fetch(`/api/search`,{method:`POST`,headers:{"content-type":`application/json`},signal:t,body:JSON.stringify({scope:e,query:o,regex:e===`text`?n:!1,changedPaths:r?i:void 0})});if(!a.ok)throw Error(`Search request failed (${a.status})`);return await a.json()}}),enabled:s,pending:t.trim()!==o,minLength:DK(e)}}function kK(e,t){fetch(`/api/search/track`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({query:e,path:t})}).catch(()=>{})}function AK(e){return nt({queryKey:[`file-text`,e],enabled:!!e,staleTime:300*1e3,queryFn:async({signal:t})=>{let n=await fetch(`/api/file-text?path=${encodeURIComponent(e)}&version=new`,{signal:t});if(n.status===415)return{content:null,missing:!1,binary:!0};if(!n.ok)throw Error(`Failed to load file (${n.status})`);let r=await n.json();if(r.error){if(/binary/i.test(r.error))return{content:null,missing:!1,binary:!0};throw Error(r.error)}return r.missing?{content:null,missing:!0,binary:!1}:{content:r.content??``,missing:!1,binary:!1}}})}var jK=[{pattern:/^\s*(?:export\s+)?(?:async\s+)?function\s+(\w[\w$]*)\s*[<(]/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:export\s+)?(?:const|let|var)\s+(\w[\w$]*)\s*=\s*(?:async\s*)?\(/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:export\s+)?(?:const|let|var)\s+(\w[\w$]*)\s*=\s*(?:async\s+)?function/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:export\s+)?class\s+(\w[\w$]*)/i,kind:`class`,nameGroup:1},{pattern:/^\s*(?:export\s+)?interface\s+(\w[\w$]*)/i,kind:`interface`,nameGroup:1},{pattern:/^\s*(?:export\s+)?type\s+(\w[\w$]*)\s*=/i,kind:`type`,nameGroup:1},{pattern:/^\s*(?:export\s+)?enum\s+(\w[\w$]*)/i,kind:`enum`,nameGroup:1},{pattern:/^\s*(?:export\s+)?(?:const|let|var)\s+(\w[\w$]*)\s*=/i,kind:`variable`,nameGroup:1},{pattern:/^\s*def\s+(\w[\w$]*)\s*\(/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?fn\s+(\w[\w$]*)\s*[<(]/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?struct\s+(\w[\w$]*)/i,kind:`struct`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?enum\s+(\w[\w$]*)/i,kind:`enum`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?impl\s+(\w[\w$]*)/i,kind:`impl`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?trait\s+(\w[\w$]*)/i,kind:`trait`,nameGroup:1},{pattern:/^\s*func\s+(\w[\w$]*)\s*\(/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:func\s+)?\((\w[\w$]*)\s+\*?\w+\)\s+(\w[\w$]*)\s*\(/i,kind:`method`,nameGroup:2}];function MK(e){for(let{pattern:t,kind:n,nameGroup:r}of jK){let i=t.exec(e);if(i){let e=i[r];if(e)return{name:e,kind:n}}}return null}function NK(e){return new Set(e.map(e=>e.name))}function PK(e){let t=new Set;for(let n of e)n.side===`additions`&&t.add(`${n.filePath}:${n.lineNumber}`);return t}function FK(e,t){return e.kind===`file`?t.diffFileSet.has(e.path)?{type:`scrollFile`,path:e.path}:{type:`preview`,path:e.path}:t.diffFileSet.has(e.path)?{type:`scrollLine`,path:e.path,line:e.line,side:`additions`,match:e.match}:{type:`preview`,path:e.path,line:e.line,match:e.match}}function IK(e,t){if(!t||t.length===0)return null;let n=!0;for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127){n=!1;break}let r=n?e.length:RK(e),i=null;if(!n){i=Array(r+1).fill(-1);let t=0;for(let n=0;n<e.length;){i[t]=n;let r=e.codePointAt(n);n+=r>65535?2:1,t+=LK(r)}i[r]=e.length}let a=[];for(let e of t){let[t,o]=e;if(!(t==null||o==null||o<=t||t<0||o>r))if(n)a.push([t,o]);else{let e=i[t],n=i[o];e>=0&&n>=0&&a.push([e,n])}}return a.length?a:null}function LK(e){return e<=127?1:e<=2047?2:e<=65535?3:4}function RK(e){let t=0;for(let n=0;n<e.length;){let r=e.codePointAt(n);t+=LK(r),n+=r>65535?2:1}return t}function zK(e,t,n){let r=((t?IK(e,t):null)??BK(e,n)).map(([t,n])=>[Math.max(0,t),Math.min(e.length,n)]).filter(([e,t])=>t>e).sort((e,t)=>e[0]-t[0]),i=[];for(let[e,t]of r){let n=i[i.length-1];n&&e<=n[1]?n[1]=Math.max(n[1],t):i.push([e,t])}return i}function BK(e,t){let n=t.trim();if(!n)return[];let r=[],i=e.toLowerCase(),a=n.toLowerCase(),o=0;for(;r.length<50;){let e=i.indexOf(a,o);if(e===-1)break;r.push([e,e+a.length]),o=e+a.length}return r}function VK(e,t){let n=e.toLowerCase(),r=t.toLowerCase();if(!r)return 0;let i=0,a=0,o=-1;for(let e=0;e<n.length&&i<r.length;e++)n[e]===r[i]&&(a+=o>=0&&e-o===1?5:1,o=e,i++);return i===r.length?a-e.length*.01:null}function HK(e){let t=[],n=new Set;for(let r of e){if(r.side!==`additions`)continue;let e=MK(r.content);if(e){let i=`${r.filePath}:${r.lineNumber}:${e.name}`;if(n.has(i))continue;n.add(i);let a=r.content.indexOf(e.name),o=a>=0?[[a,a+e.name.length]]:[];t.push({name:e.name,kind:e.kind,path:r.filePath,fileName:r.filePath.split(`/`).pop()||``,line:r.lineNumber,content:r.content,matchRanges:o,gitStatus:``})}}return t}var UK=[{key:`all`,label:`All`,Icon:FM},{key:`files`,label:`Files`,Icon:AM},{key:`text`,label:`Text`,Icon:nN},{key:`symbols`,label:`Symbols`,Icon:DM}],WK={function:`ƒ`,method:`m`,class:`C`,variable:`v`,interface:`I`,type:`T`,enum:`E`,struct:`S`,impl:`i`,trait:`t`};function GK(e){switch(e){case`modified`:return{label:`M`,title:`modified`};case`untracked`:return{label:`U`,title:`untracked`};case`staged_new`:case`added`:return{label:`A`,title:`added`};case`deleted`:return{label:`D`,title:`deleted`};case`renamed`:return{label:`R`,title:`renamed`};case``:case`clean`:return null;default:return{label:e.charAt(0).toUpperCase(),title:e}}}function KK({text:e,ranges:t}){if(!t.length)return(0,G.jsx)(G.Fragment,{children:e});let n=[],r=0;return t.forEach(([t,i],a)=>{t>r&&n.push(e.slice(r,t)),n.push((0,G.jsx)(`mark`,{className:`searchpalette-mark`,children:e.slice(t,i)},a)),r=i}),r<e.length&&n.push(e.slice(r)),(0,G.jsx)(G.Fragment,{children:n})}function qK(e,t){let n=t.trim().toLowerCase();if(!n)return[];let r=e.toLowerCase(),i=[],a=0;for(let e=0;e<r.length&&a<n.length;e++)if(r[e]===n[a]){let t=i[i.length-1];t&&t[1]===e?t[1]=e+1:i.push([e,e+1]),a++}return a===n.length?i:[]}var JK=e=>{let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t+1)};function YK(e,t){let n=e.length-e.trimStart().length,r=e.slice(n),i=n;if(r.length>400){let e=t.find(e=>e[0]>=n),a=e?Math.max(0,e[0]-n-24):0,o=a>0?`…`:``;r=o+r.slice(a,a+400),i=n+a-o.length}let a=t.map(([e,t])=>[e-i,t-i]).filter(([e,t])=>t>0&&e<r.length).map(([e,t])=>[Math.max(0,e),Math.min(r.length,t)]);return{text:r,ranges:a}}function XK({isOpen:e,onClose:t,initialScope:n,files:r,changedEntries:i,customMode:a,staged:o,onNavigateFile:s,theme:c,fontSize:l,defaultTabSize:u,lineWrap:d,showLineNumbers:f,lineHoverHighlight:p}){let[m,h]=(0,W.useState)(``),[g,_]=(0,W.useState)(n),[v,y]=(0,W.useState)(!1),[b,x]=(0,W.useState)(!1),[S,C]=(0,W.useState)(0),[w,T]=(0,W.useState)(null),E=(0,W.useRef)(null),D=(0,W.useRef)(null),O=(0,W.useMemo)(()=>NK(r),[r]),k=(0,W.useMemo)(()=>PK(i),[i]),A=OK({scope:g,query:m,regex:v,changedOnly:b,changedPaths:(0,W.useMemo)(()=>[...O],[O]),open:e}),j=A.data&&A.data.scope===g?A.data:void 0,M=j?.error,N=nt({queryKey:[`repo-files-fallback`],enabled:e&&g===`files`&&!!M,staleTime:6e4,queryFn:async()=>(await(await fetch(`/api/repo-files`)).json()).files??[]});(0,W.useEffect)(()=>{e&&(h(``),_(n),y(!1),x(!1),C(0),T(null))},[e,n]),(0,W.useEffect)(()=>{e&&E.current?.focus()},[e]),(0,W.useEffect)(()=>{C(0),T(null)},[m,g]);let P=(0,W.useMemo)(()=>{let e=m.trim(),t=e.toLowerCase(),n=[];if(g===`files`&&M&&N.data)n=N.data.map(e=>({path:e,score:t?VK(e,t):0})).filter(e=>e.score!==null).sort((e,t)=>t.score-e.score).slice(0,60).map(({path:e})=>({kind:`file`,key:e,hit:{path:e,fileName:fj(e),gitStatus:``,matchType:``,exact:!1},inDiff:O.has(e)}));else if(j)j.scope===`files`?n=j.items.map(e=>({kind:`file`,key:e.path,hit:e,inDiff:O.has(e.path)})):j.scope===`text`?n=j.items.map(e=>({kind:`text`,key:`${e.path}:${e.line}:${e.col}`,hit:e,inDiff:O.has(e.path)})):j.scope===`symbols`?n=j.items.map(e=>({kind:`symbol`,key:`${e.path}:${e.line}:${e.name}`,hit:e,inDiff:O.has(e.path)})):j.scope===`all`&&(n=j.items.map(e=>e.kind===`file`?{kind:`file`,key:`all:${e.hit.path}`,hit:e.hit,inDiff:O.has(e.hit.path)}:e.kind===`text`?{kind:`text`,key:`all:${e.hit.path}:${e.hit.line}:${e.hit.col}`,hit:e.hit,inDiff:O.has(e.hit.path)}:{kind:`symbol`,key:`all:${e.hit.path}:${e.hit.line}:${e.hit.name}`,hit:e.hit,inDiff:O.has(e.hit.path)}));else if(g===`symbols`&&e.length<2){let e=HK(i);n=(t?e.filter(e=>e.name.toLowerCase().includes(t)):e).map(e=>({kind:`symbol`,key:`local:${e.path}:${e.line}:${e.name}`,hit:e,inDiff:!0}))}let r=n.filter(e=>e.inDiff),a=n.filter(e=>!e.inDiff);return[...r,...a]},[j,M,N.data,g,O,m,i]);(0,W.useEffect)(()=>{S>=P.length&&C(0)},[P.length,S]),(0,W.useEffect)(()=>{(D.current?.querySelector(`[data-focused="true"]`))?.scrollIntoView({block:`nearest`})},[S,P]);let F=(0,W.useMemo)(()=>({diffFileSet:O,changedKeys:k,customMode:a,staged:o}),[O,k,a,o]),I=(0,W.useCallback)((e,n)=>{let r=P[e];if(!r)return;let i=r.hit.path,a=m.trim();if(kK(a,i),r.kind===`file`){if(n){T({path:i});return}FK({kind:`file`,path:i},F).type===`scrollFile`?(t(),requestAnimationFrame(()=>s(i))):T({path:i});return}let o=r.hit.line,c=r.kind===`symbol`?r.hit.name:a;if(n){T({path:i,line:o,match:c});return}let l=FK({kind:`line`,path:i,line:o,match:c},F);l.type===`scrollLine`?(t(),requestAnimationFrame(()=>vj(i,l.line,l.side,l.match))):T({path:i,line:o,match:c})},[P,m,F,t,s]),L=(0,W.useCallback)(e=>{_(t=>UK[(UK.findIndex(e=>e.key===t)+e+UK.length)%UK.length].key)},[]),R=(0,W.useCallback)(e=>{if(e.key===`PageDown`){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:150,behavior:`auto`});return}if(e.key===`PageUp`){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:-150,behavior:`auto`});return}if(e.altKey&&(e.key===`ArrowDown`||e.key===`j`)){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:80,behavior:`auto`});return}if(e.altKey&&(e.key===`ArrowUp`||e.key===`k`)){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:-80,behavior:`auto`});return}if(e.shiftKey&&(e.key===`ArrowDown`||e.key===`j`)){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:80,behavior:`auto`});return}if(e.shiftKey&&(e.key===`ArrowUp`||e.key===`k`)){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:-80,behavior:`auto`});return}if(e.key===`Tab`){e.preventDefault(),L(e.shiftKey?-1:1);return}let t=e=>{P.length!==0&&C(t=>(t+e+P.length)%P.length)};e.key===`ArrowDown`||e.ctrlKey&&(e.key===`n`||e.key===`j`)?(e.preventDefault(),t(1)):e.key===`ArrowUp`||e.ctrlKey&&(e.key===`p`||e.key===`k`)?(e.preventDefault(),t(-1)):e.ctrlKey&&e.key===`d`?(e.preventDefault(),t(8)):e.ctrlKey&&e.key===`u`?(e.preventDefault(),t(-8)):e.key===`Enter`&&(e.preventDefault(),I(S,e.metaKey||e.ctrlKey))},[L,P.length,I,S]),z=(0,W.useCallback)(()=>{w?T(null):t()},[w,t]),ee=j?.total??P.length,te=(A.isFetching||A.pending)&&A.enabled,B=j?.indexing;return(0,G.jsxs)(IF,{open:e,onClose:z,className:`searchpalette ui-modal--palette ${w?`searchpalette--split`:``}`,ariaLabel:`Search files, text and symbols`,initialFocus:E,onKeyDown:R,children:[(0,G.jsxs)(`div`,{className:`searchpalette-header`,children:[(0,G.jsxs)(`div`,{className:`searchpalette-input-row`,children:[(0,G.jsx)(XM,{size:15,className:`searchpalette-search-icon`}),(0,G.jsx)(`input`,{ref:E,type:`text`,className:`searchpalette-input`,placeholder:g===`all`?`Search files, text and symbols…`:g===`files`?`Search files in the repo…`:g===`text`?v?`Search by regular expression…`:`Search file contents…`:`Search symbol definitions…`,value:m,onChange:e=>h(e.target.value),role:`combobox`,"aria-expanded":P.length>0,"aria-controls":`searchpalette-list`,"aria-activedescendant":P[S]?`sp-row-${S}`:void 0,spellCheck:!1,autoComplete:`off`}),te&&(0,G.jsx)(IM,{size:14,className:`searchpalette-spinner spin`}),m&&(0,G.jsx)(`button`,{className:`searchpalette-clear`,onClick:()=>h(``),"aria-label":`Clear search`,children:(0,G.jsx)(aN,{size:14})}),(0,G.jsx)(`span`,{className:`searchpalette-count`,children:B?`indexing…`:j?`${P.length} of ${ee}`:``})]}),(0,G.jsxs)(`div`,{className:`searchpalette-controls`,children:[(0,G.jsx)(`div`,{className:`searchpalette-scopes`,role:`tablist`,"aria-label":`Search scope`,children:UK.map(e=>(0,G.jsxs)(`button`,{role:`tab`,"aria-selected":g===e.key,className:`searchpalette-scope ${g===e.key?`is-active`:``}`,onClick:()=>_(e.key),children:[(0,G.jsx)(e.Icon,{size:12}),e.label]},e.key))}),(0,G.jsxs)(`div`,{className:`searchpalette-toggles`,children:[g===`text`&&(0,G.jsx)(`button`,{className:`searchpalette-toggle ${v?`is-active`:``}`,onClick:()=>y(e=>!e),title:`Regular expression`,"aria-pressed":v,children:`.*`}),(0,G.jsxs)(`button`,{className:`searchpalette-toggle ${b?`is-active`:``}`,onClick:()=>x(e=>!e),title:`Limit to files in the current diff`,"aria-pressed":b,children:[(0,G.jsx)(MM,{size:12}),`Changed`]})]})]}),j?.regexError&&(0,G.jsx)(`div`,{className:`searchpalette-note`,children:`Invalid regex — showing literal matches`})]}),(0,G.jsxs)(`div`,{className:`searchpalette-body`,children:[(0,G.jsx)(`div`,{className:`searchpalette-list`,id:`searchpalette-list`,role:`listbox`,ref:D,children:(0,G.jsx)(ZK,{rows:P,scope:g,query:m,focusedIndex:S,engineError:M,isFetching:A.isFetching,enabled:A.enabled,minLength:A.minLength,regex:v,changedOnly:b,onHover:C,onActivate:(e,t)=>I(e,t?t.metaKey||t.ctrlKey:!1),onRetry:()=>A.refetch()})}),w&&(0,G.jsx)(rq,{preview:w,theme:c,fontSize:l,defaultTabSize:u,lineWrap:d,showLineNumbers:f,lineHoverHighlight:p,onClose:()=>T(null),inDiff:O.has(w.path),onGoToDiff:()=>{t(),w.line?requestAnimationFrame(()=>vj(w.path,w.line,`additions`,w.match)):requestAnimationFrame(()=>s(w.path))}},w.path)]}),(0,G.jsxs)(`div`,{className:`searchpalette-foot`,children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`Tab`}),` scope`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`↑↓`}),` move`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`↵`}),` `,w&&O.has(w.path)?`view in diff`:`open`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`⌘↵`}),` peek`]}),w&&(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`⌥↑↓`}),` / `,(0,G.jsx)(`kbd`,{children:`⇧↑↓`}),` scroll preview`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`esc`}),` `,w?`back`:`close`]})]})]})}function ZK({rows:e,scope:t,query:n,focusedIndex:r,engineError:i,isFetching:a,enabled:o,minLength:s,regex:c,changedOnly:l,onHover:u,onActivate:d,onRetry:f}){return i&&t!==`files`?(0,G.jsxs)(`div`,{className:`searchpalette-state searchpalette-state--error`,children:[(0,G.jsx)(`p`,{children:`Search engine unavailable`}),(0,G.jsx)(`span`,{className:`searchpalette-state-detail`,children:i}),(0,G.jsx)(`button`,{className:`searchpalette-retry`,onClick:f,children:`Retry`})]}):e.length>0?(0,G.jsx)(G.Fragment,{children:e.map((e,t)=>(0,G.jsx)(QK,{row:e,index:t,query:n,focused:t===r,onHover:u,onActivate:d},e.key))}):o?a?(0,G.jsxs)(`div`,{className:`searchpalette-state`,children:[(0,G.jsx)(IM,{size:15,className:`spin`}),` Searching…`]}):(0,G.jsxs)(`div`,{className:`searchpalette-state`,children:[(0,G.jsxs)(`p`,{children:[`No matches`,n.trim()?` for “${n.trim()}”`:``]}),(0,G.jsx)(`span`,{className:`searchpalette-state-detail`,children:l?`Searching only changed files — turn off Changed to search the whole repo`:t===`text`&&!c?`Try Tab to switch scope, or enable .* for regex`:`Try Tab to switch scope`})]}):(0,G.jsx)(`div`,{className:`searchpalette-state`,children:t===`symbols`?n.trim()?`No matching symbols in the current diff. Type at least 2 characters to search the whole repository.`:`No symbols found in the current diff. Type at least 2 characters to search the whole repository.`:t===`text`?`Type to search file contents`:`Type to filter — or browse all files`})}function QK({row:e,index:t,query:n,focused:r,onHover:i,onActivate:a}){let o=GK(e.hit.gitStatus);return(0,G.jsxs)(`div`,{id:`sp-row-${t}`,role:`option`,"aria-selected":r,"data-focused":r,className:`searchpalette-row ${r?`is-focused`:``} ${e.inDiff?`is-indiff`:``}`,onMouseEnter:()=>i(t),onClick:e=>a(t,e),children:[e.kind===`file`&&(0,G.jsx)($K,{hit:e.hit,query:n}),e.kind===`text`&&(0,G.jsx)(eq,{hit:e.hit,query:n}),e.kind===`symbol`&&(0,G.jsx)(tq,{hit:e.hit}),(0,G.jsxs)(`div`,{className:`searchpalette-rail`,children:[e.inDiff&&(0,G.jsx)(`span`,{className:`searchpalette-pill searchpalette-pill--diff`,children:`diff`}),o&&(0,G.jsx)(`span`,{className:`searchpalette-git searchpalette-git--${o.title}`,title:o.title,children:o.label})]})]})}function $K({hit:e,query:t}){let n=e.fileName,r=qK(n,t);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`searchpalette-tile searchpalette-tile--file`,children:(0,G.jsx)(AM,{size:13})}),(0,G.jsxs)(`div`,{className:`searchpalette-info`,children:[(0,G.jsx)(`span`,{className:`searchpalette-primary`,children:(0,G.jsx)(KK,{text:n,ranges:r})}),(0,G.jsx)(`span`,{className:`searchpalette-secondary`,children:JK(e.path)||`./`})]})]})}function eq({hit:e,query:t}){let n=zK(e.content,e.matchRanges,t),{text:r,ranges:i}=YK(e.content,n);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`searchpalette-tile searchpalette-tile--text`,children:(0,G.jsx)(nN,{size:13})}),(0,G.jsxs)(`div`,{className:`searchpalette-info`,children:[(0,G.jsx)(`span`,{className:`searchpalette-primary searchpalette-code`,children:(0,G.jsx)(KK,{text:r,ranges:i})}),(0,G.jsxs)(`span`,{className:`searchpalette-secondary`,children:[e.fileName,`:`,e.line,(0,G.jsx)(`span`,{className:`searchpalette-crumb`,children:JK(e.path)})]})]})]})}function tq({hit:e}){let t=e.content.indexOf(e.name),n=t>=0?e.content.slice(t+e.name.length).trimEnd():``,r=zK(e.name,e.matchRanges.length?nq(e):void 0,e.name);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`searchpalette-tile searchpalette-tile--symbol`,title:e.kind,children:WK[e.kind]??`?`}),(0,G.jsxs)(`div`,{className:`searchpalette-info`,children:[(0,G.jsxs)(`span`,{className:`searchpalette-primary`,children:[(0,G.jsx)(KK,{text:e.name,ranges:r}),n&&(0,G.jsx)(`span`,{className:`searchpalette-sigtail`,children:n.slice(0,60)})]}),(0,G.jsxs)(`span`,{className:`searchpalette-secondary`,children:[e.fileName,`:`,e.line,(0,G.jsx)(`span`,{className:`searchpalette-crumb`,children:JK(e.path)})]})]}),(0,G.jsx)(`span`,{className:`searchpalette-kind-badge`,children:e.kind})]})}function nq(e){let t=e.content.indexOf(e.name);if(t<0)return;let n=[];for(let[r,i]of e.matchRanges){let a=r-t,o=i-t;o>0&&a<e.name.length&&n.push([Math.max(0,a),Math.min(e.name.length,o)])}return n.length?n:void 0}function rq({preview:e,theme:t,fontSize:n,defaultTabSize:r,lineWrap:i,showLineNumbers:a,lineHoverHighlight:o,onClose:s,inDiff:c,onGoToDiff:l}){let u=pj[t]||pj.nord,{data:d,isLoading:f,error:p}=AK(e.path),m=(0,W.useRef)(null);return(0,W.useEffect)(()=>{!d?.content||!e.line||!m.current||_j(m.current,e.line,e.match)},[d?.content,e.line,e.match]),(0,G.jsxs)(`div`,{className:`searchpalette-preview`,children:[(0,G.jsxs)(`div`,{className:`searchpalette-preview-head`,children:[(0,G.jsx)(AM,{size:12}),(0,G.jsx)(`span`,{className:`searchpalette-preview-path`,children:e.path}),c&&(0,G.jsxs)(`button`,{className:`searchpalette-preview-diff-btn`,onClick:l,title:`Open this file and line in the main diff viewer (Enter)`,style:{padding:`2.5px 8px`,fontSize:`10.5px`,background:`var(--accent-subtle)`,border:`1px solid var(--accent)`,borderRadius:`4px`,color:`var(--text-primary)`,cursor:`pointer`,fontWeight:600,marginRight:`8px`,display:`inline-flex`,alignItems:`center`,gap:`4px`},children:[(0,G.jsx)(MM,{size:11}),`View in Diff`]}),(0,G.jsx)(`button`,{className:`searchpalette-clear`,onClick:s,"aria-label":`Close preview`,children:(0,G.jsx)(aN,{size:14})})]}),(0,G.jsx)(`div`,{className:`searchpalette-preview-body`,ref:m,children:f?(0,G.jsxs)(`div`,{className:`searchpalette-state`,children:[(0,G.jsx)(IM,{size:15,className:`spin`}),` Loading `,e.path,`…`]}):p?(0,G.jsx)(`div`,{className:`searchpalette-state searchpalette-state--error`,children:p.message}):d?.binary?(0,G.jsx)(`div`,{className:`searchpalette-state`,children:`Binary file — no preview`}):d?.missing?(0,G.jsx)(`div`,{className:`searchpalette-state`,children:`File not present in the working tree`}):d?(0,G.jsx)(zh,{file:{name:e.path,contents:d.content??``},options:{disableFileHeader:!0,overflow:i?`wrap`:`scroll`,disableLineNumbers:!a,lineHoverHighlight:o,theme:{dark:u.type===`dark`?u.themeName:`nord`,light:u.type===`light`?u.themeName:`github-light`},themeType:u.type,unsafeCSS:`
3884
+ }`}var bR=new WeakMap;function xR(e){let t=bR.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(BI,`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(),bR.set(e,i),i}function SR(e,t){if(!e.isConnected)return;let n=xR(t);if(n==null)return;let r=t.querySelector(`style[${VI}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(VI,``),t.appendChild(i)),i.textContent=`:host { ${HI}: ${n}px; }`}var CR;function wR(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){CR??(CR=new CSSStyleSheet,CR.replaceSync(vR(gR)));let t=!1;try{e.adoptedStyleSheets=[CR],t=!0}catch{}if(t){e.querySelector(`style[${RI}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(RI,``),t.textContent=vR(gR),e.prepend(t)}}function TR(e,t){ER(e,t),wR(t),SR(e,t)}function ER(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`});TR(this,e)}}if(customElements.define(LI,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(LI)))e instanceof HTMLElement&&TR(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var DR=5,OR=1<<DR,kR=OR*4;function AR(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function jR(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function MR(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 NR(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 PR(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function FR(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 IR(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,BR(e,t)}function LR(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=NR(e).get(t);if(i===void 0)return;let a=i>>DR;e.childVisibleChunkSums[a]+=r}function RR(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=VR(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=OR}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 zR(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>DR;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<DR}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 BR(e,t){if(t.childIds.length<kR){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/OR),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>>DR]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function VR(e,t,n,r){let i=Math.min(t.childIds.length,n+OR),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 HR=7,UR=3,WR=1<<UR,GR=4;function KR(e,t,n=0){return e<<GR|n<<UR|t}function qR(e){return e.depthAndFlags>>>GR}function JR(e){return(e.depthAndFlags&WR)>>UR}function YR(e){return(e.depthAndFlags&WR)!==0}function XR(e){return e.depthAndFlags&HR}function ZR(e,t){return(XR(e)&t)!==0}function QR(e,t){e.depthAndFlags|=t}function $R(e,t){e.depthAndFlags=KR(t,XR(e),JR(e))}var ez=Symbol(`benchmarkInstrumentation`);function tz(e,t){return t==null||Object.defineProperty(e,ez,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function nz(e){return e==null?null:e[ez]??null}function Q(e,t,n){return e==null?n():e.measurePhase(t,n)}function rz(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function iz(e){return e>=48&&e<=57}function az(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!iz(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&&iz(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 oz(e){let t=e.toLowerCase();return{lowerValue:t,tokens:az(t)}}function sz(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 cz(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=sz(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function lz(e,t,n){let r=cz(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function uz(e,t){return lz(e,t,oz)}function dz(e,t){return t===e.segments.length-1?e.isDirectory?1:0:1}function fz(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=dz(e,r);return a===dz(t,r)?uz(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 pz(e,t){return fz(e,t)}function mz(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=oz(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=dz(e,n);return o===dz(t,n)?lz(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 hz(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=oz(r);return e.sortKeyById[t]=i,i}function gz(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function _z(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 vz(e){let{hasTrailingSlash:t,segments:n}=_z(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function yz(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=_z(e);return{requiresDirectory:t,segments:n}}var bz=``;function xz(){let e=new Map;return e.set(bz,0),{idByValue:e,valueById:[bz],sortKeyById:[oz(bz)]}}function Sz(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 Cz(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var wz=Symbol(`pathStorePreparedInputKind`);function Tz(e,t){return e[wz]=t,e}function Ez(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function Dz(e,t,n){return n===`default`?pz(e,t):n(Ez(e),Ez(t))}function Oz(){return{depthAndFlags:KR(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function kz(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 Az(e){return e.isDirectory?e.segments.length:e.segments.length-1}function jz(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 Mz(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function Nz(e,t={}){return zz(e,t).map(e=>e.path)}function Pz(e,t={}){let n=zz(e,t);return Tz({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function Fz(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 Tz({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function Iz(e){let t=e,n=t.preparedPaths;if(t[wz]===`prepared`&&n!=null)return n;if(!jz(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function Lz(e){let t=e;return t[wz]===`presorted`&&t.presortedPaths!=null||Mz(t.presortedPaths)?t.presortedPaths:null}function Rz(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function zz(e,t={}){let n=gz(t),r=nz(t);rz(r,`workload.inputFiles`,e.length);let i=Q(r,`store.preparePathEntries.parse`,()=>e.map(e=>vz(e)));return Q(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>Dz(e,t,n.sort))),i}var Bz=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[Oz()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=xz();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=nz(e),this.options=gz(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,AR())}appendPaths(e){return Q(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>vz(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,Q(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return Q(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:KR(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:KR(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:KR(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=vz(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:KR(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:KR(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=vz(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(Q(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||Q(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`?mz(this.lastPreparedPath,e,this.segmentSortKeyCache):Dz(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=Az(e),i=n==null?0:Az(n),a=n==null?0:kz(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=Sz(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:KR(qR(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),PR(i,s),s}createFileChildUnchecked(e,t){let n=Sz(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:KR(qR(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),PR(r,a),a}getOrCreateDirectoryChild(e,t){let n=Sz(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&&!YR(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:KR(qR(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),PR(r,a),this.directories.set(a,AR()),a}createDirectoryChild(e,t){let n=Sz(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:KR(qR(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),PR(r,a),this.directories.set(a,AR()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!YR(n))throw Error(`Path is not a directory: "${t}"`);if(ZR(n,1))throw Error(`Duplicate path: "${t}"`);QR(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,jR());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(YR(a)){let t=jR();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;YR(n)&&this.directories.set(t,AR());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),PR(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!YR(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 IR(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function Vz(e,t=`closed`,n=null){let r=Uz(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 Hz(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function Uz(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 Wz(e,t){return ZR(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion===`closed`?!1:qR(t)<=e.defaultExpansion}function Gz(e,t,n=e.snapshot.nodes[t]){return n==null||!YR(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:Wz(e,n)}function Kz(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!YR(r))return;let i=Wz(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 qz(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 Jz(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function Yz(e,t){let n=qz(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 Xz(e,t){let n=qz(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function Zz(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 Qz(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function $z(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 eB(e,t){e.directoryLoadInfoById.delete(t)}function tB(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 nB(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function rB(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function iB(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function aB(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function oB(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function sB(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function cB(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 lB(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 uB(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 dB(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 fB(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 pB(e,t,n){return{...n,visibleCountDelta:wB(e)-t}}function mB(e,t){let n=wB(e),r=Hz();e.transactionStack.push(r);try{t()}catch(t){throw _B(e,r,!1),t}_B(e,r,!0,wB(e)-n)}function hB(e,t){let n=e.instrumentation;if(n==null){gB(e,t);return}Q(n,`store.events.record`,()=>gB(e,t))}function gB(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){SB(e,t);return}n.events.push(t),xB(n,t)}function _B(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?bB(i,t):Q(n,`store.events.batch.merge`,()=>bB(i,t));return}let a=vB(t,r),o=e.instrumentation;if(o==null){SB(e,a);return}Q(o,`store.events.batch.commit`,()=>SB(e,a))}function vB(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 yB(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function bB(e,t){for(let n of t.events)e.events.push(n);yB(e,t)}function xB(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function SB(e,t){let n=e.instrumentation;if(n==null){CB(e,t);return}Q(n,`store.events.emit`,()=>CB(e,t))}function CB(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function wB(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function TB(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!YR(n)||ZR(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||!YR(a)?null:i}function EB(e,t){let n=t;for(;;){let t=TB(e,n);if(t==null)return n;n=t}}function DB(e,t){let n=[t],r=t;for(;;){let t=TB(e,r);if(t==null)return n;n.push(t),r=t}}function OB(e,t){let n=t==null?e.snapshot.rootId:RB(e,t);return n==null?[]:HB(e,n)}function kB(e,t){let n=vz(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=rV(e,nV(e,r)),{createdNodeIds:a,directoryId:o}=UB(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=VB(e,o);if(ZR(n,1))throw Error(`Path already exists: "${t}"`);QR(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=GB(e,o,n.basename),s.add(c);FB(e,o);let l=rV(e,o);return nB({affectedAncestorIds:LB(e,c),affectedNodeIds:[...s],path:t,projectionChanged:iV(i,l)})}function AB(e,t,n){let r=RB(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=VB(e,r);if(ZR(i,2))throw Error(`The root node cannot be removed`);if(YR(i)&&BB(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=rV(e,a),s=eV(e,r);JB(e,a,r,i.nameId),tV(e,a),FB(e,a);let c=rV(e,a);return rB({affectedAncestorIds:LB(e,a),affectedNodeIds:s,path:t,projectionChanged:iV(o,c),recursive:n.recursive===!0})}function jB(e,t,n,r){let i=RB(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=VB(e,i);if(ZR(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=QB(e,i,n),c=rV(e,a.parentId),l=rV(e,s.parentId),u=Cz(e.snapshot.segmentTable,a.nameId),d=Sz(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(YR(a)&&cV(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=MR(e.snapshot.nodes,BB(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&$B(e,p,o,JR(a))===`skip`)return null;let m=a.parentId;JB(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),sV(e,i),qB(e,s.parentId,i),tV(e,m),e.pathCacheVersion++,FB(e,m),s.parentId!==m&&FB(e,s.parentId);let h=rV(e,m),g=rV(e,s.parentId);return iB({affectedAncestorIds:[...new Set([...LB(e,m),...LB(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:aV([c,l],[h,g]),to:PB(e,i)})}function MB(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function NB(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function PB(e,t){let n=VB(e,t),r=MB(e,t);if(r!=null)return r;if(ZR(n,2))return NB(e,t,``);let i=PB(e,n.parentId),a=Cz(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return NB(e,t,YR(n)?`${o}/`:o)}function FB(e,t){let n=e.instrumentation;if(n==null){uV(e,t);return}Q(n,`store.recomputeCountsUpwardFrom`,()=>uV(e,t))}function IB(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||!YR(o)){lV(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){lV(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function LB(e,t){let n=[],r=t;for(;r!=null;){let t=VB(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function RB(e,t){if(t.length===0)return e.snapshot.rootId;let n=yz(t);return zB(e,n.segments,n.requiresDirectory)}function zB(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=BB(e,r),a=MR(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=VB(e,r);return n&&!YR(i)?null:r}function BB(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 VB(e,t){let n=e.snapshot.nodes[t];if(n===void 0||ZR(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function HB(e,t){let n=e.snapshot.nodes[t];if(n===void 0||ZR(n,4))return[];if(!YR(n))return[PB(e,t)];if(BB(e,t).childIds.length===0)return ZR(n,1)&&!ZR(n,2)?[PB(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||ZR(n,4)){i.pop();continue}if(!YR(n)){r.push(PB(e,t.nodeId)),i.pop();continue}let a=BB(e,t.nodeId);if(a.childIds.length===0){ZR(n,1)&&!ZR(n,2)&&r.push(PB(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 UB(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=Sz(e.snapshot.segmentTable,i),a=BB(e,r),o=MR(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!YR(VB(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=WB(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function WB(e,t,n){let r=VB(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:KR(qR(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,AR()),qB(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function GB(e,t,n){let r=Sz(e.snapshot.segmentTable,n),i=BB(e,t);if(MR(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${fV(e,t,n)}"`);let a=VB(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:KR(qR(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),qB(e,t,o),e.activeNodeCount++,o}function KB(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}YB(e,n,o)<0?i=a:r=a+1}return r}function qB(e,t,n){let r=BB(e,t),i=VB(e,n);MR(e.snapshot.nodes,r).set(i.nameId,n),LR(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=KB(e,r,n);r.childIds.splice(a,0,n),FR(r,a),BR(e.snapshot.nodes,r)}function JB(e,t,n,r){let i=BB(e,t),a=NR(i),o=a.get(n)??-1;MR(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&LR(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),FR(i,o),BR(e.snapshot.nodes,i))}function YB(e,t,n){let r=e.snapshot.options.sort;return r===`default`?XB(e,t,n):r(ZB(e,t),ZB(e,n))}function XB(e,t,n){let r=VB(e,t),i=VB(e,n),a=YR(r);if(a!==YR(i))return a?-1:1;let o=cz(hz(e.snapshot.segmentTable,r.nameId),hz(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=Cz(e.snapshot.segmentTable,r.nameId),c=Cz(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function ZB(e,t){let n=VB(e,t),r=PB(e,t),i=YR(n),a=i?r.slice(0,-1):r;return{basename:Cz(e.snapshot.segmentTable,n.nameId),depth:qR(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function QB(e,t,n){let r=VB(e,t),i=RB(e,n);if(i!=null){let t=VB(e,i);if(YR(t))return{basename:Cz(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=yz(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=yz(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:zB(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function $B(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${PB(e,t)}"`);let i=VB(e,t);if(JR(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(YR(i)&&BB(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return eV(e,t),JB(e,a,t,o),tV(e,a),FB(e,a),`handled`}function eV(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=VB(e,t.nodeId);if(t.visitedChildren||!YR(i)){YR(i)&&e.snapshot.directories.delete(t.nodeId),QR(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),eB(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=BB(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 tV(e,t){let n=t;for(;n!=null;){let t=VB(e,n);if(!YR(t)||ZR(t,2)||BB(e,n).childIds.length>0)return;QR(t,1),n=t.parentId===n?null:t.parentId}}function nV(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=MR(e.snapshot.nodes,BB(e,n)).get(t);if(i==null||!YR(VB(e,i)))break;n=i}return n}function rV(e,t){let n=oV(e,t);if(n==null)return null;let r=EB(e,n),i=VB(e,r),a=n===r?null:DB(e,n).map(t=>PB(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:BB(e,r).childIds.length>0,path:PB(e,r),terminalKind:JR(i)})}function iV(e,t){return aV([e],[t])}function aV(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 oV(e,t){let n=t;for(;n!=null;){let t=VB(e,n);if(!YR(t)||ZR(t,2))return null;if(!Gz(e,n,t))return n;n=t.parentId}return null}function sV(e,t){let n=VB(e,t);if($R(n,(t===e.snapshot.rootId?-1:qR(VB(e,n.parentId)))+1),!YR(n))return;let r=BB(e,t);for(let t of r.childIds)sV(e,t)}function cV(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=VB(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function lV(e,t,n=VB(e,t),r=!1){let i=e.instrumentation;if(i==null){dV(e,t,n,r);return}Q(i,`store.recomputeNodeCounts`,()=>dV(e,t,n,r))}function uV(e,t){let n=t;for(;n!=null;){let t=VB(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(lV(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&LR(BB(e,s),n,a,o),n=s}}function dV(e,t,n,r){if(!YR(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=BB(e,t);if(r){let t=e.instrumentation;t==null?IR(e.snapshot.nodes,i):Q(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>IR(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,ZR(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=TB(e,t)==null?Gz(e,t,n)?1+o:1:o}function fV(e,t,n){let r=PB(e,t);return r.length===0?n:`${r}${n}`}function pV(e){return e!=null&&!ZR(e,4)}function mV(e,t){let n=e.snapshot.nodes[t];return!pV(n)||!YR(n)||ZR(n,2)?null:n}function hV(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&pV(e.snapshot.nodes[n])&&(t+=1);return t}function gV(e){return Math.max(0,e.valueById.length-1)}function _V(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:hV(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:gV(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function vV(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 yV(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)mV(e,n)!=null&&t.push(PB(e,n));for(let t of e.expandedDirectoryIds)mV(e,t)!=null&&n.push(PB(e,t));return{collapsedPaths:t,expandedPaths:n}}function bV(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)mV(e,n)==null||Jz(e,n)===`loaded`||t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:PB(e,n)});return t}function xV(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=RB(e,n);t!=null&&Kz(e,t,!0,VB(e,t))}for(let n of t.collapsedPaths){let t=RB(e,n);t!=null&&Kz(e,t,!1,VB(e,t))}}function SV(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=RB(e,n.path);t!=null&&mV(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function CV(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function wV(e){let t=e.snapshot.segmentTable,n=xz();for(let r of e.snapshot.nodes)if(pV(r)){if(ZR(r,2)){r.nameId=0;continue}r.nameId=Sz(n,Cz(t,r.nameId))}e.snapshot.segmentTable=n}function TV(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!pV(r)||!YR(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return pV(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[VB(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),IR(e.snapshot.nodes,n)}}function EV(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(pV(n))break;--t}e.snapshot.nodes.length=t+1}function DV(e){let t=yV(e),n=bV(e);Q(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>CV(e)),Q(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>wV(e)),Q(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>TV(e)),Q(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>EV(e)),Q(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>xV(e,t)),Q(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>SV(e,n)),Q(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>IB(e,e.snapshot.rootId))}function OV(e){let t=yV(e),n=bV(e),r=Q(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>OB(e)),i=tz({...e.snapshot.options},e.instrumentation),a=Q(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new Bz(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,Q(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>xV(e,t)),Q(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>SV(e,n)),Q(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>IB(e,e.snapshot.rootId))}function kV(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function AV(e,t){let n=_V(e);t===`stable`?Q(e.instrumentation,`store.cleanup.stable`,()=>DV(e)):Q(e.instrumentation,`store.cleanup.aggressive`,()=>OV(e));let r=_V(e);return vV(t,t===`stable`,n,r)}var jV=64;function MV(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 NV(e){return VB(e,e.snapshot.rootId).visibleSubtreeCount}function PV(e,t,n,r){let i=VB(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function FV(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:eH(e,t.cursor),setSize:t.setSize,subtreeEndIndex:PV(e,t.cursor,t.index,n)}}function IV(e,t,n,r,i,a){let o=BB(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=RR(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return LV(e,u,l,r+c,i+1,s,o.childIds.length,a)}function LV(e,t,n,r,i,a,o,s){if(!YR(VB(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=JV(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=VB(e,c.terminalNodeId);if(!YR(l)||!Gz(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return IV(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function RV(e,t){let n=NV(e);if(t<0||t>=n)return null;let r=IV(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>PB(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=FV(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:eH(e,r.cursor),setSize:r.setSize,subtreeEndIndex:PV(e,r.cursor,r.index,n)}}function zV(e,t,n){let r=e.instrumentation,i=NV(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 $V(e,o+1);let t=[],n=GV(e,a);for(let r=a;r<=o&&n!=null;r++){let r=eH(e,n);t.push(r),n=XV(e,n)}return t}let s=[],c=0,l=0,u=Q(r,`store.getVisibleSlice.selectFirstRow`,()=>GV(e,a));for(let t=a;t<=o&&u!=null;t++){let t=Q(r,`store.getVisibleSlice.materializeRow`,()=>eH(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=Q(r,`store.getVisibleSlice.advanceCursor`,()=>XV(e,u))}return rz(r,`workload.visibleRowsRead`,s.length),rz(r,`workload.flattenedRowsRead`,c),rz(r,`workload.flattenedSegmentsRead`,l),s}function BV(e,t=NV(e)){let n=e.instrumentation;return n==null?QV(e,t):Q(n,`store.getVisibleTreeProjection`,()=>QV(e,t))}function VV(e){return ZV(BV(e))}function HV(e,t){let n=RB(e,t);if(n==null||n===e.snapshot.rootId||YR(VB(e,n))&&EB(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=VB(e,i).parentId,n=BB(e,t),s=NR(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=zR(a,n,s),t!==o){let n=VB(e,t),a=TB(e,t);if(!Gz(e,t,n)&&a!==i)return null;EB(e,t)===t&&(r+=1)}i=t}return r}function UV(e,t){let n=RB(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=VB(e,n);if(!YR(r))throw Error(`Path is not a directory: "${t}"`);return Gz(e,n,r)?null:(Kz(e,n,!0,r),FB(e,n),aB({affectedAncestorIds:LB(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function WV(e,t){let n=RB(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=VB(e,n);if(!YR(r))throw Error(`Path is not a directory: "${t}"`);return Gz(e,n,r)?(Kz(e,n,!1,r),FB(e,n),oB({affectedAncestorIds:LB(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function GV(e,t){return t<0||t>=NV(e)?null:KV(e,e.snapshot.rootId,t,-1)}function KV(e,t,n,r){let i=BB(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?RR(e.snapshot.nodes,i,n):Q(a,`store.getVisibleSlice.selectChildIndex`,()=>RR(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return qV(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function qV(e,t,n,r){if(!YR(VB(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=JV(e,t,r);if(n===0)return i;let a=VB(e,i.terminalNodeId);if(!YR(a)||!Gz(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return KV(e,i.terminalNodeId,n-1,i.visibleDepth)}function JV(e,t,n){return YR(VB(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:EB(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:Q(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>EB(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function YV(e,t){let n=VB(e,t);if(!YR(n))return!0;let r=n.parentId;return r===e.snapshot.rootId?!0:TB(e,r)!==t}function XV(e,t){let n=VB(e,t.terminalNodeId);if(YR(n)){let r=BB(e,t.terminalNodeId);if(Gz(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:qV(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=VB(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=BB(e,n),o=NR(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 qV(e,s,0,i);YV(e,r)&&i--,r=n}}function ZV(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 QV(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(jV);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=MV(o,y);let x,S=_;if(YR(v))S=f?EB(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:PB(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&&YR(C)&&Gz(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 $V(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(!YR(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:PB(e,f)};continue}let h=l?EB(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=eH(e,g);let _=i[h];_!=null&&YR(_)&&Gz(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function eH(e,t){let n=VB(e,t.terminalNodeId),r=YR(n)?tH(e,t):null,i=PB(e,t.terminalNodeId),a=Cz(e.snapshot.segmentTable,n.nameId),o=YR(n)&&BB(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?DB(e,t.headNodeId).map(n=>{let r=VB(e,n);return{isTerminal:n===t.terminalNodeId,name:Cz(e.snapshot.segmentTable,r.nameId),nodeId:n,path:PB(e,n)}}):Q(c,`store.getVisibleSlice.flatten.collectSegments`,()=>DB(e,t.headNodeId).map(n=>{let r=VB(e,n);return{isTerminal:n===t.terminalNodeId,name:Cz(e.snapshot.segmentTable,r.nameId),nodeId:n,path:PB(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:YR(n)&&Gz(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:YR(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function tH(e,t){if(t.headNodeId===t.terminalNodeId)return Jz(e,t.terminalNodeId);let n=DB(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=Jz(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}function nH(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||!YR(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&&BR(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&YR(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,BR(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function rH(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var iH=class e{#e;constructor(e={}){let t=nz(e),n=Q(t,`store.builder.create`,()=>new Bz(e));if(e.preparedInput!=null){let t=Lz(e.preparedInput);t==null?n.appendPreparedPaths(Iz(e.preparedInput),!1):n.appendPresortedPaths(t,Rz(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(Q(t,`store.preparePathEntries`,()=>zz(r,e)))}let r=Q(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=Q(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=Q(t,`store.state.create`,()=>Vz(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:Q(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||rH(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&Q(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?Q(t,`store.state.initializeOpenVisibleCounts`,()=>nH(this.#e)):Q(t,`store.state.recomputeCounts`,()=>IB(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return Nz(e,t)}static prepareInput(e,t={}){return Pz(e,t)}static preparePresortedInput(e){return Fz(e)}list(e){return Q(this.#e.instrumentation,`store.list`,()=>OB(this.#e,e))}add(e){Q(this.#e.instrumentation,`store.add`,()=>{let t=NV(this.#e);hB(this.#e,pB(this.#e,t,kB(this.#e,e)))})}remove(e,t={}){Q(this.#e.instrumentation,`store.remove`,()=>{let n=NV(this.#e);hB(this.#e,pB(this.#e,n,AB(this.#e,e,t)))})}move(e,t,n={}){Q(this.#e.instrumentation,`store.move`,()=>{let r=NV(this.#e),i=jB(this.#e,e,t,n);i!=null&&hB(this.#e,pB(this.#e,r,i))})}batch(e){mB(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision});break}})}getVisibleCount(){return Q(this.#e.instrumentation,`store.getVisibleCount`,()=>NV(this.#e))}getVisibleSlice(e,t){return Q(this.#e.instrumentation,`store.getVisibleSlice`,()=>zV(this.#e,e,t))}getVisibleRowContext(e){return Q(this.#e.instrumentation,`store.getVisibleRowContext`,()=>RV(this.#e,e))}getVisibleTreeProjection(){return VV(this.#e)}getVisibleTreeProjectionData(e){return BV(this.#e,e)}getVisibleIndex(e){return Q(this.#e.instrumentation,`store.getVisibleIndex`,()=>HV(this.#e,e))}getPathInfo(e){return Q(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=RB(this.#e,e);if(t==null)return null;let n=VB(this.#e,t);return{depth:qR(n),kind:YR(n)?`directory`:`file`,path:PB(this.#e,t)}})}isExpanded(e){return Q(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=VB(this.#e,t);return Gz(this.#e,t,n)})}expand(e){Q(this.#e.instrumentation,`store.expand`,()=>{let t=NV(this.#e),n=UV(this.#e,e);n!=null&&hB(this.#e,pB(this.#e,t,n))})}collapse(e){Q(this.#e.instrumentation,`store.collapse`,()=>{let t=NV(this.#e),n=WV(this.#e,e);n!=null&&hB(this.#e,pB(this.#e,t,n))})}on(e,t){return tB(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return Jz(this.#e,t)}markDirectoryUnloaded(e){Q(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(BB(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=NV(this.#e);Xz(this.#e,t),hB(this.#e,pB(this.#e,n,sB({affectedAncestorIds:LB(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return Q(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=NV(this.#e),r=Yz(this.#e,t);return hB(this.#e,pB(this.#e,n,cB({affectedAncestorIds:LB(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return Q(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||Jz(this.#e,n)!==`loading`||!Qz(this.#e,n,e.attemptId))return!1;let r=PB(this.#e,n);this.validateChildPatch(r,t);let i=NV(this.#e),a=[];for(let e of t.operations){aH(r,e);let t=NV(this.#e);switch(e.type){case`add`:a.push(pB(this.#e,t,kB(this.#e,e.path)));break;case`remove`:a.push(pB(this.#e,t,AB(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=jB(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(pB(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return hB(this.#e,pB(this.#e,i,lB({affectedAncestorIds:LB(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:PB(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return Q(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=NV(this.#e),r=Zz(this.#e,t,e.attemptId);return hB(this.#e,pB(this.#e,n,uB({affectedAncestorIds:LB(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:PB(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return Q(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=NV(this.#e),i=$z(this.#e,n,e.attemptId,t);return hB(this.#e,pB(this.#e,r,dB({affectedAncestorIds:LB(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:PB(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return Q(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(kV(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=NV(this.#e),n=AV(this.#e,e.mode??`stable`);return hB(this.#e,pB(this.#e,t,fB({...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=BB(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??oz(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=cz(hz(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(!YR(VB(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=VB(this.#e,n);Gz(this.#e,n,i)||(Kz(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=VB(this.#e,e);if(!Gz(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=RB(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!YR(VB(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!YR(VB(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=VB(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=VB(this.#e,e),r=TB(this.#e,e);if(!Gz(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 aH(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`);break}}var oH=e=>e.startsWith(`f::`)?e.slice(3):e;function sH(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function cH(e,t){return e===``?t:`${e}/${t}`}function lH({files:e,path:t,isFolder:n,nextBasename:r}){let i=oH(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}=sH(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=cH(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 uH(e){return e.endsWith(`/`)}function dH(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 fH(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 pH(e,t){return t.includes(e)?fH(t):[e]}function mH(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 hH(e,t){return{draggedPaths:e,target:t}}function gH(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(uH(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function _H(e,t){return t.kind===`root`||t.directoryPath==null?dH(e):t.directoryPath}function vH(e,t){let n=e.map(e=>{let n=_H(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 yH(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 bH(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(!yH(iH.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 xH(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function SH(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 CH(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function wH(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 CH(e,t.path)?n?e:null:e;case`move`:return SH(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=wH(r,e,n),r==null)return null;return r}}}function TH(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function EH(e){switch(e.operation){case`add`:return{...TH(e),operation:`add`,path:e.path};case`remove`:return{...TH(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...TH(e),from:e.from,operation:`move`,to:e.to}}}function DH(e){return{...TH(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>EH(e)),operation:`batch`}}function OH(e){switch(e.operation){case`add`:case`remove`:case`move`:return EH(e);case`batch`:return DH(e);default:return null}}function kH(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function AH(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 jH(e){return AH(e).at(-1)??null}function MH(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function NH(e){return e.endsWith(`/`)}var PH=e=>e.toLowerCase();function FH(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function IH(e){return e.endsWith(`/`)?e.slice(0,-1):e}function LH(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var RH=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},zH=Symbol(`FILE_TREE_RENAME_VIEW`),BH=512,VH=512;function HH(e){return e===`top`||e===`center`?e:`nearest`}function UH(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=AH(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 WH(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:UH(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var GH=class{#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=bH({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=jH(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:HH(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<=VH){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=pH(t,n);return this.#r.canDrag?.(r)===!1?!1:(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=hH(t.draggedPaths,n);(gH(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}mH(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=hH(e.draggedPaths,t);if(gH(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=vH(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=NH(r),a=IH(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of AH(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=FH(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}[zH](){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}}#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,NH(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,NH(e)?{recursive:!0}:void 0);return}let t=NH(e),n=lH({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:IH(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(LH(n.sourcePath,t),LH(n.destinationPath,t))}#Y(e){this.#T==null||this.#E===e||(this.#E=e,this.#De())}resetPaths(e,t={}){let n=this.#H.list().length,r=this.#G,i=bH({paths:e,preparedInput:t.preparedInput},`resetPaths`,this.#e.sort),a=this.#le(i.paths,i.preparedInput,t.initialExpandedPaths),o=this.#c,s=this.#T,c=this.getSelectedPaths(),l=this.#z;this.#K?.(),this.#H=a,this.#d.clear(),this.#he();let u=c.map(e=>a.getPathInfo(e)?.path??null).filter(e=>e!=null),d=!kH(this.#B,u);this.#B=new Set(u),d&&(this.#V+=1),this.#z=l==null?null:a.getPathInfo(l)?.path??null,this.#T=s==null?null:a.getPathInfo(s)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(o,o!=null||u.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:i.paths.length,pathCountBefore:n,projectionChanged:!0,usedPreparedInput:t.preparedInput!=null,visibleCountDelta:this.#G-r})}#X(e){this.#Ie();let t=jH(e),n=MH(e,t),r=null,i=null;for(let e of this.#be()){if(jH(e)!==t)continue;let a=MH(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=AH(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=!kH(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 iH({...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 AH(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(PH),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(PH),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 AH(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:RH(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 AH(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 AH(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=WH(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,BH)),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=wH(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=wH(this.#c,e,!0),r=[...this.#B].map(t=>wH(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=wH(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return kH(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&&xH(e)&&(this.#i=null);let t=xH(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=OH(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},KH=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 qH(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 JH(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 YH(e,t){return t?`${e}/`:e}function XH(e,t=null){let n=KH(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;for(let t of e??[]){let e=qH(t.path);if(e==null)continue;let n=YH(e.path,e.isDirectory);r.set(n,t.status),t.status===`ignored`&&e.isDirectory?a.add(n):e.isDirectory&&a.delete(n);for(let t of JH(e.path))i.add(t)}return{directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}var ZH=e=>e.trim().toLowerCase(),QH=e=>e.split(`/`).at(-1)??e,$H=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 eU(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function tU(e){let t=fR(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(ZH(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 n=QH(o),s=n.toLowerCase(),c=r.get(s);if(c!=null)return eU(c,e);for(let[t,n]of a)if(s.includes(t))return eU(n,e);let l=$H(n);for(let t of l){let n=i.get(t);if(n!=null)return eU(n,e)}let u=uR(t.set,n,l);if(u!=null&&t.set!==`none`)return{name:cR(u),remappedFrom:e,token:u}}let s=n?.[e];return s==null?{name:e}:eU(s,e)}}}var nU,rU,iU,aU,oU,sU,cU,lU,uU,dU,fU={},pU=[],mU=Array.isArray,hU=pU.slice,gU=Object.assign;function _U(e){e&&e.parentNode&&e.remove()}function vU(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?hU.call(arguments,2):n),yU(e,o,r,i,null)}function yU(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??++rU,__i:-1,__u:0};return i==null&&nU.vnode!=null&&nU.vnode(a),a}function bU(e){return e.children}function xU(e,t){this.props=e,this.context=t,this.__g=0}function SU(e,t){if(t==null)return e.__?SU(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`?SU(e):null}function CU(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 CU(e)}}function wU(e){(8&e.__g||!(e.__g|=8)||!iU.push(e)||oU++)&&aU==nU.debounceRendering||((aU=nU.debounceRendering)||queueMicrotask)(TU)}function TU(){for(var e,t,n,r,i,a,o,s,c=1;iU.length;)iU.length>c&&iU.sort(sU),e=iU.shift(),c=iU.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=gU({},r)).__v=r.__v+1,nU.vnode&&nU.vnode(n),NU(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??SU(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,FU(a,n,o),n.__e!=i&&CU(n)));oU=0}function EU(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||pU,b=t.length;for(c=DU(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?fU:y[m.__i]||fU,m.__i=f,_=NU(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&RU(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=OU(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function DU(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?yU(null,o,null,null,null):mU(o)?yU(bU,{children:o},null,null,null):o.constructor==null&&o.__b>0?yU(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=kU(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=SU(s)),zU(s,s));return r}function OU(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=OU(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=SU(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function kU(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>(u?1:0)){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 AU(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function jU(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||AU(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||AU(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(cU,`$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=lU,e.addEventListener(t,a?dU:uU,a)):e.removeEventListener(t,a?dU:uU,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 MU(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=lU++;else if(t.u<n.l)return;return n(nU.event?nU.event(t):t)}}}function NU(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=nU.__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 xU(v,x),f.constructor=M,f.render=BU),b&&b.sub(f),f.props=v,f.state||={},f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=gU({},f.__s)),gU(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=nU.__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=gU({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===bU&&d.key==null&&(E=IU(d.props.children)),s=EU(e,mU(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--;)_U(a[j]);PU(t)}else t.__e=n.__e,t.__k=n.__k,e.then||PU(t);nU.__e(e,t,n)}else s=t.__e=LU(n.__e,t,n,r,i,a,o,c,l,u);return(d=nU.diffed)&&d(t),128&t.__u?void 0:s}function PU(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(PU)}function FU(e,t,n){for(var r=0;r<n.length;r++)RU(n[r],n[++r],n[++r]);nU.__c&&nU.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){nU.__e(e,t.__v)}})}function IU(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:mU(e)?e.map(IU):gU({},e)}function LU(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&&=(nU.__m&&nU.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=hU.call(e.childNodes),v=n.props||fU,!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;jU(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&&!_||jU(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=``),EU(b==`template`?e.content:e,mU(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&SU(n,0),s,c,l),a!=null)for(u=a.length;u--;)_U(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||jU(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&jU(e,u,g,v[u],i))}return e}function RU(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){nU.__e(e,n)}}function zU(e,t,n){var r,i;if(nU.unmount&&nU.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||RU(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){nU.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&zU(r[i],t,n||typeof e.type!=`function`);n||_U(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function BU(e,t,n){return this.constructor(e,n)}function VU(e,t){var n,r,i,a;t==document&&(t=document.documentElement),nU.__&&nU.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=vU(bU,null,[e]),i=[],a=[],NU(t,e,r||fU,fU,t.namespaceURI,r?null:t.firstChild?hU.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),FU(i,e,a)}function HU(e,t){e.__u|=32,VU(e,t)}nU={__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 oU=0,e}},rU=0,xU.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=gU({},this.state);typeof e==`function`&&(e=e(gU({},n),this.props)),e&&gU(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),wU(this))},xU.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),wU(this))},xU.prototype.render=bU,iU=[],oU=0,sU=function(e,t){return e.__v.__b-t.__v.__b},cU=/(PointerCapture)$|Capture$/i,lU=0,uU=MU(!1),dU=MU(!0);var UU=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:--UU,__i:-1,__u:0,__source:i,__self:a};return nU.vnode&&nU.vnode(l),l}var WU=16,GU=16,KU={};function qU({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}=KU[e]??{width:WU,height:GU},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`,h=o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`};return $(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...h,viewBox:m,width:f,height:p,children:$(`use`,{href:c})})}var JU=e=>{if(e.length<2)return[e,``];let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]},YU=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},XU=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)]},ZU=(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)]},QU=(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)]},$U=(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 eW({children:e,marker:t,variant:n=`default`}){"use no memo";let r=n===`fade`;return $(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:$(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):r?$(`span`,{"data-truncate-fade":!0}):t})})}function tW(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 nW({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=$(tW,{mode:t,children:e},`content`),o=$(eW,{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 rW({children:e,...t}){"use no memo";return $(nW,{mode:`truncate`,...t,children:e})}function iW({children:e,...t}){"use no memo";return $(nW,{mode:`fruncate`,...t,children:e})}function aW({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=$(rW,{...s,children:t[0]}),l=$(iW,{...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`?iW:rW,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=JU:r===`extension`?t=YU:r===`leaf-path`&&(t=XU);else if(typeof r==`number`)t=ZU,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=QU:e===`first`&&(t=$U)}else typeof r==`function`&&(t=r);t??=JU;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=$(rW,{...s,..._,children:f}),l=$(iW,{...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 oW={endIndex:-1,startIndex:-1};function sW(e,t,n){return Math.min(Math.max(e,t),n)}function cW(e,t){return e<0||t<e?oW:{endIndex:t,startIndex:e}}function lW(e){return e.startIndex<0||e.endIndex<e.startIndex}function uW(e,t){return lW(e)?0:(e.endIndex-e.startIndex+1)*t}function dW(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function fW(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function pW(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 mW(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 hW(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 gW(e,t,n){if(e.length===0||t<=0)return[];let r=hW(e),i=pW(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=mW(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 _W(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=sW(t.scrollTop,0,o),c=t.stickyRows??gW(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=dW(s,n,t.itemHeight),m=dW(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?oW:cW(m,fW(u+d,n,t.itemHeight)),y=g+1,b=lW(v)?oW:cW(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=uW(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:lW(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var vW={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},yW={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},bW=`Contains git status items`;function xW(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 SW(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return xW({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 CW(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 wW(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 TW(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 EW(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function DW(e,t){return e!=null&&e>0?e:t}function OW(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 kW(e,t,n,r,i=0){let a=xW({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a==null?!1:(e.scrollTop=a,!0)}function AW(e,t,n,r,i,a,o=0){let s=SW({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s==null?!1:(e.scrollTop=s,!0)}function jW(e,t,n,r,i,a){let o=CW({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o==null?!1:(e.scrollTop=o,!0)}function MW(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function NW(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function PW({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 FW(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 IW(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 LW,RW,zW,BW,VW=Object.is,HW=0,UW=[],WW=nU,GW=WW.__b,KW=WW.__r,qW=WW.diffed,JW=WW.__c,YW=WW.unmount,XW=WW.__;function ZW(e,t){WW.__h&&WW.__h(RW,e,HW||t),HW=0;var n=RW.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function QW(e){return HW=1,$W(dG,e)}function $W(e,t,n){var r=ZW(LW++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):dG(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);VW(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=RW,!RW.__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,VW(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};RW.__f=!0;var a=RW.shouldComponentUpdate,o=RW.componentWillUpdate;RW.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)},RW.shouldComponentUpdate=i}return r.__N||r.__}function eG(e,t){var n=ZW(LW++,3);!WW.__s&&uG(n.__H,t)&&(n.__=e,n.u=t,RW.__H.__h.push(n))}function tG(e,t){var n=ZW(LW++,4);!WW.__s&&uG(n.__H,t)&&(n.__=e,n.u=t,RW.__h.push(n))}function nG(e){return HW=5,rG(function(){return{current:e}},[])}function rG(e,t){var n=ZW(LW++,7);return uG(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function iG(e,t){return HW=8,rG(function(){return e},t)}function aG(){for(var e;e=UW.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(cG),e.__H.__h.forEach(lG),e.__H.__h=[]}catch(t){e.__H.__h=[],WW.__e(t,e.__v)}}WW.__b=function(e){RW=null,GW&&GW(e)},WW.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),XW&&XW(e,t)},WW.__r=function(e){KW&&KW(e),LW=0;var t=(RW=e.__c).__H;t&&(zW===RW?(t.__h=[],RW.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(cG),t.__h.forEach(lG),t.__h=[],LW=0)),zW=RW},WW.diffed=function(e){qW&&qW(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(UW.push(t)!==1&&BW===WW.requestAnimationFrame||((BW=WW.requestAnimationFrame)||sG)(aG)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),zW=RW=null},WW.__c=function(e,t){t.some(function(e){try{e.__h.forEach(cG),e.__h=e.__h.filter(function(e){return!e.__||lG(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],WW.__e(n,e.__v)}}),JW&&JW(e,t)},WW.unmount=function(e){YW&&YW(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{cG(e)}catch(e){t=e}}),n.__H=void 0,t&&WW.__e(t,n.__v))};var oG=typeof requestAnimationFrame==`function`;function sG(e){var t,n=function(){clearTimeout(r),oG&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);oG&&(t=requestAnimationFrame(n))}function cG(e){var t=RW,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),RW=t}function lG(e){var t=RW;e.__c=e.__(),RW=t}function uG(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!VW(t,e[n])})}function dG(e,t){return typeof t==`function`?t(e):t}function fG(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 $(bU,{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:$(rW,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function pG(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function mG(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function hG(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 gG({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=_W(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:hG(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?hG(u,1,t,o):i&&r<=0&&c.length>0?gW(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 _G=400,vG=10,yG=40,bG=18;function xG(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))?SG(e,t,n):a instanceof HTMLElement?a:null}function SG(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 CG(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 wG(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 TG(){return navigator.vendor!==`Apple Computer, Inc.`}function EG(e,t){let n=e-t.top;if(n<yG)return-Math.ceil((yG-Math.max(0,n))/yG*bG);let r=t.bottom-e;return r<yG?Math.ceil((yG-Math.max(0,r))/yG*bG):0}function DG(e,t){if(e!=null){let t=vW[e];return t==null?null:{text:t,title:yW[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:bW}:null}function OG(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 kG(e){return e!=null&&`toggle`in e}function AG(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function jG(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function MG(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function NG(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function PG(e,t){return t&&NG(e)||(e.ctrlKey||e.metaKey)&&AG(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var FG=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function IG(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 LG(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 RG(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function zG(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function BG(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function VG(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 HG(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 UG(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 WG(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=UG(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 GG(e,t){return{kind:e.kind,name:mG(e),path:t}}function KG(e){return e==null?void 0:`${e}__tree`}function qG(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function JG(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function YG(e,t){if(e==null)return null;if(`text`in e)return $(`span`,{title:e.title,children:e.text});let n=typeof e.icon==`string`?JG(e.icon)?t(e.icon):{name:e.icon}:JG(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:$(qU,{...n})})}function XG(e){e!=null&&wW(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function ZG(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=pG(e);return $(bU,{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`?$(qU,{...t(`file-tree-icon-chevron`)}):$(qU,{...t(`file-tree-icon-file`,u)})}),$(`div`,{"data-item-section":`content`,children:e.isFlattened?fG(e,c,a):c??$(aW,{minimumLength:5,split:`extension`,children:e.name})}),i?$(`div`,{"data-item-section":`decoration`,children:r==null?null:YG(r,t)}):null,s?$(`div`,{"data-item-section":`git`,children:YG(o,t)}):null,n?$(`div`,{"data-item-section":`action`,children:l?$(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:$(qU,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function QG(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=pG(t),{isParked:F=!1,mode:I=`flow`,style:L}=r,R=I===`sticky`,z=_?.get(P)??null??OG(t.ancestorPaths,v,y),ee=t.kind===`directory`&&(b?.has(P)??!1),te=A(t,P),B=DG(z,ee),V=S&&w,H=te!=null||x||V,ne=V&&T===`always`,re=a.getPath()===P,ie=re?a.getValue():``,ae=R||!re?null:$(PW,{ref:D,ariaLabel:`Rename ${mG(t)}`,isFlattened:t.isFlattened,value:ie,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),oe=ZG(t,k,{actionLaneEnabled:V,customDecoration:te,decorationLaneEnabled:H,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:B,gitLaneActive:x,renameInput:ae,showDecorativeActionAffordance:ne}),se={...FW({ariaLabel:mG(t),domId:t.isFocused?qG(h,P,F):void 0,extraStyle:L,features:{actionLaneEnabled:V,contextMenuButtonVisibility:V?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:F,itemHeight:g,mode:I,row:t,state:{containsGitChange:ee,effectiveGitStatus:z,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:RG(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:R?void 0:()=>{i.focusMountedPathFromInput(P)},onKeyDown:R?void 0:N,ref:e=>{O(P,e)}};return!R&&re?$(`div`,{...se,children:oe}):$(`button`,{...se,type:`button`,draggable:u&&!F,onDragEnd:u&&!F?p:void 0,onDragStart:u&&!F?e=>{f(e,t,P)}:void 0,onMouseDown:e=>{if(R){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:oe})}function $G(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(pG(e))).map((n,r)=>QG(e,n,t.start+r))}function eK({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=hR,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 _=nG(null),v=nG(null),y=nG(!1),b=nG(null),x=nG(null),S=nG(null),C=nG(null),w=nG(null),T=nG(new Map),E=nG(new Map),D=nG(()=>{}),O=nG(null),k=nG(0),A=nG(!1),j=nG(null);j.current!==t&&(A.current=!1,j.current=t);let M=nG(!1),N=nG(null),P=nG(null),F=nG(!1),I=nG(null),L=nG(null),R=nG(null),z=nG(null),ee=nG(null),te=nG(null),B=nG(null),V=nG(null),H=nG(!1),ne=nG(null),re=nG(null),ie=nG(null),ae=nG(null),oe=rG(()=>new Map,[]),[,se]=QW(0),[ce,le]=QW(null),[ue,U]=QW(null),[de,fe]=QW(null),[pe,me]=QW(null),[he,ge]=QW(0),[_e,ve]=QW(null),ye=nG(_e);ye.current=_e;let be=nG(null),xe=nG(null),Se=nG(null),Ce=nG(null),we=nG(null),Te=nG(!1),Ee=()=>{xe.current=null,Se.current=null,Ce.current=null},De=(e,t)=>{xe.current=e,Se.current=null,Ce.current=t==null?null:{path:e,scrollTop:t}},Oe=(e,t)=>{xe.current=null,Se.current={path:e,viewportOffset:t},Ce.current=null},ke=nG(d===`retain`&&t.isSearchOpen()),[Ae,je]=QW(p);eG(()=>{p||je(!1)},[p]);let Me=nG(!1),Ne=iG(()=>{Me.current=!0,je(e=>e&&!1)},[]),[Pe,Fe]=QW(()=>gG({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[Ie,Le]=QW(!1);eG(()=>{Le(!0)},[]);let Re=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,ze=e?.contextMenu?.triggerMode??(Re?`right-click`:`both`),W=ze===`both`||ze===`button`,G=e?.contextMenu?.buttonVisibility??`when-needed`,Be=ze===`both`||ze===`right-click`;tG(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;we.current=t,U(t),me(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(Te.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 Ve=iG((e,t)=>{BG(T.current,e,t)},[]),He=iG((e,t)=>{BG(E.current,e,t)},[]),Ue=iG(e=>{x.current=e},[]),We=iG(e=>VG(e,E.current,T.current),[]),Ge=n!=null||r!=null||i!=null,{resolveIcon:Ke}=rG(()=>tU(a),[a]),qe=t[zH](),Je=qe.getPath(),Ye=Je!=null,Xe=t.isSearchOpen(),Ze=t.getSearchValue(),Qe=t.getFocusedPath(),$e=t.getFocusedIndex(),et=t.getScrollRequest(),tt=t.isDragAndDropEnabled(),nt=t.getDragSession(),rt=rG(()=>nt==null?null:new Set(nt.draggedPaths),[nt]),it=nt?.target??null,at=nt?.primaryPath??null,ot=KG(o),{overlayHeight:st,overlayRows:ct,snapshot:lt,visibleRows:ut}=Pe,dt=lt.physical.viewportHeight,ft=rG(()=>({end:lt.window.endIndex,start:lt.window.startIndex}),[lt.window.endIndex,lt.window.startIndex]),pt=ct,mt=lt.sticky.rows,ht=lt.physical.totalHeight,gt=lt.sticky.height,_t=rG(()=>new Set(mt.map(e=>pG(e.row))),[mt]),vt=$e>=0&&$e>=ft.start&&$e<=ft.end,yt=iG((e,t)=>u?.({item:GG(e,t),row:e})??null,[u]),bt=iG(e=>wW(e==null?null:T.current.get(e)??null)?!0:wW(S.current),[]),xt=iG(e=>{bt(t.focusNearestPath(e))},[t,bt]),St=nG(xt);St.current=xt;let Ct=nG(!0),wt=nG(()=>{}),Tt=iG((t=!0)=>{let n=ye.current;n!=null&&(Ct.current=Ct.current&&t,ve(null),e?.contextMenu?.onClose?.(),Ct.current&&xt(n.path))},[e?.contextMenu,xt]);wt.current=Tt;let Et=iG(e=>{let t=e==null?null:zG(S.current,e);fe(e=>e===t?e:t)},[]),Dt=iG((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=We(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;De(n,e?.scrollTop??null),M.current=!0,le(e=>e===n?e:n)}i.focus(),Et(a),Ct.current=!0,ve({anchorRect:r?.anchorRect??null,item:GG(e,n),path:n,source:r?.source??`keyboard`})},[t,We,Et]),Ot=iG(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=EW(e,dt);I.current=$e<0||e==null?null:Math.max(0,Math.min($e*s-e.scrollTop,Math.max(0,t-s))),F.current=!0}t.startRenaming(e)!==!1&&(me(`focus`),se(e=>e+1))}},[t,$e,s,l,dt]),kt=iG((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=EW(i,dt),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:gG({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return M.current=!0,jW(i,a,s,l,u,d),D.current(),be.current=n?e:null,!0},[t,s,c,dt,h]),At=()=>y.current===!0||ae.current!=null||H.current===!0,jt=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Mt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Nt=()=>{z.current!=null&&(clearTimeout(z.current),z.current=null),R.current=null},K=()=>{te.current?.remove(),te.current=null},Pt=()=>{Mt(L.current),L.current=null,ee.current=null},Ft=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},It=()=>{V.current?.(),V.current=null,ae.current!=null&&(clearTimeout(ae.current),ae.current=null),H.current=!1,ne.current=null,ie.current=null,re.current!=null&&(re.current.setAttribute(`draggable`,`true`),re.current.style.removeProperty(`touch-action`),re.current=null),K(),Nt(),Pt(),B.current=null},Lt=(e,n)=>{let r=S.current?.getRootNode(),i=CG(xG(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Rt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Nt();return}let r=t.getItem(e.directoryPath),i=kG(r)?r:null;if(i==null||i.isExpanded()){Nt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;R.current!==a&&(Nt(),R.current=a,z.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind!==`directory`||n.directoryPath!==e.directoryPath||n.flattenedSegmentPath!==e.flattenedSegmentPath||i.expand()},n))},zt=()=>{L.current=null;let e=ee.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=EG(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()),Rt(Lt(e.clientX,e.clientY)),L.current=jt(zt)},Bt=(e,t)=>{ee.current={clientX:e,clientY:t},L.current??=jt(zt)},Vt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(It(),K(),Nt(),Pt(),t.startDrag(r)===!1){e.preventDefault();return}if(B.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),TG())){let t=wG(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Ft(t),te.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Ht=()=>{K(),Nt(),Pt(),B.current=null,t.cancelDrag()},Ut=(e,n,r)=>{if(ae.current!=null||H.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;ie.current={clientX:i.clientX,clientY:i.clientY},re.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!H.current;ae.current!=null&&(clearTimeout(ae.current),ae.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),V.current===o&&(V.current=null),t&&(a.setAttribute(`draggable`,`true`),re.current===a&&(re.current=null),ie.current=null)},s=e=>{let t=e.touches[0],n=ie.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=vG*vG||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),V.current=o,ae.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),re.current===a&&(re.current=null),ie.current=null;return}H.current=!0,re.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),B.current=n;let e=a.getBoundingClientRect(),s=wG(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`}),Ft(s),te.current=s,ne.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=ne.current;n!=null&&te.current!=null&&(te.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Rt(Lt(t.clientX,t.clientY)),Bt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Lt(n.clientX,n.clientY),t.completeDrag(),It()},u=()=>{t.cancelDrag(),It()};V.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)},_G)},Wt=e=>{if(_e!=null){if(e.key===`Escape`){Tt(),e.preventDefault(),e.stopPropagation();return}FG.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(qe.isActive()){if(e.key===`Escape`)qe.cancel();else if(e.key===`Enter`)qe.commit();else return;me(`focus`),se(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Ot(Qe??void 0),e.preventDefault(),e.stopPropagation();return}if(Xe){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=EW(n,dt);I.current=$e<0||n==null?null:Math.max(0,Math.min($e*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;me(`focus`),se(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&jG(e)){t.openSearch(e.key),se(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Re&&NG(e),r=PG(e,Re),i=r&&S.current!=null?TW(S.current):null,a=r?new Set(HG(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==Qe&&a.has(o)){let e=C.current;De(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=kG(p)?p:null,h=u!=null&&(_t.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=VG(u,E.current,T.current);e==null||n==null?y=!1:Dt(e,u)}else if((e.ctrlKey||e.metaKey)&&AG(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;me(`focus`);let b=t.getFocusedPath(),x=b!=null&&(_t.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))De(b,v?.scrollTop??null),M.current=!0,le(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(Oe(b,WG(S.current,v,i,u,s,gt,dt)),M.current=!0,le(e=>e===b?e:b)):Ee()}se(e=>e+1),e.preventDefault(),e.stopPropagation()};tG(()=>{if(!(!f||!Xe)){if(ke.current){ke.current=!1;return}wW(w.current)}},[Xe,f]),tG(()=>{let e=x.current;switch(NW({hasRenderedInput:e!=null,previousRenamingPath:P.current,renamingPath:Je})){case`reset`:P.current=null;return;case`reveal-canonical`:Je!=null&&kt(Je,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(be.current=null,P.current=Je,wW(e),e.select());return}},[ft.end,ft.start,Je,kt,_t]),tG(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=TW(e)?.dataset.itemPath??null;le(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,TW(e)!=null){r();return}M.current=!1,le(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),M.current=!1,le(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;le(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),tG(()=>{let e=S.current;e!=null&&(lt.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[lt.physical.scrollTop]),tG(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=EW(n,g);let a=()=>{let e=t.getVisibleCount(),r=DW(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Fe(gG({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=DW(O.current,g),i=t.getVisibleRows(e,e)[0]??null;kW(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=!1,l=t.subscribe(()=>{o?se(e=>e+1):o=!0,a()}),u=()=>{Te.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,ge(e=>e+1),e=null},50))},d=null,f=()=>{i!=null&&delete i.dataset.overlayReveal,d!=null&&(clearTimeout(d),d=null)},p=()=>{i==null||Te.current===!0||n.scrollTop>0||(i.dataset.overlayReveal=`true`,d!=null&&clearTimeout(d),d=setTimeout(()=>{f()},200))},m=()=>{if(a(),n.scrollTop>0&&f(),ye.current!=null&&y.current&&wt.current(),Te.current===!0){y.current=!1;return}U(e=>e==null?e:null),u()},_=()=>{u(),p()},v=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),x=e=>{v.has(e.key)&&_()};n.addEventListener(`scroll`,m,{passive:!0}),n.addEventListener(`wheel`,_,{passive:!0}),n.addEventListener(`touchmove`,_,{passive:!0}),n.addEventListener(`keydown`,x);let w=typeof ResizeObserver<`u`?new ResizeObserver(e=>{O.current=(e[0]==null?null:OW(e[0]))??EW(n,g),a()}):null;return w?.observe(n),()=>{D.current=()=>{},l(),n.removeEventListener(`scroll`,m),n.removeEventListener(`wheel`,_),n.removeEventListener(`touchmove`,_),n.removeEventListener(`keydown`,x),e!=null&&clearTimeout(e),d!=null&&clearTimeout(d),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,O.current=null,w?.disconnect()}},[t,g,s,c,h]),tG(()=>{Re||_e==null||Tt(!1)},[Tt,Re,_e]);let Gt=rG(()=>_e==null?null:`${_e.path}::${_e.source}`,[_e]);tG(()=>{if(Gt==null){m?.clearSlotContent(WI);return}let t=ye.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??LG(n.getBoundingClientRect()),close:e=>{wt.current(e?.restoreFocus??!0)},restoreFocus:()=>{Ct.current&&St.current(ye.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(WI,i),e?.contextMenu?.onOpen?.(t.item,r),XG(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&XG(i)}),()=>{m?.clearSlotContent(WI)}},[Gt,e?.contextMenu,m]),tG(()=>{_e!=null&&t.getItem(_e.path)==null&&Tt()},[Tt,_e,t]),tG(()=>{if(_e==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(IG(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Tt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Tt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Tt,_e]),tG(()=>{let e=C.current,n=S.current;if(e==null||n==null){N.current=Qe;return}let r=Qe==null?null:T.current.get(Qe)??null,i=TW(n),a=i?.dataset.itemPath??null,o=Ye&&x.current===i,c=f&&w.current===i,l=F.current&&!Xe,u=I.current??0,d=be.current,p=xe.current,m=Se.current,g=Ce.current,_=i!=null,v=M.current||_,y=N.current!==Qe,b=p!=null&&p===Qe&&Qe!=null,E=!1,O=!1;if(et!=null&&et.id!==k.current){k.current=et.id;let n=et.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,dt-s))):gt;E=!0,O=AW(e,n,s,dt,ht,et.offset,t)}t.clearScrollRequest(et.id)}let A=!E&&l&&jW(e,$e,s,dt,ht,u),j=!E&&d!=null&&d===Qe&&jW(e,$e,s,dt,ht,gt),P=!E&&m!=null&&m.path===Qe&&jW(e,$e,s,dt,ht,m.viewportOffset),L=!E&&g!=null&&g.path===Qe&&e.scrollTop!==g.scrollTop;if(L&&(e.scrollTop=g.scrollTop),(L||O||j||P||A||v&&y&&d!==Qe&&!b&&kW(e,$e,s,dt,gt))&&D.current(),E){N.current=Qe;return}if(!v){N.current=Qe;return}if(o){N.current=Qe;return}if(c&&!l){N.current=Qe;return}if(r==null){l&&$e>=0&&(jW(e,$e,s,dt,ht,u),D.current()),N.current=Qe;return}(y||l||d===Qe||p===Qe||m?.path===Qe||g?.path===Qe||a==null||a!==Qe)&&(wW(r),d===Qe&&(be.current=null),p===Qe&&(xe.current=null),m?.path===Qe&&(Se.current=null),g?.path===Qe&&(Ce.current=null),F.current=!1,I.current=null),N.current=Qe},[t,$e,Qe,vt,s,Ye,Xe,ft,dt,f,et,h,gt,ht,ut]);let Kt=$e>=0&&$e>=lt.visible.startIndex&&$e<=lt.visible.endIndex,qt=Qe!=null&&pt.some(e=>pG(e.row)===Qe),Jt=Kt||qt,Yt=W&&M.current===!0&&Jt?Qe:null,Xt=pe===`pointer`?ue:null,Zt=_e?.path??we.current??Xt??Yt??ue,Qt=_e?.source===`right-click`;tG(()=>{y.current&&_e==null||Et(We(Zt))},[_e,We,ft,dt,he,pt,Zt,Et,ut]);let $t=iG(e=>{if(y.current||IG(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&&me(e=>e===`pointer`?e:`pointer`),U(e=>e===i?e:i)},[]),en=iG(()=>{U(null)},[]);tG(()=>{if(!tt)return;let e=()=>{It(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),It(),t.cancelDrag()}},[t,tt]);let tn=e=>{if(!tt||t.getDragSession()==null||H.current)return;let n=CG(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Rt(t.getDragSession()?.target??null),Bt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},nn=e=>{if(!tt||t.getDragSession()==null||H.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Nt(),Pt(),t.setDragTarget(null))},rn=e=>{!tt||t.getDragSession()==null||H.current||(e.preventDefault(),Lt(e.clientX,e.clientY),t.completeDrag(),K(),Nt(),Pt(),B.current=null)},an=lt.window.height,on=lt.window.offsetTop,sn=Math.min(0,dt-an),cn=Math.min(0,dt-an-gt),ln=ce===Qe||F.current,un=Qe!=null&&ln&&!vt&&$e>=0?ut[$e]??t.getVisibleRows($e,$e)[0]??null:null,dn=un==null?null:MW($e,s,ft,an),fn=B.current,pn=at!=null&&fn!=null&&fn.path===at&&fn.index>=ft.start&&fn.index<=ft.end,mn=at!=null&&fn!=null&&fn.path===at&&!pn&&fn.path!==un?.path?fn:null,hn=mn==null?null:MW(mn.index,s,ft,an),gn=MG(($e>=0?ut[$e]??t.getVisibleRows($e,$e)[0]??null:null)?.ancestorPaths.at(-1)??null),_n=Xe&&Qe!=null?qG(o,Qe,!vt):void 0,vn=_e?.path??(Xe?Qe:ce),yn=_e?.path??ue,bn=We(Zt),xn=Re&&W&&!Qt&&!Ye&&bn!=null&&de!=null&&Zt!=null,Sn=Re&&(xn||_e!=null),Cn=_e?.anchorRect,wn=Cn==null&&bn!=null&&de!=null&&(_e!=null||xn)?de:null,Tn=Cn==null?wn==null?void 0:{top:`${wn}px`}:{left:`${Cn.left}px`,position:`fixed`,right:`auto`,top:`${Cn.top}px`},En=Qt?{opacity:`0`}:void 0,Dn=iG((e,n,r,i)=>{let a=IW({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:Xe,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c);break}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=lt.visible.startIndex&&n.index<=lt.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(M.current=!0,le(e=>e===c?e:c),me(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&kt(c,{targetOffset:`sticky-parents`})},[t,Xe,lt.visible.endIndex,lt.visible.startIndex,kt]),On=()=>{if(y.current||!W||Zt==null||bn==null)return;let e=t.getItem(Zt);e!=null&&(Et(bn),Ct.current=!0,ve({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:bn.getAttribute(`aria-label`)??Zt,path:e.getPath()},path:e.getPath(),source:`button`}))},kn={contextHoverPath:yn,contextMenuButtonTriggerEnabled:W,contextMenuButtonVisibility:G,contextMenuEnabled:Re,contextMenuRightClickEnabled:Be,contextMenuTriggerMode:ze,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:tt,draggedPathSet:rt,dragTarget:it,gitLaneActive:Ge,gitStatusByPath:n,handleRowDragEnd:Ht,handleRowDragStart:Vt,handleRowTouchStart:Ut,ignoredGitDirectories:r,ignoredInheritanceCache:oe,instanceId:o,itemHeight:s,onKeyDown:Wt,onRowClick:Dn,openContextMenuForRow:Dt,registerButton:Ve,registerRenameInput:Ue,renameView:qe,renderDecorationForRow:yt,resolveIcon:Ke,shouldSuppressContextMenu:At,visualFocusPath:vn},An={...kn,registerButton:He};return $(`div`,{ref:S,id:ot,"data-file-tree-context-menu-button-visibility":Re&&W?G:void 0,"data-file-tree-context-menu-trigger-mode":Re?ze:void 0,"data-file-tree-has-context-menu-action-lane":Re&&W?`true`:void 0,"data-file-tree-has-git-lane":Ge?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:tt?nn:void 0,onDragOver:tt?tn:void 0,onDrop:tt?rn:void 0,onKeyDown:Wt,onPointerLeave:Re?en:void 0,onPointerOver:Re?$t:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[$(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:gn}}),$(`slot`,{name:UI,"data-type":`header-slot`}),f?$(`div`,{"data-file-tree-search-container":!0,"data-open":Xe?`true`:`false`,children:$(`input`,{ref:w,"aria-activedescendant":_n,"aria-controls":ot,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ae?`true`:void 0,value:Ze,onBlur:()=>{d===`retain`&&!Me.current||t.closeSearch()},onFocus:Ne,onPointerDown:Ne,onInput:e=>{Ne();let n=e.currentTarget;t.setSearch(n.value)}})}):null,$(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&Ie&&pt.length>0?$(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:$(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${st}px`},children:pt.map((e,t)=>QG(An,e.row,`sticky:${pG(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${pt.length-t}`}}))})}):null,$(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${ht}px`},children:[$(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${on}px`}}),$(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${an}px`,top:`${sn}px`,bottom:`${cn}px`},children:[$G(kn,ft,_t),un!=null&&dn!=null?QG(kn,un,`parked:${un.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:at===un.path?`none`:void 0,position:`absolute`,right:`0`,top:`${dn}px`}}):null,mn!=null&&hn!=null?QG(kn,mn,`parked-drag:${mn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${hn}px`}}):null]})]})]}),Re?$(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":Sn?`true`:`false`,style:Tn,children:[$(`button`,{ref:v,type:`button`,"data-type":GI,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":_e==null?`false`:`true`,"data-visible":xn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),_e!=null){Tt();return}On()},tabIndex:-1,style:En,children:$(qU,{...Ke(`file-tree-icon-ellipsis`)})}),_e==null?null:$(`slot`,{name:WI})]}):null,_e==null?null:$(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Tt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Tt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var tK={hydrateRoot:(e,t)=>{HU(vU(eK,t),e)},renderRoot:(e,t)=>{VU(vU(eK,t),e)},unmountRoot:e=>{VU(null,e)}};function nK(e,t){tK.renderRoot(e,t)}function rK(e,t){tK.hydrateRoot(e,t)}function iK(e){tK.unmountRoot(e)}var aK=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)}}},oK=`__c`,sK=`__k`,cK=`__d`,lK=`__s`,uK=/[\s\n\\/='"\0<>]/,dK=/^(xlink|xmlns|xml)([A-Z])/,fK=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,pK=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,mK=new Set([`draggable`,`spellcheck`]);function hK(e){e.__g===void 0?e[cK]=!0:e.__g|=8}function gK(e){e.__g===void 0?e[cK]=!1:e.__g&=-9}function _K(e){return e.__g===void 0?!0===e[cK]:!!(8&e.__g)}var vK=/["&<]/;function yK(e){if(e.length===0||!1===vK.test(e))return e;for(var t=0,n=0,r=``,i=``;n<e.length;n++){switch(e.charCodeAt(n)){case 34:i=`&quot;`;break;case 38:i=`&amp;`;break;case 60:i=`&lt;`;break;default:continue}n!==t&&(r+=e.slice(t,n)),r+=i,t=n+1}return n!==t&&(r+=e.slice(t,n)),r}var bK={},xK=new Set(`animation-iteration-count.border-image-outset.border-image-slice.border-image-width.box-flex.box-flex-group.box-ordinal-group.column-count.fill-opacity.flex.flex-grow.flex-negative.flex-order.flex-positive.flex-shrink.flood-opacity.font-weight.grid-column.grid-row.line-clamp.line-height.opacity.order.orphans.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.widows.z-index.zoom`.split(`.`)),SK=/[A-Z]/g;function CK(e){var t=``;for(var n in e){var r=e[n];if(r!=null&&r!==``){var i=n[0]==`-`?n:bK[n]||(bK[n]=n.replace(SK,`-$&`).toLowerCase()),a=`;`;typeof r!=`number`||i.startsWith(`--`)||xK.has(i)||(a=`px;`),t=t+i+`:`+r+a}}return t||void 0}function wK(){this.__d=!0}function TK(e,t){return{__v:e,context:t,props:e.props,setState:wK,forceUpdate:wK,__d:!0,__h:[]}}function EK(e,t,n){if(!e.s){if(n instanceof DK){if(!n.s)return void(n.o=EK.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(EK.bind(null,e,t),EK.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var DK=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{EK(r,1,a(this.v))}catch(e){EK(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?EK(r,1,t?t(i):i):n?EK(r,1,n(i)):EK(r,2,i)}catch(e){EK(r,2,e)}},r},e}(),OK,kK,AK,jK,MK={},NK=Array.isArray,PK=Object.assign,FK=``,IK=`<!--$s-->`,LK=`<!--/$s-->`;function RK(e,t){var n,r=e.type,i=!0;return e[oK]?(i=!1,(n=e[oK]).state=n[lK]):n=new r(e.props,t),e[oK]=n,n.__v=e,n.props=e.props,n.context=t,hK(n),n.state??=MK,n[lK]??(n[lK]=n.state),r.getDerivedStateFromProps?n.state=PK({},n.state,r.getDerivedStateFromProps(n.props,n.state)):i&&n.componentWillMount?(n.componentWillMount(),n.state=n[lK]===n.state?n.state:n[lK]):!i&&n.componentWillUpdate&&n.componentWillUpdate(),AK&&AK(e),n.render(n.props,n.state,t)}function zK(e,t,n,r,i,a,o){if(e==null||!0===e||!1===e||e===FK)return FK;var s=typeof e;if(s!=`object`)return s==`function`?FK:s==`string`?yK(e):e+FK;if(NK(e)){var c,l=FK;i[sK]=e;for(var u=e.length,d=0;d<u;d++){var f=e[d];if(f!=null&&typeof f!=`boolean`){var p,m=zK(f,t,n,r,i,a,o);typeof m==`string`?l+=m:(c||=Array(u),l&&c.push(l),l=FK,NK(m)?(p=c).push.apply(p,m):c.push(m))}}return c?(l&&c.push(l),c):l}if(e.constructor!==void 0)return FK;e.__=i,OK&&OK(e);var h=e.type,g=e.props;if(typeof h==`function`){var _,v,y,b=t;if(h===bU){if(`tpl`in g){for(var x=FK,S=0;S<g.tpl.length;S++)if(x+=g.tpl[S],g.exprs&&S<g.exprs.length){var C=g.exprs[S];if(C==null)continue;typeof C!=`object`||C.constructor!==void 0&&!NK(C)?x+=C:x+=zK(C,t,n,r,e,a,o)}return x}if(`UNSTABLE_comment`in g)return`<!--`+yK(g.UNSTABLE_comment)+`-->`;v=g.children}else{if((_=h.contextType)!=null){var w=t[_.__c];b=w?w.props.value:_.__}var T=h.prototype&&typeof h.prototype.render==`function`;if(T)v=RK(e,b),y=e[oK];else{e[oK]=y=TK(e,b);for(var E=0;_K(y)&&E++<25;){gK(y),AK&&AK(e);try{v=h.call(y,g,b)}catch(t){throw a&&t&&typeof t.then==`function`&&(e._suspended=!0),t}}hK(y)}if(y.getChildContext!=null&&(t=PK({},t,y.getChildContext())),T&&nU.errorBoundaries&&(h.getDerivedStateFromError||y.componentDidCatch)){v=v!=null&&v.type===bU&&v.key==null&&v.props.tpl==null?v.props.children:v;try{return zK(v,t,n,r,e,a,!1)}catch(i){return h.getDerivedStateFromError&&(y[lK]=h.getDerivedStateFromError(i)),y.componentDidCatch&&y.componentDidCatch(i,MK),_K(y)?(v=RK(e,t),(y=e[oK]).getChildContext!=null&&(t=PK({},t,y.getChildContext())),zK(v=v!=null&&v.type===bU&&v.key==null&&v.props.tpl==null?v.props.children:v,t,n,r,e,a,o)):FK}finally{kK&&kK(e),jK&&jK(e)}}}v=v!=null&&v.type===bU&&v.key==null&&v.props.tpl==null?v.props.children:v;try{var D=zK(v,t,n,r,e,a,o);return kK&&kK(e),nU.unmount&&nU.unmount(e),e._suspended?typeof D==`string`?IK+D+LK:NK(D)?(D.unshift(IK),D.push(LK),D):D.then(function(e){return IK+e+LK}):D}catch(i){if(!a&&o&&o.onError){var O=function i(s){return o.onError(s,e,function(e,s){try{return zK(e,t,n,r,s,a,o)}catch(e){return i(e)}})}(i);if(O!==void 0)return O;var k=nU.__e;return k&&k(i,e),FK}if(!a||!i||typeof i.then!=`function`)throw i;return i.then(function i(){try{var s=zK(v,t,n,r,e,a,o);return e._suspended?IK+s+LK:s}catch(e){if(!e||typeof e.then!=`function`)throw e;return e.then(i)}})}}var A,j=`<`+h,M=FK;for(var N in g){var P=g[N];if(typeof(P=VK(P)?P.value:P)!=`function`||N===`class`||N===`className`){switch(N){case`children`:A=P;continue;case`key`:case`ref`:case`__self`:case`__source`:continue;case`htmlFor`:if(`for`in g)continue;N=`for`;break;case`className`:if(`class`in g)continue;N=`class`;break;case`defaultChecked`:N=`checked`;break;case`defaultSelected`:N=`selected`;break;case`defaultValue`:case`value`:switch(N=`value`,h){case`textarea`:A=P;continue;case`select`:r=P;continue;case`option`:r!=P||`selected`in g||(j+=` selected`)}break;case`dangerouslySetInnerHTML`:M=P&&P.__html;continue;case`style`:typeof P==`object`&&(P=CK(P));break;case`acceptCharset`:N=`accept-charset`;break;case`httpEquiv`:N=`http-equiv`;break;default:if(dK.test(N))N=N.replace(dK,`$1:$2`).toLowerCase();else{if(uK.test(N))continue;N[4]!==`-`&&!mK.has(N)||P==null?n?pK.test(N)&&(N=N===`panose1`?`panose-1`:N.replace(/([A-Z])/g,`-$1`).toLowerCase()):fK.test(N)&&(N=N.toLowerCase()):P+=FK}}P!=null&&!1!==P&&(j=!0===P||P===FK?j+` `+N:j+` `+N+`="`+(typeof P==`string`?yK(P):P+FK)+`"`)}}if(uK.test(h))throw Error(h+` is not a valid HTML tag name in `+j+`>`);if(M||(typeof A==`string`?M=yK(A):A!=null&&!1!==A&&!0!==A&&(M=zK(A,t,h===`svg`||h!==`foreignObject`&&n,r,e,a,o))),kK&&kK(e),jK&&jK(e),!M&&BK.has(h))return j+`/>`;var F=`</`+h+`>`,I=j+`>`;return NK(M)?[I].concat(M,[F]):typeof M==`string`?I+M+F:[I,M,F]}var BK=new Set([`area`,`base`,`br`,`col`,`command`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function VK(e){return typeof e==`object`&&!!e&&typeof e.peek==`function`&&`value`in e}var HK=0;function UK(e){return e!=null&&e.length>0?e:(HK+=1,`pst_ft_${HK}`)}function WK({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??hR)}function GK(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 KK(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 qK(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var JK=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new aK;#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=UK(a),this.#p=XH(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=mR(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new GH({...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&&(iK(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}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){this.#t.resetPaths(e,t)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),nK(t.wrapper,this.#w()))}setGitStatus(e){this.#p=XH(e,this.#p);let t=this.#T();t!=null&&nK(t.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),nK(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),rK(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),nK(r,this.#w())}#C(){return{initialViewportHeight:WK({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(UI,e());return}this.#l.setSlotHtml(UI,this.#e?.header?.html??null)}#k(e){let t=qK(e).find(e=>KK(e)),n=GK(sR(fR(this.#m).set));n!=null&&(t!=null&&t.outerHTML===n.outerHTML||(t==null?e.prepend(n):t.replaceWith(n)))}#A(e){let t=qK(e),n=t.find(e=>KK(e)),r=t.filter(e=>e!==n),i=fR(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=GK(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=fR(this.#m);t.colored&&lR(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${zI}]`);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(zI,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=yR(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 TR(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 YK(e){let[t]=(0,W.useState)(()=>new JK(e)),n=(0,W.useRef)({timeout:null,model:t});return(0,W.useEffect)(()=>{let{current:e}=n;return e.timeout!=null&&(clearTimeout(e.timeout),e.timeout=null),()=>{e.timeout=setTimeout(()=>e.model.cleanUp(),1)}},[]),{model:t}}var XK=(0,W.memo)(function({files:e,activeFile:t,commentCounts:n,viewedFiles:r,untrackedFiles:i,onFileClick:a,collapsed:o,onToggleCollapse:s}){let[c,l]=(0,W.useState)(``),u=(0,W.useMemo)(()=>e.map(e=>e.name),[e]),d=(0,W.useMemo)(()=>{let e=new Set;return u.forEach(t=>{let n=t.split(`/`);for(let t=1;t<n.length;t++)e.add(n.slice(0,t).join(`/`))}),Array.from(e)},[u]),f=(0,W.useMemo)(()=>e.map(e=>{let t=`modified`;if(i.has(e.name))t=`untracked`;else if(e.prevName)t=`renamed`;else{let n=e.prevObjectId,r=e.newObjectId;n===`0000000`||n===`0000000000000000000000000000000000000000`?t=`added`:(r===`0000000`||r===`0000000000000000000000000000000000000000`)&&(t=`deleted`)}return{path:e.name,status:t}}),[e,i]),p=(0,W.useRef)({commentCounts:n,viewedFiles:r});p.current={commentCounts:n,viewedFiles:r};let{model:m}=YK({paths:u,fileTreeSearchMode:`hide-non-matches`,gitStatus:f,renderRowDecoration:(0,W.useCallback)(e=>{let t=e.item.path,{commentCounts:n,viewedFiles:r}=p.current,i=r.has(t),a=n[t]??0;return i&&a>0?{text:`✓ 💬 ${a}`,title:`Viewed, ${a} comment${a>1?`s`:``}`}:i?{text:`✓`,title:`Viewed`}:a>0?{text:`💬 ${a}`,title:`${a} comment${a>1?`s`:``}`}:null},[]),initialSelectedPaths:t?[t]:[],initialExpandedPaths:d,onSelectionChange:e=>{e.length>0&&e[0]!==t&&a(e[0])}});return(0,W.useEffect)(()=>{m.resetPaths(u,{initialExpandedPaths:d})},[u,d,m]),(0,W.useEffect)(()=>{m.setGitStatus(f)},[f,n,r,m]),(0,W.useEffect)(()=>{if(t)try{m.focusPath(t),m.scrollToPath(t,{focus:!0,offset:`nearest`})}catch(e){console.error(`Failed to scroll to active file:`,e)}},[t,m]),(0,W.useEffect)(()=>{m.setSearch(c||null)},[c,m]),o?(0,G.jsx)(`div`,{className:`ft`,children:(0,G.jsx)(`div`,{className:`ft-search`,children:s&&(0,G.jsx)(QT,{content:`Expand sidebar`,side:`right`,children:(0,G.jsx)(`button`,{className:`sidebar-toggle`,onClick:s,"aria-label":`Expand sidebar`,children:(0,G.jsx)(gN,{size:16})})})})}):(0,G.jsxs)(`div`,{className:`ft`,style:{display:`flex`,flexDirection:`column`,height:`100%`},children:[(0,G.jsxs)(`div`,{className:`ft-search`,children:[s&&(0,G.jsx)(QT,{content:`Collapse sidebar`,side:`right`,children:(0,G.jsx)(`button`,{className:`sidebar-toggle`,onClick:s,"aria-label":`Collapse sidebar`,children:(0,G.jsx)(hN,{size:16})})}),(0,G.jsxs)(`div`,{className:`ft-search-wrapper`,children:[(0,G.jsx)(wN,{size:14,className:`ft-search-icon`}),(0,G.jsx)(`input`,{type:`text`,placeholder:`Filter files...`,value:c,onChange:e=>l(e.target.value),className:`ft-search-input`})]})]}),(0,G.jsx)(`div`,{style:{flex:1,minHeight:0,overflow:`auto`},children:(0,G.jsx)(ZI,{model:m,className:`ft-pierre-tree`})})]})});function ZK(e){return e.status===`resolved`?`resolved`:e.replies?.length?`replied`:`open`}var QK=[{key:`all`,label:`All`},{key:`open`,label:`Open`},{key:`replied`,label:`Replied`},{key:`resolved`,label:`Resolved`}];function $K({comments:e,resolveComment:t,unresolveComment:n,removeComment:r,addReply:i,editComment:a,editReply:o,removeReply:s}){let[c,l]=(0,W.useState)(`all`),u=(0,W.useMemo)(()=>{let t={all:e.length,open:0,replied:0,resolved:0};for(let n of e)t[ZK(n)]++;return t},[e]),d=(0,W.useMemo)(()=>[...e].sort((e,t)=>t.createdAt-e.createdAt),[e]),f=(0,W.useMemo)(()=>c===`all`?d:d.filter(e=>ZK(e)===c),[d,c]);return e.length===0?null:(0,G.jsxs)(`div`,{className:`cmt`,role:`complementary`,"aria-label":`Review comments`,children:[(0,G.jsxs)(`div`,{className:`cmt-head`,children:[(0,G.jsxs)(`div`,{className:`cmt-title`,children:[(0,G.jsx)(dN,{size:14,"aria-hidden":`true`}),(0,G.jsx)(`span`,{children:`Comments`}),(0,G.jsx)(`span`,{className:`cmt-total`,children:e.length})]}),(0,G.jsx)(`div`,{className:`cmt-filters`,role:`tablist`,"aria-label":`Filter comments`,children:QK.map(e=>(0,G.jsxs)(`button`,{role:`tab`,"aria-selected":c===e.key,className:`cmt-filter ${c===e.key?`cmt-filter-active`:``}`,onClick:()=>l(e.key),disabled:e.key!==`all`&&u[e.key]===0,children:[e.label,(0,G.jsx)(`span`,{className:`cmt-filter-count`,children:u[e.key]})]},e.key))})]}),(0,G.jsx)(`ul`,{className:`cmt-list`,"aria-label":`Comment threads`,children:f.length===0?(0,G.jsxs)(`li`,{className:`cmt-empty`,children:[`No `,c,` comments`]}):f.map(e=>(0,G.jsx)(eq,{comment:e,resolveComment:t,unresolveComment:n,removeComment:r,addReply:i,editComment:a,editReply:o,removeReply:s},e.id))})]})}function eq({comment:e,resolveComment:t,unresolveComment:n,removeComment:r,addReply:i,editComment:a,editReply:o,removeReply:s}){let c=ZK(e),l=e.status===`resolved`,u=e.replies?.length??0,{haptic:d,sound:f}=bM(),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(!1),[_,v]=(0,W.useState)(!1),[y,b]=(0,W.useState)(!1),x=(0,W.useCallback)(()=>{e.lineNumber>0?vj(e.filePath,e.lineNumber,e.side):document.getElementById(`file-${e.filePath}`)?.scrollIntoView({block:`start`})},[e.filePath,e.lineNumber,e.side]),S=e.lineNumber>0?`:${e.lineNumber}`:` · file`;return(0,G.jsxs)(`li`,{className:`cmt-card cmt-card-${c} ${l?`cmt-card-resolved`:``}`,children:[(0,G.jsxs)(`div`,{className:`cmt-card-top`,children:[(0,G.jsx)(`span`,{className:`cmt-dot cmt-dot-${c}`,"aria-hidden":`true`}),(0,G.jsxs)(`button`,{className:`cmt-loc`,onClick:x,title:`Jump to ${e.filePath}${S}`,children:[(0,G.jsx)(`span`,{className:`cmt-loc-file`,children:fj(e.filePath)}),(0,G.jsx)(`span`,{className:`cmt-loc-line`,children:S})]}),(0,G.jsx)(`span`,{className:`cmt-time`,children:dj(e.createdAt)})]}),e.lineContent?.trim()&&(0,G.jsx)(`button`,{className:`cmt-codeline`,onClick:x,title:`Jump to line`,children:(0,G.jsx)(`code`,{children:e.lineContent.trim().slice(0,160)})}),_?(0,G.jsx)(CI,{draftKey:`tracker-edit:${e.id}`,initialBody:e.body,onCancel:()=>v(!1),onSubmit:t=>{a(e.id,t),v(!1)}}):(0,G.jsx)(`div`,{className:`cmt-body markdown-body`,dangerouslySetInnerHTML:{__html:mj(e.body)}}),(0,G.jsxs)(`div`,{className:`cmt-actions`,children:[(0,G.jsxs)(`button`,{className:`cmt-act`,onClick:()=>{g(e=>!e),m(!0)},title:`Reply`,children:[(0,G.jsx)($M,{size:13,"aria-hidden":`true`}),(0,G.jsx)(`span`,{children:`Reply`})]}),(0,G.jsx)(`button`,{className:`cmt-act`,onClick:()=>v(e=>!e),title:`Edit comment`,children:(0,G.jsx)(vN,{size:13,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`cmt-act ${l?`cmt-act-resolved`:``}`,onClick:()=>{l?(n(e.id),d(`light`),f(`toggle`)):(t(e.id),d(`success`),f(`resolve`))},title:l?`Reopen`:`Resolve`,children:l?(0,G.jsx)(SN,{size:13,"aria-hidden":`true`}):(0,G.jsx)(HM,{size:13,"aria-hidden":`true`})}),y?(0,G.jsxs)(`span`,{className:`cmt-confirm`,children:[(0,G.jsx)(`button`,{className:`cmt-act cmt-act-danger`,onClick:()=>{r(e.id),d(`medium`),f(`remove`)},title:`Confirm delete`,children:`Delete?`}),(0,G.jsx)(`button`,{className:`cmt-act`,onClick:()=>b(!1),title:`Cancel`,children:(0,G.jsx)(NN,{size:13,"aria-hidden":`true`})})]}):(0,G.jsx)(`button`,{className:`cmt-act cmt-act-del`,onClick:()=>b(!0),title:`Delete comment`,children:(0,G.jsx)(ON,{size:13,"aria-hidden":`true`})})]}),u>0&&(0,G.jsxs)(`button`,{className:`cmt-thread-toggle`,onClick:()=>m(e=>!e),"aria-expanded":p,children:[(0,G.jsx)(WM,{size:12,className:`cmt-chev ${p?`cmt-chev-open`:``}`,"aria-hidden":`true`}),u,` `,u===1?`reply`:`replies`]}),p&&u>0&&(0,G.jsx)(`ul`,{className:`cmt-replies`,children:e.replies.map(t=>(0,G.jsx)(tq,{reply:t,onEdit:n=>o(e.id,t.id,n),onRemove:()=>s(e.id,t.id)},t.id))}),h&&(0,G.jsx)(CI,{draftKey:`reply:${e.id}`,onCancel:()=>g(!1),onSubmit:t=>{i(e.id,t),d(`light`),f(`success`),g(!1),m(!0)}})]})}function tq({reply:e,onEdit:t,onRemove:n}){let r=e.role===`agent`||e.role==null&&!!e.model,[i,a]=(0,W.useState)(!1);return(0,G.jsxs)(`li`,{className:`cmt-reply ${r?`cmt-reply-agent`:``}`,children:[(0,G.jsxs)(`div`,{className:`cmt-reply-head`,children:[(0,G.jsxs)(`span`,{className:`cmt-reply-who ${r?`cmt-reply-who-agent`:``}`,children:[r?(0,G.jsx)(VM,{size:11,"aria-hidden":`true`}):null,r?e.model||`Agent`:`You`]}),(0,G.jsx)(`span`,{className:`cmt-time`,children:dj(e.createdAt)}),!r&&(0,G.jsx)(`button`,{className:`cmt-reply-act`,onClick:()=>a(e=>!e),title:`Edit reply`,children:(0,G.jsx)(vN,{size:11,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`cmt-reply-act cmt-act-del`,onClick:n,title:`Delete reply`,children:(0,G.jsx)(ON,{size:11,"aria-hidden":`true`})})]}),i?(0,G.jsx)(CI,{draftKey:`tracker-reply-edit:${e.id}`,initialBody:e.body,onCancel:()=>a(!1),onSubmit:e=>{t(e),a(!1)}}):(0,G.jsx)(`div`,{className:`cmt-reply-body markdown-body`,dangerouslySetInnerHTML:{__html:mj(e.body)}})]})}function nq(e,t){let[n,r]=(0,W.useState)(e);return(0,W.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function rq(e){return e===`symbols`?2:e===`text`?1:0}function iq({scope:e,query:t,regex:n,changedOnly:r,changedPaths:i,open:a}){let o=nq(t,130).trim(),s=a&&o.length>=rq(e);return{...nt({queryKey:[`search`,e,o,e===`text`?n:!1,r,r?i:null],enabled:s,placeholderData:V,staleTime:5e3,queryFn:async({signal:t})=>{let a=await fetch(`/api/search`,{method:`POST`,headers:{"content-type":`application/json`},signal:t,body:JSON.stringify({scope:e,query:o,regex:e===`text`?n:!1,changedPaths:r?i:void 0})});if(!a.ok)throw Error(`Search request failed (${a.status})`);return await a.json()}}),enabled:s,pending:t.trim()!==o,minLength:rq(e)}}function aq(e,t){fetch(`/api/search/track`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({query:e,path:t})}).catch(()=>{})}function oq(e){return nt({queryKey:[`file-text`,e],enabled:!!e,staleTime:300*1e3,queryFn:async({signal:t})=>{let n=await fetch(`/api/file-text?path=${encodeURIComponent(e)}&version=new`,{signal:t});if(n.status===415)return{content:null,missing:!1,binary:!0};if(!n.ok)throw Error(`Failed to load file (${n.status})`);let r=await n.json();if(r.error){if(/binary/i.test(r.error))return{content:null,missing:!1,binary:!0};throw Error(r.error)}return r.missing?{content:null,missing:!0,binary:!1}:{content:r.content??``,missing:!1,binary:!1}}})}var sq=[{pattern:/^\s*(?:export\s+)?(?:async\s+)?function\s+(\w[\w$]*)\s*[<(]/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:export\s+)?(?:const|let|var)\s+(\w[\w$]*)\s*=\s*(?:async\s*)?\(/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:export\s+)?(?:const|let|var)\s+(\w[\w$]*)\s*=\s*(?:async\s+)?function/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:export\s+)?class\s+(\w[\w$]*)/i,kind:`class`,nameGroup:1},{pattern:/^\s*(?:export\s+)?interface\s+(\w[\w$]*)/i,kind:`interface`,nameGroup:1},{pattern:/^\s*(?:export\s+)?type\s+(\w[\w$]*)\s*=/i,kind:`type`,nameGroup:1},{pattern:/^\s*(?:export\s+)?enum\s+(\w[\w$]*)/i,kind:`enum`,nameGroup:1},{pattern:/^\s*(?:export\s+)?(?:const|let|var)\s+(\w[\w$]*)\s*=/i,kind:`variable`,nameGroup:1},{pattern:/^\s*def\s+(\w[\w$]*)\s*\(/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?fn\s+(\w[\w$]*)\s*[<(]/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?struct\s+(\w[\w$]*)/i,kind:`struct`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?enum\s+(\w[\w$]*)/i,kind:`enum`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?impl\s+(\w[\w$]*)/i,kind:`impl`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?trait\s+(\w[\w$]*)/i,kind:`trait`,nameGroup:1},{pattern:/^\s*func\s+(\w[\w$]*)\s*\(/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:func\s+)?\((\w[\w$]*)\s+\*?\w+\)\s+(\w[\w$]*)\s*\(/i,kind:`method`,nameGroup:2}];function cq(e){for(let{pattern:t,kind:n,nameGroup:r}of sq){let i=t.exec(e);if(i){let e=i[r];if(e)return{name:e,kind:n}}}return null}function lq(e){return new Set(e.map(e=>e.name))}function uq(e){let t=new Set;for(let n of e)n.side===`additions`&&t.add(`${n.filePath}:${n.lineNumber}`);return t}function dq(e,t){return e.kind===`file`?t.diffFileSet.has(e.path)?{type:`scrollFile`,path:e.path}:{type:`preview`,path:e.path}:t.diffFileSet.has(e.path)?{type:`scrollLine`,path:e.path,line:e.line,side:`additions`,match:e.match}:{type:`preview`,path:e.path,line:e.line,match:e.match}}function fq(e,t){if(!t||t.length===0)return null;let n=!0;for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127){n=!1;break}let r=n?e.length:mq(e),i=null;if(!n){i=Array(r+1).fill(-1);let t=0;for(let n=0;n<e.length;){i[t]=n;let r=e.codePointAt(n);n+=r>65535?2:1,t+=pq(r)}i[r]=e.length}let a=[];for(let e of t){let[t,o]=e;if(!(t==null||o==null||o<=t||t<0||o>r))if(n)a.push([t,o]);else{let e=i[t],n=i[o];e>=0&&n>=0&&a.push([e,n])}}return a.length?a:null}function pq(e){return e<=127?1:e<=2047?2:e<=65535?3:4}function mq(e){let t=0;for(let n=0;n<e.length;){let r=e.codePointAt(n);t+=pq(r),n+=r>65535?2:1}return t}function hq(e,t,n){let r=((t?fq(e,t):null)??gq(e,n)).map(([t,n])=>[Math.max(0,t),Math.min(e.length,n)]).filter(([e,t])=>t>e).sort((e,t)=>e[0]-t[0]),i=[];for(let[e,t]of r){let n=i[i.length-1];n&&e<=n[1]?n[1]=Math.max(n[1],t):i.push([e,t])}return i}function gq(e,t){let n=t.trim();if(!n)return[];let r=[],i=e.toLowerCase(),a=n.toLowerCase(),o=0;for(;r.length<50;){let e=i.indexOf(a,o);if(e===-1)break;r.push([e,e+a.length]),o=e+a.length}return r}function _q(e,t){let n=e.toLowerCase(),r=t.toLowerCase();if(!r)return 0;let i=0,a=0,o=-1;for(let e=0;e<n.length&&i<r.length;e++)n[e]===r[i]&&(a+=o>=0&&e-o===1?5:1,o=e,i++);return i===r.length?a-e.length*.01:null}function vq(e){let t=[],n=new Set;for(let r of e){if(r.side!==`additions`)continue;let e=cq(r.content);if(e){let i=`${r.filePath}:${r.lineNumber}:${e.name}`;if(n.has(i))continue;n.add(i);let a=r.content.indexOf(e.name),o=a>=0?[[a,a+e.name.length]]:[];t.push({name:e.name,kind:e.kind,path:r.filePath,fileName:r.filePath.split(`/`).pop()||``,line:r.lineNumber,content:r.content,matchRanges:o,gitStatus:``})}}return t}var yq=[{key:`all`,label:`All`,Icon:oN},{key:`files`,label:`Files`,Icon:tN},{key:`text`,label:`Text`,Icon:AN},{key:`symbols`,label:`Symbols`,Icon:QM}],bq={function:`ƒ`,method:`m`,class:`C`,variable:`v`,interface:`I`,type:`T`,enum:`E`,struct:`S`,impl:`i`,trait:`t`};function xq(e){switch(e){case`modified`:return{label:`M`,title:`modified`};case`untracked`:return{label:`U`,title:`untracked`};case`staged_new`:case`added`:return{label:`A`,title:`added`};case`deleted`:return{label:`D`,title:`deleted`};case`renamed`:return{label:`R`,title:`renamed`};case``:case`clean`:return null;default:return{label:e.charAt(0).toUpperCase(),title:e}}}function Sq({text:e,ranges:t}){if(!t.length)return(0,G.jsx)(G.Fragment,{children:e});let n=[],r=0;return t.forEach(([t,i],a)=>{t>r&&n.push(e.slice(r,t)),n.push((0,G.jsx)(`mark`,{className:`searchpalette-mark`,children:e.slice(t,i)},a)),r=i}),r<e.length&&n.push(e.slice(r)),(0,G.jsx)(G.Fragment,{children:n})}function Cq(e,t){let n=t.trim().toLowerCase();if(!n)return[];let r=e.toLowerCase(),i=[],a=0;for(let e=0;e<r.length&&a<n.length;e++)if(r[e]===n[a]){let t=i[i.length-1];t&&t[1]===e?t[1]=e+1:i.push([e,e+1]),a++}return a===n.length?i:[]}var wq=e=>{let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t+1)};function Tq(e,t){let n=e.length-e.trimStart().length,r=e.slice(n),i=n;if(r.length>400){let e=t.find(e=>e[0]>=n),a=e?Math.max(0,e[0]-n-24):0,o=a>0?`…`:``;r=o+r.slice(a,a+400),i=n+a-o.length}let a=t.map(([e,t])=>[e-i,t-i]).filter(([e,t])=>t>0&&e<r.length).map(([e,t])=>[Math.max(0,e),Math.min(r.length,t)]);return{text:r,ranges:a}}function Eq({isOpen:e,onClose:t,initialScope:n,files:r,changedEntries:i,customMode:a,staged:o,onNavigateFile:s,theme:c,fontSize:l,monoFontFamily:u,defaultTabSize:d,lineWrap:f,showLineNumbers:p,lineHoverHighlight:m}){let[h,g]=(0,W.useState)(``),[_,v]=(0,W.useState)(n),[y,b]=(0,W.useState)(!1),[x,S]=(0,W.useState)(!1),[C,w]=(0,W.useState)(0),[T,E]=(0,W.useState)(null),D=(0,W.useRef)(null),O=(0,W.useRef)(null),k=(0,W.useMemo)(()=>lq(r),[r]),A=(0,W.useMemo)(()=>uq(i),[i]),j=iq({scope:_,query:h,regex:y,changedOnly:x,changedPaths:(0,W.useMemo)(()=>[...k],[k]),open:e}),M=j.data&&j.data.scope===_?j.data:void 0,N=M?.error,P=nt({queryKey:[`repo-files-fallback`],enabled:e&&_===`files`&&!!N,staleTime:6e4,queryFn:async()=>(await(await fetch(`/api/repo-files`)).json()).files??[]});(0,W.useEffect)(()=>{e&&(g(``),v(n),b(!1),S(!1),w(0),E(null))},[e,n]),(0,W.useEffect)(()=>{e&&D.current?.focus()},[e]),(0,W.useEffect)(()=>{w(0),E(null)},[h,_]);let F=(0,W.useMemo)(()=>{let e=h.trim(),t=e.toLowerCase(),n=[];if(_===`files`&&N&&P.data)n=P.data.map(e=>({path:e,score:t?_q(e,t):0})).filter(e=>e.score!==null).sort((e,t)=>t.score-e.score).slice(0,60).map(({path:e})=>({kind:`file`,key:e,hit:{path:e,fileName:fj(e),gitStatus:``,matchType:``,exact:!1},inDiff:k.has(e)}));else if(M)M.scope===`files`?n=M.items.map(e=>({kind:`file`,key:e.path,hit:e,inDiff:k.has(e.path)})):M.scope===`text`?n=M.items.map(e=>({kind:`text`,key:`${e.path}:${e.line}:${e.col}`,hit:e,inDiff:k.has(e.path)})):M.scope===`symbols`?n=M.items.map(e=>({kind:`symbol`,key:`${e.path}:${e.line}:${e.name}`,hit:e,inDiff:k.has(e.path)})):M.scope===`all`&&(n=M.items.map(e=>e.kind===`file`?{kind:`file`,key:`all:${e.hit.path}`,hit:e.hit,inDiff:k.has(e.hit.path)}:e.kind===`text`?{kind:`text`,key:`all:${e.hit.path}:${e.hit.line}:${e.hit.col}`,hit:e.hit,inDiff:k.has(e.hit.path)}:{kind:`symbol`,key:`all:${e.hit.path}:${e.hit.line}:${e.hit.name}`,hit:e.hit,inDiff:k.has(e.hit.path)}));else if(_===`symbols`&&e.length<2){let e=vq(i);n=(t?e.filter(e=>e.name.toLowerCase().includes(t)):e).map(e=>({kind:`symbol`,key:`local:${e.path}:${e.line}:${e.name}`,hit:e,inDiff:!0}))}let r=n.filter(e=>e.inDiff),a=n.filter(e=>!e.inDiff);return[...r,...a]},[M,N,P.data,_,k,h,i]);(0,W.useEffect)(()=>{C>=F.length&&w(0)},[F.length,C]),(0,W.useEffect)(()=>{(O.current?.querySelector(`[data-focused="true"]`))?.scrollIntoView({block:`nearest`})},[C,F]);let I=(0,W.useMemo)(()=>({diffFileSet:k,changedKeys:A,customMode:a,staged:o}),[k,A,a,o]),L=(0,W.useCallback)((e,n)=>{let r=F[e];if(!r)return;let i=r.hit.path,a=h.trim();if(aq(a,i),r.kind===`file`){if(n){E({path:i});return}dq({kind:`file`,path:i},I).type===`scrollFile`?(t(),requestAnimationFrame(()=>s(i))):E({path:i});return}let o=r.hit.line,c=r.kind===`symbol`?r.hit.name:a;if(n){E({path:i,line:o,match:c});return}let l=dq({kind:`line`,path:i,line:o,match:c},I);l.type===`scrollLine`?(t(),requestAnimationFrame(()=>vj(i,l.line,l.side,l.match))):E({path:i,line:o,match:c})},[F,h,I,t,s]),R=(0,W.useCallback)(e=>{v(t=>yq[(yq.findIndex(e=>e.key===t)+e+yq.length)%yq.length].key)},[]),z=(0,W.useCallback)(e=>{if(e.key===`PageDown`){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:150,behavior:`auto`});return}if(e.key===`PageUp`){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:-150,behavior:`auto`});return}if(e.altKey&&(e.key===`ArrowDown`||e.key===`j`)){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:80,behavior:`auto`});return}if(e.altKey&&(e.key===`ArrowUp`||e.key===`k`)){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:-80,behavior:`auto`});return}if(e.shiftKey&&(e.key===`ArrowDown`||e.key===`j`)){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:80,behavior:`auto`});return}if(e.shiftKey&&(e.key===`ArrowUp`||e.key===`k`)){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:-80,behavior:`auto`});return}if(e.key===`Tab`){e.preventDefault(),R(e.shiftKey?-1:1);return}let t=e=>{F.length!==0&&w(t=>(t+e+F.length)%F.length)};e.key===`ArrowDown`||e.ctrlKey&&(e.key===`n`||e.key===`j`)?(e.preventDefault(),t(1)):e.key===`ArrowUp`||e.ctrlKey&&(e.key===`p`||e.key===`k`)?(e.preventDefault(),t(-1)):e.ctrlKey&&e.key===`d`?(e.preventDefault(),t(8)):e.ctrlKey&&e.key===`u`?(e.preventDefault(),t(-8)):e.key===`Enter`&&(e.preventDefault(),L(C,e.metaKey||e.ctrlKey))},[R,F.length,L,C]),ee=(0,W.useCallback)(()=>{T?E(null):t()},[T,t]),te=M?.total??F.length,B=(j.isFetching||j.pending)&&j.enabled,V=M?.indexing;return(0,G.jsxs)(fI,{open:e,onClose:ee,className:`searchpalette ui-modal--palette ${T?`searchpalette--split`:``}`,ariaLabel:`Search files, text and symbols`,initialFocus:D,onKeyDown:z,children:[(0,G.jsxs)(`div`,{className:`searchpalette-header`,children:[(0,G.jsxs)(`div`,{className:`searchpalette-input-row`,children:[(0,G.jsx)(wN,{size:15,className:`searchpalette-search-icon`}),(0,G.jsx)(`input`,{ref:D,type:`text`,className:`searchpalette-input`,placeholder:_===`all`?`Search files, text and symbols…`:_===`files`?`Search files in the repo…`:_===`text`?y?`Search by regular expression…`:`Search file contents…`:`Search symbol definitions…`,value:h,onChange:e=>g(e.target.value),role:`combobox`,"aria-expanded":F.length>0,"aria-controls":`searchpalette-list`,"aria-activedescendant":F[C]?`sp-row-${C}`:void 0,spellCheck:!1,autoComplete:`off`}),B&&(0,G.jsx)(sN,{size:14,className:`searchpalette-spinner spin`}),h&&(0,G.jsx)(`button`,{className:`searchpalette-clear`,onClick:()=>g(``),"aria-label":`Clear search`,children:(0,G.jsx)(NN,{size:14})}),(0,G.jsx)(`span`,{className:`searchpalette-count`,children:V?`indexing…`:M?`${F.length} of ${te}`:``})]}),(0,G.jsxs)(`div`,{className:`searchpalette-controls`,children:[(0,G.jsx)(`div`,{className:`searchpalette-scopes`,role:`tablist`,"aria-label":`Search scope`,children:yq.map(e=>(0,G.jsxs)(`button`,{role:`tab`,"aria-selected":_===e.key,className:`searchpalette-scope ${_===e.key?`is-active`:``}`,onClick:()=>v(e.key),children:[(0,G.jsx)(e.Icon,{size:12}),e.label]},e.key))}),(0,G.jsxs)(`div`,{className:`searchpalette-toggles`,children:[_===`text`&&(0,G.jsx)(`button`,{className:`searchpalette-toggle ${y?`is-active`:``}`,onClick:()=>b(e=>!e),title:`Regular expression`,"aria-pressed":y,children:`.*`}),(0,G.jsxs)(`button`,{className:`searchpalette-toggle ${x?`is-active`:``}`,onClick:()=>S(e=>!e),title:`Limit to files in the current diff`,"aria-pressed":x,children:[(0,G.jsx)(rN,{size:12}),`Changed`]})]})]}),M?.regexError&&(0,G.jsx)(`div`,{className:`searchpalette-note`,children:`Invalid regex — showing literal matches`})]}),(0,G.jsxs)(`div`,{className:`searchpalette-body`,children:[(0,G.jsx)(`div`,{className:`searchpalette-list`,id:`searchpalette-list`,role:`listbox`,ref:O,children:(0,G.jsx)(Dq,{rows:F,scope:_,query:h,focusedIndex:C,engineError:N,isFetching:j.isFetching,enabled:j.enabled,minLength:j.minLength,regex:y,changedOnly:x,onHover:w,onActivate:(e,t)=>L(e,t?t.metaKey||t.ctrlKey:!1),onRetry:()=>j.refetch()})}),T&&(0,G.jsx)(Nq,{preview:T,theme:c,fontSize:l,monoFontFamily:u,defaultTabSize:d,lineWrap:f,showLineNumbers:p,lineHoverHighlight:m,onClose:()=>E(null),inDiff:k.has(T.path),onGoToDiff:()=>{t(),T.line?requestAnimationFrame(()=>vj(T.path,T.line,`additions`,T.match)):requestAnimationFrame(()=>s(T.path))}},T.path)]}),(0,G.jsxs)(`div`,{className:`searchpalette-foot`,children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`Tab`}),` scope`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`↑↓`}),` move`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`↵`}),` `,T&&k.has(T.path)?`view in diff`:`open`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`⌘↵`}),` peek`]}),T&&(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`⌥↑↓`}),` / `,(0,G.jsx)(`kbd`,{children:`⇧↑↓`}),` scroll preview`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`esc`}),` `,T?`back`:`close`]})]})]})}function Dq({rows:e,scope:t,query:n,focusedIndex:r,engineError:i,isFetching:a,enabled:o,minLength:s,regex:c,changedOnly:l,onHover:u,onActivate:d,onRetry:f}){return i&&t!==`files`?(0,G.jsxs)(`div`,{className:`searchpalette-state searchpalette-state--error`,children:[(0,G.jsx)(`p`,{children:`Search engine unavailable`}),(0,G.jsx)(`span`,{className:`searchpalette-state-detail`,children:i}),(0,G.jsx)(`button`,{className:`searchpalette-retry`,onClick:f,children:`Retry`})]}):e.length>0?(0,G.jsx)(G.Fragment,{children:e.map((e,t)=>(0,G.jsx)(Oq,{row:e,index:t,query:n,focused:t===r,onHover:u,onActivate:d},e.key))}):o?a?(0,G.jsxs)(`div`,{className:`searchpalette-state`,children:[(0,G.jsx)(sN,{size:15,className:`spin`}),` Searching…`]}):(0,G.jsxs)(`div`,{className:`searchpalette-state`,children:[(0,G.jsxs)(`p`,{children:[`No matches`,n.trim()?` for “${n.trim()}”`:``]}),(0,G.jsx)(`span`,{className:`searchpalette-state-detail`,children:l?`Searching only changed files — turn off Changed to search the whole repo`:t===`text`&&!c?`Try Tab to switch scope, or enable .* for regex`:`Try Tab to switch scope`})]}):(0,G.jsx)(`div`,{className:`searchpalette-state`,children:t===`symbols`?n.trim()?`No matching symbols in the current diff. Type at least 2 characters to search the whole repository.`:`No symbols found in the current diff. Type at least 2 characters to search the whole repository.`:t===`text`?`Type to search file contents`:`Type to filter — or browse all files`})}function Oq({row:e,index:t,query:n,focused:r,onHover:i,onActivate:a}){let o=xq(e.hit.gitStatus);return(0,G.jsxs)(`div`,{id:`sp-row-${t}`,role:`option`,"aria-selected":r,"data-focused":r,className:`searchpalette-row ${r?`is-focused`:``} ${e.inDiff?`is-indiff`:``}`,onMouseEnter:()=>i(t),onClick:e=>a(t,e),children:[e.kind===`file`&&(0,G.jsx)(kq,{hit:e.hit,query:n}),e.kind===`text`&&(0,G.jsx)(Aq,{hit:e.hit,query:n}),e.kind===`symbol`&&(0,G.jsx)(jq,{hit:e.hit}),(0,G.jsxs)(`div`,{className:`searchpalette-rail`,children:[e.inDiff&&(0,G.jsx)(`span`,{className:`searchpalette-pill searchpalette-pill--diff`,children:`diff`}),o&&(0,G.jsx)(`span`,{className:`searchpalette-git searchpalette-git--${o.title}`,title:o.title,children:o.label})]})]})}function kq({hit:e,query:t}){let n=e.fileName,r=Cq(n,t);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`searchpalette-tile searchpalette-tile--file`,children:(0,G.jsx)(tN,{size:13})}),(0,G.jsxs)(`div`,{className:`searchpalette-info`,children:[(0,G.jsx)(`span`,{className:`searchpalette-primary`,children:(0,G.jsx)(Sq,{text:n,ranges:r})}),(0,G.jsx)(`span`,{className:`searchpalette-secondary`,children:wq(e.path)||`./`})]})]})}function Aq({hit:e,query:t}){let n=hq(e.content,e.matchRanges,t),{text:r,ranges:i}=Tq(e.content,n);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`searchpalette-tile searchpalette-tile--text`,children:(0,G.jsx)(AN,{size:13})}),(0,G.jsxs)(`div`,{className:`searchpalette-info`,children:[(0,G.jsx)(`span`,{className:`searchpalette-primary searchpalette-code`,children:(0,G.jsx)(Sq,{text:r,ranges:i})}),(0,G.jsxs)(`span`,{className:`searchpalette-secondary`,children:[e.fileName,`:`,e.line,(0,G.jsx)(`span`,{className:`searchpalette-crumb`,children:wq(e.path)})]})]})]})}function jq({hit:e}){let t=e.content.indexOf(e.name),n=t>=0?e.content.slice(t+e.name.length).trimEnd():``,r=hq(e.name,e.matchRanges.length?Mq(e):void 0,e.name);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`searchpalette-tile searchpalette-tile--symbol`,title:e.kind,children:bq[e.kind]??`?`}),(0,G.jsxs)(`div`,{className:`searchpalette-info`,children:[(0,G.jsxs)(`span`,{className:`searchpalette-primary`,children:[(0,G.jsx)(Sq,{text:e.name,ranges:r}),n&&(0,G.jsx)(`span`,{className:`searchpalette-sigtail`,children:n.slice(0,60)})]}),(0,G.jsxs)(`span`,{className:`searchpalette-secondary`,children:[e.fileName,`:`,e.line,(0,G.jsx)(`span`,{className:`searchpalette-crumb`,children:wq(e.path)})]})]}),(0,G.jsx)(`span`,{className:`searchpalette-kind-badge`,children:e.kind})]})}function Mq(e){let t=e.content.indexOf(e.name);if(t<0)return;let n=[];for(let[r,i]of e.matchRanges){let a=r-t,o=i-t;o>0&&a<e.name.length&&n.push([Math.max(0,a),Math.min(e.name.length,o)])}return n.length?n:void 0}function Nq({preview:e,theme:t,fontSize:n,monoFontFamily:r,defaultTabSize:i,lineWrap:a,showLineNumbers:o,lineHoverHighlight:s,onClose:c,inDiff:l,onGoToDiff:u}){let d=pj[t]||pj.nord,{data:f,isLoading:p,error:m}=oq(e.path),h=(0,W.useRef)(null);return(0,W.useEffect)(()=>{!f?.content||!e.line||!h.current||_j(h.current,e.line,e.match)},[f?.content,e.line,e.match]),(0,G.jsxs)(`div`,{className:`searchpalette-preview`,children:[(0,G.jsxs)(`div`,{className:`searchpalette-preview-head`,children:[(0,G.jsx)(tN,{size:12}),(0,G.jsx)(`span`,{className:`searchpalette-preview-path`,children:e.path}),l&&(0,G.jsxs)(`button`,{className:`searchpalette-preview-diff-btn`,onClick:u,title:`Open this file and line in the main diff viewer (Enter)`,style:{padding:`2.5px 8px`,fontSize:`10.5px`,background:`var(--accent-subtle)`,border:`1px solid var(--accent)`,borderRadius:`4px`,color:`var(--text-primary)`,cursor:`pointer`,fontWeight:600,marginRight:`8px`,display:`inline-flex`,alignItems:`center`,gap:`4px`},children:[(0,G.jsx)(rN,{size:11}),`View in Diff`]}),(0,G.jsx)(`button`,{className:`searchpalette-clear`,onClick:c,"aria-label":`Close preview`,children:(0,G.jsx)(NN,{size:14})})]}),(0,G.jsx)(`div`,{className:`searchpalette-preview-body`,ref:h,children:p?(0,G.jsxs)(`div`,{className:`searchpalette-state`,children:[(0,G.jsx)(sN,{size:15,className:`spin`}),` Loading `,e.path,`…`]}):m?(0,G.jsx)(`div`,{className:`searchpalette-state searchpalette-state--error`,children:m.message}):f?.binary?(0,G.jsx)(`div`,{className:`searchpalette-state`,children:`Binary file — no preview`}):f?.missing?(0,G.jsx)(`div`,{className:`searchpalette-state`,children:`File not present in the working tree`}):f?(0,G.jsx)(zh,{file:{name:e.path,contents:f.content??``},options:{disableFileHeader:!0,overflow:a?`wrap`:`scroll`,disableLineNumbers:!o,lineHoverHighlight:s,theme:{dark:d.type===`dark`?d.themeName:`nord`,light:d.type===`light`?d.themeName:`github-light`},themeType:d.type,unsafeCSS:`
3849
3885
  :host {
3850
- --diffs-tab-size: ${r} !important;
3851
- --diffs-font-family: var(--font-mono) !important;
3886
+ --diffs-tab-size: ${i} !important;
3887
+ --diffs-font-family: ${r} !important;
3852
3888
  --diffs-font-size: ${n}px !important;
3853
3889
  --diffs-line-height: ${Math.round(n*1.7)}px !important;
3854
3890
  }
3855
- `}}):null})]})}var iq=(0,W.memo)(function({activeFile:e,onShowHelp:t}){let[n,r]=(0,W.useState)(!1);(0,W.useEffect)(()=>{let e=()=>{let e=document.activeElement;if(e){let t=e.tagName.toLowerCase();r(t===`input`||t===`textarea`||e.hasAttribute(`contenteditable`))}else r(!1)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,e);let t=setInterval(e,400);return()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,e),clearInterval(t)}},[]);let i=e?e.split(`/`).pop():null,a=e&&e.includes(`/`)?e.split(`/`).slice(0,-1).join(`/`)+`/`:``;return(0,G.jsxs)(`div`,{className:`vim-status-bar`,children:[(0,G.jsx)(`div`,{className:`vim-mode-badge ${n?`vim-mode-insert`:`vim-mode-normal`}`,children:n?`INSERT`:`NORMAL`}),(0,G.jsxs)(`div`,{className:`vim-status-content`,children:[(0,G.jsx)($M,{size:12,className:`vim-status-icon`}),e?(0,G.jsxs)(`span`,{className:`vim-status-file`,title:e,children:[(0,G.jsx)(`span`,{className:`vim-file-dir`,children:a}),(0,G.jsx)(`strong`,{className:`vim-file-name`,children:i})]}):(0,G.jsx)(`span`,{className:`vim-status-placeholder`,children:`No active file (J/K to jump)`})]}),(0,G.jsxs)(`button`,{className:`vim-status-help-btn`,onClick:t,title:`View Keyboard Shortcuts (?)`,children:[(0,G.jsx)(TM,{size:13}),(0,G.jsx)(`span`,{children:`Shortcuts`}),(0,G.jsx)(`kbd`,{className:`vim-kbd-small`,children:`?`})]})]})}),aq=(0,W.memo)(function({isOpen:e,onClose:t}){let n=[{title:`Scrolling & Diffs`,icon:(0,G.jsx)(BM,{size:15}),items:[{keys:[`j`],description:`Scroll Down slightly`},{keys:[`k`],description:`Scroll Up slightly`},{keys:[`Ctrl`,`d`],description:`Scroll Down half page`},{keys:[`Ctrl`,`u`],description:`Scroll Up half page`},{keys:[`g`,`g`],description:`Scroll to Top of diffs`},{keys:[`G`],description:`Scroll to Bottom of diffs`}]},{title:`File Navigation`,icon:(0,G.jsx)(PM,{size:15}),items:[{keys:[`J`],description:`Jump to Next File Diff`},{keys:[`K`],description:`Jump to Previous File Diff`},{keys:[`v`],description:`Toggle Viewed state for Active File`},{keys:[`b`],description:`Toggle Sidebar Panel collapse`}]},{title:`Search & Dialogs`,icon:(0,G.jsx)(kM,{size:15}),items:[{keys:[`⌘`,`K`],description:`Open Search Palette (files · text · symbols)`},{keys:[`/`],description:`Search file contents (Text scope)`},{keys:[`g`,`f`],description:`Search files (Files scope)`},{keys:[`s`],description:`Search symbols (or "g s")`},{keys:[`g`,`v`],description:`Browse any file in the repo`},{keys:[`g`,`t`],description:`Open Theme Selection Modal`},{keys:[`Tab`],description:`Cycle search scope while open`},{keys:[`⌘`,`↵`],description:`Peek a result in the preview pane`},{keys:[`?`],description:`Toggle Keyboard Shortcuts Guide`},{keys:[`Esc`],description:`Close preview / dialog`}]},{title:`Views & Formatting`,icon:(0,G.jsx)(RM,{size:15}),items:[{keys:[`m`],description:`Toggle Diff Style (Split / Unified)`},{keys:[`t`],description:`Cycle Tab Indentation Size (2 → 4 → 8)`},{keys:[`w`],description:`Toggle Soft-Wrap Long Lines`},{keys:[`n`],description:`Toggle Line Numbers`},{keys:[`i`],description:`Cycle Diff Indicator Style (+/− → bars → none)`},{keys:[`Shift`,`I`],description:`Cycle Inline Diff Style (word → char → none)`}]}];return(0,G.jsxs)(IF,{open:e,onClose:t,className:`shortcuts-modal`,ariaLabel:`Keyboard shortcuts`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header-title`,children:[(0,G.jsx)(PM,{size:18,className:`shortcuts-icon`}),(0,G.jsx)(`h2`,{children:`Developer Keyboard Shortcuts`})]}),(0,G.jsx)(`button`,{className:`shortcuts-close-btn`,onClick:t,"aria-label":`Close dialog`,children:(0,G.jsx)(aN,{size:16})})]}),(0,G.jsxs)(`div`,{className:`shortcuts-body`,children:[(0,G.jsx)(`div`,{className:`shortcuts-intro`,children:`Vim-style keybindings are enabled! Hover, select, and review code entirely from your home keys.`}),(0,G.jsx)(`div`,{className:`shortcuts-grid`,children:n.map((e,t)=>(0,G.jsxs)(`div`,{className:`shortcuts-section`,children:[(0,G.jsxs)(`h3`,{className:`shortcuts-section-title`,children:[e.icon,(0,G.jsx)(`span`,{children:e.title})]}),(0,G.jsx)(`div`,{className:`shortcuts-list`,children:e.items.map((e,t)=>(0,G.jsxs)(`div`,{className:`shortcuts-row`,children:[(0,G.jsx)(`span`,{className:`shortcuts-desc`,children:e.description}),(0,G.jsx)(`div`,{className:`shortcuts-keys`,children:e.keys.map((t,n)=>(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{className:`vim-kbd`,children:t}),n<e.keys.length-1&&(0,G.jsx)(`span`,{className:`kbd-plus`,children:`+`})]},n))})]},t))})]},t))})]}),(0,G.jsxs)(`div`,{className:`shortcuts-footer`,children:[`Press `,(0,G.jsx)(`kbd`,{className:`vim-kbd-small`,children:`?`}),` to dismiss this menu at any time.`]})]})});function oq({activity:e,onDismiss:t,onJump:n}){if((0,W.useEffect)(()=>{if(!e)return;let n=setTimeout(t,8e3);return()=>clearTimeout(n)},[e,t]),!e)return null;let r=e.body.length>120?`${e.body.slice(0,120)}…`:e.body;return(0,G.jsxs)(`div`,{className:`agent-toast`,role:`status`,"aria-live":`polite`,children:[(0,G.jsxs)(`button`,{className:`agent-toast-body`,onClick:()=>{n(e.filePath),t()},title:`Jump to the file`,children:[(0,G.jsx)(`span`,{className:`agent-toast-icon`,children:(0,G.jsx)(vM,{size:16})}),(0,G.jsxs)(`span`,{className:`agent-toast-text`,children:[(0,G.jsxs)(`span`,{className:`agent-toast-title`,children:[`Agent replied`,e.model?` · ${e.model}`:``]}),(0,G.jsx)(`span`,{className:`agent-toast-file`,children:e.filePath}),(0,G.jsx)(`span`,{className:`agent-toast-preview`,children:r})]})]}),(0,G.jsx)(`button`,{className:`agent-toast-close`,onClick:t,"aria-label":`Dismiss`,children:(0,G.jsx)(aN,{size:14})})]})}var sq=[{id:`nord`,name:`Nord (Main)`,type:`dark`,colors:{bg:`#2e3440`,secondary:`#242933`,accent:`#88c0d0`}},{id:`github-dark`,name:`GitHub Dark`,type:`dark`,colors:{bg:`#0d1117`,secondary:`#161b22`,accent:`#58a6ff`}},{id:`github-dark-dimmed`,name:`GitHub Dark Dimmed`,type:`dark`,colors:{bg:`#22272e`,secondary:`#1c2128`,accent:`#539bf5`}},{id:`github-dark-high-contrast`,name:`GitHub Dark HC`,type:`dark`,colors:{bg:`#0a0c10`,secondary:`#010409`,accent:`#409eff`}},{id:`github-light`,name:`GitHub Light`,type:`light`,colors:{bg:`#ffffff`,secondary:`#f6f8fa`,accent:`#0969da`}},{id:`github-light-high-contrast`,name:`GitHub Light HC`,type:`light`,colors:{bg:`#ffffff`,secondary:`#f6f8fa`,accent:`#0969da`}},{id:`dracula`,name:`Dracula`,type:`dark`,colors:{bg:`#282a36`,secondary:`#1e1f29`,accent:`#bd93f9`}},{id:`one-dark`,name:`One Dark`,type:`dark`,colors:{bg:`#282c34`,secondary:`#21252b`,accent:`#61afef`}},{id:`synthwave-84`,name:`Synthwave '84`,type:`dark`,colors:{bg:`#2b213a`,secondary:`#241b2f`,accent:`#f92aad`}},{id:`tokyo-night`,name:`Tokyo Night`,type:`dark`,colors:{bg:`#1a1b26`,secondary:`#16161e`,accent:`#7aa2f7`}},{id:`catppuccin-mocha`,name:`Catppuccin Mocha`,type:`dark`,colors:{bg:`#1e1e2e`,secondary:`#181825`,accent:`#cba6f7`}},{id:`catppuccin-frappe`,name:`Catppuccin Frappé`,type:`dark`,colors:{bg:`#303446`,secondary:`#292c3c`,accent:`#ca9ee6`}},{id:`catppuccin-macchiato`,name:`Catppuccin Macchiato`,type:`dark`,colors:{bg:`#24273a`,secondary:`#1e2030`,accent:`#c6a0f6`}},{id:`catppuccin-latte`,name:`Catppuccin Latte`,type:`light`,colors:{bg:`#eff1f5`,secondary:`#e6e9ef`,accent:`#8839ef`}},{id:`solarized-dark`,name:`Solarized Dark`,type:`dark`,colors:{bg:`#002b36`,secondary:`#073642`,accent:`#268bd2`}},{id:`solarized-light`,name:`Solarized Light`,type:`light`,colors:{bg:`#fdf6e3`,secondary:`#eee8d5`,accent:`#268bd2`}},{id:`monokai`,name:`Monokai`,type:`dark`,colors:{bg:`#272822`,secondary:`#1d1e19`,accent:`#f92672`}},{id:`ayu-dark`,name:`Ayu Dark`,type:`dark`,colors:{bg:`#0a0e14`,secondary:`#0d1117`,accent:`#e6b450`}},{id:`ayu-light`,name:`Ayu Light`,type:`light`,colors:{bg:`#fafafa`,secondary:`#f3f3f3`,accent:`#ff9900`}},{id:`nightfox`,name:`Nightfox`,type:`dark`,colors:{bg:`#192330`,secondary:`#131a24`,accent:`#719cd6`}},{id:`nordfox`,name:`Nordfox`,type:`dark`,colors:{bg:`#2e3440`,secondary:`#232831`,accent:`#81a1c1`}},{id:`duskfox`,name:`Duskfox`,type:`dark`,colors:{bg:`#232136`,secondary:`#1d1b2d`,accent:`#86b3b3`}},{id:`terafox`,name:`Terafox`,type:`dark`,colors:{bg:`#152528`,secondary:`#0f1c1e`,accent:`#5a93aa`}},{id:`carbonfox`,name:`Carbonfox`,type:`dark`,colors:{bg:`#161616`,secondary:`#111111`,accent:`#78a9ff`}},{id:`dayfox`,name:`Dayfox`,type:`light`,colors:{bg:`#f6f2ee`,secondary:`#ebe5df`,accent:`#2848a9`}},{id:`dawnfox`,name:`Dawnfox`,type:`light`,colors:{bg:`#eae5e5`,secondary:`#e0d8d8`,accent:`#614d85`}},{id:`andromeeda`,name:`Andromeeda`,type:`dark`,colors:{bg:`#090b10`,secondary:`#0e1117`,accent:`#00e8c6`}},{id:`aurora-x`,name:`Aurora X`,type:`dark`,colors:{bg:`#07090f`,secondary:`#0c0e15`,accent:`#2eb5e5`}},{id:`dark-plus`,name:`Dark+ (VS Code)`,type:`dark`,colors:{bg:`#1e1e1e`,secondary:`#252526`,accent:`#0e639c`}},{id:`light-plus`,name:`Light+ (VS Code)`,type:`light`,colors:{bg:`#ffffff`,secondary:`#f3f3f3`,accent:`#007acc`}},{id:`houston`,name:`Houston (Astro)`,type:`dark`,colors:{bg:`#131415`,secondary:`#17191e`,accent:`#ff5d01`}},{id:`laserwave`,name:`Laserwave`,type:`dark`,colors:{bg:`#1b1d28`,secondary:`#181a23`,accent:`#ffe261`}},{id:`material-theme`,name:`Material Theme`,type:`dark`,colors:{bg:`#263238`,secondary:`#1e272c`,accent:`#80cbd8`}},{id:`material-theme-darker`,name:`Material Darker`,type:`dark`,colors:{bg:`#212121`,secondary:`#1a1a1a`,accent:`#80cbd8`}},{id:`material-theme-lighter`,name:`Material Lighter`,type:`light`,colors:{bg:`#fafafa`,secondary:`#eeeded`,accent:`#80cbd8`}},{id:`material-theme-ocean`,name:`Material Ocean`,type:`dark`,colors:{bg:`#0f111a`,secondary:`#090b10`,accent:`#80cbd8`}},{id:`material-theme-palenight`,name:`Material Palenight`,type:`dark`,colors:{bg:`#292d3e`,secondary:`#202331`,accent:`#80cbd8`}},{id:`min-dark`,name:`Min Dark`,type:`dark`,colors:{bg:`#1f1f1f`,secondary:`#181818`,accent:`#ffffff`}},{id:`min-light`,name:`Min Light`,type:`light`,colors:{bg:`#ffffff`,secondary:`#f5f5f5`,accent:`#111111`}},{id:`night-owl`,name:`Night Owl`,type:`dark`,colors:{bg:`#011627`,secondary:`#0b2942`,accent:`#7fdbca`}},{id:`one-light`,name:`One Light`,type:`light`,colors:{bg:`#fafafa`,secondary:`#f0f0f0`,accent:`#40a9ff`}},{id:`plastic`,name:`Plastic`,type:`dark`,colors:{bg:`#21252b`,secondary:`#1b1d23`,accent:`#61afef`}},{id:`poimandres`,name:`Poimandres`,type:`dark`,colors:{bg:`#1b1e28`,secondary:`#171922`,accent:`#50cad2`}},{id:`rose-pine`,name:`Rosé Pine`,type:`dark`,colors:{bg:`#191724`,secondary:`#1f1d2e`,accent:`#c4a7e7`}},{id:`rose-pine-moon`,name:`Rosé Pine Moon`,type:`dark`,colors:{bg:`#232136`,secondary:`#2a283e`,accent:`#c4a7e7`}},{id:`rose-pine-dawn`,name:`Rosé Pine Dawn`,type:`light`,colors:{bg:`#faf4ed`,secondary:`#f2e9e1`,accent:`#907aa9`}},{id:`slack-dark`,name:`Slack Dark`,type:`dark`,colors:{bg:`#1a1d21`,secondary:`#222529`,accent:`#36c5f0`}},{id:`slack-ochre`,name:`Slack Ochre`,type:`dark`,colors:{bg:`#222222`,secondary:`#2b2b2b`,accent:`#e8912d`}},{id:`vesper`,name:`Vesper`,type:`dark`,colors:{bg:`#101010`,secondary:`#161616`,accent:`#ffc600`}},{id:`vitesse-black`,name:`Vitesse Black`,type:`dark`,colors:{bg:`#000000`,secondary:`#0b0b0b`,accent:`#4d9375`}},{id:`vitesse-dark`,name:`Vitesse Dark`,type:`dark`,colors:{bg:`#121212`,secondary:`#181818`,accent:`#4d9375`}},{id:`vitesse-light`,name:`Vitesse Light`,type:`light`,colors:{bg:`#ffffff`,secondary:`#fafafa`,accent:`#1b655f`}}];function cq({open:e,activeTheme:t,onThemeChange:n,onClose:r}){let[i,a]=(0,W.useState)(``),[o,s]=(0,W.useState)(`all`),[c,l]=(0,W.useState)(0),u=(0,W.useRef)(null),d=(0,W.useRef)(null),f=(0,W.useRef)([]);(0,W.useEffect)(()=>{e&&(a(``),s(`all`),l(0),setTimeout(()=>{u.current?.focus()},50))},[e]);let p=(0,W.useMemo)(()=>{let e=i.toLowerCase().trim();return sq.filter(t=>{let n=t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e),r=o===`all`||t.type===o;return n&&r})},[i,o]);return(0,W.useEffect)(()=>{c>=p.length&&l(Math.max(0,p.length-1))},[p,c]),(0,W.useEffect)(()=>{e&&f.current[c]&&f.current[c]?.scrollIntoView({block:`nearest`,behavior:`smooth`})},[c,e]),(0,G.jsx)(IF,{open:e,onClose:r,className:`theme-modal`,ariaLabel:`Theme Selector Modal`,children:(0,G.jsxs)(`div`,{className:`theme-modal-content`,onKeyDown:e=>{let t=p.length;if(e.key===`Escape`){e.preventDefault(),r();return}if(t!==0)switch(e.key){case`ArrowRight`:e.preventDefault(),l(e=>Math.min(e+1,t-1));break;case`ArrowLeft`:e.preventDefault(),l(e=>Math.max(e-1,0));break;case`ArrowDown`:e.preventDefault(),c+2<t?l(c+2):l(t-1);break;case`ArrowUp`:e.preventDefault(),c-2>=0&&l(c-2);break;case`Enter`:e.preventDefault(),p[c]&&(n(p[c].id),r());break;default:break}},children:[(0,G.jsxs)(`div`,{className:`theme-modal-header`,children:[(0,G.jsxs)(`div`,{className:`theme-modal-title-row`,children:[(0,G.jsx)(`h2`,{className:`theme-modal-title`,children:`Select Color Theme`}),(0,G.jsx)(`button`,{className:`theme-modal-close-btn`,onClick:r,"aria-label":`Close`,children:(0,G.jsx)(aN,{size:16})})]}),(0,G.jsxs)(`div`,{className:`theme-modal-search-wrapper`,children:[(0,G.jsx)(XM,{className:`theme-modal-search-icon`,size:16}),(0,G.jsx)(`input`,{ref:u,type:`text`,className:`theme-modal-search-input`,placeholder:`Search themes... (e.g. nordfox, github)`,value:i,onChange:e=>{a(e.target.value),l(0)}}),i&&(0,G.jsx)(`button`,{className:`theme-modal-clear-btn`,onClick:()=>{a(``),l(0),u.current?.focus()},children:(0,G.jsx)(aN,{size:14})})]}),(0,G.jsxs)(`div`,{className:`theme-modal-filters`,children:[(0,G.jsxs)(`button`,{className:`theme-filter-tab ${o===`all`?`active`:``}`,onClick:()=>{s(`all`),l(0),u.current?.focus()},children:[`All Themes (`,sq.length,`)`]}),(0,G.jsxs)(`button`,{className:`theme-filter-tab ${o===`dark`?`active`:``}`,onClick:()=>{s(`dark`),l(0),u.current?.focus()},children:[(0,G.jsx)(zM,{size:12,style:{marginRight:`6px`}}),`Dark (`,sq.filter(e=>e.type===`dark`).length,`)`]}),(0,G.jsxs)(`button`,{className:`theme-filter-tab ${o===`light`?`active`:``}`,onClick:()=>{s(`light`),l(0),u.current?.focus()},children:[(0,G.jsx)(QM,{size:12,style:{marginRight:`6px`}}),`Light (`,sq.filter(e=>e.type===`light`).length,`)`]})]})]}),(0,G.jsx)(`div`,{ref:d,className:`theme-modal-list`,children:p.length===0?(0,G.jsxs)(`div`,{className:`theme-modal-empty`,children:[(0,G.jsxs)(`p`,{className:`theme-modal-empty-text`,children:[`No themes matching "`,i,`"`]}),(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>{a(``),s(`all`),l(0),u.current?.focus()},children:`Reset Search`})]}):(0,G.jsx)(`div`,{className:`theme-modal-grid`,children:p.map((e,i)=>{let a=t===e.id;return(0,G.jsxs)(`button`,{ref:e=>{f.current[i]=e},type:`button`,className:`theme-modal-card ${a?`active`:``} ${c===i?`focused`:``}`,onClick:()=>{n(e.id),r()},onMouseEnter:()=>l(i),children:[(0,G.jsxs)(`div`,{className:`theme-card-info`,children:[(0,G.jsx)(`span`,{className:`theme-card-name`,children:e.name}),(0,G.jsx)(`span`,{className:`theme-card-meta`,children:e.type===`dark`?(0,G.jsx)(`span`,{className:`theme-meta-tag dark-tag`,children:`Dark`}):(0,G.jsx)(`span`,{className:`theme-meta-tag light-tag`,children:`Light`})})]}),(0,G.jsxs)(`div`,{className:`theme-card-right`,children:[(0,G.jsxs)(`span`,{className:`theme-swatches`,children:[(0,G.jsx)(`span`,{className:`theme-swatch`,style:{background:e.colors.bg},title:`Background`}),(0,G.jsx)(`span`,{className:`theme-swatch`,style:{background:e.colors.secondary},title:`Secondary`}),(0,G.jsx)(`span`,{className:`theme-swatch`,style:{background:e.colors.accent},title:`Accent`})]}),(0,G.jsx)(`span`,{className:`theme-card-status`,children:a&&(0,G.jsx)(yM,{size:14,className:`theme-check-icon`})})]})]},e.id)})})}),(0,G.jsxs)(`div`,{className:`theme-modal-footer`,children:[(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`↑`}),` `,(0,G.jsx)(`kbd`,{children:`↓`}),` `,(0,G.jsx)(`kbd`,{children:`←`}),` `,(0,G.jsx)(`kbd`,{children:`→`}),` Navigate`]}),(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`Enter`}),` Select`]}),(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`ESC`}),` Close`]})]})]})})}function lq(){let e=km(),{settings:t,loaded:n,updateSettings:r}=Pj(),[,i]=(0,W.useTransition)(),{patch:a,repoName:o,branch:s,customMode:c,binaryFiles:l,tabSizeMap:u,untrackedFiles:d,loading:f,refreshing:p,error:m}=Dj({staged:t.staged,untracked:t.untracked},!0),{comments:h,addComment:g,removeComment:_,resolveComment:v,unresolveComment:y,addReply:b,editComment:x,editReply:S,removeReply:C,copyAllComments:w,agentActivity:T,clearAgentActivity:E,sendToAgent:D,sending:O,agentWaiting:k}=jj(),{status:A,refresh:j}=Mj(a),[M,N]=(0,W.useState)(null),[P,F]=(0,W.useState)(()=>{try{return localStorage.getItem(`diffing-sidebar-collapsed`)===`true`}catch{return!1}}),[I,L]=(0,W.useState)(()=>{try{let e=localStorage.getItem(`diffing-sidebar-width`);return e?Number(e):320}catch{return 320}}),R=(0,W.useRef)(I);R.current=I;let z=(0,W.useRef)(null),ee=(0,W.useRef)(null),te=(0,W.useRef)(null),B=(0,W.useCallback)(e=>{e.preventDefault();let t=e.clientX,n=R.current,r=ee.current,i=te.current,a=r?r.getBoundingClientRect().left:0,o=n,s=0,c=()=>{s=0,i&&(i.style.transform=`translateX(${a+o}px)`)};i&&(i.style.transform=`translateX(${a+n}px)`,i.classList.add(`sidebar-resize-guide-active`));let l=e=>{let r=e.clientX-t;o=Math.max(240,Math.min(640,n+r)),s||=requestAnimationFrame(c)},u=()=>{s&&cancelAnimationFrame(s),i&&i.classList.remove(`sidebar-resize-guide-active`),L(o);try{localStorage.setItem(`diffing-sidebar-width`,String(o))}catch{}document.removeEventListener(`mousemove`,l),document.removeEventListener(`mouseup`,u),document.body.style.cursor=``,document.body.style.userSelect=``};document.addEventListener(`mousemove`,l),document.addEventListener(`mouseup`,u),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},[]),[V,H]=(0,W.useState)({open:!1,scope:`files`}),ne=(0,W.useCallback)(e=>H({open:!0,scope:e}),[]),re=(0,W.useCallback)(()=>H(e=>({...e,open:!1})),[]),[ie,ae]=(0,W.useState)(!1),[oe,se]=(0,W.useState)(!1),[ce,le]=(0,W.useState)(()=>{try{let e=localStorage.getItem(`diffing-comment-panel-height`);return e?Number(e):220}catch{return 220}}),ue=(0,W.useRef)(ce);ue.current=ce;let U=(0,W.useCallback)(e=>{e.preventDefault();let t=e.clientY,n=ue.current,r=z.current,i=n,a=0,o=()=>{a=0,r?.style.setProperty(`--comment-panel-height`,`${i}px`)},s=e=>{let r=t-e.clientY;i=Math.max(100,Math.min(600,n+r)),a||=requestAnimationFrame(o)},c=()=>{a&&cancelAnimationFrame(a),le(i);try{localStorage.setItem(`diffing-comment-panel-height`,String(i))}catch{}document.removeEventListener(`mousemove`,s),document.removeEventListener(`mouseup`,c),document.body.style.cursor=``,document.body.style.userSelect=``};document.addEventListener(`mousemove`,s),document.addEventListener(`mouseup`,c),document.body.style.cursor=`row-resize`,document.body.style.userSelect=`none`},[]);(0,W.useEffect)(()=>{try{localStorage.setItem(`diffing-comment-panel-height`,String(ce))}catch{}},[ce]);let{viewedFiles:de,setViewed:fe}=Lj(),pe=(0,W.useRef)(null);un([`G`,`S`],()=>ne(`symbols`)),un([`G`,`F`],()=>ne(`all`)),un([`G`,`V`],()=>ne(`files`)),(0,W.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&(e.key===`k`||e.key===`K`)&&(e.preventDefault(),H(e=>e.open?{...e,open:!1}:{open:!0,scope:`all`}))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,W.useEffect)(()=>{try{localStorage.setItem(`diffing-sidebar-collapsed`,String(P))}catch{}},[P]);let me=(0,W.useMemo)(()=>new Set(d),[d]),he=(0,W.useRef)([]),ge=(0,W.useMemo)(()=>{if(!a)return[];try{let e=Ng(a).flatMap(e=>e.files),t=new Set(e.map(e=>e.name));for(let n of l)if(!t.has(n.path)){let t={name:n.path,type:n.type===`added`||n.type===`untracked`?`new`:n.type===`deleted`?`deleted`:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:!0,deletionLines:[],additionLines:[]};e.push(t)}let n=e.map(e=>{let t=he.current.find(t=>t.name===e.name);return t&&t.type===e.type&&t.isPartial===e.isPartial&&t.deletionLines.length===e.deletionLines.length&&t.additionLines.length===e.additionLines.length&&JSON.stringify(t.hunks)===JSON.stringify(e.hunks)?t:e});return he.current=n,n}catch{return[]}},[a,l]),_e=sM(ge),ve=(0,W.useMemo)(()=>{if(!a)return{additions:0,deletions:0};let e=0,t=0,n=0,r=a.length;for(;n<r;){let i=a.indexOf(`
3856
- `,n);i===-1&&(i=r);let o=a.charCodeAt(n);o===43?n+2<r&&a.charCodeAt(n+1)===43&&a.charCodeAt(n+2)===43||e++:o===45&&(n+2<r&&a.charCodeAt(n+1)===45&&a.charCodeAt(n+2)===45||t++),n=i+1}return{additions:e,deletions:t}},[a]),ye=(0,W.useMemo)(()=>{let e=new Map;for(let t of l)e.set(t.path,t);return e},[l]),be=(0,W.useMemo)(()=>{let e={};for(let t of h)e[t.filePath]=(e[t.filePath]??0)+1;return e},[h]),xe=(0,W.useRef)(new Map),Se=(0,W.useMemo)(()=>{let e=new Map,t=new Map;for(let e of h){let n=t.get(e.filePath);n||(n=[],t.set(e.filePath,n)),n.push(e)}for(let[n,r]of t){let t=r.map(e=>({side:e.side,lineNumber:e.lineNumber,metadata:e})),i=xe.current.get(n);i&&JSON.stringify(i)===JSON.stringify(t)?e.set(n,i):e.set(n,t)}return xe.current=e,e},[h]),Ce=(0,W.useCallback)(e=>{N(e);let t=document.getElementById(`file-${e}`);t&&t.scrollIntoView({block:`start`})},[]),we=(0,W.useCallback)((e,t)=>{fe(e,t)},[fe]),Te=(0,W.useCallback)(e=>{i(()=>{r({diffStyle:e})})},[r]),Ee=(0,W.useCallback)(e=>{i(()=>{r(e)})},[r]),De=(0,W.useCallback)(e=>{i(()=>{r({defaultTabSize:e})})},[r]),Oe=(0,W.useCallback)(e=>{i(()=>{r({browser:e})})},[r]),ke=(0,W.useCallback)(e=>{i(()=>{r({theme:e})})},[r]),Ae=(0,W.useCallback)(e=>{i(()=>{r({editorIDE:e})})},[r]),je=(0,W.useCallback)(e=>{i(()=>{r({lineDiffType:e})})},[r]),Me=(0,W.useCallback)(e=>{i(()=>{r({lineWrap:e})})},[r]),Ne=(0,W.useCallback)(e=>{i(()=>{r({diffIndicators:e})})},[r]),Pe=(0,W.useCallback)(e=>{i(()=>{r({showLineNumbers:e})})},[r]),Fe=(0,W.useCallback)(e=>{i(()=>{r({hunkSeparators:e})})},[r]),Ie=(0,W.useCallback)(e=>{i(()=>{r({lineHoverHighlight:e})})},[r]),Le=(0,W.useCallback)(e=>{i(()=>{r({fontSize:e})})},[r]),Re=(0,W.useCallback)(e=>{r({haptics:e})},[r]),ze=(0,W.useCallback)(e=>{r({sounds:e})},[r]),Be=(0,W.useCallback)(()=>{Me(!t.lineWrap)},[t.lineWrap,Me]),Ve=(0,W.useCallback)(()=>{Pe(!t.showLineNumbers)},[t.showLineNumbers,Pe]),He=(0,W.useCallback)(()=>{let e=[`classic`,`bars`,`none`],n=t.diffIndicators||`classic`,r=e[(e.indexOf(n)+1)%e.length];Ne(r)},[t.diffIndicators,Ne]),Ue=(0,W.useCallback)(()=>{let e=[`word`,`word-alt`,`char`,`none`],n=t.lineDiffType||`word`,r=e[(e.indexOf(n)+1)%e.length];je(r)},[t.lineDiffType,je]),We=(0,W.useCallback)(()=>{F(e=>!e)},[]),Ge=(0,W.useCallback)(e=>{if(ge.length===0)return;let t=0;if(M){let n=ge.findIndex(e=>e.name===M);n!==-1&&(t=e===`next`?Math.min(n+1,ge.length-1):Math.max(n-1,0))}let n=ge[t].name;N(n);let r=document.getElementById(`file-${n}`);r&&r.scrollIntoView({block:`start`})},[ge,M,N]),Ke=(0,W.useCallback)(()=>{M&&fe(M,!de.has(M))},[M,de,fe]),qe=(0,W.useCallback)(()=>{Te(t.diffStyle===`split`?`unified`:`split`)},[t.diffStyle,Te]),Je=(0,W.useCallback)(()=>{let e=[2,4,8],n=t.defaultTabSize||4;De(e[(e.indexOf(n)+1)%e.length])},[t.defaultTabSize,De]),Ye=(0,W.useCallback)(()=>{We()},[We]);(0,W.useEffect)(()=>{let e=``,t,n=0,r=r=>{let i=document.activeElement;if(i){let e=i.tagName.toLowerCase();if(e===`input`||e===`textarea`||i.hasAttribute(`contenteditable`))return}clearTimeout(t);let a=r.key;if(r.ctrlKey){a===`d`?(r.preventDefault(),window.scrollBy({top:window.innerHeight/2,behavior:`auto`}),iM(`selection`,`navigate`),e=``):a===`u`&&(r.preventDefault(),window.scrollBy({top:-window.innerHeight/2,behavior:`auto`}),iM(`selection`,`navigate`),e=``);return}if(!(a.length>1&&a!==`Escape`&&a!==`Enter`))if(e+=a,t=setTimeout(()=>{e=``},800),e===`j`){r.preventDefault(),window.scrollBy({top:100,behavior:`auto`});let t=Date.now();t-n>80&&(nM(`navigate`),n=t),e=``}else if(e===`k`){r.preventDefault(),window.scrollBy({top:-100,behavior:`auto`});let t=Date.now();t-n>80&&(nM(`navigate`),n=t),e=``}else e===`gg`?(r.preventDefault(),window.scrollTo({top:0,behavior:`auto`}),iM(`selection`,`navigate`),e=``):e===`G`?(r.preventDefault(),window.scrollTo({top:document.documentElement.scrollHeight,behavior:`auto`}),iM(`selection`,`navigate`),e=``):e===`J`?(r.preventDefault(),Ge(`next`),iM(`selection`,`navigate`),e=``):e===`K`?(r.preventDefault(),Ge(`prev`),iM(`selection`,`navigate`),e=``):e===`v`?(r.preventDefault(),Ke(),iM(`selection`,`toggle`),e=``):e===`m`?(r.preventDefault(),qe(),iM(`selection`,`toggle`),e=``):e===`t`?(r.preventDefault(),Je(),iM(`selection`,`toggle`),e=``):e===`b`?(r.preventDefault(),Ye(),iM(`selection`,`toggle`),e=``):e===`w`?(r.preventDefault(),Be(),iM(`selection`,`toggle`),e=``):e===`n`?(r.preventDefault(),Ve(),iM(`selection`,`toggle`),e=``):e===`i`?(r.preventDefault(),He(),iM(`selection`,`toggle`),e=``):e===`I`?(r.preventDefault(),Ue(),iM(`selection`,`toggle`),e=``):e===`/`?(r.preventDefault(),ne(`text`),iM(`medium`,`open`),e=``):e===`s`?(r.preventDefault(),ne(`symbols`),iM(`medium`,`open`),e=``):e===`gv`?(r.preventDefault(),ne(`files`),iM(`medium`,`open`),e=``):e===`gt`?(r.preventDefault(),se(!0),iM(`medium`,`open`),e=``):e===`?`?(r.preventDefault(),ae(!0),iM(`medium`,`open`),e=``):e.length>=2&&(e=``)};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r),clearTimeout(t)}},[ge,M,de,t.diffStyle,t.defaultTabSize,Ge,Ke,qe,Je,Ye,Be,Ve,He,Ue,se]);let Xe=(0,W.useMemo)(()=>({staged:t.staged,untracked:t.untracked}),[t.staged,t.untracked]);(0,W.useEffect)(()=>{let e=t.theme||`nord`,n=document.documentElement;n.classList.add(`theme-switching`),n.setAttribute(`data-theme`,e);let r=requestAnimationFrame(()=>{requestAnimationFrame(()=>n.classList.remove(`theme-switching`))});return()=>cancelAnimationFrame(r)},[t.theme]);let Ze=(0,W.useMemo)(()=>pj[t.theme||`nord`]||pj.nord,[t.theme]);return(0,W.useEffect)(()=>{e&&e.setRenderOptions({theme:{dark:Ze.type===`dark`?Ze.themeName:`nord`,light:Ze.type===`light`?Ze.themeName:`github-light`}}).catch(e=>{console.error(`Failed to set worker pool render options:`,e)})},[e,Ze]),(0,W.useEffect)(()=>{let e=Ze.type===`dark`?Ze.themeName:`nord`,t=Ze.type===`light`?Ze.themeName:`github-light`;Hf({themes:Array.from(new Set([e,t])),langs:[]}).catch(()=>{})},[Ze]),f?(0,G.jsxs)(`div`,{className:`app skeleton-app`,children:[(0,G.jsxs)(`header`,{className:`skeleton-toolbar`,children:[(0,G.jsx)(`div`,{className:`skeleton-item skeleton-logo`}),(0,G.jsx)(`div`,{className:`skeleton-item skeleton-stats`}),(0,G.jsx)(`div`,{className:`skeleton-item skeleton-actions`})]}),(0,G.jsxs)(`div`,{className:`app-body`,children:[(0,G.jsxs)(`aside`,{className:`sidebar skeleton-sidebar`,children:[(0,G.jsx)(`div`,{className:`skeleton-search`}),(0,G.jsx)(`div`,{className:`skeleton-tree-nodes`,children:Array.from({length:8}).map((e,t)=>(0,G.jsxs)(`div`,{className:`skeleton-tree-node`,style:{paddingLeft:`${t%3*16+16}px`},children:[(0,G.jsx)(`div`,{className:`skeleton-node-icon`}),(0,G.jsx)(`div`,{className:`skeleton-node-text`,style:{width:`${60+t*12%60}px`}})]},t))})]}),(0,G.jsx)(`main`,{className:`main skeleton-main`,children:(0,G.jsx)(`div`,{className:`diff-viewer`,children:Array.from({length:3}).map((e,t)=>(0,G.jsxs)(`div`,{className:`file-diff-card skeleton-card`,children:[(0,G.jsxs)(`div`,{className:`skeleton-card-header`,children:[(0,G.jsx)(`div`,{className:`skeleton-card-title`,style:{width:`${120+t*45%150}px`}}),(0,G.jsx)(`div`,{className:`skeleton-card-badge`})]}),(0,G.jsx)(`div`,{className:`skeleton-card-body`,children:Array.from({length:5}).map((e,t)=>(0,G.jsx)(`div`,{className:`skeleton-code-line`,style:{width:`${50+t*15%45}%`}},t))})]},t))})})]})]}):m?(0,G.jsx)(`div`,{className:`error`,children:(0,G.jsxs)(`p`,{children:[`Error: `,m]})}):(0,G.jsx)(aM,{enabled:t.haptics??!0,soundsEnabled:t.sounds??!0,children:(0,G.jsxs)(`div`,{className:`app`,ref:z,style:{"--sidebar-width":`${I}px`,"--comment-panel-height":`${ce}px`},children:[p&&(0,G.jsx)(`div`,{className:`refresh-bar`,role:`status`,"aria-label":`Refreshing diff`}),(0,G.jsx)(`div`,{className:`sidebar-resize-guide`,ref:te,"aria-hidden":`true`}),(0,G.jsx)(yF,{repoName:o,branch:s,fileCount:ge.length,additions:ve.additions,deletions:ve.deletions,commentCount:h.length,diffStyle:t.diffStyle,diffOptions:Xe,defaultTabSize:t.defaultTabSize,browser:t.browser,theme:t.theme||`nord`,editorIDE:t.editorIDE,customMode:c,lineDiffType:t.lineDiffType,lineWrap:t.lineWrap,diffIndicators:t.diffIndicators,showLineNumbers:t.showLineNumbers,hunkSeparators:t.hunkSeparators,lineHoverHighlight:t.lineHoverHighlight,fontSize:t.fontSize,haptics:t.haptics??!0,sounds:t.sounds??!0,onDiffStyleChange:Te,onDiffOptionsChange:Ee,onDefaultTabSizeChange:De,onBrowserChange:Oe,onOpenThemeModal:()=>se(!0),onEditorIDEChange:Ae,onLineDiffTypeChange:je,onLineWrapChange:Me,onDiffIndicatorsChange:Ne,onShowLineNumbersChange:Pe,onHunkSeparatorsChange:Fe,onLineHoverHighlightChange:Ie,onFontSizeChange:Le,onHapticsChange:Re,onSoundsChange:ze,onOpenSearch:()=>ne(`all`),onCopyComments:w,onSendToAgent:D,agentWaiting:k,sending:O,comments:h,onEditComment:x,onDeleteComment:_}),(0,G.jsxs)(`div`,{className:`app-body`,children:[(0,G.jsxs)(`aside`,{ref:ee,className:`sidebar ${P?`sidebar-collapsed`:``}`,children:[(0,G.jsx)(`div`,{style:{flex:1,minHeight:0,overflow:`hidden`},children:(0,G.jsx)(bK,{files:ge,activeFile:M,commentCounts:be,viewedFiles:de,untrackedFiles:me,onFileClick:Ce,collapsed:P,onToggleCollapse:We})}),!P&&h.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`ct-resize-handle`,onMouseDown:U,role:`separator`,"aria-label":`Resize comments panel`,"aria-orientation":`horizontal`,tabIndex:0}),(0,G.jsx)(`div`,{className:`ct-wrapper`,style:{flexShrink:0},children:(0,G.jsx)(CK,{comments:h,resolveComment:v,unresolveComment:y,removeComment:_,addReply:b,editComment:x,editReply:S,removeReply:C})})]})]}),!P&&(0,G.jsx)(`div`,{className:`sidebar-resize-handle`,onMouseDown:B,role:`separator`,"aria-label":`Resize sidebar`,"aria-orientation":`vertical`,tabIndex:0}),(0,G.jsxs)(`main`,{className:`main`,ref:pe,children:[A.inMerge&&A.conflicts.length>0&&(0,G.jsxs)(`div`,{className:`merge-conflict-banner`,children:[(0,G.jsx)(`strong`,{children:`Merge in progress`}),(0,G.jsxs)(`span`,{children:[A.conflicts.length,` unresolved file`,A.conflicts.length===1?``:`s`,` below. Use the inline buttons to accept current/incoming/both, then "Save & stage".`]})]}),A.conflicts.map(e=>(0,G.jsx)(oI,{filePath:e,theme:t.theme||`nord`,fontSize:t.fontSize,tabSize:u[e]??t.defaultTabSize,onSaved:()=>{j()}},e)),(0,G.jsx)(iI,{files:ge,diffStyle:t.diffStyle,tabSizeMap:u,defaultTabSize:t.defaultTabSize,viewedFiles:de,binaryFiles:ye,theme:t.theme||`nord`,editorIDE:t.editorIDE,lineDiffType:t.lineDiffType,lineWrap:t.lineWrap,diffIndicators:t.diffIndicators,showLineNumbers:t.showLineNumbers,hunkSeparators:t.hunkSeparators,lineHoverHighlight:t.lineHoverHighlight,fontSize:t.fontSize,expandContextByDefault:t.expandContextByDefault,collapsedContextThreshold:t.collapsedContextThreshold,expansionLineCount:t.expansionLineCount,onViewedChange:we,fileAnnotationsMap:Se,onAddComment:g,onDeleteComment:_})]})]}),(0,G.jsx)(XK,{isOpen:V.open,onClose:re,initialScope:V.scope,files:ge,changedEntries:_e,customMode:c,staged:t.staged,onNavigateFile:Ce,theme:t.theme||`nord`,fontSize:t.fontSize,defaultTabSize:t.defaultTabSize,lineWrap:t.lineWrap,showLineNumbers:t.showLineNumbers,lineHoverHighlight:t.lineHoverHighlight}),(0,G.jsx)(iq,{activeFile:M,onShowHelp:()=>ae(!0)}),(0,G.jsx)(aq,{isOpen:ie,onClose:()=>ae(!1)}),(0,G.jsx)(cq,{open:oe,activeTheme:t.theme||`nord`,onThemeChange:ke,onClose:()=>se(!1)}),(0,G.jsx)(oq,{activity:T,onDismiss:E,onJump:Ce})]})})}var uq=new Le;(0,mn.createRoot)(document.getElementById(`root`)).render((0,G.jsx)(He,{client:uq,children:(0,G.jsx)(ot,{children:(0,G.jsx)(Om,{poolOptions:{workerFactory:()=>new k_,poolSize:Math.max(1,Math.min(4,navigator.hardwareConcurrency||2))},highlighterOptions:{theme:{dark:`nord`,light:`github-light`}},children:(0,G.jsx)(ZT,{children:(0,G.jsx)(lq,{})})})})}));export{s as t};
3891
+ [data-column-number], [data-line], [data-line] * {
3892
+ font-family: ${r} !important;
3893
+ font-size: ${n}px !important;
3894
+ font-variant-ligatures: common-ligatures !important;
3895
+ font-feature-settings: "liga" on, "calt" on !important;
3896
+ }
3897
+ `}}):null})]})}var Pq=(0,W.memo)(function({activeFile:e,onShowHelp:t}){let[n,r]=(0,W.useState)(!1);(0,W.useEffect)(()=>{let e=()=>{let e=document.activeElement;if(e){let t=e.tagName.toLowerCase();r(t===`input`||t===`textarea`||e.hasAttribute(`contenteditable`))}else r(!1)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,e);let t=setInterval(e,400);return()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,e),clearInterval(t)}},[]);let i=e?e.split(`/`).pop():null,a=e&&e.includes(`/`)?e.split(`/`).slice(0,-1).join(`/`)+`/`:``;return(0,G.jsxs)(`div`,{className:`vim-status-bar`,children:[(0,G.jsx)(`div`,{className:`vim-mode-badge ${n?`vim-mode-insert`:`vim-mode-normal`}`,children:n?`INSERT`:`NORMAL`}),(0,G.jsxs)(`div`,{className:`vim-status-content`,children:[(0,G.jsx)(DN,{size:12,className:`vim-status-icon`}),e?(0,G.jsxs)(`span`,{className:`vim-status-file`,title:e,children:[(0,G.jsx)(`span`,{className:`vim-file-dir`,children:a}),(0,G.jsx)(`strong`,{className:`vim-file-name`,children:i})]}):(0,G.jsx)(`span`,{className:`vim-status-placeholder`,children:`No active file (J/K to jump)`})]}),(0,G.jsxs)(`button`,{className:`vim-status-help-btn`,onClick:t,title:`View Keyboard Shortcuts (?)`,children:[(0,G.jsx)(JM,{size:13}),(0,G.jsx)(`span`,{children:`Shortcuts`}),(0,G.jsx)(`kbd`,{className:`vim-kbd-small`,children:`?`})]})]})}),Fq=(0,W.memo)(function({isOpen:e,onClose:t,mode:n=`diff`}){let r=n===`plan`?[{title:`Scrolling & Content`,icon:(0,G.jsx)(pN,{size:15}),items:[{keys:[`j`],description:`Scroll Down slightly`},{keys:[`k`],description:`Scroll Up slightly`},{keys:[`Ctrl`,`d`],description:`Scroll Down half page`},{keys:[`Ctrl`,`u`],description:`Scroll Up half page`},{keys:[`g`,`g`],description:`Scroll to Top of plan`},{keys:[`G`],description:`Scroll to Bottom of plan`}]},{title:`Plan Navigation`,icon:(0,G.jsx)(aN,{size:15}),items:[{keys:[`J`],description:`Jump to Next Plan in list`},{keys:[`K`],description:`Jump to Previous Plan in list`},{keys:[`b`],description:`Toggle Plans Sidebar Panel collapse`}]},{title:`Search & Dialogs`,icon:(0,G.jsx)(eN,{size:15}),items:[{keys:[`g`,`t`],description:`Open Theme Selection Modal`},{keys:[`?`],description:`Toggle Keyboard Shortcuts Guide`},{keys:[`Esc`],description:`Close preview / dialog`}]},{title:`Views & Formatting`,icon:(0,G.jsx)(dN,{size:15}),items:[{keys:[`m`],description:`Toggle View Mode (Source / Rendered)`},{keys:[`t`],description:`Cycle Tab Indentation Size (2 → 4 → 8)`},{keys:[`w`],description:`Toggle Soft-Wrap Long Lines`},{keys:[`n`],description:`Toggle Line Numbers`}]}]:[{title:`Scrolling & Diffs`,icon:(0,G.jsx)(pN,{size:15}),items:[{keys:[`j`],description:`Scroll Down slightly`},{keys:[`k`],description:`Scroll Up slightly`},{keys:[`Ctrl`,`d`],description:`Scroll Down half page`},{keys:[`Ctrl`,`u`],description:`Scroll Up half page`},{keys:[`g`,`g`],description:`Scroll to Top of diffs`},{keys:[`G`],description:`Scroll to Bottom of diffs`}]},{title:`File Navigation`,icon:(0,G.jsx)(aN,{size:15}),items:[{keys:[`J`],description:`Jump to Next File Diff`},{keys:[`K`],description:`Jump to Previous File Diff`},{keys:[`v`],description:`Toggle Viewed state for Active File`},{keys:[`b`],description:`Toggle Sidebar Panel collapse`}]},{title:`Search & Dialogs`,icon:(0,G.jsx)(eN,{size:15}),items:[{keys:[`⌘`,`K`],description:`Open Search Palette (files · text · symbols)`},{keys:[`/`],description:`Search file contents (Text scope)`},{keys:[`g`,`f`],description:`Search files (Files scope)`},{keys:[`s`],description:`Search symbols (or "g s")`},{keys:[`g`,`v`],description:`Browse any file in the repo`},{keys:[`g`,`t`],description:`Open Theme Selection Modal`},{keys:[`Tab`],description:`Cycle search scope while open`},{keys:[`⌘`,`↵`],description:`Peek a result in the preview pane`},{keys:[`?`],description:`Toggle Keyboard Shortcuts Guide`},{keys:[`Esc`],description:`Close preview / dialog`}]},{title:`Views & Formatting`,icon:(0,G.jsx)(dN,{size:15}),items:[{keys:[`m`],description:`Toggle Diff Style (Split / Unified)`},{keys:[`t`],description:`Cycle Tab Indentation Size (2 → 4 → 8)`},{keys:[`w`],description:`Toggle Soft-Wrap Long Lines`},{keys:[`n`],description:`Toggle Line Numbers`},{keys:[`i`],description:`Cycle Diff Indicator Style (+/− → bars → none)`},{keys:[`Shift`,`I`],description:`Cycle Inline Diff Style (word → char → none)`}]}];return(0,G.jsxs)(fI,{open:e,onClose:t,className:`shortcuts-modal`,ariaLabel:`Keyboard shortcuts`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header-title`,children:[(0,G.jsx)(aN,{size:18,className:`shortcuts-icon`}),(0,G.jsx)(`h2`,{children:`Developer Keyboard Shortcuts`})]}),(0,G.jsx)(`button`,{className:`shortcuts-close-btn`,onClick:t,"aria-label":`Close dialog`,children:(0,G.jsx)(NN,{size:16})})]}),(0,G.jsxs)(`div`,{className:`shortcuts-body`,children:[(0,G.jsx)(`div`,{className:`shortcuts-intro`,children:`Vim-style keybindings are enabled! Navigate and review plans entirely from your home keys.`}),(0,G.jsx)(`div`,{className:`shortcuts-grid`,children:r.map((e,t)=>(0,G.jsxs)(`div`,{className:`shortcuts-section`,children:[(0,G.jsxs)(`h3`,{className:`shortcuts-section-title`,children:[e.icon,(0,G.jsx)(`span`,{children:e.title})]}),(0,G.jsx)(`div`,{className:`shortcuts-list`,children:e.items.map((e,t)=>(0,G.jsxs)(`div`,{className:`shortcuts-row`,children:[(0,G.jsx)(`span`,{className:`shortcuts-desc`,children:e.description}),(0,G.jsx)(`div`,{className:`shortcuts-keys`,children:e.keys.map((t,n)=>(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{className:`vim-kbd`,children:t}),n<e.keys.length-1&&(0,G.jsx)(`span`,{className:`kbd-plus`,children:`+`})]},n))})]},t))})]},t))})]}),(0,G.jsxs)(`div`,{className:`shortcuts-footer`,children:[`Press `,(0,G.jsx)(`kbd`,{className:`vim-kbd-small`,children:`?`}),` to dismiss this menu at any time.`]})]})});function Iq({activity:e,onDismiss:t,onJump:n}){if((0,W.useEffect)(()=>{if(!e)return;let n=setTimeout(t,8e3);return()=>clearTimeout(n)},[e,t]),!e)return null;let r=e.body.length>120?`${e.body.slice(0,120)}…`:e.body;return(0,G.jsxs)(`div`,{className:`agent-toast`,role:`status`,"aria-live":`polite`,children:[(0,G.jsxs)(`button`,{className:`agent-toast-body`,onClick:()=>{n(e.filePath),t()},title:`Jump to the file`,children:[(0,G.jsx)(`span`,{className:`agent-toast-icon`,children:(0,G.jsx)(VM,{size:16})}),(0,G.jsxs)(`span`,{className:`agent-toast-text`,children:[(0,G.jsxs)(`span`,{className:`agent-toast-title`,children:[`Agent replied`,e.model?` · ${e.model}`:``]}),(0,G.jsx)(`span`,{className:`agent-toast-file`,children:e.filePath}),(0,G.jsx)(`span`,{className:`agent-toast-preview`,children:r})]})]}),(0,G.jsx)(`button`,{className:`agent-toast-close`,onClick:t,"aria-label":`Dismiss`,children:(0,G.jsx)(NN,{size:14})})]})}var Lq=[{id:`nord`,name:`Nord (Main)`,type:`dark`,colors:{bg:`#2e3440`,secondary:`#242933`,accent:`#88c0d0`}},{id:`github-dark`,name:`GitHub Dark`,type:`dark`,colors:{bg:`#0d1117`,secondary:`#161b22`,accent:`#58a6ff`}},{id:`github-dark-dimmed`,name:`GitHub Dark Dimmed`,type:`dark`,colors:{bg:`#22272e`,secondary:`#1c2128`,accent:`#539bf5`}},{id:`github-dark-high-contrast`,name:`GitHub Dark HC`,type:`dark`,colors:{bg:`#0a0c10`,secondary:`#010409`,accent:`#409eff`}},{id:`github-light`,name:`GitHub Light`,type:`light`,colors:{bg:`#ffffff`,secondary:`#f6f8fa`,accent:`#0969da`}},{id:`github-light-high-contrast`,name:`GitHub Light HC`,type:`light`,colors:{bg:`#ffffff`,secondary:`#f6f8fa`,accent:`#0969da`}},{id:`dracula`,name:`Dracula`,type:`dark`,colors:{bg:`#282a36`,secondary:`#1e1f29`,accent:`#bd93f9`}},{id:`one-dark`,name:`One Dark`,type:`dark`,colors:{bg:`#282c34`,secondary:`#21252b`,accent:`#61afef`}},{id:`synthwave-84`,name:`Synthwave '84`,type:`dark`,colors:{bg:`#2b213a`,secondary:`#241b2f`,accent:`#f92aad`}},{id:`tokyo-night`,name:`Tokyo Night`,type:`dark`,colors:{bg:`#1a1b26`,secondary:`#16161e`,accent:`#7aa2f7`}},{id:`catppuccin-mocha`,name:`Catppuccin Mocha`,type:`dark`,colors:{bg:`#1e1e2e`,secondary:`#181825`,accent:`#cba6f7`}},{id:`catppuccin-frappe`,name:`Catppuccin Frappé`,type:`dark`,colors:{bg:`#303446`,secondary:`#292c3c`,accent:`#ca9ee6`}},{id:`catppuccin-macchiato`,name:`Catppuccin Macchiato`,type:`dark`,colors:{bg:`#24273a`,secondary:`#1e2030`,accent:`#c6a0f6`}},{id:`catppuccin-latte`,name:`Catppuccin Latte`,type:`light`,colors:{bg:`#eff1f5`,secondary:`#e6e9ef`,accent:`#8839ef`}},{id:`solarized-dark`,name:`Solarized Dark`,type:`dark`,colors:{bg:`#002b36`,secondary:`#073642`,accent:`#268bd2`}},{id:`solarized-light`,name:`Solarized Light`,type:`light`,colors:{bg:`#fdf6e3`,secondary:`#eee8d5`,accent:`#268bd2`}},{id:`monokai`,name:`Monokai`,type:`dark`,colors:{bg:`#272822`,secondary:`#1d1e19`,accent:`#f92672`}},{id:`ayu-dark`,name:`Ayu Dark`,type:`dark`,colors:{bg:`#0a0e14`,secondary:`#0d1117`,accent:`#e6b450`}},{id:`ayu-light`,name:`Ayu Light`,type:`light`,colors:{bg:`#fafafa`,secondary:`#f3f3f3`,accent:`#ff9900`}},{id:`nightfox`,name:`Nightfox`,type:`dark`,colors:{bg:`#192330`,secondary:`#131a24`,accent:`#719cd6`}},{id:`nordfox`,name:`Nordfox`,type:`dark`,colors:{bg:`#2e3440`,secondary:`#232831`,accent:`#81a1c1`}},{id:`duskfox`,name:`Duskfox`,type:`dark`,colors:{bg:`#232136`,secondary:`#1d1b2d`,accent:`#86b3b3`}},{id:`terafox`,name:`Terafox`,type:`dark`,colors:{bg:`#152528`,secondary:`#0f1c1e`,accent:`#5a93aa`}},{id:`carbonfox`,name:`Carbonfox`,type:`dark`,colors:{bg:`#161616`,secondary:`#111111`,accent:`#78a9ff`}},{id:`dayfox`,name:`Dayfox`,type:`light`,colors:{bg:`#f6f2ee`,secondary:`#ebe5df`,accent:`#2848a9`}},{id:`dawnfox`,name:`Dawnfox`,type:`light`,colors:{bg:`#eae5e5`,secondary:`#e0d8d8`,accent:`#614d85`}},{id:`andromeeda`,name:`Andromeeda`,type:`dark`,colors:{bg:`#090b10`,secondary:`#0e1117`,accent:`#00e8c6`}},{id:`aurora-x`,name:`Aurora X`,type:`dark`,colors:{bg:`#07090f`,secondary:`#0c0e15`,accent:`#2eb5e5`}},{id:`dark-plus`,name:`Dark+ (VS Code)`,type:`dark`,colors:{bg:`#1e1e1e`,secondary:`#252526`,accent:`#0e639c`}},{id:`light-plus`,name:`Light+ (VS Code)`,type:`light`,colors:{bg:`#ffffff`,secondary:`#f3f3f3`,accent:`#007acc`}},{id:`houston`,name:`Houston (Astro)`,type:`dark`,colors:{bg:`#131415`,secondary:`#17191e`,accent:`#ff5d01`}},{id:`laserwave`,name:`Laserwave`,type:`dark`,colors:{bg:`#1b1d28`,secondary:`#181a23`,accent:`#ffe261`}},{id:`material-theme`,name:`Material Theme`,type:`dark`,colors:{bg:`#263238`,secondary:`#1e272c`,accent:`#80cbd8`}},{id:`material-theme-darker`,name:`Material Darker`,type:`dark`,colors:{bg:`#212121`,secondary:`#1a1a1a`,accent:`#80cbd8`}},{id:`material-theme-lighter`,name:`Material Lighter`,type:`light`,colors:{bg:`#fafafa`,secondary:`#eeeded`,accent:`#80cbd8`}},{id:`material-theme-ocean`,name:`Material Ocean`,type:`dark`,colors:{bg:`#0f111a`,secondary:`#090b10`,accent:`#80cbd8`}},{id:`material-theme-palenight`,name:`Material Palenight`,type:`dark`,colors:{bg:`#292d3e`,secondary:`#202331`,accent:`#80cbd8`}},{id:`min-dark`,name:`Min Dark`,type:`dark`,colors:{bg:`#1f1f1f`,secondary:`#181818`,accent:`#ffffff`}},{id:`min-light`,name:`Min Light`,type:`light`,colors:{bg:`#ffffff`,secondary:`#f5f5f5`,accent:`#111111`}},{id:`night-owl`,name:`Night Owl`,type:`dark`,colors:{bg:`#011627`,secondary:`#0b2942`,accent:`#7fdbca`}},{id:`one-light`,name:`One Light`,type:`light`,colors:{bg:`#fafafa`,secondary:`#f0f0f0`,accent:`#40a9ff`}},{id:`plastic`,name:`Plastic`,type:`dark`,colors:{bg:`#21252b`,secondary:`#1b1d23`,accent:`#61afef`}},{id:`poimandres`,name:`Poimandres`,type:`dark`,colors:{bg:`#1b1e28`,secondary:`#171922`,accent:`#50cad2`}},{id:`rose-pine`,name:`Rosé Pine`,type:`dark`,colors:{bg:`#191724`,secondary:`#1f1d2e`,accent:`#c4a7e7`}},{id:`rose-pine-moon`,name:`Rosé Pine Moon`,type:`dark`,colors:{bg:`#232136`,secondary:`#2a283e`,accent:`#c4a7e7`}},{id:`rose-pine-dawn`,name:`Rosé Pine Dawn`,type:`light`,colors:{bg:`#faf4ed`,secondary:`#f2e9e1`,accent:`#907aa9`}},{id:`slack-dark`,name:`Slack Dark`,type:`dark`,colors:{bg:`#1a1d21`,secondary:`#222529`,accent:`#36c5f0`}},{id:`slack-ochre`,name:`Slack Ochre`,type:`dark`,colors:{bg:`#222222`,secondary:`#2b2b2b`,accent:`#e8912d`}},{id:`vesper`,name:`Vesper`,type:`dark`,colors:{bg:`#101010`,secondary:`#161616`,accent:`#ffc600`}},{id:`vitesse-black`,name:`Vitesse Black`,type:`dark`,colors:{bg:`#000000`,secondary:`#0b0b0b`,accent:`#4d9375`}},{id:`vitesse-dark`,name:`Vitesse Dark`,type:`dark`,colors:{bg:`#121212`,secondary:`#181818`,accent:`#4d9375`}},{id:`vitesse-light`,name:`Vitesse Light`,type:`light`,colors:{bg:`#ffffff`,secondary:`#fafafa`,accent:`#1b655f`}}];function Rq({open:e,activeTheme:t,onThemeChange:n,onClose:r}){let[i,a]=(0,W.useState)(``),[o,s]=(0,W.useState)(`all`),[c,l]=(0,W.useState)(0),u=(0,W.useRef)(null),d=(0,W.useRef)(null),f=(0,W.useRef)([]);(0,W.useEffect)(()=>{e&&(a(``),s(`all`),l(0),setTimeout(()=>{u.current?.focus()},50))},[e]);let p=(0,W.useMemo)(()=>{let e=i.toLowerCase().trim();return Lq.filter(t=>{let n=t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e),r=o===`all`||t.type===o;return n&&r})},[i,o]);return(0,W.useEffect)(()=>{c>=p.length&&l(Math.max(0,p.length-1))},[p,c]),(0,W.useEffect)(()=>{e&&f.current[c]&&f.current[c]?.scrollIntoView({block:`nearest`,behavior:`smooth`})},[c,e]),(0,G.jsx)(fI,{open:e,onClose:r,className:`theme-modal`,ariaLabel:`Theme Selector Modal`,children:(0,G.jsxs)(`div`,{className:`theme-modal-content`,onKeyDown:e=>{let t=p.length;if(e.key===`Escape`){e.preventDefault(),r();return}if(t!==0)switch(e.key){case`ArrowRight`:e.preventDefault(),l(e=>Math.min(e+1,t-1));break;case`ArrowLeft`:e.preventDefault(),l(e=>Math.max(e-1,0));break;case`ArrowDown`:e.preventDefault(),c+2<t?l(c+2):l(t-1);break;case`ArrowUp`:e.preventDefault(),c-2>=0&&l(c-2);break;case`Enter`:e.preventDefault(),p[c]&&(n(p[c].id),r());break;default:break}},children:[(0,G.jsxs)(`div`,{className:`theme-modal-header`,children:[(0,G.jsxs)(`div`,{className:`theme-modal-title-row`,children:[(0,G.jsx)(`h2`,{className:`theme-modal-title`,children:`Select Color Theme`}),(0,G.jsx)(`button`,{className:`theme-modal-close-btn`,onClick:r,"aria-label":`Close`,children:(0,G.jsx)(NN,{size:16})})]}),(0,G.jsxs)(`div`,{className:`theme-modal-search-wrapper`,children:[(0,G.jsx)(wN,{className:`theme-modal-search-icon`,size:16}),(0,G.jsx)(`input`,{ref:u,type:`text`,className:`theme-modal-search-input`,placeholder:`Search themes... (e.g. nordfox, github)`,value:i,onChange:e=>{a(e.target.value),l(0)}}),i&&(0,G.jsx)(`button`,{className:`theme-modal-clear-btn`,onClick:()=>{a(``),l(0),u.current?.focus()},children:(0,G.jsx)(NN,{size:14})})]}),(0,G.jsxs)(`div`,{className:`theme-modal-filters`,children:[(0,G.jsxs)(`button`,{className:`theme-filter-tab ${o===`all`?`active`:``}`,onClick:()=>{s(`all`),l(0),u.current?.focus()},children:[`All Themes (`,Lq.length,`)`]}),(0,G.jsxs)(`button`,{className:`theme-filter-tab ${o===`dark`?`active`:``}`,onClick:()=>{s(`dark`),l(0),u.current?.focus()},children:[(0,G.jsx)(fN,{size:12,style:{marginRight:`6px`}}),`Dark (`,Lq.filter(e=>e.type===`dark`).length,`)`]}),(0,G.jsxs)(`button`,{className:`theme-filter-tab ${o===`light`?`active`:``}`,onClick:()=>{s(`light`),l(0),u.current?.focus()},children:[(0,G.jsx)(EN,{size:12,style:{marginRight:`6px`}}),`Light (`,Lq.filter(e=>e.type===`light`).length,`)`]})]})]}),(0,G.jsx)(`div`,{ref:d,className:`theme-modal-list`,children:p.length===0?(0,G.jsxs)(`div`,{className:`theme-modal-empty`,children:[(0,G.jsxs)(`p`,{className:`theme-modal-empty-text`,children:[`No themes matching "`,i,`"`]}),(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>{a(``),s(`all`),l(0),u.current?.focus()},children:`Reset Search`})]}):(0,G.jsx)(`div`,{className:`theme-modal-grid`,children:p.map((e,i)=>{let a=t===e.id;return(0,G.jsxs)(`button`,{ref:e=>{f.current[i]=e},type:`button`,className:`theme-modal-card ${a?`active`:``} ${c===i?`focused`:``}`,onClick:()=>{n(e.id),r()},onMouseEnter:()=>l(i),children:[(0,G.jsxs)(`div`,{className:`theme-card-info`,children:[(0,G.jsx)(`span`,{className:`theme-card-name`,children:e.name}),(0,G.jsx)(`span`,{className:`theme-card-meta`,children:e.type===`dark`?(0,G.jsx)(`span`,{className:`theme-meta-tag dark-tag`,children:`Dark`}):(0,G.jsx)(`span`,{className:`theme-meta-tag light-tag`,children:`Light`})})]}),(0,G.jsxs)(`div`,{className:`theme-card-right`,children:[(0,G.jsxs)(`span`,{className:`theme-swatches`,children:[(0,G.jsx)(`span`,{className:`theme-swatch`,style:{background:e.colors.bg},title:`Background`}),(0,G.jsx)(`span`,{className:`theme-swatch`,style:{background:e.colors.secondary},title:`Secondary`}),(0,G.jsx)(`span`,{className:`theme-swatch`,style:{background:e.colors.accent},title:`Accent`})]}),(0,G.jsx)(`span`,{className:`theme-card-status`,children:a&&(0,G.jsx)(HM,{size:14,className:`theme-check-icon`})})]})]},e.id)})})}),(0,G.jsxs)(`div`,{className:`theme-modal-footer`,children:[(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`↑`}),` `,(0,G.jsx)(`kbd`,{children:`↓`}),` `,(0,G.jsx)(`kbd`,{children:`←`}),` `,(0,G.jsx)(`kbd`,{children:`→`}),` Navigate`]}),(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`Enter`}),` Select`]}),(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`ESC`}),` Close`]})]})]})})}var zq=`Cascadia Code.Cascadia Mono.Consolas.Courier New.Dank Mono.Fantasque Sans Mono.Fira Code.Fira Mono.Geist Mono.Hack.IBM Plex Mono.Inconsolata.Input Mono.JetBrains Mono.Maple Mono.Menlo.Monaco.Monoid.Monaspace Argon.Monaspace Krypton.Monaspace Neon.Monaspace Radon.Monaspace Xenon.Noto Sans Mono.Operator Mono.Roboto Mono.SF Mono.Source Code Pro.Space Mono.Ubuntu Mono.Victor Mono`.split(`.`);async function Bq(){if(`queryLocalFonts`in window)try{let e=await window.queryLocalFonts();return[...new Set(e.map(e=>e.family))].sort((e,t)=>e.localeCompare(t))}catch{}return zq}function Vq({open:e,title:t,defaultLabel:n,activeFont:r,onFontChange:i,onClose:a}){let[o,s]=(0,W.useState)(``),[c,l]=(0,W.useState)([]),[u,d]=(0,W.useState)(!1),[f,p]=(0,W.useState)(0),m=(0,W.useRef)(null),h=(0,W.useRef)(null),g=(0,W.useRef)([]);(0,W.useEffect)(()=>{e&&(s(``),p(0),setTimeout(()=>m.current?.focus(),50),!(c.length>0)&&(d(!0),Bq().then(e=>{l(e),d(!1)})))},[e]);let _=(0,W.useMemo)(()=>{let e=o.toLowerCase().trim();return e?c.filter(t=>t.toLowerCase().includes(e)):c},[c,o]),v=_.length+1;(0,W.useEffect)(()=>{f>=v&&p(Math.max(0,v-1))},[v,f]),(0,W.useEffect)(()=>{e&&(f===0?g.current[0]:g.current[f])?.scrollIntoView({block:`nearest`,behavior:`smooth`})},[f,e]);let y=e=>{i(e),a()},b=e=>{if(e.key===`Escape`){e.preventDefault(),a();return}if(v!==0)switch(e.key){case`ArrowDown`:e.preventDefault(),p(e=>Math.min(e+1,v-1));break;case`ArrowUp`:e.preventDefault(),p(e=>Math.max(e-1,0));break;case`Enter`:e.preventDefault(),f===0?y(null):_[f-1]&&y(_[f-1]);break}},x=!r;return(0,G.jsx)(fI,{open:e,onClose:a,className:`theme-modal`,ariaLabel:`${t} Modal`,children:(0,G.jsxs)(`div`,{className:`theme-modal-content`,onKeyDown:b,children:[(0,G.jsxs)(`div`,{className:`theme-modal-header`,children:[(0,G.jsxs)(`div`,{className:`theme-modal-title-row`,children:[(0,G.jsx)(`h2`,{className:`theme-modal-title`,children:t}),(0,G.jsx)(`button`,{className:`theme-modal-close-btn`,onClick:a,"aria-label":`Close`,children:(0,G.jsx)(NN,{size:16})})]}),(0,G.jsxs)(`div`,{className:`theme-modal-search-wrapper`,children:[(0,G.jsx)(wN,{className:`theme-modal-search-icon`,size:16}),(0,G.jsx)(`input`,{ref:m,type:`text`,className:`theme-modal-search-input`,placeholder:`Search fonts...`,value:o,onChange:e=>{s(e.target.value),p(0)}}),o&&(0,G.jsx)(`button`,{className:`theme-modal-clear-btn`,onClick:()=>{s(``),p(0),m.current?.focus()},children:(0,G.jsx)(NN,{size:14})})]})]}),(0,G.jsx)(`div`,{ref:h,className:`theme-modal-list`,children:u?(0,G.jsx)(`div`,{className:`theme-modal-empty`,children:(0,G.jsx)(`p`,{className:`theme-modal-empty-text`,children:`Loading fonts…`})}):(0,G.jsxs)(`div`,{className:`font-picker-list`,children:[(0,G.jsxs)(`button`,{ref:e=>{g.current[0]=e},type:`button`,className:`font-picker-item ${x?`active`:``} ${f===0?`focused`:``}`,onClick:()=>y(null),onMouseEnter:()=>p(0),children:[(0,G.jsxs)(`span`,{className:`font-picker-name font-picker-default-name`,children:[(0,G.jsx)(AN,{size:13,style:{marginRight:`6px`,opacity:.6}}),n]}),(0,G.jsx)(`span`,{className:`font-picker-status`,children:x&&(0,G.jsx)(HM,{size:14,className:`theme-check-icon`})})]},`__default__`),_.length===0&&o?(0,G.jsxs)(`div`,{className:`theme-modal-empty`,style:{paddingTop:`16px`},children:[(0,G.jsxs)(`p`,{className:`theme-modal-empty-text`,children:[`No fonts matching "`,o,`"`]}),(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>{s(``),p(0),m.current?.focus()},children:`Reset Search`})]}):_.map((e,t)=>{let n=r===e,i=f===t+1;return(0,G.jsxs)(`button`,{ref:e=>{g.current[t+1]=e},type:`button`,className:`font-picker-item ${n?`active`:``} ${i?`focused`:``}`,onClick:()=>y(e),onMouseEnter:()=>p(t+1),children:[(0,G.jsx)(`span`,{className:`font-picker-name`,style:{fontFamily:`"${e}", ui-monospace, monospace`},children:e}),(0,G.jsx)(`span`,{className:`font-picker-status`,children:n&&(0,G.jsx)(HM,{size:14,className:`theme-check-icon`})})]},e)})]})}),(0,G.jsxs)(`div`,{className:`theme-modal-footer`,children:[(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`↑`}),` `,(0,G.jsx)(`kbd`,{children:`↓`}),` Navigate`]}),(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`Enter`}),` Select`]}),(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`ESC`}),` Close`]})]})]})})}function Hq(){let e=km(),{settings:t,loaded:n,updateSettings:r}=qj(),[,i]=(0,W.useTransition)(),{patch:a,repoName:o,branch:s,customMode:c,binaryFiles:l,tabSizeMap:u,untrackedFiles:d,loading:f,refreshing:p,error:m}=Dj({staged:t.staged,untracked:t.untracked},!0),{comments:h,addComment:g,removeComment:_,resolveComment:v,unresolveComment:y,addReply:b,editComment:x,editReply:S,removeReply:C,copyAllComments:w,agentActivity:T,clearAgentActivity:E,sendToAgent:D,sending:O,agentWaiting:k}=Mj(),{plans:A}=Fj(),j=(0,W.useMemo)(()=>A.filter(e=>e.decision===`pending`).length,[A]),{status:M,refresh:N}=Uj(a),[P,F]=(0,W.useState)(null),[I,L]=(0,W.useState)(()=>{try{return CM(`diffing-sidebar-collapsed`)===`true`}catch{return!1}}),[R,z]=(0,W.useState)(()=>{try{let e=CM(`diffing-sidebar-width`);return e?Number(e):320}catch{return 320}}),ee=(0,W.useRef)(R);ee.current=R;let te=(0,W.useRef)(null),B=(0,W.useRef)(null),V=(0,W.useRef)(null),H=(0,W.useCallback)(e=>{e.preventDefault();let t=e.clientX,n=ee.current,r=B.current,i=V.current,a=r?r.getBoundingClientRect().left:0,o=n,s=0,c=()=>{s=0,i&&(i.style.transform=`translateX(${a+o}px)`)};i&&(i.style.transform=`translateX(${a+n}px)`,i.classList.add(`sidebar-resize-guide-active`));let l=e=>{let r=e.clientX-t;o=Math.max(240,Math.min(640,n+r)),s||=requestAnimationFrame(c)},u=()=>{s&&cancelAnimationFrame(s),i&&i.classList.remove(`sidebar-resize-guide-active`),z(o);try{DM(`diffing-sidebar-width`,String(o))}catch{}document.removeEventListener(`mousemove`,l),document.removeEventListener(`mouseup`,u),document.body.style.cursor=``,document.body.style.userSelect=``};document.addEventListener(`mousemove`,l),document.addEventListener(`mouseup`,u),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},[]),[ne,re]=(0,W.useState)({open:!1,scope:`files`}),ie=(0,W.useCallback)(e=>re({open:!0,scope:e}),[]),ae=(0,W.useCallback)(()=>re(e=>({...e,open:!1})),[]),[oe,se]=(0,W.useState)(!1),[ce,le]=(0,W.useState)(!1),[ue,U]=(0,W.useState)(!1),[de,fe]=(0,W.useState)(!1),[pe,me]=(0,W.useState)(()=>{try{let e=CM(`diffing-comment-panel-height`);return e?Number(e):220}catch{return 220}}),he=(0,W.useRef)(pe);he.current=pe;let ge=(0,W.useCallback)(e=>{e.preventDefault();let t=e.clientY,n=he.current,r=te.current,i=n,a=0,o=()=>{a=0,r?.style.setProperty(`--comment-panel-height`,`${i}px`)},s=e=>{let r=t-e.clientY;i=Math.max(100,Math.min(600,n+r)),a||=requestAnimationFrame(o)},c=()=>{a&&cancelAnimationFrame(a),me(i);try{DM(`diffing-comment-panel-height`,String(i))}catch{}document.removeEventListener(`mousemove`,s),document.removeEventListener(`mouseup`,c),document.body.style.cursor=``,document.body.style.userSelect=``};document.addEventListener(`mousemove`,s),document.addEventListener(`mouseup`,c),document.body.style.cursor=`row-resize`,document.body.style.userSelect=`none`},[]);(0,W.useEffect)(()=>{try{DM(`diffing-comment-panel-height`,String(pe))}catch{}},[pe]);let{viewedFiles:_e,setViewed:ve}=Zj(),ye=(0,W.useRef)(null);un([`G`,`S`],()=>ie(`symbols`)),un([`G`,`F`],()=>ie(`all`)),un([`G`,`V`],()=>ie(`files`)),(0,W.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&(e.key===`k`||e.key===`K`)&&(e.preventDefault(),re(e=>e.open?{...e,open:!1}:{open:!0,scope:`all`}))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,W.useEffect)(()=>{try{DM(`diffing-sidebar-collapsed`,String(I))}catch{}},[I]);let be=(0,W.useMemo)(()=>new Set(d),[d]),xe=(0,W.useRef)([]),Se=(0,W.useMemo)(()=>{if(!a)return[];try{let e=Ng(a).flatMap(e=>e.files),t=new Set(e.map(e=>e.name));for(let n of l)if(!t.has(n.path)){let t={name:n.path,type:n.type===`added`||n.type===`untracked`?`new`:n.type===`deleted`?`deleted`:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:!0,deletionLines:[],additionLines:[]};e.push(t)}let n=e.map(e=>{let t=xe.current.find(t=>t.name===e.name);return t&&t.type===e.type&&t.isPartial===e.isPartial&&t.deletionLines.length===e.deletionLines.length&&t.additionLines.length===e.additionLines.length&&JSON.stringify(t.hunks)===JSON.stringify(e.hunks)?t:e});return xe.current=n,n}catch{return[]}},[a,l]),Ce=kM(Se),we=(0,W.useMemo)(()=>{if(!a)return{additions:0,deletions:0};let e=0,t=0,n=0,r=a.length;for(;n<r;){let i=a.indexOf(`
3898
+ `,n);i===-1&&(i=r);let o=a.charCodeAt(n);o===43?n+2<r&&a.charCodeAt(n+1)===43&&a.charCodeAt(n+2)===43||e++:o===45&&(n+2<r&&a.charCodeAt(n+1)===45&&a.charCodeAt(n+2)===45||t++),n=i+1}return{additions:e,deletions:t}},[a]),Te=(0,W.useMemo)(()=>{let e=new Map;for(let t of l)e.set(t.path,t);return e},[l]),Ee=(0,W.useMemo)(()=>{let e={};for(let t of h)e[t.filePath]=(e[t.filePath]??0)+1;return e},[h]),De=(0,W.useRef)(new Map),Oe=(0,W.useMemo)(()=>{let e=new Map,t=new Map;for(let e of h){let n=t.get(e.filePath);n||(n=[],t.set(e.filePath,n)),n.push(e)}for(let[n,r]of t){let t=r.map(e=>({side:e.side,lineNumber:e.lineNumber,metadata:e})),i=De.current.get(n);i&&JSON.stringify(i)===JSON.stringify(t)?e.set(n,i):e.set(n,t)}return De.current=e,e},[h]),ke=(0,W.useCallback)(e=>{F(e);let t=document.getElementById(`file-${e}`);t&&t.scrollIntoView({block:`start`})},[]),Ae=(0,W.useCallback)((e,t)=>{ve(e,t)},[ve]),je=(0,W.useCallback)(e=>{i(()=>{r({diffStyle:e})})},[r]),Me=(0,W.useCallback)(e=>{i(()=>{r(e)})},[r]),Ne=(0,W.useCallback)(e=>{i(()=>{r({defaultTabSize:e})})},[r]),Pe=(0,W.useCallback)(e=>{i(()=>{r({browser:e})})},[r]),Fe=(0,W.useCallback)(e=>{i(()=>{r({theme:e})})},[r]),Ie=(0,W.useCallback)(e=>{i(()=>{r({editorIDE:e})})},[r]),Le=(0,W.useCallback)(e=>{i(()=>{r({lineDiffType:e})})},[r]),Re=(0,W.useCallback)(e=>{i(()=>{r({lineWrap:e})})},[r]),ze=(0,W.useCallback)(e=>{i(()=>{r({diffIndicators:e})})},[r]),Be=(0,W.useCallback)(e=>{i(()=>{r({showLineNumbers:e})})},[r]),Ve=(0,W.useCallback)(e=>{i(()=>{r({hunkSeparators:e})})},[r]),He=(0,W.useCallback)(e=>{i(()=>{r({lineHoverHighlight:e})})},[r]),Ue=(0,W.useCallback)(e=>{i(()=>{r({fontSize:e})})},[r]),We=(0,W.useCallback)(e=>{r({haptics:e})},[r]),Ge=(0,W.useCallback)(e=>{r({sounds:e})},[r]),Ke=(0,W.useCallback)(e=>{r({uiFont:e})},[r]),qe=(0,W.useCallback)(e=>{r({monoFont:e})},[r]),Je=(0,W.useCallback)(()=>{Re(!t.lineWrap)},[t.lineWrap,Re]),Ye=(0,W.useCallback)(()=>{Be(!t.showLineNumbers)},[t.showLineNumbers,Be]),Xe=(0,W.useCallback)(()=>{let e=[`classic`,`bars`,`none`],n=t.diffIndicators||`classic`,r=e[(e.indexOf(n)+1)%e.length];ze(r)},[t.diffIndicators,ze]),Ze=(0,W.useCallback)(()=>{let e=[`word`,`word-alt`,`char`,`none`],n=t.lineDiffType||`word`,r=e[(e.indexOf(n)+1)%e.length];Le(r)},[t.lineDiffType,Le]),Qe=(0,W.useCallback)(()=>{L(e=>!e)},[]),$e=(0,W.useCallback)(e=>{if(Se.length===0)return;let t=0;if(P){let n=Se.findIndex(e=>e.name===P);n!==-1&&(t=e===`next`?Math.min(n+1,Se.length-1):Math.max(n-1,0))}let n=Se[t].name;F(n);let r=document.getElementById(`file-${n}`);r&&r.scrollIntoView({block:`start`})},[Se,P,F]),et=(0,W.useCallback)(()=>{P&&ve(P,!_e.has(P))},[P,_e,ve]),tt=(0,W.useCallback)(()=>{je(t.diffStyle===`split`?`unified`:`split`)},[t.diffStyle,je]),nt=(0,W.useCallback)(()=>{let e=[2,4,8],n=t.defaultTabSize||4;Ne(e[(e.indexOf(n)+1)%e.length])},[t.defaultTabSize,Ne]),rt=(0,W.useCallback)(()=>{Qe()},[Qe]);(0,W.useEffect)(()=>{let e=``,t,n=0,r=r=>{let i=document.activeElement;if(i){let e=i.tagName.toLowerCase();if(e===`input`||e===`textarea`||i.hasAttribute(`contenteditable`))return}clearTimeout(t);let a=r.key;if(r.ctrlKey){a===`d`?(r.preventDefault(),window.scrollBy({top:window.innerHeight/2,behavior:`auto`}),vM(`selection`,`navigate`),e=``):a===`u`&&(r.preventDefault(),window.scrollBy({top:-window.innerHeight/2,behavior:`auto`}),vM(`selection`,`navigate`),e=``);return}if(!(a.length>1&&a!==`Escape`&&a!==`Enter`))if(e+=a,t=setTimeout(()=>{e=``},800),e===`j`){r.preventDefault(),window.scrollBy({top:100,behavior:`auto`});let t=Date.now();t-n>80&&(gM(`navigate`),n=t),e=``}else if(e===`k`){r.preventDefault(),window.scrollBy({top:-100,behavior:`auto`});let t=Date.now();t-n>80&&(gM(`navigate`),n=t),e=``}else e===`gg`?(r.preventDefault(),window.scrollTo({top:0,behavior:`auto`}),vM(`selection`,`navigate`),e=``):e===`G`?(r.preventDefault(),window.scrollTo({top:document.documentElement.scrollHeight,behavior:`auto`}),vM(`selection`,`navigate`),e=``):e===`J`?(r.preventDefault(),$e(`next`),vM(`selection`,`navigate`),e=``):e===`K`?(r.preventDefault(),$e(`prev`),vM(`selection`,`navigate`),e=``):e===`v`?(r.preventDefault(),et(),vM(`selection`,`toggle`),e=``):e===`m`?(r.preventDefault(),tt(),vM(`selection`,`toggle`),e=``):e===`t`?(r.preventDefault(),nt(),vM(`selection`,`toggle`),e=``):e===`b`?(r.preventDefault(),rt(),vM(`selection`,`toggle`),e=``):e===`w`?(r.preventDefault(),Je(),vM(`selection`,`toggle`),e=``):e===`n`?(r.preventDefault(),Ye(),vM(`selection`,`toggle`),e=``):e===`i`?(r.preventDefault(),Xe(),vM(`selection`,`toggle`),e=``):e===`I`?(r.preventDefault(),Ze(),vM(`selection`,`toggle`),e=``):e===`/`?(r.preventDefault(),ie(`text`),vM(`medium`,`open`),e=``):e===`s`?(r.preventDefault(),ie(`symbols`),vM(`medium`,`open`),e=``):e===`gv`?(r.preventDefault(),ie(`files`),vM(`medium`,`open`),e=``):e===`gt`?(r.preventDefault(),le(!0),vM(`medium`,`open`),e=``):e===`?`?(r.preventDefault(),se(!0),vM(`medium`,`open`),e=``):e.length>=2&&(e=``)};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r),clearTimeout(t)}},[Se,P,_e,t.diffStyle,t.defaultTabSize,$e,et,tt,nt,rt,Je,Ye,Xe,Ze,le]);let it=(0,W.useMemo)(()=>({staged:t.staged,untracked:t.untracked}),[t.staged,t.untracked]);(0,W.useEffect)(()=>{let e=t.theme||`nord`,n=document.documentElement;n.classList.add(`theme-switching`),n.setAttribute(`data-theme`,e);let r=requestAnimationFrame(()=>{requestAnimationFrame(()=>n.classList.remove(`theme-switching`))});return()=>cancelAnimationFrame(r)},[t.theme]),Jj(n,t.uiFont,t.monoFont);let at=(0,W.useMemo)(()=>Kj(t.monoFont),[t.monoFont]),ot=(0,W.useMemo)(()=>pj[t.theme||`nord`]||pj.nord,[t.theme]);return(0,W.useEffect)(()=>{e&&e.setRenderOptions({theme:{dark:ot.type===`dark`?ot.themeName:`nord`,light:ot.type===`light`?ot.themeName:`github-light`}}).catch(e=>{console.error(`Failed to set worker pool render options:`,e)})},[e,ot]),(0,W.useEffect)(()=>{let e=ot.type===`dark`?ot.themeName:`nord`,t=ot.type===`light`?ot.themeName:`github-light`;Hf({themes:Array.from(new Set([e,t])),langs:[]}).catch(()=>{})},[ot]),f?(0,G.jsxs)(`div`,{className:`app skeleton-app`,style:{"--sidebar-width":`${R}px`,"--comment-panel-height":`${pe}px`},children:[(0,G.jsxs)(`header`,{className:`skeleton-toolbar`,children:[(0,G.jsx)(`div`,{className:`skeleton-item skeleton-logo`}),(0,G.jsx)(`div`,{className:`skeleton-item skeleton-stats`}),(0,G.jsx)(`div`,{className:`skeleton-item skeleton-actions`})]}),(0,G.jsxs)(`div`,{className:`app-body`,children:[(0,G.jsx)(`aside`,{className:`sidebar skeleton-sidebar ${I?`sidebar-collapsed`:``}`,children:!I&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`skeleton-search`}),(0,G.jsx)(`div`,{className:`skeleton-tree-nodes`,children:Array.from({length:8}).map((e,t)=>(0,G.jsxs)(`div`,{className:`skeleton-tree-node`,style:{paddingLeft:`${t%3*16+16}px`},children:[(0,G.jsx)(`div`,{className:`skeleton-node-icon`}),(0,G.jsx)(`div`,{className:`skeleton-node-text`,style:{width:`${60+t*12%60}px`}})]},t))})]})}),!I&&(0,G.jsx)(`div`,{className:`sidebar-resize-handle`,style:{cursor:`default`}}),(0,G.jsx)(`main`,{className:`main skeleton-main`,children:(0,G.jsx)(`div`,{className:`diff-viewer`,children:Array.from({length:3}).map((e,t)=>(0,G.jsxs)(`div`,{className:`file-diff-card skeleton-card`,children:[(0,G.jsxs)(`div`,{className:`skeleton-card-header`,children:[(0,G.jsx)(`div`,{className:`skeleton-card-title`,style:{width:`${120+t*45%150}px`}}),(0,G.jsx)(`div`,{className:`skeleton-card-badge`})]}),(0,G.jsx)(`div`,{className:`skeleton-card-body`,children:Array.from({length:5}).map((e,t)=>(0,G.jsx)(`div`,{className:`skeleton-code-line`,style:{width:`${50+t*15%45}%`}},t))})]},t))})})]})]}):m?(0,G.jsx)(`div`,{className:`error`,children:(0,G.jsxs)(`p`,{children:[`Error: `,m]})}):(0,G.jsx)(yM,{enabled:t.haptics??!0,soundsEnabled:t.sounds??!0,children:(0,G.jsxs)(`div`,{className:`app`,ref:te,style:{"--sidebar-width":`${R}px`,"--comment-panel-height":`${pe}px`},children:[p&&(0,G.jsx)(`div`,{className:`refresh-bar`,role:`status`,"aria-label":`Refreshing diff`}),(0,G.jsx)(`div`,{className:`sidebar-resize-guide`,ref:V,"aria-hidden":`true`}),(0,G.jsx)(YF,{repoName:o,branch:s,fileCount:Se.length,additions:we.additions,deletions:we.deletions,commentCount:h.length,planCount:A.length,pendingPlanCount:j,onOpenPlans:()=>Rj(`/plan`),diffStyle:t.diffStyle,diffOptions:it,defaultTabSize:t.defaultTabSize,browser:t.browser,theme:t.theme||`nord`,editorIDE:t.editorIDE,customMode:c,lineDiffType:t.lineDiffType,lineWrap:t.lineWrap,diffIndicators:t.diffIndicators,showLineNumbers:t.showLineNumbers,hunkSeparators:t.hunkSeparators,lineHoverHighlight:t.lineHoverHighlight,fontSize:t.fontSize,haptics:t.haptics??!0,sounds:t.sounds??!0,uiFont:t.uiFont,monoFont:t.monoFont,onDiffStyleChange:je,onDiffOptionsChange:Me,onDefaultTabSizeChange:Ne,onBrowserChange:Pe,onOpenThemeModal:()=>le(!0),onEditorIDEChange:Ie,onLineDiffTypeChange:Le,onLineWrapChange:Re,onDiffIndicatorsChange:ze,onShowLineNumbersChange:Be,onHunkSeparatorsChange:Ve,onLineHoverHighlightChange:He,onFontSizeChange:Ue,onHapticsChange:We,onSoundsChange:Ge,onOpenUiFontModal:()=>U(!0),onOpenMonoFontModal:()=>fe(!0),onOpenSearch:()=>ie(`all`),onCopyComments:w,onSendToAgent:D,agentWaiting:k,sending:O,comments:h,onEditComment:x,onDeleteComment:_}),(0,G.jsxs)(`div`,{className:`app-body`,children:[(0,G.jsxs)(`aside`,{ref:B,className:`sidebar ${I?`sidebar-collapsed`:``}`,children:[(0,G.jsx)(`div`,{style:{flex:1,minHeight:0,overflow:`hidden`},children:(0,G.jsx)(XK,{files:Se,activeFile:P,commentCounts:Ee,viewedFiles:_e,untrackedFiles:be,onFileClick:ke,collapsed:I,onToggleCollapse:Qe})}),!I&&h.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`ct-resize-handle`,onMouseDown:ge,role:`separator`,"aria-label":`Resize comments panel`,"aria-orientation":`horizontal`,tabIndex:0}),(0,G.jsx)(`div`,{className:`ct-wrapper`,style:{flexShrink:0},children:(0,G.jsx)($K,{comments:h,resolveComment:v,unresolveComment:y,removeComment:_,addReply:b,editComment:x,editReply:S,removeReply:C})})]})]}),!I&&(0,G.jsx)(`div`,{className:`sidebar-resize-handle`,onMouseDown:H,role:`separator`,"aria-label":`Resize sidebar`,"aria-orientation":`vertical`,tabIndex:0}),(0,G.jsxs)(`main`,{className:`main`,ref:ye,children:[M.inMerge&&M.conflicts.length>0&&(0,G.jsxs)(`div`,{className:`merge-conflict-banner`,children:[(0,G.jsx)(`strong`,{children:`Merge in progress`}),(0,G.jsxs)(`span`,{children:[M.conflicts.length,` unresolved file`,M.conflicts.length===1?``:`s`,` below. Use the inline buttons to accept current/incoming/both, then "Save & stage".`]})]}),M.conflicts.map(e=>(0,G.jsx)(II,{filePath:e,theme:t.theme||`nord`,fontSize:t.fontSize,monoFontFamily:at,tabSize:u[e]??t.defaultTabSize,onSaved:()=>{N()}},e)),(0,G.jsx)(PI,{files:Se,diffStyle:t.diffStyle,tabSizeMap:u,defaultTabSize:t.defaultTabSize,viewedFiles:_e,binaryFiles:Te,theme:t.theme||`nord`,editorIDE:t.editorIDE,lineDiffType:t.lineDiffType,lineWrap:t.lineWrap,diffIndicators:t.diffIndicators,showLineNumbers:t.showLineNumbers,hunkSeparators:t.hunkSeparators,lineHoverHighlight:t.lineHoverHighlight,fontSize:t.fontSize,monoFontFamily:at,expandContextByDefault:t.expandContextByDefault,collapsedContextThreshold:t.collapsedContextThreshold,expansionLineCount:t.expansionLineCount,onViewedChange:Ae,fileAnnotationsMap:Oe,onAddComment:g,onDeleteComment:_})]})]}),(0,G.jsx)(Eq,{isOpen:ne.open,onClose:ae,initialScope:ne.scope,files:Se,changedEntries:Ce,customMode:c,staged:t.staged,onNavigateFile:ke,theme:t.theme||`nord`,fontSize:t.fontSize,monoFontFamily:at,defaultTabSize:t.defaultTabSize,lineWrap:t.lineWrap,showLineNumbers:t.showLineNumbers,lineHoverHighlight:t.lineHoverHighlight}),(0,G.jsx)(Pq,{activeFile:P,onShowHelp:()=>se(!0)}),(0,G.jsx)(Fq,{isOpen:oe,onClose:()=>se(!1)}),(0,G.jsx)(Rq,{open:ce,activeTheme:t.theme||`nord`,onThemeChange:Fe,onClose:()=>le(!1)}),(0,G.jsx)(Vq,{open:ue,title:`Select UI Font`,defaultLabel:`Default (Geist Mono, from CDN)`,activeFont:t.uiFont,onFontChange:Ke,onClose:()=>U(!1)}),(0,G.jsx)(Vq,{open:de,title:`Select Code Font`,defaultLabel:`Default (JetBrains Mono, from CDN)`,activeFont:t.monoFont,onFontChange:qe,onClose:()=>fe(!1)}),(0,G.jsx)(Iq,{activity:T,onDismiss:E,onJump:ke})]})})}function Uq(e,t){if(t<1)return;let n=e.split(`
3899
+ `),r=Math.min(t,n.length);for(let e=r-1;e>=0;e--){let t=/^\s{0,3}(#{1,6})\s+(.*?)\s*#*\s*$/.exec(n[e]);if(t)return t[2].trim()}}function Wq(e,t,n){if(t<1)return``;let r=e.split(`
3900
+ `),i=Math.max(1,t),a=Math.min(n,r.length);return a<i?``:r.slice(i-1,a).join(`
3901
+ `)}function Gq({role:e,size:t=16}){return e===`agent`?(0,G.jsx)(`div`,{className:`comment-avatar-circle comment-avatar-agent`,style:{width:`${t*2}px`,height:`${t*2}px`},children:(0,G.jsx)(VM,{size:t,"aria-hidden":`true`})}):(0,G.jsx)(`div`,{className:`comment-avatar-circle comment-avatar-user`,style:{width:`${t*2}px`,height:`${t*2}px`},children:(0,G.jsx)(MN,{size:t,"aria-hidden":`true`})})}function Kq({comment:e,onResolve:t,onUnresolve:n,onDelete:r,onEdit:i,onReply:a,onEditReply:o,onDeleteReply:s}){let[,c]=(0,W.useState)(0),l=e.status===`resolved`,[u,d]=(0,W.useState)(l),[f,p]=(0,W.useState)(!1),[m,h]=(0,W.useState)(!1),[g,_]=(0,W.useState)(!1),[v,y]=(0,W.useState)(null);(0,W.useEffect)(()=>d(e.status===`resolved`),[e.status]),(0,W.useEffect)(()=>{let e=setInterval(()=>c(e=>e+1),3e4);return()=>clearInterval(e)},[]);let b=e.lineNumber===0,x=e.startLineNumber&&e.startLineNumber!==e.lineNumber,S=(0,G.jsxs)(G.Fragment,{children:[e.sectionTitle&&(0,G.jsxs)(`span`,{className:`plan-comment-section-chip`,title:`Section: ${e.sectionTitle}`,children:[`§\xA0`,e.sectionTitle]}),b?(0,G.jsx)(`span`,{className:`plan-comment-line-chip plan-comment-line-chip-general`,children:`Whole plan`}):(0,G.jsx)(`span`,{className:`plan-comment-line-chip`,children:x?`L${e.startLineNumber}-${e.lineNumber}`:`L${e.lineNumber}`})]});return l&&u?(0,G.jsxs)(`div`,{className:`comment-resolved-collapsed plan-comment-resolved-collapsed`,children:[(0,G.jsxs)(`div`,{className:`plan-comment-resolved-left`,children:[(0,G.jsx)(qM,{size:15,style:{color:`var(--success)`}}),(0,G.jsx)(`span`,{style:{fontWeight:600},children:`Resolved`}),S,(0,G.jsx)(`span`,{children:`•`}),(0,G.jsx)(`span`,{children:e.replies?.length?`${e.replies.length+1} comments`:`1 comment`})]}),(0,G.jsx)(`button`,{className:`plan-comment-show-resolved`,onClick:()=>d(!1),children:`Show`})]}):(0,G.jsxs)(`div`,{className:`comment-bubble-canvas ${l?`comment-bubble-canvas-resolved`:``}`,id:`plan-comment-${e.id}`,role:`article`,children:[(0,G.jsxs)(`div`,{className:`comment-node ${l?`comment-node-resolved`:``}`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:(0,G.jsx)(Gq,{role:`user`,size:16})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge comment-node-badge-user`,children:`User`}),(0,G.jsxs)(`span`,{className:`comment-node-time`,style:{display:`flex`,alignItems:`center`,gap:`8px`,flexWrap:`wrap`},children:[dj(e.createdAt),S]}),l&&(0,G.jsxs)(`span`,{className:`comment-canvas-resolved-banner`,style:{marginLeft:`8px`},children:[(0,G.jsx)(qM,{size:13}),`Resolved`]}),!l&&!m&&(0,G.jsxs)(`div`,{className:`comment-node-actions`,children:[(0,G.jsx)(`button`,{className:`comment-node-btn`,onClick:()=>h(!0),title:`Edit comment`,"aria-label":`Edit comment`,children:(0,G.jsx)(vN,{size:13,"aria-hidden":`true`})}),g?(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`4px`},children:[(0,G.jsxs)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:r,title:`Confirm delete`,style:{color:`var(--danger)`,background:`var(--feedback-danger-bg)`,fontWeight:600,fontSize:`11px`,border:`1px solid var(--feedback-danger-border)`,padding:`2px 6px`,width:`auto`,height:`auto`,display:`flex`,alignItems:`center`,gap:`2px`},children:[(0,G.jsx)(kN,{size:11}),`Delete?`]}),(0,G.jsx)(`button`,{className:`comment-node-btn`,onClick:()=>_(!1),title:`Cancel delete`,style:{fontSize:`11px`,padding:`2px 6px`,width:`auto`,height:`auto`},children:`Cancel`})]}):(0,G.jsx)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>_(!0),title:`Delete comment`,"aria-label":`Delete comment`,children:(0,G.jsx)(ON,{size:13,"aria-hidden":`true`})})]})]}),m?(0,G.jsx)(`div`,{style:{marginTop:`8px`},children:(0,G.jsx)(CI,{draftKey:`plan-edit:${e.id}`,initialBody:e.body,lineContent:e.lineContent,onSubmit:e=>{i(e),h(!1)},onCancel:()=>h(!1)})}):(0,G.jsx)(`div`,{className:`comment-node-body markdown-body ${l?`comment-resolved-line`:``}`,dangerouslySetInnerHTML:{__html:mj(e.body)}})]})]}),e.replies?.length>0&&(0,G.jsx)(`div`,{className:`comment-replies`,role:`list`,"aria-label":`Replies`,children:e.replies.map((t,n)=>{let r=t.role===`agent`,i=v===t.id;return(0,G.jsxs)(`div`,{className:`comment-node ${r?`comment-node-agent`:`comment-node-user`} ${l?`comment-node-resolved`:``}`,role:`listitem`,"aria-label":`${r?`Agent`:`User`} reply ${n+1}`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:(0,G.jsx)(Gq,{role:r?`agent`:`user`,size:14})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:r?`Agent`:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge ${r?`comment-node-badge-agent`:`comment-node-badge-user`}`,children:r?`Agent`:`User`}),r&&t.model&&(0,G.jsx)(`span`,{style:{fontSize:`10px`,fontWeight:600,padding:`1px 5px`,borderRadius:`4px`,background:`var(--bg-tertiary)`,color:`var(--text-secondary)`,fontFamily:`var(--font-mono)`},children:t.model}),(0,G.jsx)(`span`,{className:`comment-node-time`,children:dj(t.createdAt)}),!l&&(0,G.jsxs)(`div`,{className:`comment-node-actions`,children:[(0,G.jsx)(`button`,{className:`comment-node-btn`,onClick:()=>y(t.id),title:`Edit reply`,"aria-label":`Edit reply`,children:(0,G.jsx)(vN,{size:12,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>s(t.id),title:`Delete reply`,"aria-label":`Delete reply`,children:(0,G.jsx)(ON,{size:12,"aria-hidden":`true`})})]})]}),i?(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`var(--radius-md)`,border:`1px solid var(--border-color)`,marginTop:`6px`},children:(0,G.jsx)(CI,{draftKey:`plan-reply-edit:${e.id}:${t.id}`,initialBody:t.body,onSubmit:e=>{o(t.id,e),y(null)},onCancel:()=>y(null)})}):(0,G.jsx)(`div`,{className:`comment-node-body markdown-body`,dangerouslySetInnerHTML:{__html:mj(t.body)}})]})]},t.id)})}),(0,G.jsxs)(`div`,{className:`comment-canvas-footer`,children:[!f&&(0,G.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,G.jsxs)(`button`,{onClick:()=>p(!0),className:`comment-reply-trigger`,style:{width:`100%`,maxWidth:`320px`},children:[(0,G.jsx)(xN,{size:14,"aria-hidden":`true`}),`Reply...`]}),l?(0,G.jsxs)(`div`,{style:{display:`flex`,gap:`6px`,marginLeft:`12px`},children:[(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:()=>d(!0),style:{fontSize:`12px`,padding:`4px 10px`},children:`Hide`}),(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:n,style:{fontSize:`12px`,padding:`4px 10px`},children:`Unresolve`})]}):(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:t,style:{fontSize:`12px`,padding:`4px 10px`,marginLeft:`12px`},children:`Resolve`})]}),f&&(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`var(--radius-md)`,border:`1px solid var(--border-color)`,marginTop:`4px`},children:(0,G.jsx)(CI,{draftKey:`plan-reply:${e.id}`,onSubmit:e=>{a(e),p(!1)},onCancel:()=>p(!1)})})]})]})}var qq=(0,W.memo)(function({isOpen:e,filePath:t,onClose:n}){let{data:r,isLoading:i,error:a}=oq(t),o=t?t.split(`/`).pop():``;return(0,G.jsxs)(fI,{open:e,onClose:n,className:`shortcuts-modal file-preview-modal`,ariaLabel:`File preview`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header-title`,children:[(0,G.jsx)(tN,{size:18,className:`shortcuts-icon`}),(0,G.jsxs)(`h2`,{children:[`Preview: `,o]}),(0,G.jsx)(`span`,{style:{fontSize:`11px`,color:`var(--text-muted)`,marginLeft:`8px`},children:t})]}),(0,G.jsx)(`button`,{className:`shortcuts-close-btn`,onClick:n,"aria-label":`Close dialog`,children:(0,G.jsx)(NN,{size:16})})]}),(0,G.jsxs)(`div`,{className:`shortcuts-body`,style:{maxHeight:`60vh`,display:`flex`,flexDirection:`column`},children:[i&&(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,padding:`40px`,gap:`8px`,color:`var(--text-muted)`},children:[(0,G.jsx)(sN,{size:16,className:`spin`}),(0,G.jsx)(`span`,{children:`Loading file content...`})]}),a&&(0,G.jsxs)(`div`,{style:{padding:`20px`,color:`var(--danger)`,background:`var(--feedback-danger-bg)`,borderRadius:`6px`},children:[`Failed to load file: `,a.message||String(a)]}),r&&(0,G.jsx)(`div`,{style:{flex:1,overflow:`auto`,background:`var(--bg-secondary)`,borderRadius:`6px`,border:`1px solid var(--border-normal)`},children:r.binary?(0,G.jsx)(`div`,{style:{padding:`40px`,textAlign:`center`,color:`var(--text-muted)`},children:`Binary file cannot be previewed.`}):r.missing?(0,G.jsx)(`div`,{style:{padding:`40px`,textAlign:`center`,color:`var(--text-muted)`},children:`File does not exist or has been deleted.`}):(0,G.jsx)(`pre`,{style:{margin:0,padding:`16px`,fontFamily:`var(--font-mono)`,fontSize:`13px`,lineHeight:`1.6`,overflowX:`auto`,whiteSpace:`pre-wrap`,wordBreak:`break-all`},children:(0,G.jsx)(`code`,{children:r.content})})})]}),(0,G.jsx)(`div`,{className:`shortcuts-footer`,style:{justifyContent:`flex-end`},children:(0,G.jsx)(`button`,{className:`btn btn-sm btn-primary`,onClick:n,children:`Close Preview`})})]})}),Jq={pending:{label:`Pending review`,className:`plan-badge-pending`,icon:ZM},approved:{label:`Approved`,className:`plan-badge-approved`,icon:HM},"changes-requested":{label:`Changes requested`,className:`plan-badge-changes`,icon:uN},rejected:{label:`Rejected`,className:`plan-badge-rejected`,icon:NN}};function Yq({plan:e,theme:t,fontSize:n,monoFontFamily:r,defaultTabSize:i,lineWrap:a,showLineNumbers:o,lineHoverHighlight:s,viewMode:c}){let{addPlanComment:l,editPlanComment:u,resolvePlanComment:d,unresolvePlanComment:f,removePlanComment:p,addPlanReply:m,editPlanReply:h,removePlanReply:g,submitDecision:_,submitting:v,agentWaiting:y}=Fj(),[b,x]=(0,W.useState)(null),[S,C]=(0,W.useState)(null),[w,T]=(0,W.useState)(0),[E,D]=(0,W.useState)(null),O=e=>{let t=e.target.closest(`a`);if(t){let n=t.getAttribute(`href`);n&&n.startsWith(`file:///`)&&(e.preventDefault(),D(n.replace(`file://`,``)))}},k=pj[t]||pj.nord,A=(0,W.useMemo)(()=>Xq(i,n,r),[i,n,r]),j=e.comments??[],M=j.filter(e=>e.lineNumber>0),N=j.filter(e=>e.lineNumber===0);j.filter(e=>e.status===`open`).length;let P=(t,n)=>Wq(e.body,t??n,n),F=(t,n)=>{l({planId:e.id,lineNumber:t.lineNumber,startLineNumber:t.startLineNumber,lineContent:P(t.startLineNumber,t.lineNumber),sectionTitle:Uq(e.body,t.startLineNumber??t.lineNumber),body:n}),x(null),C(null)},I=(0,W.useMemo)(()=>{let e=M.map(e=>({lineNumber:e.lineNumber,metadata:e}));return b&&e.push({lineNumber:b.lineNumber,metadata:{_pending:!0}}),e},[M,b]),L=t=>{let n=t.metadata;if(!n)return null;if(`_pending`in n){let t=b;return(0,G.jsx)(CI,{draftKey:`plan-new:${e.id}:${t.startLineNumber??t.lineNumber}:${t.lineNumber}`,lineContent:P(t.startLineNumber,t.lineNumber),onSubmit:e=>F(t,e),onCancel:()=>{x(null),C(null)}})}let r=n;return(0,G.jsx)(Kq,{comment:r,onResolve:()=>d(e.id,r.id),onUnresolve:()=>f(e.id,r.id),onDelete:()=>p(e.id,r.id),onEdit:t=>u(e.id,r.id,t),onReply:t=>m(e.id,r.id,t),onEditReply:(t,n)=>h(e.id,r.id,t,n),onDeleteReply:t=>g(e.id,r.id,t)})},R=Jq[e.decision],z=R.icon;return(0,G.jsxs)(`div`,{className:`plan-review`,children:[(0,G.jsx)(`div`,{className:`plan-review-head`,children:(0,G.jsxs)(`div`,{className:`plan-review-head-main`,children:[(0,G.jsx)(`h2`,{className:`plan-review-title`,title:e.title,children:e.title}),(0,G.jsxs)(`div`,{className:`plan-review-meta`,children:[(0,G.jsxs)(`span`,{className:`plan-badge ${R.className}`,children:[(0,G.jsx)(z,{size:12,"aria-hidden":`true`}),R.label]}),(0,G.jsxs)(`span`,{className:`plan-review-chip`,children:[`v`,e.version]}),e.source&&(0,G.jsx)(`span`,{className:`plan-review-chip`,children:e.source}),e.model&&(0,G.jsxs)(`span`,{className:`plan-review-chip plan-review-chip-model`,children:[(0,G.jsx)(VM,{size:11,"aria-hidden":`true`}),e.model]}),M.length+N.length>0&&(0,G.jsxs)(`span`,{className:`plan-review-chip`,children:[j.length,` comment`,j.length===1?``:`s`]}),w>0&&(0,G.jsxs)(`span`,{className:`plan-review-chip plan-review-chip-selection`,"aria-live":`polite`,children:[w,` line`,w===1?``:`s`,` selected`]})]})]})}),e.decision!==`pending`&&(0,G.jsxs)(`div`,{className:`plan-decision-banner ${R.className}`,children:[(0,G.jsx)(z,{size:15,"aria-hidden":`true`}),(0,G.jsxs)(`div`,{className:`plan-decision-banner-text`,children:[(0,G.jsx)(`strong`,{children:R.label}),e.decisionComment&&(0,G.jsx)(`span`,{className:`plan-decision-banner-note markdown-body`,dangerouslySetInnerHTML:{__html:mj(e.decisionComment)}})]})]}),N.length>0&&(0,G.jsxs)(`div`,{className:`plan-general-section`,children:[(0,G.jsxs)(`div`,{className:`plan-general-header`,children:[(0,G.jsx)(lN,{size:14}),(0,G.jsxs)(`span`,{children:[`General comments (`,N.length,`)`]})]}),N.map(t=>(0,G.jsx)(Kq,{comment:t,onResolve:()=>d(e.id,t.id),onUnresolve:()=>f(e.id,t.id),onDelete:()=>p(e.id,t.id),onEdit:n=>u(e.id,t.id,n),onReply:n=>m(e.id,t.id,n),onEditReply:(n,r)=>h(e.id,t.id,n,r),onDeleteReply:n=>g(e.id,t.id,n)},t.id))]}),c===`rendered`?(0,G.jsx)(`div`,{className:`markdown-body plan-rendered`,dangerouslySetInnerHTML:{__html:mj(e.body)},onClick:O}):(0,G.jsx)(`div`,{className:`plan-file`,children:(0,G.jsx)(zh,{file:{name:`PLAN.md`,contents:e.body,lang:`markdown`},options:{disableFileHeader:!0,enableGutterUtility:!0,enableLineSelection:!0,overflow:a?`wrap`:`scroll`,disableLineNumbers:!o,lineHoverHighlight:s,onLineSelectionStart:()=>{C(null),T(0)},onLineSelectionChange:e=>{T(e?Math.abs(e.end-e.start)+1:0)},onLineSelectionEnd:e=>{T(0),e&&(C(e),x({lineNumber:e.end,startLineNumber:e.start}))},theme:{dark:k.type===`dark`?k.themeName:`nord`,light:k.type===`light`?k.themeName:`github-light`},themeType:k.type,unsafeCSS:A},selectedLines:S,lineAnnotations:I,renderAnnotation:L,renderGutterUtility:e=>(0,G.jsx)(`button`,{className:`gutter-add-btn`,onClick:()=>{let t=e();t&&x({lineNumber:t.lineNumber})},children:`+`})})}),(0,G.jsx)(qq,{isOpen:!!E,filePath:E,onClose:()=>D(null)})]})}function Xq(e,t,n){return`
3902
+ :host {
3903
+ --diffs-tab-size: ${e} !important;
3904
+ --diffs-font-family: ${n} !important;
3905
+ --diffs-font-size: ${t}px !important;
3906
+ --diffs-border: var(--border-normal) !important;
3907
+ --diffs-bg: var(--bg-secondary) !important;
3908
+ --diffs-line-height: ${Math.round(t*1.7)}px !important;
3909
+ }
3910
+ [data-column-number], [data-line], [data-line] * {
3911
+ font-family: ${n} !important;
3912
+ font-size: ${t}px !important;
3913
+ font-variant-ligatures: common-ligatures !important;
3914
+ font-feature-settings: "liga" on, "calt" on !important;
3915
+ }
3916
+ [data-column-number] {
3917
+ color: var(--text-muted) !important;
3918
+ opacity: 0.65 !important;
3919
+ user-select: none !important;
3920
+ padding-right: 12px !important;
3921
+ }
3922
+ [data-line]:hover [data-column-number] {
3923
+ opacity: 1 !important;
3924
+ color: var(--primary) !important;
3925
+ }
3926
+ [data-line].selected-line {
3927
+ background-color: var(--accent-subtle) !important;
3928
+ }
3929
+ .comment-bubble-canvas {
3930
+ width: calc(100% - 40px) !important;
3931
+ max-width: min(720px, calc(100% - 40px)) !important;
3932
+ margin: 14px 20px !important;
3933
+ min-width: 0 !important;
3934
+ box-sizing: border-box !important;
3935
+ }
3936
+ .comment-replies {
3937
+ min-width: 0 !important;
3938
+ }
3939
+ .comment-node {
3940
+ min-width: 0 !important;
3941
+ }
3942
+ .comment-content-col {
3943
+ min-width: 0 !important;
3944
+ }
3945
+ .comment-node-header {
3946
+ flex-wrap: wrap !important;
3947
+ min-width: 0 !important;
3948
+ }
3949
+ .comment-node-body {
3950
+ word-break: break-word !important;
3951
+ overflow-wrap: break-word !important;
3952
+ min-width: 0 !important;
3953
+ }
3954
+ `}var Zq={pending:{icon:ZM,className:`plan-badge-pending`,label:`Pending`},approved:{icon:HM,className:`plan-badge-approved`,label:`Approved`},"changes-requested":{icon:uN,className:`plan-badge-changes`,label:`Changes`},rejected:{icon:NN,className:`plan-badge-rejected`,label:`Rejected`}};function Qq({plans:e,activeId:t,onSelect:n,onDelete:r,collapsed:i,onToggleCollapse:a}){let[o,s]=(0,W.useState)(``),c=(0,W.useMemo)(()=>[...e].sort((e,t)=>t.createdAt-e.createdAt),[e]),l=(0,W.useMemo)(()=>c.filter(e=>e.title.toLowerCase().includes(o.toLowerCase())),[c,o]);return i?(0,G.jsx)(`div`,{className:`ft`,children:(0,G.jsx)(`div`,{className:`ft-search`,children:a&&(0,G.jsx)(QT,{content:`Expand sidebar`,side:`right`,children:(0,G.jsx)(`button`,{className:`sidebar-toggle`,onClick:a,"aria-label":`Expand sidebar`,children:(0,G.jsx)(gN,{size:16})})})})}):(0,G.jsxs)(`div`,{className:`ft`,style:{display:`flex`,flexDirection:`column`,height:`100%`},children:[(0,G.jsxs)(`div`,{className:`ft-search`,children:[a&&(0,G.jsx)(QT,{content:`Collapse sidebar`,side:`right`,children:(0,G.jsx)(`button`,{className:`sidebar-toggle`,onClick:a,"aria-label":`Collapse sidebar`,children:(0,G.jsx)(hN,{size:16})})}),(0,G.jsxs)(`div`,{className:`ft-search-wrapper`,children:[(0,G.jsx)(wN,{size:14,className:`ft-search-icon`}),(0,G.jsx)(`input`,{type:`text`,placeholder:`Filter plans...`,value:o,onChange:e=>s(e.target.value),className:`ft-search-input`})]})]}),(0,G.jsxs)(`div`,{className:`plan-list-scroll`,style:{flex:1,minHeight:0,overflow:`auto`},children:[(0,G.jsxs)(`div`,{className:`plan-list-header`,children:[`Plans (`,l.length,`)`]}),l.length===0&&(0,G.jsx)(`div`,{className:`plan-list-empty`,children:o?`No matching plans found.`:`No plans submitted yet.`}),l.map(e=>{let i=Zq[e.decision],a=i.icon,o=(e.comments??[]).filter(e=>e.status===`open`).length;return(0,G.jsxs)(`div`,{className:`plan-list-item ${e.id===t?`plan-list-item-active`:``}`,onClick:()=>n(e.id),role:`button`,tabIndex:0,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n(e.id))},children:[(0,G.jsxs)(`div`,{className:`plan-list-item-top`,children:[(0,G.jsx)(`span`,{className:`plan-badge plan-badge-dot ${i.className}`,title:i.label,children:(0,G.jsx)(a,{size:11,"aria-hidden":`true`})}),(0,G.jsx)(`span`,{className:`plan-list-item-title`,title:e.title,children:e.title}),(0,G.jsx)(`button`,{className:`plan-list-delete`,title:`Delete plan`,onClick:t=>{t.stopPropagation(),r(e.id)},children:(0,G.jsx)(ON,{size:12,"aria-hidden":`true`})})]}),(0,G.jsxs)(`div`,{className:`plan-list-item-sub`,children:[(0,G.jsxs)(`span`,{children:[`v`,e.version]}),o>0&&(0,G.jsxs)(`span`,{children:[`· `,o,` open`]}),e.model&&(0,G.jsxs)(`span`,{className:`plan-list-item-model`,children:[`· `,(0,G.jsx)(VM,{size:10,"aria-hidden":`true`}),` `,e.model]}),(0,G.jsxs)(`span`,{className:`plan-list-item-time`,children:[`· `,dj(e.createdAt)]})]})]},e.id)})]})]})}var $q=[{value:`approved`,label:`Approve`,description:`The plan looks good — the agent should proceed.`,icon:HM,className:`plan-verdict-approve`},{value:`changes-requested`,label:`Request changes`,description:`The agent should revise the plan and resubmit it.`,icon:uN,className:`plan-verdict-changes`},{value:`rejected`,label:`Reject`,description:`Don't proceed — the approach needs rethinking.`,icon:NN,className:`plan-verdict-reject`}];function eJ({openCommentCount:e,onSubmit:t,submitting:n,agentWaiting:r,currentDecision:i}){let{haptic:a,sound:o}=bM(),[s,c]=(0,W.useState)(!1),[l,u]=(0,W.useState)(null),[d,f]=(0,W.useState)(``),p=async()=>{l&&(a(`heavy`),o(`send`),await t(l,d),f(``),u(null),c(!1))},m=i!==`pending`;return(0,G.jsx)(CP,{open:s,onOpenChange:c,ariaLabel:`Submit plan review`,className:`submit-plan-review-popover`,trigger:(0,G.jsxs)(`button`,{className:`btn btn-primary btn-sm`,disabled:n,title:r?`An agent is connected and waiting for your verdict`:`Submit your verdict on this plan`,style:{display:`inline-flex`,alignItems:`center`,gap:`6px`},children:[r&&(0,G.jsx)(`span`,{className:`agent-waiting-dot`,"aria-hidden":`true`}),m?(0,G.jsx)(bN,{size:14}):(0,G.jsx)(YM,{size:14}),(0,G.jsx)(`span`,{children:n?`Submitting…`:m?`Update review`:`Submit review`})]}),children:(0,G.jsxs)(`div`,{className:`srp`,children:[(0,G.jsxs)(`div`,{className:`srp-head`,children:[m?(0,G.jsx)(bN,{size:15,"aria-hidden":`true`}):(0,G.jsx)(YM,{size:15,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`srp-title`,children:m?`Update plan review`:`Submit plan review`}),e>0&&(0,G.jsxs)(`span`,{className:`srp-count`,children:[e,` open comment`,e===1?``:`s`]})]}),(0,G.jsx)(`div`,{className:`plan-verdict-options`,role:`radiogroup`,"aria-label":`Verdict`,children:$q.map(e=>{let t=e.icon,n=l===e.value;return(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":n,className:`plan-verdict-option ${e.className} ${n?`plan-verdict-option-selected`:``}`,onClick:()=>u(e.value),children:[(0,G.jsx)(`span`,{className:`plan-verdict-icon`,children:(0,G.jsx)(t,{size:15,"aria-hidden":`true`})}),(0,G.jsxs)(`span`,{className:`plan-verdict-text`,children:[(0,G.jsx)(`span`,{className:`plan-verdict-label`,children:e.label}),(0,G.jsx)(`span`,{className:`plan-verdict-desc`,children:e.description})]}),(0,G.jsx)(`span`,{className:`plan-verdict-radio`,"aria-hidden":`true`})]},e.value)})}),(0,G.jsxs)(`div`,{className:`srp-general`,children:[(0,G.jsxs)(`label`,{className:`srp-general-label`,htmlFor:`plan-decision-comment`,children:[`Overall comment `,(0,G.jsx)(`span`,{className:`srp-optional`,children:`(optional · Markdown)`})]}),(0,G.jsx)(LF,{id:`plan-decision-comment`,value:d,onChange:f,textareaClassName:`srp-general-input`,placeholder:`Add an overall note for the agent that applies to the whole plan…`,rows:3,ariaLabel:`Overall plan review comment`,onSubmitShortcut:p})]}),(0,G.jsxs)(`div`,{className:`srp-footer`,children:[(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>c(!1),disabled:n,children:`Cancel`}),(0,G.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:p,disabled:!l||n,children:n?`Submitting…`:`Submit review`})]})]})})}var tJ=[11,12,13,14,15,16].map(e=>({value:String(e),label:`${e}px`})),nJ=[2,4,8].map(e=>({value:String(e),label:String(e)})),rJ=[{value:`both`,label:`Both`},{value:`line`,label:`Line only`},{value:`number`,label:`Number only`},{value:`disabled`,label:`Disabled`}];function iJ(){let e=km(),{settings:t,loaded:n,updateSettings:r}=qj();Jj(n,t.uiFont,t.monoFont);let{plans:i,getPlan:a,removePlan:o,agentActivity:s,clearAgentActivity:c,submitDecision:l,submitting:u,agentWaiting:d,isLoading:f}=Fj(),p=Hj(),[m,h]=(0,W.useState)(!1),[g,_]=(0,W.useState)(!1),[v,y]=(0,W.useState)(!1);(0,W.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&(e.key===`,`||e.code===`Comma`)&&(e.preventDefault(),_(e=>!e))};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[]);let[b,x]=(0,W.useState)(()=>{try{return CM(`diffing-plan-view-mode`)===`rendered`?`rendered`:`source`}catch{return`source`}}),S=(0,W.useCallback)(e=>{x(e);try{DM(`diffing-plan-view-mode`,e)}catch{}},[]),C=(0,W.useMemo)(()=>{let e=/^\/plan\/([^/]+)/.exec(p);return e?decodeURIComponent(e[1]):null},[p]),w=(0,W.useMemo)(()=>C?a(C):i.length===0?null:[...i].reverse().find(e=>e.decision===`pending`)??i[i.length-1],[C,i,a]),T=(0,W.useMemo)(()=>pj[t.theme||`nord`]||pj.nord,[t.theme]);(0,W.useEffect)(()=>{let e=t.theme||`nord`,n=document.documentElement;n.classList.add(`theme-switching`),n.setAttribute(`data-theme`,e);let r=requestAnimationFrame(()=>{requestAnimationFrame(()=>n.classList.remove(`theme-switching`))});return()=>cancelAnimationFrame(r)},[t.theme]),(0,W.useEffect)(()=>{e&&e.setRenderOptions({theme:{dark:T.type===`dark`?T.themeName:`nord`,light:T.type===`light`?T.themeName:`github-light`}}).catch(e=>console.error(`Failed to set worker pool render options:`,e))},[e,T]),(0,W.useEffect)(()=>{let e=T.type===`dark`?T.themeName:`nord`,t=T.type===`light`?T.themeName:`github-light`;Hf({themes:Array.from(new Set([e,t])),langs:[]}).catch(()=>{})},[T]);let[E,D]=(0,W.useState)(()=>{try{return CM(`diffing-sidebar-collapsed`)===`true`}catch{return!1}}),[O,k]=(0,W.useState)(()=>{try{let e=CM(`diffing-sidebar-width`);return e?Number(e):320}catch{return 320}});(0,W.useEffect)(()=>{try{DM(`diffing-sidebar-collapsed`,String(E))}catch{}},[E]);let A=(0,W.useRef)(O);A.current=O;let j=(0,W.useRef)(null),M=(0,W.useRef)(null),N=(0,W.useRef)(null),P=(0,W.useCallback)(e=>{e.preventDefault();let t=e.clientX,n=A.current,r=M.current,i=N.current,a=r?r.getBoundingClientRect().left:0,o=n,s=0,c=()=>{s=0,i&&(i.style.transform=`translateX(${a+o}px)`)};i&&(i.style.transform=`translateX(${a+n}px)`,i.classList.add(`sidebar-resize-guide-active`));let l=e=>{let r=e.clientX-t;o=Math.max(240,Math.min(640,n+r)),s||=requestAnimationFrame(c)},u=()=>{s&&cancelAnimationFrame(s),i&&i.classList.remove(`sidebar-resize-guide-active`),k(o);try{DM(`diffing-sidebar-width`,String(o))}catch{}document.removeEventListener(`mousemove`,l),document.removeEventListener(`mouseup`,u),document.body.style.cursor=``,document.body.style.userSelect=``};document.addEventListener(`mousemove`,l),document.addEventListener(`mouseup`,u),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},[]),F=(0,W.useCallback)(()=>{D(e=>!e)},[]),I=(0,W.useCallback)(()=>{r({lineWrap:!t.lineWrap})},[t.lineWrap,r]),L=(0,W.useCallback)(()=>{r({showLineNumbers:!t.showLineNumbers})},[t.showLineNumbers,r]),R=(0,W.useCallback)(()=>{S(b===`source`?`rendered`:`source`)},[b,S]),z=(0,W.useCallback)(()=>{let e=[2,4,8],n=t.defaultTabSize||4;r({defaultTabSize:e[(e.indexOf(n)+1)%e.length]})},[t.defaultTabSize,r]),ee=(0,W.useCallback)(e=>{if(i.length===0)return;let t=[...i].sort((e,t)=>t.createdAt-e.createdAt),n=0;if(w){let r=t.findIndex(e=>e.id===w.id);r!==-1&&(n=e===`next`?Math.min(r+1,t.length-1):Math.max(r-1,0))}let r=t[n];Rj(`/plan/${r.id}`)},[i,w]);(0,W.useEffect)(()=>{let e=``,t,n=0,r=r=>{let i=document.activeElement;if(i){let e=i.tagName.toLowerCase();if(e===`input`||e===`textarea`||i.hasAttribute(`contenteditable`))return}clearTimeout(t);let a=r.key;if(r.ctrlKey){a===`d`?(r.preventDefault(),window.scrollBy({top:window.innerHeight/2,behavior:`auto`}),vM(`selection`,`navigate`),e=``):a===`u`&&(r.preventDefault(),window.scrollBy({top:-window.innerHeight/2,behavior:`auto`}),vM(`selection`,`navigate`),e=``);return}if(!(a.length>1&&a!==`Escape`&&a!==`Enter`))if(e+=a,t=setTimeout(()=>{e=``},800),e===`j`){r.preventDefault(),window.scrollBy({top:100,behavior:`auto`});let t=Date.now();t-n>80&&(gM(`navigate`),n=t),e=``}else if(e===`k`){r.preventDefault(),window.scrollBy({top:-100,behavior:`auto`});let t=Date.now();t-n>80&&(gM(`navigate`),n=t),e=``}else e===`gg`?(r.preventDefault(),window.scrollTo({top:0,behavior:`auto`}),vM(`selection`,`navigate`),e=``):e===`G`?(r.preventDefault(),window.scrollTo({top:document.documentElement.scrollHeight,behavior:`auto`}),vM(`selection`,`navigate`),e=``):e===`J`?(r.preventDefault(),ee(`next`),vM(`selection`,`navigate`),e=``):e===`K`?(r.preventDefault(),ee(`prev`),vM(`selection`,`navigate`),e=``):e===`m`?(r.preventDefault(),R(),vM(`selection`,`toggle`),e=``):e===`t`?(r.preventDefault(),z(),vM(`selection`,`toggle`),e=``):e===`b`?(r.preventDefault(),F(),vM(`selection`,`toggle`),e=``):e===`w`?(r.preventDefault(),I(),vM(`selection`,`toggle`),e=``):e===`n`?(r.preventDefault(),L(),vM(`selection`,`toggle`),e=``):e===`gt`?(r.preventDefault(),h(!0),vM(`medium`,`open`),e=``):e===`?`?(r.preventDefault(),y(!0),vM(`medium`,`open`),e=``):e.length>=2&&(e=``)};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r)}},[F,I,L,R,z,ee]);let te=(0,W.useMemo)(()=>w?(w.comments??[]).filter(e=>e.status===`open`).length:0,[w]);return f||!n?(0,G.jsxs)(`div`,{className:`app plan-app skeleton-app`,style:{"--sidebar-width":`${O}px`},children:[(0,G.jsxs)(`header`,{className:`skeleton-toolbar`,children:[(0,G.jsx)(`div`,{className:`skeleton-item skeleton-logo`,style:{width:`140px`}}),(0,G.jsx)(`div`,{className:`skeleton-item skeleton-stats`,style:{width:`80px`,marginLeft:`20px`}}),(0,G.jsx)(`div`,{className:`skeleton-item skeleton-actions`,style:{width:`220px`}})]}),(0,G.jsxs)(`div`,{className:`app-body`,children:[(0,G.jsx)(`aside`,{className:`sidebar plan-sidebar skeleton-sidebar ${E?`sidebar-collapsed`:``}`,children:!E&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`skeleton-search`,style:{height:`32px`,margin:`0 16px 16px 16px`}}),(0,G.jsx)(`div`,{className:`skeleton-tree-nodes`,children:Array.from({length:4}).map((e,t)=>(0,G.jsxs)(`div`,{className:`skeleton-tree-node`,style:{paddingLeft:`16px`,height:`40px`,borderBottom:`1px solid var(--border-weak)`},children:[(0,G.jsx)(`div`,{className:`skeleton-node-icon`,style:{width:`20px`,height:`20px`,borderRadius:`50%`}}),(0,G.jsx)(`div`,{className:`skeleton-node-text`,style:{width:`${80+t*30%90}px`,height:`14px`}})]},t))})]})}),!E&&(0,G.jsx)(`div`,{className:`sidebar-resize-handle`,style:{cursor:`default`}}),(0,G.jsx)(`main`,{className:`main plan-main skeleton-main`,children:(0,G.jsxs)(`div`,{className:`file-diff-card skeleton-card`,style:{border:`1px solid var(--border-color)`,borderRadius:`8px`},children:[(0,G.jsxs)(`div`,{className:`skeleton-card-header`,style:{padding:`16px 20px`},children:[(0,G.jsx)(`div`,{className:`skeleton-card-title`,style:{width:`250px`,height:`20px`}}),(0,G.jsx)(`div`,{className:`skeleton-card-badge`,style:{width:`100px`,height:`24px`}})]}),(0,G.jsxs)(`div`,{className:`skeleton-card-body`,style:{padding:`24px`,background:`var(--bg-secondary)`,display:`flex`,flexDirection:`column`,gap:`16px`},children:[(0,G.jsx)(`div`,{className:`skeleton-code-line`,style:{width:`90%`,height:`16px`}}),(0,G.jsx)(`div`,{className:`skeleton-code-line`,style:{width:`75%`,height:`16px`}}),(0,G.jsx)(`div`,{className:`skeleton-code-line`,style:{width:`85%`,height:`16px`}}),(0,G.jsx)(`div`,{className:`skeleton-code-line`,style:{width:`40%`,height:`16px`}}),(0,G.jsx)(`div`,{className:`skeleton-code-line`,style:{width:`60%`,height:`16px`}}),(0,G.jsx)(`div`,{className:`skeleton-code-line`,style:{width:`80%`,height:`16px`}})]})]})})]})]}):(0,G.jsx)(yM,{enabled:t.haptics??!0,soundsEnabled:t.sounds??!0,children:(0,G.jsxs)(`div`,{className:`app plan-app`,ref:j,style:{"--sidebar-width":`${O}px`},children:[(0,G.jsx)(`div`,{className:`sidebar-resize-guide`,ref:N,"aria-hidden":`true`}),(0,G.jsxs)(`div`,{className:`toolbar plan-app-toolbar`,children:[(0,G.jsxs)(`div`,{className:`toolbar-left`,children:[(0,G.jsxs)(`button`,{className:`btn btn-sm`,onClick:()=>Rj(`/`),title:`Back to the diff review`,children:[(0,G.jsx)(BM,{size:14,style:{marginRight:`6px`}}),`Diff`]}),(0,G.jsxs)(`h1`,{className:`toolbar-title plan-app-title`,children:[(0,G.jsx)(XM,{size:16,style:{marginRight:`6px`}}),`Plan review`]}),(0,G.jsxs)(`span`,{className:`toolbar-stat`,children:[i.length,` plan`,i.length===1?``:`s`]})]}),(0,G.jsxs)(`div`,{className:`toolbar-right`,children:[(0,G.jsx)(CP,{open:g,onOpenChange:_,ariaLabel:`Settings`,className:`settings-popover`,trigger:(0,G.jsxs)(`button`,{className:`btn btn-sm settings-btn ${g?`btn-active`:``}`,title:`Settings`,children:[(0,G.jsx)(TN,{size:14}),` Settings`]}),children:(0,G.jsxs)(`div`,{className:`popover-scroll settings-panel`,children:[(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Review Options`}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`View mode`}),(0,G.jsx)(IF,{value:b,onValueChange:e=>S(e),options:[{value:`source`,label:`Source (commentable)`},{value:`rendered`,label:`Rendered (markdown)`}],ariaLabel:`Plan view mode`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Theme`}),(0,G.jsxs)(`button`,{className:`btn btn-sm settings-btn`,onClick:()=>{_(!1),h(!0)},style:{display:`inline-flex`,alignItems:`center`},children:[(0,G.jsx)(mN,{size:14,style:{marginRight:`4px`}}),(0,G.jsx)(`span`,{children:`Switch Theme...`})]})]}),(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Display`}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:t.lineWrap,onChange:e=>r({lineWrap:e.target.checked})}),`Wrap long lines`]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:t.showLineNumbers,onChange:e=>r({showLineNumbers:e.target.checked})}),`Show line numbers`]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Hover highlight`}),(0,G.jsx)(IF,{value:t.lineHoverHighlight,onValueChange:e=>r({lineHoverHighlight:e}),options:rJ,ariaLabel:`Hover highlight`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Font size`}),(0,G.jsx)(IF,{value:String(t.fontSize),onValueChange:e=>r({fontSize:Number(e)}),options:tJ,ariaLabel:`Font size`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Default tab size`}),(0,G.jsx)(IF,{value:String(t.defaultTabSize),onValueChange:e=>r({defaultTabSize:Number(e)}),options:nJ,ariaLabel:`Default tab size`})]})]})}),w&&(0,G.jsx)(eJ,{openCommentCount:te,onSubmit:(e,t)=>l(w.id,e,t),submitting:u,agentWaiting:d,currentDecision:w.decision})]})]}),(0,G.jsxs)(`div`,{className:`app-body`,children:[(0,G.jsx)(`aside`,{ref:M,className:`sidebar plan-sidebar ${E?`sidebar-collapsed`:``}`,children:(0,G.jsx)(`div`,{style:{flex:1,minHeight:0,overflow:`hidden`},children:(0,G.jsx)(Qq,{plans:i,activeId:w?.id??null,onSelect:e=>Rj(`/plan/${e}`),onDelete:e=>{o(e),w?.id===e&&Rj(`/plan`)},collapsed:E,onToggleCollapse:()=>D(!E)})})}),!E&&(0,G.jsx)(`div`,{className:`sidebar-resize-handle`,onMouseDown:P,role:`separator`,"aria-label":`Resize sidebar`,"aria-orientation":`vertical`,tabIndex:0}),(0,G.jsx)(`main`,{className:`main plan-main`,children:w?(0,G.jsx)(Yq,{plan:w,theme:t.theme||`nord`,fontSize:t.fontSize,monoFontFamily:Kj(t.monoFont),defaultTabSize:t.defaultTabSize,lineWrap:t.lineWrap,showLineNumbers:t.showLineNumbers,lineHoverHighlight:t.lineHoverHighlight,viewMode:b},w.id):(0,G.jsx)(aJ,{hasPlans:i.length>0,notFound:!!C})})]}),(0,G.jsx)(Rq,{open:m,activeTheme:t.theme||`nord`,onThemeChange:e=>r({theme:e}),onClose:()=>h(!1)}),(0,G.jsx)(Iq,{activity:s?{at:s.at,commentId:s.commentId,filePath:`plan comment`,model:s.model,body:s.body}:null,onDismiss:c,onJump:()=>{s&&Rj(`/plan/${s.planId}`)}}),(0,G.jsx)(Pq,{activeFile:w?w.title:null,onShowHelp:()=>y(!0),placeholder:`No active plan (J/K to jump)`}),(0,G.jsx)(Fq,{isOpen:v,onClose:()=>y(!1),mode:`plan`})]})})}function aJ({hasPlans:e,notFound:t}){return(0,G.jsxs)(`div`,{className:`plan-empty-state`,children:[(0,G.jsx)(XM,{size:40,style:{opacity:.4}}),t?(0,G.jsx)(`p`,{children:`That plan no longer exists. Pick one from the list, or submit a new plan.`}):e?(0,G.jsx)(`p`,{children:`Select a plan from the list to review it.`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{children:`No plans have been submitted for review yet.`}),(0,G.jsxs)(`p`,{className:`plan-empty-hint`,children:[`An agent can submit one with`,` `,(0,G.jsx)(`code`,{children:`diffing plan submit PLAN.md`}),` (or the `,(0,G.jsx)(`code`,{children:`submit_plan`}),` MCP tool), then block on`,` `,(0,G.jsx)(`code`,{children:`diffing plan await`}),` until you approve, reject, or request changes here.`]})]})]})}function oJ(){let e=Hj(),[t,n]=(0,W.useState)(!1);return(0,W.useEffect)(()=>{SM().then(()=>{n(!0)})},[]),t?e===`/plan`||e.startsWith(`/plan/`)?(0,G.jsx)(iJ,{}):(0,G.jsx)(Hq,{}):(0,G.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,height:`100vh`,width:`100vw`,background:`#0d1117`,color:`#c9d1d9`,fontFamily:`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`},children:[(0,G.jsx)(`div`,{style:{width:`32px`,height:`32px`,border:`3px solid rgba(139, 148, 158, 0.15)`,borderTop:`3px solid #58a6ff`,borderRadius:`50%`,animation:`spin 0.8s linear infinite`,marginBottom:`16px`}}),(0,G.jsx)(`span`,{style:{fontSize:`13px`,fontWeight:500,opacity:.75,letterSpacing:`0.3px`},children:`Loading review session...`}),(0,G.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`
3955
+ @keyframes spin {
3956
+ 0% { transform: rotate(0deg); }
3957
+ 100% { transform: rotate(360deg); }
3958
+ }
3959
+ `}})]})}var sJ=new Le;(0,mn.createRoot)(document.getElementById(`root`)).render((0,G.jsx)(He,{client:sJ,children:(0,G.jsx)(ot,{children:(0,G.jsx)(Om,{poolOptions:{workerFactory:()=>new k_,poolSize:Math.max(1,Math.min(4,navigator.hardwareConcurrency||2))},highlighterOptions:{theme:{dark:`nord`,light:`github-light`}},children:(0,G.jsx)(ZT,{children:(0,G.jsx)(oJ,{})})})})}));export{s as t};