@imenam/mcp-feature-analyzer 1.0.18 → 1.0.19

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 (90) hide show
  1. package/README.md +3 -3
  2. package/dist/shared/review-state.d.ts +6 -0
  3. package/dist/shared/review-state.js +11 -2
  4. package/dist/shared/schemas/analysis.schema.d.ts +3 -1
  5. package/dist/src/index.js +5 -4
  6. package/dist/src/tools/format.d.ts +3 -2
  7. package/dist/src/tools/format.js +8 -3
  8. package/dist/src/tools/get-review-feedback.js +8 -8
  9. package/dist/src/tools/list-analyses.d.ts +2 -1
  10. package/dist/src/tools/list-analyses.js +7 -6
  11. package/gui/dist/assets/{angular-html-khSGtcDV.js → angular-html-BG32ZSEg.js} +1 -1
  12. package/gui/dist/assets/{angular-ts-CQZskKbG.js → angular-ts-W997xU6j.js} +1 -1
  13. package/gui/dist/assets/{apl-Dk2A1KW8.js → apl-6ogEEQiK.js} +1 -1
  14. package/gui/dist/assets/{astro-CDNLxpIR.js → astro-DBxTz6gT.js} +1 -1
  15. package/gui/dist/assets/{blade-HVRxvZlI.js → blade-PbZvkn0I.js} +1 -1
  16. package/gui/dist/assets/{c-BAogwQrx.js → c-C5-3wfrB.js} +1 -1
  17. package/gui/dist/assets/{chapel-CXJ1GKiJ.js → chapel-KHYeKJD5.js} +1 -1
  18. package/gui/dist/assets/{cobol-CUpuiRry.js → cobol-D51AxaJB.js} +1 -1
  19. package/gui/dist/assets/{coffee-Bvuk4CPF.js → coffee-4h6_4dhl.js} +1 -1
  20. package/gui/dist/assets/{cpp-DrhGCibo.js → cpp-B63oWnHV.js} +1 -1
  21. package/gui/dist/assets/{crystal-CoGIF_h4.js → crystal-OG_TkIE7.js} +1 -1
  22. package/gui/dist/assets/{css-CUXMpymc.js → css-Csea3soR.js} +1 -1
  23. package/gui/dist/assets/{edge-MTcLzslY.js → edge-HBaaYuuJ.js} +1 -1
  24. package/gui/dist/assets/{elixir-DpYpNuu6.js → elixir-DZlxxd9b.js} +1 -1
  25. package/gui/dist/assets/{elm-CAdLQ8j2.js → elm-DZAjSs9M.js} +1 -1
  26. package/gui/dist/assets/{erb-wGT1uBBo.js → erb-BurFBvpV.js} +1 -1
  27. package/gui/dist/assets/{git-rebase-D7SHvGwZ.js → git-rebase-B7wPwCu-.js} +1 -1
  28. package/gui/dist/assets/{glimmer-js-DEF7JSd6.js → glimmer-js-Bgk8Z51T.js} +1 -1
  29. package/gui/dist/assets/{glimmer-ts-CM94Mbx8.js → glimmer-ts-ldZtmANh.js} +1 -1
  30. package/gui/dist/assets/{glsl-DvB1v13j.js → glsl-7SImpJuS.js} +1 -1
  31. package/gui/dist/assets/{graphql-CpBeqKe2.js → graphql-CJ0BLjCq.js} +1 -1
  32. package/gui/dist/assets/{hack-CBlJ1Su7.js → hack-D50FsJQB.js} +1 -1
  33. package/gui/dist/assets/{haml-Db0uDFny.js → haml-xkw_a2ii.js} +1 -1
  34. package/gui/dist/assets/{handlebars-B9jQcMgj.js → handlebars-C0upK5dG.js} +1 -1
  35. package/gui/dist/assets/{html-DTSojrQm.js → html-CerDkvKq.js} +1 -1
  36. package/gui/dist/assets/{html-derivative-7jGgl4AX.js → html-derivative-BfB3QMj5.js} +1 -1
  37. package/gui/dist/assets/{http-DJbcEzJc.js → http-pXaTY6-R.js} +1 -1
  38. package/gui/dist/assets/{hurl-BjBdeErH.js → hurl-BNtMT88T.js} +1 -1
  39. package/gui/dist/assets/{index-CR3WhYFz.js → index-CMjVOwnL.js} +15 -15
  40. package/gui/dist/assets/index-CN9ojYe6.css +1 -0
  41. package/gui/dist/assets/{java-Dn64Xe0Z.js → java-B3e3IyVz.js} +1 -1
  42. package/gui/dist/assets/{javascript-BbkSu_9c.js → javascript-DgggYE1f.js} +1 -1
  43. package/gui/dist/assets/{jinja-DqC5t5sF.js → jinja-BHtm4gvT.js} +1 -1
  44. package/gui/dist/assets/{jison-DpuZbYSp.js → jison-B2YK1Y49.js} +1 -1
  45. package/gui/dist/assets/{json-B2a7n5JV.js → json-7jbWqmUr.js} +1 -1
  46. package/gui/dist/assets/{jsx-ClgcRv-g.js → jsx-BFPQ2oqh.js} +1 -1
  47. package/gui/dist/assets/{julia-Do1-bHs6.js → julia-DX1Bsm0x.js} +1 -1
  48. package/gui/dist/assets/{just-DHt2GVD3.js → just-D524YAex.js} +1 -1
  49. package/gui/dist/assets/{latex-B_f2UeRI.js → latex-Dc0dzAGl.js} +1 -1
  50. package/gui/dist/assets/{liquid-Ds2eU_MP.js → liquid-DXohsHev.js} +1 -1
  51. package/gui/dist/assets/{lua-S7tZuNGt.js → lua-G_rux6Ay.js} +1 -1
  52. package/gui/dist/assets/{marko-udM4lCVd.js → marko-BdidjG96.js} +1 -1
  53. package/gui/dist/assets/{mdc-Cp5CPiQh.js → mdc-DxAZb3tM.js} +1 -1
  54. package/gui/dist/assets/{nginx-fGikazrY.js → nginx-CuvNT-q8.js} +1 -1
  55. package/gui/dist/assets/{nim-ByS27m8u.js → nim-DuDgLkQa.js} +1 -1
  56. package/gui/dist/assets/{org-CWef6EjL.js → org-BJKUhgoL.js} +1 -1
  57. package/gui/dist/assets/{perl-B3b8PFq6.js → perl-BdJ-pZH6.js} +1 -1
  58. package/gui/dist/assets/{php-BgIqtqOt.js → php-DUOUy2DX.js} +1 -1
  59. package/gui/dist/assets/{pug-BRImkfAG.js → pug-WUnoGP-C.js} +1 -1
  60. package/gui/dist/assets/{qml-CzXZbZNQ.js → qml-Dl8tY0zd.js} +1 -1
  61. package/gui/dist/assets/{r-Nteo2x9j.js → r-Ci9Hbbcn.js} +1 -1
  62. package/gui/dist/assets/{razor-D_Afw34M.js → razor-0bx4DTys.js} +1 -1
  63. package/gui/dist/assets/{regexp-CKIOMRkq.js → regexp-C0ZlJfpq.js} +1 -1
  64. package/gui/dist/assets/{rst-BKqSLPk8.js → rst-BC_vqA0U.js} +1 -1
  65. package/gui/dist/assets/{ruby-e08qQ71e.js → ruby-DPPk42YS.js} +1 -1
  66. package/gui/dist/assets/{sas-CBP-Z7IW.js → sas-B8jfw3hR.js} +1 -1
  67. package/gui/dist/assets/{scss-D_FoTbGY.js → scss-7mTWL496.js} +1 -1
  68. package/gui/dist/assets/{shellscript-Ck8Pcu_n.js → shellscript-CYNcJqc-.js} +1 -1
  69. package/gui/dist/assets/{shellsession-ClnG1wCa.js → shellsession-Dh2E3t_B.js} +1 -1
  70. package/gui/dist/assets/{soy-SRwHcO2G.js → soy-BVR-TmA2.js} +1 -1
  71. package/gui/dist/assets/{sql-CjUCW4z6.js → sql-D3S51lwn.js} +1 -1
  72. package/gui/dist/assets/{stata-DbpO8t8N.js → stata-BjuRTlAG.js} +1 -1
  73. package/gui/dist/assets/{surrealql-BvdjWgRW.js → surrealql-BKRHdvyc.js} +1 -1
  74. package/gui/dist/assets/{svelte-Bce_bVba.js → svelte-DIKo_e2T.js} +1 -1
  75. package/gui/dist/assets/{templ-D1Wmfx4s.js → templ-DC42iqks.js} +1 -1
  76. package/gui/dist/assets/{tex-DAUoYbei.js → tex-BZ2lfoiV.js} +1 -1
  77. package/gui/dist/assets/{ts-tags-DeHdW_lm.js → ts-tags-o8CUeNFk.js} +1 -1
  78. package/gui/dist/assets/{tsx-BtUXi9Pr.js → tsx-DeMh4Cat.js} +1 -1
  79. package/gui/dist/assets/{twig-NY4Ref0L.js → twig-BUr_lvSK.js} +1 -1
  80. package/gui/dist/assets/{typescript-BRVtVFtH.js → typescript-DeKHrHpS.js} +1 -1
  81. package/gui/dist/assets/{typst-CEx4fnEq.js → typst-CcbUABTI.js} +1 -1
  82. package/gui/dist/assets/{vue-CzSBuAS4.js → vue-JHDlnmNz.js} +1 -1
  83. package/gui/dist/assets/{vue-html-3GkraVg2.js → vue-html-soMMIiuc.js} +1 -1
  84. package/gui/dist/assets/{vue-vine-un5mayXW.js → vue-vine-D8TZS6Lm.js} +1 -1
  85. package/gui/dist/assets/{xml-DYFbmBqP.js → xml-9isD2blC.js} +1 -1
  86. package/gui/dist/assets/{xsl-CVaXn7rF.js → xsl-chWKvWOz.js} +1 -1
  87. package/gui/dist/assets/{yaml-CCwQ0s68.js → yaml-DEY2M1js.js} +1 -1
  88. package/gui/dist/index.html +2 -2
  89. package/package.json +1 -1
  90. package/gui/dist/assets/index-Bj1iisUG.css +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./angular-html-khSGtcDV.js","./html-DTSojrQm.js","./javascript-BbkSu_9c.js","./css-CUXMpymc.js","./angular-ts-CQZskKbG.js","./scss-D_FoTbGY.js","./apl-Dk2A1KW8.js","./xml-DYFbmBqP.js","./java-Dn64Xe0Z.js","./json-B2a7n5JV.js","./astro-CDNLxpIR.js","./typescript-BRVtVFtH.js","./postcss-BXeXVLqQ.js","./tsx-BtUXi9Pr.js","./blade-HVRxvZlI.js","./html-derivative-7jGgl4AX.js","./sql-CjUCW4z6.js","./bsl-_VjlB9mv.js","./sdbl-bTVj8UrX.js","./cairo-DLTphjLi.js","./python-gzcpVVnB.js","./chapel-CXJ1GKiJ.js","./c-BAogwQrx.js","./cobol-CUpuiRry.js","./coffee-Bvuk4CPF.js","./cpp-DrhGCibo.js","./regexp-CKIOMRkq.js","./glsl-DvB1v13j.js","./crystal-CoGIF_h4.js","./shellscript-Ck8Pcu_n.js","./edge-MTcLzslY.js","./elixir-DpYpNuu6.js","./elm-CAdLQ8j2.js","./erb-wGT1uBBo.js","./ruby-e08qQ71e.js","./haml-Db0uDFny.js","./graphql-CpBeqKe2.js","./jsx-ClgcRv-g.js","./lua-S7tZuNGt.js","./yaml-CCwQ0s68.js","./erlang-Cphh6RMH.js","./markdown-BYOwaDjH.js","./fortran-fixed-form-DEKoE2YW.js","./fortran-free-form-CYNrtFtB.js","./fsharp-D13ZGOAj.js","./gdresource-xMC7jr7x.js","./gdshader-CBce3t8t.js","./gdscript-DYvRD3hg.js","./git-commit-BSykSTBG.js","./diff-woXpYk--.js","./git-rebase-D7SHvGwZ.js","./glimmer-js-DEF7JSd6.js","./glimmer-ts-CM94Mbx8.js","./hack-CBlJ1Su7.js","./handlebars-B9jQcMgj.js","./http-DJbcEzJc.js","./hurl-BjBdeErH.js","./csv-Dx-8-gkx.js","./hxml-Dcm88srW.js","./haxe-C8oCnwJJ.js","./jinja-DqC5t5sF.js","./jison-DpuZbYSp.js","./julia-Do1-bHs6.js","./r-Nteo2x9j.js","./just-DHt2GVD3.js","./perl-B3b8PFq6.js","./latex-B_f2UeRI.js","./tex-DAUoYbei.js","./liquid-Ds2eU_MP.js","./marko-udM4lCVd.js","./less-DVTAwKKz.js","./mdc-Cp5CPiQh.js","./nextflow-CSgcYZcx.js","./nextflow-groovy-D7IRt6Pp.js","./nginx-fGikazrY.js","./nim-ByS27m8u.js","./org-CWef6EjL.js","./clojure-DqKBuwfJ.js","./csharp-dmMxLVLW.js","./dart-CHZY9Xhz.js","./docker-IyjqRm3v.js","./go-rLFTqkRN.js","./groovy-CacY0gHj.js","./ini-B5eOa1yu.js","./make-Dixweg8N.js","./objective-c-D1A_Heim.js","./ocaml-O90oeIOV.js","./php-BgIqtqOt.js","./vb-DOwzaHZ0.js","./raku-B3gFvitq.js","./rust-DpiIf5JO.js","./scala-BiFt_7mu.js","./zig-CMLA9XwU.js","./xsl-CVaXn7rF.js","./pug-BRImkfAG.js","./qml-CzXZbZNQ.js","./razor-D_Afw34M.js","./rst-BKqSLPk8.js","./cmake-Bj61d0ZC.js","./sas-CBP-Z7IW.js","./shaderlab-TOUzSsQk.js","./hlsl-Cvrh5tZx.js","./shellsession-ClnG1wCa.js","./soy-SRwHcO2G.js","./sparql-D_iOobhT.js","./turtle-ByJddavk.js","./stata-DbpO8t8N.js","./surrealql-BvdjWgRW.js","./svelte-Bce_bVba.js","./templ-D1Wmfx4s.js","./ts-tags-DeHdW_lm.js","./twig-NY4Ref0L.js","./typst-CEx4fnEq.js","./bat-qdxAdBWQ.js","./bibtex-Ci_nEsc7.js","./jsonc-CYpm1nAK.js","./log-BNLmms1o.js","./powershell-QtSnmXcu.js","./swift-CyEgAFGc.js","./system-verilog-Dh5ihWbf.js","./verilog-B2gwz-sJ.js","./vue-CzSBuAS4.js","./vue-html-3GkraVg2.js","./vue-vine-un5mayXW.js","./stylus-B6D30XZt.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./angular-html-BG32ZSEg.js","./html-CerDkvKq.js","./javascript-DgggYE1f.js","./css-Csea3soR.js","./angular-ts-W997xU6j.js","./scss-7mTWL496.js","./apl-6ogEEQiK.js","./xml-9isD2blC.js","./java-B3e3IyVz.js","./json-7jbWqmUr.js","./astro-DBxTz6gT.js","./typescript-DeKHrHpS.js","./postcss-BXeXVLqQ.js","./tsx-DeMh4Cat.js","./blade-PbZvkn0I.js","./html-derivative-BfB3QMj5.js","./sql-D3S51lwn.js","./bsl-_VjlB9mv.js","./sdbl-bTVj8UrX.js","./cairo-DLTphjLi.js","./python-gzcpVVnB.js","./chapel-KHYeKJD5.js","./c-C5-3wfrB.js","./cobol-D51AxaJB.js","./coffee-4h6_4dhl.js","./cpp-B63oWnHV.js","./regexp-C0ZlJfpq.js","./glsl-7SImpJuS.js","./crystal-OG_TkIE7.js","./shellscript-CYNcJqc-.js","./edge-HBaaYuuJ.js","./elixir-DZlxxd9b.js","./elm-DZAjSs9M.js","./erb-BurFBvpV.js","./ruby-DPPk42YS.js","./haml-xkw_a2ii.js","./graphql-CJ0BLjCq.js","./jsx-BFPQ2oqh.js","./lua-G_rux6Ay.js","./yaml-DEY2M1js.js","./erlang-Cphh6RMH.js","./markdown-BYOwaDjH.js","./fortran-fixed-form-DEKoE2YW.js","./fortran-free-form-CYNrtFtB.js","./fsharp-D13ZGOAj.js","./gdresource-xMC7jr7x.js","./gdshader-CBce3t8t.js","./gdscript-DYvRD3hg.js","./git-commit-BSykSTBG.js","./diff-woXpYk--.js","./git-rebase-B7wPwCu-.js","./glimmer-js-Bgk8Z51T.js","./glimmer-ts-ldZtmANh.js","./hack-D50FsJQB.js","./handlebars-C0upK5dG.js","./http-pXaTY6-R.js","./hurl-BNtMT88T.js","./csv-Dx-8-gkx.js","./hxml-Dcm88srW.js","./haxe-C8oCnwJJ.js","./jinja-BHtm4gvT.js","./jison-B2YK1Y49.js","./julia-DX1Bsm0x.js","./r-Ci9Hbbcn.js","./just-D524YAex.js","./perl-BdJ-pZH6.js","./latex-Dc0dzAGl.js","./tex-BZ2lfoiV.js","./liquid-DXohsHev.js","./marko-BdidjG96.js","./less-DVTAwKKz.js","./mdc-DxAZb3tM.js","./nextflow-CSgcYZcx.js","./nextflow-groovy-D7IRt6Pp.js","./nginx-CuvNT-q8.js","./nim-DuDgLkQa.js","./org-BJKUhgoL.js","./clojure-DqKBuwfJ.js","./csharp-dmMxLVLW.js","./dart-CHZY9Xhz.js","./docker-IyjqRm3v.js","./go-rLFTqkRN.js","./groovy-CacY0gHj.js","./ini-B5eOa1yu.js","./make-Dixweg8N.js","./objective-c-D1A_Heim.js","./ocaml-O90oeIOV.js","./php-DUOUy2DX.js","./vb-DOwzaHZ0.js","./raku-B3gFvitq.js","./rust-DpiIf5JO.js","./scala-BiFt_7mu.js","./zig-CMLA9XwU.js","./xsl-chWKvWOz.js","./pug-WUnoGP-C.js","./qml-Dl8tY0zd.js","./razor-0bx4DTys.js","./rst-BC_vqA0U.js","./cmake-Bj61d0ZC.js","./sas-B8jfw3hR.js","./shaderlab-TOUzSsQk.js","./hlsl-Cvrh5tZx.js","./shellsession-Dh2E3t_B.js","./soy-BVR-TmA2.js","./sparql-D_iOobhT.js","./turtle-ByJddavk.js","./stata-BjuRTlAG.js","./surrealql-BKRHdvyc.js","./svelte-DIKo_e2T.js","./templ-DC42iqks.js","./ts-tags-o8CUeNFk.js","./twig-BUr_lvSK.js","./typst-CcbUABTI.js","./bat-qdxAdBWQ.js","./bibtex-Ci_nEsc7.js","./jsonc-CYpm1nAK.js","./log-BNLmms1o.js","./powershell-QtSnmXcu.js","./swift-CyEgAFGc.js","./system-verilog-Dh5ihWbf.js","./verilog-B2gwz-sJ.js","./vue-JHDlnmNz.js","./vue-html-soMMIiuc.js","./vue-vine-D8TZS6Lm.js","./stylus-B6D30XZt.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),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=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.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.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`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function ee(){}var w={H:null,A:null,T:null,S:null},te=Object.prototype.hasOwnProperty;function T(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function E(e,t){return T(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function ne(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function re(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(ee,ee):(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 ie(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,ie(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ne(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(k,`$&/`)+`/`),ie(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ne(a,u),c+=ie(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ne(a,u++),c+=ie(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ie(re(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 ae(e,t,n){if(e==null)return e;var r=[],i=0;return ie(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function oe(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var se=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)};function ce(e){var t=w.T,n={};n.types=t===null?null:t.types,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(ee,se)}catch(e){se(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}}function le(e){var t=w.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else ce(le.bind(null,e))}var ue={map:ae,forEach:function(e,t,n){ae(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ae(e,function(){t++}),t},toArray:function(e){return ae(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ue,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,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.addTransitionType=le,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=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!te.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 T(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)te.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 T(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:oe}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ce,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.3.0`})),d=o(((e,t)=>{t.exports=u()})),f=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,E());else{var t=n(l);t!==null&&k(x,t.startTime-e)}}}var S=!1,C=-1,ee=5,w=-1;function te(){return g?!0:!(e.unstable_now()-w<ee)}function T(){if(g=!1,S){var t=e.unstable_now();w=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&&te());){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&&k(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?E():S=!1}}}var E;if(typeof y==`function`)E=function(){y(T)};else if(typeof MessageChannel<`u`){var D=new MessageChannel,O=D.port2;D.port1.onmessage=T,E=function(){O.postMessage(null)}}else E=function(){_(T,0)};function k(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`):ee=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,k(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,E()))),r},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();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`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(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.browser=function(e){return{$$typeof:o,_reason:e}},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 c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.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=u(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=u(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,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority: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=u(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=u(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,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority: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 l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),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=p(),n=d(),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){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e: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}function m(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&m(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function ee(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function w(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function te(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var T=Object.assign,E=Symbol.for(`react.element`),D=Symbol.for(`react.transitional.element`),O=Symbol.for(`react.portal`),k=Symbol.for(`react.fragment`),ne=Symbol.for(`react.strict_mode`),re=Symbol.for(`react.profiler`),ie=Symbol.for(`react.consumer`),ae=Symbol.for(`react.context`),oe=Symbol.for(`react.forward_ref`),se=Symbol.for(`react.suspense`),ce=Symbol.for(`react.suspense_list`),le=Symbol.for(`react.memo`),ue=Symbol.for(`react.lazy`),de=Symbol.for(`react.activity`),fe=Symbol.for(`react.legacy_hidden`),pe=Symbol.for(`react.memo_cache_sentinel`),me=Symbol.for(`react.view_transition`),he=Symbol.for(`react.recoverable`),ge=Symbol.iterator;function _e(e){return typeof e!=`object`||!e?null:(e=ge&&e[ge]||e[`@@iterator`],typeof e==`function`?e:null)}var ve=Symbol.for(`react.client.reference`);function ye(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ve?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case k:return`Fragment`;case re:return`Profiler`;case ne:return`StrictMode`;case se:return`Suspense`;case ce:return`SuspenseList`;case de:return`Activity`;case me:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case O:return`Portal`;case ae:return e.displayName||`Context`;case ie:return(e._context.displayName||`Context`)+`.Consumer`;case oe:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case le:return t=e.displayName||null,t===null?ye(e.type)||`Memo`:t;case ue:t=e._payload,e=e._init;try{return ye(e(t))}catch{}}return null}var be=Array.isArray,A=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe={pending:!1,data:null,method:null,action:null},Se=[],Ce=-1;function we(e){return{current:e}}function Te(e){0>Ce||(e.current=Se[Ce],Se[Ce]=null,Ce--)}function Ee(e,t){Ce++,Se[Ce]=e.current,e.current=t}var De=we(null),Oe=we(null),ke=we(null),Ae=we(null);function je(e,t){switch(Ee(ke,t),Ee(Oe,e),Ee(De,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?pp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=pp(t),e=mp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Te(De),Ee(De,e)}function Me(){Te(De),Te(Oe),Te(ke)}function Ne(e){var t=e.memoizedState;t!==null&&(uh._currentValue=t.memoizedState,Ee(Ae,e)),t=De.current;var n=mp(t,e.type);t!==n&&(Ee(Oe,e),Ee(De,n))}function Pe(e){Oe.current===e&&(Te(De),Te(Oe)),Ae.current===e&&(Te(Ae),uh._currentValue=xe)}var Fe,Ie;function Le(e){if(Fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Fe=t&&t[1]||``,Ie=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+Fe+e+Ie}var M=!1;function Re(e,t){if(!e||M)return``;M=!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}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}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(`
@@ -63,15 +63,15 @@ Error generating stack: `+e.message+`
63
63
 
64
64
  Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function ao(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;ao(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var oo=new Set([`type`,`properties`,`required`,`additionalProperties`]),so=[`oneOf`,`anyOf`];function co(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function lo(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!oo.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??co(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}j(n,r,e.length===1?e[0]:lo(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=co(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function uo(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of oo)if(t in e)return;let n=t.filter(e=>so.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=lo(t);else{let e=n[0],i=so.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>lo([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,$a(e,r))}function fo(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):$a(i,s),$a(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())ao(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])uo(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}$a(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,j(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:ho(t,`input`,e.processors),output:ho(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function po(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return po(r.element,n);if(r.type===`set`)return po(r.valueType,n);if(r.type===`lazy`)return po(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return po(r.innerType,n);if(r.type===`intersection`)return po(r.left,n)||po(r.right,n);if(r.type===`record`||r.type===`map`)return po(r.keyType,n)||po(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:po(r.in,n)||po(r.out,n);if(r.type===`object`){for(let e in r.shape)if(po(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(po(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(po(e,n))return!0;return!!(r.rest&&po(r.rest,n))}return!1}var mo=(e,t={})=>n=>{let r=eo({...n,processors:t});return no(e,r),io(r,e),fo(r,e)},ho=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=eo({...i??{},target:a,io:t,processors:n});return no(e,o),io(o,e),fo(o,e)},go=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},_o=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},vo=(e,t)=>{go(e,`minimum`,t),_o(e,`maximum`,t)},yo=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},bo=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},xo=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},So=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Co=(e,t)=>go(e,`minimum`,t.minimum),wo=(e,t)=>_o(e,`maximum`,t.maximum),To=e=>(t,n)=>{So(t,n.format);let[r,i]=e[n.format];go(t,`minimum`,r),_o(t,`maximum`,i)},Eo={greater_than:(e,t)=>go(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>_o(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>yo(e,t.value),number_format:To(Be),bigint_format:To(Ve),min_length:Co,max_length:wo,length_equals:(e,t)=>vo(e,t.length),min_size:Co,max_size:wo,size_equals:(e,t)=>vo(e,t.size),string_format:(e,t)=>{So(e,t.format),t.pattern&&bo(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>xo(e,t.mime)};function Do(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Eo[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&go(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&go(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&_o(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&_o(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&yo(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&xo(t,i.mime);for(let e of i.patterns??[])bo(t,e);return t}var Oo={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ko=new Map([[Lr,bn],[zr,xn]]),Ao=e=>ko.get(e)??e,jo=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=Do(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Oo[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Ao);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Mo=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=Do(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):to(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},No=(e,t,n,r)=>{n.type=`boolean`},Po=(e,t,n,r)=>{n.not={}},Fo=(e,t,n,r)=>{let i=e._zod.def,a=me(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Io=(e,t,n,r)=>{to(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Lo=(e,t,n,r)=>{to(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Ro=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Do(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=no(a.element,t,{...r,path:[...r.path,`items`]})};function zo(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?zo(t.out):t.type===`catch`?zo(t.innerType):e._zod.optin}var Bo=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&to(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)j(i.properties,e,no(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?zo(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=no(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Vo=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>no(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Ho=(e,t,n,r)=>{let i=e._zod.def,a=no(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=no(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Uo=(e,t,n,r)=>{let i=e._zod.def,a=no(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Wo=(e,t,n,r)=>{let i=e._zod.def;no(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Go=Symbol();function Ko(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(to(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Go):JSON.parse(o)}var L=(e,t,n,r)=>{let i=e._zod.def;no(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Ko(i.defaultValue,e,t,n,r);o!==Go&&(n.default=o)},R=(e,t,n,r)=>{let i=e._zod.def;no(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Ko(i.defaultValue,e,t,n,r);o!==Go&&(n._prefault=o)},qo=(e,t,n,r)=>{let i=e._zod.def;no(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{to(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Jo=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;no(o,t,r);let s=t.seen.get(e);s.ref=o},Yo=(e,t,n,r)=>{let i=e._zod.def;no(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Xo=(e,t,n,r)=>{let i=e._zod.def;no(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Zo=new WeakSet([Object.prototype,Error.prototype]);function Qo(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var $o=P(`ZodError`,(e,t)=>{Pt.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Zo.has(n)||(Zo.add(n),Qo(n,`format`,e=>t=>Lt(e,t)),Qo(n,`flatten`,e=>t=>It(e,t)),Qo(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ge,2)}),Qo(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ge,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),es=zt($o),ts=Bt($o),ns=Vt($o),rs=Ut($o),is=Yt($o),as=F($o),os=Xt($o),ss=Zt($o),cs=Qt($o),ls=$t($o),us=en($o),ds=tn($o);function fs(){Et.localeError||Dt(Ki())}function ps(){Et.memoizer||Dt({memoizer:Ui()})}var ms=P(`ZodType`,(e,t)=>(fs(),tr.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(De(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Le(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Oc(e,t))},superRefine(e,t){return this.check(kc(e,t))},overwrite(e){return this.check(Ua(e))},optional(){return uc(this)},exactOptional(){return fc(this)},nullable(){return mc(this)},nullish(){return uc(mc(this))},nonoptional(e){return bc(this,e)},array(){return Qs(this)},or(e){return nc([this,e])},and(e){return ic(this,e)},transform(e){return wc(this,cc(e))},default(e){return gc(this,e)},prefault(e){return vc(this,e)},catch(e){return Sc(this,e)},pipe(e){return wc(this,e)},readonly(){return Ec(this)},describe(e){let t=this.clone();return Xi.add(t,{description:e}),t},meta(...e){if(e.length===0)return Xi.get(this);let t=this.clone();return Xi.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return ut(this,`~standard`,{...ir(this),jsonSchema:{input:ho(this,`input`),output:ho(this,`output`)}})},set"~standard"(e){lt(this,`~standard`,e)},parse:function e(t,n){return es(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await ts(this,t,n,{callee:e})},safeParse(e,t){return ns(this,e,t)},async safeParseAsync(e,t){return rs(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){lt(this,`spa`,e)},validate(e,t){return Kt(this,e,t)},validateAsync(e,t){return Jt(this,e,t)},encode:function e(t,n){return is(this,t,n,{callee:e})},decode:function e(t,n){return as(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await os(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await ss(this,t,n,{callee:e})},safeEncode(e,t){return cs(this,e,t)},safeDecode(e,t){return ls(this,e,t)},async safeEncodeAsync(e,t){return us(this,e,t)},async safeDecodeAsync(e,t){return ds(this,e,t)},toJSONSchema(e){return mo(this,{})(e)},get description(){return Xi.get(this)?.description},get _def(){return this._zod.def}}),hs=P(`_ZodString`,(e,t)=>{ar.init(e,t),ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jo(e,t,n,r)},dt({format:e=>Do(e).format??null,minLength:e=>Do(e).minimum??null,maxLength:e=>Do(e).maximum??null},{regex(...e){return this.check(La(...e))},includes(...e){return this.check(Ba(...e))},startsWith(...e){return this.check(Va(...e))},endsWith(...e){return this.check(Ha(...e))},min(...e){return this.check(Fa(...e))},max(...e){return this.check(Pa(...e))},length(...e){return this.check(Ia(...e))},nonempty(...e){return this.check(Fa(1,...e))},lowercase(e){return this.check(Ra(e))},uppercase(e){return this.check(za(e))},trim(){return this.check(Ga())},normalize(...e){return this.check(Wa(...e))},toLowerCase(){return this.check(Ka())},toUpperCase(){return this.check(qa())},slugify(){return this.check(Ja())}})),gs=P(`ZodString`,(e,t)=>{ar.init(e,t),hs.init(e,t)},{email(e){return this.check($i(Ss,e))},url(e){return this.check(aa(Ts,e))},jwt(e){return this.check(ya(Bs,e))},emoji(e){return this.check(oa(Es,e))},guid(e){return this.check(ea(Cs,e))},uuid(e){return this.check(ta(ws,e))},uuidv4(e){return this.check(na(ws,e))},uuidv6(e){return this.check(ra(ws,e))},uuidv7(e){return this.check(ia(ws,e))},nanoid(e){return this.check(sa(Ds,e))},cuid(e){return this.check(ca(Os,e))},cuid2(e){return this.check(I(ks,e))},ulid(e){return this.check(la(As,e))},base64(e){return this.check(ga(Ls,e))},base64url(e){return this.check(_a(Rs,e))},xid(e){return this.check(ua(js,e))},ksuid(e){return this.check(da(Ms,e))},ipv4(e){return this.check(fa(Ns,e))},ipv6(e){return this.check(pa(Ps,e))},cidrv4(e){return this.check(ma(Fs,e))},cidrv6(e){return this.check(ha(Is,e))},e164(e){return this.check(va(zs,e))},datetime(e){return this.check(ba(vs,e))},date(e){return this.check(xa(ys,e))},time(e){return this.check(Sa(bs,e))},duration(e){return this.check(Ca(xs,e))}});function z(e){return Qi(gs,e)}var _s=P(`ZodStringFormat`,(e,t)=>{or.init(e,t),hs.init(e,t)}),vs=P(`ZodISODateTime`,(e,t)=>{Tr.init(e,t),_s.init(e,t)}),ys=P(`ZodISODate`,(e,t)=>{Er.init(e,t),_s.init(e,t)}),bs=P(`ZodISOTime`,(e,t)=>{Dr.init(e,t),_s.init(e,t)}),xs=P(`ZodISODuration`,(e,t)=>{Or.init(e,t),_s.init(e,t)}),Ss=P(`ZodEmail`,(e,t)=>{lr.init(e,t),_s.init(e,t)}),Cs=P(`ZodGUID`,(e,t)=>{sr.init(e,t),_s.init(e,t)}),ws=P(`ZodUUID`,(e,t)=>{cr.init(e,t),_s.init(e,t)}),Ts=P(`ZodURL`,(e,t)=>{_r.init(e,t),_s.init(e,t)}),Es=P(`ZodEmoji`,(e,t)=>{vr.init(e,t),_s.init(e,t)}),Ds=P(`ZodNanoID`,(e,t)=>{yr.init(e,t),_s.init(e,t)}),Os=P(`ZodCUID`,(e,t)=>{br.init(e,t),_s.init(e,t)}),ks=P(`ZodCUID2`,(e,t)=>{xr.init(e,t),_s.init(e,t)}),As=P(`ZodULID`,(e,t)=>{Sr.init(e,t),_s.init(e,t)}),js=P(`ZodXID`,(e,t)=>{Cr.init(e,t),_s.init(e,t)}),Ms=P(`ZodKSUID`,(e,t)=>{wr.init(e,t),_s.init(e,t)}),Ns=P(`ZodIPv4`,(e,t)=>{kr.init(e,t),_s.init(e,t)}),Ps=P(`ZodIPv6`,(e,t)=>{Mr.init(e,t),_s.init(e,t)}),Fs=P(`ZodCIDRv4`,(e,t)=>{Nr.init(e,t),_s.init(e,t)}),Is=P(`ZodCIDRv6`,(e,t)=>{Fr.init(e,t),_s.init(e,t)}),Ls=P(`ZodBase64`,(e,t)=>{Rr.init(e,t),_s.init(e,t)}),Rs=P(`ZodBase64URL`,(e,t)=>{Vr.init(e,t),_s.init(e,t)}),zs=P(`ZodE164`,(e,t)=>{Hr.init(e,t),_s.init(e,t)}),Bs=P(`ZodJWT`,(e,t)=>{Wr.init(e,t),_s.init(e,t)}),Vs=P(`ZodNumber`,(e,t)=>{Gr.init(e,t),ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mo(e,t,n,r),e.isFinite=!0},dt({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Do(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Do(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=Do(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Do(e).format??null},{gt(e,t){return this.check(ja(e,t))},gte(e,t){return this.check(Ma(e,t))},min(e,t){return this.check(Ma(e,t))},lt(e,t){return this.check(ka(e,t))},lte(e,t){return this.check(Aa(e,t))},max(e,t){return this.check(Aa(e,t))},int(e){return this.check(Ws(e))},safe(e){return this.check(Ws(e))},positive(e){return this.check(ja(0,e))},nonnegative(e){return this.check(Ma(0,e))},negative(e){return this.check(ka(0,e))},nonpositive(e){return this.check(Aa(0,e))},multipleOf(e,t){return this.check(Na(e,t))},step(e,t){return this.check(Na(e,t))},finite(){return this}}));function Hs(e){return wa(Vs,e)}var Us=P(`ZodNumberFormat`,(e,t)=>{Kr.init(e,t),Vs.init(e,t)});function Ws(e){return Ta(Us,e)}var Gs=P(`ZodBoolean`,(e,t)=>{qr.init(e,t),ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>No(e,t,n,r)});function Ks(e){return Ea(Gs,e)}var qs=P(`ZodUnknown`,(e,t)=>{Jr.init(e,t),ms.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Js(){return Da(qs)}var Ys=P(`ZodNever`,(e,t)=>{Yr.init(e,t),ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Po(e,t,n,r)});function Xs(e){return Oa(Ys,e)}var Zs=P(`ZodArray`,(e,t)=>{ps(),Zr.init(e,t),ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ro(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Fa(e,t))},nonempty(e){return this.check(Fa(1,e))},max(e,t){return this.check(Pa(e,t))},length(e,t){return this.check(Ia(e,t))},unwrap(){return this.element}});function Qs(e,t){return Ya(Zs,e,t)}var $s=P(`ZodObject`,(e,t)=>{ps(),ri.init(e,t),ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bo(e,t,n,r),_t(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return oc(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(De(this._zod.def,{catchall:e}))},passthrough(){return this.clone(De(this._zod.def,{catchall:Js()}))},loose(){return this.clone(De(this._zod.def,{catchall:Js()}))},strict(){return this.clone(De(this._zod.def,{catchall:Xs()}))},strip(){return this.clone(De(this._zod.def,{catchall:void 0}))},extend(e){return Ge(this,e)},safeExtend(e){return qe(this,e)},merge(e){return Je(this,e)},pick(e){return He(this,e)},omit(e){return We(this,e)},partial(...e){return Ye(lc,this,e[0])},exactPartial(...e){return Ye(dc,this,e[0],`exactPartial`)},required(...e){return Xe(yc,this,e[0])}});function ec(e,t){return new $s({type:`object`,shape:e??{},...M(t)})}var tc=P(`ZodUnion`,(e,t)=>{ai.init(e,t),ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vo(e,t,n,r),e.options=t.options});function nc(e,t){return new tc({type:`union`,options:e,...M(t)})}var rc=P(`ZodIntersection`,(e,t)=>{oi.init(e,t),ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ho(e,t,n,r)});function ic(e,t){return new rc({type:`intersection`,left:e,right:t})}var ac=P(`ZodEnum`,(e,t)=>{li.init(e,t),ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fo(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new ac({...t,checks:[],...M(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new ac({...t,checks:[],...M(r),entries:i})}});function oc(e,t){return new ac({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...M(t)})}var sc=P(`ZodTransform`,(e,t)=>{ps(),ui.init(e,t),ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lo(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Tt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(st(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(st(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function cc(e){return new sc({type:`transform`,transform:e})}var lc=P(`ZodOptional`,(e,t)=>{fi.init(e,t),ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function uc(e){return new lc({type:`optional`,innerType:e})}var dc=P(`ZodExactOptional`,(e,t)=>{pi.init(e,t),ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fc(e){return new dc({type:`optional`,innerType:e})}var pc=P(`ZodNullable`,(e,t)=>{mi.init(e,t),ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function mc(e){return new pc({type:`nullable`,innerType:e})}var hc=P(`ZodDefault`,(e,t)=>{hi.init(e,t),ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>L(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function gc(e,t){return new hc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Pe(t)}})}var _c=P(`ZodPrefault`,(e,t)=>{_i.init(e,t),ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>R(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vc(e,t){return new _c({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Pe(t)}})}var yc=P(`ZodNonOptional`,(e,t)=>{vi.init(e,t),ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bc(e,t){return new yc({type:`nonoptional`,innerType:e,...M(t)})}var xc=P(`ZodCatch`,(e,t)=>{xi.init(e,t),ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Sc(e,t){return new xc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:yt(t)})}var Cc=P(`ZodPipe`,(e,t)=>{Si.init(e,t),ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jo(e,t,n,r),e.in=t.in,e.out=t.out});function wc(e,t){return new Cc({type:`pipe`,in:e,out:t})}var Tc=P(`ZodReadonly`,(e,t)=>{wi.init(e,t),ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ec(e){return new Tc({type:`readonly`,innerType:e})}var Dc=P(`ZodCustom`,(e,t)=>{Ei.init(e,t),ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Io(e,t,n,r)});function Oc(e,t={}){return Xa(Dc,e,t)}function kc(e,t){return Za(e,t)}var Ac=[`branch`,`working_tree`],jc=[`added`,`modified`,`deleted`,`renamed`,`untracked`],Mc=[`critical`,`major`,`minor`,`trivial`],Nc=[`issue`,`requirement_gap`],Pc=[`open`,`ignored`,`outdated`],Fc=[`new`,`old`],Ic=[`current`,`outdated`],Lc=[`flow`,`layers`,`mindmap`],Rc=[`box`,`pill`,`decision`],zc=[`new`,`modified`,`impacted`,`existing`,`finding`,`missing`],Bc=[`pending`,`submitted`],Vc=[`approve`,`request_changes`,`reject`],Hc=[`agent`,`user`],Uc=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,Wc=z().regex(/^[A-Za-z0-9_-]{1,64}$/,`must contain only letters, digits, '_' or '-' (1 to 64 characters)`),Gc=Hs().int().positive(),Kc=z().min(1),qc=ec({path:z().min(1),oldPath:z().min(1).nullable(),status:oc(jc),additions:Hs().int().nonnegative(),deletions:Hs().int().nonnegative(),binary:Ks(),contentAvailable:Ks(),lineCount:Hs().int().nonnegative(),reviewed:Ks()}),Jc=ec({path:z().min(1),startLine:Gc,endLine:Gc}),Yc=ec({id:Wc,severity:oc(Mc),kind:oc(Nc),title:z().min(1),body:z(),location:Jc.nullable(),anchorText:z().nullable(),suggestion:z().nullable(),prompt:z().nullable(),status:oc(Pc),createdAt:Kc}),Xc=ec({path:z().min(1),side:oc(Fc),startLine:Gc,endLine:Gc}),Zc=ec({id:Wc,title:z().min(1),body:z().min(1),location:Xc,anchorText:z(),status:oc(Ic),createdAt:Kc}),Qc=ec({path:z().min(1),line:Gc.nullable()}),$c=ec({id:Wc,location:Qc.nullable(),findingId:Wc.nullable(),text:z().min(1),createdAt:Kc}),el=ec({path:z().min(1),line:Gc.nullable()}),tl=ec({id:Wc,label:z().min(1),shape:oc(Rc),status:oc(zc),layer:z().min(1).nullable(),detail:z().nullable(),location:el.nullable()}),nl=ec({from:Wc,to:Wc,label:z().nullable()}),rl=ec({id:Wc,title:z().min(1),kind:oc(Lc),layers:Qs(z().min(1)),nodes:Qs(tl),links:Qs(nl),updatedAt:Kc}),il=ec({at:Kc,note:z().min(1).nullable()}),al=ec({decision:oc(Vc),submittedAt:Kc,processed:il.nullable(),findings:Qs(ec({id:Wc,title:z().min(1)})),notes:Qs(ec({id:Wc,location:Qc.nullable(),text:z().min(1)})),excludedFindingIds:Qs(Wc),excludedNoteIds:Qs(Wc)}),ol=ec({state:oc(Bc),decision:oc(Vc).nullable(),selectedFindingIds:Qs(Wc),selectedNoteIds:Qs(Wc),prompt:z().nullable(),submittedAt:Kc.nullable(),processed:il.nullable(),previousSubmission:al.nullable()}),sl=ec({text:z().min(1),source:z().min(1).nullable()}),cl=ec({objective:z().min(1),approach:z().min(1),attentionPoints:Qs(z().min(1))}),ll=z().min(1).refine(e=>e===e.trim(),`must not start or end with whitespace`);ec({id:z().regex(Uc),title:z().min(1),project:ll,repoPath:z().min(1),mode:oc(Ac),base:z().min(1),head:z().min(1).nullable(),baseCommit:z().min(1),headCommit:z().min(1).nullable(),snapshotAt:Kc,request:sl.nullable(),overview:cl.nullable(),summary:Qs(z().min(1)),files:Qs(qc),findings:Qs(Yc),explanations:Qs(Zc),notes:Qs($c),diagrams:Qs(rl),review:ol,revision:Hs().int().nonnegative(),createdAt:Kc,updatedAt:Kc,lastEditor:oc(Hc)});var ul=[`not_started`,`in_progress`,`files_reviewed`,`submitted`];function dl(e){return Mc.indexOf(e)}function fl(e,t){return dl(e)-dl(t)}function pl(e){return[...e].sort((e,t)=>fl(e.severity,t.severity))}function ml(e){if(e===``)return[];let t=e.split(`
65
65
  `).map(e=>e.endsWith(`\r`)?e.slice(0,-1):e);return t[t.length-1]===``&&e.endsWith(`
66
- `)&&t.pop(),t}function hl(e,t,n=`-`){return e===t?`${e}`:`${e}${n}${t}`}function gl(e){return e.line===null?e.path:`${e.path}:${e.line}`}function _l(e,t){let n=e.findings.flatMap(e=>e.location?.path===t?[{finding:e,startLine:e.location.startLine,endLine:e.location.endLine}]:[]);return n.sort((e,t)=>e.startLine-t.startLine||e.endLine-t.endLine),n.map((e,t)=>({...e,number:t+1}))}function vl(e){let t=new Set;for(let n of e.hunks)for(let e of n.lines)e.newNo!==null&&t.add(e.newNo);return t}function yl(e,t,n){for(let r=t;r<=n;r++)if(e.has(r))return r;return null}var bl={off:{icon:`eye-off`,label:`Sans correctif`,description:`Le diff seul`},"before-after":{icon:`git-compare`,label:`Avant / après`,description:`Lignes visées barrées, correctif dessous`},applied:{icon:`wand-sparkles`,label:`Code corrigé`,description:`Correctif à la place des lignes visées`}},xl={diff:{icon:`diff`,label:`Unifié`,description:`Lignes supprimées au-dessus des lignes ajoutées`},split:{icon:`columns-2`,label:`Côte à côte`,description:`Ancien code à gauche, nouveau à droite`},new:{icon:`file-code`,label:`Nouveau code`,description:`Le nouveau code seul, ajouts marqués d'un filet`}},Sl={changes:{icon:`fold-vertical`,label:`Modifications`,description:`Les blocs du diff et leurs lignes de contexte`},file:{icon:`unfold-vertical`,label:`Fichier entier`,description:`Tout le fichier, lignes inchangées comprises`}};function Cl(e,t,n){return e.hunks.some(e=>{let r=e.lines.flatMap(e=>e.newNo===null?[]:[e.newNo]);return r.includes(t)&&r.includes(n)})}function wl(e,t,n,r){let i=new Map,a=[];for(let o of e){let{finding:e}=o;if(e.suggestion===null)i.set(e.id,{state:`none`});else if(!Cl(t,o.startLine,o.endLine))i.set(e.id,{state:`outside`});else if(r===`off`||!n(e))i.set(e.id,{state:`hidden`});else{let t=a.find(e=>e.startLine<=o.endLine&&o.startLine<=e.endLine);t?i.set(e.id,{state:`blocked`,blockedBy:t.number}):(a.push(o),i.set(e.id,{state:`shown`}))}}return i}function Tl(e){return e.kind===`line`?Bl(e.line):Hl(e.entry.finding.id)}function El(e){return e.kind===`line`?e.line:e.entry.startLine-.5}function Dl(e,t){return e===null||t===null?!1:e.kind===`line`?t.kind===`line`&&e.line===t.line:t.kind===`fix`&&e.entry.finding.id===t.entry.finding.id}function Ol(e,t,n){let r=new Map;if(n!==`applied`)return r;for(let n of e)if(t.get(n.finding.id)?.state===`shown`)for(let e=n.startLine;e<=n.endLine;e++)r.set(e,n);return r}function kl(e,t){let n=t.get(e);return n?{kind:`fix`,entry:n}:{kind:`line`,line:e}}function Al(e,t,n,r){if(t.get(e.finding.id)?.state===`shown`)return{kind:`fix`,entry:e};for(let t=e.startLine;t<=e.endLine;t++)if(n.has(t)&&!r.has(t))return{kind:`line`,line:t};let i=yl(n,e.startLine,e.endLine);return i===null?null:kl(i,r)}function jl(e){return{severity:e.severity,muted:e.status!==`open`}}function Ml(e,t){let n=null;for(let{finding:r,startLine:i,endLine:a}of e)t<i||t>a||(n===null||r.status===`open`&&n.status!==`open`||r.status===`open`==(n.status===`open`)&&fl(r.severity,n.severity)<0)&&(n=r);return n?jl(n):null}function Nl(e){return ml(e.finding.suggestion??``).map((t,n)=>({kind:`fix-line`,text:t,index:n,entry:e,bar:jl(e.finding)}))}function Pl(e,t){return e.explanations.filter(e=>e.location.path===t).sort((e,t)=>e.location.startLine-t.location.startLine||(e.location.side===t.location.side?0:e.location.side===`old`?-1:1)||e.location.endLine-t.location.endLine)}function Fl(e,t){let{side:n,startLine:r,endLine:i}=e.location,a=n===`new`?t.newNo:t.type===`add`?null:t.oldNo;return a!==null&&a>=r&&a<=i}function Il(e,t,n,r){for(let i of e.hunks){let e=i.lines.findIndex(e=>Fl(t,e));if(e===-1)continue;let a=i.lines[e];if(a.newNo!==null){let e=kl(a.newNo,n);return{selector:Tl(e),order:El(e)}}let o=i.lines.slice(e).find(e=>e.newNo!==null),s=i.lines.slice(0,e).findLast(e=>e.newNo!==null);if(r===`new`){let e=o??s;if(!e)continue;let t=kl(e.newNo,n);return{selector:Tl(t),order:El(t)+(o?-.25:.25)}}let c=o?o.newNo-.25:s?s.newNo+.25:i.newStart;return{selector:Vl(a.oldNo),order:c}}return null}function Ll(e,t,n,r,i,a){let o=vl(e),s=Ol(t,n,r),c=t.filter(e=>n.get(e.finding.id)?.state===`shown`),l=new Map,u=new Map;for(let e of t){if(n.get(e.finding.id)?.state===`shown`)continue;let t=Al(e,n,o,s);if(t?.kind===`line`&&l.set(t.line,[...l.get(t.line)??[],e]),t?.kind===`fix`){let n=t.entry.finding.id;u.set(n,[...u.get(n)??[],e])}}let d=e=>({kind:`fix-strip`,entry:e,bar:jl(e.finding),pills:u.get(e.finding.id)??[]});return e.hunks.map(e=>{let n=[],o=pe(e.lines),s=le(o);for(let{line:e,oldLine:u}of o){if(a===`new`&&e.type===`del`)continue;let o=e.newNo,f=o===null?void 0:c.find(e=>o>=e.startLine&&o<=e.endLine);if(r===`applied`&&f){f.startLine===o&&n.push(d(f),...Nl(f));continue}f&&f.startLine===o&&n.push(d(f)),n.push({kind:`line`,line:e,oldLine:u,inline:s.get(e)??null,replaced:f!==void 0&&e.type!==`del`,explained:i.some(t=>Fl(t,e)||u!==null&&Fl(t,u)),bar:f?jl(f.finding):o===null?null:Ml(t,o),pills:o===null?[]:l.get(o)??[]}),f&&f.endLine===o&&n.push(...Nl(f))}return{hunk:e,rows:n}})}function Rl(e,t){return e?.kind===`line`&&e.oldLine===null&&e.line.type===t}function zl(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r.kind===`fix-strip`)t.push({kind:`full`,row:r}),n++;else if(r.kind===`line`&&r.oldLine!==null)t.push({kind:`pair`,left:r,right:r}),n++;else if(r.kind===`fix-line`||Rl(r,`add`))t.push({kind:`pair`,left:null,right:r}),n++;else if(Rl(r,`context`))t.push({kind:`pair`,left:r,right:r}),n++;else{let r=[],i=[];for(let t=e[n];Rl(t,`del`);t=e[++n])r.push(t);for(let t=e[n];Rl(t,`add`);t=e[++n])i.push(t);for(let e=0;e<Math.max(r.length,i.length);e++)t.push({kind:`pair`,left:r[e]??null,right:i[e]??null})}}return t}function Bl(e){return`[data-line="${e}"]`}function Vl(e){return`[data-old-line="${e}"]`}function Hl(e){return`[data-fix="${e}"]`}function Ul(e,t){return e.notes.filter(e=>e.location?.path===t&&e.location.line!==null).sort((e,t)=>e.location.line-t.location.line)}function Wl(e){if(e.kind===`fix-line`)return{kind:null,added:[],deleted:[],newNo:null,strip:null};let{line:t}=e,n=e.oldLine===null?t.type===`context`?null:t.type:`reindent`;return{kind:n,added:n===`add`||n===`reindent`?[t.newNo]:[],deleted:n===`del`?[t.oldNo]:[],newNo:t.newNo,strip:null}}function Gl(e){return{kind:null,added:[],deleted:[],newNo:null,strip:e}}function Kl(e,t){return e.flatMap(e=>t===`split`?zl(e.rows).map(e=>{if(e.kind===`full`)return Gl(e.row.entry);let t=e.left?Wl(e.left):null,n=e.right?Wl(e.right):null;if(n?.kind===`reindent`)return n;let r=n?.kind===`add`?n.added:[],i=t?.kind===`del`?t.deleted:[];return{kind:r.length>0?i.length>0?`mod`:`add`:i.length>0?`del`:null,added:r,deleted:i,newNo:n?.newNo??null,strip:null}}):e.rows.map(e=>e.kind===`fix-strip`?Gl(e.entry):Wl(e)))}function ql(e,t){return`${e} ligne${e>1?`s`:``} ${t}${e>1?`s`:``}`}function Jl(e){let t=Math.min(...e),n=Math.max(...e);return t===n?`ligne ${t}`:`lignes ${t} à ${n}`}function Yl(e,t,n){switch(e){case`add`:return`${ql(t.length,`ajoutée`)} · ${Jl(t)}`;case`del`:return`${ql(n.length,`supprimée`)} · ancienne ${Jl(n)}`;case`mod`:return`${ql(n.length,`supprimée`)}, ${t.length} ajoutée${t.length>1?`s`:``} · ${Jl(t)}`;case`reindent`:return`Indentation modifiée · ${Jl(t)}`}}function Xl(e,t,n,r){let i=Kl(e,t),a=[];for(let e=0;e<i.length;){let t=i[e].kind,n=e+1;for(;n<i.length&&i[n].kind===t;)n++;if(t!==null){let r=i.slice(e,n);a.push({kind:t,start:e,end:n,label:Yl(t,r.flatMap(e=>e.added),r.flatMap(e=>e.deleted))})}e=n}let o=[];for(let e of n){let t=i.findIndex(t=>t.strip?.finding.id===e.finding.id||t.newNo!==null&&t.newNo>=e.startLine&&t.newNo<=e.endLine);t!==-1&&o.push({kind:`finding`,entry:e,row:t})}for(let e of r){let t=i.findIndex(t=>t.newNo===e);t!==-1&&o.push({kind:`note`,line:e,row:t})}return{changes:a,dots:o}}function Zl(e,t){return e===t?`la ligne ${e}`:`les lignes ${e} à ${t}`}var Ql=`feature-analyzer.`;function $l(e,t,n){try{let r=window.localStorage.getItem(Ql+e);return r!==null&&Object.hasOwn(t,r)?r:n}catch{return n}}function eu(e,t){try{window.localStorage.setItem(Ql+e,t)}catch{}}var tu=5e3,nu=0,ru,iu=null,au=`L'analyse a été modifiée entre-temps (par l'agent ou un autre onglet) : elle vient d'être rechargée. Vérifiez l'état affiché puis refaites votre action.`,B=w((e,t)=>{async function n(n,r){let i=t().current?.analysis;if(!i)return!1;e({saving:!0});try{let n=await r(i);return t().current?.id===n.analysis.id&&e({current:{id:n.analysis.id,analysis:n.analysis,error:null}}),!0}catch(e){return e instanceof te&&e.status===409?(await t().reloadCurrent(),t().notify(`info`,au)):t().notify(`error`,`${n} : ${e.message}`),!1}finally{e({saving:!1})}}return{config:null,analyses:null,unreadable:[],listError:null,current:null,diff:null,diffError:null,saving:!1,notice:null,homeFilter:`to_review`,collapsedProjects:new Set,fixMode:$l(`fix-mode`,bl,`before-after`),codeView:$l(`code-view`,xl,`diff`),diffScope:$l(`diff-scope`,Sl,`changes`),gapsCollapsed:!1,filesPanelCollapsed:!1,findingsShown:!0,explanationsShown:!0,setHomeFilter:t=>e({homeFilter:t}),toggleProject:n=>{let r=new Set(t().collapsedProjects);r.has(n)?r.delete(n):r.add(n),e({collapsedProjects:r})},setFixMode:t=>{eu(`fix-mode`,t),e({fixMode:t})},setCodeView:t=>{eu(`code-view`,t),e({codeView:t})},setDiffScope:t=>{eu(`diff-scope`,t),e({diffScope:t})},setGapsCollapsed:t=>e({gapsCollapsed:t}),setFilesPanelCollapsed:t=>e({filesPanelCollapsed:t}),setFindingsShown:t=>e({findingsShown:t}),setExplanationsShown:t=>e({explanationsShown:t}),loadConfig:async()=>{try{e({config:await O.getConfig()})}catch(e){t().notify(`error`,`Configuration illisible : ${e.message}`)}},setListing:t=>e({analyses:t.analyses,unreadable:t.unreadable,listError:null}),loadAnalyses:async()=>{try{t().setListing(await O.listAnalyses())}catch(t){e({listError:`Liste des analyses illisible : ${t.message}`})}},openAnalysis:n=>{t().current?.id!==n&&(e({current:{id:n,analysis:null,error:null}}),t().reloadCurrent())},reloadCurrent:async()=>{let n=t().current?.id;if(n)try{let{analysis:r}=await O.getAnalysis(n);if(t().current?.id!==n)return;e({current:{id:n,analysis:r,error:null}}),await t().ensureDiff()}catch(r){if(t().current?.id!==n)return;e({current:{id:n,analysis:null,error:r.message}})}},ensureDiff:async()=>{let n=t().current?.analysis;if(!n)return;let r=t().diff;if(r&&r.id===n.id&&r.snapshotAt===n.snapshotAt)return;let i=`${n.id}@${n.snapshotAt}`;if(iu?.key===i)return iu.promise;let a=(async()=>{try{let{diff:r}=await O.getDiff(n.id);if(t().current?.analysis?.id!==n.id)return;e({diff:{id:n.id,snapshotAt:n.snapshotAt,snapshot:r},diffError:null})}catch(t){e({diffError:`Diff illisible : ${t.message}`})}finally{iu?.key===i&&(iu=null)}})();return iu={key:i,promise:a},a},setFileReviewed:(e,t)=>n(`Marquage du fichier impossible`,n=>O.setFileReviewed(n.id,{path:e,reviewed:t,baseRevision:n.revision})),setFindingStatus:(e,t)=>n(`Changement de statut impossible`,n=>O.setFindingStatus(n.id,e,{status:t,baseRevision:n.revision})),addNote:(e,t,r,i)=>n(`Remarque non enregistrée`,n=>O.addNote(n.id,{path:e,line:t,findingId:i,text:r,baseRevision:n.revision})),updateNote:(e,t)=>n(`Remarque non modifiée`,n=>O.updateNote(n.id,e,{text:t,baseRevision:n.revision})),deleteNote:e=>n(`Suppression impossible`,t=>O.deleteNote(t.id,e,{baseRevision:t.revision})),submitReview:(e,t,r)=>n(`Retour non enregistré`,n=>O.submitReview(n.id,{decision:e,findingIds:t,noteIds:r,baseRevision:n.revision})),copy:async(e,n)=>{try{await k(e),t().notify(`info`,n)}catch(e){t().notify(`error`,`Copie impossible : ${e.message}`)}},notify:(t,n)=>{clearTimeout(ru),e({notice:{id:++nu,kind:t,text:n}}),ru=setTimeout(()=>e({notice:null}),tu)},dismissNotice:()=>{clearTimeout(ru),e({notice:null})}}}),ou=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),V=o(((e,t)=>{t.exports=ou()}))(),su={"scan-search":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`}),(0,V.jsx)(`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`}),(0,V.jsx)(`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`}),(0,V.jsx)(`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`}),(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,V.jsx)(`path`,{d:`m16 16-1.9-1.9`})]}),"git-branch":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`}),(0,V.jsx)(`circle`,{cx:`18`,cy:`6`,r:`3`}),(0,V.jsx)(`circle`,{cx:`6`,cy:`18`,r:`3`}),(0,V.jsx)(`path`,{d:`M18 9a9 9 0 0 1-9 9`})]}),"chevron-down":(0,V.jsx)(`path`,{d:`m6 9 6 6 6-6`}),"chevron-right":(0,V.jsx)(`path`,{d:`m9 18 6-6-6-6`}),"arrow-left":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`m12 19-7-7 7-7`}),(0,V.jsx)(`path`,{d:`M19 12H5`})]}),"arrow-right":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M5 12h14`}),(0,V.jsx)(`path`,{d:`m12 5 7 7-7 7`})]}),sparkles:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`}),(0,V.jsx)(`path`,{d:`M20 3v4`}),(0,V.jsx)(`path`,{d:`M22 5h-4`}),(0,V.jsx)(`path`,{d:`M4 17v2`}),(0,V.jsx)(`path`,{d:`M5 18H3`})]}),bot:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M12 8V4H8`}),(0,V.jsx)(`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`}),(0,V.jsx)(`path`,{d:`M2 14h2`}),(0,V.jsx)(`path`,{d:`M20 14h2`}),(0,V.jsx)(`path`,{d:`M15 13v2`}),(0,V.jsx)(`path`,{d:`M9 13v2`})]}),circle:(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),"circle-check":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,V.jsx)(`path`,{d:`m9 12 2 2 4-4`})]}),"circle-dot":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1`})]}),"circle-x":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,V.jsx)(`path`,{d:`m15 9-6 6`}),(0,V.jsx)(`path`,{d:`m9 9 6 6`})]}),square:(0,V.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),"square-check":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,V.jsx)(`path`,{d:`m9 12 2 2 4-4`})]}),check:(0,V.jsx)(`path`,{d:`M20 6 9 17l-5-5`}),pencil:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`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`}),(0,V.jsx)(`path`,{d:`m15 5 4 4`})]}),copy:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}),(0,V.jsx)(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})]}),info:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,V.jsx)(`path`,{d:`M12 16v-4`}),(0,V.jsx)(`path`,{d:`M12 8h.01`})]}),save:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`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`}),(0,V.jsx)(`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`}),(0,V.jsx)(`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`})]}),"message-square":(0,V.jsx)(`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`}),trash:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M3 6h18`}),(0,V.jsx)(`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`}),(0,V.jsx)(`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2`})]}),"triangle-alert":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`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`}),(0,V.jsx)(`path`,{d:`M12 9v4`}),(0,V.jsx)(`path`,{d:`M12 17h.01`})]}),network:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`}),(0,V.jsx)(`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`}),(0,V.jsx)(`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`}),(0,V.jsx)(`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`}),(0,V.jsx)(`path`,{d:`M12 12V8`})]}),workflow:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`}),(0,V.jsx)(`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`}),(0,V.jsx)(`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`})]}),"brain-circuit":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`}),(0,V.jsx)(`path`,{d:`M9 13a4.5 4.5 0 0 0 3-4`}),(0,V.jsx)(`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`}),(0,V.jsx)(`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`}),(0,V.jsx)(`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`}),(0,V.jsx)(`path`,{d:`M12 13h4`}),(0,V.jsx)(`path`,{d:`M12 18h6a2 2 0 0 1 2 2v1`}),(0,V.jsx)(`path`,{d:`M12 8h8`}),(0,V.jsx)(`path`,{d:`M16 8V5a2 2 0 0 1 2-2`}),(0,V.jsx)(`circle`,{cx:`16`,cy:`13`,r:`.5`}),(0,V.jsx)(`circle`,{cx:`18`,cy:`3`,r:`.5`}),(0,V.jsx)(`circle`,{cx:`20`,cy:`21`,r:`.5`}),(0,V.jsx)(`circle`,{cx:`20`,cy:`8`,r:`.5`})]}),"file-code":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`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`}),(0,V.jsx)(`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}),(0,V.jsx)(`path`,{d:`M10 12.5 8 15l2 2.5`}),(0,V.jsx)(`path`,{d:`m14 12.5 2 2.5-2 2.5`})]}),"flask-conical":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`}),(0,V.jsx)(`path`,{d:`M6.453 15h11.094`}),(0,V.jsx)(`path`,{d:`M8.5 2h7`})]}),minus:(0,V.jsx)(`path`,{d:`M5 12h14`}),plus:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M5 12h14`}),(0,V.jsx)(`path`,{d:`M12 5v14`})]}),maximize:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`}),(0,V.jsx)(`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`}),(0,V.jsx)(`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`}),(0,V.jsx)(`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`})]}),minimize:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M8 3v3a2 2 0 0 1-2 2H3`}),(0,V.jsx)(`path`,{d:`M21 8h-3a2 2 0 0 1-2-2V3`}),(0,V.jsx)(`path`,{d:`M3 16h3a2 2 0 0 1 2 2v3`}),(0,V.jsx)(`path`,{d:`M16 21v-3a2 2 0 0 1 2-2h3`})]}),focus:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,V.jsx)(`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`}),(0,V.jsx)(`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`}),(0,V.jsx)(`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`}),(0,V.jsx)(`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`})]}),"eye-off":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`}),(0,V.jsx)(`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`}),(0,V.jsx)(`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`}),(0,V.jsx)(`path`,{d:`m2 2 20 20`})]}),"rotate-ccw":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,V.jsx)(`path`,{d:`M3 3v5h5`})]}),"panel-left-close":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,V.jsx)(`path`,{d:`M9 3v18`}),(0,V.jsx)(`path`,{d:`m16 15-3-3 3-3`})]}),"panel-left-open":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,V.jsx)(`path`,{d:`M9 3v18`}),(0,V.jsx)(`path`,{d:`m14 9 3 3-3 3`})]}),folder:(0,V.jsx)(`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}),move:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M12 2v20`}),(0,V.jsx)(`path`,{d:`m15 19-3 3-3-3`}),(0,V.jsx)(`path`,{d:`m19 9 3 3-3 3`}),(0,V.jsx)(`path`,{d:`M2 12h20`}),(0,V.jsx)(`path`,{d:`m5 9-3 3 3 3`}),(0,V.jsx)(`path`,{d:`m9 5 3-3 3 3`})]}),"chevron-up":(0,V.jsx)(`path`,{d:`m18 15-6-6-6 6`}),"fold-vertical":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M12 22v-6`}),(0,V.jsx)(`path`,{d:`M12 8V2`}),(0,V.jsx)(`path`,{d:`M4 12H2`}),(0,V.jsx)(`path`,{d:`M10 12H8`}),(0,V.jsx)(`path`,{d:`M16 12h-2`}),(0,V.jsx)(`path`,{d:`M22 12h-2`}),(0,V.jsx)(`path`,{d:`m15 19-3-3-3 3`}),(0,V.jsx)(`path`,{d:`m15 5-3 3-3-3`})]}),"unfold-vertical":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M12 22v-6`}),(0,V.jsx)(`path`,{d:`M12 8V2`}),(0,V.jsx)(`path`,{d:`M4 12H2`}),(0,V.jsx)(`path`,{d:`M10 12H8`}),(0,V.jsx)(`path`,{d:`M16 12h-2`}),(0,V.jsx)(`path`,{d:`M22 12h-2`}),(0,V.jsx)(`path`,{d:`m15 19-3 3-3-3`}),(0,V.jsx)(`path`,{d:`m15 5-3-3-3 3`})]}),diff:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M12 3v14`}),(0,V.jsx)(`path`,{d:`M5 10h14`}),(0,V.jsx)(`path`,{d:`M5 21h14`})]}),"columns-2":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,V.jsx)(`path`,{d:`M12 3v18`})]}),"git-compare":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`circle`,{cx:`18`,cy:`18`,r:`3`}),(0,V.jsx)(`circle`,{cx:`6`,cy:`6`,r:`3`}),(0,V.jsx)(`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`}),(0,V.jsx)(`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`})]}),"wand-sparkles":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`}),(0,V.jsx)(`path`,{d:`m14 7 3 3`}),(0,V.jsx)(`path`,{d:`M5 6v4`}),(0,V.jsx)(`path`,{d:`M19 14v4`}),(0,V.jsx)(`path`,{d:`M10 2v2`}),(0,V.jsx)(`path`,{d:`M7 8H3`}),(0,V.jsx)(`path`,{d:`M21 16h-4`}),(0,V.jsx)(`path`,{d:`M11 3H9`})]})};function H({name:e,size:t=14,color:n,className:r}){return(0,V.jsx)(`svg`,{className:r,width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,stroke:n??`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:su[e]})}function cu(){let e=B(e=>e.notice),t=B(e=>e.dismissNotice);return e?(0,V.jsxs)(`div`,{className:`notice notice-${e.kind}`,role:e.kind===`error`?`alert`:`status`,children:[(0,V.jsx)(H,{name:e.kind===`error`?`triangle-alert`:`info`}),(0,V.jsx)(`span`,{className:`notice-text`,children:e.text}),(0,V.jsx)(`button`,{type:`button`,className:`notice-close`,onClick:t,"aria-label":`Fermer le message`,children:(0,V.jsx)(H,{name:`circle-x`})})]},e.id):null}var lu={critical:{label:`Critique`,color:`#f0625a`,background:`#34191c`},major:{label:`Majeur`,color:`#e3a33b`,background:`#33270f`},minor:{label:`Mineur`,color:`#6fb3ff`,background:`#13243a`},trivial:{label:`Détail`,color:`#9aa1b1`,background:`#1c2029`}},uu={label:`Remarque`,color:`#c4a8ff`,background:`#241d3a`},du={open:`Ouvert`,ignored:`Ignoré`,outdated:`Obsolète`},fu={issue:`Problème`,requirement_gap:`Exigence manquante`},pu={added:`Ajouté`,modified:`Modifié`,deleted:`Supprimé`,renamed:`Renommé`,untracked:`Non suivi`},mu={added:`A`,modified:`M`,deleted:`D`,renamed:`R`,untracked:`U`},hu={branch:`Branche`,working_tree:`Copie de travail`},gu={approve:`Approuver`,request_changes:`Demander des corrections`,reject:`Rejeter`},_u={not_started:{label:`Non commencée`,color:`#9aa1b1`,background:`#1c2029`},in_progress:{label:`En cours`,color:`#6fb3ff`,background:`#13243a`},files_reviewed:{label:`Fichiers revus`,color:`#8b97ff`,background:`#1b1f3d`},submitted:{label:`Soumise`,color:`#3fb950`,background:`#11201a`}},vu={label:`Traitée`,color:`#5fd4c4`,background:`#10272a`},yu={approve:{label:`Approuvée`,color:`#3fb950`,background:`#11201a`},request_changes:{label:`Corrections demandées`,color:`#e3a33b`,background:`#33270f`},reject:{label:`Rejetée`,color:`#f0625a`,background:`#34191c`}},bu={new:{label:`Nouveau`,fill:`#11201a`,stroke:`#2c6b3a`,text:`#bfeccd`,accent:`#3fb950`},modified:{label:`Modifié`,fill:`#151a2b`,stroke:`#36407a`,text:`#d5daff`,accent:`#8b97ff`},impacted:{label:`Impacté, non modifié`,fill:`#13161f`,stroke:`#2a2f3d`,text:`#7b8396`,accent:`#646b7b`},existing:{label:`Existant`,fill:`#13161f`,stroke:`#2a2f3d`,text:`#9aa1b1`,accent:`#646b7b`},finding:{label:`Constat`,fill:`#221416`,stroke:`#6b2a2d`,text:`#f0a09a`,accent:`#f0625a`},missing:{label:`Attendu, absent`,fill:null,stroke:`#6b2a2d`,text:`#f0776f`,accent:`#b0605b`}};function xu(e){let t=e.lastIndexOf(`/`);return t===-1?{folder:``,name:e}:{folder:e.slice(0,t+1),name:e.slice(t+1)}}function Su(e,t=Date.now()){let n=Math.max(0,Math.round((t-Date.parse(e))/1e3));if(n<60)return`à l'instant`;let r=Math.round(n/60);if(r<60)return`il y a ${r} min`;let i=Math.round(r/60);return i<24?`il y a ${i} h`:`il y a ${Math.round(i/24)} j`}function Cu(e){let t=new Date(e);return`${t.toLocaleDateString(`fr-FR`)} à ${t.toLocaleTimeString(`fr-FR`,{hour:`2-digit`,minute:`2-digit`})}`}function wu(e){return`Traitée par l'agent le ${Cu(e.at)}${e.note===null?``:` — ${e.note}`}`}function Tu(e,t=new Date){let n=new Date(e),r=n.toLocaleTimeString(`fr-FR`,{hour:`2-digit`,minute:`2-digit`});return n.toDateString()===t.toDateString()?r:n.getFullYear()===t.getFullYear()?`${n.toLocaleDateString(`fr-FR`,{day:`2-digit`,month:`2-digit`})} ${r}`:n.toLocaleDateString(`fr-FR`)}function Eu(e,t,n=`${t}s`){return`${e} ${e>1?n:t}`}function Du(e,t){return Eu(t,lu[e].label.toLowerCase())}var Ou={critical:[`critique`,`critiques`],major:[`majeur`,`majeurs`],minor:[`mineur`,`mineurs`],trivial:[`de détail`,`de détail`]};function ku(e,t){let[n,r]=Ou[e];return t>1?`${t} constats ${r} ouverts`:`${t} constat ${n} ouvert`}function Au(e,t=4){let n=e.lastIndexOf(`.`),r=n>0?e.length-n:0,i=Math.max(0,e.length-r-t);return{head:e.slice(0,i),tail:e.slice(i)}}function ju(e){return/^[0-9a-f]{40}$/.test(e)?e.slice(0,7):e}function Mu(e){if(e.mode===`working_tree`)return hu.working_tree;if(e.head===null)throw Error(`L'analyse ${e.id} est en mode branche sans ref de tête.`);return ju(e.head)}function Nu(e){return e.mode===`working_tree`?hu.working_tree:`${Mu(e)} → ${ju(e.base)}`}function Pu(e,t){let n=e.location;return n?`${xu(n.path).name}:${hl(n.startLine,n.endLine,`–`)}`:t?.source?`demande ${t.source}`:`exigence manquante`}function Fu(e){if(!e.location)return`analyse entière`;let t=xu(e.location.path).name;return e.location.line===null?t:`${t}:${e.location.line}`}function Iu(e,t){return e===t?`ligne ${e}`:`lignes ${e}–${t}`}function Lu(e){return e.files.reduce((e,t)=>({additions:e.additions+t.additions,deletions:e.deletions+t.deletions}),{additions:0,deletions:0})}var Ru=[`summary`,`files`,`findings`,`diagrams`];function zu(e){try{return decodeURIComponent(e)}catch{return null}}function Bu(e){let t=e.replace(/^#/,``),n=t.indexOf(`?`),r=n===-1?t:t.slice(0,n),i=n===-1?``:t.slice(n+1),a=r.split(`/`).filter(e=>e!==``);if(a.length===0)return{name:`home`};let o=zu(a[0]);if(o===null)return{name:`not_found`,hash:e};let[s,...c]=a.slice(1);if(s===void 0)return{name:`feature`,id:o,tab:`summary`};if(Ru.includes(s)&&c.length===0)return{name:`feature`,id:o,tab:s};if(s===`finish`&&c.length===0)return{name:`finish`,id:o};if(s===`review`&&c.length<=1){let t=c.length===1?zu(c[0]):null;if(c.length===1&&t===null)return{name:`not_found`,hash:e};let n=new URLSearchParams(i).get(`line`);return{name:`review`,id:o,path:t,line:n!==null&&/^[1-9]\d*$/.test(n)?Number(n):null}}return{name:`not_found`,hash:e}}function Vu(e){return`${window.location.pathname}${window.location.search}${e}`}var Hu={home:()=>Vu(`#/`),feature:(e,t=`summary`)=>Vu(t===`summary`?`#/${encodeURIComponent(e)}`:`#/${encodeURIComponent(e)}/${t}`),review:(e,t,n)=>{let r=`#/${encodeURIComponent(e)}/review`;return Vu(t?`${r}/${encodeURIComponent(t)}${n?`?line=${n}`:``}`:r)},finish:e=>Vu(`#/${encodeURIComponent(e)}/finish`)};function Uu(e,t={}){t.replace?window.location.replace(e):window.location.assign(e)}function Wu(e){return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)}function Gu(){return window.location.hash}function Ku(){return Bu((0,v.useSyncExternalStore)(Wu,Gu))}function qu(e){return e.progress.state!==`submitted`}function Ju(e,t){return t===`all`?e:e.filter(qu)}function Yu(e){let t=new Map;for(let n of e){let e=t.get(n.project);e?e.push(n):t.set(n.project,[n])}return[...t].map(([e,t])=>({project:e,analyses:t,counts:ul.map(e=>({state:e,count:t.filter(t=>t.progress.state===e).length})).filter(({count:e})=>e>0)}))}function Xu(e){return Mc.map(t=>({severity:t,count:e.openFindings[t]})).filter(({count:e})=>e>0)}function Zu(e){let{reviewedFiles:t,totalFiles:n}=e.progress;return n===0?0:t/n*100}function Qu({severity:e,fixed:t=!0}){let n=lu[e];return(0,V.jsx)(`span`,{className:`pill${t?` pill-fixed`:``}`,style:{color:n.color,background:n.background},children:n.label})}function $u({fixed:e=!0}){return(0,V.jsx)(`span`,{className:`pill${e?` pill-fixed`:``}`,style:{color:uu.color,background:uu.background},children:uu.label})}function ed({status:e}){return e===`open`?null:(0,V.jsx)(`span`,{className:`tag tag-${e}`,children:du[e]})}function td({kind:e}){return e===`requirement_gap`?(0,V.jsx)(`span`,{className:`tag tag-gap`,children:fu[e]}):null}function nd({severity:e,count:t,title:n,href:r}){let i=lu[e].color,a=(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`severity-dot-mark`,style:{background:i}}),t]});return r?(0,V.jsx)(`a`,{className:`severity-dot is-link`,href:r,style:{color:i},title:n,"aria-label":n,children:a}):(0,V.jsx)(`span`,{className:`severity-dot`,style:{color:i},title:n,children:a})}function U({style:e,small:t,title:n}){return(0,V.jsx)(`span`,{className:`pill${t?` pill-small`:``}`,style:{color:e.color,background:e.background},title:n,children:e.label})}function W({progress:e,small:t}){return(0,V.jsxs)(`span`,{className:`review-badges`,children:[(0,V.jsx)(U,{style:_u[e.state],small:t}),e.decision&&(0,V.jsx)(U,{style:yu[e.decision],small:t}),e.processed&&(0,V.jsx)(U,{style:vu,small:t,title:wu(e.processed)})]})}function G({currentId:e}){let t=B(e=>e.analyses),n=B(e=>e.unreadable),[r,i]=(0,v.useState)(!1),a=(0,v.useRef)(null);if((0,v.useEffect)(()=>{if(!r)return;let e=e=>{a.current?.contains(e.target)||i(!1)},t=e=>{e.key===`Escape`&&i(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]),!t||t.length===0&&n.length===0)return null;let o=t.find(t=>t.id===e)??null;return(0,V.jsxs)(`div`,{className:`selector`,ref:a,children:[(0,V.jsxs)(`button`,{type:`button`,className:`selector-button`,"aria-haspopup":`listbox`,"aria-expanded":r,title:o?`${o.title} · ${Nu(o)}`:`Choisir une analyse`,onClick:()=>i(!r),children:[(0,V.jsx)(H,{name:`git-branch`,color:`#9aa1b1`}),(0,V.jsx)(`span`,{className:`selector-value`,children:o?o.title:`Choisir une analyse`}),(0,V.jsx)(H,{name:`chevron-down`,size:12,color:`#646b7b`})]}),r&&(0,V.jsxs)(`div`,{className:`selector-menu`,role:`listbox`,children:[Yu(t).map(t=>(0,V.jsxs)(`div`,{className:`selector-group`,role:`group`,"aria-label":`Projet ${t.project}`,children:[(0,V.jsxs)(`div`,{className:`selector-group-title`,children:[(0,V.jsx)(H,{name:`folder`,size:12,color:`#646b7b`}),t.project]}),t.analyses.map(t=>(0,V.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t.id===e,className:`selector-item${t.id===e?` is-current`:``}`,onClick:()=>{i(!1),Uu(Hu.feature(t.id))},children:[(0,V.jsxs)(`span`,{className:`selector-item-head`,children:[(0,V.jsx)(`span`,{className:`selector-item-title`,children:t.title}),(0,V.jsx)(W,{progress:t.progress,small:!0})]}),(0,V.jsxs)(`span`,{className:`selector-item-meta`,children:[(0,V.jsx)(`span`,{className:`mono`,children:Nu(t)}),(0,V.jsxs)(`span`,{children:[`· `,Su(t.updatedAt)]})]})]},t.id))]},t.project)),n.map(e=>(0,V.jsxs)(`div`,{className:`selector-item is-unreadable`,title:e.error,children:[(0,V.jsx)(`span`,{className:`selector-item-title`,children:e.id}),(0,V.jsxs)(`span`,{className:`selector-item-meta`,children:[`Analyse illisible : `,e.error]})]},e.id))]})]})}function K({currentId:e,action:t}){return(0,V.jsxs)(`header`,{className:`topbar`,children:[(0,V.jsxs)(`a`,{className:`brand`,href:Hu.home(),children:[(0,V.jsx)(`span`,{className:`brand-mark`,children:(0,V.jsx)(H,{name:`scan-search`,color:`#8b97ff`})}),`Feature Analyzer`]}),(0,V.jsx)(G,{currentId:e}),(0,V.jsx)(`div`,{className:`topbar-spacer`}),t]})}var q=`[mcp-feature-analyzer]`,rd=3e3;function id(e){let t=B.getState();switch(e.type){case`ANALYSES_UPDATED`:t.loadAnalyses();return;case`ANALYSIS_UPDATED`:t.current?.id===e.data.analysisId&&t.reloadCurrent();return}}function ad(){(0,v.useEffect)(()=>{let e=null,t,n=!1;async function r(){try{let t=await O.getChanges(e);if(n)return;let r=B.getState();if(t.reset)r.loadConfig(),r.loadAnalyses(),r.reloadCurrent();else for(let e of t.events)id(e);e={epoch:t.epoch,seq:t.seq}}catch(e){console.error(`${q} Polling api/changes failed, retrying in ${rd} ms: ${e.message}`)}n||(t=setTimeout(r,rd))}return r(),()=>{n=!0,clearTimeout(t)}},[])}function od(e){return(e.files.find(e=>!e.reviewed)??e.files[0])?.path??null}function sd(e,t){return t.location?Hu.review(e.id,t.location.path,t.location.endLine):Hu.review(e.id,e.files[0]?.path??null)}function cd(e,t){return Mc.flatMap(n=>{let r=e.findings.flatMap(e=>e.status===`open`&&e.severity===n&&e.location?.path===t?[e.location.startLine]:[]);return r.length===0?[]:[{severity:n,count:r.length,firstLine:Math.min(...r)}]})}function ld(e){return pl(e.findings.filter(e=>e.location===null))}function ud({analysis:e}){let t=e.files.filter(e=>e.reviewed).length;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`section-head`,children:[(0,V.jsx)(`h2`,{className:`section-title`,children:`Fichiers modifiés`}),(0,V.jsxs)(`span`,{className:`section-meta`,children:[t,` / `,e.files.length,` revus`]})]}),(0,V.jsxs)(`section`,{className:`card list-card`,children:[e.files.length===0&&(0,V.jsx)(`p`,{className:`list-empty`,children:`Le diff ne contient aucun fichier modifié.`}),e.files.map(t=>{let{folder:n,name:r}=xu(t.path);return(0,V.jsxs)(`a`,{className:`file-row`,href:Hu.review(e.id,t.path),children:[(0,V.jsx)(H,{name:t.reviewed?`circle-check`:`circle`,color:t.reviewed?`#3fb950`:`#3a4050`}),(0,V.jsxs)(`span`,{className:`file-row-path mono`,title:t.oldPath?`${t.oldPath} → ${t.path}`:t.path,children:[(0,V.jsx)(`span`,{className:`path-folder`,children:n}),(0,V.jsx)(`span`,{className:t.reviewed?`path-name is-reviewed`:`path-name`,children:r})]}),(0,V.jsx)(`span`,{className:`tag tag-file-${t.status}`,children:pu[t.status]}),t.binary&&(0,V.jsx)(`span`,{className:`tag`,children:`Binaire`}),(0,V.jsx)(`span`,{className:`spacer`}),cd(e,t.path).map(({severity:e,count:t})=>(0,V.jsx)(nd,{severity:e,count:t,title:`${ku(e,t)} dans ce fichier`},e)),(0,V.jsxs)(`span`,{className:`file-row-counts mono`,children:[(0,V.jsxs)(`span`,{className:`count-add`,children:[`+`,t.additions]}),(0,V.jsxs)(`span`,{className:`count-del`,children:[`−`,t.deletions]})]}),(0,V.jsx)(`span`,{className:`file-row-state${t.reviewed?` is-reviewed`:``}`,children:t.reviewed?`Revu`:`À revoir`})]},t.path)})]})]})}var dd=1e-6,fd=1;function pd(e,t,n){let r=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x);return r>dd?1:r<-1e-6?-1:0}function md(e,t,n){return n.x>=Math.min(e.x,t.x)-dd&&n.x<=Math.max(e.x,t.x)+dd&&n.y>=Math.min(e.y,t.y)-dd&&n.y<=Math.max(e.y,t.y)+dd}function hd(e,t,n,r){return pd(e,t,n)*pd(e,t,r)<0&&pd(n,r,e)*pd(n,r,t)<0}function gd(e,t,n,r){let i=pd(e,t,n),a=pd(e,t,r),o=pd(n,r,e),s=pd(n,r,t);return i*a<0&&o*s<0||i===0&&md(e,t,n)||a===0&&md(e,t,r)||o===0&&md(n,r,e)||s===0&&md(n,r,t)}function _d(e,t,n,r=fd){let i=n.x+r,a=n.x+n.width-r,o=n.y+r,s=n.y+n.height-r;if(i>=a||o>=s)return!1;let c=t.x-e.x,l=t.y-e.y,u=0,d=1;for(let[t,n]of[[-c,e.x-i],[c,a-e.x],[-l,e.y-o],[l,s-e.y]]){if(t===0){if(n<=0)return!1;continue}let e=n/t;if(t<0){if(e>d)return!1;e>u&&(u=e)}else{if(e<u)return!1;e<d&&(d=e)}}return d-u>dd}function vd(e){let t=[];for(let n=1;n<e.length;n++){let[r,i]=[e[n-1],e[n]];(Math.abs(r.x-i.x)>dd||Math.abs(r.y-i.y)>dd)&&t.push([r,i])}return t}function yd(e,t){let n=t.map(e=>vd(e.points)),r=[];for(let e=0;e<t.length;e++)for(let i=e+1;i<t.length;i++){let a=t[e],o=t[i],s=a.u===o.u||a.u===o.v||a.v===o.u||a.v===o.v?hd:gd;n[e].some(([e,t])=>n[i].some(([n,r])=>s(e,t,n,r)))&&r.push([e,i])}let i=[];return t.forEach((t,r)=>{e.forEach((e,a)=>{a!==t.u&&a!==t.v&&n[r].some(([t,n])=>_d(t,n,e))&&i.push({link:r,node:a})})}),{crossings:r,overlaps:i}}function bd(e){return e.crossings.length+e.overlaps.length}function xd(e){let t=e.nodes.map(e=>e.id),n=new Set(t),r=new Map(t.map(e=>[e,[]])),i=new Map(t.map(e=>[e,[]])),a=[];for(let t of e.links)if(n.has(t.from)&&n.has(t.to)){if(t.from===t.to){a.push({kind:`self_loop`,node:t.from});continue}r.get(t.to).push(t.from),i.get(t.from).push(t.to)}let o=t.filter(e=>r.get(e).length===0);o.length===0&&t.length>0&&a.push({kind:`no_root`}),o.length>1&&a.push({kind:`several_roots`,roots:o});for(let e of t){let t=r.get(e);t.length>1&&a.push({kind:`several_parents`,node:e,parents:t})}let s=new Map(t.map(e=>[e,0])),c=[],l=e=>{s.set(e,1),c.push(e);for(let t of i.get(e))s.get(t)===1?a.push({kind:`cycle`,nodes:[...c.slice(c.indexOf(t)),t]}):s.get(t)===0&&l(t);c.pop(),s.set(e,2)};for(let e of[...o,...t])s.get(e)===0&&l(e);if(o.length===1){let e=new Set([o[0]]),n=[o[0]];for(;n.length>0;)for(let t of i.get(n.shift()))e.has(t)||(e.add(t),n.push(t));let r=t.filter(t=>!e.has(t));r.length>0&&a.push({kind:`unreachable`,root:o[0],nodes:r})}return a}var Sd=.6,Cd=.56;function wd(e,t){return[...e].length*t.size*(t.mono?Sd:Cd)}var Td={size:12,weight:400,mono:!0},Ed={size:12.5,weight:400,mono:!1},Dd={size:12.5,weight:500,mono:!1},Od={size:11.5,weight:500,mono:!1},kd={size:11,weight:400,mono:!1},Ad={size:10.5,weight:400,mono:!1},jd={size:10.5,weight:600,mono:!1};function Md(e){return e.shape===`decision`?Od:e.status===`missing`?Dd:e.location?Td:Ed}function Nd(e){return e.location!==null&&e.shape!==`decision`}function Pd(e){return e.status===`missing`&&e.shape!==`decision`&&e.detail!==null&&e.detail!==``}function Fd(e,t){let n=t(e.label,Md(e));if(e.shape===`decision`){let e=Math.max(84,Math.ceil(n+36));return{width:e,height:e}}let r=Pd(e)?t(e.detail,kd):0,i=Math.max(n,r),a=(Nd(e)?22:0)+(e.location?14:0);return e.shape===`pill`?{width:Math.max(80,Math.ceil(i+48+a)),height:r>0?52:40}:{width:Math.max(140,Math.ceil(i+32+a)),height:r>0?52:44}}var Id=40,Ld=36,Rd=18,zd=12,Bd=36,Vd=24,Hd=16,Ud=14,Wd=30,Gd=14,Kd=14,qd=8,Jd=8,Yd=60,Xd=40,Zd=14,Qd=6,$d=48,ef=16,tf=8,nf=2e4,rf=8,af=6,of=12,sf=1e3,cf=.1,lf=4,uf=2;function df(e){return{x:e.x+e.width,y:e.y+e.height/2}}function ff(e){return{x:e.x,y:e.y+e.height/2}}function pf(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function mf(e){let t=0,n=0;for(let{value:r,weight:i}of e)t+=r*i,n+=i;return n>0?t/n:null}function hf(e,t){let n=[];return e.forEach((e,r)=>{for(n.push({value:e,weight:t[r],count:1});n.length>1&&n[n.length-2].value>n[n.length-1].value;){let e=n.pop(),t=n[n.length-1],r=t.weight+e.weight;t.value=(t.value*t.weight+e.value*e.weight)/r,t.weight=r,t.count+=e.count}}),n.flatMap(e=>Array(e.count).fill(e.value))}function gf(e,t,n,r){let i=[],a=0;return e.forEach((e,n)=>{i.push(a),a+=e+(t[n]??0)}),hf(n.map((t,n)=>t-e[n]/2-i[n]),r).map((t,n)=>t+i[n]+e[n]/2)}function J(e,t){let n=[],r=0;return e.forEach((e,i)=>{n.push(r+e/2),r+=e+(t[i]??0)}),n}function _f(e,t){return e.map((e,n)=>({item:e,index:n,key:t(e)})).sort((e,t)=>e.key-t.key||e.index-t.index).map(({item:e})=>e)}function vf(e,t){let n=df(e),r=n.x+Kd,i=e.y-Kd,a=e.x+e.width/2;return{from:t,to:t,points:[n,{x:r,y:n.y},{x:r,y:i},{x:a,y:i},{x:a,y:e.y}],labelPosition:{x:(a+r)/2,y:i-qd},labelAnchor:`middle`,back:!0}}function yf(e){let t=[];for(let n of e){let e=t[t.length-1];if(!(e&&Math.abs(e.x-n.x)<1e-6&&Math.abs(e.y-n.y)<1e-6)){if(t.length>=2){let r=t[t.length-2],i=(e.x-r.x)*(n.y-r.y)-(e.y-r.y)*(n.x-r.x);Math.abs(i)<1e-6&&t.pop()}t.push(n)}}return t}function bf(e){let t=Math.max(0,Math.floor((e.length-1)/2)),n=e[t],r=e[Math.min(t+1,e.length-1)];return{x:(n.x+r.x)/2,y:(n.y+r.y)/2}}function xf(e){if(e.nodes.length===0)throw Error(`Le schéma « ${e.title} » ne contient aucun nœud.`);let t=new Map;return e.nodes.forEach((n,r)=>{if(t.has(n.id))throw Error(`Le nœud « ${n.id} » apparaît deux fois dans le schéma « ${e.title} ».`);t.set(n.id,r)}),{index:t,links:e.links.map(n=>{let r=t.get(n.from),i=t.get(n.to);if(r===void 0||i===void 0){let t=r===void 0?n.from:n.to;throw Error(`Le lien ${n.from} → ${n.to} référence le nœud « ${t} », absent du schéma « ${e.title} ».`)}return{u:r,v:i,label:n.label}})}}function Sf(e,t){let n=bd(yd(e.boxes,e.links.map((e,n)=>({u:t[n].u,v:t[n].v,points:e.points})))),r=0;for(let t of e.links)for(let e=1;e<t.points.length;e++)r+=Math.abs(t.points[e].y-t.points[e-1].y);return{issues:n,stretch:r}}function Cf(e,t){return e.issues<t.issues||e.issues===t.issues&&e.stretch<t.stretch-1e-6}function wf(e,t){let n=e[0],r=t(n);for(let i of e.slice(1)){let e=t(i);Cf(e,r)&&(n=i,r=e)}let i=n.map(e=>[...e]);for(let e=0;e<af&&r.issues>0;e++){let e=!1;for(let n of i)for(let a=0;a+1<n.length&&r.issues>0;a++){[n[a],n[a+1]]=[n[a+1],n[a]];let o=t(i);o.issues<r.issues?(r=o,e=!0):[n[a],n[a+1]]=[n[a+1],n[a]]}if(!e)break}return i}function Tf(e,t,n,r){let i=e.nodes.length,a=Array.from({length:i},()=>[]),o=Array(i).fill(0);n.forEach((e,t)=>{e.u!==e.v&&(a[e.u].push(t),o[e.v]++)});let s=Array(i).fill(0),c=Array(i).fill(-1),l=Array(n.length).fill(!1),u=0,d=[...e.nodes.keys()].filter(e=>o[e]===0).concat([...e.nodes.keys()]);for(let e of d){if(s[e]!==0)continue;s[e]=1,c[e]=u++;let t=[{node:e,next:0}];for(;t.length>0;){let e=t[t.length-1];if(e.next<a[e.node].length){let r=a[e.node][e.next++],i=n[r].v;s[i]===1?l[r]=!0:s[i]===0&&(s[i]=1,c[i]=u++,t.push({node:i,next:0}))}else s[e.node]=2,t.pop()}}let f=Array.from({length:i},()=>[]),p=Array.from({length:i},()=>[]),m=Array(i).fill(!1);n.forEach((e,t)=>{if(e.u===e.v||l[t]){m[e.u]=!0,m[e.v]=!0;return}f[e.u].includes(e.v)||f[e.u].push(e.v),p[e.v].includes(e.u)||p[e.v].push(e.u)});let h=e=>{let t=[];for(let n=e;;n=f[n][0]){if(p[n].length!==1||m[n]||f[n].length>1)return null;if(t.push(n),f[n].length===0)return t}},g=Array.from({length:i},()=>[]),_=Array(i).fill(!1);for(let e=0;e<i;e++){let t=f[e],n=null;for(let e=1;e<t.length&&n===null;e++)n=h(t[e]);if(n===null&&t.length===1&&p[e].length>0&&f[t[0]].length===0&&(n=h(t[0])),n!==null){g[e]=n;for(let e of n)_[e]=!0}}for(let e=0;e<i;e++)_[e]&&(g[e]=[]);let v=[...e.nodes.keys()].filter(e=>!_[e]),y=n.map((e,t)=>({...e,k:t})).filter(e=>e.u!==e.v&&!l[e.k]&&!_[e.v]),b=Array.from({length:i},()=>[]),x=Array.from({length:i},()=>[]);for(let e of y)x[e.u].push(e.v),b[e.v].push(e.u);let S=Array(i).fill(0),C=b.map(e=>e.length),ee=v.filter(e=>C[e]===0);for(;ee.length>0;){ee.sort((e,t)=>c[e]-c[t]);let e=ee.shift();for(let t of x[e])S[t]=Math.max(S[t],S[e]+1),--C[t]===0&&ee.push(t)}for(let e of v)b[e].length===0&&x[e].length>0&&(S[e]=Math.min(...x[e].map(e=>S[e]))-1);let w=Math.max(...v.map(e=>S[e]))+1;g.forEach((e,t)=>e.forEach(e=>S[e]=S[t]));let te=e=>g[e].reduce((e,n)=>e+Bd+t[n].height,t[e].height),T=e.nodes.map((e,n)=>({node:n,rank:S[n],width:t[n].width,height:te(n),above:t[n].height/2})),E=new Map;for(let e of y){let t=[e.u];for(let n=S[e.u]+1;n<S[e.v];n++)T.push({node:null,rank:n,width:0,height:0,above:0}),t.push(T.length-1);t.push(e.v),E.set(e.k,t)}let D=T.map(()=>[]),O=T.map(()=>[]);for(let e of E.values())for(let t=1;t<e.length;t++)O[e[t-1]].push(e[t]),D[e[t]].push(e[t-1]);let k=Array.from({length:w},()=>[]);_f(v,e=>c[e]).forEach(e=>k[S[e]].push(e));for(let e=i;e<T.length;e++)k[T[e].rank].push(e);let ne=Array(T.length).fill(0),re=()=>k.forEach(e=>e.forEach((e,t)=>ne[e]=t));re();let ie=(e,t)=>{k[e]=_f(k[e],e=>{let n=t[e];return n.length>0?n.reduce((e,t)=>e+ne[t],0)/n.length:ne[e]}),k[e].forEach((e,t)=>ne[e]=t)},ae=[k.map(e=>[...e])];for(let e=0;e<rf;e++){if(e%2==0)for(let e=1;e<w;e++)ie(e,D);else for(let e=w-2;e>=0;e--)ie(e,O);ae.push(k.map(e=>[...e]))}let oe=a=>{k=a.map(e=>[...e]),re();let o=new Set,s=new Set;for(let e=1;e<w;e++){let t=-1;for(let n of k[e]){let e=[...new Set(D[n])].sort((e,t)=>ne[e]-ne[t]);if(e.length===0)continue;let r=e[Math.floor((e.length-1)/2)];!s.has(r)&&ne[r]>t&&(s.add(r),o.add(`${r}>${n}`),t=ne[r])}}let c=(e,t)=>o.has(`${e}>${t}`)||o.has(`${t}>${e}`)?sf:1,u=e=>T[e].above,d=e=>T[e].height-T[e].above,f=e=>T[e].height/2-T[e].above,p=e=>e.slice(0,-1).map((t,n)=>T[t].node===null||T[e[n+1]].node===null?Rd:Ld),m=Array(T.length).fill(0);for(let e of k)J(e.map(e=>T[e].height),p(e)).forEach((t,n)=>m[e[n]]=t-f(e[n]));for(let e=0;e<of;e++){let t=e===11?`both`:e%2==0?`down`:`up`,n=t===`up`?[...k.keys()].reverse():[...k.keys()];for(let e of n){let n=k[e],r=[],i=[];for(let e of n){let n=(t===`down`?D[e]:t===`up`?O[e]:[...D[e],...O[e]]).map(t=>({value:m[t],weight:c(e,t)})),a=mf(n);r.push((a??m[e])+f(e)),i.push(a===null?cf:n.reduce((e,t)=>e+t.weight,0))}gf(n.map(e=>T[e].height),p(n),r,i).forEach((e,t)=>m[n[t]]=e-f(n[t]))}}for(let e=1;e<w;e++){let t=k[e],n=p(t);t.forEach((e,r)=>{let i=D[e].find(t=>o.has(`${t}>${e}`));if(!(i===void 0||Math.abs(m[i]-m[e])>lf)){m[e]=m[i];for(let e=r+1;e<t.length;e++){let r=m[t[e-1]]+d(t[e-1])+n[e-1]+u(t[e]);m[t[e]]<r&&(m[t[e]]=r)}for(let e=r-1;e>=0;e--){let r=m[t[e+1]]-u(t[e+1])-n[e]-d(t[e]);m[t[e]]>r&&(m[t[e]]=r)}}})}let h=Array(i).fill(0);for(let e of v){h[e]=m[e]-t[e].height/2;let n=h[e]+t[e].height;for(let r of g[e])h[r]=n+Bd,n=h[r]+t[r].height}let b=(e,t)=>Math.abs(m[e]-m[t])>=uf,x=Array.from({length:w},()=>[]),C=new Map;for(let e of E.values())for(let t=1;t<e.length;t++){let[n,r]=[e[t-1],e[t]];if(!b(n,r))continue;x[T[n].rank].includes(n)||x[T[n].rank].push(n);let i=C.get(n)??[];i.includes(r)||i.push(r),C.set(n,i)}let ee=e=>{let t=[m[e],...C.get(e).map(e=>m[e])];return[Math.min(...t),Math.max(...t)]},te=(e,[t,n])=>e>t+uf&&e<n-uf,ie=(e,t)=>{let n=C.get(t);return C.get(e).filter(e=>!n.includes(e)&&te(m[e],ee(t))).length+ +!!te(m[t],ee(e))};x.forEach((e,t)=>{let n=[];for(let t of _f(e,e=>m[e])){let e=n.length,r=1/0;for(let i=n.length;i>=0;i--){let a=n.reduce((e,n,r)=>e+(r<i?ie(n,t):ie(t,n)),0);a<r&&(r=a,e=i)}n.splice(e,0,t)}x[t]=n});let ae=(e,t)=>(x[e].indexOf(t)+1)/(x[e].length+1),oe=x.map(e=>Math.max(Id,(e.length+1)*zd));for(let e of y){if(!e.label)continue;let t=E.get(e.k),n=t[t.length-2],i=T[n].rank,a=r(e.label,Ad),o=b(n,e.v)?(a+qd+Jd)/(1-ae(i,n)):a+16;oe[i]=Math.max(oe[i],o)}let se=Array.from({length:w+1},()=>[]);for(let e of E.values())for(let t=1;t<e.length;t++){let[n,r]=[e[t-1],e[t]];se[T[n].rank+1].push([Math.min(m[n],m[r]),Math.max(m[n],m[r])])}n.forEach((e,t)=>{e.u===e.v?se[S[e.u]+1].push([h[e.u]-Kd,m[e.u]]):l[t]&&(se[S[e.u]+1].push([m[e.u],1/0]),se[S[e.v]].push([m[e.v],1/0]))});let ce=(e,t,n)=>se[e].some(([e,r])=>e-Hd<n&&r+Hd>t),le=e.nodes.map((e,i)=>{let a=t[i].width/2;if(!_[i])return{rank:S[i],top:h[i],bottom:h[i]+t[i].height,left:a,right:a,hung:!1};let o=n.filter(e=>e.v===i&&e.label).map(e=>qd+r(e.label,Ad)+Jd);return{rank:S[i],top:h[i]-Bd,bottom:h[i]+t[i].height,left:a,right:Math.max(a,...o),hung:!0}}),ue=k.map(e=>Math.max(0,...e.map(e=>T[e].width/2))),de=[...ue];for(let e of le)e.hung&&(ce(e.rank,e.top,e.bottom)&&(ue[e.rank]=Math.max(ue[e.rank],e.left)),ce(e.rank+1,e.top,e.bottom)&&(de[e.rank]=Math.max(de[e.rank],e.right)));let fe=Array.from({length:w},()=>[]);le.forEach(e=>fe[e.rank].push(e));let pe=[];for(let e=0;e<w;e++){let t=e===0?ue[0]:pe[e-1]+de[e-1]+oe[e-1]+ue[e];for(let n of fe[e])for(let r=0;r<e;r++)for(let e of fe[r])(n.hung||e.hung)&&(n.top>=e.bottom+Hd||e.top>=n.bottom+Hd||(t=Math.max(t,pe[r]+e.right+Vd+n.left)));pe.push(t)}let me=e=>pe[e]-ue[e],he=e=>pe[e]+de[e],ge=e.nodes.map((e,n)=>({x:pe[S[n]]-t[n].width/2,y:h[n],width:t[n].width,height:t[n].height})),_e=Math.max(...ge.map(e=>e.y+e.height)),ve=0;return{boxes:ge,links:n.map((t,n)=>{let r=e.nodes[t.u].id,i=e.nodes[t.v].id;if(t.u===t.v)return vf(ge[t.u],r);if(l[n]){let e=df(ge[t.u]),n=ff(ge[t.v]),a=he(S[t.u])+Ud,o=me(S[t.v])-Ud,s=_e+Wd+Gd*ve++;return{from:r,to:i,points:[e,{x:a,y:e.y},{x:a,y:s},{x:o,y:s},{x:o,y:n.y},n],labelPosition:{x:(a+o)/2,y:s-qd},labelAnchor:`middle`,back:!0}}if(_[t.v]){let e=pe[S[t.v]],n=ge[t.u].y+ge[t.u].height,a=ge[t.v].y;return{from:r,to:i,points:[{x:e,y:n},{x:e,y:a}],labelPosition:{x:e+qd,y:(n+a)/2},labelAnchor:`start`,back:!1}}let a=E.get(n),o=[df(ge[t.u])],s=o[0],c=`middle`;for(let e=1;e<a.length;e++){let t=a[e-1],n=a[e],r=o[o.length-1],i=T[n].node!==null,l=i?ff(ge[n]):{x:me(T[n].rank),y:m[n]};if(b(t,n)){let e=T[t].rank,n=he(e)+oe[e]*ae(e,t);o.push({x:n,y:r.y},{x:n,y:l.y}),s={x:n+qd,y:(r.y+l.y)/2},c=`start`}else s={x:(r.x+l.x)/2,y:l.y-qd},c=`middle`;o.push(l),i||o.push({x:he(T[n].rank),y:m[n]})}return{from:r,to:i,points:yf(o),labelPosition:s,labelAnchor:c,back:!1}}),headers:[],center:null}};return oe(wf(ae,e=>Sf(oe(e),n)))}function Ef(e,t,n,r){if(e.layers.length===0)throw Error(`Le schéma en couches « ${e.title} » ne déclare aucune couche.`);let i=e.nodes.map(t=>{if(t.layer===null)throw Error(`Le nœud « ${t.id} » n'a pas de couche alors que le schéma « ${e.title} » est en couches.`);let n=e.layers.indexOf(t.layer);if(n===-1)throw Error(`Le nœud « ${t.id} » est dans la couche « ${t.layer} », absente des couches déclarées (${e.layers.join(`, `)}).`);return n}),a=e.layers.length,o=e.layers.map((e,n)=>Math.max(180,Math.ceil(r(e.toUpperCase(),jd)),...t.filter((e,t)=>i[t]===n).map(e=>e.width))),s=e.nodes.map((e,n)=>e.shape===`box`?o[i[n]]:t[n].width),c=t.map(e=>e.height),l=e.nodes.map(()=>[]);for(let e of n){if(e.u===e.v)continue;let t=i[e.u]===i[e.v]?(c[e.u]+c[e.v])/2+Ld:0;l[e.u].push({other:e.v,delta:-t}),l[e.v].push({other:e.u,delta:t})}let u=e.layers.map((t,n)=>[...e.nodes.keys()].filter(e=>i[e]===n)),d=e=>e.slice(0,-1).map(()=>Ld),f=Array(e.nodes.length).fill(0),p=e=>J(u[e].map(e=>c[e]),d(u[e])).forEach((t,n)=>f[u[e][n]]=t);u.forEach((e,t)=>p(t));let m=e=>{let t=l[e].map(({other:e,delta:t})=>({value:f[e]+t,weight:1}));return{mean:mf(t),weight:t.length}},h=[u.map(e=>[...e])];for(let e=0;e<rf;e++){let t=e%2==0?[...u.keys()]:[...u.keys()].reverse();for(let e of t)u[e]=_f(u[e],e=>m(e).mean??f[e]),p(e);h.push(u.map(e=>[...e]))}let g=t=>{u=t.map(e=>[...e]),u.forEach((e,t)=>p(t));for(let e=0;e<of;e++){let t=e%2==0?[...u.keys()]:[...u.keys()].reverse();for(let e of t){let t=u[e],n=t.map(m);gf(t.map(e=>c[e]),d(t),n.map((e,n)=>e.mean??f[t[n]]),n.map(e=>e.mean===null?cf:e.weight)).forEach((e,n)=>f[t[n]]=e)}}let r=[],l=0;for(let e=0;e<a;e++)r.push(l),l+=o[e]+Yd;let h=e.nodes.map((e,t)=>({x:r[i[t]]+(o[i[t]]-s[t])/2,y:f[t]-c[t]/2,width:s[t],height:c[t]})),g=Math.min(...h.map(e=>e.y)),_=e.layers.map((e,t)=>({label:e,x:r[t],y:g-Xd,width:o[t]})),v=(e,t)=>{let n=u[e].map(e=>h[e]),r=[n[0].y-Ld/2,...n.slice(1).map((e,t)=>(n[t].y+n[t].height+e.y)/2)];return r.push(n[n.length-1].y+n[n.length-1].height+Ld/2),_f(r,e=>Math.abs(e-t))[0]};return{boxes:h,links:n.map(t=>{let n=e.nodes[t.u].id,a=e.nodes[t.v].id;if(t.u===t.v)return vf(h[t.u],n);let s=h[t.u],c=h[t.v],l;if(i[t.u]===i[t.v]){let e=i[t.u],[n,a]=s.y<=c.y?[t.u,t.v]:[t.v,t.u],d=u[e].indexOf(a)-u[e].indexOf(n)>1,f=h[n],p=h[a];if(d){let t=r[e]+o[e]+Ud;l=[df(f),{x:t,y:f.y+f.height/2},{x:t,y:p.y+p.height/2},df(p)]}else l=[{x:f.x+f.width/2,y:f.y+f.height},{x:p.x+p.width/2,y:p.y}];n!==t.u&&l.reverse()}else{let[e,n]=i[t.u]<i[t.v]?[t.u,t.v]:[t.v,t.u],a=ff(h[n]);l=[df(h[e])];for(let t=i[e]+1;t<i[n];t++){let e=l[l.length-1],n=r[t],i=r[t]+o[t],s=t=>e.y+(a.y-e.y)*(t-e.x)/(a.x-e.x),c=Math.min(s(n),s(i)),d=Math.max(s(n),s(i));if(u[t].some(e=>h[e].y-Qd<d&&h[e].y+h[e].height+Qd>c)){let e=v(t,s((n+i)/2));l.push({x:n,y:e},{x:i,y:e})}}l.push(a),e!==t.u&&l.reverse()}let d=bf(l);return{from:n,to:a,points:l,labelPosition:{x:d.x,y:d.y-qd},labelAnchor:`middle`,back:!1}}),headers:_,center:null}};return g(wf(h,e=>Sf(g(e),n)))}function Df(e,t,n){let r=pf(e),i=n.x-r.x,a=n.y-r.y;if(i===0&&a===0)return r;let o=e.width/2,s=e.height/2,c;if(t===`decision`)c=1/(Math.abs(i)/o+Math.abs(a)/s);else if(c=Math.min(i===0?1/0:o/Math.abs(i),a===0?1/0:s/Math.abs(a)),t===`pill`){let e=s,t=o-e;if(Math.abs(c*i)>t){let n=Math.hypot(i,a),r=i/n,o=Math.sign(i)*t,s=o*r;c=(s+Math.sqrt(Math.max(0,s*s-o*o+e*e)))/n}}return{x:r.x+i*c,y:r.y+a*c}}function Of(e,t,n){return e.x<t.x+t.width+n&&t.x<e.x+e.width+n&&e.y<t.y+t.height+n&&t.y<e.y+e.height+n}function kf(e){let t=e=>e.map(e=>`« ${e} »`).join(`, `);switch(e.kind){case`self_loop`:return`le nœud « ${e.node} » est relié à lui-même`;case`no_root`:return`aucun nœud n'est sans lien entrant, il n'y a pas de racine`;case`several_roots`:return`plusieurs nœuds sans lien entrant (${t(e.roots)}) au lieu d'une seule racine`;case`several_parents`:return`le nœud « ${e.node} » a plusieurs parents (${t(e.parents)})`;case`cycle`:return`cycle ${e.nodes.join(` → `)}`;case`unreachable`:return`${t(e.nodes)} inaccessible(s) depuis la racine « ${e.root} »`}}function Af(e,t,n){let r=xd(e);if(r.length>0)throw Error(`La carte mentale « ${e.title} » n'est pas un arbre : ${r.map(kf).join(` ; `)}.`);let i=e.nodes.length,a=Array(i).fill(!1),o=Array.from({length:i},()=>[]);for(let e of n)a[e.v]=!0,o[e.u].push(e.v);let s=a.indexOf(!1),c=o,l=Array(i).fill(0),u=[],d=[s];for(;d.length>0;){let e=d.shift();u.push(e);for(let t of c[e])l[t]=l[e]+1,d.push(t)}let f=Array(i).fill(1);for(let e of[...u].reverse())for(let t of c[e])f[e]+=f[t];let p=Array(i).fill(0),m=(e,t,n)=>{let r=c[e].reduce((e,t)=>e+f[t],0),i=t;for(let a of c[e]){let e=(n-t)*f[a]/r;p[a]=i+e/2,m(a,i,i+e),i+=e}};if(c[s].length>0){let e=2*Math.PI*f[c[s][0]]/(f[s]-1);m(s,-e/2,2*Math.PI-e/2)}let h=(e,n)=>Math.min(Math.abs(Math.cos(n))<1e-9?1/0:t[e].width/2/Math.abs(Math.cos(n)),Math.abs(Math.sin(n))<1e-9?1/0:t[e].height/2/Math.abs(Math.sin(n))),g=Array(i).fill(0);for(let e of u)for(let t of c[e])g[t]=g[e]+h(e,p[t])+h(t,p[t])+$d;let _=Array(i).fill(0);u.forEach((e,t)=>_[e]=t);let v=e=>{g[e]+=tf;for(let t of c[e])v(t)},y=()=>e.nodes.map((e,n)=>{let r=g[n]*Math.cos(p[n]),i=g[n]*Math.sin(p[n]);return{x:r-t[n].width/2,y:i-t[n].height/2,width:t[n].width,height:t[n].height}}),b=y();for(let t=0;;t++){let n=null;for(let e=0;e<i&&n===null;e++)for(let t=e+1;t<i;t++)if(Of(b[e],b[t],ef)){n=l[e]>l[t]||l[e]===l[t]&&_[e]>_[t]?e:t;break}if(n===null)break;if(t>=nf)throw Error(`La carte mentale « ${e.title} » n'a pas pu être placée sans chevauchement.`);v(n),b=y()}let x=n.map(t=>{let n=e.nodes[t.u].id,r=e.nodes[t.v].id;if(t.u===t.v)return vf(b[t.u],n);let i=Df(b[t.u],e.nodes[t.u].shape,pf(b[t.v])),a=Df(b[t.v],e.nodes[t.v].shape,pf(b[t.u]));return{from:n,to:r,points:[i,a],labelPosition:{x:(i.x+a.x)/2,y:(i.y+a.y)/2-qd},labelAnchor:`middle`,back:!1}});return{boxes:b,links:x,headers:[],center:pf(b[s])}}function jf(e,t){let n=new Map;t.forEach((t,r)=>{if(!e.links[r].label)return;let i=`${t.from}\u0000${t.to}`,a=n.get(i)??0;n.set(i,a+1),t.labelPosition={x:t.labelPosition.x,y:t.labelPosition.y-a*(Ad.size+4)}})}function Mf(e,t,n){jf(e,t.links);let r=[],i=[];for(let e of t.boxes)r.push(e.x,e.x+e.width),i.push(e.y,e.y+e.height);t.links.forEach((t,a)=>{for(let e of t.points)r.push(e.x),i.push(e.y);let o=e.links[a].label;if(o){let e=n(o,Ad),a=Ad.size*.7,s=t.labelAnchor===`start`?t.labelPosition.x:t.labelPosition.x-e/2;r.push(s,s+e),i.push(t.labelPosition.y-a,t.labelPosition.y+a)}});for(let e of t.headers)r.push(e.x,e.x+e.width),i.push(e.y,e.y+Zd);let a=Math.min(...r),o=Math.max(...r),s=Math.min(...i),c=Math.max(...i);if(t.center){let e=Math.max(t.center.x-a,o-t.center.x),n=Math.max(t.center.y-s,c-t.center.y);a=t.center.x-e,o=t.center.x+e,s=t.center.y-n,c=t.center.y+n}let l=24-a,u=24-s,d=e=>({x:e.x+l,y:e.y+u});return{nodes:t.boxes.map((t,n)=>({id:e.nodes[n].id,x:t.x+l,y:t.y+u,width:t.width,height:t.height})),links:t.links.map(e=>({...e,points:e.points.map(d),labelPosition:d(e.labelPosition)})),headers:t.headers.map(e=>({...e,x:e.x+l,y:e.y+u})),width:Math.ceil(o-a+48),height:Math.ceil(c-s+48)}}function Nf(e,t=wd){let{links:n}=xf(e),r=e.nodes.map(e=>Fd(e,t));switch(e.kind){case`flow`:return Mf(e,Tf(e,r,n,t),t);case`layers`:return Mf(e,Ef(e,r,n,t),t);case`mindmap`:return Mf(e,Af(e,r,n),t)}}function Pf(e,t=Nf(e)){let n=new Map(e.nodes.map((e,t)=>[e.id,t])),r=e.links.map((e,t)=>({index:t,from:e.from,to:e.to})),i=yd(t.nodes,t.links.map(e=>({u:n.get(e.from),v:n.get(e.to),points:e.points})));return{crossings:i.crossings.map(([e,t])=>({a:r[e],b:r[t]})),nodeOverlaps:i.overlaps.map(({link:t,node:n})=>({link:r[t],node:e.nodes[n].id}))}}var Ff={layers:`network`,flow:`workflow`,mindmap:`brain-circuit`};function If(e){return e.location?/\.(spec|test)\./.test(e.location.path)?`flask-conical`:`file-code`:null}function Lf(e){let t=new Map;for(let n of e.findings){if(n.status!==`open`||!n.location)continue;let e=t.get(n.location.path);(!e||fl(n.severity,e)<0)&&t.set(n.location.path,n.severity)}return t}function Rf(e,t){let n=new Set(e.flatMap(e=>e.location&&t.has(e.location.path)?[t.get(e.location.path)]:[]));return Mc.filter(e=>n.has(e))}function zf(e){return zc.filter(t=>e.some(e=>e.status===t))}var Bf=6;function Vf(e){if(e.length===0)return``;let t=[`M ${e[0].x} ${e[0].y}`];for(let n=1;n<e.length-1;n++){let r=e[n-1],i=e[n],a=e[n+1],o=Math.hypot(i.x-r.x,i.y-r.y),s=Math.hypot(a.x-i.x,a.y-i.y),c=Math.min(Bf,o/2,s/2);if(c<=0){t.push(`L ${i.x} ${i.y}`);continue}let l={x:i.x-(i.x-r.x)/o*c,y:i.y-(i.y-r.y)/o*c},u={x:i.x+(a.x-i.x)/s*c,y:i.y+(a.y-i.y)/s*c};t.push(`L ${l.x} ${l.y}`,`Q ${i.x} ${i.y} ${u.x} ${u.y}`)}let n=e[e.length-1];return t.push(`L ${n.x} ${n.y}`),t.join(` `)}function Hf(e,t){return`${e/2},0 ${e},${t/2} ${e/2},${t} 0,${t/2}`}var Uf=.2,Wf=.85,Y=1.25,Gf=320,Kf=620;function qf(e){return Math.min(3,Math.max(Uf,e))}var Jf=1.5;function Yf(e,t,n,r=1){return Math.max(Wf,Math.min(r,t/e.width,n/e.height))}function Xf(e,t){let n=Yf(e,t,1/0);return Math.round(Math.min(Kf,Math.max(Gf,e.height*n)))}function Zf(e,t,n,r=1){let i=Yf(e,t,n,r),a=t/i,o=n/i;return{x:e.width<=a?(e.width-a)/2:0,y:e.height<=o?(e.height-o)/2:0,scale:i}}function Qf(e,t,n,r){return e.width>n/t.scale+.5||e.height>r/t.scale+.5}function $f(e,t,n,r){let i=(e,t,n)=>{let r=Math.min(0,t-n),i=Math.max(0,t-n);return Math.min(i,Math.max(r,e))};return{x:i(e.x,t.width,n/e.scale),y:i(e.y,t.height,r/e.scale),scale:e.scale}}function ep(e,t,n){let r=qf(e.scale*t),i=e.x+n.x/e.scale,a=e.y+n.y/e.scale;return{x:i-n.x/r,y:a-n.y/r,scale:r}}function tp(e,t,n){return{x:e.x-t/e.scale,y:e.y-n/e.scale,scale:e.scale}}function np(e,t,n){return`${e.x} ${e.y} ${t/e.scale} ${n/e.scale}`}function rp(e){let t;try{t=Nf(e)}catch{return null}let n=Pf(e,t);return n.crossings.length+n.nodeOverlaps.length}var X=`#3a4052`,ip=3,ap=1.1;function op(e){try{return{layout:Nf(e),error:null}}catch(e){return{layout:null,error:e.message}}}function sp({analysis:e}){let[t,n]=(0,v.useState)(null),r=e.diagrams.find(e=>e.id===t)??e.diagrams[0],i=(0,v.useMemo)(()=>new Map(e.diagrams.map(e=>[e.id,rp(e)])),[e.diagrams]);return r?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`diagram-picker`,children:[e.diagrams.map(e=>{let t=e.id===r.id,a=i.get(e.id)??null;return(0,V.jsxs)(`button`,{type:`button`,className:`diagram-pick${t?` is-active`:``}`,"aria-pressed":t,onClick:()=>n(e.id),title:e.title,children:[(0,V.jsx)(H,{name:Ff[e.kind],color:t?`#8b97ff`:`#646b7b`}),(0,V.jsx)(`span`,{className:`diagram-pick-title`,children:e.title}),a!==null&&a>0&&(0,V.jsx)(`span`,{className:`diagram-pick-issues`,title:`${a} croisement(s) de liens ou traversée(s) de nœud : l'agent doit revoir ce schéma`,children:`croisements`})]},e.id)}),(0,V.jsxs)(`span`,{className:`diagram-meta`,children:[`Dessiné par l'agent · `,Su(r.updatedAt)]})]}),(0,V.jsx)(cp,{analysis:e,diagram:r},r.id)]}):(0,V.jsxs)(`div`,{className:`card diagram-empty`,children:[(0,V.jsx)(`h2`,{className:`empty-title`,children:`Aucun schéma pour cette analyse`}),(0,V.jsxs)(`p`,{children:[`L'agent dessine les schémas avec l'outil `,(0,V.jsx)(`code`,{children:`set_diagram`}),` : périmètre d'impact en couches, flux de process ou carte mentale. Ils apparaîtront ici automatiquement.`]})]})}function cp({analysis:e,diagram:t}){let n=(0,v.useMemo)(()=>op(t),[t]);return n.error===null?(0,V.jsx)(lp,{analysis:e,diagram:t,layout:n.layout}):(0,V.jsxs)(`div`,{className:`card diagram-error`,role:`alert`,children:[(0,V.jsx)(H,{name:`triangle-alert`,color:`#f0625a`,size:16}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`diagram-error-title`,children:`Ce schéma ne peut pas être affiché.`}),(0,V.jsx)(`p`,{className:`diagram-error-text`,children:n.error}),(0,V.jsx)(`p`,{className:`diagram-error-text`,children:`L'agent doit le corriger avec l'outil set_diagram.`})]})]})}function lp({analysis:e,diagram:t,layout:n}){let r=(0,v.useRef)(null),i=(0,v.useRef)(null),[a,o]=(0,v.useState)({width:0,height:0}),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(null),d=a.width,f=d===0?0:s?a.height:Xf(n,d),[p,m]=(0,v.useState)(null),h=(0,v.useRef)(null),g=(0,v.useRef)(!1),_=(0,v.useMemo)(()=>Lf(e),[e]),y=(0,v.useMemo)(()=>new Map(n.nodes.map(e=>[e.id,e])),[n]),b=zf(t.nodes),x=Rf(t.nodes,_),S=`arrow-${t.id}`,C=t.kind===`flow`;(0,v.useEffect)(()=>{let e=i.current;if(!e)return;let t=()=>o({width:e.clientWidth,height:e.clientHeight}),n=new ResizeObserver(t);return n.observe(e),t(),()=>n.disconnect()},[]),(0,v.useEffect)(()=>{let e=()=>{c(document.fullscreenElement!==null&&document.fullscreenElement===r.current),m(null)};return document.addEventListener(`fullscreenchange`,e),()=>document.removeEventListener(`fullscreenchange`,e)},[]);let ee=async()=>{u(null);try{if(s){await document.exitFullscreen();return}let e=r.current;if(!e)return;if(!document.fullscreenEnabled)throw Error(`le navigateur n'autorise pas le plein écran sur cette page`);await e.requestFullscreen()}catch(e){u(`Plein écran impossible : ${e.message}`)}},w=`${n.width}x${n.height}@${d}x${f}${s?`:plein-ecran`:``}`,te=d>0?Zf(n,d,f,s?Jf:1):null,T=p&&p.key===w?p.viewport:te,E=e=>{T&&m({key:w,viewport:$f(e(T),n,d,f)})},D=T!==null&&Qf(n,T,d,f),O=(0,v.useEffectEvent)(e=>{let t=i.current;if(!t)return;e.preventDefault();let n=t.getBoundingClientRect(),r=e.deltaY<0?ap:1/ap;E(t=>ep(t,r,{x:e.clientX-n.left,y:e.clientY-n.top}))});(0,v.useEffect)(()=>{let e=i.current;if(!e)return;let t=e=>O(e);return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[]);let k=e=>E(t=>ep(t,e,{x:d/2,y:f/2})),ne=e=>{e.button===0&&T&&(h.current={x:e.clientX,y:e.clientY,origin:T,moved:!1,pointerId:e.pointerId},g.current=!1)},re=e=>{let t=h.current;if(!t||t.pointerId!==e.pointerId)return;let r=e.clientX-t.x,i=e.clientY-t.y;if(!t.moved){if(Math.hypot(r,i)<ip)return;t.moved=!0,e.currentTarget.setPointerCapture(e.pointerId)}m({key:w,viewport:$f(tp(t.origin,r,i),n,d,f)})},ie=e=>{let t=h.current;t&&t.pointerId===e.pointerId&&(g.current=t.moved,h.current=null)},ae=t=>{!g.current&&t.location&&Uu(Hu.review(e.id,t.location.path,t.location.line))};return(0,V.jsxs)(`section`,{ref:r,className:`card diagram-card${s?` is-fullscreen`:``}`,children:[(0,V.jsx)(`div`,{ref:i,className:`diagram-area`,style:s?void 0:{height:f||void 0},children:T&&(0,V.jsxs)(`svg`,{className:`diagram-svg`,width:d,height:f,viewBox:np(T,d,f),onPointerDown:ne,onPointerMove:re,onPointerUp:ie,onPointerCancel:ie,role:`img`,"aria-label":t.title,children:[C&&(0,V.jsx)(`defs`,{children:(0,V.jsx)(`marker`,{id:S,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto-start-reverse`,children:(0,V.jsx)(`path`,{d:`M 1 1 L 9 5 L 1 9`,fill:`none`,stroke:X,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),n.headers.map(e=>(0,V.jsx)(`text`,{className:`diagram-header`,x:e.x,y:e.y+7,dominantBaseline:`central`,children:e.label.toUpperCase()},e.label)),n.links.map((e,t)=>(0,V.jsx)(`path`,{className:`diagram-link`,d:Vf(e.points),stroke:X,markerEnd:C?`url(#${S})`:void 0},`link-${t}`)),n.links.map((e,n)=>{let r=t.links[n].label;return r?(0,V.jsx)(`text`,{className:`diagram-link-label`,x:e.labelPosition.x,y:e.labelPosition.y,textAnchor:e.labelAnchor,dominantBaseline:`central`,children:r},`label-${n}`):null}),t.nodes.map(e=>(0,V.jsx)(up,{node:e,box:y.get(e.id),severity:e.location?_.get(e.location.path)??null:null,onOpen:ae},e.id))]})}),(0,V.jsxs)(`div`,{className:`diagram-footer`,children:[(0,V.jsxs)(`div`,{className:`diagram-legend`,children:[b.map(e=>{let t=bu[e];return(0,V.jsxs)(`span`,{className:`legend-item`,children:[(0,V.jsx)(`span`,{className:`legend-swatch`,style:{background:t.fill??`transparent`,borderColor:t.stroke}}),t.label]},e)}),x.length>0&&(0,V.jsxs)(`span`,{className:`legend-item`,children:[(0,V.jsx)(`span`,{className:`legend-dots`,children:x.map(e=>(0,V.jsx)(`span`,{className:`legend-dot`,style:{background:lu[e].color},title:lu[e].label},e))}),x.length===1?`Constat ouvert (${lu[x[0]].label.toLowerCase()})`:`Constat ouvert (couleur de la gravité la plus haute)`]})]}),(0,V.jsx)(`span`,{className:`spacer`}),D&&(0,V.jsxs)(`span`,{className:`diagram-hint`,children:[(0,V.jsx)(H,{name:`move`,color:`#646b7b`,size:12}),`Glisser pour parcourir le schéma`]}),(0,V.jsxs)(`div`,{className:`icon-button-group diagram-zoom`,children:[(0,V.jsx)(`button`,{type:`button`,className:`icon-button`,title:`Zoom arrière`,"aria-label":`Zoom arrière`,onClick:()=>k(1/Y),children:(0,V.jsx)(H,{name:`minus`,color:`#9aa1b1`})}),(0,V.jsx)(`button`,{type:`button`,className:`icon-button`,title:`Zoom avant`,"aria-label":`Zoom avant`,onClick:()=>k(Y),children:(0,V.jsx)(H,{name:`plus`,color:`#9aa1b1`})}),(0,V.jsxs)(`button`,{type:`button`,className:`button button-secondary diagram-control`,title:`Recentrer et adapter le zoom`,onClick:()=>m(null),children:[(0,V.jsx)(H,{name:`focus`,color:`#9aa1b1`}),`Ajuster`]}),(0,V.jsxs)(`button`,{type:`button`,className:`button button-secondary diagram-control`,"aria-pressed":s,onClick:()=>void ee(),children:[(0,V.jsx)(H,{name:s?`minimize`:`maximize`,color:`#9aa1b1`}),s?`Quitter le plein écran`:`Plein écran`]})]})]}),l&&(0,V.jsx)(`p`,{className:`diagram-fullscreen-error`,role:`alert`,children:l})]})}function up({node:e,box:t,severity:n,onOpen:r}){let i=bu[e.status],{width:a,height:o}=t,s=e.location!==null,c=e.status===`missing`,l=Nd(e)?If(e):null,u=Pd(e),d=Md(e),f=e.shape===`pill`?20:16,p=l?f+22:a/2,m=u?o/2-8:o/2,h={className:`diagram-shape`,fill:i.fill??`transparent`,stroke:i.stroke,strokeWidth:c?1.5:1},g=[e.detail,e.location?`${e.location.path}${e.location.line?`:${e.location.line}`:``}`:null].filter(Boolean).join(`
67
- `);return(0,V.jsxs)(`g`,{className:`diagram-node${s?` is-clickable`:``}`,transform:`translate(${t.x} ${t.y})`,onClick:s?()=>r(e):void 0,onKeyDown:s?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),r(e))}:void 0,tabIndex:s?0:void 0,role:s?`link`:void 0,children:[g&&(0,V.jsx)(`title`,{children:g}),e.shape===`decision`?(0,V.jsx)(`polygon`,{points:Hf(a,o),strokeLinejoin:`round`,...h}):(0,V.jsx)(`rect`,{width:a,height:o,rx:e.shape===`pill`?o/2:10,...h}),l&&(0,V.jsx)(`g`,{transform:`translate(${f} ${o/2-7})`,children:(0,V.jsx)(H,{name:l,size:14,color:i.accent})}),(0,V.jsx)(`text`,{x:p,y:m,textAnchor:l?`start`:`middle`,dominantBaseline:`central`,fill:i.text,fontSize:d.size,fontWeight:d.weight,className:d.mono?`diagram-label mono`:`diagram-label`,children:e.label}),u&&(0,V.jsx)(`text`,{x:a/2,y:o/2+10,textAnchor:`middle`,dominantBaseline:`central`,fill:i.accent,fontSize:kd.size,className:`diagram-label`,children:e.detail}),n&&(0,V.jsx)(`circle`,{cx:e.shape===`decision`?a-22:a-18,cy:o/2,r:3,fill:lu[n].color,children:(0,V.jsx)(`title`,{children:`Constat ${lu[n].label.toLowerCase()} ouvert sur ce fichier`})})]})}function dp({analysis:e,finding:t}){return(0,V.jsxs)(`a`,{className:`finding-row is-${t.status}`,href:sd(e,t),children:[(0,V.jsx)(Qu,{severity:t.severity}),(0,V.jsxs)(`span`,{className:`finding-row-text`,children:[(0,V.jsxs)(`span`,{className:`finding-row-title`,children:[t.title,(0,V.jsx)(td,{kind:t.kind}),(0,V.jsx)(ed,{status:t.status})]}),(0,V.jsx)(`span`,{className:`finding-row-location mono`,children:Pu(t,e.request)})]}),(0,V.jsx)(H,{name:`chevron-right`,color:`#646b7b`})]})}function fp(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function pp({analysis:e}){let[t,n]=(0,v.useState)(new Set(Mc)),[r,i]=(0,v.useState)(new Set(Pc)),a=pl(e.findings).filter(e=>t.has(e.severity)&&r.has(e.status));return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`filters`,children:[(0,V.jsxs)(`div`,{className:`filter-group`,role:`group`,"aria-label":`Filtrer par gravité`,children:[(0,V.jsx)(`span`,{className:`filter-label`,children:`Gravité`}),Mc.map(r=>{let i=e.findings.filter(e=>e.severity===r).length,a=t.has(r);return(0,V.jsxs)(`button`,{type:`button`,"aria-pressed":a,className:`chip${a?` is-active`:``}`,style:a?{color:lu[r].color,background:lu[r].background}:void 0,title:`${Eu(i,`constat`)} de gravité « ${lu[r].label} », tous statuts confondus`,onClick:()=>n(fp(t,r)),children:[lu[r].label,` `,(0,V.jsx)(`span`,{className:`chip-count`,children:i})]},r)})]}),(0,V.jsxs)(`div`,{className:`filter-group`,role:`group`,"aria-label":`Filtrer par statut`,children:[(0,V.jsx)(`span`,{className:`filter-label`,children:`Statut`}),Pc.map(t=>{let n=e.findings.filter(e=>e.status===t).length,a=r.has(t);return(0,V.jsxs)(`button`,{type:`button`,"aria-pressed":a,className:`chip${a?` is-active is-neutral`:``}`,title:`${Eu(n,`constat`)} au statut « ${du[t]} »`,onClick:()=>i(fp(r,t)),children:[du[t],` `,(0,V.jsx)(`span`,{className:`chip-count`,children:n})]},t)})]})]}),(0,V.jsx)(`section`,{className:`card list-card`,children:a.length===0?(0,V.jsx)(`p`,{className:`list-empty`,children:e.findings.length===0?`L'agent n'a relevé aucun constat.`:`Aucun constat ne correspond aux filtres.`}):a.map(t=>(0,V.jsx)(dp,{analysis:e,finding:t},t.id))})]})}var mp={critical:`Critical`,major:`Major`,minor:`Minor`,trivial:`Trivial`},hp={approve:`Decision: Approve. The feature can be merged.`,request_changes:`Decision: Request changes. Rework the feature and address the points below.`,reject:`Decision: Reject. The feature is abandoned.`},gp=` `;function _p(e){return e.split(`
68
- `).map(e=>e===``?``:`${gp}${e}`)}function vp(e,t){return[`${gp}${e}`,`${gp}\`\`\``,..._p(t),`${gp}\`\`\``]}function yp(e){return e.mode===`branch`?`branch ${e.base}...${e.head}`:`working tree changes against HEAD`}function bp(e){let t=e.location;return t?`${t.path}:${hl(t.startLine,t.endLine)}`:null}function xp(e,t){let n=bp(t),r=t.kind===`requirement_gap`?`Missing requirement: ${t.title}`:t.title,i=`${e}. [${mp[t.severity]}] ${n?`${n} — `:``}${r}`;if(t.prompt!==null)return[i,..._p(t.prompt)];let a=[i];return t.body.trim()!==``&&a.push(..._p(t.body)),t.anchorText!==null&&a.push(...vp(`Current lines:`,t.anchorText)),t.suggestion!==null&&a.push(...vp(`Proposed replacement:`,t.suggestion)),a}function Sp(e,t){let n=t.location?`${gl(t.location)} — `:``,[r,...i]=t.text.split(`
69
- `);return[`${e}. [Reviewer note] ${n}${r}`,...i.map(e=>e===``?``:`${gp}${e}`)]}function Cp(e,t,n){let r=new Set(e.map(e=>e.id)),i=t.filter(e=>!r.has(e));if(i.length>0)throw Error(`Unknown ${n} id(s): ${i.join(`, `)}.`);let a=new Set(t);return e.filter(e=>a.has(e.id))}function wp(e,t){let n=pl(Cp(e.findings,t.findingIds,`finding`)),r=Cp(e.notes,t.noteIds,`note`),i=[`Review feedback on "${e.title}" (${yp(e)}).`];if(e.overview!==null&&i.push(`Feature objective: ${e.overview.objective}`),t.decision!==null&&i.push(hp[t.decision]),i.push(``),n.length===0&&r.length===0)return i.push(`No points to address.`),i.join(`
70
- `);i.push(`Address the following points:`);let a=1;for(let e of n)i.push(``,...xp(a++,e));for(let e of r)i.push(``,...Sp(a++,e));return i.join(`
71
- `)}function Tp(e){return wp(e,{findingIds:e.findings.filter(e=>e.status===`open`).map(e=>e.id),noteIds:[],decision:null})}var Ep=5;function Dp({analysis:e}){let t=B(e=>e.copy),n=pl(e.findings.filter(e=>e.status===`open`)),r=Mc.map(e=>({severity:e,count:n.filter(t=>t.severity===e).length}));return(0,V.jsxs)(V.Fragment,{children:[e.overview&&(0,V.jsxs)(`section`,{className:`card overview-card`,children:[(0,V.jsxs)(`h2`,{className:`card-title`,children:[(0,V.jsx)(H,{name:`focus`,color:`#8b97ff`}),`Vue d'ensemble`]}),(0,V.jsx)(`h3`,{className:`overview-label`,children:`Objectif`}),(0,V.jsx)(`p`,{className:`overview-text`,children:e.overview.objective}),(0,V.jsx)(`h3`,{className:`overview-label`,children:`Approche`}),(0,V.jsx)(`p`,{className:`overview-text`,children:e.overview.approach}),e.overview.attentionPoints.length>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h3`,{className:`overview-label`,children:`Points d'attention`}),(0,V.jsx)(`ul`,{className:`summary-list overview-points`,children:e.overview.attentionPoints.map((e,t)=>(0,V.jsx)(`li`,{children:e},t))})]})]}),(0,V.jsxs)(`section`,{className:`card summary-card`,children:[(0,V.jsxs)(`h2`,{className:`card-title`,children:[(0,V.jsx)(H,{name:`sparkles`,color:`#b18cff`}),`Ce que l'agent a fait`]}),e.summary.length>0?(0,V.jsx)(`ul`,{className:`summary-list`,children:e.summary.map((e,t)=>(0,V.jsx)(`li`,{children:e},t))}):(0,V.jsx)(`p`,{className:`empty-text`,children:`L'agent n'a pas encore rédigé de résumé (outil update_analysis).`})]}),e.request&&(0,V.jsxs)(`section`,{className:`card request-card`,children:[(0,V.jsxs)(`h2`,{className:`card-title`,children:[(0,V.jsx)(H,{name:`message-square`,color:`#9aa1b1`}),`Demande initiale`,e.request.source&&(0,V.jsx)(`span`,{className:`request-source mono`,children:e.request.source})]}),(0,V.jsx)(`p`,{className:`request-text`,children:e.request.text})]}),(0,V.jsxs)(`div`,{className:`section-head`,children:[(0,V.jsx)(`h2`,{className:`section-title`,children:`Constats ouverts`}),(0,V.jsx)(`div`,{className:`pill-row`,title:`Constats ouverts par gravité, exigences manquantes comprises`,children:r.filter(({count:e})=>e>0).map(({severity:e,count:t})=>(0,V.jsx)(`span`,{className:`pill`,style:{color:lu[e].color,background:lu[e].background},children:Du(e,t)},e))}),(0,V.jsx)(`span`,{className:`spacer`}),(0,V.jsxs)(`button`,{type:`button`,className:`button button-secondary button-medium`,disabled:n.length===0,title:n.length===0?`Aucun constat ouvert à transmettre.`:`Tous les constats ouverts, du plus grave au moins grave.`,onClick:()=>void t(Tp(e),`Prompt des constats ouverts copié dans le presse-papiers.`),children:[(0,V.jsx)(H,{name:`bot`,color:`#b18cff`}),`Copier le prompt pour l'agent`]})]}),(0,V.jsxs)(`section`,{className:`card list-card`,children:[n.length===0?(0,V.jsx)(`p`,{className:`list-empty`,children:e.findings.length===0?`L'agent n'a relevé aucun constat.`:`Aucun constat ouvert : tous sont ignorés ou obsolètes.`}):n.slice(0,Ep).map(t=>(0,V.jsx)(dp,{analysis:e,finding:t},t.id)),e.findings.length>0&&(0,V.jsxs)(`a`,{className:`list-footer-link`,href:Hu.feature(e.id,`findings`),children:[`Voir les `,e.findings.length,` constats, tous statuts confondus`]})]})]})}var Op={summary:`Résumé`,files:`Fichiers`,findings:`Constats`,diagrams:`Schémas`};function kp(e,t){if(t===`files`)return{count:e.files.length,title:Eu(e.files.length,`fichier modifié`,`fichiers modifiés`)};if(t===`findings`){let t=e.findings.filter(e=>e.status===`open`).length;return{count:t,title:`${Eu(t,`constat ouvert`,`constats ouverts`)}, exigences manquantes comprises · ${e.findings.length} au total`}}return t===`diagrams`?{count:e.diagrams.length,title:Eu(e.diagrams.length,`schéma`)}:null}function Ap(e){return e.mode===`branch`?`${hu.branch} ${Mu(e)} vers ${ju(e.base)}`:`${hu.working_tree} par rapport à HEAD`}function jp({analysis:e,tab:t}){let n=Lu(e),r=od(e);return(0,V.jsxs)(`div`,{className:`page`,children:[(0,V.jsxs)(`div`,{className:`page-head`,children:[(0,V.jsxs)(`div`,{className:`page-head-text`,children:[(0,V.jsx)(`h1`,{className:`page-title`,children:e.title}),(0,V.jsxs)(`p`,{className:`page-meta`,children:[(0,V.jsxs)(`span`,{children:[Ap(e),` · produite `,Su(e.snapshotAt),` · `,Eu(e.files.length,`fichier`)]}),(0,V.jsxs)(`span`,{className:`count-add mono`,children:[`+`,n.additions]}),(0,V.jsxs)(`span`,{className:`count-del mono`,children:[`−`,n.deletions]})]})]}),(0,V.jsx)(`button`,{type:`button`,className:`button button-primary button-large`,disabled:r===null,title:r===null?`L'analyse ne contient aucun fichier modifié.`:void 0,onClick:()=>r&&Uu(Hu.review(e.id,r)),children:`Commencer la revue`})]}),(0,V.jsx)(`nav`,{className:`tabs`,"aria-label":`Sections de l'analyse`,children:Ru.map(n=>{let r=kp(e,n);return(0,V.jsxs)(`a`,{href:Hu.feature(e.id,n),className:`tab${n===t?` is-active`:``}`,title:r?.title,children:[Op[n],r!==null&&(0,V.jsx)(`span`,{className:`tab-count`,children:r.count})]},n)})}),(0,V.jsxs)(`div`,{className:`tab-panel`,children:[t===`summary`&&(0,V.jsx)(Dp,{analysis:e}),t===`files`&&(0,V.jsx)(ud,{analysis:e}),t===`findings`&&(0,V.jsx)(pp,{analysis:e}),t===`diagrams`&&(0,V.jsx)(sp,{analysis:e})]})]})}var Mp={approve:{icon:`circle-check`,color:`#3fb950`,description:`La feature peut être fusionnée`},request_changes:{icon:`pencil`,color:`#e3a33b`,description:`L'agent reprend son travail`},reject:{icon:`circle-x`,color:`#f0625a`,description:`La feature est abandonnée`}};function Np(e){let t=pl(e.findings.filter(e=>e.status===`open`)).map(e=>({key:`f:${e.id}`,finding:e})),n=e.notes.map(e=>({key:`n:${e.id}`,note:e}));return[...t,...n]}function Pp(e){let t=e.review;if(t.state===`submitted`){let n=new Set([...t.selectedFindingIds.map(e=>`f:${e}`),...t.selectedNoteIds.map(e=>`n:${e}`)]);return new Set(Np(e).map(e=>e.key).filter(e=>!n.has(e)))}let n=t.previousSubmission;return n?new Set([...n.excludedFindingIds.map(e=>`f:${e}`),...n.excludedNoteIds.map(e=>`n:${e}`)]):new Set}function Fp({analysis:e}){let t=B(e=>e.copy),n=B(e=>e.submitReview),r=B(e=>e.notify),i=B(e=>e.saving),a=Np(e),[o,s]=(0,v.useState)(()=>e.review.decision??e.review.previousSubmission?.decision??(a.length>0?`request_changes`:`approve`)),[c,l]=(0,v.useState)(()=>Pp(e)),u=a.filter(e=>!c.has(e.key)),d=u.flatMap(e=>e.finding?[e.finding.id]:[]),f=u.flatMap(e=>e.note?[e.note.id]:[]),p=wp(e,{findingIds:d,noteIds:f,decision:o}),m=e.files.filter(e=>e.reviewed).length,h=e.review,g=e=>{let t=new Set(c);t.has(e)?t.delete(e):t.add(e),l(t)},_=async()=>{await n(o,d,f)&&r(`info`,`Retour enregistré : l'agent le lit avec l'outil get_review_feedback.`)},y=od(e);return(0,V.jsxs)(`div`,{className:`page page-narrow`,children:[(0,V.jsx)(`h1`,{className:`page-title page-title-small`,children:`Terminer la revue`}),(0,V.jsxs)(`p`,{className:`page-meta`,children:[m,` / `,Eu(e.files.length,`fichier revu`,`fichiers revus`),` · `,Eu(d.length,`constat ouvert`,`constats ouverts`),` et`,` `,Eu(f.length,`remarque`),` à transmettre`]}),h.state===`submitted`&&h.submittedAt&&h.decision&&(0,V.jsxs)(`div`,{className:`submitted-banner`,children:[(0,V.jsx)(H,{name:`circle-check`,color:`#3fb950`,size:16}),(0,V.jsxs)(`span`,{children:[`Retour enregistré le `,Cu(h.submittedAt),` · décision « `,gu[h.decision],` ».`,` `,h.processed?`${wu(h.processed)}.`:`L'agent le lit avec l'outil get_review_feedback ; il n'est pas encore traité.`,` `,`Un nouvel enregistrement le remplace.`]})]}),h.state===`pending`&&h.previousSubmission&&(0,V.jsxs)(`div`,{className:`submitted-banner is-reopened`,children:[(0,V.jsx)(H,{name:`pencil`,color:`#e3a33b`,size:16}),(0,V.jsxs)(`span`,{children:[`Revue modifiée depuis le retour du `,Cu(h.previousSubmission.submittedAt),` : l'agent ne le traite plus. Enregistrez-la à nouveau pour qu'il traite la nouvelle version ; il verra ce qui a changé.`]})]}),(0,V.jsx)(`h2`,{className:`field-label`,children:`Décision`}),(0,V.jsx)(`div`,{className:`decisions`,role:`radiogroup`,"aria-label":`Décision`,children:Vc.map(e=>(0,V.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":o===e,className:`decision${o===e?` is-selected`:``}`,onClick:()=>s(e),children:[(0,V.jsx)(H,{name:Mp[e].icon,color:Mp[e].color,size:16}),(0,V.jsxs)(`span`,{className:`decision-text`,children:[(0,V.jsx)(`span`,{className:`decision-title`,children:gu[e]}),(0,V.jsx)(`span`,{className:`decision-description`,children:Mp[e].description})]})]},e))}),(0,V.jsxs)(`div`,{className:`field-head`,children:[(0,V.jsx)(`h2`,{className:`field-label`,children:`Points à transmettre`}),(0,V.jsxs)(`span`,{className:`field-meta`,children:[u.length,` sur `,a.length,` sélectionnés`]})]}),(0,V.jsxs)(`div`,{className:`card points`,children:[a.length===0&&(0,V.jsx)(`p`,{className:`list-empty`,children:`Aucun constat ouvert ni remarque : le retour ne contiendra que la décision.`}),a.map(t=>{let n=!c.has(t.key);return(0,V.jsxs)(`label`,{className:`point${n?``:` is-excluded`}`,children:[(0,V.jsx)(`input`,{type:`checkbox`,className:`visually-hidden`,checked:n,onChange:()=>g(t.key)}),(0,V.jsx)(H,{name:n?`square-check`:`square`,color:n?`#8b97ff`:`#646b7b`,size:16}),t.finding?(0,V.jsx)(Qu,{severity:t.finding.severity}):(0,V.jsx)($u,{}),(0,V.jsx)(`span`,{className:`point-title`,children:t.finding?t.finding.title:t.note.text}),(0,V.jsx)(`span`,{className:`point-location mono`,children:t.finding?Pu(t.finding,e.request):Fu(t.note)})]},t.key)})]}),(0,V.jsx)(`h2`,{className:`field-label`,children:`Prompt pour l'agent`}),(0,V.jsxs)(`div`,{className:`prompt-box`,children:[(0,V.jsx)(`pre`,{className:`prompt-text`,children:p}),(0,V.jsx)(`button`,{type:`button`,className:`icon-button prompt-copy`,title:`Copier le prompt`,"aria-label":`Copier le prompt`,onClick:()=>void t(p,`Prompt copié dans le presse-papiers.`),children:(0,V.jsx)(H,{name:`copy`,color:`#9aa1b1`})})]}),(0,V.jsxs)(`footer`,{className:`finish-footer`,children:[(0,V.jsx)(H,{name:`info`,color:`#646b7b`}),(0,V.jsx)(`span`,{className:`finish-hint`,children:`L'agent récupère ce retour avec l'outil get_review_feedback.`}),(0,V.jsx)(`span`,{className:`spacer`}),(0,V.jsx)(`button`,{type:`button`,className:`button button-secondary button-medium`,onClick:()=>Uu(y?Hu.review(e.id,y):Hu.feature(e.id)),children:`Retour à la revue`}),(0,V.jsxs)(`button`,{type:`button`,className:`button button-primary button-medium`,disabled:i,onClick:()=>void _(),children:[(0,V.jsx)(H,{name:`save`,color:`#ffffff`}),`Enregistrer le retour`]})]})]})}var Ip={to_review:`À relire`,all:`Toutes`};function Lp({analysis:e}){let{reviewedFiles:t,totalFiles:n}=e.progress,r=Xu(e);return(0,V.jsxs)(`a`,{className:`home-row`,href:Hu.feature(e.id),children:[(0,V.jsxs)(`span`,{className:`home-row-body`,children:[(0,V.jsx)(`span`,{className:`home-row-title`,children:e.title}),(0,V.jsxs)(`span`,{className:`home-row-details`,children:[(0,V.jsxs)(`span`,{className:`home-row-meta`,children:[(0,V.jsx)(`span`,{className:`mono`,children:Nu(e)}),(0,V.jsxs)(`span`,{children:[`· `,Su(e.updatedAt)]})]}),(0,V.jsxs)(`span`,{className:`home-row-progress`,title:`${t} fichier(s) revu(s) sur ${n}`,children:[(0,V.jsx)(`span`,{className:`home-row-progress-bar`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":n,"aria-valuenow":t,children:(0,V.jsx)(`span`,{className:`progress-fill`,style:{width:`${Zu(e)}%`}})}),(0,V.jsxs)(`span`,{className:`home-row-progress-label mono`,children:[t,`/`,n]})]}),(0,V.jsx)(`span`,{className:`home-row-findings`,children:r.length===0?(0,V.jsx)(`span`,{className:`home-row-none`,children:`Aucun constat ouvert`}):r.map(({severity:e,count:t})=>(0,V.jsx)(nd,{severity:e,count:t,title:`${ku(e,t)}, exigences manquantes comprises`},e))}),(0,V.jsx)(`span`,{className:`home-row-state`,children:(0,V.jsx)(W,{progress:e.progress})})]})]}),(0,V.jsx)(H,{name:`chevron-right`,color:`#646b7b`})]})}function Rp({group:e}){let t=B(t=>t.collapsedProjects.has(e.project)),n=B(e=>e.toggleProject);return(0,V.jsxs)(`section`,{className:`home-project`,children:[(0,V.jsxs)(`button`,{type:`button`,className:`home-project-head`,"aria-expanded":!t,onClick:()=>n(e.project),children:[(0,V.jsx)(H,{name:t?`chevron-right`:`chevron-down`,color:`#646b7b`}),(0,V.jsx)(H,{name:`folder`,color:`#8b97ff`}),(0,V.jsx)(`span`,{className:`home-project-name`,children:e.project}),(0,V.jsx)(`span`,{className:`home-project-total`,children:Eu(e.analyses.length,`analyse`)}),(0,V.jsx)(`span`,{className:`spacer`}),(0,V.jsx)(`span`,{className:`home-project-counts`,children:e.counts.map(({state:e,count:t})=>(0,V.jsxs)(`span`,{className:`pill pill-small`,style:{color:_u[e].color,background:_u[e].background},children:[_u[e].label,` · `,t]},e))})]}),!t&&(0,V.jsx)(`div`,{className:`home-project-list`,children:e.analyses.map(e=>(0,V.jsx)(Lp,{analysis:e},e.id))})]})}function zp(){let e=B(e=>e.analyses),t=B(e=>e.unreadable),n=B(e=>e.listError),r=B(e=>e.homeFilter),i=B(e=>e.setHomeFilter);if(n)return(0,V.jsx)(`div`,{className:`empty-state`,children:(0,V.jsx)(`div`,{className:`empty-card`,children:(0,V.jsx)(`p`,{className:`error-text`,children:n})})});if(e===null)return(0,V.jsx)(`div`,{className:`empty-state`,children:(0,V.jsx)(`div`,{className:`empty-card`,children:(0,V.jsx)(`p`,{children:`Chargement des analyses…`})})});if(e.length===0&&t.length===0)return(0,V.jsx)(`div`,{className:`empty-state`,children:(0,V.jsxs)(`div`,{className:`empty-card`,children:[(0,V.jsx)(`h1`,{className:`empty-title`,children:`Aucune analyse à revoir`}),(0,V.jsxs)(`p`,{children:[`L'agent crée une analyse avec l'outil `,(0,V.jsx)(`code`,{children:`create_analysis`}),` une fois la feature développée. Elle apparaîtra ici automatiquement.`]})]})});let a=Yu(Ju(e,r)),o=new Set(e.map(e=>e.project)).size,s=Ju(e,`to_review`).length;return(0,V.jsxs)(`div`,{className:`page`,children:[(0,V.jsxs)(`div`,{className:`home-head`,children:[(0,V.jsxs)(`div`,{className:`page-head-text`,children:[(0,V.jsx)(`h1`,{className:`page-title`,children:`Analyses`}),(0,V.jsxs)(`p`,{className:`page-meta`,children:[Eu(e.length,`analyse`),` · `,Eu(o,`projet`),` · `,s,` à relire`]})]}),(0,V.jsx)(`div`,{className:`segmented`,role:`group`,"aria-label":`Filtrer les analyses`,children:Object.keys(Ip).map(e=>(0,V.jsx)(`button`,{type:`button`,className:`segmented-item${e===r?` is-active`:``}`,"aria-pressed":e===r,onClick:()=>i(e),children:Ip[e]},e))})]}),(0,V.jsxs)(`div`,{className:`home-projects`,children:[a.length===0&&e.length>0&&(0,V.jsxs)(`div`,{className:`card home-empty`,children:[(0,V.jsx)(`p`,{children:`Toutes les revues sont soumises : aucune analyse ne reste à relire.`}),(0,V.jsx)(`button`,{type:`button`,className:`link-button accent`,onClick:()=>i(`all`),children:`Afficher toutes les analyses`})]}),a.map(e=>(0,V.jsx)(Rp,{group:e},e.project)),t.length>0&&(0,V.jsxs)(`section`,{className:`home-project`,children:[(0,V.jsxs)(`h2`,{className:`home-project-head is-static`,children:[(0,V.jsx)(H,{name:`triangle-alert`,color:`#f0625a`}),(0,V.jsx)(`span`,{className:`home-project-name`,children:`Analyses illisibles`})]}),(0,V.jsx)(`div`,{className:`home-project-list`,children:t.map(e=>(0,V.jsx)(`div`,{className:`home-row is-unreadable`,children:(0,V.jsxs)(`span`,{className:`home-row-body`,children:[(0,V.jsx)(`span`,{className:`home-row-title mono`,children:e.id}),(0,V.jsx)(`span`,{className:`home-row-meta error-text`,children:e.error})]})},e.id))})]})]})]})}function Bp(e,t){return t===1?`${e}`:`${e},${t}`}function Vp(e,t,n,r){let i=r.filter(e=>e.type!==`add`).length,a=r.filter(e=>e.type!==`del`).length,o=e.header.replace(/^@@[^@]*@@/,``);return{header:`@@ -${Bp(t,i)} +${Bp(n,a)} @@${o}`,oldStart:t,oldLines:i,newStart:n,newLines:a,lines:r}}function Hp(e){let t=e.lines.findIndex(e=>e.type!==`context`);return t===-1?e.lines.length:t}function Up(e,t){if(e.newContent===null)return null;let n=ml(e.newContent),r=new Set,i=[],a=0,o=0;e.hunks.forEach((s,c)=>{let l=s.newLines===0?s.newStart+1:s.newStart,u=l+s.newLines-1,d=e.hunks[c+1],f=d===void 0?n.length+1:d.newLines===0?d.newStart+1:d.newStart,p=Math.max(0,t[c]??0),m=l-1-o,h=f-1-u,g=Math.min(p,m),_=Math.min(p,h),v=a+s.oldLines-s.newLines,y=(e,t)=>(r.add(e),{type:`context`,oldNo:e+t,newNo:e,text:n[e-1]}),b=g===0&&_===0?s:Vp(s,(s.oldLines===0?s.oldStart+1:s.oldStart)-g,l-g,[...Array.from({length:g},(e,t)=>y(l-g+t,a)),...s.lines,...Array.from({length:_},(e,t)=>y(u+1+t,v))]);i.push({hunk:b,above:g,below:_,canGrow:g<m||_<h,joinsPrevious:c>0&&g===m}),a=v,o=u+_});let s=[];i.forEach((e,t)=>{e.joinsPrevious?s[s.length-1].push(t):s.push([t])});let c=s.map(e=>{if(e.length===1)return i[e[0]].hunk;let t=i[e[0]].hunk;return Vp(t,t.oldLines===0?t.oldStart+1:t.oldStart,t.newLines===0?t.newStart+1:t.newStart,e.flatMap(e=>i[e].hunk.lines))}),l=s.map(t=>({context:Hp(e.hunks[t[0]])+i[t[0]].above,members:t,canShrink:t.some(e=>i[e].above>0||i[e].below>0),canGrow:t.some(e=>i[e].canGrow)}));return{fileDiff:{...e,hunks:c},hunks:l,extras:i.map(e=>Math.max(e.above,e.below)),added:r}}function Wp(e,t,n){let r=[...e.extras];for(let i of e.hunks[t].members)r[i]=Math.max(0,r[i]+n*5);return r}var Gp={context:` `,add:`+`,del:`-`};function Kp(e){return e.mode===`branch`?`branch ${e.base}...${e.head}`:`working tree changes against HEAD`}function qp(e,t){return t===0?null:hl(e,e+t-1)}function Jp(e){let t=1;for(let n of e.lines)t=Math.max(t,String(n.oldNo??``).length,String(n.newNo??``).length);let n=e=>String(e??``).padStart(t);return[e.header,...e.lines.map(e=>`${n(e.oldNo)} | ${n(e.newNo)} ${Gp[e.type]} ${e.text}`)]}function Yp(e,t,n){let r=qp(n.newStart,n.newLines),i=qp(n.oldStart,n.oldLines),a=[`- File: ${t.path}${t.oldPath===null?``:` (renamed from ${t.oldPath})`}`,r===null?`- New side: no line (the section only removes code).`:`- New side (code after the feature): lines ${r}`,i===null?`- Old side: no line (the section only adds code).`:`- Old side (code before the feature): lines ${i}`];return[`Explain a section of code in the feature analysis "${e.title}" (analysis_id: "${e.id}", project "${e.project}").`,`Repository: ${e.repoPath} — ${Kp(e)}.`,``,`Section to explain:`,...a,``,`Code of the section, as frozen in the analysis (columns: old line | new line, then + added, - removed, or a space for context):`,"```",...Jp(n),"```",``,`What to do:`,`1. Read this code and what surrounds it (get_diff with analysis_id "${e.id}" and path "${t.path}", and the repository) until you understand what it does and how it works.`,`2. Record your explanations in the feature analyzer with add_explanations (analysis_id "${e.id}", path "${t.path}"): one explanation per meaningful block of the section, covering it from its first to its last line. Use "side": "new" with new-side line numbers for added or kept code, and "side": "old" with old-side line numbers for removed code.`,`3. In each explanation, say what the code does (inputs, outputs, effects), then how it works, step by step in the order of the code; name the key variables and the edge cases it handles. For removed code, say what it did and what replaces it. Describe, do not judge.`,`4. If an explanation of the analysis already covers these lines (see get_analysis), rewrite it with update_explanation instead of adding a duplicate.`,`5. Then tell me in a few lines which explanations you recorded.`].join(`
72
- `)}function Xp(e){return`${e===0?0:1},${e}`}function Zp(e){if(e.newContent===null)return null;let t=ml(e.newContent),n=[],r=1,i=0,a=e=>{for(;r<=e;r++)n.push({type:`context`,oldNo:r+i,newNo:r,text:t[r-1]})};for(let t of e.hunks)a(t.newLines===0?t.newStart:t.newStart-1),n.push(...t.lines),r+=t.newLines,i+=t.oldLines-t.newLines;a(t.length);let o=t.length+i,s={header:`@@ -${Xp(o)} +${Xp(t.length)} @@`,oldStart:o===0?0:1,oldLines:o,newStart:t.length===0?0:1,newLines:t.length,lines:n};return{path:e.path,hunks:[s],newContent:e.newContent}}function Qp({anchorText:e,suggestion:t}){let n=ml(e),r=ml(t);return(0,V.jsxs)(`div`,{className:`fix`,children:[n.map((e,t)=>(0,V.jsxs)(`div`,{className:`fix-line is-del`,children:[(0,V.jsx)(`span`,{className:`fix-marker`,children:`−`}),(0,V.jsx)(`span`,{className:`fix-code`,children:e})]},`del-${t}`)),r.map((e,t)=>(0,V.jsxs)(`div`,{className:`fix-line is-add`,children:[(0,V.jsx)(`span`,{className:`fix-marker`,children:`+`}),(0,V.jsx)(`span`,{className:`fix-code`,children:e})]},`add-${t}`)),r.length===0&&(0,V.jsx)(`div`,{className:`fix-empty`,children:`Les lignes visées sont supprimées.`})]})}function $p({analysis:e,finding:t,onAddNote:n}){let r=B(e=>e.setFindingStatus),i=B(e=>e.copy),a=B(e=>e.saving),o=t.location;return(0,V.jsxs)(`article`,{className:`finding-card is-${t.status}`,id:`finding-${t.id}`,children:[(0,V.jsxs)(`header`,{className:`finding-head`,children:[(0,V.jsx)(Qu,{severity:t.severity}),(0,V.jsx)(`h3`,{className:`finding-title`,children:t.title}),(0,V.jsx)(td,{kind:t.kind}),(0,V.jsx)(ed,{status:t.status}),o&&(0,V.jsx)(`span`,{className:`finding-lines mono`,children:Iu(o.startLine,o.endLine)})]}),t.body.trim()!==``&&(0,V.jsx)(`p`,{className:`finding-body`,children:t.body}),t.status===`outdated`&&(0,V.jsx)(`p`,{className:`finding-outdated`,children:`Les lignes visées ont changé depuis la rédaction de ce constat : l'agent doit le réancrer avec update_finding.`}),t.suggestion!==null&&t.anchorText!==null&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`finding-section-title`,children:`Correctif proposé`}),(0,V.jsx)(Qp,{anchorText:t.anchorText,suggestion:t.suggestion})]}),(0,V.jsxs)(`footer`,{className:`finding-actions`,children:[(0,V.jsxs)(`button`,{type:`button`,className:`button button-secondary`,onClick:()=>void i(wp(e,{findingIds:[t.id],noteIds:[],decision:null}),`Prompt du constat copié dans le presse-papiers.`),children:[(0,V.jsx)(H,{name:`bot`,color:`#b18cff`}),`Copier le prompt pour l'agent`]}),t.status===`open`&&(0,V.jsx)(`button`,{type:`button`,className:`link-button muted`,disabled:a,onClick:()=>void r(t.id,`ignored`),children:`Ignorer`}),t.status===`ignored`&&(0,V.jsx)(`button`,{type:`button`,className:`link-button muted`,disabled:a,onClick:()=>void r(t.id,`open`),children:`Rouvrir`}),(0,V.jsx)(`span`,{className:`spacer`}),n&&(0,V.jsx)(`button`,{type:`button`,className:`link-button accent`,onClick:n,children:`Ajouter une remarque`})]})]})}function em({entry:e,small:t}){let n=lu[e.finding.severity];return(0,V.jsx)(`span`,{className:`finding-number${t?` is-small`:``}`,style:{color:n.color,background:n.background,borderColor:n.color},"aria-label":`Constat ${e.number}`,children:e.number})}function tm(e,t){return e===`applied`?t?`Correctif appliqué dans le code`:`Appliquer le correctif dans le code`:t?`Correctif affiché dans le code`:`Afficher le correctif dans le code`}function nm({analysis:e,entry:t,fix:n,mode:r,onToggleFix:i,onAddNote:a,highlighted:o}){let s=B(e=>e.setFindingStatus),c=B(e=>e.copy),l=B(e=>e.saving),{finding:u}=t,d=lu[u.severity],f=n.state===`shown`,p=r===`off`||n.state===`blocked`;return(0,V.jsxs)(`article`,{className:`margin-card is-${u.status}${f?` is-fix-shown`:``}${o?` is-target`:``}`,id:`finding-${u.id}`,"data-finding-card":u.id,style:{"--severity":d.color},children:[(0,V.jsxs)(`header`,{className:`margin-card-head`,children:[(0,V.jsx)(em,{entry:t}),(0,V.jsx)(`span`,{className:`pill pill-small margin-card-severity`,style:{color:d.color,background:d.background},children:d.label}),(0,V.jsx)(td,{kind:u.kind}),(0,V.jsx)(ed,{status:u.status}),(0,V.jsxs)(`span`,{className:`margin-card-lines mono`,children:[`l. `,hl(t.startLine,t.endLine,`–`)]})]}),(0,V.jsx)(`h3`,{className:`margin-card-title`,children:u.title}),u.body.trim()!==``&&(0,V.jsx)(`p`,{className:`margin-card-body`,children:u.body}),u.status===`outdated`&&(0,V.jsx)(`p`,{className:`finding-outdated`,children:`Les lignes visées ont changé depuis la rédaction de ce constat : l'agent doit le réancrer avec update_finding.`}),(n.state===`shown`||n.state===`hidden`||n.state===`blocked`)&&(0,V.jsxs)(`label`,{className:`fix-toggle${f?` is-on`:``}${p?` is-disabled`:``}`,children:[(0,V.jsx)(`input`,{type:`checkbox`,className:`visually-hidden`,checked:f,disabled:p,onChange:e=>i(e.target.checked)}),(0,V.jsx)(`span`,{className:`switch`,"aria-hidden":`true`}),tm(r,f)]}),r===`off`&&n.state===`hidden`&&(0,V.jsx)(`p`,{className:`margin-card-hint`,children:`Choisissez « Avant / après » ou « Code corrigé » pour afficher le correctif.`}),n.state===`blocked`&&(0,V.jsx)(`p`,{className:`margin-card-hint`,children:r===`applied`?`Ses lignes recouvrent le correctif du constat ${n.blockedBy} : retirez-le pour appliquer celui-ci dans le code.`:`Ses lignes recouvrent le correctif du constat ${n.blockedBy} : masquez-le pour afficher celui-ci dans le code.`}),n.state===`outside`&&u.suggestion!==null&&u.anchorText!==null&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:`margin-card-hint`,children:`Les lignes visées ne sont pas toutes affichées dans le diff : voici le correctif proposé.`}),(0,V.jsx)(Qp,{anchorText:u.anchorText,suggestion:u.suggestion})]}),(0,V.jsxs)(`footer`,{className:`margin-card-actions`,children:[(0,V.jsxs)(`button`,{type:`button`,className:`margin-button`,onClick:()=>void c(wp(e,{findingIds:[u.id],noteIds:[],decision:null}),`Prompt du constat copié dans le presse-papiers.`),children:[(0,V.jsx)(H,{name:`bot`,color:`#b18cff`}),`Copier le prompt`]}),u.status===`open`&&(0,V.jsxs)(`button`,{type:`button`,className:`margin-button`,disabled:l,onClick:()=>void s(u.id,`ignored`),children:[(0,V.jsx)(H,{name:`eye-off`,color:`#9aa1b1`}),`Ignorer`]}),u.status===`ignored`&&(0,V.jsxs)(`button`,{type:`button`,className:`margin-button`,disabled:l,onClick:()=>void s(u.id,`open`),children:[(0,V.jsx)(H,{name:`rotate-ccw`,color:`#9aa1b1`}),`Rouvrir`]}),a&&(0,V.jsxs)(`button`,{type:`button`,className:`margin-button`,onClick:a,children:[(0,V.jsx)(H,{name:`message-square`,color:`#9aa1b1`}),`Remarque`]})]})]})}function rm({label:e,options:t,value:n,onChange:r,disabled:i}){let[a,o]=(0,v.useState)(null),s=a!==null,c=(0,v.useRef)(null),l=(0,v.useRef)(null);(0,v.useEffect)(()=>{if(!s)return;let e=()=>o(null),t=t=>{c.current?.contains(t.target)||e()},n=t=>{t.key===`Escape`&&e()};return document.addEventListener(`mousedown`,t),document.addEventListener(`keydown`,n),document.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{document.removeEventListener(`mousedown`,t),document.removeEventListener(`keydown`,n),document.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[s]);let u=()=>{let e=l.current?.getBoundingClientRect();o(s||!e?null:{top:e.bottom+6,right:window.innerWidth-e.right})},d=t[n];return(0,V.jsxs)(`div`,{className:`option-menu`,ref:c,children:[(0,V.jsxs)(`button`,{ref:l,type:`button`,className:`option-menu-button${s?` is-open`:``}`,"aria-haspopup":`listbox`,"aria-expanded":s,title:e,onClick:u,children:[(0,V.jsx)(H,{name:d.icon,color:s?`#c3caff`:`#9aa1b1`}),(0,V.jsx)(`span`,{className:`option-menu-value`,children:d.label}),(0,V.jsx)(H,{name:s?`chevron-up`:`chevron-down`,size:12,color:s?`#9aa1b1`:`#646b7b`})]}),a&&(0,V.jsxs)(`div`,{className:`option-menu-list`,role:`listbox`,"aria-label":e,style:a,children:[(0,V.jsx)(`div`,{className:`option-menu-title`,children:e}),Object.keys(t).map(e=>{let a=t[e],s=i?.[e],c=e===n;return(0,V.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":c,className:`option-menu-item${c?` is-selected`:``}`,disabled:s!==void 0,onClick:()=>{o(null),r(e)},children:[(0,V.jsx)(H,{name:a.icon,color:c?`#c3caff`:`#9aa1b1`}),(0,V.jsxs)(`span`,{className:`option-menu-item-text`,children:[(0,V.jsx)(`span`,{className:`option-menu-item-label`,children:a.label}),(0,V.jsx)(`span`,{className:`option-menu-item-description`,children:s??a.description})]}),c&&(0,V.jsx)(H,{name:`check`,color:`#c3caff`})]},e)})]})]})}var im=4,am=6;function om(e,t){let n=e.getBoundingClientRect();return{top:n.top+t,bottom:n.bottom}}function sm(e){if(e.kind===`note`)return{color:uu.color,title:`Remarque · ligne ${e.line}`,detail:null};let{finding:t,number:n}=e.entry;return{color:lu[t.severity].color,title:`Constat ${n} · ${lu[t.severity].label}`,detail:t.title}}function cm({model:e,rowsRef:t,scrollRef:n,toolbarHeight:r}){let i=(0,v.useRef)(null),a=(0,v.useRef)(!1),[o,s]=(0,v.useState)(0),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(null);(0,v.useLayoutEffect)(()=>{let e=t.current;if(!e)return;let n=()=>{let t=e.offsetHeight,n=e.querySelectorAll(`:scope > .hunk > :not(.hunk-header)`);if(t===0||n.length===0)return p(null);let r=Array.from(n,e=>e.offsetTop/t),i=n[n.length-1];p([...r,(i.offsetTop+i.offsetHeight)/t])};n();let r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[t,e]),(0,v.useEffect)(()=>{let e=n.current,i=t.current;if(!e||!i)return;let a=()=>{let t=om(e,r),n=i.getBoundingClientRect();if(s(Math.max(Math.min(t.bottom-t.top,n.height),0)),n.height===0)return l(null);let a=Math.max(t.top,n.top),o=Math.min(t.bottom,n.bottom);l({top:(a-n.top)/n.height,height:Math.max(o-a,0)/n.height})};a(),e.addEventListener(`scroll`,a,{passive:!0});let o=new ResizeObserver(a);return o.observe(e),o.observe(i),()=>{e.removeEventListener(`scroll`,a),o.disconnect()}},[n,t,r]);let m=e=>{let a=n.current,o=t.current,s=i.current;if(!a||!o||!s)return;let c=s.getBoundingClientRect(),l=Math.min(Math.max((e-c.top)/c.height,0),1),u=om(a,r),d=o.getBoundingClientRect();a.scrollTop+=d.top+l*d.height-(u.top+u.bottom)/2},h=e=>{e.button===0&&(a.current=!0,e.currentTarget.setPointerCapture(e.pointerId),d(null),m(e.clientY))},g=e=>{a.current&&m(e.clientY)},_=()=>{a.current=!1},y=(e,t)=>{a.current||d({top:im+e*(o-8),...t})},b=e=>f?.[e]??0;return(0,V.jsx)(`div`,{className:`diff-minimap`,children:(0,V.jsxs)(`div`,{className:`diff-minimap-track`,style:{top:r,height:o},children:[(0,V.jsxs)(`div`,{ref:i,className:`diff-minimap-inner`,"aria-hidden":`true`,onPointerDown:h,onPointerMove:g,onPointerUp:_,onPointerCancel:_,onPointerLeave:()=>d(null),children:[(0,V.jsx)(`div`,{className:`minimap-lane is-changes`,children:f&&e.changes.map((e,t)=>(0,V.jsx)(`span`,{className:`minimap-change is-${e.kind}`,style:{top:`${b(e.start)*100}%`,height:`${(b(e.end)-b(e.start))*100}%`},onPointerEnter:()=>y(b(e.start),{color:lm(e.kind),title:e.label,detail:null})},t))}),(0,V.jsx)(`div`,{className:`minimap-lane is-dots`,children:f&&e.dots.map(e=>(0,V.jsx)(`span`,{className:`minimap-dot is-${e.kind}${e.kind===`finding`&&e.entry.finding.status!==`open`?` is-muted`:``}`,style:{top:`${b(e.row)*100}%`,"--dot":sm(e).color},onPointerEnter:()=>y(b(e.row),sm(e))},e.kind===`note`?`note-${e.line}`:e.entry.finding.id))}),c&&(0,V.jsx)(`div`,{className:`minimap-view`,style:{top:`${c.top*100}%`,height:`${c.height*100}%`}})]}),u&&(0,V.jsxs)(`div`,{className:`minimap-tooltip`,style:u.top>o/2?{bottom:o-u.top-am}:{top:u.top-am},children:[(0,V.jsxs)(`span`,{className:`minimap-tooltip-title`,children:[(0,V.jsx)(`span`,{className:`minimap-tooltip-swatch`,style:{background:u.color}}),u.title]}),u.detail&&(0,V.jsx)(`span`,{className:`minimap-tooltip-detail`,children:u.detail})]})]})})}function lm(e){switch(e){case`add`:return`var(--add)`;case`del`:return`var(--del)`;case`mod`:return`linear-gradient(90deg, var(--del) 50%, var(--add) 50%)`;case`reindent`:return`var(--accent-soft)`}}var um=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function dm(e){return fm(e)}function fm(e){return Array.isArray(e)?pm(e):e instanceof RegExp?e:typeof e==`object`?mm(e):e}function pm(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=fm(e[n]);return t}function mm(e){let t={};for(let n in e)t[n]=fm(e[n]);return t}function hm(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function gm(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?gm(e.substring(0,e.length-1)):e.substr(~t+1)}var _m=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,vm=class{static hasCaptures(e){return e!==null&&(_m.lastIndex=0,_m.test(e))}static replaceCaptures(e,t,n){return e.replace(_m,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function ym(e,t){return e<t?-1:+(e>t)}function bm(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=ym(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function xm(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Sm(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Cm=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},wm=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(km(e),t)}static createFromParsedTheme(e,t){return Mm(e,t)}_cachedMatchRoot=new Cm(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>Em(e.parent,t.parentScopes));return n?new Om(n.fontStyle,n.foreground,n.background):null}},Tm=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Em(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Dm(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Dm(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var Om=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function km(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&xm(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&xm(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new Am(l,u,e,o,s,c)}}return n}var Am=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},jm=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(jm||{});function Mm(e,t){e.sort((e,t)=>{let n=ym(e.scope,t.scope);return n!==0||(n=bm(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new Nm(t),o=new Om(n,a.getId(r),a.getId(i)),s=new Im(new Fm(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new wm(a,o,s)}var Nm=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Pm=Object.freeze([]),Fm=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||Pm,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},Im=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),Fm.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(bm(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Fm(e,t,n,r,i))}},Lm=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=zm(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function Rm(e){return e}function zm(e){return e}function Bm(e,t){let n=[],r=Hm(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(Vm(i)){let e=[];do e.push(i),i=r.next();while(Vm(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function Vm(e){return!!e&&!!e.match(/[\w\.:]+/)}function Hm(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function Um(e){typeof e.dispose==`function`&&e.dispose()}var Wm=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Gm=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Km=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},qm=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Wm(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new Km;for(let n of e)Jm(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof Wm){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function Jm(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof Wm?Xm({baseGrammar:a,selfGrammar:i},r):Ym(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new Wm(e))}function Ym(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];Zm([r],t,n)}}function Xm(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Zm(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Zm(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Zm(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?hm({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Zm(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=rh(i);switch(a.kind){case 0:Xm({...t,selfGrammar:t.baseGrammar},n);break;case 1:Xm(t,n);break;case 2:Ym(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?Ym(a.ruleName,i,n):Xm(i,n)}else a.kind===4?n.add(new Gm(a.scopeName,a.ruleName)):n.add(new Wm(a.scopeName))}}}var Qm=class{kind=0},$m=class{kind=1},eh=class{constructor(e){this.ruleName=e}kind=2},th=class{constructor(e){this.scopeName=e}kind=3},nh=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function rh(e){if(e===`$base`)return new Qm;if(e===`$self`)return new $m;let t=e.indexOf(`#`);return t===-1?new th(e):t===0?new eh(e.substring(1)):new nh(e.substring(0,t),e.substring(t+1))}var ih=/\\(\d+)/,ah=/\\(\d+)/g,oh=-1,sh=-2;function ch(e){return e}function lh(e){return e}var uh=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=vm.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=vm.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${gm(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:vm.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:vm.replaceCaptures(this._contentName,e,t)}},dh=class extends uh{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},fh=class extends uh{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new _h(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new vh,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ph=class extends uh{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new vh,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},mh=class extends uh{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new _h(i,this.id),this.beginCaptures=a,this._end=new _h(o||`￿`,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new vh;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},hh=class extends uh{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new _h(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new _h(o,sh),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new vh;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new vh,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},gh=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new dh(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new fh(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=hm({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new ph(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new hh(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new mh(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=rh(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof ph||e instanceof mh||e instanceof hh)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},_h=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&ih.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return ah.lastIndex=0,this.source.replace(ah,(e,t)=>Sm(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=`￿`,t[i+1]=`￿`,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=`￿`,t[i+1]=`G`,n[i+1]=`￿`,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},vh=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new yh(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new yh(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},yh=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
73
- `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},bh=class{constructor(e,t){this.languageId=e,this.tokenType=t}},xh=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new bh(e,8),this._embeddedLanguagesMatcher=new Sh(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new bh(0,0);_getBasicScopeAttributes=new Cm(e=>new bh(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Sh=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>Sm(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var Ch=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function wh(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Th(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new Ch(i,!0);f()}return new Ch(i,!1);function f(){let o=Eh(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===oh){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),jh(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof mh){let r=o;jh(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof hh){let r=o;jh(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(jh(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function Th(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof hh&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=Ah(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==sh){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),jh(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Eh(e,t,n,r,i,a){let o=Dh(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Oh(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function Dh(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=kh(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Oh(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=kh(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function kh(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Ah(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function jh(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));wh(e,p,n&&d.start===0,d.start,f,i,!1,0),Um(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new Mh(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var Mh=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Nh(e,t,n,r,i,a,o,s){return new Lh(e,t,n,r,i,a,o,s)}function Ph(e,t,n,r,i){let a=Bm(t,Fh),o=gh.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function Fh(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(Ih(t[r],e))return n=r+1,!0;return!1})}function Ih(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var Lh=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new xh(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Rh(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=Bm(e,Fh);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)Ph(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&Ph(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(ch(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[lh(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Rh(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=gh.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Bh.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=Lm.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?zh.createRootAndLookUpScopeName(a,r,this):zh.createRoot(`unknown`,r),t=new Bh(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
74
- `;let a=this.createOnigString(e),o=a.content.length,s=new Hh(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=wh(this,a,i,0,t,s,!0,r);return Um(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Rh(e,t){return e=dm(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var zh=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=Tm.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new Tm(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new Tm(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(1)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),Lm.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},Bh=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?zh.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(1)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:lh(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=zh.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,ch(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,zh.fromExtension(r,n.contentNameScopesList))}},Vh=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):Bm(e,Fh).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>Bm(e,Fh).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Hh=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=Lm.set(n,0,Rm(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=Lm.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},Uh=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,Nh(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},Wh=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Uh(wm.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(wm.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new Vh(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new qm(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},Gh=Bh.NULL;function Kh(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 qh(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Jh(e){return Array.isArray(e)?e:[e]}async function Yh(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function Xh(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function Zh(e){return e===`ansi`||Xh(e)}function Qh(e){return e===`none`}function $h(e){return Qh(e)}var eg=/(\r?\n)/g;function tg(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(eg),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var ng={light:`#333333`,dark:`#bbbbbb`},rg={light:`#fffffe`,dark:`#1e1e1e`},ig=`__shiki_resolved`;function ag(e){if(e?.[ig])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`?ng.light:ng.dark,n||=t.type===`light`?rg.light:rg.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,ig,{enumerable:!1,writable:!1,value:!0}),t}async function og(e){return[...new Set((await Promise.all(e.filter(e=>!Zh(e)).map(async e=>await Yh(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function sg(e){return(await Promise.all(e.map(async e=>$h(e)?null:ag(await Yh(e))))).filter(e=>!!e)}function cg(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 um(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var lg=class extends Wh{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=ag(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=wm.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=cg(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._syncRegistry?._grammars?.get(e.scopeName)?.dispose(),this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new um(`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))}},ug=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).includes(e.scopeName)||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}},dg=0;function fg(e){dg+=1,e.warnings!==!1&&dg>=10&&dg%10==0&&console.warn(`[Shiki] ${dg} 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 um("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(ag),i=new lg(new ug(e.engine,n),r,n,e.langAlias),a;function o(t){return cg(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new um(`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 um(`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 og(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await sg(e))}function g(){if(t)throw new um(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--dg)}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 pg(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([sg(e.themes||[]),og(e.langs||[]),e.engine]);return fg({...e,themes:t,langs:n,engine:r})}var mg=new WeakMap;function hg(e,t){mg.set(e,t)}function gg(e){return mg.get(e)}var _g=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(Jh(n).map(e=>[e,Gh])),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 vg(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function vg(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 yg(e,t){if(!(e instanceof _g))throw new um(`Invalid grammar state`);return e.getInternalStack(t)}var bg=/,/,xg=/ /;function Sg(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(Xh(e.resolveLangAlias(n.lang||`text`))||Qh(r))return tg(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new um(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new um(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return wg(t,o,i,a,n)}function Cg(...e){if(e.length===2)return gg(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(Xh(i)||Qh(a))throw new um(`Plain language does not have grammar state`);if(i===`ansi`)throw new um(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new _g(Tg(n,c,o,s,r).stateStack,c.name,o.name)}function wg(e,t,n,r,i){let a=Tg(e,t,n,r,i),o=new _g(a.stateStack,t.name,n.name);return hg(a.tokens,o),a.tokens}function Tg(e,t,n,r,i){let a=Kh(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=tg(e),u=i.grammarState?yg(i.grammarState,n.name)??Gh:i.grammarContextCode==null?Gh:Tg(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=qh(r[Lm.getForeground(s)],a),u=Lm.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=Lm.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(bg).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(xg))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?Eg(t.scopes):Dg(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function Eg(e){return e.map(e=>({scopeName:e}))}function Dg(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:Ag(e,i,t.slice(0,r))}}return n}function Og(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function kg(e,t,n){if(!Og(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Og(e[r],n[i])&&--r,--i;return r===-1}function Ag(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(kg(e,t,n)){r.push(a);break}return r}function jg(e,t,n,r=Sg){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:gg(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=Mg(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new _g(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&hg(s,c),s}function Mg(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var Ng=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],Pg=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Pg.prototype.normal={},Pg.prototype.property={},Pg.prototype.space=void 0;function Fg(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Pg(n,r,t)}function Ig(e){return e.toLowerCase()}var Lg=class{constructor(e,t){this.attribute=t,this.property=e}};Lg.prototype.attribute=``,Lg.prototype.booleanish=!1,Lg.prototype.boolean=!1,Lg.prototype.commaOrSpaceSeparated=!1,Lg.prototype.commaSeparated=!1,Lg.prototype.defined=!1,Lg.prototype.mustUseProperty=!1,Lg.prototype.number=!1,Lg.prototype.overloadedBoolean=!1,Lg.prototype.property=``,Lg.prototype.spaceSeparated=!1,Lg.prototype.space=void 0;var Rg=s({boolean:()=>Z,booleanish:()=>Bg,commaOrSpaceSeparated:()=>Wg,commaSeparated:()=>Ug,number:()=>Q,overloadedBoolean:()=>Vg,spaceSeparated:()=>Hg}),zg=0,Z=Gg(),Bg=Gg(),Vg=Gg(),Q=Gg(),Hg=Gg(),Ug=Gg(),Wg=Gg();function Gg(){return 2**++zg}var Kg=Object.keys(Rg),qg=class extends Lg{constructor(e,t,n,r){let i=-1;if(super(e,t),Jg(this,`space`,r),typeof n==`number`)for(;++i<Kg.length;){let e=Kg[i];Jg(this,Kg[i],(n&Rg[e])===Rg[e])}}};qg.prototype.defined=!0;function Jg(e,t,n){n&&(e[t]=n)}function Yg(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new qg(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Ig(r)]=r,n[Ig(a.attribute)]=r}return new Pg(t,n,e.space)}var Xg=Yg({properties:{ariaActiveDescendant:null,ariaAtomic:Bg,ariaAutoComplete:null,ariaBusy:Bg,ariaChecked:Bg,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:Hg,ariaCurrent:null,ariaDescribedBy:Hg,ariaDetails:null,ariaDisabled:Bg,ariaDropEffect:Hg,ariaErrorMessage:null,ariaExpanded:Bg,ariaFlowTo:Hg,ariaGrabbed:Bg,ariaHasPopup:null,ariaHidden:Bg,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Hg,ariaLevel:Q,ariaLive:null,ariaModal:Bg,ariaMultiLine:Bg,ariaMultiSelectable:Bg,ariaOrientation:null,ariaOwns:Hg,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:Bg,ariaReadOnly:Bg,ariaRelevant:null,ariaRequired:Bg,ariaRoleDescription:Hg,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:Bg,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Zg(e,t){return t in e?e[t]:t}function Qg(e,t){return Zg(e,t.toLowerCase())}var $g=Yg({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Ug,acceptCharset:Hg,accessKey:Hg,action:null,allow:null,allowFullScreen:Z,allowPaymentRequest:Z,allowUserMedia:Z,alpha:Z,alt:null,as:null,async:Z,autoCapitalize:null,autoComplete:Hg,autoFocus:Z,autoPlay:Z,blocking:Hg,capture:null,charSet:null,checked:Z,cite:null,className:Hg,closedBy:null,colorSpace:null,cols:Q,colSpan:Q,command:null,commandFor:null,content:null,contentEditable:Bg,controls:Z,controlsList:Hg,coords:Q|Ug,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Z,defer:Z,dir:null,dirName:null,disabled:Z,download:Vg,draggable:Bg,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Z,formTarget:null,headers:Hg,height:Q,hidden:Vg,high:Q,href:null,hrefLang:null,htmlFor:Hg,httpEquiv:Hg,id:null,imageSizes:null,imageSrcSet:null,inert:Z,inputMode:null,integrity:null,is:null,isMap:Z,itemId:null,itemProp:Hg,itemRef:Hg,itemScope:Z,itemType:Hg,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Z,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:Z,muted:Z,name:null,nonce:null,noModule:Z,noValidate:Z,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Z,optimum:Q,pattern:null,ping:Hg,placeholder:null,playsInline:Z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Z,referrerPolicy:null,rel:Hg,required:Z,reversed:Z,rows:Q,rowSpan:Q,sandbox:Hg,scope:null,scoped:Z,seamless:Z,selected:Z,shadowRootClonable:Z,shadowRootCustomElementRegistry:Z,shadowRootDelegatesFocus:Z,shadowRootMode:null,shadowRootSerializable:Z,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:Bg,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:Z,useMap:null,value:Bg,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Hg,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Z,declare:Z,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:Z,noHref:Z,noShade:Z,noWrap:Z,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:Bg,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Z,disablePictureInPicture:Z,disableRemotePlayback:Z,exportParts:Ug,part:Hg,prefix:null,property:null,results:Q,security:null,unselectable:null},space:`html`,transform:Qg}),e_=Yg({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Wg,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:Hg,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:Z,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ug,g2:Ug,glyphName:Ug,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:Wg,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Hg,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Wg,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Wg,rev:Wg,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Wg,requiredFeatures:Wg,requiredFonts:Wg,requiredFormats:Wg,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:Wg,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Wg,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Wg,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Zg}),t_=Yg({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),n_=Yg({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Qg}),r_=Yg({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),i_=/[A-Z]/g,a_=/-[a-z]/g,o_=/^data[-\w.:]+$/i;function s_(e,t){let n=Ig(t),r=t,i=Lg;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&o_.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(a_,l_);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!a_.test(e)){let n=e.replace(i_,c_);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=qg}return new i(r,t)}function c_(e){return`-`+e.toLowerCase()}function l_(e){return e.charAt(1).toUpperCase()}var u_=Fg([Xg,$g,t_,n_,r_],`html`),d_=Fg([Xg,e_,t_,n_,r_],`svg`),f_={}.hasOwnProperty;function p_(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&f_.call(t,e)){let n=String(t[e]);i=f_.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var m_=/["&'<>`]/g,h_=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,g_=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,__=/[|\\{}()[\]^$+*?.]/g,v_=new WeakMap;function y_(e,t){return e=e.replace(t.subset?b_(t.subset):m_,r),t.subset||t.escapeOnly?e:e.replace(h_,n).replace(g_,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function b_(e){let t=v_.get(e);return t||(t=x_(e),v_.set(e,t)),t}function x_(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(__,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var S_=/[\dA-Fa-f]/;function C_(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!S_.test(String.fromCharCode(t))?r:r+`;`}var w_=/\d/;function T_(e,t,n){let r=`&#`+String(e);return n&&t&&!w_.test(String.fromCharCode(t))?r:r+`;`}var E_=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),D_={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},O_=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],k_={}.hasOwnProperty,A_={},j_;for(j_ in D_)k_.call(D_,j_)&&(A_[D_[j_]]=j_);var M_=/[^\dA-Za-z]/;function N_(e,t,n,r){let i=String.fromCharCode(e);if(k_.call(A_,i)){let e=A_[i],a=`&`+e;return n&&E_.includes(e)&&!O_.includes(e)&&(!r||t&&t!==61&&M_.test(String.fromCharCode(t)))?a:a+`;`}return``}function P_(e,t,n){let r=C_(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=N_(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=T_(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function F_(e,t){return y_(e,Object.assign({format:P_},t))}var I_=/^>|^->|<!--|-->|--!>|<!-$/g,L_=[`>`],R_=[`<`,`>`];function z_(e,t,n,r){return r.settings.bogusComments?`<?`+F_(e.value,Object.assign({},r.settings.characterReferences,{subset:L_}))+`>`:`<!--`+e.value.replace(I_,i)+`-->`;function i(e){return F_(e,Object.assign({},r.settings.characterReferences,{subset:R_}))}}function B_(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function V_(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function H_(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function U_(e){return e.join(` `).trim()}var W_=/[ \t\n\f\r]/g;function G_(e){return typeof e==`object`?e.type===`text`&&K_(e.value):K_(e)}function K_(e){return e.replace(W_,``)===``}var q_=X_(1),J_=X_(-1),Y_=[];function X_(e){return t;function t(t,n,r){let i=t?t.children:Y_,a=(n||0)+e,o=i[a];if(!r)for(;o&&G_(o);)a+=e,o=i[a];return o}}var Z_={}.hasOwnProperty;function Q_(e){return t;function t(t,n,r){return Z_.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var $_=Q_({body:nv,caption:ev,colgroup:ev,dd:ov,dt:av,head:ev,html:tv,li:iv,optgroup:cv,option:lv,p:rv,rp:sv,rt:sv,tbody:dv,td:mv,tfoot:fv,th:mv,thead:uv,tr:pv});function ev(e,t,n){let r=q_(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&G_(r.value.charAt(0)))}function tv(e,t,n){let r=q_(n,t);return!r||r.type!==`comment`}function nv(e,t,n){let r=q_(n,t);return!r||r.type!==`comment`}function rv(e,t,n){let r=q_(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function iv(e,t,n){let r=q_(n,t);return!r||r.type===`element`&&r.tagName===`li`}function av(e,t,n){let r=q_(n,t);return!(!r||r.type!==`element`||r.tagName!==`dt`&&r.tagName!==`dd`)}function ov(e,t,n){let r=q_(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function sv(e,t,n){let r=q_(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function cv(e,t,n){let r=q_(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function lv(e,t,n){let r=q_(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function uv(e,t,n){let r=q_(n,t);return!(!r||r.type!==`element`||r.tagName!==`tbody`&&r.tagName!==`tfoot`)}function dv(e,t,n){let r=q_(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function fv(e,t,n){return!q_(n,t)}function pv(e,t,n){let r=q_(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function mv(e,t,n){let r=q_(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var hv=Q_({body:vv,colgroup:yv,head:_v,html:gv,tbody:bv});function gv(e){let t=q_(e,-1);return!t||t.type!==`comment`}function _v(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function vv(e){let t=q_(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&G_(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function yv(e,t,n){let r=J_(n,t),i=q_(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&$_(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function bv(e,t,n){let r=J_(n,t),i=q_(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&$_(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var xv={name:[[`
66
+ `)&&t.pop(),t}function hl(e,t,n=`-`){return e===t?`${e}`:`${e}${n}${t}`}function gl(e){return e.line===null?e.path:`${e.path}:${e.line}`}function _l(e,t){let n=e.findings.flatMap(e=>e.location?.path===t?[{finding:e,startLine:e.location.startLine,endLine:e.location.endLine}]:[]);return n.sort((e,t)=>e.startLine-t.startLine||e.endLine-t.endLine),n.map((e,t)=>({...e,number:t+1}))}function vl(e){let t=new Set;for(let n of e.hunks)for(let e of n.lines)e.newNo!==null&&t.add(e.newNo);return t}function yl(e,t,n){for(let r=t;r<=n;r++)if(e.has(r))return r;return null}var bl={off:{icon:`eye-off`,label:`Sans correctif`,description:`Le diff seul`},"before-after":{icon:`git-compare`,label:`Avant / après`,description:`Lignes visées barrées, correctif dessous`},applied:{icon:`wand-sparkles`,label:`Code corrigé`,description:`Correctif à la place des lignes visées`}},xl={diff:{icon:`diff`,label:`Unifié`,description:`Lignes supprimées au-dessus des lignes ajoutées`},split:{icon:`columns-2`,label:`Côte à côte`,description:`Ancien code à gauche, nouveau à droite`},new:{icon:`file-code`,label:`Nouveau code`,description:`Le nouveau code seul, ajouts marqués d'un filet`}},Sl={changes:{icon:`fold-vertical`,label:`Modifications`,description:`Les blocs du diff et leurs lignes de contexte`},file:{icon:`unfold-vertical`,label:`Fichier entier`,description:`Tout le fichier, lignes inchangées comprises`}};function Cl(e,t,n){return e.hunks.some(e=>{let r=e.lines.flatMap(e=>e.newNo===null?[]:[e.newNo]);return r.includes(t)&&r.includes(n)})}function wl(e,t,n,r){let i=new Map,a=[];for(let o of e){let{finding:e}=o;if(e.suggestion===null)i.set(e.id,{state:`none`});else if(!Cl(t,o.startLine,o.endLine))i.set(e.id,{state:`outside`});else if(r===`off`||!n(e))i.set(e.id,{state:`hidden`});else{let t=a.find(e=>e.startLine<=o.endLine&&o.startLine<=e.endLine);t?i.set(e.id,{state:`blocked`,blockedBy:t.number}):(a.push(o),i.set(e.id,{state:`shown`}))}}return i}function Tl(e){return e.kind===`line`?Bl(e.line):Hl(e.entry.finding.id)}function El(e){return e.kind===`line`?e.line:e.entry.startLine-.5}function Dl(e,t){return e===null||t===null?!1:e.kind===`line`?t.kind===`line`&&e.line===t.line:t.kind===`fix`&&e.entry.finding.id===t.entry.finding.id}function Ol(e,t,n){let r=new Map;if(n!==`applied`)return r;for(let n of e)if(t.get(n.finding.id)?.state===`shown`)for(let e=n.startLine;e<=n.endLine;e++)r.set(e,n);return r}function kl(e,t){let n=t.get(e);return n?{kind:`fix`,entry:n}:{kind:`line`,line:e}}function Al(e,t,n,r){if(t.get(e.finding.id)?.state===`shown`)return{kind:`fix`,entry:e};for(let t=e.startLine;t<=e.endLine;t++)if(n.has(t)&&!r.has(t))return{kind:`line`,line:t};let i=yl(n,e.startLine,e.endLine);return i===null?null:kl(i,r)}function jl(e){return{severity:e.severity,muted:e.status!==`open`}}function Ml(e,t){let n=null;for(let{finding:r,startLine:i,endLine:a}of e)t<i||t>a||(n===null||r.status===`open`&&n.status!==`open`||r.status===`open`==(n.status===`open`)&&fl(r.severity,n.severity)<0)&&(n=r);return n?jl(n):null}function Nl(e){return ml(e.finding.suggestion??``).map((t,n)=>({kind:`fix-line`,text:t,index:n,entry:e,bar:jl(e.finding)}))}function Pl(e,t){return e.explanations.filter(e=>e.location.path===t).sort((e,t)=>e.location.startLine-t.location.startLine||(e.location.side===t.location.side?0:e.location.side===`old`?-1:1)||e.location.endLine-t.location.endLine)}function Fl(e,t){let{side:n,startLine:r,endLine:i}=e.location,a=n===`new`?t.newNo:t.type===`add`?null:t.oldNo;return a!==null&&a>=r&&a<=i}function Il(e,t,n,r){for(let i of e.hunks){let e=i.lines.findIndex(e=>Fl(t,e));if(e===-1)continue;let a=i.lines[e];if(a.newNo!==null){let e=kl(a.newNo,n);return{selector:Tl(e),order:El(e)}}let o=i.lines.slice(e).find(e=>e.newNo!==null),s=i.lines.slice(0,e).findLast(e=>e.newNo!==null);if(r===`new`){let e=o??s;if(!e)continue;let t=kl(e.newNo,n);return{selector:Tl(t),order:El(t)+(o?-.25:.25)}}let c=o?o.newNo-.25:s?s.newNo+.25:i.newStart;return{selector:Vl(a.oldNo),order:c}}return null}function Ll(e,t,n,r,i,a){let o=vl(e),s=Ol(t,n,r),c=t.filter(e=>n.get(e.finding.id)?.state===`shown`),l=new Map,u=new Map;for(let e of t){if(n.get(e.finding.id)?.state===`shown`)continue;let t=Al(e,n,o,s);if(t?.kind===`line`&&l.set(t.line,[...l.get(t.line)??[],e]),t?.kind===`fix`){let n=t.entry.finding.id;u.set(n,[...u.get(n)??[],e])}}let d=e=>({kind:`fix-strip`,entry:e,bar:jl(e.finding),pills:u.get(e.finding.id)??[]});return e.hunks.map(e=>{let n=[],o=pe(e.lines),s=le(o);for(let{line:e,oldLine:u}of o){if(a===`new`&&e.type===`del`)continue;let o=e.newNo,f=o===null?void 0:c.find(e=>o>=e.startLine&&o<=e.endLine);if(r===`applied`&&f){f.startLine===o&&n.push(d(f),...Nl(f));continue}f&&f.startLine===o&&n.push(d(f)),n.push({kind:`line`,line:e,oldLine:u,inline:s.get(e)??null,replaced:f!==void 0&&e.type!==`del`,explained:i.some(t=>Fl(t,e)||u!==null&&Fl(t,u)),bar:f?jl(f.finding):o===null?null:Ml(t,o),pills:o===null?[]:l.get(o)??[]}),f&&f.endLine===o&&n.push(...Nl(f))}return{hunk:e,rows:n}})}function Rl(e,t){return e?.kind===`line`&&e.oldLine===null&&e.line.type===t}function zl(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r.kind===`fix-strip`)t.push({kind:`full`,row:r}),n++;else if(r.kind===`line`&&r.oldLine!==null)t.push({kind:`pair`,left:r,right:r}),n++;else if(r.kind===`fix-line`||Rl(r,`add`))t.push({kind:`pair`,left:null,right:r}),n++;else if(Rl(r,`context`))t.push({kind:`pair`,left:r,right:r}),n++;else{let r=[],i=[];for(let t=e[n];Rl(t,`del`);t=e[++n])r.push(t);for(let t=e[n];Rl(t,`add`);t=e[++n])i.push(t);for(let e=0;e<Math.max(r.length,i.length);e++)t.push({kind:`pair`,left:r[e]??null,right:i[e]??null})}}return t}function Bl(e){return`[data-line="${e}"]`}function Vl(e){return`[data-old-line="${e}"]`}function Hl(e){return`[data-fix="${e}"]`}function Ul(e,t){return e.notes.filter(e=>e.location?.path===t&&e.location.line!==null).sort((e,t)=>e.location.line-t.location.line)}function Wl(e){if(e.kind===`fix-line`)return{kind:null,added:[],deleted:[],newNo:null,strip:null};let{line:t}=e,n=e.oldLine===null?t.type===`context`?null:t.type:`reindent`;return{kind:n,added:n===`add`||n===`reindent`?[t.newNo]:[],deleted:n===`del`?[t.oldNo]:[],newNo:t.newNo,strip:null}}function Gl(e){return{kind:null,added:[],deleted:[],newNo:null,strip:e}}function Kl(e,t){return e.flatMap(e=>t===`split`?zl(e.rows).map(e=>{if(e.kind===`full`)return Gl(e.row.entry);let t=e.left?Wl(e.left):null,n=e.right?Wl(e.right):null;if(n?.kind===`reindent`)return n;let r=n?.kind===`add`?n.added:[],i=t?.kind===`del`?t.deleted:[];return{kind:r.length>0?i.length>0?`mod`:`add`:i.length>0?`del`:null,added:r,deleted:i,newNo:n?.newNo??null,strip:null}}):e.rows.map(e=>e.kind===`fix-strip`?Gl(e.entry):Wl(e)))}function ql(e,t){return`${e} ligne${e>1?`s`:``} ${t}${e>1?`s`:``}`}function Jl(e){let t=Math.min(...e),n=Math.max(...e);return t===n?`ligne ${t}`:`lignes ${t} à ${n}`}function Yl(e,t,n){switch(e){case`add`:return`${ql(t.length,`ajoutée`)} · ${Jl(t)}`;case`del`:return`${ql(n.length,`supprimée`)} · ancienne ${Jl(n)}`;case`mod`:return`${ql(n.length,`supprimée`)}, ${t.length} ajoutée${t.length>1?`s`:``} · ${Jl(t)}`;case`reindent`:return`Indentation modifiée · ${Jl(t)}`}}function Xl(e,t,n,r){let i=Kl(e,t),a=[];for(let e=0;e<i.length;){let t=i[e].kind,n=e+1;for(;n<i.length&&i[n].kind===t;)n++;if(t!==null){let r=i.slice(e,n);a.push({kind:t,start:e,end:n,label:Yl(t,r.flatMap(e=>e.added),r.flatMap(e=>e.deleted))})}e=n}let o=[];for(let e of n){let t=i.findIndex(t=>t.strip?.finding.id===e.finding.id||t.newNo!==null&&t.newNo>=e.startLine&&t.newNo<=e.endLine);t!==-1&&o.push({kind:`finding`,entry:e,row:t})}for(let e of r){let t=i.findIndex(t=>t.newNo===e);t!==-1&&o.push({kind:`note`,line:e,row:t})}return{changes:a,dots:o}}function Zl(e,t){return e===t?`la ligne ${e}`:`les lignes ${e} à ${t}`}var Ql=`feature-analyzer.`;function $l(e,t,n){try{let r=window.localStorage.getItem(Ql+e);return r!==null&&Object.hasOwn(t,r)?r:n}catch{return n}}function eu(e,t){try{window.localStorage.setItem(Ql+e,t)}catch{}}var tu=5e3,nu=0,ru,iu=null,au=`L'analyse a été modifiée entre-temps (par l'agent ou un autre onglet) : elle vient d'être rechargée. Vérifiez l'état affiché puis refaites votre action.`,B=w((e,t)=>{async function n(n,r){let i=t().current?.analysis;if(!i)return!1;e({saving:!0});try{let n=await r(i);return t().current?.id===n.analysis.id&&e({current:{id:n.analysis.id,analysis:n.analysis,error:null}}),!0}catch(e){return e instanceof te&&e.status===409?(await t().reloadCurrent(),t().notify(`info`,au)):t().notify(`error`,`${n} : ${e.message}`),!1}finally{e({saving:!1})}}return{config:null,analyses:null,unreadable:[],listError:null,current:null,diff:null,diffError:null,saving:!1,notice:null,homeFilter:`to_review`,collapsedProjects:new Set,fixMode:$l(`fix-mode`,bl,`before-after`),codeView:$l(`code-view`,xl,`diff`),diffScope:$l(`diff-scope`,Sl,`changes`),gapsCollapsed:!1,filesPanelCollapsed:!1,findingsShown:!0,explanationsShown:!0,setHomeFilter:t=>e({homeFilter:t}),toggleProject:n=>{let r=new Set(t().collapsedProjects);r.has(n)?r.delete(n):r.add(n),e({collapsedProjects:r})},setFixMode:t=>{eu(`fix-mode`,t),e({fixMode:t})},setCodeView:t=>{eu(`code-view`,t),e({codeView:t})},setDiffScope:t=>{eu(`diff-scope`,t),e({diffScope:t})},setGapsCollapsed:t=>e({gapsCollapsed:t}),setFilesPanelCollapsed:t=>e({filesPanelCollapsed:t}),setFindingsShown:t=>e({findingsShown:t}),setExplanationsShown:t=>e({explanationsShown:t}),loadConfig:async()=>{try{e({config:await O.getConfig()})}catch(e){t().notify(`error`,`Configuration illisible : ${e.message}`)}},setListing:t=>e({analyses:t.analyses,unreadable:t.unreadable,listError:null}),loadAnalyses:async()=>{try{t().setListing(await O.listAnalyses())}catch(t){e({listError:`Liste des analyses illisible : ${t.message}`})}},openAnalysis:n=>{t().current?.id!==n&&(e({current:{id:n,analysis:null,error:null}}),t().reloadCurrent())},reloadCurrent:async()=>{let n=t().current?.id;if(n)try{let{analysis:r}=await O.getAnalysis(n);if(t().current?.id!==n)return;e({current:{id:n,analysis:r,error:null}}),await t().ensureDiff()}catch(r){if(t().current?.id!==n)return;e({current:{id:n,analysis:null,error:r.message}})}},ensureDiff:async()=>{let n=t().current?.analysis;if(!n)return;let r=t().diff;if(r&&r.id===n.id&&r.snapshotAt===n.snapshotAt)return;let i=`${n.id}@${n.snapshotAt}`;if(iu?.key===i)return iu.promise;let a=(async()=>{try{let{diff:r}=await O.getDiff(n.id);if(t().current?.analysis?.id!==n.id)return;e({diff:{id:n.id,snapshotAt:n.snapshotAt,snapshot:r},diffError:null})}catch(t){e({diffError:`Diff illisible : ${t.message}`})}finally{iu?.key===i&&(iu=null)}})();return iu={key:i,promise:a},a},setFileReviewed:(e,t)=>n(`Marquage du fichier impossible`,n=>O.setFileReviewed(n.id,{path:e,reviewed:t,baseRevision:n.revision})),setFindingStatus:(e,t)=>n(`Changement de statut impossible`,n=>O.setFindingStatus(n.id,e,{status:t,baseRevision:n.revision})),addNote:(e,t,r,i)=>n(`Remarque non enregistrée`,n=>O.addNote(n.id,{path:e,line:t,findingId:i,text:r,baseRevision:n.revision})),updateNote:(e,t)=>n(`Remarque non modifiée`,n=>O.updateNote(n.id,e,{text:t,baseRevision:n.revision})),deleteNote:e=>n(`Suppression impossible`,t=>O.deleteNote(t.id,e,{baseRevision:t.revision})),submitReview:(e,t,r)=>n(`Retour non enregistré`,n=>O.submitReview(n.id,{decision:e,findingIds:t,noteIds:r,baseRevision:n.revision})),copy:async(e,n)=>{try{await k(e),t().notify(`info`,n)}catch(e){t().notify(`error`,`Copie impossible : ${e.message}`)}},notify:(t,n)=>{clearTimeout(ru),e({notice:{id:++nu,kind:t,text:n}}),ru=setTimeout(()=>e({notice:null}),tu)},dismissNotice:()=>{clearTimeout(ru),e({notice:null})}}}),ou=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),V=o(((e,t)=>{t.exports=ou()}))(),su={"scan-search":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`}),(0,V.jsx)(`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`}),(0,V.jsx)(`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`}),(0,V.jsx)(`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`}),(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,V.jsx)(`path`,{d:`m16 16-1.9-1.9`})]}),"git-branch":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`}),(0,V.jsx)(`circle`,{cx:`18`,cy:`6`,r:`3`}),(0,V.jsx)(`circle`,{cx:`6`,cy:`18`,r:`3`}),(0,V.jsx)(`path`,{d:`M18 9a9 9 0 0 1-9 9`})]}),"chevron-down":(0,V.jsx)(`path`,{d:`m6 9 6 6 6-6`}),"chevron-right":(0,V.jsx)(`path`,{d:`m9 18 6-6-6-6`}),"arrow-left":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`m12 19-7-7 7-7`}),(0,V.jsx)(`path`,{d:`M19 12H5`})]}),"arrow-right":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M5 12h14`}),(0,V.jsx)(`path`,{d:`m12 5 7 7-7 7`})]}),sparkles:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`}),(0,V.jsx)(`path`,{d:`M20 3v4`}),(0,V.jsx)(`path`,{d:`M22 5h-4`}),(0,V.jsx)(`path`,{d:`M4 17v2`}),(0,V.jsx)(`path`,{d:`M5 18H3`})]}),bot:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M12 8V4H8`}),(0,V.jsx)(`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`}),(0,V.jsx)(`path`,{d:`M2 14h2`}),(0,V.jsx)(`path`,{d:`M20 14h2`}),(0,V.jsx)(`path`,{d:`M15 13v2`}),(0,V.jsx)(`path`,{d:`M9 13v2`})]}),circle:(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),"circle-check":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,V.jsx)(`path`,{d:`m9 12 2 2 4-4`})]}),"circle-dot":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1`})]}),"circle-x":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,V.jsx)(`path`,{d:`m15 9-6 6`}),(0,V.jsx)(`path`,{d:`m9 9 6 6`})]}),square:(0,V.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),"square-check":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,V.jsx)(`path`,{d:`m9 12 2 2 4-4`})]}),check:(0,V.jsx)(`path`,{d:`M20 6 9 17l-5-5`}),pencil:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`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`}),(0,V.jsx)(`path`,{d:`m15 5 4 4`})]}),copy:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}),(0,V.jsx)(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})]}),info:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,V.jsx)(`path`,{d:`M12 16v-4`}),(0,V.jsx)(`path`,{d:`M12 8h.01`})]}),save:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`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`}),(0,V.jsx)(`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`}),(0,V.jsx)(`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`})]}),"message-square":(0,V.jsx)(`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`}),trash:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M3 6h18`}),(0,V.jsx)(`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`}),(0,V.jsx)(`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2`})]}),"triangle-alert":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`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`}),(0,V.jsx)(`path`,{d:`M12 9v4`}),(0,V.jsx)(`path`,{d:`M12 17h.01`})]}),network:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`}),(0,V.jsx)(`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`}),(0,V.jsx)(`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`}),(0,V.jsx)(`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`}),(0,V.jsx)(`path`,{d:`M12 12V8`})]}),workflow:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`}),(0,V.jsx)(`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`}),(0,V.jsx)(`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`})]}),"brain-circuit":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`}),(0,V.jsx)(`path`,{d:`M9 13a4.5 4.5 0 0 0 3-4`}),(0,V.jsx)(`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`}),(0,V.jsx)(`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`}),(0,V.jsx)(`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`}),(0,V.jsx)(`path`,{d:`M12 13h4`}),(0,V.jsx)(`path`,{d:`M12 18h6a2 2 0 0 1 2 2v1`}),(0,V.jsx)(`path`,{d:`M12 8h8`}),(0,V.jsx)(`path`,{d:`M16 8V5a2 2 0 0 1 2-2`}),(0,V.jsx)(`circle`,{cx:`16`,cy:`13`,r:`.5`}),(0,V.jsx)(`circle`,{cx:`18`,cy:`3`,r:`.5`}),(0,V.jsx)(`circle`,{cx:`20`,cy:`21`,r:`.5`}),(0,V.jsx)(`circle`,{cx:`20`,cy:`8`,r:`.5`})]}),"file-code":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`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`}),(0,V.jsx)(`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}),(0,V.jsx)(`path`,{d:`M10 12.5 8 15l2 2.5`}),(0,V.jsx)(`path`,{d:`m14 12.5 2 2.5-2 2.5`})]}),"flask-conical":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`}),(0,V.jsx)(`path`,{d:`M6.453 15h11.094`}),(0,V.jsx)(`path`,{d:`M8.5 2h7`})]}),minus:(0,V.jsx)(`path`,{d:`M5 12h14`}),plus:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M5 12h14`}),(0,V.jsx)(`path`,{d:`M12 5v14`})]}),maximize:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`}),(0,V.jsx)(`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`}),(0,V.jsx)(`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`}),(0,V.jsx)(`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`})]}),minimize:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M8 3v3a2 2 0 0 1-2 2H3`}),(0,V.jsx)(`path`,{d:`M21 8h-3a2 2 0 0 1-2-2V3`}),(0,V.jsx)(`path`,{d:`M3 16h3a2 2 0 0 1 2 2v3`}),(0,V.jsx)(`path`,{d:`M16 21v-3a2 2 0 0 1 2-2h3`})]}),focus:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,V.jsx)(`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`}),(0,V.jsx)(`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`}),(0,V.jsx)(`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`}),(0,V.jsx)(`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`})]}),"eye-off":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`}),(0,V.jsx)(`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`}),(0,V.jsx)(`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`}),(0,V.jsx)(`path`,{d:`m2 2 20 20`})]}),"rotate-ccw":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,V.jsx)(`path`,{d:`M3 3v5h5`})]}),"panel-left-close":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,V.jsx)(`path`,{d:`M9 3v18`}),(0,V.jsx)(`path`,{d:`m16 15-3-3 3-3`})]}),"panel-left-open":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,V.jsx)(`path`,{d:`M9 3v18`}),(0,V.jsx)(`path`,{d:`m14 9 3 3-3 3`})]}),folder:(0,V.jsx)(`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}),eye:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`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`}),(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`})]}),"clipboard-check":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`}),(0,V.jsx)(`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`}),(0,V.jsx)(`path`,{d:`m9 14 2 2 4-4`})]}),hourglass:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M5 22h14`}),(0,V.jsx)(`path`,{d:`M5 2h14`}),(0,V.jsx)(`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`}),(0,V.jsx)(`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`})]}),list:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M3 12h.01`}),(0,V.jsx)(`path`,{d:`M3 18h.01`}),(0,V.jsx)(`path`,{d:`M3 6h.01`}),(0,V.jsx)(`path`,{d:`M8 12h13`}),(0,V.jsx)(`path`,{d:`M8 18h13`}),(0,V.jsx)(`path`,{d:`M8 6h13`})]}),"corner-down-right":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`m15 10 5 5-5 5`}),(0,V.jsx)(`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`})]}),move:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M12 2v20`}),(0,V.jsx)(`path`,{d:`m15 19-3 3-3-3`}),(0,V.jsx)(`path`,{d:`m19 9 3 3-3 3`}),(0,V.jsx)(`path`,{d:`M2 12h20`}),(0,V.jsx)(`path`,{d:`m5 9-3 3 3 3`}),(0,V.jsx)(`path`,{d:`m9 5 3-3 3 3`})]}),"chevron-up":(0,V.jsx)(`path`,{d:`m18 15-6-6-6 6`}),"fold-vertical":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M12 22v-6`}),(0,V.jsx)(`path`,{d:`M12 8V2`}),(0,V.jsx)(`path`,{d:`M4 12H2`}),(0,V.jsx)(`path`,{d:`M10 12H8`}),(0,V.jsx)(`path`,{d:`M16 12h-2`}),(0,V.jsx)(`path`,{d:`M22 12h-2`}),(0,V.jsx)(`path`,{d:`m15 19-3-3-3 3`}),(0,V.jsx)(`path`,{d:`m15 5-3 3-3-3`})]}),"unfold-vertical":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M12 22v-6`}),(0,V.jsx)(`path`,{d:`M12 8V2`}),(0,V.jsx)(`path`,{d:`M4 12H2`}),(0,V.jsx)(`path`,{d:`M10 12H8`}),(0,V.jsx)(`path`,{d:`M16 12h-2`}),(0,V.jsx)(`path`,{d:`M22 12h-2`}),(0,V.jsx)(`path`,{d:`m15 19-3 3-3-3`}),(0,V.jsx)(`path`,{d:`m15 5-3-3-3 3`})]}),diff:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`M12 3v14`}),(0,V.jsx)(`path`,{d:`M5 10h14`}),(0,V.jsx)(`path`,{d:`M5 21h14`})]}),"columns-2":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,V.jsx)(`path`,{d:`M12 3v18`})]}),"git-compare":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`circle`,{cx:`18`,cy:`18`,r:`3`}),(0,V.jsx)(`circle`,{cx:`6`,cy:`6`,r:`3`}),(0,V.jsx)(`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`}),(0,V.jsx)(`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`})]}),"wand-sparkles":(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`}),(0,V.jsx)(`path`,{d:`m14 7 3 3`}),(0,V.jsx)(`path`,{d:`M5 6v4`}),(0,V.jsx)(`path`,{d:`M19 14v4`}),(0,V.jsx)(`path`,{d:`M10 2v2`}),(0,V.jsx)(`path`,{d:`M7 8H3`}),(0,V.jsx)(`path`,{d:`M21 16h-4`}),(0,V.jsx)(`path`,{d:`M11 3H9`})]})};function H({name:e,size:t=14,color:n,className:r}){return(0,V.jsx)(`svg`,{className:r,width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,stroke:n??`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:su[e]})}function cu(){let e=B(e=>e.notice),t=B(e=>e.dismissNotice);return e?(0,V.jsxs)(`div`,{className:`notice notice-${e.kind}`,role:e.kind===`error`?`alert`:`status`,children:[(0,V.jsx)(H,{name:e.kind===`error`?`triangle-alert`:`info`}),(0,V.jsx)(`span`,{className:`notice-text`,children:e.text}),(0,V.jsx)(`button`,{type:`button`,className:`notice-close`,onClick:t,"aria-label":`Fermer le message`,children:(0,V.jsx)(H,{name:`circle-x`})})]},e.id):null}var lu={critical:{label:`Critique`,color:`#f0625a`,background:`#34191c`},major:{label:`Majeur`,color:`#e3a33b`,background:`#33270f`},minor:{label:`Mineur`,color:`#6fb3ff`,background:`#13243a`},trivial:{label:`Détail`,color:`#9aa1b1`,background:`#1c2029`}},uu={label:`Remarque`,color:`#c4a8ff`,background:`#241d3a`},du={open:`Ouvert`,ignored:`Ignoré`,outdated:`Obsolète`},fu={issue:`Problème`,requirement_gap:`Exigence manquante`},pu={added:`Ajouté`,modified:`Modifié`,deleted:`Supprimé`,renamed:`Renommé`,untracked:`Non suivi`},mu={added:`A`,modified:`M`,deleted:`D`,renamed:`R`,untracked:`U`},hu={branch:`Branche`,working_tree:`Copie de travail`},gu={approve:`Approuver`,request_changes:`Demander des corrections`,reject:`Rejeter`},_u={not_started:{label:`Non commencée`,color:`#9aa1b1`,background:`#1c2029`},in_progress:{label:`En cours`,color:`#6fb3ff`,background:`#13243a`},files_reviewed:{label:`Fichiers revus`,color:`#8b97ff`,background:`#1b1f3d`},submitted:{label:`Soumise`,color:`#3fb950`,background:`#11201a`}},vu={label:`Traitée`,color:`#5fd4c4`,background:`#10272a`},yu={approve:{label:`Approuvée`,color:`#3fb950`,background:`#11201a`},request_changes:{label:`Corrections demandées`,color:`#e3a33b`,background:`#33270f`},reject:{label:`Rejetée`,color:`#f0625a`,background:`#34191c`}},bu={new:{label:`Nouveau`,fill:`#11201a`,stroke:`#2c6b3a`,text:`#bfeccd`,accent:`#3fb950`},modified:{label:`Modifié`,fill:`#151a2b`,stroke:`#36407a`,text:`#d5daff`,accent:`#8b97ff`},impacted:{label:`Impacté, non modifié`,fill:`#13161f`,stroke:`#2a2f3d`,text:`#7b8396`,accent:`#646b7b`},existing:{label:`Existant`,fill:`#13161f`,stroke:`#2a2f3d`,text:`#9aa1b1`,accent:`#646b7b`},finding:{label:`Constat`,fill:`#221416`,stroke:`#6b2a2d`,text:`#f0a09a`,accent:`#f0625a`},missing:{label:`Attendu, absent`,fill:null,stroke:`#6b2a2d`,text:`#f0776f`,accent:`#b0605b`}};function xu(e){let t=e.lastIndexOf(`/`);return t===-1?{folder:``,name:e}:{folder:e.slice(0,t+1),name:e.slice(t+1)}}function Su(e,t=Date.now()){let n=Math.max(0,Math.round((t-Date.parse(e))/1e3));if(n<60)return`à l'instant`;let r=Math.round(n/60);if(r<60)return`il y a ${r} min`;let i=Math.round(r/60);return i<24?`il y a ${i} h`:`il y a ${Math.round(i/24)} j`}function Cu(e){let t=new Date(e);return`${t.toLocaleDateString(`fr-FR`)} à ${t.toLocaleTimeString(`fr-FR`,{hour:`2-digit`,minute:`2-digit`})}`}function wu(e){return`Traitée par l'agent le ${Cu(e.at)}${e.note===null?``:` — ${e.note}`}`}function Tu(e,t=new Date){let n=new Date(e),r=n.toLocaleTimeString(`fr-FR`,{hour:`2-digit`,minute:`2-digit`});return n.toDateString()===t.toDateString()?r:n.getFullYear()===t.getFullYear()?`${n.toLocaleDateString(`fr-FR`,{day:`2-digit`,month:`2-digit`})} ${r}`:n.toLocaleDateString(`fr-FR`)}function Eu(e,t,n=`${t}s`){return`${e} ${e>1?n:t}`}function Du(e,t){return Eu(t,lu[e].label.toLowerCase())}var Ou={critical:[`critique`,`critiques`],major:[`majeur`,`majeurs`],minor:[`mineur`,`mineurs`],trivial:[`de détail`,`de détail`]};function ku(e,t){let[n,r]=Ou[e];return t>1?`${t} constats ${r} ouverts`:`${t} constat ${n} ouvert`}function Au(e,t=4){let n=e.lastIndexOf(`.`),r=n>0?e.length-n:0,i=Math.max(0,e.length-r-t);return{head:e.slice(0,i),tail:e.slice(i)}}function ju(e){return/^[0-9a-f]{40}$/.test(e)?e.slice(0,7):e}function Mu(e){if(e.mode===`working_tree`)return hu.working_tree;if(e.head===null)throw Error(`L'analyse ${e.id} est en mode branche sans ref de tête.`);return ju(e.head)}function Nu(e){return e.mode===`working_tree`?hu.working_tree:`${Mu(e)} → ${ju(e.base)}`}function Pu(e,t){let n=e.location;return n?`${xu(n.path).name}:${hl(n.startLine,n.endLine,`–`)}`:t?.source?`demande ${t.source}`:`exigence manquante`}function Fu(e){if(!e.location)return`analyse entière`;let t=xu(e.location.path).name;return e.location.line===null?t:`${t}:${e.location.line}`}function Iu(e,t){return e===t?`ligne ${e}`:`lignes ${e}–${t}`}function Lu(e){return e.files.reduce((e,t)=>({additions:e.additions+t.additions,deletions:e.deletions+t.deletions}),{additions:0,deletions:0})}var Ru=[`summary`,`files`,`findings`,`diagrams`];function zu(e){try{return decodeURIComponent(e)}catch{return null}}function Bu(e){let t=e.replace(/^#/,``),n=t.indexOf(`?`),r=n===-1?t:t.slice(0,n),i=n===-1?``:t.slice(n+1),a=r.split(`/`).filter(e=>e!==``);if(a.length===0)return{name:`home`};let o=zu(a[0]);if(o===null)return{name:`not_found`,hash:e};let[s,...c]=a.slice(1);if(s===void 0)return{name:`feature`,id:o,tab:`summary`};if(Ru.includes(s)&&c.length===0)return{name:`feature`,id:o,tab:s};if(s===`finish`&&c.length===0)return{name:`finish`,id:o};if(s===`review`&&c.length<=1){let t=c.length===1?zu(c[0]):null;if(c.length===1&&t===null)return{name:`not_found`,hash:e};let n=new URLSearchParams(i).get(`line`);return{name:`review`,id:o,path:t,line:n!==null&&/^[1-9]\d*$/.test(n)?Number(n):null}}return{name:`not_found`,hash:e}}function Vu(e){return`${window.location.pathname}${window.location.search}${e}`}var Hu={home:()=>Vu(`#/`),feature:(e,t=`summary`)=>Vu(t===`summary`?`#/${encodeURIComponent(e)}`:`#/${encodeURIComponent(e)}/${t}`),review:(e,t,n)=>{let r=`#/${encodeURIComponent(e)}/review`;return Vu(t?`${r}/${encodeURIComponent(t)}${n?`?line=${n}`:``}`:r)},finish:e=>Vu(`#/${encodeURIComponent(e)}/finish`)};function Uu(e,t={}){t.replace?window.location.replace(e):window.location.assign(e)}function Wu(e){return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)}function Gu(){return window.location.hash}function Ku(){return Bu((0,v.useSyncExternalStore)(Wu,Gu))}var qu=[`to_review`,`processed`,`to_process`,`approved`,`all`];function Ju(e,t){let{state:n,decision:r,processed:i,toProcess:a}=e.progress;switch(t){case`to_review`:return n!==`submitted`;case`processed`:return n===`submitted`&&i!==null;case`to_process`:return a;case`approved`:return n===`submitted`&&r===`approve`&&i===null;case`all`:return!0}}function Yu(e,t){return e.filter(e=>Ju(e,t))}function Xu(e){return Object.fromEntries(qu.map(t=>[t,Yu(e,t).length]))}function Zu(e){let t=new Map;for(let n of e){let e=t.get(n.project);e?e.push(n):t.set(n.project,[n])}return[...t].map(([e,t])=>({project:e,analyses:t,counts:ul.map(e=>({state:e,count:t.filter(t=>t.progress.state===e).length})).filter(({count:e})=>e>0)}))}function Qu(e){return Mc.map(t=>({severity:t,count:e.openFindings[t]})).filter(({count:e})=>e>0)}function $u(e){let{reviewedFiles:t,totalFiles:n}=e.progress;return n===0?0:t/n*100}function ed({severity:e,fixed:t=!0}){let n=lu[e];return(0,V.jsx)(`span`,{className:`pill${t?` pill-fixed`:``}`,style:{color:n.color,background:n.background},children:n.label})}function td({fixed:e=!0}){return(0,V.jsx)(`span`,{className:`pill${e?` pill-fixed`:``}`,style:{color:uu.color,background:uu.background},children:uu.label})}function nd({status:e}){return e===`open`?null:(0,V.jsx)(`span`,{className:`tag tag-${e}`,children:du[e]})}function U({kind:e}){return e===`requirement_gap`?(0,V.jsx)(`span`,{className:`tag tag-gap`,children:fu[e]}):null}function W({severity:e,count:t,title:n,href:r}){let i=lu[e].color,a=(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`severity-dot-mark`,style:{background:i}}),t]});return r?(0,V.jsx)(`a`,{className:`severity-dot is-link`,href:r,style:{color:i},title:n,"aria-label":n,children:a}):(0,V.jsx)(`span`,{className:`severity-dot`,style:{color:i},title:n,children:a})}function G({style:e,small:t,title:n}){return(0,V.jsx)(`span`,{className:`pill${t?` pill-small`:``}`,style:{color:e.color,background:e.background},title:n,children:e.label})}function K({progress:e,small:t}){return(0,V.jsxs)(`span`,{className:`review-badges`,children:[(0,V.jsx)(G,{style:_u[e.state],small:t}),e.decision&&(0,V.jsx)(G,{style:yu[e.decision],small:t}),e.processed&&(0,V.jsx)(G,{style:vu,small:t,title:wu(e.processed)})]})}function q({currentId:e}){let t=B(e=>e.analyses),n=B(e=>e.unreadable),[r,i]=(0,v.useState)(!1),a=(0,v.useRef)(null);if((0,v.useEffect)(()=>{if(!r)return;let e=e=>{a.current?.contains(e.target)||i(!1)},t=e=>{e.key===`Escape`&&i(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]),!t||t.length===0&&n.length===0)return null;let o=t.find(t=>t.id===e)??null;return(0,V.jsxs)(`div`,{className:`selector`,ref:a,children:[(0,V.jsxs)(`button`,{type:`button`,className:`selector-button`,"aria-haspopup":`listbox`,"aria-expanded":r,title:o?`${o.title} · ${Nu(o)}`:`Choisir une analyse`,onClick:()=>i(!r),children:[(0,V.jsx)(H,{name:`git-branch`,color:`#9aa1b1`}),(0,V.jsx)(`span`,{className:`selector-value`,children:o?o.title:`Choisir une analyse`}),(0,V.jsx)(H,{name:`chevron-down`,size:12,color:`#646b7b`})]}),r&&(0,V.jsxs)(`div`,{className:`selector-menu`,role:`listbox`,children:[Zu(t).map(t=>(0,V.jsxs)(`div`,{className:`selector-group`,role:`group`,"aria-label":`Projet ${t.project}`,children:[(0,V.jsxs)(`div`,{className:`selector-group-title`,children:[(0,V.jsx)(H,{name:`folder`,size:12,color:`#646b7b`}),t.project]}),t.analyses.map(t=>(0,V.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t.id===e,className:`selector-item${t.id===e?` is-current`:``}`,onClick:()=>{i(!1),Uu(Hu.feature(t.id))},children:[(0,V.jsxs)(`span`,{className:`selector-item-head`,children:[(0,V.jsx)(`span`,{className:`selector-item-title`,children:t.title}),(0,V.jsx)(K,{progress:t.progress,small:!0})]}),(0,V.jsxs)(`span`,{className:`selector-item-meta`,children:[(0,V.jsx)(`span`,{className:`mono`,children:Nu(t)}),(0,V.jsxs)(`span`,{children:[`· `,Su(t.updatedAt)]})]})]},t.id))]},t.project)),n.map(e=>(0,V.jsxs)(`div`,{className:`selector-item is-unreadable`,title:e.error,children:[(0,V.jsx)(`span`,{className:`selector-item-title`,children:e.id}),(0,V.jsxs)(`span`,{className:`selector-item-meta`,children:[`Analyse illisible : `,e.error]})]},e.id))]})]})}function rd({currentId:e,action:t}){return(0,V.jsxs)(`header`,{className:`topbar`,children:[(0,V.jsxs)(`a`,{className:`brand`,href:Hu.home(),children:[(0,V.jsx)(`span`,{className:`brand-mark`,children:(0,V.jsx)(H,{name:`scan-search`,color:`#8b97ff`})}),`Feature Analyzer`]}),(0,V.jsx)(q,{currentId:e}),(0,V.jsx)(`div`,{className:`topbar-spacer`}),t]})}var id=`[mcp-feature-analyzer]`,ad=3e3;function od(e){let t=B.getState();switch(e.type){case`ANALYSES_UPDATED`:t.loadAnalyses();return;case`ANALYSIS_UPDATED`:t.current?.id===e.data.analysisId&&t.reloadCurrent();return}}function sd(){(0,v.useEffect)(()=>{let e=null,t,n=!1;async function r(){try{let t=await O.getChanges(e);if(n)return;let r=B.getState();if(t.reset)r.loadConfig(),r.loadAnalyses(),r.reloadCurrent();else for(let e of t.events)od(e);e={epoch:t.epoch,seq:t.seq}}catch(e){console.error(`${id} Polling api/changes failed, retrying in ${ad} ms: ${e.message}`)}n||(t=setTimeout(r,ad))}return r(),()=>{n=!0,clearTimeout(t)}},[])}function cd(e){return(e.files.find(e=>!e.reviewed)??e.files[0])?.path??null}function ld(e,t){return t.location?Hu.review(e.id,t.location.path,t.location.endLine):Hu.review(e.id,e.files[0]?.path??null)}function ud(e,t){return Mc.flatMap(n=>{let r=e.findings.flatMap(e=>e.status===`open`&&e.severity===n&&e.location?.path===t?[e.location.startLine]:[]);return r.length===0?[]:[{severity:n,count:r.length,firstLine:Math.min(...r)}]})}function dd(e){return pl(e.findings.filter(e=>e.location===null))}function fd({analysis:e}){let t=e.files.filter(e=>e.reviewed).length;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`section-head`,children:[(0,V.jsx)(`h2`,{className:`section-title`,children:`Fichiers modifiés`}),(0,V.jsxs)(`span`,{className:`section-meta`,children:[t,` / `,e.files.length,` revus`]})]}),(0,V.jsxs)(`section`,{className:`card list-card`,children:[e.files.length===0&&(0,V.jsx)(`p`,{className:`list-empty`,children:`Le diff ne contient aucun fichier modifié.`}),e.files.map(t=>{let{folder:n,name:r}=xu(t.path);return(0,V.jsxs)(`a`,{className:`file-row`,href:Hu.review(e.id,t.path),children:[(0,V.jsx)(H,{name:t.reviewed?`circle-check`:`circle`,color:t.reviewed?`#3fb950`:`#3a4050`}),(0,V.jsxs)(`span`,{className:`file-row-path mono`,title:t.oldPath?`${t.oldPath} → ${t.path}`:t.path,children:[(0,V.jsx)(`span`,{className:`path-folder`,children:n}),(0,V.jsx)(`span`,{className:t.reviewed?`path-name is-reviewed`:`path-name`,children:r})]}),(0,V.jsx)(`span`,{className:`tag tag-file-${t.status}`,children:pu[t.status]}),t.binary&&(0,V.jsx)(`span`,{className:`tag`,children:`Binaire`}),(0,V.jsx)(`span`,{className:`spacer`}),ud(e,t.path).map(({severity:e,count:t})=>(0,V.jsx)(W,{severity:e,count:t,title:`${ku(e,t)} dans ce fichier`},e)),(0,V.jsxs)(`span`,{className:`file-row-counts mono`,children:[(0,V.jsxs)(`span`,{className:`count-add`,children:[`+`,t.additions]}),(0,V.jsxs)(`span`,{className:`count-del`,children:[`−`,t.deletions]})]}),(0,V.jsx)(`span`,{className:`file-row-state${t.reviewed?` is-reviewed`:``}`,children:t.reviewed?`Revu`:`À revoir`})]},t.path)})]})]})}var pd=1e-6,md=1;function hd(e,t,n){let r=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x);return r>pd?1:r<-1e-6?-1:0}function gd(e,t,n){return n.x>=Math.min(e.x,t.x)-pd&&n.x<=Math.max(e.x,t.x)+pd&&n.y>=Math.min(e.y,t.y)-pd&&n.y<=Math.max(e.y,t.y)+pd}function _d(e,t,n,r){return hd(e,t,n)*hd(e,t,r)<0&&hd(n,r,e)*hd(n,r,t)<0}function vd(e,t,n,r){let i=hd(e,t,n),a=hd(e,t,r),o=hd(n,r,e),s=hd(n,r,t);return i*a<0&&o*s<0||i===0&&gd(e,t,n)||a===0&&gd(e,t,r)||o===0&&gd(n,r,e)||s===0&&gd(n,r,t)}function yd(e,t,n,r=md){let i=n.x+r,a=n.x+n.width-r,o=n.y+r,s=n.y+n.height-r;if(i>=a||o>=s)return!1;let c=t.x-e.x,l=t.y-e.y,u=0,d=1;for(let[t,n]of[[-c,e.x-i],[c,a-e.x],[-l,e.y-o],[l,s-e.y]]){if(t===0){if(n<=0)return!1;continue}let e=n/t;if(t<0){if(e>d)return!1;e>u&&(u=e)}else{if(e<u)return!1;e<d&&(d=e)}}return d-u>pd}function bd(e){let t=[];for(let n=1;n<e.length;n++){let[r,i]=[e[n-1],e[n]];(Math.abs(r.x-i.x)>pd||Math.abs(r.y-i.y)>pd)&&t.push([r,i])}return t}function xd(e,t){let n=t.map(e=>bd(e.points)),r=[];for(let e=0;e<t.length;e++)for(let i=e+1;i<t.length;i++){let a=t[e],o=t[i],s=a.u===o.u||a.u===o.v||a.v===o.u||a.v===o.v?_d:vd;n[e].some(([e,t])=>n[i].some(([n,r])=>s(e,t,n,r)))&&r.push([e,i])}let i=[];return t.forEach((t,r)=>{e.forEach((e,a)=>{a!==t.u&&a!==t.v&&n[r].some(([t,n])=>yd(t,n,e))&&i.push({link:r,node:a})})}),{crossings:r,overlaps:i}}function Sd(e){return e.crossings.length+e.overlaps.length}function Cd(e){let t=e.nodes.map(e=>e.id),n=new Set(t),r=new Map(t.map(e=>[e,[]])),i=new Map(t.map(e=>[e,[]])),a=[];for(let t of e.links)if(n.has(t.from)&&n.has(t.to)){if(t.from===t.to){a.push({kind:`self_loop`,node:t.from});continue}r.get(t.to).push(t.from),i.get(t.from).push(t.to)}let o=t.filter(e=>r.get(e).length===0);o.length===0&&t.length>0&&a.push({kind:`no_root`}),o.length>1&&a.push({kind:`several_roots`,roots:o});for(let e of t){let t=r.get(e);t.length>1&&a.push({kind:`several_parents`,node:e,parents:t})}let s=new Map(t.map(e=>[e,0])),c=[],l=e=>{s.set(e,1),c.push(e);for(let t of i.get(e))s.get(t)===1?a.push({kind:`cycle`,nodes:[...c.slice(c.indexOf(t)),t]}):s.get(t)===0&&l(t);c.pop(),s.set(e,2)};for(let e of[...o,...t])s.get(e)===0&&l(e);if(o.length===1){let e=new Set([o[0]]),n=[o[0]];for(;n.length>0;)for(let t of i.get(n.shift()))e.has(t)||(e.add(t),n.push(t));let r=t.filter(t=>!e.has(t));r.length>0&&a.push({kind:`unreachable`,root:o[0],nodes:r})}return a}var wd=.6,Td=.56;function Ed(e,t){return[...e].length*t.size*(t.mono?wd:Td)}var Dd={size:12,weight:400,mono:!0},Od={size:12.5,weight:400,mono:!1},kd={size:12.5,weight:500,mono:!1},Ad={size:11.5,weight:500,mono:!1},jd={size:11,weight:400,mono:!1},Md={size:10.5,weight:400,mono:!1},Nd={size:10.5,weight:600,mono:!1};function Pd(e){return e.shape===`decision`?Ad:e.status===`missing`?kd:e.location?Dd:Od}function Fd(e){return e.location!==null&&e.shape!==`decision`}function Id(e){return e.status===`missing`&&e.shape!==`decision`&&e.detail!==null&&e.detail!==``}function Ld(e,t){let n=t(e.label,Pd(e));if(e.shape===`decision`){let e=Math.max(84,Math.ceil(n+36));return{width:e,height:e}}let r=Id(e)?t(e.detail,jd):0,i=Math.max(n,r),a=(Fd(e)?22:0)+(e.location?14:0);return e.shape===`pill`?{width:Math.max(80,Math.ceil(i+48+a)),height:r>0?52:40}:{width:Math.max(140,Math.ceil(i+32+a)),height:r>0?52:44}}var Rd=40,zd=36,Bd=18,Vd=12,Hd=36,Ud=24,Wd=16,Gd=14,Kd=30,qd=14,Jd=14,Yd=8,Xd=8,Zd=60,Qd=40,$d=14,ef=6,tf=48,nf=16,rf=8,af=2e4,of=8,sf=6,cf=12,lf=1e3,uf=.1,df=4,ff=2;function pf(e){return{x:e.x+e.width,y:e.y+e.height/2}}function mf(e){return{x:e.x,y:e.y+e.height/2}}function hf(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function gf(e){let t=0,n=0;for(let{value:r,weight:i}of e)t+=r*i,n+=i;return n>0?t/n:null}function J(e,t){let n=[];return e.forEach((e,r)=>{for(n.push({value:e,weight:t[r],count:1});n.length>1&&n[n.length-2].value>n[n.length-1].value;){let e=n.pop(),t=n[n.length-1],r=t.weight+e.weight;t.value=(t.value*t.weight+e.value*e.weight)/r,t.weight=r,t.count+=e.count}}),n.flatMap(e=>Array(e.count).fill(e.value))}function _f(e,t,n,r){let i=[],a=0;return e.forEach((e,n)=>{i.push(a),a+=e+(t[n]??0)}),J(n.map((t,n)=>t-e[n]/2-i[n]),r).map((t,n)=>t+i[n]+e[n]/2)}function vf(e,t){let n=[],r=0;return e.forEach((e,i)=>{n.push(r+e/2),r+=e+(t[i]??0)}),n}function yf(e,t){return e.map((e,n)=>({item:e,index:n,key:t(e)})).sort((e,t)=>e.key-t.key||e.index-t.index).map(({item:e})=>e)}function bf(e,t){let n=pf(e),r=n.x+Jd,i=e.y-Jd,a=e.x+e.width/2;return{from:t,to:t,points:[n,{x:r,y:n.y},{x:r,y:i},{x:a,y:i},{x:a,y:e.y}],labelPosition:{x:(a+r)/2,y:i-Yd},labelAnchor:`middle`,back:!0}}function xf(e){let t=[];for(let n of e){let e=t[t.length-1];if(!(e&&Math.abs(e.x-n.x)<1e-6&&Math.abs(e.y-n.y)<1e-6)){if(t.length>=2){let r=t[t.length-2],i=(e.x-r.x)*(n.y-r.y)-(e.y-r.y)*(n.x-r.x);Math.abs(i)<1e-6&&t.pop()}t.push(n)}}return t}function Sf(e){let t=Math.max(0,Math.floor((e.length-1)/2)),n=e[t],r=e[Math.min(t+1,e.length-1)];return{x:(n.x+r.x)/2,y:(n.y+r.y)/2}}function Cf(e){if(e.nodes.length===0)throw Error(`Le schéma « ${e.title} » ne contient aucun nœud.`);let t=new Map;return e.nodes.forEach((n,r)=>{if(t.has(n.id))throw Error(`Le nœud « ${n.id} » apparaît deux fois dans le schéma « ${e.title} ».`);t.set(n.id,r)}),{index:t,links:e.links.map(n=>{let r=t.get(n.from),i=t.get(n.to);if(r===void 0||i===void 0){let t=r===void 0?n.from:n.to;throw Error(`Le lien ${n.from} → ${n.to} référence le nœud « ${t} », absent du schéma « ${e.title} ».`)}return{u:r,v:i,label:n.label}})}}function wf(e,t){let n=Sd(xd(e.boxes,e.links.map((e,n)=>({u:t[n].u,v:t[n].v,points:e.points})))),r=0;for(let t of e.links)for(let e=1;e<t.points.length;e++)r+=Math.abs(t.points[e].y-t.points[e-1].y);return{issues:n,stretch:r}}function Tf(e,t){return e.issues<t.issues||e.issues===t.issues&&e.stretch<t.stretch-1e-6}function Ef(e,t){let n=e[0],r=t(n);for(let i of e.slice(1)){let e=t(i);Tf(e,r)&&(n=i,r=e)}let i=n.map(e=>[...e]);for(let e=0;e<sf&&r.issues>0;e++){let e=!1;for(let n of i)for(let a=0;a+1<n.length&&r.issues>0;a++){[n[a],n[a+1]]=[n[a+1],n[a]];let o=t(i);o.issues<r.issues?(r=o,e=!0):[n[a],n[a+1]]=[n[a+1],n[a]]}if(!e)break}return i}function Df(e,t,n,r){let i=e.nodes.length,a=Array.from({length:i},()=>[]),o=Array(i).fill(0);n.forEach((e,t)=>{e.u!==e.v&&(a[e.u].push(t),o[e.v]++)});let s=Array(i).fill(0),c=Array(i).fill(-1),l=Array(n.length).fill(!1),u=0,d=[...e.nodes.keys()].filter(e=>o[e]===0).concat([...e.nodes.keys()]);for(let e of d){if(s[e]!==0)continue;s[e]=1,c[e]=u++;let t=[{node:e,next:0}];for(;t.length>0;){let e=t[t.length-1];if(e.next<a[e.node].length){let r=a[e.node][e.next++],i=n[r].v;s[i]===1?l[r]=!0:s[i]===0&&(s[i]=1,c[i]=u++,t.push({node:i,next:0}))}else s[e.node]=2,t.pop()}}let f=Array.from({length:i},()=>[]),p=Array.from({length:i},()=>[]),m=Array(i).fill(!1);n.forEach((e,t)=>{if(e.u===e.v||l[t]){m[e.u]=!0,m[e.v]=!0;return}f[e.u].includes(e.v)||f[e.u].push(e.v),p[e.v].includes(e.u)||p[e.v].push(e.u)});let h=e=>{let t=[];for(let n=e;;n=f[n][0]){if(p[n].length!==1||m[n]||f[n].length>1)return null;if(t.push(n),f[n].length===0)return t}},g=Array.from({length:i},()=>[]),_=Array(i).fill(!1);for(let e=0;e<i;e++){let t=f[e],n=null;for(let e=1;e<t.length&&n===null;e++)n=h(t[e]);if(n===null&&t.length===1&&p[e].length>0&&f[t[0]].length===0&&(n=h(t[0])),n!==null){g[e]=n;for(let e of n)_[e]=!0}}for(let e=0;e<i;e++)_[e]&&(g[e]=[]);let v=[...e.nodes.keys()].filter(e=>!_[e]),y=n.map((e,t)=>({...e,k:t})).filter(e=>e.u!==e.v&&!l[e.k]&&!_[e.v]),b=Array.from({length:i},()=>[]),x=Array.from({length:i},()=>[]);for(let e of y)x[e.u].push(e.v),b[e.v].push(e.u);let S=Array(i).fill(0),C=b.map(e=>e.length),ee=v.filter(e=>C[e]===0);for(;ee.length>0;){ee.sort((e,t)=>c[e]-c[t]);let e=ee.shift();for(let t of x[e])S[t]=Math.max(S[t],S[e]+1),--C[t]===0&&ee.push(t)}for(let e of v)b[e].length===0&&x[e].length>0&&(S[e]=Math.min(...x[e].map(e=>S[e]))-1);let w=Math.max(...v.map(e=>S[e]))+1;g.forEach((e,t)=>e.forEach(e=>S[e]=S[t]));let te=e=>g[e].reduce((e,n)=>e+Hd+t[n].height,t[e].height),T=e.nodes.map((e,n)=>({node:n,rank:S[n],width:t[n].width,height:te(n),above:t[n].height/2})),E=new Map;for(let e of y){let t=[e.u];for(let n=S[e.u]+1;n<S[e.v];n++)T.push({node:null,rank:n,width:0,height:0,above:0}),t.push(T.length-1);t.push(e.v),E.set(e.k,t)}let D=T.map(()=>[]),O=T.map(()=>[]);for(let e of E.values())for(let t=1;t<e.length;t++)O[e[t-1]].push(e[t]),D[e[t]].push(e[t-1]);let k=Array.from({length:w},()=>[]);yf(v,e=>c[e]).forEach(e=>k[S[e]].push(e));for(let e=i;e<T.length;e++)k[T[e].rank].push(e);let ne=Array(T.length).fill(0),re=()=>k.forEach(e=>e.forEach((e,t)=>ne[e]=t));re();let ie=(e,t)=>{k[e]=yf(k[e],e=>{let n=t[e];return n.length>0?n.reduce((e,t)=>e+ne[t],0)/n.length:ne[e]}),k[e].forEach((e,t)=>ne[e]=t)},ae=[k.map(e=>[...e])];for(let e=0;e<of;e++){if(e%2==0)for(let e=1;e<w;e++)ie(e,D);else for(let e=w-2;e>=0;e--)ie(e,O);ae.push(k.map(e=>[...e]))}let oe=a=>{k=a.map(e=>[...e]),re();let o=new Set,s=new Set;for(let e=1;e<w;e++){let t=-1;for(let n of k[e]){let e=[...new Set(D[n])].sort((e,t)=>ne[e]-ne[t]);if(e.length===0)continue;let r=e[Math.floor((e.length-1)/2)];!s.has(r)&&ne[r]>t&&(s.add(r),o.add(`${r}>${n}`),t=ne[r])}}let c=(e,t)=>o.has(`${e}>${t}`)||o.has(`${t}>${e}`)?lf:1,u=e=>T[e].above,d=e=>T[e].height-T[e].above,f=e=>T[e].height/2-T[e].above,p=e=>e.slice(0,-1).map((t,n)=>T[t].node===null||T[e[n+1]].node===null?Bd:zd),m=Array(T.length).fill(0);for(let e of k)vf(e.map(e=>T[e].height),p(e)).forEach((t,n)=>m[e[n]]=t-f(e[n]));for(let e=0;e<cf;e++){let t=e===11?`both`:e%2==0?`down`:`up`,n=t===`up`?[...k.keys()].reverse():[...k.keys()];for(let e of n){let n=k[e],r=[],i=[];for(let e of n){let n=(t===`down`?D[e]:t===`up`?O[e]:[...D[e],...O[e]]).map(t=>({value:m[t],weight:c(e,t)})),a=gf(n);r.push((a??m[e])+f(e)),i.push(a===null?uf:n.reduce((e,t)=>e+t.weight,0))}_f(n.map(e=>T[e].height),p(n),r,i).forEach((e,t)=>m[n[t]]=e-f(n[t]))}}for(let e=1;e<w;e++){let t=k[e],n=p(t);t.forEach((e,r)=>{let i=D[e].find(t=>o.has(`${t}>${e}`));if(!(i===void 0||Math.abs(m[i]-m[e])>df)){m[e]=m[i];for(let e=r+1;e<t.length;e++){let r=m[t[e-1]]+d(t[e-1])+n[e-1]+u(t[e]);m[t[e]]<r&&(m[t[e]]=r)}for(let e=r-1;e>=0;e--){let r=m[t[e+1]]-u(t[e+1])-n[e]-d(t[e]);m[t[e]]>r&&(m[t[e]]=r)}}})}let h=Array(i).fill(0);for(let e of v){h[e]=m[e]-t[e].height/2;let n=h[e]+t[e].height;for(let r of g[e])h[r]=n+Hd,n=h[r]+t[r].height}let b=(e,t)=>Math.abs(m[e]-m[t])>=ff,x=Array.from({length:w},()=>[]),C=new Map;for(let e of E.values())for(let t=1;t<e.length;t++){let[n,r]=[e[t-1],e[t]];if(!b(n,r))continue;x[T[n].rank].includes(n)||x[T[n].rank].push(n);let i=C.get(n)??[];i.includes(r)||i.push(r),C.set(n,i)}let ee=e=>{let t=[m[e],...C.get(e).map(e=>m[e])];return[Math.min(...t),Math.max(...t)]},te=(e,[t,n])=>e>t+ff&&e<n-ff,ie=(e,t)=>{let n=C.get(t);return C.get(e).filter(e=>!n.includes(e)&&te(m[e],ee(t))).length+ +!!te(m[t],ee(e))};x.forEach((e,t)=>{let n=[];for(let t of yf(e,e=>m[e])){let e=n.length,r=1/0;for(let i=n.length;i>=0;i--){let a=n.reduce((e,n,r)=>e+(r<i?ie(n,t):ie(t,n)),0);a<r&&(r=a,e=i)}n.splice(e,0,t)}x[t]=n});let ae=(e,t)=>(x[e].indexOf(t)+1)/(x[e].length+1),oe=x.map(e=>Math.max(Rd,(e.length+1)*Vd));for(let e of y){if(!e.label)continue;let t=E.get(e.k),n=t[t.length-2],i=T[n].rank,a=r(e.label,Md),o=b(n,e.v)?(a+Yd+Xd)/(1-ae(i,n)):a+16;oe[i]=Math.max(oe[i],o)}let se=Array.from({length:w+1},()=>[]);for(let e of E.values())for(let t=1;t<e.length;t++){let[n,r]=[e[t-1],e[t]];se[T[n].rank+1].push([Math.min(m[n],m[r]),Math.max(m[n],m[r])])}n.forEach((e,t)=>{e.u===e.v?se[S[e.u]+1].push([h[e.u]-Jd,m[e.u]]):l[t]&&(se[S[e.u]+1].push([m[e.u],1/0]),se[S[e.v]].push([m[e.v],1/0]))});let ce=(e,t,n)=>se[e].some(([e,r])=>e-Wd<n&&r+Wd>t),le=e.nodes.map((e,i)=>{let a=t[i].width/2;if(!_[i])return{rank:S[i],top:h[i],bottom:h[i]+t[i].height,left:a,right:a,hung:!1};let o=n.filter(e=>e.v===i&&e.label).map(e=>Yd+r(e.label,Md)+Xd);return{rank:S[i],top:h[i]-Hd,bottom:h[i]+t[i].height,left:a,right:Math.max(a,...o),hung:!0}}),ue=k.map(e=>Math.max(0,...e.map(e=>T[e].width/2))),de=[...ue];for(let e of le)e.hung&&(ce(e.rank,e.top,e.bottom)&&(ue[e.rank]=Math.max(ue[e.rank],e.left)),ce(e.rank+1,e.top,e.bottom)&&(de[e.rank]=Math.max(de[e.rank],e.right)));let fe=Array.from({length:w},()=>[]);le.forEach(e=>fe[e.rank].push(e));let pe=[];for(let e=0;e<w;e++){let t=e===0?ue[0]:pe[e-1]+de[e-1]+oe[e-1]+ue[e];for(let n of fe[e])for(let r=0;r<e;r++)for(let e of fe[r])(n.hung||e.hung)&&(n.top>=e.bottom+Wd||e.top>=n.bottom+Wd||(t=Math.max(t,pe[r]+e.right+Ud+n.left)));pe.push(t)}let me=e=>pe[e]-ue[e],he=e=>pe[e]+de[e],ge=e.nodes.map((e,n)=>({x:pe[S[n]]-t[n].width/2,y:h[n],width:t[n].width,height:t[n].height})),_e=Math.max(...ge.map(e=>e.y+e.height)),ve=0;return{boxes:ge,links:n.map((t,n)=>{let r=e.nodes[t.u].id,i=e.nodes[t.v].id;if(t.u===t.v)return bf(ge[t.u],r);if(l[n]){let e=pf(ge[t.u]),n=mf(ge[t.v]),a=he(S[t.u])+Gd,o=me(S[t.v])-Gd,s=_e+Kd+qd*ve++;return{from:r,to:i,points:[e,{x:a,y:e.y},{x:a,y:s},{x:o,y:s},{x:o,y:n.y},n],labelPosition:{x:(a+o)/2,y:s-Yd},labelAnchor:`middle`,back:!0}}if(_[t.v]){let e=pe[S[t.v]],n=ge[t.u].y+ge[t.u].height,a=ge[t.v].y;return{from:r,to:i,points:[{x:e,y:n},{x:e,y:a}],labelPosition:{x:e+Yd,y:(n+a)/2},labelAnchor:`start`,back:!1}}let a=E.get(n),o=[pf(ge[t.u])],s=o[0],c=`middle`;for(let e=1;e<a.length;e++){let t=a[e-1],n=a[e],r=o[o.length-1],i=T[n].node!==null,l=i?mf(ge[n]):{x:me(T[n].rank),y:m[n]};if(b(t,n)){let e=T[t].rank,n=he(e)+oe[e]*ae(e,t);o.push({x:n,y:r.y},{x:n,y:l.y}),s={x:n+Yd,y:(r.y+l.y)/2},c=`start`}else s={x:(r.x+l.x)/2,y:l.y-Yd},c=`middle`;o.push(l),i||o.push({x:he(T[n].rank),y:m[n]})}return{from:r,to:i,points:xf(o),labelPosition:s,labelAnchor:c,back:!1}}),headers:[],center:null}};return oe(Ef(ae,e=>wf(oe(e),n)))}function Of(e,t,n,r){if(e.layers.length===0)throw Error(`Le schéma en couches « ${e.title} » ne déclare aucune couche.`);let i=e.nodes.map(t=>{if(t.layer===null)throw Error(`Le nœud « ${t.id} » n'a pas de couche alors que le schéma « ${e.title} » est en couches.`);let n=e.layers.indexOf(t.layer);if(n===-1)throw Error(`Le nœud « ${t.id} » est dans la couche « ${t.layer} », absente des couches déclarées (${e.layers.join(`, `)}).`);return n}),a=e.layers.length,o=e.layers.map((e,n)=>Math.max(180,Math.ceil(r(e.toUpperCase(),Nd)),...t.filter((e,t)=>i[t]===n).map(e=>e.width))),s=e.nodes.map((e,n)=>e.shape===`box`?o[i[n]]:t[n].width),c=t.map(e=>e.height),l=e.nodes.map(()=>[]);for(let e of n){if(e.u===e.v)continue;let t=i[e.u]===i[e.v]?(c[e.u]+c[e.v])/2+zd:0;l[e.u].push({other:e.v,delta:-t}),l[e.v].push({other:e.u,delta:t})}let u=e.layers.map((t,n)=>[...e.nodes.keys()].filter(e=>i[e]===n)),d=e=>e.slice(0,-1).map(()=>zd),f=Array(e.nodes.length).fill(0),p=e=>vf(u[e].map(e=>c[e]),d(u[e])).forEach((t,n)=>f[u[e][n]]=t);u.forEach((e,t)=>p(t));let m=e=>{let t=l[e].map(({other:e,delta:t})=>({value:f[e]+t,weight:1}));return{mean:gf(t),weight:t.length}},h=[u.map(e=>[...e])];for(let e=0;e<of;e++){let t=e%2==0?[...u.keys()]:[...u.keys()].reverse();for(let e of t)u[e]=yf(u[e],e=>m(e).mean??f[e]),p(e);h.push(u.map(e=>[...e]))}let g=t=>{u=t.map(e=>[...e]),u.forEach((e,t)=>p(t));for(let e=0;e<cf;e++){let t=e%2==0?[...u.keys()]:[...u.keys()].reverse();for(let e of t){let t=u[e],n=t.map(m);_f(t.map(e=>c[e]),d(t),n.map((e,n)=>e.mean??f[t[n]]),n.map(e=>e.mean===null?uf:e.weight)).forEach((e,n)=>f[t[n]]=e)}}let r=[],l=0;for(let e=0;e<a;e++)r.push(l),l+=o[e]+Zd;let h=e.nodes.map((e,t)=>({x:r[i[t]]+(o[i[t]]-s[t])/2,y:f[t]-c[t]/2,width:s[t],height:c[t]})),g=Math.min(...h.map(e=>e.y)),_=e.layers.map((e,t)=>({label:e,x:r[t],y:g-Qd,width:o[t]})),v=(e,t)=>{let n=u[e].map(e=>h[e]),r=[n[0].y-zd/2,...n.slice(1).map((e,t)=>(n[t].y+n[t].height+e.y)/2)];return r.push(n[n.length-1].y+n[n.length-1].height+zd/2),yf(r,e=>Math.abs(e-t))[0]};return{boxes:h,links:n.map(t=>{let n=e.nodes[t.u].id,a=e.nodes[t.v].id;if(t.u===t.v)return bf(h[t.u],n);let s=h[t.u],c=h[t.v],l;if(i[t.u]===i[t.v]){let e=i[t.u],[n,a]=s.y<=c.y?[t.u,t.v]:[t.v,t.u],d=u[e].indexOf(a)-u[e].indexOf(n)>1,f=h[n],p=h[a];if(d){let t=r[e]+o[e]+Gd;l=[pf(f),{x:t,y:f.y+f.height/2},{x:t,y:p.y+p.height/2},pf(p)]}else l=[{x:f.x+f.width/2,y:f.y+f.height},{x:p.x+p.width/2,y:p.y}];n!==t.u&&l.reverse()}else{let[e,n]=i[t.u]<i[t.v]?[t.u,t.v]:[t.v,t.u],a=mf(h[n]);l=[pf(h[e])];for(let t=i[e]+1;t<i[n];t++){let e=l[l.length-1],n=r[t],i=r[t]+o[t],s=t=>e.y+(a.y-e.y)*(t-e.x)/(a.x-e.x),c=Math.min(s(n),s(i)),d=Math.max(s(n),s(i));if(u[t].some(e=>h[e].y-ef<d&&h[e].y+h[e].height+ef>c)){let e=v(t,s((n+i)/2));l.push({x:n,y:e},{x:i,y:e})}}l.push(a),e!==t.u&&l.reverse()}let d=Sf(l);return{from:n,to:a,points:l,labelPosition:{x:d.x,y:d.y-Yd},labelAnchor:`middle`,back:!1}}),headers:_,center:null}};return g(Ef(h,e=>wf(g(e),n)))}function kf(e,t,n){let r=hf(e),i=n.x-r.x,a=n.y-r.y;if(i===0&&a===0)return r;let o=e.width/2,s=e.height/2,c;if(t===`decision`)c=1/(Math.abs(i)/o+Math.abs(a)/s);else if(c=Math.min(i===0?1/0:o/Math.abs(i),a===0?1/0:s/Math.abs(a)),t===`pill`){let e=s,t=o-e;if(Math.abs(c*i)>t){let n=Math.hypot(i,a),r=i/n,o=Math.sign(i)*t,s=o*r;c=(s+Math.sqrt(Math.max(0,s*s-o*o+e*e)))/n}}return{x:r.x+i*c,y:r.y+a*c}}function Af(e,t,n){return e.x<t.x+t.width+n&&t.x<e.x+e.width+n&&e.y<t.y+t.height+n&&t.y<e.y+e.height+n}function jf(e){let t=e=>e.map(e=>`« ${e} »`).join(`, `);switch(e.kind){case`self_loop`:return`le nœud « ${e.node} » est relié à lui-même`;case`no_root`:return`aucun nœud n'est sans lien entrant, il n'y a pas de racine`;case`several_roots`:return`plusieurs nœuds sans lien entrant (${t(e.roots)}) au lieu d'une seule racine`;case`several_parents`:return`le nœud « ${e.node} » a plusieurs parents (${t(e.parents)})`;case`cycle`:return`cycle ${e.nodes.join(` → `)}`;case`unreachable`:return`${t(e.nodes)} inaccessible(s) depuis la racine « ${e.root} »`}}function Mf(e,t,n){let r=Cd(e);if(r.length>0)throw Error(`La carte mentale « ${e.title} » n'est pas un arbre : ${r.map(jf).join(` ; `)}.`);let i=e.nodes.length,a=Array(i).fill(!1),o=Array.from({length:i},()=>[]);for(let e of n)a[e.v]=!0,o[e.u].push(e.v);let s=a.indexOf(!1),c=o,l=Array(i).fill(0),u=[],d=[s];for(;d.length>0;){let e=d.shift();u.push(e);for(let t of c[e])l[t]=l[e]+1,d.push(t)}let f=Array(i).fill(1);for(let e of[...u].reverse())for(let t of c[e])f[e]+=f[t];let p=Array(i).fill(0),m=(e,t,n)=>{let r=c[e].reduce((e,t)=>e+f[t],0),i=t;for(let a of c[e]){let e=(n-t)*f[a]/r;p[a]=i+e/2,m(a,i,i+e),i+=e}};if(c[s].length>0){let e=2*Math.PI*f[c[s][0]]/(f[s]-1);m(s,-e/2,2*Math.PI-e/2)}let h=(e,n)=>Math.min(Math.abs(Math.cos(n))<1e-9?1/0:t[e].width/2/Math.abs(Math.cos(n)),Math.abs(Math.sin(n))<1e-9?1/0:t[e].height/2/Math.abs(Math.sin(n))),g=Array(i).fill(0);for(let e of u)for(let t of c[e])g[t]=g[e]+h(e,p[t])+h(t,p[t])+tf;let _=Array(i).fill(0);u.forEach((e,t)=>_[e]=t);let v=e=>{g[e]+=rf;for(let t of c[e])v(t)},y=()=>e.nodes.map((e,n)=>{let r=g[n]*Math.cos(p[n]),i=g[n]*Math.sin(p[n]);return{x:r-t[n].width/2,y:i-t[n].height/2,width:t[n].width,height:t[n].height}}),b=y();for(let t=0;;t++){let n=null;for(let e=0;e<i&&n===null;e++)for(let t=e+1;t<i;t++)if(Af(b[e],b[t],nf)){n=l[e]>l[t]||l[e]===l[t]&&_[e]>_[t]?e:t;break}if(n===null)break;if(t>=af)throw Error(`La carte mentale « ${e.title} » n'a pas pu être placée sans chevauchement.`);v(n),b=y()}let x=n.map(t=>{let n=e.nodes[t.u].id,r=e.nodes[t.v].id;if(t.u===t.v)return bf(b[t.u],n);let i=kf(b[t.u],e.nodes[t.u].shape,hf(b[t.v])),a=kf(b[t.v],e.nodes[t.v].shape,hf(b[t.u]));return{from:n,to:r,points:[i,a],labelPosition:{x:(i.x+a.x)/2,y:(i.y+a.y)/2-Yd},labelAnchor:`middle`,back:!1}});return{boxes:b,links:x,headers:[],center:hf(b[s])}}function Nf(e,t){let n=new Map;t.forEach((t,r)=>{if(!e.links[r].label)return;let i=`${t.from}\u0000${t.to}`,a=n.get(i)??0;n.set(i,a+1),t.labelPosition={x:t.labelPosition.x,y:t.labelPosition.y-a*(Md.size+4)}})}function Pf(e,t,n){Nf(e,t.links);let r=[],i=[];for(let e of t.boxes)r.push(e.x,e.x+e.width),i.push(e.y,e.y+e.height);t.links.forEach((t,a)=>{for(let e of t.points)r.push(e.x),i.push(e.y);let o=e.links[a].label;if(o){let e=n(o,Md),a=Md.size*.7,s=t.labelAnchor===`start`?t.labelPosition.x:t.labelPosition.x-e/2;r.push(s,s+e),i.push(t.labelPosition.y-a,t.labelPosition.y+a)}});for(let e of t.headers)r.push(e.x,e.x+e.width),i.push(e.y,e.y+$d);let a=Math.min(...r),o=Math.max(...r),s=Math.min(...i),c=Math.max(...i);if(t.center){let e=Math.max(t.center.x-a,o-t.center.x),n=Math.max(t.center.y-s,c-t.center.y);a=t.center.x-e,o=t.center.x+e,s=t.center.y-n,c=t.center.y+n}let l=24-a,u=24-s,d=e=>({x:e.x+l,y:e.y+u});return{nodes:t.boxes.map((t,n)=>({id:e.nodes[n].id,x:t.x+l,y:t.y+u,width:t.width,height:t.height})),links:t.links.map(e=>({...e,points:e.points.map(d),labelPosition:d(e.labelPosition)})),headers:t.headers.map(e=>({...e,x:e.x+l,y:e.y+u})),width:Math.ceil(o-a+48),height:Math.ceil(c-s+48)}}function Ff(e,t=Ed){let{links:n}=Cf(e),r=e.nodes.map(e=>Ld(e,t));switch(e.kind){case`flow`:return Pf(e,Df(e,r,n,t),t);case`layers`:return Pf(e,Of(e,r,n,t),t);case`mindmap`:return Pf(e,Mf(e,r,n),t)}}function If(e,t=Ff(e)){let n=new Map(e.nodes.map((e,t)=>[e.id,t])),r=e.links.map((e,t)=>({index:t,from:e.from,to:e.to})),i=xd(t.nodes,t.links.map(e=>({u:n.get(e.from),v:n.get(e.to),points:e.points})));return{crossings:i.crossings.map(([e,t])=>({a:r[e],b:r[t]})),nodeOverlaps:i.overlaps.map(({link:t,node:n})=>({link:r[t],node:e.nodes[n].id}))}}var Lf={layers:`network`,flow:`workflow`,mindmap:`brain-circuit`};function Rf(e){return e.location?/\.(spec|test)\./.test(e.location.path)?`flask-conical`:`file-code`:null}function zf(e){let t=new Map;for(let n of e.findings){if(n.status!==`open`||!n.location)continue;let e=t.get(n.location.path);(!e||fl(n.severity,e)<0)&&t.set(n.location.path,n.severity)}return t}function Bf(e,t){let n=new Set(e.flatMap(e=>e.location&&t.has(e.location.path)?[t.get(e.location.path)]:[]));return Mc.filter(e=>n.has(e))}function Vf(e){return zc.filter(t=>e.some(e=>e.status===t))}var Hf=6;function Uf(e){if(e.length===0)return``;let t=[`M ${e[0].x} ${e[0].y}`];for(let n=1;n<e.length-1;n++){let r=e[n-1],i=e[n],a=e[n+1],o=Math.hypot(i.x-r.x,i.y-r.y),s=Math.hypot(a.x-i.x,a.y-i.y),c=Math.min(Hf,o/2,s/2);if(c<=0){t.push(`L ${i.x} ${i.y}`);continue}let l={x:i.x-(i.x-r.x)/o*c,y:i.y-(i.y-r.y)/o*c},u={x:i.x+(a.x-i.x)/s*c,y:i.y+(a.y-i.y)/s*c};t.push(`L ${l.x} ${l.y}`,`Q ${i.x} ${i.y} ${u.x} ${u.y}`)}let n=e[e.length-1];return t.push(`L ${n.x} ${n.y}`),t.join(` `)}function Wf(e,t){return`${e/2},0 ${e},${t/2} ${e/2},${t} 0,${t/2}`}var Y=.2,Gf=.85,Kf=1.25,qf=320,Jf=620;function Yf(e){return Math.min(3,Math.max(Y,e))}var Xf=1.5;function Zf(e,t,n,r=1){return Math.max(Gf,Math.min(r,t/e.width,n/e.height))}function Qf(e,t){let n=Zf(e,t,1/0);return Math.round(Math.min(Jf,Math.max(qf,e.height*n)))}function $f(e,t,n,r=1){let i=Zf(e,t,n,r),a=t/i,o=n/i;return{x:e.width<=a?(e.width-a)/2:0,y:e.height<=o?(e.height-o)/2:0,scale:i}}function ep(e,t,n,r){return e.width>n/t.scale+.5||e.height>r/t.scale+.5}function tp(e,t,n,r){let i=(e,t,n)=>{let r=Math.min(0,t-n),i=Math.max(0,t-n);return Math.min(i,Math.max(r,e))};return{x:i(e.x,t.width,n/e.scale),y:i(e.y,t.height,r/e.scale),scale:e.scale}}function np(e,t,n){let r=Yf(e.scale*t),i=e.x+n.x/e.scale,a=e.y+n.y/e.scale;return{x:i-n.x/r,y:a-n.y/r,scale:r}}function rp(e,t,n){return{x:e.x-t/e.scale,y:e.y-n/e.scale,scale:e.scale}}function X(e,t,n){return`${e.x} ${e.y} ${t/e.scale} ${n/e.scale}`}function ip(e){let t;try{t=Ff(e)}catch{return null}let n=If(e,t);return n.crossings.length+n.nodeOverlaps.length}var ap=`#3a4052`,op=3,sp=1.1;function cp(e){try{return{layout:Ff(e),error:null}}catch(e){return{layout:null,error:e.message}}}function lp({analysis:e}){let[t,n]=(0,v.useState)(null),r=e.diagrams.find(e=>e.id===t)??e.diagrams[0],i=(0,v.useMemo)(()=>new Map(e.diagrams.map(e=>[e.id,ip(e)])),[e.diagrams]);return r?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`diagram-picker`,children:[e.diagrams.map(e=>{let t=e.id===r.id,a=i.get(e.id)??null;return(0,V.jsxs)(`button`,{type:`button`,className:`diagram-pick${t?` is-active`:``}`,"aria-pressed":t,onClick:()=>n(e.id),title:e.title,children:[(0,V.jsx)(H,{name:Lf[e.kind],color:t?`#8b97ff`:`#646b7b`}),(0,V.jsx)(`span`,{className:`diagram-pick-title`,children:e.title}),a!==null&&a>0&&(0,V.jsx)(`span`,{className:`diagram-pick-issues`,title:`${a} croisement(s) de liens ou traversée(s) de nœud : l'agent doit revoir ce schéma`,children:`croisements`})]},e.id)}),(0,V.jsxs)(`span`,{className:`diagram-meta`,children:[`Dessiné par l'agent · `,Su(r.updatedAt)]})]}),(0,V.jsx)(up,{analysis:e,diagram:r},r.id)]}):(0,V.jsxs)(`div`,{className:`card diagram-empty`,children:[(0,V.jsx)(`h2`,{className:`empty-title`,children:`Aucun schéma pour cette analyse`}),(0,V.jsxs)(`p`,{children:[`L'agent dessine les schémas avec l'outil `,(0,V.jsx)(`code`,{children:`set_diagram`}),` : périmètre d'impact en couches, flux de process ou carte mentale. Ils apparaîtront ici automatiquement.`]})]})}function up({analysis:e,diagram:t}){let n=(0,v.useMemo)(()=>cp(t),[t]);return n.error===null?(0,V.jsx)(dp,{analysis:e,diagram:t,layout:n.layout}):(0,V.jsxs)(`div`,{className:`card diagram-error`,role:`alert`,children:[(0,V.jsx)(H,{name:`triangle-alert`,color:`#f0625a`,size:16}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`diagram-error-title`,children:`Ce schéma ne peut pas être affiché.`}),(0,V.jsx)(`p`,{className:`diagram-error-text`,children:n.error}),(0,V.jsx)(`p`,{className:`diagram-error-text`,children:`L'agent doit le corriger avec l'outil set_diagram.`})]})]})}function dp({analysis:e,diagram:t,layout:n}){let r=(0,v.useRef)(null),i=(0,v.useRef)(null),[a,o]=(0,v.useState)({width:0,height:0}),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(null),d=a.width,f=d===0?0:s?a.height:Qf(n,d),[p,m]=(0,v.useState)(null),h=(0,v.useRef)(null),g=(0,v.useRef)(!1),_=(0,v.useMemo)(()=>zf(e),[e]),y=(0,v.useMemo)(()=>new Map(n.nodes.map(e=>[e.id,e])),[n]),b=Vf(t.nodes),x=Bf(t.nodes,_),S=`arrow-${t.id}`,C=t.kind===`flow`;(0,v.useEffect)(()=>{let e=i.current;if(!e)return;let t=()=>o({width:e.clientWidth,height:e.clientHeight}),n=new ResizeObserver(t);return n.observe(e),t(),()=>n.disconnect()},[]),(0,v.useEffect)(()=>{let e=()=>{c(document.fullscreenElement!==null&&document.fullscreenElement===r.current),m(null)};return document.addEventListener(`fullscreenchange`,e),()=>document.removeEventListener(`fullscreenchange`,e)},[]);let ee=async()=>{u(null);try{if(s){await document.exitFullscreen();return}let e=r.current;if(!e)return;if(!document.fullscreenEnabled)throw Error(`le navigateur n'autorise pas le plein écran sur cette page`);await e.requestFullscreen()}catch(e){u(`Plein écran impossible : ${e.message}`)}},w=`${n.width}x${n.height}@${d}x${f}${s?`:plein-ecran`:``}`,te=d>0?$f(n,d,f,s?Xf:1):null,T=p&&p.key===w?p.viewport:te,E=e=>{T&&m({key:w,viewport:tp(e(T),n,d,f)})},D=T!==null&&ep(n,T,d,f),O=(0,v.useEffectEvent)(e=>{let t=i.current;if(!t)return;e.preventDefault();let n=t.getBoundingClientRect(),r=e.deltaY<0?sp:1/sp;E(t=>np(t,r,{x:e.clientX-n.left,y:e.clientY-n.top}))});(0,v.useEffect)(()=>{let e=i.current;if(!e)return;let t=e=>O(e);return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[]);let k=e=>E(t=>np(t,e,{x:d/2,y:f/2})),ne=e=>{e.button===0&&T&&(h.current={x:e.clientX,y:e.clientY,origin:T,moved:!1,pointerId:e.pointerId},g.current=!1)},re=e=>{let t=h.current;if(!t||t.pointerId!==e.pointerId)return;let r=e.clientX-t.x,i=e.clientY-t.y;if(!t.moved){if(Math.hypot(r,i)<op)return;t.moved=!0,e.currentTarget.setPointerCapture(e.pointerId)}m({key:w,viewport:tp(rp(t.origin,r,i),n,d,f)})},ie=e=>{let t=h.current;t&&t.pointerId===e.pointerId&&(g.current=t.moved,h.current=null)},ae=t=>{!g.current&&t.location&&Uu(Hu.review(e.id,t.location.path,t.location.line))};return(0,V.jsxs)(`section`,{ref:r,className:`card diagram-card${s?` is-fullscreen`:``}`,children:[(0,V.jsx)(`div`,{ref:i,className:`diagram-area`,style:s?void 0:{height:f||void 0},children:T&&(0,V.jsxs)(`svg`,{className:`diagram-svg`,width:d,height:f,viewBox:X(T,d,f),onPointerDown:ne,onPointerMove:re,onPointerUp:ie,onPointerCancel:ie,role:`img`,"aria-label":t.title,children:[C&&(0,V.jsx)(`defs`,{children:(0,V.jsx)(`marker`,{id:S,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto-start-reverse`,children:(0,V.jsx)(`path`,{d:`M 1 1 L 9 5 L 1 9`,fill:`none`,stroke:ap,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),n.headers.map(e=>(0,V.jsx)(`text`,{className:`diagram-header`,x:e.x,y:e.y+7,dominantBaseline:`central`,children:e.label.toUpperCase()},e.label)),n.links.map((e,t)=>(0,V.jsx)(`path`,{className:`diagram-link`,d:Uf(e.points),stroke:ap,markerEnd:C?`url(#${S})`:void 0},`link-${t}`)),n.links.map((e,n)=>{let r=t.links[n].label;return r?(0,V.jsx)(`text`,{className:`diagram-link-label`,x:e.labelPosition.x,y:e.labelPosition.y,textAnchor:e.labelAnchor,dominantBaseline:`central`,children:r},`label-${n}`):null}),t.nodes.map(e=>(0,V.jsx)(fp,{node:e,box:y.get(e.id),severity:e.location?_.get(e.location.path)??null:null,onOpen:ae},e.id))]})}),(0,V.jsxs)(`div`,{className:`diagram-footer`,children:[(0,V.jsxs)(`div`,{className:`diagram-legend`,children:[b.map(e=>{let t=bu[e];return(0,V.jsxs)(`span`,{className:`legend-item`,children:[(0,V.jsx)(`span`,{className:`legend-swatch`,style:{background:t.fill??`transparent`,borderColor:t.stroke}}),t.label]},e)}),x.length>0&&(0,V.jsxs)(`span`,{className:`legend-item`,children:[(0,V.jsx)(`span`,{className:`legend-dots`,children:x.map(e=>(0,V.jsx)(`span`,{className:`legend-dot`,style:{background:lu[e].color},title:lu[e].label},e))}),x.length===1?`Constat ouvert (${lu[x[0]].label.toLowerCase()})`:`Constat ouvert (couleur de la gravité la plus haute)`]})]}),(0,V.jsx)(`span`,{className:`spacer`}),D&&(0,V.jsxs)(`span`,{className:`diagram-hint`,children:[(0,V.jsx)(H,{name:`move`,color:`#646b7b`,size:12}),`Glisser pour parcourir le schéma`]}),(0,V.jsxs)(`div`,{className:`icon-button-group diagram-zoom`,children:[(0,V.jsx)(`button`,{type:`button`,className:`icon-button`,title:`Zoom arrière`,"aria-label":`Zoom arrière`,onClick:()=>k(1/Kf),children:(0,V.jsx)(H,{name:`minus`,color:`#9aa1b1`})}),(0,V.jsx)(`button`,{type:`button`,className:`icon-button`,title:`Zoom avant`,"aria-label":`Zoom avant`,onClick:()=>k(Kf),children:(0,V.jsx)(H,{name:`plus`,color:`#9aa1b1`})}),(0,V.jsxs)(`button`,{type:`button`,className:`button button-secondary diagram-control`,title:`Recentrer et adapter le zoom`,onClick:()=>m(null),children:[(0,V.jsx)(H,{name:`focus`,color:`#9aa1b1`}),`Ajuster`]}),(0,V.jsxs)(`button`,{type:`button`,className:`button button-secondary diagram-control`,"aria-pressed":s,onClick:()=>void ee(),children:[(0,V.jsx)(H,{name:s?`minimize`:`maximize`,color:`#9aa1b1`}),s?`Quitter le plein écran`:`Plein écran`]})]})]}),l&&(0,V.jsx)(`p`,{className:`diagram-fullscreen-error`,role:`alert`,children:l})]})}function fp({node:e,box:t,severity:n,onOpen:r}){let i=bu[e.status],{width:a,height:o}=t,s=e.location!==null,c=e.status===`missing`,l=Fd(e)?Rf(e):null,u=Id(e),d=Pd(e),f=e.shape===`pill`?20:16,p=l?f+22:a/2,m=u?o/2-8:o/2,h={className:`diagram-shape`,fill:i.fill??`transparent`,stroke:i.stroke,strokeWidth:c?1.5:1},g=[e.detail,e.location?`${e.location.path}${e.location.line?`:${e.location.line}`:``}`:null].filter(Boolean).join(`
67
+ `);return(0,V.jsxs)(`g`,{className:`diagram-node${s?` is-clickable`:``}`,transform:`translate(${t.x} ${t.y})`,onClick:s?()=>r(e):void 0,onKeyDown:s?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),r(e))}:void 0,tabIndex:s?0:void 0,role:s?`link`:void 0,children:[g&&(0,V.jsx)(`title`,{children:g}),e.shape===`decision`?(0,V.jsx)(`polygon`,{points:Wf(a,o),strokeLinejoin:`round`,...h}):(0,V.jsx)(`rect`,{width:a,height:o,rx:e.shape===`pill`?o/2:10,...h}),l&&(0,V.jsx)(`g`,{transform:`translate(${f} ${o/2-7})`,children:(0,V.jsx)(H,{name:l,size:14,color:i.accent})}),(0,V.jsx)(`text`,{x:p,y:m,textAnchor:l?`start`:`middle`,dominantBaseline:`central`,fill:i.text,fontSize:d.size,fontWeight:d.weight,className:d.mono?`diagram-label mono`:`diagram-label`,children:e.label}),u&&(0,V.jsx)(`text`,{x:a/2,y:o/2+10,textAnchor:`middle`,dominantBaseline:`central`,fill:i.accent,fontSize:jd.size,className:`diagram-label`,children:e.detail}),n&&(0,V.jsx)(`circle`,{cx:e.shape===`decision`?a-22:a-18,cy:o/2,r:3,fill:lu[n].color,children:(0,V.jsx)(`title`,{children:`Constat ${lu[n].label.toLowerCase()} ouvert sur ce fichier`})})]})}function pp({analysis:e,finding:t}){return(0,V.jsxs)(`a`,{className:`finding-row is-${t.status}`,href:ld(e,t),children:[(0,V.jsx)(ed,{severity:t.severity}),(0,V.jsxs)(`span`,{className:`finding-row-text`,children:[(0,V.jsxs)(`span`,{className:`finding-row-title`,children:[t.title,(0,V.jsx)(U,{kind:t.kind}),(0,V.jsx)(nd,{status:t.status})]}),(0,V.jsx)(`span`,{className:`finding-row-location mono`,children:Pu(t,e.request)})]}),(0,V.jsx)(H,{name:`chevron-right`,color:`#646b7b`})]})}function mp(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function hp({analysis:e}){let[t,n]=(0,v.useState)(new Set(Mc)),[r,i]=(0,v.useState)(new Set(Pc)),a=pl(e.findings).filter(e=>t.has(e.severity)&&r.has(e.status));return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`filters`,children:[(0,V.jsxs)(`div`,{className:`filter-group`,role:`group`,"aria-label":`Filtrer par gravité`,children:[(0,V.jsx)(`span`,{className:`filter-label`,children:`Gravité`}),Mc.map(r=>{let i=e.findings.filter(e=>e.severity===r).length,a=t.has(r);return(0,V.jsxs)(`button`,{type:`button`,"aria-pressed":a,className:`chip${a?` is-active`:``}`,style:a?{color:lu[r].color,background:lu[r].background}:void 0,title:`${Eu(i,`constat`)} de gravité « ${lu[r].label} », tous statuts confondus`,onClick:()=>n(mp(t,r)),children:[lu[r].label,` `,(0,V.jsx)(`span`,{className:`chip-count`,children:i})]},r)})]}),(0,V.jsxs)(`div`,{className:`filter-group`,role:`group`,"aria-label":`Filtrer par statut`,children:[(0,V.jsx)(`span`,{className:`filter-label`,children:`Statut`}),Pc.map(t=>{let n=e.findings.filter(e=>e.status===t).length,a=r.has(t);return(0,V.jsxs)(`button`,{type:`button`,"aria-pressed":a,className:`chip${a?` is-active is-neutral`:``}`,title:`${Eu(n,`constat`)} au statut « ${du[t]} »`,onClick:()=>i(mp(r,t)),children:[du[t],` `,(0,V.jsx)(`span`,{className:`chip-count`,children:n})]},t)})]})]}),(0,V.jsx)(`section`,{className:`card list-card`,children:a.length===0?(0,V.jsx)(`p`,{className:`list-empty`,children:e.findings.length===0?`L'agent n'a relevé aucun constat.`:`Aucun constat ne correspond aux filtres.`}):a.map(t=>(0,V.jsx)(pp,{analysis:e,finding:t},t.id))})]})}var gp={critical:`Critical`,major:`Major`,minor:`Minor`,trivial:`Trivial`},_p={approve:`Decision: Approve. The feature can be merged.`,request_changes:`Decision: Request changes. Rework the feature and address the points below.`,reject:`Decision: Reject. The feature is abandoned.`},vp=` `;function yp(e){return e.split(`
68
+ `).map(e=>e===``?``:`${vp}${e}`)}function bp(e,t){return[`${vp}${e}`,`${vp}\`\`\``,...yp(t),`${vp}\`\`\``]}function xp(e){return e.mode===`branch`?`branch ${e.base}...${e.head}`:`working tree changes against HEAD`}function Sp(e){let t=e.location;return t?`${t.path}:${hl(t.startLine,t.endLine)}`:null}function Cp(e,t){let n=Sp(t),r=t.kind===`requirement_gap`?`Missing requirement: ${t.title}`:t.title,i=`${e}. [${gp[t.severity]}] ${n?`${n} — `:``}${r}`;if(t.prompt!==null)return[i,...yp(t.prompt)];let a=[i];return t.body.trim()!==``&&a.push(...yp(t.body)),t.anchorText!==null&&a.push(...bp(`Current lines:`,t.anchorText)),t.suggestion!==null&&a.push(...bp(`Proposed replacement:`,t.suggestion)),a}function wp(e,t){let n=t.location?`${gl(t.location)} — `:``,[r,...i]=t.text.split(`
69
+ `);return[`${e}. [Reviewer note] ${n}${r}`,...i.map(e=>e===``?``:`${vp}${e}`)]}function Tp(e,t,n){let r=new Set(e.map(e=>e.id)),i=t.filter(e=>!r.has(e));if(i.length>0)throw Error(`Unknown ${n} id(s): ${i.join(`, `)}.`);let a=new Set(t);return e.filter(e=>a.has(e.id))}function Ep(e,t){let n=pl(Tp(e.findings,t.findingIds,`finding`)),r=Tp(e.notes,t.noteIds,`note`),i=[`Review feedback on "${e.title}" (${xp(e)}).`];if(e.overview!==null&&i.push(`Feature objective: ${e.overview.objective}`),t.decision!==null&&i.push(_p[t.decision]),i.push(``),n.length===0&&r.length===0)return i.push(`No points to address.`),i.join(`
70
+ `);i.push(`Address the following points:`);let a=1;for(let e of n)i.push(``,...Cp(a++,e));for(let e of r)i.push(``,...wp(a++,e));return i.join(`
71
+ `)}function Dp(e){return Ep(e,{findingIds:e.findings.filter(e=>e.status===`open`).map(e=>e.id),noteIds:[],decision:null})}var Op=5;function kp({analysis:e}){let t=B(e=>e.copy),n=pl(e.findings.filter(e=>e.status===`open`)),r=Mc.map(e=>({severity:e,count:n.filter(t=>t.severity===e).length}));return(0,V.jsxs)(V.Fragment,{children:[e.overview&&(0,V.jsxs)(`section`,{className:`card overview-card`,children:[(0,V.jsxs)(`h2`,{className:`card-title`,children:[(0,V.jsx)(H,{name:`focus`,color:`#8b97ff`}),`Vue d'ensemble`]}),(0,V.jsx)(`h3`,{className:`overview-label`,children:`Objectif`}),(0,V.jsx)(`p`,{className:`overview-text`,children:e.overview.objective}),(0,V.jsx)(`h3`,{className:`overview-label`,children:`Approche`}),(0,V.jsx)(`p`,{className:`overview-text`,children:e.overview.approach}),e.overview.attentionPoints.length>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h3`,{className:`overview-label`,children:`Points d'attention`}),(0,V.jsx)(`ul`,{className:`summary-list overview-points`,children:e.overview.attentionPoints.map((e,t)=>(0,V.jsx)(`li`,{children:e},t))})]})]}),(0,V.jsxs)(`section`,{className:`card summary-card`,children:[(0,V.jsxs)(`h2`,{className:`card-title`,children:[(0,V.jsx)(H,{name:`sparkles`,color:`#b18cff`}),`Ce que l'agent a fait`]}),e.summary.length>0?(0,V.jsx)(`ul`,{className:`summary-list`,children:e.summary.map((e,t)=>(0,V.jsx)(`li`,{children:e},t))}):(0,V.jsx)(`p`,{className:`empty-text`,children:`L'agent n'a pas encore rédigé de résumé (outil update_analysis).`})]}),e.request&&(0,V.jsxs)(`section`,{className:`card request-card`,children:[(0,V.jsxs)(`h2`,{className:`card-title`,children:[(0,V.jsx)(H,{name:`message-square`,color:`#9aa1b1`}),`Demande initiale`,e.request.source&&(0,V.jsx)(`span`,{className:`request-source mono`,children:e.request.source})]}),(0,V.jsx)(`p`,{className:`request-text`,children:e.request.text})]}),(0,V.jsxs)(`div`,{className:`section-head`,children:[(0,V.jsx)(`h2`,{className:`section-title`,children:`Constats ouverts`}),(0,V.jsx)(`div`,{className:`pill-row`,title:`Constats ouverts par gravité, exigences manquantes comprises`,children:r.filter(({count:e})=>e>0).map(({severity:e,count:t})=>(0,V.jsx)(`span`,{className:`pill`,style:{color:lu[e].color,background:lu[e].background},children:Du(e,t)},e))}),(0,V.jsx)(`span`,{className:`spacer`}),(0,V.jsxs)(`button`,{type:`button`,className:`button button-secondary button-medium`,disabled:n.length===0,title:n.length===0?`Aucun constat ouvert à transmettre.`:`Tous les constats ouverts, du plus grave au moins grave.`,onClick:()=>void t(Dp(e),`Prompt des constats ouverts copié dans le presse-papiers.`),children:[(0,V.jsx)(H,{name:`bot`,color:`#b18cff`}),`Copier le prompt pour l'agent`]})]}),(0,V.jsxs)(`section`,{className:`card list-card`,children:[n.length===0?(0,V.jsx)(`p`,{className:`list-empty`,children:e.findings.length===0?`L'agent n'a relevé aucun constat.`:`Aucun constat ouvert : tous sont ignorés ou obsolètes.`}):n.slice(0,Op).map(t=>(0,V.jsx)(pp,{analysis:e,finding:t},t.id)),e.findings.length>0&&(0,V.jsxs)(`a`,{className:`list-footer-link`,href:Hu.feature(e.id,`findings`),children:[`Voir les `,e.findings.length,` constats, tous statuts confondus`]})]})]})}var Ap={summary:`Résumé`,files:`Fichiers`,findings:`Constats`,diagrams:`Schémas`};function jp(e,t){if(t===`files`)return{count:e.files.length,title:Eu(e.files.length,`fichier modifié`,`fichiers modifiés`)};if(t===`findings`){let t=e.findings.filter(e=>e.status===`open`).length;return{count:t,title:`${Eu(t,`constat ouvert`,`constats ouverts`)}, exigences manquantes comprises · ${e.findings.length} au total`}}return t===`diagrams`?{count:e.diagrams.length,title:Eu(e.diagrams.length,`schéma`)}:null}function Mp(e){return e.mode===`branch`?`${hu.branch} ${Mu(e)} vers ${ju(e.base)}`:`${hu.working_tree} par rapport à HEAD`}function Np({analysis:e,tab:t}){let n=Lu(e),r=cd(e);return(0,V.jsxs)(`div`,{className:`page`,children:[(0,V.jsxs)(`div`,{className:`page-head`,children:[(0,V.jsxs)(`div`,{className:`page-head-text`,children:[(0,V.jsx)(`h1`,{className:`page-title`,children:e.title}),(0,V.jsxs)(`p`,{className:`page-meta`,children:[(0,V.jsxs)(`span`,{children:[Mp(e),` · produite `,Su(e.snapshotAt),` · `,Eu(e.files.length,`fichier`)]}),(0,V.jsxs)(`span`,{className:`count-add mono`,children:[`+`,n.additions]}),(0,V.jsxs)(`span`,{className:`count-del mono`,children:[`−`,n.deletions]})]})]}),(0,V.jsx)(`button`,{type:`button`,className:`button button-primary button-large`,disabled:r===null,title:r===null?`L'analyse ne contient aucun fichier modifié.`:void 0,onClick:()=>r&&Uu(Hu.review(e.id,r)),children:`Commencer la revue`})]}),(0,V.jsx)(`nav`,{className:`tabs`,"aria-label":`Sections de l'analyse`,children:Ru.map(n=>{let r=jp(e,n);return(0,V.jsxs)(`a`,{href:Hu.feature(e.id,n),className:`tab${n===t?` is-active`:``}`,title:r?.title,children:[Ap[n],r!==null&&(0,V.jsx)(`span`,{className:`tab-count`,children:r.count})]},n)})}),(0,V.jsxs)(`div`,{className:`tab-panel`,children:[t===`summary`&&(0,V.jsx)(kp,{analysis:e}),t===`files`&&(0,V.jsx)(fd,{analysis:e}),t===`findings`&&(0,V.jsx)(hp,{analysis:e}),t===`diagrams`&&(0,V.jsx)(lp,{analysis:e})]})]})}var Pp={approve:{icon:`circle-check`,color:`#3fb950`,description:`La feature peut être fusionnée`},request_changes:{icon:`pencil`,color:`#e3a33b`,description:`L'agent reprend son travail`},reject:{icon:`circle-x`,color:`#f0625a`,description:`La feature est abandonnée`}};function Fp(e){let t=pl(e.findings.filter(e=>e.status===`open`)).map(e=>({key:`f:${e.id}`,finding:e})),n=e.notes.map(e=>({key:`n:${e.id}`,note:e}));return[...t,...n]}function Ip(e){let t=e.review;if(t.state===`submitted`){let n=new Set([...t.selectedFindingIds.map(e=>`f:${e}`),...t.selectedNoteIds.map(e=>`n:${e}`)]);return new Set(Fp(e).map(e=>e.key).filter(e=>!n.has(e)))}let n=t.previousSubmission;return n?new Set([...n.excludedFindingIds.map(e=>`f:${e}`),...n.excludedNoteIds.map(e=>`n:${e}`)]):new Set}function Lp({analysis:e}){let t=B(e=>e.copy),n=B(e=>e.submitReview),r=B(e=>e.notify),i=B(e=>e.saving),a=Fp(e),[o,s]=(0,v.useState)(()=>e.review.decision??e.review.previousSubmission?.decision??(a.length>0?`request_changes`:`approve`)),[c,l]=(0,v.useState)(()=>Ip(e)),u=a.filter(e=>!c.has(e.key)),d=u.flatMap(e=>e.finding?[e.finding.id]:[]),f=u.flatMap(e=>e.note?[e.note.id]:[]),p=Ep(e,{findingIds:d,noteIds:f,decision:o}),m=e.files.filter(e=>e.reviewed).length,h=e.review,g=e=>{let t=new Set(c);t.has(e)?t.delete(e):t.add(e),l(t)},_=async()=>{await n(o,d,f)&&r(`info`,`Retour enregistré : l'agent le lit avec l'outil get_review_feedback.`)},y=cd(e);return(0,V.jsxs)(`div`,{className:`page page-narrow`,children:[(0,V.jsx)(`h1`,{className:`page-title page-title-small`,children:`Terminer la revue`}),(0,V.jsxs)(`p`,{className:`page-meta`,children:[m,` / `,Eu(e.files.length,`fichier revu`,`fichiers revus`),` · `,Eu(d.length,`constat ouvert`,`constats ouverts`),` et`,` `,Eu(f.length,`remarque`),` à transmettre`]}),h.state===`submitted`&&h.submittedAt&&h.decision&&(0,V.jsxs)(`div`,{className:`submitted-banner`,children:[(0,V.jsx)(H,{name:`circle-check`,color:`#3fb950`,size:16}),(0,V.jsxs)(`span`,{children:[`Retour enregistré le `,Cu(h.submittedAt),` · décision « `,gu[h.decision],` ».`,` `,h.processed?`${wu(h.processed)}.`:h.decision===`approve`?`Approuvée : rien à traiter pour l'agent.`:`L'agent le lit avec l'outil get_review_feedback ; il n'est pas encore traité.`,` `,`Un nouvel enregistrement le remplace.`]})]}),h.state===`pending`&&h.previousSubmission&&(0,V.jsxs)(`div`,{className:`submitted-banner is-reopened`,children:[(0,V.jsx)(H,{name:`pencil`,color:`#e3a33b`,size:16}),(0,V.jsxs)(`span`,{children:[`Revue modifiée depuis le retour du `,Cu(h.previousSubmission.submittedAt),` : l'agent ne le traite plus. Enregistrez-la à nouveau pour qu'il traite la nouvelle version ; il verra ce qui a changé.`]})]}),(0,V.jsx)(`h2`,{className:`field-label`,children:`Décision`}),(0,V.jsx)(`div`,{className:`decisions`,role:`radiogroup`,"aria-label":`Décision`,children:Vc.map(e=>(0,V.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":o===e,className:`decision${o===e?` is-selected`:``}`,onClick:()=>s(e),children:[(0,V.jsx)(H,{name:Pp[e].icon,color:Pp[e].color,size:16}),(0,V.jsxs)(`span`,{className:`decision-text`,children:[(0,V.jsx)(`span`,{className:`decision-title`,children:gu[e]}),(0,V.jsx)(`span`,{className:`decision-description`,children:Pp[e].description})]})]},e))}),(0,V.jsxs)(`div`,{className:`field-head`,children:[(0,V.jsx)(`h2`,{className:`field-label`,children:`Points à transmettre`}),(0,V.jsxs)(`span`,{className:`field-meta`,children:[u.length,` sur `,a.length,` sélectionnés`]})]}),(0,V.jsxs)(`div`,{className:`card points`,children:[a.length===0&&(0,V.jsx)(`p`,{className:`list-empty`,children:`Aucun constat ouvert ni remarque : le retour ne contiendra que la décision.`}),a.map(t=>{let n=!c.has(t.key);return(0,V.jsxs)(`label`,{className:`point${n?``:` is-excluded`}`,children:[(0,V.jsx)(`input`,{type:`checkbox`,className:`visually-hidden`,checked:n,onChange:()=>g(t.key)}),(0,V.jsx)(H,{name:n?`square-check`:`square`,color:n?`#8b97ff`:`#646b7b`,size:16}),t.finding?(0,V.jsx)(ed,{severity:t.finding.severity}):(0,V.jsx)(td,{}),(0,V.jsx)(`span`,{className:`point-title`,children:t.finding?t.finding.title:t.note.text}),(0,V.jsx)(`span`,{className:`point-location mono`,children:t.finding?Pu(t.finding,e.request):Fu(t.note)})]},t.key)})]}),(0,V.jsx)(`h2`,{className:`field-label`,children:`Prompt pour l'agent`}),(0,V.jsxs)(`div`,{className:`prompt-box`,children:[(0,V.jsx)(`pre`,{className:`prompt-text`,children:p}),(0,V.jsx)(`button`,{type:`button`,className:`icon-button prompt-copy`,title:`Copier le prompt`,"aria-label":`Copier le prompt`,onClick:()=>void t(p,`Prompt copié dans le presse-papiers.`),children:(0,V.jsx)(H,{name:`copy`,color:`#9aa1b1`})})]}),(0,V.jsxs)(`footer`,{className:`finish-footer`,children:[(0,V.jsx)(H,{name:`info`,color:`#646b7b`}),(0,V.jsx)(`span`,{className:`finish-hint`,children:`L'agent récupère ce retour avec l'outil get_review_feedback.`}),(0,V.jsx)(`span`,{className:`spacer`}),(0,V.jsx)(`button`,{type:`button`,className:`button button-secondary button-medium`,onClick:()=>Uu(y?Hu.review(e.id,y):Hu.feature(e.id)),children:`Retour à la revue`}),(0,V.jsxs)(`button`,{type:`button`,className:`button button-primary button-medium`,disabled:i,onClick:()=>void _(),children:[(0,V.jsx)(H,{name:`save`,color:`#ffffff`}),`Enregistrer le retour`]})]})]})}var Rp={to_review:{label:`À relire`,icon:`eye`,empty:`Aucune revue à faire : toutes les analyses sont soumises.`},processed:{label:`Traitées par l'agent`,icon:`clipboard-check`,empty:`Aucun retour traité par l'agent à vérifier.`},to_process:{label:`À traiter par l'agent`,icon:`hourglass`,empty:`Aucun retour n'attend l'agent.`},approved:{label:`Approuvées`,icon:`circle-check`,empty:`Aucune analyse approuvée.`},all:{label:`Toutes`,icon:`list`,empty:`Aucune analyse.`}};function zp({counts:e}){let t=B(e=>e.homeFilter),n=B(e=>e.setHomeFilter);return(0,V.jsx)(`nav`,{className:`home-filters`,"aria-label":`Filtrer les analyses`,children:qu.map(r=>{let i=r===t,a=r===`processed`&&e.processed>0;return(0,V.jsxs)(`button`,{type:`button`,className:`home-filter${i?` is-active`:``}${a?` is-highlighted`:``}${r===`all`?` is-all`:``}`,"aria-pressed":i,onClick:()=>n(r),children:[(0,V.jsx)(H,{name:Rp[r].icon,size:16,color:a?vu.color:`#9aa1b1`}),(0,V.jsx)(`span`,{className:`home-filter-label`,children:Rp[r].label}),(0,V.jsx)(`span`,{className:`home-filter-count`,children:e[r]})]},r)})})}function Bp({analysis:e}){let t=e.progress.processed;return t?(0,V.jsxs)(`span`,{className:`home-row-processing`,children:[(0,V.jsx)(H,{name:`corner-down-right`,size:12,color:vu.color}),t.note===null?`Traitée par l'agent`:`Note de l'agent : ${t.note}`,` · le `,Cu(t.at)]}):null}function Vp({analysis:e}){let{reviewedFiles:t,totalFiles:n}=e.progress,r=Qu(e);return(0,V.jsxs)(`a`,{className:`home-row`,href:Hu.feature(e.id),children:[(0,V.jsxs)(`span`,{className:`home-row-body`,children:[(0,V.jsx)(`span`,{className:`home-row-title`,children:e.title}),(0,V.jsxs)(`span`,{className:`home-row-details`,children:[(0,V.jsxs)(`span`,{className:`home-row-meta`,children:[(0,V.jsx)(`span`,{className:`mono`,children:Nu(e)}),(0,V.jsxs)(`span`,{children:[`· `,Su(e.updatedAt)]})]}),(0,V.jsxs)(`span`,{className:`home-row-progress`,title:`${t} fichier(s) revu(s) sur ${n}`,children:[(0,V.jsx)(`span`,{className:`home-row-progress-bar`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":n,"aria-valuenow":t,children:(0,V.jsx)(`span`,{className:`progress-fill`,style:{width:`${$u(e)}%`}})}),(0,V.jsxs)(`span`,{className:`home-row-progress-label mono`,children:[t,`/`,n]})]}),(0,V.jsx)(`span`,{className:`home-row-findings`,children:r.length===0?(0,V.jsx)(`span`,{className:`home-row-none`,children:`Aucun constat ouvert`}):r.map(({severity:e,count:t})=>(0,V.jsx)(W,{severity:e,count:t,title:`${ku(e,t)}, exigences manquantes comprises`},e))}),(0,V.jsx)(`span`,{className:`home-row-state`,children:(0,V.jsx)(K,{progress:e.progress})})]}),(0,V.jsx)(Bp,{analysis:e})]}),(0,V.jsx)(H,{name:`chevron-right`,color:`#646b7b`})]})}function Hp({group:e}){let t=B(t=>t.collapsedProjects.has(e.project)),n=B(e=>e.toggleProject);return(0,V.jsxs)(`section`,{className:`home-project`,children:[(0,V.jsxs)(`button`,{type:`button`,className:`home-project-head`,"aria-expanded":!t,onClick:()=>n(e.project),children:[(0,V.jsx)(H,{name:t?`chevron-right`:`chevron-down`,color:`#646b7b`}),(0,V.jsx)(H,{name:`folder`,color:`#8b97ff`}),(0,V.jsx)(`span`,{className:`home-project-name`,children:e.project}),(0,V.jsx)(`span`,{className:`home-project-total`,children:Eu(e.analyses.length,`analyse`)}),(0,V.jsx)(`span`,{className:`spacer`}),(0,V.jsx)(`span`,{className:`home-project-counts`,children:e.counts.map(({state:e,count:t})=>(0,V.jsxs)(`span`,{className:`pill pill-small`,style:{color:_u[e].color,background:_u[e].background},children:[_u[e].label,` · `,t]},e))})]}),!t&&(0,V.jsx)(`div`,{className:`home-project-list`,children:e.analyses.map(e=>(0,V.jsx)(Vp,{analysis:e},e.id))})]})}function Up(){let e=B(e=>e.analyses),t=B(e=>e.unreadable),n=B(e=>e.listError),r=B(e=>e.homeFilter),i=B(e=>e.setHomeFilter);if(n)return(0,V.jsx)(`div`,{className:`empty-state`,children:(0,V.jsx)(`div`,{className:`empty-card`,children:(0,V.jsx)(`p`,{className:`error-text`,children:n})})});if(e===null)return(0,V.jsx)(`div`,{className:`empty-state`,children:(0,V.jsx)(`div`,{className:`empty-card`,children:(0,V.jsx)(`p`,{children:`Chargement des analyses…`})})});if(e.length===0&&t.length===0)return(0,V.jsx)(`div`,{className:`empty-state`,children:(0,V.jsxs)(`div`,{className:`empty-card`,children:[(0,V.jsx)(`h1`,{className:`empty-title`,children:`Aucune analyse à revoir`}),(0,V.jsxs)(`p`,{children:[`L'agent crée une analyse avec l'outil `,(0,V.jsx)(`code`,{children:`create_analysis`}),` une fois la feature développée. Elle apparaîtra ici automatiquement.`]})]})});let a=Zu(Yu(e,r)),o=new Set(e.map(e=>e.project)).size,s=Xu(e);return(0,V.jsxs)(`div`,{className:`page page-home`,children:[(0,V.jsx)(`div`,{className:`home-head`,children:(0,V.jsxs)(`div`,{className:`page-head-text`,children:[(0,V.jsx)(`h1`,{className:`page-title`,children:`Analyses`}),(0,V.jsxs)(`p`,{className:`page-meta`,children:[Eu(e.length,`analyse`),` · `,Eu(o,`projet`),` · `,s.to_review,` à relire`]})]})}),(0,V.jsxs)(`div`,{className:`home-layout`,children:[(0,V.jsx)(zp,{counts:s}),(0,V.jsxs)(`div`,{className:`home-projects`,children:[a.length===0&&e.length>0&&(0,V.jsxs)(`div`,{className:`card home-empty`,children:[(0,V.jsx)(`p`,{children:Rp[r].empty}),(0,V.jsx)(`button`,{type:`button`,className:`link-button accent`,onClick:()=>i(`all`),children:`Afficher toutes les analyses`})]}),a.map(e=>(0,V.jsx)(Hp,{group:e},e.project)),t.length>0&&(0,V.jsxs)(`section`,{className:`home-project`,children:[(0,V.jsxs)(`h2`,{className:`home-project-head is-static`,children:[(0,V.jsx)(H,{name:`triangle-alert`,color:`#f0625a`}),(0,V.jsx)(`span`,{className:`home-project-name`,children:`Analyses illisibles`})]}),(0,V.jsx)(`div`,{className:`home-project-list`,children:t.map(e=>(0,V.jsx)(`div`,{className:`home-row is-unreadable`,children:(0,V.jsxs)(`span`,{className:`home-row-body`,children:[(0,V.jsx)(`span`,{className:`home-row-title mono`,children:e.id}),(0,V.jsx)(`span`,{className:`home-row-meta error-text`,children:e.error})]})},e.id))})]})]})]})]})}function Wp(e,t){return t===1?`${e}`:`${e},${t}`}function Gp(e,t,n,r){let i=r.filter(e=>e.type!==`add`).length,a=r.filter(e=>e.type!==`del`).length,o=e.header.replace(/^@@[^@]*@@/,``);return{header:`@@ -${Wp(t,i)} +${Wp(n,a)} @@${o}`,oldStart:t,oldLines:i,newStart:n,newLines:a,lines:r}}function Kp(e){let t=e.lines.findIndex(e=>e.type!==`context`);return t===-1?e.lines.length:t}function qp(e,t){if(e.newContent===null)return null;let n=ml(e.newContent),r=new Set,i=[],a=0,o=0;e.hunks.forEach((s,c)=>{let l=s.newLines===0?s.newStart+1:s.newStart,u=l+s.newLines-1,d=e.hunks[c+1],f=d===void 0?n.length+1:d.newLines===0?d.newStart+1:d.newStart,p=Math.max(0,t[c]??0),m=l-1-o,h=f-1-u,g=Math.min(p,m),_=Math.min(p,h),v=a+s.oldLines-s.newLines,y=(e,t)=>(r.add(e),{type:`context`,oldNo:e+t,newNo:e,text:n[e-1]}),b=g===0&&_===0?s:Gp(s,(s.oldLines===0?s.oldStart+1:s.oldStart)-g,l-g,[...Array.from({length:g},(e,t)=>y(l-g+t,a)),...s.lines,...Array.from({length:_},(e,t)=>y(u+1+t,v))]);i.push({hunk:b,above:g,below:_,canGrow:g<m||_<h,joinsPrevious:c>0&&g===m}),a=v,o=u+_});let s=[];i.forEach((e,t)=>{e.joinsPrevious?s[s.length-1].push(t):s.push([t])});let c=s.map(e=>{if(e.length===1)return i[e[0]].hunk;let t=i[e[0]].hunk;return Gp(t,t.oldLines===0?t.oldStart+1:t.oldStart,t.newLines===0?t.newStart+1:t.newStart,e.flatMap(e=>i[e].hunk.lines))}),l=s.map(t=>({context:Kp(e.hunks[t[0]])+i[t[0]].above,members:t,canShrink:t.some(e=>i[e].above>0||i[e].below>0),canGrow:t.some(e=>i[e].canGrow)}));return{fileDiff:{...e,hunks:c},hunks:l,extras:i.map(e=>Math.max(e.above,e.below)),added:r}}function Jp(e,t,n){let r=[...e.extras];for(let i of e.hunks[t].members)r[i]=Math.max(0,r[i]+n*5);return r}var Yp={context:` `,add:`+`,del:`-`};function Xp(e){return e.mode===`branch`?`branch ${e.base}...${e.head}`:`working tree changes against HEAD`}function Zp(e,t){return t===0?null:hl(e,e+t-1)}function Qp(e){let t=1;for(let n of e.lines)t=Math.max(t,String(n.oldNo??``).length,String(n.newNo??``).length);let n=e=>String(e??``).padStart(t);return[e.header,...e.lines.map(e=>`${n(e.oldNo)} | ${n(e.newNo)} ${Yp[e.type]} ${e.text}`)]}function $p(e,t,n){let r=Zp(n.newStart,n.newLines),i=Zp(n.oldStart,n.oldLines),a=[`- File: ${t.path}${t.oldPath===null?``:` (renamed from ${t.oldPath})`}`,r===null?`- New side: no line (the section only removes code).`:`- New side (code after the feature): lines ${r}`,i===null?`- Old side: no line (the section only adds code).`:`- Old side (code before the feature): lines ${i}`];return[`Explain a section of code in the feature analysis "${e.title}" (analysis_id: "${e.id}", project "${e.project}").`,`Repository: ${e.repoPath} — ${Xp(e)}.`,``,`Section to explain:`,...a,``,`Code of the section, as frozen in the analysis (columns: old line | new line, then + added, - removed, or a space for context):`,"```",...Qp(n),"```",``,`What to do:`,`1. Read this code and what surrounds it (get_diff with analysis_id "${e.id}" and path "${t.path}", and the repository) until you understand what it does and how it works.`,`2. Record your explanations in the feature analyzer with add_explanations (analysis_id "${e.id}", path "${t.path}"): one explanation per meaningful block of the section, covering it from its first to its last line. Use "side": "new" with new-side line numbers for added or kept code, and "side": "old" with old-side line numbers for removed code.`,`3. In each explanation, say what the code does (inputs, outputs, effects), then how it works, step by step in the order of the code; name the key variables and the edge cases it handles. For removed code, say what it did and what replaces it. Describe, do not judge.`,`4. If an explanation of the analysis already covers these lines (see get_analysis), rewrite it with update_explanation instead of adding a duplicate.`,`5. Then tell me in a few lines which explanations you recorded.`].join(`
72
+ `)}function em(e){return`${e===0?0:1},${e}`}function tm(e){if(e.newContent===null)return null;let t=ml(e.newContent),n=[],r=1,i=0,a=e=>{for(;r<=e;r++)n.push({type:`context`,oldNo:r+i,newNo:r,text:t[r-1]})};for(let t of e.hunks)a(t.newLines===0?t.newStart:t.newStart-1),n.push(...t.lines),r+=t.newLines,i+=t.oldLines-t.newLines;a(t.length);let o=t.length+i,s={header:`@@ -${em(o)} +${em(t.length)} @@`,oldStart:o===0?0:1,oldLines:o,newStart:t.length===0?0:1,newLines:t.length,lines:n};return{path:e.path,hunks:[s],newContent:e.newContent}}function nm({anchorText:e,suggestion:t}){let n=ml(e),r=ml(t);return(0,V.jsxs)(`div`,{className:`fix`,children:[n.map((e,t)=>(0,V.jsxs)(`div`,{className:`fix-line is-del`,children:[(0,V.jsx)(`span`,{className:`fix-marker`,children:`−`}),(0,V.jsx)(`span`,{className:`fix-code`,children:e})]},`del-${t}`)),r.map((e,t)=>(0,V.jsxs)(`div`,{className:`fix-line is-add`,children:[(0,V.jsx)(`span`,{className:`fix-marker`,children:`+`}),(0,V.jsx)(`span`,{className:`fix-code`,children:e})]},`add-${t}`)),r.length===0&&(0,V.jsx)(`div`,{className:`fix-empty`,children:`Les lignes visées sont supprimées.`})]})}function rm({analysis:e,finding:t,onAddNote:n}){let r=B(e=>e.setFindingStatus),i=B(e=>e.copy),a=B(e=>e.saving),o=t.location;return(0,V.jsxs)(`article`,{className:`finding-card is-${t.status}`,id:`finding-${t.id}`,children:[(0,V.jsxs)(`header`,{className:`finding-head`,children:[(0,V.jsx)(ed,{severity:t.severity}),(0,V.jsx)(`h3`,{className:`finding-title`,children:t.title}),(0,V.jsx)(U,{kind:t.kind}),(0,V.jsx)(nd,{status:t.status}),o&&(0,V.jsx)(`span`,{className:`finding-lines mono`,children:Iu(o.startLine,o.endLine)})]}),t.body.trim()!==``&&(0,V.jsx)(`p`,{className:`finding-body`,children:t.body}),t.status===`outdated`&&(0,V.jsx)(`p`,{className:`finding-outdated`,children:`Les lignes visées ont changé depuis la rédaction de ce constat : l'agent doit le réancrer avec update_finding.`}),t.suggestion!==null&&t.anchorText!==null&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`finding-section-title`,children:`Correctif proposé`}),(0,V.jsx)(nm,{anchorText:t.anchorText,suggestion:t.suggestion})]}),(0,V.jsxs)(`footer`,{className:`finding-actions`,children:[(0,V.jsxs)(`button`,{type:`button`,className:`button button-secondary`,onClick:()=>void i(Ep(e,{findingIds:[t.id],noteIds:[],decision:null}),`Prompt du constat copié dans le presse-papiers.`),children:[(0,V.jsx)(H,{name:`bot`,color:`#b18cff`}),`Copier le prompt pour l'agent`]}),t.status===`open`&&(0,V.jsx)(`button`,{type:`button`,className:`link-button muted`,disabled:a,onClick:()=>void r(t.id,`ignored`),children:`Ignorer`}),t.status===`ignored`&&(0,V.jsx)(`button`,{type:`button`,className:`link-button muted`,disabled:a,onClick:()=>void r(t.id,`open`),children:`Rouvrir`}),(0,V.jsx)(`span`,{className:`spacer`}),n&&(0,V.jsx)(`button`,{type:`button`,className:`link-button accent`,onClick:n,children:`Ajouter une remarque`})]})]})}function im({entry:e,small:t}){let n=lu[e.finding.severity];return(0,V.jsx)(`span`,{className:`finding-number${t?` is-small`:``}`,style:{color:n.color,background:n.background,borderColor:n.color},"aria-label":`Constat ${e.number}`,children:e.number})}function am(e,t){return e===`applied`?t?`Correctif appliqué dans le code`:`Appliquer le correctif dans le code`:t?`Correctif affiché dans le code`:`Afficher le correctif dans le code`}function om({analysis:e,entry:t,fix:n,mode:r,onToggleFix:i,onAddNote:a,highlighted:o}){let s=B(e=>e.setFindingStatus),c=B(e=>e.copy),l=B(e=>e.saving),{finding:u}=t,d=lu[u.severity],f=n.state===`shown`,p=r===`off`||n.state===`blocked`;return(0,V.jsxs)(`article`,{className:`margin-card is-${u.status}${f?` is-fix-shown`:``}${o?` is-target`:``}`,id:`finding-${u.id}`,"data-finding-card":u.id,style:{"--severity":d.color},children:[(0,V.jsxs)(`header`,{className:`margin-card-head`,children:[(0,V.jsx)(im,{entry:t}),(0,V.jsx)(`span`,{className:`pill pill-small margin-card-severity`,style:{color:d.color,background:d.background},children:d.label}),(0,V.jsx)(U,{kind:u.kind}),(0,V.jsx)(nd,{status:u.status}),(0,V.jsxs)(`span`,{className:`margin-card-lines mono`,children:[`l. `,hl(t.startLine,t.endLine,`–`)]})]}),(0,V.jsx)(`h3`,{className:`margin-card-title`,children:u.title}),u.body.trim()!==``&&(0,V.jsx)(`p`,{className:`margin-card-body`,children:u.body}),u.status===`outdated`&&(0,V.jsx)(`p`,{className:`finding-outdated`,children:`Les lignes visées ont changé depuis la rédaction de ce constat : l'agent doit le réancrer avec update_finding.`}),(n.state===`shown`||n.state===`hidden`||n.state===`blocked`)&&(0,V.jsxs)(`label`,{className:`fix-toggle${f?` is-on`:``}${p?` is-disabled`:``}`,children:[(0,V.jsx)(`input`,{type:`checkbox`,className:`visually-hidden`,checked:f,disabled:p,onChange:e=>i(e.target.checked)}),(0,V.jsx)(`span`,{className:`switch`,"aria-hidden":`true`}),am(r,f)]}),r===`off`&&n.state===`hidden`&&(0,V.jsx)(`p`,{className:`margin-card-hint`,children:`Choisissez « Avant / après » ou « Code corrigé » pour afficher le correctif.`}),n.state===`blocked`&&(0,V.jsx)(`p`,{className:`margin-card-hint`,children:r===`applied`?`Ses lignes recouvrent le correctif du constat ${n.blockedBy} : retirez-le pour appliquer celui-ci dans le code.`:`Ses lignes recouvrent le correctif du constat ${n.blockedBy} : masquez-le pour afficher celui-ci dans le code.`}),n.state===`outside`&&u.suggestion!==null&&u.anchorText!==null&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:`margin-card-hint`,children:`Les lignes visées ne sont pas toutes affichées dans le diff : voici le correctif proposé.`}),(0,V.jsx)(nm,{anchorText:u.anchorText,suggestion:u.suggestion})]}),(0,V.jsxs)(`footer`,{className:`margin-card-actions`,children:[(0,V.jsxs)(`button`,{type:`button`,className:`margin-button`,onClick:()=>void c(Ep(e,{findingIds:[u.id],noteIds:[],decision:null}),`Prompt du constat copié dans le presse-papiers.`),children:[(0,V.jsx)(H,{name:`bot`,color:`#b18cff`}),`Copier le prompt`]}),u.status===`open`&&(0,V.jsxs)(`button`,{type:`button`,className:`margin-button`,disabled:l,onClick:()=>void s(u.id,`ignored`),children:[(0,V.jsx)(H,{name:`eye-off`,color:`#9aa1b1`}),`Ignorer`]}),u.status===`ignored`&&(0,V.jsxs)(`button`,{type:`button`,className:`margin-button`,disabled:l,onClick:()=>void s(u.id,`open`),children:[(0,V.jsx)(H,{name:`rotate-ccw`,color:`#9aa1b1`}),`Rouvrir`]}),a&&(0,V.jsxs)(`button`,{type:`button`,className:`margin-button`,onClick:a,children:[(0,V.jsx)(H,{name:`message-square`,color:`#9aa1b1`}),`Remarque`]})]})]})}function sm({label:e,options:t,value:n,onChange:r,disabled:i}){let[a,o]=(0,v.useState)(null),s=a!==null,c=(0,v.useRef)(null),l=(0,v.useRef)(null);(0,v.useEffect)(()=>{if(!s)return;let e=()=>o(null),t=t=>{c.current?.contains(t.target)||e()},n=t=>{t.key===`Escape`&&e()};return document.addEventListener(`mousedown`,t),document.addEventListener(`keydown`,n),document.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{document.removeEventListener(`mousedown`,t),document.removeEventListener(`keydown`,n),document.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[s]);let u=()=>{let e=l.current?.getBoundingClientRect();o(s||!e?null:{top:e.bottom+6,right:window.innerWidth-e.right})},d=t[n];return(0,V.jsxs)(`div`,{className:`option-menu`,ref:c,children:[(0,V.jsxs)(`button`,{ref:l,type:`button`,className:`option-menu-button${s?` is-open`:``}`,"aria-haspopup":`listbox`,"aria-expanded":s,title:e,onClick:u,children:[(0,V.jsx)(H,{name:d.icon,color:s?`#c3caff`:`#9aa1b1`}),(0,V.jsx)(`span`,{className:`option-menu-value`,children:d.label}),(0,V.jsx)(H,{name:s?`chevron-up`:`chevron-down`,size:12,color:s?`#9aa1b1`:`#646b7b`})]}),a&&(0,V.jsxs)(`div`,{className:`option-menu-list`,role:`listbox`,"aria-label":e,style:a,children:[(0,V.jsx)(`div`,{className:`option-menu-title`,children:e}),Object.keys(t).map(e=>{let a=t[e],s=i?.[e],c=e===n;return(0,V.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":c,className:`option-menu-item${c?` is-selected`:``}`,disabled:s!==void 0,onClick:()=>{o(null),r(e)},children:[(0,V.jsx)(H,{name:a.icon,color:c?`#c3caff`:`#9aa1b1`}),(0,V.jsxs)(`span`,{className:`option-menu-item-text`,children:[(0,V.jsx)(`span`,{className:`option-menu-item-label`,children:a.label}),(0,V.jsx)(`span`,{className:`option-menu-item-description`,children:s??a.description})]}),c&&(0,V.jsx)(H,{name:`check`,color:`#c3caff`})]},e)})]})]})}var cm=4,lm=6;function um(e,t){let n=e.getBoundingClientRect();return{top:n.top+t,bottom:n.bottom}}function dm(e){if(e.kind===`note`)return{color:uu.color,title:`Remarque · ligne ${e.line}`,detail:null};let{finding:t,number:n}=e.entry;return{color:lu[t.severity].color,title:`Constat ${n} · ${lu[t.severity].label}`,detail:t.title}}function fm({model:e,rowsRef:t,scrollRef:n,toolbarHeight:r}){let i=(0,v.useRef)(null),a=(0,v.useRef)(!1),[o,s]=(0,v.useState)(0),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(null);(0,v.useLayoutEffect)(()=>{let e=t.current;if(!e)return;let n=()=>{let t=e.offsetHeight,n=e.querySelectorAll(`:scope > .hunk > :not(.hunk-header)`);if(t===0||n.length===0)return p(null);let r=Array.from(n,e=>e.offsetTop/t),i=n[n.length-1];p([...r,(i.offsetTop+i.offsetHeight)/t])};n();let r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[t,e]),(0,v.useEffect)(()=>{let e=n.current,i=t.current;if(!e||!i)return;let a=()=>{let t=um(e,r),n=i.getBoundingClientRect();if(s(Math.max(Math.min(t.bottom-t.top,n.height),0)),n.height===0)return l(null);let a=Math.max(t.top,n.top),o=Math.min(t.bottom,n.bottom);l({top:(a-n.top)/n.height,height:Math.max(o-a,0)/n.height})};a(),e.addEventListener(`scroll`,a,{passive:!0});let o=new ResizeObserver(a);return o.observe(e),o.observe(i),()=>{e.removeEventListener(`scroll`,a),o.disconnect()}},[n,t,r]);let m=e=>{let a=n.current,o=t.current,s=i.current;if(!a||!o||!s)return;let c=s.getBoundingClientRect(),l=Math.min(Math.max((e-c.top)/c.height,0),1),u=um(a,r),d=o.getBoundingClientRect();a.scrollTop+=d.top+l*d.height-(u.top+u.bottom)/2},h=e=>{e.button===0&&(a.current=!0,e.currentTarget.setPointerCapture(e.pointerId),d(null),m(e.clientY))},g=e=>{a.current&&m(e.clientY)},_=()=>{a.current=!1},y=(e,t)=>{a.current||d({top:cm+e*(o-8),...t})},b=e=>f?.[e]??0;return(0,V.jsx)(`div`,{className:`diff-minimap`,children:(0,V.jsxs)(`div`,{className:`diff-minimap-track`,style:{top:r,height:o},children:[(0,V.jsxs)(`div`,{ref:i,className:`diff-minimap-inner`,"aria-hidden":`true`,onPointerDown:h,onPointerMove:g,onPointerUp:_,onPointerCancel:_,onPointerLeave:()=>d(null),children:[(0,V.jsx)(`div`,{className:`minimap-lane is-changes`,children:f&&e.changes.map((e,t)=>(0,V.jsx)(`span`,{className:`minimap-change is-${e.kind}`,style:{top:`${b(e.start)*100}%`,height:`${(b(e.end)-b(e.start))*100}%`},onPointerEnter:()=>y(b(e.start),{color:pm(e.kind),title:e.label,detail:null})},t))}),(0,V.jsx)(`div`,{className:`minimap-lane is-dots`,children:f&&e.dots.map(e=>(0,V.jsx)(`span`,{className:`minimap-dot is-${e.kind}${e.kind===`finding`&&e.entry.finding.status!==`open`?` is-muted`:``}`,style:{top:`${b(e.row)*100}%`,"--dot":dm(e).color},onPointerEnter:()=>y(b(e.row),dm(e))},e.kind===`note`?`note-${e.line}`:e.entry.finding.id))}),c&&(0,V.jsx)(`div`,{className:`minimap-view`,style:{top:`${c.top*100}%`,height:`${c.height*100}%`}})]}),u&&(0,V.jsxs)(`div`,{className:`minimap-tooltip`,style:u.top>o/2?{bottom:o-u.top-lm}:{top:u.top-lm},children:[(0,V.jsxs)(`span`,{className:`minimap-tooltip-title`,children:[(0,V.jsx)(`span`,{className:`minimap-tooltip-swatch`,style:{background:u.color}}),u.title]}),u.detail&&(0,V.jsx)(`span`,{className:`minimap-tooltip-detail`,children:u.detail})]})]})})}function pm(e){switch(e){case`add`:return`var(--add)`;case`del`:return`var(--del)`;case`mod`:return`linear-gradient(90deg, var(--del) 50%, var(--add) 50%)`;case`reindent`:return`var(--accent-soft)`}}var mm=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function hm(e){return gm(e)}function gm(e){return Array.isArray(e)?_m(e):e instanceof RegExp?e:typeof e==`object`?vm(e):e}function _m(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=gm(e[n]);return t}function vm(e){let t={};for(let n in e)t[n]=gm(e[n]);return t}function ym(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function bm(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?bm(e.substring(0,e.length-1)):e.substr(~t+1)}var xm=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Sm=class{static hasCaptures(e){return e!==null&&(xm.lastIndex=0,xm.test(e))}static replaceCaptures(e,t,n){return e.replace(xm,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function Cm(e,t){return e<t?-1:+(e>t)}function wm(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=Cm(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function Tm(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Em(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Dm=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},Om=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Nm(e),t)}static createFromParsedTheme(e,t){return Im(e,t)}_cachedMatchRoot=new Dm(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>Am(e.parent,t.parentScopes));return n?new Mm(n.fontStyle,n.foreground,n.background):null}},km=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Am(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!jm(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function jm(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var Mm=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Nm(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&Tm(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&Tm(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new Pm(l,u,e,o,s,c)}}return n}var Pm=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},Fm=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(Fm||{});function Im(e,t){e.sort((e,t)=>{let n=Cm(e.scope,t.scope);return n!==0||(n=wm(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new Lm(t),o=new Mm(n,a.getId(r),a.getId(i)),s=new Bm(new zm(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new Om(a,o,s)}var Lm=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Rm=Object.freeze([]),zm=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||Rm,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},Bm=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),zm.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(wm(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new zm(e,t,n,r,i))}},Vm=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=Um(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function Hm(e){return e}function Um(e){return e}function Wm(e,t){let n=[],r=Km(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(Gm(i)){let e=[];do e.push(i),i=r.next();while(Gm(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function Gm(e){return!!e&&!!e.match(/[\w\.:]+/)}function Km(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function qm(e){typeof e.dispose==`function`&&e.dispose()}var Jm=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Ym=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Xm=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Zm=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Jm(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new Xm;for(let n of e)Qm(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof Jm){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function Qm(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof Jm?eh({baseGrammar:a,selfGrammar:i},r):$m(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new Jm(e))}function $m(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];th([r],t,n)}}function eh(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&th(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&th(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function th(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?ym({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&th(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=sh(i);switch(a.kind){case 0:eh({...t,selfGrammar:t.baseGrammar},n);break;case 1:eh(t,n);break;case 2:$m(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?$m(a.ruleName,i,n):eh(i,n)}else a.kind===4?n.add(new Ym(a.scopeName,a.ruleName)):n.add(new Jm(a.scopeName))}}}var nh=class{kind=0},rh=class{kind=1},ih=class{constructor(e){this.ruleName=e}kind=2},ah=class{constructor(e){this.scopeName=e}kind=3},oh=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function sh(e){if(e===`$base`)return new nh;if(e===`$self`)return new rh;let t=e.indexOf(`#`);return t===-1?new ah(e):t===0?new ih(e.substring(1)):new oh(e.substring(0,t),e.substring(t+1))}var ch=/\\(\d+)/,lh=/\\(\d+)/g,uh=-1,dh=-2;function fh(e){return e}function ph(e){return e}var mh=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Sm.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Sm.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${bm(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Sm.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Sm.replaceCaptures(this._contentName,e,t)}},hh=class extends mh{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},gh=class extends mh{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new xh(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Sh,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},_h=class extends mh{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Sh,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},vh=class extends mh{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new xh(i,this.id),this.beginCaptures=a,this._end=new xh(o||`￿`,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Sh;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},yh=class extends mh{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new xh(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new xh(o,dh),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Sh;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Sh,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},bh=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new hh(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new gh(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=ym({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new _h(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new yh(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new vh(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=sh(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof _h||e instanceof vh||e instanceof yh)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},xh=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&ch.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return lh.lastIndex=0,this.source.replace(lh,(e,t)=>Em(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=`￿`,t[i+1]=`￿`,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=`￿`,t[i+1]=`G`,n[i+1]=`￿`,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Sh=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Ch(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new Ch(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Ch=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
73
+ `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},wh=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Th=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new wh(e,8),this._embeddedLanguagesMatcher=new Eh(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new wh(0,0);_getBasicScopeAttributes=new Dm(e=>new wh(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Eh=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>Em(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var Dh=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Oh(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=kh(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new Dh(i,!0);f()}return new Dh(i,!1);function f(){let o=Ah(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===uh){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),Fh(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof vh){let r=o;Fh(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof yh){let r=o;Fh(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(Fh(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function kh(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof yh&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=Ph(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==dh){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),Fh(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Ah(e,t,n,r,i,a){let o=jh(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Mh(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function jh(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=Nh(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Mh(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=Nh(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function Nh(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Ph(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Fh(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));Oh(e,p,n&&d.start===0,d.start,f,i,!1,0),qm(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new Ih(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var Ih=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Lh(e,t,n,r,i,a,o,s){return new Vh(e,t,n,r,i,a,o,s)}function Rh(e,t,n,r,i){let a=Wm(t,zh),o=bh.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function zh(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(Bh(t[r],e))return n=r+1,!0;return!1})}function Bh(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var Vh=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new Th(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Hh(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=Wm(e,zh);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)Rh(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&Rh(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(fh(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[ph(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Hh(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=bh.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Wh.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=Vm.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?Uh.createRootAndLookUpScopeName(a,r,this):Uh.createRoot(`unknown`,r),t=new Wh(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
74
+ `;let a=this.createOnigString(e),o=a.content.length,s=new Kh(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Oh(this,a,i,0,t,s,!0,r);return qm(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Hh(e,t){return e=hm(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Uh=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=km.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new km(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new km(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(1)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),Vm.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},Wh=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?Uh.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(1)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:ph(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=Uh.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,fh(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Uh.fromExtension(r,n.contentNameScopesList))}},Gh=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):Wm(e,zh).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>Wm(e,zh).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Kh=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=Vm.set(n,0,Hm(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=Vm.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},qh=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,Lh(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},Jh=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new qh(Om.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(Om.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new Gh(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new Zm(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},Yh=Wh.NULL;function Xh(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 Zh(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Qh(e){return Array.isArray(e)?e:[e]}async function $h(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function eg(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function tg(e){return e===`ansi`||eg(e)}function ng(e){return e===`none`}function rg(e){return ng(e)}var ig=/(\r?\n)/g;function ag(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(ig),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var og={light:`#333333`,dark:`#bbbbbb`},sg={light:`#fffffe`,dark:`#1e1e1e`},cg=`__shiki_resolved`;function lg(e){if(e?.[cg])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`?og.light:og.dark,n||=t.type===`light`?sg.light:sg.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,cg,{enumerable:!1,writable:!1,value:!0}),t}async function ug(e){return[...new Set((await Promise.all(e.filter(e=>!tg(e)).map(async e=>await $h(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function dg(e){return(await Promise.all(e.map(async e=>rg(e)?null:lg(await $h(e))))).filter(e=>!!e)}function fg(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 mm(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var pg=class extends Jh{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=lg(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=Om.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=fg(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._syncRegistry?._grammars?.get(e.scopeName)?.dispose(),this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new mm(`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))}},mg=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).includes(e.scopeName)||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}},hg=0;function gg(e){hg+=1,e.warnings!==!1&&hg>=10&&hg%10==0&&console.warn(`[Shiki] ${hg} 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 mm("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(lg),i=new pg(new mg(e.engine,n),r,n,e.langAlias),a;function o(t){return fg(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new mm(`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 mm(`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 ug(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await dg(e))}function g(){if(t)throw new mm(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--hg)}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 _g(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([dg(e.themes||[]),ug(e.langs||[]),e.engine]);return gg({...e,themes:t,langs:n,engine:r})}var vg=new WeakMap;function yg(e,t){vg.set(e,t)}function bg(e){return vg.get(e)}var xg=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(Qh(n).map(e=>[e,Yh])),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 Sg(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Sg(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 Cg(e,t){if(!(e instanceof xg))throw new mm(`Invalid grammar state`);return e.getInternalStack(t)}var wg=/,/,Tg=/ /;function Eg(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(eg(e.resolveLangAlias(n.lang||`text`))||ng(r))return ag(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new mm(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new mm(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return Og(t,o,i,a,n)}function Dg(...e){if(e.length===2)return bg(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(eg(i)||ng(a))throw new mm(`Plain language does not have grammar state`);if(i===`ansi`)throw new mm(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new xg(kg(n,c,o,s,r).stateStack,c.name,o.name)}function Og(e,t,n,r,i){let a=kg(e,t,n,r,i),o=new xg(a.stateStack,t.name,n.name);return yg(a.tokens,o),a.tokens}function kg(e,t,n,r,i){let a=Xh(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=ag(e),u=i.grammarState?Cg(i.grammarState,n.name)??Yh:i.grammarContextCode==null?Yh:kg(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=Zh(r[Vm.getForeground(s)],a),u=Vm.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=Vm.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(wg).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(Tg))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?Ag(t.scopes):jg(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function Ag(e){return e.map(e=>({scopeName:e}))}function jg(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:Pg(e,i,t.slice(0,r))}}return n}function Mg(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function Ng(e,t,n){if(!Mg(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Mg(e[r],n[i])&&--r,--i;return r===-1}function Pg(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(Ng(e,t,n)){r.push(a);break}return r}function Fg(e,t,n,r=Eg){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:bg(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=Ig(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new xg(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&yg(s,c),s}function Ig(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var Lg=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],Rg=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Rg.prototype.normal={},Rg.prototype.property={},Rg.prototype.space=void 0;function zg(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Rg(n,r,t)}function Bg(e){return e.toLowerCase()}var Vg=class{constructor(e,t){this.attribute=t,this.property=e}};Vg.prototype.attribute=``,Vg.prototype.booleanish=!1,Vg.prototype.boolean=!1,Vg.prototype.commaOrSpaceSeparated=!1,Vg.prototype.commaSeparated=!1,Vg.prototype.defined=!1,Vg.prototype.mustUseProperty=!1,Vg.prototype.number=!1,Vg.prototype.overloadedBoolean=!1,Vg.prototype.property=``,Vg.prototype.spaceSeparated=!1,Vg.prototype.space=void 0;var Hg=s({boolean:()=>Z,booleanish:()=>Wg,commaOrSpaceSeparated:()=>Jg,commaSeparated:()=>qg,number:()=>Q,overloadedBoolean:()=>Gg,spaceSeparated:()=>Kg}),Ug=0,Z=Yg(),Wg=Yg(),Gg=Yg(),Q=Yg(),Kg=Yg(),qg=Yg(),Jg=Yg();function Yg(){return 2**++Ug}var Xg=Object.keys(Hg),Zg=class extends Vg{constructor(e,t,n,r){let i=-1;if(super(e,t),Qg(this,`space`,r),typeof n==`number`)for(;++i<Xg.length;){let e=Xg[i];Qg(this,Xg[i],(n&Hg[e])===Hg[e])}}};Zg.prototype.defined=!0;function Qg(e,t,n){n&&(e[t]=n)}function $g(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Zg(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Bg(r)]=r,n[Bg(a.attribute)]=r}return new Rg(t,n,e.space)}var e_=$g({properties:{ariaActiveDescendant:null,ariaAtomic:Wg,ariaAutoComplete:null,ariaBusy:Wg,ariaChecked:Wg,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:Kg,ariaCurrent:null,ariaDescribedBy:Kg,ariaDetails:null,ariaDisabled:Wg,ariaDropEffect:Kg,ariaErrorMessage:null,ariaExpanded:Wg,ariaFlowTo:Kg,ariaGrabbed:Wg,ariaHasPopup:null,ariaHidden:Wg,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Kg,ariaLevel:Q,ariaLive:null,ariaModal:Wg,ariaMultiLine:Wg,ariaMultiSelectable:Wg,ariaOrientation:null,ariaOwns:Kg,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:Wg,ariaReadOnly:Wg,ariaRelevant:null,ariaRequired:Wg,ariaRoleDescription:Kg,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:Wg,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function t_(e,t){return t in e?e[t]:t}function n_(e,t){return t_(e,t.toLowerCase())}var r_=$g({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:qg,acceptCharset:Kg,accessKey:Kg,action:null,allow:null,allowFullScreen:Z,allowPaymentRequest:Z,allowUserMedia:Z,alpha:Z,alt:null,as:null,async:Z,autoCapitalize:null,autoComplete:Kg,autoFocus:Z,autoPlay:Z,blocking:Kg,capture:null,charSet:null,checked:Z,cite:null,className:Kg,closedBy:null,colorSpace:null,cols:Q,colSpan:Q,command:null,commandFor:null,content:null,contentEditable:Wg,controls:Z,controlsList:Kg,coords:Q|qg,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Z,defer:Z,dir:null,dirName:null,disabled:Z,download:Gg,draggable:Wg,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Z,formTarget:null,headers:Kg,height:Q,hidden:Gg,high:Q,href:null,hrefLang:null,htmlFor:Kg,httpEquiv:Kg,id:null,imageSizes:null,imageSrcSet:null,inert:Z,inputMode:null,integrity:null,is:null,isMap:Z,itemId:null,itemProp:Kg,itemRef:Kg,itemScope:Z,itemType:Kg,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Z,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:Z,muted:Z,name:null,nonce:null,noModule:Z,noValidate:Z,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Z,optimum:Q,pattern:null,ping:Kg,placeholder:null,playsInline:Z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Z,referrerPolicy:null,rel:Kg,required:Z,reversed:Z,rows:Q,rowSpan:Q,sandbox:Kg,scope:null,scoped:Z,seamless:Z,selected:Z,shadowRootClonable:Z,shadowRootCustomElementRegistry:Z,shadowRootDelegatesFocus:Z,shadowRootMode:null,shadowRootSerializable:Z,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:Wg,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:Z,useMap:null,value:Wg,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Kg,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Z,declare:Z,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:Z,noHref:Z,noShade:Z,noWrap:Z,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:Wg,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Z,disablePictureInPicture:Z,disableRemotePlayback:Z,exportParts:qg,part:Kg,prefix:null,property:null,results:Q,security:null,unselectable:null},space:`html`,transform:n_}),i_=$g({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Jg,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:Kg,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:Z,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:qg,g2:qg,glyphName:qg,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:Jg,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Kg,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Jg,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Jg,rev:Jg,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Jg,requiredFeatures:Jg,requiredFonts:Jg,requiredFormats:Jg,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:Jg,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Jg,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Jg,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:t_}),a_=$g({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),o_=$g({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:n_}),s_=$g({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),c_=/[A-Z]/g,l_=/-[a-z]/g,u_=/^data[-\w.:]+$/i;function d_(e,t){let n=Bg(t),r=t,i=Vg;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&u_.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(l_,p_);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!l_.test(e)){let n=e.replace(c_,f_);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Zg}return new i(r,t)}function f_(e){return`-`+e.toLowerCase()}function p_(e){return e.charAt(1).toUpperCase()}var m_=zg([e_,r_,a_,o_,s_],`html`),h_=zg([e_,i_,a_,o_,s_],`svg`),g_={}.hasOwnProperty;function __(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&g_.call(t,e)){let n=String(t[e]);i=g_.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var v_=/["&'<>`]/g,y_=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b_=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,x_=/[|\\{}()[\]^$+*?.]/g,S_=new WeakMap;function C_(e,t){return e=e.replace(t.subset?w_(t.subset):v_,r),t.subset||t.escapeOnly?e:e.replace(y_,n).replace(b_,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function w_(e){let t=S_.get(e);return t||(t=T_(e),S_.set(e,t)),t}function T_(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(x_,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var E_=/[\dA-Fa-f]/;function D_(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!E_.test(String.fromCharCode(t))?r:r+`;`}var O_=/\d/;function k_(e,t,n){let r=`&#`+String(e);return n&&t&&!O_.test(String.fromCharCode(t))?r:r+`;`}var A_=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),j_={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},M_=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],N_={}.hasOwnProperty,P_={},F_;for(F_ in j_)N_.call(j_,F_)&&(P_[j_[F_]]=F_);var I_=/[^\dA-Za-z]/;function L_(e,t,n,r){let i=String.fromCharCode(e);if(N_.call(P_,i)){let e=P_[i],a=`&`+e;return n&&A_.includes(e)&&!M_.includes(e)&&(!r||t&&t!==61&&I_.test(String.fromCharCode(t)))?a:a+`;`}return``}function R_(e,t,n){let r=D_(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=L_(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=k_(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function z_(e,t){return C_(e,Object.assign({format:R_},t))}var B_=/^>|^->|<!--|-->|--!>|<!-$/g,V_=[`>`],H_=[`<`,`>`];function U_(e,t,n,r){return r.settings.bogusComments?`<?`+z_(e.value,Object.assign({},r.settings.characterReferences,{subset:V_}))+`>`:`<!--`+e.value.replace(B_,i)+`-->`;function i(e){return z_(e,Object.assign({},r.settings.characterReferences,{subset:H_}))}}function W_(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function G_(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function K_(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function q_(e){return e.join(` `).trim()}var J_=/[ \t\n\f\r]/g;function Y_(e){return typeof e==`object`?e.type===`text`&&X_(e.value):X_(e)}function X_(e){return e.replace(J_,``)===``}var Z_=ev(1),Q_=ev(-1),$_=[];function ev(e){return t;function t(t,n,r){let i=t?t.children:$_,a=(n||0)+e,o=i[a];if(!r)for(;o&&Y_(o);)a+=e,o=i[a];return o}}var tv={}.hasOwnProperty;function nv(e){return t;function t(t,n,r){return tv.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var rv=nv({body:ov,caption:iv,colgroup:iv,dd:uv,dt:lv,head:iv,html:av,li:cv,optgroup:fv,option:pv,p:sv,rp:dv,rt:dv,tbody:hv,td:vv,tfoot:gv,th:vv,thead:mv,tr:_v});function iv(e,t,n){let r=Z_(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&Y_(r.value.charAt(0)))}function av(e,t,n){let r=Z_(n,t);return!r||r.type!==`comment`}function ov(e,t,n){let r=Z_(n,t);return!r||r.type!==`comment`}function sv(e,t,n){let r=Z_(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function cv(e,t,n){let r=Z_(n,t);return!r||r.type===`element`&&r.tagName===`li`}function lv(e,t,n){let r=Z_(n,t);return!(!r||r.type!==`element`||r.tagName!==`dt`&&r.tagName!==`dd`)}function uv(e,t,n){let r=Z_(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function dv(e,t,n){let r=Z_(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function fv(e,t,n){let r=Z_(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function pv(e,t,n){let r=Z_(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function mv(e,t,n){let r=Z_(n,t);return!(!r||r.type!==`element`||r.tagName!==`tbody`&&r.tagName!==`tfoot`)}function hv(e,t,n){let r=Z_(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function gv(e,t,n){return!Z_(n,t)}function _v(e,t,n){let r=Z_(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function vv(e,t,n){let r=Z_(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var yv=nv({body:Sv,colgroup:Cv,head:xv,html:bv,tbody:wv});function bv(e){let t=Z_(e,-1);return!t||t.type!==`comment`}function xv(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function Sv(e){let t=Z_(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&Y_(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function Cv(e,t,n){let r=Q_(n,t),i=Z_(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&rv(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function wv(e,t,n){let r=Q_(n,t),i=Z_(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&rv(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var Tv={name:[[`
75
75
  \f\r &/=>`.split(``),`
76
76
  \f\r "&'/=>\``.split(``)],[`\0
77
77
  \f\r "&'/<=>`.split(``),`\0
@@ -79,9 +79,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
79
79
  \f\r &>`.split(``),`\0
80
80
  \f\r "&'<=>\``.split(``)],[`\0
81
81
  \f\r "&'<=>\``.split(``),`\0
82
- \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function Sv(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&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=d_);let l=Cv(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!hv(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||!$_(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Cv(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=wv(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 wv(e,t,n){let r=s_(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=F_(r.attribute,Object.assign({},e.settings.characterReferences,{subset:xv.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?H_:U_)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=F_(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:xv.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&V_(n,o)>V_(n,e.alternative)&&(o=e.alternative),s=o+F_(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?xv.single:xv.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var Tv=[`<`,`&`];function Ev(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:F_(e.value,Object.assign({},r.settings.characterReferences,{subset:Tv}))}function Dv(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Ev(e,t,n,r)}function Ov(e,t,n,r){return r.all(e)}var kv=p_(`type`,{invalid:Av,unknown:jv,handlers:{comment:z_,doctype:B_,element:Sv,raw:Dv,root:Ov,text:Ev}});function Av(e){throw Error("Expected node, not `"+e+"`")}function jv(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Mv={},Nv={},Pv=[];function Fv(e,t){let n=t||Mv,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Iv,all:Lv,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||Ng,characterReferences:n.characterReferences||Nv,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?d_:u_,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function Iv(e,t,n){return kv(e,t,n,this)}function Lv(e){let t=[],n=e&&e.children||Pv,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var Rv=/\s+/g;function zv(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(Rv)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(Rv);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function Bv(e){let t=tg(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}var Vv=[`color`,`background-color`];function Hv(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 Uv(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function Wv(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=Uv(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(r,i);for(let t=0;t<a.length;t++)a[t]-=e.offset;return Hv(e,a)})):e}function Gv(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>Kv(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&&Vv.includes(a)){if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new um('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=o[e][a]||`inherit`,d=o[r][a]||`inherit`;c[a]=`light-dark(${u}, ${d})`,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 Kv(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&jm.Italic&&(t[`font-style`]=`italic`),e.fontStyle&jm.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&jm.Underline&&n.push(`underline`),e.fontStyle&jm.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function qv(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function Jv(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=Bv(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new um(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}{let t=n.lines[e.line];if(t===void 0)throw new um(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new um(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));Yv(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return Wv(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new um(`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+=Xv(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new um(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new um(`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&&zv(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 Yv(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new um(`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 um(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function Xv(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(Xv).join(``):``}var Zv=[Jv()];function Qv(e){let t=$v(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Zv]}function $v(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 ey=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],ty={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function ny(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 ry(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}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function iy(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)ty[r]&&t.push({type:`setDecoration`,value:ty[r]});else if(r<=29){let e=ty[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:ey[r-30]}});else if(r===38){let n=ry(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:ey[r-40]}});else if(r===48){let n=ry(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:ey[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:ey[r-100+8]}})}}return t}function ay(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=ny(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=iy(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 oy={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 sy(e=oy){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<ey.length;e++)r.push(t(ey[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 cy=/#([0-9a-f]{3,8})/i,ly=/var\((--[\w-]+-ansi-[\w-]+)\)/,uy={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 dy(e,t,n){let r=Kh(e,n),i=tg(t),a=sy(Object.fromEntries(ey.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||uy[t]]}))),o=ay();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=qh(i,r),o=qh(o,r),n.decorations.has(`dim`)&&(i=fy(i));let s=jm.None;return n.decorations.has(`bold`)&&(s|=jm.Bold),n.decorations.has(`italic`)&&(s|=jm.Italic),n.decorations.has(`underline`)&&(s|=jm.Underline),n.decorations.has(`strikethrough`)&&(s|=jm.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function fy(e){let t=e.match(cy);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}`}if(e.length===6)return`#${e}80`;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`)}`}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(ly);return n?`var(${n[1]}-dim)`:e}function py(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!Xh(r)&&!Qh(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return dy(r,t,n)}return Sg(e,t,n)}function my(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new um("`themes` option must not be empty");let p=jg(e,t,n,py);if(c=gg(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new um(`\`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=>Gv(e,h,u,l,d))),c&&hg(a,c);let g=f.map(e=>Kh(e.theme,n));i=hy(f,m,g,u,l,`fg`,d),r=hy(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=Kh(n.theme,n);a=py(e,t,n);let l=e.getTheme(n.theme);r=qh(l.bg,s),i=qh(l.fg,s),o=l.name,c=gg(a)}else throw new um("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function hy(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=qh(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new um('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${qh(t[r][a],n[r])||`inherit`}, ${qh(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var gy=/^\s+$/,_y=/^(\s*)(.*?)(\s*)$/;function vy(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>vy(e,t,n),codeToTokens:(t,n)=>my(e,t,n)}){let i=t;for(let e of Qv(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=my(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=by(a):d===`never`&&(a=xy(a)),f&&(a=Sy(a));let p={...r,get source(){return i}};for(let e of Qv(n))a=e.tokens?.call(p,a)||a;return yy(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function yy(e,t,n,r=gg(e)){let i=Qv(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`: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:zv,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:`
83
- `}));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=qv(a.htmlStyle||Kv(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&&hg(m,r),m}function by(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&jm.Underline||i.fontStyle&jm.Strikethrough));o&&gy.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function xy(e){return e.map(e=>e.flatMap(e=>{if(gy.test(e.content))return e;let t=e.content.match(_y);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 Sy(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=qv(e.htmlStyle||Kv(e)),i=qv(n.htmlStyle||Kv(n)),a=e.fontStyle&&(e.fontStyle&jm.Underline||e.fontStyle&jm.Strikethrough),o=n.fontStyle&&(n.fontStyle&jm.Underline||n.fontStyle&jm.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Cy=Fv;function wy(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>vy(e,t,n),codeToTokens:(t,n)=>my(e,t,n)},i=Cy(vy(e,t,n,r));for(let e of Qv(n))i=e.postprocess?.call(r,i,n)||i;return i}async function Ty(e){let t=await pg(e);return{getLastGrammarState:(...e)=>Cg(t,...e),codeToTokensBase:(e,n)=>py(t,e,n),codeToTokensWithThemes:(e,n)=>jg(t,e,n),codeToTokens:(e,n)=>my(t,e,n),codeToHast:(e,n)=>vy(t,e,n),codeToHtml:(e,n)=>wy(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}var Ey=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Dy(){return 2147483648}function Oy(){return typeof performance<`u`?performance.now():Date.now()}var ky=(e,t)=>e+(t-e%t)%t;async function Ay(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=Dy();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,ky(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:Oy,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 jy=Object.defineProperty,My=(e,t,n)=>t in e?jy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ny=(e,t,n)=>My(e,typeof t==`symbol`?t:t+``,n),Py=null;function Fy(e){throw new Ey(e.UTF8ToString(e.getLastOnigError()))}var Iy=class e{constructor(t){Ny(this,`utf16Length`),Ny(this,`utf8Length`),Ny(this,`utf16Value`),Ny(this,`utf8Value`),Ny(this,`utf16OffsetToUtf8`),Ny(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},Ly=class e{constructor(t){if(Ny(this,`id`,++e.LAST_ID),Ny(this,`_onigBinding`),Ny(this,`content`),Ny(this,`utf16Length`),Ny(this,`utf8Length`),Ny(this,`utf16OffsetToUtf8`),Ny(this,`utf8OffsetToUtf16`),Ny(this,`ptr`),!Py)throw new Ey(`Must invoke loadWasm first.`);this._onigBinding=Py,this.content=t;let n=new Iy(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=Py.omalloc(1e4),e._sharedPtrInUse=!0,Py.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(Py)}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)}};Ny(Ly,`LAST_ID`,0),Ny(Ly,`_sharedPtr`,0),Ny(Ly,`_sharedPtrInUse`,!1);var Ry=Ly,zy=class{constructor(e){if(Ny(this,`_onigBinding`),Ny(this,`_ptr`),!Py)throw new Ey(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new Iy(e[r]);t[r]=i.createString(Py),n[r]=i.utf8Length}let r=Py.omalloc(4*e.length);Py.HEAPU32.set(t,r/4);let i=Py.omalloc(4*e.length);Py.HEAPU32.set(n,i/4);let a=Py.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)Py.ofree(t[n]);Py.ofree(i),Py.ofree(r),a===0&&Fy(Py),this._onigBinding=Py,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 Ry(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 By(e){return typeof e.instantiator==`function`}function Vy(e){return typeof e.default==`function`}function Hy(e){return e.data!==void 0}function Uy(e){return typeof Response<`u`&&e instanceof Response}function Wy(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 Gy;function Ky(e){if(Gy)return Gy;async function t(){Py=await Ay(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),By(n)?n=await n.instantiator(t):Vy(n)?n=await n.default(t):(Hy(n)&&(n=n.data),Uy(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await Jy(n)(t):await Yy(n)(t):Wy(n)||n instanceof WebAssembly.Module?n=await qy(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await qy(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return Gy=t(),Gy}function qy(e){return t=>WebAssembly.instantiate(e,t)}function Jy(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Yy(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function Xy(e){return e&&await Ky(e),{createScanner(e){return new zy(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new Ry(e)}}}var Zy=`modulepreload`,Qy=function(e,t){return new URL(e,t).href},$y={},$=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Qy(t,n),t=s(t),t in $y)return;$y[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Zy,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).filter(e=>e!==void 0))}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)})},eb=[{id:`abap`,name:`ABAP`,import:(()=>$(()=>import(`./abap-CLvhMVsD.js`),[],import.meta.url))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>$(()=>import(`./actionscript-3-Cs6JJXT5.js`),[],import.meta.url))},{id:`ada`,name:`Ada`,import:(()=>$(()=>import(`./ada-X3Y2mlq2.js`),[],import.meta.url))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>$(()=>import(`./ahk-DwADkxyd.js`),[],import.meta.url))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>$(()=>import(`./ahk2-_6rzW9BS.js`),[],import.meta.url))},{id:`angular-html`,name:`Angular HTML`,import:(()=>$(()=>import(`./angular-html-khSGtcDV.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3]),import.meta.url))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>$(()=>import(`./angular-ts-CQZskKbG.js`),__vite__mapDeps([4,0,1,2,3,5]),import.meta.url))},{id:`apache`,name:`Apache Conf`,import:(()=>$(()=>import(`./apache-U0d_L8uA.js`),[],import.meta.url))},{id:`apex`,name:`Apex`,import:(()=>$(()=>import(`./apex-KFGFyKwG.js`),[],import.meta.url))},{id:`apl`,name:`APL`,import:(()=>$(()=>import(`./apl-Dk2A1KW8.js`),__vite__mapDeps([6,2,3,1,7,8,9]),import.meta.url))},{id:`applescript`,name:`AppleScript`,import:(()=>$(()=>import(`./applescript-CCn79oCD.js`),[],import.meta.url))},{id:`ara`,name:`Ara`,import:(()=>$(()=>import(`./ara-4CJ0cIlV.js`),[],import.meta.url))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>$(()=>import(`./asciidoc-SCjQUq34.js`),[],import.meta.url))},{id:`asm`,name:`Assembly`,import:(()=>$(()=>import(`./asm-Cmm7eHzH.js`),[],import.meta.url))},{id:`astro`,name:`Astro`,import:(()=>$(()=>import(`./astro-CDNLxpIR.js`),__vite__mapDeps([10,2,3,9,11,12,13]),import.meta.url))},{id:`awk`,name:`AWK`,import:(()=>$(()=>import(`./awk-BWXHIvNe.js`),[],import.meta.url))},{id:`ballerina`,name:`Ballerina`,import:(()=>$(()=>import(`./ballerina-B7ZEbQpA.js`),[],import.meta.url))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>$(()=>import(`./bat-qdxAdBWQ.js`),[],import.meta.url))},{id:`beancount`,name:`Beancount`,import:(()=>$(()=>import(`./beancount-C2IN4Vk8.js`),[],import.meta.url))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>$(()=>import(`./berry-DKpUyyne.js`),[],import.meta.url))},{id:`bibtex`,name:`BibTeX`,import:(()=>$(()=>import(`./bibtex-Ci_nEsc7.js`),[],import.meta.url))},{id:`bicep`,name:`Bicep`,import:(()=>$(()=>import(`./bicep-CUHmPFLl.js`),[],import.meta.url))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>$(()=>import(`./bird2-CYIUgYqB.js`),[],import.meta.url))},{id:`blade`,name:`Blade`,import:(()=>$(()=>import(`./blade-HVRxvZlI.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16]),import.meta.url))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>$(()=>import(`./bsl-_VjlB9mv.js`),__vite__mapDeps([17,18]),import.meta.url))},{id:`c`,name:`C`,import:(()=>$(()=>import(`./c-BAogwQrx.js`).then(e=>e.n),[],import.meta.url))},{id:`c3`,name:`C3`,import:(()=>$(()=>import(`./c3-D0apG41V.js`),[],import.meta.url))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>$(()=>import(`./cadence-CQ2zXKGN.js`),[],import.meta.url))},{id:`cairo`,name:`Cairo`,import:(()=>$(()=>import(`./cairo-DLTphjLi.js`),__vite__mapDeps([19,20]),import.meta.url))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>$(()=>import(`./chapel-CXJ1GKiJ.js`),__vite__mapDeps([21,22]),import.meta.url))},{id:`clarity`,name:`Clarity`,import:(()=>$(()=>import(`./clarity-CtfBBspg.js`),[],import.meta.url))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>$(()=>import(`./clojure-DqKBuwfJ.js`),[],import.meta.url))},{id:`cmake`,name:`CMake`,import:(()=>$(()=>import(`./cmake-Bj61d0ZC.js`),[],import.meta.url))},{id:`cobol`,name:`COBOL`,import:(()=>$(()=>import(`./cobol-CUpuiRry.js`),__vite__mapDeps([23,1,2,3,8]),import.meta.url))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>$(()=>import(`./codeowners-C8r90Shi.js`),[],import.meta.url))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>$(()=>import(`./codeql-oeQT6MSM.js`),[],import.meta.url))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>$(()=>import(`./coffee-Bvuk4CPF.js`),__vite__mapDeps([24,2]),import.meta.url))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>$(()=>import(`./common-lisp-Cv5bFMCO.js`),[],import.meta.url))},{id:`coq`,name:`Rocq`,import:(()=>$(()=>import(`./coq-CGaSfhwR.js`),[],import.meta.url))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>$(()=>import(`./cpp-DrhGCibo.js`).then(e=>e.n),__vite__mapDeps([25,26,27,22]),import.meta.url))},{id:`crystal`,name:`Crystal`,import:(()=>$(()=>import(`./crystal-CoGIF_h4.js`),__vite__mapDeps([28,2,3,1,16,22,29]),import.meta.url))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>$(()=>import(`./csharp-dmMxLVLW.js`),[],import.meta.url))},{id:`css`,name:`CSS`,import:(()=>$(()=>import(`./css-CUXMpymc.js`).then(e=>e.n),[],import.meta.url))},{id:`csv`,name:`CSV`,import:(()=>$(()=>import(`./csv-Dx-8-gkx.js`),[],import.meta.url))},{id:`cue`,name:`CUE`,import:(()=>$(()=>import(`./cue-CE9AQfxI.js`),[],import.meta.url))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>$(()=>import(`./cypher-ClKdZ_lG.js`),[],import.meta.url))},{id:`d`,name:`D`,import:(()=>$(()=>import(`./d-qD-0Kul2.js`),[],import.meta.url))},{id:`dart`,name:`Dart`,import:(()=>$(()=>import(`./dart-CHZY9Xhz.js`),[],import.meta.url))},{id:`dax`,name:`DAX`,import:(()=>$(()=>import(`./dax-BkyTk9wS.js`),[],import.meta.url))},{id:`desktop`,name:`Desktop`,import:(()=>$(()=>import(`./desktop-Dlh5hvp9.js`),[],import.meta.url))},{id:`diff`,name:`Diff`,import:(()=>$(()=>import(`./diff-woXpYk--.js`),[],import.meta.url))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>$(()=>import(`./docker-IyjqRm3v.js`),[],import.meta.url))},{id:`dotenv`,name:`dotEnv`,import:(()=>$(()=>import(`./dotenv-CuH5my32.js`),[],import.meta.url))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>$(()=>import(`./dream-maker-DW3nJb8Q.js`),[],import.meta.url))},{id:`edge`,name:`Edge`,import:(()=>$(()=>import(`./edge-MTcLzslY.js`),__vite__mapDeps([30,1,2,3,11,15]),import.meta.url))},{id:`elixir`,name:`Elixir`,import:(()=>$(()=>import(`./elixir-DpYpNuu6.js`),__vite__mapDeps([31,1,2,3]),import.meta.url))},{id:`elm`,name:`Elm`,import:(()=>$(()=>import(`./elm-CAdLQ8j2.js`),__vite__mapDeps([32,27,22]),import.meta.url))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>$(()=>import(`./emacs-lisp-DR2vtWaj.js`),[],import.meta.url))},{id:`erb`,name:`ERB`,import:(()=>$(()=>import(`./erb-wGT1uBBo.js`),__vite__mapDeps([33,1,2,3,34,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39]),import.meta.url))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>$(()=>import(`./erlang-Cphh6RMH.js`),__vite__mapDeps([40,41]),import.meta.url))},{id:`fennel`,name:`Fennel`,import:(()=>$(()=>import(`./fennel-DQxkIbk2.js`),[],import.meta.url))},{id:`fish`,name:`Fish`,import:(()=>$(()=>import(`./fish-BJitypiv.js`),[],import.meta.url))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>$(()=>import(`./fluent-C03EYrpw.js`),[],import.meta.url))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>$(()=>import(`./fortran-fixed-form-DEKoE2YW.js`),__vite__mapDeps([42,43]),import.meta.url))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>$(()=>import(`./fortran-free-form-CYNrtFtB.js`),[],import.meta.url))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>$(()=>import(`./fsharp-D13ZGOAj.js`),__vite__mapDeps([44,41]),import.meta.url))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>$(()=>import(`./gdresource-xMC7jr7x.js`),__vite__mapDeps([45,46,47]),import.meta.url))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>$(()=>import(`./gdscript-DYvRD3hg.js`),[],import.meta.url))},{id:`gdshader`,name:`GDShader`,import:(()=>$(()=>import(`./gdshader-CBce3t8t.js`),[],import.meta.url))},{id:`genie`,name:`Genie`,import:(()=>$(()=>import(`./genie-CV2tkWYe.js`),[],import.meta.url))},{id:`gherkin`,name:`Gherkin`,import:(()=>$(()=>import(`./gherkin-DExj1W_8.js`),[],import.meta.url))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>$(()=>import(`./git-commit-BSykSTBG.js`),__vite__mapDeps([48,49]),import.meta.url))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>$(()=>import(`./git-rebase-D7SHvGwZ.js`),__vite__mapDeps([50,29]),import.meta.url))},{id:`gleam`,name:`Gleam`,import:(()=>$(()=>import(`./gleam-CSRkHgEL.js`),[],import.meta.url))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>$(()=>import(`./glimmer-js-DEF7JSd6.js`),__vite__mapDeps([51,2,3,1,11]),import.meta.url))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>$(()=>import(`./glimmer-ts-CM94Mbx8.js`),__vite__mapDeps([52,2,3,1,11]),import.meta.url))},{id:`glsl`,name:`GLSL`,import:(()=>$(()=>import(`./glsl-DvB1v13j.js`).then(e=>e.n),__vite__mapDeps([27,22]),import.meta.url))},{id:`gn`,name:`GN`,import:(()=>$(()=>import(`./gn-CAXYAgV-.js`),[],import.meta.url))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>$(()=>import(`./gnuplot-7GGW24-e.js`),[],import.meta.url))},{id:`go`,name:`Go`,import:(()=>$(()=>import(`./go-rLFTqkRN.js`),[],import.meta.url))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>$(()=>import(`./graphql-CpBeqKe2.js`).then(e=>e.n),__vite__mapDeps([36,2,11,13,37]),import.meta.url))},{id:`groovy`,name:`Groovy`,import:(()=>$(()=>import(`./groovy-CacY0gHj.js`),[],import.meta.url))},{id:`hack`,name:`Hack`,import:(()=>$(()=>import(`./hack-CBlJ1Su7.js`),__vite__mapDeps([53,1,2,3,16]),import.meta.url))},{id:`haml`,name:`Ruby Haml`,import:(()=>$(()=>import(`./haml-Db0uDFny.js`).then(e=>e.n),__vite__mapDeps([35,2,3]),import.meta.url))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>$(()=>import(`./handlebars-B9jQcMgj.js`),__vite__mapDeps([54,2,3,1,39]),import.meta.url))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>$(()=>import(`./haskell-D8IpX4py.js`),[],import.meta.url))},{id:`haxe`,name:`Haxe`,import:(()=>$(()=>import(`./haxe-C8oCnwJJ.js`),[],import.meta.url))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>$(()=>import(`./hcl-Dh228itO.js`),[],import.meta.url))},{id:`hjson`,name:`Hjson`,import:(()=>$(()=>import(`./hjson-CxZEssPk.js`),[],import.meta.url))},{id:`hlsl`,name:`HLSL`,import:(()=>$(()=>import(`./hlsl-Cvrh5tZx.js`),[],import.meta.url))},{id:`html`,name:`HTML`,import:(()=>$(()=>import(`./html-DTSojrQm.js`).then(e=>e.n),__vite__mapDeps([1,2,3]),import.meta.url))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>$(()=>import(`./html-derivative-7jGgl4AX.js`),__vite__mapDeps([15,1,2,3]),import.meta.url))},{id:`http`,name:`HTTP`,import:(()=>$(()=>import(`./http-DJbcEzJc.js`),__vite__mapDeps([55,7,8,9,29,36,2,11,13,37]),import.meta.url))},{id:`hurl`,name:`Hurl`,import:(()=>$(()=>import(`./hurl-BjBdeErH.js`),__vite__mapDeps([56,7,8,57,36,2,11,13,37]),import.meta.url))},{id:`hxml`,name:`HXML`,import:(()=>$(()=>import(`./hxml-Dcm88srW.js`),__vite__mapDeps([58,59]),import.meta.url))},{id:`hy`,name:`Hy`,import:(()=>$(()=>import(`./hy-CZbG8q4J.js`),[],import.meta.url))},{id:`imba`,name:`Imba`,import:(()=>$(()=>import(`./imba-DsUTQ-LC.js`),[],import.meta.url))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>$(()=>import(`./ini-B5eOa1yu.js`),[],import.meta.url))},{id:`java`,name:`Java`,import:(()=>$(()=>import(`./java-Dn64Xe0Z.js`).then(e=>e.n),[],import.meta.url))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>$(()=>import(`./javascript-BbkSu_9c.js`).then(e=>e.n),[],import.meta.url))},{id:`jinja`,name:`Jinja`,import:(()=>$(()=>import(`./jinja-DqC5t5sF.js`),__vite__mapDeps([60,1,2,3]),import.meta.url))},{id:`jison`,name:`Jison`,import:(()=>$(()=>import(`./jison-DpuZbYSp.js`),__vite__mapDeps([61,2]),import.meta.url))},{id:`json`,name:`JSON`,import:(()=>$(()=>import(`./json-B2a7n5JV.js`).then(e=>e.n),[],import.meta.url))},{id:`json5`,name:`JSON5`,import:(()=>$(()=>import(`./json5-BR5RXkoi.js`),[],import.meta.url))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>$(()=>import(`./jsonc-CYpm1nAK.js`),[],import.meta.url))},{id:`jsonl`,name:`JSON Lines`,import:(()=>$(()=>import(`./jsonl-CmCQp5Yx.js`),[],import.meta.url))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>$(()=>import(`./jsonnet-CJTPZ8u_.js`),[],import.meta.url))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>$(()=>import(`./jssm-DXw9l8Rf.js`),[],import.meta.url))},{id:`jsx`,name:`JSX`,import:(()=>$(()=>import(`./jsx-ClgcRv-g.js`).then(e=>e.n),[],import.meta.url))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>$(()=>import(`./julia-Do1-bHs6.js`),__vite__mapDeps([62,2,16,20,25,26,27,22,63]),import.meta.url))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>$(()=>import(`./just-DHt2GVD3.js`),__vite__mapDeps([64,2,11,20,29,34,3,1,7,8,16,22,25,26,27,35,36,13,37,38,39,65]),import.meta.url))},{id:`kdl`,name:`KDL`,import:(()=>$(()=>import(`./kdl-CsD5j6eV.js`),[],import.meta.url))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>$(()=>import(`./kotlin-DhhofPvG.js`),[],import.meta.url))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>$(()=>import(`./kusto-C7mF5XQf.js`),[],import.meta.url))},{id:`latex`,name:`LaTeX`,import:(()=>$(()=>import(`./latex-B_f2UeRI.js`),__vite__mapDeps([66,67,63]),import.meta.url))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>$(()=>import(`./lean-CewbzKMR.js`),[],import.meta.url))},{id:`less`,name:`Less`,import:(()=>$(()=>import(`./less-DVTAwKKz.js`),[],import.meta.url))},{id:`liquid`,name:`Liquid`,import:(()=>$(()=>import(`./liquid-Ds2eU_MP.js`),__vite__mapDeps([68,2,3,1,9]),import.meta.url))},{id:`llvm`,name:`LLVM IR`,import:(()=>$(()=>import(`./llvm-DqHOMS-s.js`),[],import.meta.url))},{id:`log`,name:`Log file`,import:(()=>$(()=>import(`./log-BNLmms1o.js`),[],import.meta.url))},{id:`logo`,name:`Logo`,import:(()=>$(()=>import(`./logo-Cluzi2Zq.js`),[],import.meta.url))},{id:`lua`,name:`Lua`,import:(()=>$(()=>import(`./lua-S7tZuNGt.js`).then(e=>e.n),__vite__mapDeps([38,22]),import.meta.url))},{id:`luau`,name:`Luau`,import:(()=>$(()=>import(`./luau-VGWVLoqX.js`),[],import.meta.url))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>$(()=>import(`./make-Dixweg8N.js`),[],import.meta.url))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>$(()=>import(`./markdown-BYOwaDjH.js`),[],import.meta.url))},{id:`marko`,name:`Marko`,import:(()=>$(()=>import(`./marko-udM4lCVd.js`),__vite__mapDeps([69,3,5,11,70]),import.meta.url))},{id:`matlab`,name:`MATLAB`,import:(()=>$(()=>import(`./matlab-D7qyCx1q.js`),[],import.meta.url))},{id:`mdc`,name:`MDC`,import:(()=>$(()=>import(`./mdc-Cp5CPiQh.js`),__vite__mapDeps([71,15,1,2,3,39,41]),import.meta.url))},{id:`mdx`,name:`MDX`,import:(()=>$(()=>import(`./mdx-DQZ5AkYe.js`),[],import.meta.url))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>$(()=>import(`./mermaid-BxpfTIzt.js`),[],import.meta.url))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>$(()=>import(`./mipsasm-BMqwQI7S.js`),[],import.meta.url))},{id:`mojo`,name:`Mojo`,import:(()=>$(()=>import(`./mojo-fg40_ntQ.js`),[],import.meta.url))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>$(()=>import(`./moonbit-D9W784E_.js`),[],import.meta.url))},{id:`move`,name:`Move`,import:(()=>$(()=>import(`./move-BYnGhZoM.js`),[],import.meta.url))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>$(()=>import(`./narrat-_X_XdTYD.js`),[],import.meta.url))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>$(()=>import(`./nextflow-CSgcYZcx.js`),__vite__mapDeps([72,73]),import.meta.url))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>$(()=>import(`./nextflow-groovy-D7IRt6Pp.js`),[],import.meta.url))},{id:`nginx`,name:`Nginx`,import:(()=>$(()=>import(`./nginx-fGikazrY.js`),__vite__mapDeps([74,38,22]),import.meta.url))},{id:`nim`,name:`Nim`,import:(()=>$(()=>import(`./nim-ByS27m8u.js`),__vite__mapDeps([75,2,3,1,7,8,22,27,41]),import.meta.url))},{id:`nix`,name:`Nix`,import:(()=>$(()=>import(`./nix-IvuFDN5E.js`),[],import.meta.url))},{id:`nsis`,name:`NSIS`,import:(()=>$(()=>import(`./nsis-CjNLYCLg.js`),[],import.meta.url))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>$(()=>import(`./nushell--0fT3PI1.js`),[],import.meta.url))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>$(()=>import(`./objective-c-D1A_Heim.js`),[],import.meta.url))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>$(()=>import(`./objective-cpp-BsSzOQcm.js`),[],import.meta.url))},{id:`ocaml`,name:`OCaml`,import:(()=>$(()=>import(`./ocaml-O90oeIOV.js`),[],import.meta.url))},{id:`odin`,name:`Odin`,import:(()=>$(()=>import(`./odin-B1RWQWA5.js`),[],import.meta.url))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>$(()=>import(`./openscad-BUDT5pXO.js`),[],import.meta.url))},{id:`org`,name:`Org Markup`,import:(()=>$(()=>import(`./org-CWef6EjL.js`),__vite__mapDeps([76,2,3,1,5,8,7,9,11,13,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,48,50,81,82,83,63,65,66,67,70,84,75,85,86,87,88,89,90,91,92,93]),import.meta.url))},{id:`pascal`,name:`Pascal`,import:(()=>$(()=>import(`./pascal-4ZHwLPI5.js`),[],import.meta.url))},{id:`perl`,name:`Perl`,import:(()=>$(()=>import(`./perl-B3b8PFq6.js`),__vite__mapDeps([65,2,3,1,7,8,16]),import.meta.url))},{id:`php`,name:`PHP`,import:(()=>$(()=>import(`./php-BgIqtqOt.js`),__vite__mapDeps([87,2,3,1,7,8,9,16]),import.meta.url))},{id:`pkl`,name:`Pkl`,import:(()=>$(()=>import(`./pkl-ot-7Btpt.js`),[],import.meta.url))},{id:`plsql`,name:`PL/SQL`,import:(()=>$(()=>import(`./plsql-DGHpHOYJ.js`),[],import.meta.url))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>$(()=>import(`./po-BiJDBrnU.js`),[],import.meta.url))},{id:`polar`,name:`Polar`,import:(()=>$(()=>import(`./polar-C7UOKdEL.js`),[],import.meta.url))},{id:`postcss`,name:`PostCSS`,import:(()=>$(()=>import(`./postcss-BXeXVLqQ.js`),[],import.meta.url))},{id:`powerquery`,name:`PowerQuery`,import:(()=>$(()=>import(`./powerquery-DNMTfnFr.js`),[],import.meta.url))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>$(()=>import(`./powershell-QtSnmXcu.js`),[],import.meta.url))},{id:`prisma`,name:`Prisma`,import:(()=>$(()=>import(`./prisma-DMgNhnYS.js`),[],import.meta.url))},{id:`prolog`,name:`Prolog`,import:(()=>$(()=>import(`./prolog-iXnhIJG7.js`),[],import.meta.url))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>$(()=>import(`./proto-DB4EqR-F.js`),[],import.meta.url))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>$(()=>import(`./pug-BRImkfAG.js`),__vite__mapDeps([94,2,3,1]),import.meta.url))},{id:`puppet`,name:`Puppet`,import:(()=>$(()=>import(`./puppet-CDv2pdJW.js`),[],import.meta.url))},{id:`purescript`,name:`PureScript`,import:(()=>$(()=>import(`./purescript-9MfHhQsQ.js`),[],import.meta.url))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>$(()=>import(`./python-gzcpVVnB.js`),[],import.meta.url))},{id:`qml`,name:`QML`,import:(()=>$(()=>import(`./qml-CzXZbZNQ.js`),__vite__mapDeps([95,2]),import.meta.url))},{id:`qmldir`,name:`QML Directory`,import:(()=>$(()=>import(`./qmldir-DCQb3MpD.js`),[],import.meta.url))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>$(()=>import(`./qss-Fe1Jh2GI.js`),[],import.meta.url))},{id:`r`,name:`R`,import:(()=>$(()=>import(`./r-Nteo2x9j.js`).then(e=>e.n),[],import.meta.url))},{id:`racket`,name:`Racket`,import:(()=>$(()=>import(`./racket-DcIDlBhZ.js`),[],import.meta.url))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>$(()=>import(`./raku-B3gFvitq.js`),[],import.meta.url))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>$(()=>import(`./razor-D_Afw34M.js`),__vite__mapDeps([96,1,2,3,78]),import.meta.url))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>$(()=>import(`./rbs-C0MpOrj4.js`),[],import.meta.url))},{id:`reg`,name:`Windows Registry Script`,import:(()=>$(()=>import(`./reg-CRGYupPL.js`),[],import.meta.url))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>$(()=>import(`./regexp-CKIOMRkq.js`).then(e=>e.n),[],import.meta.url))},{id:`rel`,name:`Rel`,import:(()=>$(()=>import(`./rel-BtDbiS_P.js`),[],import.meta.url))},{id:`riscv`,name:`RISC-V`,import:(()=>$(()=>import(`./riscv-Ckw8ddFX.js`),[],import.meta.url))},{id:`ron`,name:`RON`,import:(()=>$(()=>import(`./ron-VUp2lXgN.js`),[],import.meta.url))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>$(()=>import(`./rosmsg-CAekHB0j.js`),[],import.meta.url))},{id:`rst`,name:`reStructuredText`,import:(()=>$(()=>import(`./rst-BKqSLPk8.js`),__vite__mapDeps([97,2,15,1,3,20,98,25,26,27,22,29,39,34,7,8,16,35,36,11,13,37,38]),import.meta.url))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>$(()=>import(`./ruby-e08qQ71e.js`),__vite__mapDeps([34,2,3,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39]),import.meta.url))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>$(()=>import(`./rust-DpiIf5JO.js`),[],import.meta.url))},{id:`sas`,name:`SAS`,import:(()=>$(()=>import(`./sas-CBP-Z7IW.js`),__vite__mapDeps([99,16]),import.meta.url))},{id:`sass`,name:`Sass`,import:(()=>$(()=>import(`./sass-DXrisJhu.js`),[],import.meta.url))},{id:`scala`,name:`Scala`,import:(()=>$(()=>import(`./scala-BiFt_7mu.js`),[],import.meta.url))},{id:`scheme`,name:`Scheme`,import:(()=>$(()=>import(`./scheme-DQCgrYNe.js`),[],import.meta.url))},{id:`scss`,name:`SCSS`,import:(()=>$(()=>import(`./scss-D_FoTbGY.js`).then(e=>e.n),__vite__mapDeps([5,3]),import.meta.url))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>$(()=>import(`./sdbl-bTVj8UrX.js`),[],import.meta.url))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>$(()=>import(`./shaderlab-TOUzSsQk.js`),__vite__mapDeps([100,101]),import.meta.url))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>$(()=>import(`./shellscript-Ck8Pcu_n.js`).then(e=>e.n),[],import.meta.url))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>$(()=>import(`./shellsession-ClnG1wCa.js`),__vite__mapDeps([102,29]),import.meta.url))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>$(()=>import(`./smalltalk-BHpQb5nM.js`),[],import.meta.url))},{id:`smithy`,name:`Smithy`,import:(()=>$(()=>import(`./smithy-Dgaz7aur.js`),[],import.meta.url))},{id:`solidity`,name:`Solidity`,import:(()=>$(()=>import(`./solidity-Bj7E1mRn.js`),[],import.meta.url))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>$(()=>import(`./soy-SRwHcO2G.js`),__vite__mapDeps([103,1,2,3]),import.meta.url))},{id:`sparql`,name:`SPARQL`,import:(()=>$(()=>import(`./sparql-D_iOobhT.js`),__vite__mapDeps([104,105]),import.meta.url))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>$(()=>import(`./splunk-BC2Px7Mm.js`),[],import.meta.url))},{id:`sql`,name:`SQL`,import:(()=>$(()=>import(`./sql-CjUCW4z6.js`).then(e=>e.n),[],import.meta.url))},{id:`ssh-config`,name:`SSH Config`,import:(()=>$(()=>import(`./ssh-config-BgfXC-Er.js`),[],import.meta.url))},{id:`stata`,name:`Stata`,import:(()=>$(()=>import(`./stata-DbpO8t8N.js`),__vite__mapDeps([106,16]),import.meta.url))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>$(()=>import(`./stylus-B6D30XZt.js`),[],import.meta.url))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>$(()=>import(`./surrealql-BvdjWgRW.js`),__vite__mapDeps([107,2]),import.meta.url))},{id:`svelte`,name:`Svelte`,import:(()=>$(()=>import(`./svelte-Bce_bVba.js`),__vite__mapDeps([108,2,3,11,12]),import.meta.url))},{id:`swift`,name:`Swift`,import:(()=>$(()=>import(`./swift-CyEgAFGc.js`),[],import.meta.url))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>$(()=>import(`./system-verilog-Dh5ihWbf.js`),[],import.meta.url))},{id:`systemd`,name:`Systemd Units`,import:(()=>$(()=>import(`./systemd-BxMlprV5.js`),[],import.meta.url))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>$(()=>import(`./talonscript-CohzipZa.js`),[],import.meta.url))},{id:`tasl`,name:`Tasl`,import:(()=>$(()=>import(`./tasl-DMoTqEGO.js`),[],import.meta.url))},{id:`tcl`,name:`Tcl`,import:(()=>$(()=>import(`./tcl-CZd0xW_V.js`),[],import.meta.url))},{id:`templ`,name:`Templ`,import:(()=>$(()=>import(`./templ-D1Wmfx4s.js`),__vite__mapDeps([109,2,3,81]),import.meta.url))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>$(()=>import(`./terraform-DswuEJGm.js`),[],import.meta.url))},{id:`tex`,name:`TeX`,import:(()=>$(()=>import(`./tex-DAUoYbei.js`).then(e=>e.n),__vite__mapDeps([67,63]),import.meta.url))},{id:`toml`,name:`TOML`,import:(()=>$(()=>import(`./toml-CcmNWLt0.js`),[],import.meta.url))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>$(()=>import(`./ts-tags-DeHdW_lm.js`),__vite__mapDeps([110,2,3,1,7,8,11,16,27,22]),import.meta.url))},{id:`tsv`,name:`TSV`,import:(()=>$(()=>import(`./tsv-sltzmVWM.js`),[],import.meta.url))},{id:`tsx`,name:`TSX`,import:(()=>$(()=>import(`./tsx-BtUXi9Pr.js`).then(e=>e.n),[],import.meta.url))},{id:`turtle`,name:`Turtle`,import:(()=>$(()=>import(`./turtle-ByJddavk.js`),[],import.meta.url))},{id:`twig`,name:`Twig`,import:(()=>$(()=>import(`./twig-NY4Ref0L.js`),__vite__mapDeps([111,2,3,5,20,34,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39,87,9]),import.meta.url))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>$(()=>import(`./typescript-BRVtVFtH.js`).then(e=>e.n),[],import.meta.url))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>$(()=>import(`./typespec-BGhR2SqG.js`),[],import.meta.url))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>$(()=>import(`./typst-CEx4fnEq.js`),__vite__mapDeps([112,2,3,1,5,8,7,9,11,13,113,114,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,44,48,50,81,82,54,83,115,63,62,65,66,67,70,116,84,85,87,88,89,90,91,93,117,94,118,119,111,120]),import.meta.url))},{id:`v`,name:`V`,import:(()=>$(()=>import(`./v-DBj4K9d_.js`),[],import.meta.url))},{id:`vala`,name:`Vala`,import:(()=>$(()=>import(`./vala-zf12oZj6.js`),[],import.meta.url))},{id:`vb`,name:`Visual Basic`,import:(()=>$(()=>import(`./vb-DOwzaHZ0.js`),[],import.meta.url))},{id:`verilog`,name:`Verilog`,import:(()=>$(()=>import(`./verilog-B2gwz-sJ.js`),[],import.meta.url))},{id:`vhdl`,name:`VHDL`,import:(()=>$(()=>import(`./vhdl-BroJfC0k.js`),[],import.meta.url))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>$(()=>import(`./viml-DvXPmvsu.js`),[],import.meta.url))},{id:`vue`,name:`Vue`,import:(()=>$(()=>import(`./vue-CzSBuAS4.js`),__vite__mapDeps([121,2,3,1,9,11,15]),import.meta.url))},{id:`vue-html`,name:`Vue HTML`,import:(()=>$(()=>import(`./vue-html-3GkraVg2.js`),__vite__mapDeps([122,2]),import.meta.url))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>$(()=>import(`./vue-vine-un5mayXW.js`),__vite__mapDeps([123,2,3,5,12,70,124]),import.meta.url))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>$(()=>import(`./vyper-CgoNMtux.js`),[],import.meta.url))},{id:`wasm`,name:`WebAssembly`,import:(()=>$(()=>import(`./wasm-ByWQv1Qj.js`),[],import.meta.url))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>$(()=>import(`./wenyan-C8pVoKbM.js`),[],import.meta.url))},{id:`wgsl`,name:`WGSL`,import:(()=>$(()=>import(`./wgsl-BsKzXJz4.js`),[],import.meta.url))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>$(()=>import(`./wikitext-ClFFjSW2.js`),[],import.meta.url))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>$(()=>import(`./wit-DdvCle-K.js`),[],import.meta.url))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>$(()=>import(`./wolfram-DLL8P-h_.js`),[],import.meta.url))},{id:`xml`,name:`XML`,import:(()=>$(()=>import(`./xml-DYFbmBqP.js`).then(e=>e.n),__vite__mapDeps([7,8]),import.meta.url))},{id:`xsl`,name:`XSL`,import:(()=>$(()=>import(`./xsl-CVaXn7rF.js`),__vite__mapDeps([93,7,8]),import.meta.url))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>$(()=>import(`./yaml-CCwQ0s68.js`).then(e=>e.n),[],import.meta.url))},{id:`zenscript`,name:`ZenScript`,import:(()=>$(()=>import(`./zenscript-BnlCZFoB.js`),[],import.meta.url))},{id:`zig`,name:`Zig`,import:(()=>$(()=>import(`./zig-CMLA9XwU.js`),[],import.meta.url))}],tb=Object.fromEntries(eb.map(e=>[e.id,e.import])),nb=Object.fromEntries(eb.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),rb={...tb,...nb},ib=`github-dark-default`,ab={h:`c`,hh:`cpp`,hpp:`cpp`,hxx:`cpp`,cc:`cpp`,cxx:`cpp`,htm:`html`,svg:`xml`,pl:`perl`,ex:`elixir`,exs:`elixir`,makefile:`make`,dockerfile:`dockerfile`},ob=new Map;for(let e of eb)for(let t of[e.id,...e.aliases??[]])ob.set(t.toLowerCase(),e.id);for(let[e,t]of Object.entries(ab))ob.set(e,t);function sb(e){let t=e.slice(e.lastIndexOf(`/`)+1).toLowerCase(),n=t.lastIndexOf(`.`),r=n===-1?t:t.slice(n+1);return ob.get(r)??ob.get(t)??null}var cb=null;function lb(){return cb??=Ty({themes:[$(()=>import(`./github-dark-default-DXG-b-1a.js`),[],import.meta.url)],langs:[],engine:Xy($(()=>import(`./wasm-BnjxR4X6.js`),[],import.meta.url))}),cb}async function ub(e){let t=await lb();return t.getLoadedLanguages().includes(e)||await t.loadLanguage(rb[e]),n=>n.length===0?[]:t.codeToTokensBase(n.join(`
84
- `),{lang:e,theme:ib})}function db(e,t){let n=new Map,r=new Map;if(e.newContent!==null){let r=Math.max(0,...e.hunks.flatMap(e=>e.lines.map(e=>e.newNo??0)));t(ml(e.newContent).slice(0,r)).forEach((e,t)=>n.set(t+1,e))}for(let i of e.hunks){let a=i.lines.filter(e=>e.type!==`add`);if(t(a.map(e=>e.text)).forEach((e,t)=>r.set(a[t].oldNo,e)),e.newContent===null){let e=i.lines.filter(e=>e.type!==`del`);t(e.map(e=>e.text)).forEach((t,r)=>n.set(e[r].newNo,t))}}return{newSide:n,oldSide:r}}function fb(e){let t=sb(e.path),[n,r]=(0,v.useState)(null);(0,v.useEffect)(()=>{if(t===null)return;let e=!1;return ub(t).then(n=>!e&&r({lang:t,tokenizer:n}),n=>!e&&r({lang:t,error:n instanceof Error?n.message:String(n)})),()=>{e=!0}},[t]);let i=n!==null&&n.lang===t?n:null,a=i!==null&&`tokenizer`in i?i.tokenizer:null;return(0,v.useMemo)(()=>{if(i!==null&&`error`in i)return{status:`error`,message:i.error};if(a===null)return{status:`none`};let t=new Map;return{status:`ready`,file:db(e,a),suggestion:e=>{let n=t.get(e);return n||(n=a(ml(e)),t.set(e,n)),n}}},[i,a,e])}var pb={context:` `,add:`+`,del:`−`};function mb(e,t){return t===`new`&&e===`add`?`is-new`:`is-${e}`}function hb(e,t){let n=[],r=0;for(let{text:i,style:a}of e){let e=t.flatMap(e=>[e.start,e.end]).map(e=>Math.min(Math.max(e-r,0),i.length)),o=[...new Set([0,...e,i.length])].sort((e,t)=>e-t);for(let e=0;e<o.length-1;e++){let s=r+o[e],c=t.find(e=>s>=e.start&&s<e.end);n.push({text:i.slice(o[e],o[e+1]),style:a,className:c?.className})}r+=i.length}return n}function gb({text:e,tokens:t,marks:n=[]}){let r=t?t.map(e=>({text:e.content,style:yb(e)})):[{text:e}];return(0,V.jsx)(`span`,{className:`diff-code${t?` is-highlighted`:``}`,children:hb(r,n).map((e,t)=>(0,V.jsx)(`span`,{style:e.style,className:e.className,children:e.text},t))})}function _b(e,t,n){if(e.replaced&&!n)return[];if(e.oldLine){let t=de(e.oldLine.text,e.line.text);return n?[{start:t.start,end:t.oldEnd,className:`diff-indent is-del`}]:[{start:t.start,end:t.newEnd,className:`diff-indent is-add`}]}return!e.inline||t.type===`context`?[]:e.inline.map(e=>({...e,className:`diff-inline is-${t.type}`}))}function vb(e,t){let{oldEnd:n,newEnd:r}=de(e,t);return r>n?`→`:r<n?`←`:`↔`}function yb(e){let t=e.fontStyle??0;return{color:e.color,fontStyle:t&1?`italic`:void 0,fontWeight:t&2?600:void 0}}function bb(e){return e?{"--mark":lu[e.severity].color}:void 0}function xb(e){return e?e.muted?` has-bar is-bar-muted`:` has-bar`:``}function Sb({entries:e}){return(0,V.jsx)(`span`,{className:`diff-pills`,children:e.map(e=>(0,V.jsx)(`span`,{className:e.finding.status===`open`?void 0:`is-muted`,title:e.finding.title,children:(0,V.jsx)(em,{entry:e,small:!0})},e.finding.id))})}function Cb({entry:e,bar:t,pills:n,applied:r,isTarget:i,onHide:a}){let o=ml(e.finding.suggestion??``).length===0,s=Zl(e.startLine,e.endLine),c=o?`supprime ${s}`:`remplace ${s}`;return(0,V.jsxs)(`div`,{className:`fix-strip${r?` is-applied`:``}${xb(t)}${i?` is-target`:``}`,style:bb(t),"data-fix":e.finding.id,children:[(0,V.jsx)(em,{entry:e,small:!0}),(0,V.jsx)(H,{name:`sparkles`,color:`#8b97ff`}),(0,V.jsx)(`span`,{className:`fix-strip-text`,children:r?`Correctif ${e.number} appliqué — ${c}`:`Correctif proposé par l'agent — ${c}`}),n.length>0&&(0,V.jsx)(Sb,{entries:n}),(0,V.jsx)(`button`,{type:`button`,className:`fix-strip-hide`,onClick:a,children:r?`Retirer le correctif`:`Masquer le correctif`})]})}function wb({context:e,onChange:t}){return(0,V.jsxs)(`div`,{className:`context-stepper`,role:`group`,"aria-label":`Contexte du bloc`,children:[(0,V.jsxs)(`button`,{type:`button`,className:`context-stepper-button`,disabled:!e.canShrink,title:`Retirer 5 lignes de contexte au-dessus et en dessous`,onClick:()=>t(-1),children:[(0,V.jsx)(H,{name:`fold-vertical`,size:12}),`−`,5]}),(0,V.jsx)(`span`,{className:`context-stepper-count`,children:Eu(e.context,`ligne`)}),(0,V.jsxs)(`button`,{type:`button`,className:`context-stepper-button`,disabled:!e.canGrow,title:`Ajouter 5 lignes de contexte au-dessus et en dessous`,onClick:()=>t(1),children:[(0,V.jsx)(H,{name:`unfold-vertical`,size:12}),`+`,5]})]})}function Tb({mode:e,codeView:t,explained:n,reindented:r,inlined:i,expanded:a}){return(0,V.jsxs)(`div`,{className:`diff-legend`,children:[t===`new`?(0,V.jsxs)(`span`,{className:`legend-item`,children:[(0,V.jsx)(`span`,{className:`legend-swatch is-new`}),`Ajouté par la feature`]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`span`,{className:`legend-item`,children:[(0,V.jsx)(`span`,{className:`legend-swatch is-add`}),`Ajouté par la feature`]}),(0,V.jsxs)(`span`,{className:`legend-item`,children:[(0,V.jsx)(`span`,{className:`legend-swatch is-del`}),`Supprimé par la feature`]})]}),i&&(0,V.jsxs)(`span`,{className:`legend-item`,children:[(0,V.jsx)(`span`,{className:`legend-swatch ${t===`new`?`is-inline-add`:`is-inline`}`}),`Partie modifiée de la ligne`]}),r&&(0,V.jsxs)(`span`,{className:`legend-item`,children:[(0,V.jsx)(`span`,{className:`legend-swatch is-reindent`}),`Indentation modifiée`]}),e===`before-after`&&(0,V.jsxs)(`span`,{className:`legend-item`,children:[(0,V.jsx)(`span`,{className:`legend-swatch is-replaced`}),`Lignes remplacées par le correctif`]}),e!==`off`&&(0,V.jsxs)(`span`,{className:`legend-item`,children:[(0,V.jsx)(`span`,{className:`legend-swatch is-proposed`}),e===`applied`?`Correctif appliqué`:`Correctif proposé`]}),n&&(0,V.jsxs)(`span`,{className:`legend-item`,children:[(0,V.jsx)(`span`,{className:`legend-swatch is-explained`}),`Code décrit par une explication`]}),a&&(0,V.jsxs)(`span`,{className:`legend-item`,children:[(0,V.jsx)(`span`,{className:`legend-swatch is-expanded`}),`Contexte ajouté`]})]})}function Eb({file:e,fileDiff:t,hunks:n,hunkContexts:r,addedContext:i,onContextChange:a,findings:o,notedLines:s,scrollRef:c,mode:l,onModeChange:u,codeView:d,onCodeViewChange:f,scope:p,onScopeChange:m,wholeFileAvailable:h,explained:g,target:_,onLineNote:y,onHideFix:b,onRequestExplanation:x}){let S=e.contentAvailable,C=fb(t),ee=(0,v.useRef)(null),w=(0,v.useRef)(null),[te,T]=(0,v.useState)(0),E=p===`file`,D=(0,v.useMemo)(()=>E?Xl(n,d,o,s):null,[E,n,d,o,s]);(0,v.useEffect)(()=>{let e=ee.current;if(!e)return;let t=new ResizeObserver(()=>T(e.offsetHeight));return t.observe(e),()=>t.disconnect()},[]);let O=(e,t)=>(0,V.jsx)(Cb,{entry:e.entry,bar:e.bar,pills:e.pills,applied:l===`applied`,isTarget:Dl(_,{kind:`fix`,entry:e.entry}),onHide:()=>b(e.entry.finding.id)},t),k=(e,t,n)=>{if(e.kind===`fix-line`)return(0,V.jsxs)(`div`,{className:`diff-line is-proposed${xb(e.bar)}`,style:bb(e.bar),children:[(0,V.jsx)(`span`,{className:`diff-num`}),(0,V.jsx)(`span`,{className:`diff-marker`,children:`›`}),(0,V.jsx)(gb,{text:e.text,tokens:C.status===`ready`?C.suggestion(e.entry.finding.suggestion??``)[e.index]:void 0})]},n);let{oldLine:r}=e,a=t===`old`,o=a&&r?r:e.line,c=r??(o.type===`del`?o:null),l=e.replaced&&!a,u=a?null:e.bar,f=a?null:o.newNo,p=C.status!==`ready`||l?void 0:o.type===`del`?C.file.oldSide.get(o.oldNo):C.file.newSide.get(o.newNo),m=_b(e,o,a),h=[`diff-line`,r?`is-reindent`:mb(o.type,d),!r&&!l&&e.inline?`has-inline`:``,l?`is-replaced`:``,o.type===`context`&&o.newNo!==null&&i?.has(o.newNo)?`is-expanded`:``,e.explained?`is-explained`:``,xb(u).trim(),f!==null&&Dl(_,{kind:`line`,line:f})?`is-target`:``];return(0,V.jsxs)(`div`,{className:h.filter(Boolean).join(` `),style:bb(u),"data-line":f??void 0,"data-old-line":t===`new`?void 0:c?.oldNo??void 0,children:[f!==null&&s.has(f)&&(0,V.jsx)(`span`,{className:`diff-note-dot`,title:`Remarque sur cette ligne`}),f!==null&&S?(0,V.jsx)(`button`,{type:`button`,className:`diff-num`,title:`Ajouter une remarque sur la ligne ${f}`,onClick:()=>y(f),children:f}):(0,V.jsx)(`span`,{className:`diff-num`,children:(a?o.oldNo:f)??``}),r?(0,V.jsx)(`span`,{className:`diff-marker`,title:`Seule l'indentation de cette ligne change (ligne ${r.oldNo} avant)`,children:vb(r.text,e.line.text)}):(0,V.jsx)(`span`,{className:`diff-marker`,children:d===`new`?``:pb[o.type]}),(0,V.jsx)(gb,{text:o.text,tokens:p,marks:m}),!a&&e.pills.length>0&&(0,V.jsx)(Sb,{entries:e.pills})]},n)};return(0,V.jsxs)(`div`,{className:`diff`,children:[(0,V.jsxs)(`div`,{className:`diff-toolbar`,ref:ee,children:[C.status===`error`&&(0,V.jsxs)(`span`,{className:`diff-toolbar-error`,children:[`Coloration syntaxique indisponible : `,C.message]}),(0,V.jsx)(rm,{label:`Afficher`,options:Sl,value:p,onChange:m,disabled:h?void 0:{file:`Contenu du fichier non conservé dans l'analyse`}}),(0,V.jsx)(rm,{label:`Code`,options:xl,value:d,onChange:f}),(0,V.jsx)(rm,{label:`Correctifs`,options:bl,value:l,onChange:u})]}),(0,V.jsxs)(`div`,{className:`diff-body${E?` has-minimap`:``}`,children:[(0,V.jsx)(`div`,{className:`diff-rows`,ref:w,children:n.map((e,t)=>(0,V.jsxs)(`div`,{className:`hunk`,children:[(0,V.jsxs)(`div`,{className:`hunk-header`,children:[(0,V.jsx)(`span`,{className:`hunk-header-text mono`,children:e.hunk.header}),r?.[t]&&(0,V.jsx)(wb,{context:r[t],onChange:e=>a(t,e)}),(0,V.jsx)(`button`,{type:`button`,className:`hunk-explain`,title:`Copier un prompt qui demande à l'agent d'expliquer ce bloc et d'ajouter ses explications à l'analyse`,"aria-label":`Copier une demande d'explication`,onClick:()=>x(e.hunk),children:(0,V.jsx)(H,{name:`bot`,color:`#3cc4b4`})})]}),d===`split`?zl(e.rows).map((e,t)=>e.kind===`full`?O(e.row,t):(0,V.jsxs)(`div`,{className:`diff-split-row`,children:[e.left?k(e.left,`old`):(0,V.jsx)(`div`,{className:`diff-line is-empty`}),e.right?k(e.right,`new`):(0,V.jsx)(`div`,{className:`diff-line is-empty`})]},t)):e.rows.map((e,t)=>e.kind===`fix-strip`?O(e,t):k(e,`both`,t))]},t))}),D&&(0,V.jsx)(cm,{model:D,rowsRef:w,scrollRef:c,toolbarHeight:te})]}),(0,V.jsx)(Tb,{mode:l,codeView:d,explained:g,reindented:n.some(e=>e.rows.some(e=>e.kind===`line`&&e.oldLine!==null)),inlined:n.some(e=>e.rows.some(e=>e.kind===`line`&&e.inline!==null&&!e.replaced)),expanded:i!==null&&i.size>0})]})}var Db=8,Ob=600;function kb({explanation:e}){let[t,n]=(0,v.useState)(!1),{side:r,startLine:i,endLine:a}=e.location,o=e.body.split(`
85
- `).length>Db||e.body.length>Ob;return(0,V.jsxs)(`article`,{className:`margin-card margin-explanation is-${e.status}`,"data-explanation-card":e.id,children:[(0,V.jsxs)(`header`,{className:`margin-card-head`,children:[(0,V.jsx)(H,{name:`info`,color:`#3cc4b4`}),(0,V.jsx)(`span`,{className:`margin-explanation-kind`,children:`Explication`}),r===`old`&&(0,V.jsx)(`span`,{className:`tag explanation-side`,children:`Code supprimé`}),e.status===`outdated`&&(0,V.jsx)(`span`,{className:`tag explanation-outdated-tag`,children:`Obsolète`}),(0,V.jsxs)(`span`,{className:`margin-card-lines mono`,title:r===`old`?`Numéros de ligne avant la feature`:void 0,children:[`l. `,hl(i,a,`–`)]})]}),(0,V.jsx)(`h3`,{className:`margin-card-title`,children:e.title}),e.status===`outdated`&&(0,V.jsx)(`p`,{className:`explanation-outdated`,children:`Le code décrit a changé depuis la rédaction de cette explication : elle peut ne plus correspondre.`}),(0,V.jsx)(`p`,{className:`margin-explanation-body${o&&!t?` is-folded`:``}`,children:e.body}),o&&(0,V.jsx)(`button`,{type:`button`,className:`margin-explanation-more`,"aria-expanded":t,onClick:()=>n(!t),children:t?`Réduire`:`Lire la suite`})]})}function Ab({note:e}){let t=B(e=>e.updateNote),n=B(e=>e.deleteNote),r=B(e=>e.saving),[i,a]=(0,v.useState)(!1),o=e.location?.line?`ligne ${e.location.line}`:`fichier entier`;return i?(0,V.jsx)(Mb,{id:`note-edit-${e.id}`,label:`Modifier la remarque (${o})`,initialText:e.text,submitLabel:`Enregistrer la modification`,onSubmit:n=>n===e.text?Promise.resolve(!0):t(e.id,n),onClose:()=>a(!1)}):(0,V.jsxs)(`div`,{className:`note-card`,children:[(0,V.jsxs)(`div`,{className:`note-head`,children:[(0,V.jsx)($u,{fixed:!1}),(0,V.jsxs)(`span`,{className:`note-meta`,title:`${o} · ${Cu(e.createdAt)}`,children:[o,` · `,Tu(e.createdAt)]}),(0,V.jsxs)(`button`,{type:`button`,className:`link-button muted`,disabled:r,onClick:()=>a(!0),children:[(0,V.jsx)(H,{name:`pencil`,size:13}),`Modifier`]}),(0,V.jsxs)(`button`,{type:`button`,className:`link-button muted`,disabled:r,onClick:()=>void n(e.id),children:[(0,V.jsx)(H,{name:`trash`,size:13}),`Supprimer`]})]}),(0,V.jsx)(`p`,{className:`note-text`,children:e.text})]})}function jb({path:e,line:t,findingId:n,onClose:r}){let i=B(e=>e.addNote);return(0,V.jsx)(Mb,{id:`note-${t??`file`}`,label:t===null?`Remarque sur le fichier`:`Remarque sur la ligne ${t}`,initialText:``,submitLabel:`Enregistrer la remarque`,onSubmit:r=>i(e,t,r,n),onClose:r})}function Mb({id:e,label:t,initialText:n,submitLabel:r,onSubmit:i,onClose:a}){let o=B(e=>e.saving),[s,c]=(0,v.useState)(n),l=(0,v.useRef)(null);(0,v.useEffect)(()=>l.current?.focus(),[]);let u=async()=>{s.trim()!==``&&await i(s.trim())&&a()};return(0,V.jsxs)(`form`,{className:`note-composer`,onSubmit:e=>{e.preventDefault(),u()},children:[(0,V.jsx)(`label`,{className:`note-composer-label`,htmlFor:e,children:t}),(0,V.jsx)(`textarea`,{id:e,ref:l,rows:3,value:s,placeholder:`Ce que l'agent doit revoir…`,onChange:e=>c(e.target.value),onFocus:e=>e.currentTarget.setSelectionRange(e.currentTarget.value.length,e.currentTarget.value.length),onKeyDown:e=>{e.key===`Escape`&&a(),e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),u())}}),(0,V.jsxs)(`div`,{className:`note-composer-actions`,children:[(0,V.jsx)(`span`,{className:`hint`,children:`Ctrl + Entrée pour enregistrer · Échap pour annuler`}),(0,V.jsx)(`button`,{type:`button`,className:`button button-ghost`,onClick:a,children:`Annuler`}),(0,V.jsx)(`button`,{type:`submit`,className:`button button-primary button-small`,disabled:o||s.trim()===``,children:r})]})]})}var Nb=40;function Pb(e,t){let[n,r]=(0,v.useState)([]),i=(0,v.useRef)(()=>{});return(0,v.useLayoutEffect)(()=>{i.current=()=>{let n=e.current,i=t.current;if(!n||!i)return;let a=n.getBoundingClientRect().bottom-Nb,o=[...i.querySelectorAll(`[data-finding-card]`)].map(e=>({id:e.dataset.findingCard,top:e.getBoundingClientRect().top})).filter(e=>e.top>a).sort((e,t)=>e.top-t.top).map(e=>e.id);r(e=>e.join(`
82
+ \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function Ev(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&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=h_);let l=Dv(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!yv(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||!rv(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Dv(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=Ov(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 Ov(e,t,n){let r=d_(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=z_(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Tv.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?K_:q_)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=z_(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Tv.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&G_(n,o)>G_(n,e.alternative)&&(o=e.alternative),s=o+z_(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Tv.single:Tv.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var kv=[`<`,`&`];function Av(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:z_(e.value,Object.assign({},r.settings.characterReferences,{subset:kv}))}function jv(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Av(e,t,n,r)}function Mv(e,t,n,r){return r.all(e)}var Nv=__(`type`,{invalid:Pv,unknown:Fv,handlers:{comment:U_,doctype:W_,element:Ev,raw:jv,root:Mv,text:Av}});function Pv(e){throw Error("Expected node, not `"+e+"`")}function Fv(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Iv={},Lv={},Rv=[];function zv(e,t){let n=t||Iv,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Bv,all:Vv,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||Lg,characterReferences:n.characterReferences||Lv,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?h_:m_,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function Bv(e,t,n){return Nv(e,t,n,this)}function Vv(e){let t=[],n=e&&e.children||Rv,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var Hv=/\s+/g;function Uv(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(Hv)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(Hv);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function Wv(e){let t=ag(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}var Gv=[`color`,`background-color`];function Kv(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 qv(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function Jv(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=qv(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(r,i);for(let t=0;t<a.length;t++)a[t]-=e.offset;return Kv(e,a)})):e}function Yv(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>Xv(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&&Gv.includes(a)){if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new mm('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=o[e][a]||`inherit`,d=o[r][a]||`inherit`;c[a]=`light-dark(${u}, ${d})`,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 Xv(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&Fm.Italic&&(t[`font-style`]=`italic`),e.fontStyle&Fm.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&Fm.Underline&&n.push(`underline`),e.fontStyle&Fm.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function Zv(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function Qv(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=Wv(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new mm(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}{let t=n.lines[e.line];if(t===void 0)throw new mm(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new mm(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));$v(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return Jv(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new mm(`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+=ey(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new mm(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new mm(`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&&Uv(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 $v(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new mm(`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 mm(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function ey(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(ey).join(``):``}var ty=[Qv()];function ny(e){let t=ry(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...ty]}function ry(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 iy=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],ay={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function oy(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 sy(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}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function cy(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)ay[r]&&t.push({type:`setDecoration`,value:ay[r]});else if(r<=29){let e=ay[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:iy[r-30]}});else if(r===38){let n=sy(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:iy[r-40]}});else if(r===48){let n=sy(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:iy[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:iy[r-100+8]}})}}return t}function ly(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=oy(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=cy(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 uy={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 dy(e=uy){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<iy.length;e++)r.push(t(iy[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 fy=/#([0-9a-f]{3,8})/i,py=/var\((--[\w-]+-ansi-[\w-]+)\)/,my={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 hy(e,t,n){let r=Xh(e,n),i=ag(t),a=dy(Object.fromEntries(iy.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||my[t]]}))),o=ly();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=Zh(i,r),o=Zh(o,r),n.decorations.has(`dim`)&&(i=gy(i));let s=Fm.None;return n.decorations.has(`bold`)&&(s|=Fm.Bold),n.decorations.has(`italic`)&&(s|=Fm.Italic),n.decorations.has(`underline`)&&(s|=Fm.Underline),n.decorations.has(`strikethrough`)&&(s|=Fm.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function gy(e){let t=e.match(fy);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}`}if(e.length===6)return`#${e}80`;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`)}`}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(py);return n?`var(${n[1]}-dim)`:e}function _y(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!eg(r)&&!ng(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return hy(r,t,n)}return Eg(e,t,n)}function vy(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new mm("`themes` option must not be empty");let p=Fg(e,t,n,_y);if(c=bg(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new mm(`\`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=>Yv(e,h,u,l,d))),c&&yg(a,c);let g=f.map(e=>Xh(e.theme,n));i=yy(f,m,g,u,l,`fg`,d),r=yy(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=Xh(n.theme,n);a=_y(e,t,n);let l=e.getTheme(n.theme);r=Zh(l.bg,s),i=Zh(l.fg,s),o=l.name,c=bg(a)}else throw new mm("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function yy(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=Zh(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new mm('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${Zh(t[r][a],n[r])||`inherit`}, ${Zh(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var by=/^\s+$/,xy=/^(\s*)(.*?)(\s*)$/;function Sy(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>Sy(e,t,n),codeToTokens:(t,n)=>vy(e,t,n)}){let i=t;for(let e of ny(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=vy(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=wy(a):d===`never`&&(a=Ty(a)),f&&(a=Ey(a));let p={...r,get source(){return i}};for(let e of ny(n))a=e.tokens?.call(p,a)||a;return Cy(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function Cy(e,t,n,r=bg(e)){let i=ny(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`: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:Uv,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:`
83
+ `}));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=Zv(a.htmlStyle||Xv(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&&yg(m,r),m}function wy(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&Fm.Underline||i.fontStyle&Fm.Strikethrough));o&&by.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function Ty(e){return e.map(e=>e.flatMap(e=>{if(by.test(e.content))return e;let t=e.content.match(xy);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 Ey(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=Zv(e.htmlStyle||Xv(e)),i=Zv(n.htmlStyle||Xv(n)),a=e.fontStyle&&(e.fontStyle&Fm.Underline||e.fontStyle&Fm.Strikethrough),o=n.fontStyle&&(n.fontStyle&Fm.Underline||n.fontStyle&Fm.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Dy=zv;function Oy(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>Sy(e,t,n),codeToTokens:(t,n)=>vy(e,t,n)},i=Dy(Sy(e,t,n,r));for(let e of ny(n))i=e.postprocess?.call(r,i,n)||i;return i}async function ky(e){let t=await _g(e);return{getLastGrammarState:(...e)=>Dg(t,...e),codeToTokensBase:(e,n)=>_y(t,e,n),codeToTokensWithThemes:(e,n)=>Fg(t,e,n),codeToTokens:(e,n)=>vy(t,e,n),codeToHast:(e,n)=>Sy(t,e,n),codeToHtml:(e,n)=>Oy(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}var Ay=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function jy(){return 2147483648}function My(){return typeof performance<`u`?performance.now():Date.now()}var Ny=(e,t)=>e+(t-e%t)%t;async function Py(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=jy();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,Ny(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:My,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 Fy=Object.defineProperty,Iy=(e,t,n)=>t in e?Fy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ly=(e,t,n)=>Iy(e,typeof t==`symbol`?t:t+``,n),Ry=null;function zy(e){throw new Ay(e.UTF8ToString(e.getLastOnigError()))}var By=class e{constructor(t){Ly(this,`utf16Length`),Ly(this,`utf8Length`),Ly(this,`utf16Value`),Ly(this,`utf8Value`),Ly(this,`utf16OffsetToUtf8`),Ly(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},Vy=class e{constructor(t){if(Ly(this,`id`,++e.LAST_ID),Ly(this,`_onigBinding`),Ly(this,`content`),Ly(this,`utf16Length`),Ly(this,`utf8Length`),Ly(this,`utf16OffsetToUtf8`),Ly(this,`utf8OffsetToUtf16`),Ly(this,`ptr`),!Ry)throw new Ay(`Must invoke loadWasm first.`);this._onigBinding=Ry,this.content=t;let n=new By(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=Ry.omalloc(1e4),e._sharedPtrInUse=!0,Ry.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(Ry)}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)}};Ly(Vy,`LAST_ID`,0),Ly(Vy,`_sharedPtr`,0),Ly(Vy,`_sharedPtrInUse`,!1);var Hy=Vy,Uy=class{constructor(e){if(Ly(this,`_onigBinding`),Ly(this,`_ptr`),!Ry)throw new Ay(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new By(e[r]);t[r]=i.createString(Ry),n[r]=i.utf8Length}let r=Ry.omalloc(4*e.length);Ry.HEAPU32.set(t,r/4);let i=Ry.omalloc(4*e.length);Ry.HEAPU32.set(n,i/4);let a=Ry.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)Ry.ofree(t[n]);Ry.ofree(i),Ry.ofree(r),a===0&&zy(Ry),this._onigBinding=Ry,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 Hy(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 Wy(e){return typeof e.instantiator==`function`}function Gy(e){return typeof e.default==`function`}function Ky(e){return e.data!==void 0}function qy(e){return typeof Response<`u`&&e instanceof Response}function Jy(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 Yy;function Xy(e){if(Yy)return Yy;async function t(){Ry=await Py(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),Wy(n)?n=await n.instantiator(t):Gy(n)?n=await n.default(t):(Ky(n)&&(n=n.data),qy(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await Qy(n)(t):await $y(n)(t):Jy(n)||n instanceof WebAssembly.Module?n=await Zy(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await Zy(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return Yy=t(),Yy}function Zy(e){return t=>WebAssembly.instantiate(e,t)}function Qy(e){return t=>WebAssembly.instantiateStreaming(e,t)}function $y(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function eb(e){return e&&await Xy(e),{createScanner(e){return new Uy(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new Hy(e)}}}var tb=`modulepreload`,nb=function(e,t){return new URL(e,t).href},rb={},$=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=nb(t,n),t=s(t),t in rb)return;rb[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:tb,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).filter(e=>e!==void 0))}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)})},ib=[{id:`abap`,name:`ABAP`,import:(()=>$(()=>import(`./abap-CLvhMVsD.js`),[],import.meta.url))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>$(()=>import(`./actionscript-3-Cs6JJXT5.js`),[],import.meta.url))},{id:`ada`,name:`Ada`,import:(()=>$(()=>import(`./ada-X3Y2mlq2.js`),[],import.meta.url))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>$(()=>import(`./ahk-DwADkxyd.js`),[],import.meta.url))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>$(()=>import(`./ahk2-_6rzW9BS.js`),[],import.meta.url))},{id:`angular-html`,name:`Angular HTML`,import:(()=>$(()=>import(`./angular-html-BG32ZSEg.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3]),import.meta.url))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>$(()=>import(`./angular-ts-W997xU6j.js`),__vite__mapDeps([4,0,1,2,3,5]),import.meta.url))},{id:`apache`,name:`Apache Conf`,import:(()=>$(()=>import(`./apache-U0d_L8uA.js`),[],import.meta.url))},{id:`apex`,name:`Apex`,import:(()=>$(()=>import(`./apex-KFGFyKwG.js`),[],import.meta.url))},{id:`apl`,name:`APL`,import:(()=>$(()=>import(`./apl-6ogEEQiK.js`),__vite__mapDeps([6,2,3,1,7,8,9]),import.meta.url))},{id:`applescript`,name:`AppleScript`,import:(()=>$(()=>import(`./applescript-CCn79oCD.js`),[],import.meta.url))},{id:`ara`,name:`Ara`,import:(()=>$(()=>import(`./ara-4CJ0cIlV.js`),[],import.meta.url))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>$(()=>import(`./asciidoc-SCjQUq34.js`),[],import.meta.url))},{id:`asm`,name:`Assembly`,import:(()=>$(()=>import(`./asm-Cmm7eHzH.js`),[],import.meta.url))},{id:`astro`,name:`Astro`,import:(()=>$(()=>import(`./astro-DBxTz6gT.js`),__vite__mapDeps([10,2,3,9,11,12,13]),import.meta.url))},{id:`awk`,name:`AWK`,import:(()=>$(()=>import(`./awk-BWXHIvNe.js`),[],import.meta.url))},{id:`ballerina`,name:`Ballerina`,import:(()=>$(()=>import(`./ballerina-B7ZEbQpA.js`),[],import.meta.url))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>$(()=>import(`./bat-qdxAdBWQ.js`),[],import.meta.url))},{id:`beancount`,name:`Beancount`,import:(()=>$(()=>import(`./beancount-C2IN4Vk8.js`),[],import.meta.url))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>$(()=>import(`./berry-DKpUyyne.js`),[],import.meta.url))},{id:`bibtex`,name:`BibTeX`,import:(()=>$(()=>import(`./bibtex-Ci_nEsc7.js`),[],import.meta.url))},{id:`bicep`,name:`Bicep`,import:(()=>$(()=>import(`./bicep-CUHmPFLl.js`),[],import.meta.url))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>$(()=>import(`./bird2-CYIUgYqB.js`),[],import.meta.url))},{id:`blade`,name:`Blade`,import:(()=>$(()=>import(`./blade-PbZvkn0I.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16]),import.meta.url))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>$(()=>import(`./bsl-_VjlB9mv.js`),__vite__mapDeps([17,18]),import.meta.url))},{id:`c`,name:`C`,import:(()=>$(()=>import(`./c-C5-3wfrB.js`).then(e=>e.n),[],import.meta.url))},{id:`c3`,name:`C3`,import:(()=>$(()=>import(`./c3-D0apG41V.js`),[],import.meta.url))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>$(()=>import(`./cadence-CQ2zXKGN.js`),[],import.meta.url))},{id:`cairo`,name:`Cairo`,import:(()=>$(()=>import(`./cairo-DLTphjLi.js`),__vite__mapDeps([19,20]),import.meta.url))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>$(()=>import(`./chapel-KHYeKJD5.js`),__vite__mapDeps([21,22]),import.meta.url))},{id:`clarity`,name:`Clarity`,import:(()=>$(()=>import(`./clarity-CtfBBspg.js`),[],import.meta.url))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>$(()=>import(`./clojure-DqKBuwfJ.js`),[],import.meta.url))},{id:`cmake`,name:`CMake`,import:(()=>$(()=>import(`./cmake-Bj61d0ZC.js`),[],import.meta.url))},{id:`cobol`,name:`COBOL`,import:(()=>$(()=>import(`./cobol-D51AxaJB.js`),__vite__mapDeps([23,1,2,3,8]),import.meta.url))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>$(()=>import(`./codeowners-C8r90Shi.js`),[],import.meta.url))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>$(()=>import(`./codeql-oeQT6MSM.js`),[],import.meta.url))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>$(()=>import(`./coffee-4h6_4dhl.js`),__vite__mapDeps([24,2]),import.meta.url))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>$(()=>import(`./common-lisp-Cv5bFMCO.js`),[],import.meta.url))},{id:`coq`,name:`Rocq`,import:(()=>$(()=>import(`./coq-CGaSfhwR.js`),[],import.meta.url))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>$(()=>import(`./cpp-B63oWnHV.js`).then(e=>e.n),__vite__mapDeps([25,26,27,22]),import.meta.url))},{id:`crystal`,name:`Crystal`,import:(()=>$(()=>import(`./crystal-OG_TkIE7.js`),__vite__mapDeps([28,2,3,1,16,22,29]),import.meta.url))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>$(()=>import(`./csharp-dmMxLVLW.js`),[],import.meta.url))},{id:`css`,name:`CSS`,import:(()=>$(()=>import(`./css-Csea3soR.js`).then(e=>e.n),[],import.meta.url))},{id:`csv`,name:`CSV`,import:(()=>$(()=>import(`./csv-Dx-8-gkx.js`),[],import.meta.url))},{id:`cue`,name:`CUE`,import:(()=>$(()=>import(`./cue-CE9AQfxI.js`),[],import.meta.url))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>$(()=>import(`./cypher-ClKdZ_lG.js`),[],import.meta.url))},{id:`d`,name:`D`,import:(()=>$(()=>import(`./d-qD-0Kul2.js`),[],import.meta.url))},{id:`dart`,name:`Dart`,import:(()=>$(()=>import(`./dart-CHZY9Xhz.js`),[],import.meta.url))},{id:`dax`,name:`DAX`,import:(()=>$(()=>import(`./dax-BkyTk9wS.js`),[],import.meta.url))},{id:`desktop`,name:`Desktop`,import:(()=>$(()=>import(`./desktop-Dlh5hvp9.js`),[],import.meta.url))},{id:`diff`,name:`Diff`,import:(()=>$(()=>import(`./diff-woXpYk--.js`),[],import.meta.url))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>$(()=>import(`./docker-IyjqRm3v.js`),[],import.meta.url))},{id:`dotenv`,name:`dotEnv`,import:(()=>$(()=>import(`./dotenv-CuH5my32.js`),[],import.meta.url))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>$(()=>import(`./dream-maker-DW3nJb8Q.js`),[],import.meta.url))},{id:`edge`,name:`Edge`,import:(()=>$(()=>import(`./edge-HBaaYuuJ.js`),__vite__mapDeps([30,1,2,3,11,15]),import.meta.url))},{id:`elixir`,name:`Elixir`,import:(()=>$(()=>import(`./elixir-DZlxxd9b.js`),__vite__mapDeps([31,1,2,3]),import.meta.url))},{id:`elm`,name:`Elm`,import:(()=>$(()=>import(`./elm-DZAjSs9M.js`),__vite__mapDeps([32,27,22]),import.meta.url))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>$(()=>import(`./emacs-lisp-DR2vtWaj.js`),[],import.meta.url))},{id:`erb`,name:`ERB`,import:(()=>$(()=>import(`./erb-BurFBvpV.js`),__vite__mapDeps([33,1,2,3,34,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39]),import.meta.url))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>$(()=>import(`./erlang-Cphh6RMH.js`),__vite__mapDeps([40,41]),import.meta.url))},{id:`fennel`,name:`Fennel`,import:(()=>$(()=>import(`./fennel-DQxkIbk2.js`),[],import.meta.url))},{id:`fish`,name:`Fish`,import:(()=>$(()=>import(`./fish-BJitypiv.js`),[],import.meta.url))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>$(()=>import(`./fluent-C03EYrpw.js`),[],import.meta.url))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>$(()=>import(`./fortran-fixed-form-DEKoE2YW.js`),__vite__mapDeps([42,43]),import.meta.url))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>$(()=>import(`./fortran-free-form-CYNrtFtB.js`),[],import.meta.url))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>$(()=>import(`./fsharp-D13ZGOAj.js`),__vite__mapDeps([44,41]),import.meta.url))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>$(()=>import(`./gdresource-xMC7jr7x.js`),__vite__mapDeps([45,46,47]),import.meta.url))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>$(()=>import(`./gdscript-DYvRD3hg.js`),[],import.meta.url))},{id:`gdshader`,name:`GDShader`,import:(()=>$(()=>import(`./gdshader-CBce3t8t.js`),[],import.meta.url))},{id:`genie`,name:`Genie`,import:(()=>$(()=>import(`./genie-CV2tkWYe.js`),[],import.meta.url))},{id:`gherkin`,name:`Gherkin`,import:(()=>$(()=>import(`./gherkin-DExj1W_8.js`),[],import.meta.url))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>$(()=>import(`./git-commit-BSykSTBG.js`),__vite__mapDeps([48,49]),import.meta.url))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>$(()=>import(`./git-rebase-B7wPwCu-.js`),__vite__mapDeps([50,29]),import.meta.url))},{id:`gleam`,name:`Gleam`,import:(()=>$(()=>import(`./gleam-CSRkHgEL.js`),[],import.meta.url))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>$(()=>import(`./glimmer-js-Bgk8Z51T.js`),__vite__mapDeps([51,2,3,1,11]),import.meta.url))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>$(()=>import(`./glimmer-ts-ldZtmANh.js`),__vite__mapDeps([52,2,3,1,11]),import.meta.url))},{id:`glsl`,name:`GLSL`,import:(()=>$(()=>import(`./glsl-7SImpJuS.js`).then(e=>e.n),__vite__mapDeps([27,22]),import.meta.url))},{id:`gn`,name:`GN`,import:(()=>$(()=>import(`./gn-CAXYAgV-.js`),[],import.meta.url))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>$(()=>import(`./gnuplot-7GGW24-e.js`),[],import.meta.url))},{id:`go`,name:`Go`,import:(()=>$(()=>import(`./go-rLFTqkRN.js`),[],import.meta.url))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>$(()=>import(`./graphql-CJ0BLjCq.js`).then(e=>e.n),__vite__mapDeps([36,2,11,13,37]),import.meta.url))},{id:`groovy`,name:`Groovy`,import:(()=>$(()=>import(`./groovy-CacY0gHj.js`),[],import.meta.url))},{id:`hack`,name:`Hack`,import:(()=>$(()=>import(`./hack-D50FsJQB.js`),__vite__mapDeps([53,1,2,3,16]),import.meta.url))},{id:`haml`,name:`Ruby Haml`,import:(()=>$(()=>import(`./haml-xkw_a2ii.js`).then(e=>e.n),__vite__mapDeps([35,2,3]),import.meta.url))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>$(()=>import(`./handlebars-C0upK5dG.js`),__vite__mapDeps([54,2,3,1,39]),import.meta.url))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>$(()=>import(`./haskell-D8IpX4py.js`),[],import.meta.url))},{id:`haxe`,name:`Haxe`,import:(()=>$(()=>import(`./haxe-C8oCnwJJ.js`),[],import.meta.url))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>$(()=>import(`./hcl-Dh228itO.js`),[],import.meta.url))},{id:`hjson`,name:`Hjson`,import:(()=>$(()=>import(`./hjson-CxZEssPk.js`),[],import.meta.url))},{id:`hlsl`,name:`HLSL`,import:(()=>$(()=>import(`./hlsl-Cvrh5tZx.js`),[],import.meta.url))},{id:`html`,name:`HTML`,import:(()=>$(()=>import(`./html-CerDkvKq.js`).then(e=>e.n),__vite__mapDeps([1,2,3]),import.meta.url))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>$(()=>import(`./html-derivative-BfB3QMj5.js`),__vite__mapDeps([15,1,2,3]),import.meta.url))},{id:`http`,name:`HTTP`,import:(()=>$(()=>import(`./http-pXaTY6-R.js`),__vite__mapDeps([55,7,8,9,29,36,2,11,13,37]),import.meta.url))},{id:`hurl`,name:`Hurl`,import:(()=>$(()=>import(`./hurl-BNtMT88T.js`),__vite__mapDeps([56,7,8,57,36,2,11,13,37]),import.meta.url))},{id:`hxml`,name:`HXML`,import:(()=>$(()=>import(`./hxml-Dcm88srW.js`),__vite__mapDeps([58,59]),import.meta.url))},{id:`hy`,name:`Hy`,import:(()=>$(()=>import(`./hy-CZbG8q4J.js`),[],import.meta.url))},{id:`imba`,name:`Imba`,import:(()=>$(()=>import(`./imba-DsUTQ-LC.js`),[],import.meta.url))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>$(()=>import(`./ini-B5eOa1yu.js`),[],import.meta.url))},{id:`java`,name:`Java`,import:(()=>$(()=>import(`./java-B3e3IyVz.js`).then(e=>e.n),[],import.meta.url))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>$(()=>import(`./javascript-DgggYE1f.js`).then(e=>e.n),[],import.meta.url))},{id:`jinja`,name:`Jinja`,import:(()=>$(()=>import(`./jinja-BHtm4gvT.js`),__vite__mapDeps([60,1,2,3]),import.meta.url))},{id:`jison`,name:`Jison`,import:(()=>$(()=>import(`./jison-B2YK1Y49.js`),__vite__mapDeps([61,2]),import.meta.url))},{id:`json`,name:`JSON`,import:(()=>$(()=>import(`./json-7jbWqmUr.js`).then(e=>e.n),[],import.meta.url))},{id:`json5`,name:`JSON5`,import:(()=>$(()=>import(`./json5-BR5RXkoi.js`),[],import.meta.url))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>$(()=>import(`./jsonc-CYpm1nAK.js`),[],import.meta.url))},{id:`jsonl`,name:`JSON Lines`,import:(()=>$(()=>import(`./jsonl-CmCQp5Yx.js`),[],import.meta.url))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>$(()=>import(`./jsonnet-CJTPZ8u_.js`),[],import.meta.url))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>$(()=>import(`./jssm-DXw9l8Rf.js`),[],import.meta.url))},{id:`jsx`,name:`JSX`,import:(()=>$(()=>import(`./jsx-BFPQ2oqh.js`).then(e=>e.n),[],import.meta.url))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>$(()=>import(`./julia-DX1Bsm0x.js`),__vite__mapDeps([62,2,16,20,25,26,27,22,63]),import.meta.url))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>$(()=>import(`./just-D524YAex.js`),__vite__mapDeps([64,2,11,20,29,34,3,1,7,8,16,22,25,26,27,35,36,13,37,38,39,65]),import.meta.url))},{id:`kdl`,name:`KDL`,import:(()=>$(()=>import(`./kdl-CsD5j6eV.js`),[],import.meta.url))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>$(()=>import(`./kotlin-DhhofPvG.js`),[],import.meta.url))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>$(()=>import(`./kusto-C7mF5XQf.js`),[],import.meta.url))},{id:`latex`,name:`LaTeX`,import:(()=>$(()=>import(`./latex-Dc0dzAGl.js`),__vite__mapDeps([66,67,63]),import.meta.url))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>$(()=>import(`./lean-CewbzKMR.js`),[],import.meta.url))},{id:`less`,name:`Less`,import:(()=>$(()=>import(`./less-DVTAwKKz.js`),[],import.meta.url))},{id:`liquid`,name:`Liquid`,import:(()=>$(()=>import(`./liquid-DXohsHev.js`),__vite__mapDeps([68,2,3,1,9]),import.meta.url))},{id:`llvm`,name:`LLVM IR`,import:(()=>$(()=>import(`./llvm-DqHOMS-s.js`),[],import.meta.url))},{id:`log`,name:`Log file`,import:(()=>$(()=>import(`./log-BNLmms1o.js`),[],import.meta.url))},{id:`logo`,name:`Logo`,import:(()=>$(()=>import(`./logo-Cluzi2Zq.js`),[],import.meta.url))},{id:`lua`,name:`Lua`,import:(()=>$(()=>import(`./lua-G_rux6Ay.js`).then(e=>e.n),__vite__mapDeps([38,22]),import.meta.url))},{id:`luau`,name:`Luau`,import:(()=>$(()=>import(`./luau-VGWVLoqX.js`),[],import.meta.url))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>$(()=>import(`./make-Dixweg8N.js`),[],import.meta.url))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>$(()=>import(`./markdown-BYOwaDjH.js`),[],import.meta.url))},{id:`marko`,name:`Marko`,import:(()=>$(()=>import(`./marko-BdidjG96.js`),__vite__mapDeps([69,3,5,11,70]),import.meta.url))},{id:`matlab`,name:`MATLAB`,import:(()=>$(()=>import(`./matlab-D7qyCx1q.js`),[],import.meta.url))},{id:`mdc`,name:`MDC`,import:(()=>$(()=>import(`./mdc-DxAZb3tM.js`),__vite__mapDeps([71,15,1,2,3,39,41]),import.meta.url))},{id:`mdx`,name:`MDX`,import:(()=>$(()=>import(`./mdx-DQZ5AkYe.js`),[],import.meta.url))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>$(()=>import(`./mermaid-BxpfTIzt.js`),[],import.meta.url))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>$(()=>import(`./mipsasm-BMqwQI7S.js`),[],import.meta.url))},{id:`mojo`,name:`Mojo`,import:(()=>$(()=>import(`./mojo-fg40_ntQ.js`),[],import.meta.url))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>$(()=>import(`./moonbit-D9W784E_.js`),[],import.meta.url))},{id:`move`,name:`Move`,import:(()=>$(()=>import(`./move-BYnGhZoM.js`),[],import.meta.url))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>$(()=>import(`./narrat-_X_XdTYD.js`),[],import.meta.url))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>$(()=>import(`./nextflow-CSgcYZcx.js`),__vite__mapDeps([72,73]),import.meta.url))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>$(()=>import(`./nextflow-groovy-D7IRt6Pp.js`),[],import.meta.url))},{id:`nginx`,name:`Nginx`,import:(()=>$(()=>import(`./nginx-CuvNT-q8.js`),__vite__mapDeps([74,38,22]),import.meta.url))},{id:`nim`,name:`Nim`,import:(()=>$(()=>import(`./nim-DuDgLkQa.js`),__vite__mapDeps([75,2,3,1,7,8,22,27,41]),import.meta.url))},{id:`nix`,name:`Nix`,import:(()=>$(()=>import(`./nix-IvuFDN5E.js`),[],import.meta.url))},{id:`nsis`,name:`NSIS`,import:(()=>$(()=>import(`./nsis-CjNLYCLg.js`),[],import.meta.url))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>$(()=>import(`./nushell--0fT3PI1.js`),[],import.meta.url))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>$(()=>import(`./objective-c-D1A_Heim.js`),[],import.meta.url))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>$(()=>import(`./objective-cpp-BsSzOQcm.js`),[],import.meta.url))},{id:`ocaml`,name:`OCaml`,import:(()=>$(()=>import(`./ocaml-O90oeIOV.js`),[],import.meta.url))},{id:`odin`,name:`Odin`,import:(()=>$(()=>import(`./odin-B1RWQWA5.js`),[],import.meta.url))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>$(()=>import(`./openscad-BUDT5pXO.js`),[],import.meta.url))},{id:`org`,name:`Org Markup`,import:(()=>$(()=>import(`./org-BJKUhgoL.js`),__vite__mapDeps([76,2,3,1,5,8,7,9,11,13,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,48,50,81,82,83,63,65,66,67,70,84,75,85,86,87,88,89,90,91,92,93]),import.meta.url))},{id:`pascal`,name:`Pascal`,import:(()=>$(()=>import(`./pascal-4ZHwLPI5.js`),[],import.meta.url))},{id:`perl`,name:`Perl`,import:(()=>$(()=>import(`./perl-BdJ-pZH6.js`),__vite__mapDeps([65,2,3,1,7,8,16]),import.meta.url))},{id:`php`,name:`PHP`,import:(()=>$(()=>import(`./php-DUOUy2DX.js`),__vite__mapDeps([87,2,3,1,7,8,9,16]),import.meta.url))},{id:`pkl`,name:`Pkl`,import:(()=>$(()=>import(`./pkl-ot-7Btpt.js`),[],import.meta.url))},{id:`plsql`,name:`PL/SQL`,import:(()=>$(()=>import(`./plsql-DGHpHOYJ.js`),[],import.meta.url))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>$(()=>import(`./po-BiJDBrnU.js`),[],import.meta.url))},{id:`polar`,name:`Polar`,import:(()=>$(()=>import(`./polar-C7UOKdEL.js`),[],import.meta.url))},{id:`postcss`,name:`PostCSS`,import:(()=>$(()=>import(`./postcss-BXeXVLqQ.js`),[],import.meta.url))},{id:`powerquery`,name:`PowerQuery`,import:(()=>$(()=>import(`./powerquery-DNMTfnFr.js`),[],import.meta.url))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>$(()=>import(`./powershell-QtSnmXcu.js`),[],import.meta.url))},{id:`prisma`,name:`Prisma`,import:(()=>$(()=>import(`./prisma-DMgNhnYS.js`),[],import.meta.url))},{id:`prolog`,name:`Prolog`,import:(()=>$(()=>import(`./prolog-iXnhIJG7.js`),[],import.meta.url))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>$(()=>import(`./proto-DB4EqR-F.js`),[],import.meta.url))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>$(()=>import(`./pug-WUnoGP-C.js`),__vite__mapDeps([94,2,3,1]),import.meta.url))},{id:`puppet`,name:`Puppet`,import:(()=>$(()=>import(`./puppet-CDv2pdJW.js`),[],import.meta.url))},{id:`purescript`,name:`PureScript`,import:(()=>$(()=>import(`./purescript-9MfHhQsQ.js`),[],import.meta.url))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>$(()=>import(`./python-gzcpVVnB.js`),[],import.meta.url))},{id:`qml`,name:`QML`,import:(()=>$(()=>import(`./qml-Dl8tY0zd.js`),__vite__mapDeps([95,2]),import.meta.url))},{id:`qmldir`,name:`QML Directory`,import:(()=>$(()=>import(`./qmldir-DCQb3MpD.js`),[],import.meta.url))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>$(()=>import(`./qss-Fe1Jh2GI.js`),[],import.meta.url))},{id:`r`,name:`R`,import:(()=>$(()=>import(`./r-Ci9Hbbcn.js`).then(e=>e.n),[],import.meta.url))},{id:`racket`,name:`Racket`,import:(()=>$(()=>import(`./racket-DcIDlBhZ.js`),[],import.meta.url))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>$(()=>import(`./raku-B3gFvitq.js`),[],import.meta.url))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>$(()=>import(`./razor-0bx4DTys.js`),__vite__mapDeps([96,1,2,3,78]),import.meta.url))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>$(()=>import(`./rbs-C0MpOrj4.js`),[],import.meta.url))},{id:`reg`,name:`Windows Registry Script`,import:(()=>$(()=>import(`./reg-CRGYupPL.js`),[],import.meta.url))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>$(()=>import(`./regexp-C0ZlJfpq.js`).then(e=>e.n),[],import.meta.url))},{id:`rel`,name:`Rel`,import:(()=>$(()=>import(`./rel-BtDbiS_P.js`),[],import.meta.url))},{id:`riscv`,name:`RISC-V`,import:(()=>$(()=>import(`./riscv-Ckw8ddFX.js`),[],import.meta.url))},{id:`ron`,name:`RON`,import:(()=>$(()=>import(`./ron-VUp2lXgN.js`),[],import.meta.url))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>$(()=>import(`./rosmsg-CAekHB0j.js`),[],import.meta.url))},{id:`rst`,name:`reStructuredText`,import:(()=>$(()=>import(`./rst-BC_vqA0U.js`),__vite__mapDeps([97,2,15,1,3,20,98,25,26,27,22,29,39,34,7,8,16,35,36,11,13,37,38]),import.meta.url))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>$(()=>import(`./ruby-DPPk42YS.js`),__vite__mapDeps([34,2,3,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39]),import.meta.url))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>$(()=>import(`./rust-DpiIf5JO.js`),[],import.meta.url))},{id:`sas`,name:`SAS`,import:(()=>$(()=>import(`./sas-B8jfw3hR.js`),__vite__mapDeps([99,16]),import.meta.url))},{id:`sass`,name:`Sass`,import:(()=>$(()=>import(`./sass-DXrisJhu.js`),[],import.meta.url))},{id:`scala`,name:`Scala`,import:(()=>$(()=>import(`./scala-BiFt_7mu.js`),[],import.meta.url))},{id:`scheme`,name:`Scheme`,import:(()=>$(()=>import(`./scheme-DQCgrYNe.js`),[],import.meta.url))},{id:`scss`,name:`SCSS`,import:(()=>$(()=>import(`./scss-7mTWL496.js`).then(e=>e.n),__vite__mapDeps([5,3]),import.meta.url))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>$(()=>import(`./sdbl-bTVj8UrX.js`),[],import.meta.url))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>$(()=>import(`./shaderlab-TOUzSsQk.js`),__vite__mapDeps([100,101]),import.meta.url))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>$(()=>import(`./shellscript-CYNcJqc-.js`).then(e=>e.n),[],import.meta.url))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>$(()=>import(`./shellsession-Dh2E3t_B.js`),__vite__mapDeps([102,29]),import.meta.url))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>$(()=>import(`./smalltalk-BHpQb5nM.js`),[],import.meta.url))},{id:`smithy`,name:`Smithy`,import:(()=>$(()=>import(`./smithy-Dgaz7aur.js`),[],import.meta.url))},{id:`solidity`,name:`Solidity`,import:(()=>$(()=>import(`./solidity-Bj7E1mRn.js`),[],import.meta.url))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>$(()=>import(`./soy-BVR-TmA2.js`),__vite__mapDeps([103,1,2,3]),import.meta.url))},{id:`sparql`,name:`SPARQL`,import:(()=>$(()=>import(`./sparql-D_iOobhT.js`),__vite__mapDeps([104,105]),import.meta.url))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>$(()=>import(`./splunk-BC2Px7Mm.js`),[],import.meta.url))},{id:`sql`,name:`SQL`,import:(()=>$(()=>import(`./sql-D3S51lwn.js`).then(e=>e.n),[],import.meta.url))},{id:`ssh-config`,name:`SSH Config`,import:(()=>$(()=>import(`./ssh-config-BgfXC-Er.js`),[],import.meta.url))},{id:`stata`,name:`Stata`,import:(()=>$(()=>import(`./stata-BjuRTlAG.js`),__vite__mapDeps([106,16]),import.meta.url))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>$(()=>import(`./stylus-B6D30XZt.js`),[],import.meta.url))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>$(()=>import(`./surrealql-BKRHdvyc.js`),__vite__mapDeps([107,2]),import.meta.url))},{id:`svelte`,name:`Svelte`,import:(()=>$(()=>import(`./svelte-DIKo_e2T.js`),__vite__mapDeps([108,2,3,11,12]),import.meta.url))},{id:`swift`,name:`Swift`,import:(()=>$(()=>import(`./swift-CyEgAFGc.js`),[],import.meta.url))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>$(()=>import(`./system-verilog-Dh5ihWbf.js`),[],import.meta.url))},{id:`systemd`,name:`Systemd Units`,import:(()=>$(()=>import(`./systemd-BxMlprV5.js`),[],import.meta.url))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>$(()=>import(`./talonscript-CohzipZa.js`),[],import.meta.url))},{id:`tasl`,name:`Tasl`,import:(()=>$(()=>import(`./tasl-DMoTqEGO.js`),[],import.meta.url))},{id:`tcl`,name:`Tcl`,import:(()=>$(()=>import(`./tcl-CZd0xW_V.js`),[],import.meta.url))},{id:`templ`,name:`Templ`,import:(()=>$(()=>import(`./templ-DC42iqks.js`),__vite__mapDeps([109,2,3,81]),import.meta.url))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>$(()=>import(`./terraform-DswuEJGm.js`),[],import.meta.url))},{id:`tex`,name:`TeX`,import:(()=>$(()=>import(`./tex-BZ2lfoiV.js`).then(e=>e.n),__vite__mapDeps([67,63]),import.meta.url))},{id:`toml`,name:`TOML`,import:(()=>$(()=>import(`./toml-CcmNWLt0.js`),[],import.meta.url))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>$(()=>import(`./ts-tags-o8CUeNFk.js`),__vite__mapDeps([110,2,3,1,7,8,11,16,27,22]),import.meta.url))},{id:`tsv`,name:`TSV`,import:(()=>$(()=>import(`./tsv-sltzmVWM.js`),[],import.meta.url))},{id:`tsx`,name:`TSX`,import:(()=>$(()=>import(`./tsx-DeMh4Cat.js`).then(e=>e.n),[],import.meta.url))},{id:`turtle`,name:`Turtle`,import:(()=>$(()=>import(`./turtle-ByJddavk.js`),[],import.meta.url))},{id:`twig`,name:`Twig`,import:(()=>$(()=>import(`./twig-BUr_lvSK.js`),__vite__mapDeps([111,2,3,5,20,34,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39,87,9]),import.meta.url))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>$(()=>import(`./typescript-DeKHrHpS.js`).then(e=>e.n),[],import.meta.url))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>$(()=>import(`./typespec-BGhR2SqG.js`),[],import.meta.url))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>$(()=>import(`./typst-CcbUABTI.js`),__vite__mapDeps([112,2,3,1,5,8,7,9,11,13,113,114,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,44,48,50,81,82,54,83,115,63,62,65,66,67,70,116,84,85,87,88,89,90,91,93,117,94,118,119,111,120]),import.meta.url))},{id:`v`,name:`V`,import:(()=>$(()=>import(`./v-DBj4K9d_.js`),[],import.meta.url))},{id:`vala`,name:`Vala`,import:(()=>$(()=>import(`./vala-zf12oZj6.js`),[],import.meta.url))},{id:`vb`,name:`Visual Basic`,import:(()=>$(()=>import(`./vb-DOwzaHZ0.js`),[],import.meta.url))},{id:`verilog`,name:`Verilog`,import:(()=>$(()=>import(`./verilog-B2gwz-sJ.js`),[],import.meta.url))},{id:`vhdl`,name:`VHDL`,import:(()=>$(()=>import(`./vhdl-BroJfC0k.js`),[],import.meta.url))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>$(()=>import(`./viml-DvXPmvsu.js`),[],import.meta.url))},{id:`vue`,name:`Vue`,import:(()=>$(()=>import(`./vue-JHDlnmNz.js`),__vite__mapDeps([121,2,3,1,9,11,15]),import.meta.url))},{id:`vue-html`,name:`Vue HTML`,import:(()=>$(()=>import(`./vue-html-soMMIiuc.js`),__vite__mapDeps([122,2]),import.meta.url))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>$(()=>import(`./vue-vine-D8TZS6Lm.js`),__vite__mapDeps([123,2,3,5,12,70,124]),import.meta.url))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>$(()=>import(`./vyper-CgoNMtux.js`),[],import.meta.url))},{id:`wasm`,name:`WebAssembly`,import:(()=>$(()=>import(`./wasm-ByWQv1Qj.js`),[],import.meta.url))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>$(()=>import(`./wenyan-C8pVoKbM.js`),[],import.meta.url))},{id:`wgsl`,name:`WGSL`,import:(()=>$(()=>import(`./wgsl-BsKzXJz4.js`),[],import.meta.url))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>$(()=>import(`./wikitext-ClFFjSW2.js`),[],import.meta.url))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>$(()=>import(`./wit-DdvCle-K.js`),[],import.meta.url))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>$(()=>import(`./wolfram-DLL8P-h_.js`),[],import.meta.url))},{id:`xml`,name:`XML`,import:(()=>$(()=>import(`./xml-9isD2blC.js`).then(e=>e.n),__vite__mapDeps([7,8]),import.meta.url))},{id:`xsl`,name:`XSL`,import:(()=>$(()=>import(`./xsl-chWKvWOz.js`),__vite__mapDeps([93,7,8]),import.meta.url))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>$(()=>import(`./yaml-DEY2M1js.js`).then(e=>e.n),[],import.meta.url))},{id:`zenscript`,name:`ZenScript`,import:(()=>$(()=>import(`./zenscript-BnlCZFoB.js`),[],import.meta.url))},{id:`zig`,name:`Zig`,import:(()=>$(()=>import(`./zig-CMLA9XwU.js`),[],import.meta.url))}],ab=Object.fromEntries(ib.map(e=>[e.id,e.import])),ob=Object.fromEntries(ib.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),sb={...ab,...ob},cb=`github-dark-default`,lb={h:`c`,hh:`cpp`,hpp:`cpp`,hxx:`cpp`,cc:`cpp`,cxx:`cpp`,htm:`html`,svg:`xml`,pl:`perl`,ex:`elixir`,exs:`elixir`,makefile:`make`,dockerfile:`dockerfile`},ub=new Map;for(let e of ib)for(let t of[e.id,...e.aliases??[]])ub.set(t.toLowerCase(),e.id);for(let[e,t]of Object.entries(lb))ub.set(e,t);function db(e){let t=e.slice(e.lastIndexOf(`/`)+1).toLowerCase(),n=t.lastIndexOf(`.`),r=n===-1?t:t.slice(n+1);return ub.get(r)??ub.get(t)??null}var fb=null;function pb(){return fb??=ky({themes:[$(()=>import(`./github-dark-default-DXG-b-1a.js`),[],import.meta.url)],langs:[],engine:eb($(()=>import(`./wasm-BnjxR4X6.js`),[],import.meta.url))}),fb}async function mb(e){let t=await pb();return t.getLoadedLanguages().includes(e)||await t.loadLanguage(sb[e]),n=>n.length===0?[]:t.codeToTokensBase(n.join(`
84
+ `),{lang:e,theme:cb})}function hb(e,t){let n=new Map,r=new Map;if(e.newContent!==null){let r=Math.max(0,...e.hunks.flatMap(e=>e.lines.map(e=>e.newNo??0)));t(ml(e.newContent).slice(0,r)).forEach((e,t)=>n.set(t+1,e))}for(let i of e.hunks){let a=i.lines.filter(e=>e.type!==`add`);if(t(a.map(e=>e.text)).forEach((e,t)=>r.set(a[t].oldNo,e)),e.newContent===null){let e=i.lines.filter(e=>e.type!==`del`);t(e.map(e=>e.text)).forEach((t,r)=>n.set(e[r].newNo,t))}}return{newSide:n,oldSide:r}}function gb(e){let t=db(e.path),[n,r]=(0,v.useState)(null);(0,v.useEffect)(()=>{if(t===null)return;let e=!1;return mb(t).then(n=>!e&&r({lang:t,tokenizer:n}),n=>!e&&r({lang:t,error:n instanceof Error?n.message:String(n)})),()=>{e=!0}},[t]);let i=n!==null&&n.lang===t?n:null,a=i!==null&&`tokenizer`in i?i.tokenizer:null;return(0,v.useMemo)(()=>{if(i!==null&&`error`in i)return{status:`error`,message:i.error};if(a===null)return{status:`none`};let t=new Map;return{status:`ready`,file:hb(e,a),suggestion:e=>{let n=t.get(e);return n||(n=a(ml(e)),t.set(e,n)),n}}},[i,a,e])}var _b={context:` `,add:`+`,del:`−`};function vb(e,t){return t===`new`&&e===`add`?`is-new`:`is-${e}`}function yb(e,t){let n=[],r=0;for(let{text:i,style:a}of e){let e=t.flatMap(e=>[e.start,e.end]).map(e=>Math.min(Math.max(e-r,0),i.length)),o=[...new Set([0,...e,i.length])].sort((e,t)=>e-t);for(let e=0;e<o.length-1;e++){let s=r+o[e],c=t.find(e=>s>=e.start&&s<e.end);n.push({text:i.slice(o[e],o[e+1]),style:a,className:c?.className})}r+=i.length}return n}function bb({text:e,tokens:t,marks:n=[]}){let r=t?t.map(e=>({text:e.content,style:Cb(e)})):[{text:e}];return(0,V.jsx)(`span`,{className:`diff-code${t?` is-highlighted`:``}`,children:yb(r,n).map((e,t)=>(0,V.jsx)(`span`,{style:e.style,className:e.className,children:e.text},t))})}function xb(e,t,n){if(e.replaced&&!n)return[];if(e.oldLine){let t=de(e.oldLine.text,e.line.text);return n?[{start:t.start,end:t.oldEnd,className:`diff-indent is-del`}]:[{start:t.start,end:t.newEnd,className:`diff-indent is-add`}]}return!e.inline||t.type===`context`?[]:e.inline.map(e=>({...e,className:`diff-inline is-${t.type}`}))}function Sb(e,t){let{oldEnd:n,newEnd:r}=de(e,t);return r>n?`→`:r<n?`←`:`↔`}function Cb(e){let t=e.fontStyle??0;return{color:e.color,fontStyle:t&1?`italic`:void 0,fontWeight:t&2?600:void 0}}function wb(e){return e?{"--mark":lu[e.severity].color}:void 0}function Tb(e){return e?e.muted?` has-bar is-bar-muted`:` has-bar`:``}function Eb({entries:e}){return(0,V.jsx)(`span`,{className:`diff-pills`,children:e.map(e=>(0,V.jsx)(`span`,{className:e.finding.status===`open`?void 0:`is-muted`,title:e.finding.title,children:(0,V.jsx)(im,{entry:e,small:!0})},e.finding.id))})}function Db({entry:e,bar:t,pills:n,applied:r,isTarget:i,onHide:a}){let o=ml(e.finding.suggestion??``).length===0,s=Zl(e.startLine,e.endLine),c=o?`supprime ${s}`:`remplace ${s}`;return(0,V.jsxs)(`div`,{className:`fix-strip${r?` is-applied`:``}${Tb(t)}${i?` is-target`:``}`,style:wb(t),"data-fix":e.finding.id,children:[(0,V.jsx)(im,{entry:e,small:!0}),(0,V.jsx)(H,{name:`sparkles`,color:`#8b97ff`}),(0,V.jsx)(`span`,{className:`fix-strip-text`,children:r?`Correctif ${e.number} appliqué — ${c}`:`Correctif proposé par l'agent — ${c}`}),n.length>0&&(0,V.jsx)(Eb,{entries:n}),(0,V.jsx)(`button`,{type:`button`,className:`fix-strip-hide`,onClick:a,children:r?`Retirer le correctif`:`Masquer le correctif`})]})}function Ob({context:e,onChange:t}){return(0,V.jsxs)(`div`,{className:`context-stepper`,role:`group`,"aria-label":`Contexte du bloc`,children:[(0,V.jsxs)(`button`,{type:`button`,className:`context-stepper-button`,disabled:!e.canShrink,title:`Retirer 5 lignes de contexte au-dessus et en dessous`,onClick:()=>t(-1),children:[(0,V.jsx)(H,{name:`fold-vertical`,size:12}),`−`,5]}),(0,V.jsx)(`span`,{className:`context-stepper-count`,children:Eu(e.context,`ligne`)}),(0,V.jsxs)(`button`,{type:`button`,className:`context-stepper-button`,disabled:!e.canGrow,title:`Ajouter 5 lignes de contexte au-dessus et en dessous`,onClick:()=>t(1),children:[(0,V.jsx)(H,{name:`unfold-vertical`,size:12}),`+`,5]})]})}function kb({mode:e,codeView:t,explained:n,reindented:r,inlined:i,expanded:a}){return(0,V.jsxs)(`div`,{className:`diff-legend`,children:[t===`new`?(0,V.jsxs)(`span`,{className:`legend-item`,children:[(0,V.jsx)(`span`,{className:`legend-swatch is-new`}),`Ajouté par la feature`]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`span`,{className:`legend-item`,children:[(0,V.jsx)(`span`,{className:`legend-swatch is-add`}),`Ajouté par la feature`]}),(0,V.jsxs)(`span`,{className:`legend-item`,children:[(0,V.jsx)(`span`,{className:`legend-swatch is-del`}),`Supprimé par la feature`]})]}),i&&(0,V.jsxs)(`span`,{className:`legend-item`,children:[(0,V.jsx)(`span`,{className:`legend-swatch ${t===`new`?`is-inline-add`:`is-inline`}`}),`Partie modifiée de la ligne`]}),r&&(0,V.jsxs)(`span`,{className:`legend-item`,children:[(0,V.jsx)(`span`,{className:`legend-swatch is-reindent`}),`Indentation modifiée`]}),e===`before-after`&&(0,V.jsxs)(`span`,{className:`legend-item`,children:[(0,V.jsx)(`span`,{className:`legend-swatch is-replaced`}),`Lignes remplacées par le correctif`]}),e!==`off`&&(0,V.jsxs)(`span`,{className:`legend-item`,children:[(0,V.jsx)(`span`,{className:`legend-swatch is-proposed`}),e===`applied`?`Correctif appliqué`:`Correctif proposé`]}),n&&(0,V.jsxs)(`span`,{className:`legend-item`,children:[(0,V.jsx)(`span`,{className:`legend-swatch is-explained`}),`Code décrit par une explication`]}),a&&(0,V.jsxs)(`span`,{className:`legend-item`,children:[(0,V.jsx)(`span`,{className:`legend-swatch is-expanded`}),`Contexte ajouté`]})]})}function Ab({file:e,fileDiff:t,hunks:n,hunkContexts:r,addedContext:i,onContextChange:a,findings:o,notedLines:s,scrollRef:c,mode:l,onModeChange:u,codeView:d,onCodeViewChange:f,scope:p,onScopeChange:m,wholeFileAvailable:h,explained:g,target:_,onLineNote:y,onHideFix:b,onRequestExplanation:x}){let S=e.contentAvailable,C=gb(t),ee=(0,v.useRef)(null),w=(0,v.useRef)(null),[te,T]=(0,v.useState)(0),E=p===`file`,D=(0,v.useMemo)(()=>E?Xl(n,d,o,s):null,[E,n,d,o,s]);(0,v.useEffect)(()=>{let e=ee.current;if(!e)return;let t=new ResizeObserver(()=>T(e.offsetHeight));return t.observe(e),()=>t.disconnect()},[]);let O=(e,t)=>(0,V.jsx)(Db,{entry:e.entry,bar:e.bar,pills:e.pills,applied:l===`applied`,isTarget:Dl(_,{kind:`fix`,entry:e.entry}),onHide:()=>b(e.entry.finding.id)},t),k=(e,t,n)=>{if(e.kind===`fix-line`)return(0,V.jsxs)(`div`,{className:`diff-line is-proposed${Tb(e.bar)}`,style:wb(e.bar),children:[(0,V.jsx)(`span`,{className:`diff-num`}),(0,V.jsx)(`span`,{className:`diff-marker`,children:`›`}),(0,V.jsx)(bb,{text:e.text,tokens:C.status===`ready`?C.suggestion(e.entry.finding.suggestion??``)[e.index]:void 0})]},n);let{oldLine:r}=e,a=t===`old`,o=a&&r?r:e.line,c=r??(o.type===`del`?o:null),l=e.replaced&&!a,u=a?null:e.bar,f=a?null:o.newNo,p=C.status!==`ready`||l?void 0:o.type===`del`?C.file.oldSide.get(o.oldNo):C.file.newSide.get(o.newNo),m=xb(e,o,a),h=[`diff-line`,r?`is-reindent`:vb(o.type,d),!r&&!l&&e.inline?`has-inline`:``,l?`is-replaced`:``,o.type===`context`&&o.newNo!==null&&i?.has(o.newNo)?`is-expanded`:``,e.explained?`is-explained`:``,Tb(u).trim(),f!==null&&Dl(_,{kind:`line`,line:f})?`is-target`:``];return(0,V.jsxs)(`div`,{className:h.filter(Boolean).join(` `),style:wb(u),"data-line":f??void 0,"data-old-line":t===`new`?void 0:c?.oldNo??void 0,children:[f!==null&&s.has(f)&&(0,V.jsx)(`span`,{className:`diff-note-dot`,title:`Remarque sur cette ligne`}),f!==null&&S?(0,V.jsx)(`button`,{type:`button`,className:`diff-num`,title:`Ajouter une remarque sur la ligne ${f}`,onClick:()=>y(f),children:f}):(0,V.jsx)(`span`,{className:`diff-num`,children:(a?o.oldNo:f)??``}),r?(0,V.jsx)(`span`,{className:`diff-marker`,title:`Seule l'indentation de cette ligne change (ligne ${r.oldNo} avant)`,children:Sb(r.text,e.line.text)}):(0,V.jsx)(`span`,{className:`diff-marker`,children:d===`new`?``:_b[o.type]}),(0,V.jsx)(bb,{text:o.text,tokens:p,marks:m}),!a&&e.pills.length>0&&(0,V.jsx)(Eb,{entries:e.pills})]},n)};return(0,V.jsxs)(`div`,{className:`diff`,children:[(0,V.jsxs)(`div`,{className:`diff-toolbar`,ref:ee,children:[C.status===`error`&&(0,V.jsxs)(`span`,{className:`diff-toolbar-error`,children:[`Coloration syntaxique indisponible : `,C.message]}),(0,V.jsx)(sm,{label:`Afficher`,options:Sl,value:p,onChange:m,disabled:h?void 0:{file:`Contenu du fichier non conservé dans l'analyse`}}),(0,V.jsx)(sm,{label:`Code`,options:xl,value:d,onChange:f}),(0,V.jsx)(sm,{label:`Correctifs`,options:bl,value:l,onChange:u})]}),(0,V.jsxs)(`div`,{className:`diff-body${E?` has-minimap`:``}`,children:[(0,V.jsx)(`div`,{className:`diff-rows`,ref:w,children:n.map((e,t)=>(0,V.jsxs)(`div`,{className:`hunk`,children:[(0,V.jsxs)(`div`,{className:`hunk-header`,children:[(0,V.jsx)(`span`,{className:`hunk-header-text mono`,children:e.hunk.header}),r?.[t]&&(0,V.jsx)(Ob,{context:r[t],onChange:e=>a(t,e)}),(0,V.jsx)(`button`,{type:`button`,className:`hunk-explain`,title:`Copier un prompt qui demande à l'agent d'expliquer ce bloc et d'ajouter ses explications à l'analyse`,"aria-label":`Copier une demande d'explication`,onClick:()=>x(e.hunk),children:(0,V.jsx)(H,{name:`bot`,color:`#3cc4b4`})})]}),d===`split`?zl(e.rows).map((e,t)=>e.kind===`full`?O(e.row,t):(0,V.jsxs)(`div`,{className:`diff-split-row`,children:[e.left?k(e.left,`old`):(0,V.jsx)(`div`,{className:`diff-line is-empty`}),e.right?k(e.right,`new`):(0,V.jsx)(`div`,{className:`diff-line is-empty`})]},t)):e.rows.map((e,t)=>e.kind===`fix-strip`?O(e,t):k(e,`both`,t))]},t))}),D&&(0,V.jsx)(fm,{model:D,rowsRef:w,scrollRef:c,toolbarHeight:te})]}),(0,V.jsx)(kb,{mode:l,codeView:d,explained:g,reindented:n.some(e=>e.rows.some(e=>e.kind===`line`&&e.oldLine!==null)),inlined:n.some(e=>e.rows.some(e=>e.kind===`line`&&e.inline!==null&&!e.replaced)),expanded:i!==null&&i.size>0})]})}var jb=8,Mb=600;function Nb({explanation:e}){let[t,n]=(0,v.useState)(!1),{side:r,startLine:i,endLine:a}=e.location,o=e.body.split(`
85
+ `).length>jb||e.body.length>Mb;return(0,V.jsxs)(`article`,{className:`margin-card margin-explanation is-${e.status}`,"data-explanation-card":e.id,children:[(0,V.jsxs)(`header`,{className:`margin-card-head`,children:[(0,V.jsx)(H,{name:`info`,color:`#3cc4b4`}),(0,V.jsx)(`span`,{className:`margin-explanation-kind`,children:`Explication`}),r===`old`&&(0,V.jsx)(`span`,{className:`tag explanation-side`,children:`Code supprimé`}),e.status===`outdated`&&(0,V.jsx)(`span`,{className:`tag explanation-outdated-tag`,children:`Obsolète`}),(0,V.jsxs)(`span`,{className:`margin-card-lines mono`,title:r===`old`?`Numéros de ligne avant la feature`:void 0,children:[`l. `,hl(i,a,`–`)]})]}),(0,V.jsx)(`h3`,{className:`margin-card-title`,children:e.title}),e.status===`outdated`&&(0,V.jsx)(`p`,{className:`explanation-outdated`,children:`Le code décrit a changé depuis la rédaction de cette explication : elle peut ne plus correspondre.`}),(0,V.jsx)(`p`,{className:`margin-explanation-body${o&&!t?` is-folded`:``}`,children:e.body}),o&&(0,V.jsx)(`button`,{type:`button`,className:`margin-explanation-more`,"aria-expanded":t,onClick:()=>n(!t),children:t?`Réduire`:`Lire la suite`})]})}function Pb({note:e}){let t=B(e=>e.updateNote),n=B(e=>e.deleteNote),r=B(e=>e.saving),[i,a]=(0,v.useState)(!1),o=e.location?.line?`ligne ${e.location.line}`:`fichier entier`;return i?(0,V.jsx)(Ib,{id:`note-edit-${e.id}`,label:`Modifier la remarque (${o})`,initialText:e.text,submitLabel:`Enregistrer la modification`,onSubmit:n=>n===e.text?Promise.resolve(!0):t(e.id,n),onClose:()=>a(!1)}):(0,V.jsxs)(`div`,{className:`note-card`,children:[(0,V.jsxs)(`div`,{className:`note-head`,children:[(0,V.jsx)(td,{fixed:!1}),(0,V.jsxs)(`span`,{className:`note-meta`,title:`${o} · ${Cu(e.createdAt)}`,children:[o,` · `,Tu(e.createdAt)]}),(0,V.jsxs)(`button`,{type:`button`,className:`link-button muted`,disabled:r,onClick:()=>a(!0),children:[(0,V.jsx)(H,{name:`pencil`,size:13}),`Modifier`]}),(0,V.jsxs)(`button`,{type:`button`,className:`link-button muted`,disabled:r,onClick:()=>void n(e.id),children:[(0,V.jsx)(H,{name:`trash`,size:13}),`Supprimer`]})]}),(0,V.jsx)(`p`,{className:`note-text`,children:e.text})]})}function Fb({path:e,line:t,findingId:n,onClose:r}){let i=B(e=>e.addNote);return(0,V.jsx)(Ib,{id:`note-${t??`file`}`,label:t===null?`Remarque sur le fichier`:`Remarque sur la ligne ${t}`,initialText:``,submitLabel:`Enregistrer la remarque`,onSubmit:r=>i(e,t,r,n),onClose:r})}function Ib({id:e,label:t,initialText:n,submitLabel:r,onSubmit:i,onClose:a}){let o=B(e=>e.saving),[s,c]=(0,v.useState)(n),l=(0,v.useRef)(null);(0,v.useEffect)(()=>l.current?.focus(),[]);let u=async()=>{s.trim()!==``&&await i(s.trim())&&a()};return(0,V.jsxs)(`form`,{className:`note-composer`,onSubmit:e=>{e.preventDefault(),u()},children:[(0,V.jsx)(`label`,{className:`note-composer-label`,htmlFor:e,children:t}),(0,V.jsx)(`textarea`,{id:e,ref:l,rows:3,value:s,placeholder:`Ce que l'agent doit revoir…`,onChange:e=>c(e.target.value),onFocus:e=>e.currentTarget.setSelectionRange(e.currentTarget.value.length,e.currentTarget.value.length),onKeyDown:e=>{e.key===`Escape`&&a(),e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),u())}}),(0,V.jsxs)(`div`,{className:`note-composer-actions`,children:[(0,V.jsx)(`span`,{className:`hint`,children:`Ctrl + Entrée pour enregistrer · Échap pour annuler`}),(0,V.jsx)(`button`,{type:`button`,className:`button button-ghost`,onClick:a,children:`Annuler`}),(0,V.jsx)(`button`,{type:`submit`,className:`button button-primary button-small`,disabled:o||s.trim()===``,children:r})]})]})}var Lb=40;function Rb(e,t){let[n,r]=(0,v.useState)([]),i=(0,v.useRef)(()=>{});return(0,v.useLayoutEffect)(()=>{i.current=()=>{let n=e.current,i=t.current;if(!n||!i)return;let a=n.getBoundingClientRect().bottom-Lb,o=[...i.querySelectorAll(`[data-finding-card]`)].map(e=>({id:e.dataset.findingCard,top:e.getBoundingClientRect().top})).filter(e=>e.top>a).sort((e,t)=>e.top-t.top).map(e=>e.id);r(e=>e.join(`
86
86
  `)===o.join(`
87
- `)?e:o)},i.current()}),(0,v.useEffect)(()=>{let n=e.current,r=t.current;if(!n||!r)return;let a=()=>i.current();n.addEventListener(`scroll`,a,{passive:!0});let o=new ResizeObserver(a);return o.observe(n),o.observe(r),()=>{n.removeEventListener(`scroll`,a),o.disconnect()}},[e,t]),n}var Fb=12;function Ib(e){let t=[],n=-12;for(let r of e){let e=Math.max(r.anchorTop,n+Fb,0);t.push(e),n=e+r.height}return t}function Lb(e,t){(0,v.useLayoutEffect)(()=>{let n=e.current,r=t.current;if(!n||!r)return;let i=[...n.querySelectorAll(`:scope > [data-anchor]`)],a=()=>{let e=n.getBoundingClientRect().top,t=i.map(t=>{let n=r.querySelector(t.dataset.anchor);if(!n)throw Error(`Ancre introuvable dans le diff : ${t.dataset.anchor}`);return{anchorTop:n.getBoundingClientRect().top-e,height:t.offsetHeight}}),a=Ib(t);i.forEach((e,n)=>{e.style.top=`${a[n]}px`,e.style.setProperty(`--shift`,`${a[n]-t[n].anchorTop}px`)});let o=i.length-1;n.style.minHeight=o<0?``:`${a[o]+t[o].height}px`};a();let o=new ResizeObserver(a);o.observe(r);for(let e of i)o.observe(e);return()=>o.disconnect()})}function Rb({filters:e}){let t=[{key:`findings`,label:`Constats`,count:e.findingCount,shown:e.findingsShown,color:`#e3a33b`,onChange:e.onFindingsShownChange},{key:`explanations`,label:`Explications`,count:e.explanationCount,shown:e.explanationsShown,color:`#3cc4b4`,onChange:e.onExplanationsShownChange}];return(0,V.jsx)(`div`,{className:`margin-filters`,role:`group`,"aria-label":`Éléments affichés`,children:t.map(e=>(0,V.jsxs)(`button`,{type:`button`,className:`margin-filter${e.shown?` is-on`:``}`,style:{"--filter":e.color},"aria-pressed":e.shown,title:e.shown?`Masquer les ${e.label.toLowerCase()}`:`Afficher les ${e.label.toLowerCase()}`,onClick:()=>e.onChange(!e.shown),children:[(0,V.jsx)(`span`,{className:`margin-filter-dot`,"aria-hidden":`true`}),e.label,(0,V.jsx)(`span`,{className:`margin-filter-count`,children:e.count})]},e.key))})}function zb({numbered:e,onReveal:t}){return(0,V.jsx)(`nav`,{className:`margin-index`,"aria-label":`Index des constats du fichier`,children:e.map(e=>{let{finding:n}=e,r=n.status===`open`?``:` · ${du[n.status].toLowerCase()}`;return(0,V.jsxs)(`button`,{type:`button`,className:`margin-index-item${n.status===`open`?``:` is-muted`}`,style:{color:lu[n.severity].color},title:`${n.title} · ${Iu(e.startLine,e.endLine)}${r}`,onClick:()=>t(e),children:[(0,V.jsx)(em,{entry:e,small:!0}),(0,V.jsxs)(`span`,{className:`mono`,children:[`l.`,e.startLine]})]},n.id)})})}function Bb({analysis:e,file:t,numbered:n,explanations:r,filters:i,fileDiff:a,fixes:o,mode:s,codeView:c,removed:l,lineNotes:u,shownLines:d,composer:f,setComposer:p,onToggleFix:m,scopeRef:h,scrollRef:g,onReveal:_,revealedId:y}){let b=(0,v.useRef)(null),x=(0,v.useRef)(null);Lb(x,h);let S=Pb(g,b),C=S.length===0?void 0:n.find(e=>e.finding.id===S[0]),ee=t.contentAvailable,w=d??new Set,te=e.notes.filter(e=>e.location?.path===t.path&&e.location.line===null),T=(t,n)=>(0,V.jsx)(nm,{analysis:e,entry:t,fix:o.get(t.finding.id),mode:s,onToggleFix:e=>m(t.finding.id,e),onAddNote:ee?()=>p({line:n,findingId:t.finding.id}):void 0,highlighted:t.finding.id===y}),E=e=>(0,V.jsx)(jb,{path:t.path,line:e,findingId:f?.findingId??null,onClose:()=>p(null)}),D=[],O=[];for(let e of n){let t=Al(e,o,w,l),n=yl(w,e.startLine,e.endLine);if(t===null||n===null){O.push((0,V.jsx)(`div`,{children:T(e,e.startLine)},e.finding.id));continue}D.push({key:`finding-${e.finding.id}`,anchor:Tl(t),line:El(t),rank:e.number,color:e.finding.status===`open`?lu[e.finding.severity].color:`#3a4050`,content:T(e,n)})}for(let e of r){let t=a===null?null:Il(a,e,l,c),n=(0,V.jsx)(kb,{explanation:e});if(t===null){O.push((0,V.jsx)(`div`,{children:n},`explanation-${e.id}`));continue}D.push({key:`explanation-${e.id}`,anchor:t.selector,line:t.order,rank:0,color:e.status===`current`?`#3cc4b4`:`#3a4050`,content:n})}for(let e of u){if(!w.has(e.location.line)){O.push((0,V.jsx)(Ab,{note:e},e.id));continue}let t=kl(e.location.line,l);D.push({key:`note-${e.id}`,anchor:Tl(t),line:El(t),rank:1e3,color:uu.color,content:(0,V.jsx)(Ab,{note:e})})}let k=f?.line??null,ne=f!==null&&k!==null&&w.has(k);if(ne){let e=kl(k,l);D.push({key:`composer`,anchor:Tl(e),line:El(e),rank:2e3,color:`#6d7cff`,content:E(k)})}f!==null&&k!==null&&!ne&&O.push((0,V.jsx)(`div`,{children:E(k)},`composer`)),D.sort((e,t)=>e.line-t.line||e.rank-t.rank);let re=n.length===0&&r.length===0&&u.length===0&&te.length===0&&f===null,ie=(i.findingsShown?0:i.findingCount)+(i.explanationsShown?0:i.explanationCount),ae=n.filter(e=>e.finding.status===`open`).length;return(0,V.jsxs)(`aside`,{className:`margin-column`,"aria-label":`Constats et explications de ce fichier`,ref:b,children:[(0,V.jsxs)(`div`,{className:`margin-head`,children:[(0,V.jsxs)(`h2`,{className:`margin-title`,children:[`Constats et explications`,` `,i.findingsShown&&(0,V.jsxs)(`span`,{className:`margin-count`,title:`Constats ouverts de ce fichier ; le total compte aussi les constats ignorés et obsolètes.`,children:[Eu(ae,`constat ouvert`,`constats ouverts`),n.length!==ae&&` · ${n.length} au total`]})]}),(0,V.jsx)(Rb,{filters:i}),re&&ie>0?(0,V.jsxs)(`p`,{className:`margin-subtitle`,children:[Eu(ie,`élément masqué`,`éléments masqués`),` sur ce fichier : affichez-les avec les boutons ci-dessus.`]}):re?(0,V.jsx)(`p`,{className:`margin-subtitle`,children:`Aucun constat, explication ni remarque sur ce fichier. Cliquez sur un numéro de ligne pour ajouter une remarque.`}):(0,V.jsx)(`p`,{className:`margin-subtitle is-aligned-hint`,children:`Chaque carte est alignée sur les lignes qu'elle concerne.`}),n.length>0&&(0,V.jsx)(zb,{numbered:n,onReveal:_})]}),(te.length>0||f?.line===null)&&(0,V.jsxs)(`section`,{className:`margin-section`,children:[(0,V.jsx)(`h3`,{className:`block-title`,children:`Sur le fichier entier`}),te.map(e=>(0,V.jsx)(Ab,{note:e},e.id)),f?.line===null&&E(null)]}),d!==null&&O.length>0&&(0,V.jsxs)(`section`,{className:`margin-section`,children:[(0,V.jsx)(`h3`,{className:`block-title`,children:`Hors des lignes affichées du diff`}),O]}),(0,V.jsx)(`div`,{className:`margin-track`,ref:x,children:d!==null&&D.map(e=>(0,V.jsxs)(`div`,{className:`margin-item`,"data-anchor":e.anchor,style:{"--link":e.color},children:[(0,V.jsx)(`span`,{className:`margin-link-a`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`margin-link-b`,"aria-hidden":`true`}),e.content]},e.key))}),C&&(0,V.jsxs)(`button`,{type:`button`,className:`margin-more`,onClick:()=>_(C),children:[Eu(S.length,`constat`),` plus bas ↓`]})]})}var Vb={default:280,min:200,max:600},Hb=`feature-analyzer.files-panel-width`;function Ub(e){return Math.round(Math.min(Math.max(e,Vb.min),Vb.max))}function Wb(){try{let e=Number(window.localStorage.getItem(Hb));return e>0?Ub(e):Vb.default}catch{return Vb.default}}function Gb(e){try{window.localStorage.setItem(Hb,String(e))}catch{}}function Kb(){let[e,t]=(0,v.useState)(Wb),n=(0,v.useRef)(e);return{width:e,setWidth:(0,v.useCallback)(e=>{let r=Ub(typeof e==`function`?e(n.current):e);n.current=r,t(r),Gb(r)},[])}}function qb({name:e}){let{head:t,tail:n}=Au(e);return(0,V.jsxs)(`span`,{className:`middle-ellipsis`,children:[(0,V.jsx)(`span`,{className:`middle-ellipsis-head`,children:t}),(0,V.jsx)(`span`,{className:`middle-ellipsis-tail`,children:n})]})}function Jb({analysis:e,currentPath:t}){let n=e.files.filter(e=>e.reviewed).length,r=e.files.length===0?0:n/e.files.length*100;return(0,V.jsxs)(`aside`,{className:`files-panel`,children:[(0,V.jsxs)(`div`,{className:`files-panel-head`,children:[(0,V.jsx)(`span`,{className:`files-panel-title`,children:`Fichiers`}),(0,V.jsxs)(`span`,{className:`files-panel-count`,children:[n,` / `,e.files.length,` revus`]})]}),(0,V.jsx)(`div`,{className:`progress`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":e.files.length,"aria-valuenow":n,children:(0,V.jsx)(`div`,{className:`progress-fill`,style:{width:`${r}%`}})}),(0,V.jsx)(`nav`,{className:`files-list`,children:e.files.map((n,r)=>{let i=n.path===t,a=n.reviewed?`circle-check`:i?`circle-dot`:`circle`,o=n.reviewed?`#3fb950`:i?`#8b97ff`:`#3a4050`,s=xu(n.path).folder,c=r===0?s!==``:xu(e.files[r-1].path).folder!==s;return(0,V.jsxs)(v.Fragment,{children:[c&&(0,V.jsx)(`span`,{className:`files-group mono`,title:s||`racine du dépôt`,children:s||`./`}),(0,V.jsxs)(`div`,{className:`files-item${i?` is-current`:``}${n.reviewed?` is-reviewed`:``}`,children:[(0,V.jsxs)(`a`,{href:Hu.review(e.id,n.path),className:`files-item-link`,title:n.path,"aria-current":i?`page`:void 0,children:[(0,V.jsx)(H,{name:a,color:o}),(0,V.jsx)(`span`,{className:`files-item-name`,children:(0,V.jsx)(qb,{name:xu(n.path).name})})]}),cd(e,n.path).map(({severity:t,count:r,firstLine:i})=>(0,V.jsx)(nd,{severity:t,count:r,href:Hu.review(e.id,n.path,i),title:`${ku(t,r)} — ${r>1?`aller au premier`:`y aller`}`},t)),(0,V.jsx)(`span`,{className:`files-item-status mono is-${n.status}`,title:pu[n.status],children:mu[n.status]})]})]},n.path)})})]})}function Yb({width:e,setWidth:t,containerRef:n}){let[r,i]=(0,v.useState)(!1),a=e=>Ub(e-(n.current?.getBoundingClientRect().left??0));return(0,V.jsx)(`div`,{className:`files-panel-resizer${r?` is-dragging`:``}`,style:{left:e},role:`separator`,"aria-orientation":`vertical`,"aria-label":`Largeur de la liste des fichiers`,"aria-valuenow":e,"aria-valuemin":Vb.min,"aria-valuemax":Vb.max,tabIndex:0,title:`Glisser pour régler la largeur · double-clic pour la largeur par défaut`,onPointerDown:e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),i(!0)},onPointerMove:e=>{let t=n.current;if(!r||!t)return;let i=a(e.clientX);t.style.gridTemplateColumns=`${i}px minmax(0, 1fr)`,e.currentTarget.style.left=`${i}px`},onPointerUp:e=>{r&&(i(!1),t(a(e.clientX)))},onDoubleClick:()=>t(Vb.default),onKeyDown:e=>{e.key===`ArrowLeft`&&t(e=>e-16),e.key===`ArrowRight`&&t(e=>e+16)}})}function Xb({analysis:e}){let t=B(e=>e.gapsCollapsed),n=B(e=>e.setGapsCollapsed),r=ld(e);if(r.length===0)return null;let i=r.filter(e=>e.status===`open`).length;return(0,V.jsxs)(`section`,{className:`gap-banner${t?` is-collapsed`:``}`,children:[(0,V.jsxs)(`button`,{type:`button`,className:`gap-banner-toggle block-title`,"aria-expanded":!t,onClick:()=>n(!t),children:[(0,V.jsx)(H,{name:t?`chevron-right`:`chevron-down`,color:`#646b7b`}),(0,V.jsx)(H,{name:`triangle-alert`,color:`#e3a33b`}),Eu(r.length,`exigence manquante`,`exigences manquantes`),i!==r.length&&(0,V.jsxs)(`span`,{className:`gap-banner-count`,children:[`· `,Eu(i,`ouverte`)]})]}),!t&&r.map(t=>(0,V.jsx)($p,{analysis:e,finding:t},t.id))]})}function Zb({file:e}){return e.binary?(0,V.jsxs)(`p`,{className:`diff-message`,children:[`Fichier binaire (`,pu[e.status].toLowerCase(),`) : son contenu n'est pas affiché.`]}):e.status===`renamed`?(0,V.jsxs)(`p`,{className:`diff-message`,children:[`Fichier renommé depuis `,e.oldPath,` sans changement de contenu.`]}):(0,V.jsx)(`p`,{className:`diff-message`,children:`Aucune ligne modifiée dans ce fichier (changement de mode ou fichier vide).`})}function Qb({analysis:e,file:t,onFileNote:n}){let r=B(e=>e.setFileReviewed),i=B(e=>e.saving),a=B(e=>e.filesPanelCollapsed),o=B(e=>e.setFilesPanelCollapsed),s=e.files.findIndex(e=>e.path===t.path),c=e.files[s-1],l=e.files[s+1],{folder:u,name:d}=xu(t.path);return(0,V.jsxs)(`div`,{className:`file-head`,children:[(0,V.jsx)(`button`,{type:`button`,className:`icon-button files-panel-toggle`,"aria-pressed":!a,title:a?`Afficher la liste des fichiers`:`Masquer la liste des fichiers`,onClick:()=>o(!a),children:(0,V.jsx)(H,{name:a?`panel-left-open`:`panel-left-close`,color:`#9aa1b1`})}),(0,V.jsxs)(`span`,{className:`file-head-path mono`,title:t.oldPath?`${t.oldPath} → ${t.path}`:t.path,children:[(0,V.jsx)(`span`,{className:`path-folder`,children:u}),(0,V.jsx)(`span`,{className:`file-head-name`,children:d})]}),(0,V.jsxs)(`span`,{className:`count-add mono`,children:[`+`,t.additions]}),(0,V.jsxs)(`span`,{className:`count-del mono`,children:[`−`,t.deletions]}),t.status!==`modified`&&(0,V.jsx)(`span`,{className:`tag tag-file-${t.status}`,children:pu[t.status]}),(0,V.jsx)(`span`,{className:`spacer`}),(0,V.jsxs)(`button`,{type:`button`,className:`link-button muted`,onClick:n,children:[(0,V.jsx)(H,{name:`message-square`,size:13}),`Remarque sur le fichier`]}),(0,V.jsxs)(`div`,{className:`icon-button-group`,children:[(0,V.jsx)(`button`,{type:`button`,className:`icon-button`,disabled:!c,title:c?`Fichier précédent : ${c.path}`:`Premier fichier`,onClick:()=>c&&Uu(Hu.review(e.id,c.path)),children:(0,V.jsx)(H,{name:`arrow-left`,color:`#9aa1b1`})}),(0,V.jsx)(`button`,{type:`button`,className:`icon-button`,disabled:!l,title:l?`Fichier suivant : ${l.path}`:`Dernier fichier`,onClick:()=>l&&Uu(Hu.review(e.id,l.path)),children:(0,V.jsx)(H,{name:`arrow-right`,color:`#9aa1b1`})})]}),(0,V.jsxs)(`button`,{type:`button`,className:`button button-secondary reviewed-toggle${t.reviewed?` is-on`:``}`,"aria-pressed":t.reviewed,disabled:i,onClick:()=>void r(t.path,!t.reviewed),children:[(0,V.jsx)(H,{name:`square-check`,color:t.reviewed?`#3fb950`:`#9aa1b1`}),t.reviewed?`Revu`:`Marquer comme revu`]})]})}function $b({analysis:e,path:t,line:n}){let r=B(e=>e.diff),i=B(e=>e.diffError),a=B(e=>e.fixMode),o=B(e=>e.setFixMode),s=B(e=>e.codeView),c=B(e=>e.setCodeView),l=B(e=>e.diffScope),u=B(e=>e.setDiffScope),d=B(e=>e.copy),f=B(e=>e.findingsShown),p=B(e=>e.setFindingsShown),m=B(e=>e.explanationsShown),h=B(e=>e.setExplanationsShown),g=B(e=>e.filesPanelCollapsed),_=Kb(),y=(0,v.useRef)(null),[b,x]=(0,v.useState)(null),S=b&&b.path===t?{line:b.line,findingId:b.findingId}:null,C=e=>x(e&&t!==null?{path:t,...e}:null),[ee,w]=(0,v.useState)({}),[te,T]=(0,v.useState)({}),[E,D]=(0,v.useState)(null),O=(0,v.useRef)(null),k=(0,v.useRef)(null),ne=od(e);(0,v.useEffect)(()=>{t===null&&ne!==null&&Uu(Hu.review(e.id,ne),{replace:!0})},[t,ne,e.id]);let re=e.files.find(e=>e.path===t)??null,ie=r?.id===e.id?r.snapshot.files.find(e=>e.path===t):void 0,ae=ie!==void 0&&ie.newContent!==null,oe=ae?l:`changes`,se=(0,v.useMemo)(()=>oe===`file`&&ie?Zp(ie)??void 0:ie,[oe,ie]),ce=t===null?void 0:te[t],le=(0,v.useMemo)(()=>oe===`changes`&&ie?Up(ie,ce??[]):null,[oe,ie,ce]),ue=le?.fileDiff??se,de=(e,n)=>{if(t===null||!le)return;let r=Wp(le,e,n);T(e=>({...e,[t]:r}))},fe=i!==null&&r?.id!==e.id,pe=t===null?[]:_l(e,t),me=f?pe:[],he=wl(me,ue??{path:t??``,hunks:[],newContent:null},e=>ee[e.id]??(e.suggestion!==null&&e.status===`open`),a),ge=Ol(me,he,a),_e=n===null?null:kl(n,ge),ve=_e===null?null:Tl(_e),ye=E!==null&&E.path===t&&E.line===n?E.findingId:null,be=E?.seq??0;if((0,v.useEffect)(()=>{let e=O.current;if(se&&e){if(ve===null){e.scrollTo({top:0});return}e.querySelector(ve)?.scrollIntoView({block:`center`}),ye!==null&&e.querySelector(`[data-finding-card="${CSS.escape(ye)}"]`)?.scrollIntoView({block:`nearest`})}},[se,ve,t,ye,be]),t===null)return(0,V.jsx)(`div`,{className:`page`,children:(0,V.jsx)(`p`,{className:`empty-text`,children:`L'analyse ne contient aucun fichier modifié : il n'y a rien à revoir.`})});let A=Pl(e,t),j=m?A:[],xe=ue?Ll(ue,me,he,a,j,s):[],Se=ue?vl(ue):fe?new Set:null,Ce=Ul(e,t),we=new Set(Ce.map(e=>e.location.line)),Te=(e,t)=>w(n=>({...n,[e]:t})),Ee=n=>{D(e=>({path:t,findingId:n.finding.id,line:n.startLine,seq:(e?.seq??0)+1})),Uu(Hu.review(e.id,t,n.startLine))},De=g&&re!==null;return(0,V.jsxs)(`div`,{className:`review${De?` is-files-hidden`:``}`,ref:y,style:De?void 0:{gridTemplateColumns:`${_.width}px minmax(0, 1fr)`},children:[!De&&(0,V.jsx)(Jb,{analysis:e,currentPath:t}),!De&&(0,V.jsx)(Yb,{width:_.width,setWidth:_.setWidth,containerRef:y}),(0,V.jsx)(`section`,{className:`review-main`,children:re===null?(0,V.jsx)(`div`,{className:`review-body review-body-padded`,children:(0,V.jsxs)(`p`,{className:`diff-message`,children:[`Le fichier « `,t,` » ne fait pas partie de cette analyse. Choisissez un fichier dans la liste.`]})}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Qb,{analysis:e,file:re,onFileNote:()=>C({line:null,findingId:null})}),(0,V.jsx)(`div`,{className:`review-body`,ref:O,children:(0,V.jsxs)(`div`,{className:`review-columns`,children:[(0,V.jsxs)(`div`,{className:`review-center`,ref:k,children:[f&&(0,V.jsx)(Xb,{analysis:e}),!re.contentAvailable&&!re.binary&&re.status!==`deleted`&&(0,V.jsx)(`p`,{className:`diff-notice`,children:`Fichier trop volumineux pour être conservé en entier : les remarques ne peuvent viser que le fichier entier.`}),fe?(0,V.jsx)(`p`,{className:`diff-message is-error`,children:i}):ue?ie?.hunks.length===0?(0,V.jsx)(Zb,{file:re}):(0,V.jsx)(Eb,{file:re,fileDiff:ue,hunks:xe,hunkContexts:le?.hunks??null,addedContext:le?.added??null,onContextChange:de,findings:me,notedLines:we,scrollRef:O,mode:a,onModeChange:o,codeView:s,onCodeViewChange:c,scope:oe,onScopeChange:u,wholeFileAvailable:ae,explained:j.length>0,target:_e,onLineNote:e=>C({line:e,findingId:null}),onHideFix:e=>Te(e,!1),onRequestExplanation:t=>void d(Yp(e,re,t),`Demande d'explication copiée : collez-la dans la conversation de l'agent.`)}):(0,V.jsx)(`p`,{className:`diff-message`,children:`Chargement du diff…`})]}),(0,V.jsx)(Bb,{analysis:e,file:re,numbered:me,explanations:j,filters:{findingCount:pe.length,explanationCount:A.length,findingsShown:f,explanationsShown:m,onFindingsShownChange:p,onExplanationsShownChange:h},fileDiff:ue??null,fixes:he,mode:a,codeView:s,removed:ge,lineNotes:Ce,shownLines:Se,composer:S,setComposer:C,onToggleFix:Te,scopeRef:k,scrollRef:O,onReveal:Ee,revealedId:ye})]})})]})})]})}function ex(e){return e.name===`feature`||e.name===`review`||e.name===`finish`?e.id:null}function tx({children:e}){return(0,V.jsx)(`div`,{className:`empty-state`,children:(0,V.jsx)(`div`,{className:`empty-card`,children:e})})}function nx(){ad();let e=Ku(),t=B(e=>e.current),n=B(e=>e.openAnalysis),r=ex(e);(0,v.useEffect)(()=>{r&&n(r)},[r,n]);let i=t&&t.id===r?t.analysis:null,a=t&&t.id===r?t.error:null,o=e.name===`review`&&i?(0,V.jsx)(`button`,{type:`button`,className:`button button-primary topbar-action`,onClick:()=>Uu(Hu.finish(i.id)),children:`Terminer la revue`}):null,s;return s=e.name===`home`?(0,V.jsx)(zp,{}):e.name===`not_found`?(0,V.jsx)(tx,{children:(0,V.jsxs)(`p`,{children:[`Adresse inconnue : `,(0,V.jsx)(`code`,{children:e.hash}),`. `,(0,V.jsx)(`a`,{href:Hu.home(),children:`Revenir à l'accueil`}),`.`]})}):a?(0,V.jsxs)(tx,{children:[(0,V.jsxs)(`p`,{className:`error-text`,children:[`Analyse illisible : `,a]}),(0,V.jsx)(`p`,{children:(0,V.jsx)(`a`,{href:Hu.home(),children:`Revenir à l'accueil`})})]}):i?e.name===`feature`?(0,V.jsx)(jp,{analysis:i,tab:e.tab}):e.name===`review`?(0,V.jsx)($b,{analysis:i,path:e.path,line:e.line}):(0,V.jsx)(Fp,{analysis:i},i.id):(0,V.jsx)(tx,{children:(0,V.jsx)(`p`,{children:`Chargement de l'analyse…`})}),(0,V.jsxs)(`div`,{className:`app`,children:[(0,V.jsx)(K,{currentId:r,action:o}),(0,V.jsx)(`main`,{className:`main${e.name===`review`?` main-fixed`:``}`,children:s}),(0,V.jsx)(cu,{})]})}(0,y.createRoot)(document.getElementById(`root`)).render((0,V.jsx)(v.StrictMode,{children:(0,V.jsx)(nx,{})}));export{s as t};
87
+ `)?e:o)},i.current()}),(0,v.useEffect)(()=>{let n=e.current,r=t.current;if(!n||!r)return;let a=()=>i.current();n.addEventListener(`scroll`,a,{passive:!0});let o=new ResizeObserver(a);return o.observe(n),o.observe(r),()=>{n.removeEventListener(`scroll`,a),o.disconnect()}},[e,t]),n}var zb=12;function Bb(e){let t=[],n=-12;for(let r of e){let e=Math.max(r.anchorTop,n+zb,0);t.push(e),n=e+r.height}return t}function Vb(e,t){(0,v.useLayoutEffect)(()=>{let n=e.current,r=t.current;if(!n||!r)return;let i=[...n.querySelectorAll(`:scope > [data-anchor]`)],a=()=>{let e=n.getBoundingClientRect().top,t=i.map(t=>{let n=r.querySelector(t.dataset.anchor);if(!n)throw Error(`Ancre introuvable dans le diff : ${t.dataset.anchor}`);return{anchorTop:n.getBoundingClientRect().top-e,height:t.offsetHeight}}),a=Bb(t);i.forEach((e,n)=>{e.style.top=`${a[n]}px`,e.style.setProperty(`--shift`,`${a[n]-t[n].anchorTop}px`)});let o=i.length-1;n.style.minHeight=o<0?``:`${a[o]+t[o].height}px`};a();let o=new ResizeObserver(a);o.observe(r);for(let e of i)o.observe(e);return()=>o.disconnect()})}function Hb({filters:e}){let t=[{key:`findings`,label:`Constats`,count:e.findingCount,shown:e.findingsShown,color:`#e3a33b`,onChange:e.onFindingsShownChange},{key:`explanations`,label:`Explications`,count:e.explanationCount,shown:e.explanationsShown,color:`#3cc4b4`,onChange:e.onExplanationsShownChange}];return(0,V.jsx)(`div`,{className:`margin-filters`,role:`group`,"aria-label":`Éléments affichés`,children:t.map(e=>(0,V.jsxs)(`button`,{type:`button`,className:`margin-filter${e.shown?` is-on`:``}`,style:{"--filter":e.color},"aria-pressed":e.shown,title:e.shown?`Masquer les ${e.label.toLowerCase()}`:`Afficher les ${e.label.toLowerCase()}`,onClick:()=>e.onChange(!e.shown),children:[(0,V.jsx)(`span`,{className:`margin-filter-dot`,"aria-hidden":`true`}),e.label,(0,V.jsx)(`span`,{className:`margin-filter-count`,children:e.count})]},e.key))})}function Ub({numbered:e,onReveal:t}){return(0,V.jsx)(`nav`,{className:`margin-index`,"aria-label":`Index des constats du fichier`,children:e.map(e=>{let{finding:n}=e,r=n.status===`open`?``:` · ${du[n.status].toLowerCase()}`;return(0,V.jsxs)(`button`,{type:`button`,className:`margin-index-item${n.status===`open`?``:` is-muted`}`,style:{color:lu[n.severity].color},title:`${n.title} · ${Iu(e.startLine,e.endLine)}${r}`,onClick:()=>t(e),children:[(0,V.jsx)(im,{entry:e,small:!0}),(0,V.jsxs)(`span`,{className:`mono`,children:[`l.`,e.startLine]})]},n.id)})})}function Wb({analysis:e,file:t,numbered:n,explanations:r,filters:i,fileDiff:a,fixes:o,mode:s,codeView:c,removed:l,lineNotes:u,shownLines:d,composer:f,setComposer:p,onToggleFix:m,scopeRef:h,scrollRef:g,onReveal:_,revealedId:y}){let b=(0,v.useRef)(null),x=(0,v.useRef)(null);Vb(x,h);let S=Rb(g,b),C=S.length===0?void 0:n.find(e=>e.finding.id===S[0]),ee=t.contentAvailable,w=d??new Set,te=e.notes.filter(e=>e.location?.path===t.path&&e.location.line===null),T=(t,n)=>(0,V.jsx)(om,{analysis:e,entry:t,fix:o.get(t.finding.id),mode:s,onToggleFix:e=>m(t.finding.id,e),onAddNote:ee?()=>p({line:n,findingId:t.finding.id}):void 0,highlighted:t.finding.id===y}),E=e=>(0,V.jsx)(Fb,{path:t.path,line:e,findingId:f?.findingId??null,onClose:()=>p(null)}),D=[],O=[];for(let e of n){let t=Al(e,o,w,l),n=yl(w,e.startLine,e.endLine);if(t===null||n===null){O.push((0,V.jsx)(`div`,{children:T(e,e.startLine)},e.finding.id));continue}D.push({key:`finding-${e.finding.id}`,anchor:Tl(t),line:El(t),rank:e.number,color:e.finding.status===`open`?lu[e.finding.severity].color:`#3a4050`,content:T(e,n)})}for(let e of r){let t=a===null?null:Il(a,e,l,c),n=(0,V.jsx)(Nb,{explanation:e});if(t===null){O.push((0,V.jsx)(`div`,{children:n},`explanation-${e.id}`));continue}D.push({key:`explanation-${e.id}`,anchor:t.selector,line:t.order,rank:0,color:e.status===`current`?`#3cc4b4`:`#3a4050`,content:n})}for(let e of u){if(!w.has(e.location.line)){O.push((0,V.jsx)(Pb,{note:e},e.id));continue}let t=kl(e.location.line,l);D.push({key:`note-${e.id}`,anchor:Tl(t),line:El(t),rank:1e3,color:uu.color,content:(0,V.jsx)(Pb,{note:e})})}let k=f?.line??null,ne=f!==null&&k!==null&&w.has(k);if(ne){let e=kl(k,l);D.push({key:`composer`,anchor:Tl(e),line:El(e),rank:2e3,color:`#6d7cff`,content:E(k)})}f!==null&&k!==null&&!ne&&O.push((0,V.jsx)(`div`,{children:E(k)},`composer`)),D.sort((e,t)=>e.line-t.line||e.rank-t.rank);let re=n.length===0&&r.length===0&&u.length===0&&te.length===0&&f===null,ie=(i.findingsShown?0:i.findingCount)+(i.explanationsShown?0:i.explanationCount),ae=n.filter(e=>e.finding.status===`open`).length;return(0,V.jsxs)(`aside`,{className:`margin-column`,"aria-label":`Constats et explications de ce fichier`,ref:b,children:[(0,V.jsxs)(`div`,{className:`margin-head`,children:[(0,V.jsxs)(`h2`,{className:`margin-title`,children:[`Constats et explications`,` `,i.findingsShown&&(0,V.jsxs)(`span`,{className:`margin-count`,title:`Constats ouverts de ce fichier ; le total compte aussi les constats ignorés et obsolètes.`,children:[Eu(ae,`constat ouvert`,`constats ouverts`),n.length!==ae&&` · ${n.length} au total`]})]}),(0,V.jsx)(Hb,{filters:i}),re&&ie>0?(0,V.jsxs)(`p`,{className:`margin-subtitle`,children:[Eu(ie,`élément masqué`,`éléments masqués`),` sur ce fichier : affichez-les avec les boutons ci-dessus.`]}):re?(0,V.jsx)(`p`,{className:`margin-subtitle`,children:`Aucun constat, explication ni remarque sur ce fichier. Cliquez sur un numéro de ligne pour ajouter une remarque.`}):(0,V.jsx)(`p`,{className:`margin-subtitle is-aligned-hint`,children:`Chaque carte est alignée sur les lignes qu'elle concerne.`}),n.length>0&&(0,V.jsx)(Ub,{numbered:n,onReveal:_})]}),(te.length>0||f?.line===null)&&(0,V.jsxs)(`section`,{className:`margin-section`,children:[(0,V.jsx)(`h3`,{className:`block-title`,children:`Sur le fichier entier`}),te.map(e=>(0,V.jsx)(Pb,{note:e},e.id)),f?.line===null&&E(null)]}),d!==null&&O.length>0&&(0,V.jsxs)(`section`,{className:`margin-section`,children:[(0,V.jsx)(`h3`,{className:`block-title`,children:`Hors des lignes affichées du diff`}),O]}),(0,V.jsx)(`div`,{className:`margin-track`,ref:x,children:d!==null&&D.map(e=>(0,V.jsxs)(`div`,{className:`margin-item`,"data-anchor":e.anchor,style:{"--link":e.color},children:[(0,V.jsx)(`span`,{className:`margin-link-a`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`margin-link-b`,"aria-hidden":`true`}),e.content]},e.key))}),C&&(0,V.jsxs)(`button`,{type:`button`,className:`margin-more`,onClick:()=>_(C),children:[Eu(S.length,`constat`),` plus bas ↓`]})]})}var Gb={default:280,min:200,max:600},Kb=`feature-analyzer.files-panel-width`;function qb(e){return Math.round(Math.min(Math.max(e,Gb.min),Gb.max))}function Jb(){try{let e=Number(window.localStorage.getItem(Kb));return e>0?qb(e):Gb.default}catch{return Gb.default}}function Yb(e){try{window.localStorage.setItem(Kb,String(e))}catch{}}function Xb(){let[e,t]=(0,v.useState)(Jb),n=(0,v.useRef)(e);return{width:e,setWidth:(0,v.useCallback)(e=>{let r=qb(typeof e==`function`?e(n.current):e);n.current=r,t(r),Yb(r)},[])}}function Zb({name:e}){let{head:t,tail:n}=Au(e);return(0,V.jsxs)(`span`,{className:`middle-ellipsis`,children:[(0,V.jsx)(`span`,{className:`middle-ellipsis-head`,children:t}),(0,V.jsx)(`span`,{className:`middle-ellipsis-tail`,children:n})]})}function Qb({analysis:e,currentPath:t}){let n=e.files.filter(e=>e.reviewed).length,r=e.files.length===0?0:n/e.files.length*100;return(0,V.jsxs)(`aside`,{className:`files-panel`,children:[(0,V.jsxs)(`div`,{className:`files-panel-head`,children:[(0,V.jsx)(`span`,{className:`files-panel-title`,children:`Fichiers`}),(0,V.jsxs)(`span`,{className:`files-panel-count`,children:[n,` / `,e.files.length,` revus`]})]}),(0,V.jsx)(`div`,{className:`progress`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":e.files.length,"aria-valuenow":n,children:(0,V.jsx)(`div`,{className:`progress-fill`,style:{width:`${r}%`}})}),(0,V.jsx)(`nav`,{className:`files-list`,children:e.files.map((n,r)=>{let i=n.path===t,a=n.reviewed?`circle-check`:i?`circle-dot`:`circle`,o=n.reviewed?`#3fb950`:i?`#8b97ff`:`#3a4050`,s=xu(n.path).folder,c=r===0?s!==``:xu(e.files[r-1].path).folder!==s;return(0,V.jsxs)(v.Fragment,{children:[c&&(0,V.jsx)(`span`,{className:`files-group mono`,title:s||`racine du dépôt`,children:s||`./`}),(0,V.jsxs)(`div`,{className:`files-item${i?` is-current`:``}${n.reviewed?` is-reviewed`:``}`,children:[(0,V.jsxs)(`a`,{href:Hu.review(e.id,n.path),className:`files-item-link`,title:n.path,"aria-current":i?`page`:void 0,children:[(0,V.jsx)(H,{name:a,color:o}),(0,V.jsx)(`span`,{className:`files-item-name`,children:(0,V.jsx)(Zb,{name:xu(n.path).name})})]}),ud(e,n.path).map(({severity:t,count:r,firstLine:i})=>(0,V.jsx)(W,{severity:t,count:r,href:Hu.review(e.id,n.path,i),title:`${ku(t,r)} — ${r>1?`aller au premier`:`y aller`}`},t)),(0,V.jsx)(`span`,{className:`files-item-status mono is-${n.status}`,title:pu[n.status],children:mu[n.status]})]})]},n.path)})})]})}function $b({width:e,setWidth:t,containerRef:n}){let[r,i]=(0,v.useState)(!1),a=e=>qb(e-(n.current?.getBoundingClientRect().left??0));return(0,V.jsx)(`div`,{className:`files-panel-resizer${r?` is-dragging`:``}`,style:{left:e},role:`separator`,"aria-orientation":`vertical`,"aria-label":`Largeur de la liste des fichiers`,"aria-valuenow":e,"aria-valuemin":Gb.min,"aria-valuemax":Gb.max,tabIndex:0,title:`Glisser pour régler la largeur · double-clic pour la largeur par défaut`,onPointerDown:e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),i(!0)},onPointerMove:e=>{let t=n.current;if(!r||!t)return;let i=a(e.clientX);t.style.gridTemplateColumns=`${i}px minmax(0, 1fr)`,e.currentTarget.style.left=`${i}px`},onPointerUp:e=>{r&&(i(!1),t(a(e.clientX)))},onDoubleClick:()=>t(Gb.default),onKeyDown:e=>{e.key===`ArrowLeft`&&t(e=>e-16),e.key===`ArrowRight`&&t(e=>e+16)}})}function ex({analysis:e}){let t=B(e=>e.gapsCollapsed),n=B(e=>e.setGapsCollapsed),r=dd(e);if(r.length===0)return null;let i=r.filter(e=>e.status===`open`).length;return(0,V.jsxs)(`section`,{className:`gap-banner${t?` is-collapsed`:``}`,children:[(0,V.jsxs)(`button`,{type:`button`,className:`gap-banner-toggle block-title`,"aria-expanded":!t,onClick:()=>n(!t),children:[(0,V.jsx)(H,{name:t?`chevron-right`:`chevron-down`,color:`#646b7b`}),(0,V.jsx)(H,{name:`triangle-alert`,color:`#e3a33b`}),Eu(r.length,`exigence manquante`,`exigences manquantes`),i!==r.length&&(0,V.jsxs)(`span`,{className:`gap-banner-count`,children:[`· `,Eu(i,`ouverte`)]})]}),!t&&r.map(t=>(0,V.jsx)(rm,{analysis:e,finding:t},t.id))]})}function tx({file:e}){return e.binary?(0,V.jsxs)(`p`,{className:`diff-message`,children:[`Fichier binaire (`,pu[e.status].toLowerCase(),`) : son contenu n'est pas affiché.`]}):e.status===`renamed`?(0,V.jsxs)(`p`,{className:`diff-message`,children:[`Fichier renommé depuis `,e.oldPath,` sans changement de contenu.`]}):(0,V.jsx)(`p`,{className:`diff-message`,children:`Aucune ligne modifiée dans ce fichier (changement de mode ou fichier vide).`})}function nx({analysis:e,file:t,onFileNote:n}){let r=B(e=>e.setFileReviewed),i=B(e=>e.saving),a=B(e=>e.filesPanelCollapsed),o=B(e=>e.setFilesPanelCollapsed),s=e.files.findIndex(e=>e.path===t.path),c=e.files[s-1],l=e.files[s+1],{folder:u,name:d}=xu(t.path);return(0,V.jsxs)(`div`,{className:`file-head`,children:[(0,V.jsx)(`button`,{type:`button`,className:`icon-button files-panel-toggle`,"aria-pressed":!a,title:a?`Afficher la liste des fichiers`:`Masquer la liste des fichiers`,onClick:()=>o(!a),children:(0,V.jsx)(H,{name:a?`panel-left-open`:`panel-left-close`,color:`#9aa1b1`})}),(0,V.jsxs)(`span`,{className:`file-head-path mono`,title:t.oldPath?`${t.oldPath} → ${t.path}`:t.path,children:[(0,V.jsx)(`span`,{className:`path-folder`,children:u}),(0,V.jsx)(`span`,{className:`file-head-name`,children:d})]}),(0,V.jsxs)(`span`,{className:`count-add mono`,children:[`+`,t.additions]}),(0,V.jsxs)(`span`,{className:`count-del mono`,children:[`−`,t.deletions]}),t.status!==`modified`&&(0,V.jsx)(`span`,{className:`tag tag-file-${t.status}`,children:pu[t.status]}),(0,V.jsx)(`span`,{className:`spacer`}),(0,V.jsxs)(`button`,{type:`button`,className:`link-button muted`,onClick:n,children:[(0,V.jsx)(H,{name:`message-square`,size:13}),`Remarque sur le fichier`]}),(0,V.jsxs)(`div`,{className:`icon-button-group`,children:[(0,V.jsx)(`button`,{type:`button`,className:`icon-button`,disabled:!c,title:c?`Fichier précédent : ${c.path}`:`Premier fichier`,onClick:()=>c&&Uu(Hu.review(e.id,c.path)),children:(0,V.jsx)(H,{name:`arrow-left`,color:`#9aa1b1`})}),(0,V.jsx)(`button`,{type:`button`,className:`icon-button`,disabled:!l,title:l?`Fichier suivant : ${l.path}`:`Dernier fichier`,onClick:()=>l&&Uu(Hu.review(e.id,l.path)),children:(0,V.jsx)(H,{name:`arrow-right`,color:`#9aa1b1`})})]}),(0,V.jsxs)(`button`,{type:`button`,className:`button button-secondary reviewed-toggle${t.reviewed?` is-on`:``}`,"aria-pressed":t.reviewed,disabled:i,onClick:()=>void r(t.path,!t.reviewed),children:[(0,V.jsx)(H,{name:`square-check`,color:t.reviewed?`#3fb950`:`#9aa1b1`}),t.reviewed?`Revu`:`Marquer comme revu`]})]})}function rx({analysis:e,path:t,line:n}){let r=B(e=>e.diff),i=B(e=>e.diffError),a=B(e=>e.fixMode),o=B(e=>e.setFixMode),s=B(e=>e.codeView),c=B(e=>e.setCodeView),l=B(e=>e.diffScope),u=B(e=>e.setDiffScope),d=B(e=>e.copy),f=B(e=>e.findingsShown),p=B(e=>e.setFindingsShown),m=B(e=>e.explanationsShown),h=B(e=>e.setExplanationsShown),g=B(e=>e.filesPanelCollapsed),_=Xb(),y=(0,v.useRef)(null),[b,x]=(0,v.useState)(null),S=b&&b.path===t?{line:b.line,findingId:b.findingId}:null,C=e=>x(e&&t!==null?{path:t,...e}:null),[ee,w]=(0,v.useState)({}),[te,T]=(0,v.useState)({}),[E,D]=(0,v.useState)(null),O=(0,v.useRef)(null),k=(0,v.useRef)(null),ne=cd(e);(0,v.useEffect)(()=>{t===null&&ne!==null&&Uu(Hu.review(e.id,ne),{replace:!0})},[t,ne,e.id]);let re=e.files.find(e=>e.path===t)??null,ie=r?.id===e.id?r.snapshot.files.find(e=>e.path===t):void 0,ae=ie!==void 0&&ie.newContent!==null,oe=ae?l:`changes`,se=(0,v.useMemo)(()=>oe===`file`&&ie?tm(ie)??void 0:ie,[oe,ie]),ce=t===null?void 0:te[t],le=(0,v.useMemo)(()=>oe===`changes`&&ie?qp(ie,ce??[]):null,[oe,ie,ce]),ue=le?.fileDiff??se,de=(e,n)=>{if(t===null||!le)return;let r=Jp(le,e,n);T(e=>({...e,[t]:r}))},fe=i!==null&&r?.id!==e.id,pe=t===null?[]:_l(e,t),me=f?pe:[],he=wl(me,ue??{path:t??``,hunks:[],newContent:null},e=>ee[e.id]??(e.suggestion!==null&&e.status===`open`),a),ge=Ol(me,he,a),_e=n===null?null:kl(n,ge),ve=_e===null?null:Tl(_e),ye=E!==null&&E.path===t&&E.line===n?E.findingId:null,be=E?.seq??0;if((0,v.useEffect)(()=>{let e=O.current;if(se&&e){if(ve===null){e.scrollTo({top:0});return}e.querySelector(ve)?.scrollIntoView({block:`center`}),ye!==null&&e.querySelector(`[data-finding-card="${CSS.escape(ye)}"]`)?.scrollIntoView({block:`nearest`})}},[se,ve,t,ye,be]),t===null)return(0,V.jsx)(`div`,{className:`page`,children:(0,V.jsx)(`p`,{className:`empty-text`,children:`L'analyse ne contient aucun fichier modifié : il n'y a rien à revoir.`})});let A=Pl(e,t),j=m?A:[],xe=ue?Ll(ue,me,he,a,j,s):[],Se=ue?vl(ue):fe?new Set:null,Ce=Ul(e,t),we=new Set(Ce.map(e=>e.location.line)),Te=(e,t)=>w(n=>({...n,[e]:t})),Ee=n=>{D(e=>({path:t,findingId:n.finding.id,line:n.startLine,seq:(e?.seq??0)+1})),Uu(Hu.review(e.id,t,n.startLine))},De=g&&re!==null;return(0,V.jsxs)(`div`,{className:`review${De?` is-files-hidden`:``}`,ref:y,style:De?void 0:{gridTemplateColumns:`${_.width}px minmax(0, 1fr)`},children:[!De&&(0,V.jsx)(Qb,{analysis:e,currentPath:t}),!De&&(0,V.jsx)($b,{width:_.width,setWidth:_.setWidth,containerRef:y}),(0,V.jsx)(`section`,{className:`review-main`,children:re===null?(0,V.jsx)(`div`,{className:`review-body review-body-padded`,children:(0,V.jsxs)(`p`,{className:`diff-message`,children:[`Le fichier « `,t,` » ne fait pas partie de cette analyse. Choisissez un fichier dans la liste.`]})}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(nx,{analysis:e,file:re,onFileNote:()=>C({line:null,findingId:null})}),(0,V.jsx)(`div`,{className:`review-body`,ref:O,children:(0,V.jsxs)(`div`,{className:`review-columns`,children:[(0,V.jsxs)(`div`,{className:`review-center`,ref:k,children:[f&&(0,V.jsx)(ex,{analysis:e}),!re.contentAvailable&&!re.binary&&re.status!==`deleted`&&(0,V.jsx)(`p`,{className:`diff-notice`,children:`Fichier trop volumineux pour être conservé en entier : les remarques ne peuvent viser que le fichier entier.`}),fe?(0,V.jsx)(`p`,{className:`diff-message is-error`,children:i}):ue?ie?.hunks.length===0?(0,V.jsx)(tx,{file:re}):(0,V.jsx)(Ab,{file:re,fileDiff:ue,hunks:xe,hunkContexts:le?.hunks??null,addedContext:le?.added??null,onContextChange:de,findings:me,notedLines:we,scrollRef:O,mode:a,onModeChange:o,codeView:s,onCodeViewChange:c,scope:oe,onScopeChange:u,wholeFileAvailable:ae,explained:j.length>0,target:_e,onLineNote:e=>C({line:e,findingId:null}),onHideFix:e=>Te(e,!1),onRequestExplanation:t=>void d($p(e,re,t),`Demande d'explication copiée : collez-la dans la conversation de l'agent.`)}):(0,V.jsx)(`p`,{className:`diff-message`,children:`Chargement du diff…`})]}),(0,V.jsx)(Wb,{analysis:e,file:re,numbered:me,explanations:j,filters:{findingCount:pe.length,explanationCount:A.length,findingsShown:f,explanationsShown:m,onFindingsShownChange:p,onExplanationsShownChange:h},fileDiff:ue??null,fixes:he,mode:a,codeView:s,removed:ge,lineNotes:Ce,shownLines:Se,composer:S,setComposer:C,onToggleFix:Te,scopeRef:k,scrollRef:O,onReveal:Ee,revealedId:ye})]})})]})})]})}function ix(e){return e.name===`feature`||e.name===`review`||e.name===`finish`?e.id:null}function ax({children:e}){return(0,V.jsx)(`div`,{className:`empty-state`,children:(0,V.jsx)(`div`,{className:`empty-card`,children:e})})}function ox(){sd();let e=Ku(),t=B(e=>e.current),n=B(e=>e.openAnalysis),r=ix(e);(0,v.useEffect)(()=>{r&&n(r)},[r,n]);let i=t&&t.id===r?t.analysis:null,a=t&&t.id===r?t.error:null,o=e.name===`review`&&i?(0,V.jsx)(`button`,{type:`button`,className:`button button-primary topbar-action`,onClick:()=>Uu(Hu.finish(i.id)),children:`Terminer la revue`}):null,s;return s=e.name===`home`?(0,V.jsx)(Up,{}):e.name===`not_found`?(0,V.jsx)(ax,{children:(0,V.jsxs)(`p`,{children:[`Adresse inconnue : `,(0,V.jsx)(`code`,{children:e.hash}),`. `,(0,V.jsx)(`a`,{href:Hu.home(),children:`Revenir à l'accueil`}),`.`]})}):a?(0,V.jsxs)(ax,{children:[(0,V.jsxs)(`p`,{className:`error-text`,children:[`Analyse illisible : `,a]}),(0,V.jsx)(`p`,{children:(0,V.jsx)(`a`,{href:Hu.home(),children:`Revenir à l'accueil`})})]}):i?e.name===`feature`?(0,V.jsx)(Np,{analysis:i,tab:e.tab}):e.name===`review`?(0,V.jsx)(rx,{analysis:i,path:e.path,line:e.line}):(0,V.jsx)(Lp,{analysis:i},i.id):(0,V.jsx)(ax,{children:(0,V.jsx)(`p`,{children:`Chargement de l'analyse…`})}),(0,V.jsxs)(`div`,{className:`app`,children:[(0,V.jsx)(rd,{currentId:r,action:o}),(0,V.jsx)(`main`,{className:`main${e.name===`review`?` main-fixed`:``}`,children:s}),(0,V.jsx)(cu,{})]})}(0,y.createRoot)(document.getElementById(`root`)).render((0,V.jsx)(v.StrictMode,{children:(0,V.jsx)(ox,{})}));export{s as t};